From: Emil P. <hu...@co...> - 2008-07-28 23:13:23
|
With wrap mode it indeed wraps, rather than flip. The fractional part is defined x - floor(x), which is always in [0, 1), so frac(-0.3) = 0.7. I think the confusion in this thread is because some are talking about negating texture coordinates (which flips) and some are talking about what happens when the texture coordinate is interpolated from the positive to negative side of zero (where it's just wrapping, like it does across any other integer coordinate). -Emil -----Original Message----- From: gda...@li... [mailto:gda...@li...] On Behalf Of Tom Plunket Sent: 29 July 2008 00:45 To: Game Development Algorithms Subject: Re: [Algorithms] negative UV coords > Assuming you don't have texture clamping turned on, negating uv's > will cause them to be mirrored along the negated axis. If you > think about it, by negating u, you will be walking backwards along > the u axis, which means those texels will be encountered in reverse > order, which is the order they will be mapped onto the triangle. Again, it would seem (to me) to depend on the implementation, since it depends how you interpret the fractional portion of the values. E.g. I seem to remember hearing that different hardware implemented modulus differently, so -3.5 % 2.0 could yield 1.5 or .5 (or possibly a negative version of one of those?), depending on your implementation. So then the question is one of whether you interpret -.3 U as .3 or .7. Can one say with certainty that one way is wrong and the other right? I mean, to me if I have the mode "wrap" set, I sure wouldn't expect it'd implicitly mean "flip." For that, I'd choose a "mirror" mode instead. -tom! ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ GDAlgorithms-list mailing list GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list |