diff --git a/shader.glsl b/shader.glsl index e956e7f..cbd16d1 100644 --- a/shader.glsl +++ b/shader.glsl @@ -102,8 +102,7 @@ SEA_WATER_COLOR =vec3(0.4,0.5,0.3); // with duration d, startTime s and speed up with timeFact float timedSine(vec3 i) { - i.y *= i.z; - return PI * min(((u_time * i.z) - i.y) / PI, i.x); + return min((u_time - i.y)*i.z, i.x*PI); } float calcFactor (float startTime) @@ -393,9 +392,8 @@ vec3 sceneGate(vec2 uv) if(mat==0.) col *= vec3(.3) + addSpecular(n,rd,0.5); - if(mat==1.){ + if(mat==1.) col = getSeaColor(p, n, normalize(vec3(0.0,0.3,0.8)),normalize(rd)); //col = vec3(0.,0.,.5); // + (noise(5.*(p.xy+2.)+u_time, -1.0) * noise(50.*(p.xy+2.), -0.4) + 0.5*noise(20.*(p.xy+2.0)-u_time, -0.5) * noise(5.*(p.xy+2.0), -0.75))*smoothstep(0.,0.75,(u_time-5.0)*0.1) + vec3(0.,0.,0.5*noise(10.*(p.xy+4.0)-u_time, -0.5)); - } if(mat==2.) col *= vec3(.3, .1, .0)+ addSpecular(n,rd,0.1); // - 0.2*noise((vec2(100.*p.x+300.,75.*p.z+150.0)), -2.2) * noise((vec2(15.*p.x+2.0,3.*p.z+2.)), -1.) + noise((vec2(15.*p.x+2.4,3.*p.z+2.)), -0.25); if(mat==3.)