PDA

View Full Version : Polygon Edge Smoothing with Shaders



glfreak
05-28-2011, 01:35 PM
I'm trying to smooth the edges of rendered lines implemented as textured quads, to compensate for a removed functionality (thick stippled lines).

I use vertex and pixel shaders so no fixed path is utilized.



glDisable(GL_DEPTH_TEST);

glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA_SATURATE, GL_ONE);

glEnable(GL_POLYGON_SMOOTH);

glDrawArrays(GL_TRIANGLES, 0, 3 * vertices.size());


This is causing polygons not rendered. Is this a consequence of using shaders with some kind of "fixed functionality (polygon soothing)?"

I had a problem with using shaders and stippled lines that's why I'm using my own line rendering implementation instead.

Thanks.

BionicBytes
05-31-2011, 12:58 AM
implemented as textured quads
But you iussue this commmand: glDrawArrays(GL_TRIANGLES ....

Anyway, not the cause of
This is causing polygons not rendered

So what is your vertex array setup code?

Ilian Dinev
05-31-2011, 10:50 AM
a removed functionality (thick stippled lines).
Wide lines are back in the spec, since long ago. You can simulate stipples and whatever in frag-shader.