Studio Yotsuba
Back to Node List

Surface Light Preview

surface_light_preview

Renders a quick lighting preview from Surface height, normal, AO, roughness, and emission maps.

Reviewed
Guide available

Input Ports

NameTypeDescription
Surface
surface
Surface
Required
Surface to light for preview.
Palette
palette
Palette
Optional palette used to snap shadow and highlight stages.

Output Ports

NameTypeDescription
Image
output
Image
Lit preview image.

Parameters

NameTypeDefaultRangeDescription / Options
Light Angle
angle
Angle
315— / step 1

Direction of the light on the image plane.

Light Height
elevation
Angle
45— / step 1

Vertical orbit angle of the light. 0 is horizontal from the light angle side, 90 is overhead, 180 is horizontal from the opposite side, and 270 is below/back.

Base Brightness
ambient
Float
0.350–1 / step 0.01

Brightness kept even on surfaces facing away from the light.

Light Strength
intensity
Float
0.850–2 / step 0.01

Strength of the direct light.

Height Strength
height_strength
Float
20–12 / step 0.1

How strongly the height map bends the preview shading.

AO Strength
shadow_strength
Float
0.60–1 / step 0.01

How much the AO map darkens creases and gaps.

Cast Shadow Strength
cast_shadow_strength
Float
0.450–1 / step 0.01

How strongly higher pixels cast shadows onto lower pixels.

Cast Shadow Length
cast_shadow_length
Float
160–128 / step 1

How far cast shadows can reach when the light height is positive. Lower positive heights make visible shadows longer.

Cast Shadow Detail
cast_shadow_steps
Int
161–128

How many checks are used when looking for shadow-casting height.

Base Roughness
roughness
Float
0.650–1 / step 0.01

Roughness used when no roughness map is connected. Lower makes a sharper, stronger specular hotspot.

Highlight Anchor
highlight_anchor_mode
Enum
Absolute—

Whether highlight stages are judged on absolute physics or anchored to the image maximum.

  • AbsoluteAbsolute
    Highlight stages use fixed physical thresholds. Top stages can disappear under low light.
  • RelativeMaxRelativeMax
    The brightest area in the image always reaches the top highlight stage, even under low light.
Rim Highlight Strength
rim_highlight_strength
Float
00–1 / step 0.01

Illustrative correction that guarantees the top highlight on the lit edge of the silhouette. 0 disables it.

Rim Highlight Width
rim_highlight_width
Float
1.50–4 / step 0.5

How many pixels the rim highlight reaches inward from the silhouette edge.

Lighting Settings
lighting_definition_mode
Enum
Custom—

Choose whether this node uses its own color rules or a saved lighting definition.

  • CustomCustom
    Use the settings shown on this node.
  • DefinitionDefinition
    Use a saved Surface Lighting definition. Editing the definition updates nodes that reference it.
Lighting Definition ID
lighting_definition_id
Text
core:pixel_basic—

Saved Surface Lighting definition used by this preview.

Palette Finish Override
lighting_definition_palette_override
Enum
AsDefined—

Per-node override for the definition's palette finishing stage. Lets one definition serve both palette-rounded and full-color scenes.

  • AsDefinedAsDefined
    Apply the palette rounding/staging exactly as the definition specifies.
  • ForceOffForceOff
    Keep the definition's OKLCH shading but skip its palette rounding/staging on this node only.
Tone Color Mode
tone_grade_mode
Enum
Off—

Choose whether shadows and highlights also shift color.

  • OffOff
    Keep lighting as brightness changes only.
  • OKLCHOKLCH
    Shift shadow and highlight colors in OKLCH before palette snapping.
Tone Step Mode
tone_grade_steps_mode
Enum
Smooth—

Choose whether the OKLCH color shift is smooth or stepped.

  • SmoothSmooth
    Change the color continuously with the lighting amount.
  • StepsSteps
    Round the color shift into a small number of pixel-art-like steps.
Tone Color Strength
tone_grade_strength
Float
10–1 / step 0.01

