Fix icon color when disabled in VAB menu

This commit is contained in:
2020-06-09 13:23:34 -07:00
parent ebaeaa2182
commit 2cae31b20f
5 changed files with 10 additions and 6 deletions

View File

@ -72,6 +72,7 @@ float3 _DecalTangent;
float _Cutoff;
float _DecalOpacity;
float _Opacity;
float4 _Background;
inline void decalClipAlpha(float alpha) {
#ifndef DECAL_PREVIEW
@ -239,9 +240,9 @@ fixed4 frag_forward(v2f IN) : SV_Target
#ifdef DECAL_PREVIEW
if (any(IN.uv_decal > 1) || any(IN.uv_decal < 0)) o.Alpha = 0;
o.Albedo = lerp(_Color.rgb, o.Albedo, o.Alpha);
o.Albedo = lerp(_Background.rgb, o.Albedo, o.Alpha) * _Color.rgb;
o.Normal = lerp(float3(0,0,1), o.Normal, o.Alpha);
o.Gloss = lerp(_Color.a, o.Gloss, o.Alpha);
o.Gloss = lerp(_Background.a, o.Gloss, o.Alpha);
o.Emission = lerp(0, o.Emission, o.Alpha);
o.Alpha = _Opacity;
#endif //DECAL_PREVIEW