Jump to content

  • Log In with Google      Sign In   
  • Create Account

Sorting faces according to depth but keeping an index buffer


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 simonjacoby   Members   -  Reputation: 546

Like
0Likes
Like

Posted 31 March 2013 - 12:25 AM

Hi guys,

 

I have a problem where I want to sort faces according to depth to be able to render them without a depth buffer (or even a depth component in the position of the vertex, I just want to have x and y in the position).

 

However I still want to have a have a nice index buffer so that I don't have to treat them as separate faces, for memory (and performance, but mostly memory) reasons.

 

Basically, I just want to make a draw call that draws the entire mesh, knowing that it will be drawn back-to-front (overdraw is a smaller problem than the vertex processing in my specific case), and indexed so that I process as few verts as possible.

 

Does anyone have any ideas on how to accomplish that?

 

Thanks,

 

Simon

 

 

 



Sponsor:

#2 unbird   Crossbones+   -  Reputation: 4977

Like
0Likes
Like

Posted 31 March 2013 - 02:13 AM

You could probably use volume sort, given your faces are somewhat laid out in a grid like fashion. Then you provide different index buffers for all the possible view directions. You can even combine them into one index buffer and use a subset logic (DirectX lets you chose the starting index, I don't know OpenGL, but I bet you can do that too).



#3 simonjacoby   Members   -  Reputation: 546

Like
0Likes
Like

Posted 31 March 2013 - 03:25 AM

Thanks for the tip, I was looking for something like that.

 

However, I've encountered a fatal flaw with the way I was trying to do things, so I'm dropping it now, and trying something else.

 

Thanks anyway!






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS