You are right. The only way to solve it completely in my opinion is ray
tracing. However, according to OpenGL spec, the smooth implementation
should calculate the coverage percentage to the pixels of the edge of
the object, that means that if the situation you described occurs for
two polygons of the same object, the effect you described won't happen.
Only if two different objects edges falls in the same pixel and are not
overlapping it will happen.

 

Thanks anyway,

 Guy. 

 

________________________________

From: [email protected]
[mailto:[email protected]] On Behalf Of Michael
Platings
Sent: Tuesday, March 09, 2010 7:01 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] automatic pixel transparency adjustment

 

If "physically correct" is what you need then OpenGL probably isn't what
you want. In general, OpenGL is suitable for rendering something that
looks pretty good, FAST.

I don't know of any way to get fragment coverage in a shader. However,
even if you could that wouldn't be adequate:
Imagine you have a white (255) square on a black (0) background. You
size the square so that it precisely covers one pixel. When you render
it, the pixel is coloured white (255).
Now imagine you divide that white square in half. You would expect that
rendering the two halves would also get you a value of 255, but...
When you render the first half, the pixel is 255 * 0.5 + 0 * (1 - 0.5) =
127.
When you render the second half the pixel is 255 * 0.5 + 127 * (1 - 0.5)
= 191. NOT 255!

Therefore, multiplying alpha by coverage wouldn't work unless you're
only dealing with separate polygons, which isn't the case most of the
time.
HTH

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to