How to set the alpha of multitexture?

PS: the easy way would be to just fire up Quake, it displays all the extensions it found in the console and in setup->system->driver info. If you want to post your list of texture env extensions here, be my guest.

Originally posted by zeckensack:
I know that the hardware can do that, and it would puzzle me if it wasn’t exposed somehow.

Unfortunately, 3dfx wasn’t exactly famous for the quality of their OpenGL drivers

PS: the easy way would be to just fire up Quake, it displays all the extensions it found in the console and in setup->system->driver info. If you want to post your list of texture env extensions here, be my guest.

Why bother? http://www.delphi3d.net/hardware

They had EXT_texture_env_add from the Voodoo3 upwards. Looks like EXT_texture_env_combine was only supported on the Voodoo4/5.

– Tom

I have this Nehe tutorial which shows my cards extensions:

GL_ARB_multitexture
GL_EXT_abgr
GL_EXT_bgra
GL_EXT_clip_volume_hint
GL_EXT_compiled_vertex_array
GL_EXT_packed_pixels
GL_EXT_point_parameters
GL_EXT_stencil_warp
GL_EXT_texture_env_add
GL_EXT_vertex_array
GL_SGIS_texture_edge_clamp
GL_EXT_paletted_texture
GL_EXT_shared_texture_palette
GL_SGIS_multitexture
WGL_EXT_extensions_string
WGL_3DFX_gamma_control
WGL_EXT_swap_control
WGL_ARB_extensions_string

(I hand typed those)

try texture-env-add, its not as good as signed add but you get nice overbrighting anyways…

I have tried GL_REPLACE and GL_ADD (base - lightmap) and the result is exactly the overbrighting I want, the big bad thing is that the important shadows are gone, becouse by adding I can’t get black colors from lightmaps.

I have been searcing some info how others render lightmaps, and figured out that many uses multipass rendering. They say it’s more flexible and doesn’t drop fps that much if you use a powerful visibility determination.

The exact equation is for you to decide. As a starting point, I suggest doing something like this:

Render lightbase map in first pass.
Set blend equation to (GL_SRC_ALPHA,GL_ONE) <- requires alpha in lightmaps, maybe not optimal
Render light
light map in second pass.

This will add the cube of the light map to the general base*light pass. This way, when the lightmap is very bright, it’ll add almost one to the framebuffer, for extreme overbrighting. If the lightmap is relatively dark, it won’t change much.

If I use multipass and multitexture in the first, fps will go down (at least at this point).
I’v also had some color problems with alpha blended lightmaps: too much green and pink or something, even when the light color is white. That may be just a voodoo color thing, becouse I think it don’t support big color depths (maybe just 16).

You can simplify the second pass (and throw out alpha again) if you set your blend equation to (GL_ONE,GL_ONE). This will only add whatever you compute in the second pass (would be the square of the light intensity in my example).

The whole idea of taking the cube was to not overly influence the base pass where light intensity is low. You’ll have to experiment a bit with that and you can also try to change your lightmap computations a bit.

However, multipassing will always cost you some performance. You have to resend geometry and it eats fill. Activated blending eats additional bandwith. You can minimize the fill overhead by using the GL_EQUAL depth function for your second pass. And you should simply skip the second pass altogether for objects where you don’t need or want overbrighting at all.