GraphicsPipe.BFResizeable issues

I want a resizable offscreen buffer. If I set the GraphicsPipe.BFResizeable flag, graphicsEngine.makeOutput returns None.

I’d assume this is an issue with what my drivers support, but it seems very odd that I can make lots of offscreen buffers that track the size of a visible window via BFSizeTrackHost, and all the filters work (bloom for example), and I know they resize buffers.

It may be relevant that I have no other buffers (so no host window). I’m only rendering to the offscreen buffer, and copying the image into the wx bitmap for display. Well, currently I’m rendering to an onscreen window, since I can’t make a resizable offscreen one!

Anyone have a suggestion? I could recreate the buffer every time my window is resized, but that seems light it might have some overhead.

Mac, Panda 1.7.2

Can you show the framebuffer properties and the other flags that you used?

Usually, only an FBO is resizable, so you must be using some options that make it refuse an FBO, such as multisampling, accumulation bits, or back buffers.

Here is the relevant code:

        fbprops = FrameBufferProperties.getDefault()

        flags = GraphicsPipe.BFRefuseWindow | GraphicsPipe.BFResizeable
        
        win = self.graphicsEngine.makeOutput(pipe, name, 0, fbprops, props, flags)

I don’t know what “BFFbPropsOptional” does, but I tried including it since showBase does. It does not seem to change anything.

Edit: I tried with props=WindowProperties.getDefault(). No change.

I maybe wrong, but I don’t think there’s anything magical about a FBO that allows it to automatically resize – the underlying engine still has to detach the textures and attach new ones. Thus for all practical purposes it’s just like add and removing textures yourself.

@Craig: what are the default properties for you? (usually they are the ones set in Config.prc). You can just use “print fbprops” to print out the properties.
If you have multisampling enabled in your Config.prc file, that code will fail, because we don’t have proper FBO multisampling support.

@zhao: Right, but Panda is supposed to take care of that. With a pbuffer, though, you need to completely destroy and recreate the buffer if you want to resize it.

the fbprops are:

depth_bits=1 color_bits=1 alpha_bits=1 back_buffers=1

I also tried removing the back_buffers, and it did not help.

window props:

origin=(50, 50) size=(800, 600) title=“Panda” !undecorated !fixed_size !fullscreen open !cursor_hidden absolute

I guess if panda remakes buffers internally when resized, I don’t really lose much by remaking them myself.

What happens if you use an empty set of FramebufferProperties?

No change.