Can I pixelate a 2D node (Sprite
in my case) in Godot? I need something like this:
It doesn't matter how to do it: with a shader or with code or with some tweaks. Any help appreciated.
Can I pixelate a 2D node (Sprite
in my case) in Godot? I need something like this:
It doesn't matter how to do it: with a shader or with code or with some tweaks. Any help appreciated.
I've figured it out by myself, it was pretty easy indeed. I just need a shader:
The inside of
fragment
function is scaling theUV
up, rounds it down usingfloor
and scales the result back down. The image above (in the question) is pixelated down to 32x32 size, and after using this shader theSprite
looks just like in the image example.P.S. It doesn't work for GUI nodes, maybe I'll solve this problem.