I've been trying to find the source of why my render distance is so low (I'm new at using LWJGL and don't know the complete basics yet) and I believe it falls down into this code. My idea for my game (Well, this is more of a practice run to get used to coding 3D games.) is going to be a small island with a size of around 800 which seems extremely low however it is only loading a small portion which I'd estimate to be 600. The code for my MasterRenderer class is below. createProjectionMatrix() is called in the constructor and prepare() is called at the beginning of every render.
private static final float FOV = 70;
private static final float NEAR_PLANE = 0.01f;
private static final float FAR_PLANE = 1000f;
public void prepare() {
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
GL11.glClearColor(0.49f, 89f, 0.98f, 1);
}
private void createProjectionMatrix() {
float aspectRatio = (float) Display.getWidth() / (float) Display.getHeight();
float y_scale = (float) ((1f / Math.tan(Math.toRadians(FOV / 2f))) * aspectRatio);
float x_scale = y_scale / aspectRatio;
float frustum_length = (FAR_PLANE - NEAR_PLANE);
projectionMatrix = new Matrix4f();
projectionMatrix.m00 = x_scale;
projectionMatrix.m11 = y_scale;
projectionMatrix.m22 = -((FAR_PLANE + NEAR_PLANE) / frustum_length);
projectionMatrix.m23 = -1;
projectionMatrix.m32 = -((2 * NEAR_PLANE * FAR_PLANE) / frustum_length);
projectionMatrix.m33 = 0;
}
I've tried altering the FAR_PLANE and NEAR_PLANE with no results other than some minor bugs with changing the NEAR_PLANE to a small number.