|
@@ -48,6 +48,9 @@ THREE.EffectComposer.prototype = {
|
|
|
|
|
|
this.passes.push( pass );
|
|
|
|
|
|
+ var size = this.renderer.getSize();
|
|
|
+ pass.setSize( size.width, size.height );
|
|
|
+
|
|
|
},
|
|
|
|
|
|
insertPass: function ( pass, index ) {
|
|
@@ -131,6 +134,12 @@ THREE.EffectComposer.prototype = {
|
|
|
this.renderTarget1.setSize( width, height );
|
|
|
this.renderTarget2.setSize( width, height );
|
|
|
|
|
|
+ for ( var i = 0; i < this.passes.length; i ++ ) {
|
|
|
+
|
|
|
+ this.passes[i].setSize( width, height );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
};
|
|
@@ -138,28 +147,30 @@ THREE.EffectComposer.prototype = {
|
|
|
|
|
|
THREE.Pass = function () {
|
|
|
|
|
|
- // if set to true, the pass is processed by the composer
|
|
|
- this.enabled = true;
|
|
|
+ // if set to true, the pass is processed by the composer
|
|
|
+ this.enabled = true;
|
|
|
|
|
|
- // if set to true, the pass indicates to swap read and write buffer after rendering
|
|
|
- this.needsSwap = true;
|
|
|
+ // if set to true, the pass indicates to swap read and write buffer after rendering
|
|
|
+ this.needsSwap = true;
|
|
|
|
|
|
- // if set to true, the pass clears its buffer before rendering
|
|
|
- this.clear = false;
|
|
|
+ // if set to true, the pass clears its buffer before rendering
|
|
|
+ this.clear = false;
|
|
|
|
|
|
- // if set to true, the result of the pass is rendered to screen
|
|
|
- this.renderToScreen = false;
|
|
|
+ // if set to true, the result of the pass is rendered to screen
|
|
|
+ this.renderToScreen = false;
|
|
|
|
|
|
};
|
|
|
|
|
|
THREE.Pass.prototype = {
|
|
|
|
|
|
- constructor: THREE.Pass,
|
|
|
+ constructor: THREE.Pass,
|
|
|
+
|
|
|
+ setSize: function( width, height ) {},
|
|
|
|
|
|
- render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
|
|
|
+ render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
|
|
|
|
|
|
console.error( "THREE.Pass: .render() must be implemented in derived pass." );
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
};
|