-
-
Notifications
You must be signed in to change notification settings - Fork 36.3k
Closed
Description
Description
Renderer.compileAsync is advertised as asynchronously compiling materials. It actually does this only partially as some settings from the target scene aren't handled. One if them is Scene.fogNode and consequentially also Scene.fog. If the material is then later used it includes the fogNode and everything compileAsync did is obsolete. Without fog in the target scene it works as intended. Scene.environment is affected the same way.
There is some special handling for lights by including them from the target scene. Something like this might be necessary here too.
Reproduction steps
- Use the WebGL backend.
WebGPURenderer({ forceWebGL: true }) - Have a scene with fogNode.
- Watch
WebGLBackend._completeCompilewith a breakpoint. - Use
await renderer.compileAsync(object, camera, targetScene). - Add object to scene.
- Observe
WebGLBackend._completeCompilebeing called twice for the same object and material.
Code
// code goes hereLive example
https://jsfiddle.net/Ljskxp1d/
Screenshots
No response
Version
0.181.2
Device
Desktop
Browser
Chrome
OS
Windows
Reactions are currently unavailable