I have an issue with the water in my terrain, which is currently just a quad with a transparent blue colour.
When close up to it, it looks like this:
As you can see, it's simple enough - A flat transparent quad representing water.
However, when I get further away, this happens:
For those who can't see the GIF, or need an external link (or can't understand what's going on), the terrain is glitching around the water. If you look near the water near enough, you will see the terrain glitching above/below it.
Here is the code where I prepare the 3D view:
static void ready3D()
{
glViewport(0, 0, Display.getWidth(),Display.getHeight());
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
GLU.gluPerspective(45, (float) Display.getWidth()/Display.getHeight(), 50f, 500f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glDepthFunc(GL_LEQUAL);
glEnable(GL_DEPTH_TEST);
}
Does anyone know what the issue is, and how I could improve the precision of the depth buffer (presuming the depth buffer is the issue)?