$ssbump: Difference between revisions
TomEdwards (talk | contribs) mNo edit summary |
TomEdwards (talk | contribs) |
||
Line 25: | Line 25: | ||
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! | 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! | ||
== | == Creation == | ||
{{bug|Only the version of height2ssbump in the current [[SDK Beta]] works.}} | {{bug|Only the version of height2ssbump in the current [[SDK Beta]] works.}} | ||
Line 31: | Line 31: | ||
You need to use '''<code>height2ssbump</code>''', a [[command line]] SDK tool. The command is: | You need to use '''<code>height2ssbump</code>''', a [[command line]] SDK tool. The command is: | ||
height2ssbump <options> <path\ | height2ssbump <options> <path\to\[[heightmap]].tga> <[[float]]|bumpscale> | ||
The output is <code><input>-ssbump.tga</code>, in the same folder as the input file. <code>Bumpscale</code> controls the intensity of the ssbump (i.e. coarseness of the surface); 60 is a good starting value. | The output is <code><input name>-ssbump.tga</code>, in the same folder as the input file. <code>Bumpscale</code> controls the intensity of the ssbump (i.e. coarseness of the surface); 60 is a good starting value. | ||
{{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.}} | {{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.}} | ||
Line 46: | Line 46: | ||
:Set smoothing filter radius (default 10; 0 disables). | :Set smoothing filter radius (default 10; 0 disables). | ||
;-n | ;-n | ||
:Generate a conventional | :Generate a conventional bump map as <code><input name>-bump.tga</code>. | ||
;-A | ;-A | ||
:Generate ambient occlusion in the alpha channel. | :Generate ambient occlusion in the alpha channel. |
Revision as of 06:24, 17 March 2009
$ssbump is a boolean material parameter that flags a $bumpmap texture as being self-shadowing. It is only supported with LightmappedGeneric
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.

Example
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!
Creation
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.

Options
- <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 bump map as
<input name>-bump.tga
. - -A
- Generate ambient occlusion in the alpha channel.
- -D
- Write out filtered result as
filtered.tga
.
Creating ssbumps manually
Here are the different ways of manually creating ssbumps without the real tools.
- SSbump Generator 2.0 - Third Party tool