Questions tagged [zbuffer]

is an array used to store the maximum Z coordinate of any feature plotted at a given (X, Y) location on the screen.

The Z-buffer is a memory buffer (array) used in a graphics accelerator to hold the maximum z-axis value of each (X, Y) location. This allows a pixel check so that if any pixel is "below" the z-buffer value for that location, it can be ignored. This is for "hidden surface removal."

114 questions
0
votes
1 answer

Z Buffer Not Working Correctly (Not Displaying Anything)

Here is the code for my Z Buffer, it returns a black screen when I draw it. sf::VertexArray ZOrder(sf::VertexArray verticies, std::vector z_buffer) { std::vector order; for (int i = 0; i < verticies.getVertexCount(); i++) { …
0
votes
0 answers

How to find the depth of a pixel using two x y and z coordinates

I am working on z buffering with lines, and I am trying to find the depth of a certain pixel. Here is my line drawing code: void l(int x1, int y1, int z1, int x2, int y2, int z2, int cl) { int deltax = x2 - x1; // The difference in the x's …
0
votes
0 answers

get simulated depth image from matlab figure

I'm simulating a depth camera in matlab (and I don't have the automated driving toolbox) and was trying to access the depth buffer (z-buffer) from the figure that matlab plots. I've implemented twerdster's solution, but the depthData returns an…
Toby
  • 21
  • 4
0
votes
1 answer

Direct3D 9 Z-Buffer Precision Bug occuring only in release build

I'm currently experiencing a weird issue that looks like Z-Fighting with Direct3D 9. I suspect that my problem is actually a Z buffer precision issue. I noticed that absolutely no depth artifacts appear in Debug builds (I'm using Visual Studio…
Dave
  • 41
  • 8
0
votes
0 answers

Calculating individual distances from a Camera in a 3D world, Java

I am a beginner in 3D rendering, and for a learning experience, I wanted to make my own engine from scratch. I have been looking for a long time, and haven't been able to find something that gives a way to find the distance from the camera of each…
0
votes
1 answer

Change depth buffer limits for pretransformed mesh in DirectX 9.0c

I'm writing small application that recieves pretransformed vertices and display them on screen. FVF for vertice is defined as (and I can't change it) #define MY_FVF D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1 Z buffer is created…
PiotrK
  • 4,210
  • 6
  • 45
  • 65
0
votes
1 answer

Optimize 3D data for 2D rendering in PostGIS DB

I have 3D models in my PostGIS DB. This data is basically big sets of triangle faces coming from Autocad DXFs, mostly. I use it for visualizing in THREEJS based webapp and it works fine. But I have 2D view which is based on OpenLayers. OpenLayers…
SalientBrain
  • 2,431
  • 16
  • 18
0
votes
1 answer

How to save a bitmap as 16-bit in Maxscript?

I want to read out the z-buffer of camera, and render it as an image. I could achieve it with the following code: --Place the z camera z_cam = freecamera name: "depth" position:[0.0,0.0,50.0] rotation: (eulertoquat (eulerAngles 0 0 0)) z_name =…
Kev1n91
  • 3,553
  • 8
  • 46
  • 96
0
votes
1 answer

WebGL shader z position not used in depth calculations

I've been trying out some WebGL but there's a bug I cannot seem to find out how to fix. Currently I have the following setup: I have around 100 triangles which all have a position and are being drawn by a single gl.drawArrays function. To have them…
Alter User
  • 21
  • 4
0
votes
2 answers

GlReadPixels always takes from the depth buffer 0

The situation is, there are many surfaces that intersect and there is no need for the mouse click to determine the actual coordinates of the cursor position, if it points to what or surface, for this I wanted to use glReadPixels, paint all over…
0
votes
2 answers

When is painter's algorithm required with Z-buffer algorithm?

According to my teacher, in some situations, Z-buffer algorithm needs the painter's algorithm to render a 3D scene in a 2D image. I thought Z-buffer algorithm as an extension, an enhancement of painter's one : for me, Z-buffer algorithm can do all…
JarsOfJam-Scheduler
  • 2,809
  • 3
  • 31
  • 70
0
votes
1 answer

Depth Test in opengl

My program refuses to do depth testing. The two sphere objects are always drawn in the order they are created, not according to their position. Sphere alpha is positioned at (0, 0, 1) and Sphere beta is positioned (0, 0, -10), yet OpenGL still draws…
user5735177
  • 11
  • 1
  • 1
0
votes
1 answer

Unity3D ViewModel Z depth buffer fix floating point

Do anyone know how to fix floating point issue with Meshes and Skinned Meshes ? Rust have found a solution for this issue and Garry explained here : http://garry.tv/2014/04/07/unity-viewmodels/ I want to know how works the rust way, not the unity3d…
user4646893
0
votes
2 answers

Weird behaviour of Z-Buffer

I'm using Deferred Shading method to render the scene, but I have a problem with a Skybox technique due to weird behaviour of Z-Buffer. I've created additional Framebuffer and attached 5 textures, one of which is being used as a depth buffer. First…
Roman
  • 316
  • 2
  • 9
0
votes
1 answer

Data from Depth Sensor to OpenGL's z-buffer to achieve occlusion

I would like to learn more about occlusion in augmented reality apps using the data from a depth sensor(e.g kinect or Realsense RGB-D Dev kit). I read that what one should do is to compare the z-buffer values of the rendered objects with the depth…
mariosbikos
  • 429
  • 1
  • 5
  • 11