Przeglądaj źródła

Use TwoPassDoubleSide (#25175)

WestLangley 2 lat temu
rodzic
commit
32d2fc31a9
1 zmienionych plików z 3 dodań i 11 usunięć
  1. 3 11
      examples/webgl_geometry_convex.html

+ 3 - 11
examples/webgl_geometry_convex.html

@@ -102,12 +102,10 @@
 				}
 				}
 
 
 				const pointsMaterial = new THREE.PointsMaterial( {
 				const pointsMaterial = new THREE.PointsMaterial( {
-
 					color: 0x0080ff,
 					color: 0x0080ff,
 					map: texture,
 					map: texture,
 					size: 1,
 					size: 1,
 					alphaTest: 0.5
 					alphaTest: 0.5
-
 				} );
 				} );
 
 
 				const pointsGeometry = new THREE.BufferGeometry().setFromPoints( vertices );
 				const pointsGeometry = new THREE.BufferGeometry().setFromPoints( vertices );
@@ -120,20 +118,14 @@
 				const meshMaterial = new THREE.MeshLambertMaterial( {
 				const meshMaterial = new THREE.MeshLambertMaterial( {
 					color: 0xffffff,
 					color: 0xffffff,
 					opacity: 0.5,
 					opacity: 0.5,
+					side: THREE.TwoPassDoubleSide,
 					transparent: true
 					transparent: true
 				} );
 				} );
 
 
 				const meshGeometry = new ConvexGeometry( vertices );
 				const meshGeometry = new ConvexGeometry( vertices );
 
 
-				const mesh1 = new THREE.Mesh( meshGeometry, meshMaterial );
-				mesh1.material.side = THREE.BackSide; // back faces
-				mesh1.renderOrder = 0;
-				group.add( mesh1 );
-
-				const mesh2 = new THREE.Mesh( meshGeometry, meshMaterial.clone() );
-				mesh2.material.side = THREE.FrontSide; // front faces
-				mesh2.renderOrder = 1;
-				group.add( mesh2 );
+				const mesh = new THREE.Mesh( meshGeometry, meshMaterial );
+				group.add( mesh );
 
 
 				//
 				//