Question

When drawing filled, no outline triangles with OpenGL ES 2+ is there a way to easily add rounded corners to the triangles?

Is it also performant or is there a need to do it in a more complex manner to get performant rounded corners on a triangle?

// think dynamic triangles. And dynamic ability to adjust the radius of the corners would be useful also.

The only way I can think of is stepping around the corner, but I'm hoping there's an easy effect or some other magical less intensive effort required to pull it off.

Was it helpful?

Solution

There is no shortcut to doing this. Adding rounded corners to a triangle means it is not a triangle any more, so cannot be rendered as a single primitive.

Instead it needs to be constructed out of many triangles to give the illusion of a smooth rounded corner. So your own suggestion about 'stepping around the corner' is the correct way to do it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top