Skip to content
unreal · rendering

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.
KBVEPostShaderPlugin
UE 5.7Min engine
Post-tonemapStage
KBVELicense

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:

  1. Mask — pixels without a stencil tag pass through untouched (unless r.KBVEPost.Mask 0).
  2. Ink — a 3×3 Sobel on luma, thresholded and scaled, darkens edges. Stencil value 2 stops here: outlines only.
  3. 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

CVarDefaultPurpose
r.KBVEPost.Enable0Master on/off.
r.KBVEPost.Bands4Cel luminance bands.
r.KBVEPost.BandSoftness0.3Softness of band transitions (0 = hard toon step).
r.KBVEPost.DetailRecover6Keeps high-gradient detail out of the bands.
r.KBVEPost.EdgeStrength3.0Ink outline darkening.
r.KBVEPost.EdgeThreshold0.4Sobel threshold; higher keeps silhouettes only.
r.KBVEPost.Saturation1.25Output saturation.
r.KBVEPost.Brightness1.05Output brightness lift.
r.KBVEPost.Mask11 = stencil-tagged meshes only, 0 = whole screen.
r.KBVEPost.Debug0Tint 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.

Terminal window
r.KBVEPost.Enable 1
r.KBVEPost.Mask 0

Roadmap

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.