2D blooming shader

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

Hi all!

I am trying to start writing shaders in Godot 3. I would like to implement a basic bloom shader in a 2D (pixel-art like) game. I know more or less how a fragment shader works, what is the syntax, and even how to perform some things like gaussian blur and similar stuff.

However, I’ve never worked with shaders and I do not know what is the best strategy to implement this kind of effect in 2D. I want an effect similar to this: https://www.youtube.com/watch?v=8NSWtp5ziLY It should looks like it emits light (and it should illuminate nearby objects, such as the tilemap or other characters in the game).

Any ideas on how to implement that? I have read some ideas for 3D shaders, but they do not seem to adapt very well to 2D sprites (since, for example, it looks like the effect of the fragment shader is bounded by the texture size of the sprite… How can I circumvent that?)

Also, resources & tutorials in 2D shading techniques would be super-appreciated!
Thank you very much in advance!