DirectX z-fighting in SpecialFX demo

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Neuman
Posts: 7
Joined: Thu Aug 03, 2006 2:37 pm
Contact:

DirectX z-fighting in SpecialFX demo

Post by Neuman »

Image

This wasn't happening in version 1.0, so I'm assuming this isn't a known bug. This problem seems to occur on my computer whenever I move some distance away from the water surface. It happens with DirectX 9.0 and 8.1, but not OpenGL. I'm not getting any shader errors either. My video card is a GeForce 6800.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I don't remeber any major changes to the DirectX drivers, except for the FPU precision setting. But as this default to false I cannot imagine what this really causes.
EDIT: I don't see this effect on my computer either, otherwise we would have checked that before :wink:
Last edited by hybrid on Tue Aug 08, 2006 1:23 pm, edited 1 time in total.
Mancuso Raffaele
Posts: 70
Joined: Sat Dec 17, 2005 4:43 pm
Location: licata (AG) italy
Contact:

Post by Mancuso Raffaele »

on my computer this "effect" don't happen neither with directx9,neither with directx8,neither with realtime shadow active and neither with realtime shadow deactive. I try to rename the file d3dx9_28.dll and this "effect" don't happen. Maybe your version of directx is not up to date. try to update directx or video driver. my configuration is: AMD Sempron 2500+1.41 ghz, 512 mb RAM, NVIDIA GeForce 6100 with 256 mb VRAM, Directx 9.0c

Bye
Bye all,
Mancuso Raffaele (Ares FPS game)
Neuman
Posts: 7
Joined: Thu Aug 03, 2006 2:37 pm
Contact:

Post by Neuman »

If it were my version of DirectX, then why would this still show up with DirectX 8.1 being used?

Anyway, I have no idea what the problem is, since I've only been using the Dev-C++ branch and I'm not using the directx source.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

DirectX depth buffer selection

Post by hybrid »

Ok, I have found the problem on my machine, too, and also a solution. As probably everyone knows this is zbuffer fighting. The floor shows through due to a lack of precision in the depth buffer such that the gfx card thinks the water is below the floor. this can be fixed by changing the depth format to 24bit or 32bit. Irrlicht does not allow to set the depth buffer depth, though, with one exception. As long as the scene does not contain shadow volumes you can enable stencil buffers and get 24bit depth buffer and 8bit stencil. The FPS will still drop, though.
I can put a better depth buffer search into the code, but I'd need some advice on the impact of depth buffer selection. I think a good solution would be to choose the depth/stencil buffer the same size as the main buffer (16/32 bit), with a fallback to 24bit in both cases (there's a fast D24X8 when no stencil is required).
Another solution would be to make this format selectable from the Creation Parameter and the device creation.
Any suggestions or requests?
Post Reply