我有一个名为“material”的MeshPhongMaterial,如下所示:
var material = new THREE.MeshPhongMaterial({
map: THREE.ImageUtils.loadTexture('assets/images/8k-earth-diffuse.jpg'),
normalMap: THREE.ImageUtils.loadTexture('assets/images/8k-earth-normal.jpg'),
normalScale: (0.1, 0.1),
specularMap: THREE.ImageUtils.loadTexture('assets/images/8k-earth-spec.png'),
specular: new THREE.Color('grey')
});
所有的东西都可以正常工作,包括地图和normalMap。问题在于,当我尝试添加一个normalScale
属性时,它会抛出以下错误:
Uncaught TypeError: Failed to execute 'uniform2fv' on 'WebGLRenderingContext': No function was found that matched the signature provided.
我之前使用过normalScale
,并且在正确的语法下一直能够正常工作,但最近出现了问题。没有使用normalScale
时一切正常。我正在使用77版本。我的问题是为什么会出现这种情况以及造成这个错误的原因是什么?我怎样才能在不引起three.js错误的情况下使用normalScale
?我使用Chrome DevTools获取了在three.js源代码中引发错误的行。
if ( v.x === undefined ) gl.uniform2fv( this.addr, v );