by REDDemon » Wed Feb 22, 2012 12:44 pm
irrlicht already sorts scene nodes. you can decide to implement a custom octree for sorting your stuff (sort groups of triangles instead of single triangles can be much faster, but can also lead to visual artifacts) or maybe you can decide that is more viable sorting directly all triangles (if there are not to much triangles). Irrlicht arrays (irr::core::array) already have sorting capabilities, you have "just" to compute the distance from the camera at every frame. try both quicksort and heapsort for sorting. Until you try them you never know wich is faster. (theorically heapsort should be faster because is O(n*logn) vs O(n^2). in practice quicksort is faster in most cases).
Also avoid to use a separate scene node for each triangle.
OpenGL is not hard. What you have to do is just explained in specifications. What is hard is dealing with poor OpenGL implementations.