Read Z-buffer of a device context

Hi all,

How can I read and write to the Z-buffer of a process? If for example, I have a visualization software running, is it possible for me to read (and possibly write) the Z-buffer values using GDI/OpenGL/DirectX?

Thanks,
Atul

This is not quite simple, but doable. You could do something like that with a custom OpenGL library wrapper. You could start with APITrace and modify it do what you need, instead of tracing.

Okay. I’ll give that a shot. Thanks tksuoran :slight_smile:

Best,
Atul

Hi,

As pointed to me by tksuoran, I looked at the codebase of ApiTrace. But I was unable to extract much out of it. I see that all these tracer software use their own OpenGL32.dll, why is that so? Is the dll doing the call intercept? If yes, how do I replicate the same (since the dll is not in a human readable format) ?

Thanks,
Atul