You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IBL Shadows - Init passes only after voxelization (#16527)
Okay, I've been investigating the issue where the shadow accumulation
isn't working initially after loading the [IBL Shadow Demo
playground](https://playground.babylonjs.com/#8R5SSE#618). On some
loads, the shadows will appear noisy and not accumulate over multiple
frames. Note that this issue never happens if you have Spector.js
enabled, which is why I had such a hard time reproducing it originally.
The actual issue is that the uniform, `accumulationParameters` fails to
be set with
`WebGL: INVALID_OPERATION: uniform4f: location is not from the
associated program`
Even though this fails, the uniform value is still cached and Babylon
doesn't set the uniform again until the value changes. That is why
accumulation appears to be disabled until you move the camera (which
causes the uniform to change and update).
I have not been able to figure out _why_ the uniform set fails in the
first place. It seems to be consistently the 3rd render that fails.
Before that, the uniform is set successfully and, as far as I can tell,
the shader program isn't updated after that point. And after the
failure, the uniform can be set again.
The one thing that I was able to change to make the issue seem to go
away was to put enough of a delay on the rendering of the accumulation
pass. I've added logic to only start rendering the accumulation pass
once the first voxelization is complete. This is fine since we can't
render shadows until this is done anyway but I don't know why it should
fix the problem.
0 commit comments