diff --git a/assets/Data/game/voxel/test2.json b/assets/Data/game/voxel/test2.json index 28167548..b3af64ac 100644 --- a/assets/Data/game/voxel/test2.json +++ b/assets/Data/game/voxel/test2.json @@ -26,7 +26,7 @@ "name" : "Add", "first" : { "name" : "Const", - "value" : 0.5 + "value" : 1.0 }, "second" : { "name" : "OpenSimplex" diff --git a/assets/Textures/Ground/GrassTileable256.png b/assets/Textures/Ground/GrassTileable256.png index da0312b6..e92de00f 100644 Binary files a/assets/Textures/Ground/GrassTileable256.png and b/assets/Textures/Ground/GrassTileable256.png differ diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index 3d0ba987..6850f10b 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -1108,6 +1108,11 @@ Fix ClientTerrainManager concurrent editing bug Fix point lights not being cleared from buffer after deletion Remove point lights from skeleton + human +(11/21/2024) +Change grass texture +Fix allocations on FoliageChunk child iterations +Reduce near clip to remove flickering on far chunks + # TODO @@ -1139,8 +1144,6 @@ Bug Fixes - Calculate bounding sphere for meshes by deforming vertices with bone default pose instead of no bone deform - Fix light cluster mapping for foliage shader - Fix foliage placement - - Fix lights not being deleted - - Not sending a "light count" var to light calculations, so the data stays in buffer even though it is not being updated - Fix block tree preventing initiating an attack - Fix particles not spawning in correct positions - Fix flickering when applying yoga signal (may need to rethink arch here) @@ -1230,8 +1233,6 @@ Build a lod system Refactor attach logic to better encapsulate semantic attachment Light Manager - - Creates and manages light entities - - Uses priority queue mechanism like foliage manager to only draw the most important lights - Support "flickering" somehow - Eventually support spot lights? - Point shadows ??? diff --git a/src/main/java/electrosphere/client/foliagemanager/FoliageCell.java b/src/main/java/electrosphere/client/foliagemanager/FoliageCell.java index eee8519a..31f12210 100644 --- a/src/main/java/electrosphere/client/foliagemanager/FoliageCell.java +++ b/src/main/java/electrosphere/client/foliagemanager/FoliageCell.java @@ -54,12 +54,12 @@ public class FoliageCell { /** * the length of the ray to ground test with */ - static final float RAY_LENGTH = 2.0f; + static final float RAY_LENGTH = 1.0f; /** * the height above the chunk to start from when sampling downwards */ - static final float SAMPLE_START_HEIGHT = 1.0f; + static final float SAMPLE_START_HEIGHT = 0.5f; /** * The ID of the air voxel @@ -159,6 +159,11 @@ public class FoliageCell { */ boolean hasGenerated = false; + /** + * Tracks whether this cell should be evaluated or not + */ + boolean shouldEvaluate = true; + /** * Inits the foliage cell data */ @@ -269,6 +274,7 @@ public class FoliageCell { this.addEntity(grassEntity); } } + this.shouldEvaluate = false; this.hasGenerated = true; } @@ -488,6 +494,22 @@ public class FoliageCell { return this.hasGenerated; } + /** + * Checks if the cell should be continuously evaluated + * @return true if should be evaluated, false otherwise + */ + public boolean shouldEvaluate() { + return shouldEvaluate; + } + + /** + * Sets if the cell should be continuously evaluated + * @param shouldEvaluate true if should be evaluated, false otherwise + */ + public void setShouldEvaluate(boolean shouldEvaluate) { + this.shouldEvaluate = shouldEvaluate; + } + /** * SCAFFOLDING FOR BUILDING SCALE>1 CELLS AND ALSO FOR TOP LEVEL CELL CHECKING diff --git a/src/main/java/electrosphere/client/ui/menu/mainmenu/MenuGeneratorsTitleMenu.java b/src/main/java/electrosphere/client/ui/menu/mainmenu/MenuGeneratorsTitleMenu.java index 404e90ac..20566402 100644 --- a/src/main/java/electrosphere/client/ui/menu/mainmenu/MenuGeneratorsTitleMenu.java +++ b/src/main/java/electrosphere/client/ui/menu/mainmenu/MenuGeneratorsTitleMenu.java @@ -47,27 +47,27 @@ public class MenuGeneratorsTitleMenu { optionPanel.addChild(titleLabel); //button (multiplayer) - optionPanel.addChild(Button.createButtonCentered("Singleplayer", 2.0f, () -> { + optionPanel.addChild(Button.createButtonCentered("Singleplayer", 1.0f, () -> { WindowUtils.replaceMainMenuContents(MenuGenerators.createWorldSelectMenu()); }).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE)); //button (multiplayer) - optionPanel.addChild(Button.createButtonCentered("Multiplayer", 2.0f, () -> { + optionPanel.addChild(Button.createButtonCentered("Multiplayer", 1.0f, () -> { WindowUtils.replaceMainMenuContents(MenuGenerators.createMultiplayerMenu()); }).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE)); //button (static level) - optionPanel.addChild(Button.createButtonCentered("Level Editor", 2.0f, () -> { + optionPanel.addChild(Button.createButtonCentered("Level Editor", 1.0f, () -> { WindowUtils.replaceMainMenuContents(MenuGeneratorsLevelEditor.createLevelEditorTopMenu()); }).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE)); //button (options) - optionPanel.addChild(Button.createButtonCentered("Options", 2.0f, () -> { + optionPanel.addChild(Button.createButtonCentered("Options", 1.0f, () -> { WindowUtils.replaceMainMenuContents(MenuGenerators.createOptionsMainMenu()); }).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE)); //button (sp debug) - optionPanel.addChild(Button.createButtonCentered("Debug SP Quickstart", 2.0f, () -> { + optionPanel.addChild(Button.createButtonCentered("Debug SP Quickstart", 1.0f, () -> { LoadingThread loadingThread = new LoadingThread(LoadingThreadType.DEBUG_RANDOM_SP_WORLD); Globals.RUN_CLIENT = true; Globals.RUN_SERVER = true; @@ -75,7 +75,7 @@ public class MenuGeneratorsTitleMenu { }).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE)); //button (sp debug) - optionPanel.addChild(Button.createButtonCentered("Load Test Generation Realm", 2.0f, () -> { + optionPanel.addChild(Button.createButtonCentered("Load Test Generation Realm", 1.0f, () -> { LoadingThread loadingThread = new LoadingThread(LoadingThreadType.CHUNK_GENERATION_REALM); Globals.RUN_CLIENT = true; Globals.RUN_SERVER = true; @@ -83,12 +83,12 @@ public class MenuGeneratorsTitleMenu { }).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE)); //button (ui testing) - optionPanel.addChild(Button.createButtonCentered("UI Testing", 2.0f, () -> { + optionPanel.addChild(Button.createButtonCentered("UI Testing", 1.0f, () -> { WindowUtils.replaceMainMenuContents(MenuGeneratorsUITesting.createUITestMenu()); }).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE)); //button (Viewport Test) - optionPanel.addChild(Button.createButtonCentered("Viewport Test", 2.0f, () -> { + optionPanel.addChild(Button.createButtonCentered("Viewport Test", 1.0f, () -> { Globals.threadManager.start(new LoadingThread(LoadingThreadType.LOAD_VIEWPORT)); }).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE)); diff --git a/src/main/java/electrosphere/engine/Globals.java b/src/main/java/electrosphere/engine/Globals.java index c274386a..10509186 100644 --- a/src/main/java/electrosphere/engine/Globals.java +++ b/src/main/java/electrosphere/engine/Globals.java @@ -258,7 +258,7 @@ public class Globals { public static float verticalFOV = 90; public static float aspectRatio = 2.0f; - public static float nearClip = 0.001f; + public static float nearClip = 0.01f; //matrices for drawing models public static Matrix4f viewMatrix = new Matrix4f(); diff --git a/src/main/java/electrosphere/util/ds/octree/ChunkTree.java b/src/main/java/electrosphere/util/ds/octree/ChunkTree.java index 0f9f5354..49258556 100644 --- a/src/main/java/electrosphere/util/ds/octree/ChunkTree.java +++ b/src/main/java/electrosphere/util/ds/octree/ChunkTree.java @@ -183,6 +183,22 @@ public class ChunkTree { this.data = data; } + /** + * Sets whether this node is a leaf or not + * @param isLeaf true if it is a leaf, false otherwise + */ + public void setLeaf(boolean isLeaf){ + this.isLeaf = isLeaf; + } + + /** + * Sets the data of the node + * @param data The data + */ + public void setData(T data){ + this.data = data; + } + /** * Gets the data associated with this node */