aboutsummaryrefslogtreecommitdiff
path: root/engine/src/core-data/Common/ShaderLib/Tangent.glsllib
blob: 308c13dd7f4314a10670fa08c306d17316b8b302 (plain)
1
2
3
4
5
6
7
8
9
10
11
uniform mat3 g_NormalMatrix;

void Tangent_ComputeVS(out vec3 outNormal, out vec3 outTangent){
    outNormal = normalize(g_NormalMatrix * inNormal);
    outTangent = normalize(g_NormalMatrix * inTangent);
}

mat3 Tangent_GetBasis(){
    vec3 wvBinormal = cross(wvNormal, wvTangent);
    return mat3(wvTangent, wvBinormal, wvNormal);
}