|
|
|
|
|
|
Shader "UIWidgets/GUITexture" |
|
|
|
{ |
|
|
|
Properties { _MainTex ("Texture", any) = "" {} } |
|
|
|
Properties { _MainTex ("Texture", any) = "" {} |
|
|
|
_Linear ("_Linear", float) = 0 |
|
|
|
} |
|
|
|
|
|
|
|
CGINCLUDE |
|
|
|
#pragma vertex vert |
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
sampler2D _MainTex; |
|
|
|
|
|
|
|
float _Linear; |
|
|
|
|
|
|
|
uniform float4 _MainTex_ST; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fixed4 frag (v2f i) : SV_Target |
|
|
|
{ |
|
|
|
return 2.0f * tex2D(_MainTex, i.texcoord) * i.color; |
|
|
|
fixed4 colr = 2.0f * tex2D(_MainTex, i.texcoord) * i.color; |
|
|
|
float gamma = 2.2; |
|
|
|
colr.rgb = _Linear ? pow(colr.rgb, (1.0/gamma)) : colr.rgb; |
|
|
|
return colr; |
|
|
|
} |
|
|
|
ENDCG |
|
|
|
|
|
|
|