This commit is contained in:
mcrcortex
2025-05-04 11:50:49 +10:00
parent 74bda196f0
commit 94223738ec
3 changed files with 17 additions and 7 deletions

View File

@@ -25,12 +25,18 @@ void main() {
discard;
}
vec2 uv = mod(uv, vec2(1.0))*(1.0/(vec2(3.0,2.0)*256.0));
vec2 texPos = uv + baseUV;
//vec4 colour = solidColour;
vec4 colour = texture(blockModelAtlas, uv + baseUV, ((flags>>1)&1u)*-4.0);
vec4 colour = texture(blockModelAtlas, texPos, ((flags>>1)&1u)*-5.0);//TODO: FIXME mipping needs to be fixed so that it doesnt go cross model bounds
//Also, small quad is really fking over the mipping level somehow
if ((flags&1u) == 1 && colour.a <= 0.25f) {
#ifndef DEBUG_RENDER
discard;
#endif
//This is stupidly stupidly bad for divergence
//TODO: FIXME, basicly what this do is sample the exact pixel (no lod) for discarding, this stops mipmapping fucking it over
if (texture(blockModelAtlas, texPos, -4.0).a <= 0.1f) {
#ifndef DEBUG_RENDER
discard;
#endif
}
}
//Conditional tinting, TODO: FIXME: REPLACE WITH MASK OR SOMETHING, like encode data into the top bit of alpha

View File

@@ -42,7 +42,7 @@ vec4 uint2vec4RGBA(uint colour) {
}
vec4 getFaceSize(uint faceData) {
float EPSILON = 0.001f;
float EPSILON = 0.0005f;
vec4 faceOffsetsSizes = extractFaceSizes(faceData);