From 1d92a950df91d7e6d3a34e925f445bc389a3fa93 Mon Sep 17 00:00:00 2001 From: "Matthew Breindel (Falcon)" Date: Tue, 18 May 2010 11:26:53 -0700 Subject: Modified color scheme for visualization of physics reps. --- indra/newview/app_settings/settings.xml | 18 +++++++++++++++++- indra/newview/llspatialpartition.cpp | 13 ++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) (limited to 'indra') 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 @@ Type F32 Value - 128.0 + 50.0 ObjectCostLowColor @@ -5445,6 +5445,22 @@ 0.5 + ObjectCostMidColor + + Comment + Color for object with a medium object cost. + Persist + 1 + Type + Color4 + Value + + 1.0 + 0.75 + 0.0 + 0.65 + + ObjectCostHighColor Comment 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; -- cgit v1.2.3