Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent Behavior of Baked Normal for Outline #117

Open
crna-ruka opened this issue Nov 10, 2022 · 0 comments
Open

Inconsistent Behavior of Baked Normal for Outline #117

crna-ruka opened this issue Nov 10, 2022 · 0 comments

Comments

@crna-ruka
Copy link

crna-ruka commented Nov 10, 2022

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

  1. Open the sample scene in Baked Normal directory.
  2. Set Y rotations of each objects to 180. Much of the outlines disappear.

Screenshot
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);

@crna-ruka crna-ruka changed the title Behavior of Baked Normal for Outline is not consistent Inconsistent Behavior of Baked Normal for Outline Nov 22, 2022
yuki4080 pushed a commit to yuki4080/com.unity.toonshader that referenced this issue Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant