z-buffer vs w-buffer

Discussion about everything. New games, 3d math, development tips...
Post Reply
Noiecity
Posts: 387
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

z-buffer vs w-buffer

Post by Noiecity »

I was comparing z-buffer renders with w-buffer, I had the same result in irrlicht.
I used https://ezgif.com/compare-images with "Highlight differences" to see if there were pixel differences... there were none. (This was with burningsvideo, I told chatgpt to confirm that 1.9.0 used w-buffer by default in burnings video, the response was yes).

I tried with my own software rasterizer, not only did I try with z-buffer and w-buffer in 32 bits, but also with double and long double... the difference: 0 pixels difference.

The only time there was a difference was when I went down to less than 16 bits of depth, using Q8.8, so yes, the difference was notable, I didn't even have to analyze it, it was just a matter of seeing that the sizes were very different (it looked small up close and from a distance).

So my final conclusion was, the important thing is the fov, with a vertical fov of 54.0f (irrlicht uses vertical fov) you get a sensation of depth similar to the human eye. Expanding the fov because the human eye covers a greater radius will distort the image and take away realism.


I also noticed that a small fov, like 5 or close, can give you almost the same result as an orthogonal camera, this works for isometric graphics (since burnings video currently has problems with an isometric orthogonal view camera).
Irrlicht is love, Irrlicht is life, long live to Irrlicht
Noiecity
Posts: 387
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Re: z-buffer vs w-buffer

Post by Noiecity »

However, I don't have seen a difference in the analysis due to a render distance that was too low (far).
Irrlicht is love, Irrlicht is life, long live to Irrlicht
CuteAlien
Admin
Posts: 10022
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: z-buffer vs w-buffer

Post by CuteAlien »

z-buffer (or w-buffer) is usually no problem until it is. And then you see it. And 90% you can fix it by increasing near-plane a bit or so. Or slightly modifying your 3d scene architecture (don't have flat planes too close together). In some specific scenes it obviously matters, but it's not something you run into a lot.

Don't know about burnings video troubles with isometric camera, it has?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Noiecity
Posts: 387
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Re: z-buffer vs w-buffer

Post by Noiecity »

CuteAlien wrote: Fri May 22, 2026 11:05 am z-buffer (or w-buffer) is usually no problem until it is. And then you see it. And 90% you can fix it by increasing near-plane a bit or so. Or slightly modifying your 3d scene architecture (don't have flat planes too close together). In some specific scenes it obviously matters, but it's not something you run into a lot.

Don't know about burnings video troubles with isometric camera, it has?
Thanks for the information. And yes, it had Z-Fighting for some reason; I don't know if it still does, but with a 5-degree FOV and moving away from the target a little, at the same angle as an isometric camera, it gives practically the same result as a "true isometric" orthographic camera.
Irrlicht is love, Irrlicht is life, long live to Irrlicht
Post Reply