Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Alpha blending without sorting possible?

2 views
Skip to first unread message

Roy Schulz

unread,
Sep 19, 2002, 10:07:24 AM9/19/02
to
I draw a tree with a recursive function. The leaves are quads that have a
texture with alpha channel. Since the depth test is done on the full quad,
their are strange artifacts at the free spots of the textured quads
(background shining through). I understand that this is usually avoided by
drawing alpha blended polygons from farthest to nearest.

But is there a way to do it without sorting the polygons? I'd like to do the
OGL calls directly in the tree function because the performance will
decrease severly when the tree is built in memory, then sorted and then
drawn to screen.

I guess, it could be done, if transparent pixels wouldn't affect the depth
buffer. How can I achieve such behavior?

Thank you for any help
Roy

Ruud van Gaal

unread,
Sep 19, 2002, 10:38:16 AM9/19/02
to

I'd use ALPHA_TEST. When pixels fail the alpha test, then the Z-buffer
isn't updated.
And you then also might want to turn off blending (as an option
perhaps), since with ALPHA_TEST you might not need it anyway (and it's
faster).


Ruud van Gaal
Free car sim: http://www.racer.nl/
Pencil art : http://www.marketgraph.nl/gallery/

fungus

unread,
Sep 19, 2002, 10:54:37 AM9/19/02
to

Use glAlphaFunc(), disable blending.

--
<\___/>
/ O O \
\_____/ FTB.

Roy Schulz

unread,
Sep 19, 2002, 12:18:38 PM9/19/02
to
Thank for your help. Now it works perfectly.
Roy

0 new messages