|
|
|
|
|
|
float3 TransformObjectToWorldNormal(float3 normalOS) |
|
|
|
{ |
|
|
|
#ifdef UNITY_ASSUME_UNIFORM_SCALING |
|
|
|
return UnityObjectToWorldDir(normalOS); |
|
|
|
return TransformObjectToWorldDir(normalOS); |
|
|
|
// mul(IT_M, norm) => mul(norm, I_M) => {dot(norm, I_M.col0), dot(norm, I_M.col1), dot(norm, I_M.col2)} |
|
|
|
return normalize(mul(normalOS, (float3x3)GetWorldToObjectMatrix())); |
|
|
|
#endif |
|
|
|
} |
|
|
|