Fix resolve pass

This commit is contained in:
luboslenco 2019-04-16 13:30:35 +02:00
parent d4680b5e1a
commit 82235ef194
4 changed files with 15 additions and 11 deletions

View File

@ -395,4 +395,6 @@ void main() {
);
}
#endif // _Clusters
fragColor.a = 1.0; // Mark as opaque
}

View File

@ -46,15 +46,15 @@ vec3 textureBicubic(sampler2D tex, vec2 tc, vec2 texStep) {
return mix(mix(sample3, sample2, sx), mix(sample1, sample0, sx), sy);
}
vec3 textureSS(sampler2D tex, vec2 tc, vec2 texStep) {
vec3 col = texture(tex, tc).rgb;
col += texture(tex, tc + vec2(1.5, 0.0) * texStep).rgb;
col += texture(tex, tc + vec2(-1.5, 0.0) * texStep).rgb;
col += texture(tex, tc + vec2(0.0, 1.5) * texStep).rgb;
col += texture(tex, tc + vec2(0.0, -1.5) * texStep).rgb;
col += texture(tex, tc + vec2(1.5, 1.5) * texStep).rgb;
col += texture(tex, tc + vec2(-1.5, -1.5) * texStep).rgb;
col += texture(tex, tc + vec2(1.5, -1.5) * texStep).rgb;
col += texture(tex, tc + vec2(-1.5, 1.5) * texStep).rgb;
vec4 textureSS(sampler2D tex, vec2 tc, vec2 texStep) {
vec4 col = texture(tex, tc);
col += texture(tex, tc + vec2(1.5, 0.0) * texStep);
col += texture(tex, tc + vec2(-1.5, 0.0) * texStep);
col += texture(tex, tc + vec2(0.0, 1.5) * texStep);
col += texture(tex, tc + vec2(0.0, -1.5) * texStep);
col += texture(tex, tc + vec2(1.5, 1.5) * texStep);
col += texture(tex, tc + vec2(-1.5, -1.5) * texStep);
col += texture(tex, tc + vec2(1.5, -1.5) * texStep);
col += texture(tex, tc + vec2(-1.5, 1.5) * texStep);
return col / 9.0;
}

View File

@ -10,5 +10,5 @@ out vec4 fragColor;
void main() {
// 4X resolve
fragColor.rgb = textureSS(tex, texCoord, screenSizeInv / 4.0);
fragColor = textureSS(tex, texCoord, screenSizeInv / 4.0);
}

View File

@ -166,4 +166,6 @@ void main() {
#ifdef _LDR
fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2));
#endif
fragColor.a = 0.0; // Mark as non-opaque
}