mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Fix rendering issue in flow view
This commit is contained in:
parent
dd952c7f63
commit
91c4d8b5f2
1 changed files with 15 additions and 7 deletions
|
@ -116,7 +116,15 @@ vertex41core =
|
|||
// Inspired by https://stackoverflow.com/a/46628410
|
||||
vec4 flowRateGradientColor(float abs_value, float min_value, float max_value)
|
||||
{
|
||||
float t = 2.0 * ((abs_value - min_value) / (max_value - min_value)) - 1;
|
||||
float t;
|
||||
if(abs(min_value - max_value) < 0.0001)
|
||||
{
|
||||
t = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
t = 2.0 * ((abs_value - min_value) / (max_value - min_value)) - 1;
|
||||
}
|
||||
float red = clamp(1.5 - abs(2.0 * t - 1.0));
|
||||
float green = clamp(1.5 - abs(2.0 * t));
|
||||
float blue = clamp(1.5 - abs(2.0 * t + 1.0));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue