Skip to content

Fragment tangents/basis generates incorrect tangents. #4

@alecazam

Description

@alecazam
  1. Hit 8 to switch to sphere shape
  2. Hit 6 switch to viewing tangent shape channel
  3. Hit T to toggle between vertex tangents/basis and fragment tangents/basis

Vertex Tangents - are nice and smooth with a seam down the middle
Fragment Tangents - no seam, and only the same in the middle of the sphere

I had to negate T in the shader to generate right-handed tangents.
It looks like the z slope and the vertical falloff throw off the calculations
Interpolated world pos, world vertex normal, and uv are passed into the call

Original shader passed -V = (worldPos - cameraPos), but with deltas the cameraPos drops out.
So passing worldPos should be the same.
The bitangents are almost identical with small banding at the top/bottom.

Vertex Tangents
image

Fragment Tangents
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions