Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Terrain, Water and flickering problems...  (Read 998 times)
Brandon
Community Member
*
Posts: 7


« on: September 29, 2010, 02:16:46 PM »

In my program I am having a big problem with how the water interacts with the terrain.  For some reason it flickers quite a bit, and I'm not sure why.  I hope the attachment is clear enough in showing what's going on.  If not, I can upload a bigger video to my website.
Logged
jviper
Community Member
*
Posts: 2130

Discipline in training


« Reply #1 on: September 29, 2010, 03:10:12 PM »

Looks like Z-fighting due to lack of available precision. You may have to decrease your far plane so you can make your near plane smaller.
Logged

JAbstract.....Don't just imagine, make it happen!
Brandon
Community Member
*
Posts: 7


« Reply #2 on: September 29, 2010, 04:37:03 PM »

Thanks for the help.  Right now I have it setup like so:

Code:
Camera.SetViewFrustum 60, 300000

Is that too big?  It appears that the nearPlane defaults to 1. The flickering really goes haywire when I set the nearPlane to 0.1
Logged
Brandon
Community Member
*
Posts: 7


« Reply #3 on: September 29, 2010, 05:19:46 PM »

What you said is working.  This is what I changed
Code:
Camera.SetViewFrustum 60, 300000.05, 26.032

And it's making a tremendous difference!
Thanks!
Logged
arnienet
Customers
Community Member
*****
Posts: 263


WWW
« Reply #4 on: September 30, 2010, 07:20:41 AM »

With the near and far plane it's a good idea to use values close to what you need in the scene. Many people use 1 unit in a 3D scene to represent 1 meter in actual reality. So with the far plane, the setting of 300000 would equate to 300 km and using 26.032 for the near plane fixes the problem by allowing the Z buffer to differentiate between the water and land mesh intersection in your scene. 26.032 means though that the camera would not see anything less than 26m in front of it.

I suspect your meshes are scaled up to a large value and these values are fine if you want to work in that scale (but even scaling up by ten, you would be using a far plane of 30km, near plane of 2.6m).

I suggest you scale down your meshes to a size that more closely represents 1 unit = 1 meter and use a far plane of 2000 to 3000 (2-3km) and a near plane of 0.5m to 1m. This would remove any ambiguity in the dev process. Also use similar values to move the camera around.
« Last Edit: September 30, 2010, 07:23:02 AM by arnienet » Logged

Total Dev time = 50% to code, 50% to test, 50% to find errors, 50% to fix, that's why it takes twice as long.

Dawn World MMO
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks