Voxels with MagicaVoxel

Thu Apr 17, 2014 7:40 pm

Edit: 21/04/14- MV just got support for pngs, removed tgas from tutorial. Dev uploaded a tutorial that cover 70% of this at https://voxel.codeplex.com/wikipage?tit ... Title=Home

Why MagicaVoxel :
Most other tutorials on how to do voxels for Doom recommend a SLAB6 + strip2voxel combo. Every little second I used the combo I couldn't help but wonder if there was any other method, and that was no small amount of seconds as voxels took hours. Strip2voxel isn't easy and thinking with slices is counterintuitive. And then MagicaVoxel appeared.

Things only it can do:

+Undo and redo
+import sprites right into the editor
+Face and brush edit ( Now you can paint/remove/add more than 1 voxel at time!)
+rotate, flip, move around
+a bad workaround for copy/paste (comparing to no copy/paste SLAB6 has, it's mighty good)
+Custom edge color
and more

Cons (For now)

-Requires OpenGl
-Can't set offset

Needed tools
the MagicaVoxel itself- http://ephtracy.github.io/
we can't completely break free from SLAB6 yet - http://advsys.net/ken/download.htm
Something to convert pngs to tgas, for example, png2tga - http://www.easy2convert.com/png2tga/

The actual Tutorial

Part 1- Importing that sprite

1- Pick any sprite you want to do. The sprite I'll use is ww-doomnukem's STIMA0

2- MagicaVoxel can't import png files, but it can import .tga ones.Use the png2tga to create the tga, or whatever method you may choose

3- Execute MagicaVoxel. Drag the .png to palette first and then drag the png again, this time into the cube


Part 2- Modeling

you should have something like this

1- Get used to the hud. Most functions are named after letters, so if you want to know what the g,e and f under Line tab mean click the circled i next to the console. Next time you mouse over a function it will tell it's name and hotkeys

Very important functions to know:

v,f and b are brush settings.
V works like pencil in paint ( not very useful)
F is face edit and works like a bucket ( you can change if it's color or geo based in the Face tab)
B adds/paints/erases every cube from the cube you clicked to the last cube you dragged

picking colors is done by holding alt and clicking on the cube with desired color

In the same bar as the console icon next to the ruler toggles freemode camera

How to copy/paste(kinda): under the shape tab, there's a pattern function. It places wherever you point at the voxel specified in the pattern tab on the lower right. Copying is done by saving the desired cubes in another voxel and pasting is done by using that voxel in the pattern function

2-You probably want your voxel to be deeper than 1 cube. As shaving is easier than adding cubes, Decide how large your voxel will be at it's maximum. For example, I want my syringe to be
5 cubes large at it's maximum. Then go to Scale and write "y (insert how large here)"


(Hint: some voxels need more precision than 1 pixel : 1 cube. You can scale them 2X the original sprite, work in detail, and then scale them back to the original size with voxeldef)

3- Remove voxels until it's at desired shape

4-Touchups. Don't deviate too much from the original in the parts that the original sprite doesn't cover

Part 3- Exporting and Loading

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.
Done! Now you have an working voxel. It needs to be in a voxels folder if it's in a pk3 or between VX_START and VX_EN if it's in a wad
Last edited by Voxelbro on Fri Dec 01, 2017 8:48 am, edited 2 times in total.

Re: Voxels with MagicaVoxel

Fri Apr 18, 2014 8:02 am

Very cool tutorial :)

Re: Voxels with MagicaVoxel

Fri Apr 18, 2014 1:32 pm

I'll give this a shot, seems interesting



Re: Voxels with MagicaVoxel

Fri Apr 18, 2014 3:03 pm

This doesn't look too difficult at all. I don't suppose MagicaVoxel can edit existing KVX files, can it? (I cannot confirm, since I'm on my Linux netbook at the moment.)

Re: Voxels with MagicaVoxel

Fri Apr 18, 2014 3:13 pm

i could import a .vox by dragging it into MagicaVoxel, but it didn't work for .kvx, so no.

Re: Voxels with MagicaVoxel

Fri Apr 18, 2014 5:15 pm

wildweasel wrote: I don't suppose MagicaVoxel can edit existing KVX files, can it?

Just open the kvx in SLAB6 and save it as .vox. MV can import slab's .vox

HazeBandicoot wrote:Edit: WHOOOSH!.

nice one.

Re: Voxels with MagicaVoxel

Fri Apr 18, 2014 7:47 pm

First attempt at using this program:


I quite like it. Found it relatively easy to use.

Re: Voxels with MagicaVoxel

Sat Apr 19, 2014 1:54 am

While I'm not trying to rain on anyone's parade, I'm still not feeling the love for voxels. I'd rather see either of the first two of these in game over the third:


While I can see it's a well enough made voxel model, most of the time, I just don't think voxel models look particularly good. They have a use but, IMO, it's not the wholesale replacement of sprites.

Re: Voxels with MagicaVoxel

Sat Apr 19, 2014 4:24 am

Enjay wrote:Stuff

Ah. Thank you for your kind words and support.

Re: Voxels with MagicaVoxel

Sat Apr 19, 2014 6:12 am

It's not a problem with what you did - you made a good, little model. It's just that I personally find the voxel format itself not very nice to look at. YMMV as they say. :)

Re: Voxels with MagicaVoxel

Sat Apr 19, 2014 6:41 am

but Enjay, the comparison you posted is unfair. agaures posted the image with advanced shading on,which makes extra blocky voxels looks nothing like in game. Compare in-game pics of the three

Re: Voxels with MagicaVoxel

Sat Apr 19, 2014 7:08 am

True, but I don't have a picture of his model without the advanced shading. I had the sprite though, and I whipped up the MD3 model in 5 minutes.

Regardless, advanced shading or no, the IMO, the blocky, graininess of voxel models makes them quite ugly in my eyes when they are used in game. As a general rule, I don't find them to be an improvement over sprites and with curved models (e.g. your avatar, a soul sphere, etc) I think they look borderline dreadful. I'm not saying that they don't have their place. For example, I think making cunning parts of map architecture with voxels rather than mid-textures can work very well (e.g. diagonal beams "holding up" a roof, a bridge etc etc). However, I simply don't think that they work well for many sprite replacements.

I am, however, also aware that I'm not going to convince anyone otherwise (nor am I trying to) so it's possibly best if I just butt out of the thread. I've expressed my thoughts on the matter but I don't want to bog things down with an argument over something very subjective where I'll probably just end up annoying people who like voxels and who feel I'm trying to undermine their efforts (which I'm not).

Re: Voxels with MagicaVoxel

Mon Apr 21, 2014 8:20 am

Hi Voxelbro,
just discovered this cool post:)
so I improved MagicaVoxel based on your tutorial to make things a little easier :

1. Support PNG format sprite/palette import/export
2. Now it will use the first 255 individual colors from image to generate the palette
( before it used the first 255 pixels of image, so may not be very accurate )

Here are some details, Thanks:) https://voxel.codeplex.com/wikipage?title=How%20To&referringTitle=Home

Re: Voxels with MagicaVoxel

Mon Apr 21, 2014 11:42 am

I'm flattered you posted here! Your software made my work way better and my life easier!

And now you're here, time for some feedback.
Is it possible to instead of attaching a cube of a selected color,I toggle a function, and now it attachs a cube with the color of the face I'm pointing at? This would make adding as easy as shaving.
Looking foward sub folders in the models list, as I have over 200 of them.

Re: Voxels with MagicaVoxel

Mon Apr 21, 2014 10:02 pm

After extruding, is there a way to cut down on the thickness by removing voxels from the middle to preserve the front and back faces?