Commit 27296a28 authored by Declara Denis's avatar Declara Denis Committed by Christian Schulte zu Berge
Browse files

Fixed clipping errors in advancedusfusion pixel shader

parent f5ecff91
......@@ -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.0f, 1.0f);
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;
}
}
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