Created
January 24, 2018 04:05
-
-
Save bitinn/4aab28cb425fd917522e867ad3c5c38b to your computer and use it in GitHub Desktop.
Amplify Shader Template Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader /*ase_name*/ "AST/Extended Unlit" /*end*/ | |
{ | |
Properties | |
{ | |
_MainTex ("Sprite Texture", 2D) = "white" {} | |
_Color ("Tint", Color) = (1,1,1,1) | |
/*ase_props*/ | |
} | |
SubShader | |
{ | |
Tags { | |
"Queue"="Transparent" | |
"RenderType"="Transparent" | |
"IgnoreProjector"="True" | |
"LightMode" = "ForwardBase" | |
/*ase_tags*/ | |
} | |
LOD 100 | |
Cull Off | |
ZWrite Off | |
ZTest LEqual | |
Offset 0, -1 | |
Blend SrcAlpha OneMinusSrcAlpha | |
/*ase_pass*/ | |
Pass | |
{ | |
CGPROGRAM | |
#pragma target 3.0 | |
#pragma vertex vert | |
#pragma fragment frag | |
#include "UnityCG.cginc" | |
/*ase_pragma*/ | |
struct appdata | |
{ | |
float4 vertex : POSITION; | |
float4 texcoord : TEXCOORD0; | |
float4 texcoord1 : TEXCOORD1; | |
UNITY_VERTEX_INPUT_INSTANCE_ID | |
/*ase_vdata:p=p;uv0=tc0.xy;uv1=tc1.xy*/ | |
}; | |
struct v2f | |
{ | |
float4 vertex : SV_POSITION; | |
float4 texcoord : TEXCOORD0; | |
UNITY_VERTEX_OUTPUT_STEREO | |
/*ase_interp(1,7):sp=sp.xyzw;uv0=tc0.xy;uv1=tc0.zw*/ | |
}; | |
uniform sampler2D _MainTex; | |
uniform fixed4 _Color; | |
/*ase_globals*/ | |
v2f vert ( appdata v /*ase_vert_input*/) | |
{ | |
v2f o; | |
UNITY_SETUP_INSTANCE_ID(v); | |
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); | |
o.texcoord.xy = v.texcoord.xy; | |
o.texcoord.zw = v.texcoord1.xy; | |
// ase common template code | |
/*ase_vert_code:v=appdata;o=v2f*/ | |
v.vertex.xyz += /*ase_vert_out:Local Vertex;Float3*/ float3(0,0,0) /*end*/; | |
o.vertex = UnityObjectToClipPos(v.vertex); | |
return o; | |
} | |
fixed4 frag (v2f i /*ase_frag_input*/) : SV_Target | |
{ | |
fixed4 myColorVar; | |
// ase common template code | |
/*ase_frag_code:i=v2f*/ | |
myColorVar = /*ase_frag_out:Frag Color;Float4*/fixed4(1,0,0,1)/*end*/; | |
return myColorVar; | |
} | |
ENDCG | |
} | |
} | |
CustomEditor "ASEMaterialInspector" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment