0 votes

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!

in Engine by (128 points)

1 Answer

+1 vote

The resolution in godot shader expressed as follows:
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);

by (2,060 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.