PDA

View Full Version : PolygonStipple



V-man
12-02-2009, 02:53 PM
I'm having hard time finding some papers, documents, tutorials on this one. How can glPolygonStipple be used to do screen door effect? From what I remember, this can be used to give a transparent look. It would be a total replacement to the glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) issue.

I know there are other solutions such as OIT, but I am looking for something simple for GL 1.1

Alfonse Reinheart
12-02-2009, 04:30 PM
I don't think you can use polygon stipple as a complete replacement for blending. The stipple is screen-space aligned, so one blended object on top of another will simply look like the last one you drew. You can't do order-independent transparency with stipple.

Brolingstanz
12-02-2009, 04:40 PM
How far back does CSAA reach (1.3?). By far the easiest way to fly for dense veggies but dunno about 1.1.

ZbuffeR
12-02-2009, 04:54 PM
I don't think you can use polygon stipple as a complete replacement for blending. The stipple is screen-space aligned, so one blended object on top of another will simply look like the last one you drew. You can't do order-independent transparency with stipple.
Think again, search here for "stipple" :
http://www.opengl.org/resources/code/samples/glut_examples/examples/examples.html

And it has modern uses too, as described by this interesting paper :
http://graphics.cs.uiuc.edu/~kircher/inferred/inferred_lighting_paper.pdf

Alfonse Reinheart
12-02-2009, 05:07 PM
Think again, search here for "stipple" :

That's because they drew each object with a different stipple pattern. So you could use it if you have a limited number of objects and draw each one with a different pattern. But for stipple-based transparency, you generally want the pattern to be the effective blend value for that object: dense patterns mean more opaque, and sparse patterns mean more transparent.

This is not not a general solution for OIT.

ZbuffeR
12-03-2009, 02:02 AM
Yeah but for "something simple for GL 1.1" there is not a lot of general (and realtime) options ...

V-man
12-03-2009, 09:36 AM
Thanks, it has been a long time since I've seen that examples page. Like I suspected, they use different patterns and it is nice to have that tables of bitpatterns that they have in the source.