// 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.Materials
{
    // Temporary code for testing IMaterialSurface
    shader MaterialSurfaceStreamShading<MemberName TStreamName, MemberName TStreamRGB, bool RemapSigned> : ShadingBase, MaterialPixelShadingStream
    {
        stage override float4 Shading()
        {
            // Run surface shading but don't take the result
            base.Shading();
            var value = streams.TStreamName;
            if (RemapSigned)
                value = value * 0.5f + 0.5f;
            return float4(value.TStreamRGB, 1.0f);
        }
    };
}
