HeadlinesBriefing favicon HeadlinesBriefing.com

UE5 Colored Penumbra Shader Effect

Hacker News •
×

A developer has created a shader implementation that adds colored penumbra effects to Unreal Engine 5 dynamic shadows. Inspired by Romain Durand's work, this technique enhances shadow regions with color rather than keeping them monochromatic. The implementation creates more visually interesting lighting by adding subtle color variations to shadow edges, particularly in scenes with multiple light sources.

The approach works by editing engine shaders, specifically SubstrateDeferredLighting.ush or DeferredLightPixelShaders.usf files. This method offers significant benefits including compatibility with all light types, minimal performance impact, and straightforward implementation. Unlike post-processing solutions, the technique doesn't require manually identifying light or shadow values, making it easier to implement with complex lighting systems.

The shader modification has some limitations. The color saturation applies globally rather than per-light or per-scene, requiring wide penumbras for visibility. The effect only works with dynamic lights, not baked lighting, and gray or fully-saturated surfaces won't show enhancement. Despite these constraints, the implementation provides an accessible way for developers to enhance visual quality without significant performance costs.