Commit 8267978c authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[FIX] too dark light. Added property to modify this on demand as this heavily...

[FIX] too dark light. Added property to modify this on demand as this heavily depends on the LIC image itself.
parent ff6ddbb2
...@@ -135,6 +135,9 @@ void WMImageSpaceLIC::properties() ...@@ -135,6 +135,9 @@ void WMImageSpaceLIC::properties()
m_licGroup = m_properties->addPropertyGroup( "LIC", "LIC properties." ); m_licGroup = m_properties->addPropertyGroup( "LIC", "LIC properties." );
m_useLight = m_licGroup->addProperty( "Use Light", "Check to enable lightning using the Phong model.", false ); m_useLight = m_licGroup->addProperty( "Use Light", "Check to enable lightning using the Phong model.", false );
m_lightIntensity = m_licGroup->addProperty( "Light Intensity", "Define how intense the light should be.", 1.0 );
m_lightIntensity->setMin( 0.0 );
m_lightIntensity->setMax( 10.0 );
m_useEdges = m_licGroup->addProperty( "Edges", "Check to enable blending in edges.", true ); m_useEdges = m_licGroup->addProperty( "Edges", "Check to enable blending in edges.", true );
m_useHighContrast = m_licGroup->addProperty( "High Contrast", "Use an extremely increased contrast.", false ); m_useHighContrast = m_licGroup->addProperty( "High Contrast", "Use an extremely increased contrast.", false );
...@@ -369,6 +372,7 @@ void WMImageSpaceLIC::moduleMain() ...@@ -369,6 +372,7 @@ void WMImageSpaceLIC::moduleMain()
// final pass needs some uniforms controlled by properties // final pass needs some uniforms controlled by properties
clipBlend->addUniform( new WGEPropertyUniform< WPropBool >( "u_useEdges", m_useEdges ) ); clipBlend->addUniform( new WGEPropertyUniform< WPropBool >( "u_useEdges", m_useEdges ) );
clipBlend->addUniform( new WGEPropertyUniform< WPropBool >( "u_useLight", m_useLight ) ); clipBlend->addUniform( new WGEPropertyUniform< WPropBool >( "u_useLight", m_useLight ) );
clipBlend->addUniform( new WGEPropertyUniform< WPropDouble >( "u_lightIntensity", m_lightIntensity ) );
clipBlend->addUniform( new WGEPropertyUniform< WPropBool >( "u_useDepthCueing", m_useDepthCueing ) ); clipBlend->addUniform( new WGEPropertyUniform< WPropBool >( "u_useDepthCueing", m_useDepthCueing ) );
clipBlend->addUniform( new WGEPropertyUniform< WPropBool >( "u_useHighContrast", m_useHighContrast ) ); clipBlend->addUniform( new WGEPropertyUniform< WPropBool >( "u_useHighContrast", m_useHighContrast ) );
clipBlend->addUniform( new WGEPropertyUniform< WPropDouble >( "u_cmapRatio", m_cmapRatio ) ); clipBlend->addUniform( new WGEPropertyUniform< WPropDouble >( "u_cmapRatio", m_cmapRatio ) );
......
...@@ -168,6 +168,8 @@ private: ...@@ -168,6 +168,8 @@ private:
WPropBool m_useLight; //!< indicates whether to use Phong WPropBool m_useLight; //!< indicates whether to use Phong
WPropDouble m_lightIntensity; //!< light intensity
WPropBool m_useDepthCueing; //!< indicates whether to use depth cueing in the shader WPropBool m_useDepthCueing; //!< indicates whether to use depth cueing in the shader
WPropBool m_useHighContrast; //!< use the high contrast version? WPropBool m_useHighContrast; //!< use the high contrast version?
......
...@@ -46,6 +46,11 @@ uniform sampler2D u_texture2Sampler; ...@@ -46,6 +46,11 @@ uniform sampler2D u_texture2Sampler;
*/ */
uniform bool u_useLight; uniform bool u_useLight;
/**
* Define the light intensity here.
*/
uniform float u_lightIntensity;
/** /**
* Used to en-/disable blending of edges. * Used to en-/disable blending of edges.
*/ */
...@@ -92,7 +97,7 @@ void main() ...@@ -92,7 +97,7 @@ void main()
vec4 col = vec4( vec4 col = vec4(
( vec3( edge ) + plainColor ) // plain color mapped advection texture with edges ( vec3( edge ) + plainColor ) // plain color mapped advection texture with edges
* clamp( 1.0 - ( float( u_useDepthCueing ) * depth * depth ), 0.4, 1.0 ) // scaled by depth if enabled * clamp( 1.0 - ( float( u_useDepthCueing ) * depth * depth ), 0.4, 1.0 ) // scaled by depth if enabled
* ( u_useLight ? light * 1.3: 1.0 ), * ( u_useLight ? light * 1.3 * u_lightIntensity: 1.0 ), // NOTE: the 1.3 is here to keep compatibility with the old version
1.0 1.0
); );
......
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