rendering pipline help?? thoughts, ideas, questions! :)

i’m just trying to think of some ways to approach a 3d engine - rendering pipline. every time i have a thought something gets in the way that i can’t figure out.

what would give me the best performance in theory?

  • using a z buffer
  • go through all textures and render all triangles with that texture
  • but how would transparent textures fit in to this?
  • don’t have have to sort them?
  • and won’t the other triangles that i render using 2nd method screw this up?

or perhaps i can do this

  • sort all triangles from back to front
  • render triangle (using it’s texture)
  • but wouldn’t this be slow because of the constant state changes?

what are some other ways of doing the rendering pipline?

i know about bsp trees, octrees, etc BUT i only see them as the following…
bsp trees : allows to clip out triangles, etc, sorting
octrees: allows to clip out regions of triangles…

but what i’m left with is a list of triangles?? i’m still stuck wondering how to go about rendering them in a fast, efficient way!

thanks in advance for any info!!
jeff

a hardware z buffer is pretty quick and in most cases u cant really not use one without having bad vidual aftifacts.

what u should do is have 2 list one built from meshes/triangles containing solid textures and another with tris/meshes containing transparent textures.

sort the 2 lists depending on texture and or state.

render the solid list then render the transparent list and finally do the 2d stuff over the top.

For opaque triangles, it’s most likelly that in current video cards your sorting algorithm will be a lot slower than throwing all the triangles unordered, and let the zbuffer manage it.
Now for transparent triangles, you can do similar to what zed says in its last line:
-draw opaque triangles, unordered, with zbuffer enabled.
-sort transparent triangles/objects
-draw transparent triangles from back to front, with writes to the ZBuffer disabled (depthmask) but with depth_test enabled.