Custom mask buffer texture in 2D for custom bloom/glow effect?

Godot Version

4.2.1

Question

Im trying to make my own glow/bloom post process effect for my 2D topdown game. My idea goes like this…

  • Store a glow mask texture in a shader on each sprite (black and white mask. White being the part that should glow).
  • Combine all of those masks into a single texture from the viewport/camera view to act as the glow/bloom buffer texture.
  • Use that buffer texture in a bloom/glow post process shader. Blur it and draw it on top of the original render to create that glow effect.

The problem is that I have no idea how to render that buffer texture that I need. What are some ways of doing that?