summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Breindel (Falcon) <falcon@lindenlab.com>2010-05-18 11:26:53 -0700
committerMatthew Breindel (Falcon) <falcon@lindenlab.com>2010-05-18 11:26:53 -0700
commit1d92a950df91d7e6d3a34e925f445bc389a3fa93 (patch)
tree8e783022cd6ec4812640e390d0d8f5498b4a0ae5
parent246dd9c168550bfe4b1b71bba75f5af9456e86dd (diff)
Modified color scheme for visualization of physics reps.
-rw-r--r--indra/newview/app_settings/settings.xml18
-rw-r--r--indra/newview/llspatialpartition.cpp13
2 files changed, 29 insertions, 2 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 107f98071c..2e7ff939ee 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -5427,7 +5427,7 @@
<key>Type</key>
<string>F32</string>
<key>Value</key>
- <real>128.0</real>
+ <real>50.0</real>
</map>
<key>ObjectCostLowColor</key>
<map>
@@ -5445,6 +5445,22 @@
<real>0.5</real>
</array>
</map>
+ <key>ObjectCostMidColor</key>
+ <map>
+ <key>Comment</key>
+ <string>Color for object with a medium object cost.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Color4</string>
+ <key>Value</key>
+ <array>
+ <real>1.0</real>
+ <real>0.75</real>
+ <real>0.0</real>
+ <real>0.65</real>
+ </array>
+ </map>
<key>ObjectCostHighColor</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 1290e6b9a6..9bfc12c7ab 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -2676,9 +2676,20 @@ void renderPhysicsShape(LLDrawable* drawable)
F32 cost = volume->getObjectCost();
LLColor4 low = gSavedSettings.getColor4("ObjectCostLowColor");
+ LLColor4 mid = gSavedSettings.getColor4("ObjectCostMidColor");
LLColor4 high = gSavedSettings.getColor4("ObjectCostHighColor");
- LLColor4 color = lerp(low, high, cost/threshold);
+ F32 normalizedCost = 1.f - exp( -(cost / threshold) );
+
+ LLColor4 color;
+ if ( normalizedCost <= 0.5f )
+ {
+ color = lerp( low, mid, 2.f * normalizedCost );
+ }
+ else
+ {
+ color = lerp( mid, high, 2.f * ( normalizedCost - 0.5f ) );
+ }
U32 data_mask = LLVertexBuffer::MAP_VERTEX;