-
Notifications
You must be signed in to change notification settings - Fork 410
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
Undocumented File Format Structures (as of 0.99) #19
Comments
If there's anything I can do to help let me know. |
Please update the docs further, |
bump. LAYR and rOBJ is still not documented. would be very appreciated. |
Hello all, like you, i tried to understand the new file format. i thinck im successfull. the weird thing about this new format, is the format number (150) is the same in each voxel files i opened .... old files and new :) i used hexamonkey (http://hexamonkey.com), who is a fabulous binary file analyser, so i found that the byte offset you seen, is due to the STRING TYPE in each DICT. and i think the LAYER Chunck is : i seen that the unknown var is always -1, so i think its a reserved int on 4 bytes, like other reserved items. so it display that : here the grammar: and here the result : marvelous no ? :) the grammar file is available on my repor : https://github.com/aiekick/MagicaVoxel_File_Formats |
Thank you! This is amazing! |
i not seen the rOBj in my vox files. do you have sample vox file with this rOBJ ? for search the structure |
This little 3x3x3 pyramide has the mentioned rOBJ-Tag. It got created with the latest version that supports multiple objects in one file, 0.99.1 under Windows. As it wasn't very complicated to create, it's licensed under WTFPL. |
@DanielGilbert I created a pullrequest with the rOBJ chunk aiekick/MagicaVoxel_File_Writer#1 |
i have approved the request. :) |
i added in my repo a basis vox writer with world mode support :) it can be improved i think but for the moment it take the job. my goal was just to export voxel block in new world mode from my Soft "SdfMesher" : https://twitter.com/hashtag/sdfmesher?src=hash |
Hi all, found this issue because I'm working on a numpy-vox format lib and I also noticed stuff in the saved vox files not in the file format description. Just adding a +1 really. @ephtracy, any chance of documenting the current file format doc please? |
Or in the very least, updating the model version written to files (apparently it's still at 150), so we can at least know if we're trying to open a file with a model format we don't yet know how to parse. |
the reason why the version is still 150 is to make the file readable in older versions (the old version only accepts files with version 150). |
the rendering setting are not open yet because they are changing frequently. But you can still read it since it is just in the DICT format. I will update the format of the Layer chunks though. |
@ephtracy Could you please provide an update on .vox format documentation? |
+1 ... would rather like to know what rOBJ does |
(I'm guessing it's lighting, background, skybox and camera information, and I really would like to use that so I can import scenes directly into my game engine) |
What is IMAP about? A chunk I've found in the PrinceOfPersia scene: https://www.patreon.com/posts/prince-of-persia-26600425 |
About the IMAP and NOTE chunk: IMAP: The palette of a VOX file contains 256 colors, all identified by their index and containing a specific color (r,g,b,a). The RGBA chunk contains the color information of the palette but not the exact indexes (let's assume for the moment that the order of RGBA is random). To overcome this problem and find the exact palette index of each color, the IMAP chunk stores the RGBA/palette index mapping.
By the way ... NOTE:
|
@hugodecasta Thanks for the hint regarding IMAP, saved my day! |
Yes, the RGBA data saving order is still a mystery to me too (maybe it has to do with the inner working of MV: moving stuff around for other purposes. Who knows). |
@hugodecasta Yes. Also: When IMAP chunk is not present (needs to be checked when importing), the index of the RGBA chunk and voxel color index match, like one would expect. |
Until an official behavior documentation hard to find out why such different behaviors |
Thanks so much for this description, it seems to be the only one online that describes what this chunk actually does (and importantly, in which direction it "maps"). However, in files produced by MV that contains such a chunk, which I always ignored in the past, and produces correct colors. Looking at the chunk, it contains a fairly "random mapping", i.e. there's not a lot of correlation between the array index and the value in the array. Trying to apply it according to your description results in wrong colors. It seems to me the voxel indices in a Anyway, for posterity, here's what I did to create a remapped palette:
If you're wondering why the indices are off, my |
It's also used for reading palette labels. |
The 'IMAP' node is used to map voxel indexes (the 'i' value on each Voxel structure) to the color palette in a way that is *not* simply value-to-value. This structure has the following behavior if it appears in a file: ephtracy/voxel-model#19 (comment) When importing a file which contains this, imported models will not match the expected values in the palette unless the IMAP is respected.
The 'IMAP' node is used to map voxel indexes (the 'i' value on each Voxel structure) to the color palette in a way that is *not* simply value-to-value. This structure has the following behavior if it appears in a file: ephtracy/voxel-model#19 (comment) When importing a file which contains this, imported models will not match the expected values in the palette unless the IMAP is respected.
There exists undocumented data members inside the VOX file format. Proceeding the XYZI data, we can see tags labelled:
These appear to be non-standard when compared to the other Chunk types as they don't seem to be 4-byte aligned and are may be terminated with 0xFFFFFFFF.
Furthermore the old description for materials MATT appears to have been replaces by a new descriptor MATL which uses strings to identify material properties rather than pure binary.
The text was updated successfully, but these errors were encountered: