🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Depth in Depth buffer texture is always 1

Started by
3 comments, last by emil0 3 years, 3 months ago

As you can see in the image, the D component is one, despite it being black, my cursor is at a black area in the texture but the depth value is always one no matter where I look.

I am writing the depth to a texture, this is from debugging the output merger.

I have no idea why it always returns 1 no matter what pixel I'm looking at.

Any help would be very appreciated.

I should also say that I'm rendering from the camera's perspective, I have another depth texture from a light source perspective, and that one works, it has different values over the black areas. I'm using the same texture types.

Advertisement

How are you reading the value of actual sample from the texture.

@JohnnyCode I just do tex.Load() the image is from the graphics debugger, but it's the same when I'm loading in the hlsl file, it always reads 1.

I think I solved it, Instead of loading, I sampled, using float values instead of integers, then I made the depth linear which in return gave me correct values.

This topic is closed to new replies.

Advertisement