Home Dota 2

[tutorial] Importing cubemap and bg content from Dota 2 into Toolbag 2

Hey guys, I’ve written a quick mini-tutorial for pulling cubemap and portrait background content out of the Dota 2 vpk and into Marmoset Toolbag 2.

First off, a big thanks to Drew Watts who helped me out with some of the info here.

What you will need:
1. GCFScape
2. VTFedit
3. Marmoset Toolbag 2
4. Adobe Photoshop or similar

Cubemaps


Start by opening the pak01_dir.vpk file in GCFScape and browsing to models/cubemaps, then extract the .vtf file for the cubemap you want to use. Now open that file in VTFedit, and go to file->export all. Make sure you do export all and not simply export, as that will only save one image, while we need all 6 cubemap faces.

You should now have 6 tga files named *_00_0X_00.tga, where 0X = face number, the face number is important as we will need it to reconstruct a vertical-cross format cubemap.

A vertical-cross cubemap looks like this:
vertical_cross.png

To recreate that layout, we need to drag each file into photoshop, at the correct position, which is:
00_00_00 = Front( Positive Z )
00_01_00 = Back( Negative Z )
00_02_00 = Right( Positive X )
00_03_00 = Left( Negative X )
00_04_00 = Top( Positive Y )
00_05_00 = Down( Negative Y )

Load up the vertical cross template into PS, and resize it so that the width is 3x the size of each individual cubemap face texture (eg, 512 x 3 = 1536 pixels wide). When you’ve got it sized properly, drag the individual textures in and match them up according to the chart above. You should have something that looks like this now:

dotacube01.jpg

After you have each texture in the correct position, you’ll need to rotate them so they all line up, like so:

dotoacube02.jpg

Thats it, now you’ve got a cubemap ready to load into Toolbag 2. From here, simply click the Image button in the Sky object properties, and find your file. Toolbag will automatically recognize the cubemap format and load it up.

dotacubes01.jpg

Portrait Backgrounds

Open up the pak01_dir.vpk file once again in GFCScape, but browse to materials/portrait_card/portrait_backgrounds, and export the VTF file for your character. Then, open the VTF file up in VTFedit and export as a TGA.

We currently do not support loading a custom background image directly into Toolbag, but its easy to add by exporting a screenshot with transparency and placing the image in Photoshop.

To do that, go to Capture-> Settings (ctrl+P) from Toolbag, change your file format to PSD and make sure Transparency is checked.

tb2transexp.jpg

Now, set up your model, lighting, etc, and export an image. When you load the image in PS you will find a layer mask automatically applied for your model. Now simply drop in the portrait background image that you previously exported behind your render and you’re done.

dotabg01.jpg

Replies

Sign In or Register to comment.