Shadow Cascades still tremble even with "stabilizeCascades == true"

Hello,

Here is a PG where the issue can be observed.
Shadow cascades use the stabilizeCascades option.
Zoom in so that the first cascade is visible.
Rotate the camera and you’ll notice that shadow map still trembles a bit. Do you think this can be fixed?

This artifact is way more prominent in our current project but I can’t make it that visible in the PG unfortunately.

I’m not sure I understand/see the problem…

Have you tried to change the shadowGenerator.cascadeBlendPercentage property to either 0 or a big value (like 0.9)?

Note that exponential shadow map is not supported in CSM, so in your PG there’s no filtering method (hence the blocky look).

Yeah, I know about CSM. I specifically disabled filtering this way so that the problem is better observed.

It is not about blending different cascades. It is about calculating cascades’ matrices.
Let me attach a video of what I observe in PG. It is from my Gdrive. Not sure if this is considered unsafe on the forum. I’ll remove it if that’s the case.
Video
And in my project the shadow ‘dances’ way more wildly.

I don’t experience this problem:

Have you tried in another browser?

Also, can you try with WebGPU? It should be available in the engine dropdown box:

image

Hm. Interesting.
Tried with FF. The issues are there but to a lesser extent. That’s weird.
Downloaded Chrome Canary and enabled WebGPU. Unfortunately, the shaders crash for me. Might be because I’m on Linux.

I discussed it with my teammates and it seems to behave differently for everyone depending on the OS + browser + GPU + drivers combination.
Currently, seems to happen in some Browsers on Unix-based (Linux, MacOs) systems with Nvidia cards

Sorry for spamming a little.
Just tried on my Laptop. The problem is there with Nvidia 3050Ti.
When I switch to an integrated AMD the problem is gone.
[EDIT] Nope. That’s a wrong observation. It is kinda random.

Just reporting here the results on my machine (Nvidia Quadro):
Edge: No tremble
Chrome + WebGPU: No tremble too, but I got a TypeError :thinking:
image

It seems the engine is not fully initialized when this code in CSM is reached as it is engine._features.supportCSM which is failing because of _features not being initialized. But this variable is set as part of the global WebGPU inits and no user code should execute before these inits are completed… Maybe the Playground environment is not waiting for the end of the async inits before executing the PG code?

Another observation.
It depends on the browser window size.
In fullscreen, the artifact is there.
As I gradually reduce the size of the canvas, at some point the artifact is gone.
Hope this helps.

@carolhmj I am not able to repro the type error. are you running on latest Canary ?

It’s version 107.0.5302.0 I’m not sure if it’s the latest :thinking:

Oooh I refreshed the page and didn’t see the error, might be a race condition?

1 Like

yup could definitely be the init not being awaited in the PG for some reasons