Tuesday, March 13, 2007

Compiling Textures

OK, here is how it's done "the hard way"...

Plonk your tga file in this folder :
SteamApps\username\sourcesdk_content\hl2\materialsrc\qsh

You will have to create the qsh folder.

Then drag the tga onto vtex.exe, which you can find in this folder :
SteamApps\username\sourcesdk\bin

A command window should pop up, and a vtf file should then magically appear in here :
SteamApps\username\half-life 2\hl2\materials\qsh

A vmt file will need to be created, which can be done in Notepad.
Open a new file and paste in the following :

"lightmappedgeneric"
{
"$baseTexture" "/qsh/qsh_testtexture"
}

Not this bit, though... don't paste this line.

Change the "qsh_testtexture" part to whatever the vtf is named.

The "lightmappedgeneric" part tells the engine the texture is for use in the map... if you want to use the texture for a model, replace it with "VertexLitGeneric".

ie/

"VertexLitGeneric"
{
"$baseTexture" "/qsh_testtexture"
"$bumpmap" "/qsh_testtexture_normal"
}


The $bumpmap line tells the engine where the normal map for the texture is... compile that the same way as the diffuse texture, but do not create it its own vmt file... just add that line in the main texture's vmt.

Save the Notepad file as (in this example) qsh_testtexture.vmt and put it in the same directory as the vtf. Ensure you're saving the file as qsh_testtexture.vmt and not qsh_testtexture.vmt.txt.

There are other settings to play with, but let's walk before we run, and see if what I've written here is actually understandable. If not, I'll clarify... if so, we can move on to doing models.

Joy.

2 Comments:

Blogger John A. said...

By the way, I lied... I'll be in closer to 1.15.

Sorry to whoever happens to be there tomorrow morning... DAYS LOST. :o(

11:13 PM  
Blogger Daljit said...

DUM DUM... i think im gunna be late a bit.(45mins-1hr) i don't wanna go with 10mb of free space on my pen drive. a 2gb shud be coming in a hour. ''I SAID A 2GB PEN DRIVE SHOULD BE COMING IN AN HOUR!!!!''

8:12 AM  

Post a Comment

<< Home