Quake3 Multipass Rendering

Ok here is what I’d like to do. It seems like everyone is making a q3 viewer these days so I’m not trying to make one that will work on everyone’s computer or anything. What I want is one that works really fast on one specific video card. I chose nvidia cause they’ve got fast cards and the Xbox will be using them so maybe if I learn enough about these cards I’ll have a shot at making games for the Xbox.

Anyways the next generation Nvidia card is going to have either 4 or 8 texture units (or so I’ve read). I figure with this many I could render the majority of shaders in quake3 in a single pass.

The problem I’ve run into is that the blendfunc() in the shaders is based on the assumption that everything will be rendered in a seperate pass. I can see how to implement this using one texture and lots of passes fairly easily, but using lots of texture units and a single pass makes it a more iteresting problem.

I am under the understanding that the actual q3 engine does make use of up to 2 texture units. If anyone has ideas on efficent ways of doing this I’m open to suggestions.

One way I know I could do it is to use the register combiners. Infact this would be a fairly simple approach the problem. I would only need one of the general registers to do everything I need, but everytime the blending functions would change I’d have to change the register combiner setup. This would be more state changes than I think it would be worth.
I suppose I could try both the multipass and register combiner method and see which is faster, but the number of regester combiner setups I’d have to make sorta scares me.

If you have any comments or ideas please state them.

Oh, one other thing. When using lightmaps my scene gets too dark (as expected). How can I increase the brightness of the entire scene efficently?

I’ve looked into this myself and from what I can see, Quake3 does not use the register combiner extensions. It does use the GL_EXT_TEX_ENV_COMBINE extension on my TNT for a few shaders. But for most complex shaders it resorts to a non multitextured multipass approach. The NVIDIA register combiners extension could very well be used to render some of them in one pass, but even then most complex shaders will still require the non multitextured multipass approach as different passes within a single shader may use different cull modes, alpha tests, depth tests, alpha functions, depth functions, fragment color, and so on.