• Advertisement
Sign in to follow this  

Order your draw calls..

This topic is 1650 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 everyone,

 

Just curious I was reading http://realtimecollisiondetection.net/blog/?p=86 when I decided to think about actually implementing the system as mention, but I faced a dilema. When sorting by key, which includes depth, what depth is that? The centroid of the renderable based on camera position? How do you deal with overlapping objects which centroids are properly sorted? Isn't that a problem? how are you supposed to handle those kind of issues?

 

In fact I was thinking how does this handles concave objects that wrap other objects within. My first guess was about splitting object into smaller sub meshes and then form the drawcall on the fly by combining those meshes, but seems quite suboptimal.

 

Any hints would be greatly appreciated, thanks.

Share this post


Link to post
Share on other sites
Advertisement

Overlapping objects will be an issue when you are dealing with transparent objets, and in this case the only solution, beside OIT techniques, is not to sort objects but triangles by depth to avoid potential artifacts, which might be impracticable in real-time (Unigine seems to do it, but I don't know how).

So, in the general case, centroid distance is generally enough for draw call sorting.

Share this post


Link to post
Share on other sites

For opaque objects it isnt that huge of an issue because Z testing will still make them render correctly.

 

For translucent objects, to achieve absolute correctness you must pretty much do the sorting triangle by triangle and in some cases even split up the individual triangles (if theyre overlapping for example)

 

If you only have windows and glass objects to worry about, it doesnt really matter how you sort them. If they get too close, the orientation and geometry of the objects will affect what the best way to sort them is.

Share this post


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

  • Advertisement