[gtk] gl renderer: Properly apply opacity in cross-fade shader
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] gl renderer: Properly apply opacity in cross-fade shader
- Date: Wed, 24 Apr 2019 11:33:54 +0000 (UTC)
commit 34fcfb154ab2e0cd1d51120a9b11a83b4868c9ad
Author: Timm Bäder <mail baedert org>
Date: Wed Apr 24 12:56:23 2019 +0200
gl renderer: Properly apply opacity in cross-fade shader
gsk/resources/glsl/cross_fade.fs.glsl | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gsk/resources/glsl/cross_fade.fs.glsl b/gsk/resources/glsl/cross_fade.fs.glsl
index 8f0f4115f4..612673bf66 100644
--- a/gsk/resources/glsl/cross_fade.fs.glsl
+++ b/gsk/resources/glsl/cross_fade.fs.glsl
@@ -6,7 +6,8 @@ void main() {
vec4 source1 = Texture(u_source, vUv); // start child
vec4 source2 = Texture(u_source2, vUv); // end child
- float p = u_progress;
- vec4 color = ((1.0 - p) * source1) + (p * source2);
+ float p_start = (1.0 - u_progress) * u_alpha;
+ float p_end = u_progress * u_alpha;
+ vec4 color = (p_start * source1) + (p_end * source2);
setOutputColor(color);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]