Fix format hopefully
This commit is contained in:
@@ -57,7 +57,7 @@ dependencies {
|
|||||||
|
|
||||||
modImplementation("maven.modrinth:cloth-config:13.0.121+fabric")
|
modImplementation("maven.modrinth:cloth-config:13.0.121+fabric")
|
||||||
modImplementation("maven.modrinth:modmenu:11.0.1")
|
modImplementation("maven.modrinth:modmenu:11.0.1")
|
||||||
modCompileOnly("maven.modrinth:iris:1.7.1+1.21")
|
modCompileOnly("maven.modrinth:iris:1.7.3+1.21")
|
||||||
//modRuntimeOnly("maven.modrinth:iris:1.6.17+1.20.4")
|
//modRuntimeOnly("maven.modrinth:iris:1.6.17+1.20.4")
|
||||||
modCompileOnly("maven.modrinth:starlight:1.1.3+1.20.4")
|
modCompileOnly("maven.modrinth:starlight:1.1.3+1.20.4")
|
||||||
//modCompileOnly("maven.modrinth:immersiveportals:v5.1.7-mc1.20.4")
|
//modCompileOnly("maven.modrinth:immersiveportals:v5.1.7-mc1.20.4")
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ public class VoxelCore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private AbstractFarWorldRenderer<?,?> createRenderBackend() {
|
private AbstractFarWorldRenderer<?,?> createRenderBackend() {
|
||||||
if (false) {
|
if (true) {
|
||||||
System.out.println("Using Gl46MeshletFarWorldRendering");
|
System.out.println("Using Gl46MeshletFarWorldRendering");
|
||||||
return new Gl46MeshletsFarWorldRenderer(VoxyConfig.CONFIG.geometryBufferSize, VoxyConfig.CONFIG.maxSections);
|
return new Gl46MeshletsFarWorldRenderer(VoxyConfig.CONFIG.geometryBufferSize, VoxyConfig.CONFIG.maxSections);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -4,10 +4,9 @@ import me.cortex.voxy.common.util.TrackedObject;
|
|||||||
|
|
||||||
import static org.lwjgl.opengl.ARBFramebufferObject.glDeleteFramebuffers;
|
import static org.lwjgl.opengl.ARBFramebufferObject.glDeleteFramebuffers;
|
||||||
import static org.lwjgl.opengl.ARBFramebufferObject.glGenFramebuffers;
|
import static org.lwjgl.opengl.ARBFramebufferObject.glGenFramebuffers;
|
||||||
import static org.lwjgl.opengl.GL11C.GL_TEXTURE_2D;
|
import static org.lwjgl.opengl.GL11C.*;
|
||||||
import static org.lwjgl.opengl.GL11C.glDeleteTextures;
|
import static org.lwjgl.opengl.GL30C.glGetIntegeri;
|
||||||
import static org.lwjgl.opengl.GL45C.glCreateTextures;
|
import static org.lwjgl.opengl.GL45C.*;
|
||||||
import static org.lwjgl.opengl.GL45C.glTextureStorage2D;
|
|
||||||
|
|
||||||
public class GlTexture extends TrackedObject {
|
public class GlTexture extends TrackedObject {
|
||||||
public final int id;
|
public final int id;
|
||||||
@@ -35,4 +34,16 @@ public class GlTexture extends TrackedObject {
|
|||||||
super.free0();
|
super.free0();
|
||||||
glDeleteTextures(this.id);
|
glDeleteTextures(this.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: FIXME, glGetTextureParameteri doesnt work
|
||||||
|
public static int getRawTextureType(int texture) {
|
||||||
|
if (!glIsTexture(texture)) {
|
||||||
|
throw new IllegalStateException("Not texture");
|
||||||
|
}
|
||||||
|
int immFormat = glGetTextureParameteri(texture, GL_TEXTURE_IMMUTABLE_FORMAT);
|
||||||
|
if (immFormat == 0) {
|
||||||
|
throw new IllegalStateException("Texture: " + texture + " is not immutable");
|
||||||
|
}
|
||||||
|
return immFormat;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import me.cortex.voxy.client.core.gl.shader.ShaderType;
|
|||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import static org.lwjgl.opengl.ARBDirectStateAccess.*;
|
import static org.lwjgl.opengl.ARBDirectStateAccess.*;
|
||||||
|
import static org.lwjgl.opengl.GL11.glScaled;
|
||||||
import static org.lwjgl.opengl.GL11C.*;
|
import static org.lwjgl.opengl.GL11C.*;
|
||||||
import static org.lwjgl.opengl.GL30C.*;
|
import static org.lwjgl.opengl.GL30C.*;
|
||||||
import static org.lwjgl.opengl.GL33.glBindSampler;
|
import static org.lwjgl.opengl.GL33.glBindSampler;
|
||||||
@@ -41,7 +42,8 @@ public class HiZBuffer {
|
|||||||
this.levels -= 3;//Arbitrary size, shinks the max level by alot and saves a significant amount of processing time
|
this.levels -= 3;//Arbitrary size, shinks the max level by alot and saves a significant amount of processing time
|
||||||
// (could probably increase it to be defined by a max meshlet coverage computation thing)
|
// (could probably increase it to be defined by a max meshlet coverage computation thing)
|
||||||
|
|
||||||
this.texture = new GlTexture().store(GL_DEPTH_COMPONENT32, this.levels, width, height);
|
//GL_DEPTH_COMPONENT32F //Cant use this as it does not match the depth format of the provided depth buffer
|
||||||
|
this.texture = new GlTexture().store(GL_DEPTH24_STENCIL8, this.levels, width, height);
|
||||||
glTextureParameteri(this.texture.id, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
glTextureParameteri(this.texture.id, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
glTextureParameteri(this.texture.id, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTextureParameteri(this.texture.id, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
glTextureParameteri(this.texture.id, GL_TEXTURE_COMPARE_MODE, GL_NONE);
|
glTextureParameteri(this.texture.id, GL_TEXTURE_COMPARE_MODE, GL_NONE);
|
||||||
@@ -75,7 +77,7 @@ public class HiZBuffer {
|
|||||||
glDepthFunc(GL_ALWAYS);
|
glDepthFunc(GL_ALWAYS);
|
||||||
|
|
||||||
|
|
||||||
|
//System.err.println("SRC: " + GlTexture.getRawTextureType(srcDepthTex) + " DST: " + this.texture.id);
|
||||||
glCopyImageSubData(srcDepthTex, GL_TEXTURE_2D, 0,0,0,0,
|
glCopyImageSubData(srcDepthTex, GL_TEXTURE_2D, 0,0,0,0,
|
||||||
this.texture.id, GL_TEXTURE_2D, 0,0,0,0,
|
this.texture.id, GL_TEXTURE_2D, 0,0,0,0,
|
||||||
width, height, 1);
|
width, height, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user