Make single buttons glow with World Environment

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

Hi there, guys!

So, I have a set of 9 buttons sorted inside a GridContainer. Each button has a simple, unique color StyleBoxFlat. I saw some tutorials online on making things glow with WorldEnvironment node, but I’m not managing to make just a single object (in my case, a button) to glow with the environment node. What I want is to one single button glow when I click it (like the glow is the “pressed” state), and when I click on another button, it deactivates the glow on the previous one, and activate on the newer. Kinda like only one button can be active at a time.

I’m super new to the engine so I’m sorry if this is like super basic.
Also, if there’s a better way to create this glow, I’d like to know it :slight_smile:


:bust_in_silhouette: Reply From: phiz

I’m a newbie too so take this with the understanding that there’s probably a better way to do things :slight_smile: It depends on your colour scheme, if you’re able to set one of the RBG values above 1 then having a glow_hdr_thresold = 1 on your WorldEnvironment will only apply the glow to those objects with R|G|B > 1.

I kinda wish the alpha channel could be set above 1 (or another generic property tested for HDR threshold) for this purpose, but that doesn’t seem possible, would love to be corrected!

The other option I see (probably the right way to do it) is a custom ShaderMaterial to apply a glow effect, there are plenty of good examples online.

Depending on the use case, creating alternate sprites with a glow effect and swapping those as needed is simplest.

Hi. I’m trying to do the same thing but I can’t find a really good tutorial about this. Pls someone post a script of a shader that makes a texture glow alone

nahsch | 2020-12-31 07:09