attemped fix for ssao outline

This commit is contained in:
mcrcortex
2024-02-26 09:08:15 +10:00
parent 232eb228d7
commit 9df9b6fc89
3 changed files with 7 additions and 4 deletions

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);