Robbo
04-02-2002, 06:05 AM
Hi Gurus,
http://www.thermoteknix.com/93288989/ogl.htm
You will find 2 images here. The first one (imaginatively labelled `One') shows the inside of a 3 layered cylinder. The two inner cylinders have been displacement mapped (or `bumped') and also alpha tested. This means that holes in the inner layer show bits of the 2nd layer, and holes in both layers show through to the outer layer.
(I won't bother explaining what my application is). Anyway, obviously I'm not running the mesh at the same resolution as the texture, so there isn't a one-to-one correspondance between texel and quad (actually, I'm using tri-strips, but you know what I mean).
Compare image one to image 2. Image 2 shows the `other' side of image 2 and as you can see, the alpha test has culled away fragments of triangles where the texel alpha is zero, but as that texel probably stretches over many pixels, more of the fragment is being tested away than I want, leaving holes in the mesh and making it look awfully messy. What can I do to help with this problem? The only solution I can think of is to use one quad per texel and just not render a quad where its texel alpha is zero. However, with textures of up to 2048x2048 texels (depending on the user defined detail level) - I do not have the power to run such a large mesh in real-time (currently getting around 30fps with a GeForce 2 MX).
My second question is perhaps simpler. What are the rules for alpha test with multi-texture? When I use multi-texture, sometimes the fragments aren't rejected with zero alpha - do I need to set the fragment alpha to zero and just use one of the texture alpha values to reject whole fragments? Or is each texture unit alpha considered seperately from the other?
Thanks for any help you can give me.
http://www.thermoteknix.com/93288989/ogl.htm
You will find 2 images here. The first one (imaginatively labelled `One') shows the inside of a 3 layered cylinder. The two inner cylinders have been displacement mapped (or `bumped') and also alpha tested. This means that holes in the inner layer show bits of the 2nd layer, and holes in both layers show through to the outer layer.
(I won't bother explaining what my application is). Anyway, obviously I'm not running the mesh at the same resolution as the texture, so there isn't a one-to-one correspondance between texel and quad (actually, I'm using tri-strips, but you know what I mean).
Compare image one to image 2. Image 2 shows the `other' side of image 2 and as you can see, the alpha test has culled away fragments of triangles where the texel alpha is zero, but as that texel probably stretches over many pixels, more of the fragment is being tested away than I want, leaving holes in the mesh and making it look awfully messy. What can I do to help with this problem? The only solution I can think of is to use one quad per texel and just not render a quad where its texel alpha is zero. However, with textures of up to 2048x2048 texels (depending on the user defined detail level) - I do not have the power to run such a large mesh in real-time (currently getting around 30fps with a GeForce 2 MX).
My second question is perhaps simpler. What are the rules for alpha test with multi-texture? When I use multi-texture, sometimes the fragments aren't rejected with zero alpha - do I need to set the fragment alpha to zero and just use one of the texture alpha values to reject whole fragments? Or is each texture unit alpha considered seperately from the other?
Thanks for any help you can give me.