diff --git a/src/main/java/me/cortex/voxy/client/core/rendering/post/PostProcessing.java b/src/main/java/me/cortex/voxy/client/core/rendering/post/PostProcessing.java index 37fdf9b8..8aaab9bf 100644 --- a/src/main/java/me/cortex/voxy/client/core/rendering/post/PostProcessing.java +++ b/src/main/java/me/cortex/voxy/client/core/rendering/post/PostProcessing.java @@ -71,6 +71,8 @@ public class PostProcessing { glTextureParameterf(this.colour.id, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTextureParameterf(this.colourSSAO.id, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTextureParameterf(this.colourSSAO.id, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + //glTextureParameterf(this.depthStencil.id, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + //glTextureParameterf(this.depthStencil.id, GL_TEXTURE_MAG_FILTER, GL_NEAREST); this.framebuffer.bind(GL_COLOR_ATTACHMENT0, this.colour); this.framebuffer.bind(GL_DEPTH_STENCIL_ATTACHMENT, this.depthStencil); diff --git a/src/main/resources/assets/voxy/shaders/lod/gl46/quads.vert b/src/main/resources/assets/voxy/shaders/lod/gl46/quads.vert index fc274718..01cd4956 100644 --- a/src/main/resources/assets/voxy/shaders/lod/gl46/quads.vert +++ b/src/main/resources/assets/voxy/shaders/lod/gl46/quads.vert @@ -49,6 +49,7 @@ void main() { uint modelId = extractStateId(quad); BlockModel model = modelData[modelId]; uint faceData = model.faceData[face]; + bool isTranslucent = modelIsTranslucent(model); bool hasAO = modelHasMipmaps(model);//TODO: replace with per face AO flag bool isShaded = hasAO;//TODO: make this a per face flag //Change the ordering due to backface culling @@ -115,7 +116,7 @@ void main() { } addin = vec4(0.0); - if (!modelIsTranslucent(model)) { + if (!isTranslucent) { tinting.w = 0.0; //Encode the face, the lod level and uint encodedData = 0; diff --git a/src/main/resources/assets/voxy/shaders/post/ssao.comp b/src/main/resources/assets/voxy/shaders/post/ssao.comp index bca4c205..8adec458 100644 --- a/src/main/resources/assets/voxy/shaders/post/ssao.comp +++ b/src/main/resources/assets/voxy/shaders/post/ssao.comp @@ -19,11 +19,11 @@ vec4 reDeProject(vec3 pos) { vec2 UV = clamp(view.xy*0.5+0.5, 0.0, 1.0); //TODO: sample the colour texture and check if the alpha has the hasAO flag - float depth = texture(depthTex, UV).x; + float depth = texture(depthTex, UV, -4.0f).x; if (depth == 1.0f) { return vec4(-1.0f); } - uint meta = uint(255.0f*texture(colourTex, UV).w); + uint meta = uint(255.0f*texture(colourTex, UV, -4.0f).w); if ((meta>>6)==0) { return vec4(-1.0f); } @@ -49,7 +49,7 @@ void main() { return; } vec2 point = vec2(gl_GlobalInvocationID.xy)/size; - float depth = texture(depthTex, point).r; + float depth = texture(depthTex, point, -4.0f).r; vec4 ocolour = vec4(0); if (depth < 1.0f) { vec4 colour = texture(colourTex, point);