a technique used in 3D graphics to ensure that only the objects closest to the viewer are drawn in a scene.
Questions tagged [depth-testing]
121 questions
0
votes
2 answers
OpenGL selected depth testing
I'd like to implement an OpenGL scene (OpenGL ES 2.0) in which depth testing is enabled only between selected triangles.
To be more specific: Suppose we have four triangles to render. Depth testing should be enabled between triangles 1 and 2, as…

coolcat29
- 333
- 3
- 9
0
votes
0 answers
LibGDX depth test error
I am doing some basic code in LibGDX and want to render a grid of green spheres, but the depth testing which I set to LEQUAL has an error. The error is it seems to render them back to front like GEQUAL.
Here's a screenshot -…

husawyers
- 1
- 2
0
votes
1 answer
c++ and directx11 Depth Test Not working for few objects scene
I was working on c++ and directx11.. I initiazlized everything correctly.But no matter what i do . The DepthBuffer is not working as expected..
Of the two cubes one cube appears to be transparent from certain angle .And even though the Second Cube…

user3797103
- 39
- 1
- 10
0
votes
0 answers
OpenGL framebuffer depth buffer not working
I am trying to create a framebuffer object with a colour and depth buffer. The colour buffer works fine but the depth buffer does not.
It is unlikely that the problem is in the scene drawing routine, as it works fine when using the default…

IntelOrca
- 108
- 2
- 8
0
votes
2 answers
OpenGL Depth Buffer Behaving Not As Expected
I have been working on the beginnings of an engine for educational pursuit and I've run into an OpenGL concept which I THOUGHT I understood, however I cannot explain the behavior I've been observing. The issue is with the Depth Buffer. Also,…

Mr. Nex
- 233
- 1
- 12
0
votes
1 answer
Opengl failing to depth test properly
I'm was working on a really simple voxel like game, but for some reason OpenGL isn't depth testing properly.
Here's the relevant code:
//Render function:
void display() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
…

nebuch
- 6,475
- 4
- 20
- 39
0
votes
1 answer
shadow maps, woo trick, depth peeling
I'm trying to make a self-shadowed object (opengl/glsl). The steps I did were these:
1- Render the scene from light to obtain a depth map
2- Render from camera position and calculate the distance of each point to the light source, if the distance of…

Matias Morant
- 513
- 2
- 5
- 12
0
votes
1 answer
Regarding channels in Depth textures
I have implemented depth texture and getting different outputs on 2 different drivers.
I am reading all channels in texture() in fragment shader :
“vec4 color = texelFetch(tk_diffuseMap, ivec3(tmp), i);”
In this case I get a red and grey image on…

debonair
- 2,505
- 4
- 33
- 73
0
votes
1 answer
In AGAL, when using the 'kil' opcode, does the DepthTest skip that pixel?
Let's say I was building a game, and had some tilemaps to create the world in several layers.
The view would be orthographic, basically just a top-down view of the world.
I'm thinking of using Depth-Test to compare which sprites gets drawn from top…

chamberlainpi
- 4,854
- 8
- 32
- 63
0
votes
2 answers
Render 2D image (with depth) in OpenGL preserving depth testing
I have an image from an external source (say a software ray tracer) that also has a depth buffer. I want to render that image in an OpenGL scene (which contains several other 3D objects) such that the OpenGL depth buffer is correctly updated, i.e.…

porst17
- 377
- 3
- 16
0
votes
1 answer
glreadpixel gl_depth_component returns 0?
I am looking for a solution to intersection point of a cube and a line. So i used
GLES20.glReadPixels(touchX, touchY, 1, 1, GLES20.GL_DEPTH_COMPONENT, GLES20.GL_FLOAT, zz);
and i showed the zz , but result was 0. so how could i get the depth…

Mungunbat Enkhbayar
- 171
- 2
- 15
0
votes
1 answer
How do I depth-test for a certain range?
What is the most common/simplest/fastest way to depth-test for a certain range?
pass if (currentDepth-offset < newDepth && newDepth < currentDepth)
currentDepth := value in the depth buffer
offset := constant (know at compile-time and for all…

Fabian
- 1,982
- 4
- 25
- 35
-1
votes
1 answer
LWJGL FBOs - Depth Testing Doesn't Work (Simpler code)
When I render to FBO, the depth testing appears to fail, but when I don't it works beautifully. Weirdly, though, on the more complex version (I haven't tested this one), when I tested it on school computers (Not when I should be working of course!…

Superdavo
- 301
- 2
- 8
-2
votes
1 answer
I have a strange problem when trying to blend two overlapping surfaces (same depth)
I have two surfaces.
One as the background (rendered first).
The other as my "canvas" (rendered last).
I found a very strange problem when I tried to use blending to achieve a transparent effect!
Even though I have rendered in the "recommended"…

potter john
- 37
- 7
-2
votes
3 answers
Faster iteration on for loop with 2d arrays
I have a problem with optimization to compute errors for disparity map estimation.
To compute errors I create a class with called methods for each error. I need to iterate for every pixel to get an error.
This arrays are big cause I'm iterating in…

Sagocz
- 5
- 1
- 4