// Unimplemented uniforms // Resolution doesn't make sense in the VR context const vec3 iResolution = vec3(1.0); // Mouse functions not enabled currently const vec4 iMouse = vec4(0.0); // No support for audio input const float iSampleRate = 1.0; // No support for video input const vec4 iChannelTime = vec4(0.0); uniform float iGlobalTime; // shader playback time (in seconds) uniform vec4 iDate; uniform int iFrameCount; uniform vec3 iWorldPosition; // the position of the object being rendered uniform vec3 iWorldScale; // the dimensions of the object being rendered uniform mat3 iWorldOrientation; // the orientation of the object being rendered uniform vec3 iChannelResolution[4]; uniform sampler2D iChannel0; uniform sampler2D iChannel1; uniform sampler2D iChannel2; uniform sampler2D iChannel3; //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