Skip to content

Commit d0f984a

Browse files
committed
Improve output alpha calculation
Addresses #719
1 parent d7c4536 commit d0f984a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/effects/shaders/bloom.frag

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ uniform float intensity;
1212

1313
vec4 mainImage(const in vec4 inputColor, const in vec2 uv, const in GData gData) {
1414

15-
vec3 texel = texture(map, uv).rgb;
16-
return vec4(texel * intensity, inputColor.a);
15+
vec4 texel = texture(map, uv);
16+
return vec4(texel.rgb * intensity, max(inputColor.a, texel.a));
1717

1818
}

src/effects/shaders/texture.frag

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ vec4 mainImage(const in vec4 inputColor, const in vec2 uv, const in GData gData)
2626

2727
#endif
2828

29-
return TEXEL;
29+
vec4 result = TEXEL;
30+
return vec4(result.rgb, max(inputColor.a, result.a));
3031

3132
}

0 commit comments

Comments
 (0)