69 lines
1.2 KiB
Plaintext
69 lines
1.2 KiB
Plaintext
/*Shader "Custom/Joystick" {
|
|
Properties {
|
|
_MainTex ("Base (RGB)", 2D) = "white" {}
|
|
_TintColor("Color Tint", Color) = (1,1,1,1)
|
|
}
|
|
SubShader {
|
|
Blend SrcAlpha OneMinusSrcAlpha
|
|
CGPROGRAM
|
|
#pragma surface surf Lambert
|
|
|
|
float4 _TintColor;
|
|
sampler2D _MainTex;
|
|
|
|
struct Input {
|
|
float2 uv_MainTex;
|
|
};
|
|
|
|
void surf (Input IN, inout SurfaceOutput o) {
|
|
float c = tex2D (_MainTex, IN.uv_MainTex).a;
|
|
|
|
o.Albedo = _TintColor.rgb;
|
|
o.Alpha = c * _TintColor.a;
|
|
}
|
|
ENDCG
|
|
}
|
|
FallBack "Diffuse"
|
|
}*/
|
|
|
|
|
|
Shader "Custom/Joystick" {
|
|
Properties {
|
|
_MainTex ("Base (RGB)", 2D) = "white" {}
|
|
_TintColor("Color Tint", Color) = (1,1,1,1)
|
|
}
|
|
SubShader {
|
|
Blend SrcAlpha OneMinusSrcAlpha
|
|
Pass {
|
|
|
|
CGPROGRAM
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
#include "UnityCG.cginc"
|
|
float4 _TintColor;
|
|
sampler2D _MainTex;
|
|
|
|
struct v2f {
|
|
float4 pos : SV_POSITION;
|
|
float3 tc : COLOR0;
|
|
};
|
|
|
|
v2f vert (appdata_base v)
|
|
{
|
|
v2f o;
|
|
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
|
|
o.tc = v.texcoord;
|
|
return o;
|
|
}
|
|
|
|
half4 frag (v2f i) : COLOR
|
|
{
|
|
float c = tex2D (_MainTex, i.tc).a;
|
|
return float4(_TintColor.rgb, c * _TintColor.a);
|
|
}
|
|
ENDCG
|
|
|
|
}
|
|
}
|
|
Fallback "VertexLit"
|
|
} |