-
- Downloads
gl-renderer: Improve wireframe rendering
Render wireframe within paint nodes instead of drawing lines in a
second pass. The wireframe is blended over the node in a single draw
call. This slightly simplifies the logic by removing the computation
of a second set of indices and enables wireframe anti-aliasing using
Celes and Abraham's "Fast and versatile texture-based wireframe
rendering" paper from 2011.
Celes and Abraham use a one-dimensional set of texture coords for each
triangle edge, 1.0 for the 2 vertices defining the edge and 0.0 for
the other vertex, which basically define barycentric coords. Texture
mapping and the mip chain is then exploited to give a constant-width
edge. The main drawback of the technique is that contour edges of
node's damage mesh are drawn half as thick as interior lines since
each triangle draws half of each line's thickness.
Signed-off-by:
Loïc Molinari <loic.molinari@collabora.com>
Showing
- libweston/renderer-gl/fragment.glsl 19 additions, 3 deletionslibweston/renderer-gl/fragment.glsl
- libweston/renderer-gl/gl-renderer-internal.h 12 additions, 3 deletionslibweston/renderer-gl/gl-renderer-internal.h
- libweston/renderer-gl/gl-renderer.c 132 additions, 111 deletionslibweston/renderer-gl/gl-renderer.c
- libweston/renderer-gl/gl-shaders.c 16 additions, 1 deletionlibweston/renderer-gl/gl-shaders.c
- libweston/renderer-gl/vertex.glsl 5 additions, 1 deletionlibweston/renderer-gl/vertex.glsl
- shared/helpers.h 55 additions, 0 deletionsshared/helpers.h
Loading
Please register or sign in to comment