<%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%> CITY 7: TORONTO CONFLICT V2
Materials
City 7 workflow

SOURCE MATERIALS
how to create materials

   


To import or save Source textures you must use the Photoshop plug-in
created by Nems Tools found here

The default texture scale in hammer is .25
Therefore a 128 orange map texture equals 512 pixels in Photoshop.

Always make sure your texture size is to power of 2
Eg: 16, 32, 64, 128, 256, 512 and1024 Set the DPI to 72 (screen\web standard).

Save the image as a lossy (compressed) or loss less (uncompressed)
- DXT1 high compression
- DXT5 low compression
- BGRA8888 uncompressed

Select the materials surface properties from the hl2\scripts\surfaceproperties.txt

      Sean
   

CREATE A BASIC MATERIAL
create a repetitive brick wall texture

   

*Video and files to come*

Work file

      Sean
   

CREATE A DECAL
import the City 7 logo

   

Learn how use masks for transparency effects

In order to create a 64 by 64 texture we must remember that the texture is scaled by .25, therefore in Photoshop we must create a 256 by 256 texture. We follow this up with a "$decalscale" .25 in the vmt file

The default texture scale is .25 therefore a 128 orange map texture equals 512 pixels in Photoshop. In Photoshop DPI (dots per inch) does not matter because resolution is based on the players distance, however keep it at 72 (screen standard).

Commands used for decals:
- "$decal" 1
- "$translucent" 1
- "$decalscale" .25

*Video and files to come*

Work file

      Sean
   

CREATE A NORMAL MAP
create a normal map for brick materials

   

To create normal maps you must use the Photoshop plug-in created by NVIDIA found here

There are two methods to create normal maps:

- One method is to create a texture from a white to black to express depth like a bump map and then convert it to normal map using a NVIDA effect
- The other method is projection mapping which is method of transferring high ploy detail to a low ploy model by baking a normal map texture

You can also insert a normal map over a projection normal map by using a method written by Ben Mathis found here. You can’t just place a normal map on top of another because it does not take into consideration the values of the normal map bellow. Another import note is that the RGB value of each pixel adds up to certain value so don't overlay a normal map or colour on one.

*Video and files to come*

Work file

      Sean
   

CREATE A STORE FRONT MATERIAL
textures, normal maps and mask are use to create convincing materials in run-time

   

Learn how use masks for reflective effects

If you have a normal map you must put the reflective mask on its alpha channel

*Video and files to come*

Work file

      Sean
   

MAIN SOURCE SHADERS KEYS ANDS VALUES
LightmappedGeneric, VertexLitGeneric, UnlitGeneric

   

Valve Materail type (open with text pad)
super_vmt.vmt - commands below in one vmt file

Use simple templates:
simple_bsp_vmt.vmt - for bsps ("LightmappedGeneric")
simple_model_vmt.vmt - for models (”VertexLitGeneric")

-----------------------------------------
SHADER
-----------------------------------------
This article is written for the follow shaders, you MUST select only ONE

"LightmappedGeneric"
// use this ONLY for BSP brush surfaces
// this shader references the BSP brush lightmap points for light valves and builds gradient shades between each point as a lighting solution

”VertexLitGeneric"
// use this ONLY for models imported as props into source
// this shader calculates each vertice’s light valve and builds gradients shade between each point as a lighting solution

"UnlitGeneric"
// this material does not render lighting properties
// its surface will not be shaded or effect nearby materials

-----------------------------------------
MAIN PROPERTIES
-----------------------------------------

"$basetexture" " folder\texture "
// defines the base texture path from the \Materials folder eg “folder\texture"

"$surfaceprop" "concrete"
// defines the physics, sound effects and audio distortion of the material, see Scipts\surfaceproperties.txt

"%keywords" "texture_search"
// use to search and find keywords in the material browser

-----------------------------------------
NORMAL MAP PROPERTIES
-----------------------------------------
Normal maps tells the engine how to display the light hitting the polygons
3 color channels - Red – left to right, Green – up to down and Blue – depth

"$bumpmap" "folder\texture_normal"
defines the normal map texture path from the \Materials folder eg “folder\texture"

"$bumpscale" "1.0"
// use to scale the normal map texture

-----------------------------------------
REFLECTIVE PROPERTIES
-----------------------------------------
Materials like glass, metal, plastics, liquids and glossy surfaces like tiles or varnished wood

"$envmap" "env_cubemap"
// uses cubemaps for reflective textures, you can create you own, see below

"$envmaptint" "[.7 .7 .7]"
// RGB changes the hue of the reflection (the gradation of color within the visible spectrum)
// eg. a red material would tint the cubemaps red

$envmapcontrast" 0.5
// set the reflections contrast (the difference in visual properties\shade that makes an texture)

"$envmapsaturation" 0.3
// set the reflections saturation (the purity/intensity of the specific hue)

If you want have a reflection mask, choose ONE of the follow target paths

"$envmapmask" "folder/texture"
// use this if you want to target a separate texture to define the opacity mask (don’t use the alpha channel)

"$basealphaenvmapmask" 1
// use this if you want to target the basetexture's alpha channel to define the opacity mask

"$normalmapalphaenvmapmask" 1
// use this if you want to target the normal map texture’s alpha channel to define the opacity mask
// if you have a normal map you must put the reflective mask on its alpha channel

-----------------------------------------
TRANSPARENT PROPERTIES
-----------------------------------------
Materials like glass, plastics or liquids as well as fences or surfaces with gaps across it

"$translucent"1
// use the alpha channel of the $basetexture as transparency
//if the base texture's alpha channel is being used, you must change it so you can use this effect

"$alphatest" 1
// use to make the mask to run a hit test, so you can shoot through it

"$alpha" 0.5
// set the overall base texture's opacity, don’t use $translucency

"$additive" 1
// use to render the base texture additively (like a Photoshop effect)

-----------------------------------------
ILLUMINATION PROPERTIES
-----------------------------------------
This is used make a section or all of the material seem bright. Eg, a light bulb/sign that is on or LED lights on a computer prop (these objects should not be shaded). This does not cast light, it just blocks the section from being shaded so it appears brighter or renders in a dark place

"$selfillum" 1
//use the base texture's alpha channel to define the illumination across the surface
//if the base texture's alpha channel is being used, you must change it so you can use this effect

-----------------------------------------
OTHER PROPERTIES
-----------------------------------------

"$color" "[100 100 100]"
// use to scale the red, green, and blue channels of the material

"$nocull" 1
// use to make the texture render on the front and back sides

"$decal" 1
// use for textures that need be rendered as a decal

"$nodecal" 1
// use to apply no decals on the texture, like a fence or transparent material

"$decalscale" .25
// use .25 scale so the texture resolution matches hammer’s texture scale

      Sean