-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[rmodels] Some faces of the gltf model are not rendered ? #3165
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
Comments
raylib 4.5 |
I think it could be related to the way the gltf is created. raylib uses cgltf library to load models. |
I set the log level to debug and got this warning:
I also noticed that there is a restriction warning in
Does it mean raylib is only able to load mesh models with vertex number less than 65535 (max val of uint16_t) ? |
I just ran into this last week and you're on the right track. I'll try to explain it to the extent that I understand it. GLTF is an indexed model format, meaning it lists out all the vertex coordinates in the mesh, and then uses sets of 3 indexes (like vertex 0 2 3, 2 3 5, etc) to make each triangle. For large models like yours, it is more efficient with space, but it takes more processing power for the GPU to compute and has that pesky vertex count limit which I believe comes from the functionality of the cgltf library that @raysan5 mentioned. To solve this, you can use a non-indexed model format like .obj, which instead lists the position of each vertex in each triangle for every triangle. This makes the file format larger, but it is easier for the GPU to run through and draw the model. And it won't have the same indexing limit that the GLTF loader has. |
Great thanks for your detailed reply ! That helps a lot for me to understand the current design.
I guess it is necessary to compress my model (vertex/edge/face numbers) in blender before use it in raylib. |
This issue seems to be external to raylib, maybe related to |
Issue description
I tried to load and render a gltf mesh model like below
The rendering result is like below.

The model opened in blender is like below.

It looks like some faces of the mesh model are not rendered at all. And the color of other faces also looks quite different.
Environment
OS:Ubuntu 20.04
The text was updated successfully, but these errors were encountered: