Re: Filtering
"Sylvain G. Vignaud" <[email protected]> Sat, 02 Oct 2010 05:05:30 +0900
| Newsgroups | gmane.games.devel.algorithms |
|---|---|
| Message-ID | <[email protected]> |
> On Fri, Oct 1, 2010 at 9:57 AM, Andreas Brinck > <[email protected]> wrote: > filtered value = lerp(r0 * C0 + b0 * C1 + g0 * C2, r1 * C0 + g1 * C1 > + > b1 * C2, t) = > = (r0 * C0 + b0 * C1 + g0 * C2) * (1 - t) + (r1 * > C0 + g1 * C1 + b1 * C2) * t = > = (r0 * C0) * (1 - t) + (r1 * C0) * t + ... = > = lerp(r0, r1, t) * C0 + ... > > So in the world of non floating point numbers these two should be > equivalent right? No they're not, due to rounding. Take for example 2 texels: R=1 G=0 B=0 and R=0 G=255 B=0 Lerping in the texfetch would spawn something like: R=0 G=128 B=0 Definitely not what you're expecting! You'd want : R=0 G=255 B=something Using texfetch interpolation fails because it doesn't treat the 3 channels as one number; it won't always interpolate in the correct direction (interpreting 128 as either 0,5 or 1,5 depending on what's on the next channel) and it won't alter the other channel accordingly either. ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ GDAlgorithms-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list