Jump to content
  • Advertisement
Sign in to follow this  
dv

Question about the triangle rendering order

This topic is 4499 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

Hi, a question about rendering triangles: if I use a triangle list, and insert 15 triangles in a vertex buffer, sorted in back-front order, can I assume that they will be rendered in that order? This is important for blending; I pre-sort the triangles, then render all of them using only one draw call, and they will be blended correctly. So, can I assume this? Or will this only work with some drivers?

Share this post


Link to post
Share on other sites
Advertisement
When it comes to these graphics APIs, it's always FIFO. So whatever you render first gets shipped through the pipeline first, and anything rendered after that is rendered "on-top" of it.

Share this post


Link to post
Share on other sites

not sure what specific applications you need this for but bear in mind that it is often enough to just draw your _models_ in back to front order, switching culling to front faces, rendering the 'inside' then switching culling to backfaces and rendering the 'outside'. This is much faster than sorting every individual triangle, but occlusion is not a trivial problem and it depends what exactly you are trying to do.

Share this post


Link to post
Share on other sites
The geometry in question is a Q3BSP level. I know, its old, but I have to use it, no options here :) But I dont wanna do a drawcall for every single face, so I prefer to stuff them all presorted in an IB and issue the call only once.

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!