Add glow to image (actor) in LibGDX

Can I add a glow to the Image path? I know that I can do this by adding an additional “luminous” version of the image and switching to it at will, but since there are many different shapes in my game, I would prefer the glow to be done programmatically. How can i do this?

+6
source share
2 answers

As @Metaphore pointed out, shaders really the best option I've found. I managed to add a diagram to any desired image in my game by following this article and get important information from the request for follow-up question .

+2
source

The only way to do this is to use your own pixel shader when drawing this particular image.

You can find many effects on the net for the glow effect, and there are also ways to use them. You can check out the official LibGDX article on this topic https://github.com/libgdx/libgdx/wiki/Shaders

However, I would not recommend that you follow this path, because using different shaders to draw individual images will make you make the code loop much more complex and less optimal. Thus, either you compromise, or simply find a simpler way to achieve this behavior without shaders (I mean, draw it statically somehow).

+1
source

All Articles