Model fixes (namely on intel)
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user