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
3
votes
0 answers

iOS: render to and read from depthbuffer for offscreen processing

Problem My main goal is to get model coordinates for touches on the device, so to check what you've touched. Im working with a large model and have to draw many things, that also have to be touchable. To achieve this I know two possible ways: On one…
patte
  • 191
  • 3
  • 5
2
votes
3 answers

Rendering 3D Models With Textures That Have Alpha In OpenGL

So Im trying to figure out the best way to render a 3D model in OpenGL when some of the textures applied to it have alpha channels. When I have the depth buffer enabled, and start drawing all the triangles in a 3D model, if it draws a triangle that…
Jeremy
  • 145
  • 2
  • 12
2
votes
1 answer

Comparing Kinect depth to OpenGL depth efficiently

Background: This problem is related with 3D tracking of object. My system projects object/samples from known parameters (X, Y, Z) to OpenGL and try to match with image and depth informations obtained from Kinect sensor to infer the object's 3D…
Rudi
  • 700
  • 1
  • 8
  • 19
2
votes
1 answer

OpenGL point sprites with depth testing - a blending issue?

I am rendering point sprites (using OpenGL ES 2.0 on iOS) as a user's drawing strokes. I am storing these points in vertex buffer objects such that I need to perform depth testing in order for the sprites to appear in the correct order when they're…
Stuart
  • 36,683
  • 19
  • 101
  • 139
2
votes
1 answer

OpenGL ES 2.x: How to Discard Depth Buffer glDiscardFramebufferEXT?

I read iOS OpenGL ES Logical Buffer Loads that a performance gain can be reached by "discarding" your depth buffer after each draw cycle. I try this, but it's as my game engine is not rendering any longer. I am getting an glError 1286, or…
David
  • 597
  • 5
  • 17
2
votes
1 answer

Affect depth, or stencil buffer from inside fragment shader?

I know it is possible to control what is written to the depth buffer in GLSL by writing to gl_FragDepth, but is it possible to write to the stencil buffer? Also, can I cancel a pixel write completely from within the fragment-shader, as if the pixel…
CuriousGeorge
  • 7,120
  • 6
  • 42
  • 74
2
votes
0 answers

How to correctly work with the range of depth data obtained from render-to-texture?

I'm doing some customized 2D rendering to depth buffer that connects to a texture of internal format GL_DEPTH_STENCIL. In fragment shader, the normalized Z value (only 0.0 to 1.0 is used, I'm lazy) is explicitly written from some process: in float…
jiandingzhe
  • 1,881
  • 15
  • 35
2
votes
1 answer

Can I read single pixel value from WebGL depth texture in JavaScript?

In short I would like to read a single pixel value from a WebGL 2 depth texture in JavaScript. Is this at all possible? The scenario I am rendering a scene in WebGL 2. The renderer is given a depth texture to which it writes the depth buffer. This…
Berthur
  • 4,300
  • 2
  • 14
  • 28
2
votes
1 answer

PyVista: AttributeError: 'Plotter' object has no attribute 'ren_win'

I am using the example code of the documentation from PyVista: import pyvista as pv import matplotlib.pyplot as plt from pyvista import examples mesh = examples.load_random_hills() p = pv.Plotter() p.add_mesh(mesh, color=True) p.show() zval =…
mzr97
  • 69
  • 7
2
votes
1 answer

Non-monotonic depth buffer; cyclical overlapping in OpenGL

Is it possible to implement custom depth buffer values so that I can implement a non-transitive ordering? E.g. Red > Green Green > Blue Blue > Red Which I imagine would be implemented in the fragment shader or something, only writing the pixel if…
Patrick
  • 677
  • 5
  • 14
2
votes
1 answer

OES_depth_texture and glReadPixels

The open gl es 2.0 extension, OES_depth_texture, enables writing of depth information to frame buffer with an attached texture. However, the spec not describe the usage of glReadPixels with such an extension. As far as I can tell glReadPixels will…
2
votes
1 answer

Setting gl_FragDepth causes lag?

I designed a very basic set of depth shaders for rendering depth to my shadow map depth textures. This is the code for the depth fragment shader that I used : #version 330 core in vec3 FragPos; uniform vec3 lightPos; uniform float farPlane; void…
skeelz
  • 57
  • 8
2
votes
1 answer

VK_FORMAT_UNDEFINED for Android hardware buffer with depth format on Vulkan

If I allocate an Android hardware buffer with a depth format (AHARDWAREBUFFER_FORMAT_D16_UNORM), the resulting Vulkan format retrieved by vkGetAndroidHardwareBufferPropertiesANDROID is VK_FORMAT_UNDEFINED, even though the hardware buffer depth…
P M
  • 21
  • 5
2
votes
1 answer

Graphics to graphics depth dependency, depth buffer is being corrupted

I am trying to do the following: Take render pass 1, render to attachment set S. Take render pass 2, render to attachment set S again. There is a one to one explanation on how to do this in the official Khronos github: Under Graphics to Graphics…
Makogan
  • 8,208
  • 7
  • 44
  • 112
2
votes
1 answer

Support of GL_DEPTH_COMPONENT for cudaGraphicsGLRegisterImage

I'm trying to perform combined rendering with OpenGL for polygonal rendering and CUDA for volume rendering. My idea is to render the OpenGL scene into a framebuffer, then use that color and depth buffer as input to my CUDA renderer, using it in the…
tkerwin
  • 9,559
  • 1
  • 31
  • 47