// 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.Lights
{
    /// <summary>
    /// Filters the texture projected by a light using a linear sampler at the specified mip map level.
    /// </summary>
    /// <remarks>
    /// PerLightGroup: Parameter used to uniquely identify this group of lights.
    /// </remarks>
    internal shader TextureProjectionFilterDefault<MemberName PerLightGroup> :
        TextureProjectionCommon<PerLightGroup>, // Defines "ProjectionTexture".
        Texturing  // Defines "LinearSampler".
    {
        // Filters the projected texture using a linear sampler at the specified mip map level.
        float3 FilterProjectedTexture(float2 textureCoordinate, float mipMapLevel)
        {
            return ProjectionTexture.SampleLevel(LinearSampler, textureCoordinate * UVScale + UVOffset, mipMapLevel).rgb;
        }
    };
}
