VXGI - Fallback diffuse ambient color

I am using the VXGI implementation for Unreal Engine in an architectural visualization project. Beyond the “r.vxgi.range” of tracing diffuse ambience, the ambience falls back to black resulting in a large scene going from high fidelity to very low (at this distance). In order to fix this I’d like the diffuse component, similar to specular component, to fall back to a defined color/environment map beyond the traced range. I’ve looked through many shaders but I can’t seem to find where this can be done.

You can use a sky light to add some basic ambient lighting, and it will be added globally, regardless of VXGI results. But I understand it can be useful to blend between VXGI and sky light / other solutions. In the VXGI diffuse output, the alpha channel contains “confidence” values: 1.0 where there is enough voxel data, 0.0 outside of the voxel region, and something intermediate in the transition area. You can modify some post-processing passes to use that for blending.


VXGI diffuse is added in the VXGICompositing.usf / AddVxgiDiffusePS shader.

Thanks a lot,

Skylight is not sufficient for me as it makes fully occluded areas impossible to keep dark.

For now I’ll use the info you provided and lerp to a constant when “confidence” is low, which works way better than having 0 diffuse contribution. I’d use the assigned diffuse environment map instead but I don’t know how to fetch that in VXGICompositing.usf.

Thanks again!