diff --git a/examples/js/MirrorRTT.js b/examples/js/MirrorRTT.js new file mode 100644 index 0000000000000000000000000000000000000000..5a1bfc7462a098037bba3a49987f0dd9bffc904e --- /dev/null +++ b/examples/js/MirrorRTT.js @@ -0,0 +1,9 @@ +THREE.MirrorRTT = function ( width, height, options ) { + + THREE.Mirror.call( this, width, height, options ); + + this.geometry.setDrawRange( 0, 0 ); // avoid rendering geometry + +}; + +THREE.MirrorRTT.prototype = Object.create( THREE.Mirror.prototype ); diff --git a/examples/webgl_mirror_nodes.html b/examples/webgl_mirror_nodes.html index 5762b0b537fc4b842adf58246f1aec3978b87674..12994e1309c23b107bb9f5578e8ea4d37edab7ba 100644 --- a/examples/webgl_mirror_nodes.html +++ b/examples/webgl_mirror_nodes.html @@ -37,6 +37,7 @@ + @@ -152,8 +153,7 @@ var planeGeo = new THREE.PlaneBufferGeometry( 100.1, 100.1 ); // MIRROR planes - var groundMirror = new THREE.Mirror( 100, 100, { clipBias: 0.003, textureWidth: WIDTH, textureHeight: HEIGHT } ); - groundMirror.geometry.setDrawRange( 0, 0 ); // avoid rendering geometry + var groundMirror = new THREE.MirrorRTT( 100, 100, { clipBias: 0.003, textureWidth: WIDTH, textureHeight: HEIGHT } ); var mask = new THREE.SwitchNode( new THREE.TextureNode( decalDiffuse ), 'w' ); var maskFlip = new THREE.Math1Node( mask, THREE.Math1Node.INVERT );