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 Modules
Commits
8733a845
Commit
8733a845
authored
Nov 20, 2012
by
Mathias Goldau
Browse files
[ADD] Fiber Stipples now use a color threshold to emphazise also low probabilities.
parent
00e1a741
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
FiberStippleToolbox/src/fiberStipples/WMFiberStipples.cpp
FiberStippleToolbox/src/fiberStipples/WMFiberStipples.cpp
+5
-0
FiberStippleToolbox/src/fiberStipples/WMFiberStipples.h
FiberStippleToolbox/src/fiberStipples/WMFiberStipples.h
+5
-0
FiberStippleToolbox/src/fiberStipples/shaders/WFiberStipples-fragment.glsl
...ox/src/fiberStipples/shaders/WFiberStipples-fragment.glsl
+7
-1
No files found.
FiberStippleToolbox/src/fiberStipples/WMFiberStipples.cpp
View file @
8733a845
...
...
@@ -99,6 +99,10 @@ void WMFiberStipples::properties()
m_threshold
->
setMin
(
0.0
);
m_threshold
->
setMax
(
1.0
);
m_colorThreshold
=
m_properties
->
addProperty
(
"Color Threshold"
,
"Colors of connectivity scores below this threshold will be maped to colors representing this probability."
,
0.00
);
m_colorThreshold
->
setMin
(
0.0
);
m_colorThreshold
->
setMax
(
1.0
);
m_minRange
=
m_properties
->
addProperty
(
"Min Range"
,
"Minimal stipple density"
,
0.0
);
m_minRange
->
setMin
(
0.0
);
m_minRange
->
setMax
(
1.0
);
...
...
@@ -247,6 +251,7 @@ void WMFiberStipples::initOSG( boost::shared_ptr< WDataSetScalar > probTract, co
wge
::
bindAsUniform
(
m_output
,
numDensitySlices
,
"u_numDensitySlices"
);
wge
::
bindAsUniform
(
m_output
,
m_glyphSize
,
"u_glyphSize"
);
wge
::
bindAsUniform
(
m_output
,
m_glyphThickness
,
"u_glyphThickness"
);
wge
::
bindAsUniform
(
m_output
,
m_colorThreshold
,
"u_colorThreshold"
);
// each slice (containing scattered quads) is child of an transformation node
...
...
FiberStippleToolbox/src/fiberStipples/WMFiberStipples.h
View file @
8733a845
...
...
@@ -140,6 +140,11 @@ private:
*/
WPropDouble
m_threshold
;
/**
* All probabilities below this probability are highlighted to the color of this probability.
*/
WPropDouble
m_colorThreshold
;
/**
* Determines the size of the quad used to stamp out the stipples.
*/
...
...
FiberStippleToolbox/src/fiberStipples/shaders/WFiberStipples-fragment.glsl
View file @
8733a845
...
...
@@ -42,6 +42,11 @@ uniform vec3 middlePoint_tex = vec3( 0.5, 0.5, 0.0 );
*/
uniform
float
u_glyphThickness
;
/**
* All probabilities below this probability are highlighted to the color of this probability.
*/
uniform
float
u_colorThreshold
;
void
main
()
{
// generally the area of a line stipple is a circle with radius R (each half for the endings of the line stipple) plus
...
...
@@ -85,7 +90,8 @@ void main()
if
(
distancePointLineSegment
(
gl_TexCoord
[
1
].
xyz
,
scaledFocalPoint1
,
scaledFocalPoint2
)
<
radius
)
{
gl_FragColor
=
u_color
*
probability
;
gl_FragColor
=
u_color
*
pow
(
probability
,
1
.
0
/
(
10
.
0
*
u_colorThreshold
)
);
// gl_FragColor = clamp( u_color * clamp( u_colorThreshold + probability, 0.0, 1.0 ) - vec4( 0.0, 0.0, 0.0, 0.2 ), 0.0, 1.0 );
}
else
{
...
...
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