aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/makamys/lodmod/renderer/LODChunk.java4
-rw-r--r--src/main/java/makamys/lodmod/renderer/LODRenderer.java9
2 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/LODChunk.java b/src/main/java/makamys/lodmod/renderer/LODChunk.java
index 63b43e7..ae86103 100644
--- a/src/main/java/makamys/lodmod/renderer/LODChunk.java
+++ b/src/main/java/makamys/lodmod/renderer/LODChunk.java
@@ -84,9 +84,9 @@ public class LODChunk {
public void tick(Entity player) {
double distSq = distSq(player);
- if(distSq < Math.pow(32 * 16, 2)) {
+ if(distSq < Math.pow((LODMod.renderer.renderRange / 2) * 16, 2)) {
renderer.setLOD(this, 2);
- } else if(distSq < Math.pow(64 * 16, 2)) {
+ } else if(distSq < Math.pow((LODMod.renderer.renderRange) * 16, 2)) {
renderer.setLOD(this, 1);
} else {
renderer.setLOD(this, 0);
diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java
index 5454352..4e9c97d 100644
--- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java
+++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java
@@ -77,6 +77,8 @@ public class LODRenderer {
private long lastGCTime = -1;
private long gcInterval = 60 * 1000;
+ public int renderRange = 48;
+
public LODRenderer(){
hasInited = init();
}
@@ -113,9 +115,8 @@ public class LODRenderer {
int centerX = (int)Math.floor(player.posX / 16.0);
int centerZ = (int)Math.floor(player.posZ / 16.0);
- int range = 64;
- for(int x = -range; x <= range; x++) {
- for(int z = -range; z <= range; z++) {
+ for(int x = -renderRange; x <= renderRange; x++) {
+ for(int z = -renderRange; z <= renderRange; z++) {
int chunkX = centerX + x;
int chunkZ = centerZ + z;
@@ -145,7 +146,7 @@ public class LODRenderer {
}
public int getFarPlaneDistanceMultiplier() {
- return 4;
+ return renderRange / 12;
}
private void handleKeyboard() {