We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5260864 + 5ada4cb commit fa0aa3eCopy full SHA for fa0aa3e
1 file changed
UiRoundedCorners/ShaderSetup.cginc
@@ -13,6 +13,8 @@ struct v2f {
13
UNITY_VERTEX_OUTPUT_STEREO
14
};
15
16
+int _UIVertexColorAlwaysGammaSpace;
17
+
18
v2f vert (appdata v) {
19
v2f o;
20
UNITY_SETUP_INSTANCE_ID(v);
@@ -22,11 +24,14 @@ v2f vert (appdata v) {
22
24
o.vertex = UnityObjectToClipPos(v.vertex);
23
25
o.uv = v.uv;
26
o.color = v.color;
27
+ if (_UIVertexColorAlwaysGammaSpace)
28
+ if(!IsGammaSpace())
29
+ o.color = float4(UIGammaToLinear(o.color.xyz), o.color.w);
30
return o;
31
}
32
33
inline fixed4 mixAlpha(fixed4 mainTexColor, fixed4 color, float sdfAlpha){
34
fixed4 col = mainTexColor * color;
35
col.a = min(col.a, sdfAlpha);
36
return col;
-}
37
+}
0 commit comments