X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=shaders%2Fmodel_character_view.h;h=18d5c19062ec5d9afc1b92e55b68d3d1e19ec2e3;hb=409edea2cf6271956137918e4e0b4f1c2addf620;hp=c527d9032beacaead2bb5f08c399ca7f47e57ead;hpb=f3a2490079baf440238b78e54f4476649eddbda2;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/shaders/model_character_view.h b/shaders/model_character_view.h index c527d90..18d5c19 100644 --- a/shaders/model_character_view.h +++ b/shaders/model_character_view.h @@ -74,8 +74,6 @@ static struct vg_shader _shader_model_character_view = { .static_src = "uniform sampler2D uTexMain;\n" "uniform vec3 uCamera;\n" -"uniform vec3 uBoard0;\n" -"uniform vec3 uBoard1;\n" "\n" "in vec4 aColour;\n" "in vec2 aUv;\n" @@ -99,8 +97,10 @@ static struct vg_shader _shader_model_character_view = { " int g_light_preview;\n" " int g_shadow_samples;\n" "\n" -" vec4 g_point_light_positions[32];\n" -" vec4 g_point_light_colours[32];\n" +" // g_time ?\n" +"\n" +" //vec4 g_point_light_positions[32];\n" +" //vec4 g_point_light_colours[32];\n" "};\n" "\n" "uniform sampler2D g_world_depth;\n" @@ -127,15 +127,6 @@ static struct vg_shader _shader_model_character_view = { " return clamp( fdelta, 0.1, 0.2 )-0.1;\n" "}\n" "\n" -"float sdLine( vec3 p, vec3 a, vec3 b )\n" -"{\n" -" vec3 pa = p - a;\n" -" vec3 ba = b - a;\n" -"\n" -" float h = clamp( dot(pa,ba)/dot(ba,ba), 0.0, 1.0 );\n" -" return length( pa - ba*h );\n" -"}\n" -"\n" "vec3 apply_fog( vec3 vfrag, float fdist )\n" "{\n" " float dist = pow(fdist*0.0008,1.2);\n" @@ -171,12 +162,7 @@ static struct vg_shader _shader_model_character_view = { " famt+=shadow_sample((vdir+vec3( 0.522,-0.379, 0.350)*fspread)*flength*0.7);\n" " famt+=shadow_sample((vdir+vec3( 0.483, 0.201, 0.306)*fspread)*flength*0.8);\n" "\n" -" // player shadow\n" -" float dist_to_player = max( 0.0, sdLine( aWorldCo, uBoard0, uBoard1 )-0.1 );\n" -" float player_shadow = max( 1.0-dist_to_player*2.7, 0.0 );\n" -" player_shadow *= player_shadow*player_shadow*player_shadow;\n" -"\n" -" return 1.0 - max( player_shadow*0.8, famt );\n" +" return 1.0 - famt;\n" "}\n" "\n" "vec3 newlight_compute_world_diffuse( vec3 wnormal )\n" @@ -217,7 +203,7 @@ static struct vg_shader _shader_model_character_view = { " return light_colour*attenuation;\n" "}\n" "\n" -"#line 13 0 \n" +"#line 11 0 \n" "#line 1 2 \n" "const float k_motion_lerp_amount = 0.01;\n" "\n" @@ -237,7 +223,7 @@ static struct vg_shader _shader_model_character_view = { " oMotionVec = (vmotion1-vmotion0) * (1.0/k_motion_lerp_amount);\n" "}\n" "\n" -"#line 14 0 \n" +"#line 12 0 \n" "\n" "void main()\n" "{\n" @@ -271,8 +257,6 @@ static GLuint _uniform_model_character_view_uPv; static GLuint _uniform_model_character_view_uTransforms; static GLuint _uniform_model_character_view_uTexMain; static GLuint _uniform_model_character_view_uCamera; -static GLuint _uniform_model_character_view_uBoard0; -static GLuint _uniform_model_character_view_uBoard1; static GLuint _uniform_model_character_view_g_world_depth; static void shader_model_character_view_uPv(m4x4f m){ glUniformMatrix4fv(_uniform_model_character_view_uPv,1,GL_FALSE,(float*)m); @@ -283,12 +267,6 @@ static void shader_model_character_view_uTexMain(int i){ static void shader_model_character_view_uCamera(v3f v){ glUniform3fv(_uniform_model_character_view_uCamera,1,v); } -static void shader_model_character_view_uBoard0(v3f v){ - glUniform3fv(_uniform_model_character_view_uBoard0,1,v); -} -static void shader_model_character_view_uBoard1(v3f v){ - glUniform3fv(_uniform_model_character_view_uBoard1,1,v); -} static void shader_model_character_view_g_world_depth(int i){ glUniform1i(_uniform_model_character_view_g_world_depth,i); } @@ -301,8 +279,6 @@ static void shader_model_character_view_link(void){ _uniform_model_character_view_uTransforms = glGetUniformLocation( _shader_model_character_view.id, "uTransforms" ); _uniform_model_character_view_uTexMain = glGetUniformLocation( _shader_model_character_view.id, "uTexMain" ); _uniform_model_character_view_uCamera = glGetUniformLocation( _shader_model_character_view.id, "uCamera" ); - _uniform_model_character_view_uBoard0 = glGetUniformLocation( _shader_model_character_view.id, "uBoard0" ); - _uniform_model_character_view_uBoard1 = glGetUniformLocation( _shader_model_character_view.id, "uBoard1" ); _uniform_model_character_view_g_world_depth = glGetUniformLocation( _shader_model_character_view.id, "g_world_depth" ); } #endif /* SHADER_model_character_view_H */