Skip to content
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

Optimise playback of static meshes in Viewer #545

Closed
bentoogood opened this issue Sep 21, 2013 · 6 comments
Closed

Optimise playback of static meshes in Viewer #545

bentoogood opened this issue Sep 21, 2013 · 6 comments
Labels
scene Issues with GafferScene

Comments

@bentoogood
Copy link
Contributor

Playback of complex static scenes is slow - probably as gaffer isn't aware that it is unchanging frame to frame.

Make some optimisations by detecting static geo and avoid regenerating each frame.

Related to #121

@johnhaddon
Copy link
Member

This relates specifically to the implementation of SceneReader::hash(), which is currently assuming that the whole scene depends on time. We need to detect static geo and not append time to the hash.

@johnhaddon
Copy link
Member

We also need to ensure that time doesn't affect the hash for the child names as it currently does - SceneCache hierarchies are constant across time.

I believe there is also currently significant overhead in the SceneHierarchy ui which is rebuilding every frame - this seems unnecessary given that the hierarchy itself rarely changes from frame to frame (it could, but still, what's the use of displaying that while someone's playing back?). So I think with some sort of playbackStarted() and playbackStopped() signal we could disable updates temporarily for the SceneHierarchy. This would probably mean making a Playback class, or adding playback methods to the ScriptNode, at which point we'd be in a good position to flesh out Ben's pull request #559.

@johnhaddon
Copy link
Member

We might also want to investigate the ideas in #427 in conjunction with this ticket, as I think they could speed up scene evaluation a fair bit across the board.

@johnhaddon
Copy link
Member

There's some initial work on this here :

https://github.com/johnhaddon/gaffer/tree/sceneReaderOptimisation

@johnhaddon
Copy link
Member

OK, now this ticket is a bit more a catch-all for performance improvements, here's a checklist of what needs doing before we can consider it closed :

  • Static geo hash optimisation in SceneReader
  • ScenePath plugDirtiedSignal() lazy connections
  • SceneHierarchy disabling update during playback
  • Optimise StringPlug storage to avoid string substitutions when there are no variable references
  • Other things that come up during investigation

@johnhaddon
Copy link
Member

I think we've made enough general playback optimisations to call this one good now - greater than 5x speedup overall for the bunny scene. This can be closed when we get code reviews for each of the individual pull requests done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scene Issues with GafferScene
Projects
None yet
Development

No branches or pull requests

3 participants