Performance optimizations in deferred lighting shaders
Created structures for alpha transparency and occlusion culling Fixed memory allocation issue in KREngine.mm (pointer to NSDictionary allocated on stack retained and later dereferenced when popped) --HG-- extra : convert_revision : svn%3A7752d6cf-9f14-4ad2-affc-04f1e67b81a5/trunk%4074
This commit is contained in:
@@ -56,6 +56,14 @@ void KRModel::loadPack(std::string path) {
|
||||
m_uniqueMaterials.clear();
|
||||
m_pMesh = new KRMesh(*m_pContext, KRResource::GetFileBase(path));
|
||||
m_pMesh->loadPack(path);
|
||||
|
||||
m_hasTransparency = false;
|
||||
for(std::set<KRMaterial *>::iterator mat_itr = m_uniqueMaterials.begin(); mat_itr != m_uniqueMaterials.end(); mat_itr++) {
|
||||
if((*mat_itr)->isTransparent()) {
|
||||
m_hasTransparency = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string KRModel::getName() {
|
||||
@@ -124,3 +132,7 @@ KRMesh *KRModel::getMesh() {
|
||||
return m_pMesh;
|
||||
}
|
||||
|
||||
bool KRModel::hasTransparency() {
|
||||
return m_hasTransparency;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user