Browse Source

fix glDrawElements: Source and destination textures of the draw are the same.

sunag 7 years ago
parent
commit
33dc16764a
1 changed files with 5 additions and 3 deletions
  1. 5 3
      examples/webgl_mirror_nodes.html

+ 5 - 3
examples/webgl_mirror_nodes.html

@@ -227,9 +227,11 @@
 			//--
 
 			var mirrorMesh = new THREE.Mesh( planeGeo, groundMirrorMaterial );
-			mirrorMesh.add( groundMirror );
-			mirrorMesh.rotateX( - Math.PI / 2 );
-			scene.add( mirrorMesh );
+			// add all alternative mirror materials inside the ReflectorRTT to prevent:
+			// glDrawElements: Source and destination textures of the draw are the same.
+			groundMirror.add( mirrorMesh );
+			groundMirror.rotateX( - Math.PI / 2 );
+			scene.add( groundMirror );
 
 			sphereGroup = new THREE.Object3D();
 			scene.add( sphereGroup );