X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=shaders%2Fstandard.h;h=4d52aa81fad8601b97d1788a133e8ea22770b1c7;hb=6d98c1e42c1617a8a426f9f0c0df99b75725b486;hp=16f36cee1676afd2d5761cbec55a298ddbac39c8;hpb=d045af680c6b8ca267a7aded69e2e510e659d2ab;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/shaders/standard.h b/shaders/standard.h index 16f36ce..4d52aa8 100644 --- a/shaders/standard.h +++ b/shaders/standard.h @@ -7,7 +7,6 @@ static struct vg_shader _shader_standard = { .link = shader_standard_link, .vs = { -.orig_file = "../../shaders/standard.vs", .static_src = "layout (location=0) in vec3 a_co;\n" "layout (location=1) in vec3 a_norm;\n" @@ -18,8 +17,8 @@ static struct vg_shader _shader_standard = { "\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" @@ -40,55 +39,193 @@ static struct vg_shader _shader_standard = { ""}, .fs = { -.orig_file = "../../shaders/standard.fs", .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" +" int g_shadow_samples;\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