Skip to content

Dynamically calculate normals/tangents #4407

Answered by romainguy
paulosensorydata asked this question in Q&A
Discussion options

You must be logged in to vote

To do this automatically you can use the SurfaceOrientation class. It offers several methods that will be more or less precise based on:

  • normals only (not recommended)
  • normals + tangents (sign of W determines bitangent orientation)
  • normals + uvs + positions + indices
  • positions + indices

In addition if you won't use normal mapping or anisotropy, you can just make up the tangents/bitangents (set one to +X and the other one to +Y always for instance).

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@paulosensorydata
Comment options

@romainguy
Comment options

Answer selected by paulosensorydata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants