Daniel Phillips wrote:
On Tuesday 01 February 2005 11:54, Timothy Miller wrote:

I've decided that I'm going to add the Z into the rasterizer.


I hope it's only a temporary decision. The payoff for working out all the little problems with using W instead of Z is pretty big. If there's an extra interpolant in the pipeline I'd far rather see it used for, say, color or alpha than Z.

It's either permanent or it doesn't go in at all. As long as there isn't a fixed relationship between Z and W, they must be computed separately.



Have you thought about what to do when the number of interpolants required for a particular render state exceeds the number that can be practically hard coded?

Well, some things can be iterated. For instance, texture coordinates can be computed sequentially because there's only one texture unit. (It loops.)


We will reach a point where we have to start making sacrifices. But now is not the time. Yes, people's hopes will be too high, but it's bad to pre-optimize.


The only thing that isn't clear to me is whether I need to store Z
(world) or Z/W (screen coordiates) in the depth buffer.


Normalized device coordinates I think.

Which means "screen Z"?

Correct me if I'm wrong, but "normalized device coordinates" have been projected but not scaled, right?


Therein lies a problem.  Since the reciprocal isn't precise (we use
only 10 mantissa bits when computing it)


Hmm, I thought we had 18 bits of precision readily available. Is this a consequence of using linear interpolation for the divide?

It's a consequence of using a lookup table with only 10 address bits for the reciprocal.



...computing world Z (which is screenZ/(1/W)) would result in an
inaccurate value (not that it'll be all that great to begin with).


So maybe 24 bit floating point is really what we want to store, which slightly complicates the Z compare but makes best use of the limited precision.

We have 25 fb bits, 16 of which are mantissa.


BTW, I think I'm going to go through the model and rename everything
called 'W' to 'M'.  The reason is to eliminate some confusion.  W
will always mean exactly the same thing which is [1+Zworld/d].  Since
we rasterize 1/W, I'll call it M.  Comments?


Yes, cute.


Another thing that I remain confused about is wrt rounding.  If
something is exactly 0.5, do we round up or down?


My guess is that in a perfect world we should round down, but saving a few gates is enough excuse for rounding up. Fortunately it's a FPGA, so there's hardly any penalty for guessing wrong the first time.

Your GUESS? Is there anything which states it definitively?

Another thing that I'm going to change is that the X values are going to be fixed-point. It won't hurt anything (on the contrary!), and it'll make the logic lots simpler. Additionally, it makes it easier to round 0.5 down. It's still more logic but not horribly bad.
_______________________________________________
Open-graphics mailing list
[email protected]
http://lists.duskglow.com/mailman/listinfo/open-graphics
List service provided by Duskglow Consulting, LLC (www.duskglow.com)

Reply via email to