Overview
Adds a directional hard shadow behind a sprite. Because the shadow is not blurred, it fits pixel art naturally and provides go-to effects such as raising a UI icon or placing a shadow to the lower right of a character with one node.
When to use it
- Add a lower-right shadow to a pixel-art character or item
- Offset by only 1px horizontally or vertically to resemble a one-sided edge shadow
- Add a directional shadow instead of an
Outline
Usage tips
- Start with the defaults: lower right, distance 1, black at 60%. This is enough for a slight raised pixel-art look.
- Adjust strength with the shadow color's alpha (0.6 by default). Alpha controls how naturally it sits over the background.
distancehas approximately the same physical length in all eight directions. Diagonal components are normalized, then rounded to whole pixels.- This is an offset shadow, not an oval contact shadow. For a top-down contact shadow,
placing
shape_generate(Ellipse)underneath withblendis more appropriate. shadow_onlyis also useful for extracting and managing the shadow as a separate layer.
Common pitfalls
- The shadow is clipped: the output is the same size as the source. Set
paddingto at least the effective offset component plus spread. A nonfatal warning appears when the current padding is insufficient. - The shadow should be soft: this node intentionally uses hard edges for pixel art.
For a soft shadow, apply
gaussian_blurto theshadow_onlyoutput and composite it withblend. - The shadow extends to the opposite side:
spreadexpands in every direction in the default Radial mode. Usespread_mode = Directionalto limit it to the chosen side.
Notes
- This is a hard-edged shadow, not a blurred shadow.
distance = 1creates a look close to a one-sided edge shadow.- Increasing
spreadthickens the shadow mass. spread_mode = Radialexpands evenly around the shadow.spread_mode = Directionalexpands only into the half-plane/quadrant of the selected direction, reducing overflow on the opposite side.threshold = 0excludes fully transparent pixels and selects every pixel with alpha above zero.- Diagonal direction vectors are normalized, so diagonal and cardinal movement have approximately the same physical length.
- The output size matches the source, and shadows beyond the canvas edge are clipped.
- Set
paddingonly when the shadow needs extra room. It adds the specified amount of transparent padding on every side. Its maximum is 48, enough for cardinal distance 32 plus spread 16. - With
shadow_only = true, you can inspect the shadow without the source image. directionoffers eight directions. Nine-slice and complex rim lighting are future extensions.
Examples
- Add a 1px shadow to the lower right of a character.
- Make a UI icon appear slightly raised.
- Increase
spreadto create a thick, solid shadow. - Use
shadow_onlyto keep the shadow on a separate layer.
Related nodes
glow— the luminous counterpart, using distance-based falloffoutline— a non-directional outlinecontact_shadow_from_order— creates contact shadows from overlap ordersurface_light_preview— full cast shadows for assets with height information