-
-
Notifications
You must be signed in to change notification settings - Fork 246
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
mat4_mul_mvp #446
base: master
Are you sure you want to change the base?
mat4_mul_mvp #446
Conversation
Hi @Minterl, Many thanks for your contributions, Let’s get some feedback on naming and parameter order, before proceeding, then we can merge it 🚀 |
^ found through cheeky @Minterl Re missing bits, they were all small so i've made a PR to your branch from MarcinKonowalczyk/cglm/tree/glm_mat4_mul3, if you'd like. :)) Feel free to use or ignore. |
add missing bits
@MarcinKonowalczyk Thanks for the PR; I've merged it. That said, I think my PR needs a little more work before it's ready to be merged. |
If the name is changed to something more general, it will be slower for MVP multiplication. |
There was no suggestion of naming anything here
I'm unsure what you mean? How would the name of the function affect its performance? Surely the idea is to make it as performant as possible. I can't think of MVP-specific optimisation which would not be applicable to just multiplying 3 matrices together. |
What exactly do you mean by this? |
Sorry for not being clear. I mean that, in the specific case where you are doing an MVP multiplication, you wouldn't want to use the function in this PR because it is inefficient compared to the following:
This is discussed in #124. So it probably makes sense to add both |
I also think that using (right, center, left, out) as a parameter order for |
+1 for @appybara13 proposal: glm_mat4_mvp {
glm_mul(view, model, mv)
glm_mat4_mul(proj, mv, mvp)
}
/* 2 spaces for indents :) */ seems good to me, I think we can introduce a few functions
I think no need to add camera intrinsics matrix ( mat3 ) x camera world / extrinsic matrix ( mat4 ) x projection ( mat4 ) ... |
agreed
yup (i missed this from the original discussion 😅🫣) |
Addresses #124
I understand that this would just be another layer of abstraction and not an actual optimized algorithm, but the use case is common enough (given we do have functions for constructing rotation, perspective projection, etc. matrices) that it would make sense to have an official idiom for constructing an MVP matrix.
I am haven't tested this, but as for implementing an optimized, explicit three matrix multiplication algorithm, I would wager that the the inputs are generally small enough that something like parallel Strassen is generally unnecessary.