From 58b93cda2349f4fa4db49ebdcf4647604e8da92b Mon Sep 17 00:00:00 2001 From: Sovanny Huy Date: Wed, 4 Sep 2019 15:48:02 -0400 Subject: [PATCH] change polarity fl colors and add option (in comments) for white and gray texture --- .../transferfunctions/openness_spec.txt | 4 +-- .../transferfunctions/polarity_spec.txt | 4 +-- modules/base/rendering/suntexturemanager.cpp | 26 ++++++++++++++++--- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/data/assets/testwsa/transferfunctions/openness_spec.txt b/data/assets/testwsa/transferfunctions/openness_spec.txt index e60ef94919..b94862399a 100644 --- a/data/assets/testwsa/transferfunctions/openness_spec.txt +++ b/data/assets/testwsa/transferfunctions/openness_spec.txt @@ -3,5 +3,5 @@ lower 0.0 upper 1.0 mappingkey 0.0 255 255 50 225 -mappingkey 0.5 20 50 255 225 -mappingkey 1.0 255 50 20 225 \ No newline at end of file +mappingkey 0.5 255 50 20 225 +mappingkey 1.0 20 50 255 225 \ No newline at end of file diff --git a/data/assets/testwsa/transferfunctions/polarity_spec.txt b/data/assets/testwsa/transferfunctions/polarity_spec.txt index 86c724ef5b..f723de1afd 100644 --- a/data/assets/testwsa/transferfunctions/polarity_spec.txt +++ b/data/assets/testwsa/transferfunctions/polarity_spec.txt @@ -2,5 +2,5 @@ width 2.0 lower 0.0 upper 1.0 -mappingkey 0.0 20 50 255 205 -mappingkey 1.0 255 50 20 205 +mappingkey 0.0 255 50 20 225 +mappingkey 1.0 20 50 255 225 diff --git a/modules/base/rendering/suntexturemanager.cpp b/modules/base/rendering/suntexturemanager.cpp index 361845e55b..a28c2a4806 100644 --- a/modules/base/rendering/suntexturemanager.cpp +++ b/modules/base/rendering/suntexturemanager.cpp @@ -280,16 +280,34 @@ void SunTextureManager::processTextureFromName(std::string filename, std::vector { float norm_abs_value = abs(mapvalue)/maxvalue; - r = 0.0f, g = 0.0f, b = 0.0f; + //r = 1.0f, g = 1.0f, b = 1.0f; // white + //r = 0.0f, g = 0.0f, b = 0.0f; // black + r = 0.5f, g = 0.5f, b = 0.5f; // gray if(mapvalue != 0.0f){ float colorIntensity = damper*log(1 + multiplyer*norm_abs_value); if (wsaMapType.compare("agong") == 0 ) colorIntensity = norm_abs_value; if(mapvalue < 0) - r = colorIntensity; - else - b = colorIntensity; + { + //r = colorIntensity; //black + //g = 1.0 - colorIntensity; // white + //b = 1.0 - colorIntensity; // white + r = colorIntensity*0.5 + 0.5; + g = colorIntensity*0.5 + 0.5; + b = colorIntensity*0.5 + 0.5; + } + + else{ + //b = colorIntensity; // black + //r = 1.0 - colorIntensity; // white + //g = 1.0 - colorIntensity; // white + r = 1.0 - (colorIntensity*0.5 + 0.5); // gray + g = 1.0 - (colorIntensity*0.5 + 0.5); // gray + b = 1.0 - (colorIntensity*0.5 + 0.5); // gray + + } + } std::vector rgb = {r,g,b}; rgbLayers.push_back(rgb);