#define SQUARE_ROOT_TRANSFORMATION 0
#endif
+#ifndef FLIP_ORIGIN
+#define FLIP_ORIGIN 0
+#endif
+
void main()
{
INPUT();
void cs_output(ivec2 coord, vec4 val)
{
+ // Run the value through any preprocessing steps we might have.
+ CS_OUTPUT_VAL = val;
+ val = CS_POSTPROC(vec2(0.0, 0.0));
+
#if SQUARE_ROOT_TRANSFORMATION
// Make sure we don't give negative values to sqrt.
val.rgb = sqrt(max(val.rgb, 0.0));
#endif
- imageStore(outbuf, coord, val);
+
+#if FLIP_ORIGIN
+ coord.y = imageSize(tex_outbuf).y - coord.y - 1;
+#endif
+
+ imageStore(tex_outbuf, coord, val);
}