Index: trunk/src/engine/material_manager.cc
===================================================================
--- trunk/src/engine/material_manager.cc	(revision 487)
+++ trunk/src/engine/material_manager.cc	(revision 491)
@@ -39,5 +39,5 @@
 
 		// HACK
- 		for ( uint32 i = 0; i < 5; ++i )
+ 		for ( uint32 i = 0; i < 8; ++i )
  			if ( result->textures[i].is_nil() )
  				result->textures[i] = m_default;
@@ -59,11 +59,37 @@
 bool material_manager::load_resource( nv::lua::table_guard& table, nv::shash64 id )
 {
+	c_file_system fs;
 	material* m = new material;
-	m->paths[ TEX_DIFFUSE ]  = table.get_string128( "diffuse" );
-	m->paths[ TEX_SPECULAR ] = table.get_string128( "specular" );
-	m->paths[ TEX_NORMAL ]   = table.get_string128( "normal" );
-	m->paths[ TEX_EMISSIVE ] = table.get_string128( "emissive" );
-	m->paths[ TEX_GLOSS ]    = table.get_string128( "gloss" );
+
+	if ( table.is_string( "path" ) )
+	{
+		string128 path = table.get_string128( "path" );
+		for ( uint32 i = 0; i < 5; ++i )
+			m->paths[i] = path;
+		m->paths[TEX_DIFFUSE].append( "_diffuse.png" );
+		m->paths[TEX_NORMAL].append( "_normal.png" );
+		m->paths[TEX_METALLIC].append( "_metallic.png" );
+		m->paths[TEX_ROUGHNESS].append( "_roughness.png" );
+		m->paths[TEX_EMISSIVE].append( "_emissive.png" );
+		for ( uint32 i = 0; i < 5; ++i )
+		{
+			if ( !fs.exists( m->paths[i] ) )
+			{
+				if ( i != TEX_EMISSIVE )
+					NV_LOG_ERROR( "Texture file not found! : ", m->paths[i] );
+				m->paths[i].clear();
+			}
+		}
+	}
+	else
+	{
+		m->paths[ TEX_DIFFUSE ]  = table.get_string128( "diffuse" );
+		m->paths[ TEX_NORMAL ]   = table.get_string128( "normal" );
+		m->paths[ TEX_METALLIC]  = table.get_string128( "metallic" );
+		m->paths[ TEX_ROUGHNESS] = table.get_string128( "roughness" );
+		m->paths[ TEX_EMISSIVE ] = table.get_string128( "emissive" );
+	}
 	add( id, m );
 	return true;
 }
+
Index: trunk/src/engine/particle_engine.cc
===================================================================
--- trunk/src/engine/particle_engine.cc	(revision 487)
+++ trunk/src/engine/particle_engine.cc	(revision 491)
@@ -497,6 +497,9 @@
 	info->particles = new particle[ data->quota ];
 	info->quads     = new particle_quad[ data->quota ];
-	info->vtx_array = m_context->create_vertex_array<particle_vtx>( info->quads[0].data, data->quota*6, STREAM_DRAW );
-	info->vtx_buffer = m_context->find_buffer( info->vtx_array, slot::POSITION );
+
+	vertex_array_desc desc;
+	info->vtx_buffer = m_device->create_buffer( VERTEX_BUFFER, STREAM_DRAW, data->quota * 6 * sizeof( particle_vtx ), info->quads[0].data );
+	desc.add_vertex_buffers< particle_vtx >( info->vtx_buffer, true );
+	info->vtx_array = m_context->create_vertex_array( desc );
 	info->last_update = m_last_update;
 	info->test = false;
