Closed Clockwork-Muse closed 3 years ago
My actual use-case only needs RTMBindOrCopy
for the depth texture, it just accidentally ended up being RTMCopyRam
as I was writing stuff.
Thanks for the high-quality bug report as always.
In case 1 the problem is that you're trying to tell OpenGL to copy the depth buffer to a texture while the framebuffer doesn't actually have a depth buffer. As you've seen, the solution is to request depth bits. Panda ought to be catching this and displaying a more appropriate error. The reason that it doesn't happen with RTMBindOrCopy
is that you're providing a depth buffer to render into in that mode (ie. the texture).
I'm afraid I'm not replicating the warning message.
In case 2 the problem is that Panda doesn't currently support storing a combined 32-bit float depth + 8-bit stencil image (which is a bit of an odd and recent feature) in RAM, so it tries to just download the depth component—but because you've bound to RTPDepthStencil
instead of just RTPDepth
, OpenGL displays an error that it can't stuff the entire depth-stencil buffer into just a 32-bit float texture. I think we need to silently change RTPDepthStencil
to RTPDepth
until we support this feature.
Fixed builds available here.
@rdb - Perhaps it's because I'm running this in EGL, and you may have run this with normal OpenGL?
You mean that I'm not replicating the warning? I doubt it, I just added load-display p3headlessgl
to force EGL and I still don't get a warning.
But, I just realised, you actually meant "making both changes", whereas I understood you meant "adding both set_depth_bits and set_stencil_bits". I still can't reproduce it then on my laptop, but I can reproduce it on my desktop which has an NVIDIA card.
It is a mystery to me why though. I can see in the GL trace produced by apitrace that it's passing the same GL_DEPTH_STENCIL
texture to both depth and stencil attachments.
Description
Some of this may be misunderstanding what, exactly, needs to be specified when creating offscreen buffers.
Case 1
This ends up generating lines filled with
:display:gsg:glgsg(error): GL_INVALID_OPERATION error generated. Drawable does not have depth buffer.
.The errors can be fixed by:
GraphicsOutput.RTMBindOrCopy
OR
props.set_depth_bits(24)
orprops.set_stencil_bits(8)
Adding both yields a single line with
:display:gsg:glgsg(warning): Framebuffer unsupported. Framebuffer object some buffer is unsupported because the depth and stencil attachments are mismatched.
Case 2
This will generate lines of
:display:gsg:glgsg(error): GL_INVALID_ENUM error generated. <type> enum is invalid.
This can be fixed by setting
props.set_float_depth(True)
toprops.set_float_depth(False)
Environment