|
|
|
|
|
|
|
|
|
|
void OutputTangentToWorld(half4 vertexTangent, half3 vertexNormal, out half3 tangentWS, out half3 binormalWS, out half3 normalWS) |
|
|
|
{ |
|
|
|
// mikkts space compliant. only normalize when extracting normal at frag. |
|
|
|
tangentWS = normalize(mul((half3x3)UNITY_MATRIX_M, vertexTangent.xyz)); |
|
|
|
tangentWS = TransformObjectToWorldDir(vertexTangent.xyz); |
|
|
|
binormalWS = cross(normalWS, tangentWS) * sign; |
|
|
|
} |
|
|
|
|
|
|
|