diff --git a/src/main/java/me/cortex/voxy/client/core/model/ModelBakerySubsystem.java b/src/main/java/me/cortex/voxy/client/core/model/ModelBakerySubsystem.java index d6670d88..f8a33b8b 100644 --- a/src/main/java/me/cortex/voxy/client/core/model/ModelBakerySubsystem.java +++ b/src/main/java/me/cortex/voxy/client/core/model/ModelBakerySubsystem.java @@ -100,6 +100,7 @@ public class ModelBakerySubsystem { this.factory.tick(); + start = System.nanoTime(); while (!this.factory.resultJobs.isEmpty()) { this.factory.resultJobs.poll().run(); if (totalBudget<(System.nanoTime()-start)) diff --git a/src/main/java/me/cortex/voxy/client/core/model/bakery/ModelTextureBakery.java b/src/main/java/me/cortex/voxy/client/core/model/bakery/ModelTextureBakery.java index 65aaa88a..50e1c85a 100644 --- a/src/main/java/me/cortex/voxy/client/core/model/bakery/ModelTextureBakery.java +++ b/src/main/java/me/cortex/voxy/client/core/model/bakery/ModelTextureBakery.java @@ -21,11 +21,10 @@ import net.minecraft.world.chunk.light.LightingProvider; import org.jetbrains.annotations.Nullable; import org.joml.Matrix4f; -import static org.lwjgl.opengl.ARBShaderImageLoadStore.*; import static org.lwjgl.opengl.GL11.*; import static org.lwjgl.opengl.GL14C.glBlendFuncSeparate; import static org.lwjgl.opengl.GL30.*; -import static org.lwjgl.opengl.GL45.glClearNamedFramebufferfv; +import static org.lwjgl.opengl.GL45.glTextureBarrier; public class ModelTextureBakery { //Note: the first bit of metadata is if alpha discard is enabled @@ -188,7 +187,8 @@ public class ModelTextureBakery { glEnable(GL_BLEND); glBlendFuncSeparate(GL_ONE_MINUS_DST_ALPHA, GL_DST_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); } else { - glDisable(GL_BLEND); + glDisable(GL_BLEND);//FUCK YOU INTEL (screams), for _some reason_ discard or something... JUST DOESNT WORK?? + //glBlendFuncSeparate(GL_ONE, GL_ZERO, GL_ONE, GL_ONE); } glStencilOp(GL_KEEP, GL_KEEP, GL_INCR); @@ -281,7 +281,7 @@ public class ModelTextureBakery { glDisable(GL_BLEND); //Finish and download - glMemoryBarrier(GL_FRAMEBUFFER_BARRIER_BIT|GL_TEXTURE_UPDATE_BARRIER_BIT|GL_PIXEL_BUFFER_BARRIER_BIT|GL_SHADER_IMAGE_ACCESS_BARRIER_BIT);//Am not sure if barriers are right + glTextureBarrier(); this.capture.emitToStream(streamBuffer, streamOffset); glBindFramebuffer(GL_FRAMEBUFFER, this.capture.framebuffer.id); diff --git a/src/main/resources/assets/voxy/shaders/bakery/position_tex.fsh b/src/main/resources/assets/voxy/shaders/bakery/position_tex.fsh index e49efe30..833700e1 100644 --- a/src/main/resources/assets/voxy/shaders/bakery/position_tex.fsh +++ b/src/main/resources/assets/voxy/shaders/bakery/position_tex.fsh @@ -1,8 +1,8 @@ #version 430 layout(location=0) uniform sampler2D tex; -in flat uint metadata; in vec2 texCoord; +in flat uint metadata; out vec4 colour; void main() { diff --git a/src/main/resources/assets/voxy/shaders/bakery/position_tex.vsh b/src/main/resources/assets/voxy/shaders/bakery/position_tex.vsh index f5b3813a..4d046ecd 100644 --- a/src/main/resources/assets/voxy/shaders/bakery/position_tex.vsh +++ b/src/main/resources/assets/voxy/shaders/bakery/position_tex.vsh @@ -1,16 +1,15 @@ #version 430 -layout(location=0) in vec3 pos; -layout(location=1) in uint _metadata; -layout(location=2) in vec2 uv; +layout(location=0) in vec4 pos; +layout(location=1) in vec2 uv; layout(location=1) uniform mat4 transform; out vec2 texCoord; out flat uint metadata; void main() { - metadata = _metadata; + metadata = floatBitsToUint(pos.w);//Fuck you intel - gl_Position = transform * vec4(pos, 1.0); + gl_Position = transform * vec4(pos.xyz, 1.0); texCoord = uv; }