remove more unused code
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
7606b702d1
commit
afd4f547a1
@ -790,7 +790,6 @@ public class RenderUtils {
|
|||||||
int endX;
|
int endX;
|
||||||
int startY;
|
int startY;
|
||||||
int endY;
|
int endY;
|
||||||
float diff;
|
|
||||||
float min;
|
float min;
|
||||||
float max;
|
float max;
|
||||||
float texture;
|
float texture;
|
||||||
@ -801,7 +800,6 @@ public class RenderUtils {
|
|||||||
this.startY = startY;
|
this.startY = startY;
|
||||||
this.endX = endX;
|
this.endX = endX;
|
||||||
this.endY = endY;
|
this.endY = endY;
|
||||||
this.diff = diff;
|
|
||||||
this.min = min;
|
this.min = min;
|
||||||
this.max = max;
|
this.max = max;
|
||||||
this.texture = texture;
|
this.texture = texture;
|
||||||
@ -940,7 +938,6 @@ public class RenderUtils {
|
|||||||
){
|
){
|
||||||
//add to quad
|
//add to quad
|
||||||
quadCurrent.endY = y + stride;
|
quadCurrent.endY = y + stride;
|
||||||
quadCurrent.diff = newMax - newMin;
|
|
||||||
quadCurrent.min = newMax;
|
quadCurrent.min = newMax;
|
||||||
quadCurrent.max = newMax;
|
quadCurrent.max = newMax;
|
||||||
} else {
|
} else {
|
||||||
@ -954,7 +951,6 @@ public class RenderUtils {
|
|||||||
if(newMax - newMin < MINIMIZATION_DIFF_MAX){
|
if(newMax - newMin < MINIMIZATION_DIFF_MAX){
|
||||||
//add to quad
|
//add to quad
|
||||||
quadCurrent.endY = y + stride;
|
quadCurrent.endY = y + stride;
|
||||||
quadCurrent.diff = newMax - newMin;
|
|
||||||
quadCurrent.min = newMax;
|
quadCurrent.min = newMax;
|
||||||
quadCurrent.max = newMax;
|
quadCurrent.max = newMax;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -15,71 +15,28 @@ import static org.lwjgl.glfw.GLFW.glfwPollEvents;
|
|||||||
import static org.lwjgl.glfw.GLFW.glfwSwapBuffers;
|
import static org.lwjgl.glfw.GLFW.glfwSwapBuffers;
|
||||||
import static org.lwjgl.glfw.GLFW.glfwTerminate;
|
import static org.lwjgl.glfw.GLFW.glfwTerminate;
|
||||||
import static org.lwjgl.glfw.GLFW.glfwWindowHint;
|
import static org.lwjgl.glfw.GLFW.glfwWindowHint;
|
||||||
import static org.lwjgl.opengl.GL11.GL_ALWAYS;
|
|
||||||
import static org.lwjgl.opengl.GL45.GL_LEQUAL;
|
|
||||||
import static org.lwjgl.opengl.GL11.GL_BLEND;
|
|
||||||
import static org.lwjgl.opengl.GL11.GL_COLOR;
|
|
||||||
import static org.lwjgl.opengl.GL11.GL_COLOR_BUFFER_BIT;
|
import static org.lwjgl.opengl.GL11.GL_COLOR_BUFFER_BIT;
|
||||||
import static org.lwjgl.opengl.GL11.GL_DEPTH_BUFFER_BIT;
|
|
||||||
import static org.lwjgl.opengl.GL11.GL_DEPTH_TEST;
|
import static org.lwjgl.opengl.GL11.GL_DEPTH_TEST;
|
||||||
import static org.lwjgl.opengl.GL11.GL_LESS;
|
|
||||||
import static org.lwjgl.opengl.GL11.GL_ONE;
|
|
||||||
import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA;
|
import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA;
|
||||||
import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_COLOR;
|
|
||||||
import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA;
|
import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA;
|
||||||
import static org.lwjgl.opengl.GL11.GL_TEXTURE_2D;
|
|
||||||
import static org.lwjgl.opengl.GL11.GL_TRIANGLES;
|
|
||||||
import static org.lwjgl.opengl.GL11.GL_ZERO;
|
|
||||||
import static org.lwjgl.opengl.GL11.glBindTexture;
|
|
||||||
import static org.lwjgl.opengl.GL11.glBlendFunc;
|
|
||||||
import static org.lwjgl.opengl.GL11.glClear;
|
import static org.lwjgl.opengl.GL11.glClear;
|
||||||
import static org.lwjgl.opengl.GL11.glClearColor;
|
import static org.lwjgl.opengl.GL11.glClearColor;
|
||||||
import static org.lwjgl.opengl.GL11.glDepthFunc;
|
|
||||||
import static org.lwjgl.opengl.GL11.glDepthMask;
|
|
||||||
import static org.lwjgl.opengl.GL11.glDisable;
|
|
||||||
import static org.lwjgl.opengl.GL11.glDrawArrays;
|
|
||||||
import static org.lwjgl.opengl.GL11.glEnable;
|
import static org.lwjgl.opengl.GL11.glEnable;
|
||||||
import static org.lwjgl.opengl.GL11.glViewport;
|
|
||||||
import static org.lwjgl.opengl.GL13.GL_TEXTURE0;
|
|
||||||
import static org.lwjgl.opengl.GL13.GL_TEXTURE1;
|
|
||||||
import static org.lwjgl.opengl.GL13.GL_TEXTURE2;
|
|
||||||
import static org.lwjgl.opengl.GL13.GL_TEXTURE3;
|
|
||||||
import static org.lwjgl.opengl.GL13.glActiveTexture;
|
|
||||||
import static org.lwjgl.opengl.GL14.GL_FUNC_ADD;
|
|
||||||
import static org.lwjgl.opengl.GL14.glBlendEquation;
|
|
||||||
import static org.lwjgl.opengl.GL20.glGetUniformLocation;
|
|
||||||
import static org.lwjgl.opengl.GL20.glUniform1f;
|
|
||||||
import static org.lwjgl.opengl.GL20.glUniformMatrix4fv;
|
|
||||||
import static org.lwjgl.opengl.GL20.glUseProgram;
|
|
||||||
import static org.lwjgl.opengl.GL30.GL_FRAMEBUFFER;
|
import static org.lwjgl.opengl.GL30.GL_FRAMEBUFFER;
|
||||||
import static org.lwjgl.opengl.GL30.GL_RENDERBUFFER;
|
import static org.lwjgl.opengl.GL30.GL_RENDERBUFFER;
|
||||||
import static org.lwjgl.opengl.GL30.glBindRenderbuffer;
|
import static org.lwjgl.opengl.GL30.glBindRenderbuffer;
|
||||||
import static org.lwjgl.opengl.GL30.glBindVertexArray;
|
|
||||||
import static org.lwjgl.opengl.GL30.glClearBufferfv;
|
|
||||||
import static org.lwjgl.opengl.GL40.glBlendFunci;
|
|
||||||
import static org.lwjgl.system.MemoryUtil.NULL;
|
import static org.lwjgl.system.MemoryUtil.NULL;
|
||||||
|
|
||||||
import java.nio.IntBuffer;
|
import java.nio.IntBuffer;
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
|
||||||
|
|
||||||
import org.joml.Matrix4d;
|
import org.joml.Matrix4d;
|
||||||
import org.joml.Matrix4f;
|
import org.joml.Matrix4f;
|
||||||
import org.joml.Quaterniond;
|
|
||||||
import org.joml.Quaternionf;
|
|
||||||
import org.joml.Sphered;
|
|
||||||
import org.joml.Vector3d;
|
|
||||||
import org.joml.Vector3f;
|
import org.joml.Vector3f;
|
||||||
import org.lwjgl.BufferUtils;
|
import org.lwjgl.BufferUtils;
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
import org.lwjgl.glfw.GLFWErrorCallback;
|
import org.lwjgl.glfw.GLFWErrorCallback;
|
||||||
import org.lwjgl.glfw.GLFWWindowSizeCallback;
|
|
||||||
import org.lwjgl.glfw.GLFWWindowSizeCallbackI;
|
|
||||||
import org.lwjgl.opengl.GL;
|
import org.lwjgl.opengl.GL;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import org.lwjgl.opengl.GL15;
|
|
||||||
import org.lwjgl.opengl.GL20;
|
|
||||||
import org.lwjgl.opengl.GL30;
|
import org.lwjgl.opengl.GL30;
|
||||||
|
|
||||||
import electrosphere.engine.Globals;
|
import electrosphere.engine.Globals;
|
||||||
@ -89,7 +46,6 @@ import electrosphere.renderer.framebuffer.Framebuffer;
|
|||||||
import electrosphere.renderer.framebuffer.FramebufferUtils;
|
import electrosphere.renderer.framebuffer.FramebufferUtils;
|
||||||
import electrosphere.renderer.framebuffer.Renderbuffer;
|
import electrosphere.renderer.framebuffer.Renderbuffer;
|
||||||
import electrosphere.renderer.light.LightManager;
|
import electrosphere.renderer.light.LightManager;
|
||||||
import electrosphere.renderer.model.Model;
|
|
||||||
import electrosphere.renderer.pipelines.CompositePipeline;
|
import electrosphere.renderer.pipelines.CompositePipeline;
|
||||||
import electrosphere.renderer.pipelines.FirstPersonItemsPipeline;
|
import electrosphere.renderer.pipelines.FirstPersonItemsPipeline;
|
||||||
import electrosphere.renderer.pipelines.ImGuiPipeline;
|
import electrosphere.renderer.pipelines.ImGuiPipeline;
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import org.joml.Vector3f;
|
|||||||
import org.lwjgl.BufferUtils;
|
import org.lwjgl.BufferUtils;
|
||||||
import org.lwjgl.opengl.GL30;
|
import org.lwjgl.opengl.GL30;
|
||||||
import org.lwjgl.opengl.GL31;
|
import org.lwjgl.opengl.GL31;
|
||||||
import org.lwjgl.opengl.GL40;
|
|
||||||
|
|
||||||
import electrosphere.engine.Globals;
|
import electrosphere.engine.Globals;
|
||||||
import electrosphere.entity.types.camera.CameraEntityUtils;
|
import electrosphere.entity.types.camera.CameraEntityUtils;
|
||||||
|
|||||||
@ -319,20 +319,20 @@ public class FluidChunkModelGeneration {
|
|||||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
|
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
|
||||||
};
|
};
|
||||||
|
|
||||||
private static final byte[] BLOCK_PICK_BITS_BY_VERT_INDEX = new byte[]{
|
// private static final byte[] BLOCK_PICK_BITS_BY_VERT_INDEX = new byte[]{
|
||||||
(byte)0x67,
|
// (byte)0x67,
|
||||||
(byte)0x26,
|
// (byte)0x26,
|
||||||
(byte)0x23,
|
// (byte)0x23,
|
||||||
(byte)0x37,
|
// (byte)0x37,
|
||||||
(byte)0x45,
|
// (byte)0x45,
|
||||||
(byte)0x04,
|
// (byte)0x04,
|
||||||
(byte)0x01,
|
// (byte)0x01,
|
||||||
(byte)0x15,
|
// (byte)0x15,
|
||||||
(byte)0x57,
|
// (byte)0x57,
|
||||||
(byte)0x46,
|
// (byte)0x46,
|
||||||
(byte)0x02,
|
// (byte)0x02,
|
||||||
(byte)0x13
|
// (byte)0x13
|
||||||
};
|
// };
|
||||||
|
|
||||||
static class Triangle {
|
static class Triangle {
|
||||||
int[] indices = new int[3]; //array of size 3
|
int[] indices = new int[3]; //array of size 3
|
||||||
|
|||||||
@ -321,20 +321,20 @@ public class TerrainChunkModelGeneration {
|
|||||||
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
|
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
|
||||||
};
|
};
|
||||||
|
|
||||||
private static final byte[] BLOCK_PICK_BITS_BY_VERT_INDEX = new byte[]{
|
// private static final byte[] BLOCK_PICK_BITS_BY_VERT_INDEX = new byte[]{
|
||||||
(byte)0x67,
|
// (byte)0x67,
|
||||||
(byte)0x26,
|
// (byte)0x26,
|
||||||
(byte)0x23,
|
// (byte)0x23,
|
||||||
(byte)0x37,
|
// (byte)0x37,
|
||||||
(byte)0x45,
|
// (byte)0x45,
|
||||||
(byte)0x04,
|
// (byte)0x04,
|
||||||
(byte)0x01,
|
// (byte)0x01,
|
||||||
(byte)0x15,
|
// (byte)0x15,
|
||||||
(byte)0x57,
|
// (byte)0x57,
|
||||||
(byte)0x46,
|
// (byte)0x46,
|
||||||
(byte)0x02,
|
// (byte)0x02,
|
||||||
(byte)0x13
|
// (byte)0x13
|
||||||
};
|
// };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A single generated triangle
|
* A single generated triangle
|
||||||
@ -739,7 +739,7 @@ public class TerrainChunkModelGeneration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//set ratio dat
|
//set ratio dat
|
||||||
for(Triangle triangle : triangles){
|
for(int j = 0; j < triangles.size(); j++){
|
||||||
//first vertex
|
//first vertex
|
||||||
textureRatioData.add(1.0f);
|
textureRatioData.add(1.0f);
|
||||||
textureRatioData.add(0.0f);
|
textureRatioData.add(0.0f);
|
||||||
@ -948,16 +948,16 @@ public class TerrainChunkModelGeneration {
|
|||||||
return rVal;
|
return rVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final int pickBlockIdForVertex(long blockIds, int vertIndex){
|
// private static final int pickBlockIdForVertex(long blockIds, int vertIndex){
|
||||||
int bits = BLOCK_PICK_BITS_BY_VERT_INDEX[vertIndex];
|
// int bits = BLOCK_PICK_BITS_BY_VERT_INDEX[vertIndex];
|
||||||
int blockIndexA = bits >> 4;
|
// int blockIndexA = bits >> 4;
|
||||||
int blockIndexB = bits & 0xf;
|
// int blockIndexB = bits & 0xf;
|
||||||
int blockIdA = (int)(blockIds >> 8 * blockIndexA) & 0xff;
|
// int blockIdA = (int)(blockIds >> 8 * blockIndexA) & 0xff;
|
||||||
int blockIdB = (int)(blockIds >> 8 * blockIndexB) & 0xff;
|
// int blockIdB = (int)(blockIds >> 8 * blockIndexB) & 0xff;
|
||||||
|
|
||||||
//assert (blockIdA == airBlockId) != (blockIdB == airBlockId);
|
// //assert (blockIdA == airBlockId) != (blockIdB == airBlockId);
|
||||||
//return blockIdA - nonZeroAirBlockId + blockIdB;
|
// //return blockIdA - nonZeroAirBlockId + blockIdB;
|
||||||
return blockIdA + blockIdB;
|
// return blockIdA + blockIdB;
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user