z culling not working properly on some fragments

Started by
11 comments, last by Adaline 12 years, 5 months ago
Hi,Sometimes some fragments behind others are displayed :
C:UsersNicoPicturesbuggy.png
[attachment=6017:buggy.PNG]

behind the 'tree' there's a box wall like this one :
C:UsersNicoPictureswall.png
[attachment=6018:wall.PNG]

I tried with another video card (GeForce GT530) and there wasn't this bug at all.
My video card drivers have been updated yesterday. It's a GeForce 9500GT

I suspect my gpu to be faulty

what's your opinion ?
thanks
Advertisement
Check your images, I cant see them ;-)

-


Check your images, I cant see them ;-)




Hello
Done wink.gif

How do you clean your z-buffer?


for each frame, before the draw calls :

g_pd3dDevice->ClearDepthStencilView(g_pDepthStencilView,D3D10_CLEAR_DEPTH,1.0f,0);



I would also add that it occurs very very rarely (and randomly)

[quote name='Daniel Saska' timestamp='1320770244' post='4881800']
How do you clean your z-buffer?


for each frame, before the draw calls :

g_pd3dDevice->ClearDepthStencilView(g_pDepthStencilView,D3D10_CLEAR_DEPTH,1.0f,0);



I would also add that it occurs very very rarely (and randomly)
[/quote]

What are your near and far plane values?

Are you using any alpha transparency for the objects?
I checked on another computer and the problem never occured
zNear=0.1
zFar=10000.0

I just tried zFar=1000.0 but the problem was still there

I use alpha testing in a specific shader, not in general
the boxes of the walls are using it

-


I checked on another computer and the problem never occured
zNear=0.1
zFar=10000.0

I just tried zFar=1000.0 but the problem was still there

I use alpha testing in a specific shader, not in general
the boxes of the walls are using it


Regardless of the bug, you should always set your zNear to as big as you can and zFar only as far as required. 0.1 : 10000 ratio is quite big.
Otherwise this kind of bug is difficult to debug and you may have reason that you have faulty GPU.


Good luck!
A zNear value of 1.0 is the standard as far as I know, I would try that with a zFar of 1000.0 (if that doesn't cut into your scene). Also, what AutoDepthStencilFormat are you using with your presentation parameters when you create your device? I've had much better results with 24-bit depth buffers (D3DFMT_D24S8) than with what most tutorials set you up with - which is a 16-bit buffer most of the time. If you use 1.0/1000.0 and D3DFMT_D24S8 and you're still getting that problem it's not a z-fighting issue after all...

This topic is closed to new replies.

Advertisement