

Anyway, you might be able to use register combiners on GF2+
Bump-mapping and detail-texturing are very similar.
The only difference is that bump-mapping is more complicated since it is dependant on the light source''s position (and on the viewpoint position for specular bump-mapping).
BTW, I''ve thought of another technique which may work on your TNT2 using both texture_env_combine and texture_env_combine4 extensions :
In first pass :
combine with INTERPOLATE : Arg0 * (Arg2) + Arg1 * (1-Arg2)
Arg0 = "detail" texture
Arg1 = texture environment color (ie GL_CONSTANT)
Arg2 = color->alpha
using the Texture Environment Color to (0.5, 0.5, 0.5, 0.5).
for Arg1 you may either use GL_SRC_COLOR or GL_SRC_ALPHA as OPERAND since both give a RGB value of (0.5, 0.5, 0.5)
In second pass :
combine4 with ADD_SIGNED : Arg0 * Arg1 + Arg2 * Arg3 - 0.5
Arg0 = color->rgb
Arg1 = "decal" texture
Arg2 = Previous texture
Arg3 = texture environment color
using Texture Environment Color to white.
or as Arg3 you can use GL_ZERO as SOURCE and GL_ONE_MINUS_SRC_COLOR/ALPHA as OPERAND. This way you don''t need to call glTexEnvf to set the texture environment color to white.
Hope that does the trick !
Explanations :
The first pass computes the bright/dark to apply, using detail texture modulated by color->alpha. The result of the first pass is between 0 and 1 :
* 0 means ''darken''
* 0,5 means ''no effect''
* 1 means ''brighten''
If color->alpha is 1, the detail texture rules the bright/dark.
If color->alpha is 0, the bright/dark rule is 0.5 (because of texture environment color) which means ''no bright no dark''
The second pass applies the recently computed bright/dark element (in range [0,1]) to the "decal" texture.
The decal texture is multiplied by the primary color in order to modulate the texture with current color of the polygon (especially due to lighting).
The bright/dark element is multiplied by 1 because we don''t need to change it.
And after the addition, we subtract 0.5 so that :
* when the bright/dark element is 0, that subtracts 0.5 to the color, (darken)
* when the bright/dark element is 0.5, that adds 0 to the color,
* when the bright/dark element is 1, that adds 0.5 to the color (brighten).
USEFUL :
If your primary color is white (eg there''s no lighting and you called glColor3f(1,1,1)) then you can replace the second pass by a simple ADD_SIGNED (without combine4, so the equation is Arg0 + Arg1 - 0.5) :
Arg0 = "decal" texture
Arg1 = previous texture