【问题标题】:Post processing Three JS后处理三个JS
【发布时间】:2015-04-24 06:42:35
【问题描述】:

三个js后处理有问题。我选择了glitchpass效果。所以我导入了所有的库等,但效果不起作用。什么也没发生,但控制台中没有错误。

 this.renderer = renderer;
    this.composer = new THREE.EffectComposer( renderer );
    this.composer.addPass( new THREE.RenderPass( this, camera ) );

    this.glitchPass = new THREE.GlitchPass();
    this.glitchPass.renderToScreen = true;
   // this.giltchPass.goWild = true;
    this.composer.addPass( this.glitchPass );

还有动画循环:

  this.composer.render();

我不知道为什么代码不起作用。所以我将相同的代码直接放入一个html文件(test.html)

这是相同的代码,但可以工作(没有继承和 this)。

你有什么想法吗?

谢谢

【问题讨论】:

    标签: javascript three.js post-processing


    【解决方案1】:

    这行代码:

    this.composer.addPass( new THREE.RenderPass( this, camera ) );
    

    应该是:

    this.composer.addPass( new THREE.RenderPass( scene, camera ) );
    

    【讨论】:

    • 我忘了准确地说,我的类继承自 THREE.scene ,为此我这样做了
    猜你喜欢
    • 2021-02-20
    • 2017-10-26
    • 1970-01-01
    • 2013-05-21
    • 1970-01-01
    • 2015-06-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多