// Copyright (c) .NET Foundation and Contributors (https://dotnetfoundation.org/ & https://stride3d.net) and Silicon Studio Corp. (https://www.siliconstudio.co.jp)
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.

namespace Stride.Rendering.Images
{
    /// <summary>
    /// Combines persistence with current brightness.
    /// Expects as input:
    /// - Texture0: current brightness
    /// - Texture1: persistence brightness
    /// </summary>
    internal shader BloomAfterimageCombineShader : ImageEffectShader
    {

        stage override float4 Shading()
        {
	        float3 currentColor = Texture0.Sample(PointSampler, streams.TexCoord).rgb;
            float3 persistenceColor = Texture1.Sample(PointSampler, streams.TexCoord).rgb;

            float3 result = max(currentColor, persistenceColor);
	        return float4(result, 1.0);
        }
    };
}
