Skip to content

Commit f8b2cba

Browse files
authored
Examples: Clean up. (#31898)
1 parent 2c8c137 commit f8b2cba

File tree

3 files changed

+41
-41
lines changed

3 files changed

+41
-41
lines changed
-535 KB
Binary file not shown.
-37.7 KB
Loading

examples/webgpu_postprocessing_ssgi.html

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -119,89 +119,89 @@
119119
// Cornell Box inspired scene
120120

121121
// Walls
122-
const wallGeometry = new THREE.PlaneGeometry(1, 1);
123-
122+
const wallGeometry = new THREE.PlaneGeometry( 1, 1 );
123+
124124
// Left wall - red
125-
const redWallMaterial = new THREE.MeshPhysicalMaterial({ color: "#ff0000" });
126-
const leftWall = new THREE.Mesh(wallGeometry, redWallMaterial);
125+
const redWallMaterial = new THREE.MeshPhysicalMaterial( { color: '#ff0000' } );
126+
const leftWall = new THREE.Mesh( wallGeometry, redWallMaterial );
127127
leftWall.scale.set( 20, 15, 1 );
128128
leftWall.rotation.y = Math.PI * 0.5;
129-
leftWall.position.set(-10, 7.5, 0);
129+
leftWall.position.set( - 10, 7.5, 0 );
130130
leftWall.receiveShadow = true;
131-
scene.add(leftWall);
131+
scene.add( leftWall );
132132

133133
// Right wall - green
134-
const greenWallMaterial = new THREE.MeshPhysicalMaterial({ color: "#00ff00" });
135-
const rightWall = new THREE.Mesh(wallGeometry, greenWallMaterial);
134+
const greenWallMaterial = new THREE.MeshPhysicalMaterial( { color: '#00ff00' } );
135+
const rightWall = new THREE.Mesh( wallGeometry, greenWallMaterial );
136136
rightWall.scale.set( 20, 15, 1 );
137-
rightWall.rotation.y = Math.PI * -0.5;
138-
rightWall.position.set(10, 7.5, 0);
137+
rightWall.rotation.y = Math.PI * - 0.5;
138+
rightWall.position.set( 10, 7.5, 0 );
139139
rightWall.receiveShadow = true;
140-
scene.add(rightWall);
140+
scene.add( rightWall );
141141

142142
// White walls and boxes
143-
const whiteMaterial = new THREE.MeshPhysicalMaterial({ color: "#fff" });
144-
143+
const whiteMaterial = new THREE.MeshPhysicalMaterial( { color: '#fff' } );
144+
145145
// Floor
146-
const floor = new THREE.Mesh(wallGeometry, whiteMaterial);
146+
const floor = new THREE.Mesh( wallGeometry, whiteMaterial );
147147
floor.scale.set( 20, 20, 1 );
148-
floor.rotation.x = Math.PI * -.5;
148+
floor.rotation.x = Math.PI * - .5;
149149
floor.receiveShadow = true;
150-
scene.add(floor);
150+
scene.add( floor );
151151

152152
// Back wall
153-
const backWall = new THREE.Mesh(wallGeometry, whiteMaterial);
153+
const backWall = new THREE.Mesh( wallGeometry, whiteMaterial );
154154
backWall.scale.set( 15, 20, 1 );
155-
backWall.rotation.z = Math.PI * -0.5;
156-
backWall.position.set(0, 7.5, -10);
155+
backWall.rotation.z = Math.PI * - 0.5;
156+
backWall.position.set( 0, 7.5, - 10 );
157157
backWall.receiveShadow = true;
158-
scene.add(backWall);
158+
scene.add( backWall );
159159

160160
// Ceiling
161-
const ceiling = new THREE.Mesh(wallGeometry, whiteMaterial);
161+
const ceiling = new THREE.Mesh( wallGeometry, whiteMaterial );
162162
ceiling.scale.set( 20, 20, 1 );
163163
ceiling.rotation.x = Math.PI * 0.5;
164-
ceiling.position.set(0, 15, 0);
164+
ceiling.position.set( 0, 15, 0 );
165165
ceiling.receiveShadow = true;
166-
scene.add(ceiling);
166+
scene.add( ceiling );
167167

168168
// Boxes
169-
const tallBoxGeometry = new THREE.BoxGeometry(5, 7, 5);
170-
const tallBox = new THREE.Mesh(tallBoxGeometry, whiteMaterial);
169+
const tallBoxGeometry = new THREE.BoxGeometry( 5, 7, 5 );
170+
const tallBox = new THREE.Mesh( tallBoxGeometry, whiteMaterial );
171171
tallBox.rotation.y = Math.PI * 0.25;
172-
tallBox.position.set(-3, 3.5, -2);
172+
tallBox.position.set( - 3, 3.5, - 2 );
173173
tallBox.castShadow = true;
174174
tallBox.receiveShadow = true;
175-
scene.add(tallBox);
175+
scene.add( tallBox );
176176

177-
const shortBoxGeometry = new THREE.BoxGeometry(4, 4, 4);
178-
const shortBox = new THREE.Mesh(shortBoxGeometry, whiteMaterial);
179-
shortBox.rotation.y = Math.PI * -0.1;
180-
shortBox.position.set(4, 2, 4);
177+
const shortBoxGeometry = new THREE.BoxGeometry( 4, 4, 4 );
178+
const shortBox = new THREE.Mesh( shortBoxGeometry, whiteMaterial );
179+
shortBox.rotation.y = Math.PI * - 0.1;
180+
shortBox.position.set( 4, 2, 4 );
181181
shortBox.castShadow = true;
182182
shortBox.receiveShadow = true;
183-
scene.add(shortBox);
183+
scene.add( shortBox );
184184

185185
// Light source geometry
186-
const lightSourceGeometry = new THREE.CylinderGeometry(2.5, 2.5, 1, 64);
186+
const lightSourceGeometry = new THREE.CylinderGeometry( 2.5, 2.5, 1, 64 );
187187
const lightSourceMaterial = new THREE.MeshBasicMaterial();
188-
const lightSource = new THREE.Mesh(lightSourceGeometry, lightSourceMaterial);
188+
const lightSource = new THREE.Mesh( lightSourceGeometry, lightSourceMaterial );
189189
lightSource.position.y = 15;
190-
scene.add(lightSource);
190+
scene.add( lightSource );
191191

192192
// Point light
193-
const pointLight = new THREE.PointLight("#ffffff", 100);
194-
pointLight.position.set(0, 13, 0);
193+
const pointLight = new THREE.PointLight( '#ffffff', 100 );
194+
pointLight.position.set( 0, 13, 0 );
195195
pointLight.distance = 100;
196196
pointLight.castShadow = true;
197197
pointLight.shadow.mapSize.width = 1024;
198198
pointLight.shadow.mapSize.height = 1024;
199-
pointLight.shadow.bias = -0.0025;
200-
scene.add(pointLight);
199+
pointLight.shadow.bias = - 0.0025;
200+
scene.add( pointLight );
201201

202202
// Ambient light
203-
const ambientLight = new THREE.AmbientLight("#0c0c0c");
204-
scene.add(ambientLight);
203+
const ambientLight = new THREE.AmbientLight( '#0c0c0c' );
204+
scene.add( ambientLight );
205205

206206
window.addEventListener( 'resize', onWindowResize );
207207

0 commit comments

Comments
 (0)