diff --git a/4kdemo.compofiller b/4kdemo.compofiller index a1db361..baa5bd0 100644 --- a/4kdemo.compofiller +++ b/4kdemo.compofiller @@ -6,7 +6,7 @@ PROJECT_INFO_FILE=prod.nfo PROJECT_SCREENSHOT= # Currently active config file name -ACTIVE_CONFIG=base.config +ACTIVE_CONFIG=minified.config # ------- GUI options/preferences -------- # Automatically rebuild DLLs when things have changed? diff --git a/base.config b/base.config index fc411fc..2001a43 100644 --- a/base.config +++ b/base.config @@ -65,5 +65,5 @@ AUDIO_BUFFER_ALLOCATED_LENGTH=2830240 AUDIO_SAMPLING_RATE=44100 LOOP_END=28.0 LOOP_START=24.0 -LOOP_ENABLED=1 +LOOP_ENABLED=0 TIME_DIVIDER_INT=91241 diff --git a/minified.config b/minified.config index ef7e55b..bafe933 100644 --- a/minified.config +++ b/minified.config @@ -21,5 +21,3 @@ TWO_PASS_RENDERING=0 SECOND_PASS_NEGATIVE_TIME=0 USE_TEXTS=0 USE_TEXTS_UNIFORM=0 -RESOLUTION_X=1270 -RESOLUTION_Y=768 diff --git a/shader.glsl b/shader.glsl index 24b4d5a..e185076 100644 --- a/shader.glsl +++ b/shader.glsl @@ -252,7 +252,7 @@ float rayMarch(vec3 ro, vec3 rd, int a) { // Raymarching for (int i = 0; i < 100; i++) { d = map(ro + rd * t, 0); // Get distance to objects - if (a==0) glow += 0.05/(1.0 + 10.*pow(d.z, .5)); + if (a==0&&d.z<0.3) glow += 0.05/(1.0 + 10.*pow(d.z, .5)); t += d.x; // "march" the ray if (d.x < 1e-3 || t > 400.) break; } @@ -287,7 +287,10 @@ float specular(vec3 normal,vec3 lightPos,vec3 rayOrigin,float specular) { } vec3 getSeaColor(vec3 p, vec3 n, vec3 l, vec3 eye) { + vec3 color = SEA_BASE + diffuse(n,l,60.0) * SEA_WATER_COLOR * 0.3; + float fresnel = pow(clamp(1.-dot(n, -eye), 0., 1.), .9); + color -= vec3(0.73, 0.15, 0.66) * fresnel; color += vec3(specular(n,l,eye,60.0))*0.2; return color; } @@ -407,8 +410,8 @@ vec3 sceneGate(vec2 uv) col *= vec3(0.21, 0.35, 0.33) + addSpecular(n,rd,.5, 2.); if(mat==1.) { - float fresnel = pow(clamp(1.-dot(n, -rd), 0., 1.), 0.6); - col = getSeaColor(p, n, no(vec3(0.0,0.3,0.8)),no(rd)) - vec3(1., 1.0 ,1.) * fresnel; + //float fresnel = pow(clamp(1.-dot(n, -rd), 0., 1.), .5); + col = getSeaColor(p, n, no(vec3(0.0,0.3,0.8)),no(rd)); //+ vec3(1., 1.0 ,1.); * fresnel; } if(mat==2.) col *= vec3(.8, .8, .5); @@ -417,7 +420,7 @@ vec3 sceneGate(vec2 uv) if(mat==4.) col *= vec3(0.0, 0.08, 0.11) + addSpecular(n,rd,0.3,0.7); if(mat ==5.) - col = chevronColor*0.4 * pow(cl(1. -dot(n, -rd), 0., 1.), .3); + col = chevronColor*0.4;// * pow(cl(1. -dot(n, -rd), 0., 1.), .3); if(mat == 6.) col *= vec3(0.01, 0.04, 0.06) + addSpecular(n,rd,.1, 2.5); } diff --git a/shader_minified.h b/shader_minified.h index 7e77dcf..88b8607 100644 --- a/shader_minified.h +++ b/shader_minified.h @@ -24,8 +24,8 @@ const char *__temp_cleaned_shader_glsl = "}" "float n(float v,float y,float m)" "{" - "float f=max(m-abs(v-y),0.);" - "return max(v,y)+f*f*.25/m;" + "float z=max(m-abs(v-y),0.);" + "return max(v,y)+z*z*.25/m;" "}" "float f(vec2 v,int y)" "{" @@ -117,7 +117,7 @@ const char *__temp_cleaned_shader_glsl = "float F=1.5,e=0.,b,g=4.,E=.6,D=.2;" "for(int i=0;i<4;i++)" "p=n(vec3(v.x,v.y+F+.05,v.z),vec3(2,.2,F))-.05,l=min(l,p),F+=.2;" - "l+=x(v.xz*50.+2e2,.01,0);" + "l+=x(v.xz*50.+2e2,.01,0)-x(v.yz*2.+1.5,.15,0);" "c=min(c,l);" "if(c==l)" "z=2.;" @@ -159,21 +159,22 @@ const char *__temp_cleaned_shader_glsl = "z=4.;" "if(c==f)" "if(y>p+.2)" - "z=5.,i=f;" + "z=5.,i=min(l,f);" "}" "}" "return vec3(c,z,i);" "}" "float t(vec3 v,vec3 y,int f)" "{" - "float m,i=0.;" + "vec3 m;" + "float i=0.;" "for(int c=0;c<100;c++)" "{" - "m=x(v+y*i,0).x;" - "if(f==0)" - "z+=.05/(1.+10.*pow(x(v+y*i,0).z,.5));" - "i+=m;" - "if(m<1e-4||i>6e2)" + "m=x(v+y*i,0);" + "if(f==0&&m.z<.3)" + "z+=.05/(1.+10.*pow(m.z,.5));" + "i+=m.x;" + "if(m.x<.001||i>4e2)" "break;" "}" "return i;" @@ -183,13 +184,13 @@ const char *__temp_cleaned_shader_glsl = "vec2 y=vec2(.01,0);" "return f(x(v,1).x-vec3(x(v-y.xyy,1).x,x(v-y.yxy,1).x,x(v-y.yyx,1)));" "}" - "float f(vec3 v,vec3 y,float m,vec3 c)" + "float f(vec3 v,vec3 y,float m,vec3 z)" "{" "float i=1.;" "vec3 l=f(y-v);" - "i=f(dot(c,l),0.,i);" - "float d=t(v+c*.0025,l,1);" - "if(d