+1 vote

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 :)


in Engine by (42 points)

1 Answer

0 votes

I'm a newbie too so take this with the understanding that there's probably a better way to do things :) 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.

by (92 points)

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

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.