Browse Source

Examples: Clean up. (#26962)

Michael Herzog 1 year ago
parent
commit
30b6736405
2 changed files with 4 additions and 7 deletions
  1. 3 4
      examples/webgl_loader_gltf.html
  2. 1 3
      examples/webgl_loader_gltf_transmission.html

+ 3 - 4
examples/webgl_loader_gltf.html

@@ -35,7 +35,6 @@
 			let camera, scene, renderer;
 
 			init();
-			render();
 
 			function init() {
 
@@ -63,12 +62,12 @@
 						const loader = new GLTFLoader().setPath( 'models/gltf/DamagedHelmet/glTF/' );
 						loader.load( 'DamagedHelmet.gltf', async function ( gltf ) {
 
-							await renderer.compileAsync( gltf.scene, camera );
-
 							scene.add( gltf.scene );
 
-							render();
+							await renderer.compileAsync( scene, camera );
 
+							render();
+			
 						} );
 
 					} );

+ 1 - 3
examples/webgl_loader_gltf_transmission.html

@@ -65,13 +65,11 @@
 						new GLTFLoader()
 							.setPath( 'models/gltf/' )
 							.setDRACOLoader( new DRACOLoader().setDecoderPath( 'jsm/libs/draco/gltf/' ) )
-							.load( 'IridescentDishWithOlives.glb', async function ( gltf ) {
+							.load( 'IridescentDishWithOlives.glb', function ( gltf ) {
 
 								mixer = new THREE.AnimationMixer( gltf.scene );
 								mixer.clipAction( gltf.animations[ 0 ] ).play();
 
-								await renderer.compileAsync( gltf.scene, camera );
-
 								scene.add( gltf.scene );
 
 							} );