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.
173 questions
1
vote
2
answers
532
views
How to render depthmap image in 3d?
I'm new to game development and XNA. I have this depthmap image and I want to render it in 3D, how do I do it, any tutorial or blog post would be helpful.
2
votes
1
answer
639
views
My transparent objects overwrite opaque objects depth and always draw on top?
I have set up an 'Order Independent Transparency' method for drawing my transparent objects.
The algorithm can be simplified as follows:
DrawOpaqueObjects()
DrawTransparentObjects()
Drawing the ...
2
votes
4
answers
7k
views
What is the format of DXGI_FORMAT_D24_UNORM_S8_UINT?
I'm trying to read the values in a depth texture of type DXGI_FORMAT_D24_UNORM_S8_UINT.
I know this means "24 bits for depth, 8 bits for stencil" "A 32-bit z-...
2
votes
1
answer
711
views
Position Reconstruction from Depth by inverting Perspective Projection
I had some trouble reconstructing position from depth sampled from the depth buffer. I use the equivalent of gluPerspective in GLM. The code in GLM is:
...
4
votes
2
answers
728
views
How can I simulate multiple depth channels?
Here's what I'd like to achieve:
Rendering a first pass of objects in my scene, using standard depth comparison
Rendering another pass of objects in the same scene, but with the following rules:
A ...
10
votes
1
answer
229
views
What would be a good filter to create 'magnetic deformers' from a depth map?
In my project, I am creating a system for deforming a highly detailed mesh (clothing) so that it 'fits' a convex mesh.
To do this I use depth maps of the item and the 'hull' to determine at what point ...
4
votes
3
answers
3k
views
When does depth testing happen?
I'm working with 2D sprites - and I want to do 3D style depth testing with them. When writing a pixel shader for them, I get access to the semantic DEPTH0. Would writing to this value help? It seems ...
6
votes
1
answer
7k
views
What are the valid DepthBuffer Texture formats in DirectX 11? And which are also valid for a staging resource?
I am trying to read the contents of the depth buffer into main memory so that my CPU side code can do Some Stuff™ with it.
I am attempting to do this by creating a staging resource which can be read ...
1
vote
1
answer
2k
views
Early Z culling - Ogre
For Ogre experienced people, but also experts in the field:
Early Z culling is sometimes quite desirable, and that's what I tried to do in Ogre by using a two pass material. The first one is writing ...
6
votes
1
answer
2k
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
2
answers
310
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
...
5
votes
2
answers
1k
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
3
answers
4k
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:
...
1
vote
1
answer
2k
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.
...
4
votes
1
answer
3k
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
1
answer
2k
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:
...
4
votes
2
answers
7k
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
16k
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 ...