rama++at++graphics.cis.upenn.edu
Tue, 11 Jul 1995 10:32:48 -0400
The problem I am having is that I am not able to read the zbuffer
correctly. I am using the perfly program as my base. All that I am
trying to do is to read the zbuffer after the scene has been drawn
on the screen. I found that my problem relates to the EarthSky Model.
1) If I set the earthsky mode to PFES_SKY_GRND (as it is set in perfly),
I have no problems. The zbuffer is read correctly.
2) If I set the earthsky mode to PFES_FAST, then the zbuffer just has
one constant value, ff00000, which is obviously wrong.
3) I do not want to use a earth sky model in my application. But, if
I do not create a earthsky model, the zbuffer again reads only one
constant value.
I tried to see the differences using gldebug, but was not very
successful. So I would greatly appreciate it if somebody could
explain to me as to what is going on and help me overcome my problem
I use the following code to read the depth map:
PreDraw(chan, data); /* e.g. - clear the viewport */
drawmode(NORMALDRAW);
multisample(FALSE);
zclear();
zbuffer(TRUE);
zfunction(ZF_ALWAYS);
pixmode(PM_ZDATA,1);
readsource(SRC_ZBUFFER);
pfDraw(); /* Render the frame */
pixmode(PM_ZDATA,1); /* to ensure that pfDraw hasnt messed it */
readsource(SRC_ZBUFFER); /* " " " */
lrectread((short)xorg,(short)yorg,(short)xorg+xsize,(short)yorg+ysize,smap);
PostDraw(chan,data);
Thanks
Rama
---------------------------------------------------------------------
Rama Bindiganavale
rama++at++graphics.cis.upenn.edu
http://www.cis.upenn.edu/~rama/home.html
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:39 PDT