$ssbump

$ssbump is a material shader parameter available in all Source games since Source 2007.

Standard bump maps only darken texels that are facing away from a light source. Self-shadowing bump maps darken both texels facing away and also any texels which are 'behind' them. You can read more about the technology behind it in this paper.

**Tip:**Self-shadowed normal mapping actually renders faster than standard normal maps!

Example

LightmappedGeneric
{
	$basetexture	nature/rockwall_cave02a
	$surfaceprop	concrete
	$bumpmap	nature/rockwall_cave_02a_height-ssbump

	$ssbump		1
	$SSBumpMathFix	1 // seen in L4D2, modifies the amount of light received. Can be any number (0 removes the effect)
}

Limitations

The shadows cast by the bump map are permanently baked into the texture, meaning that they can only appear in one of three predefined locations. height2ssbump generates shadows for light arriving from the right, top-left, and bottom-left of the texture. If light arrives from between those directions (such as from the left), the nearest available baked shadows are blended between, producing an acceptable but hardly ideal image.

Additionally, in order to preserve the illusion of height, low areas of a SSBumped material will receive less light even if it arrives head-on. This can look odd if you have too intense (rugged) a SSBump.

Creation

You need to use height2ssbump, a command line SDK tool. The command is:

height2ssbump <options> <path\to\heightmap.tga> <float|bumpscale>

**Tip:**Self-shadowed normal mapping actually renders faster than standard normal maps!

Options

<path/filename>

The source heightmap (TGA format).

-r <int>

Set the number of 'rays' (default 250). More rays take more time.

-n

Generate a conventional bump map as <input name>-bump.tga.

-d

(New with Left 4 Dead)Generate an ssbump detail texture. To do: What is this for?

-A

Generate ambient occlusion in the alpha channel.

-f <int>

Set smoothing filter radius (default 10; 0 disables).

-D

Write out filtered result as filtered.tga.

Last updated