Skip to content

Commit 4edb768

Browse files
authored
Examples: Cleanup volumetric lighting (#30660)
1 parent d8df4ae commit 4edb768

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

examples/webgpu_volume_lighting.html

+3-8
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,12 @@
88
</head>
99

1010
<body>
11+
1112
<div id="info">
1213
<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> webgpu - volumetric lighting
1314
<br>Improve the quality/performance adjusting the parameters in the Controls
1415
</div>
1516

16-
<video id="video" loop muted crossOrigin="anonymous" playsinline style="display:none">
17-
<source src="textures/sintel.ogv" type='video/ogg; codecs="theora, vorbis"'>
18-
<source src="textures/sintel.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
19-
</video>
20-
2117
<script type="importmap">
2218
{
2319
"imports": {
@@ -211,11 +207,11 @@
211207
// Scene Pass
212208

213209
const scenePass = pass( scene, camera );
214-
const sceneLinearDepth = scenePass.getTextureNode( 'depth' );
210+
const sceneDepth = scenePass.getTextureNode( 'depth' );
215211

216212
// Material - Apply occlusion depth of volumetric lighting based on the scene depth
217213

218-
volumetricMaterial.depthNode = sceneLinearDepth.sample( screenUV );
214+
volumetricMaterial.depthNode = sceneDepth.sample( screenUV );
219215

220216
// Volumetric Lighting Pass
221217

@@ -236,7 +232,6 @@
236232
// GUI
237233

238234
const params = {
239-
quality: 1,
240235
resolution: volumetricPass.getResolution(),
241236
denoise: true
242237
};

examples/webgpu_volume_lighting_rectarea.html

+3-8
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,12 @@
88
</head>
99

1010
<body>
11+
1112
<div id="info">
1213
<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> webgpu - volumetric lighting rect area
1314
<br>Improve the quality/performance adjusting the parameters in the Controls
1415
</div>
1516

16-
<video id="video" loop muted crossOrigin="anonymous" playsinline style="display:none">
17-
<source src="textures/sintel.ogv" type='video/ogg; codecs="theora, vorbis"'>
18-
<source src="textures/sintel.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
19-
</video>
20-
2117
<script type="importmap">
2218
{
2319
"imports": {
@@ -232,11 +228,11 @@
232228
// Scene Pass
233229

234230
const scenePass = pass( scene, camera );
235-
const sceneLinearDepth = scenePass.getTextureNode( 'depth' );
231+
const sceneDepth = scenePass.getTextureNode( 'depth' );
236232

237233
// Material - Apply occlusion depth of volumetric lighting based on the scene depth
238234

239-
volumetricMaterial.depthNode = sceneLinearDepth.sample( screenUV );
235+
volumetricMaterial.depthNode = sceneDepth.sample( screenUV );
240236

241237
// Volumetric Lighting Pass
242238

@@ -257,7 +253,6 @@
257253
// GUI
258254

259255
const params = {
260-
quality: 1,
261256
resolution: volumetricPass.getResolution(),
262257
denoise: true
263258
};

0 commit comments

Comments
 (0)