I was messing around with making offscreen buffers when I noticed that the GraphicsEngine section and the API ref doesn’t agree anymore. It seems that the makeGsg function has been removed from GraphicsEngine.
I’m trying to create an offscreen buffer that’s not tied to a window but all the methods that I can find in the API reference seem to require some sort of window. Is there still a way to do it? I’m trying to see if I can tie Panda and PyQt together and make a transparent window with 3d content from the offscreen buffer I’m trying to create.
I’m getting an error with ‘window-type offscreen’. Is this a bug with Panda? I’m on ubuntu running Panda 1.5.2 and this is the output with notify-level at debug:
>>> StdErr: :interrogatedb(debug): Creating interrogate database
:interrogatedb(debug): Got interrogate data for module libexpress
StdErr: :interrogatedb(debug): Got interrogate data for module libdownloader
StdErr: :interrogatedb(debug): Got interrogate data for module libpnmtext
StdErr: :interrogatedb(debug): Got interrogate data for module libvrpn
:interrogatedb(debug): Got interrogate data for module libnativenet
:interrogatedb(debug): Got interrogate data for module libnet
:interrogatedb(debug): Got interrogate data for module libpgui
:interrogatedb(debug): Got interrogate data for module libaudio
:interrogatedb(debug): Got interrogate data for module libputil
:interrogatedb(debug): Got interrogate data for module liblerp
:interrogatedb(debug): Got interrogate data for module libtform
:interrogatedb(debug): Got interrogate data for module libtext
:interrogatedb(debug): Got interrogate data for module libpnmimage
:pnmimage:png(debug): PNG version 10215
:pnmimage:tiff(debug): LIBTIFF, Version 3.8.2
Copyright (c) 1988-1996 Sam Leffler
Copyright (c) 1991-1996 Silicon Graphics, Inc.
:interrogatedb(debug): Got interrogate data for module libparametrics
:interrogatedb(debug): Got interrogate data for module libmathutil
:interrogatedb(debug): Got interrogate data for module liblinmath
:interrogatedb(debug): Got interrogate data for module libgsgbase
:interrogatedb(debug): Got interrogate data for module libgobj
:interrogatedb(debug): Got interrogate data for module libevent
:interrogatedb(debug): Got interrogate data for module libpipeline
:interrogatedb(debug): Got interrogate data for module libdisplay
:interrogatedb(debug): Got interrogate data for module libdgraph
:interrogatedb(debug): Got interrogate data for module libdevice
:interrogatedb(debug): Got interrogate data for module libcollide
:interrogatedb(debug): Got interrogate data for module libchar
:interrogatedb(debug): Got interrogate data for module libpstatclient
:interrogatedb(debug): Got interrogate data for module libchan
:interrogatedb(debug): Got interrogate data for module libgrutil
:interrogatedb(debug): Got interrogate data for module libmovies
:interrogatedb(debug): Got interrogate data for module libpgraph
:interrogatedb(debug): Got interrogate data for module librecorder
StdErr: :interrogatedb(debug): Got interrogate data for module libparticlesystem
:interrogatedb(debug): Got interrogate data for module libphysics
StdErr: :interrogatedb(debug): Got interrogate data for module libeffects
:interrogatedb(debug): Got interrogate data for module libdistort
:interrogatedb(debug): Got interrogate data for module libdistributed
:interrogatedb(debug): Got interrogate data for module libinterval
:interrogatedb(debug): Got interrogate data for module libdeadrec
:interrogatedb(debug): Got interrogate data for module libshowbase
:interrogatedb(debug): Got interrogate data for module libdcparser
StdErr: :interrogatedb(debug): Got interrogate data for module libskel
StdErr: :interrogatedb(debug): Got interrogate data for module libegg
StdErr: :interrogatedb(debug): Got interrogate data for module libegg2pg
DirectStart: Starting the game.
StdErr: :pgraph(debug): Constructing 0x86b6fbc, hidden
:pgraph(debug): Constructing 0x8712594, render
:pgraph(debug): Constructing 0x871282c, render2d
:pgraph(debug): Constructing 0x8712d8c, aspect2d
:pgraph(debug): Constructing 0x871314c, a2dBackground
:pgraph(debug): Constructing 0x8713234, a2dTopCenter
:pgraph(debug): Constructing 0x871331c, a2dBottomCenter
:pgraph(debug): Constructing 0x8713444, a2dLeftCenter
:pgraph(debug): Constructing 0x871356c, a2dRightCenter
:pgraph(debug): Constructing 0x87136c4, a2dTopLeft
:pgraph(debug): Constructing 0x87137dc, a2dTopRight
:pgraph(debug): Constructing 0x8713904, a2dBottomLeft
:pgraph(debug): Constructing 0x8713a2c, a2dBottomRight
:pgraph(debug): Constructing 0x8713cfc, dataRoot
:pgraph(debug): Constructing 0x8713e14, dataUnused
:pgraph(debug): Constructing 0x871409c, render2dp
:pgraph(debug): Constructing 0x871427c, aspect2dp
:pgraph(debug): Constructing 0x87143b4, a2dpTopCenter
:pgraph(debug): Constructing 0x871449c, a2dpBottomCenter
:pgraph(debug): Constructing 0x87145a4, a2dpLeftCenter
:pgraph(debug): Constructing 0x87146c4, a2dpRightCenter
:pgraph(debug): Constructing 0x87147ec, a2dpTopLeft
:pgraph(debug): Constructing 0x8714944, a2dpTopRight
:pgraph(debug): Constructing 0x8714a5c, a2dpBottomLeft
:pgraph(debug): Constructing 0x8714b84, a2dpBottomRight
:display: loading display module: libpandagl.so
Warning: DirectNotify: category 'Interval' already exists
StdErr: Known pipe types:
glxGraphicsPipe
(all display modules loaded.)
:05-24-2008 19:06:53 ShowBase(warning): Unable to open 'offscreen' window.
>>>
I’ve also tried it out on windows with 1.4.2 and it dies when it tries to create the window with DirectX.
I think I’m going to have to use window-type none and just create the offscreen buffer myself but it would be a whole lot easier if window-type none just worked since I won’t be messing about with reparenting models to the other buffer.
The offscreen buffer code in Panda3D has recently become a little less stable. On some graphics cards and platforms, it doesn’t appear to be possible to create only an offscreen buffer without a window. Which OS are you using, and which graphics card? In what way does the buffer creation attempt fail, precisely?
You can try experimenting with the buffer requirements–the depth bits, alpha bits, and so on. If you’re on Windows, you can also try experimenting with pandadx8 or pandadx9. Or, if visual quality is not important to you, you can use tinydisplay, which certainly does work offscreen.
I’m using Ubuntu 10.04, ATI Radeon HD 3400, Panda3d 1.7.
It fails by returning a None to self.buffer (the line before the assert).
Also, I can set up offscreen buffers (ie. makeOutput() with the optional Gsg and Win arguments) but Gsg and Win must be associated with an onscreen window.
Thanks a lot for the quick reply, and any help you can give!
I’m hitting this bug on Ubuntu 11.10 using 1.8.0 and also latest CVS.
Here’s my test script:
from panda3d.core import loadPrcFileData
loadPrcFileData("", "window-type offscreen")
import direct.directbase.DirectStart
run()
I did a debug build and stepping through the code in gdb, glxGraphicsPipe::make_output is successfully returning a glxGraphicsBuffer, but glxGraphicsBuffer::open_buffer is not creating the pbuffer due to an incorrect check. Patch attached.
RCS file: /cvsroot/panda3d/panda/src/glxdisplay/glxGraphicsBuffer.cxx,v
retrieving revision 1.31
diff -u -r1.31 glxGraphicsBuffer.cxx
--- panda/src/glxdisplay/glxGraphicsBuffer.cxx 4 Oct 2011 18:05:10 -0000 1.31
+++ panda/src/glxdisplay/glxGraphicsBuffer.cxx 25 Apr 2012 15:50:58 -0000
@@ -187,7 +187,7 @@
}
}
- if (glxgsg->_fbconfig == None || glxgsg->_context_has_pbuffer) {
+ if (glxgsg->_fbconfig == None || !glxgsg->_context_has_pbuffer) {
// If we didn't use an fbconfig to create the GSG, or it doesn't
// support buffers, we can't create a PBuffer.
return false;