Skip to content

Commit

Permalink
Docs: Simplified light setup in material browser.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Mar 24, 2021
1 parent 5a51f73 commit f9a3638
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions docs/scenes/material-browser.html
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,8 @@

// only use a single point light

lights[ 0 ].visible = false;
lights[ 2 ].visible = false;
light1.visible = false;
light3.visible = false;

return material;

Expand Down Expand Up @@ -718,18 +718,17 @@
const ambientLight = new THREE.AmbientLight( 0x000000 );
scene.add( ambientLight );

const lights = [];
lights[ 0 ] = new THREE.PointLight( 0xffffff, 1, 0 );
lights[ 1 ] = new THREE.PointLight( 0xffffff, 1, 0 );
lights[ 2 ] = new THREE.PointLight( 0xffffff, 1, 0 );
const light1 = new THREE.PointLight( 0xffffff, 1, 0 );
light1.position.set( 0, 200, 0 );
scene.add( light1 );

lights[ 0 ].position.set( 0, 200, 0 );
lights[ 1 ].position.set( 100, 200, 100 );
lights[ 2 ].position.set( - 100, - 200, - 100 );
const light2 = new THREE.PointLight( 0xffffff, 1, 0 );
light2.position.set( 100, 200, 100 );
scene.add( light2 );

scene.add( lights[ 0 ] );
scene.add( lights[ 1 ] );
scene.add( lights[ 2 ] );
const light3 = new THREE.PointLight( 0xffffff, 1, 0 );
light3.position.set( - 100, - 200, - 100 );
scene.add( light3 );

guiScene( gui, scene, camera );

Expand Down

0 comments on commit f9a3638

Please sign in to comment.