lod cache stratification working
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2024-11-05 15:50:25 -05:00
parent bf292f29c6
commit 6b2f323fdf
2 changed files with 4 additions and 6 deletions

View File

@ -6,7 +6,6 @@ import java.util.List;
import org.joml.Vector3d; import org.joml.Vector3d;
import org.joml.Vector3i; import org.joml.Vector3i;
import electrosphere.client.terrain.cache.ChunkData;
import electrosphere.client.terrain.cells.DrawCell.DrawCellFace; import electrosphere.client.terrain.cells.DrawCell.DrawCellFace;
import electrosphere.engine.Globals; import electrosphere.engine.Globals;
import electrosphere.entity.EntityUtils; import electrosphere.entity.EntityUtils;
@ -510,11 +509,11 @@ public class ClientDrawCellManager {
posToCheck.y < Globals.clientWorldData.getWorldDiscreteSize() && posToCheck.y < Globals.clientWorldData.getWorldDiscreteSize() &&
posToCheck.z >= 0 && posToCheck.z >= 0 &&
posToCheck.z < Globals.clientWorldData.getWorldDiscreteSize() && posToCheck.z < Globals.clientWorldData.getWorldDiscreteSize() &&
!Globals.clientTerrainManager.containsChunkDataAtWorldPoint(posToCheck.x, posToCheck.y, posToCheck.z, ChunkData.NO_STRIDE) !Globals.clientTerrainManager.containsChunkDataAtWorldPoint(posToCheck.x, posToCheck.y, posToCheck.z, lod)
){ ){
//client should request chunk data from server for each chunk necessary to create the model //client should request chunk data from server for each chunk necessary to create the model
LoggerInterface.loggerNetworking.DEBUG("(Client) Send Request for terrain at " + posToCheck); LoggerInterface.loggerNetworking.DEBUG("(Client) Send Request for terrain at " + posToCheck);
Globals.clientTerrainManager.requestChunk(posToCheck.x, posToCheck.y, posToCheck.z, ChunkData.NO_STRIDE); Globals.clientTerrainManager.requestChunk(posToCheck.x, posToCheck.y, posToCheck.z, lod);
} }
} }
} }
@ -542,7 +541,7 @@ public class ClientDrawCellManager {
posToCheck.y < Globals.clientWorldData.getWorldDiscreteSize() && posToCheck.y < Globals.clientWorldData.getWorldDiscreteSize() &&
posToCheck.z >= 0 && posToCheck.z >= 0 &&
posToCheck.z < Globals.clientWorldData.getWorldDiscreteSize() && posToCheck.z < Globals.clientWorldData.getWorldDiscreteSize() &&
!Globals.clientTerrainManager.containsChunkDataAtWorldPoint(posToCheck.x, posToCheck.y, posToCheck.z, ChunkData.NO_STRIDE) !Globals.clientTerrainManager.containsChunkDataAtWorldPoint(posToCheck.x, posToCheck.y, posToCheck.z, lod)
){ ){
return false; return false;
} }

View File

@ -12,7 +12,6 @@ import electrosphere.engine.Globals;
import electrosphere.entity.ClientEntityUtils; import electrosphere.entity.ClientEntityUtils;
import electrosphere.entity.Entity; import electrosphere.entity.Entity;
import electrosphere.entity.types.terrain.TerrainChunk; import electrosphere.entity.types.terrain.TerrainChunk;
import electrosphere.renderer.meshgen.TransvoxelModelGeneration;
import electrosphere.renderer.meshgen.TransvoxelModelGeneration.TransvoxelChunkData; import electrosphere.renderer.meshgen.TransvoxelModelGeneration.TransvoxelChunkData;
/** /**
@ -195,7 +194,7 @@ public class DrawCell {
worldPos.x + x / ChunkData.CHUNK_SIZE * spacingFactor, worldPos.x + x / ChunkData.CHUNK_SIZE * spacingFactor,
worldPos.y + y / ChunkData.CHUNK_SIZE * spacingFactor, worldPos.y + y / ChunkData.CHUNK_SIZE * spacingFactor,
worldPos.z + z / ChunkData.CHUNK_SIZE * spacingFactor, worldPos.z + z / ChunkData.CHUNK_SIZE * spacingFactor,
ChunkData.NO_STRIDE lod
); );
if(currentChunk == null){ if(currentChunk == null){
return false; return false;