Skip to content

State orthonormalization policy for input normals and tangents #274

@portsmouth

Description

@portsmouth

This issue was highlighted by Arnon Marcus in a Slack discussion:

I have a question about tangent vs normal inputs. For each pair (coat or geometry), is it expected that they are always provided already perpendicular to each over? If not, is the normal expected to be the "primary" one and the tangent is expected to be realigned to the normal internally by the material? What is the exact expectation there?

In my view, I agree that we should really explain in the specification how the supplied shading normal N and anisotropy tangent T are supposed to be made consistent, if they are not orthogonal.

In detail, I would propose we assume in general the shader is supplied

  • The final bumped/perturbed shading normal $N'$.
  • The desired tangent vector defining the specular reflection anisotropy, say $T'$.
  • (These will usually be based on some reference normal $N$ and reference tangent $T$, via normal and flow mapping, but the shader does not necessarily have direct access to those).

Then we state that we do not assume that the supplied $N'$ and $T'$ are necessarily orthonormal, but if they are not, the shader should make $T'$ orthonormal to $N'$, by projecting

$$T' \rightarrow T' - (N'\cdot T') N'$$

and renormalizing.

Then the proejcted $T'$ used for anisotropy lies in the local $xy$-plane, which makes sense for the microfacet theory we discuss.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions