register combiner problem

I need to “add” 4 textures (on a GeForce 3), choosing the maximum of them. Textures are RGBA,
Adding the 4 textures is simple, using register combiners or the old glTexEnv, but choosing the maximum among the 4 textures, for each pixel is not simple. I’ve read the documents for texture combiners, and couldn’t find an appropriate function.
Any help would be most appreciated.

The only conditional operation you have is “mux”, and the condition is always “if (spare0.a <= 0.5)”.

You can only access B and A individually, not R and G, so you have no way to put R and G in spare0.a, and hence no way to perform a mux on them. Assuming you want to do this for R, G, B and possibly A separately, I think there’s no way it can be done.

It should be possible if you only cared about luminance and not about RGB, though. For two textures T1 and T2, you could try to put 0.5 + T1 - T2 in spare0.a, then use mux to select either T1 or T2.

– Tom