-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Helper function for getting inverse model matrix in WGSL shaders #10462
base: main
Are you sure you want to change the base?
Helper function for getting inverse model matrix in WGSL shaders #10462
Conversation
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
Really excellent comments, thanks for that :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very useful, thanks! I checked on a sample project and this works wonderfully
Following a conversation in the discord I've fixed the merge conflicts, renamed the function to match the changed names of other functions, and tested that it still works :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is great. Clean and well documented.
In 0.11 you could easily access the inverse model matrix inside a WGSL shader with
transpose(mesh.inverse_transpose_model)
. This was changed in 0.12 wheninverse_transpose_model
was removed and it's now not as straightfoward. I wrote a helper function for my own code and thought I'd submit a pull request in case it would be helpful to others.