//http://dept-info.labri.fr/~schlick/DOC/gem2.ps.gz float bias(float x, float b) { return x/((1./b-2.)*(1.-x)+1.); } float gain(float x, float g) { float t = (1./g-2.)*(1.-(2.*x)); return x<0.5 ? (x/(t+1.)) : (t-x)/(t-1.); } vec3 degamma(vec3 c) { return pow(c,vec3(2.2)); } vec3 gamma(vec3 c) { return pow(c,vec3(1./1.6)); } #define pi 3.1415927 void mainImage( out vec4 fragColor, in vec2 fragCoord ) { vec2 uv = fragCoord.xy / iResolution.xy; uv.y=1.-uv.y; uv.x *= iResolution.x / iResolution.y; float h = 0.; #if 1 float time = iGlobalTime; #else //go forwards and backwards! float time = mod(iGlobalTime,30.); if (time > 15.) time = 30.-time; #endif #define DIVS 8 for (int iy=0; iy