0 votes

I'm trying to create a pixelation shader which I can view through the camera2D node
something like this but instead of black and white I need pixelation

using this answer I got a pixelation shader but how do I view it through the camera?

shader_type canvas_item;

uniform float size_x = 32.0; // blocks by x direction
uniform float size_y = 32.0; // blocks by y direction

void fragment() {
    COLOR = texture(TEXTURE, vec2(floor(UV.x * size_x) / (size_x - 1.0), floor(UV.y * size_y) / (size_y - 1.0)));

the structure of my nodes is same as in the above video link:

enter image description here

The end product should maybe look something like this:
enter image description here

Godot version 3.4
in Engine by (99 points)

1 Answer

0 votes
by (1,340 points)

I tried that but I can't get it to pixelate

remember the pixelation should be seen through the camera

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 Frequently asked questions and 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 [email protected] with your username.