getNodeToParentTransform(Node* ancestor)
graph transform caching feature
#1239
DelinWorks
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was trying to squeeze every bit of performance out of my UI rendering in my editor, and there are stress tests for dropdown menus of over 10,000 elements, performance seems to be fair (around 900 fps) on a ryzen 7 5800x
I was profiling and noticed that most of the time is spent on
hitTest
/visit
events andhitTest
being a visit in and of itself, which requires each node to provide it's full transform from scene root node, which is what thegetNodeToParentTransform()
does, this function seems to appear the most when profiling, it simply does this:for a single node it reclusively goes through it's ancestors to figure out it's world transform, and combine that with matrix multiplication and you got yourself a recipe for disaster, not really a disaster but a performance tank, I thought of trying to implement a cache system where each node stores it's world transform and when it moves it recalculates its world transform, so that these recalculations occur when the transform gets dirty NOT each frame (which for static objects could give HUGE performance boost), problem is what if a parent moves? that parent is now required to tell every child that it had moved (by moved meaning it's transform got dirty which applies for anything including position, rotation, and scaling, etc).
So the question is would that be feasible to implement? and how would someone go about implementing it, I opened this discussion to get help from experienced people on this stuff, Thanks!
Beta Was this translation helpful? Give feedback.
All reactions