Low complexity shader to indicate the sides of a polyline

Posted by Pris on Game Development See other posts from Game Development or by Pris
Published on 2012-11-16T05:53:58Z Indexed on 2012/11/16 11:14 UTC
Read the original article Hit count: 310

Filed under:
|

I have a bunch of polylines that I draw using GL_LINES. They can have thousands of points. They actually represent the separation of land and water on a map. I don't have complete polygons, just the ordered set of points. enter image description here

I'm looking for a neat but efficient way to visually convey Side A and Side B as being different. For example I could offset the polyline in one direction a few times and fade it out (but every offset is doubling the number of points), or offset it once to make a "ribbon" and give one side a 'glow' like effect to mimic the outer glow or shadow of a polygon).

This is for a mobile application and I'm using OpenGL ES 2. I'd like to keep the effect as simple as possible from a complexity stand point. I'm looking for some additional ideas; maybe there's a clever shader technique out there or a visual effect I haven't considered.

© Game Development or respective owner

Related posts about glsl

Related posts about opengl-es2