Questions tagged [depth-testing]

a technique used in 3D graphics to ensure that only the objects closest to the viewer are drawn in a scene.

121 questions
0
votes
0 answers

THREEJS: Depth order between Mesh object with shader material (with volume rendering) and other mesh objects is always wrong

I'm using Threejs to create a medical-volume-rendering app. I'm using a shadermaterial to define the volume rendering of a body and for the single rois (region of interest) and other extern objects I'm using basic or phong-materials with defined…
Michel
  • 1
0
votes
1 answer

How to convert 2d(x,y) cooridinates into 3d(x,y,z) coordinates using python and point cloud?

I have been using this github repo: https://github.com/aim-uofa/AdelaiDepth/blob/main/LeReS/Minist_Test/tools/test_shape.py To figure out how this piece of code can be used to get x,y,z coordinates: def reconstruct_3D(depth, f): """ …
0
votes
0 answers

How to get 3D coordinates from depth maps

I can get the depth map from depth estimation which uses supervised or unsupervised learning, but here is an obstacle that I want to get 3D coordinates from depth maps. If anyone can provide some suggestions.
Feona
  • 67
  • 2
  • 8
0
votes
1 answer

Vulkan Instanced Rendering Weird Depth Buffer Behaviour

I am rendering a single mesh test object that contains 8000 cubes, 1 monkey, and 1 plane. I checked normals and winding orders. all seems correct for mesh. if I render a single instance, the depth buffer works correctly. if I render using instanced…
aramok
  • 35
  • 1
  • 1
  • 6
0
votes
1 answer

gray color ranges of a disparity image keeps on fluctuating

I have been working on stereophotogrammetry to find depth data using OpenCV. I did the calibration and got the intrinsic, extrinsic, and distortion parameters to find the disparity map. Using these parameters, I rectified the images and used them to…
0
votes
0 answers

Using alpha blending for depth testing

I only have partially opaque/transparent but not translucent sprites in my scene. My approach would be to render the scene to an FBO with a simple fragment shader writing gl_FragCoord.z for opaque- or 1.0 for transparent regions to gl_FragColor.a,…
ichi
  • 1
  • 1
0
votes
1 answer

Opengl Skybox Depth Buffer Hides the scene

Depth Buffer was working fine Until I added the Skybox, now it hides all my world(scene) and only renders the skybox when hiddenDepth=False... The issue is clearly the skybox as I checked it by removing skybox... Display Function below static void…
0
votes
1 answer

openGL - converting a non-linear depth buffer to a linear depth buffer

According to the thread on this page, The equation given for calculating the depth buffer: F_depth = 1/z - 1/n/(1/f - 1/n) is non-linear only because of the perspective divide.(Note that this is a combination of from the view-space z coord to…
horxCoder
  • 165
  • 8
0
votes
1 answer

N depth map texture in single shader

I have a shader 1 depth map texture attached to it. glGenFramebuffers(1, &depthMapFrameBuffer); glGenTextures(1, &depthMapTexture); glBindTexture(GL_TEXTURE_2D, depthMapTexture); glTexImage2D(GL_TEXTURE_2D, 0,…
aramok
  • 35
  • 1
  • 1
  • 6
0
votes
1 answer

How to check the depth of every object field in Javascript

I have a navigation function in my React Native app, that outputs to the console all the arguments passed to it in the developer's mode, and sometimes i sent a big store to the arguments and it can not be output. Get the error about the cyclic…
jocoders
  • 1,594
  • 2
  • 19
  • 54
0
votes
1 answer

How to measure distance between mobile phone and the object being photographed?

I am trying to obtain the distance between mobile and object for an application where I want to convert a 2D photograph to 3D object, I have the following doubts: Is there a way to get the distance between the lens of the mobile phone and the…
0
votes
1 answer

Doing a per-fragment DEPTH_TEST in OpenGL

I can toggle depth testing on/off in OpenGL using glEnable( GL_DEPTH_TEST ); But this switches the test on/off for the entire draw call. I would like to control the test on a per-fragment basis. This is to achieve the following effect: in a…
Bram
  • 7,440
  • 3
  • 52
  • 94
0
votes
1 answer

Depth Buffer Not Working With Multiple Shader Programs

I am writing a 3D graphics renderer in C++ using OpenGL-ES for a handheld system and I am utilizing a decal (texture) shader, as well as a color-fill shader. I have two render passes where I use the respective program and use Array/Element buffers…
Daniel Bailey
  • 51
  • 1
  • 9
0
votes
1 answer

HLSL modifying pixel depth without skipping z-culling

I'm attempting to write a ray-tracing based shader where for each pixel of a quad I calculate the origin and direction of the ray from the camera and test for intersection with my scene (currently a sphere). If intersection occurs I want to set the…
Byker Dave
  • 11
  • 2
0
votes
1 answer

Unity3d mobile shader transparency issue

My 3D object is overlapping itself with alpha when using a custom shader in Unity3D (Unlit version): It should look something like this instead: Shader "Custom/Shader1" { Properties { _Color ("Main Color", Color) = (1,1,1,1) …
1 2 3
8 9