uniform sampler2D background_tex; uniform sampler2D noise_tex; varying vec2 tex_coord; varying vec2 tex_coord2; void main() { vec4 uv_col = texture2D(noise_tex, tex_coord2.xy); vec4 uv_col2 = texture2D(noise_tex, tex_coord2.xy + vec2(0.3, 0.3)); // vec2 pos = tex_coord.xy; vec2 pos = tex_coord.xy + ((uv_col.rg-0.5) * (uv_col.b*.05)); vec2 pos2 = pos + vec2(0.3, 0.3); vec4 tex_col; vec4 tex_col2; // blur for(int i = -2; i <= 2; ++i) { tex_col += texture2D(background_tex, pos.xy + vec2(0, i*(1/128.0))); tex_col += texture2D(background_tex, pos.xy + vec2(i*(1/128.0), 0)); } tex_col *= 1.0/5.0; float r = -tex_coord.y; tex_col = mix(tex_col, vec4(r, r*0.5, 0, 1), r); tex_col2= texture2D(background_tex, pos.xy); // vec4 uv_col = vec4(tex_coord.x, tex_coord.y, 0, 1); gl_FragColor = mix(tex_col, tex_col2, clamp(pow(uv_col2.b*2, 1.5)/2.0, 0, 1.0)); // gl_FragColor = (tex_col + uv_col) * 0.5; }