使用 OpenGL 着色器绘制多边形的边 [英] Draw edges of a polygon with OpenGL shaders
本文介绍了使用 OpenGL 着色器绘制多边形的边的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道是否可以使用片段着色器绘制具有特定颜色的渲染多边形的边缘,如本示例图片所示:
I was wondering if it was possible to draw the edges of a rendered polygon with a specific color using a fragment shader, as in this example picture:
或者我应该单独渲染它们?
Or should I just render those separately?
推荐答案
查看此页面上的相关工作:http://web.archive.org/web/20120527185124/http://cgg-journal.com/2008-2/06/index.html
See work related on this page: http://web.archive.org/web/20120527185124/http://cgg-journal.com/2008-2/06/index.html
顶点着色器应该渲染多边形,其中到每条边的距离都是彩色的.
A vertex shader should render polygons where the distance to each edge is colored.
详细解释了为每个单元格"着色的区别.
The difference between coloring each "cell" is explained in much detail.
这篇关于使用 OpenGL 着色器绘制多边形的边的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文