i don’t have a strong allegiance to APIs in general. i try to do all of my work from scratch. still opengl has treated me good, and i like the general structure, and i think its something graphics people are likely to be comfortable with.
so sometimes i build APIs for my systems which mimic opengl structure as close as i can afford. i’ve built a run-time opengl parser, so i know if i stick to the format, building a run-time parser for a given api should be as simple as ‘copy paste’ to use a windows euphamism.
today i’m considering mimicing the seemingly quirky little glEdgeFlag and would like to hear maybe something more about it.
best i can tell glEdgeFlag is soley for when rendering in line polygon mode. it seems that when rendering polygons as lines you can control whether or not edges are rasterized with glEdgeFlag via assigning flags to their starting vertex.
i’m assuming it maps well to all triangle display modes (TRIANGLES,QUADS,TRIANGLE_STRIP,etc)… if not please let me know.
it is said that glEdgeFlag defines boundary and non-boundary edges.
i’m working with this interesting real-time nurbs system i’ve devised. it is real-time so effeciency is the key. it is subdivision based so it helps to start with a highly regular mesh (regular triangle area, rather than necesarrilly a regular grid connectivity). a nurbs parameterization may not be very regular though for complex models. so the idea is to map a subdivision type polygon model onto the parameterized surface via the polygon models texcoords (actually technicly the system reserves texcoords for actual texture coordinates, and rather vertices are assigned ‘parameter2f’, which function like texcoords but are indapendant, for spatial mapping to the nurbs base model). this mesh is not required to be a grid, so it can map well to an irregular parameterized surface.
so the idea is to provide an api for defining this initial mesh (subdivision lvl0).
right now i’m planning two flavors, one using opengl immediate mode, and and another based on glDrawElements et al.
one thing to be clear about is you would not run through this mapping process each frame as if drawing the manifold… you would just do it once to set it up and from there a clod based renderer takes over.
the issue arises in for instance, if two ajacent strip are rendered, then the system must internally be able to to recognize the overlapping vertices and connect the ajacent triangles so that subdivision will be continuous.
algorithmicly this is a bit tricky, but not the issue. the thing is, i wonder if it is always apropriate to assume that overlapping vertices should be merged, or if i should let the user explicitly define non-boundary edges via a glEdgeFlag analog.
i wonder if i’m being too nit-picky, but relying on EdgeFlag would also relieve the internal algorithm a great deal in many cases.
all i’m really asking though is what is the history of glEdgeFlag. does anyone ever use it, or is it just a quirk?
i want to provide an interface that will be intuitive for everyone to get started with, but i’m sure in the in a custom file format will be available for maximal effeciancy in managing connectivity. but at least this api serves as a basis for generating the initial connectivity relationship.
PS: i realize as a start this thread is a lot more jabbering than real curiosity. but i’m trully interested in whether people would be comfortable using a glEdgeFlag type construct in this respect for total control and internal effeciency, or whether i’m going overboard here. also as ever interested in any kind of lateral suggestions whatsoever. -michael