Compare commits

...

1 Commits

Author SHA1 Message Date
maxwes08
9ffda6f5af Reduced render distance, added back fog 2025-12-15 10:36:33 +01:00
2 changed files with 2 additions and 3 deletions

View File

@@ -15,13 +15,12 @@ void main()
float distSq = dot(delta, delta); float distSq = dot(delta, delta);
// Precomputed fog parameters // Precomputed fog parameters
const float fogEndSq = 16384.0; // 128^2 const float fogEndSq = 65536.0; // 128^2
const float fogStartSq = 1024.0; // 32^2 const float fogStartSq = 1024.0; // 32^2
const float fogRangeInv = 1.0 / (fogEndSq - fogStartSq); const float fogRangeInv = 1.0 / (fogEndSq - fogStartSq);
float fogFactor = (fogEndSq - distSq) * fogRangeInv; float fogFactor = (fogEndSq - distSq) * fogRangeInv;
fogFactor = clamp(fogFactor, 0.0, 1.0); fogFactor = clamp(fogFactor, 0.0, 1.0);
fogFactor = 1;
// Texture and lighting // Texture and lighting
vec4 texColor = texture(uTexture, fragUV); vec4 texColor = texture(uTexture, fragUV);

View File

@@ -9,7 +9,7 @@ namespace Voxel
private Dictionary<(int, int), Chunk> _chunks; private Dictionary<(int, int), Chunk> _chunks;
private (int x, int z) _lastCenter = (0, 0); private (int x, int z) _lastCenter = (0, 0);
private int _loadDistance = 32; private int _loadDistance = 8;
bool chunkLoadingInitialized = false; bool chunkLoadingInitialized = false;
private static readonly Dictionary<Orientation, (int x, int y)> _neighborOffsets = new() private static readonly Dictionary<Orientation, (int x, int y)> _neighborOffsets = new()