Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
9.2.2023: Due to updates GitLab will be unavailable for some minutes between 9:00 and 11:00.
Open sidebar
CAMP
campvis-public
Commits
27296a28
Commit
27296a28
authored
Dec 10, 2014
by
Declara Denis
Committed by
Christian Schulte zu Berge
Feb 18, 2015
Browse files
Fixed clipping errors in advancedusfusion pixel shader
parent
f5ecff91
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/advancedusvis/glsl/advancedusfusion.frag
View file @
27296a28
...
...
@@ -73,84 +73,79 @@ void main() {
float
confidence
=
clamp
(
TEXTURE_LOOKUP_FUNC
(
_confidenceMap
,
texCoord
).
r
*
_confidenceScaling
,
0
.
0
,
1
.
0
);
float
uncertainty
=
lookupTF
(
_confidenceTF
,
_confidenceTFParams
,
confidence
).
a
;
if
(
confidence
<=
0
.
0
)
{
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
texel
.
r
);
}
else
{
switch
(
_viewIndex
)
{
case
0
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
texel
.
r
);
break
;
case
1
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
blurred
.
r
);
break
;
case
2
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
confidence
);
break
;
case
3
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
texel
.
r
);
vec3
hsv
=
rgb2hsv
(
out_Color
.
xyz
);
hsv
.
x
=
_hue
;
hsv
.
y
=
uncertainty
;
out_Color
.
xyz
=
hsv2rgb
(
hsv
);
break
;
case
4
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
texel
.
r
);
vec3
hsl
=
rgb2hsl
(
out_Color
.
xyz
);
hsl
.
x
=
_hue
;
hsl
.
y
=
uncertainty
;
out_Color
.
xyz
=
hsl2rgb
(
hsl
);
break
;
case
5
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
texel
.
r
);
vec3
tsl
=
rgb2tsl
(
out_Color
.
xyz
);
//tsl.x = _hue;
//tsl.y = uncertainty;
out_Color
.
xyz
=
tsl2rgb
(
tsl
);
break
;
case
6
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
texel
.
r
);
vec3
hcl
=
rgb2hcl
(
out_Color
.
xyz
);
hcl
.
x
=
_hue
;
hcl
.
y
=
uncertainty
;
out_Color
.
xyz
=
hcl2rgb
(
hcl
);
break
;
case
7
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
texel
.
r
);
vec3
hcy
=
rgb2hcy
(
out_Color
.
xyz
);
hcy
.
x
=
_hue
;
hcy
.
y
=
uncertainty
;
out_Color
.
xyz
=
hcy2rgb
(
hcy
);
break
;
case
8
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
texel
.
r
);
vec3
lch
=
rgb2lch
(
out_Color
.
xyz
);
lch
.
z
=
6
.
2831853
*
_hue
;
lch
.
y
=
100
.
0
*
(
uncertainty
);
out_Color
.
xyz
=
lch2rgb
(
lch
);
break
;
case
9
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
texel
.
r
);
vec3
hlch
=
lab2lch
(
xyz2hlab
(
rgb2xyz
(
out_Color
.
xyz
)));
//hlch.z = 6.2831853 * _hue;
//hlch.y = 100.0 * (uncertainty);
out_Color
.
xyz
=
xyz2rgb
(
hlab2xyz
(
lch2lab
(
hlch
)));
break
;
case
10
:
float
intensity
=
mix
((
2
.
0
*
texel
.
r
-
blurred
.
r
),
blurred
.
r
,
uncertainty
);
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
intensity
);
break
;
case
11
:
float
lod
=
max
(
floor
((
uncertainty
)
*
6
.
0
),
0
.
0
);
switch
(
_viewIndex
)
{
case
0
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
texel
.
r
);
break
;
case
1
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
blurred
.
r
);
break
;
case
2
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
confidence
);
break
;
case
3
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
texel
.
r
);
vec3
hsv
=
rgb2hsv
(
out_Color
.
xyz
);
hsv
.
x
=
_hue
;
hsv
.
y
=
uncertainty
;
out_Color
.
xyz
=
hsv2rgb
(
hsv
);
break
;
case
4
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
texel
.
r
);
vec3
hsl
=
rgb2hsl
(
out_Color
.
xyz
);
hsl
.
x
=
_hue
;
hsl
.
y
=
uncertainty
;
out_Color
.
xyz
=
hsl2rgb
(
hsl
);
break
;
case
5
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
texel
.
r
);
vec3
tsl
=
rgb2tsl
(
out_Color
.
xyz
);
//tsl.x = _hue;
//tsl.y = uncertainty;
out_Color
.
xyz
=
tsl2rgb
(
tsl
);
break
;
case
6
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
texel
.
r
);
vec3
hcl
=
rgb2hcl
(
out_Color
.
xyz
);
hcl
.
x
=
_hue
;
hcl
.
y
=
uncertainty
;
out_Color
.
xyz
=
hcl2rgb
(
hcl
);
break
;
case
7
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
texel
.
r
);
vec3
hcy
=
rgb2hcy
(
out_Color
.
xyz
);
hcy
.
x
=
_hue
;
hcy
.
y
=
uncertainty
;
out_Color
.
xyz
=
hcy2rgb
(
hcy
);
break
;
case
8
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
texel
.
r
);
vec3
lch
=
rgb2lch
(
out_Color
.
xyz
);
lch
.
z
=
6
.
2831853
*
_hue
;
lch
.
y
=
100
.
0
*
(
uncertainty
);
out_Color
.
xyz
=
lch2rgb
(
lch
);
break
;
case
9
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
texel
.
r
);
vec3
hlch
=
lab2lch
(
xyz2hlab
(
rgb2xyz
(
out_Color
.
xyz
)));
//hlch.z = 6.2831853 * _hue;
//hlch.y = 100.0 * (uncertainty);
out_Color
.
xyz
=
xyz2rgb
(
hlab2xyz
(
lch2lab
(
hlch
)));
break
;
case
10
:
float
intensity
=
clamp
(
mix
((
2
.
0
*
texel
.
r
-
blurred
.
r
),
blurred
.
r
,
uncertainty
),
0
.
0
f
,
1
.
0
f
);
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
intensity
);
break
;
case
11
:
float
lod
=
max
(
floor
((
uncertainty
)
*
6
.
0
),
0
.
0
);
vec4
lodTexel
=
texture
(
_usImage
,
texCoord
,
lod
);
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
lodTexel
.
r
);
break
;
case
12
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
texel
.
r
);
vec3
color
=
hsv2rgb
(
vec3
(
_hue
,
uncertainty
,
0
.
8
));
out_Color
.
xyz
=
(
uncertainty
)
*
color
+
(
1
-
uncertainty
)
*
out_Color
.
xyz
;
break
;
}
vec4
lodTexel
=
texture
(
_usImage
,
texCoord
,
lod
);
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
lodTexel
.
r
);
break
;
case
12
:
out_Color
=
lookupTF
(
_transferFunction
,
_transferFunctionParams
,
texel
.
r
);
vec3
color
=
hsv2rgb
(
vec3
(
_hue
,
uncertainty
,
0
.
8
));
out_Color
.
xyz
=
(
uncertainty
)
*
color
+
(
1
-
uncertainty
)
*
out_Color
.
xyz
;
break
;
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment