Material Setup

QuickSDFTool outputs a threshold texture intended to drive stylized light-to-shadow transitions. The exact shader graph can vary by project, but the core idea is stable: compare a light-angle value against the generated texture value, then use the result to choose lit or shadow color.

Basic Shader Concept

light direction / artist control value
    compared with
SDF threshold map sample
    produces
toon shadow mask

Use the included Content/Materials/M_SDFToon.uasset as the first reference material. It is meant to show the expected data flow rather than dictate a final production shader.

Texture Expectations

Original Shading Bake Parameters

M_OriginalShading receives these dynamic parameters during the original-shading bake:

For actor-rotation-independent output, build the bake direction from Angle + BakeForwardAngleOffset and compare it with normalized PixelNormalWS.rg in the material baking space. QuickSDF neutralizes the primitive transform for this bake, so do not transform PixelNormalWS from world to local in M_OriginalShading.

Mesh Preview Material Parameters

QuickSDF loads two mesh preview material interfaces:

The opaque material is used for replacement preview and for the upper-left 2D texture preview. The overlay material is used only for the original-material overlay preview. Blend mode is not changed dynamically from C++; M_PreviewSceneColorOverlay must be a real material asset whose Blend Mode is Translucent. Do not make it a material instance of opaque M_PreviewMat, because opaque parents cannot use SceneColor.

Preview modes:

The default mesh preview mode is Original + Painted.

Both dynamic material instances receive these parameters:

For Painted + Shadow, use the same Angle + BakeForwardAngleOffset direction calculation as M_OriginalShading so the mesh preview matches the baked mask. Only M_PreviewSceneColorOverlay should be translucent. M_PreviewMat should stay opaque and should not contain a SceneColor node.

For Original + Painted, implement M_PreviewSceneColorOverlay with SceneColor multiplied by the black/white painted mask from BaseColor. C++ always sends PreviewMode = 0 to this overlay path.

The upper-left 2D texture preview uses a separate dynamic instance of M_PreviewMat and always forces PreviewMode = 0, so it remains a black/white painted texture preview regardless of the selected mesh preview mode.

Monopolar vs Bipolar

LilToon / General Toon Shader Notes

QuickSDFTool does not require a specific toon shader. For LilToon-inspired or similar pipelines, use the generated map as an authored control texture:

Keep the first integration simple. Once the direction and value range are confirmed, add project-specific ramps, softening, and color grading.