فهرست منبع

Examples: Clean up `webgpu_camera.html` (#31594)

* Clean up

* Update screenshot
WestLangley 5 ماه پیش
والد
کامیت
8722ea5455
2فایلهای تغییر یافته به همراه3 افزوده شده و 7 حذف شده
  1. BIN
      examples/screenshots/webgpu_camera.jpg
  2. 3 7
      examples/webgpu_camera.html

BIN
examples/screenshots/webgpu_camera.jpg


+ 3 - 7
examples/webgpu_camera.html

@@ -124,7 +124,7 @@
 
 				geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) );
 
-				const particles = new THREE.Points( geometry, new THREE.PointsMaterial( { color: 0x888888 } ) );
+				const particles = new THREE.Points( geometry, new THREE.PointsMaterial( { color: 0xffffff } ) );
 				scene.add( particles );
 
 				//
@@ -136,7 +136,6 @@
 				container.appendChild( renderer.domElement );
 
 				renderer.setScissorTest( true );
-				backgroundNode = color( 0x111111 );
 				renderer.setClearColor( 0x000000, 1 );
 
 				//
@@ -243,21 +242,18 @@
 
 				activeHelper.visible = false;
 
-				renderer.autoClear = true;
-
+				renderer.setClearColor( 0x000000, 1 );
 				renderer.setScissor( 0, 0, SCREEN_WIDTH / 2, SCREEN_HEIGHT );
 				renderer.setViewport( 0, 0, SCREEN_WIDTH / 2, SCREEN_HEIGHT );
-				scene.backgroundNode = null;
 				renderer.render( scene, activeCamera );
 
 				//
 
 				activeHelper.visible = true;
 
+				renderer.setClearColor( 0x111111, 1 );
 				renderer.setScissor( SCREEN_WIDTH / 2, 0, SCREEN_WIDTH / 2, SCREEN_HEIGHT );
 				renderer.setViewport( SCREEN_WIDTH / 2, 0, SCREEN_WIDTH / 2, SCREEN_HEIGHT );
-				renderer.autoClear = false;
-				scene.backgroundNode = backgroundNode;
 				renderer.render( scene, camera );
 
 			}

粤ICP备19079148号