Not logged in, Join Here! or Log In Below:

Home / 3D Theory & Graphics / division vs multiplication , silcon area, latency, energy  Account Manager 

Am I right, 

What kind of multiplication do you mean ? Integer or float ? 

Thank you. The sleepless nights have come to an end. :P 

It all depends on the ALU design. Traditionally, division has been considered slower in most systems. Nowadays, I do not think it is still true. I would not bother about it unless I were coding for a really slow CPU or embedded system. 

Well, on X86 CPUs, it definitely is true (both integer and float). 

Division is certainly slower on today's systems. Try to avoid it where possible. 

The compiler will probably not do this when using floating point... 

>What kind of multiplication do you mean ? Integer or float ? 

Arne Rosenfeldt wrote:
>
This thread is related to perspective correct texture mapping. No const there. I think quake 1 used an inversed zbuffer to avoid division later in the shading process. 

Oh, I did a mistake: 

First, multiplication is not completely parallelizable either (at least not with multiplication algorithms you'd use for relatively small numbers, such as 

As Scali correctly noted, the above is not true. The US Army even had their Patriot missiles fail, since their programmers incorrectly assumed that n/10 == n*.1 ... 

>completely parallelizable 

Some more: 

>http://historical.ncstrl.org/litesitedata/stan/CSLTR93554.pdf 

Why not the triedandtested method of scanline subdivision? 

linear 

Erm, is it me, or is your reply completely unrelated to what I said? 

You: "for every 16th pixel" 

You: "for every 16th pixel"
Me: "Most triangles are smaller than 16 pixel" Then you have bigger problems than perspective, I'd say. Anyway, scanline subdivision can work for any span of pixels ofcourse. And it could also be implemented vertically, but that may be more trouble than it's worth in some cases. You: "linearly interpolate"
Me: "playstation 1", wich always did linearly interpolate PlayStation had bigger problems than linear texturemapping... Like no subpixel/texel correction, no texture filtering, not that many colours, etc. Quake 1/2 in software mode look much better than PSX. They are indistinguishable from proper perspective texturemapping. That's scanline subdivision. You:"In a slightly more complex version you will estimate the amount of perspective correction required, rather than using the fixed value of 16 pixels"
Me: "playstation 1", were triangles at sharp angles get smaller in this direction Yes, but what are you trying to say with that? Triangles at sharp edges always get smaller... Has nothing to do with PSX. That's just how perspective works. 

With SSE, you can get four 1/x approximations per clock cycle. These have a precision of 12 mantissa bits, which can easily be increased to ~24 bit with a NewtonRhapson iteration. 

>but what are you trying to say with that? 

I just use a simple estimation formula that takes the error at the middle of the polygon, given linear interpolation. 

OK, thank you 
