Jump to content
  • Advertisement
Sign in to follow this  
monguin61

question about rendering triangles

This topic is 4424 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This will probably sound like kind of a dumb question, but if someone can just give me a quick answer, my confusion should be sorted out with no trouble. I understand most of the algorithms needed to store, manipulate, display (et cetera) 3D graphics, but there's one thing I've never really been sure about. When you have a full scene, ie, not just a single, simple model, and it comes time to display all your triangles, what is the method that current games and other programs actually use? Most of the books I have on the topic are kind of outdated, and I'm just curious as to how its actually done. To the best of my knowledge, there are two basic techniques, z-buffer, and sorting the full list of (non backface) polygons by depth, and drawing all of them, far ones first. Honestly, I can't imagine that the latter technique is actually feasible, so I assume that current games use some form of a z-buffer, but I'm just not sure. Enlighten me, anyone?

Share this post


Link to post
Share on other sites
Advertisement
All current graphics cards out now support z buffering (since pre Geforce1?), no real time renderers/games out there are sorting per triangle.

The depth buffer is all handled on the graphics card and the programmers mainly don't have to worry about it. The graphics cards also use several techniques to speed up the z-testing, such as depth compression (Hyper-Z, etc). This makes them very fast at rejecting pixels that aren't visible.

For example, Doom 3 first renders a depth pass where only the depth (z) buffer is written to. The lighting passes after it only write to the color buffer (where z_buffer_depth = current pixels depth). This ensures that no pixel will be lit that isn't visible.

Sorting front to back can be beneficial in many cases but isn't done per triangle rather per batches of triangles. Same goes for rendering, all major rendering is done in batches.

Hope that helps

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!