Voxels with MagicaVoxel

Handy guides on how to do things, written by users for users.

Moderators: GZDoom Developers, Raze Developers

Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.
User avatar
ramon.dexter
Posts: 1343
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Voxels with MagicaVoxel

Post by ramon.dexter »

RSSwizard wrote:How exactly do you model in a program like this, id think it would be like pixel art but i cant figure out how to carefully (precisely) place the blocks where I want them. Like restricting it to one Z slice at a time like a 3d printer does.
What?

Basically, using magicavoxel is close to working with pixelart. If you want to place it exactly, you need to use grid+edges...
Kullenberg
Posts: 14
Joined: Mon Oct 31, 2016 3:39 pm

Re: Voxels with MagicaVoxel

Post by Kullenberg »

Is a voxel sprite more "cost effective" in ZDoom software mode than the same converted 3d faux voxel in GZDoom?

How about, say a regular billboarded sprite for decoration vs the same sprite converted to (true) voxels with just a one voxel thick extrusion? I'm assuming sprites are less taxing to draw for the system but since I'm more of a artist than a tech guy I wouldn't know.
User avatar
Rachael
Admin
Posts: 13208
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Voxels with MagicaVoxel

Post by Rachael »

Kullenberg wrote:Is a voxel sprite more "cost effective" in ZDoom software mode than the same converted 3d faux voxel in GZDoom?
Way more.

A faux voxel model in GZDoom has at least 14 structures for every "pixel" - that includes its 8 vertices and 6 box-face sides. All of this is carefully rendered by the GPU, whereas in ZDoom the structure is only a single pixel.
Gez
 
 
Posts: 17728
Joined: Fri Jul 06, 2007 3:22 pm

Re: Voxels with MagicaVoxel

Post by Gez »

It is probably possible to turn each voxel into a simple billboarded quad, then it'd look closer to how software renders it and you could reduce it to four pixels and one side. At least it's an effect I have seen in the NIF format when modding TES games; not to make voxels obviously but to do stuff such as the light halo of a candle or the foliage of a tree.
User avatar
Major Cooke
Posts: 8109
Joined: Sun Jan 28, 2007 3:55 pm

Re: Voxels with MagicaVoxel

Post by Major Cooke »

I wish this software could go bigger than 126x126x126. I wonder why it's limited.
User avatar
worldendDominator
Posts: 286
Joined: Sun May 17, 2015 9:39 am

Re: Voxels with MagicaVoxel

Post by worldendDominator »

Voxelbro wrote:+a bad workaround for copy/paste
How do I use that?
User avatar
Nash
 
 
Posts: 17346
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Voxels with MagicaVoxel

Post by Nash »

Gez wrote:It is probably possible to turn each voxel into a simple billboarded quad
I asked Graf about this before and this is what he said:
Graf Zahl wrote:Not going to happen. The current approach is very efficient and allows to render the entire voxel with a single draw call. Doing per-column billboarding would really add up to a lot of processing time.
Not to mention that voxel rendering in the software renderer is rather glitchy if you know where to look. The way GZDoom does it is rock-solid 3D and won't exhibit any strange quirks.
User avatar
ramon.dexter
Posts: 1343
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Voxels with MagicaVoxel

Post by ramon.dexter »

Major Cooke wrote:I wish this software could go bigger than 126x126x126. I wonder why it's limited.
I'm wondering the same. As I understood, voxel models used in build engine were limited to 256x256x256 voxels...
User avatar
Gato303
Posts: 36
Joined: Wed Mar 30, 2016 6:14 pm
Location: Colombia

Re: Voxels with MagicaVoxel

Post by Gato303 »

Voxelbro wrote:1- Done with that voxel? now it's time to get it working. Open the export tab and click slab. Pop. A file named howyounamedyourvoxel.slab.vox should have apeared in the export subdirectory of your MagicaVoxel folder.
2- Open it up in SLAB6. Open the Tools tab and click Adjust pivots. Mouse into the boxes on the left and use the arrow keys to move the base point. You just need to put it at the base of the model, so it doesn't clip though the floor in-game.
3- Save it as .kvx, the number of Mips doesn't matter.
Thanks a lot for the "export" tip on Magica Voxel, I was using Goxel on Linux and was exporting my test model to VOX (Magica Vox) format but it never open in Slab6 (not in Windows7 nor under Wine on Linux - not compatible), so I am opening it now on MagicaVoxel (running through Wine too), and with the option Export to Slab6 VOX, now it opens on Slab6 and it lets me save as KVX and now I can see it in game, gotta check how to fix the pivot point tho...
User avatar
Cherno
Posts: 1297
Joined: Tue Dec 06, 2016 11:25 am

Re: Voxels with MagicaVoxel

Post by Cherno »

Gato303 wrote:
Voxelbro wrote:1- Done with that voxel? now it's time to get it working. Open the export tab and click slab. Pop. A file named howyounamedyourvoxel.slab.vox should have apeared in the export subdirectory of your MagicaVoxel folder.
2- Open it up in SLAB6. Open the Tools tab and click Adjust pivots. Mouse into the boxes on the left and use the arrow keys to move the base point. You just need to put it at the base of the model, so it doesn't clip though the floor in-game.
3- Save it as .kvx, the number of Mips doesn't matter.
Thanks a lot for the "export" tip on Magica Voxel, I was using Goxel on Linux and was exporting my test model to VOX (Magica Vox) format but it never open in Slab6 (not in Windows7 nor under Wine on Linux - not compatible), so I am opening it now on MagicaVoxel (running through Wine too), and with the option Export to Slab6 VOX, now it opens on Slab6 and it lets me save as KVX and now I can see it in game, gotta check how to fix the pivot point tho...
You do this in Slab6 by moving the mouse cursor over the small rectangle that represents the axis (it will start glowing) in the bottom left corner, then hitting the arrow keys until the pivot point is at the required position.
User avatar
Gato303
Posts: 36
Joined: Wed Mar 30, 2016 6:14 pm
Location: Colombia

