ZGameEditor forum Forum Index ZGameEditor forum
The tool for creating 64kb games. ZGE Wiki homepage.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to avoid z-fighting?

 
Post new topic   Reply to topic    ZGameEditor forum Forum Index -> General discussion
View previous topic :: View next topic  
Author Message
panurge



Joined: 04 Jul 2009
Posts: 13

PostPosted: Fri May 14, 2010 5:45 pm    Post subject: How to avoid z-fighting? Reply with quote

Hi everyone. I'm creating a planet-generator, in the following way:

I put all the data in a two-dimensional array into the Z component of each vertex of a cube-mesh. This works pretty fine for creating mountains.
I create the sea by spawning a big flat mesh at Z=0.

When the camera moves, the intesection between the sea-mesh and the earth-mesh wobbles in a strange and annoying way. How can i aviod this?

Hope this is clear. I can't send you an editable file at the moment. I already tried checking and uncheckng "draw back face" and similar in the material options, but the prolem persists.

Thanks in advance!
Back to top
View user's profile Send private message
Kjell



Joined: 23 Feb 2008
Posts: 854

PostPosted: Fri May 14, 2010 6:10 pm    Post subject: Reply with quote

Hi panurge,

Did you enable the Grid2DOnly checkbox of your MeshBox components?

If that doesn't solve it, try to reduce the Clipping range by adjusting the ClipNear / ClipFar properties on App. The smaller your range, the higher the "resolution" of the Z-Buffer will be for that range.

A screenshot or executable would make it easier to help Wink

K
Back to top
View user's profile Send private message
jph_wacheski



Joined: 16 Feb 2008
Posts: 768
Location: Toronto Canada

PostPosted: Sat May 15, 2010 1:00 pm    Post subject: Reply with quote

Sometimes if they are at the exact same place you can get this problem.
Off-setting one by a tinny amound may do it; z=-0.01;

_________________
remember when we used to play?
iterationGAMES.com
Back to top
View user's profile Send private message Visit poster's website
panurge



Joined: 04 Jul 2009
Posts: 13

PostPosted: Sat Jun 05, 2010 12:33 pm    Post subject: Reply with quote

Thanks guys, sorry for answering so late, but i currently don't own an internet connection...
for the moment i simply avoided the problem by eliminating the 'sea'. Anyway, i'll post my project on these forums for you to see.

thank you again
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ZGameEditor forum Forum Index -> General discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group