X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=shaders%2Fsky.fs;h=036f2445001ed8ccfddf0a2c9aee0cf165dda6da;hb=a1adba47558099cab82aa6d10abdc1dca11d3342;hp=9e08967b1a741cdfaa6fdd14e909667737423600;hpb=afa80c76d03f5e983092e9d7be33a9102a7ab25e;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/shaders/sky.fs b/shaders/sky.fs index 9e08967..036f244 100644 --- a/shaders/sky.fs +++ b/shaders/sky.fs @@ -1,4 +1,4 @@ -out vec4 FragColor; +layout (location = 0) out vec4 oColour; uniform vec4 uColour; uniform sampler2D uTexGarbage; @@ -9,28 +9,29 @@ in vec2 aUv; in vec3 aNorm; in vec3 aCo; +#include "motion_vectors_fs.glsl" + void main() { + compute_motion_vectors(); + float fintensity = 1.0-(abs(aNorm.y)*0.7); - float angle = -dot(vec3(0.95,0.0,-0.3),aNorm)*0.5+0.5; - float fblend = pow(fintensity,6.0) * angle; - vec3 horizon = vec3(0.9,0.9,0.8); - vec3 skycolour = vec3(0.4,0.5,0.8); + float fblend = pow(fintensity,4.0); + vec3 horizon = vec3( 0.8, 0.9, 0.9 ); + vec3 skycolour = vec3( 0.5, 0.6, 0.9 ); vec3 diffuse = mix( skycolour, horizon, fblend ); - float fmove = uTime * 0.001; - vec2 cloudplane = (aCo.xz / (aCo.y*sign(aNorm.y))) * 0.03; + float fmove = uTime * 0.004; + vec2 cloudplane = (aNorm.xz / (aNorm.y*sign(aNorm.y))) * 0.05; vec4 clouds1 = texture( uTexGarbage, cloudplane + vec2(0.1,0.4)*fmove*2.0 ); vec4 clouds2 = texture( uTexGarbage, cloudplane + vec2(0.3,0.1)*fmove ); float cloud_d = max(clouds1.b*clouds2.r -0.2 - clouds2.g*0.4,0.0); - float cloud_e = pow(cloud_d,1.8)*pow(abs(aNorm.y),0.3)*2.0; + float cloud_e = pow(cloud_d,1.5)*pow(abs(aNorm.y),0.3)*2.0; vec3 colour_ocean = vec3( 0.61, 0.84, 0.9 ); float fhorizon = step( aNorm.y * 0.5 + 0.5, 0.5 ); - vec3 skycomp = mix(diffuse, vec3(1.0), cloud_e); - skycomp = mix(mix(pow(colour_ocean,vec3(6.0))*0.6,skycomp, 0.7),skycomp,fhorizon); - - FragColor = vec4(skycomp, 1.0); + vec3 skycomp = mix(diffuse, vec3(1.0,1.0,1.0), cloud_e); + oColour = vec4(pow(skycomp, vec3(1.5)),1.0); }