-
I'm using react-slick for carousel usage to display gltf/img/video files, but I found the result didn't work as expected, sometimes the gltf model won't show up in the Canvas, sometimes the whole Canvas won't show. my MerchandiseMedia component part And after some debug process, I found it seems that it is because there's multiple I made a sandbox for it: https://codesandbox.io/s/gltfloader-forked-o3064v?file=/src/App.js Can anyone share some idea about how to overcome this kind of issue? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
using multiple canvas is generally a terrible idea, the browser limits the number to 8 or 10 until it closes the tab, there cannot be any data shared between them (which is why you see things work and then not, three is unmounting and disposing thing as you add/remove them), performance is bad, etc. this is the solution: https://github.com/pmndrs/drei#view but then again, i would implement the carousel in webgl altogether and instead annotate with html. https://codesandbox.io/s/l4klb check out the other demos for drei/scrollcontrols as well. |
Beta Was this translation helpful? Give feedback.
-
Pmndrs has given us create-r3f-app which uses tunnel-rat for rendering different three.js canvases in next.js app router pages |
Beta Was this translation helpful? Give feedback.
using multiple canvas is generally a terrible idea, the browser limits the number to 8 or 10 until it closes the tab, there cannot be any data shared between them (which is why you see things work and then not, three is unmounting and disposing thing as you add/remove them), performance is bad, etc.
this is the solution: https://github.com/pmndrs/drei#view
but then again, i would implement the carousel in webgl altogether and instead annotate with html. https://codesandbox.io/s/l4klb check out the other demos for drei/scrollcontrols as well.