diff pytouhou/ui/shaders/eosd.py @ 462:a71b912b45b7

Render to framebuffers first, and reposition some interface elements in the game area.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 11 Sep 2013 00:36:50 +0200
parents 3ce4065840e9
children
line wrap: on
line diff
--- a/pytouhou/ui/shaders/eosd.py
+++ b/pytouhou/ui/shaders/eosd.py
@@ -90,3 +90,34 @@ class BackgroundShader(Shader):
                 gl_FragColor = vec4(mix(fog_color, temp_color, fog_density).rgb, temp_color.a);
             }
         '''])
+
+
+class PassthroughShader(Shader):
+    def __init__(self):
+        Shader.__init__(self, ['''
+            #version 120
+
+            attribute vec2 in_position;
+            attribute vec2 in_texcoord;
+
+            uniform mat4 mvp;
+
+            varying vec2 texcoord;
+
+            void main()
+            {
+                gl_Position = mvp * vec4(in_position, 0.0, 1.0);
+                texcoord = in_texcoord;
+            }
+        '''], ['''
+            #version 120
+
+            varying vec2 texcoord;
+
+            uniform sampler2D color_map;
+
+            void main()
+            {
+                gl_FragColor = texture2D(color_map, texcoord);
+            }
+        '''])