diff options
author | makamys <makamys@outlook.com> | 2022-06-04 11:28:12 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2022-06-04 13:29:40 +0200 |
commit | 6c20df930d5f5294583602e604e5fc474782e539 (patch) | |
tree | 7fc21a93e65af85841818bb76dd0f47fcc8d05ce /src/main/java/makamys/lodmod/renderer | |
parent | 524c250c683a380395dd065065f72731b730ed74 (diff) | |
download | Neodymium-6c20df930d5f5294583602e604e5fc474782e539.tar.gz Neodymium-6c20df930d5f5294583602e604e5fc474782e539.tar.bz2 Neodymium-6c20df930d5f5294583602e604e5fc474782e539.zip |
Tick meshes
Diffstat (limited to 'src/main/java/makamys/lodmod/renderer')
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/ChunkMesh.java | 3 | ||||
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/LODRenderer.java | 7 | ||||
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/Mesh.java | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/ChunkMesh.java b/src/main/java/makamys/lodmod/renderer/ChunkMesh.java index 33814a6..562aa49 100644 --- a/src/main/java/makamys/lodmod/renderer/ChunkMesh.java +++ b/src/main/java/makamys/lodmod/renderer/ChunkMesh.java @@ -174,6 +174,9 @@ public class ChunkMesh extends Mesh { return buffer; } + public void update() { + } + // Java is weird. public static short readShortAt(DataInputStream in, int offset) { try { diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java index 95273c4..c76ea64 100644 --- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java +++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java @@ -131,6 +131,7 @@ public class LODRenderer { if(renderLOD) { sort(); + updateMeshes(); initIndexBuffers(); render(alpha); } @@ -142,6 +143,12 @@ public class LODRenderer { private void sort() { Entity player = Minecraft.getMinecraft().renderViewEntity; sentMeshes[1].sort(new MeshDistanceComparator(player.posX, player.posY, player.posZ)); + private void updateMeshes() { + for(List<Mesh> list : sentMeshes) { + for(Mesh mesh : list) { + mesh.update(); + } + } } private void initIndexBuffers() { diff --git a/src/main/java/makamys/lodmod/renderer/Mesh.java b/src/main/java/makamys/lodmod/renderer/Mesh.java index ca645e8..2367b03 100644 --- a/src/main/java/makamys/lodmod/renderer/Mesh.java +++ b/src/main/java/makamys/lodmod/renderer/Mesh.java @@ -35,6 +35,8 @@ public abstract class Mesh { public void prepareBuffer() {} public void destroyBuffer() {} + public void update() {} + public static enum GPUStatus { UNSENT, SENT, PENDING_DELETE } |