Depth buffer stores a depth (z-coordinate) of a rendered pixel of a 3D scene. Depth buffer is used in Z-buffering (management of image depth coordinates). Because of this depth buffer is often called Z-buffer.

learn more… | top users | synonyms

4
votes
1answer
519 views

Can I use the default depth buffer when drawing to FBO?

How to attach default depth buffer to FBO? How to use depth renderbuffer buffer attached to FBO (after drawing to it) as a default depth buffer? Basically I want to use the same depth buffer for both ...
1
vote
2answers
192 views

Direct3D9 application won't write to depth buffer

I've got an application written in D3D9 which will not write any values to the depth buffer, resulting in incorrect values for the depth test. Things I've checked so far: D3DRS_ZENABLE, set to TRUE ...
4
votes
2answers
627 views

How to deal with large depth buffer values due to extreme distances

Alright, this is semi-related to my last question here So I've got an really big coordinate system and need to handle rendering large astral bodies from extreme distances. My current approach ...
2
votes
3answers
2k views

Depth Buffer not working in XNA?

I'm stumped. I have been fighting this for about 2 hours now. Here are the interesting parts of my code: protected override void Update(GameTime gameTime) { // Allows the game to exit if ...
1
vote
1answer
603 views

Why are my scene's depth values not being written to my DepthStencilView?

I'm rendering to a depth map in order to use it as a shader resource view, but when I sample the depth map in my shader, the red component has a value of 1 while all other channels have a value of 0. ...
3
votes
1answer
856 views

Renderbuffer to GLSL shader?

I have a software that performs volume rendering through a raycasting approach. The actual raycasting shader writes the raycasted volume depth into a framebuffer object, through gl_FragDepth, that I ...
4
votes
1answer
617 views

The Depth buffer and Perspective

I'm having trouble understanding the behaviour of my OpenGL program; and in drawing my Z-Buffer out to the screen. It will probably be best to just start with code, here is my GLSL shader: in vec3 ...
3
votes
2answers
2k views

computing gl_FragDepth

I am trying to draw spheres using a billboard, so I have a normal map with a z component that I am sampling in my fragment shader. I just need to add this z component to the depth of my fragment to ...
3
votes
0answers
816 views

Sampling from depth texture causes shader to stop working [closed]

I'm currently having issues with depth textures. When I sample from a depth texture it causes my other samplers to fail. For example, when I set gl_FragColor manually the depth buffer is correct. I ...
2
votes
1answer
440 views

Writing the correct value in the depth buffer when using ray-casting

I am doing a ray-casting in a 3d texture until I hit a correct value. I am doing the ray-casting in a cube and the cube corners are already in world coordinates so I don't have to multiply the ...
3
votes
1answer
840 views

Drawing a depth map properly

I want to render a depth map by importing it from a file, then creating an array of vertices and indices, and then displaying it using a basic shader (just apply the view and projection matrices on it ...
9
votes
2answers
5k views

How do I use depth testing and texture transparency together in my 2.5D world?

Note: I've already found an answer (which I will post after this question) - I was just wondering if I was doing it right, or if there is a better way. I'm making a "2.5D" isometric game using OpenGL ...
1
vote
2answers
842 views

Disabling depth write trashes the frame buffer on some GPUs

I sometimes disable depth buffer writing via glDepthMask(GL_FALSE) during the alpha rendering of a frame. That works perfectly fine on some GPUs (like the Motorola Droid's PowerVR), but on the HTC EVO ...
5
votes
2answers
3k views

In OpenGL Can I Discover the Depth Range of a Depth Buffer?

I am doing a GL multi-pass rendering app for iOS. The first pass renders to a depthbuffer texture. The second pass uses the values in the depth buffer to control the application of a fragment shader. ...
8
votes
4answers
2k views

Shadow Mapping and Transparent Quads

Shadow mapping uses the depth buffer to calculate where shadows should be drawn. My problem is that I'd like some semi transparent textured quads to cast shadows - for example billboarded trees. As ...