Post tutorial RSS Making Specular Textures Work (With and without normal map)

In this tutorial i will explain how to get specularity textures to work in the Source Engine (Compile & VMTs). This is a technical tutorial NOT an artistic one.

Posted by on - Basic Textures

------------------------------------------------------------------------------

SPECULAR TEXTURES WITH NORMAL MAP

BY JENKINS (xer2k8@gmail.com - steam username: jenkins_08)

------------------------------------------------------------------------------

NOTE: This procedure is written if you HAVE a normal map for your texture! For textures without a normal map, read the procedure after this one.

NOTE2: If your base texture has an alpha channel I.E it is transparent such as a fence or something, you will need to follow a slightly different procedure (Only the VMT changes)

1. Create your 3 textures, a diffuse/colour map, normal and specular maps and save them as individual TGA files.

TIP: In the specular texture, White=Shiny, Black=don't shine, grey=halfway between

2. Load your normal and specular into Photoshop or GIMP
(This won't work in Paint.NET because it doesn't support editing colour/alpha channels at the time of writing this.)

3. In your image editing program, copy the Specular texture to the ALPHA CHANNEL OF THE NORMAL MAP. This is the most crucial step and took me a while to figure out.

4. Save your normal map (32bit TGA WITHOUT Compression)

5. Compile your textures with VTEX or VTFEdit (I prefer VTEX because i feel more comfortable with command line plus VTEX auto detects normal maps and adjusts the settings automatically)

6. In your base texture VMT use the following as a template (just change the paths to whatever your using)

LightmappedGeneric 
{ 
    //Base Texture
    "$basetexture"     "Metal/texture_01" 
    "$bumpmap"        "Metal/texture_01_normal"
	
    //"$translucent"    1                        
    //"$alpha"        1
    //UNCOMMENT THE ABOVE LINES 
    //IF YOU HAVE A TRANSPARENT TEXTURE (see NOTE2 above)
	
    "$surfaceprop"     metal 
    
    //Specular stuff    
    "$normalmapalphaenvmapmask" 1
    "$envmaptint" "[ 0.25 0.25 0.25 ]"
    "$envmap" "env_cubemap"
    "$envmapcontrast" 0 //1
    "$envmapsaturation" .1
}

Done!

------------------------------------------------------------------------------

SPECULAR TEXTURES WITHOUT NORMAL MAP
------------------------------------------------------------------------------

NOTE: This procedure is similar to above, just without the normal map.
NOTE2: If your base texture has an alpha channel I.E it is transparent such as a fence or something, you will need to follow a slightly different procedure (Only the VMT changes)

1. Create your 2 textures, a diffuse/colour map and specular maps and save them as individual TGA files.

TIP: In the specular texture, White=Shiny, Black=don't shine, grey=halfway between

2. Load your base texture and specular into Photoshop or GIMP
(This won't work in Paint.NET because it doesn't support editing colour/alpha channels at the time of writing this.)

3. In your image editing program, copy the Specular texture to the ALPHA CHANNEL OF THE BASE TEXTURE. This is the most crucial step.

4. Save your base texture (32bit TGA WITHOUT Compression)

5. Compile your textures with VTEX or VTFEdit (I prefer VTEX)

6. In your base texture VMT use the following as a template (just change the paths to whatever your using)

LightmappedGeneric 
{ 
    //Base Texture
    "$basetexture"     "Metal/texture_01"
	
    //"$translucent"    1                        
    //"$alpha"        1
    //UNCOMMENT THE ABOVE LINES 
    //IF YOU HAVE A TRANSPARENT TEXTURE (see NOTE2 above)
	
    "$surfaceprop"     metal 
    
    //Specular stuff
    "$basealphaenvmapmask" 1
    "$envmaptint" "[ 0.25 0.25 0.25 ]"
    "$envmap" "env_cubemap"
    "$envmapcontrast" 0 //1
    "$envmapsaturation" .1
} 

Done!

Credits:
Not many because VDC was useless concerning this topic.
I basically just looked at how Valve did theirs and figured it out for myself. :)

Enjoy!

-Jenkins

Comments
lemons
lemons

Thank you sir. :)

Reply Good karma Bad karma+1 vote
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.

Tutorial
Related Mods
Related Games
Half-Life 2
Half-Life 2 First Person Shooter
Related Groups
PROJECT:NOVA Dev Team
PROJECT:NOVA Dev Team Developer & Publisher