   Any idea for polygon sorting
  Well, I need to sort my semi transparent polygons by the distance to the camera, to be rendered correctly. I thought I just need to take a shape, calculate a center vertex, or something like that (I form an average of all vertices), and then sort the single vertices. But then I created a model, that produces some troubles:http://www.konstantin-schauwecker.de/secure/alpha.pngI need to use such a model to create a simple tree (by aplying an alpha tree structure to the two rects, as you see it in older 3d games). Now, the center of these two rects are the same. If I break it up into single triangles, and sort each of them, this would take unnecessary time. Well, currently I have no other idea how to sort it the "right way". Maybe anyone of you has one?Cone 
  one of the "easiest" ways that i know of, is building a bsp tree of all your tranparent polys, and render that.The result is as perfect as you can get, and it''s not _that_ expensive if you don''t have too many transparent polygons.;  Yes, build a BSP, but you don''t have to split the polygons. So it can actually be quite efficient. With randomly inserted polygons I think you get O(n*log(n)) complexity. ;  Short answer: it''s impossible without subdivision.Long answer: this shape can''t be sorted as is, simply because it has a cyclic visibility relationship in screen space. On one half, you have the blue polygon infront of the red one. On the other half, the red one is infront of the blue. The only way to correctly render this shape using sorted transparency, is to split it into 4 quads.An alternative would be order independent transparency. But since you are worried about performance, this is no option either (it''s going to be faster to simply render the additional 4 faces, rather than creating the transparency shells use by OIT).;  If you''re going to render classic cardboardcross trees, just disable alpha blending, enable alpha testing, and forget about sorting, the zbuffer will take care of it. ;quote:Original post by Anonymous Poster  If you''re going to render classic cardboardcross trees, just disable alpha blending, enable alpha testing, and forget about sorting, the zbuffer will take care of it.   Well I already tried that, but the problem was, that I want to use texture filtering. At the edges the filtering produces semi transparent pixels. If I use alpha testing, I either have a sort of glow aroud the objects, showing the background or it cuts off a lot of the texels (dependent on the value I use for the alpha test). I guess I''ll go with the subdivision, and write some simple sorting algorithm (I don''t want to use too much transparancy, so I guess sorting just inside an object and using alpha test for the rest would produce accaptable results for my needs).Well, good night (it''s already 1:20)Cone 