Questions tagged [depth-buffer]
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.
172
questions
4
votes
2
answers
6k
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
1
answer
1k
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 ...
4
votes
1
answer
2k
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 ...
12
votes
2
answers
10k
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 ...
2
votes
2
answers
2k
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 ...
11
votes
2
answers
15k
views
In OpenGL, how 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 depth buffer texture. The second pass uses the values in the depth buffer to control the application of a fragment shader. ...
10
votes
4
answers
5k
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 ...