comparison 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
comparison
equal deleted inserted replaced
461:6af3854ed826 462:a71b912b45b7
88 float depth = gl_FragCoord.z / gl_FragCoord.w; 88 float depth = gl_FragCoord.z / gl_FragCoord.w;
89 float fog_density = clamp((fog_end - depth) * fog_scale, 0.0f, 1.0f); 89 float fog_density = clamp((fog_end - depth) * fog_scale, 0.0f, 1.0f);
90 gl_FragColor = vec4(mix(fog_color, temp_color, fog_density).rgb, temp_color.a); 90 gl_FragColor = vec4(mix(fog_color, temp_color, fog_density).rgb, temp_color.a);
91 } 91 }
92 ''']) 92 '''])
93
94
95 class PassthroughShader(Shader):
96 def __init__(self):
97 Shader.__init__(self, ['''
98 #version 120
99
100 attribute vec2 in_position;
101 attribute vec2 in_texcoord;
102
103 uniform mat4 mvp;
104
105 varying vec2 texcoord;
106
107 void main()
108 {
109 gl_Position = mvp * vec4(in_position, 0.0, 1.0);
110 texcoord = in_texcoord;
111 }
112 '''], ['''
113 #version 120
114
115 varying vec2 texcoord;
116
117 uniform sampler2D color_map;
118
119 void main()
120 {
121 gl_FragColor = texture2D(color_map, texcoord);
122 }
123 '''])