Overview
The main lighting node in the 3D → pixel-art lane, lighting a Surface, the
pixel-art G-buffer containing height, normals, AO, and other maps, into an image.
Despite "Preview" in its name, it is not inspection-only: it can produce a finished
image with stepped shadows, OKLCH color rules, and palette snapping.
If a normal map exists, the node uses it. Otherwise it derives approximate face directions from the height map. If an emission map exists, its color is added even in dark areas.
Usage tips
- Start with only four controls:
angle, where 315 = upper-left is the go-to direction;elevation;intensity; andambient. Establish the basic light and dark first. - Basic pixel-art finishing path:
- Set
tone_grade_mode = OKLCHto apply color rules to shadows and highlights. - Set
tone_grade_steps_mode = Stepsfor discrete stages; two shadow steps are standard. - Connect the project palette to
paletteand snap throughpalette_stage_mode.
- Set
- When several assets share the same lighting rules, save and reference a lighting
definition with
lighting_definition_mode = Definitioninstead of configuring every node. Definitions live inuser_data/definitions/lighting/and can be shared between assets. - Cast shadows through
cast_shadow_*determine contact. Lowerelevationfor longer shadows.
Common pitfalls
- The result is flat:
height_strengthis too low. Raise it to about 2–6 relative to the Surface height range and inspect the result. - No cast shadow appears:
cast_shadow_strength = 0, or the light is below the surface withelevationfrom 180–360. Height-map cast shadows are enabled only for upper lights from 0–180. - Palette stepping produces unexpected colors:
StageIndicesuses palette indices. Check the connected palette order againstshadow_stage_*_index. - There are too many parameters: detailed controls remain hidden while
tone_grade_mode = Off. Build basic lighting first, then move to OKLCH when needed.
Examples
- Add a height map to
Image to Surface, then changeangleand confirm the shadow direction. - Add a lamp
emission_mapand adjust the glow withemission_strength. - Raise
height_strengthand inspect how strongly brick mortar falls into shadow. - On a brick or block
Surface, raisecast_shadow_strength, lowerelevation, and check that shadows extend from height changes. - With
tone_grade_mode = OKLCH, add slightly to H inshadow_oklch_adjustand subtract slightly from H inhighlight_oklch_adjustto apply consistent color rules to every shadow and highlight. - With
tone_grade_steps_mode = Stepsandshadow_grade_steps = 2, shadows become a small set of stages—shadow 1 and shadow 2—instead of a smooth gradient. - With
shadow_tone_detail_mode = PerStageandshadow_grade_steps = 4, definition management shows correction fields for shadow 1 through shadow 4. Arrange them from light correction for weak shadows to deeper darkness for strong shadows. - With
cast_shadow_tone_mode = Separateandcast_shadow_grade_steps = 3, cast shadows receive their own corrections from cast shadow 1 through cast shadow 3. Use this when contact shadows or block steps should be darker than ordinary shading. - Connect the project palette to
palette, setpalette_stage_mode = StageIndices, and lock shadow 1, shadow 2, highlight 1, and highlight 2 to palette indices.
Light direction and elevation
angle specifies the direction the light comes from in the image plane. It is an Angle
parameter controlled with a cyclic knob in the inspector. 315 degrees means light from
the upper left.
elevation is the vertical orbital angle representing light height. As an Angle
parameter, it also uses a cyclic knob. 0 is the horizon on the light-direction side,
90 is directly overhead, 180 is the opposite horizon, and 270 lights from below
or behind. With 光の向き fixed, moving elevation from 0→180 makes the sun rise,
pass overhead, and set on the other side. Height-map cast shadows work with upper
lights from 0〜180. For lower lights from 180〜360, height-map cast shadows are
disabled to avoid unnatural projection.
shadow_strength darkens recesses using the AO map. cast_shadow_strength controls the
actual shadow that higher height-map pixels cast onto lower pixels.
OKLCH adjustments
With tone_grade_mode = OKLCH, the node reads the amounts of shadow and highlight from
the lighting calculation and shifts color in OKLCH.
With tone_grade_mode = Off, detailed OKLCH-adjustment parameters are hidden in the
inspector. Values remain stored, so switching back to OKLCH restores the previous settings.
For example, shadow_oklch_adjust at L=-12, C=0, H=8 makes shadows slightly darker
and rotates their hue. Applying one shadow-color rule everywhere makes a consistent
look easier than matching shadow colors by hand on each node.
tone_grade_steps_mode = Steps rounds correction strength into a small number of
stages. At shadow_grade_steps = 2, it divides into no shadow, shadow 1, and shadow 2.
Use this to try pixel-art stepped shading through OKLCH alone before snapping fully to
a palette.
With shadow_tone_detail_mode = PerStage, each shadow strength uses a separate
correction. shadow_grade_steps = 1 uses only shadow 1; 4 uses shadow 1 through
shadow 4. Definition management adds or removes fields to match the count. For fixed
shadow rules, keep weak stages light and make stronger stages progressively darker.
Processing order is lighting, OKLCH adjustment, then palette stepping. You can
therefore organize hue in OKLCH, then finish with palette_stage_mode = Nearest to snap
to nearby project-palette colors.
By default, cast shadows use the same shadow_oklch_adjust as ordinary shadows to avoid
unnecessarily increasing pixel-art colors and shadow rules. Switch to
cast_shadow_tone_mode = Separate only when steps or contact need stronger depth. With
Smooth, adjust all cast shadows through cast_shadow_oklch_adjust; with Steps, set
corrections for cast shadow 1, cast shadow 2, and so on according to
cast_shadow_grade_steps.
When tone_grade_steps_mode = Steps, highlight correction fields also follow
highlight_grade_steps. Two stages provide weak and strong highlights; four stages
can standardize finer light response in a palette-like way.
Palette stepping
StageIndices replaces shadow and highlight stages with palette indices instead of
using the colors produced directly by the lighting calculation.
For example, define palette entry 1 as shadow 1, entry 2 as shadow 2, entry 3 as
highlight 1, and entry 4 as highlight 2. The user palette, rather than the lighting
calculation, then controls shading colors. With palette_snap_strength = 1, every final
color belongs to the connected palette.
Lighting definitions use the same concept. Instead of changing colors on every node, first define how shadow and highlight stages map to palette indices across the work, then override individual nodes only when needed.
Likewise, lighting definitions can manage OKLCH shadow stages. Define project-wide rules for shadow 1, shadow 2, shadow 3, cast shadow 1, cast shadow 2, highlight 1, highlight 2, and so on, then override only exceptional nodes.
Related nodes
solid_render/model_render/image_to_surface— supply the input Surfacequick_shade— beginner version of this system contained in one nodesurface_export— export the unlit Surface as engine texturessurface_edge_highlight— emphasize edge light separately