Jump to content

  • Log In with Google      Sign In   
  • Create Account


How does the pipeline know the index what it need when it draws a quad using the vertices generated by the Geometry Shader?


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
No replies to this topic

#1 swdever   Members   -  Reputation: 176

Like
0Likes
Like

Posted 02 April 2013 - 08:50 PM

   Hi! I am learning how the Geometry Shader works in D3D11. I am studying a sample which inputs one point into the Geometry Shader and outputs a quad each time. As shown in the figure below, the sample specifies the vertices generated by the Geometry Shader.(Sorry. I don't know how to upload a image. Hope you can understand the figure.)

 

 

v1               v2

------------------

|                 |

|                 |

|                 |

|                 |

------------------

v0                v3

  With general method,if we want to draw a quad, we pass four vertices to the VertexBuffer, then create a IndexBuffer, binding them to the pipeline. Then the pipeline uses the data in the IndexBuffer and the VertexBuffer to draw two triangles what make up a quad. But in the sample I am studying, there is no IndexBuffer. The sample just generates these four vertices and append them to a TriangleStream object in the order: v0,v1,v2,v3, at the end of the Geometry Shader. Since D3D11 uses counter-clockwise culling state by default, visible triangles must be drawn in clockwise order. But how does the pipeline determine which three vertices of these four vertices to choose and their order to draw a visible triangle. There is no IndexBuffer in the sample. Maybe the Geometry Shader's output is drawn using a fixed index?Can anybody help me figure it out?

 

PS: The sample works well.



Sponsor:



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