Jump to content
  • Advertisement
Sign in to follow this  
Gaming101

Triangulation

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

I was just wondering what was the purpose of triangulation mesh data. What are the pros and cons of it.

I hear that you should triangulate because if speeds up rendering but I also read that's no longer the case with the newer versions of say DirectX. I also hear you shouldn't triangulate because if give you more polygons which would be bad for collision detection and other math operations.

So should I triangulate or not? Should I hold two data sets for the mesh data one for rendering another for math computations? Any help would be great.

Thanks

Share this post


Link to post
Share on other sites
Advertisement
D3D only really supports three types of primitives - triangles, lines and points. That means for 3D rendering you'll want triangles. This is generally handled in the exporter used to get your 3D models into the game - you don't need to do it in your modelling software.

Physics libraries also tend to support triangles because that's the standard mesh format, but you probably don't want to use the same mesh representation for rendering as you do for physics anyway. A lower poly version is commonly used to speed things up.

Share this post


Link to post
Share on other sites
So you use a high poly count model for rendering then a really low poly count for the physics? So you do use two sets?

Thanks for the reply

Share this post


Link to post
Share on other sites
You can use two sets of geometry, or, if acceptable, narrow down the collision detection parametrically using bounding boxes and/or shapes like spheres, cylinders, capsules, etc., then apply a finer set of triangles - either a second set or the original mesh.

Depending on your collision algorithm, you may need two sets of data in any case - you may not be able to (or want to) render the collision set data directly if it needs to be in a vertex buffer, etc. It's a tradeoff. Locking and unlocking vertex buffers can be expensive timewise (e.g., they're in GPU memory) versus accessing data arranged to make collision detection easier - which takes more memory.

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!