KhronosGroup / KhronosGroup/glTF
Remaining issues with the tangent space
- Dominant language
- HTML
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 17h 26m
- Merged PRs (30d)
- 5
Description
A gist of open questions and suggestions wrt glTF tangent space definitions (mostly sourced from #1252).
1. The MikkTSpace algorithm is not directly applicable to an indexed mesh that was not exported with tangents in mind. Such meshes require "unindexing" before processing.
- [x] **Suggested action**: None, since it's an implementation detail.
2. The MikkTSpace algorithm has one configurable parameter (`fAngularThreshold`). It is not used by default.
- [x] **Suggested action**: None. This is not an issue since the spec explicitly mentions "... default MikkTSpace ...".
3. The key to correctly working normal maps is that exactly the same process is used both for baking and for sampling per-fragment normal vector values. This comprises two sub-issues:
1. Per-vertex vs per-fragment bitangent reconstruction. A misalignment there may break lighting in certain cases. It seems that the industry is moving towards the per-fragment approach.
- [ ] **Suggested action**: TBD.
2. At which point(s) should renormalization occur?
- [ ] **Suggested action**: TBD.
Note that the third entry of the list above applies to all normal maps, even when the tangents are provided.
References:
- http://www.mikktspace.com/
- https://github.com/mmikk/MikkTSpace/blob/master/mikktspace.h
- https://bgolus.medium.com/generating-perfect-normal-maps-for-unity-f929e673fc57
/cc @bghgary @emackey @javagl @donmccurdy
Contributor guide
Research direction
Start with the unresolved third item in this issue and review the linked MikkTSpace references, especially mikktspace.h and the normal-map article. Determine the agreed handling of per-vertex versus per-fragment bitangent reconstruction and renormalization. Done means the open questions have a decided specification action rather than a TBD status.
Written by the indexing model from the issue text.
Assessment
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100