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

dealing with degraded performance #60

Open
blairmacintyre opened this issue Apr 17, 2017 · 0 comments
Open

dealing with degraded performance #60

blairmacintyre opened this issue Apr 17, 2017 · 0 comments

Comments

@blairmacintyre
Copy link
Contributor

In argon-aframe, I had the render function set up this way for a while to try and make the app more responsive when the content being rendered was too much for the device:

    argonRender: {
       value: function (frame) {
        if (!this.animationFrameID) {
          var app = this.argonApp;

          this.rAFviewport = app.view.getViewport();
          this.rAFsubViews = app.view.getSubviews();
          this.animationFrameID = requestAnimationFrame(this.rAFRenderFunc.bind(this));
        }
      },
      writable: true 
    },

    rAFRenderFunc: {
      value: function () {

The idea was twofold:

  1. it appeared, on some devices like iOS, that wrapping ensuring the rendering happened directly inside a rAF callback prevented extra DOM repair if the DOM changed (such as with the CSS renderer).
  2. if the render callbacks happened faster than we could render, we'd ignore the extra ones (instead of them getting queued and just rendering later). Specifically, by skipping then, we hope to ensure we only render when we can render immediately (rather than slightly delayed). (reducing frame rate, possibly, but improving perceived latency). Otherwise, we could find ourselves in the situation where we are always rendering slightly behind.

I need to remove this, though, for cases where we use native WebVR for rendering, since we don't want to introduce a rAF call from within a webVR high-performance rAF call (it results in rendering only occurring at a very slow frame rate).

So it would be nice if this sort of thing might be integrated in the right place inside argon, for those cases where it matters.

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

1 participant