Making voxels with Strip2Voxel & SLAB6

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
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

Making voxels with Strip2Voxel & SLAB6

Post by amv2k9 »

Voxels are an easy way to add simple 3D models to Doom, but the process of using the necessary tools can be hampered by less-than-adequate documentation. So in this tutorial, we'll learn how to create a voxel from an existing sprite using Strip2Voxel, and then export it for use in ZDoom using SLAB6. Both of these programs are available here. In addition to those two programs, you'll need an image editing program. Nothing fancy is required; use what you're comfortable with. It may help you organize things better if your editor supports separating graphics into layers, though.

To start with, we need a sprite. For the purposes of this tutorial, I'm using Strife's small health pack 'STMPA0'.

It's fairly low-res, so creating and touching up the voxel won't be too overwhelming, but the sprite is drawn in such a way that we can learn a bit about the ins and outs of making a convincing voxel at the same time.

Now, as its name might imply, Strip2Voxel will make a voxel from an image that is a strip of individual images, one for each layer. So, we need to figure out what is going to make up each layer.
Image
Now if we look at the shading, STMPA0 looks like a cylinder set on its side, and these four darker vertical lines of pixels, two on the end and two in the middle, look like they should be recessed. So let's make our image strip follow that logic.
Image
Here's our finished strip. Note that this image strip is arranged vertically. You can arrange it either vertically or horizontally, whichever's easier for you; Strip2Voxel will ask for whether a strip is vertically or horizontally ordered. Remember: When working with a vertical strip, the top image is the first layer, and in a horizontal strip, the farthest left image will be the top layer. The black portions will be transparent; Strip2Voxel uses black as the default transparent color. If you need black in your voxel, you can always select another color to use as a transparent once you get into Strip2Voxel.
Image
For the first layer, we erased everything except the portions of the model which will stick out the farthest. In the second, we see the beginnings of those four recessed vertical rings, and so on and so forth until the fifth frame, where the sprite is at its original dimensions, then we can simply copy-paste frames 5 through 1 for the back half of the model. So, let's save the image into the folder where Strip2Voxel is located, and start up Strip2Voxel. Keep the image editor with the saved image open though; this will come in handy in a second.

Starting up Strip2Voxel, the first thing you'll see is a message saying you should be running 16-bit color; apparently the program does not run (well) otherwise. Anyways, press enter to get past that, and it will ask for the filename of your image strip, with file extension. It is case-sensitive, so if the image is all-caps, enter it that way. Then it will ask you to put in the finished voxel name. So put that in too.

Now for the important stuff; selecting the transparent color, strip orientation (either horizontal or vertical), and the dimensions. This is why we kept the image open; so we can quickly get the dimensions. As you can imagine, getting the dimensions wrong will end up creating a garbage voxel. First width, then height, then layers. Our intended voxel is 24x10x10 so we just put those numbers in. After that, it will ask whether you want mirroring. We won't need that for ours, so 'no' on that. Then it will give us a preview of the image strip and our voxel's intended dimensions, and after accepting that, it will create the voxel. You can then choose to preview the voxel if you want, but we don't need to, since we're opening it up next in SLAB6. So close down Strip2Voxel and open up SLAB6, then load up the voxel.

We use SLAB6 for three reasons: first to do any touchups, but more importantly to set the voxel's pivot point and export it. Setting the pivot correctly is important because normally the Z-pivot will be be at the center of the voxel making it appear half-stuck in the floor. It's also important if you want your voxel to spin, because unless the pivot is set at the voxel's center on its X and Y axes, it's going to look goofy when it spins. Setting the pivot is really the only challenge in this.

So with the voxel loaded, zoom for a closer view (/ and * on your keypad), then press enter to open the slice boxes, which will appear in the lower left of the SLAB6 window. The boxes are kind of like a crosshair in three dimensions, and are used for more advanced editing.
Image
Anyway, press the tilde key (`) to change the slice boxes to a mode where we use them to set the pivot. Hover your mouse over each of the windows in turn, and use the arrow keys to set the pivot on the X, Y and Z axes. X and Y are simple enough; set those to the center of the model. You can see coordinates in the top left of the editing window if you need help centering things. Zooming in and out, and rotating the sprite (, and .) will help too. For the Z axis, we'll set it to the bottom of the model.
Image
Now, save the voxel into KVX format, at which point SLAB6 will ask if you what it to be saved in 1 MIPS or 5 MIPS. I don't know if this matters for ZDoom, but I've selected 5 MIPS and not had problems.

Now, let's try out this voxel ingame. Open up SLADE3. If you're making a wad, add the voxel in between a pair of markers named VX_START and VX_END. If you're making an archive, add the voxel to a folder called 'voxels'. Now to make a VODELDEFS lump. We don't necessarily need to do this; as long as the voxel has the same name as the sprite you want it to take the place of, it will do that automatically. We will make a VOXELDEFS lump to show off one useful feature: spin animation.

Here's what our test VOXELDEFS lump looks like:

Code: Select all

STMPA = "STMPA0"
{
	Scale = 1.0
	Spin = 200
}
Not only will Spin make the item visually 'pop' more, it can allievate a possible problem with models. When a mapper is setting the angle of actors like pickups when making a map, they don't necessarily make sure that the actor is facing outward from a wall, simply because it's not something you notice when an actor's sprite or sprites are always facing the player. Putting Spin on a voxel prevents a pickup from looking like it's been awkwardly put in a corner.
Image
And we're done!
Last edited by amv2k9 on Wed Apr 09, 2014 2:09 pm, edited 9 times in total.
User avatar
Mikk-
Posts: 2274
Joined: Tue Jun 30, 2009 1:31 pm
Location: Somewhere off Kanagawa

Re: Making voxels with Strip2Voxel & SLAB6

Post by Mikk- »

Great tutorial! This has motivated me to make some voxels of my own- so far I've made the chaos device, heretic wall torch and the three keys featured in heretic!
User avatar
Enjay
 
 
Posts: 26533
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Making voxels with Strip2Voxel & SLAB6

Post by Enjay »

I'm not a huge fan of voxels (personally, I think that they look uglier than sprites and, although perhaps more consistent with Doom style and resolution, models too). However, I have been meaning to try my hand at them just to find out more. I've stumbled around blindly with them in the past and not made much headway. This clear tutorial may well be what I need to get me going properly, thank you. :)
User avatar
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

Re: Making voxels with Strip2Voxel & SLAB6

Post by amv2k9 »

Enjay wrote:I'm not a huge fan of voxels (personally, I think that they look uglier than sprites and, although perhaps more consistent with Doom style and resolution, models too).
Yeah; you have to make voxels higher resolution than the sprite they're based on to make something nice, and even the, the boxiness is something you aren't going to get rid of.
User avatar
TheMightyHeracross
Posts: 2100
Joined: Sun Aug 18, 2013 9:41 am
Location: Philadelphia, PA

Re: Making voxels with Strip2Voxel & SLAB6

Post by TheMightyHeracross »

You said to make a "voxel folder ," assuming they use .pk3. However, in case they prefer .wad like me, you should also mention the VX_START and VX_END markers.
User avatar
zrrion the insect
Posts: 2411
Joined: Thu Jun 25, 2009 1:58 pm
Location: Time Station 1: Moon of Glendale

Re: Making voxels with Strip2Voxel & SLAB6

Post by zrrion the insect »

if Strip2Voxel makes the z pivot in the center of the voxel, could you add a blank space underneath the strips so that the halfway point would be halfway through the voxel, but half of the voxcel would be empty. That way you wouldn't have to fuss with Slab6?
User avatar
Dark-Assassin
Posts: 742
Joined: Thu Mar 19, 2009 3:40 am
Location: South Australia

Re: Making voxels with Strip2Voxel & SLAB6

Post by Dark-Assassin »

This is really useful.

Have a Light Wall... With Depth!
Spoiler:
W13_A.png
W13_A.png (3.44 KiB) Viewed 6913 times
Here's another wall...
Spoiler:
WALL57_2.png
And a door...
Spoiler:
DOOR2_1.png
DOOR2_1.png (6.21 KiB) Viewed 6915 times
User avatar
Mikk-
Posts: 2274
Joined: Tue Jun 30, 2009 1:31 pm
Location: Somewhere off Kanagawa

Re: Making voxels with Strip2Voxel & SLAB6

Post by Mikk- »

Those voxel textures look great, would be awesome to see them used in a map
User avatar
Xeotroid
Posts: 436
Joined: Sat Jun 23, 2012 7:44 am
Graphics Processor: nVidia with Vulkan support
Location: Czech Rep.

Re: Making voxels with Strip2Voxel & SLAB6

Post by Xeotroid »

Awesome! I started working on a little personal project of remaking Strife sprites. Goodbye map making, for now... :D
Spoiler:
User avatar
Dark-Assassin
Posts: 742
Joined: Thu Mar 19, 2009 3:40 am
Location: South Australia

Re: Making voxels with Strip2Voxel & SLAB6

Post by Dark-Assassin »

Thanks.

I'll end my little show for now with a simple texture.
Spoiler:
WALL03_1.png
WALL03_1.png (3.81 KiB) Viewed 6902 times
And then a fairly complex one.
Spoiler:
DOOR2_4.png

Spoiler:
Tribeam3rd
Posts: 16
Joined: Wed Oct 23, 2013 5:50 am

Re: Making voxels with Strip2Voxel & SLAB6

Post by Tribeam3rd »

I too have made a voxel:
Spoiler:
Edit: I wanted to see what Dark Slayer's texture would look like in-game
Spoiler:
Edit2: Zdoom renders them with bounding cubes instead of normal cubes, so in slab6 you can view > render method > bounding cubes to get a better in-game look
Last edited by Tribeam3rd on Tue Apr 08, 2014 8:33 pm, edited 4 times in total.
PSTrooper
Posts: 191
Joined: Wed Oct 16, 2013 1:40 pm

Re: Making voxels with Strip2Voxel & SLAB6

Post by PSTrooper »

Hitler's portrait.
Hitler.PNG
User avatar
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

Re: Making voxels with Strip2Voxel & SLAB6

Post by amv2k9 »

TheMightyHeracross wrote:You said to make a "voxel folder ," assuming they use .pk3. However, in case they prefer .wad like me, you should also mention the VX_START and VX_END markers.
Added.
User avatar
phi108
Posts: 976
Joined: Sat Dec 01, 2007 6:28 pm

Re: Making voxels with Strip2Voxel & SLAB6

Post by phi108 »

Here's 5 old Wolfenstein voxels from 2011 in a doomworld thread if anyone wants them, some of the colors may need adjusting:

http://speedy.sh/NzxEr/WolfVoxs.zip
Image

and I also did a couple textures back then, a Startan, the one with pipes, and some rocky walls

Image
PSTrooper
Posts: 191
Joined: Wed Oct 16, 2013 1:40 pm

Re: Making voxels with Strip2Voxel & SLAB6

Post by PSTrooper »

phi108 wrote:Here's 5 old Wolfenstein voxels from 2011 in a doomworld thread if anyone wants them, some of the colors may need adjusting:
These might come in handy later, here are 5 I made for Wolfenstein.
PSTWVoxs.wad
(Syringe is unused in game)
Screenshot_Doom_20140410_173621.jpg
Post Reply

Return to “Tutorials”