-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preloading .glb models with asset system #2420
Comments
Does this block #2378? I think the caching is a moot point for now, GLTFLoader has a cache built in. In terms of preloading, agree, but it's the same situation as other loaders (OBJ and COLLADA won't pre-load their textures, either) except that glTF file can optionally have larger If it is something we want to solve robustly, maybe we want a general model case for assets? <a-asset-item type="model" gltf-model="url(...)"></a-asset-item> And if the type is |
No, different topics. Yep, this isn't serious issue (yet) and isn't glTF specific. |
Let's try to look into this with 0.7.0. As it is now, the |
What about inferring from the file extension and we keep the |
we could infer from the |
That pre-parsing is feasible for glTF... I'm less excited about doing it for other formats like COLLADA and OBJ. Would we be comfortable only doing this for glTF? If not, and we want it to work for other types of models, I think we need some system by which <a-asset-item gltf-model="foo.gltf"/> |
Seems to me that, assuming it's possible, the use of .glb (single file) should be encouraged if folks want to be able to preload as a generic single file? If taking the approach of having asset items invoke loaders, maybe just a preload boolean in the loaders (or some other not-horrible way the components should know). If we use video as an comparative use case, if you want to preload video, you usually specify as element within a-assets, then reference by selector when you use it. |
Great point. It's not possible to convert a glTF->glb directly yet, but that should be supported soon-ish. Maybe we just recommend |
Even for a <a-scene environment>
<a-assets>
<a-asset-item id="castle" src="../assets/castle/Castle.glb"></a-asset-item>
</a-assets>
<a-entity position="0 0 0"
scale="3 3 3"
gltf-model="#castle">
</a-entity>
</a-scene> In this example the scene starts presenting with just the environment visible, and the castle flickers in a second later. Because GLTFLoader parses asynchronously, presumably. I'm inclined to say we don't NEED to solve secondary dependencies of |
There are now multiple tools (https://sbtron.github.io/makeglb/, https://glb-packer.glitch.me/) for packing glTF files and their dependencies into GLB archives, so I don't think we should do anything special for As mentioned above, it would be ideal if there were some way to ensure a |
+1 for focusing on .glb now that it's easy enough to make that happen. A suggestion:
|
I had an issue load an glb model: can load the model and the animation but this doesn’t show the textures of the model? Why happen this? |
@juansho01 could you file a new issue, and include enough information (demo, code, model) for others to reproduce the issue? |
Any progress on this? Is this available in aframe 1.0.4 release? |
Has this been dropped? |
Description:
a-asset-item
is for preloading and caching assets.But glTF data consists of glTF file and other files specified in the glTF file, like
.bin, .glsl, image(texture) files.
<a-asset-item id="model" src="something.gltf"></a-asset-item>
preloads only .glTF file.How can we preload all the involved files?
Do we make glTF special
a-asset-item
in which it loads glTF withTHREE.GLTFLoader
?The text was updated successfully, but these errors were encountered: