Hi, I'm writing some simple software 3D rasterization code for a small game me and my friends are going to make. So I have gotten some triangle rasterization code, with some *FULL* matrix concatenator routine (which takes ~3000 clk cycles, is that bad? ). anyway the polygons are respresented using floating point data types using the average Z values of the verticies. I was wondering if there is a floating poit sorting algorithm that you guys use, that is pretty quick?

If the bubble sort will do well let me know so I can implement it instead of bothering you guys :D

Thanks in advance

If the bubble sort will do well let me know so I can implement it instead of bothering you guys :D

Thanks in advance

You could use my quick sort.

http://www.asmcommunity.net/board/index.php?topic=2361&highlight=quick+sort

http://www.asmcommunity.net/board/index.php?topic=2361&highlight=quick+sort

Bubblesort is the best for sorting triangles when the difference between each frame is small. The bubblesort is the absolute fastest sort on already sorted data. You should, however, use Quicksort if the whole scene changes fast. BTW. Remember to sort pointers to the triangles and not sort the actual triangles.

Bubblesort is the best for sorting triangles when the difference between each frame is small. The bubblesort is the absolute fastest sort on already sorted data. You should, however, use Quicksort if the whole scene changes fast. BTW. Remember to sort pointers to the triangles and not sort the actual triangles.

thanks I was about to sort and move the whole triangle entry, stupid me :(

You could use my quick sort.

http://www.asmcommunity.net/board/index.php?topic=2361&highlight=quick+sort

I'll look at your code, and try to convert it to floating point much thanks Gliptic and BitRake