Graphics

NPR Stylized Lighting: The Medieval High-Contrast Prototype

Custom Shader
Post-Processing
NPR
Lighting design

Engineered a custom NPR post-processing pipeline to bridge the gap between PBR physics and stylized art direction. Features include dynamic hue remapping, non-destructive saturation gating, and stencil-based gameplay safeguards.

A stylized, high-contrast medieval scene demonstrating non-physical lighting and inverse brightness.
HDRP::CUSTOM_POST_PROCESS_VOLUMESTATUS::MODIFIED
Input Assembler[FIXED]
Vertex Shader (Fullscreen Tri)[SHADER]
Rasterizer[FIXED]
Fragment Shader[SHADER]
Output Merger[FIXED]
MODIFIED
UNTOUCHED

NPR Stylized Lighting: The Medieval High-Contrast Prototype

In implementing highly stylized Non-Photorealistic Rendering (NPR), the core challenge for a Technical Artist is deconstructing abstract artistic desires into controllable mathematical logic while making pragmatic technical trade-offs under extreme deadline pressure. This post-mortem reviews the R&D process for the “Medieval High-Contrast” lighting prototype and documents how I utilized a custom post-processing pipeline to deliberately break physical laws.

1. Visual Benchmarks & Production Reality

In the Spriggan Art Bible, the core visual pillars are defined as: Unreal, Ethereal, Melancholy, and Somber. The design specification emphasizes a world built on “Stark Contrasts”—where natural environments maintain a muted, oppressive tone, while magical or corrupted forces must erupt with “bursts of vibrant, unnatural hues.”

The Conflict: Ideal Architecture vs. Business Velocity While rewriting the underlying Custom Lighting Model is the most “architecturally sound” solution, the commercial reality was unforgiving: We needed to deliver a high-fidelity Vertical Slice for investors within 3-4 months to secure the next round of funding. Altering the massive HDRP lighting architecture posed high risks and a long development cycle. Therefore, I adopted a “Brute-force yet impactful” strategy—utilizing a Custom Pass Volume to build a black-box filter. This low-invasiveness approach allowed us to extract maximum visual impact on a very short runway.

2. Artistic Deconstruction: Breaking Physics

By deconstructing reference art from titles like Blasphemous and Marathon, I identified that the core of their high-contrast atmosphere lies in subjective, intentional “Color and Value Dislocation.” In these works, light behavior often defies physical common sense:

Style References for Spriggan
  • Subjective Hue Shifting (Unnatural Hues): The Art Bible demands a “clash” of colors. For instance, a physically red light source should, under stylized logic, cast yellow or cool highlights rather than a physically correct orange-red reflection.
  • Inverse Brightness Logic: To cultivate a “Somber” atmosphere, highly saturated colors are often given an inverse relationship with brightness. This makes energy sources feel less like standard lights and more like “ethereal entities” that warp their surroundings.

Limitations of Native Engines: Standard PBR systems are strictly energy-conserving and physics-based, making them incapable of native subjective mapping. While a global LUT can establish an environment’s “muted” tone, it acts as a flat filter and cannot handle dynamic, spatial highlight conversions for specific light sources. Only by introducing non-physical calculations in screen space can we achieve that “sharp, intentional intensity.”

3. The Custom “Black-Box” Toolset

To address artistic pain points within a tight window, I developed a custom shader pipeline that grants the Art team direct control over non-physical behaviors:

3.1 Art-Driven Color Mapping

I broke the linear continuity of color calculations, introducing a dynamic Hue remapping logic based on Day/Night environment curves.

Hue Mapping Logic Visualization
  • Mechanism: In “Day Mode,” red light sources (Hue ≈ 0/360) are forcibly remapped to yellow highlights (Hue ≈ 50); in “Night Mode,” the same red input maps to a cool sky-blue highlight (Hue ≈ 195).
  • Objective: This “deliberate technical coupling” allows artists to quickly achieve an unstable, erratic lighting atmosphere through simple curve adjustments.

3.2 Smart Value & Contrast Dynamics

  • Non-Destructive Threshold: To protect the base environment, I implemented a saturation-sensing gate. The mode only activates when the input light saturation exceeds 0.1. This means standard, low-saturation PBR sunlight (Muted tones) bypasses the system entirely, while intentional, high-saturation magical lights trigger the stylized “burst.”
  • Inverse Brightness Mapping: I implemented a variation of Vout=1VinV_{out} = 1 - V_{in} logic. When a light source is exceptionally bright, the resulting highlight is darkened, and vice versa. This grants light sources the visual characteristics of an “Ethereal Substance” rather than a physical fire.

3.3 Precision Spatial Masking

To prevent the high-contrast filter from overwhelming the visual hierarchy, I utilized multiple masking layers:

  • Highlight Extraction: Used Smoothstep to lock the color shift strictly to the lighting impact zones, effectively shielding base albedo textures from color contamination.
  • Spatio-Temporal Fading: Integrated Depth Masks and Height Limiters to ensure distant objects and vertical spaces fade gracefully back to physical lighting, maintaining the “breathing room” of the frame.
Spatial Masking and High-pass filtering

3.4 Gameplay Readability Safeguards

Visual expression must not sacrifice the player experience. At the end of the Custom Pass, I integrated Stencil Override logic.

Stencil Culling for Gameplay Clarity

By utilizing the stencil buffer, I completely excluded all enemy units from the stylized filter. No matter how chaotic or unnatural the environment lighting becomes, enemy silhouettes and highlights retain 100% physical contrast and recognizability, ensuring combat readability in a hardcore gameplay setting.

Gallery