Hey all,
I’m trying to get a depth buffer from an alternate orthographic camera in my scene. I eventually want to pass this information into a shader so I can get an offset of how far something has sunk below a piece of terrain. My issue so far has been with the depth buffer of that camera.
What I believe is happening is I’m not getting a high enough bit depth from the depth buffer of that camera so instead of a gradient I’m getting basically black and white. Here’s my code…
props = FrameBufferProperties()
props.setDepthBits(1)
self.bladeDepthTexture = Texture()
self.bladeDepthTexture.setFormat( Texture.FDepthComponent )
self.bladeDepthTexture.setComponentType( Texture.TFloat )
self.bladeDepthBuffer = base.win.makeTextureBuffer("Blade Depth Buffer", 1024, 1024, tex = self.bladeDepthTexture, to_ram = False, fbp = props)
self.bladeDepthCam = base.makeCamera(self.bladeDepthBuffer)
self.bladeDepthCam.node().setScene(render)
If I change my texture component type to anything like FDepthComponent16 (or anything other than FDepthComponent) I get a standard RGB color image in my buffer rather than black and white values. Hope my explanation makes some sense. Thanks
EDIT: I also get a glgsg error everytime :display:gsg:glgsg(error): c:\panda_source\panda3d\panda\src\glstuff\glGraphicsBuffer_src.cxx, line 991: GL error 1282
I think it’s unsupported operation…trouble is I don’t which operation is unsupported.
~Andrew