-
Notifications
You must be signed in to change notification settings - Fork 50
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
Render only on changes #470
Render only on changes #470
Conversation
No more cooking computer or really loud fan noise! |
@@ -209,6 +209,9 @@ define([ | |||
controller.resize(w, h); | |||
} | |||
}); | |||
|
|||
// Set for update | |||
this.sceneViews[0].needsUpdate = true; |
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.
Shouldn't this be a loop over all the sceneViews?
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.
If any sceneview needs updating all are, so I just used 0 since it will always exist.
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.
Is that always true?
Maybe I missed something but on the design that we did a while ago each scene view was independent so I'm unsure why if 1 needs to change all of them need to.
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.
@josenavas, yes you are right, this made me realize that in a situation with more than one ScenePlotView3D
object, we are updating all the objects if one of them needs update, right?
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.
Yes, the logic on line 223 works exactly like I said above.
👍 code looks good! And functionality is great! CPU usage went from 105 % to 3-5% in a 10,000 samples plot. |
Looks good, all this needs is tests and it should be good to go. |
Comments addressed, ready to go. |
} | ||
var scope = this; | ||
$.each(this.sceneViews, function(i, sv) { | ||
console.log(i, sv); |
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.
Can you remove this line?
🎆 |
I'm so glad this is a thing now. I'm looking forward to the next stable release of Emperor. |
This moves rendering to an event-based action, where new frames are only rendered when the views are changed in some way. previously it was rendering a new frame regardless of it was needed or not.