tesselated filled bezier curves
category: code [glöplog]
the 2D kind - like used in SVG etc, these are really difficult to do in OpenGL/DX with tesselation.
Seems like noone has done it properly... Or am I that bad at googling?
That is. self-overlapping/intersecting curves.. Anyway, looks like it could be a good thing for a fragment shader...
Seems like noone has done it properly... Or am I that bad at googling?
That is. self-overlapping/intersecting curves.. Anyway, looks like it could be a good thing for a fragment shader...
You can perhaps use a well known stencil buffer approach to draw concave/self-intersecting polygons. It is mentioned in the OpenGL Red Book. That makes drawing complex polygons relatively painless and puts all the load on the GPU. It might not be ideal for all polygons though and it consumes some fill rate.
yes I know about that one.. is OK but not a perfect solution that works with everything else regardless of situation... so no, it needs to be tesselated somehow.
You can try to implement a Seidel tessellator, but the problem here is that most are content with implementing a basic routine which doesn't handle the tonnes of special cases and ambiguities which can occur with general polygons. I've never found a document which describes how to handle these in full detail.
There are open source variants of the tessellator in GLU (gluTess). Maybe you can have a look at one of these for inspiration on how to implement this?
There are open source variants of the tessellator in GLU (gluTess). Maybe you can have a look at one of these for inspiration on how to implement this?