Sign in to follow this  

Solved:Flickering Faces when Faces are very near together

Recommended Posts

Hello world... in my actual project, a strategical Roleplaygame, i've now created the world and Characters. everything is fine but one thing is bad: I've created the terrain(64*32 tiles, each has 64*64 verts) by using a fractal and the water is a plane at height zero. This creates many verts and faces which are close to zero or maybe at zero. These (Terrain)faces gets in a Zbuffer-Fight with the waterplane when i move the Cam. The result is flickering faces. With Objects i have the same Problem, but Objects can be created without faces too near together..., the fractal terrain cant because its fractal How will Terrain always win the Zbuffer-Fight with the water? Or is there any technique to avoid flicker in case of near faces by giving some sort of priority?? What distance(Face to Face) is minimum distance at which directx dont get in problems? thanks for all help FreakDesign [Edited by - Freakdesign on February 14, 2005 4:17:26 PM]

Share this post

Link to post
Share on other sites
From what I understand of your description, your 0-plane water and your fractal are very close - as in, your fractals are generated in -1 <> +1 range or something similar? If that is the case, you could just multiply through by a scalar - making sure that the fractal terrain is (quite simply) bigger than the water...

Alternatively, there are a couple of possibilities.
1. If you render the terrain first (the more important of the two), then switch depth buffering from LEQUAL to LESS you can sometimes get an improvement.
2. If you use D3DRS_DEPTHBIAS and D3DRS_SLOPEDSCALEDBIAS to bias one of the two geometries.
3. Alter your front clipping plane to something >1.0f; this is often quite easy with a terrain engine, and can be very effective at solving this problem.

My reply to the recent Z Fighting thread might well be of interest to you.

Also, the classic Learning To Love Your Z Buffer page can help you choose some more suitable values (and/or see the effects of your current setup).


Share this post

Link to post
Share on other sites
Oh great! i've tried your 3 alternative and it works perfektly.

especialy your link to "love_your_z_buffer" link (funny name hehe) with the really helpful calculator helped a lot to bring more understanding into use of z-buffer and what values it use :))).

My NearPlane now changes with Cam-Height above terrain and i got rid of these flicker fx. my Nearplane was static 1.0f, now my Nearplane varies from 1.0f (Cam near Ground) to something about 50 (Cam in high Orbit)

it is as you said... it very effektiv.

Special thanks again Jack, also greets from my friend called Fred, who started this little project with me in Sep2004 :)

now i give my best to produce more little problems :))


ps: sorry for my bad english, its hard to explain problems in a foreign language... but it worked :)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this