ISF - Distortion - Mirror
/*{
"CREDIT": "VIDVOX",
"ISFVSN": "2",
"CATEGORIES": [
"Geometry Adjustment"
],
"INPUTS": [
{
"NAME": "inputImage",
"TYPE": "image"
},
{
"NAME": "horizontal",
"TYPE": "bool",
"DEFAULT": 1
},
{
"NAME": "vertical",
"TYPE": "bool",
"DEFAULT": 0
}
]
}*/
void main() {
// (isf_FragNormCoord.xy)[0] and (isf_FragNormCoord.xy)[1] are my normalized x/y coordinates
// if we're not doing a flip in either direction we can just pass thru
vec2 normSrcCoord;
normSrcCoord.x = (isf_FragNormCoord.xy)[0];
normSrcCoord.y = (isf_FragNormCoord.xy)[1];
if ((normSrcCoord.x > 0.5)&&(horizontal)) {
normSrcCoord.x = (1.0-normSrcCoord.x);
}
if ((normSrcCoord.y > 0.5)&&(vertical)) {
normSrcCoord.y = (1.0-normSrcCoord.y);
}
gl_FragColor = IMG_NORM_PIXEL(inputImage, normSrcCoord);
}