﻿// 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
{
    shader MaterialHairShared
    {
        static const int HAIR_SHADING_SCHEUERMANN_APPROXIMATION = 0;    // These values must correspond to the ones defined in "MaterialHairShared.cs".
        static const int HAIR_SHADING_SCHEUERMANN_IMPROVED = 1;
        static const int HAIR_SHADING_KAJIYAKAY_SHIFTED = 2;

        static const int Opaque = 0;
        static const int TransparentBack = 1;
        static const int TransparentFront = 2;
        
        cbuffer PerMaterial // Changed to "PerMaterial" because otherwise PassID contains garbage, as we don't require nor execute the HairRenderFeature anymore.
        {
            stage int PassID;   // 0 == Opaque, 1 == Transparent back, 2 = Transparent front
        }

        float3 GetDebugColor(int passID)
        {
            if(passID == Opaque)
            {
                return float3(1.0, 0.0, 0.0);
            }
            else if(passID == TransparentBack)
            {
                return float3(0.0, 1.0, 0.0);
            }
            else
            {
                return float3(0.0, 0.0, 1.0);
            }
        }
    };
}