PDA

View Full Version : multipass rendering aphas...



ToolChest
07-23-2002, 09:07 AM
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 http://www.opengl.org/discussion_boards/ubb/smile.gif). 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.

BlackJack
07-23-2002, 11:40 AM
Hm....... I don't get what you mean.... you want to do lightmapping without multitexturing? So using two passes instead of one? Or you want lightmapped transparent polygons?

BlackJack

ToolChest
07-23-2002, 11:54 AM
hi blackjack,

yes I would like to do multi-pass multi-texturing on an alpha. the reason is my pipeline is heavily layered and I would like to keep the same texturing on the alphas and the solids. that way the look of the objects will stay consistent...

Thanks...

John.

ToolChest
07-25-2002, 04:40 PM
ok, I don't think I being clear. who supports alphas in their apps? do you limit your pipeline based on the number of channels that your target video cards multitexture can support? do you also render texture layers in multiple passes? if so how do you setup your blend function?

I can get mine to look good (not great) and I know it is because the math doesn't workout. this is a problem I am having trouble getting around.

John.