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

Why does the WebGL drawing lag (ever so slightly) behind the CSS rendering? #18

Closed
trusktr opened this issue Mar 2, 2019 · 1 comment

Comments

@trusktr
Copy link

trusktr commented Mar 2, 2019

If you play close attention (more visible in Safari), then you'll notice that WebGL content lags slightly behind CSS content. For example, in this (example)[https://keithclark.co.uk/labs/3d-model-custom-element/examples/3d-scene/], move back a little, then jiggle the mouse around and the model seems to catch up to the motion of the floor a very short (but noticeable) moment later.

Curious to know why this happens.

@trusktr trusktr changed the title Why might the WebGL drawing lag (ever so slightly) behind the CSS rendering? Why does the WebGL drawing lag (ever so slightly) behind the CSS rendering? Mar 2, 2019
@keithclark
Copy link
Owner

Think I've finally go to the bottom of this. It looks like a problem with that demo. Switching this...

requestAnimationFrame(update);

...to the following fixes the issue for me:

requestIdleCallback(update)

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

No branches or pull requests

2 participants