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
1
vote
1 answer

Depth-fighting solution using custom depth testing

The core of my problem is that I have troubles with depth-fighting in pure OpenGL. I have two identical geometries, but one is simpler than the other. That forms a set of perfectly coplanar polygons, and I want to display the complex geometry on…
Kiord
  • 79
  • 7
1
vote
1 answer

Parts of model are occluded strangely in OpenGL

I'm rendering a barrel object in Android with GLES20. The barrel is not rendered correctly and it's not clear to me where the problem is (texture? model? culling? depth?): I've tried debugging with Google's debugger. The model can be rendered…
Tim Guo
  • 98
  • 1
  • 6
1
vote
0 answers

How to perform an orthographic projection on a z-Buffer image in Matlab?

I am facing the same problem as mentioned in this post, however, I am not facing it with OpenGL, but simply with MATLAB. Depth as distance to camera plane in GLSL I have a depth image rendered from the Z-Buffer from 3ds max. I was not able to get…
Kev1n91
  • 3,553
  • 8
  • 46
  • 96
1
vote
2 answers

How to use a ZBuffer with simple polygons?

I have been writing a simple 3d renderer, and have been looking into draw order. The engine renders 3d polygons (groups of 3d points that are in correct drawing order) into 2d space, returning a list of 2d points that represent the projection of a…
pete2fiddy
  • 31
  • 6
1
vote
1 answer

Implementing a Z-buffer using OpenGL

For a project I want to implement my own Z-buffer. I know the algorithm and how to implement this. Because I do not want to write an entire graphics engine I was planning on using OpenGL, the problem is, how can I combine my own algorithm with…
Kevin
  • 775
  • 2
  • 13
  • 32
1
vote
1 answer

as3 - How to sort display objects that constantly switch depths?

I have a 2.5D game (2D game that acts like a 3D game) where you constantly switch depths, where the player displays on top of an object when it walks in front of it and when it walks behind it, the object displays on top of the player. Like when the…
Crook
  • 317
  • 1
  • 3
  • 12
1
vote
0 answers

Volume Ray Marching rendered always on top of the other objects

I have a really big problem that has been bothering me for so long and I can't seem to find the solution. I have downloaded this project https://github.com/brianasu/unity-ray-marching/tree/volumetric-textures (Unitypackage with my project here…
Albert Alises
  • 1,018
  • 1
  • 8
  • 19
1
vote
1 answer

How to write to zbuffer only with three.js

I'm trying to use thee.js to only update the zbuffer (I'm using preserveDrawingBuffer to create a trace effect). However I can't find any way to only write to the zbuffer with the standard materials, so far I've tried: setting the material's…
Chris
  • 13
  • 1
  • 3
1
vote
1 answer

DirectX meshes not being displayed properly after switching view and projection matrices

In my program, the meshes were being displayed properly, but when I change the device.transform.view and the device.transform.projection matrices from the left handed to the right handed system, the meshes are not displayed properly anymore, i.e the…
user326075
  • 49
  • 1
  • 4
1
vote
1 answer

Change the values of OpenGL's z-buffer

I want to pass a matrix with depth values into the z-buffer of openGL. Somewhere I found that I can use: glDrawPixels(640,480,GL_DEPTH_COMPONENT,GL_FLOAT,normalizedMappedDepthMat.ptr()); ...where mat is an opencv Mat.Is it possible to change the…
mbiks
  • 29
  • 5
1
vote
1 answer

calculate depth of the points lying in a plane? depth buffer

Currently i am working on the Z-buffer.I have the idea of original plane(in the world), and i process out screen vertices through: world to camera transformation, x_projection = x(world) / -z(world) (similar for y) now i am unable to find out, how…
AnnShress
  • 477
  • 1
  • 5
  • 11
1
vote
1 answer

OpenGL Z order messed up

I cannot figure out why some of my objects are being rendered on top of each other. I have Depth testing on. glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); Do I need to draw by order of what is closest to the camera? (I thought OpenGL did that…
TechAUmNu
  • 152
  • 1
  • 3
  • 11
1
vote
0 answers

XNA 4.0 shader depth information

I am using a RenderTarget2D to draw my 3D World and I use a shader to add light effects etc. later. How can I get the depth information inside the pixelshader? I am new at shader programming and I have no idear of the shader given commands. my…
Thomas
  • 2,093
  • 3
  • 21
  • 40
1
vote
1 answer

What might be the issue with my pipeline to rendering the depth buffer to a texture?

The main steps for depth testing from my understanding: 1) enable depth testing and how we want to depth test 2) create the frame buffer object and make sure it has a depth attached to it 3) bind our frame buffer object ( make sure to clear it…
Franky Rivera
  • 553
  • 8
  • 20
1
vote
1 answer

Rendering complexity of a complex object

Consider a 3D box. Re-tessellating the vertices of this box in a random fashion creates many large intersecting faces. Rendering such an object is more complex. why? How does this affect the rendering complexity?
Jolfaei
  • 13
  • 4