bladedpenguin
"This does everything I need, but I think it would be good if I could reverse it somehow, so the faded part shows up at the bottom."
Use the following to reverse it-
/////////////////////////////////////////////////////////
// Opacity Gradient effect
varying mediump vec2 vTex;
uniform lowp sampler2D samplerFront;
//uniform lowp float pixelWidth; not needed //
//uniform lowp float pixelHeight; not needed //
uniform lowp float opacityx;
uniform lowp float heightx;
uniform lowp float opacityy;
uniform lowp float heighty;
void main(void)
{
lowp vec4 front = texture2D(samplerFront, vTex);
mediump float ay = (1.-vTex.y) *((1. - opacityy) / heighty) + opacityy;
mediump float ax = vTex.x*((1. - opacityx) / heightx) + opacityx;
gl_FragColor = front*min(ax*ay,1.0);
}
------------------------------
This bit ... (1.-vTex.y).... Flips it.