Hello Constantin, On 08/25/10 06:15, Constantin Müller wrote: >> hm, it appears readback was only implemented for color attachments :( The >> attached patch should change it to also handle depth and stencil attachments >> (including combined ones). Can you give it a try and see if it works for >> you, thanks! > > I applied the patch and added > > #define GL_DEPTH_STENCIL_EXT 0x84F9 > #define GL_UNSIGNED_INT_24_8_EXT 0x84FA > #define GL_DEPTH24_STENCIL8_EXT 0x88F0 > #define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 > > to OSGGLEXT.h
> Now I got some invalid enumerant calls. Here is the glTrace: > ... > | glEndList() > | glCallList(1) > | glColorMask(TRUE, TRUE, TRUE, TRUE) > | glDepthFunc(GL_LEQUAL) > | glDepthMask(TRUE) > | glDisable(GL_LIGHTING) > | glDisable(GL_COLOR_MATERIAL) > | glDepthMask(FALSE) > | glDepthMask(TRUE) > | glMatrixMode(GL_PROJECTION) > | glPopMatrix() > | glMatrixMode(GL_MODELVIEW) > | glPopAttrib() > | glReadBuffer(GL_COLOR_ATTACHMENT0_EXT) > | glReadPixels(0, 0, 64, 64, GL_RGB, GL_UNSIGNED_BYTE, 073310A8) > | glReadBuffer(GL_POINTS) > | glGetError() > | glReadBuffer(GL_DEPTH_STENCIL_NV) > W! OpenGL error GL_INVALID_ENUM detected > | glReadPixels(0, 0, 64, 64, GL_UNSIGNED_INT_24_8_NV, > GL_UNSIGNED_BYTE, 00000000) > W! OpenGL error GL_INVALID_OPERATION detected > | glReadBuffer(GL_POINTS) > | glGetError() > | glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0) >> glDepthMask(FALSE) > > I'm wondering why there is an _NV at the end of GL_DEPTH_STENCIL. I guess the constants were originally specified by a vendor (_NV) extension and your GL debugger has those names associated with their numeric value instead of the newer multi vendor (_EXT) names. Your card does support the GL_EXT_packed_depth_stencil extension, right? > Any hint or solution? I have missed a problem with the Image creation in your last mail, sorry - I've never tried reading back or using a packed depth stencil buffer, so this is a learning experience for me. Try this: depthimage = OSG::Image::create(); depthimage->set(GL_DEPTH_STENCIL_EXT, sizex, sizey, 1, 1, 1, 0.0, NULL, GL_UNSIGNED_INT_24_8_EXT); The format has to be DEPTH_STENCIL and the data type is UNSIGNED_INT_24_8 according to this in the glReadPixels call, according to this page in the book "OpenGL Extensions Guide": <http://books.google.com/books?id=VDqw6MK5NJMC&pg=PA345&lpg=PA345&dq=opengl+read+packed+depth+stencil&source=bl&ots=VbZVa8A85P&sig=gkf46Q9UYXp8dSrIlWsMnkIJ7ao&hl=en&ei=yiR1TN6XAoH58AbpxNypBg&sa=X&oi=book_result&ct=result&resnum=8&ved=0CEAQ6AEwBw#v=onepage&q=opengl%20read%20packed%20depth%20stencil&f=false> Cheers, Carsten ------------------------------------------------------------------------------ Sell apps to millions through the Intel(R) Atom(Tm) Developer Program Be part of this innovative community and reach millions of netbook users worldwide. Take advantage of special opportunities to increase revenue and speed time-to-market. Join now, and jumpstart your future. http://p.sf.net/sfu/intel-atom-d2d _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users