Skip to content

Commit

Permalink
Examples: Improved webgl_lights_spotlight.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Aug 30, 2022
1 parent 979f4c5 commit 599e0e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Binary file modified examples/screenshots/webgl_lights_spotlight.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions examples/webgl_lights_spotlight.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,13 @@
const texture = loader.load( filename );
texture.minFilter = THREE.LinearFilter;
texture.magFilter = THREE.LinearFilter;
texture.encoding = THREE.sRGBEncoding;

textures[ filename ] = texture;

}

spotLight = new THREE.SpotLight( 0xffffff, 1.75 );
spotLight = new THREE.SpotLight( 0xffffff, 10 );
spotLight.position.set( 25, 50, 25 );
spotLight.angle = Math.PI / 6;
spotLight.penumbra = 1;
Expand Down Expand Up @@ -113,7 +114,7 @@

const mesh = new THREE.Mesh( geometry, material );
mesh.position.set( 0, - 1, 0 );
mesh.rotation.x = - Math.PI * 0.5;
mesh.rotation.x = - Math.PI / 2;
mesh.receiveShadow = true;
scene.add( mesh );

Expand Down Expand Up @@ -165,7 +166,7 @@

} );

gui.add( params, 'intensity', 0, 3 ).onChange( function ( val ) {
gui.add( params, 'intensity', 0, 10 ).onChange( function ( val ) {

spotLight.intensity = val;

Expand Down

0 comments on commit 599e0e2

Please sign in to comment.