Hi all,
Another tip mainly for new and new-ish Panda users. Documenting this to make it easy to find by a web search, just in case someone else runs into the same problem.
On the forums, over the years at least two approaches to creating texture buffers have been posted. This one-liner seems to be the currently (1.8.1) preferred way to create texture buffers:
buf = base.win.makeTextureBuffer("MyNameForThisBuffer",
base.win.getXSize(),
base.win.getYSize())
This works fine on both ATI (yes, it’s old) and Intel (tested in a laptop with Ironlake Mobile).
The following, probably older, snippet works on ATI, but does NOT work on Intel:
fbp = FrameBufferProperties(base.win.getFbProperties())
wsx = base.win.getXSize()
wsy = base.win.getYSize()
wp = WindowProperties()
wp.setSize(wsx, wsy)
texture = Texture()
buf = base.graphicsEngine.makeOutput(
pipe=base.win.getPipe(), name="buffer", sort=-100, fb_prop=fbp, win_prop=wp,
flags=GraphicsPipe.BFRefuseWindow, gsg=base.win.getGsg(), host=base.win)
buf.addRenderTexture(texture, GraphicsOutput.RTMBindOrCopy)
Trying to run the latter on my laptop with the Intel chip, Panda prints into the terminal window a screenful of copies of the error message
:display:x11display(error): BadMatch (invalid parameter attributes)
and the render window remains blank.
In conclusion: use the first approach, it’s more compatible across different hardware configurations.
EDIT: as rdb notes below, it’s not inherently more compatible, but it is a bad idea to copy frame buffer properties from the window, as for example windows are usually double-buffered, while double-buffering makes no sense for a buffer.