LOADING
immagine_sfondo
//SKY SCELTA - FRAGMENT uniform float time; uniform float dissolve; uniform int modesky; varying vec2 vUv; uniform float amount; #define S(a, b, t) smoothstep(a, b, t) float random( vec2 p ) { vec2 K1 = vec2( 23.14069263277926, // e^pi (Gelfond’s constant) 2.665144142690225 // 2^sqrt(2) (Gelfond–Schneider constant) ); return fract( cos( dot(p,K1) ) * 12345.6789 ); } float N21(vec2 p) { return fract(sin(p.x*123.+p.y*3456.)*3524.); } vec2 N22(vec2 p) { return vec2(N21(p), N21(p+324.)); } float L(vec2 p, vec2 a, vec2 b) { vec2 pa = p-a; vec2 ba = b-a; // float t = clamp(dot(pa, ba)/dot(ba, ba), 0., 1.); float t = 0.; float d = length(pa - ba*t); float m = S(.12, .0, d); d = length(a-b); float f = S(1., .8, d); m *= f; m += m*S(.05, .06, abs(d - .75))*2.; return m; } vec2 GetPos(vec2 p, vec2 o) { p += o; vec2 n = N22(p)*time; p = sin(n)*.4; return o+p; } float G(vec2 uv) { vec2 id = floor(uv); uv = fract(uv)-.5; vec2 g = GetPos(id, vec2(0)); float m = 0.; for(float y=-1.; y<=1.; y++) { for(float x=-1.; x<=1.; x++) { vec2 offs = vec2(x, y); vec2 p = GetPos(id, offs); m+=L(uv, g, p);//METTE LE LINEE vec2 a = p-uv; //float flash = .003/dot(a, a); //flash *= pow( sin(N21(id+offs)*6.2831+10.*time)*.4+.6, 10.);//METTE LE STELLINE PULSANTI //flash *= pow( sin(time)*.5+.5, 3.); //m += flash; } } //m += L(uv, GetPos(id, vec2(-1, 0)), GetPos(id, vec2(0, -1)));//METTE LE LINEE //m += L(uv, GetPos(id, vec2(0, -1)), GetPos(id, vec2(1, 0)));//METTE LE LINEE //m += L(uv, GetPos(id, vec2(1, 0)), GetPos(id, vec2(0, 1)));//METTE LE LINEE //m += L(uv, GetPos(id, vec2(0, 1)), GetPos(id, vec2(-1, 0)));//METTE LE LINEE //float d = length(g-uv);//LEVA LE LINEE E METTE CERCHIETTI //m = S(.1, .08, d); return m; } void main( void ) { vec2 uv = (0.1*vUv.xy) / 1.; // vec2 uv = ( gl_FragCoord.xy-.5*varying vec2 vUv.xy*0.001) / 1.*0.001*position.y; float d = step(uv.y, 0.); //if(uv.y<0.) // uv.y = abs(uv.y); float m = 0.; m = 0.; float t = time*.2; float i=0.; //for(float i=0.; i<1.; i+=.4) {//da il numero di stelle float z = fract(i-t);//la t da il movimento e il verso float s = mix(10., .5, z);//i primi due danno la focale/profondita/zoom float f = S(0., .4, z)*S(1., .8, z);//regolano la dissolvenza delle linee m += G(uv*s+10.*i)*f; //} t *= 10.; vec3 base = vec3(0.06 ,0.12 ,0.49);//.5+sin(vec3(1., .56, .76)*t)*.5;//CAMBIA COLORE vec3 col = base; col *= m; col -= uv.y*base; col *= dissolve*(1.-dot(uv, uv)); //col *= mix(1., .5, d); //if(col.r<0.1){ vec2 uvRandom = uv; uvRandom.y *= random(vec2(uvRandom.y,1.)); col += random(uvRandom)*0.15*amount; gl_FragColor = vec4( col, 1.0 ); //} }
//SKY SCELTA - VERTEX uniform float time; uniform vec2 mouse; uniform vec2 resolution; uniform float dissolve; uniform int modesky; varying vec2 vUv; void main() { vUv = uv; vUv = vec2( position.x , position.y ); gl_Position = projectionMatrix * modelViewMatrix * vec4(position,1.0); }