โ† All examples

godot shaders

Soft outer glow around a sprite

Surround a sprite's shape with a soft coloured glow: alpha is gathered in rings around each texel, giving a smooth halo that can pulse, drawn under the sprite.

Recorded render of Soft outer glow around a sprite

What this component contains

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • component.json
  • demo.tscn
  • inspect_shader.py
  • material.tres
  • preview.png
  • sprite_soft_glow.gdshader
  • test_package.py
  • verification/native.json

How it works

Shader type
canvas_item
Parameters
glow_color (vec4 = 0.4, 0.85, 1, 1), radius (float = 10), intensity (float = 1.6), rings (int = 3), directions (int = 12), pulse_speed (float = 2), pulse_depth (float = 0.3)
Use it on
A Sprite2D (or other textured CanvasItem) with transparent space around its shape, assigned to the node as usual. Effects outside the shape are drawn inside the texture rectangle, so the texture needs a margin.
Result
An orange disc surrounded by a soft cyan halo on a dark background.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/sprite_soft_glow/

Recorded checks

godot 4.7.2.stable.official.ed1daf0bf

  • contract_static
  • engine_run
  • engine_log_clean
  • shader_in_scene
  • capture_written
  • render_not_uniform
  • shader_changes_pixels

Limits to consider

Effects outside the shape are drawn inside the texture rectangle, so the texture needs a margin. Cost is rings times directions samples per pixel (36 by default).