Skip to content

Commit b3bdd22

Browse files
authored
Examples: Remove obsolete shadow bias from WebGPU demos. (#32715)
1 parent 054e34e commit b3bdd22

19 files changed

+5
-57
lines changed

examples/webgpu_backdrop_water.html

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,6 @@
6060
camera.lookAt( 0, 1, 0 );
6161

6262
const sunLight = new THREE.DirectionalLight( 0xFFE499, 5 );
63-
sunLight.castShadow = true;
64-
sunLight.shadow.camera.near = .1;
65-
sunLight.shadow.camera.far = 5;
66-
sunLight.shadow.camera.right = 2;
67-
sunLight.shadow.camera.left = - 2;
68-
sunLight.shadow.camera.top = 1;
69-
sunLight.shadow.camera.bottom = - 2;
70-
sunLight.shadow.mapSize.width = 2048;
71-
sunLight.shadow.mapSize.height = 2048;
72-
sunLight.shadow.bias = - 0.001;
7363
sunLight.position.set( .5, 3, .5 );
7464

7565
const waterAmbientLight = new THREE.HemisphereLight( 0x333366, 0x74ccf4, 5 );
@@ -87,7 +77,6 @@
8777
loader.load( 'models/gltf/Michelle.glb', function ( gltf ) {
8878

8979
model = gltf.scene;
90-
model.children[ 0 ].children[ 0 ].castShadow = true;
9180

9281
mixer = new THREE.AnimationMixer( model );
9382

examples/webgpu_camera_array.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
const light = new THREE.DirectionalLight( 0xffffff, 3 );
6767
light.position.set( 0.5, 0.5, 1 );
6868
light.castShadow = true;
69-
light.shadow.bias = - 0.001;
7069
light.shadow.camera.zoom = 4; // tighter shadow map
7170
scene.add( light );
7271

examples/webgpu_caustics.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
spotLight.shadow.mapSize.height = 1024;
6868
spotLight.shadow.camera.near = .1;
6969
spotLight.shadow.camera.far = 1;
70-
spotLight.shadow.bias = - .003;
7170
spotLight.shadow.intensity = .95;
7271
scene.add( spotLight );
7372

examples/webgpu_clipping.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
spotLight.shadow.camera.far = 10;
6262
spotLight.shadow.mapSize.width = 2048;
6363
spotLight.shadow.mapSize.height = 2048;
64-
spotLight.shadow.bias = - 0.002;
6564
spotLight.shadow.radius = 4;
6665
scene.add( spotLight );
6766

examples/webgpu_compute_particles_rain.html

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,9 @@
6464
scene = new THREE.Scene();
6565

6666
const dirLight = new THREE.DirectionalLight( 0xffffff, .5 );
67-
dirLight.castShadow = true;
6867
dirLight.position.set( 3, 17, 17 );
69-
dirLight.castShadow = true;
70-
dirLight.shadow.camera.near = 1;
71-
dirLight.shadow.camera.far = 50;
72-
dirLight.shadow.camera.right = 25;
73-
dirLight.shadow.camera.left = - 25;
74-
dirLight.shadow.camera.top = 25;
75-
dirLight.shadow.camera.bottom = - 25;
76-
dirLight.shadow.mapSize.width = 2048;
77-
dirLight.shadow.mapSize.height = 2048;
78-
dirLight.shadow.bias = - 0.01;
79-
8068
scene.add( dirLight );
69+
8170
scene.add( new THREE.AmbientLight( 0x111111 ) );
8271

8372
//
@@ -257,7 +246,6 @@
257246
collisionBox.position.y = 12;
258247
collisionBox.scale.x = 3.5;
259248
collisionBox.layers.enable( 1 );
260-
collisionBox.castShadow = true;
261249
scene.add( collisionBox );
262250

263251
//
@@ -268,7 +256,6 @@
268256
geometry.computeVertexNormals();
269257

270258
monkey = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial( { roughness: 1, metalness: 0 } ) );
271-
monkey.receiveShadow = true;
272259
monkey.scale.setScalar( 5 );
273260
monkey.rotation.y = Math.PI / 2;
274261
monkey.position.y = 4.5;

examples/webgpu_compute_particles_snow.html

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,7 @@
6868
scene.fog = new THREE.Fog( 0x0f3c37, 5, 40 );
6969

7070
const dirLight = new THREE.DirectionalLight( 0xf9ff9b, 9 );
71-
dirLight.castShadow = true;
7271
dirLight.position.set( 10, 10, 0 );
73-
dirLight.castShadow = true;
74-
dirLight.shadow.camera.near = 1;
75-
dirLight.shadow.camera.far = 30;
76-
dirLight.shadow.camera.right = 30;
77-
dirLight.shadow.camera.left = - 30;
78-
dirLight.shadow.camera.top = 30;
79-
dirLight.shadow.camera.bottom = - 30;
80-
dirLight.shadow.mapSize.width = 2048;
81-
dirLight.shadow.mapSize.height = 2048;
82-
dirLight.shadow.bias = - 0.009;
8372
scene.add( dirLight );
8473

8574
scene.add( new THREE.HemisphereLight( 0x0f3c37, 0x080d10, 100 ) );
@@ -200,7 +189,6 @@
200189

201190
const rainParticles = new THREE.Mesh( geometry, staticMaterial );
202191
rainParticles.count = maxParticleCount;
203-
rainParticles.castShadow = true;
204192
rainParticles.layers.disableAll();
205193
rainParticles.layers.enable( layer );
206194

@@ -249,7 +237,6 @@
249237
const coneGeometry = new THREE.ConeGeometry( radius * 0.95, radius * 1.25, 32 );
250238

251239
const cone = new THREE.Mesh( coneGeometry, coneMaterial );
252-
cone.castShadow = true;
253240
cone.position.y = ( ( count - i ) * 1.5 ) + ( count * .6 );
254241
object.add( cone );
255242

examples/webgpu_instancing_morph.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@
8080
light.shadow.camera.bottom = - 5000;
8181
light.shadow.camera.far = 2000;
8282

83-
light.shadow.bias = - 0.01;
84-
8583
light.shadow.camera.updateProjectionMatrix();
8684

8785
scene.add( light );

examples/webgpu_lights_projector.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@
117117
projectorLight.shadow.camera.near = 1;
118118
projectorLight.shadow.camera.far = 10;
119119
projectorLight.shadow.focus = 1;
120-
projectorLight.shadow.bias = - .003;
121120
scene.add( projectorLight );
122121

123122
lightHelper = new THREE.SpotLightHelper( projectorLight );

examples/webgpu_lights_spotlight.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@
117117
spotLight.shadow.camera.near = 2;
118118
spotLight.shadow.camera.far = 10;
119119
spotLight.shadow.focus = 1;
120-
spotLight.shadow.bias = - .003;
121120
spotLight.shadow.intensity = 1;
122121
scene.add( spotLight );
123122

examples/webgpu_postprocessing_motion_blur.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,8 @@
6868
sunLight.shadow.camera.left = - 2;
6969
sunLight.shadow.camera.top = 2;
7070
sunLight.shadow.camera.bottom = - 2;
71-
sunLight.shadow.mapSize.width = 2048;
72-
sunLight.shadow.mapSize.height = 2048;
73-
sunLight.shadow.bias = - 0.001;
71+
sunLight.shadow.mapSize.width = 1024;
72+
sunLight.shadow.mapSize.height = 1024;
7473
sunLight.position.set( 4, 4, 2 );
7574

7675
const waterAmbientLight = new THREE.HemisphereLight( 0x333366, 0x74ccf4, 5 );

0 commit comments

Comments
 (0)