Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

102 Neutral

About These_Violent_delights

  • Rank
  1. These_Violent_delights

    Querying the depth buffer

    Thanks for the reply Hodgman, Sadly the d3d9.dll is hash checked by the engine... you don't happen to know of Kegetys do you? :D I will look into copying it onto another buffer and copy it back to the CPU side - thanks! Guy
  2. These_Violent_delights

    Querying the depth buffer

    PLUGIN_EXPORT void WINAPI OnFilledBackBuffer(filledBackBuffer *p, DWORD paramSize) { std::cout << "Locking now" << std::endl; D3DLOCKED_RECT *pLRect; if (SUCCEEDED(p->depthBbuffer->LockRect(pLRect, NULL, D3DLOCK_READONLY))) { std::cout << "Lock successful" << std::endl; p->depthBuffer->UnlockRect(); std::cout << "Unlocked" << std::endl; } else { std::cout << "Failed lock attempt" << std::endl; } } Hello everyone.   I work for a company that is using an old computer game for visualisations. The computer game has an open plugin architecture, but we don't have access to the source code, or ability to input our own shaders etc. Essentially what we want to do is query the depth buffer to get an approximate (we can deduce to a degree) value of the depth per pixel on screen. We want to do this in order to simulate a ladar/lidar scan of an image - much like a drone could potentially do. Through one of the engine callbacks we are given a struct containing two IDirect3DSurface9 pointers, one for the depth buffer and one for the render target. This callback is called once the back buffer has been filled, and is aptly named 'OnFilledBackBuffer'. I am currently attempting to lock the depth buffer via the code above, however this always failed to lock, and then causes a CTD. I suspect this is because the depthBuffer is not lockable... How else should I be doing this? Thanks Guy
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!