Here’s the issue:
I have a scene with mostly light-mapped objects. When I’m switching parts of the scene on and off I call
to update lightmaps. When I do this, non-lightmapped models dissappear from the scene (with their shadows still rendering correctly into lightmaps).
The light is set to both “Affect Dynamic” and “Affect Lightmapped” and initially, the scene renders correctly.
Here’s a simple projects to demonstrate the issue:
And the build:
One cube is lightmapped, other is dynamically lit. The pink button on the screen simply calls app.lightmapper.bake(); and one of them disappears.
This issue started with PlayCanvas v 1.42, in v1.41.2, and before it worked correctly
(here’s the example project with v1.41.2 https://launch.playcanvas.com/1196877?debug=true&use_local_engine=https://code.playcanvas.com/playcanvas-1.41.2.js)
Previously I was able to use an old version of the engine to bypass this, but with new texture encoding changes, it’s no longer an option.
I just tested your project, and I can’t seem to get the cube to disappear. As far as I can tell, lightmapper.bake() is called though there is a bit of weirdness from the UV flipping that was released today (I think):
Yes, disregard the flipped UV, AO map didn’t update with new encoding for some reason.
But strange that it works for you. Here’s what I’m getting:
That’s strange! I opened the link in Chrome out of curiosity, and the cube disappeared for me. Whatever the issue is, it does not appear to be affecting Firefox.
Edit: Here are the warnings from Chrome’s console:
Well that’s one more thing for me to look at. Adding it to my list, thanks!
A bit more details that I’ve found out:
The issue only occurs with the light set to ‘Bake Lightmap’ and Shadow Update Mode set to ‘Once’.
Without shadow or with shadow update set to ‘Realtime’, everything works as expected.
good info, thanks … I suspect a workaround you’ve found works for you now? I’ll need to perhaps handle (ignore) Once mode by lightmapper, I’ll investigate.
Workaround totally works for what I need to do, shadows are baked for lightmapped objects in either case, and for dynamic objects the performance impact is minimal.