#define PI 3.141592 #define EPS 0.005 #define ITERS_RAY 17 #define ITERS_NORMAL 45 #define W_DEPTH 2.2 #define W_SPEED 1.4 #define W_DETAIL .75 const mat2 rot = mat2(cos(12.),sin(12.),-sin(12.),cos(12.)); vec3 srf(vec2 pos, int n, float time) { pos *= W_DEPTH; float freq = 0.6; float t = W_SPEED*time; float weight = 1.0; float w = 0.0; vec2 dx = vec2(0); vec2 dir = vec2(1,0); for(int i=0;i