ISF - Distortion - Trapezoid Distortion
void main() {
vec4 inputPixelColor = vec4(0.0);
vec2 loc = (isf_FragNormCoord.xy).xy;
if (heightScale > 0.0) {
float heightDivisor = 1.0 / heightScale;
loc.y = loc.y * heightDivisor + (1.0 - heightDivisor) / 2.0;
float currentLineWidth = mix(bottomWidth,topWidth,loc.y);
if (currentLineWidth > 0.0) {
float lwDivisor = 1.0 / currentLineWidth;
loc.x = loc.x * lwDivisor + (1.0 - lwDivisor) / 2.0;
if ((loc.x >= 0.0)&&(loc.x <= 1.0)&&(loc.y >= 0.0)&&(loc.y <= 1.0)) {
inputPixelColor = IMG_NORM_PIXEL(inputImage,loc);
}
}
}
gl_FragColor = inputPixelColor;
}