浏览代码

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
/aisv754_seg_alpha_bug
Steven Borkman 4 年前
当前提交
61ff26b3
共有 1 个文件被更改,包括 9 次插入4 次删除
  1. 13
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/SegRemoveBackgroundShader.shader

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


fixed4 frag (v2f i) : SV_Target
{
// Cap the max Transparency of the background so that we never
// reach 1.0 which causes an anomaly that the _SegmentTransparency
// value stops being honored.
if (_BackTransparency > 0.998f) _BackTransparency = 0.998f;
if (abs(col.r - _RemoveColor.r) < .01f)
if (abs(col.r - _RemoveColor.r) < .001f)
if (abs(col.g - _RemoveColor.g) < .01f)
if (abs(col.g - _RemoveColor.g) < .001f)
if (abs(col.b - _RemoveColor.b) < .01f)
if (abs(col.b - _RemoveColor.b) < .001f)
{
col.a = _BackTransparency;
}

if (abs(col.a - _BackTransparency) > .01f) col.a = _SegmentTransparency;
if (abs(col.a - _BackTransparency) > .001f) col.a = _SegmentTransparency;
return col;
}

正在加载...
取消
保存