Implemented new texture streaming algorithm:
Textures are assigned a “weight” by tuneable criteria: - Area of screen coverage taken by objects containing material (more accurate and generic than distance) - Type of texture (separate weight for normal, diffuse, spec maps) - Last used time (to keep textures loaded for recently seen objects that are outside of the view frustum) Those factors combine together to give a “weight”, which represents a proportion relative to all other textures weights Mipmap levels are stripped off of each texture until they occupy the amount of memory they should proportionally have This is in contrast to the global ceiling of texture resolution that slowly drops until the textures fit --HG-- branch : nfb extra : rebase_source : 0710cebf76f196f5fea20b6df51be539fafbd834
This commit is contained in:
@@ -55,7 +55,7 @@ void KRLODSet::updateLODVisibility(const KRViewport &viewport)
|
||||
} else if(m_activeLODGroup == NULL) {
|
||||
m_activeLODGroup = new_active_lod_group;
|
||||
} else if(new_active_lod_group != m_activeLODGroup) {
|
||||
if(true || new_active_lod_group->getStreamLevel(true) >= kraken_stream_level::STREAM_LEVEL_IN_LQ) {
|
||||
if(new_active_lod_group->getStreamLevel(true, viewport) >= kraken_stream_level::STREAM_LEVEL_IN_LQ) {
|
||||
// fprintf(stderr, "LOD %s -> %s\n", m_activeLODGroup->getName().c_str(), new_active_lod_group->getName().c_str());
|
||||
m_activeLODGroup = new_active_lod_group;
|
||||
} else {
|
||||
@@ -104,10 +104,10 @@ void KRLODSet::showLOD()
|
||||
}
|
||||
}
|
||||
|
||||
kraken_stream_level KRLODSet::getStreamLevel(bool prime)
|
||||
kraken_stream_level KRLODSet::getStreamLevel(bool prime, const KRViewport &viewport)
|
||||
{
|
||||
if(m_activeLODGroup) {
|
||||
return m_activeLODGroup->getStreamLevel(prime);
|
||||
return m_activeLODGroup->getStreamLevel(prime, viewport);
|
||||
} else {
|
||||
return kraken_stream_level::STREAM_LEVEL_IN_HQ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user