Commit 8ec63581 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] - final TF construction example. Will be done by a GUI later.

parent 8281c831
......@@ -31,6 +31,7 @@
#include <osg/ShapeDrawable>
#include <osg/StateAttribute>
#include <osgDB/ReadFile>
#include <osgDB/WriteFile>
#include "../../common/WColor.h"
#include "../../common/WPropertyHelper.h"
......
......@@ -29,7 +29,7 @@
#endif
// This is needed if the modulo operator % is required
// #extension GL_EXT_gpu_shader4 : enable
#extension GL_EXT_gpu_shader4 : enable
#include "WGEUtils.glsl"
......@@ -130,34 +130,25 @@ vec4 transferFunction( float value )
#ifdef TRANSFERFUNCTION_ENABLED
return texture1D( u_transferFunctionSampler, value );
#else
if ( isZero( value - 0.5, 0.01 ) ) // if not TF has been specified, at least show something
{
return vec4( 1.0, 0.0, 0.0, 0.1 );
}
else
{
return vec4( 0.0 );
}
// Example TF
/*if ( isZero( value - 0.5, 0.005 ) )
if ( isZero( value - 0.5, 0.00005 ) )
return vec4( 0.0 );
vec4 c = vec4( 0.0 );
if ( value >= 0.5 )
if ( value <= 0.5 )
{
c = vec4( 1.0, 0.34, 0.34, 2.0 * ( value - 0.5 ) );
c = vec4( 0.0, 0.37, 1.0, 2.0 * ( 0.5 - value ) );
}
else
{
vec4 cols[2];
cols[1] = vec4( 0.0, 0.37, 1.0, 0.1 );
cols[0] = vec4( 0.0, 1.0, 1.0, 0.1 );
cols[0] = vec4( 1.0, 0.34, 0.34, 0.25 );
cols[1] = vec4( 1.0, 0.75, 0.0, 0.25 );
int i = int(2.0 * value * 2.0 * 15.0);
int i = int( 2.0 * ( value - 0.5 ) * 2.0 * 15.0);
int imod = i % 2;
c = cols[ imod ];
}
return c;
*/
#endif
}
......
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