diff options
author | Matthew Breindel (Falcon) <falcon@lindenlab.com> | 2010-05-18 11:26:53 -0700 |
---|---|---|
committer | Matthew Breindel (Falcon) <falcon@lindenlab.com> | 2010-05-18 11:26:53 -0700 |
commit | 1d92a950df91d7e6d3a34e925f445bc389a3fa93 (patch) | |
tree | 8e783022cd6ec4812640e390d0d8f5498b4a0ae5 /indra/newview/llspatialpartition.cpp | |
parent | 246dd9c168550bfe4b1b71bba75f5af9456e86dd (diff) |
Modified color scheme for visualization of physics reps.
Diffstat (limited to 'indra/newview/llspatialpartition.cpp')
-rw-r--r-- | indra/newview/llspatialpartition.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
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; |