-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add utility for computing tangents #532
Comments
That makes sense. Note that we also have a public function to compute the quaternion tangent frame from a TBN matrix. It's in
|
What algorithm will the function use to generate the tangents if only normals are provided? |
We'll simply have a fixed random vector like (0,1,0) and cross the normal with it, a bit like this although we should probably check for when the random vector is too close to the normal, in which case we'd choose a different random vector. |
MeshAssimp.cpp does that (minus switching vector when too close to the normal) |
I tested this by writing a quick-and-dirty Sphere demo.
I tested this by writing a quick-and-dirty Sphere demo.
I tested this by writing a quick-and-dirty Sphere demo.
I tested this by writing a quick-and-dirty Sphere demo.
Per discussion with Mathias and Aaron, we'd like to add a static utility method to
VertexBuffer
that makes it easier for clients to supply a buffer forTANGENTS
.It could look like this:
The text was updated successfully, but these errors were encountered: