android - Is it possible to create a diffuse effect on a 2d mesh in opengl? -
in picture below have 2d mesh represented white square. (the rounded corners mesh geometry) can see square has bit of shading around it's edges. want accomplish, shader adds diffuse effect whenever near edge. possible in opengl? use normals calculated angles of faces, has 2d mesh route not possible. suggestions appreciated. thanks.

there many ways accomplish in gl, graphics pipeline quite flexible.
one possibility: add new vertex data stream, contains distance of vertex closest edge. data passed fragment shader vertex shader, , used darken fragment, if close enough edge.
Comments
Post a Comment