|
|
|
|
|
|
#else |
|
|
|
); |
|
|
|
#endif |
|
|
|
|
|
|
|
#if (SUPPORT_ASYMMETRY == 0) |
|
|
|
lighting.radianceComplete = lighting.radianceNoPhase; |
|
|
|
#endif |
|
|
|
|
|
|
|
#if ENABLE_REPROJECTION |
|
|
|
// Reproject the history at 'centerWS'. |
|
|
|
float2 reprojPosNDC = ComputeNormalizedDeviceCoordinates(centerWS, _PrevViewProjMatrix); |
|
|
|
|
|
|
// to prevent ghosting. |
|
|
|
_VBufferLightingFeedback[uint3(posInput.positionSS, slice)] = float4(blendedRadiance, dt); |
|
|
|
|
|
|
|
#if SUPPORT_ASYMMETRY |
|
|
|
// TODO: how to ensure we do not divide by 0? |
|
|
|
float3 phaseCurrFrame = lighting.radianceComplete / lighting.radianceNoPhase; |
|
|
|
// Use max() to prevent division by 0. |
|
|
|
float3 phaseCurrFrame = lighting.radianceComplete * rcp(max(lighting.radianceNoPhase, FLT_MIN)); |
|
|
|
#else |
|
|
|
#endif // SUPPORT_ASYMMETRY |
|
|
|
|
|
|
|
#else // ENABLE_REPROJECTION |
|
|
|
|
|
|
|
#if SUPPORT_ASYMMETRY |
|
|
|
#else // SUPPORT_ASYMMETRY |
|
|
|
float3 blendedRadiance = lighting.radianceNoPhase; |
|
|
|
#endif // SUPPORT_ASYMMETRY |
|
|
|
|
|
|
|
#endif // ENABLE_REPROJECTION |
|
|
|
|
|
|
|
// Compute the transmittance from the camera to 't0'. |
|
|
|