Textures & Materials

This was originally posted on http://synthesisgraphics.com/tutorials/bf2staticmeshes.htm and mirrored here. Bf2 tutorials go down all the time.

BF2 uses a directX shader that lets us blend several textures together to create many different combinations with a relatively small texture load. The idea being the smaller the texture load, the less information will have to be called by videocards. This is a big step from BFV and BF42, its also quite a bit more challenging to work with. I will explain the different ‘layers’ of textures then how I am applying them to staticobjects. The majority of this information was in ‘modder info pack #3′.

Color Layer
UV Channel 1
Full Color
MyTexture_c.dds
DXT1 (no alpha)

This layer is just to provide basic color to your model. It can be stretched to just about any extremes.

Detail Layer
UV Channel 2
B&W or Color
MyTexture_de.dds
DXT5 (alpha controls specular, light colors = shiny, dark = matte)

This layer is probably the most important layer used on a static. It is the detail layer, its function is to add details to the Color Layer. Think of it like the multiply function in photoshop.

This texture is a ‘per pixel’ texture, you need to be extremely careful in your modeling so that this layer can be used properly. To get the best optimization for this texture, your texture should be 1 pixel per cm in your model. So, if you have a 5 meter tall building, your texture should be 500 pixels tall to match the building.

Detail Normal
UV Channel 2
MyTexture_deb.dds
DXT1 no transparency
DXT 5 with transparency

This is essentially a copy of the _de layer with the nvidia normalmap filter applied to it. It controls the ‘bump’ of your detail texture.

Dirt Layer
UV Channel 3
MyTexture_di.dds
DXT1 (no alpha)

This layer is another additive layer, it adds to the color and detail layers and is used normally for dirt or grime to help breakup the detail tiling. It isn’t a ‘per pixel’ layer so it just needs to be applied at a resolution that looks good.

Crack/Decal Layer
UV Channel 4
MyTexture_cr.dds
DXT5 (alpha controls the stencil, white = not applied, black = 100% applied)

Use this layer for signs, rugs, anything you want applied over the top of the other layers (not additive like the detail and dirt layers).

The alpha channel of this layer is the stencil. Black is transparent, white is opaque. This means that wherever the alpha channel in this layer is black, the color from the other layers shows through.

Crack/Decal Normal
UV Channel 4
MyTexture_?.dds
DXT1 (no alpha)

This is essentially a copy of the _cr layer with the nvidia normalmap filter applied to it. It controls the ‘bump’ of your crack/decal texture.

STEPS and WALKWAYS:

Slope with a Non-Stair Materials like dirt: (“Grass”, “Dirt”, “Concrete”, “Wood”, “Sand”, etc.) [Results may vary slightly for each material]
Can climb “comfortably” upto 40º
Can just climb with a slight struggle somewhere between 40º and 45º
Can not climb 45º

Stairs with Normal Stair Materials: (“Stairs_concrete”, “Stairs_metal”, “Stairs_wood”)
Can climb “comfortably” upto 50º
Can just climb with a slight struggle upto 55º
Can not climb 60º

Stairs with Special “Stair Steep” Materials: (“Stair_Steep_Metal” {Custom Material})
Can climb “comfortably” upto 60º
Can just climb with a slight struggle somewhere between 60º and 65º
Can not climb 65º

Note: You shouldn’t use a gradient on your stairs that a player will struggle to climb up unless 100% necessary.