X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_render.c;h=011d0415edacf62857cb81e9b83a767005c951d5;hb=edd08a99f72cced7626654b04591d5a54a8b540b;hp=f34aa1665028c9ac4909508e56503648f59694bb;hpb=f24a8cdd8ea6c3d762d26de2fc0700599bedbcad;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_render.c b/player_render.c index f34aa16..011d041 100644 --- a/player_render.c +++ b/player_render.c @@ -6,6 +6,7 @@ #include "camera.h" #include "player_model.h" #include "ent_skateshop.h" +#include "audio.h" #include "shaders/model_character_view.h" #include "shaders/model_board_view.h" @@ -61,6 +62,7 @@ VG_STATIC void player_model_load( struct player_model *mdl, const char *path ) mdl_close( &ctx ); } +/* TODO: allow error handling */ VG_STATIC void player_board_load( struct player_board *mdl, const char *path ) { vg_linear_clear( vg_mem.scratch ); @@ -173,7 +175,7 @@ VG_STATIC void player__pre_render( player_instance *player ) v3_zero( vp1 ); } - struct ub_world_lighting *ubo = &get_active_world()->ub_lighting; + struct ub_world_lighting *ubo = &world_current_instance()->ub_lighting; m4x3_mulv( av->sk.final_mtx[ av->id_board ], vp0, ubo->g_board_0 ); m4x3_mulv( av->sk.final_mtx[ av->id_board ], vp1, ubo->g_board_1 ); @@ -193,11 +195,11 @@ VG_STATIC void player__pre_render( player_instance *player ) player->rewind_length = 1; player->rewind_total_length = 0.0f; player->rewind_accum = 0.0f; - world_global.sky_target_rate = 1.0; - world_global.time = world_global.last_use; + world_render.sky_target_rate = 1.0; + world_static.time = world_static.last_use; } else{ - world_global.sky_target_rate = -100.0; + world_render.sky_target_rate = -100.0; float budget = vg.time_delta, overall_length = player->rewind_length; @@ -281,11 +283,6 @@ VG_STATIC void player__pre_render( player_instance *player ) player__cam_iterate( player ); } -enum board_shader{ - k_board_shader_player, - k_board_shader_entity -}; - VG_STATIC void render_board( camera *cam, world_instance *world, struct player_board *board, m4x3f root, enum board_shader shader ) @@ -305,6 +302,7 @@ VG_STATIC void render_board( camera *cam, world_instance *world, shader_model_board_view_uTexSceneDepth( 1 ); render_fb_inverse_ratio( gpipeline.fb_main, inverse ); + inverse[2] = main_camera.farz-main_camera.nearz; shader_model_board_view_uInverseRatioDepth( inverse ); @@ -421,7 +419,7 @@ PLAYER_API void player__render( camera *cam, player_instance *player ) inverse[2] = cam->farz-cam->nearz; shader_model_character_view_uInverseRatioMain( inverse ); - world_instance *world = get_active_world(); + world_instance *world = world_current_instance(); 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 );