Skip to content

Commit 32c8956

Browse files
authoredFeb 7, 2018
Merge pull request #13272 from sunag/90dev-mirror-issue
mirror nodes fixes
2 parents 619d6b3 + 33dc167 commit 32c8956

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed
 

‎examples/js/objects/ReflectorRTT.js

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ THREE.ReflectorRTT = function ( geometry, options ) {
44

55
this.geometry.setDrawRange( 0, 0 ); // avoid rendering geometry
66

7+
this.renderOrder = -Infinity; // render RTT first
8+
79
};
810

911
THREE.ReflectorRTT.prototype = Object.create( THREE.Reflector.prototype );

‎examples/webgl_mirror_nodes.html

+5-3
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,11 @@
227227
//--
228228

229229
var mirrorMesh = new THREE.Mesh( planeGeo, groundMirrorMaterial );
230-
mirrorMesh.add( groundMirror );
231-
mirrorMesh.rotateX( - Math.PI / 2 );
232-
scene.add( mirrorMesh );
230+
// add all alternative mirror materials inside the ReflectorRTT to prevent:
231+
// glDrawElements: Source and destination textures of the draw are the same.
232+
groundMirror.add( mirrorMesh );
233+
groundMirror.rotateX( - Math.PI / 2 );
234+
scene.add( groundMirror );
233235

234236
sphereGroup = new THREE.Object3D();
235237
scene.add( sphereGroup );

0 commit comments

Comments
 (0)
Please sign in to comment.