Skip to content

Commit 3d6f577

Browse files
mvaligurskyMartin Valigursky
andauthored
WGSL version of LTC shader chunk used to evaluate area lights (#7625)
Co-authored-by: Martin Valigursky <[email protected]>
1 parent d96789b commit 3d6f577

File tree

4 files changed

+405
-22
lines changed

4 files changed

+405
-22
lines changed

src/platform/graphics/webgpu/webgpu-shader-processor-wgsl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const KEYWORD_LINE = /^[ \t]*(attribute|varying|uniform)[ \t]*([^;]+)(;+)/gm;
3232

3333
// match global variables of type texture, storage buffer, storage texture or external texture
3434
// eslint-disable-next-line
35-
const KEYWORD_RESOURCE = /^[ \t]*var\s*(<[^>]+>)?\s*[\w\d_]+\s*:\s*(texture_.*|storage_texture_.*|storage.*|external_texture|array<.*>|sampler|sampler_comparison).*;\s*$/gm;
35+
const KEYWORD_RESOURCE = /^[ \t]*var\s*(<[^>]+>)?\s*[\w\d_]+\s*:\s*(texture_.*|storage_texture_.*|storage.*|external_texture|sampler|sampler_comparison).*;\s*$/gm;
3636

3737
// match varying name from string like: '@interpolate(perspective, centroid) smoothColor : vec3f;'
3838
// eslint-disable-next-line

src/scene/shader-lib/chunks-wgsl/chunks-wgsl.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ import litOtherMainPS from './lit/frag/pass-other/litOtherMain.js';
8181
import litShaderArgsPS from './standard/frag/litShaderArgs.js';
8282
import litShaderCorePS from './standard/frag/litShaderCore.js';
8383
import litShadowMainPS from './lit/frag/pass-shadow/litShadowMain.js';
84-
// import ltcPS from './lit/frag/ltc.js';
84+
import ltcPS from './lit/frag/ltc.js';
8585
import metalnessPS from './standard/frag/metalness.js';
8686
import msdfPS from './common/frag/msdf.js';
8787
import metalnessModulatePS from './lit/frag/metalnessModulate.js';
@@ -290,7 +290,7 @@ const shaderChunksWGSL = {
290290
litShaderArgsPS,
291291
litShaderCorePS,
292292
litShadowMainPS,
293-
// ltcPS,
293+
ltcPS,
294294
metalnessPS,
295295
metalnessModulatePS,
296296
morphPS,

0 commit comments

Comments
 (0)