uniform vec4 PREFIX(samples)[NUM_TAPS + 1];
vec4 FUNCNAME(vec2 tc) {
- vec4 sum = vec4(PREFIX(samples)[0].z) * LAST_INPUT(tc);
+ vec4 sum = vec4(PREFIX(samples)[0].z) * INPUT(tc);
for (int i = 1; i < NUM_TAPS + 1; ++i) {
vec4 sample = PREFIX(samples)[i];
- sum += vec4(sample.z) * (LAST_INPUT(tc - sample.xy) + LAST_INPUT(tc + sample.xy));
+ sum += vec4(sample.z) * (INPUT(tc - sample.xy) + INPUT(tc + sample.xy));
}
return sum;
}
// The matrix is computed on the host and baked into the shader at compile time.
vec4 FUNCNAME(vec2 tc) {
- vec4 x = LAST_INPUT(tc);
+ vec4 x = INPUT(tc);
x.rgb = PREFIX(conversion_matrix) * x.rgb;
return x;
}
frag_shader += replace_prefix(effects[i]->output_fragment_shader(), effect_id);
frag_shader += "#undef PREFIX\n";
frag_shader += "#undef FUNCNAME\n";
- frag_shader += "#undef LAST_INPUT\n";
- frag_shader += std::string("#define LAST_INPUT ") + effect_id + "\n";
+ frag_shader += "#undef INPUT\n";
+ frag_shader += std::string("#define INPUT ") + effect_id + "\n";
frag_shader += "\n";
input_needs_mipmaps |= effects[i]->needs_mipmaps();
void main()
{
- gl_FragColor = LAST_INPUT(tc);
+ gl_FragColor = INPUT(tc);
}
void main()
{
- tc = LAST_INPUT();
+ tc = INPUT();
gl_Position = ftransform();
}
// Compress to sRGB gamma curve.
vec4 FUNCNAME(vec2 tc) {
- vec4 x = LAST_INPUT(tc);
+ vec4 x = INPUT(tc);
x.r = texture1D(PREFIX(compression_curve_tex), x.r).x;
x.g = texture1D(PREFIX(compression_curve_tex), x.g).x;
// Expand sRGB gamma curve.
vec4 FUNCNAME(vec2 tc) {
- vec4 x = LAST_INPUT(tc);
+ vec4 x = INPUT(tc);
x.r = texture1D(PREFIX(expansion_curve_tex), x.r).x;
x.g = texture1D(PREFIX(expansion_curve_tex), x.g).x;
return texture2D(input_tex, tc.st);
}
-#define LAST_INPUT read_input
+#define INPUT read_input
return gl_MultiTexCoord0.st;
}
-#define LAST_INPUT read_input
+#define INPUT read_input
// Identity transformation (sometimes useful to do nothing).
vec4 FUNCNAME(vec2 tc)
{
- return LAST_INPUT(tc);
+ return INPUT(tc);
}
uniform vec3 PREFIX(inv_gamma_22); // 2.2 / gamma.
vec4 FUNCNAME(vec2 tc) {
- vec4 x = LAST_INPUT(tc);
+ vec4 x = INPUT(tc);
x.rgb = pow(x.rgb, vec3(1.0/2.2));
x.rgb += PREFIX(lift) * (vec3(1) - x.rgb);
vec4 FUNCNAME(vec2 tc)
{
tc.x = 1.0 - tc.x;
- return LAST_INPUT(tc);
+ return INPUT(tc);
}
vec4 FUNCNAME(vec2 tc) {
// Your code goes here, obviously.
// You can use PREFIX(parm) to access the parameter you gave in.
- return LAST_INPUT(tc);
+ return INPUT(tc);
}
// Saturate/desaturate (in linear space).
vec4 FUNCNAME(vec2 tc) {
- vec4 x = LAST_INPUT(tc);
+ vec4 x = INPUT(tc);
float luminance = dot(x.rgb, vec3(0.2126, 0.7152, 0.0722));
x.rgb = mix(vec3(luminance), x.rgb, PREFIX(saturation));
uniform vec2 PREFIX(aspect_correction);
vec4 FUNCNAME(vec2 tc) {
- vec4 x = LAST_INPUT(tc);
+ vec4 x = INPUT(tc);
const float pihalf = 0.5 * 3.14159265358979324;