reduced shader bind code dupe & adjust skate uprighter strenght
authorhgn <hgodden00@gmail.com>
Fri, 6 Oct 2023 07:11:23 +0000 (08:11 +0100)
committerhgn <hgodden00@gmail.com>
Fri, 6 Oct 2023 07:11:23 +0000 (08:11 +0100)
depth_compare.h [new file with mode: 0644]
entity.h
font.h
player_render.c
player_skate.c
world_render.c
world_render.h
world_routes.c
world_sfd.c
world_water.c

diff --git a/depth_compare.h b/depth_compare.h
new file mode 100644 (file)
index 0000000..8b64586
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef DEPTH_COMPARE_H
+#define DEPTH_COMPARE_H
+
+#include "vg/vg_m.h"
+#include "render.h"
+
+static void depth_compare_bind( 
+      void (*uTexSceneDepth)(int),
+      void (*uInverseRatioDepth)(v3f),
+      void (*uInverseRatioMain)(v3f),
+      camera *cam ){
+   uTexSceneDepth( 5 );
+   render_fb_bind_texture( gpipeline.fb_main, 2, 5 );
+   v3f inverse;
+   render_fb_inverse_ratio( gpipeline.fb_main, inverse );
+   inverse[2] = skaterift.cam.farz-skaterift.cam.nearz;
+
+   uInverseRatioDepth( inverse );
+   render_fb_inverse_ratio( NULL, inverse );
+   inverse[2] = cam->farz-cam->nearz;
+   uInverseRatioMain( inverse );
+}
+
+#endif /* DEPTH_COMPARE_H */
index 22ee913c6a6199ff938aa14793ad5c41cee3f1fa..103e1a20635e1f32a91f7f0a4f8cc719350fff4d 100644 (file)
--- a/entity.h
+++ b/entity.h
@@ -161,11 +161,11 @@ struct ent_checkpoint{
 };
 
 struct ent_route{
-
    union{
       mdl_transform transform;
       u32 official_track_id;
-   };
+   }
+   anon;
 
    u32 pstr_name;
    u16 checkpoints_start,
diff --git a/font.h b/font.h
index c49bc6639f396a5fb27d9a55f2b78b06f2d98add..c00aece3c9f2f46a59ae2e3f76062284bd93e113 100644 (file)
--- a/font.h
+++ b/font.h
@@ -7,6 +7,7 @@
 #include "shaders/model_font.h"
 #include "shaders/scene_font.h"
 #include "world_render.h"