Overall strength of the OKLCH shadow and highlight color shift.

Shadow Steps
shadow_grade_steps
Int
21–16

Number of shadow levels when Tone Step Mode is Steps.

Highlight Steps
highlight_grade_steps
Int
21–16

Number of highlight levels when Tone Step Mode is Steps.

Shadow Tone Detail
shadow_tone_detail_mode
Enum
Shared—

Choose whether normal shadows share one tone rule or use per-step rules.

  • SharedShared
    Use one OKLCH adjustment for all normal shadow strengths.
  • PerStagePerStage
    Use separate OKLCH adjustments for each shadow step.
Shadow OKLCH Adjust
shadow_oklch_adjust
OklchAdjust
[-12,0,8,0]—

Lightness, chroma, and hue shift applied to full shadow.

Cast Shadow Tone
cast_shadow_tone_mode
Enum
SameAsShadow—

Choose whether cast shadows use the same tone as normal shadows or their own adjustment.

  • SameAsShadowSameAsShadow
    Use the normal shadow OKLCH adjustment for cast shadows too.
  • SeparateSeparate
    Use a separate OKLCH adjustment for cast shadows.
Cast Shadow Steps
cast_shadow_grade_steps
Int
21–16

Number of cast-shadow color levels.

Cast Shadow OKLCH Adjust
cast_shadow_oklch_adjust
OklchAdjust
[-18,-0.01,10,0]—

Lightness, chroma, and hue shift applied only to cast shadows.

Highlight OKLCH Adjust
highlight_oklch_adjust
OklchAdjust
[8,0,-4,0]—

Lightness, chroma, and hue shift applied to full highlight.

Shadow Start Threshold
shadow_stage_start
Float
0.180–0.9 / step 0.01

Shadow amount below this stays the base color. Raising the stage count only subdivides the range above this threshold, so the base-color band never disappears.

Highlight Start Threshold
highlight_stage_start
Float
0.60–0.95 / step 0.01

Highlight amount below this stays the base color. Keeps a base-color band between shadows and highlights regardless of stage counts.

Shadow Air Color
shadow_converge_enabled
Bool
false—

Pulls each color's shadow hue toward one shared air color by the shortest direction. Applied after the OKLCH adjust, so reds rotate toward purple and greens toward blue-green automatically - per-color directions the uniform adjust cannot express.

Shadow Air Color Target
shadow_converge_color
Color
[0.3499999940395355,0.36000001430511475,0.6200000047683716,1]—

The shared air color shadows converge toward. Bluish purples are the classic pick.

Shadow Hue Converge %
shadow_converge_hue_rate
Float
300–100 / step 1

How strongly shadow hues rotate toward the air color (scaled by shadow depth). 20-40 keeps each color's identity; 100 aligns every shadow hue to the air color.

Shadow Lightness Converge %
shadow_converge_lightness_rate
Float
00–100 / step 1

Advanced: also pulls shadow lightness toward the air color. Deepens shadows into the atmosphere; keep 0 for normal use.

Shadow Chroma Converge %
shadow_converge_chroma_rate
Float
00–100 / step 1

Advanced: also pulls shadow chroma toward the air color. Keep 0 for normal use.

Highlight Light Color
highlight_converge_enabled
Bool
false—

Pulls highlight hues toward one light color by the shortest direction (e.g. every highlight leaning orange at sunset).

Highlight Light Color Target
highlight_converge_color
Color
[1,0.9300000071525574,0.75,1]—

The light color highlights converge toward.

Highlight Hue Converge %
highlight_converge_hue_rate
Float
300–100 / step 1

How strongly highlight hues rotate toward the light color (scaled by highlight strength).

Highlight Lightness Converge %
highlight_converge_lightness_rate
Float
00–100 / step 1

Advanced: also pulls highlight lightness toward the light color. Keep 0 for normal use.

Highlight Chroma Converge %
highlight_converge_chroma_rate
Float
00–100 / step 1

Advanced: also pulls highlight chroma toward the light color. Keep 0 for normal use.

