I’m working on a UE 5.7 post-process shader for a PS1-style look. The shader only performs simple color quantization using:
floor(Color * Levels) / Levels
The problem is that lighting transitions flicker heavily, even when the camera is completely static. The flickering only appears around color boundaries where the lighting changes from one quantized color to another.
I’ve already tested:
No TAA (AA disabled completely)
No Lumen
Different Blendable Locations
Unlit materials
No LUTs
No dithering
The issue is still visible even with a very simple quantization setup. As shown in the video, the lighting gradients themselves seem unstable, and the color quantization makes this instability very noticeable.
Is there a way to stabilize lighting values before quantization, or is there a better approach to achieve hard PS1-style color bands without this flickering?
Checking with my peers, and considering that the simple shader setup in your video results in flickering, even without TAA, Lumen, etc., then the cause it’s most likely the order of the actions.
If your light’s value changes from 0.499 to 0.500, it would be barely noticeable. But after you apply quantization, that difference will jump from 0.25 to 0.50. And if your material is running after the tonemapping phase, you will definitely get flickering.
So, in your material, check your current setting for Blendable Location. If it’s set to “Scene Color After Tonemapping” then try changing it to “Scene Color Before DOF”, or even “Replacing the Tonemapper” (test the scene after each change).
You also mentioned that no dithering was used in the scene, but it’s not clear which method was being used. If you are on random dithering, that could even increase the flickering. For this scenario, a bayer dithering is most likely the way to go, resulting in a more stable pattern.
If that’s the case, I suggest reviewing the following video guides on the matter:
I changed the shader to Scene Color Before DOF, and that seems to have solved the issue. There is still a very slight amount of flickering, but it’s barely noticeable now, so this was definitely the right direction.
However, this introduces a new problem: transparent materials are no longer affected by the post-process effect. Ideally, I would like transparent materials to be included as well.
I experimented with different Blendable Location settings, but when I switch back to other options, the flickering starts to return (at least partially).
Is there any workaround for this? For example, is there a way to keep the stability of Scene Color Before DOF while still having transparent materials included in the effect?