+ }
+
+ f32 greyout = 0.0f;
+ if( mdl_entity_id_type(world_static.focused_entity) == k_ent_challenge )
+ greyout = world_static.focus_strength;
+
+ if( greyout > 0.0f ){
+ glDrawBuffers( 1, (GLenum[]){ GL_COLOR_ATTACHMENT0 } );
+ glEnable(GL_BLEND);
+ glDisable(GL_DEPTH_TEST);
+ glDepthMask(GL_FALSE);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glBlendEquation(GL_FUNC_ADD);
+
+ shader_blitcolour_use();
+ shader_blitcolour_uColour( (v4f){ 0.5f, 0.5f, 0.5f, greyout*0.56f } );
+ render_fsquad();
+
+ glDisable(GL_BLEND);
+ glEnable(GL_DEPTH_TEST);
+ glDepthMask(GL_TRUE);
+ glDrawBuffers( 2, (GLenum[]){ GL_COLOR_ATTACHMENT0,
+ GL_COLOR_ATTACHMENT1 } );
+ }
+
+ render_world_fxglow( world, cam, layer_depth );
+}
+
+
+static
+void render_world_override_pass( world_instance *world,
+ struct world_pass *pass ){
+ for( int i=0; i<world->surface_count; i++ ){
+ struct world_surface *mat = &world->surfaces[i];
+
+ if( mat->info.flags & k_material_flag_ghosts ) continue;
+
+ mdl_submesh *sm;
+ if( pass->geo_type == k_world_geo_type_solid )
+ sm = &mat->sm_geo;
+ else
+ sm = &mat->sm_no_collide;
+
+ if( !sm->indice_count )
+ continue;
+
+ m4x3f mmdl;
+ m4x3_identity( mmdl );
+ pass->fn_set_mdl( mmdl );
+ pass->fn_set_uPvmPrev( pass->cam->mtx_prev.pv );
+ pass->fn_bind_textures( world, mat );
+ mdl_draw_submesh( sm );
+ }
+}
+
+static void render_world_override( world_instance *world ){
+ struct world_pass pass = {
+ .cam = &skaterift.cam,
+ .fn_bind_textures = bindpoint_override,
+ .fn_set_mdl = shader_scene_override_uMdl,
+ .fn_set_uPvmPrev = shader_scene_override_uPvmPrev,
+ .shader = k_shader_override
+ };
+
+ shader_scene_override_use();
+ respawn_chooser_shader_uniforms();
+ shader_scene_override_uTexGarbage(0);
+ 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 );
+
+ bind_terrain_noise();
+ shader_scene_override_uCamera( pass.cam->transform[3] );
+
+ glDisable( GL_CULL_FACE );
+ mesh_bind( &world->mesh_geo );
+ pass.geo_type = k_world_geo_type_solid;
+ render_world_override_pass( world, &pass );
+ mesh_bind( &world->mesh_no_collide );
+ pass.geo_type = k_world_geo_type_nonsolid;
+ render_world_override_pass( world, &pass );
+ glEnable( GL_CULL_FACE );
+}