Dithering node Unity to Godot 4 ?
Hey,
I try do redo the same technic a was doing in unity shader graph, i'm close to the same result in godot with the visual shader.
I just want a nice dithering effect in the fragment. But i got the same issue in unity, the dither don't have a nice 'disposition' and only the dither node in unity is actually working. Only blue noise texture is not a problem with texture of course.
Here my godot disposition and result :
here the result in unity with the dither node :
i tried as well to "redo" the dither node in a expression, but i'm not good at it. I which we could have a godot dither node in futur ^^
if somebody have a solution : ) i would love it !
Here the dither unity node
void Unity_Dither_float4(float4 In, float4 ScreenPosition, out float4 Out)
{
float2 uv = ScreenPosition.xy * _ScreenParams.xy;
float DITHER_THRESHOLDS[16] =
{
1.0 / 17.0, 9.0 / 17.0, 3.0 / 17.0, 11.0 / 17.0,
13.0 / 17.0, 5.0 / 17.0, 15.0 / 17.0, 7.0 / 17.0,
4.0 / 17.0, 12.0 / 17.0, 2.0 / 17.0, 10.0 / 17.0,
16.0 / 17.0, 8.0 / 17.0, 14.0 / 17.0, 6.0 / 17.0
};
uint index = (uint(uv.x) % 4) * 4 + uint(uv.y) % 4;
Out = In - DITHER_THRESHOLDS[index];
}