Re: color interpolation discrepancies




<scott.d.anderson@xxxxxxxxx> wrote in message
news:1127358822.788331.277600@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> What I expected to see was all of these squares looking the same. (More
> specifically, I expected them to look like the last square, which at
> least looked smooth. But that's beside the point.) Mathematically, it
> doesn't matter whether you divide a square along one diagonal or the
> other: the parametric coordinates and therefore the color of the
> center is the same in either calculation. So, while I really do
> appreciate the practical advice to always use triangles for the most
> consistent results, it's amazing to me that I should have to even
> consider this. In fact, it's hard for me to imagine an implementation
> that would screw up interpolation -- the math is pretty easy.
>
> Scott
>
> PS: sorry to everyone for mispelling the URL. I see that most people
> figured out that I just mispelled "interpolation."
>

No, I'm sorry, but you are wrong. For a textured quad you are correct, as
all 4 corners
contribute to the color in the center, but for a per-vertex-color quad split
into a pair of triangles, the color just off of center is not affected at
all by the "other" corner in the other triangle.

Consider a quad that has colors red,red,red, blue corners. The red,red,red
triangle will
be red, all the way across, as the blue corner is not considered. As I said,
that's why
texturing is such a big deal these days and per-vertex coloring is
essentially obsolete --
a textured quad will consider the blue corner, using an interpolator of your
choosing.

It's not bilinear, it's triangle linear -- bilinear is a *lot* more
expensive, and triangle rasterizers
just won't do it -- the silicon doesn't exist.


.



Relevant Pages

  • intelligence
    ... then a triangle, therefore is missing the square. ... D the half squares are turned around 90° against the clockwise direction, ... square and circle and indicate at the same ...
    (misc.news.internet.discuss)
  • Re: "Euclids Fourteenth Book
    ... square on the hypotenuse. ... right triangle itself. ... Given that areas of plane figures scale as the square of any ... If you add curvature the Pythagorean theorem holds ...
    (talk.origins)
  • Re: 3 quilt patterns
    ... A technique cannot be copyrighted, but the specific instructions, written ... three of the sides to inscribe a triangle in this, ... making what I called a "triangle in a square." ... As for the pattern being ...
    (rec.crafts.textiles.quilting)
  • Re: floating point problems
    ... It looks like you are calculating a square root, ... Better write a function that returns the square of the distance between ... distances inside my right triangle function. ... and then resquare it in the actualy "figuring out" ...
    (comp.lang.c)

Loading