Palette Stage Mode
palette_stage_mode
Enum
Off—

How palette colors are applied after lighting.

  • OffOff
    Keep the lit colors without palette snapping.
  • NearestNearest
    Snap the final lit color to the nearest connected palette color.
  • StageIndicesStageIndices
    Use selected palette indices for shadow and highlight stages.
Palette Snap Strength
palette_snap_strength
Float
10–1 / step 0.01

How strongly the selected palette color replaces the lit color.

Shadow 1 Index
shadow_stage_1_index
Int
10–255

Palette index used for the first shadow stage.

Shadow 2 Index
shadow_stage_2_index
Int
20–255

Palette index used for the darker shadow stage.

Highlight 1 Index
highlight_stage_1_index
Int
30–255

Palette index used for the first highlight stage.

Highlight 2 Index
highlight_stage_2_index
Int
40–255

Palette index used for the stronger highlight stage.

Shadow 1 Threshold
shadow_stage_1_threshold
Float
0.180–1 / step 0.01

Shadow amount needed to use Shadow 1.

Shadow 2 Threshold
shadow_stage_2_threshold
Float
0.450–1 / step 0.01

Shadow amount needed to use Shadow 2.

Highlight 1 Threshold
highlight_stage_1_threshold
Float
0.750–2 / step 0.01

Highlight amount needed to use Highlight 1.

Highlight 2 Threshold
highlight_stage_2_threshold
Float
1.050–2 / step 0.01

Highlight amount needed to use Highlight 2.

Preserve Alpha
palette_preserve_alpha
Bool
true—

Keep the original alpha when replacing colors with palette stages.

Emission Strength
emission_strength
Float
10–4 / step 0.05

How strongly the emission map adds light.

Light Color
light_color
Color
[1,0.9599999785423279,0.8799999952316284,1]—

Color of the direct light.

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; and ambient. Establish the basic light and dark first.
  • Basic pixel-art finishing path:
    1. Set tone_grade_mode = OKLCH to apply color rules to shadows and highlights.
    2. Set tone_grade_steps_mode = Steps for discrete stages; two shadow steps are standard.
    3. Connect the project palette to palette and snap through palette_stage_mode.
  • When several assets share the same lighting rules, save and reference a lighting definition with lighting_definition_mode = Definition instead of configuring every node. Definitions live in user_data/definitions/lighting/ and can be shared between assets.
  • Cast shadows through cast_shadow_* determine contact. Lower elevation for longer shadows.
  • If highlights look soft, lower roughness for a sharper, stronger specular hotspot.
  • If the top highlight stage disappears under heavy shadow settings, set highlight_anchor_mode = RelativeMax so the brightest area always reaches the top stage (an illustrative correction).
  • To emphasize the lit edge, raise rim_highlight_strength: it guarantees the top highlight on the light-facing 1-2px of the silhouette - the classic pixel-art rim highlight (a stylistic, non-physical correction).

Common pitfalls

  • The result is flat: height_strength is 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 with elevation from 180–360. Height-map cast shadows are enabled only for upper lights from 0–180.
  • Palette stepping produces unexpected colors: StageIndices uses palette indices. Check the connected palette order against shadow_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 change angle and confirm the shadow direction.
  • Add a lamp emission_map and adjust the glow with emission_strength.
  • Raise height_strength and inspect how strongly brick mortar falls into shadow.
  • On a brick or block Surface, raise cast_shadow_strength, lower elevation, and check that shadows extend from height changes.
  • With tone_grade_mode = OKLCH, add slightly to H in shadow_oklch_adjust and subtract slightly from H in highlight_oklch_adjust to apply consistent color rules to every shadow and highlight.
  • With tone_grade_steps_mode = Steps and shadow_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 = PerStage and shadow_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 = Separate and cast_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, set palette_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 Surface
  • quick_shade — beginner version of this system contained in one node
  • surface_export — export the unlit Surface as engine textures
  • surface_edge_highlight — emphasize edge light separately
Back to Node List