0
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ 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 $\endgroup$
    – Thomas
    Commented Feb 23, 2023 at 7:46
  • $\begingroup$ @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 $\endgroup$
    – Chris Gnam
    Commented Feb 23, 2023 at 12:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.