Open crna-ruka opened 1 year ago
Hi, I love this amazing shader. I've noticed that the results of Baked Normal for Outline seem to vary according to rotations of objects.
To Reproduce
Screenshot
Possible Solution
How about calculating the tangentTransform, at both line 76 of UCTS_Outline.cginc and line 82 of UCTS_Outline_Tess.cginc, in local space?
from float3x3 tangentTransform = float3x3(o.tangentDir, o.bitangentDir, o.normalDir);
float3x3 tangentTransform = float3x3(o.tangentDir, o.bitangentDir, o.normalDir);
to float3 bitangent = cross(v.normal, v.tangent.xyz) * v.tangent.w; float3x3 tangentTransform = float3x3(v.tangent.xyz, bitangent, v.normal);
float3 bitangent = cross(v.normal, v.tangent.xyz) * v.tangent.w;
float3x3 tangentTransform = float3x3(v.tangent.xyz, bitangent, v.normal);
Hi, I love this amazing shader. I've noticed that the results of Baked Normal for Outline seem to vary according to rotations of objects.
To Reproduce
Screenshot
Possible Solution
How about calculating the tangentTransform, at both line 76 of UCTS_Outline.cginc and line 82 of UCTS_Outline_Tess.cginc, in local space?
from
float3x3 tangentTransform = float3x3(o.tangentDir, o.bitangentDir, o.normalDir);
to
float3 bitangent = cross(v.normal, v.tangent.xyz) * v.tangent.w;
float3x3 tangentTransform = float3x3(v.tangent.xyz, bitangent, v.normal);