forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vtkLineIntegralConvolution2D_CE.glsl
38 lines (34 loc) · 1.2 KB
/
vtkLineIntegralConvolution2D_CE.glsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//=========================================================================
//
// Program: Visualization Toolkit
// Module: vtkLineIntegralConvolution2D_CE.glsl
//
// Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
// All rights reserved.
// See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
//=========================================================================
// gray scale contrast enhance stage implemented via histogram stretching
// if the min and max are tweaked it can generate out-of-range values
// these will be clamped in 0 to 1
#version 110
uniform sampler2D texLIC; // most recent lic pass
uniform float uMin; // min gray scale color value
uniform float uMaxMinDiff; // max-min
void main( void )
{
vec4 lic = texture2D(texLIC, gl_TexCoord[0].st);
if (lic.g!=0.0)
{
gl_FragData[0] = lic;
}
else
{
float CElic = clamp((lic.r - uMin)/uMaxMinDiff, 0.0, 1.0);
gl_FragData[0] = vec4(CElic, lic.gb, 1.0);
}
}