From 89e6b9695fcea77b6df511acd4334552d2e88c2f Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 26 Feb 2026 02:39:29 +0000 Subject: [PATCH] [pl3] 30fps globe trying to minimise CPU use, but this doesn't seem to make a huge difference? --- player3/src/components/globe.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/player3/src/components/globe.tsx b/player3/src/components/globe.tsx index 51bdb777..f7e71cdb 100644 --- a/player3/src/components/globe.tsx +++ b/player3/src/components/globe.tsx @@ -80,6 +80,13 @@ function MyScene() { ); }, [tracks]); + const invalidate = useThree((state) => state.invalidate) + + useEffect(() => { + const id = setInterval(() => invalidate(), 1000 / 30) // 30 FPS + return () => clearInterval(id) + }, []) + useThree((state) => { // these debug functions can randomly take ~100ms // on raspberry pi (less on more powerful machines), @@ -147,7 +154,7 @@ function GlobeInternal() { const { tracks } = useContext(ServerContext); return (
- +