Ok, I spent a lot of time writing the code to sort alpha polys and a lot of time working on the pipeline, but at no point did it occur to me that rendering the alphas would be a problem (it the obvious things that get past you ). I’ve spent a few weeks trying to figure some way out of this problem and have come up with nothing. I’m sure everyone is familiar with the problem:
I have 2 texture layers, light map and texture. I need to modulate them in separate passes how do I do this without messing up the way the textures should look. I’m using two textures as an example when in fact I have 7 – 10 layers, so multi-texture is not an option (also trying to maintain 1.1 support). Here is the problem mathematically:
Layer 1 (light map) blended with: (s * a) + (d * (1 - a))
Layer 2 (texture) if I use the same blend I will get a ‘looking through the texture at the light map’ look.
If I use: (s * d) + (d * (1 - a)) this works, but the image is a little bright (no (s * a)), so I used the multi-texture (violating the 1.1 support) to multiply the alpha by the texture giving me: (s * a * d) + (d * (1 - a)). Very nice…. but still wrong. The texture is getting modulated with the background and blended with the light map. This blending with the light map part is the worst, it is adding a nice white border to objects that use the alpha to ‘cut away’ parts…
Oh my….
Any opinions would be greatly appreciated…
Thanks…
John.