Search code examples
opengl-escurve

Drawing semi-transparent curves in OpenGL ES


My goal is to draw a semi-transparent curve. User moves cursor and I draw the curve under the cursor.

I've tried to use antialiased points to draw line, but I don't know how to make it transparent. I can't use lines to draw the curve, because can't set both antialiasing and line width.

Should I use triangle strip to draw curve?


Solution

  • Yeah, if you want to do a nice job with this, you could tessellate your wide curve into a triangle strip. There are many papers written about stroke tessellation.

    You can then texture your triangle strip with a square alpha texture that has a nice solid, anti-aliased circle in it -- this causes the wide line to appear anti-aliased! Check it out:

    http://homepage.mac.com/arekkusu/bugs/invariance/TexAA.html

    Very cool stuff.