Using REFRESHRATE_RENDER_ONCE with cascaded shadow maps will only work if you don’t move the camera: the generated shadow maps depend on the camera position, so if you move the camera the shadows will be off.
You will see that using SHADOWUPDATE_THISFRAME (which is the setting used when you choose “Once” in the editor) here won’t work:
Add the entry shadowUpdateMode: 1, (see screenshot) line 71: that will set the mode to SHADOWUPDATE_THISFRAME.
Excute the updated code by clicking on:
You will see the shadows are not ok.
You need to set shadowUpdateMode = 2 for the shadows to work correctly, this setting corresponding to SHADOWUPDATE_REALTIME (meaning shadows updated each frame - default setting).
Yes, I think when you choose “Once” in the editor you are really in the "once "mode, so that shadow maps are generated a single time. But you will get artifacts, depending on your scene and how you move the camera. Note that when you choose “once” in the editor, you have a button that pops on the right which is titled “Update shadows”.
Ok, I see where the issue was in my understanding.
PlayCanvas’ single “Shadow Generator” is just cascading = 1 and when set to 2-4 the issue when changing the camera starts to happen.
Now it makes sense to me, that Babylon only allows 2-4 cascades and not 1
Thanks for being patient with me, I’ll have to stick with single “cascading”