2
votes

I want to implement a geometry shader which needs triangle adjacency information. I found an algorithm which expands an index buffer to include vertices of neighboring triangles. But obviously this only works for meshes with shared vertices, so it won't work for every model. For example, a simple cube already needs to be created from duplicated vertices, if one wants to get the normals right.

Any ideas?

1
Couldn't you send the cube as connected geometry to OpenGL and mark the tris that you want to seperate with a special color and then output them with different normals. I don't know if that's even possible but just throwing that out there. - PeterT
The cube is just an example. I don't want to make exceptions, i want to treat every object the same. - cargath

1 Answers

1
votes

You don't need to use the same data set for OpenGL and geometry processing. You can have a geometry processing data set on which you perform algorithms like you described, and create a OpenGL dataset from this.

Another method is maintaining a set of "connected vertices" and perform the algorithm on that set.