takahirox / three-gltf-extensions

Unofficial Three.js glTF loader/exporter plugins
MIT License
123 stars 20 forks source link

Add EXT_mesh_gpu_instancing exporter and Readme #59

Closed hybridherbst closed 2 years ago

hybridherbst commented 2 years ago

Added an exporter for GPU instancing for a recent project. I think it makes sense to have it here in this wonderful collection :)

I'm sure there must be a faster way to get the instancing matrix data into the right form to save it as attributes; looking forward to feedback on this, definitely "works but probably slow-ish".

I'm also not sure what the minimum required three version would be, so I added the current one.

Example file exported with this from a threejs scene: dragons-vs-vikings.zip

image

"Dragon" by jeremy [CC-BY] (https://creativecommons.org/licenses/by/3.0/) via Poly Pizza (https://poly.pizza/m/3ZuMS3IRb0C) "Thor and the Midgard Serpent" [CC-BY] (http://creativecommons.org/licenses/by/4.0/) by Mr. The Rich (https://skfb.ly/69X8V)

takahirox commented 2 years ago

Hi, thanks for the PR! I don't have enough time for reviewing in details now because I'm on parental leave. But the plugin looks very useful and I want users to be able to use it. And I trust you. So I merge this PR so far.

We still need

But I can do them on my end. Of course I would be happy if you or someone else make PRs.