utsuboco / r3f-perf

Easily monitor your ThreeJS performances.
https://codesandbox.io/s/perlin-cubes-r3f-perf-wtp9t?file=/src/App.js
MIT License
573 stars 21 forks source link

Usage with demand frameloop #33

Open itsdouges opened 1 year ago

itsdouges commented 1 year ago

Hey mate! Love the tool. Is there any advice in how to use it when frameloop is set to "demand"? When it is you don't get FPS data, and calls, triangles, and lines display only for the render frame and then drop off immediately.

It would be great if the data would persist between frames (when there is no rendering happening). Is FPS calculated with useFrame? Could it be calcuated with rAF instead so it works when frameloop is demand?

GPU/Memory/FPS aren't calculated at all.

Keen to discuss.

RenaudRohlinger commented 1 year ago

Hey! So I'm pretty sure it is necessary to update r3f to do so. I need to add callbacks before and after the render for r3f-perf to work by using addEffect and addTail but both these events are still getting fired when the loop is in never or demand mode. So we would need another information/callback in the render method of r3f or additional information in these hooks or something like that.