Discussion:
How to draw overlapping triangles that don't clip?
(too old to reply)
Capt Laser Man
2008-12-27 16:23:37 UTC
Permalink
I want to draw semi-transparent triangles of different colors on top of each
other to mimic rays of light from different colored sources. I had this
working in GDI+ by simply drawing the triangles with low alpha values.
However, DirectX seems to be completely covering up the background
triangles. Is there a way to tell DirectX to not clip the triangles that
are already drawn not to be overwritten completely and to make triangles
blend together?
legalize+ (Richard [Microsoft Direct3D MVP])
2008-12-27 17:42:38 UTC
Permalink
[Please do not mail me a copy of your followup]
Post by Capt Laser Man
I want to draw semi-transparent triangles of different colors on top of each
other to mimic rays of light from different colored sources. I had this
working in GDI+ by simply drawing the triangles with low alpha values.
However, DirectX seems to be completely covering up the background
triangles. Is there a way to tell DirectX to not clip the triangles that
are already drawn not to be overwritten completely and to make triangles
blend together?
It sounds like you haven't configured the frame buffer to alpha blend
properly. Take a look at Chapter 14. The Frame Buffer from my book:
<http://www.xmission.com/~legalize/book/download/14-Frame%20Buffer.pdf>
--
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
<http://www.xmission.com/~legalize/book/download/index.html>

Legalize Adulthood! <http://blogs.xmission.com/legalize/>
Capt Laser Man
2008-12-28 03:38:02 UTC
Permalink
I finally got this to work in 2D. Then I tried switching to 3D and using
perspective transforms. Now I get nothing at all. Sigh. DirectX is a
tough nut to crack.
Post by Capt Laser Man
I want to draw semi-transparent triangles of different colors on top of
each other to mimic rays of light from different colored sources. I had
this working in GDI+ by simply drawing the triangles with low alpha values.
However, DirectX seems to be completely covering up the background
triangles. Is there a way to tell DirectX to not clip the triangles that
are already drawn not to be overwritten completely and to make triangles
blend together?
legalize+ (Richard [Microsoft Direct3D MVP])
2008-12-28 04:57:36 UTC
Permalink
[Please do not mail me a copy of your followup]
Post by Capt Laser Man
I finally got this to work in 2D. Then I tried switching to 3D and using
perspective transforms. Now I get nothing at all. Sigh. DirectX is a
tough nut to crack.
My friend Russ Fish says "the hard part about graphics is that there's
too many ways do draw a black screen", and he's right.

Read through the chapters of my book, its all free.
--
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
<http://www.xmission.com/~legalize/book/download/index.html>

Legalize Adulthood! <http://blogs.xmission.com/legalize/>
Loading...