Sign in to follow this  

Question about the triangle rendering order

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

This topic is 4247 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this