Re: [PyOpenGL-Users] Reading Depth Component - not working anymore?
Brought to you by:
mcfletch
From: Hart's A. <bha...@ya...> - 2007-12-28 19:32:46
|
--- "Mike C. Fletcher" <mcf...@vr...> wrote: > Hart's Antler wrote: > > I am using the latest pyopengl (ctypes based) release for Ubuntu Gusty. I am unable to read > the > > zbuffer using glreadpixels GL_DEPTH_COMPONENT, my function had worked before with the much > older > > pyopengl2.x series. I'm not sure if this is a bug in new ctypes-pyopengl or is it my ATI > drivers > > not supporting that feature. I'm wondering if anybody has had any luck doing this? One note > is > > that i can read the zbuffer directly into a texture (for shadows) with no problem using > glCopyTexSub2d. > > > If you can send me a sample script that demonstrates the problem I can > far more easily fix the bug. It does sound like a bug, incidentally. > The image handling code is completely rewritten, so it's not unlikely > there would be differences between the old and new implementations. > i dont have a stripped down example, but the code is just 3 lines you can insert into any pyopengl demo. data = glReadPixels(0,0,x,y, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE) # note x,y are screen size img = Image.fromstring( 'L', (x,y), data ) # requires PIL img.save( 'z.bmp' ) # when you open z.bmp you will find that it is blank - all white. ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping |