-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
No texture loaded when adding GLTF model #11871
Comments
https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#images
Your model should be |
Alternatively, you can use the viewer below to check if your glTF asset can be rendered correctly: |
Hi @cstopdown, would you be able to provide the glTF file in question? We also recommend the official validator from Khronos. That would be glTF-Validator. |
Thank you for your reply! Please review more information: And, the metadata is below (it is not provided because there are too many texture files): |
According to the information, there seems to be some texture loss. If this is the reason why rendering is not possible, I would like to inquire whether other textures cannot be rendered when a small amount of texture loss occurs. This also seems incorrect because if only a few textures are lost, the model is still usable in business, and it is usually unacceptable to abandon all textures directly. |
You can drag-and-dropping all of the related files on the validator at once, not just the one |
In principle, CesiumJS does support this: You can refer to external textures from a GLB. (At least, I tried it out with the sample asset from KhronosGroup/glTF-Sample-Assets#111 that was basically created to test exactly this case, and CesiumJS displayed it properly). @cstopdown You explicitly said
Can you check this again, and maybe also look at the "Network" tab whether you see any (The reason for asking this is that I just tested your model with dummy textures, and received this error message, and eventually summarized this in #11876 - so this might now be a duplicate...) |
@javagl Thank you for your reply! |
@javagl Sorry, I just saw your reference link and my question is consistent with what you mentioned. |
@cstopdown The easiest and quickest solution in this case might be to convert the model into one that does not refer to (so many) external images, but includes the images directly in the GLB itself. But... whether this a "good" solution is hard to say without more context. For example, when many different GLBs are referring to these textures, then including them in each GLB would cause them to be "duplicated" (i.e. stored many times), and the data may load more slowly. The directory structure looks like the textures directly belong to this one model (and are therefore not used by any other model). Still, the file size may become an issue. The GLB that you posted already has 33MB. Do you happen to know how large to model is in total (i.e. what is the size of the GLB file plus the size of the textures?) |
Overall, there is about 600M, and I have attempted to archive it in a glb file, but have achieved the same results. |
When you say that you "achieved the same results", then it is not clear (for me) what this means. With a single GLB file, it should not send out requests for textures, and therefore, not cause an How did you create that 600MB GLB file? (And does this file pass validation?) |
Sorry, I didn't express myself clearly.Actually, what I mean is that I achieved the same effect as the initial one, that is, no texture was loaded. |
Thanks @cstopdown for the report! I believe @javagl has summarized the issue in #11876, so I'll close this one as a duplicate. Please see #11876 for any updates. |
Indeed, converthing this data to GLB and trying to load it in CesiumJS causes ~"an error" (and the textures are not displayed). But... that's not an error in CesiumJS, but an error in the data. When you drag-and-drop that GLB into the https://github.khronos.org/glTF-Validator/, then it will print many errors like this:
The reason is that this data set includes You should either...
I just tried the latter, converted the result of this into a GLB, and it looks like it can be rendered then: (There are some areas that look "un-textured", and when converting TGA to PNG, there are some questions about the handling or transparency, but in general, this is an approach that might work...) |
What happened?
Summary
Hello! I am a beginner building my own app using Cesium for the first time
When I use the Entities API to load the GLTF2.0 Model which converted by Mayo, the model is showed, but no any textures were loaded. I try to use Online 3D Viewer to validate my model and find all well. And I find no any error log info in console.
Please help me to solve the problem, thanks!
Situation
Here is the file tree and code:
screenshots:
validate scene:
Cesium scene:
Reproduction steps
...
Sandcastle example
No response
Environment
Browser:Microsoft Edge Version:122.0.2365.66
CesiumJS Version:1.112
Operating System:Windows 11
CPU:13th Gen Intel(R) Core(TM) i9-13900HX 2.20 GHz
GPU:NVDIA Geforce RTX 4060 Laptop
GPU Driver:546.65
Memory:64.0 GB
The text was updated successfully, but these errors were encountered: