Making voxels with Strip2Voxel & SLAB6

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

Moderator: GZDoom 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.

Making voxels with Strip2Voxel & SLAB6

Postby amv2k9 » Wed Apr 02, 2014 4:27 pm

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 allExpand view
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 3:09 pm, edited 9 times in total.
User avatar
amv2k9
That Strife Guy
 
Joined: 10 Jan 2010
Location: Southern California

Re: Making voxels with Strip2Voxel & SLAB6

Postby Mikk- » Wed Apr 02, 2014 8:17 pm

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
Mikk-
yooooooooooo
 
Joined: 30 Jun 2009
Location: Somewhere off Kanagawa
Discord: Mikk0451#3922

Re: Making voxels with Strip2Voxel & SLAB6

Postby Enjay » Thu Apr 03, 2014 6:09 am

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
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Making voxels with Strip2Voxel & SLAB6

Postby amv2k9 » Mon Apr 07, 2014 7:11 pm

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
amv2k9
That Strife Guy
 
Joined: 10 Jan 2010
Location: Southern California

Re: Making voxels with Strip2Voxel & SLAB6

Postby TheMightyHeracross » Tue Apr 08, 2014 6:25 am

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
TheMightyHeracross
...and remember: his silence is golden.
 
Joined: 18 Aug 2013
Location: Philadelphia, PA
Discord: TheMightyHeracross#1716

Re: Making voxels with Strip2Voxel & SLAB6

Postby zrrion the insect » Tue Apr 08, 2014 9:13 am

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
zrrion the insect
Like a fish in a child's hands.
 
Joined: 25 Jun 2009
Location: Time Station 1: Moon of Glendale

Re: Making voxels with Strip2Voxel & SLAB6

Postby Dark-Assassin » Tue Apr 08, 2014 12:57 pm

This is really useful.

Have a Light Wall... With Depth!
Spoiler:

W13_A.png
W13_A.png (3.44 KiB) Viewed 4592 times


Here's another wall...
Spoiler:

WALL57_2.png


And a door...
Spoiler:

DOOR2_1.png
DOOR2_1.png (6.21 KiB) Viewed 4594 times
User avatar
Dark-Assassin
 
Joined: 19 Mar 2009
Location: South Australia

Re: Making voxels with Strip2Voxel & SLAB6

Postby Mikk- » Tue Apr 08, 2014 4:13 pm

Those voxel textures look great, would be awesome to see them used in a map
User avatar
Mikk-
yooooooooooo
 
Joined: 30 Jun 2009
Location: Somewhere off Kanagawa
Discord: Mikk0451#3922

Re: Making voxels with Strip2Voxel & SLAB6

Postby Xeotroid » Tue Apr 08, 2014 4:26 pm

Awesome! I started working on a little personal project of remaking Strife sprites. Goodbye map making, for now... :D

Spoiler:
User avatar
Xeotroid
 
Joined: 23 Jun 2012
Location: Czech Rep.

Re: Making voxels with Strip2Voxel & SLAB6

Postby Dark-Assassin » Tue Apr 08, 2014 6:18 pm

Thanks.

I'll end my little show for now with a simple texture.
Spoiler:

WALL03_1.png
WALL03_1.png (3.81 KiB) Viewed 4581 times


And then a fairly complex one.
Spoiler:

DOOR2_4.png




Spoiler:
User avatar
Dark-Assassin
 
Joined: 19 Mar 2009
Location: South Australia

Re: Making voxels with Strip2Voxel & SLAB6

Postby Tribeam3rd » Tue Apr 08, 2014 7:45 pm

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 9:33 pm, edited 4 times in total.
Tribeam3rd
 
Joined: 23 Oct 2013

Re: Making voxels with Strip2Voxel & SLAB6

Postby PSTrooper » Tue Apr 08, 2014 8:29 pm

Hitler's portrait.
Hitler.PNG
User avatar
PSTrooper
 
Joined: 16 Oct 2013
Location: Alabama

Re: Making voxels with Strip2Voxel & SLAB6

Postby amv2k9 » Wed Apr 09, 2014 3:09 pm

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
amv2k9
That Strife Guy
 
Joined: 10 Jan 2010
Location: Southern California

Re: Making voxels with Strip2Voxel & SLAB6

Postby phi108 » Wed Apr 09, 2014 5:56 pm

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
User avatar
phi108
Magical Error?
 
Joined: 01 Dec 2007

Re: Making voxels with Strip2Voxel & SLAB6

Postby PSTrooper » Thu Apr 10, 2014 5:51 pm

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
User avatar
PSTrooper
 
Joined: 16 Oct 2013
Location: Alabama

Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest