// 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.

shader SelectedSpriteShader : SpriteBase
{
    float Blend;

    // method computing color
    stage override float4 Shading()
    {
        float factor = fmod(streams.ShadingPosition.x, 2) * fmod(streams.ShadingPosition.y, 2);
        float4 selectionColor = float4(0.0f, 0.5f, 1, 1);
        float4 baseColor = base.Shading();

        return lerp(baseColor, selectionColor, factor * Blend * Blend * baseColor.a);
    }
};
