WebGLRenderer: Prepare shadow maps without rendering during compile(). - #34239
WebGLRenderer: Prepare shadow maps without rendering during compile().#34239hybridherbst wants to merge 3 commits into
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
🖼️ E2E screenshot tests✅ All examples render correctly again (run). |
|
@Mugen87 turns out current dev also fails with so I think this adjustment to shadow code (to make it reusable and to fix the bug) is justified – let me know what you think! |
e7f0787 to
c726e2c
Compare
|
Um, I'm not yet sure it's worth the effort. I'm not supporting a 100% integration of the node materials in WebGLRenderer since that would cause massive additional maintenance effort. |
c726e2c to
0139209
Compare
Related issue: stacked on #34219
Description
When a WebGL node material receives shadows, shader setup needs the shadow map and its depth texture.
compile()currently creates these resources by callingshadowMap.render().Besides rendering actual shadow passes during precompilation (for no reason), this breaks when automatic shadow updates are disabled:
Since shadowMap.render() returns before allocating anything, node setup fails with:
This change separates shadow-map allocation from rendering, so
compile()prepares the required targets without clearing or drawing into them.I also added a new
webgl_tsl_compile_asyncsample scene (that would fail before this PR).This contribution is funded by Needle