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
Voxelbro
Posts: 36
Joined: Sat Feb 22, 2014 11:22 am

Voxels with MagicaVoxel

Post by Voxelbro »

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)
+Mirror
+Custom edge color
+Grid
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
Image


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

Image

Part 2- Modeling

you should have something like this
Image

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)"

Image

(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.
User avatar
Tormentor667
Posts: 13462
Joined: Wed Jul 16, 2003 3:52 am

Re: Voxels with MagicaVoxel

Post by Tormentor667 »

Very cool tutorial :)
User avatar
YukiHerz
Global Moderator
Posts: 1503
Joined: Mon Dec 02, 2013 6:01 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Where corruption is redefined daily.

Re: Voxels with MagicaVoxel

Post by YukiHerz »

I'll give this a shot, seems interesting

Edit: WHOOOSH!.

Image
User avatar
wildweasel
Moderator Team Lead
Posts: 21455
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10, 21H1
Graphics Processor: nVidia with Vulkan support

Re: Voxels with MagicaVoxel

Post by wildweasel »

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.)
User avatar
YukiHerz
Global Moderator
Posts: 1503
Joined: Mon Dec 02, 2013 6:01 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Where corruption is redefined daily.

Re: Voxels with MagicaVoxel

Post by YukiHerz »

i could import a .vox by dragging it into MagicaVoxel, but it didn't work for .kvx, so no.
User avatar
Voxelbro
Posts: 36
Joined: Sat Feb 22, 2014 11:22 am

Re: Voxels with MagicaVoxel

Post by Voxelbro »

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.
User avatar
agaures
Posts: 303
Joined: Mon Jan 07, 2013 7:33 pm
Location: New Zealand

Re: Voxels with MagicaVoxel

Post by agaures »

First attempt at using this program:
Spoiler:
I quite like it. Found it relatively easy to use.
User avatar
Enjay
 
 
Posts: 26418
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Voxels with MagicaVoxel

Post by Enjay »

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:

Image

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.
User avatar
agaures
Posts: 303
Joined: Mon Jan 07, 2013 7:33 pm
Location: New Zealand

Re: Voxels with MagicaVoxel

Post by agaures »

Enjay wrote:Stuff
Ah. Thank you for your kind words and support.
User avatar
Enjay
 
 
Posts: 26418
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Voxels with MagicaVoxel

Post by Enjay »

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. :)
User avatar
Voxelbro
Posts: 36
Joined: Sat Feb 22, 2014 11:22 am

Re: Voxels with MagicaVoxel

Post by Voxelbro »

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
User avatar
Enjay
 
 
Posts: 26418
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Voxels with MagicaVoxel

Post by Enjay »

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).
ephtracy
Posts: 5
Joined: Mon Apr 21, 2014 7:56 am

Re: Voxels with MagicaVoxel

Post by ephtracy »

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?tit ... Title=Home
Image
User avatar
Voxelbro
Posts: 36
Joined: Sat Feb 22, 2014 11:22 am

Re: Voxels with MagicaVoxel

Post by Voxelbro »

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.
User avatar
torridgristle
Posts: 684
Joined: Fri Aug 23, 2013 9:34 am

Re: Voxels with MagicaVoxel

Post by torridgristle »

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?

Return to “Tutorials”