在OpenGL ES中绘制半透明曲线
我的目标是画一条半透明的曲线。用户移动光标,我在光标下绘制曲线。
我尝试使用抗锯齿点来绘制线条,但我不知道如何使其透明。 我无法使用线条来绘制曲线,因为无法同时设置抗锯齿和线宽。
我应该使用三角带来绘制曲线吗?
My goal is to draw a semi-transparent curve. User moves cursor and I draw the curve under the cursor.
I've tried to use antialiased points to draw line, but I don't know how to make it transparent.
I can't use lines to draw the curve, because can't set both antialiasing and line width.
Should I use triangle strip to draw curve?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,如果你想做得很好,你可以将你的宽曲线镶嵌成三角形带。有很多关于笔画细分的论文。
然后,您可以使用方形 alpha 纹理对三角形条进行纹理处理,其中有一个漂亮的实心、抗锯齿圆圈——这会导致宽线看起来抗锯齿!看看:
http://homepage.mac.com/arekkusu/bugs/ invariance/TexAA.html
非常酷的东西。
Yeah, if you want to do a nice job with this, you could tessellate your wide curve into a triangle strip. There are many papers written about stroke tessellation.
You can then texture your triangle strip with a square alpha texture that has a nice solid, anti-aliased circle in it -- this causes the wide line to appear anti-aliased! Check it out:
http://homepage.mac.com/arekkusu/bugs/invariance/TexAA.html
Very cool stuff.