Repository navigation
TSL: Share EON directional albedo in indirect lighting. - #34660
Conversation
π¦ Bundle sizeFull ESM build, minified and gzipped.
π³ Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
|
That looks good but I've realized now something: It's maybe better to give the EON BRDFs a layout like other BRDF functions: three.js/src/nodes/functions/BSDF/V_GGX_SmithCorrelated.js Lines 16 to 24 in 023bd79 That should further improve the build performance since it better scales with multiple lights. Layout functions are built once and then cached. Calling a plain That's not a problem when executing the shader but it affects build time. |
|
Merging. The suggested layout Fn changes can be done separately. |
|
Thank you! |
With diffuse roughness enabled,
PhysicalLightingModelconstructs the sameEON_DirectionalAlbedograph in bothindirectDiffuse()andindirectSpecular().Create one shared node in
start()and reuse it in both methods. This preserves the existing method signatures and multiplication order.For a material lighting graph with diffuse roughness and one directional light (WGSL):
This saves 50 registered nodes and 92 allocations per material graph. The same reduction was measured with 0, 1, and 4 direct lights on both WGSL and GLSL.