Questions tagged [depth-buffer]

Depth buffering(Z-buffering), is the management of image depth coordinates in three-dimensional (3-D) graphics.

In computer graphics, z-buffering, also known as depth buffering, is the management of image depth coordinates in three-dimensional (3-D) graphics, usually done in hardware, sometimes in software. It is one solution to the visibility problem, which is the problem of deciding which elements of a rendered scene are visible, and which are hidden. The painter's algorithm is another common solution which, though less efficient, can also handle non-opaque scene elements.

Resources

454 questions
5
votes
1 answer

Cuda Render Buffer Interop for depth component

What I am trying to do is to use OpenGL to perform some rendering, then use CUDA to perform some read-only post-processing (computations) directly on the rendered RGB and depth components, without copying the data to a PBO. To do this, I create a…
BenP
  • 53
  • 5
5
votes
1 answer

how does glDepthRange work?

My vertex cords are : GLfloat vertices[]= { 0.5f,0.5f,0.5f, -0.5f,0.5f,0.5f, -0.5f,-0.5f,0.5f, 0.5f,-0.5f,0.5f,//face 1 0.5f,-0.5f,-0.5f, -0.5f,-0.5f,-0.5f, …
debonair
  • 2,505
  • 4
  • 33
  • 73
4
votes
2 answers

True depth values using OpenGL readPixels

I'd like to retrieve the depth buffer from my camera view for a 3D filtering application. Currently, I'm using glReadPixels to get the depth component. Instead of the [0,1] values, I need the true values for the depth buffer, or true distance to the…
Kevin Watts
  • 63
  • 1
  • 6
4
votes
2 answers

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 vertices with the modelviewmatrix to get the correct…
hidayat
  • 9,493
  • 13
  • 51
  • 66
4
votes
2 answers

Android Q - Get depth map from portrait mode photos

I'm trying to build a sample Android App to extract the depth map of portrait mode photos taken with the google camera app. I know that it's saved along the blurred photos. I read the Dynamic Depth Format documentation coming from Google :…
François
  • 41
  • 3
4
votes
2 answers

Using RGB images and PointCloud, how to generate depth map from the PointClouds? (python)

I am working on fusing Lidar and Camera images in order to perform a classification object algorithm using CNN. I want to use the KITTI Dataset which provide synchronized lidar and rgb image data. Lidar are 3D-scanners, so the output is a 3D Point…
Doxcos44
  • 135
  • 2
  • 12
4
votes
1 answer

How to Extract SceneKit Depth Buffer at runtime in AR scene?

How does one extract the SceneKit depth buffer? I make an AR based app that is running Metal and I'm really struggling to find any info on how to extract a 2D depth buffer so I can render out fancy 3D photos of my scenes. Any help greatly…
Dan M
  • 370
  • 2
  • 13
4
votes
1 answer

Pack depth information in a RGBA texture using mediump precison

Trying to understand the many issues related to the WebGL development for a generic mobile target, now I need to store depth information in a texture attachment for later retrieval and post-processing. JavaScript: var depthRB =…
deblocker
  • 7,629
  • 2
  • 24
  • 59
4
votes
1 answer

How to get Z values from Z Buffer

I'm having problems with drawing in OpenGL and I need to see exactly what values are being placed in the depth buffer. Can anyone tell me how to retrieve these values? Thanks Chris
Sonoman
  • 3,379
  • 9
  • 45
  • 61
4
votes
1 answer

Drawing unobscured health bars in a Java 3D scene

So I'm working on a game in Java 3D and I'm implementing health bars that hover above units. I started by drawing a quad at a 3D point above the unit's location and applying a Billboard behavior to make it always face the camera. But the problem I'm…
mjomble
  • 521
  • 3
  • 9
  • 20
4
votes
3 answers

JOGL Depth Buffering Not Working

I have been using JOGL for a few days now and this is now becoming a major road block. I can not get shapes to draw in the correct z-order, instead, they are drawn in the order they are given to OpenGL. I have spent the last few hours researching…
David Bella
  • 831
  • 5
  • 8
4
votes
1 answer

Is there a way to enable blending and depth at the same time in Metal

I have a metal view that displays some textured quads. The textures are loaded from PNGs so are premultiplied. Some of the textures have transparent pixels. When I enable blending and draw in the right order, the transparency works and you can see…
Dom Chapman
  • 953
  • 2
  • 10
  • 15
4
votes
1 answer

Using depth buffer in opengl es 2.0 iphone

I followed a tutorial using depth buffer in opengl es 1.1. But I use opengl es 2.0. The implemented code results in an error: Failed to make complete framebuffer object 8cd6. See implemented code below: (void)createFramebuffer { if (context &&…
tyuip
  • 157
  • 2
  • 10
4
votes
1 answer

gl_FragDepth breaks color

It seems that I can't use gl_FragDepth on my computer. My program works well otherwise, no glsl error, glGetError returns 0, but I can't write in the depth buffer from my fragment shader. Besides, writing in gl_FragDepth changes the red component of…
Procrade
  • 689
  • 1
  • 7
  • 10
4
votes
1 answer

Opengl depth buffer to cuda

I'm a new programmer to Opengl, my aim is to retrieve the depth buffer into a FBO to be able to transfer to cuda without using glReadpixels. Here is what I've already done: void make_Fbo() { glGenFramebuffers(1, &fbo); …
Thomas Kostas
  • 435
  • 4
  • 11