Gems/Atom/Feature/Common/Code/Source/PostProcessing/TaaPass.cpp
void TaaPass::GenerateFilterWeights(AZ::Vector2 jitterOffset)
    {
        static const AZStd::array<Vector2, 9> pixelOffsets =
        {
            // Center
            Vector2(0.0f, 0.0f),
            // Cross
            Vector2( 1.0f,  0.0f),
            Vector2( 0.0f,  1.0f),
            Vector2(-1.0f,  0.0f),
            Vector2( 0.0f, -1.0f),
            // Diagonals
            Vector2( 1.0f,  1.0f),
            Vector2( 1.0f, -1.0f),
            Vector2(-1.0f,  1.0f),
            Vector2(-1.0f, -1.0f),
        };

        float sum = 0.0f;
        for (uint32_t i = 0; i < 9; ++i)
        {
            m_filterWeights[i] = BlackmanHarris(pixelOffsets[i] + jitterOffset);
            sum += m_filterWeights[i];
        }

        // Normalize the weight so the sum of all weights is 1.0.
        float normalization = 1.0f / sum;
        for (uint32_t i = 0; i < 9; ++i)
        {
            m_filterWeights[i] *= normalization;
        }
    }
// Generates filter weights for the 3x3 neighborhood of a pixel. Since jitter positions are the
// same for every pixel we can calculate this once here and upload to the SRG.
// Jitter weights are based on a window function centered at the pixel center (we use Blackman-Harris).
// As the jitter position moves around, some neighborhood locations decrease in weight, and others
// increase in weight based on their distance from the center of the pixel.
Generates filter weights for the 3x3 neighborhood of a pixel. Since jitter positions are the
same for every pixel we can calculate this once here and upload to the SRG.
Jitter weights are based on a window function centered at the pixel center (we use Blackman-Harris).
As the jitter position moves around, some neighborhood locations decrease in weight, and others
increase in weight based on their distance from the center of the pixel.
Generates filter weights for the 3x3 neighborhood of a pixel . Since jitter positions are the same for every pixel we can calculate this once here and upload to the SRG . Jitter weights are based on a window function centered at the pixel center ( we use Blackman - Harris ) . As the jitter position moves around some neighborhood locations decrease in weight and others increase in weight based on their distance from the center of the pixel .
void TaaPass::GenerateFilterWeights(AZ::Vector2 jitterOffset)
    {
        static const AZStd::array<Vector2, 9> pixelOffsets =
        {
            Vector2(0.0f, 0.0f),
            Vector2( 1.0f,  0.0f),
            Vector2( 0.0f,  1.0f),
            Vector2(-1.0f,  0.0f),
            Vector2( 0.0f, -1.0f),
            Vector2( 1.0f,  1.0f),
            Vector2( 1.0f, -1.0f),
            Vector2(-1.0f,  1.0f),
            Vector2(-1.0f, -1.0f),
        };
        float sum = 0.0f;
        for (uint32_t i = 0; i < 9; ++i)
        {
            m_filterWeights[i] = BlackmanHarris(pixelOffsets[i] + jitterOffset);
            sum += m_filterWeights[i];
        }
        float normalization = 1.0f / sum;
        for (uint32_t i = 0; i < 9; ++i)
        {
            m_filterWeights[i] *= normalization;
        }
    }
void TaaPass :: GenerateFilterWeights ( AZ :: Vector2 jitterOffset ) { static const AZStd :: array < Vector2 , 9 > pixelOffsets = { Vector2 ( 0.0f , 0.0f ) , Vector2 ( 1.0f , 0.0f ) , Vector2 ( 0.0f , 1.0f ) , Vector2 ( -1.0f , 0.0f ) , Vector2 ( 0.0f , -1.0f ) , Vector2 ( 1.0f , 1.0f ) , Vector2 ( 1.0f , -1.0f ) , Vector2 ( -1.0f , 1.0f ) , Vector2 ( -1.0f , -1.0f ) , } ; float sum = 0.0f ; for ( uint32_t i = 0 ; i < 9 ; ++ i ) { m_filterWeights [ i ] = BlackmanHarris ( pixelOffsets [ i ] + jitterOffset ) ; sum += m_filterWeights [ i ] ; } float normalization = 1.0f / sum ; for ( uint32_t i = 0 ; i < 9 ; ++ i ) { m_filterWeights [ i ] *= normalization ; } }
Generates filter weights for the 3x3 neighborhood of a pixel.
Generates filter weights for the 3x3 neighborhood of a pixel .
// Center // Cross // Diagonals // Normalize the weight so the sum of all weights is 1.0.