Jump to content
  • Advertisement
Sign in to follow this  
Endemoniada

DrawIndexedPrimitive()

This topic is 2633 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 guys, I don't understand something about drawing indexed primitives. Let's say my model is a cube, that would mean my geometry buffer would be length 8, one for each vertex and my index buffer would be length 36, 3 for each triangle times 2 triangles per side times 6 sides; is that right ?

What about the normals ? Each vertex really has 3 normals depending on which triangle it's used for.

Thanks.

Share this post


Link to post
Share on other sites
Advertisement
If you want your geometry to have unique vertex normals at every vertex, then you need to duplicate the vertices and apply the individual normal vectors as appropriate. In that case, your cube would have 4 vertices * 6 sides = 24 vertices in your vertex buffer.

Share this post


Link to post
Share on other sites
with geometry shaders normals can be calculated on the fly. but in general doing as Jason Z says is the way to go.
especially if you cant get your geo shader to work <.<, see http://www.gamedev.net/topic/611589-geo-shader-problem/ for details :)

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!