Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples: More usage of useLegacyLights=false. #26284

Merged
merged 2 commits into from
Jun 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file modified examples/screenshots/webgl_postprocessing.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_postprocessing_3dlut.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_postprocessing_advanced.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_postprocessing_afterimage.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_postprocessing_backgrounds.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_postprocessing_dof.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_postprocessing_dof2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_postprocessing_fxaa.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_postprocessing_glitch.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_postprocessing_godrays.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_postprocessing_masking.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_postprocessing_outline.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_postprocessing_pixel.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_postprocessing_rgb_halftone.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_postprocessing_sao.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_postprocessing_smaa.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_postprocessing_sobel.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_postprocessing_ssaa.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_postprocessing_ssao.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_postprocessing_ssr.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_postprocessing_unreal_bloom.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_raycaster_bvh.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_read_float_buffer.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_rtt.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions examples/webgl_postprocessing.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.useLegacyLights = false;
document.body.appendChild( renderer.domElement );

//
Expand Down Expand Up @@ -71,9 +72,9 @@

}

scene.add( new THREE.AmbientLight( 0x666666 ) );
scene.add( new THREE.AmbientLight( 0xcccccc ) );

const light = new THREE.DirectionalLight( 0xffffff );
const light = new THREE.DirectionalLight( 0xffffff, 3 );
light.position.set( 1, 1, 1 );
scene.add( light );

Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_3dlut.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.useLegacyLights = false;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1;
container.appendChild( renderer.domElement );
Expand Down
3 changes: 2 additions & 1 deletion examples/webgl_postprocessing_advanced.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@

//

directionalLight = new THREE.DirectionalLight( 0xffffff );
directionalLight = new THREE.DirectionalLight( 0xffffff, 3 );
directionalLight.position.set( 0, - 0.1, 1 ).normalize();
sceneModel.add( directionalLight );

Expand Down Expand Up @@ -131,6 +131,7 @@
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( width, height );
renderer.useLegacyLights = false;
renderer.autoClear = false;

//
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_afterimage.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.useLegacyLights = false;
document.body.appendChild( renderer.domElement );

camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 1000 );
Expand Down
25 changes: 13 additions & 12 deletions examples/webgl_postprocessing_backgrounds.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( devicePixelRatio );
renderer.setSize( width, height );
renderer.useLegacyLights = false;
document.body.appendChild( renderer.domElement );

stats = new Stats();
Expand All @@ -116,22 +117,22 @@
const group = new THREE.Group();
scene.add( group );

const light = new THREE.PointLight( 0xddffdd, 1.0 );
light.position.z = 70;
light.position.y = - 70;
light.position.x = - 70;
const light = new THREE.PointLight( 0xefffef, 500 );
light.position.z = 10;
light.position.y = - 10;
light.position.x = - 10;
scene.add( light );

const light2 = new THREE.PointLight( 0xffdddd, 1.0 );
light2.position.z = 70;
light2.position.x = - 70;
light2.position.y = 70;
const light2 = new THREE.PointLight( 0xffefef, 500 );
light2.position.z = 10;
light2.position.x = - 10;
light2.position.y = 10;
scene.add( light2 );

const light3 = new THREE.PointLight( 0xddddff, 1.0 );
light3.position.z = 70;
light3.position.x = 70;
light3.position.y = - 70;
const light3 = new THREE.PointLight( 0xefefff, 500 );
light3.position.z = 10;
light3.position.x = 10;
light3.position.y = - 10;
scene.add( light3 );

const geometry = new THREE.SphereGeometry( 1, 48, 24 );
Expand Down
20 changes: 10 additions & 10 deletions examples/webgl_postprocessing_crossfade.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,20 @@

for ( let i = 0; i < count; i ++ ) {

dummy.position.x = Math.random() * 10000 - 5000;
dummy.position.y = Math.random() * 6000 - 3000;
dummy.position.z = Math.random() * 8000 - 4000;
dummy.position.x = Math.random() * 100 - 50;
dummy.position.y = Math.random() * 60 - 30;
dummy.position.z = Math.random() * 80 - 40;

dummy.rotation.x = Math.random() * 2 * Math.PI;
dummy.rotation.y = Math.random() * 2 * Math.PI;
dummy.rotation.z = Math.random() * 2 * Math.PI;

dummy.scale.x = Math.random() * 200 + 100;
dummy.scale.x = Math.random() * 2 + 1;

if ( geometry.type === 'BoxGeometry' ) {

dummy.scale.y = Math.random() * 200 + 100;
dummy.scale.z = Math.random() * 200 + 100;
dummy.scale.y = Math.random() * 2 + 1;
dummy.scale.z = Math.random() * 2 + 1;

} else {

Expand All @@ -168,15 +168,15 @@

this.clearColor = clearColor;

const camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 1, 10000 );
camera.position.z = 2000;
const camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 0.1, 100 );
camera.position.z = 20;

// Setup scene
const scene = new THREE.Scene();
scene.add( new THREE.AmbientLight( 0x555555 ) );
scene.add( new THREE.AmbientLight( 0xaaaaaa ) );

const light = new THREE.SpotLight( 0xffffff, 1.5 );
light.position.set( 0, 500, 2000 );
light.position.set( 0, 5, 20 );
scene.add( light );

this.rotationSpeed = rotationSpeed;
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_dof.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( width, height );
renderer.useLegacyLights = false;
container.appendChild( renderer.domElement );

const path = 'textures/cube/SwedishRoyalCastle/';
Expand Down
7 changes: 4 additions & 3 deletions examples/webgl_postprocessing_dof2.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.useLegacyLights = false;
renderer.autoClear = false;
container.appendChild( renderer.domElement );

Expand Down Expand Up @@ -190,13 +191,13 @@

// lights

scene.add( new THREE.AmbientLight( 0x666666 ) );
scene.add( new THREE.AmbientLight( 0xcccccc ) );

const directionalLight1 = new THREE.DirectionalLight( 0xffffff, 2 );
const directionalLight1 = new THREE.DirectionalLight( 0xffffff, 6 );
directionalLight1.position.set( 2, 1.2, 10 ).normalize();
scene.add( directionalLight1 );

const directionalLight2 = new THREE.DirectionalLight( 0xffffff, 1 );
const directionalLight2 = new THREE.DirectionalLight( 0xffffff, 3 );
directionalLight2.position.set( - 2, 1.2, - 10 ).normalize();
scene.add( directionalLight2 );

Expand Down
7 changes: 4 additions & 3 deletions examples/webgl_postprocessing_fxaa.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@

//

const hemiLight = new THREE.HemisphereLight( 0xffffff, 0x8d8d8d );
const hemiLight = new THREE.HemisphereLight( 0xffffff, 0x8d8d8d, 3 );
hemiLight.position.set( 0, 1000, 0 );
scene.add( hemiLight );

const dirLight = new THREE.DirectionalLight( 0xffffff, 0.8 );
const dirLight = new THREE.DirectionalLight( 0xffffff, 2.5 );
dirLight.position.set( - 3000, 1000, - 1000 );
scene.add( dirLight );

Expand Down Expand Up @@ -114,9 +114,10 @@
//

renderer = new THREE.WebGLRenderer();
renderer.autoClear = false;
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( container.offsetWidth, container.offsetHeight );
renderer.useLegacyLights = false;
renderer.autoClear = false;
container.appendChild( renderer.domElement );

//
Expand Down
5 changes: 3 additions & 2 deletions examples/webgl_postprocessing_glitch.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ <h2>WARNING</h2>
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.useLegacyLights = false;
document.body.appendChild( renderer.domElement );

//
Expand Down Expand Up @@ -98,9 +99,9 @@ <h2>WARNING</h2>

}

scene.add( new THREE.AmbientLight( 0x666666 ) );
scene.add( new THREE.AmbientLight( 0xcccccc ) );

light = new THREE.DirectionalLight( 0xffffff );
light = new THREE.DirectionalLight( 0xffffff, 3 );
light.position.set( 1, 1, 1 );
scene.add( light );

Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_godrays.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
renderer.setClearColor( 0xffffff );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.useLegacyLights = false;
container.appendChild( renderer.domElement );

renderer.autoClear = false;
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_masking.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
renderer.setClearColor( 0xe0e0e0 );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.useLegacyLights = false;
renderer.autoClear = false;
document.body.appendChild( renderer.domElement );

Expand Down
5 changes: 3 additions & 2 deletions examples/webgl_postprocessing_outline.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
const height = window.innerHeight;

renderer = new THREE.WebGLRenderer();
renderer.useLegacyLights = false;
renderer.shadowMap.enabled = true;
// todo - support pixelRatio in this demo
renderer.setSize( width, height );
Expand All @@ -149,9 +150,9 @@

