8 #include "common_world.glsl"
10 float sdLine( vec3 p, vec3 a, vec3 b )
15 float h = clamp( dot(pa,ba)/dot(ba,ba), 0.0, 1.0 );
16 return length( pa - ba*h );
19 float compute_board_shadow()
22 float dist_to_player = max( 0.0, sdLine( aWorldCo, g_board_0.xyz,
23 g_board_1.xyz )-0.1 );
24 float player_shadow = max( 1.0-dist_to_player*2.7, 0.0 );
25 player_shadow *= player_shadow*player_shadow*player_shadow;
27 return 1.0 - player_shadow*0.8;
30 vec3 scene_compute_lighting( vec3 diffuse, vec3 normal, vec3 co )
32 return world_compute_lighting( diffuse, normal, co, compute_board_shadow() );