-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Make ModelExperimental
's bounding sphere update with model matrix
#10078
Conversation
Thanks for the pull request @j9liu!
Reviewers, don't forget to make sure 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.
@j9liu this PR does work as advertised. Though the bounding volume update code is spread out in several places, so we might want to review it holistically to see what if anything needs to be updated/simplified The model matrix and bounding sphere get updated in a few places:
- in
buildDrawCommands.js
I see that a bounding volume is computed from the render resources' copy, in-place. Does that make sense to do still? Note that sometimesbuildDrawCommands()
gets called a second time if draw commands need to be re-built (such as making a big change like swapping out a custom shader or style). Though since the whole pipeline gets re-run, this might be okay. - I see that the bounding sphere gets updated in
ModelMatrixUpdateStage
-- we might need something similar for the final model bounding volume (like in the review comment below)
We can discuss this more on a call if needed since this is a little more nuanced than it first appears.
@ptrgags - just wanted to clarify your |
@j9liu yes, that's what I meant, though now that I think about it, even when |
@ptrgags - got it. Is there anything else I should look at to wrap-up this PR? |
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.
@j9liu closer, though I noticed that the original code's _modelMatrix
vs modelMatrix
is a bit confusing, must have been missed in a past review. I left some notes of how to neaten that up.
…elExperimentalSceneGraph
@j9liu looks good now, I'll merge once CI passes! |
thanks @j9liu! |
Fixes #10074.
This PR fixes a bug where
ModelExperimental
's bounding sphere wouldn't be affected by changes in the model matrix. I added a unit test for it and observed that it worked in @lilleyse's sandcastle.