utsuboco / r3f-perf

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

Working offline! #53

Open Alkebsi opened 5 months ago

Alkebsi commented 5 months ago

Tried to initiate the r3f-perf offline, but it didn't work! Is there a way I can work around that error?

The UI appears, but the stats are not displayed!

mattparrilla commented 4 months ago

I have a similar issue (am unable to load assets not on our whitelisted domains).

The root of the problem is that troika-text-3d (which this tool depends on through its dependency on drei) loads fonts via a CDN, if a unicodeFontsUrl is not provided and that is not exposed in the Perf interface.

You can see where you would need to add it here (and below): https://github.com/utsuboco/r3f-perf/blob/292adb112ce57e0780e57454452a6b450412035f/src/components/TextsHighHZ.tsx#L108

Alkebsi commented 4 months ago

I have a similar issue (am unable to load assets not on our whitelisted domains).

The root of the problem is that troika-text-3d (which this tool depends on through its dependency on drei) loads fonts via a CDN, if a unicodeFontsUrl is not provided and that is not exposed in the Perf interface.

You can see where you would need to add it here (and below):

https://github.com/utsuboco/r3f-perf/blob/292adb112ce57e0780e57454452a6b450412035f/src/components/TextsHighHZ.tsx#L108

Knowing the root of the problem is amazing. Seen that once I was using drei, but I was always able to refer a local font. Will try to do that here on Perf and see if that would make sense to be a useful PR!

Otherwise, I will just use it for myself 😅 Thanks, that was really useful 👍