Cel P7: built-in cel shading — toon lighting + outlines, whole scene or avatars only #550

Closed
opened 2026-10-08 06:28:04 +00:00 by sky_line · 1 comment
Owner

Part of epic #542 (from #186). Design + code citations are in the epic; read it first.

Size: L (5-7 d)

The first built-in effect. Native, not FX: the lighting needs the in-pass hook.

Scope

  • Toon lighting in lightSurface() (clean_surface_light.glsl:86, shared by forward and clean_deferred_light.comp):
    • quantized sun/moon N·L ramp (bands, softness, shadow tint)
    • banded local lights
    • flattened ambient
    • rim light
    • optional specular step
    • Per-pixel enable:
      • forward: instance flags + avatar slot -> P6's selection SSBO
      • deferred: 1 bit in G2.w model byte (bit 3; bits 3-7 free, clean_gbuffer.glsl:48)
    • Whole-scene mode = global flag.
    • Applies in snapshots, mirrors and probe captures via the shared path.
  • Outlines: a native compute pass at the in-scene pre-TAA point (after pass-1 lighting, before pass 2, ~llcleanrenderervk.cpp:26146), render-res on sceneHdr(), so TAA anti-aliases the lines and alpha / water draw on top.
    • Edges come from id discontinuity (silhouette vs world, avatar vs avatar), linear-depth discontinuity (self-occlusion) and normal creases.
    • Avatars-only mode uses a dilated mask (the outer silhouette is drawn on world pixels too).
    • Width in display px, exposure-aware colour, distance fade.
  • Controls: settings RenderVKCel* + Photo Studio Effects "Cel shading" section + right-click avatar "Cel shade this avatar". Saved in Photo Studio presets.
  • Later / optional (separate ticket if wanted): an inverted-hull outline mode as one extra MDI over the rigged buckets from mSkinVbo (front-face cull, clip-space extrusion via spec constant in clean_draw_rigged.vert).

Done when

  • Avatars-only and whole-scene modes look right on mesh bodies with attachments and alpha hair: clean silhouettes against the world, arm-over-body lines, no outline crawl under TAA / camera motion.
  • Forward and deferred produce the same image (A/B screenshot).
  • Snapshot (incl. supersampled) matches the live view.
  • Cost ≤ 0.3 ms at 1440p (3060-class) incl. P6; 0 when off.
Part of epic #542 (from #186). Design + code citations are in the epic; read it first. **Size:** L (5-7 d) The first built-in effect. Native, not FX: the lighting needs the in-pass hook. **Scope** - **Toon lighting in `lightSurface()`** (`clean_surface_light.glsl:86`, shared by forward and `clean_deferred_light.comp`): - quantized sun/moon N·L ramp (bands, softness, shadow tint) - banded local lights - flattened ambient - rim light - optional specular step - Per-pixel enable: - **forward:** instance flags + avatar slot -> P6's selection SSBO - **deferred:** 1 bit in G2.w model byte (bit 3; bits 3-7 free, `clean_gbuffer.glsl:48`) - Whole-scene mode = global flag. - Applies in snapshots, mirrors and probe captures via the shared path. - **Outlines:** a native compute pass at the **in-scene pre-TAA point** (after pass-1 lighting, before pass 2, ~`llcleanrenderervk.cpp:26146`), render-res on `sceneHdr()`, so TAA anti-aliases the lines and alpha / water draw on top. - Edges come from id discontinuity (silhouette vs world, avatar vs avatar), linear-depth discontinuity (self-occlusion) and normal creases. - Avatars-only mode uses a dilated mask (the outer silhouette is drawn on world pixels too). - Width in display px, exposure-aware colour, distance fade. - **Controls:** settings `RenderVKCel*` + Photo Studio Effects "Cel shading" section + right-click avatar "Cel shade this avatar". Saved in Photo Studio presets. - **Later / optional (separate ticket if wanted):** an inverted-hull outline mode as one extra MDI over the rigged buckets from `mSkinVbo` (front-face cull, clip-space extrusion via spec constant in `clean_draw_rigged.vert`). **Done when** - [ ] Avatars-only and whole-scene modes look right on mesh bodies with attachments and alpha hair: clean silhouettes against the world, arm-over-body lines, no outline crawl under TAA / camera motion. - [ ] Forward and deferred produce the same image (A/B screenshot). - [ ] Snapshot (incl. supersampled) matches the live view. - [ ] Cost ≤ 0.3 ms at 1440p (3060-class) incl. P6; 0 when off.
sky_line added this to the Slipstream project 2026-10-08 06:28:04 +00:00
Author
Owner

Done: Cel P7 (built-in cel shading, 5868c1ece6). Shipped in 1.2.0 Beta 4/5 (ReShade effects + cel shading).

Done: Cel P7 (built-in cel shading, 5868c1ece6). Shipped in 1.2.0 Beta 4/5 (ReShade effects + cel shading).
sky_line 2026-10-09 09:25:23 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream#550
No description provided.