WebGLRenderer: Add targetScene parameter to compile() methods.#26966
WebGLRenderer: Add targetScene parameter to compile() methods.#26966Mugen87 merged 1 commit intomrdoob:devfrom
targetScene parameter to compile() methods.#26966Conversation
|
|
||
| prepareMaterial( material2, scene, object ); | ||
| compiling.add( material2 ); | ||
| prepareMaterial( material2, targetScene, object ); |
There was a problem hiding this comment.
This is a subtle but important change. We have to use targetScene here since otherwise we miss environment definitions (and then end up with recompilations during the first render).
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
|
This would work for my use case, yes! (And hopefully many others as well!) I really like the change to have |
|
Thanks for the review! And sorry for deleting |
|
Thank you! I'm glad that we ended up going through this review separately in the end, because I think having this call through to 'compile()' makes the implementation better. |
Related issue: #19752
Description
This PR implements the feedback from #19752 (comment) and introduces the
targetSceneparameter, which was part of the original version of #19752.@toji I've managed to refactor the code such that
compileAsync()reuses the implementation fromcompile()which makes the code more manageable. Do you think your use case will work with this version ofcompileAsync()?BTW: Existing usage of
compile()should not be affected by this change.targetSceneis optional.