On Thursday 24 February 2005 18:34, Daniel Phillips wrote: > On Thursday 24 February 2005 17:55, Lourens Veen wrote: > > 1.m is in [1, 2), so log2(1.m) is in [0, 1). (e - 127) is in [-126, > > 127], and integer. That means that all we need to know if we want a > > rounded result, is whether log2(1.m) > 0.5. Which happens if 1.m > > > 2**0.5. Which happens if m > (sqrt(2) - 1). Or, for a 16-bit m as > > integer, if m > 27145. > > > > So, we need one 16-bit comparator and an incrementor. > > > > What did I miss? > > It looks great. In short, floor(log2(f)) is given directly by the > exponent. Your observation on rounding is very nice.
Whoops, what you missed is that the trilinear blend needs the fraction. However, because only 8 bit precision is needed, this can be a straight table lookup. Or it might not even look that horrible to use the mantissa directly. Regards, Daniel _______________________________________________ Open-graphics mailing list [email protected] http://lists.duskglow.com/mailman/listinfo/open-graphics List service provided by Duskglow Consulting, LLC (www.duskglow.com)
