X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=shaders%2Fstandard.h;h=ac052b0d935f5e4042e1dff2b5be57a8162e7c71;hb=23a1be081ab9e378cba49a23b8ed4d4082b580c1;hp=cf98fb0765d652ea5be57e6b44efb6bf386fe7ab;hpb=15beb60ade240af4e00b0d204f7e89a4d35dca36;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/shaders/standard.h b/shaders/standard.h index cf98fb0..ac052b0 100644 --- a/shaders/standard.h +++ b/shaders/standard.h @@ -44,42 +44,172 @@ static struct vg_shader _shader_standard = { .static_src = "out vec4 FragColor;\n" "\n" +"uniform sampler2D uTexGarbage;\n" "uniform sampler2D uTexMain;\n" -"uniform vec4 uColour;\n" +"uniform vec3 uCamera;\n" +"uniform vec4 uPlane;\n" "\n" "in vec4 aColour;\n" "in vec2 aUv;\n" "in vec3 aNorm;\n" "in vec3 aCo;\n" +"in vec3 aWorldCo;\n" +"\n" +"#line 1 1 \n" +"layout (std140) uniform ub_world_lighting\n" +"{\n" +" vec4 g_light_colours[3];\n" +" vec4 g_light_directions[3];\n" +" vec4 g_ambient_colour;\n" +"\n" +" vec4 g_water_plane;\n" +" vec4 g_depth_bounds;\n" +" float g_water_fog;\n" +" int g_light_count;\n" +" int g_light_preview;\n" +"};\n" +"\n" +"uniform sampler2D g_world_depth;\n" +"\n" +"// Standard diffuse + spec models\n" +"// ==============================\n" +"\n" +"vec3 do_light_diffuse( vec3 vfrag, vec3 wnormal )\n" +"{\n" +" vec3 vtotal = g_ambient_colour.rgb;\n" +"\n" +" for( int i=0; i