Reuben
08-30-2011, 05:11 AM
Hi,
I am working on Android, where I am restricted to OpenGL ES and seldom have multisample buffers available.
The problem is antialiasing polygon edges... surely a very common issue. The solution I initially used was to use transparent texture edges (i.e. let bilinear filtering provide smooth edges), but this requires drawing the scene in back-to-front order. Since my scenes tend to have a lot of overdraw, this totally killed my framerate.
I am now wondering whether antialiasing can be achieved in a fragment shader? For it to work the shader would need a "%age of fragment covered by polygon" variable, and blend according to that.
Is such a thing possible? Can fragment shaders have this kind of information? I have not yet written any shaders... I've only done fixed function GL work up to now.
Thanks for any advice!
I am working on Android, where I am restricted to OpenGL ES and seldom have multisample buffers available.
The problem is antialiasing polygon edges... surely a very common issue. The solution I initially used was to use transparent texture edges (i.e. let bilinear filtering provide smooth edges), but this requires drawing the scene in back-to-front order. Since my scenes tend to have a lot of overdraw, this totally killed my framerate.
I am now wondering whether antialiasing can be achieved in a fragment shader? For it to work the shader would need a "%age of fragment covered by polygon" variable, and blend according to that.
Is such a thing possible? Can fragment shaders have this kind of information? I have not yet written any shaders... I've only done fixed function GL work up to now.
Thanks for any advice!