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.
1
vote
1answer
141 views
Depth write and depth test in Unity
Scenario: several objects (o1, o2,.., on) have to be rendered with the z test disable, but the z values must be written to the depth buffer. In another pass, some other objects (t1, t2,..., tm) need ...
2
votes
1answer
93 views
Use different values for Depth Test and Depth Write in OpenGL
Is there a way to use something similar to PolygonOffset to make a depth test more permissive (move fragment depth towards eye) but still write the original depth value to the depth buffer? The only ...
5
votes
1answer
189 views
How to pass depth buffer from OGRE to CUDA?
I am using OGRE for rendering some objects. At every frame, I would like to pass the resulting depth buffer to CUDA for running some kernels on it and computing a result.
How can I achieve this? How ...
1
vote
0answers
26 views
Dealing with back to front drawing with alpha blending and z buffer for a list of 2d quads
I'm using depth buffer as a layering system for my 2d render and I have to draw them from back to front to make semi-transparent quads work out. The problem is I have to sort my quads vector based on ...
1
vote
2answers
69 views
How to determine the visibility of a single vertex, given a viewpoint?
I have a 3D triangle mesh, and I want to know, given a viewpoint (defined by a model, view and projection matrix), if a certain vertex is visible or not.
My approach was to render the mesh using ...
0
votes
1answer
28 views
Obtain linear depth values on FBO and deal with small differences
I've a render target on which I have both a color and a depth attachment. In a second pass I need to run a filter whose width depends on the derivative and values of the depth.
Now, if I try, in the ...
0
votes
1answer
28 views
DepthStencilView and alphaBlendState
I have create a 2D game with directx11 and i want to use a depth buffer instead of a painter's algorithm to draw the sprites but i have a problem since i'm not really good with directx 3d programming.
...
2
votes
1answer
50 views
Disable depth testing for only some faces
I have some meshes and I need to be able to draw some part of them without depth test. Is it possible to turn off depth testing from within shader, wo that some parts will be rendered no matter what ...
3
votes
1answer
110 views
Self occluding object and alpha blending
Look at the object I've rendered with my app:
It's the same screen twice, above the original and below I've drawn (by hand :P) the shape of the mesh of one of plant's leaves. You can clearly see ...
1
vote
2answers
76 views
Layer depth problem
I try to create Puzzle JigSaw,and I want to display the selected piece on the first layer, the pieces that are on the original positions(solved) on the last layer and the others on the middle.
I ...
0
votes
1answer
169 views
OpenGL Reconstructing Position from Depth
I know this has been asked a lot of time before but none of those answers fixed my problem.
I try to implement deferred shading and to do so I need to reconstruct the world space position from the ...
0
votes
0answers
45 views
OpenGL - How to use depth checking and alpha blending at the same time? [duplicate]
Suppose I have a semi-transparent object (let's call this "bubble"), a solid object (let's call this "wall"), and the bubble is closer to the camera compared to the wall behind it.
If I draw the ...
6
votes
1answer
214 views
overlapping 3d particles not blending nicely when at the same z
I'm working on a 3d particle emitter. It's going pretty good but I'm still having a problem with triangle sorting.
As you can see in the photos, there are some particles that are not blending ...
1
vote
2answers
201 views
IsoMetric Map draw: sort with Topological Sort, Z-Buffer and anchor point
I'm writing an IsoMetric renderer for my html5 isometric game. The isometric renderer should be able to render objects with floating point coordinates.
DEMO: http://matt93.altervista.org/game/
...
2
votes
1answer
137 views
How to best utilize depth buffer precision
Are there strategies to minimize depth buffer precision problems with hyperbolic depth buffers, such as the ones resulting from perspective projection matrices, or depth buffers in general?
For ...
2
votes
1answer
1k views
Using SpriteBatch with BasicEffects and layerDepth creates negative Z values?
Simply: Why don't all of these sprites draw? What do I need to do to make them draw?
I'm trying to use SpriteBatch.Draw with the layerDepth parameter to help reduce overdrawn. However I can't get it ...
4
votes
1answer
349 views
How do you display non-cutout transparent 2D textures with a depth buffer? (OpenGL)
I've been able to get my 2D renderer to display transparent cutout textures by testing the alpha of a fragment and discarding if it is less than 1 (or any fraction really). The problem is I want to ...
2
votes
0answers
126 views
Best approach to depth streaming via existing codec [closed]
I'm working on a development system (and game) intended for games set mostly in static third-person views. We produce our scenery by CG and photographic techniques. Our background art is rendered ...
0
votes
1answer
75 views
Changing the maxDepth of viewport
Whenever I change the maxDepth of the viewport from 1.0 to say 300.0f (just for kicks), everything on my screen disappears. Why is that? Is there anywhere else I have to account for this change in ...
1
vote
1answer
277 views
How do I copy the depth buffer to CPU memory in Direct3D 9?
I have code in OpenGL that uses glReadPixels to copy the depth buffer to a CPU memory buffer:
glReadPixels(0, 0, w, h, GL_DEPTH_COMPONENT, GL_FLOAT, dbuf);
How do I achieve the same in Direct3D?
I ...
0
votes
1answer
89 views
XNA DepthBias increases performance even when EarlyZ is turned off. Why?
My 3d scene consists of three main polygons:
The first and the second polygons overlap each other (have the same World matrix and use the same geometry), the third one is perpendicular to the first ...
1
vote
1answer
218 views
Why does switching to fullscreen produce this graphical glitch?
I followed this tutorial and things were looking good. However, when switching to Fullscreen from 800x600 using alt-enter, I noticed an error in debug output:
DXGI WARNING: IDXGISwapChain::Present: ...
0
votes
1answer
164 views
Creating a 2D texture array for depth view
Following my question here, I decided to create an 2D texture array for all of my depth screen texture so that I can use them for shadows for all my lights.
I'm having an issue setting it up, I'm ...
0
votes
1answer
216 views
How to print Depth to a Texture2D and then read it in the next pass on a shader in DirectX11
I'm programming a two-pass effect in DirectX 11 (SharpDX). It's supposed to write the depth to a texture in the first pass and then use that texture to extract data on the second one in the pixel ...
2
votes
1answer
548 views
Use depth bias for shadows in deferred shading
We are building a deferred shading engine and we have a problem with shadows.
To add shadows we use two maps: the first one stores the depth of the scene captured by the player's camera and the ...
0
votes
2answers
126 views
Accesing depth buffer from shader
I read this presentation and on 6th slide I found that is not need to use multiple render targets and depth can be taken directly from depth buffer.
From which version of DirectX or OpenGL can be ...
4
votes
1answer
775 views
using heightmap to simulate 3d in an isometric 2d game
I saw a video of an 2.5d engine that used heightmaps to do zbuffering.
Is this hard to do? I have more or less no idea of Opengl(lwjgl) and that stuff.
I could imagine, that you compare each pixel ...
1
vote
0answers
158 views
How do you tell OpenGL ES 2.0 to use a texture as the depth buffer?
I want to render a scene with an outline post processing effect in OpenGL ES 2.0.
First I render all the opaque objects. Then I use a post processing shader
for silhouette detection that uses the ...
2
votes
1answer
292 views
Early Z-test / depth-test in DirectX 11
As a DirectX noob i'm trying to wrap my head around depth buffers and specifically how pixel shaders are called for obscured pixels.
From what i understand, the rasterizer calls the pixel shader for ...
2
votes
2answers
172 views
Direct3D9 depth write without depth test
In OpenGL and Direct3D11 depth write is disabled if depth test is disabled. To enable depth write with out depth test in gl you must enable depth test with depth func always.
OpenGL
Even if the ...
0
votes
0answers
110 views
Depth Test not working properly on Nvidia
So, I send a Development Test of my in-dev game to some friends, and they found out that the Depth Test in OpenGL does not work on Nvidia.
I use my own matrices and sent them to the shader, and at ...
5
votes
1answer
555 views
Slow glReadPixels
I have implemented a lense flare for my game, and it looks great.
The first draft used individual sprites each with its own draw call. This was very slow, so I reengineered it to use a single draw ...
2
votes
2answers
145 views
How scanline rendering finds an intersection with an object
I'm a newbie with graphics and after I read many articles on the web I still don't understand how in rasterizing from a pixel coordinate like (0;0) on the screen the intersection with an object (let's ...
0
votes
1answer
276 views
How to update “dynamicVertexBuffer” correctly with “setdata” on XNA?
I developed a small 3d games xna and uses a "DynamicVertexBuffer" and "DynamicIndexBuffer" to store and draw my vertices. Everything works fine, but my problem is the "Update" function where I update ...
1
vote
2answers
622 views
How to clear a buffer to 1.0 instead of 0.0 in OpenGL?
Using glClear() you can set the buffer specified by the parameter to 0.0. This is useful say if you want pixels not covered by models to be black. Because vec3(0.0, 0.0, 0.0) results in black.
But ...
0
votes
1answer
465 views
Using depth buffer on a sprite
I am following this guide:
http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:tiled_maps
Trying to create a tiled map that also supports multiple layers. The guide says that a way is to use ...
1
vote
1answer
96 views
Drawing sprites messes up my model in XNA4
I have a model which draws correctly in XNA4.
However if I try to add a background image (or any sprite), the rendering of my model is messed up. There are two problems with the rendering
model is ...
0
votes
4answers
1k 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-buffer format that supports 24 bits for ...
0
votes
2answers
450 views
GLSL light coloring blocked surfaces
I have created a very simple lighting shader. It currently only supports point lights, but it lights up surfaces that are completely blocked from the light. I know why, but I want to know how I can ...
-1
votes
1answer
462 views
Why distant objects are being drawn in front of close objects?
I am rendering two cubes in the space using XNA 4.0 and the layering of objects only works from certain angles.
Here is what I see from the front angle (everything ok)
Here is what I see from ...
4
votes
1answer
134 views
Forcing early-z with raytracing
I'm working on a GLSL raytracer, and I need to be able to edit gl_FragDepth in the FS. However, doing so disables early-z culling. The scene is rendered front-to-back and the FS can only push points ...
9
votes
1answer
164 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 ...
3
votes
0answers
277 views
Annoying flickering of vertices and edges (possible z-fighting) [closed]
I'm trying to make a software z-buffer implementation (meaning no DirectX or OpenGL, only a 2D library, SDL to be precise), however, after I generate the z-buffer and proceed with the vertex culling, ...
3
votes
2answers
506 views
Scan-Line Z-Buffering Dilemma
I have a set of vertices in 3D space, and for each I retain the following information:
Its 3D coordinates (x, y, z).
A list of pointers to some of the other vertices with which it's connected by ...
8
votes
1answer
1k views
Depth interpolation for z-buffer, with scanline
I have to write my own software 3d rasterizer, and so far I am able to project my 3d model made of triangles into 2d space:
I rotate, translate and project my points to get a 2d space representation ...
2
votes
0answers
204 views
Get Specific depth values in Kinect (XNA)
I'm currently trying to make a hand / finger tracking with a kinect in XNA. For this, I need to be able to specify the depth range I want my program to render. I've looked about, and I cannot see how ...
1
vote
2answers
307 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.
3
votes
0answers
523 views
Copying render target texture loses all depth [duplicate]
I have a render target RenderTargetScene that holds my scene texture with the scene's depth buffer
rtScene = new RenderTarget2D(
graphicsDevice,
...
0
votes
2answers
116 views
Is it possible to read the frame to be output to the screen from GPU in XNA?
I want my XNA game to do its thing and at the end of the Draw() call read the the frame that is sent to the screen into memory (which in XNA would presumably be a Microsoft.Xna.Framework.Color[]).
Is ...
2
votes
1answer
362 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 ...