浏览代码

Segmentation Alpha Bug Fix

Capped the max opacity allowed in the shader to an extremely high value (0.995) to stop a weird issue caused by alpha being set to 1.0. Incorporated the suggestion on how to clean up shader code
/aisv754_seg_alpha_bug
Steven Borkman 4 年前
当前提交
fac9b16d
共有 1 个文件被更改,包括 4 次插入12 次删除
  1. 16
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/SegRemoveBackgroundShader.shader

16
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/SegRemoveBackgroundShader.shader


// sample the texture
fixed4 col = tex2D(_MainTex, i.uv);
if (abs(col.r - _RemoveColor.r) < .01f)
{
if (abs(col.g - _RemoveColor.g) < .01f)
{
if (abs(col.b - _RemoveColor.b) < .01f)
{
col.a = _BackTransparency;
}
}
}
if (abs(col.a - _BackTransparency) > .01f) col.a = _SegmentTransparency;
if (abs(col.r - _RemoveColor.r) < .001f && abs(col.g - _RemoveColor.g) < .001f && abs(col.b - _RemoveColor.b) < .001f)
col.a = _BackTransparency;
else
col.a = _SegmentTransparency;
return col;
}

正在加载...
取消
保存