[gtk+/wip/matthiasc/pipeline-layouts] Use simpler math for crossfade



commit 1a7faa5e6b8a32d06311b68f39063a340d28236b
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Sep 22 17:54:24 2017 -0400

    Use simpler math for crossfade
    
    Just mix it.

 .../vulkan/crossfade-clip-rounded.frag.spv         |  Bin 9060 -> 8656 bytes
 gsk/resources/vulkan/crossfade-clip.frag.spv       |  Bin 2168 -> 1716 bytes
 gsk/resources/vulkan/crossfade.frag                |    3 +--
 gsk/resources/vulkan/crossfade.frag.spv            |  Bin 2168 -> 1716 bytes
 4 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/gsk/resources/vulkan/crossfade-clip-rounded.frag.spv 
b/gsk/resources/vulkan/crossfade-clip-rounded.frag.spv
index ed3a07a..9154061 100644
Binary files a/gsk/resources/vulkan/crossfade-clip-rounded.frag.spv and 
b/gsk/resources/vulkan/crossfade-clip-rounded.frag.spv differ
diff --git a/gsk/resources/vulkan/crossfade-clip.frag.spv b/gsk/resources/vulkan/crossfade-clip.frag.spv
index 52177dd..0b0ac78 100644
Binary files a/gsk/resources/vulkan/crossfade-clip.frag.spv and 
b/gsk/resources/vulkan/crossfade-clip.frag.spv differ
diff --git a/gsk/resources/vulkan/crossfade.frag b/gsk/resources/vulkan/crossfade.frag
index b40d318..9058572 100644
--- a/gsk/resources/vulkan/crossfade.frag
+++ b/gsk/resources/vulkan/crossfade.frag
@@ -15,7 +15,6 @@ void main()
 {
   vec4 start = texture (startTexture, inTexCoord);
   vec4 end = texture (endTexture, inTexCoord);
-  float alpha = mix (start.a, end.a, inProgress);
 
-  color = clip (inPos, vec4(mix (start.rgb, end.rgb, inProgress) / alpha, alpha));
+  color = clip (inPos, mix (start, end, inProgress));
 }
diff --git a/gsk/resources/vulkan/crossfade.frag.spv b/gsk/resources/vulkan/crossfade.frag.spv
index 52177dd..0b0ac78 100644
Binary files a/gsk/resources/vulkan/crossfade.frag.spv and b/gsk/resources/vulkan/crossfade.frag.spv differ


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