ISF - Distortion - XYZoom
/*{
"CATEGORIES": [
"Distortion Effect",
"Geometry Adjustment"
],
"CREDIT": "VIDVOX",
"DESCRIPTION": null,
"INPUTS": [
{
"NAME": "inputImage",
"TYPE": "image"
},
{
"DEFAULT": 1,
"MAX": 10,
"MIN": 0.01,
"NAME": "levelX",
"TYPE": "float"
},
{
"DEFAULT": 1,
"MAX": 10,
"MIN": 0.01,
"NAME": "levelY",
"TYPE": "float"
},
{
"DEFAULT": [
0,
0
],
"MAX": [
1,
1
],
"MIN": [
0,
0
],
"NAME": "center",
"TYPE": "point2D"
}
],
"ISFVSN": "2",
"VSN": null
}
*/
void main() {
vec2 loc;
vec2 modifiedCenter;
loc = (isf_FragNormCoord.xy);
modifiedCenter = center;
loc.x = (loc.x - modifiedCenter.x)*(1.0/levelX) + modifiedCenter.x;
loc.y = (loc.y - modifiedCenter.y)*(1.0/levelY) + modifiedCenter.y;
if ((loc.x < 0.0)||(loc.y < 0.0)||(loc.x > 1.0)||(loc.y > 1.0)) {
gl_FragColor = vec4(0.0);
}
else {
gl_FragColor = IMG_NORM_PIXEL(inputImage,loc);
}
}