android - Best Practice for Rounded Rectangles in OpenGL ES -


using opengl es, there seem 2 viable options rounded rectangles:

  1. manually draw shape using trig. (this i'm doing.)
  2. use a texture or group of textures scale appropriately, such 9-slice scaling

the problem first option antialiasing not come free, , if aiming compatibility wide array of devices, 1 can't count on opengl antialiasing hints work on hardware. you're left choppy-looking rounded rectangles, small ones, , performance overhead of making vertex array draw call. switch away this

the second option (9-slice or 9-patch) seems go-to method ui rounded rect elements, there surprisingly little information out there implementing 9-patching in opengl es.

what is: efficient strategy rendering antialiased rounded rectangles in opengl es adjustable border widths, border colors , fill colors. suggestions?

what want technique called edge anti-aliasing.

it described in answer: opengl es iphone - drawing anti aliased lines

just apply transparent vertexes @ outmost borderline of rectangle.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -