NVIDIA GameWorks Integration

I managed to get point light shadows working by adding in the following into bool FDeferredShadingSceneRenderer::RenderOnePassPointLightShadows class in ShadowRendering.cpp:


	// NVCHANGE_BEGIN: Add VXGI
	#if WITH_GFSDK_VXGI
	if (bVxgiPerformEmittanceVoxelization && bVxgiUseDiffuseMaterials && ProjectedShadowInfo != 0)
	{
		SCOPE_CYCLE_COUNTER(STAT_VxgiVoxelizeEmittanceFromDiffuseMaterialsShadowed);
		SCOPED_DRAW_EVENT(RHICmdList, VXGIVoxelizeEmittanceFromDiffuseMaterialsShadowed);

		RenderForVxgiVoxelization(VXGI::RenderMeshFilter::ALL_MESHES, LightSceneInfo, ProjectedShadowInfo);
	}
	#endif
	// NVCHANGE_END: Add VXGI

So it renders the vxgi with shadows for point lights but for some reason doesn’t inject the shadow information into the voxelization process. Not sure what its doing differently from spotlight shadows.

Point light shadow r.VXGI.DebugMode 3:

Spotlight shadow r.VXGI.DebugMode 3:

[edit] I figured out why it isn’t voxelizing the point light shadows - its because that is done separately to the other shadows. The voxelization code needs to read from the point light shadow cubemap texture.