首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >three.js - FXAA在从r65更新到r68时出现错误

three.js - FXAA在从r65更新到r68时出现错误
EN

Stack Overflow用户
提问于 2014-08-20 22:11:44
回答 1查看 456关注 0票数 1

我刚从r65切换到r68 of three.js,在使用FXAA后处理着色器时,浏览器控制台中出现了这个错误:

THREE.WebGLProgram: gl.getProgramInfoLog()警告:顶点着色器'vUv‘的输出不被片段着色器读取。three.js:25545

我用r65尝试了相同的代码,但是错误没有发生。Shader看起来工作正常,但我不喜欢在控制台中出现错误。以下是有关守则:

代码语言:javascript
复制
// 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 );

},

任何帮助都将不胜感激。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-08-20 22:26:18

这只是一个警告。

您可以通过编辑examples/js/shaders/FXAAShader.js和removong引用vUv的所有行来修复它,因为不使用这种变化。

three.js r.68号

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25415300

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档