Skip to content

Commit

Permalink
Examples: Updated webgl_loader_lwo.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Aug 11, 2021
1 parent a1f1386 commit f4601f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 28 deletions.
Binary file modified examples/screenshots/webgl_loader_lwo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 10 additions & 28 deletions examples/webgl_loader_lwo.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,13 @@
scene = new THREE.Scene();
scene.background = new THREE.Color( 0xa0a0a0 );

const ambientLight = new THREE.AmbientLight( 0xaaaaaa, 1.75 );
const ambientLight = new THREE.AmbientLight( 0x222222 );
scene.add( ambientLight );

const light1 = new THREE.DirectionalLight( 0xffffff, 1 );
const light1 = new THREE.DirectionalLight( 0x888888 );
light1.position.set( 0, 200, 100 );
light1.castShadow = true;
light1.shadow.camera.top = 180;
light1.shadow.camera.bottom = - 100;
light1.shadow.camera.left = - 120;
light1.shadow.camera.right = 120;
scene.add( light1 );

const light2 = new THREE.DirectionalLight( 0xffffff, 0.7 );
light2.position.set( - 100, 200, - 100 );
scene.add( light2 );

const light3 = new THREE.DirectionalLight( 0xffffff, 0.4 );
light3.position.set( 100, - 200, 100 );
scene.add( light3 );

const light4 = new THREE.DirectionalLight( 0xffffff, 1 );
light4.position.set( - 100, - 100, 100 );
scene.add( light4 );

const grid = new THREE.GridHelper( 200, 20, 0x000000, 0x000000 );
grid.material.opacity = 0.3;
grid.material.transparent = true;
Expand All @@ -85,22 +68,15 @@
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.shadowMap.enabled = true;
renderer.physicallyCorrectLights = true;
renderer.gammaFactor = 1.18;
renderer.setAnimationLoop( animation );
renderer.outputEncoding = THREE.sRGBEncoding;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
container.appendChild( renderer.domElement );

const controls = new OrbitControls( camera, renderer.domElement );
controls.target.set( 1.33, 10, - 6.7 );
controls.update();

renderer.setAnimationLoop( function () {

renderer.render( scene, camera );

} );

window.addEventListener( 'resize', onWindowResize );

}
Expand All @@ -114,6 +90,12 @@

}

function animation() {

renderer.render( scene, camera );

}

</script>

</body>
Expand Down

0 comments on commit f4601f3

Please sign in to comment.