Accessing "lighting only" pass in a post process material

I’m working on a project with an NPR cell shaded look. This is being achieved with substrate materials and post process shaders that are limited to certain objects using stencils.

For the most part it’s working great but it’s become a real bug bear that I cannot access the lighting data directly in a post process.

I have a coding background but I’m not very familiar with HLSL and whilst spelunking about amongst the Engine/Shaders/Private files (USF/USH) I’m finding a maze with many corridors all alike.

Is there a relatively simple change I could make to the USF/USH to have my project (Running unreal engine 5.3) output the straight lighting data in place of the rendered image. Much like I’d see in the “lighting only” option in the viewport.

2 Likes

Did you ever figure it out?