+SHADER_DEFINE( shader_post_darken,
+ "layout (location=0) in vec2 a_co;"
+ "out vec2 aTexCoords;"
+ ""
+ "void main()"
+ "{"
+ "gl_Position = vec4( a_co * 2.0 - 1.0, 0.0, 1.0 );"
+ "aTexCoords = a_co;"
+ "}",
+
+ "uniform sampler2D uTexMain;"
+ "out vec4 FragColor;"
+ ""
+ "in vec2 aTexCoords;"
+ ""
+ "void main()"
+ "{"
+ "vec4 texture_sample = texture( uTexMain, aTexCoords );"
+ "FragColor = vec4(pow(texture_sample.rgb,vec3(2.2)), 1.0);"
+ "}"
+ ,
+ UNIFORMS({"uTexMain"})
+)
+
+SHADER_DEFINE( shader_post_blur,
+ "layout (location=0) in vec2 a_co;"
+ "out vec2 aTexCoords;"
+ ""
+ "void main()"
+ "{"
+ "gl_Position = vec4( a_co * 2.0 - 1.0, 0.0, 1.0 );"
+ "aTexCoords = a_co;"
+ "}",
+
+ "uniform sampler2D uTexMain;"
+ "uniform vec2 uDir;"
+ "out vec4 FragColor;"
+ ""
+ "in vec2 aTexCoords;"
+ ""
+ "void main()"
+ "{"
+ "vec4 colour = vec4(0.0);"
+
+ "vec2 off1 = vec2(1.411764705882353) * uDir;"
+ "vec2 off2 = vec2(3.2941176470588234) * uDir;"
+ "vec2 off3 = vec2(5.176470588235294) * uDir;"
+ "colour += texture2D( uTexMain, aTexCoords ) * 0.1964825501511404;"
+ "colour += texture2D( uTexMain, aTexCoords + off1 ) * 0.2969069646728344;"
+ "colour += texture2D( uTexMain, aTexCoords - off1 ) * 0.2969069646728344;"
+ "colour += texture2D( uTexMain, aTexCoords + off2 ) * 0.09447039785044732;"
+ "colour += texture2D( uTexMain, aTexCoords - off2 ) * 0.09447039785044732;"
+ "colour += texture2D( uTexMain, aTexCoords + off3 ) * 0.010381362401148057;"
+ "colour += texture2D( uTexMain, aTexCoords - off3 ) * 0.010381362401148057;"
+ "FragColor = colour;"
+ "}"
+ ,
+ UNIFORMS({"uTexMain","uDir"})
+)
+
+SHADER_DEFINE( shader_post_comp,
+ "layout (location=0) in vec2 a_co;"
+ "out vec2 aTexCoords;"
+ ""
+ "void main()"
+ "{"
+ "gl_Position = vec4( a_co * 2.0 - 1.0, 0.0, 1.0 );"
+ "aTexCoords = a_co;"
+ "}",
+
+ "uniform sampler2D uTexMain;"
+ "uniform sampler2D uTexBloom;"
+ "uniform vec2 uComp;" /* x: bloom, y: vignette */
+ "out vec4 FragColor;"
+ ""
+ "in vec2 aTexCoords;"
+ ""
+ "void main()"
+ "{"
+ "vec4 texture_sample = texture( uTexMain, aTexCoords );"
+ "vec4 bloom_sample = texture( uTexBloom, aTexCoords );"
+
+ "vec2 vigCoord = aTexCoords - 0.5;"
+ "float vig = pow(1.0 - dot( vigCoord, vigCoord ), 2.0);"
+
+ "FragColor = (texture_sample + bloom_sample*0.3*uComp.x)"
+ " * max(uComp.y, vig);"
+ "}"
+ ,
+ UNIFORMS({"uTexMain", "uTexBloom", "uComp"})
+)
+