cancel
Showing results for 
Search instead for 
Did you mean: 

Run every frame vs. every tick?

PointyLlama5273
Explorer

Is there a way to run a method in an activity once every frame instead of every tick? I'm aware that Systems exist, but they seem to be tied to the activity tick rate.

 

Side note, my system also seems to not consistently run at 90 ticks per second even though the contents of its execute() method take less than 11ms consistently. I'm running a simple project with this system in it and nothing else-- the tick rate jumps between 45 and 90 sporadically.

1 REPLY 1

Bulkywallnut
Meta Employee

Thanks for the question!

Meta Spatial SDK only allows executions per tick. This can be done via Systems or AppSystemActivity.onSceneTick(). 

The tick rate adjusts automatically to system performance.
You can debug the performance of your Spatial SDK app with the Perfetto tool within Meta Quest Developer Hub.
1. First, enable Spatial SDK specific tracing in the main AppSystemActivity.onCreate()

onCreate() {
TraceUtils.forceEnabled = true
...
}

2. Launch your app. (Optionally, wait until tick rate is lowered to 45 ticks per second).
3. In Meta Quest Developer Hub, connect your Quest device. The "Device Manager" view contains a "Device Actions" block with a "Trace Analysis by Perfetto" Record button. Clicking the record button will generate a report after a couple of seconds. Searching "doFrame" in this view will navigate to Spatial SDK app calls, and is a good debugging point for performance issues.

If the issue cannot be solved by improving app code, may I ask your use case? Depending on what you are trying to implement there could be work around solutions.