[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xfree-render
Subject:    [Render] RE: Point sampling trapezoid alpha (was: Another subtle issue...)
From:       "Ramshaw, Lyle" <lyle.ramshaw () hp ! com>
Date:       2002-12-19 17:52:30
[Download RAW message or body]

Warning:  The point-sampling approach to computing the alpha 
value for a trapezoid may not completely avoid the problem 
of alpha values that lie outside the range [0..1].

Consider a "trapezoid" whose left and right edges actually 
cross inside the interval between the top and bottom edges:

            .--.
             \/         
             /\
     t.left /  \
           /    \ t.right
          /      \    
         /        \
        .----------.

So there is a small "reversed" triangle at the top.  When 
processing the remaining trapezoids in a tiling, we will 
never know about both of the edges t.left and t.right 
simultaneously;  so we will never be able to correct for 
this "reversed" triangle.  Hence, if we want alphas to add 
up properly, we must consider the area of the "reversed" 
triangle as counting negatively, in computing the alpha 
value for t.  

In the point-sampling approach, it might happen that one 
of our sampling points lies in the "reversed" triangle, 
while none of them lies in the rest of t.  In such a case, 
the alpha value for t should come out slightly negative 
-- a count of -1.  Getting rid of this negative value by 
simply replacing it with 0 would be bad, since then the sum 
of the alphas for the entire pixel will be too high;  note 
that the sample point in the "reversed" triangle will lie 
positively in two other trapezoids of the tiling.  

Lyle 
_______________________________________________
Render mailing list
Render@XFree86.Org
http://XFree86.Org/mailman/listinfo/render
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic