chill out cubemaps
[carveJwlIkooP6JGAAIwe30JlM.git] / shaders / scene_scoretext.h
index 8b04293ba1cfd7a397a5092b5ad2355918697636..d417e45d0a467e8b09865ea4ab0c7ad078aa15d7 100644 (file)
@@ -46,8 +46,8 @@ static struct vg_shader _shader_scene_scoretext = {
 "void main()\n"
 "{\n"
 "   float w = ((a_norm.w)-0.5)*2.0 + fract(uInfo.z) - 0.0;\n"
-"   float c = -cos(w*0.2);\n"
-"   float s = -sin(w*0.2);\n"
+"   float c = -cos(w*0.6);\n"
+"   float s = -sin(w*0.6);\n"
 "   float r = 0.2;\n"
 "\n"
 "   float w1 = clamp( w*4.0 - a_co.y*10.0, -1.0, 1.0 ) * (3.14159265*0.5);\n"
@@ -86,8 +86,6 @@ static struct vg_shader _shader_scene_scoretext = {
 "uniform sampler2D uTexMain;\n"
 "uniform vec3 uCamera;\n"
 "uniform vec4 uPlane;\n"
-"uniform vec3 uBoard0;\n"
-"uniform vec3 uBoard1;\n"
 "\n"
 "#line       1        1 \n"
 "// :D\n"
@@ -116,6 +114,8 @@ static struct vg_shader _shader_scene_scoretext = {
 "   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"
@@ -216,7 +216,7 @@ static struct vg_shader _shader_scene_scoretext = {
 "   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"
@@ -226,9 +226,8 @@ static struct vg_shader _shader_scene_scoretext = {
 "\n"
 "float world_water_depth( vec3 pos )\n"
 "{\n"
-"   vec2 depth_coord = (pos.xz - g_depth_bounds.xy) * g_depth_bounds.zw; \n"
 "   float ref_depth = g_water_plane.y*g_water_plane.w;\n"
-"   return texture( g_world_depth, depth_coord ).g-ref_depth;\n"
+"   return world_depth_sample( pos ) - ref_depth;\n"
 "}\n"
 "\n"
 "float shadow_sample( vec3 vdir )\n"
@@ -412,7 +411,8 @@ static struct vg_shader _shader_scene_scoretext = {
 "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"
@@ -424,7 +424,7 @@ static struct vg_shader _shader_scene_scoretext = {
 "   return world_compute_lighting( diffuse, normal, co, compute_board_shadow() );\n"
 "}\n"
 "\n"
-"#line      9        0 \n"
+"#line      7        0 \n"
 "#line       1        2 \n"
 "const float k_motion_lerp_amount = 0.01;\n"
 "\n"
@@ -444,7 +444,7 @@ static struct vg_shader _shader_scene_scoretext = {
 "   oMotionVec = (vmotion1-vmotion0) * (1.0/k_motion_lerp_amount);\n"
 "}\n"
 "\n"
-"#line     10        0 \n"
+"#line      8        0 \n"
 "\n"
 "void main()\n"
 "{\n"
@@ -475,8 +475,6 @@ static GLuint _uniform_scene_scoretext_uTexGarbage;
 static GLuint _uniform_scene_scoretext_uTexMain;
 static GLuint _uniform_scene_scoretext_uCamera;
 static GLuint _uniform_scene_scoretext_uPlane;
-static GLuint _uniform_scene_scoretext_uBoard0;
-static GLuint _uniform_scene_scoretext_uBoard1;
 static GLuint _uniform_scene_scoretext_g_world_depth;
 static GLuint _uniform_scene_scoretext_uLightsArray;
 static GLuint _uniform_scene_scoretext_uLightsIndex;
@@ -504,12 +502,6 @@ static void shader_scene_scoretext_uCamera(v3f v){
 static void shader_scene_scoretext_uPlane(v4f v){
    glUniform4fv(_uniform_scene_scoretext_uPlane,1,v);
 }
-static void shader_scene_scoretext_uBoard0(v3f v){
-   glUniform3fv(_uniform_scene_scoretext_uBoard0,1,v);
-}
-static void shader_scene_scoretext_uBoard1(v3f v){
-   glUniform3fv(_uniform_scene_scoretext_uBoard1,1,v);
-}
 static void shader_scene_scoretext_g_world_depth(int i){
    glUniform1i(_uniform_scene_scoretext_g_world_depth,i);
 }
@@ -526,8 +518,6 @@ static void shader_scene_scoretext_link(void){
    _uniform_scene_scoretext_uTexMain = glGetUniformLocation( _shader_scene_scoretext.id, "uTexMain" );
    _uniform_scene_scoretext_uCamera = glGetUniformLocation( _shader_scene_scoretext.id, "uCamera" );
    _uniform_scene_scoretext_uPlane = glGetUniformLocation( _shader_scene_scoretext.id, "uPlane" );
-   _uniform_scene_scoretext_uBoard0 = glGetUniformLocation( _shader_scene_scoretext.id, "uBoard0" );
-   _uniform_scene_scoretext_uBoard1 = glGetUniformLocation( _shader_scene_scoretext.id, "uBoard1" );
    _uniform_scene_scoretext_g_world_depth = glGetUniformLocation( _shader_scene_scoretext.id, "g_world_depth" );
    _uniform_scene_scoretext_uLightsArray = glGetUniformLocation( _shader_scene_scoretext.id, "uLightsArray" );
    _uniform_scene_scoretext_uLightsIndex = glGetUniformLocation( _shader_scene_scoretext.id, "uLightsIndex" );