On Jul 20, 10:38 am, nat...@[EMAIL PROTECTED]
(Nathan Mates) wrote:
> In article <1184919096.449489.42...@[EMAIL PROTECTED]
>,
>
> <b...@[EMAIL PROTECTED]
> wrote:
> >I am writing a software renderer that rasterizes 3d triangles. I was
> >wondering if anyone out there who has already done this was able to
> >realize any performance benefits from using fixed point numbers
> >instead of floating points. I tried fixed points, but they were
> >slower than floating points.
>
> It used to be that floating point sup****t was either (1)
> nonexistant, or (2) really slow. Ever since about the Pentium 1/2 &
> Athlon era, floating point units on CPUs have been first-class
> members, receiving a lot of design attention. Modern CPUs work fastest
> when both their integer *and* floating point units are engaged at the
> same time, because they're inherently parallel. (They also get the
> hottest and consume the most power in such cases.)
>
> Unless you're very good with fixed point, or targeting
> embedded/****table systems, my recommendation is to stick with floating
> point for now. Then again, just about any modern (~2002 or later)
> hardware rasterization is going to blow your software rasterizer out
> of the water.
>
> Nathan Mates
I don't know if this is useful to the OP, but, in 2000-2002 I wrote a
"lightweight" 3D data visualizer for sonar (bathymetry) data. This was
a DARPA funded project. It visualizes terrain maps on-the-fly, and
lets you "fly through" them. It was required to be useful on any
laptop w/Win2k or newer, with datasets up to four million points. I
wrote it in OpenGL, Visual C++, and the std lib. I put most of my
effort into culling and low-res display routines... and applicable to
your question, my application performed best when I fed OpenGL data
(triangles in strips) in floating point format, scaled between 0.0 and
1.0. That was the natural match for the Pentiums (& AMDs, for that
matter).


|