X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_render.c;h=8d7e546c7aeb666e8b1eb23d0c8450d30a5b0b98;hb=ca1798f62b65b72703e960d132dd0170728b7709;hp=cdbe37ebfbbfe022ed2f8eeaff1d9f8cfd5c4dd4;hpb=d171c9ad5de05c9ac8563fcf9f23760b93fb50f8;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_render.c b/world_render.c index cdbe37e..8d7e546 100644 --- a/world_render.c +++ b/world_render.c @@ -798,11 +798,7 @@ static void world_prerender( world_instance *world ){ state->g_debug_indices = k_debug_light_indices; state->g_light_preview = k_light_preview; state->g_debug_complexity = k_debug_light_complexity; - - if( skaterift.activity == k_skaterift_respawning ) - state->g_time_of_day = 0.1f; - else - state->g_time_of_day = vg_fractf( world->time ); + state->g_time_of_day = vg_fractf( world->time ); state->g_day_phase = cosf( state->g_time_of_day * VG_PIf * 2.0f ); state->g_sunset_phase= cosf( state->g_time_of_day * VG_PIf * 4.0f + VG_PIf ); @@ -847,7 +843,9 @@ static void render_world( world_instance *world, camera *cam, render_sky( world, cam ); - render_world_routes( world, cam, viewing_from_gate ); + m4x3f identity; + m4x3_identity(identity); + render_world_routes( world, world, identity, cam, viewing_from_gate, 0 ); render_world_standard( world, cam ); render_world_cubemapped( world, cam, with_cubemaps ); @@ -961,7 +959,8 @@ static void render_world_override_pass( world_instance *world, static void render_world_override( world_instance *world, world_instance *lighting_source, m4x3f mmdl, - camera *cam ){ + camera *cam, + ent_spawn *dest_spawn ){ struct world_pass pass = { .cam = cam, .fn_bind_textures = bindpoint_override, @@ -972,9 +971,6 @@ static void render_world_override( world_instance *world, }; shader_scene_override_use(); -#if 0 - respawn_chooser_shader_uniforms(); -#endif shader_scene_override_uTexGarbage(0); shader_scene_override_uTexMain(1); shader_scene_override_uPv( pass.cam->mtx.pv ); @@ -1001,13 +997,10 @@ static void render_world_override( world_instance *world, v3_copy( world->player_co, uPlayerPos ); - m4x3f mmdl_inv; - m4x3_invert_full( mmdl, mmdl_inv ); - v3f localized; - m4x3_mulv( mmdl_inv, localplayer.rb.co, localized ); - ent_spawn *spawn = world_find_closest_spawn( world, localized ); - if( spawn ) - v3_copy( spawn->transform.co, uSpawnPos ); + if( dest_spawn && (v3_dist2(dest_spawn->transform.co,uPlayerPos) > 0.1f) ) + v3_copy( dest_spawn->transform.co, uSpawnPos ); + else + v3_add( uPlayerPos, (v3f){0,-1,0}, uSpawnPos ); uPlayerPos[3] = v3_dist(uPlayerPos,uSpawnPos); uSpawnPos[3] = 1.0f/uPlayerPos[3];