The Architectural Failure of Screen-Space Post-Process Cel Shaders in Fast Combat
At Outlore, when engineering high-speed action combat pipelines, we reject hacky screen-space post-process wrappers for core gameplay rendering. In fast-paced action combat games, screen-space cel shading disintegrates under intense hit flashes, dynamic particle emitters, and rapid camera rotations. Sampling SceneColor and lighting buffers in screen space creates severe light bleeding, temporal anti-aliasing (TAA) ghosting, and stencil conflicts during rapid camera cuts. True anime stylized combat demands precise hardware-level control over the lighting pass: cleanly utilizing G-Buffer channels without introducing memory bus bottlenecks, computing deterministic discrete light bands in deferred passes, and preventing engine bloat from degrading our sub-millisecond frame budget. Read technical details on outlore game studio project ronin. Reference: Fixing Unreal Insights Game Thread Hitches in Combat. Reference: UE5 Swept Melee Collision: SweepMultiByChannel C++.
Relying on post-process edge detection and luminance-based thresholding assumes a static, predictable scene. When your combat loop involves frame-advantage pressure, multi-hit string combos, screen-space distortion waves, and dozens of overlapping point-light hit reactions, screen-space edge filters fail entirely. The thresholding calculations lose spatial coherence across frames, creating flickering outlines and muddy luminance bands that break the clean, intentional aesthetic of non-photorealistic rendering (NPR). Read technical details on project ronin action combat souls-like. Reference: Building Souls-Like Poise & Hyper Armor in UE5 C++.
Hardware G-Buffer Layout Optimization: Hijacking Clear Coat Channels
To achieve production-grade NPR without expanding Multiple Render Target (MRT) bandwidth or exhausting memory bus limits, we must integrate our shading model directly into Unreal Engine's deferred rendering pipeline. Modifying the G-Buffer structure to add dedicated custom textures introduces severe memory overhead and bandwidth penalties. Instead, a cleaner architectural approach is hijacking an existing, unused or repurposed shading model—such as Clear Coat—or defining a custom shading model enum value in EngineTypes.h that routes through CustomData channels. Read technical details on unity c++ engine garbage collection custom engine.
By repurposing the CustomData payload (such as CustomData.a or unused roughness bits), we pass artistic parameters like shadow thresholds, ramp selection indices, and specular sharpness flags directly into the deferred lighting pass. This avoids allocating extra render target textures and keeps our G-Buffer memory footprint tight. Read technical details on Custom HLSL Global Shaders in UE5: C++ & RDG Guide.
// Engine/Source/Runtime/Engine/Classes/Engine/EngineTypes.h
UENUM()
enum EMaterialShadingModel
{
MSM_Unlit UMETA(DisplayName = "Unlit"),
MSM_DefaultLit UMETA(DisplayName = "Default Lit"),
MSM_SubSurface UMETA(DisplayName = "Subsurface"),
MSM_CustomToon UMETA(DisplayName = "Custom Toon Shading"),
MSM_MAX UMETA(Hidden),
};Mathematical NdotL Warping and Discrete Tone Quantization in USF Shaders
Standard PBR lighting relies on smooth, continuous microfacet distributions (like GGX) that model physical light attenuation. Anime and cel-shaded aesthetics require discrete, stepped quantization of the dot product between the surface normal and the light direction ($N \cdot L$). Evaluating stepped half-Lambert lighting and tone ramps directly inside deferred lighting equations (specifically within DeferredLightPixelShader.usf or BDirectLighting.ush) preserves local point and spot light integrity without turning overlapping combat lights into muddy gradients.
// DeferredLightPixelShader.usf / ToonLighting.ush snippet
float ComputeToonShading(float3 Normal, float3 LightDirection, float CustomThreshold, float CustomSmoothness)
{
float NdotL = dot(Normal, LightDirection);
// Half-Lambert transformation for stylized wrap-around lighting
float halfLambert = NdotL * 0.5 + 0.5;
// Discrete quantization step
float shaded = smoothstep(CustomThreshold - CustomSmoothness, CustomThreshold + CustomSmoothness, halfLambert);
return shaded;
}Neutralizing Engine Tonemapper Conflicts for Saturated Anime Palettes
A common trap when implementing custom shading models in Unreal Engine is the default ACES filmic tonemapper. ACES is engineered to simulate physical film response curves, which naturally compress highlights, desaturate saturated primary colors, and introduce shoulder roll-off that destroys flat, vibrant anime color palettes. To achieve pure, saturated anime colors, developers must either bypass the tonemapper in specific shader permutations or normalize the G-Buffer output targets so that unclipped material colors retain their exact hue and saturation values.
As noted by graphics engineers exploring pipeline modifications, keeping the custom lighting calculations lightweight is entirely achievable. In well-structured implementations, the custom shading model adds as little as a single instruction per material pass, avoiding performance regressions while delivering a completely unique visual identity.
Decoupling Diffuse Quantization from Specular Breaks and Facial SDFs
True anime combat aesthetics—such as those seen in titles from Arc System Works—rely heavily on specialized styling rules that violate realistic optics. Specular highlights on hair and clothing should not follow microfacet roughness distribution; instead, they require hard-step geometric shapes or texture-driven specular masks. Furthermore, character faces require custom lighting solutions like camera-aligned vertex normal transfers and light-direction projected Signed Distance Field (SDF) face shadow masks to ensure noses and jaws cast clean, appealing shadow shapes regardless of where the actual scene light is positioned.