+ // 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
+
+#if FLIP_ORIGIN
+ coord.y = imageSize(tex_outbuf).y - coord.y - 1;
+#endif
+
+ imageStore(tex_outbuf, coord, val);