Skip to content

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Oct 17, 2019

Currently, the animated sphere looks very strange on a 144 Hz monitor^^.

Besides, this example should demonstrate how you can use the Page Visibility API together with THREE.Clock to avoid large delta values when the tab is switched or the browser is minimized.

At some point, we might want to replace the code with THREE.Timer. For now, I guess it gives some ideas how to solve the issue with just THREE.Clock.

@Mugen87 Mugen87 added this to the r110 milestone Oct 19, 2019
@Mugen87 Mugen87 merged commit b7d549d into mrdoob:dev Oct 19, 2019
@WestLangley
Copy link
Collaborator

this example should demonstrate how you can use the Page Visibility API together with THREE.Clock to avoid large delta values when the tab is switched or the browser is minimized.

It is helpful if two tabs remain synchronized when doing before-and-after comparisons.

Can the clock be reset (somehow) in another example to show how to maintain synchronous animations?

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Oct 21, 2019

A modern Timer class normally uses the Performance API in order to retrieve high resolution timestamps (of type DOMHighResTimeStamp). These values are relative to the time origin which is unique per tab/window. Since it's a read only value, I'm not aware of a way to synchronize the time origin across tabs in order to get exact elapsed time values.

Even if you could share a common time origin, both tabs are rendered with different frametimes so the delta time values will be different. Meaning you can't achieve 100% synchronous animations.

@mrdoob
Copy link
Owner

mrdoob commented Nov 23, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants