X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=shaders%2Fterrain.h;h=8b9452e09c96bb0f65adf1ed11a9a4f5db509de5;hb=a6708cef5099c83ff14816442de0954934f10276;hp=cf32d5ea5c5bc49bc2c103ca19e8154c2531474e;hpb=403726131f9b460c3264e4f64c46f8aaa82978fe;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/shaders/terrain.h b/shaders/terrain.h index cf32d5e..8b9452e 100644 --- a/shaders/terrain.h +++ b/shaders/terrain.h @@ -17,7 +17,7 @@ static struct vg_shader _shader_terrain = { "\n" "#line 2 0 \n" "#line 1 2 \n" -"const float k_motion_lerp_amount = 0.05;\n" +"const float k_motion_lerp_amount = 0.01;\n" "\n" "#line 2 0 \n" "\n" @@ -26,6 +26,8 @@ static struct vg_shader _shader_terrain = { "\n" "void vs_motion_out( vec4 vproj0, vec4 vproj1 )\n" "{\n" +" // This magically solves some artifacting errors!\n" +" //\n" " vproj1 = vproj0*(1.0-k_motion_lerp_amount) + vproj1*k_motion_lerp_amount;\n" "\n" " aMotionVec0 = vec3( vproj0.xy, vproj0.w );\n" @@ -183,7 +185,7 @@ static struct vg_shader _shader_terrain = { "\n" "#line 14 0 \n" "#line 1 2 \n" -"const float k_motion_lerp_amount = 0.05;\n" +"const float k_motion_lerp_amount = 0.01;\n" "\n" "#line 2 0 \n" "\n" @@ -216,8 +218,8 @@ static struct vg_shader _shader_terrain = { " \n" " // Creating normal patches\n" " vec3 modnorm = (wgarbage.rgb-0.4) * 1.4;\n" -" vec3 qnorm = normalize(floor(aNorm*4.0+modnorm)*0.25) + vec3(0.001,0.0,0.0);\n" -" vec2 dir = normalize(qnorm.xz);\n" +" vec3 qnorm = floor(aNorm*4.0+modnorm)*0.25 + vec3(0.001,0.0,0.0);\n" +" vec2 dir = qnorm.xz;\n" " vec2 uvdiffuse = aCo.xz * 0.02;\n" " uvdiffuse = mat2(dir.y, dir.x, -dir.x, dir.y) * uvdiffuse;\n" " \n"