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
2
votes
1 answer

Efficient implementation of a Z-Buffer

I am currently implementing my own renderer using the Z-Buffer algorithm. Once I have done the necessary calculations (read: My Z-Buffer is filled with the correct values) I use SDL to colour in the necessary pixels. I'm using an HWSurface for this.…
Kevin
  • 775
  • 2
  • 13
  • 32
2
votes
0 answers

Depth buffer mode with several axes in Matlab

Is there a way to use the depth buffer while rendering a figure with two axes? Here's the example: The figure consists of two axes, which have symmetrically inverted moving waves (for simplicity red and blue). Obviously, these waves would intersect…
Eugene Kolesnikov
  • 643
  • 2
  • 6
  • 15
2
votes
1 answer

DirectX depth buffering not working

For some strange reason my depth buffer is not working, i.e. the triangles drawn later always overlap, regardless of their position. I have these presenter parameters D3DPRESENT_PARAMETERS d3dpp; ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed =…
Jonas S.
  • 41
  • 1
  • 4
2
votes
1 answer

LWGL // reconstruct position in fragment shader

I have the correct inverse projection matrix. But nothing seem to be right! The reconstructed position ist totally deformed und the z-Value ist much to small? Anyone a suggestion? vec3 calculatePosition(vec2 coord, float depth) { vec4…
Kriss
  • 31
  • 2
2
votes
2 answers

Z-buffering algorithm not drawing 100% correctly

I'm programming a software renderer in Java, and am trying to use Z-buffering for the depth calculation of each pixel. However, it appears to work inconsistently. For example, with the Utah teapot example model, the handle will draw perhaps half…
Birdie
  • 274
  • 2
  • 14
2
votes
2 answers

In DirectX 9, how to get zbuffer to work properly?

I've been unsuccessful at getting a simple cube geometry with shading turned on to display correctly. This is c# code, but the values are being passed through SlimDX directly to C++ code. pParams.BackBufferWidth = 0; …
Rob Perkins
  • 3,088
  • 1
  • 30
  • 51
2
votes
1 answer

Three.js - transparent objects when rotated with TrackballControls don't behave like transparent

When I add to the scene two objects and set their transparency as true with some opacity and using TrackballControls I rotate the scene by mouse, the object which was initially further from camera loses its transparency. I read that this is Z-buffer…
2
votes
0 answers

Cocos2d 2.x: enabling z-buffering and using vertexz

Assumption: I am using Cocos2D 2.0 that uses OpenGL 2.0 ES. My game has one spritesheet for all level assets (e.g. background, enemies, clouds) and one for the player character sprites and HUD elements (e.g. usually both at a z-level above the rest…
mm24
  • 9,280
  • 12
  • 75
  • 170
2
votes
3 answers

XNA 4.0 and unsolvable (by me) depth curious rendering

Big headhache on XNA 4.0 concerning a depth problem: I've already found many answers to similar problems, but no one work for me... The device is set like this: xnaPanel1.Device.BlendState = BlendState.Opaque; …
NSV
  • 41
  • 5
2
votes
2 answers

AS3: Z buffering

Z buffering is a better rendering technique compared to z sorting, since it can render intersecting 3D objects. Say, I have an Array containing two Object instances as following: {v1:new Vector3D(0, 0, 0), v2:new Vector3D(100, 0, 0), v3:new…
hello all
  • 252
  • 2
  • 17
1
vote
2 answers

My own z-buffer

How I can make my own z-buffer for correct blending alpha channels? I'm using glsl. I have only one idea. And this is use 2 "buffers", one of them storing depth-component and another color (with alpha channel). I don't need access to buffer in my…
1
vote
0 answers

Disabling Depth Test Gives Weird Artifacts For Complex Meshes

I imported a mesh from Blender 2.90.1 (glTF 2.0 exporter, all transforms applied, normals calced outside) into Godot v4.0.2.stable.official [7a0977ce2] and when setting no_depth_test = true, it seems like Godot enables the manual depth sorting…
B3D4ev_guy
  • 11
  • 1
1
vote
0 answers

Minimalist Sphere Impostor -- computing sphere radius in zdepth

I'm trying to code up a fast and minimalist sphere impostor-- the sphere doesn't need to be shaded or do anything but correct gl_FragDepth. I have some code that's very close to working... cutting out everything but the key code: vertex…
KiraHoneybee
  • 495
  • 3
  • 12
1
vote
1 answer

Hidden and visible surface rendering in javascript by overlapping colours

I am trying to implement a hidden surface determination algorithm in my 3D renderer. I have found very good approaches, such as Z-Buffer or Warnock's algorithm. However, they are extremely resource-consuming. Thus I wondered, Why not use opaque…
1
vote
1 answer

Implementing Z Buffer Algorithm

I'm trying to experiment with computer graphics and would like to implement Z Buffer algorithm for rendering in Software. So I'm trying to use the following plane equation: z = -(ax + by + d)/c To compute the Z coordinate of a pixel using the plane…
andre_lamothe
  • 2,171
  • 2
  • 41
  • 74