simple shader problem

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By blank

Hello guys, I’m trying to translate a very simple and short shader, that I have listed here on shadertoy .
And here is my godot shader code .

The problem is, in shadertoy output, the shader “overlays” the image, and quantizes and dithers the colors of set image (iChannel0) ordered by bayer8x8 texture (iChannel1). I’ve tried using a TextureRect node with the same bayer8x8 texture, and assigning the shader to it. But for some reason it renders a weird pattern on a solid black color instead. I’m really close to having it work but I have no clue at all what can be causing this now.
Here is a screenshot from godot.

Any help is highly appreciated!

:bust_in_silhouette: Reply From: estebanmolca

The resolution in godot shader expressed as follows:
(1.0 / SCREEN_PIXEL_SIZE)
your code :
getSceneColor (uvPixellated / SCREEN_PIXEL_SIZE.xy, SCREEN_TEXTURE);
So according to Shadertoy’s code, it should look like this:
vec3 dc = getSceneColor(uvPixellated / (1.0 / SCREEN_PIXEL_SIZE), SCREEN_TEXTURE);