Re: [PyOpenGL-Users] bug in glDrawBuffers?
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@vr...> - 2009-02-17 23:05:12
|
Gijs wrote: > Hello List, > > I am trying to use glDrawBuffers to render to multiple textures using > shaders. However, I'm running into a problem (otherwise I wouldn't be > posting here ofcourse :) ). When I call glDrawBuffers with *any* > buffer-type, it fails with the following error: > Can you add this to tests/test.py and then alter it with fragments of your usage/code until it shows your error: def test_glDrawBuffers_list_valid( self ): """Test that glDrawBuffers with list argument where value is set""" fbo = glGenFramebuffersEXT(1) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo) try: img1,img2 = glGenTextures(2) for img in img1,img2: glBindTexture( GL_TEXTURE_2D, img ) glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB8, 300, 300, 0, GL_RGB, GL_INT, None # no data transferred ) glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, img1, 0 ) glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_TEXTURE_2D, img2, 0 ) drawingBuffers = [ GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT1_EXT, ] glDrawBuffers(2, drawingBuffers ) finally: glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, 0 ) then send back the error-ing version so that I can look into what's going wrong without having to guess too much? > Hope someone knows what's going on under the hood. > I *think* this should be working, I haven't had time to sit down and do shadow-casting myself, so I don't have any real-world code to test it. The code is pretty much just passing your values off to the C code, so there's not a lot under the hood that's PyOpenGL specific. HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |