$ssbump

From Valve Developer Community
Revision as of 15:44, 12 February 2009 by TheBestFlash (talk | contribs)
Jump to navigation Jump to search

$ssbump is a boolean material parameter that flags a $bumpmap as being self-shadowing. It is only supported with LightmappedGeneric and requires the Orange Box.

You can read more about the technology behind it in this paper.

Tip.pngTip:Self-shadowed normal mapping is actually faster than the standard method!

Example

rockwall_cave_02a_height-ssbump.vtf
LightmappedGeneric
{
	$basetexture	nature/rockwall_cave02a
	$surfaceprop	concrete
	$bumpmap	nature/rockwall_cave_02a_height-ssbump
	$ssbump		1
}

Limitations

The shadows cast by the bump map are baked into the texture, meaning that they can only appear in one of three predefined locations. If a light is arriving on the surface between these angles the nearest available shadows will be blended between, producing an acceptable but hardly ideal image.

It's therefore best to consider the direction from which your material will be predominantly lit from when creating it, bearing in mind that at least one of its edges will have to do without proper shadowing!

Creating self-shadowing bump maps

It's currently only possible to create ssbumps manually, or use non-VALVe programs. (Such as the SSbump Generator 2.0) This is due to the fact that height2ssbump has yet to be released. Nevertheless, here are the command-line parameters it will support:

<path/filename>
The source heightmap (TGA format).
-r <int>
Set the number of 'rays' (default 250). More rays take more time.
-f <int>
Set smoothing filter radius (default 10; 0 disables).
-n
Generate a conventional normal map.
-A
Generate ambient occlusion in the alpha channel.
-D
Write out filtered result as filtered.tga.