
Custom Shader Rendering is a fully modular post-process and rendering pipeline inside Unreal Engine built using C++, HLSL, and the global shader system. It supports runtime toggles, full view extension injection, and pixel shader effects.
FRDGBuilder)..usf shaders.AddPass().Sample pixel shader logic from a custom pass:
float3 SceneColor = SceneTextureLookup(UV, 0).rgb;
float3 SceneNormal = SceneTextureLookup(UV, 8).rgb;
float3 SceneDepth = SceneTextureLookup(UV, 1).rrr;
// Generate screen-space outlines by comparing normals
float3 N1 = normalize(SceneNormal);
float3 N2 = normalize(SceneTextureLookup(UV + float2(1.0/ViewportSize.x, 0), 8).rgb);
float Outline = step(0.1f, distance(N1, N2));
// Time-based pulse effect on glow
float Pulse = 0.5 + 0.5 * sin(GlobalTimeVec4.x * 4.0);
float3 Glow = Pulse * float3(1.0, 0.6, 0.1);
// Combine everything
float3 FinalColor = lerp(SceneColor, Glow, Outline);
return float4(FinalColor, 1.0);
Stencil Vision Project This project explores a full custom rendering pipeline in Unreal Engine using C++, HLSL (`.usf`), and the global shader system.