Method of drawing transparent polys
by Andy Hawkins · in General Discussion · 03/04/2007 (9:27 pm) · 0 replies
I thought I'd open this up to the main discussion area, because the answer is probably from what people have heard, rather than a pure coding answer... I hope you can help.
I know that in order to display all alpha polys in a scene you have to draw then last, do a bubble sort and render them after the opaque geometry is drawn. Using the default methods in Directx 9 ( not D3DX ) it would seem possible - this is my theory - because for each object it breaks it down into materials, and draws each subset of polys with common materials one after the other.
So the theory I have to do this, is detect any materials with an alpha component, and store those polys away til later. Then iterate through the alpha polys for every poly in the scene, bubble sort them and render from the bubble sort index.
Is this what "normal" people do or am I looking at it the wrong way? Maybe most people bubble sort per object for transparent polys?
I know that in order to display all alpha polys in a scene you have to draw then last, do a bubble sort and render them after the opaque geometry is drawn. Using the default methods in Directx 9 ( not D3DX ) it would seem possible - this is my theory - because for each object it breaks it down into materials, and draws each subset of polys with common materials one after the other.
So the theory I have to do this, is detect any materials with an alpha component, and store those polys away til later. Then iterate through the alpha polys for every poly in the scene, bubble sort them and render from the bubble sort index.
Is this what "normal" people do or am I looking at it the wrong way? Maybe most people bubble sort per object for transparent polys?