深度缓冲区仅显示蓝色
我正在尝试在 RenderMonkey 中实现 Light Prepass 渲染。到目前为止,在法线+深度通道中,法线缓冲区似乎得到了正确的结果,但深度缓冲区仅显示一种颜色。如何检查我的深度缓冲区是否正确? 工作区下载链接:http://www.mediafire.com/?jq3jmantyxw
I'm trying to implement Light Prepass rendering in RenderMonkey. So far, in Normal+Depth pass, it seems like Normal buffer is getting correct result, but Depth buffer only show one color. How can I check if my Depth buffer is correct or not?
Workspace download link: http://www.mediafire.com/?jq3jmantyxw
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
浅蓝色实际上是 RGB 值
0.0, 1.0, 1.0
。由于深度(通常)是代表 Z 的单个通道,因此当从纹理采样时,它会在第一个通道(红色)中返回。缺少的绿色、蓝色和 Alpha 通道将由硬件替换为 1.0。你的下载链接不起作用,因为我怀疑已经有两年了。
您应该确保您的像素着色器同时返回
COLOR0
和COLOR1
语义(请注意,尽管输出是单通道纹理,但深度是float4
) :根据您的相机设置,您可能会得到如下内容:
The light blue is actually RGB values
0.0, 1.0, 1.0
. Since depth is (usually) a single channel representing Z, when sampled from texture it's returned in the first channel, red. Missing channels green, blue and alpha will have 1.0 substituted by the hardware.Your download link is non-functional, since it's been 2 years I suspect.
You should ensure your pixel shader is returning both
COLOR0
andCOLOR1
semantics (note that depth is afloat4
despite the output being a single channel texture):Depending on your camera settings, you could get something like: