How to apply a fragment shader to a Particles2D node to effect the pixels it outputs?

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

I’m new to shaders and I wanted to limit the particle system to be drawn to pixel perfect integers to recreate the Celeste dust step effect. I know I can go into the project settings and change the stretch mode to viewport instead of 2d but I want just the particle system to be limited to pixel perfect integers.

I figured out how to pixelate a sprite thanks to the Godot shader demo, but apparently particles work in a different way. From what I understand you have to manipulate the vertex data because that’s the information that particles give you? How would I achieve a pixelate shader with this vertex data or can this even be achieved by a vertex shader?

My hunch for what will need to happen is to draw the particles to some sort of texture and then pass that texture to the fragment shader to pixelate the particles. Since I am a beginner I really have no idea how to do that.

I’d appreciate any help on this topic, thanks!

:bust_in_silhouette: Reply From: ariorick

I can only half-answer your question

Here’s a question about pixelation shaders

Also, you can set your shader in Particles2D.material, just like in any other CanvasItem, BUT it will apply shader on every particle separately. Still might be useful though