X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=shaders%2Fscene_font.h;h=eec4b6ce75a025d58297256e7d20dc98a5eec437;hb=137d40d96fe923600d8378b8e138e3c276f27ff4;hp=747175a6f9ca6b0913ce1f59e5130a830165f955;hpb=c16f95624c142beec1572baa24f262e8a661f3fb;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/shaders/scene_font.h b/shaders/scene_font.h index 747175a..eec4b6c 100644 --- a/shaders/scene_font.h +++ b/shaders/scene_font.h @@ -65,7 +65,7 @@ static struct vg_shader _shader_scene_font = { .orig_file = "shaders/scene_font.fs", .static_src = "uniform sampler2D uTexGarbage; // unused\n" -"uniform sampler2D uTexMain;\n" +"uniform sampler2D uTexMain; // unused\n" "uniform vec3 uCamera;\n" "uniform float uTime;\n" "uniform float uOpacity;\n" @@ -279,7 +279,7 @@ static struct vg_shader _shader_scene_font = { " light_delta = normalize( light_delta );\n" "\n" " float quadratic = dist2*100.0;\n" -" float attenuation = 1.0f/( 1.0f + quadratic );\n" +" float attenuation = 1.0/( 1.0 + quadratic );\n" " attenuation *= max( dot( light_delta, normal ), 0.0 );\n" "\n" " float falloff = max( 0.0, 1.0-(dist2*light_co.w) );\n" @@ -431,17 +431,15 @@ static struct vg_shader _shader_scene_font = { "#line 10 0 \n" "\n" "vec3 pal( float t ){\n" -" vec3 a = vec3(0.3,0.3,0.3);\n" -" vec3 b = vec3(1.00,1.0,1.0);\n" +" vec3 a = vec3(0.30,0.3,0.3);\n" +" vec3 b = vec3(0.8);\n" " vec3 c = vec3(0.28,0.3,0.4);\n" " vec3 d = vec3(0.00,0.1,0.1);\n" " return a + b*cos( 6.28318*(c*t+d) );\n" "}\n" "\n" -"void main()\n" -"{\n" +"void main(){\n" " compute_motion_vectors();\n" -"\n" " vec3 vfrag = vec3(0.5,0.5,0.5);\n" " vec3 qnorm = aNorm.xyz;\n" "\n" @@ -457,12 +455,11 @@ static struct vg_shader _shader_scene_font = { " vec4 v1 = step( vec4(0.5), fract(vec4(a) + spread1) );\n" "\n" " float d = ( v0.x+v0.y+v0.z+v0.w +\n" -" v1.x+v1.y+v1.z+v1.w ) * 0.0625;\n" +" v1.x+v1.y+v1.z+v1.w ) * 0.125;\n" " \n" " float dither = fract(dot(vec2(171.0,231.0),gl_FragCoord.xy)/71.0);\n" -" const float STEPS = 8.;\n" -" float x = d*0.8+length(p)*0.2;\n" -" x = (floor(x * STEPS) + step(dither, fract(x * STEPS))) / STEPS;\n" +" float x = d*0.8+length(p)*0.3;\n" +" x = (floor(x*8.0) + step(dither, fract(x * 8.0))) / 8.0;\n" "\n" " if( x + (uOpacity*2.0-1.0) < 0.5 ) \n" " discard;\n" @@ -473,8 +470,8 @@ static struct vg_shader _shader_scene_font = { " vfrag = vec3(0.5);\n" " }\n" "\n" -" vec3 litfrag = scene_compute_lighting( vfrag, qnorm, aWorldCo );\n" -" oColour = vec4( litfrag, 1.0 );\n" +" vfrag = scene_compute_lighting( vfrag, qnorm, aWorldCo );\n" +" oColour = vec4( vfrag, 1.0 );\n" "}\n" ""}, };