// 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
{
    shader AdditiveLightShader<bool TColor> : ImageEffectShader, Texturing
    {
        cbuffer PerFrame
        {
            [Color]
            stage float3 LightColor;
        }

        stage override float4 Shading()
        {
            float4 color = Texture0.Sample(LinearSampler, streams.TexCoord);
            if(TColor)
                return float4(color.rgb * LightColor, 1);
            return float4(color.rrr * LightColor, 1);
        }
    };
}
