View Full Version : lots of transparent quads
I want to put a whole bunch of transparent quads in parallel intersecting a whole bunch of transparent quads perpendicular to these. Due to the draw order, it looks good from some angles, and bad from others. Do I have to break these up into a bunch of smaller quads to get it to look right? (cross-section below)
| | | |
05-21-2000, 09:39 PM
If you are not using textures, make each quad a pair (or more) of triangles, otherwise lighting will suck. With triangles, you get a vertex crossing the centre of the rectangle (or square), where the lighting is calcd. Assume you are generating normals and assume the "looks bad" is a lighting effect. I've found triangles always work better for lighting (more vertices).
you have to depthsort.
it looks bad because if you draw a quad here and then another quad a bit farther behind, this will appear broken.
the z-buffer in fact decides if a fragment can pass or is to be discarded.
the best way is to depth sorth in back to front order the alpha blended primitives, or else in front to back order but with depth buffer test disabled.
it all depends on what you have to do with these quads.
another way could be to use the alpha test capability of gl.
polygons will appear broken the same, but this way is less noticeable.
to activate alpha test, do:
fragments with a alpha component of 0 won't be rendered, so the completely transparent parts of your textures (if you're using texturing, of course) will be invisible.
Thanks for the ideas. I'll try and them, and if I have trouble, I'm sure you'll hear from me! http://www.opengl.org/discussion_boards/ubb/smile.gif
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.