Item pulse glow

Make items glow with easy to use shader params

Glow color

Intensity

Spread

Pulse speed

Shader code
shader_type canvas_item;
render_mode blend_add;
uniform vec4 glow_color : source_color = vec4(1.0, 0.9, 0.5, 1.0);
uniform float intensity : hint_range(0.0, 5.0) = 1.5;
uniform float spread : hint_range(0.1, 2.0) = 1.0;
uniform float pulse_speed : hint_range(0.0, 10.0) = 1.0;
void fragment() {
    vec2 centered_uv = UV - vec2(0.5);
    float dist = length(centered_uv) * spread;
    float alpha = max(0.0, 1.0 - dist);
    alpha *= (1.0 + 0.2 * sin(TIME * pulse_speed));
    alpha = clamp(alpha * intensity, 0.0, 1.0);
    COLOR = glow_color * alpha;
}
Live Preview
Tags
glow
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

More from Pheonix

Related shaders

guest

2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
MDoubleDee
4 months ago

Nice and simple timesaver for noobs like myself 🙂

GameBug
GameBug
4 months ago
shader_type canvas_item;

render_mode blend_add;

uniform vec4 glow_color : source_color = vec4(1.0, 0.9, 0.5, 1.0);
uniform float intensity : hint_range(0.0, 10.0) = 1.5;
uniform float spread : hint_range(0.1, 10.0) = 1.0;
uniform float pulse_speed : hint_range(0.0, 100.0) = 1.0;

void fragment() {
  vec4 main_texture = texture(TEXTURE, UV); // Get existing texture
  vec2 centered_uv = UV - vec2(0.5);
  float dist = length(centered_uv) * spread;
  float alpha = max(0.0, 1.0 - dist);
  alpha *= (1.0 + 0.2 * sin(TIME * pulse_speed));
  alpha = clamp(alpha * intensity, 0.0, 1.0);
  COLOR = main_texture * glow_color * alpha; // Apply pulse with original texture
}

Updated above code to be used with an existing texture