bs-community / skinview3d

Three.js powered Minecraft skin viewer.
https://skinview3d-demo.vercel.app
MIT License
550 stars 90 forks source link

Render more than 16 skins on page? #156

Closed InstantlyMoist closed 11 months ago

InstantlyMoist commented 11 months ago

Hi,

I'm trying to render a 24 skins on a page but ofcourse there the default OpenGL limitation of 16: 'WARNING: Too many active WebGL contexts. Oldest context will be lost.'

Is there a way to 're-use' these component with different skins? Or is there no option as of now?

Kind regards,

Hacksore commented 11 months ago

If you need a lot of renderings of skins I think the offscreen canvas is going to be best.

https://codesandbox.io/p/sandbox/skinview3d-many-skins-vsn35w https://bs-community.github.io/skinview3d/offscreen-render.html

Note they are not intractable and will just be a static image. There is probably a clever way to solve this but I don't have any ideas as of now.

Closing but feel free to experiment with a PR to make this limitation go away.

InstantlyMoist commented 11 months ago

Makes sense! The requirement is for it to be 'active' on hover. I just pre-render the skins and serve them from the disk. And have a rendered ready for the hovering state. Amazing solution, thanks!