X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=shaders%2Froute.h;h=6ee4761560e7649bdc36843292e987517c58eb3f;hb=d8fc0acce1b39466038284aa6f1941ebe98c8348;hp=2ecff91df16a4d3e7610787cd19187371fd8e00e;hpb=d045af680c6b8ca267a7aded69e2e510e659d2ab;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/shaders/route.h b/shaders/route.h index 2ecff91..6ee4761 100644 --- a/shaders/route.h +++ b/shaders/route.h @@ -18,8 +18,8 @@ static struct vg_shader _shader_route = { "\n" "#line 2 0 \n" "\n" -"uniform mat4 uPv;\n" "uniform mat4x3 uMdl;\n" +"uniform mat4 uPv;\n" "\n" "out vec4 aColour;\n" "out vec2 aUv;\n" @@ -67,6 +67,7 @@ static struct vg_shader _shader_route = { " float g_water_fog;\n" " int g_light_count;\n" " int g_light_preview;\n" +" int g_shadow_samples;\n" "};\n" "\n" "uniform sampler2D g_world_depth;\n" @@ -131,6 +132,11 @@ static struct vg_shader _shader_route = { "\n" "vec3 do_light_shadowing( vec3 vfrag )\n" "{\n" +" if( g_shadow_samples == 0 )\n" +" {\n" +" return vfrag;\n" +" }\n" +"\n" " float fspread = g_light_colours[0].w;\n" " vec3 vdir = g_light_directions[0].xyz;\n" " float flength = g_light_directions[0].w;\n" @@ -199,19 +205,19 @@ static struct vg_shader _shader_route = { ""}, }; -static GLuint _uniform_route_uPv; static GLuint _uniform_route_uMdl; +static GLuint _uniform_route_uPv; static GLuint _uniform_route_uTexGarbage; static GLuint _uniform_route_uTexGradients; static GLuint _uniform_route_uCamera; static GLuint _uniform_route_uColour; static GLuint _uniform_route_g_world_depth; -static void shader_route_uPv(m4x4f m){ - glUniformMatrix4fv( _uniform_route_uPv, 1, GL_FALSE, (float *)m ); -} static void shader_route_uMdl(m4x3f m){ glUniformMatrix4x3fv( _uniform_route_uMdl, 1, GL_FALSE, (float *)m ); } +static void shader_route_uPv(m4x4f m){ + glUniformMatrix4fv( _uniform_route_uPv, 1, GL_FALSE, (float *)m ); +} static void shader_route_uTexGarbage(int i){ glUniform1i( _uniform_route_uTexGarbage, i ); } @@ -232,8 +238,8 @@ static void shader_route_register(void){ } static void shader_route_use(void){ glUseProgram(_shader_route.id); } static void shader_route_link(void){ - _uniform_route_uPv = glGetUniformLocation( _shader_route.id, "uPv" ); _uniform_route_uMdl = glGetUniformLocation( _shader_route.id, "uMdl" ); + _uniform_route_uPv = glGetUniformLocation( _shader_route.id, "uPv" ); _uniform_route_uTexGarbage = glGetUniformLocation( _shader_route.id, "uTexGarbage" ); _uniform_route_uTexGradients = glGetUniformLocation( _shader_route.id, "uTexGradients" ); _uniform_route_uCamera = glGetUniformLocation( _shader_route.id, "uCamera" );