【UE4】普普通通的血條UI Shader
2023-06-18 23:58 作者:AtomAntzzz | 我要投稿

材質(zhì)連線 和 custom節(jié)點(diǎn)里的代碼:
//sdf
coords.x *= 8;
float2 pointOnLineSeg = float2(clamp(coords.x,0.5,7.5),0.5);
float sdf = distance(coords,pointOnLineSeg)*2 - 1;
clip(-sdf);
//border
float borderSdf = sdf + BorderSize;
float borderMask = step(0,-borderSdf);
return float4(borderMask.xxx,1);

標(biāo)簽: