diff --git a/frontend/src/components/Constellations.tsx b/frontend/src/components/Constellations.tsx index 3197039..6e09f63 100644 --- a/frontend/src/components/Constellations.tsx +++ b/frontend/src/components/Constellations.tsx @@ -82,6 +82,9 @@ export function Constellations() { }); }, [constellations]); + // Reuse geometry + const sphereGeometry = useMemo(() => new THREE.SphereGeometry(15, 8, 8), []); + if (constellationLines.length === 0) { return null; } @@ -92,8 +95,7 @@ export function Constellations() { {/* Render constellation stars */} {constellation.starPositions.map((pos, idx) => ( - - + ))} diff --git a/frontend/src/components/Stars.tsx b/frontend/src/components/Stars.tsx index 1ffe857..35814d4 100644 --- a/frontend/src/components/Stars.tsx +++ b/frontend/src/components/Stars.tsx @@ -90,6 +90,9 @@ export function Stars() { }); }, [stars]); + // Reuse geometry for all stars to improve performance + const sphereGeometry = useMemo(() => new THREE.SphereGeometry(1, 16, 16), []); + if (starData.length === 0) { return null; } @@ -99,8 +102,7 @@ export function Stars() { {starData.map((star) => ( {/* Star sphere */} - - + {/* Star glow */} - - +