-
- scene_init( &world.geo );
- scene_init( &world.props );
-
- /*
- * Compile meshes into the world scenes
- */
- 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 );
-
- vg_info( "%d %s\n", mat->pstr_name, mat_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;
- }
-
- if( mat_surf )
- add_all_if_material( &world.geo, mworld, mat_surf );
- if( mat_vertex_blend )
- add_all_if_material( &world.geo, mworld, mat_vertex_blend );
-
-
- scene_copy_slice( &world.geo, &world.sm_surface );
-
- if( mat_surf_oob )
- add_all_if_material( &world.geo, mworld, mat_surf_oob );
- else
- vg_warn( "No OOB surface\n" );
-
- scene_bh_create( &world.geo );
- scene_upload( &world.geo );
-
- if( mat_vertex_blend )
- add_all_if_material( &world.props, mworld, mat_vertex_blend );
-
- /* TODO bvh? */