glTF icon indicating copy to clipboard operation
glTF copied to clipboard

EXT_mesh_gpu_instancing sample models

Open emackey opened this issue 6 years ago • 9 comments

The EXT_mesh_gpu_instancing extension includes a samples folder with 3 different versions of the same basic sample model.

  • [ ] teapots_galore_id.gltf has a severe error, where bufferView 10 does not fit within the byte length of the buffer, as reported by the glTF Validator.
  • [ ] teapots_galore_T4x3 uses "type": "MAT4x3" which is not described in the README or the schema.
  • [ ] teapots_galore.gltf includes several extras.arrayIndex which don't belong in an official sample.
  • [ ] The sample model(s) should be moved to glTF-Sample-Models.

I'm thinking we probably only want teapots_galore.gltf and not the other two versions, as an official sample.

Also, do any WebGL engines implement this extension yet?

emackey avatar Aug 25 '20 18:08 emackey

three.js is not merged yet, see https://github.com/mrdoob/three.js/pull/18913. I believe Babylon had implemented it, too.

donmccurdy avatar Aug 25 '20 18:08 donmccurdy

On second thought... I agree the spec repo isn't the right place, but do we want vendor and multi-vendor extensions to be hosted on glTF-Sample-Models? Would we need separate Khronos and Vendor folders, maybe?

Wherever we put it, I would suggest just keeping one of the current examples. I'd like to make a more practical example at some point, too, but don't know when I will get to that.

donmccurdy avatar Aug 27 '20 16:08 donmccurdy

Oh good point. Maybe just multi-vendor extensions could be allowed? We do have one model in there already that uses EXT_lights_image_based.

Of the three instancing models here, I believe only one of them is actually valid (the teapots_galore.gltf one). The other two should be dropped I believe.

emackey avatar Aug 27 '20 16:08 emackey

FWIW, AGI's STK 12.1 will also support EXT_mesh_gpu_instancing. We added it in anticipation that 3D Tiles might start using it at some point.

emackey avatar Aug 27 '20 16:08 emackey

Maybe just multi-vendor extensions could be allowed? We do have one model in there already that uses EXT_lights_image_based.

I don't know. I put this there in anticipation that we will have a KHR version of an IBL extension. If the intention is to just be a multi-vendor extension, I'm not sure.

Of the three instancing models here, I believe only one of them is actually valid (the teapots_galore.gltf one). The other two should be dropped I believe.

Yes, I think this is right. We should have removed the incorrect ones. For reference, Babylon.js has this extension implemented and we are using this asset in our automated testing. I haven't checked if this matches one of the ones listed earlier, but I believe we copied it from the spec.

bghgary avatar Sep 03 '20 23:09 bghgary

Not sure where the best place to ask this is...the EXT_mesh_gpu_instancing spec mentions the notion of using the extension for fur. Does anyone know of a model (sample or for purchase) that does fur? I only know of the teapot model for this extension.

ieremius avatar Feb 27 '23 20:02 ieremius

@ieremius I'm not aware of any existing, "nice" models that show fur with the EXT_mesh_gpu_instancing extension. The extension is not yet sooo widely supported. This refers to viewers, but (in this case, particularly) to authoring tools. Rendering fur realistically is challenging, and there are many different approaches, and it's unlikely that a particular tool that focussed on realistic fur actually boils the results down into a glTF asset with this particular extension.

More obvious use cases of this extension may be simple forests made of tree instances (maybe along with some architecture visualization), or street signs or so.. The "fur" case is - right now - a bit of a stretch. The general approach would be to have "strands" of hair, and rendering ... many of them, with slight variations.

As an example: The attached GLB contains 100x100 "hairs" which are actually just spheres (!) that are scaled to be "long and narrow", and rendered at different positions, with varying and slightly randomized orientations and lengths:

Khronos NotReallyFur

FurInstancing.zip

Yeah, that doesn't look too fancy. For a really nice effects, you'd need really high-quality shadows, and maybe some textures to also have color variation, and... much more. But... it roughly shows the idea.

javagl avatar Apr 12 '23 19:04 javagl

I can remove the teapost_galore model and move it into the new Sample Asset repo as part of PR #2263. I would also remove the teapots_galore_id folder entirely. There would not be any issues with having a model using this extension in the repo because the extension has been approved to enter the ratification process.

Would do this resolve all issues on this issue?

DRx3D avatar Apr 26 '23 21:04 DRx3D

(Maybe obvious) Nitpicks:

  • It should then be TeapotsGalore (or a different name, but CamelCase)
  • The asset still causes warnings, BUFFER_VIEW_TARGET_MISSING bufferView.target should be set for vertex or index data. Before becoming a sample asset, this should be fixed.
  • The asset contains some noise - namely, some extras: { arrayIndex... } properties, probably created by the exporter. It would be good to remove this...

(I can do the latter, if there's a PR/branch to work on - maybe even after the model was renamed/added elsewhere)

javagl avatar Apr 27 '23 13:04 javagl