summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-03-21 10:51:52 -0500
committerDave Parks <davep@lindenlab.com>2011-03-21 10:51:52 -0500
commit5b9ee2a9d5687eae6fd48ee6038cd2f7ed1d9a53 (patch)
treee066174191ad303484d864869e49cc4be64d91e0 /indra
parentbe553242ef706e33260f3f9e62d02f4720f00473 (diff)
parentbf3fb2566329a461ebf022a1a05a1fa95faff9aa (diff)
merge
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl2
-rw-r--r--indra/newview/lldrawpoolbump.cpp51
-rw-r--r--indra/newview/llface.cpp1
-rwxr-xr-xindra/newview/pipeline.cpp3
4 files changed, 30 insertions, 27 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index 7c89c01ea4..7a6b40006b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -102,7 +102,7 @@ void main()
float fd = depth*0.5f;
- while (sc > 1.0)
+ while (sc > 0.5)
{
dofSample(diff,w, fd, sc,sc);
dofSample(diff,w, fd, -sc,sc);
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 38ff3083ce..bbce847fdc 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -646,6 +646,8 @@ BOOL LLDrawPoolBump::bindBumpMap(U8 bump_code, LLViewerTexture* texture, F32 vsi
break;
}
+ llassert(bump);
+
if (bump)
{
if (channel == -2)
@@ -660,7 +662,7 @@ BOOL LLDrawPoolBump::bindBumpMap(U8 bump_code, LLViewerTexture* texture, F32 vsi
return TRUE;
}
-
+
return FALSE;
}
@@ -1000,25 +1002,28 @@ LLViewerTexture* LLBumpImageList::getBrightnessDarknessImage(LLViewerFetchedText
}
bump_image_map_t::iterator iter = entries_list->find(src_image->getID());
- if (iter != entries_list->end())
+ if (iter != entries_list->end() && iter->second.notNull())
{
bump = iter->second;
}
else
{
LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,1);
- raw->clear(0x77, 0x77, 0x77, 0xFF);
+ raw->clear(0x77, 0x77, 0xFF, 0xFF);
(*entries_list)[src_image->getID()] = LLViewerTextureManager::getLocalTexture( raw.get(), TRUE);
- (*entries_list)[src_image->getID()]->setExplicitFormat(GL_ALPHA8, GL_ALPHA);
-
- // Note: this may create an LLImageGL immediately
- src_image->setBoostLevel(LLViewerTexture::BOOST_BUMP) ;
- src_image->setLoadedCallback( callback_func, 0, TRUE, FALSE, new LLUUID(src_image->getID()), NULL );
bump = (*entries_list)[src_image->getID()]; // In case callback was called immediately and replaced the image
+ }
-// bump_total++;
-// llinfos << "*** Creating " << (void*)bump << " " << bump_total << llendl;
+ if (!src_image->hasCallbacks())
+ { //if image has no callbacks but resolutions don't match, trigger raw image loaded callback again
+ if (src_image->getWidth() != bump->getWidth() ||
+ src_image->getHeight() != bump->getHeight() ||
+ (LLPipeline::sRenderDeferred && bump->getComponents() != 4))
+ {
+ src_image->setBoostLevel(LLViewerTexture::BOOST_BUMP) ;
+ src_image->setLoadedCallback( callback_func, 0, TRUE, FALSE, new LLUUID(src_image->getID()), NULL );
+ }
}
}
@@ -1122,10 +1127,18 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
bump_image_map_t& entries_list(bump_code == BE_BRIGHTNESS ? gBumpImageList.mBrightnessEntries : gBumpImageList.mDarknessEntries );
bump_image_map_t::iterator iter = entries_list.find(source_asset_id);
- if (iter != entries_list.end() ||
- iter->second.isNull() ||
- iter->second->getWidth() != src->getWidth() ||
- iter->second->getHeight() != src->getHeight()) // bump not cached yet or has changed resolution
+ if (iter == entries_list.end() ||
+ iter->second.isNull())
+ { //make sure an entry exists for this image
+ LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,1);
+ raw->clear(0x77, 0x77, 0xFF, 0xFF);
+
+ entries_list[src_vi->getID()] = LLViewerTextureManager::getLocalTexture( raw.get(), TRUE);
+ iter = entries_list.find(src_vi->getID());
+ }
+
+ //if (iter->second->getWidth() != src->getWidth() ||
+ // iter->second->getHeight() != src->getHeight()) // bump not cached yet or has changed resolution
{
LLPointer<LLImageRaw> dst_image = new LLImageRaw(src->getWidth(), src->getHeight(), 1);
U8* dst_data = dst_image->getData();
@@ -1251,18 +1264,10 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
bump->setExplicitFormat(GL_RGBA, GL_RGBA);
bump->createGLTexture(0, nrm_image);
}
-
-
+
iter->second = bump; // derefs (and deletes) old image
//---------------------------------------------------
}
- else
- {
- // entry should have been added in LLBumpImageList::getImage().
-
- // Not a legit assertion - the bump texture could have been flushed by the bump image manager
- //llassert(0);
- }
}
}
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index 290115417f..ae455a8287 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -1729,6 +1729,7 @@ BOOL LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius)
t.load3(camera->getOrigin().mV);
lookAt.setSub(center, t);
F32 dist = lookAt.getLength3().getF32();
+ dist = llmax(dist-size.getLength3().getF32(), 0.f);
lookAt.normalize3fast() ;
//get area of circle around node
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 24486a7411..6a376554b9 100755
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -825,7 +825,6 @@ void LLPipeline::releaseGLBuffers()
mGlow[i].release();
}
- gBumpImageList.destroyGL();
LLVOAvatar::resetImpostors();
}
@@ -948,8 +947,6 @@ void LLPipeline::createGLBuffers()
addDeferredAttachments(mGIMap);
}
}
-
- gBumpImageList.restoreGL();
}
void LLPipeline::restoreGL()