Przeglądaj źródła

Examples: Add sky to scene. (#33037)

Michael Herzog 2 dni temu
rodzic
commit
e26ff19e99
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      examples/webgl_animation_keyframes.html

+ 2 - 1
examples/webgl_animation_keyframes.html

@@ -68,6 +68,8 @@
 			// Sky
 			// Sky
 
 
 			const sky = new Sky();
 			const sky = new Sky();
+			sky.scale.setScalar( 10000 );
+			scene.add( sky );
 
 
 			const uniforms = sky.material.uniforms;
 			const uniforms = sky.material.uniforms;
 			uniforms[ 'turbidity' ].value = 0;
 			uniforms[ 'turbidity' ].value = 0;
@@ -78,7 +80,6 @@
 
 
 			const pmremGenerator = new THREE.PMREMGenerator( renderer );
 			const pmremGenerator = new THREE.PMREMGenerator( renderer );
 			const environment = pmremGenerator.fromScene( sky ).texture;
 			const environment = pmremGenerator.fromScene( sky ).texture;
-			scene.background = environment;
 			scene.environment = environment;
 			scene.environment = environment;
 
 
 			const camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 100 );
 			const camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 100 );

粤ICP备19079148号