Thread: [PyOpenGL-Users] offscreen rendering problem with glInitFramebufferObjectEXT
Brought to you by:
mcfletch
From: Revaz Y. <yve...@ep...> - 2010-01-21 21:10:38
|
Dear List, I would like to use off-screen rendering with PyOpenGL. According to the few informations I found on the web, one method is to use a FrameBufferObject. Unfortunately, when initializing a new FrameBuffer : from OpenGL.GL.EXT.framebuffer_object import * glInitFramebufferObjectEXT() I get : --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /home/revaz/<ipython console> in <module>() /usr/lib/pymodules/python2.6/OpenGL/raw/GL/EXT/framebuffer_object.pyc in glInitFramebufferObjectEXT() 301 302 303 def glInitFramebufferObjectEXT(): 304 '''Return boolean indicating whether this extension is available''' --> 305 return extensions.hasGLExtension( EXTENSION_NAME ) /usr/lib/pymodules/python2.6/OpenGL/extensions.py in hasGLExtension(specifier) 32 print AVAILABLE_GL_EXTENSIONS 33 if not AVAILABLE_GL_EXTENSIONS: ---> 34 AVAILABLE_GL_EXTENSIONS[:] = glGetString( GL_EXTENSIONS ).split() 35 return specifier in AVAILABLE_GL_EXTENSIONS 36 the problem here is that GL_EXTENSIONS is None ! I'm running linux/ubuntu 9.10, python2.6 and PyOpenGL 3.0.1b1 All other suggestions about using off-screen rendering with PyOpenGL are welcome. Cheers, yves -- (o o) --------------------------------------------oOO--(_)--OOo------- Yves Revaz Laboratory of Astrophysics EPFL Observatoire de Sauverny Tel : ++ 41 22 379 24 28 51. Ch. des Maillettes Fax : ++ 41 22 379 22 05 1290 Sauverny e-mail : Yve...@ep... SWITZERLAND Web : http://www.lunix.ch/revaz/ ---------------------------------------------------------------- |
From: Dan H. <Dan...@no...> - 2010-01-21 21:28:48
|
Revaz Yves wrote: > Dear List, > > I would like to use off-screen rendering with PyOpenGL. > According to the few informations I found on the web, one method is > to use a FrameBufferObject. > > Unfortunately, when initializing a new FrameBuffer : > > from OpenGL.GL.EXT.framebuffer_object import * > glInitFramebufferObjectEXT() > > I get : [error snipped] Have you tried initializing PyOpenGL first? When I try running those two lines of code on a machine that I know has the frame buffer object extension, without initial PyOpenGL first, I get the same error message. In general, I would recommend using the frame buffer object extension for off-screen rendering. There are older techniques like p-buffers, but they're more difficult to use. One downside of frame buffer objects is that some older/cheaper graphics chipset drivers do not support them. Dan |
From: Revaz Y. <yve...@ep...> - 2010-01-21 21:41:18
|
Dan Helfman wrote: > Revaz Yves wrote: > >> Dear List, >> >> I would like to use off-screen rendering with PyOpenGL. >> According to the few informations I found on the web, one method is >> to use a FrameBufferObject. >> >> Unfortunately, when initializing a new FrameBuffer : >> >> from OpenGL.GL.EXT.framebuffer_object import * >> glInitFramebufferObjectEXT() >> >> I get : >> > > [error snipped] > > Have you tried initializing PyOpenGL first? > > When I try running those two lines of code on a machine that I know has > the frame buffer object extension, without initial PyOpenGL first, I get > the same error message. > ok, fine ! now it works, after a glutInitDisplayMode which initialize OpenGL. But how can I initialize OpenGL without creating a window ? > In general, I would recommend using the frame buffer object extension > for off-screen rendering. ok, so I'm on the right way. Any example will be welcome... Cheers, yves > There are older techniques like p-buffers, but > they're more difficult to use. One downside of frame buffer objects is > that some older/cheaper graphics chipset drivers do not support them. > > Dan > -- (o o) --------------------------------------------oOO--(_)--OOo------- Yves Revaz Laboratory of Astrophysics EPFL Observatoire de Sauverny Tel : ++ 41 22 379 24 28 51. Ch. des Maillettes Fax : ++ 41 22 379 22 05 1290 Sauverny e-mail : Yve...@ep... SWITZERLAND Web : http://www.lunix.ch/revaz/ ---------------------------------------------------------------- |
From: Dan H. <Dan...@no...> - 2010-01-21 21:50:38
|
Revaz Yves wrote: > ok, fine ! now it works, after a > > glutInitDisplayMode > > which initialize OpenGL. > But how can I initialize OpenGL without creating a window ? > >> In general, I would recommend using the frame buffer object extension >> for off-screen rendering. > ok, so I'm on the right way. > Any example will be welcome... The only time I've used the FBO extension is when I've got an OpenGL window open, e.g. for rendering a separate pick buffer so I can tell what the user clicks on. I don't know of a way to initialize GL without a window, although it's certainly possible to initialize GL without using GLUT. You can use wxPython's GLCanvas, for instance. But even GLCanvas expects a parent window. Dan |
From: Revaz Y. <yve...@ep...> - 2010-01-21 21:55:07
|
> > The only time I've used the FBO extension is when I've got an OpenGL > window open, e.g. for rendering a separate pick buffer so I can tell > what the user clicks on. I don't know of a way to initialize GL without > a window, ok, maybe it's not so important... however I expected to run backgound scripts... > although it's certainly possible to initialize GL without > using GLUT. You can use wxPython's GLCanvas, for instance. But even > GLCanvas expects a parent window. > sure, well, anyway, thanks for your precious help. yves > Dan > -- (o o) --------------------------------------------oOO--(_)--OOo------- Yves Revaz Laboratory of Astrophysics EPFL Observatoire de Sauverny Tel : ++ 41 22 379 24 28 51. Ch. des Maillettes Fax : ++ 41 22 379 22 05 1290 Sauverny e-mail : Yve...@ep... SWITZERLAND Web : http://www.lunix.ch/revaz/ ---------------------------------------------------------------- |
From: Dan H. <Dan...@no...> - 2010-01-21 22:21:55
|
Revaz Yves wrote: > >> >> The only time I've used the FBO extension is when I've got an OpenGL >> window open, e.g. for rendering a separate pick buffer so I can tell >> what the user clicks on. I don't know of a way to initialize GL >> without a window, > ok, maybe it's not so important... however I expected to run backgound > scripts... FYI: http://stackoverflow.com/questions/576896/can-you-create-opengl-context-without-opening-a-window Dan |
From: Revaz Y. <yve...@ep...> - 2010-01-22 01:05:15
|
Ok, I've found nice solutions to my problem: - with glut, to avoid to display a window simply use glutHideWindow :-[ : glutCreateWindow("my window") glutHideWindow() - simple and good examples about offscreen rendering using FrameBuffer and Renderbuffer can be found here: http://www.opengl.org/wiki/GL_EXT_framebuffer_object Cheers, yves Dan Helfman wrote: > Revaz Yves wrote: > >>> The only time I've used the FBO extension is when I've got an OpenGL >>> window open, e.g. for rendering a separate pick buffer so I can tell >>> what the user clicks on. I don't know of a way to initialize GL >>> without a window, >>> >> ok, maybe it's not so important... however I expected to run backgound >> scripts... >> > > FYI: > > http://stackoverflow.com/questions/576896/can-you-create-opengl-context-without-opening-a-window > > Dan > -- (o o) --------------------------------------------oOO--(_)--OOo------- Yves Revaz Laboratory of Astrophysics EPFL Observatoire de Sauverny Tel : ++ 41 22 379 24 28 51. Ch. des Maillettes Fax : ++ 41 22 379 22 05 1290 Sauverny e-mail : Yve...@ep... SWITZERLAND Web : http://www.lunix.ch/revaz/ ---------------------------------------------------------------- |