<p>My understanding is that, while subdivision algorithms like Catmull-Clark can work for any polygonal mesh (including triangles) it's preferable to start with a quad mesh.</p>
<p>Currently my rendering engine represents all meshes as meshes of triangles, but im now looking at adding tesselation/subdivision so I can make better use of displacement maps and what not.</p>
<p>So my thought process is I'll need to be able to support quads in addition to triangles.  My <code>Mesh</code> class represents geometry using vertex and index buffers where the index buffer is an <code>std::vector&lt;std::array&lt;unit32_t, 3&gt;&gt;</code>.  This works fine under my current assumption of storing ONLY triangles, but im not sure how I can change things to support both triangle and quad meshes, as well as possibly meshes that contain some quads AND some triangles.</p>

CC BY-SA 4.0
2023-02-23T07:46:05.303Z
You have two possible ways to deal with that problem. 1: triangulate the quads. 2: create two IBO Buffers. One for triangles and one for quads. Then you need two draw calls (one for triangles and one for quads.
I don't see another solution for that, but maybe someone knows a better one
Thomas
CC BY-SA 4.0
2023-02-23T12:09:29.250Z
@Thomas after a bit more reading other subdivision methods such as Loop Subdivision may be a better fit for triangle only meshes.  I was trying to find a way to represent quads as I had originally only been looking at subdivision methods that worked best with quads so im considering going another way to avoid the issue entirely
Chris Gnam
<c++><mesh><polygon><subdivision><tesselation>
How would you represent a mesh with tris and quads?
Chris Gnam
# How would you represent a mesh with tris and quads?

(Asked by: username_0 on 2023-02-23)

My understanding is that, while subdivision algorithms like Catmull-Clark can work for any polygonal mesh (including triangles) it's preferable to start with a quad mesh.

Currently my rendering engine represents all meshes as meshes of triangles, but im now looking at adding tesselation/subdivision so I can make better use of displacement maps and what not.

So my thought process is I'll need to be able to support quads in addition to triangles. My `Mesh` class represents geometry using vertex and index buffers where the index buffer is an `std::vector<std::array<unit32_t, 3>>`. This works fine under my current assumption of storing ONLY triangles, but im not sure how I can change things to support both triangle and quad meshes, as well as possibly meshes that contain some quads AND some triangles.

**Tags:** c++, mesh, polygon, subdivision, tesselation

> **Comments:**
> **username_1**: You have two possible ways to deal with that problem. 1: triangulate the quads. 2: create two IBO Buffers. One for triangles and one for quads. Then you need two draw calls (one for triangles and one for quads. I don't see another solution for that, but maybe someone knows a better one  
> **username_0**: @username_1 after a bit more reading other subdivision methods such as Loop Subdivision may be a better fit for triangle only meshes.  I was trying to find a way to represent quads as I had originally only been looking at subdivision methods that worked best with quads so im considering going another way to avoid the issue entirely  

---

## 0 answers

