Skip to content
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

Support for Multiple Models in World #7

Open
HurricanKai opened this issue Sep 14, 2018 · 16 comments
Open

Support for Multiple Models in World #7

HurricanKai opened this issue Sep 14, 2018 · 16 comments

Comments

@HurricanKai
Copy link

Recently Magica Voxel introduced the World mode, where its possible to have multiple Models in one "Scene", it woud be great to have support for that :)

@tommyettinger
Copy link
Owner

This should be possible, though I haven't updated my MagicaVoxel version in a while (at least some versions didn't support animations, and other issues on IsoVoxel specifically needed me to test animations). Some of the rendering methods here are better-suited than others for this, so a World-mode renderer may need to only produce some sizes of renders. I'll start on this when I understand World mode a little better, and hopefully I will have used it some.

@HurricanKai
Copy link
Author

I think here it should be enough to know that world mode is just a Model Array instead of a single moddel. Iterating over each one and then handling each one like you are a single one now should be fine? (Maybe lightning won't be as great, but for now just it not throwing an error would be enough ^^)

@tommyettinger
Copy link
Owner

Hmm... World mode seems like it might use some very different extensions to the .vox format, which previously was fairly simple. The docs for the scene graph addendum to the format seem like they will be a lot of work to support, and it also looks like the format is still changing, since that file was edited 4 days ago. I'd like to see someone's code that reads in files with these extended features before I try to write my own.

@superfrantv
Copy link

Greetings from Germany,

iam also wish to convert vox scenes (world format) to a big sized picture with IsoVoxel.
Hope it is possible.

@HurricanKai
Copy link
Author

Not sure if this is still supported, but it should be fairly easy to implement the new stuff (excluding nOBJ) I found it quite easy in my vox/unity conversion tool
The changes:

* there can be multiple SIZE and XYZI chunks for multiple models; model id is their index in the stored order
* the palette chunk is always stored into the file, so default palette is not needed any more
* the MATT chunk is deprecated, replaced by the MATL chunk, see (4)
* (a), (b), (c) are special data types; (d) is the scene graph in the world editor

@tommyettinger
Copy link
Owner

Yeah, I'm still somewhat interested in implementing this feature, but I really don't understand the world format's docs, and I haven't found any (readable) existing code that can parse it. There's some seriously weird usage of DICT, which is described in one place as having string keys and string values, and completely different info in other places, including mixed types for values. If I could see some existing code that loads world scenes (I have not used the world renderer myself), that would help a lot.

@superfrantv
Copy link

superfrantv commented Apr 6, 2020

Hello, have you read from the official documentation? this is used by magicavoxel, or ask Ephtracy?
https://github.com/ephtracy/voxel-model

@HurricanKai
Copy link
Author

The DICT is always string. You just have to parse that string into whatever format the actual value is

@HurricanKai
Copy link
Author

Wouldn't say this is super readable, but it should work if you ignore all the Unity related stuff and just focus on the serializing bits (at the end) https://gist.github.com/HurricanKai/d63a36016167204bcf613d08d07d7e70

@tommyettinger
Copy link
Owner

Thanks! I'll take a look.

@superfrantv
Copy link

Hey Tommy, you can also ask Zarbuz, he has finished the chunk/world thing.

https://github.com/Zarbuz/FileToVox

@tommyettinger
Copy link
Owner

I just got onto the MagicaVoxel Community Discord, and noticed some discussion of the world hierarchy's complexities. I think I saw Zarbuz there, I'll ask about this in a bit.

@HurricanKai
Copy link
Author

Didn't know that existed, will join that too, you can also DM me anytime (Kai#2345)

@pointofpresence
Copy link

any news?

@tommyettinger
Copy link
Owner

None! I did join the MagicaVoxel Community Discord (I'm TEttinger if you're there) but I didn't really know what to ask. I saw FileToVox mentioned often, so I'll probably look at how it handles this. I'm still also not sure what I'm going to do about another open issue regarding desaturation when rendering sloped voxels...

TBH IsoVoxel hasn't been a major priority for me lately; I've been writing lots of Java for another project, SquidLib, so a Java voxel renderer was a natural fit. I haven't tried to make that renderer general-purpose (its goal is to make isometric pixel art to supply as an asset library, not to render any voxel model); it's https://github.com/tommyettinger/isonomicon , it only does isometric views, and the results look pretty different. IsoVoxel was mostly hacked together 5-6 years ago, in C# because at that time it had a .vox parser written already, and C# is much easier for me to read than C/C++. I still don't know C# that well. I'll try to look into this, but I'm not especially optimistic about it being an easy change.

@heenamkung
Copy link

I just created a copy of my vox file (which contains multiple objects), and combined every object into a single object (using the "union" function in magicavoxel). I then drag that to IsoVoxel and voila.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants