Scene flickering when turning off light

The problem comes from a shader recompilation. Because it is a light change, we can’t keep the old shader while the shading is compiling, leading to this flickering. There’s no real clean solution to this, but you can use the workarounds provided by @xiehangyun. You can also disable parallel shader compilation:

Note that there’s the same problem with the standard material. If you can’t see it, it’s probably because the recompilation is faster than with a PBR material.

4 Likes