110 lines
2.9 KiB
Plaintext
110 lines
2.9 KiB
Plaintext
Shader "PRD/EyeBallV2"
|
|
{
|
|
Properties
|
|
{
|
|
[Enum(OFF,0,FRONT,1,BACK,2)] _CullMode ("Cull Mode", float) = 2
|
|
_BaseMap ("BaseMap", 2D) = "white" {}
|
|
_BaseColor ("BaseColor", Color) = (1,1,1,1)
|
|
[MaterialToggle] _Is_LightColor_Base ("Is_LightColor_Base", float) = 1
|
|
}
|
|
SubShader
|
|
{
|
|
Tags
|
|
{
|
|
"RenderType" = "Opaque"
|
|
}
|
|
Pass // ind: 1, name: FORWARD
|
|
{
|
|
Name "FORWARD"
|
|
Tags
|
|
{
|
|
"LIGHTMODE" = "FORWARDBASE"
|
|
"RenderType" = "Opaque"
|
|
"SHADOWSUPPORT" = "true"
|
|
}
|
|
Cull Off
|
|
// m_ProgramMask = 6
|
|
CGPROGRAM
|
|
#pragma multi_compile DIRECTIONAL
|
|
//#pragma target 4.0
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
#include "UnityCG.cginc"
|
|
|
|
|
|
#define CODE_BLOCK_VERTEX
|
|
//uniform float4x4 unity_ObjectToWorld;
|
|
//uniform float4x4 unity_MatrixVP;
|
|
uniform float4 _LightColor0;
|
|
uniform float4 _BaseColor;
|
|
uniform float4 _BaseMap_ST;
|
|
uniform float _Is_LightColor_Base;
|
|
uniform float4 _EyeColor;
|
|
uniform float _Alpha;
|
|
uniform float _Camouflage;
|
|
uniform sampler2D _BaseMap;
|
|
struct appdata_t
|
|
{
|
|
float4 vertex :POSITION0;
|
|
float2 texcoord :TEXCOORD0;
|
|
};
|
|
|
|
struct OUT_Data_Vert
|
|
{
|
|
float2 texcoord :TEXCOORD0;
|
|
float4 vertex :SV_POSITION;
|
|
};
|
|
|
|
struct v2f
|
|
{
|
|
float2 texcoord :TEXCOORD0;
|
|
};
|
|
|
|
struct OUT_Data_Frag
|
|
{
|
|
float4 color :SV_Target0;
|
|
};
|
|
|
|
float4 u_xlat0;
|
|
float4 u_xlat1;
|
|
OUT_Data_Vert vert(appdata_t in_v)
|
|
{
|
|
OUT_Data_Vert out_v;
|
|
out_v.vertex = UnityObjectToClipPos(in_v.vertex);
|
|
out_v.texcoord.xy = in_v.texcoord.xy;
|
|
return out_v;
|
|
}
|
|
|
|
#define CODE_BLOCK_FRAGMENT
|
|
float3 u_xlat0_d;
|
|
float4 u_xlat10_0;
|
|
float3 u_xlat1_d;
|
|
float3 u_xlat2;
|
|
float u_xlat16_9;
|
|
OUT_Data_Frag frag(v2f in_f)
|
|
{
|
|
OUT_Data_Frag out_f;
|
|
u_xlat0_d.xy = TRANSFORM_TEX(in_f.texcoord.xy, _BaseMap);
|
|
u_xlat10_0 = tex2D(_BaseMap, u_xlat0_d.xy);
|
|
u_xlat0_d.xyz = (u_xlat10_0.xyz + (_BaseColor.xyz * (1-u_xlat10_0.a)));
|
|
u_xlat16_9 = ((-u_xlat10_0.w) + 1);
|
|
u_xlat1_d.xyz = (float3(u_xlat16_9, u_xlat16_9, u_xlat16_9) * _EyeColor.xyz);
|
|
u_xlat2.xyz = ((u_xlat0_d.xyz * _LightColor0.xyz) + (-u_xlat0_d.xyz));
|
|
u_xlat0_d.xyz = ((float3(_Is_LightColor_Base, _Is_LightColor_Base, _Is_LightColor_Base) * u_xlat2.xyz) + u_xlat0_d.xyz);
|
|
u_xlat0_d.xyz = clamp(u_xlat0_d.xyz, 0, 1);
|
|
out_f.color.xyz = ((u_xlat1_d.xyz * _EyeColor.www) + u_xlat0_d.xyz);
|
|
u_xlat0_d.x = ((-_Camouflage) + 1);
|
|
out_f.color.w = (u_xlat0_d.x * _Alpha);
|
|
return out_f;
|
|
}
|
|
|
|
|
|
ENDCG
|
|
|
|
} // end phase
|
|
}
|
|
FallBack Off
|
|
}
|