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
1
vote
1 answer
Understanding Depth_Test opengl
I am newbie to opengl,and i have difficulties to learn depth test in opengl..Can someone explain me what is DEPTH_TEST?I am reading my literature where it says:
"It enables hiding objects which are covered by some other
object(hiding by depth).If…

slomil
- 193
- 1
- 4
- 12
1
vote
1 answer
How to enable/disable DepthMask in Metal iOS
I am trying to use Metal to display some 3D objects with complex alpha.
I am getting white edge in same object to object alpha blending. But in different object is working fine.
I had solved this issue in Android by disabling depthMask within one…

Sarbartha Sengupta
- 316
- 1
- 4
- 11
1
vote
0 answers
How to enable depth test with QOpenGLWidget? It renders black screen
Currently I am writing a small application with Qt and OpenGl and I choosed QOpenGLWidget for rendering graphics.
That's how I declared my widget:
class GLWidget : public QOpenGLWidget, protected QOpenGLFunctions{
// Methods, slots,…

Denis
- 719
- 2
- 8
- 23
1
vote
0 answers
OpenGL depth calculation in shader
I want some special process on depth test.
First of all, I want to know the correct depth calculation in shader by self instead of GPU depth test.
If I disable depth test, and write depth buffer to achieve same effect as depth test:
Pixel…

Jiangshanbin
- 11
- 2
1
vote
2 answers
My openGL render depths are nearly the value of 1 why is that?
I do some basic stuff
1) calculate my position
2) store it into "gl_Position"
3) then i store my depth into a vec2 based on my position info
gl_Position = vec4( vVertexPos, 1 ) * mMVP;
vDepth = gl_Position.zw;
vDepth is a variable above in my…

Franky Rivera
- 553
- 8
- 20
1
vote
1 answer
What might be the issue with my pipeline to rendering the depth buffer to a texture?
The main steps for depth testing from my understanding:
1) enable depth testing and how we want to depth test
2) create the frame buffer object and make sure it has a depth attached to it
3) bind our frame buffer object ( make sure to clear it…

Franky Rivera
- 553
- 8
- 20
1
vote
1 answer
In three.js renderDepth of the mesh seems to be ignored
I'd like to render a mesh on top of everything else, this solution works fine:
Three.js - Geometry on top of another
I was wondering if the same could be achievable with mesh.renderDepth, but I couldn't make it work so far. Seems like renderDepth…

Andrew
- 510
- 5
- 6
1
vote
1 answer
Reverse Depth Mask Shader
I am developing in Unity3D.
Using the Depth Mask shader defined here, objects behind the mask using the shader are not drawn (only objects in front of the mask are drawn). Using the referenced code, I attempted to create a reverse Depth Mask, which…

brain56
- 2,659
- 9
- 38
- 70
1
vote
0 answers
Rotating cube cutted on Direct3D9
I'm trying to show a rotating cube on Direct3D9.
I can draw it with success, but during rotation some pixels are not drawn. I'd like to show every part of the cube during rotation. Each face has 0.5f as size and it's rotating with Pitch Yaw Roll…

user3040937
- 81
- 10
1
vote
1 answer
lighting and surface normal issue with the cube
My cube looked like this (the house) after I tried to use glnormal for the lighting. If I get rid of glnormal then it's fine, if I were to get rid of glDepthFunc(GL_ALWAYS); then it's fine as well , dont know what's going on here.
Also another…

cakester
- 421
- 4
- 15
1
vote
1 answer
OpenGL ES 2.0 GPU accelerated geometry sorting
I have a 3D app that currently uses OpenGL ES 1.1, most meshes are hardwired in the app and are static (they don't move), so depth test allows to draw the transparent geometri efficiently, using the hardwired sorting.
Now I want to load the world…

rraallvv
- 2,875
- 6
- 30
- 67
1
vote
2 answers
Why depth test does not work in offscreen rendering for color pick?
I'm using coloring and off-screen rendering to implement a selection tool for QUADS on OpenGL. But the depth test seems to not work in the off-screen rendering and at certain angles and rotations, the QUAD behind the front one is selected. Any…

Hamed Rajabi Varamini
- 3,439
- 3
- 24
- 38
1
vote
1 answer
Order of execution of depth_clamp and depth_test
does depth clamp occurs before depth test or after depth test?
I am rendering a primitive with coordinates > 1.0 and <-1.0 and using depth clamping with depth test. But when i enable depth test it does not render any geometry.
Here is my…

debonair
- 2,505
- 4
- 33
- 73
1
vote
2 answers
Z-fighting Direct3D9, only with dynamic buffer
I lock and fill a vertex buffer every frame in Direct3d9 with data from my blendshape code. My shading uses two steps, so I render once with one shader, then draw an additive blend with my other shader.
For reasons beyond me, the data in my vertex…

Jeroen D Stout
- 23
- 1
- 4
1
vote
1 answer
Reading Depth map using OpenGL
I have extracted the depth map of 2 images and stored them as .tif file
now I would like to use openGL to join these two images depending on their depth
so I want to read the depth for each image from the .tif file and then use that depth to draw…

Lily
- 816
- 7
- 18
- 38