Skip to content

TSL: Add function layout to IBLSheenBRDF. - #34824

Merged
Mugen87 merged 1 commit into
devfrom
sheen-brdf-layout
Oct 6, 2026
Merged

Mugen87 merged 1 commit into
devfrom
sheen-brdf-layout

Conversation

@mrdoob

@mrdoob mrdoob commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Description

IBLSheenBRDF is called from five places in PhysicalLightingModel (twice per direct light, plus the indirect and energy-compensation paths), and each call rebuilt its full expression graph inline. It always receives the same input types, so give it a fixed setLayout() matching the WebGL IBLSheenBRDF( vec3, vec3, float ) signature. The builder then emits it once as a shader function and reuses it.

In webgpu_caustics with duck.material.sheen = 0.5, the first frame registers 264 fewer nodes (2,636 → 2,372, -10%) across the six material builds. Materials without sheen are unaffected.

webgpu_loader_gltf_sheen renders pixel-identical to dev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

📦 Bundle size

Full ESM build including core, minified and gzipped.

Before After Diff
Core 390.08
102.34
390.08
102.34
+0 B
+0 B
WebGL 775.85
193.72
775.85
193.72
+0 B
+0 B
WebGPU 1095.66
294.34
1095.80
294.37
+144 B
+27 B
WebGPU Nodes 1093.61
294.00
1093.75
294.02
+144 B
+27 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 517.70
124.36
517.70
124.36
+0 B
+0 B
WebGPU 770.46
206.49
770.60
206.51
+144 B
+22 B
WebGPU Nodes 716.30
192.99
716.30
192.99
+0 B
+0 B

@mrdoob mrdoob added this to the r187 milestone Oct 6, 2026
@Mugen87
Mugen87 merged commit 5be3c1d into dev Oct 6, 2026
10 checks passed
@mrdoob
mrdoob deleted the sheen-brdf-layout branch October 6, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants