Baltor Get started

Gallery / Godot shaders

Inner outline along a sprite's edge

In your harnessGodot shaderMIT

Draw a border of a chosen width inside the opaque shape of a sprite, following its silhouette, with optional pulsing and an option to hide the interior so only the inner line remains.

Render of Inner outline along a sprite's edge
The render its check recorded in Godot 4.7.2, 256 by 256 pixels.

What it takes and gives

Shader type
canvas_item
Parameters
line_color (vec4 = 1, 0.95, 0.4, 1), width (int = 2), alpha_cutoff (float = 0.5), keep_interior (bool = yes), pulse_speed (float = 0)
Use it on
A Sprite2D (or other textured CanvasItem) with transparent space around its shape, assigned to the node as usual.
Result
The sprite's blobs with a yellow border running just inside their edges.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/sprite_inner_outline/

Limits. Cost grows with the square of width. With texture filtering and scaling, edges are as soft as the sampled alpha. Atlas regions need padding or neighbouring sprites count as opaque.

Details

Kind
Godot shader
Engine
Godot 4.3 or later
Files
11 files, 61.0 KB
Licence
MIT
Declared effects
reads files, runs commands
Checked with
Godot 4.7.2, opengl3 compatibility (Mesa llvmpipe, Xvfb)
Checks
contract static, engine run, engine log clean, shader in scene, capture written, render not uniform, shader changes pixels
Techniques
Neighbourhood alpha erosion test, Disc-shaped search kernel
Tags
godot shader, canvas item, outline, inner outline, sprite, 2d, highlight
Identity
library.supply.creative_originals.ccb2b02f2a60e960ca02dd38.bed230a5b7037671
Version
bed230a5b703767151faa427b106f2fac78cd8398e6abed6638039b5945b39d4

The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.

Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.