X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=shaders%2Fscene_depth.h;h=42613c0b224f8597f74dbfea9b93e25871563992;hb=1d06671f87a9d24596fc6808d8e0db889a818750;hp=f1c5af34368ff017a54d28f43935d47d905a7724;hpb=0a33f65eecb5e75cddaefa08d3a5eb1a301d0479;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/shaders/scene_depth.h b/shaders/scene_depth.h index f1c5af3..42613c0 100644 --- a/shaders/scene_depth.h +++ b/shaders/scene_depth.h @@ -95,6 +95,8 @@ static struct vg_shader _shader_scene_depth = { " vec4 g_sunset_ambient;\n" " vec4 g_sun_colour;\n" " vec4 g_sun_dir;\n" +" vec4 g_board_0;\n" +" vec4 g_board_1;\n" "\n" " float g_water_fog;\n" " float g_time;\n" @@ -195,7 +197,7 @@ static struct vg_shader _shader_scene_depth = { " return ambient + (light_sun + sky_reflection) * shadow;\n" "}\n" "\n" -"#line 42 0 \n" +"#line 44 0 \n" "\n" "float world_depth_sample( vec3 pos )\n" "{\n" @@ -274,7 +276,7 @@ static struct vg_shader _shader_scene_depth = { " 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" @@ -390,7 +392,8 @@ static struct vg_shader _shader_scene_depth = { "float compute_board_shadow()\n" "{\n" " // player shadow\n" -" float dist_to_player = max( 0.0, sdLine( aWorldCo, uBoard0, uBoard1 )-0.1 );\n" +" float dist_to_player = max( 0.0, sdLine( aWorldCo, g_board_0.xyz,\n" +" g_board_1.xyz )-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"