@@ -45,6 +45,7 @@ const ParticleCloud = () => {
45
45
const pointsRef = useRef ( ) ;
46
46
const materialRef = useRef ( ) ;
47
47
const [ geometrySize , setGeometrySize ] = useState ( 4 ) ;
48
+ const [ geometryResolutionFactor , setGeometryResolutionFactor ] = useState ( 1 ) ;
48
49
const [ geometryIndex , setGeometryIndex ] = useState ( 0 ) ;
49
50
const mouse = useMouse ( ) ;
50
51
const { isMobile } = useViewport ( ) ;
@@ -64,7 +65,9 @@ const ParticleCloud = () => {
64
65
65
66
useEffect ( ( ) => {
66
67
const adjustedGeometrySize = isMobile ? 3 : 4 ;
68
+ const adjustedGeometryResolutionFactor = isMobile ? 0.5 : 1 ;
67
69
setGeometrySize ( adjustedGeometrySize ) ;
70
+ setGeometryResolutionFactor ( adjustedGeometryResolutionFactor ) ;
68
71
69
72
if ( materialRef . current ) {
70
73
materialRef . current . uniforms . u_interactionRadius . value = isMobile ? radiusRef . current * 0.75 : radiusRef . current ;
@@ -158,7 +161,7 @@ const ParticleCloud = () => {
158
161
// State for object geometries
159
162
const geometries = [
160
163
// eslint-disable-next-line react/jsx-key
161
- < icosahedronGeometry args = { [ geometrySize , 30 ] } /> ,
164
+ < icosahedronGeometry args = { [ geometrySize , Math . round ( 20 * geometryResolutionFactor ) ] } /> ,
162
165
// eslint-disable-next-line react/jsx-key
163
166
< torusKnotGeometry args = { [ geometrySize , 0.4 , 128 , 64 , 1 , 2 ] } /> ,
164
167
// eslint-disable-next-line react/jsx-key
0 commit comments