summaryrefslogtreecommitdiff
path: root/Data/Sys
diff options
context:
space:
mode:
authorflacs <tilkax@gmail.com>2015-06-02 20:55:30 +0200
committerflacs <tilkax@gmail.com>2015-06-02 20:55:30 +0200
commit2b5945ae07dbbf46e6e38d2524bf2112ef2b6324 (patch)
tree5f12e47072c0e7aaeab97cf9bc13dbc5580f3aac /Data/Sys
parent7d29039c4869a7a88a12147a29f1dd06581c392f (diff)
parent0fdd3ecdfe5fd6ccbbb7c7f90c80a14a49d99c4b (diff)
Merge pull request #2491 from TijmenW/master
add shaders for anaglyph Amber-Blue and Green-Magenta
Diffstat (limited to 'Data/Sys')
-rw-r--r--Data/Sys/Shaders/Anaglyph/dubois-LCD-Amber-Blue.glsl17
-rw-r--r--Data/Sys/Shaders/Anaglyph/dubois-LCD-Green-Magenta.glsl17
2 files changed, 34 insertions, 0 deletions
diff --git a/Data/Sys/Shaders/Anaglyph/dubois-LCD-Amber-Blue.glsl b/Data/Sys/Shaders/Anaglyph/dubois-LCD-Amber-Blue.glsl
new file mode 100644
index 0000000000..315cfb95ad
--- /dev/null
+++ b/Data/Sys/Shaders/Anaglyph/dubois-LCD-Amber-Blue.glsl
@@ -0,0 +1,17 @@
+// Anaglyph Amber-Blue shader based on Dubois algorithm
+// Constants taken from the screenshot:
+// "https://www.flickr.com/photos/e_dubois/5230654930/"
+// Eric Dubois
+
+void main()
+{
+ float4 c0 = SampleLayer(0);
+ float4 c1 = SampleLayer(1);
+ mat3 l = mat3( 1.062,-0.205, 0.299,
+ -0.026, 0.908, 0.068,
+ -0.038,-0.173, 0.022);
+ mat3 r = mat3(-0.016,-0.123,-0.017,
+ 0.006, 0.062, 0.017,
+ -0.094,-0.185, 0.991);
+ SetOutput(float4(c0.rgb * l + c1.rgb * r, c0.a));
+}
diff --git a/Data/Sys/Shaders/Anaglyph/dubois-LCD-Green-Magenta.glsl b/Data/Sys/Shaders/Anaglyph/dubois-LCD-Green-Magenta.glsl
new file mode 100644
index 0000000000..4c80813894
--- /dev/null
+++ b/Data/Sys/Shaders/Anaglyph/dubois-LCD-Green-Magenta.glsl
@@ -0,0 +1,17 @@
+// Anaglyph Green-Magenta shader based on Dubois algorithm
+// Constants taken from the screenshot:
+// "https://www.flickr.com/photos/e_dubois/5132528166/"
+// Eric Dubois
+
+void main()
+{
+ float4 c0 = SampleLayer(0);
+ float4 c1 = SampleLayer(1);
+ mat3 l = mat3(-0.062,-0.158,-0.039,
+ 0.284, 0.668, 0.143,
+ -0.015,-0.027, 0.021);
+ mat3 r = mat3( 0.529, 0.705, 0.024,
+ -0.016,-0.015, 0.065,
+ 0.009, 0.075, 0.937);
+ SetOutput(float4(c0.rgb * l + c1.rgb * r, c0.a));
+}