Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
7ce5d8c1
Commit
7ce5d8c1
authored
Feb 22, 2013
by
Sebastian Eichelbaum
Browse files
[FIX] negative-to-positve colormap did ignore positive-only values. fixed now.
parent
b7dbead5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/core/graphicsEngine/shaders/shaders/WGEColorMapsImproved.glsl
.../graphicsEngine/shaders/shaders/WGEColorMapsImproved.glsl
+1
-1
No files found.
src/core/graphicsEngine/shaders/shaders/WGEColorMapsImproved.glsl
View file @
7ce5d8c1
...
...
@@ -138,7 +138,7 @@ vec4 negative2positive( in float valueDescaled, in float minV, in float scaleV )
// the descaled value can be in interval [minV,minV+Scale]. But as we want linear scaling where the pos and neg colors are scaled linearly
// agains each other, and we want to handle real negative values correctly. For only positive values, use their interval mid-point.
float
isNegative
=
(
-
1
.
0
*
clamp
(
sign
(
minV
),
-
1
.
0
,
0
.
0
)
);
// this is 1.0 if minV is smaller than zero
float
isNegative
=
1
.
0
-
(
-
1
.
0
*
clamp
(
sign
(
minV
),
-
1
.
0
,
0
.
0
)
);
// this is 1.0 if minV is smaller than zero
float
mid
=
(
1
.
0
-
isNegative
)
*
0
.
5
*
scaleV
;
// if negative, the mid point always is 0.0
// the width of the interval is its original width/2 if there are no negative values in the dataset
float
width
=
(
isNegative
*
max
(
abs
(
minV
),
abs
(
minV
+
scaleV
)
)
)
+
(
(
1
.
0
-
isNegative
)
*
mid
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment