-
Notifications
You must be signed in to change notification settings - Fork 130
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
Only update local matrix if needed #135
Comments
I'm working on an application that we want to be available at the edge (e.g. a ruggedized Android tablet out in the middle of nowhere on an LTE radio), and we're looking at eking as much performance out of Three and I'd be interested in discussing what the preferred solution would be here, and may be able to contribute code, as my employer generally favors open source contributions over rolling our own solutions. |
Looks like I'd made #174 for the same type of problem 😅 You can see the logic for updating the world matrices in three.js here. By default when the matrix world is updated the local matrix is always updated which means matrixWorld is always updated leading to some of the issues you're seeing. It's convenient but not optimal. Here are the constraints we have if we're trying to optimize the matrix updates:
So here's what I propose:
I've written that down quickly but I think that should work. Let me know what you think. I'd like to add this in a backwards compatible way - thanks for looking into it! |
At the moment the world matrix is marked as out of date when joints are updated but realistically the local matrices need to be updated. However, three.js does not support marking the local matrix as dirty.
Options
matrixAutoUpdate
as false.updateMatrix
function to only update the local transform if a custom variable is marked as true.matrixAutoUpdate = false
because we expect that they will not change. Possibly gate this behind an option?The text was updated successfully, but these errors were encountered: