move more client state
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2025-05-15 15:48:04 -04:00
parent cd1fef2d3a
commit 6fe1733d58
8 changed files with 17 additions and 22 deletions

View File

@ -1825,6 +1825,7 @@ Move some global state into rendering engine
Push settings into config variable Push settings into config variable
Move window pointer into rendering engine Move window pointer into rendering engine
Move microSimulation into serverState Move microSimulation into serverState
Move fluidCellManager into clientState

View File

@ -8,6 +8,7 @@ import electrosphere.client.block.ClientBlockManager;
import electrosphere.client.block.cells.ClientBlockCellManager; import electrosphere.client.block.cells.ClientBlockCellManager;
import electrosphere.client.chemistry.ClientChemistryCollisionCallback; import electrosphere.client.chemistry.ClientChemistryCollisionCallback;
import electrosphere.client.entity.character.ClientCharacterManager; import electrosphere.client.entity.character.ClientCharacterManager;
import electrosphere.client.fluid.cells.FluidCellManager;
import electrosphere.client.fluid.manager.ClientFluidManager; import electrosphere.client.fluid.manager.ClientFluidManager;
import electrosphere.client.player.ClientPlayerData; import electrosphere.client.player.ClientPlayerData;
import electrosphere.client.scene.ClientLevelEditorData; import electrosphere.client.scene.ClientLevelEditorData;
@ -96,6 +97,11 @@ public class ClientState {
*/ */
public ClientBlockCellManager clientBlockCellManager; public ClientBlockCellManager clientBlockCellManager;
/**
* The fluid cell manager
*/
public FluidCellManager fluidCellManager;
/** /**
* client level editor data management * client level editor data management
*/ */

View File

@ -84,8 +84,8 @@ public class ClientFluidManager {
message.getworldX(), message.getworldY(), message.getworldZ(), message.getworldX(), message.getworldY(), message.getworldZ(),
data data
); );
if(Globals.fluidCellManager != null){ if(Globals.clientState.fluidCellManager != null){
Globals.fluidCellManager.markUpdateable(message.getworldX(), message.getworldY(), message.getworldZ()); Globals.clientState.fluidCellManager.markUpdateable(message.getworldX(), message.getworldY(), message.getworldZ());
} }
} break; } break;
default: default:

View File

