Hi, I’m trying to achieve a specific effect in a horror game, which would cause certain actors to ignore indirect lighting and be affected by direct lighting only. Is this possible? Alternately, is it possible to temporarily change the values of the volumetric lightmap within a specific area, or is that immutable at runtime?
Look at lighting channels
Unfortunately lighting channels only work with moveable lights, which don’t affect the indirect volumetric lighting. After doing some more research, I think I might have found a solution, although it requires a few modifications to the engine’s shader code. If I get it figured out I’ll post the solution here in case anyone else in the future has the same issue.
Got it working! My solution was to add the CustomData0 parameter to the DefaultLit shader (which only requires editing a small handful of source files), and then in BasePassPixelShader.usf, in the GetPrecomputedIndirectLightingAndSkyLight function which applies indirect lighting, you can multiply all of the indirect lighting output by CustomData0’s value at the end of the function. Now in your materials, you can set the value of CustomData0 and it will let you determine how much indirect lighting you want a material to receive. Note that you could also create a new shader for this effect if you don’t want to modify the existing DefaultLit shader, but this requires editing a fair amount more of files. For reference, this was in 4.26, so I’m not sure how applicable this solution will be to other versions.