Hey everyone,
Is it possible to read the full precision zbuffer data from Panda3d? I tried using addRenderTexture to render depth to a texture, but the resulting texture only has 1 byte of precision. Can I get the full precision data out somehow?
Are you saying you want to read it in a shader or export it to a file? Getting full depth in a shader is definitely possible. Check out out the fireflies demo.
I’d like to read the values out to a file. I have been working off of the fireflies demo in fact. I create a new buffer using the same FBO code, bind the buffer to an FDepthComponent Texture with RTMCopyRam. When I trigger a breakpoint and print the texture, it tells me it only has 1 byte width, and the size of the texture suggest there is only 1 byte per pixel.
Is this an artifact of RTMCopyRam? How else would I be able to send the depth information back to the host ram?
Ah I see… getting the full depth to a file is not implemented in any way right now. At least not since i last checked.
However, I have gotten greater than 8bit’s of data out of the graphics card in the past by encoding into a rgb texture. I basically write a shader where the I store the least to most significant bytes in R, G, B respectively as a 24 bit integer. Then I just do a regular screen grab.
It’s a bit hacky but it works.