On Fri, 4 Feb 2005 18:28:42 +0100, Nicolai Haehnle <[EMAIL PROTECTED]> wrote: > On Friday 04 February 2005 17:10, Timothy Miller wrote: > > I've been coding the adder I'm working on to have a true zero. Logic > > detects that the exponent is zero (meaning something like 2^-127, I > > think) and doing the appropriate thing to make it a true zero. > > > > But I'm wondering if I can't just do away with that. 2^-127 is so > > small that any time it gets converted to integer or added to a larger > > number, it really does become zero. In fact, I'm not sure I can come > > up with a situation where not explicitly making that zero does any > > harm. > > > > Comments? > > At the moment no, other than pointing out that while OpenGL is very lax when > it comes to specifying floating point precision, with one exception: It is > always pointed out quite clearly that operations involving 0.0 and 1.0 > should be precise. > Now since the chip won't be fully programmable in the shader sense, this > hack alone might not be too problematic as long as you're very careful. > > > One simplification I've already done is to not account for overflow or > > underflow. If the exponent goes below 0 or greater than 255, it > > wraps. Is it reasonable to just hope that no one uses numbers that > > big or that small? > > Wrapping overflow is probably unproblematic, but I'm worried about underflow > - even more so when you make 0 a really, really small number instead of > true 0. What happens when, in the rasterizer, R, dRdY and dRdX are all 0? > Will the adjust code in HorizontalRasterize work correctly?
That would be an interesting scenario. You'd accumulate error in the range of less than 2^-120. When converting that directly to integer, it wouldn't be a problem, but if you were to multiply by a huge number, the result could be problematic. I think this could be a bigger issue with coordinates at zero. Fortunately, zero is smack between two pixel centers, so it would never cause a rounding problem. 0.5 would never be affected by this. I have the nagging feeling that this could cause a problem somewhere that would be noticable, but I just can't come up with a really good example of one. _______________________________________________ Open-graphics mailing list [email protected] http://lists.duskglow.com/mailman/listinfo/open-graphics List service provided by Duskglow Consulting, LLC (www.duskglow.com)
