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

Alpha blending not depending of order of drawing(rendering)

4 views
Skip to first unread message

mehafi

unread,
May 4, 2011, 6:03:30 AM5/4/11
to adam_g...@tlen.pl
Hi,
Is there a way to draw something with alpha blend ( transparency ) and
that the transparency depend of ZBuffer order instead of order of
drawinf it?
For example:
Two traingles:
red one, from points (0, 0, 0), (0, 0.5, 0), (1, 0, 0)
yellow one, from points (0, 0, 1), (0, 1, 1), (1, 0, 1)
the camera is for example in (0, 0, -30 ) and is looking at (0, 0, 0).
Both traingles has 50% transparency.
The background color is black - device.Clear(ClearFlags.Target |
ClearFlags.ZBuffer, Color.Black, 1.0F, 0);

And the point is:
when I draw first red one, and next yellow one ( in other way first
draw further to user one and next closer one ) everything is ok =
through yellow on the red one could be seen ( transparency is
working ), but
when I draw first yellow and next red one no red one coud be seen
through yellow.
I think, that it is becauose of order of draawing - alpha blending
mixing colors alredy drawn (destination ) with color of point we want
to draw ( source ). But is there a way that it would be depend of
ZBuffer = alpha would be calculated after everything had been drawn
and be depended of ZBuffer order, order and not be depend of drawing
order ?

0 new messages