You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i was using the little Robot model from the Raylib examples.
The model is okay.
Loading the modal via C and LoadModel works fine.
Loading the modal via Rust, custom bindings and the Raylib crate works.
But as you guessed by the title, in Zig it just crashes.
// window setup// ..._=tryrl.loadModel("sponge.glb");
_=tryrl.loadModel("robot.glb"); // returns an error because the file is allegedly not valid_=tryrl.loadModelAnimations("robot.glb"); // works fine if loadModel("robot.glb") is commented out// ...// mainloop and cleanup
The error seems to be thrown, because the model in question is not valid.
This seems odd, because it is the official example model provided by Raylib.
In addition to, the file works flawlessly in every other binding of Raylib.
The difference is in this function.
[raylib.zig:2498]
So as a test, i used the IsModelValid in the C version.
And it failed, it said the model is not valid.
(As side node, should the model not be "unloaded", if it is not valid, because now an invalid model pollutes the graphics memory with its allocated VAO and VBO, and there is no way to do it for the user since the model is never returned!)
Sooo, in the official examples of Raylib is an unvalid GLTF model file.
Which works flawlessly fine, because nobody ever uses IsModelValid.
raylib-zig failed successfully !
This is not a failure or a bug. Nor is it important.
But i feel this should in some way be communicated.
Can you check which condition makes IsModelValid fail with a debugger? If a Model is usable, the function shouldn't fail, so chances are good that this is a raylib bug, not an issue with us verifying loading worked.
if ((model.meshes[i].boneIndices!=NULL) && (model.meshes[i].vboId[7] ==0)) { result= false; break; }
Thats were it fails. Since me and GDB are not really friends, i was not able to detect which part of the expression was failing.
But at this point i invested to much time into this.
I go with my gut feeling, we have boneIndices, but vboId[7] != 0, could be an initialization error.
But should vboId not be unequal zero, because we have a vbo initialized ?
This appears relevant because IsModelValid() checks the bone buffers when boneIndices/boneWeights are present. The result is therefore false even though the model has successfully loaded and its regular vertex/index buffers have valid VBO IDs.
There is also a notable discrepancy in the output:
So at this point the issue appears reproducible independently of the Zig wrapper: the underlying raylib C LoadModel() succeeds, but IsModelValid() reports the resulting model as invalid.
The discrepancy between the loader reporting 14 meshes / 3 materials and the returned Model containing 19 meshes / 4 materials may also be significant and worth investigating.
I get the same IsModelValid() == false result with greenman.glb from the raylib examples, as well as with a separate animated model downloaded from Mixamo and converted to GLB format. This happens across multiple independently sourced GLB files, so it does not appear to be specific to the robot.glb file itself or to a malformed model asset.
Activity
Not-Nik commentedon Aug 17, 2026
Can you check which condition makes
IsModelValidfail with a debugger? If a Model is usable, the function shouldn't fail, so chances are good that this is a raylib bug, not an issue with us verifying loading worked.void-ripper commentedon Aug 29, 2026
After some debugging
Thats were it fails. Since me and GDB are not really friends, i was not able to detect which part of the expression was failing.
But at this point i invested to much time into this.
I go with my gut feeling, we have boneIndices, but vboId[7] != 0, could be an initialization error.
But should vboId not be unequal zero, because we have a vbo initialized ?
DanielVernall commentedon Sep 27, 2026
I can reproduce this with the official
robot.glbexample model using raylib 6.0.The model loads successfully through the C API (
raylib.cdef), including all 20 VAOs shown in the raylib log:However, calling
IsModelValid()immediately afterwards returns:Inspecting the returned
Modelgives:All 19 meshes have non-null
boneIndicesandboneWeights, but their corresponding bone VBOs are zero. For example:This appears relevant because
IsModelValid()checks the bone buffers whenboneIndices/boneWeightsare present. The result is thereforefalseeven though the model has successfully loaded and its regular vertex/index buffers have valid VBO IDs.There is also a notable discrepancy in the output:
The code used:
The full printed output:
So at this point the issue appears reproducible independently of the Zig wrapper: the underlying raylib C
LoadModel()succeeds, butIsModelValid()reports the resulting model as invalid.The discrepancy between the loader reporting 14 meshes / 3 materials and the returned
Modelcontaining 19 meshes / 4 materials may also be significant and worth investigating.I get the same
IsModelValid() == falseresult withgreenman.glbfrom the raylib examples, as well as with a separate animated model downloaded from Mixamo and converted to GLB format. This happens across multiple independently sourced GLB files, so it does not appear to be specific to therobot.glbfile itself or to a malformed model asset.Not-Nik commentedon Oct 4, 2026
Looks like an issue mostly with raylib itself, so I'd suggest creating an issue on their repo.