~ubuntu-branches/ubuntu/vivid/openwalnut/vivid-proposed

« back to all changes in this revision

Viewing changes to src/modules/imageSpaceLIC/shaders/WMImageSpaceLIC-ClipBlend-fragment.glsl

  • Committer: Package Import Robot
  • Author(s): Sebastian Eichelbaum
  • Date: 2014-03-19 17:46:12 UTC
  • mfrom: (3.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140319174612-e4mgtr1avbq3f7ph
Tags: 1.4.0~rc1+hg3a3147463ee2-1
* Major functionality and stability improvements.
* Several bug fixes
* Changed ttf-liberation dependency to fonts-liberation (Closes: #722405)
* OpenWalnut now works properly with OpenSceneGraph 3.2 (Closes: #718381)
* See http://www.openwalnut.org/versions/2

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
//
23
23
//---------------------------------------------------------------------------
24
24
 
25
 
#version 120
 
25
#version 130
26
26
 
27
27
#include "WGEUtils.glsl"
 
28
#include "WGEShadingTools.glsl"
28
29
 
29
30
/**
30
31
 * The texture Unit for the advection texture
47
48
uniform bool u_useLight;
48
49
 
49
50
/**
 
51
 * Define the light intensity here.
 
52
 */
 
53
uniform float u_lightIntensity;
 
54
 
 
55
/**
50
56
 * Used to en-/disable blending of edges.
51
57
 */
52
58
uniform bool u_useEdges;
53
59
 
54
60
/**
 
61
 * Edge color to use
 
62
 */
 
63
uniform vec4 u_useEdgesColor;
 
64
 
 
65
/**
 
66
 * Step function border for blending in the edges.
 
67
 */
 
68
uniform float u_useEdgesStep;
 
69
 
 
70
/**
55
71
 * If true, the depth is blended in
56
72
 */
57
73
uniform bool u_useDepthCueing;
82
98
    float u_contrastingP = u_useHighContrast ? 8 : 2.5;
83
99
    vec3 plainColor = u_cmapRatio * cmap + ( 1.0 - u_cmapRatio ) * vec3( u_contrastingS * pow( advected, u_contrastingP ) );
84
100
 
85
 
    // MPI Paper Hack: {
86
 
    // plainColor = u_cmapRatio * cmap;
87
 
    // plainColor += 1.5*( 1.0 - u_cmapRatio ) * vec3( u_contrastingS * pow( advected, u_contrastingP ), 0.0, 0.0 );
88
 
    // if( isZero( cmap.r, 0.1 ) )
89
 
    //     discard;
90
 
    // }
91
 
 
92
101
    vec4 col = vec4(
93
 
        ( vec3( edge ) + plainColor ) // plain color mapped advection texture with edges
 
102
        mix( plainColor, u_useEdgesColor.xyz, smoothstep( 0, u_useEdgesStep, edge ) ) // plain color mapped advection texture with edges
94
103
         * clamp( 1.0 - ( float( u_useDepthCueing ) * depth * depth ), 0.4, 1.0 ) // scaled by depth if enabled
95
 
         * ( u_useLight ? light * 1.3: 1.0 ),
 
104
         * ( u_useLight ? light * 1.3 * u_lightIntensity: 1.0 ),    // NOTE: the 1.3 is here to keep compatibility with the old version
96
105
        1.0
97
106
    );
98
107
 
99
 
    // math: BioVis Paper Hack
100
 
    // if( cmap.g < 0.1 )
101
 
    //    discard;
102
 
    // else
103
 
    //    gl_FragColor = col;
104
 
 
105
108
    gl_FragColor = col;
106
109
    gl_FragDepth = depth;
107
110
}