Commit 8733a845 authored by Mathias Goldau's avatar Mathias Goldau
Browse files

[ADD] Fiber Stipples now use a color threshold to emphazise also low probabilities.

parent 00e1a741
......@@ -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
......
......@@ -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.
*/
......
......@@ -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
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment