static float EvaluateHistoryValidityPointShadow(HDCamera hdCamera, LightData lightData, HDAdditionalLightData additionalLightData)
        {
            // We need to set the history as invalid if the light has moved (rotated or translated),
            float historyValidity = 1.0f;

            if (additionalLightData.previousTransform != additionalLightData.transform.localToWorldMatrix ||
                !hdCamera.ValidShadowHistory(additionalLightData, lightData.screenSpaceShadowIndex, lightData.lightType))
            {
                historyValidity = 0.0f;
            }

            // We need to check if the camera implied an invalidation
            historyValidity *= EvaluateHistoryValidity(hdCamera);

            return(historyValidity);
        }
Exemple #2
0
        static float EvaluateHistoryValidityDirectionalShadow(HDCamera hdCamera, int dirShadowIndex, HDAdditionalLightData additionalLightData)
        {
            // We need to set the history as invalid if the directional light has rotated
            float historyValidity = 1.0f;

            if (additionalLightData.previousTransform.rotation != additionalLightData.transform.localToWorldMatrix.rotation ||
                !hdCamera.ValidShadowHistory(additionalLightData, dirShadowIndex, GPULightType.Directional))
            {
                historyValidity = 0.0f;
            }

    #if UNITY_HDRP_DXR_TESTS_DEFINE
            if (Application.isPlaying)
            {
                historyValidity = 0.0f;
            }
            else
    #endif
            // We need to check if something invalidated the history buffers
            historyValidity *= EvaluateHistoryValidity(hdCamera);

            return(historyValidity);
        }