// 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
{
    /// <summary>
    /// Converts diffuse color
    /// </summary>
    shader MaterialSurfaceDiffuse : IMaterialSurfacePixel
    {
        compose ComputeColor diffuseMap;

        override void Compute()
        {
            var colorBase = diffuseMap.Compute();
            streams.matDiffuse = colorBase;

            // Because matDiffuse can be modified when using a metalness, we are storing the colorBase into matColorBase
            // so that we are able to query the original diffuse color without any modifications.
            streams.matColorBase = colorBase;
        }
    };
}
