#define LIGHT #ifdef LIGHT #define LAYERS 30. #define DEPTH .5 #define WIDTH .3 #define SPEED .6 #define SIZE 0.2 #else #define LAYERS 200. #define DEPTH .1 #define WIDTH .8 #define SPEED 1.5 #define SIZE 1.0 #endif varying vec2 v_texCoords; uniform vec2 u_pos; uniform vec2 u_resolution; uniform float u_time; uniform sampler2D u_texture0; void main(){ gl_FragColor = texture2D(u_texture0, v_texCoords); vec2 uv = (v_texCoords * u_resolution + u_pos) / 1000.0; const mat3 p = mat3( 13.3231, 23.5112, 21.7112, 21.1212, 28.7312, 11.9312, 21.8112, 14.7212, 61.3934 ); float dof = 5.*sin(u_time*.1); //TODO this is very slow for(float i=0.0; i