0
\$\begingroup\$

I have this problem in my OpenGL project but i will show you the same thing over blender3d with video. So I believe that I will better explain the problem. it is just 30 seconds. Take a look. Youtube LINK

How can i fix these problem ?

\$\endgroup\$
2

1 Answer 1

2
\$\begingroup\$

As others have already pointed out, it's called Z fighting, and happens when two or multiple polygons are close to eachother (depth-wise) and the framework has trouble distinguishing which should be drawn over which. At its core, this is caused by floating point inaccuracies.

All that is nice to know, but how do you fix it?

  1. In your terrain shader, discard every pixel that is below a certain height (the height of your water.) This way, there's nothing for the water to fight over visibility with.
  2. increase the distance of your camera's near plane. Try to get it as far away from the camera as possible without clipping objects that should be shown.
  3. Decrease the distance of your camera's far plane (not as effective as step 2)
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .