opengametools icon indicating copy to clipboard operation
opengametools copied to clipboard

ogt_vox: Custom XYZI chunk loading

Open dougbinks opened this issue 2 months ago • 0 comments

In discussion of #79 I proposed that we should consider extending ogt_vox.h to add a way to directly load the XYZI chunk data into our own data structure which would support both parallel loading and also lower memory during load (no need for an intermediate array).

I initially proposed having a custom chunk load function, but @jpaver proposed a deferred chunk loading approach:

@jpaver: In principle we could add a deferred geometry loading mode where instead of constructing the mesh list we return a new list of spans (pointer+size) to each the geometry chunks. Then the caller can call read_scene as usual and request non instantiation of geometry and then send the list to worker threads. The one downside is the palette remapping step (applying IMAP and reordering so that color index=0 is empty space) would need to be done by whatever is doing the deferred load, but maybe we can expose that as an API.

Note: ogt_vox.h works on file data which is already loaded into memory.

This seems to be a good approach and could also match the requirement for custom chunk loading, although these chunks would still need some custom processing by ogt_vox.h.

dougbinks avatar Nov 04 '25 10:11 dougbinks