开发者

How to get polygon antialiasing to work?

开发者 https://www.devze.com 2022-12-16 06:55 出处:网络
I\'m using these function calls: glEnable(GL_BLEND) glEnable(GL_POLYGON_SMOOTH) glBlendFunc(GL_SRC_ALPHA开发者_如何转开发_SATURATE, GL_ONE)

I'm using these function calls:

glEnable(GL_BLEND)
glEnable(GL_POLYGON_SMOOTH)
glBlendFunc(GL_SRC_ALPHA开发者_如何转开发_SATURATE, GL_ONE) 

It doesn't work and won't render.

glEnable(GL_BLEND)
glEnable(GL_POLYGON_SMOOTH)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)

It doesn't anti-alias.


Try glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST)


This is a mundane answer.. but if you want rounded corners, you'll probably want to use more more vertices at the corners and place them for a more rounded shape. You could also look into doing this procedurally.. but if you're doing a game and you want to get it finish, I'd usually recommend that you have the final vertex position in the data (unless you have a compelling reason to make it dynamic).

Alternatively, you can use a texture with a rounded appearance near the corners. This is gradually becoming less popular as video hardware becomes more powerful, but is still quite effective.

0

精彩评论

暂无评论...
验证码 换一张
取 消