Stylized post-processKBVEPostShader
A stylized post-process aimed at a Breath of the Wild / Studio Ghibli look — soft cel luminance banding and Sobel ink outlines, restricted to stencil-tagged meshes, run as an RDG pass after the tonemapper and off by default.
RDG scene view extension
It runs as an RDG composite pass from a FSceneViewExtension, inserted after the tonemapper, gated by CVars and off by default. Scene captures and reflection captures are skipped.
- Enable —
r.KBVEPost.Enable 1. - Mask — Custom Depth-Stencil tagged meshes only, unless
r.KBVEPost.Mask 0.
What it gives you
Features
Soft cel banding
Luminance quantized into bands with a smoothstep edge, hue preserved; Sobel-driven detail recovery keeps fine detail like grass out of the bands.
Sobel ink outlines
A luma Sobel gradient past a threshold darkens edges; stencil value 2 gets outlines only, with no banding.
Stencil-masked
By default only Custom Depth-Stencil tagged meshes are styled; a debug CVar tints them red to check the mask.
CVar-gated, off by default
Every knob is an r.KBVEPost CVar; the effect ships disabled until enabled.
RDG passes
Pipeline
After the tonemapper, one full-screen composite pass (KBVEPostComposite.usf) reads scene color and the custom stencil:
- Mask — pixels without a stencil tag pass through untouched (unless
r.KBVEPost.Mask 0). - Ink — a 3×3 Sobel on luma, thresholded and scaled, darkens edges. Stencil value
2stops here: outlines only. - Cel — luminance split into soft bands with hue preserved, blended back toward the original where the Sobel gradient is high so fine detail survives, then saturation, brightness and a slight warm tint.
KBVEPostStructureTensor.usf and KBVEPostKuwahara.usf (an anisotropic Kuwahara oil-paint smear) are compiled but not yet dispatched.
Tuning
CVars
| CVar | Default | Purpose |
|---|---|---|
r.KBVEPost.Enable | 0 | Master on/off. |
r.KBVEPost.Bands | 4 | Cel luminance bands. |
r.KBVEPost.BandSoftness | 0.3 | Softness of band transitions (0 = hard toon step). |
r.KBVEPost.DetailRecover | 6 | Keeps high-gradient detail out of the bands. |
r.KBVEPost.EdgeStrength | 3.0 | Ink outline darkening. |
r.KBVEPost.EdgeThreshold | 0.4 | Sobel threshold; higher keeps silhouettes only. |
r.KBVEPost.Saturation | 1.25 | Output saturation. |
r.KBVEPost.Brightness | 1.05 | Output brightness lift. |
r.KBVEPost.Mask | 1 | 1 = stencil-tagged meshes only, 0 = whole screen. |
r.KBVEPost.Debug | 0 | Tint stencil-tagged pixels red. |
r.KBVEPost.Radius and r.KBVEPost.WatercolorStrength exist for the Kuwahara pass and have no effect until it is wired in. The Project Settings → KBVE → KBVE Post Shader page (UKBVEPostShaderSettings) is not yet read by the pass; the CVars are what count.
r.KBVEPost.Enable 1r.KBVEPost.Mask 0Roadmap
Status
Shipping: the cel/ink composite with stencil masking. Not yet wired: the structure-tensor and Kuwahara passes, and the Project Settings defaults. Planned beyond that: GBuffer-normal outlines, a warm palette LUT, a canvas overlay, flow warp, and Ghibli/BotW presets.
Questions
Frequently asked
What look does KBVEPostShader produce?
A toon look aimed at Breath of the Wild / Studio Ghibli — soft cel luminance banding with hue preserved, Sobel ink outlines, and a saturation and brightness lift. Anisotropic Kuwahara and structure-tensor shaders are in the plugin but not yet wired into the pass chain.
How is the effect rendered?
It runs as an RDG full-screen composite pass from an FSceneViewExtension inserted after the tonemapper, gated by CVars and off by default. By default it only touches meshes tagged in the Custom Depth-Stencil buffer.
How do I enable and tune it?
Set r.KBVEPost.Enable to 1 and tune CVars like r.KBVEPost.Bands, r.KBVEPost.EdgeThreshold and r.KBVEPost.Saturation. r.KBVEPost.Mask 0 applies it to the whole screen; r.KBVEPost.Debug 1 tints tagged pixels red.
Discuss on the forum
Questions, fixes and notes on this page live in the KBVE forum.