+static void render_scene(void){
+ /* Draw world */
+ glEnable( GL_DEPTH_TEST );
+
+ world_instance *view_world = localplayer.viewable_world;
+
+ if( view_world == NULL ){
+ glClearColor( 0.25f, 0.25f, 0.0f, 1.0f );
+ glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT );
+ return;
+ }
+
+ for( u32 i=0; i<vg_list_size(world_static.instances); i++ ){
+ if( world_static.instances[i].status == k_world_status_loaded ){
+ world_prerender( &world_static.instances[i] );
+ }
+ }
+
+ if( skaterift.activity == k_skaterift_respawning ){
+ glDrawBuffers( 1, (GLenum[]){ GL_COLOR_ATTACHMENT0 } );
+ glClearColor( 0.624f, 0.659f, 0.769f, 0.0f );
+ glClear( GL_COLOR_BUFFER_BIT );
+ glDrawBuffers( 2, (GLenum[]){ GL_COLOR_ATTACHMENT0,
+ GL_COLOR_ATTACHMENT1 } );
+ view_world = &world_static.instances[respawn_chooser.world_id];
+ render_world_override( view_world );
+ }
+ else{
+ render_world( view_world, &skaterift.cam, 0 );
+ render_water_texture( view_world, &skaterift.cam, 0 );
+ render_fb_bind( gpipeline.fb_main, 1 );
+ render_water_surface( view_world, &skaterift.cam );
+ render_remote_players( view_world, &skaterift.cam );
+ }