Improvements to the way blending between materials is handled.

This commit is contained in:
David Williams 2009-10-24 18:48:52 +00:00
parent c695a7bc86
commit e820b3de6e
2 changed files with 10 additions and 1 deletions

View File

@ -85,6 +85,11 @@ namespace PolyVox
std::vector<SurfaceVertex> m_vecVertices;
std::vector<LodRecord> m_vecLodRecords;
//The set of materials which are in this mesh. Only those materials
//which cover a whole triangle are counted. Materials which only
//exist on a material boundary do not count.
std::set<uint8_t> m_mapUsedMaterials;
};
}

View File

@ -98,7 +98,11 @@ namespace PolyVox
m_vecTriangleIndices.push_back(index1);
m_vecTriangleIndices.push_back(index2);
if((m_vecVertices[index0].material != m_vecVertices[index1].material) || (m_vecVertices[index0].material != m_vecVertices[index2].material))
if((m_vecVertices[index0].material == m_vecVertices[index1].material) && (m_vecVertices[index0].material == m_vecVertices[index2].material))
{
m_mapUsedMaterials.insert(m_vecVertices[index0].material);
}
else
{
m_vecVertices[index0].m_bIsMaterialEdgeVertex = true;
m_vecVertices[index1].m_bIsMaterialEdgeVertex = true;