Dx9,如何获得depth-buffer surface里面的depth information?

sleepingboy 2003-09-28 05:08:40
SDK文档
ms-help://MS.VSCC.2003/MS.DirectX9.1033/DirectX9_c/directx/graphics/programmingguide/gettingstarted/rendering/depthbuffers/depthbuffers.htm

里面有一句:
The depth-buffer surface that is associated with the render-target surface is used to store depth information that tells Direct3D how deep each visible pixel is in the scene.

我想知道怎样才能拿到那些depth information。
...全文
70 8 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
sleepingboy 2003-10-04
  • 打赏
  • 举报
回复
我再顶
sleepingboy 2003-09-30
  • 打赏
  • 举报
回复
为什么这种方法很慢呢?

我想既然Dx已经有一份数据了,不就可以直接用它的吗?

D3DPRESENTFLAG_LOCKABLE_BACKBUFFER这个参数对DepthStencilSurface也有效的吗?

我试了一下还没成功
bopengbopeng 2003-09-30
  • 打赏
  • 举报
回复
很慢的.
勸你想別的辦法實現你想要的效果吧.
铜戈 2003-09-30
  • 打赏
  • 举报
回复
创建device的时候要使用D3DPRESENTFLAG_LOCKABLE_BACKBUFFER参数参能lock后备缓冲
铜戈 2003-09-30
  • 打赏
  • 举报
回复
GetDepthStencilSurface 方法
sleepingboy 2003-09-29
  • 打赏
  • 举报
回复
我调用IDirect3DSurface::LockRect老是出错
D3DERR_INVALIDCALL

我想读到整个屏幕上的数据,代码要怎样写?
ttmmdd 2003-09-29
  • 打赏
  • 举报
回复
->getrendertarget get the surface
->IDirect3DSurface::LockRect get the data
sleepingboy 2003-09-29
  • 打赏
  • 举报
回复
自顶

8,325

社区成员

发帖
与我相关
我的任务
社区描述
游戏开发相关内容讨论专区
社区管理员
  • 游戏开发
  • 呆呆敲代码的小Y
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