Difference between revisions of "$ssbump"

From Valve Developer Community
Jump to: navigation, search
(Added a new SSbump generator)
Line 59: Line 59:
Third-party tools capable of generating SSbump maps:
Third-party tools capable of generating SSbump maps:
*[http://www.filterforge.com/filters/9557.html Filter Forge 2.0]
*[http://www.filterforge.com/filters/9643.html Filter Forge 2.0]
*[http://www.ssbump-generator.yolasite.com SSbump/Normal Generator 5.3 (With GUI & CUDA Acceleration)]
*[http://www.ssbump-generator.yolasite.com SSbump/Normal Generator 5.3 (With GUI & CUDA Acceleration)]
*[http://www.xnormal.net/1.aspx Xnormal]
*[http://www.xnormal.net/1.aspx Xnormal]
[[Category:List of Shader Parameters|S]]
[[Category:List of Shader Parameters|S]]

Revision as of 14:24, 16 May 2011

Comparing SSBump with standard bump mapping and no mapping at all.

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

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.png Tip: Self-shadowed normal mapping is actually faster than the standard method!


A simpler example: each surface is flat.
	$basetexture	nature/rockwall_cave02a
	$surfaceprop	concrete
	$bumpmap	nature/rockwall_cave_02a_height-ssbump

	$ssbump		1
	$SSBumpMathFix	1 // seen in L4D2, effect unclear


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 top, bottom and right of the texture. If light arrives diagonally or 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.


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

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

The output is <input name>-ssbump.tga, in the same folder as the input file. Bumpscale controls the intensity of the ssbump (i.e. coarseness of the surface); 60 is a good starting value.

Note.png Note: Bizarrely, the tool examines only the alpha channel of the input TGA. The original alpha channel will be passed on to the output TGA, but serves no purpose and should be deleted.


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).
Generate a conventional bump map as <input name>-bump.tga.
Generate ambient occlusion in the alpha channel.
Write out filtered result as filtered.tga.

Third Party Tools

Third-party tools capable of generating SSbump maps: