+static void render_other_entities( world_instance *world, vg_camera *cam )
+{
+ f32 radius = 40.0f;
+ bh_iter it;
+ bh_iter_init_range( 0, &it, cam->pos, radius+10.0f );
+
+ u32 glider_list[4],
+ glider_count = 0,
+ npc_list[4],
+ npc_count = 0;
+
+ i32 idx;
+ while( bh_next( world->entity_bh, &it, &idx ) ){
+ u32 id = world->entity_list[ idx ],
+ type = mdl_entity_id_type( id ),
+ index = mdl_entity_id_id( id );
+
+ if( type == k_ent_glider )
+ {
+ if( glider_count < vg_list_size(glider_list) )
+ glider_list[ glider_count ++ ] = index;
+ }
+ else if( type == k_ent_npc )
+ {
+ if( npc_count < vg_list_size(npc_list) )
+ npc_list[ npc_count ++ ] = index;
+ }
+ }
+
+ shader_model_entity_use();
+ shader_model_entity_uTexMain( 0 );
+ shader_model_entity_uCamera( cam->transform[3] );
+ shader_model_entity_uPv( cam->mtx.pv );
+ WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( world, model_entity );
+
+ for( u32 j=0; j<glider_count; j ++ )
+ {
+ ent_glider *glider = mdl_arritm( &world->ent_glider, glider_list[j] );
+
+ if( !(glider->flags & 0x1) )
+ continue;
+
+ m4x3f mdl;
+ mdl_transform_m4x3( &glider->transform, mdl );
+
+ f32 dist = v3_dist( glider->transform.co, cam->pos ) * (1.0f/radius),
+ scale = vg_smoothstepf( vg_clampf( 5.0f-dist*5.0f, 0.0f,1.0f ) );
+ m3x3_scalef( mdl, scale );
+
+ render_glider_model( cam, world, mdl, k_board_shader_entity );
+ }
+
+ for( u32 j=0; j<npc_count; j ++ )
+ {
+ u32 index = npc_list[j];
+ ent_npc *npc = mdl_arritm( &world->ent_npc, npc_list[j] );
+ npc_update( npc );
+ npc_render( npc, world, cam );
+ }
+}
+
+void render_world( world_instance *world, vg_camera *cam,
+ int stenciled, int viewing_from_gate,
+ int with_water, int with_cubemaps )
+{