• 2D
  • Glow in a transparent Viewport

I want to make a line glowing without glowing the full screen. I tried to set modulate colors to make the line the only one affected tby the glow like in this video.

But I try to stick to GLES2 for compatibility maximization. It seems modulate values upper than 1.0 has no effect.

So I tried to apply the world environment to a viewport dedicated to the line.

Of course I want a transparent viewport, but when transparent bg is set the environment was lost.

Is it really impossible to make the built in glow working on GLES2, on isolated objets ?

I believe GLES2 doesn’t support HDR, so colors are clamped to the 0-1 range. That’s probably why values over 1.0 are not having any effect.

You may be able to get the line glowing in the Viewport by adding a WorldEnvironment node, setting the glow there with a HDR threshold under 1, and making sure own world is enabled. I’m not totally sure it will work, but it’s what I would try.

Try making the Viewport rendered with additive blending by assigning a CanvasItemMaterial to it with the Add blend mode. Then, make sure the Viewport has a fully black background but do not enable Transparent Bg. You will be able to see what's behind the viewport since the viewport's sprite will be rendered with additive blending.

Thank you for the answers. I'm still struggling to make the game working properly since the viewports addition, because control nodes and viewports positions and bounds are tricky for my limited brain. But the Calinou suggestion points me to the right direction.

It is a real challenge for me to place the laser viewport (the one that features glow), accordingly to the camera2D without messing the coordinates. Relative coordinates is not K.I.S.S.

You can set coordinates in global space if that is easier, but you probably just have to do some addition.

Ok I moved the Line2D in "_ready" and I just hope I will not change the project enough to break the card castle. Now the problem is the framerate.