update model format
[carveJwlIkooP6JGAAIwe30JlM.git] / shaders / sky.h
index 653173ec8d4d617d59b549527daa8a78ea64c9c3..0abd65a1b12b5291217b3d5db3188ac4cc073e6d 100644 (file)
@@ -7,12 +7,14 @@ static struct vg_shader _shader_sky = {
    .link = shader_sky_link,
    .vs = 
 {
-.orig_file = "../shaders/standard.vs",
+.orig_file = "../../shaders/standard.vs",
 .static_src = 
 "layout (location=0) in vec3 a_co;\n"
 "layout (location=1) in vec3 a_norm;\n"
-"layout (location=2) in vec4 a_colour;\n"
-"layout (location=3) in vec2 a_uv;\n"
+"layout (location=2) in vec2 a_uv;\n"
+"layout (location=3) in vec4 a_colour;\n"
+"layout (location=4) in vec4 a_weights;\n"
+"layout (location=5) in ivec4 a_groups;\n"
 "\n"
 "#line      2        0 \n"
 "\n"
@@ -23,19 +25,22 @@ static struct vg_shader _shader_sky = {
 "out vec2 aUv;\n"
 "out vec3 aNorm;\n"
 "out vec3 aCo;\n"
+"out vec3 aWorldCo;\n"
 "\n"
 "void main()\n"
 "{\n"
-"   gl_Position = uPv * vec4( uMdl * vec4(a_co,1.0), 1.0 );\n"
+"   vec3 world_pos = uMdl * vec4(a_co,1.0);\n"
+"   gl_Position = uPv * vec4( world_pos, 1.0 );\n"
 "   aColour = a_colour;\n"
 "   aUv = a_uv;\n"
 "   aNorm = mat3(uMdl) * a_norm;\n"
 "   aCo = a_co;\n"
+"   aWorldCo = world_pos;\n"
 "}\n"
 ""},
    .fs = 
 {
-.orig_file = "../shaders/sky.fs",
+.orig_file = "../../shaders/sky.fs",
 .static_src = 
 "out vec4 FragColor;\n"
 "\n"
@@ -51,13 +56,13 @@ static struct vg_shader _shader_sky = {
 "void main()\n"
 "{\n"
 "   float fintensity = 1.0-(abs(aNorm.y)*0.7);\n"
-"   float fblend = pow(fintensity,6.0);\n"
-"   vec3 horizon = vec3( 0.61, 0.71, 0.86 )*1.5;\n"
-"   vec3 skycolour = vec3( 0.31, 0.56, 0.91 );\n"
+"   float fblend = pow(fintensity,4.0);\n"
+"   vec3 horizon = vec3( 0.8, 0.9, 0.9 );\n"
+"   vec3 skycolour = vec3( 0.5, 0.6, 0.9 );\n"
 "   vec3 diffuse = mix( skycolour, horizon, fblend );\n"
 "\n"
 "   float fmove = uTime * 0.004;\n"
-"   vec2 cloudplane = (aCo.xz / (aCo.y*sign(aNorm.y))) * 0.03;\n"
+"   vec2 cloudplane = (aNorm.xz / (aNorm.y*sign(aNorm.y))) * 0.05;\n"
 "   vec4 clouds1 = texture( uTexGarbage, cloudplane + vec2(0.1,0.4)*fmove*2.0 );\n"
 "   vec4 clouds2 = texture( uTexGarbage, cloudplane + vec2(0.3,0.1)*fmove );\n"
 "\n"
@@ -68,9 +73,7 @@ static struct vg_shader _shader_sky = {
 "   float fhorizon = step( aNorm.y * 0.5 + 0.5, 0.5 );\n"
 "\n"
 "   vec3 skycomp = mix(diffuse, vec3(1.0,1.0,1.0), cloud_e);\n"
-"   skycomp = mix(mix(pow(colour_ocean,vec3(6.0))*0.6,skycomp, 0.7),skycomp,fhorizon);\n"
-"\n"
-"   FragColor = vec4(skycomp, 0.0);\n"
+"   FragColor = vec4(pow(skycomp, vec3(1.5)),1.0);\n"
 "}\n"
 ""},
 };