如果将纹理加载到我使用webGL在threeJS中加载的对象,我会收到以下错误:
错误:WebGL:texImage2D:选择的格式/类型包含昂贵的重新格式:0x1908 / 0x1401
有人知道为什么会这样吗?
上传纹理的代码:
var loaderA = new THREE.ImageLoader( manager );
loaderA.load('hout.jpg', function ( image ) {
texture.image = image;
texture.needsUpdate = true;
} );
var loaderB = new THREE.OBJLoader( manager );
loaderB.load('hoesjes/iphone.obj', function ( object ) {
object.traverse( function ( child ) {
if ( child instanceof THREE.Mesh ) {
//Changing color
//texture = new THREE.MeshPhongMaterial( { color: 0x686876 } );
//color.needsUpdate = true;
//texture
child.material.map = texture;
texture.needsUpdate = true;
}
} );