Added an experimental new alphamask detection method(set SHUseRMSEAutoMask to TRUE to use. Adjust SHAlphaMaskMaxRMSE to tweak cutoff). Fixed per-frame sky updates hammering analyzeAlpha.

This commit is contained in:
Shyotl
2013-04-06 02:04:46 -05:00
parent e2255f419d
commit b16bb264cc
17 changed files with 170 additions and 28 deletions

View File

@@ -274,6 +274,8 @@ extern void toggle_debug_menus(void*);
// LLDebugText
//
extern std::map<LLGLuint, std::list<std::pair<std::string,std::string> > > sTextureMaskMap;
class LLDebugText
{
private:
@@ -336,6 +338,46 @@ public:
addText(xpos, ypos, llformat("Time: %d:%02d:%02d", hours,mins,secs)); ypos += y_inc;
}
}
static const LLCachedControl<bool> analyze_target_texture("AnalyzeTargetTexture", false);
if(analyze_target_texture)
{
static LLViewerObject* lastObject = NULL;
LLSelectNode* nodep = LLSelectMgr::instance().getPrimaryHoverNode();
LLObjectSelectionHandle handle = LLSelectMgr::instance().getHoverObjects();
if(nodep || handle.notNull())
{
LLViewerObject* obj1 = nodep ? nodep->getObject() : NULL;
LLViewerObject* obj2 = handle ? handle->getPrimaryObject() : NULL;
LLViewerObject* obj = obj1 ? obj1 : obj2;
//llinfos << std::hex << obj1 << " " << obj2 << std::dec << llendl;
if(obj)
{
S32 te = nodep ? nodep->getLastSelectedTE() : -1;
if(te > 0)
{
LLViewerTexture* imagep = obj->getTEImage(te);
if(imagep && imagep != (LLViewerTexture*)LLViewerFetchedTexture::sDefaultImagep.get())
{
LLGLuint tex = imagep->getTexName();
std::map<LLGLuint, std::list<std::pair<std::string,std::string> > >::iterator it = sTextureMaskMap.find(tex);
if(it != sTextureMaskMap.end())
{
std::list<std::pair<std::string,std::string> >::reverse_iterator it2 = it->second.rbegin();
for(;it2!=it->second.rend();++it2)
{
addText(xpos, ypos, llformat(" %s: %s", it2->first.c_str(), it2->second.c_str())); ypos += y_inc;
}
}
static const LLCachedControl<bool> use_rmse_auto_mask("SHUseRMSEAutoMask",false);
static const LLCachedControl<F32> alpha_mas_max_rmse("SHAlphaMaskMaxRMSE",.09f);
addText(xpos, ypos, llformat("Mask: %s", imagep->getIsAlphaMask(use_rmse_auto_mask ? alpha_mas_max_rmse : -1.f) ? "TRUE":"FALSE")); ypos += y_inc;
addText(xpos, ypos, llformat("ID: %s", imagep->getID().asString())); ypos += y_inc;
}
}
}
}
}
#if LL_WINDOWS
static const LLCachedControl<bool> debug_show_memory("DebugShowMemory");