+ /*
+ * Compile meshes into the world scenes
+ */
+ scene_init( &world.geo );
+
+ u32 mat_surf = 0,
+ mat_surf_oob = 0,
+ mat_vertex_blend = 0;
+
+ for( int i=1; i<mworld->material_count; i++ )
+ {
+ mdl_material *mat = mdl_material_from_id( mworld, i );
+ const char *mat_name = mdl_pstr( mworld, mat->pstr_name );
+
+ if( !strcmp( "surf", mat_name ))
+ mat_surf = i;
+ else if( !strcmp( "surf_oob", mat_name ))
+ mat_surf_oob = i;
+ else if( !strcmp( "vertex_blend", mat_name ))
+ mat_vertex_blend = i;
+ }
+
+ vg_info( "surf %d\noob %d\nvert_blend %d\n", mat_surf, mat_surf_oob,
+ mat_vertex_blend );
+
+ m4x3f midentity;
+ m4x3_identity( midentity );
+
+ if( mat_surf_oob )
+ add_all_if_material( midentity, &world.geo, mworld, mat_surf_oob );
+ else
+ vg_warn( "No OOB surface\n" );
+ scene_copy_slice( &world.geo, &world.sm_geo_std_oob );
+
+ if( mat_surf )
+ add_all_if_material( midentity, &world.geo, mworld, mat_surf );
+ scene_copy_slice( &world.geo, &world.sm_geo_std );
+
+ if( mat_vertex_blend )
+ add_all_if_material( midentity, &world.geo, mworld, mat_vertex_blend );
+ scene_copy_slice( &world.geo, &world.sm_geo_vb );
+
+ scene_upload( &world.geo );
+ scene_bh_create( &world.geo );
+