home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sgi
- Path: sparky!uunet!sun-barr!cs.utexas.edu!torn!skule.ecf!xiaoyan
- From: xiaoyan@ecf.toronto.edu (XIAO Yan)
- Subject: GL puzzle: zbuffer madness
- Message-ID: <Btr71r.412@ecf.toronto.edu>
- Keywords: zbuffer, swapbuffers
- Organization: University of Toronto, Engineering Computing Facility
- Date: Sat, 29 Aug 1992 16:27:26 GMT
- Lines: 46
-
- Here is a GL puzzle that really puzzles us (days of debugging but
- still little clue what happens). We hypothesise that, zbuffering
- does not work well if a drawing continue after a buffer swapping.
- But the manual does not say anything about this. Hope you GL
- expert can shine some light on this:
-
- When we use this sequence, it works (I'll give criterion later):
- while (1) {
- clear();
- zclear();
- for (i=0;i<10;i++)
- draw_thousand_labels (i, eye);
- swapbuffers();
- eye = !eye;
- }
- Now we use this sequence, it does not work (again, see the criterion later)
- while (1) {
- clear();
- zclear();
- for (i=0;i<10;i++) {
- draw_thousand_labels (i, eye);
- eye = !eye;
- swapbuffers();
- draw_thousand_labels (i, eye);
- eye = !eye;
- swapbuffers();
- }
- }
- (The reason of trying this sequence is to allow viewer to see
- what's going on with as little delay as possible).
-
- Criterion: using a pair shutter goggles, we can see what each buffer
- is displaying. In case I, the scene is shown as expected. But in
- case II, some of the labels that are partly occluded by some other
- invisible lables (looking through the goggles).
-
- We are thinking these possibilities:
- 1. after swapbuffers(), the zbuffer forgets about previous contents
- 2. two buffers share the same zbuffer
- 3. there are some tricky in using zclear() (or czclear()) which
- are unknown to us.
-
- Thanks for any response or advice.
-
- Xiao
- <xiaoyan@bullet.ecf>
-