+#include "depth_compare.h"
 
 enum efont_SRglyph{
    k_SRglyph_end           = 0x00, /* control characters */
@@ -147,17 +148,10 @@ static void font3d_bind( font3d *font, enum font_shader shader,
 
       shader_model_font_uDepthCompare( depth_compare );
       if( depth_compare ){
-         /* TODO: Compress with code in player_render.c */
-         shader_model_font_uTexSceneDepth( 2 );
-         render_fb_bind_texture( gpipeline.fb_main, 2, 2 );
-         v3f inverse;
-         render_fb_inverse_ratio( gpipeline.fb_main, inverse );
-         inverse[2] = skaterift.cam.farz-skaterift.cam.nearz;
-
-         shader_model_font_uInverseRatioDepth( inverse );
-         render_fb_inverse_ratio( NULL, inverse );
-         inverse[2] = cam->farz-cam->nearz;
-         shader_model_font_uInverseRatioMain( inverse );
+         depth_compare_bind( 
+            shader_model_font_uTexSceneDepth,
+            shader_model_font_uInverseRatioDepth,
+            shader_model_font_uInverseRatioMain, cam );
       }
 
       shader_model_font_uPv( cam->mtx.pv );
@@ -171,14 +165,7 @@ static void font3d_bind( font3d *font, enum font_shader shader,
       shader_scene_font_uPv( skaterift.cam.mtx.pv );
       shader_scene_font_uTime( vg.time );
 
-      /* TODO: Code dupe... */
-      world_link_lighting_ub( world, _shader_scene_font.id );
-      world_bind_position_texture( world, _shader_scene_font.id, 
-                                   _uniform_scene_font_g_world_depth, 2 );
-      world_bind_light_array( world, _shader_scene_font.id,
-                                   _uniform_scene_font_uLightsArray, 3 );
-      world_bind_light_index( world, _shader_scene_font.id,
-                                   _uniform_scene_font_uLightsIndex, 4 );
+      WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( world, scene_font );
 
       bind_terrain_noise();
       shader_scene_font_uCamera( skaterift.cam.transform[3] );
index a37e74e2128b9e67d92664d793758f65193d96fa..2cf0e283e5736109f61f914a0bd5f4a8e6e1c7b4 100644 (file)
@@ -13,6 +13,7 @@
 #include "shaders/model_board_view.h"
 #include "shaders/model_entity.h"
 #include "shaders/model_board_view.h"
+#include "depth_compare.h"
 
 static void player_avatar_load( struct player_avatar *av, const char *path ){
    mdl_open( &av->meta, path, vg_mem.rtmemory );
@@ -300,25 +301,15 @@ static void render_board( camera *cam, world_instance *world,
       shader_model_board_view_uTexMain( 0 );
       shader_model_board_view_uCamera( cam->transform[3] );
       shader_model_board_view_uPv( cam->mtx.pv );
-      shader_model_board_view_uTexSceneDepth( 1 );
-      render_fb_bind_texture( gpipeline.fb_main, 2, 1 );
 
-      render_fb_inverse_ratio( gpipeline.fb_main, inverse );
+      shader_model_board_view_uDepthCompare(1);
+      depth_compare_bind(
+         shader_model_board_view_uTexSceneDepth,
+         shader_model_board_view_uInverseRatioDepth,
+         shader_model_board_view_uInverseRatioMain,
+         cam );
 
-      inverse[2] = skaterift.cam.farz-skaterift.cam.nearz;
-
-      shader_model_board_view_uInverseRatioDepth( inverse );
-      render_fb_inverse_ratio( NULL, inverse );
-      inverse[2] = cam->farz-cam->nearz;
-      shader_model_board_view_uInverseRatioMain( inverse );
-
-      world_link_lighting_ub( world, _shader_model_board_view.id );
-      world_bind_position_texture( world, _shader_model_board_view.id,
-                                 _uniform_model_board_view_g_world_depth, 2 );
-      world_bind_light_array( world, _shader_model_board_view.id,
-                                 _uniform_model_board_view_uLightsArray, 3 );
-      world_bind_light_index( world, _shader_model_board_view.id,
-                                 _uniform_model_board_view_uLightsIndex, 4 );
+      WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( world, model_board_view );
    }
    else if( shader == k_board_shader_entity ){
       shader_model_entity_use();
@@ -326,13 +317,7 @@ static void render_board( camera *cam, world_instance *world,
       shader_model_entity_uCamera( cam->transform[3] );
       shader_model_entity_uPv( cam->mtx.pv );
       
-      world_link_lighting_ub( world, _shader_model_entity.id );
-      world_bind_position_texture( world, _shader_model_entity.id,
-                                 _uniform_model_entity_g_world_depth, 2 );
-      world_bind_light_array( world, _shader_model_entity.id,
-                                 _uniform_model_entity_uLightsArray, 3 );
-      world_bind_light_index( world, _shader_model_entity.id,
-                                 _uniform_model_entity_uLightsIndex, 4 );
+      WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( world, model_entity );
    }
 
    mesh_bind( &board->mdl.mesh );
@@ -429,27 +414,16 @@ static void render_playermodel( camera *cam, world_instance *world,
    shader_model_character_view_uCamera( cam->transform[3] );
    shader_model_character_view_uPv( cam->mtx.pv );
 
+   shader_model_character_view_uDepthCompare( depth_compare );
    if( depth_compare ){
-      shader_model_character_view_uTexSceneDepth( 1 );
-      render_fb_bind_texture( gpipeline.fb_main, 2, 1 );
-      v3f inverse;
-      render_fb_inverse_ratio( gpipeline.fb_main, inverse );
-      inverse[2] = skaterift.cam.farz-skaterift.cam.nearz;
-
-      shader_model_character_view_uInverseRatioDepth( inverse );
-      render_fb_inverse_ratio( NULL, inverse );
-      inverse[2] = cam->farz-cam->nearz;
-      shader_model_character_view_uInverseRatioMain( inverse );
+      depth_compare_bind(
+         shader_model_character_view_uTexSceneDepth,
+         shader_model_character_view_uInverseRatioDepth,
+         shader_model_character_view_uInverseRatioMain,
+         cam );
    }
-   shader_model_character_view_uDepthCompare( depth_compare );
 
-   world_link_lighting_ub( world, _shader_model_character_view.id );
-   world_bind_position_texture( world, _shader_model_character_view.id,
-                              _uniform_model_character_view_g_world_depth, 2 );
-   world_bind_light_array( world, _shader_model_character_view.id,
-                              _uniform_model_character_view_uLightsArray, 3 );
-   world_bind_light_index( world, _shader_model_character_view.id,
-                              _uniform_model_character_view_uLightsIndex, 4 );
+   WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( world, model_character_view );
 
    glUniformMatrix4x3fv( _uniform_model_character_view_uTransforms,
                          skeleton->bone_count,
index b39b016be42c4f95dd2830addbb1693d6d69731f..41e03a40b46e836e30d2543279f9753c624a86b6 100644 (file)
@@ -1493,8 +1493,12 @@ static void skate_adjust_up_direction(void){
                8.0f * player_skate.substep_delta, state->up_dir );
    }
    else{
-      v3_lerp( state->up_dir, localplayer.basis[1],
-               12.0f * player_skate.substep_delta, state->up_dir );
+      v3f avg;
+      v3_add( localplayer.rb.to_world[1], localplayer.basis[1], avg );
+      v3_normalize( avg );
+
+      v3_lerp( state->up_dir, avg,
+               6.0f * player_skate.substep_delta, state->up_dir );
    }
 }
 
index 2d23737c3f5325247b0db045ed2da4bd18cce028..022556d068a558e75ace441a3ebf314691ea99a6 100644 (file)
@@ -104,24 +104,21 @@ static void world_render_init(void)
    vg_async_call( async_world_render_init, NULL, 0 );
 }
 
-static void world_link_lighting_ub( world_instance *world, GLuint shader )
-{
+static void world_link_lighting_ub( world_instance *world, GLuint shader ){
    GLuint idx = glGetUniformBlockIndex( shader, "ub_world_lighting" );   
    glUniformBlockBinding( shader, idx, world->ubo_bind_point );
 }
 
 static void world_bind_position_texture( world_instance *world, 
                                             GLuint shader, GLuint location,
-                                            int slot )
-{
+                                            int slot ){
    render_fb_bind_texture( &world->heightmap, 0, slot );
    glUniform1i( location, slot );
 }
 
 static void world_bind_light_array( world_instance *world,
                                        GLuint shader, GLuint location, 
-                                       int slot )
-{
+                                       int slot ){
    glActiveTexture( GL_TEXTURE0 + slot );
    glBindTexture( GL_TEXTURE_BUFFER, world->tex_light_entities );
    glUniform1i( location, slot );
@@ -129,8 +126,7 @@ static void world_bind_light_array( world_instance *world,
 
 static void world_bind_light_index( world_instance *world,
                                        GLuint shader, GLuint location,
-                                       int slot )
-{
+                                       int slot ){
    glActiveTexture( GL_TEXTURE0 + slot );
    glBindTexture( GL_TEXTURE_3D, world->tex_light_cubes );
    glUniform1i( location, slot );
@@ -267,8 +263,7 @@ static void bindpoint_diffuse1_and_cubemap10( world_instance *world,
    shader_scene_cubemapped_uColour( mat->info.colour );
 }
 
-static void render_world_vb( world_instance *world, camera *cam )
-{
+static void render_world_vb( world_instance *world, camera *cam ){
    shader_scene_vertex_blend_use();
    shader_scene_vertex_blend_uTexGarbage(0);
    shader_scene_vertex_blend_uTexGradients(1);
@@ -627,20 +622,12 @@ static void bindpoint_override( world_instance *world,
    }
 }
 
-static void render_terrain( world_instance *world, camera *cam )
-{
+static void render_terrain( world_instance *world, camera *cam ){
    shader_scene_terrain_use();
    shader_scene_terrain_uTexGarbage(0);
    shader_scene_terrain_uTexGradients(1);
 
-   world_link_lighting_ub( world, _shader_scene_terrain.id );
-   world_bind_position_texture( world, _shader_scene_terrain.id, 
-                        _uniform_scene_terrain_g_world_depth, 2 );
-   world_bind_light_array( world, _shader_scene_terrain.id,
-                        _uniform_scene_terrain_uLightsArray, 3 );
-   world_bind_light_index( world, _shader_scene_terrain.id,
-                           _uniform_scene_terrain_uLightsIndex, 4 );
-
+   WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( world, scene_terrain );
    glActiveTexture( GL_TEXTURE0 );
    glBindTexture( GL_TEXTURE_2D, world_render.tex_terrain_noise );
 
@@ -902,14 +889,7 @@ static void render_world_override( world_instance *world ){
    shader_scene_override_uTexMain(1);
    shader_scene_override_uPv( pass.cam->mtx.pv );
 
-   world_link_lighting_ub( world, _shader_scene_override.id );
-   world_bind_position_texture( world, _shader_scene_override.id, 
-                                _uniform_scene_override_g_world_depth, 2 );
-   world_bind_light_array( world, _shader_scene_override.id,
-                                _uniform_scene_override_uLightsArray, 3 );
-   world_bind_light_index( world, _shader_scene_override.id,
-                                _uniform_scene_override_uLightsIndex, 4 );
-
+   WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( world, scene_override );
    bind_terrain_noise();
    shader_scene_override_uCamera( pass.cam->transform[3] );
 
@@ -989,8 +969,7 @@ static void render_world_cubemaps( world_instance *world ){
    }
 }
 
-static void render_world_depth( world_instance *world, camera *cam )
-{
+static void render_world_depth( world_instance *world, camera *cam ){
    m4x3f identity_matrix;
    m4x3_identity( identity_matrix );
 
@@ -1005,8 +984,7 @@ static void render_world_depth( world_instance *world, camera *cam )
    mesh_draw( &world->mesh_geo );
 }
 
-static void render_world_position( world_instance *world, camera *cam )
-{
+static void render_world_position( world_instance *world, camera *cam ){
    m4x3f identity_matrix;
    m4x3_identity( identity_matrix );
 
index ac0a0f2a82160b1e9e5e8e1d5ff98cc854031a27..3050a69e63213525dac25dac6627dfbd3aed6f7d 100644 (file)
@@ -79,4 +79,13 @@ static void render_world( world_instance *world, camera *cam,
 static void render_world_cubemaps( world_instance *world );
 static void bind_terrain_noise(void);
 
+#define WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( WORLD, SHADER )            \
+   world_link_lighting_ub( WORLD, _shader_##SHADER.id );                \
+   world_bind_position_texture( WORLD, _shader_##SHADER.id,             \
+                                _uniform_##SHADER##_g_world_depth, 2 ); \
+   world_bind_light_array( WORLD, _shader_##SHADER.id,                  \
+                           _uniform_##SHADER##_uLightsArray, 3 );       \
+   world_bind_light_index( WORLD, _shader_##SHADER.id,                  \
+                           _uniform_##SHADER##_uLightsIndex, 4 );
+
 #endif /* WORLD_RENDER_H */
index beb4c2c8f7c8e15f99c730794f407430dafd933d..4998cc115efa779b0d89ae4ce657326525ebec52 100644 (file)
@@ -27,14 +27,14 @@ void world_routes_local_set_record( world_instance *world, ent_route *route,
 {
    vg_success( "  NEW LAP TIME: %f\n", lap_time );
 
-   if( route->official_track_id != 0xffffffff ){
+   if( route->anon.official_track_id != 0xffffffff ){
       double time_centiseconds = lap_time * 100.0;
       if( time_centiseconds > (float)0xfffe )   /* skill issue */
          return;
 
-      struct track_info *ti = &track_infos[ route->official_track_id ];
+      struct track_info *ti = &track_infos[ route->anon.official_track_id ];
       highscore_record *record = &ti->record;
-      record->trackid  = route->official_track_id;
+      record->trackid  = route->anon.official_track_id;
       record->datetime = time(NULL);
       record->playerid = 0;
       record->points   = 0;
@@ -889,13 +889,13 @@ static void world_gen_routes_ent_init( world_instance *world ){
 
    for( u32 i=0; i<mdl_arrcount(&world->ent_route); i++ ){
       ent_route *route = mdl_arritm(&world->ent_route,i);
-      mdl_transform_m4x3( &route->transform, route->board_transform );
+      mdl_transform_m4x3( &route->anon.transform, route->board_transform );
 
-      route->official_track_id = 0xffffffff;
+      route->anon.official_track_id = 0xffffffff;
       for( u32 j=0; j<vg_list_size(track_infos); j ++ ){
          if( !strcmp(track_infos[j].name, 
                      mdl_pstr(&world->meta,route->pstr_name))){
-            route->official_track_id = j;
+            route->anon.official_track_id = j;
          }
       }
 
index d960b0d54ad5a4221c8d69c0e0f1a39e3be16542..a92a4b090719c2fd457e33f4a9a4eef00fb55f66 100644 (file)
@@ -4,9 +4,10 @@
 #include "world_sfd.h"
 #include "shaders/scene_scoretext.h"
 #include "shaders/scene_vertex_blend.h"
+#include "network.h"
+#include "entity.h"
 
-static f32 sfd_encode_glyph( char c )
-{
+static f32 sfd_encode_glyph( char c ){
    int value = 0;
    if( c >= 'a' && c <= 'z' )
       value = c-'a'+11;
@@ -74,13 +75,12 @@ static void world_sfd_update( world_instance *world, v3f pos ){
          }
       }
 
-      if( (world_sfd.active_route_board != closest) || network_scores_updated )
-      {
+      if( (world_sfd.active_route_board != closest) || network_scores_updated ){
          network_scores_updated = 0;
          world_sfd.active_route_board = closest;
 
          ent_route *route = mdl_arritm( &world->ent_route, closest );
-         u32 id = route->official_track_id;
+         u32 id = route->anon.official_track_id;
 
          if( id != 0xffffffff ){
             struct netmsg_board *local_board = 
@@ -114,19 +114,11 @@ static void world_sfd_update( world_instance *world, v3f pos ){
 }
 
 static void bind_terrain_noise(void);
-static void sfd_render( world_instance *world, camera *cam, m4x3f transform )
-{
+static void sfd_render( world_instance *world, camera *cam, m4x3f transform ){
    mesh_bind( &world_sfd.mesh_display );
    shader_scene_scoretext_use();
    shader_scene_scoretext_uTexMain(1);
-
-   world_link_lighting_ub( world, _shader_scene_scoretext.id );
-   world_bind_position_texture( world, _shader_scene_scoretext.id, 
-                        _uniform_scene_scoretext_g_world_depth, 2 );
-   world_bind_light_array( world, _shader_scene_scoretext.id,
-                        _uniform_scene_scoretext_uLightsArray, 3 );
-   world_bind_light_index( world, _shader_scene_scoretext.id,
-                           _uniform_scene_scoretext_uLightsIndex, 4 );
+   WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( world, scene_scoretext );
 
    bind_terrain_noise();
 
@@ -153,13 +145,8 @@ static void sfd_render( world_instance *world, camera *cam, m4x3f transform )
    shader_scene_vertex_blend_use();
    shader_scene_vertex_blend_uTexGarbage(0);
    shader_scene_vertex_blend_uTexGradients(1);
-   world_link_lighting_ub( world, _shader_scene_vertex_blend.id );
-   world_bind_position_texture( world, _shader_scene_vertex_blend.id, 
-                                _uniform_scene_vertex_blend_g_world_depth, 2 );
-   world_bind_light_array( world, _shader_scene_vertex_blend.id,
-                                _uniform_scene_vertex_blend_uLightsArray, 3 );
-   world_bind_light_index( world, _shader_scene_vertex_blend.id,
-                                _uniform_scene_vertex_blend_uLightsIndex, 4 );
+   WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( world, scene_vertex_blend );
+
    bind_terrain_noise();
    glActiveTexture( GL_TEXTURE1 );
    glBindTexture( GL_TEXTURE_2D, world_sfd.tex_scoretex );
@@ -173,8 +160,7 @@ static void sfd_render( world_instance *world, camera *cam, m4x3f transform )
    mdl_draw_submesh( &world_sfd.sm_base );
 }
 
-static int world_sfd_test( int argc, const char *argv[] )
-{
+static int world_sfd_test( int argc, const char *argv[] ){
    if( argc == 2 ){
       int row = vg_min( vg_max(atoi(argv[0]),0), world_sfd.h);
       sfd_encode( row, argv[1] );
@@ -183,8 +169,7 @@ static int world_sfd_test( int argc, const char *argv[] )
    return 0;
 }
 
-static void world_sfd_init(void)
-{
+static void world_sfd_init(void){
    vg_info( "world_sfd_init\n" );
    shader_scene_scoretext_register();
    vg_console_reg_cmd( "sfd", world_sfd_test, NULL );
index 87b5a62490ca51a9a244dd886b65348ecb90d3eb..980ae0204ffcc99f1f50a716fad85b4caf682e24 100644 (file)
@@ -12,8 +12,7 @@
 #include "shaders/scene_water_fast.h"
 #include "scene.h"
 
-static void world_water_init(void)
-{
+static void world_water_init(void){
    vg_info( "world_water_init\n" );
    shader_scene_water_register();
    shader_scene_water_fast_register();
@@ -25,8 +24,7 @@ static void world_water_init(void)
    vg_success( "done\n" );
 }
 
-static void water_set_surface( world_instance *world, float height )
-{
+static void water_set_surface( world_instance *world, float height ){
    world->water.height = height;
    v4_copy( (v4f){ 0.0f, 1.0f, 0.0f, height }, world->water.plane );
 }
@@ -46,8 +44,7 @@ static void world_bind_light_index( world_instance *world,
  * Does not write motion vectors
  */
 static void render_water_texture( world_instance *world, camera *cam,
-                                     int layer_depth )
-{
+                                     int layer_depth ){
    if( !world->water.enabled || (vg.quality_profile == k_quality_profile_low) )
       return;
 
@@ -121,8 +118,7 @@ static void render_water_texture( world_instance *world, camera *cam,
    //glViewport( 0,0, g_render_x, g_render_y );
 }
 
-static void render_water_surface( world_instance *world, camera *cam )
-{
+static void render_water_surface( world_instance *world, camera *cam ){
    if( !world->water.enabled )
       return;
 
@@ -141,16 +137,10 @@ static void render_water_surface( world_instance *world, camera *cam )
             1.0f / (float)vg.window_x,
             1.0f / (float)vg.window_y });
 
-      world_link_lighting_ub( world, _shader_scene_water.id );
-      world_bind_position_texture( world, _shader_scene_water.id, 
-                                    _uniform_scene_water_g_world_depth, 2 );
-      world_bind_light_array( world, _shader_scene_water.id,
-                                    _uniform_scene_water_uLightsArray, 4 );
-      world_bind_light_index( world, _shader_scene_water.id,
-                              _uniform_scene_water_uLightsIndex, 5 );
+      WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( world, scene_water );
 
-      render_fb_bind_texture( gpipeline.fb_water_beneath, 0, 3 );
-      shader_scene_water_uTexBack( 3 );
+      render_fb_bind_texture( gpipeline.fb_water_beneath, 0, 5 );
+      shader_scene_water_uTexBack( 5 );
       shader_scene_water_uTime( world_static.time );
       shader_scene_water_uCamera( cam->transform[3] );
       shader_scene_water_uSurfaceY( world->water.height );
@@ -191,11 +181,8 @@ static void render_water_surface( world_instance *world, camera *cam )
       shader_scene_water_fast_uTime( world_static.time );
       shader_scene_water_fast_uCamera( cam->transform[3] );
       shader_scene_water_fast_uSurfaceY( world->water.height );
-      world_link_lighting_ub( world, _shader_scene_water_fast.id );
-      world_bind_position_texture( world, _shader_scene_water_fast.id,
-                                   _uniform_scene_water_fast_g_world_depth, 2 );
-      world_bind_light_array( world, _shader_scene_water_fast.id,
-                                    _uniform_scene_water_fast_uLightsArray, 4 );
+
+      WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( world, scene_water_fast );
 
       m4x3f full;
       m4x3_identity( full );