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
The .vox file format (https://paulbourke.net/dataformats/vox/) specifies that you can have multiple chunks in one file. Each is introduced by a SIZE section. In https://github.com/raysan5/raylib/blob/master/src/external/vox_loader.h you can see in Vox_LoadFromMemory where the SIZE sections are handled there is always a call to Vox_AllocArray where m_arrayChunks is always resized based on the values for that SIZE section. What this means in practice is that each SIZE section ends up resetting the loaded chunks in our VoxArray3D, so whichever chunk data happens to come last in the file is the only data that gets loaded.
There is an example file at https://static.biomes.aw/wood_container.vox that illustrates the problem. In MagicaVoxel you can see it's a model of a wooden chest consisting of two sub-parts. When it's loaded in a raylib app the top is missing - see screenshots.
Issue description
The .vox file format (https://paulbourke.net/dataformats/vox/) specifies that you can have multiple chunks in one file. Each is introduced by a SIZE section. In https://github.com/raysan5/raylib/blob/master/src/external/vox_loader.h you can see in Vox_LoadFromMemory where the SIZE sections are handled there is always a call to Vox_AllocArray where m_arrayChunks is always resized based on the values for that SIZE section. What this means in practice is that each SIZE section ends up resetting the loaded chunks in our VoxArray3D, so whichever chunk data happens to come last in the file is the only data that gets loaded.
There is an example file at https://static.biomes.aw/wood_container.vox that illustrates the problem. In MagicaVoxel you can see it's a model of a wooden chest consisting of two sub-parts. When it's loaded in a raylib app the top is missing - see screenshots.
Environment
Windows 11 x64 10.0.26100 Build 26100, NVIDIA GeForce RTX 3090, OpenGL v4.6
Issue Screenshot
Full model in MagicaVoxel:



Model with bottom part disabled in Magic Voxel:
Model as it's loaded in raylib app:
Code Example
The text was updated successfully, but these errors were encountered: