在OpenGL ES中绘制半透​​明曲线

发布于 2024-08-09 08:21:44 字数 129 浏览 4 评论 0原文

我的目标是画一条半透明的曲线。用户移动光标,我在光标下绘制曲线。

我尝试使用抗锯齿点来绘制线条,但我不知道如何使其透明。 我无法使用线条来绘制曲线,因为无法同时设置抗锯齿和线宽。

我应该使用三角带来绘制曲线吗?

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

她比我温柔 2024-08-16 08:21:44

是的,如果你想做得很好,你可以将你的宽曲线镶嵌成三角形带。有很多关于笔画细分的论文。

然后,您可以使用方形 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文