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 0b150799..cf6ec1d8 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 @@ -108,6 +108,9 @@ public class PostProcessing { this.setSize(width, height); glBindFramebuffer(GL_FRAMEBUFFER, this.framebuffer.id); + + //glClearColor(0,0,0,0);//TODO: RESTORE THIS TO THE ORIGINAL VALUE + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); glBlitNamedFramebuffer(sourceFB, this.framebuffer.id, 0,0, width, height, 0,0, width, height, GL_DEPTH_BUFFER_BIT, GL_NEAREST); diff --git a/src/main/resources/assets/voxy/shaders/post/blit_texture_depth_cutout.frag b/src/main/resources/assets/voxy/shaders/post/blit_texture_depth_cutout.frag index 11727125..805e43ca 100644 --- a/src/main/resources/assets/voxy/shaders/post/blit_texture_depth_cutout.frag +++ b/src/main/resources/assets/voxy/shaders/post/blit_texture_depth_cutout.frag @@ -24,6 +24,10 @@ void main() { } float depth = texture(depthTex, UV.xy).r; + if (depth == 0.0f) { + discard; + } + depth = projDepth(rev3d(vec3(UV.xy, depth))); depth = min(1.0f-(2.0f/((1<<24)-1)), depth); depth = depth * 0.5f + 0.5f; diff --git a/src/main/resources/assets/voxy/shaders/post/ssao.comp b/src/main/resources/assets/voxy/shaders/post/ssao.comp index e291e1c9..61c0bf2c 100644 --- a/src/main/resources/assets/voxy/shaders/post/ssao.comp +++ b/src/main/resources/assets/voxy/shaders/post/ssao.comp @@ -53,7 +53,7 @@ void main() { point += scale*0.5f;//Offset to the center of the textile float depth = texture(depthTex, point).r; vec4 ocolour = vec4(0); - if (depth < 1.0f) { + if (depth!=0.0f && depth < 1.0f) { vec4 colour = texture(colourTex, point); if (colour == vec4(0.0f, 0.0f, 0.0f, 0.0f)) { ocolour = vec4(1.0f, 0.0f, 0.0f, 1.0f);