@ -213,8 +213,8 @@ public class ClientSimulation {
*/ */
private void updateFluidCellManager(){ private void updateFluidCellManager(){
//fluid work //fluid work
if(Globals.fluidCellManager != null && Globals.clientState.clientWorldData != null && Globals.RUN_FLUIDS){ if(Globals.clientState.fluidCellManager != null && Globals.clientState.clientWorldData != null && Globals.RUN_FLUIDS){
Globals.fluidCellManager.update(); Globals.clientState.fluidCellManager.update();
} }
} }

View File

@ -48,7 +48,7 @@ public class ImGuiFluidMonitor {
} }
if(ImGui.collapsingHeader("Client Data")){ if(ImGui.collapsingHeader("Client Data")){
FluidCellManager fluidCellManager = Globals.fluidCellManager; FluidCellManager fluidCellManager = Globals.clientState.fluidCellManager;
ImGui.text("FluidCellManager Data"); ImGui.text("FluidCellManager Data");
ImGui.text("Undrawable size: " + fluidCellManager.getUndrawableSize()); ImGui.text("Undrawable size: " + fluidCellManager.getUndrawableSize());
ImGui.text("Unrequested size: " + fluidCellManager.getUnrequestedSize()); ImGui.text("Unrequested size: " + fluidCellManager.getUnrequestedSize());

View File

@ -5,7 +5,6 @@ import electrosphere.auth.AuthenticationManager;
import electrosphere.client.ClientState; import electrosphere.client.ClientState;
import electrosphere.client.block.cells.BlockTextureAtlas; import electrosphere.client.block.cells.BlockTextureAtlas;
import electrosphere.client.entity.particle.ParticleService; import electrosphere.client.entity.particle.ParticleService;
import electrosphere.client.fluid.cells.FluidCellManager;
import electrosphere.client.terrain.cells.VoxelTextureAtlas; import electrosphere.client.terrain.cells.VoxelTextureAtlas;
import electrosphere.client.ui.menu.WindowUtils; import electrosphere.client.ui.menu.WindowUtils;
import electrosphere.controls.CameraHandler; import electrosphere.controls.CameraHandler;
@ -146,11 +145,6 @@ public class Globals {
// Database stuff // Database stuff
// //
public static DatabaseController dbController = new DatabaseController(); public static DatabaseController dbController = new DatabaseController();
//
//Camera handler stuff
//
public static CameraHandler cameraHandler = new CameraHandler();
@ -166,9 +160,6 @@ public class Globals {
//title bar dimensions //title bar dimensions
public static int WINDOW_TITLE_BAR_HEIGHT = 0; public static int WINDOW_TITLE_BAR_HEIGHT = 0;
//locations for shadow map specific variables
public static int depthMapShaderProgramLoc = 0;
@ -179,6 +170,7 @@ public class Globals {
public static ModelPretransforms modelPretransforms; public static ModelPretransforms modelPretransforms;
public static ShaderOptionMap shaderOptionMap; public static ShaderOptionMap shaderOptionMap;
public static FontManager fontManager; public static FontManager fontManager;
public static CameraHandler cameraHandler = new CameraHandler();
// //
@ -215,9 +207,6 @@ public class Globals {
public static VoxelTextureAtlas voxelTextureAtlas = new VoxelTextureAtlas(); public static VoxelTextureAtlas voxelTextureAtlas = new VoxelTextureAtlas();
public static BlockTextureAtlas blockTextureAtlas = new BlockTextureAtlas(); public static BlockTextureAtlas blockTextureAtlas = new BlockTextureAtlas();
//fluid cell manager
public static FluidCellManager fluidCellManager;
//manager for all widgets currently being drawn to screen //manager for all widgets currently being drawn to screen
public static ElementService elementService; public static ElementService elementService;
public static int openInventoriesCount = 0; public static int openInventoriesCount = 0;

View File

@ -374,13 +374,13 @@ public class ClientLoading {
} }
//initialize draw cell manager //initialize draw cell manager
Globals.fluidCellManager = new FluidCellManager(Globals.clientState.clientTerrainManager, 0, 0, 0); Globals.clientState.fluidCellManager = new FluidCellManager(Globals.clientState.clientTerrainManager, 0, 0, 0);
Globals.fluidCellManager.setGenerateDrawables(true); Globals.clientState.fluidCellManager.setGenerateDrawables(true);
Globals.clientState.clientSimulation.setLoadingTerrain(true); Globals.clientState.clientSimulation.setLoadingTerrain(true);
//wait for all the terrain data to arrive //wait for all the terrain data to arrive
WindowUtils.updateLoadingWindow("REQUESTING FLUID CHUNKS FROM SERVER (" + Globals.fluidCellManager.getUnrequestedSize() + ")"); WindowUtils.updateLoadingWindow("REQUESTING FLUID CHUNKS FROM SERVER (" + Globals.clientState.fluidCellManager.getUnrequestedSize() + ")");
while(blockForInit && Globals.fluidCellManager.containsUnrequestedCell() && Globals.engineState.threadManager.shouldKeepRunning() && Globals.RUN_FLUIDS){ while(blockForInit && Globals.clientState.fluidCellManager.containsUnrequestedCell() && Globals.engineState.threadManager.shouldKeepRunning() && Globals.RUN_FLUIDS){
try { try {
TimeUnit.MILLISECONDS.sleep(10); TimeUnit.MILLISECONDS.sleep(10);
} catch (InterruptedException ex) { } catch (InterruptedException ex) {

View File

@ -358,7 +358,6 @@ public class RenderingEngine {
//create light depth framebuffer/shader for shadowmapping //create light depth framebuffer/shader for shadowmapping
// //
lightDepthShaderProgram = VisualShader.loadSpecificShader("/Shaders/core/lightDepth/lightDepth.vs", "/Shaders/core/lightDepth/lightDepth.fs"); lightDepthShaderProgram = VisualShader.loadSpecificShader("/Shaders/core/lightDepth/lightDepth.vs", "/Shaders/core/lightDepth/lightDepth.fs");
Globals.depthMapShaderProgramLoc = lightDepthShaderProgram.getId();
try { try {
Framebuffer lightDepthBuffer = FramebufferUtils.generateDepthBuffer(openGLState); Framebuffer lightDepthBuffer = FramebufferUtils.generateDepthBuffer(openGLState);
RenderingEngine.lightDepthBuffer = lightDepthBuffer; RenderingEngine.lightDepthBuffer = lightDepthBuffer;