# Oculus Frame Rate Reporting

**URL:** <https://forum.babylonjs.com/t/oculus-frame-rate-reporting/34992>\
**Category:** Questions\
**Tags:** xr\
**Created:** [October 20, 2022, 4:33pm UTC](https://forum.babylonjs.com/t/oculus-frame-rate-reporting/34992 "2022-10-20T16:33:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![JCPalmer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jcpalmer/32/42_2.png) [@JCPalmer](https://forum.babylonjs.com/u/JCPalmer)\
**Post date:** [October 20, 2022, 4:33pm UTC](https://forum.babylonjs.com/t/oculus-frame-rate-reporting/34992/1 "2022-10-20T16:33:28Z")

</div>

I really dislike '@'ing, but @RaananW, I saw those WebXR wrapper functions in session manager, so I just tried them. When moving scene, it might be helpful to slow down the rate on the old scene, and go into a `scene.freezeActiveMeshes()` to free up cycles.

Anyway, here is what I got. Is this to be expected?

 ![Oculus frame rates](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/a/c/ac1534ca3b3e978527330aa9342cef81a0429c86.png)

---

<div class="post-metadata">

**Author:** ![JCPalmer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jcpalmer/32/42_2.png) [@JCPalmer](https://forum.babylonjs.com/u/JCPalmer)\
**Post date:** [October 20, 2022, 6:42pm UTC](https://forum.babylonjs.com/t/oculus-frame-rate-reporting/34992/2 "2022-10-20T18:42:06Z")

</div>

I did a test right after getting the info, which makes me think that there is a bug that Oculus current rate is not initialized correctly. Here is the code

```javascript
session.onXRSessionInit.add(()=> {
    this.currentFrameRate = session.currentFrameRate;
    this.supportedFrameRates = session.supportedFrameRates;
    console.log('current rate:', session.currentFrameRate, '\nsupported rates:', session.supportedFrameRates);

    // test changing to see what happens / is reported
    session.updateTargetFrameRate(80).then(() => {
        console.log('double check', session.currentFrameRate);
    })

});

```

You now get this:  
 ![Oculus frame rates & check](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/7/b/7beed44aa644cecb661874a66859c32754de8c55.png)  
After the target rate is updated current rate is reported at 80. Also, starting to think that the supported rates are for each eye.

EDIT: I found an on device mechanism in settings to report problems. I used it. Kind of interested to see if anything happens. This is a good issue to use. If the thing is not initialized, l can just pretend it is something that I always set.

Other problems you cannot just ignore, so finding out if this is a feasible way to go with this, before.

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [October 20, 2022, 11:43pm UTC](https://forum.babylonjs.com/t/oculus-frame-rate-reporting/34992/3 "2022-10-20T23:43:03Z")

</div>

Assigned @RaananW on October 20, 2022, 11:43pm UTC



---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [October 21, 2022, 9:52am UTC](https://forum.babylonjs.com/t/oculus-frame-rate-reporting/34992/4 "2022-10-21T09:52:32Z")

</div>

I am not sure I follow 🙂

We don’t officially support moving a scene when in XR (not until we take the scene out of every XR-related object), and you can change the rate whenever needed using the API provided. Or have I misunderstood your question?

---

<div class="post-metadata">

**Author:** ![JCPalmer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jcpalmer/32/42_2.png) [@JCPalmer](https://forum.babylonjs.com/u/JCPalmer)\
**Post date:** [October 21, 2022, 3:15pm UTC](https://forum.babylonjs.com/t/oculus-frame-rate-reporting/34992/5 "2022-10-21T15:15:48Z")

</div>

Sorry, in my example I cut and pasted. I had function, which covered `updateTargetFrameRate`, adding a check that the frame rate was returned from the supported list, which I did not show.

Here is a PG, [https://playground.babylonjs.com/#0A28NK#20](https://playground.babylonjs.com/#0A28NK#20), which shows the same thing.

As far as the question is concerned, do you think returning 0 from `session.currentFrameRate` is a Oculus issue?

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [October 24, 2022, 11:13am UTC](https://forum.babylonjs.com/t/oculus-frame-rate-reporting/34992/6 "2022-10-24T11:13:01Z")

</div>

> [@JCPalmer](#):
>
> As far as the question is concerned, do you think returning 0 from `session.currentFrameRate` is a Oculus issue?

We only proxy the session’s framerate:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/3/7/378e8aeaf227c062f0ae603e00024aa50679527e.png)

So yes, I would assume it is oculus return 0 instead of the right rate

---

<div class="post-metadata">

**Author:** ![JCPalmer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jcpalmer/32/42_2.png) [@JCPalmer](https://forum.babylonjs.com/u/JCPalmer)\
**Post date:** [October 24, 2022, 1:44pm UTC](https://forum.babylonjs.com/t/oculus-frame-rate-reporting/34992/7 "2022-10-24T13:44:42Z")

</div>

Thanks, you of course know that from the earliest version of the 2nd post, that I strong suspected it a WebXR level problem. Getting the person who wrote BJS XR implementation to say “they are only reporting what they got” builds a better case.

I am just spent getting my entire code base / architecture to work with multiple scenes & this re-worked pipeline. Need to play a while with the transition stuff. Here is just the Blender screenshot of what I have in mind.

 ![teleport.PNG](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/b/4/b49d2dbd5bf48cfccac230925e7009ec543f1120.jpeg)

Not sure what to call it:

- A worm hole
- A first person interpretation of long distance teleporting

The animation is going to be material based (in addition to the camera flying 1000 meters through it), & really cheap, if you know how to set it up. I going for a cross between jaw dropping & pants crapping.

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [October 24, 2022, 3:01pm UTC](https://forum.babylonjs.com/t/oculus-frame-rate-reporting/34992/8 "2022-10-24T15:01:36Z")

</div>

Unassigned @RaananW on October 24, 2022, 3:01pm UTC


