raysan5 / raylib

A simple and easy-to-use library to enjoy videogames programming
http://www.raylib.com
zlib License
21.41k stars 2.17k forks source link

[rmodels] Review `LoadGLTF()`, boneId loading to fit into `unsigned char` data #3836

Closed raysan5 closed 4 months ago

raysan5 commented 6 months ago

glTF could provide joints data (cgltf_attribute_type_joints) in multiple formats, raylib only supports model.meshes[].boneIds as unsigned char. A conversion is required.

x1nixmzeng commented 5 months ago

I've hit this issue with some test models from the Adobe Mixamo service.

Any ideas on the intended fix? Just adding converters for incorrectly stored data cgltf_component_type_r_16u or looking to rewrite how raylib handles boneids?

raysan5 commented 4 months ago

@x1nixmzeng I'm adding converters for incorrectly stored data, I'm not redesigning raylib to support more than 255 bone Ids.

raysan5 commented 4 months ago

Reviewed JOINTS loading, per glTF specs only vec4 and u8/u16 formats should be supported.