[gtk+/wip/ebassi/gsk-renderer] gsk: Use consistent naming for blend fragment shader



commit 12f0bdd29b010ea6e21bb19ad894794e84568707
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri Jul 8 16:26:44 2016 +0100

    gsk: Use consistent naming for blend fragment shader
    
    This should make it immediately clear if we're doing something wrong.

 gsk/resources/glsl/blend.fs.glsl |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/gsk/resources/glsl/blend.fs.glsl b/gsk/resources/glsl/blend.fs.glsl
index d632e58..cf1c256 100644
--- a/gsk/resources/glsl/blend.fs.glsl
+++ b/gsk/resources/glsl/blend.fs.glsl
@@ -28,35 +28,35 @@ vec3 BlendLighten(vec3 Cb, vec3 Cs) {
 }
 
 void main() {
-  vec4 mask = Texture(parentMap, vUv);
-  vec4 diffuse = Texture(map, vUv);
+  vec4 Cb = Texture(parentMap, vUv);
+  vec4 Cs = Texture(map, vUv);
   vec3 res;
 
   if (blendMode == 0) {
-    res = diffuse.xyz;
+    res = Cs.xyz;
   }
   else if (blendMode == 1) {
-    res = BlendMultiply(mask.xyz, diffuse.xyz);
+    res = BlendMultiply(Cb.xyz, Cs.xyz);
   }
   else if (blendMode == 2) {
-    res = BlendScreen(mask.xyz, diffuse.xyz);
+    res = BlendScreen(Cb.xyz, Cs.xyz);
   }
   else if (blendMode == 3) {
-    res = BlendOverlay(mask.xyz, diffuse.xyz);
+    res = BlendOverlay(Cb.xyz, Cs.xyz);
   }
   else if (blendMode == 4) {
-    res = BlendDarken(mask.xyz, diffuse.xyz);
+    res = BlendDarken(Cb.xyz, Cs.xyz);
   }
   else if (blendMode == 5) {
-    res = BlendLighten(mask.xyz, diffuse.xyz);
+    res = BlendLighten(Cb.xyz, Cs.xyz);
   }
   else if (blendMode == 8) {
-    res = BlendHardLight(mask.xyz, diffuse.xyz);
+    res = BlendHardLight(Cb.xyz, Cs.xyz);
   }
   else {
     // Use red for debugging missing blend modes
     res = vec3(1.0, 0.0, 0.0);
   }
 
-  setOutputColor(vec4(res, diffuse.a * alpha));
+  setOutputColor(vec4(res, Cs.a * alpha));
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]