我刚从r65切换到r68 of three.js,在使用FXAA后处理着色器时,浏览器控制台中出现了这个错误:
THREE.WebGLProgram: gl.getProgramInfoLog()警告:顶点着色器'vUv‘的输出不被片段着色器读取。three.js:25545
我用r65尝试了相同的代码,但是错误没有发生。Shader看起来工作正常,但我不喜欢在控制台中出现错误。以下是有关守则:
// COMPOSER
this.renderTargetScene = new THREE.WebGLRenderTarget( this.width, this.height );
this.renderTargetScene.minFilter = THREE.LinearFilter;
this.renderTargetScene.magFilter = THREE.LinearFilter;
this.renderTargetScene.format = THREE.RGBAFormat;
this.renderTargetScene.stencilBuffer = true;
this.sceneComposer = new THREE.EffectComposer( this.renderer, this.renderTargetScene );
this.sceneCubeUnderPass = new THREE.RenderPass( this.sceneCube, this.cameraCube );
this.sceneCubeUnderPass.renderToScreen = false;
this.scenePass = new THREE.RenderPass( this.scene, this.camera );
this.scenePass.renderToScreen = false;
this.scenePass.clear = false;
this.effectFXAA = new THREE.ShaderPass( THREE.FXAAShader );
this.effectFXAA.uniforms.resolution.value = new THREE.Vector2( 1 / window.innerWidth, 1 / window.innerHeight );
this.effectCopy = new THREE.ShaderPass( THREE.CopyShader );
this.effectCopy.renderToScreen = true;
this.sceneComposer.addPass( this.sceneCubeUnderPass );
this.sceneComposer.addPass( this.scenePass );
this.sceneComposer.addPass( this.effectFXAA );
this.sceneComposer.addPass( this.effectCopy );
onWindowResize: function() {
this.width = window.innerWidth;
this.height = window.innerHeight;
iss.windowHalfX = this.width / 2;
iss.windowHalfY = this.height / 2;
iss.camera.aspect = this.width / this.height;
iss.camera.updateProjectionMatrix();
iss.cameraCube.aspect = this.width / this.height;
iss.cameraCube.updateProjectionMatrix();
iss.renderer.setSize( this.width, this.height );
iss.effectFXAA.uniforms[ 'resolution' ].value.set(1 / ( this.width ), 1 / ( this.height ));
iss.sceneComposer.setSize( this.width, this.height );
},
render: function(){
var timer = -0.0002 * Date.now();
iss.cameraCube.rotation.copy( iss.camera.rotation );
iss.sceneComposer.render( 0.1 );
},任何帮助都将不胜感激。
发布于 2014-08-20 22:26:18
这只是一个警告。
您可以通过编辑examples/js/shaders/FXAAShader.js和removong引用vUv的所有行来修复它,因为不使用这种变化。
three.js r.68号
https://stackoverflow.com/questions/25415300
复制相似问题