How to create a pixellate effect?

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

I’m new on Godot, and I’m starting a pixel art game. I’d like to have a pixellating effect, so that the viewport doesn’t show new pixels as it scales up. The game window is 480 x 270 pixels, but playing it on fullscreen makes it more fluid, which I actually don’t want ^^
Is there a way to achieve that? I haven’t found anything that could help me yet.

Reddit - Dive into anything

rakkarage | 2022-01-29 15:42

:bust_in_silhouette: Reply From: p7f

For pixel art games, there some things you have to take care of:

1 - Reimport all your textures without filter, or with “2D pixel” preset. Just select the textures in your file system dock in the editor, go to the Import dock, uncheck filter, and click reimport.

2 - In project settings, go to Display->Window and select “viewport” in Stretch mode (at the bottom of the dialog). This makes godot render at the window resolution and the scale the result, so you only see what was intended, and the performance is a bit better.

3 - In the same Display->Window settings, select “keep” in Stretch Aspect option.

4 - In project settings, go to Rendering->Quality, and look for 2d, check pixel snap there. This makes things snap at integer pixel positions, to help you avoid subpixel distortion.

Thanks a lot, exactly what I needed :slight_smile:

IvanVoirol | 2020-07-24 12:05

glad to help!

p7f | 2020-07-24 12:15