﻿// 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
{
    class MaterialHairDirectionFunctionTangent : IMaterialHairDirectionFunction
    {
        float3 Compute(float3 normalOS, float4 tangentOS, float3x3 worldInverseTranspose)
        {
            tangentOS.xyz = normalize(tangentOS.xyz);   // TODO: PERFORMANCE: Normalization required?
            const float3 tangentWS = normalize(mul(tangentOS, worldInverseTranspose));    // TODO: PERFORMANCE: Is this normalization required?
            return tangentWS;
        }
    };
}
