Optimize terrain geometry for mobile

Co-authored-by: matissjurevics <matissjurevics@gmail.com>
This commit is contained in:
Cursor Agent
2025-12-17 18:40:22 +00:00
parent d7dec1741e
commit b4621e1f79

View File

@@ -15,7 +15,7 @@ const Terrain = () => {
}, []); }, []);
// Create geometry with reduced segment count for mobile devices // Create geometry with reduced segment count for mobile devices
const segments = isMobile ? 40 : 100; // Reduce from 100x100 to 40x40 on mobile (84% reduction) const segments = isMobile ? 28 : 100; // Reduce from 100x100 to 28x28 on mobile (50% polygon reduction)
const geometry = useMemo(() => new THREE.PlaneGeometry(20, 20, segments, segments), [segments]); const geometry = useMemo(() => new THREE.PlaneGeometry(20, 20, segments, segments), [segments]);
useFrame((state) => { useFrame((state) => {