DirectX question

Started by
1 comment, last by Dmitry Vasilijev 23 years, 9 months ago
Anybody tried to read values directly from ZBuffer surface? I think that it may be very useful for 3D object selection. I tried to use GetDC() and surface pointer but I read only zero values. please help me if you did it...
Advertisement
I''m not sure if you can read directly from the zbuffer, but if you can then just lock the surface, and read the pixels.

*** Triality ***
*** Triality ***
Thanks for answer.

I did it!!!
Simply I forgot to clear DDSURFACEDESC2 before I call IDirectDrawSurface.Lock().
And I''ve surprised that it get not very high perfomance hit.
I lock/UnLock surface to read the Z values near the 10 times per frame and I lose only 3-8 FPS.

This topic is closed to new replies.

Advertisement