Overview
A beginner shading node that adds light and shadow to flat-color pixel art with one node. It needs no height map or normals, inferring a volume automatically from the silhouette. This is the shortest route when you want to try depth or quickly shade batch-produced assets.
Usage tips
- Start with only
画像 → かんたん陰影. The defaults—upper-left light and crisp two-step shading—produce a pixel-art-friendly result. - Choose
volumeby subject: character or slime →Round; crystal or spike →Sharp; brick or tile →Flat. - Choose shading steps by asset size: 16–32px →
Steps2; 48px or larger →Steps3.Smoothlooks less like pixel art and is best reserved for effects. - Bind
光の向きto a variable to change the light direction for every asset in a scene together. - There is an upgrade path when you need more: connect the
heightoutput toimage_to_surfaceto move into the full Surface path with lighting definitions and palette snapping.
Common pitfalls
- Internal details receive no shadow: because depth is inferred from the silhouette, steps inside the artwork are not treated as geometry (see "Limitations"). Use the Surface path when internal relief matters.
- The image is too bright or blown out: lower
intensityor balance it againstambient, the minimum brightness retained on the shadow side. - Light comes from an unexpected direction:
angle315 is upper left, the pixel-art standard. Atelevation90, light is directly overhead and direction has no visible effect.
Technical details
Internally this thin wrapper uses existing shared infrastructure in three steps:
pxn_core::height_field::height_from_silhouette()— estimate a height map from an alpha-silhouette distance transform- Wrap the estimated height in a
SurfaceDocument surface::render_surface_light()— light it with the same renderer asサーフェース光プレビュー
- Steps2/Steps3 in
shading_stylequantize diffuse light throughSurfaceLightSettings::diffuse_stepsand also apply OKLCH stepped tones. - Cast shadows are disabled because silhouette-derived height tends to make them noisy.
- angle has the same meaning as in
サーフェース光プレビュー: 315 = light from upper left.
Examples
画像読み込み → かんたん陰影alone adds depth to a sprite.- Bind
光の向きto a variable to change the light direction of several sprites together. - For finer control, connect the
heightoutput to画像からサーフェース, then use lighting definitions and palette snapping inサーフェース光プレビュー.
Limitations
Because volume is inferred from the silhouette alone, internal steps such as a recessed
window are not reflected. In that case, use the Surface path with luminance mode in
画像から高さマップ or a hand-drawn height map.
Related nodes
height_from_image— estimate height separately for finer controlimage_to_surface+surface_light_preview— upgrade to full lightingdrop_shadow— when you need a cast shadow rather than volumegradient_map— the traditional approach of painting shading yourself