Hello guys, I’m using @react-three/drei and @react-three/fiber packages in my react app, now in my index page there are many rendered 3 objects , they’re displayed in laptop devices but my problem is with mobile , some of them are displayed and some were displayed but after adding new one 3d object they are not displayed (actually there are displayed but in some mobiles)…
It’s is not a problem with code of course ,cause there is not a problem with that and as i said in laptop there are displayed completely fine but they are not in mobile (some devices)
I inspect white square as u said and yeah like im using canvas for each one . i didnt understand how can i solve my problem , second why it happening only in some mobile not in laptop or some mobiles too
like i said, browsers arbitrarily limit the amount of open webgl context, i.e. <canvas> elements. the number may vary from browser to browser, or desktop and mobile. let it be 5, or 10. if you cross over it will start to crash.
it would not even make sense to have 3 canvas, or 2, you should only ever have one single canvas because the memory overhead and performance hit of having multiple is not feasible.
the good news is that this is what drei/view is for, and the rewrite would be simple. it creates a single full screen canvas that is cut into pieces, each piece is isolated into its own scene, camera, controls, etc, this “view” is in your regular dom component graph.
i got u , it like create one canvas for all the dom , whole page and instead of displaying each 3d object in canvas i will use View component instead right?
ok what about this one here , im not using a gltf file for rendering ball
it isn’t about gltf, but webgl. you can feasibly have one, single webgl canvas. everything on top is a waste of memory and performance, more than a few will crash guaranteed due to arbitrary browser limitations.
Hi Man.
I don´t know if you already fixed your problem. I had the same problem that you and I could fix it.
The first problem rendering the hero page (the gamer setup) I had to change the model for another lighter due to that one used in that project is very heavy. Then I use a timeout to render it 2 seconds after the application had loaded.
The second part (the spheres) I fixed that rendering a View instead multiple canvas. Using view reduces the load since you are using one single Canvas for all those elements.
As you can imagine I customize my project so it is different to the initial one that I supose you watched in JSM channel.
If you want I can share some fragments of my final project with you so you can have an idea of what I did.
Yeah plz share it , actually I tried to remove canvas and use view component as u said and it worked but the problem is when you deploy your Website, did u try to deploy it ? Then the problem will be related to hosting itself I think… cause I’m hosting it in free plans so it doesn’t offer that CPU, memory…to display all threed objects without crashing
It’s weird. I can see it working well on my cellphone and and also try it in 2 different browsers.
What kind of cellphone do you have? Specs?
Because what I also read is that 3D models are heavy and it takes a lot of resources in a mobile
I don’t know actually what’s happening , I have k40 gaming, (12 Ram) , but as I said it doesn’t depends on your mobile resources, it depends on host resources…