// 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>
    /// Emissive shading
    /// </summary>
    shader MaterialSurfaceEmissiveShading<bool TUseAlphaFromEmissive> : IMaterialSurfacePixel, MaterialPixelShadingStream
    {
        override void Compute()
        {
            streams.shadingColor += streams.matEmissive.rgb * streams.matEmissiveIntensity;
            if (TUseAlphaFromEmissive)
            {
                streams.shadingColorAlpha = streams.matEmissive.a;
            }
        }
    };
}