//

scene.add( new THREE.AmbientLight( 0xaaaaaa, 0.2 ) );
scene.add( new THREE.AmbientLight( 0xaaaaaa, 0.6 ) );

const light = new THREE.DirectionalLight( 0xddffdd, 0.6 );
const light = new THREE.DirectionalLight( 0xddffdd, 2 );
light.position.set( 1, 1, 1 );
light.castShadow = true;
light.shadow.mapSize.width = 1024;
Expand Down
7 changes: 4 additions & 3 deletions examples/webgl_postprocessing_pixel.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
renderer.shadowMap.enabled = true;
//renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.useLegacyLights = false;
document.body.appendChild( renderer.domElement );

composer = new EffectComposer( renderer );
Expand Down Expand Up @@ -144,15 +145,15 @@

// lights

scene.add( new THREE.AmbientLight( 0x757f8e ) );
scene.add( new THREE.AmbientLight( 0x757f8e, 3 ) );

const directionalLight = new THREE.DirectionalLight( 0xfffecd, .5 );
const directionalLight = new THREE.DirectionalLight( 0xfffecd, 1.5 );
directionalLight.position.set( 100, 100, 100 );
directionalLight.castShadow = true;
directionalLight.shadow.mapSize.set( 2048, 2048 );
scene.add( directionalLight );

const spotLight = new THREE.SpotLight( 0xffc100, 1, 10, Math.PI / 16, .02, 2 );
const spotLight = new THREE.SpotLight( 0xffc100, 10, 10, Math.PI / 16, .02, 2 );
spotLight.position.set( 2, 2, 0 );
const target = spotLight.target;
scene.add( target );
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_procedural.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.useLegacyLights = false;
document.body.appendChild( renderer.domElement );

stats = new Stats();
Expand Down
3 changes: 2 additions & 1 deletion examples/webgl_postprocessing_rgb_halftone.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.useLegacyLights = false;

clock = new THREE.Clock();

Expand All @@ -75,7 +76,7 @@
group = new THREE.Group();
const floor = new THREE.Mesh( new THREE.BoxGeometry( 100, 1, 100 ), new THREE.MeshPhongMaterial( {} ) );
floor.position.y = - 10;
const light = new THREE.PointLight( 0xffffff, 1.0, 50, 2 );
const light = new THREE.PointLight( 0xffffff, 250 );
light.position.y = 2;
group.add( floor, light );
scene.add( group );
Expand Down
27 changes: 14 additions & 13 deletions examples/webgl_postprocessing_sao.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
renderer.setClearColor( 0x000000 );
renderer.setPixelRatio( devicePixelRatio );
renderer.setSize( width, height );
renderer.useLegacyLights = false;
document.body.appendChild( renderer.domElement );

camera = new THREE.PerspectiveCamera( 65, width / height, 3, 10 );
Expand All @@ -68,25 +69,25 @@
group = new THREE.Object3D();
scene.add( group );

const light = new THREE.PointLight( 0xefffef, 0.8 );
light.position.z = 70;
light.position.y = - 70;
light.position.x = - 70;
const light = new THREE.PointLight( 0xefffef, 500 );
light.position.z = 10;
light.position.y = - 10;
light.position.x = - 10;
scene.add( light );

const light2 = new THREE.PointLight( 0xffefef, 0.8 );
light2.position.z = 70;
light2.position.x = - 70;
light2.position.y = 70;
const light2 = new THREE.PointLight( 0xffefef, 500 );
light2.position.z = 10;
light2.position.x = - 10;
light2.position.y = 10;
scene.add( light2 );

const light3 = new THREE.PointLight( 0xefefff, 0.8 );
light3.position.z = 70;
light3.position.x = 70;
light3.position.y = - 70;
const light3 = new THREE.PointLight( 0xefefff, 500 );
light3.position.z = 10;
light3.position.x = 10;
light3.position.y = - 10;
scene.add( light3 );

const light4 = new THREE.AmbientLight( 0xffffff, 0.05 );
const light4 = new THREE.AmbientLight( 0xffffff, 0.2 );
scene.add( light4 );

const geometry = new THREE.SphereGeometry( 3, 48, 24 );
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_postprocessing_smaa.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.useLegacyLights = false;
document.body.appendChild( renderer.domElement );

stats = new Stats();
Expand Down