home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / sgi / 13037 < prev    next >
Encoding:
Text File  |  1992-08-29  |  1.7 KB  |  57 lines

  1. Newsgroups: comp.sys.sgi
  2. Path: sparky!uunet!sun-barr!cs.utexas.edu!torn!skule.ecf!xiaoyan
  3. From: xiaoyan@ecf.toronto.edu (XIAO Yan)
  4. Subject: GL puzzle: zbuffer madness
  5. Message-ID: <Btr71r.412@ecf.toronto.edu>
  6. Keywords:  zbuffer, swapbuffers
  7. Organization: University of Toronto, Engineering Computing Facility
  8. Date: Sat, 29 Aug 1992 16:27:26 GMT
  9. Lines: 46
  10.  
  11. Here is a GL puzzle that really puzzles us (days of debugging but
  12. still little clue what happens).  We hypothesise that, zbuffering
  13. does not work well if a drawing continue after a buffer swapping.
  14. But the manual does not say anything about this.  Hope you GL
  15. expert can shine some light on this:
  16.  
  17. When we use this sequence, it works (I'll give criterion later):
  18.     while (1) {
  19.         clear();
  20.         zclear();
  21.         for (i=0;i<10;i++)
  22.             draw_thousand_labels (i, eye);
  23.         swapbuffers();
  24.         eye = !eye;
  25.     }
  26. Now we use this sequence, it does not work (again, see the criterion later)
  27.     while (1) {
  28.         clear();
  29.         zclear();
  30.         for (i=0;i<10;i++) {
  31.             draw_thousand_labels (i, eye);
  32.             eye = !eye;
  33.             swapbuffers();
  34.             draw_thousand_labels (i, eye);
  35.             eye = !eye;
  36.             swapbuffers();
  37.         }
  38.     }
  39. (The reason of trying this sequence is to allow viewer to see
  40.  what's going on with as little delay as possible).
  41.  
  42. Criterion: using a pair shutter goggles, we can see what each buffer
  43. is displaying.  In case I, the scene is shown as expected.  But in
  44. case II, some of the labels that are partly occluded by some other
  45. invisible lables (looking through the goggles). 
  46.  
  47. We are thinking these possibilities:
  48.     1. after swapbuffers(), the zbuffer forgets about previous contents
  49.     2. two buffers share the same zbuffer
  50.     3. there are some tricky in using zclear() (or czclear()) which
  51.        are unknown to us.
  52.  
  53. Thanks for any response or advice.
  54.  
  55. Xiao
  56. <xiaoyan@bullet.ecf>
  57.