为Effect Composer创建GodRays效果传递

时间:2015-04-10 16:05:24

标签: javascript three.js

我试图将神射线演示代码移动到效果传递中以在效果编辑器中使用,以便更容易与其他后期处理效果一起使用。 效果的渲染功能虽然没有被调用...

我以下列格式创建传递:

THREE.GodRaysPass = function ( width, height, camera, renderer, scene) {

//setup code};

THREE.GodRaysPass.prototype = {

render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {

//render code

}};

初始化:

this.composer = new THREE.EffectComposer( this.renderer );
    var effectGodRays = new THREE.GodRaysPass(this.width, this.height, this.camera, this.renderer, this.scene);
    this.composer.addPass( effectGodRays );

1 个答案:

答案 0 :(得分:0)

EffectComposer检查'已启用'渲染前的属性。切换到true: - )