Having trouble with loading a gltf model, currently when loaded it appears entirely black and I'm receiving the following error message in my console:
[.WebGL-0x7f8f03050e00]GL ERROR :GL_INVALID_ENUM : glTexParameteri: param was GL_CLOSE_PATH_NV
This issue is occurring with multiple models, even when switching to the webgl2 renderer which renders the model without a texture, I still encounter the same error.
Here is my code snippet:
var loader = new THREE.GLTFLoader();
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );
loader.load('models/scene.gltf', function(gltf) {
gltf.scene.traverse( function ( child ) {
if ( child.isMesh ) {
console.log(child.material);
}
} );
scene.add(gltf.scene);
}, undefined, function(error) {
console.error(error)
});
var canvas = document.createElement('canvas');
var context = canvas.getContext('webgl2');
var renderer = new THREE.WebGLRenderer({canvas: canvas, context: context});
renderer.gammaOutput = true;
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
camera.position.z = 5;
function animate() {
requestAnimationFrame( animate );
renderer.render( scene, camera );
}
animate();