home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / graphics / 12811 < prev    next >
Encoding:
Internet Message Format  |  1992-12-12  |  1.8 KB

  1. Path: sparky!uunet!gatech!prism!gg10
  2. From: gg10@prism.gatech.EDU (GALLOWAY)
  3. Newsgroups: comp.graphics
  4. Subject: Z Buffer Precision and Homogeneous Coordinates
  5. Message-ID: <78173@hydra.gatech.EDU>
  6. Date: 12 Dec 92 18:16:42 GMT
  7. Organization: Georgia Institute of Technology
  8. Lines: 42
  9.  
  10.  
  11. I have written a Z-buffer renderer and now a scanline Z-buffer one.
  12. But after going back and reading several new books on the subject, I
  13. find myself confused about the scaling of Z values as part of the viewing
  14. transformation pipeline.  In the new book by Alan Watt and Mark Watt,
  15. "Advanced Animation and Rendering Techniques, Theory and Practice", they
  16. reference Newman and Sproull and say that:
  17.  
  18.                       B
  19.     Z(screen) = A + ------
  20.                     Z(eye)
  21.  
  22. where A and B are constants.  And that this is done so that "in moving
  23. from eye space to screen space, lines transform into lines and planes
  24. transform into planes."  The depth value gets normalized from the range
  25. [near, far] to [0, 1].
  26.  
  27. If the viewing transformation matrix consists of only linear operations,
  28. translation, rotation, and scaling, then this appears to degrade the
  29. precision of the depth value.  In my current Z buffer-based renderer my
  30. Z buffer is an array of 32 bit floats.  I preform clipping in the 3D view
  31. space (or eye space) before perspective projection.
  32.  
  33. My questions are:
  34.  
  35. a) Why do software (non-hardware) Z buffers normalize the depth value?
  36.    Why not just keep around a float and compare floats?
  37.  
  38. b) Are most Z buffers integerized as well?  How many bits?
  39.    What is the advantage?
  40.  
  41. c) When is the correct time to clip?  And are homogeneous coordinates
  42.    necessary if you are not current rendering NURBs?
  43.    For most surface, except NURBs, W is always 1 anyway, right?
  44.  
  45. Thanks,
  46.  
  47. Greg Galloway
  48. gg10@prism.gatech.edu
  49.  
  50. P.S. Watt's book is excellent and I highly recommend finding a copy.
  51.  
  52.