Skip to content
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

Generate vertex tangents for OBJ files #266

Open
GrantMoyer opened this issue Feb 6, 2020 · 1 comment
Open

Generate vertex tangents for OBJ files #266

GrantMoyer opened this issue Feb 6, 2020 · 1 comment

Comments

@GrantMoyer
Copy link

GrantMoyer commented Feb 6, 2020

Currently, rendy::mesh::obj::load_from_obj() does not generate vertex tangents when loading OBJ files. This prevents OBJ files from being used with Amethyst's RenderBundle's RenderPbr3D plugin, which needs vertex tangents.

I can implement this, but I want to determine if this is a desired feature, and if so, what tradeoffs are preferred before I start. There are 3 ways I see to implement this:

  1. Just generate the tangents all the time
  • + Just works
  • - Wastes CPU cycles if tangents aren't needed
  1. Add a boolean parameter to specify if tangents are desired
  • - Breaks API
  • - Inflexible; tangents treated as more special than other vertex attributes
  1. Make load_from_obj generic over a new trait and implement the trait for Vec<A> where A: AsVertex and tuples of those types
  • + Leaves room for future extension
  • - Breaks API
  • - Adds type complexity

My intuition is that 1 is the best option if OBJ loading time is considered negligible, and 3 is the best option otherwise.

@GrantMoyer
Copy link
Author

Related issue: amethyst/amethyst#2104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant