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
2 answers

Frame Buffer Object (FBO) and Render & Depth Buffers Relation

I saw many examples on the web (for example) which do the following Create and Bind FBO Create and Bind BUFFERS (texture, render, depth, stencil) Then, UnBind BUFFERS To work with FBO- Bind FBO, do the work then UnBind FBO However, also Bind…
Rudi
  • 700
  • 1
  • 8
  • 19
3
votes
1 answer

Matlab z buffer for simulating kinect

We are trying to simulate simple kinect output. I have rendered a triangle mesh in Matlab and now I want to get at the depth buffer of the figure/axis where the shape has been rendered. How do I do that in matlab? i.e. how do I access the depth…
twerdster
  • 4,977
  • 3
  • 40
  • 70
3
votes
0 answers

OpenGL fragment shader manual depth test crash

Somehow a very simple test of depth values between the gbuffer depth texture and the current frag depth of a forward rendering pass causes a hard crash. I feel like there must be something I'm missing here. NOTE: the framebuffer where the frag…
Jeff Strom
  • 141
  • 1
  • 6
3
votes
1 answer

Is it possible to create a DepthMask effect in Unity's HDRP?

I've been banging my head against this for a while but I cannot figure out if it is possible to create a DepthMask shader for HDRP (as descibed here). For my exact use, I'm trying to create a "hole" in the shape of whatever I have the material…
3
votes
3 answers

How to place a TextView on top of a ImageVew in ConstraintLayout

I am using a ConstraintLayout and I want to place a TextView on top of an ImageView. But I'm not able to find this feature in the ConstraintLayout.
3
votes
0 answers

Surface Elimination not proper in my webgl code

Three triangles are rotating clockwise around the y-axis. However, there are some "surface elimination" problems when the triangles overlap. All the time, only one triangle remains in front. I have OR ED, the DEPTH_BUFFER_BIT and depthMask enabled…
3
votes
3 answers

Merging two separate framebuffers onto default framebuffer after depth testing

I have two framebuffers that I am rendering two different objects to. When I use the default framebuffer, I have both the objects rendering on the same one. I want this behaviour to work when using multiple framebuffers! How do I merge two…
Rathnavel
  • 85
  • 1
  • 15
3
votes
1 answer

Performance gain of glColorMask()/glDepthMask() on modern hardware?

In my application I have some shaders which write only depth buffer to use it later for shadowing. Also I have some other shaders which render a fullscreen quad whose depth will not affect all subsequent draw calls, so it's depth values may be…
Sergey
  • 7,985
  • 4
  • 48
  • 80
3
votes
1 answer

Android depth buffer issue: Advice for anyone experiencing problem

I've wasted around 30 hours this week writing and re-writing code, believing that I had misunderstood how the OpenGL depth buffer works. Everything I tried, failed. I have now resolved my problem by finding what may be an error in the Android…
Andrew Smith
  • 2,589
  • 3
  • 19
  • 17
3
votes
1 answer

SSAO implementation in Babylon JS and GLSL, using view ray for depth comparison

I'm trying to create my own SSAO shader in forward rendering (not in post processing) with GLSL. I'm encountering some issues, but I really can't figure out what's wrong with my code. It is created with Babylon JS engine as a BABYLON.ShaderMaterial…
Damian Taylor
  • 51
  • 1
  • 8
3
votes
1 answer

Calculate the angles of a pixel to a camera plane in a depth-image

I have a z-image from a ToF Camera (Kinect V2). I do not have the pixel size, but I know that the depth image has a resolution of 512x424. I also know that I have a fov of 70.6x60 degrees. I asked how to get the Pixel size before here. In Matlab…
Kev1n91
  • 3,553
  • 8
  • 46
  • 96
3
votes
2 answers

What's wrong with using depth render buffer? OpenGL ES 2.0

I use this code: context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; if (!context || ![EAGLContext setCurrentContext:context] || ![self loadShaders]) { [self release]; return nil; } …
HiTECNOLOGYs
  • 327
  • 5
  • 21
3
votes
4 answers

Depth test inverted by default in OpenGL, or did I get it wrong?

I've been playing around with OpenGL for a full week or equivalent. After 2D I'm now trying 3D. I want to reproduce the 3D scene you can see in the third video on http://johnnylee.net/projects/wii/. I've had a hard time making everything work…
ofavre
  • 4,488
  • 2
  • 26
  • 23
3
votes
1 answer

OpenGL: Depth Attachment breaks Framebuffer

I need a fresh pair of eyes. While working on rewriting my engine, I stumbled upon this issue while writing the Deferred Rendering path. The framebuffer displays only if I don't use a depth attachment, which means that the rendering is faulty, but…
3
votes
0 answers

Metal API: Improving depth buffer precision

What options does the Metal API offer for increasing the precision of the depth buffer, particularly for objects that are farther away? I've found that even with the nearZ value set uncomfortably far from the camera and the farZ value set…
llama591
  • 453
  • 5
  • 15