float3 GetWorldPositionForLightFunctionTexturePosition(float2 ScreenPosition)
{
// Pick a depth to evaluate the light function at
float SceneDepth = 0.5f;
float4 HomogeneousWorldPosition = mul(float4(ScreenPosition, SceneDepth, 1), ShadowToWorld);
return HomogeneousWorldPosition.xyz;
}
So why use SceneDepth = 0.5f to reconstruct world position?
And the world position reconstruct method is different from the method used in the Directional Lighting Function which used the depth from the depth buffer.
But the light function material must be same, can’t set a light function material for Volumetric Fog, set other light function material for directional light.
I meet the problem that the light function is right for directional light, and is not right for volumetric fog.
Is some method let light function for volumetric fog don’t work, and use volumetric fog voxel’s center position to calculate light function?
Thansk.