Re: Voxels with MagicaVoxel

Post by Gato303 »

Cherno wrote:
Gato303 wrote:
Voxelbro wrote:1- Done with that voxel? now it's time to get it working. Open the export tab and click slab. Pop. A file named howyounamedyourvoxel.slab.vox should have apeared in the export subdirectory of your MagicaVoxel folder.
2- Open it up in SLAB6. Open the Tools tab and click Adjust pivots. Mouse into the boxes on the left and use the arrow keys to move the base point. You just need to put it at the base of the model, so it doesn't clip though the floor in-game.
3- Save it as .kvx, the number of Mips doesn't matter.
Thanks a lot for the "export" tip on Magica Voxel, I was using Goxel on Linux and was exporting my test model to VOX (Magica Vox) format but it never open in Slab6 (not in Windows7 nor under Wine on Linux - not compatible), so I am opening it now on MagicaVoxel (running through Wine too), and with the option Export to Slab6 VOX, now it opens on Slab6 and it lets me save as KVX and now I can see it in game, gotta check how to fix the pivot point tho...
You do this in Slab6 by moving the mouse cursor over the small rectangle that represents the axis (it will start glowing) in the bottom left corner, then hitting the arrow keys until the pivot point is at the required position.
Thank you, I could find it out how to make it work ^_^
User avatar
GraveUypo
Posts: 11
Joined: Sat Jun 03, 2017 6:20 pm

Re: Voxels with MagicaVoxel

Post by GraveUypo »

this is pretty cool. i made a pile of rocks and it looks awesome. BUT! it's sinking into the ground, with only like the top 3 lines of voxels showing. voxels don't inherit sprite offsets? how do i even fix this?
on the left, the whole thing suspended on the air, on the right, how it sits when it lands on the floor
https://i.postimg.cc/QC9VRbg8/Screensho ... 194722.png

[edit] damn, i swear i didn't see the answer two posts above. gonna try that
[edit2] yep that fixed it. sorry for unburying this
Guest

Re: Voxels with MagicaVoxel

Post by Guest »

Hey, i'm back!
I found this whole process of converting a file a bunch of times a bit cumbersome, so i asked the guys at drububu.com if they would implement conversion directly from .obj to .kvx, and my request was actually fulfilled! like in the same week, which is amazing.
Here it is:
http://drububu.com/miscellaneous/voxelizer/?out=kvx
Converting directly to kvx is a new feature so it hasn't been tested properly, but it should help in skipping at least one step in this tutorial and make things a little easier. The tool itself is pretty intuitive to use so that helps. anyway, i'm off to do some testing.
User avatar
Nash
 
 
Posts: 17346
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Voxels with MagicaVoxel

Post by Nash »

Phoebe Mengerman wrote:Hey, i'm back!
I found this whole process of converting a file a bunch of times a bit cumbersome, so i asked the guys at drububu.com if they would implement conversion directly from .obj to .kvx, and my request was actually fulfilled! like in the same week, which is amazing.
Here it is:
http://drububu.com/miscellaneous/voxelizer/?out=kvx
Converting directly to kvx is a new feature so it hasn't been tested properly, but it should help in skipping at least one step in this tutorial and make things a little easier. The tool itself is pretty intuitive to use so that helps. anyway, i'm off to do some testing.
That's neat, but it doesn't seem to transfer the texture/UV map? So you end up with a colour-less/texture-less voxel object... unless I'm doing something wrong... ?
User avatar
GraveUypo
Posts: 11
Joined: Sat Jun 03, 2017 6:20 pm

Re: Voxels with MagicaVoxel

Post by GraveUypo »

Nash wrote:
Phoebe Mengerman wrote:Hey, i'm back!
I found this whole process of converting a file a bunch of times a bit cumbersome, so i asked the guys at drububu.com if they would implement conversion directly from .obj to .kvx, and my request was actually fulfilled! like in the same week, which is amazing.
Here it is:
http://drububu.com/miscellaneous/voxelizer/?out=kvx
Converting directly to kvx is a new feature so it hasn't been tested properly, but it should help in skipping at least one step in this tutorial and make things a little easier. The tool itself is pretty intuitive to use so that helps. anyway, i'm off to do some testing.
That's neat, but it doesn't seem to transfer the texture/UV map? So you end up with a colour-less/texture-less voxel object... unless I'm doing something wrong... ?
I think we've just finished tuning the tool. I mean, i bothered Arjan for way too long with my selfish requests. It should now work straight out of the box in slade, no need to go through any conversion. All you'll need to do is to adjust the pivot in slab6 to prevent the model from sinking into the ground, but that's done in literally seconds.

As for texture, you need a model with a baked texture (a single texture and a single object). It should work automatically with some models, and with others it will ask for a texture file.
Here's a couple of tests i made using this.
https://www.youtube.com/watch?v=N_-LdLYvvWo
Colors can be a bit off at times, but if you're careful when texturing to keep within the doom palette (i asked him to implement the doom palette into the software too) it shouldn't be a problem.

[edit] welp i gave him some wrong info, so now the default pivot is now on the top row of voxels instead of the middle, and the model sinks entirely underground by default. I guess i'll bother him one last time to fix this so you don't even need to go through the trouble of fixing the pivot in slab6

Return to “Tutorials”