summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml16
-rw-r--r--indra/newview/llfloatersettingsdebug.cpp42
-rw-r--r--indra/newview/llviewertexturelist.cpp32
3 files changed, 90 insertions, 0 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index a4a9323892..d7026d2dce 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -11805,6 +11805,22 @@
<key>Value</key>
<real>20.0</real>
</map>
+ <key>TextureChannelPriority</key>
+ <map>
+ <key>Comment</key>
+ <string>Per-channel texture streaming aggressiveness. X=normals, Y=diffuse, Z=specular/metallic, W=emissive. 1.0=baseline, higher=more aggressive downrez.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Vector4</string>
+ <key>Value</key>
+ <array>
+ <real>5</real>
+ <real>7.5</real>
+ <real>20</real>
+ <real>7.5</real>
+ </array>
+ </map>
<key>TextureCameraBoost</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp
index 01108b5cfa..92b3c92165 100644
--- a/indra/newview/llfloatersettingsdebug.cpp
+++ b/indra/newview/llfloatersettingsdebug.cpp
@@ -106,6 +106,7 @@ void LLFloaterSettingsDebug::onCommitSettings()
LLVector3 vector;
LLVector3d vectord;
+ LLVector4 vector4;
LLQuaternion quat;
LLRect rect;
LLColor4 col4;
@@ -142,6 +143,13 @@ void LLFloaterSettingsDebug::onCommitSettings()
vectord.mdV[VZ] = mValSpinner3->getValue().asReal();
controlp->set(vectord.getValue());
break;
+ case TYPE_VEC4:
+ vector4.mV[VX] = (F32)mValSpinner1->getValue().asReal();
+ vector4.mV[VY] = (F32)mValSpinner2->getValue().asReal();
+ vector4.mV[VZ] = (F32)mValSpinner3->getValue().asReal();
+ vector4.mV[VW] = (F32)mValSpinner4->getValue().asReal();
+ controlp->set(vector4.getValue());
+ break;
case TYPE_QUAT:
quat.mQ[VX] = mValSpinner1->getValueF32();
quat.mQ[VY] = mValSpinner2->getValueF32();
@@ -352,6 +360,40 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp)
}
break;
}
+ case TYPE_VEC4:
+ {
+ LLVector4 v;
+ v.setValue(sd);
+ mValSpinner1->setVisible(true);
+ mValSpinner1->setLabel(std::string("X"));
+ mValSpinner2->setVisible(true);
+ mValSpinner2->setLabel(std::string("Y"));
+ mValSpinner3->setVisible(true);
+ mValSpinner3->setLabel(std::string("Z"));
+ mValSpinner4->setVisible(true);
+ mValSpinner4->setLabel(std::string("W"));
+ if (!mValSpinner1->hasFocus())
+ {
+ mValSpinner1->setPrecision(3);
+ mValSpinner1->setValue(v[VX]);
+ }
+ if (!mValSpinner2->hasFocus())
+ {
+ mValSpinner2->setPrecision(3);
+ mValSpinner2->setValue(v[VY]);
+ }
+ if (!mValSpinner3->hasFocus())
+ {
+ mValSpinner3->setPrecision(3);
+ mValSpinner3->setValue(v[VZ]);
+ }
+ if (!mValSpinner4->hasFocus())
+ {
+ mValSpinner4->setPrecision(3);
+ mValSpinner4->setValue(v[VW]);
+ }
+ break;
+ }
case TYPE_QUAT:
{
LLQuaternion q;
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index e4fd947892..7dd32074cf 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -1014,6 +1014,38 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
}
imagep->addTextureStats(max_vsize);
+
+ // Derive stream priority channel from face lists.
+ // Map render texture channels to priority channels:
+ // 0 = normal, 1 = diffuse, 2 = specular, 3 = emissive
+ {
+ static const S32 render_to_priority[] = {
+ 1, // DIFFUSE_MAP (0)
+ 0, // NORMAL_MAP / ALTERNATE_DIFFUSE_MAP (1)
+ 2, // SPECULAR_MAP (2)
+ 1, // BASECOLOR_MAP (3)
+ 2, // METALLIC_ROUGHNESS_MAP (4)
+ 0, // GLTF_NORMAL_MAP (5)
+ 3, // EMISSIVE_MAP (6)
+ };
+
+ S32 priority_channel = 1; // default to diffuse
+ for (U32 i = 0; i < LLRender::NUM_TEXTURE_CHANNELS; ++i)
+ {
+ if (imagep->getNumFaces(i) > 0)
+ {
+ priority_channel = llmin(priority_channel, render_to_priority[i]);
+ }
+ }
+
+ static LLCachedControl<LLVector4> channel_priority(gSavedSettings, "TextureChannelPriority",
+ LLVector4(10.0f, 20.0f, 40.0f, 20.0f));
+ F32 factor = llmax(channel_priority().mV[priority_channel], 0.1f);
+ if (factor != 1.0f)
+ {
+ imagep->mMaxVirtualSize /= factor;
+ }
+ }
}
#if 0