Skip to content

Instantly share code, notes, and snippets.

@sugi-cho
Created July 25, 2014 08:53
Show Gist options
  • Save sugi-cho/cedc85cb9502dcf49a80 to your computer and use it in GitHub Desktop.
Save sugi-cho/cedc85cb9502dcf49a80 to your computer and use it in GitHub Desktop.
Shader "Custom/YokoMieru" {
Properties {
_MainTex("texture", 2D) = "white" {}
_T ("mieru",Float) = 0
}
CGINCLUDE
sampler2D _MainTex;
uniform half _T;
struct Input {
float4 vColor;
float2 tex;
};
void vert (inout appdata_full v, out Input o){
v.vertex.x += v.vertex.z*_T;
UNITY_INITIALIZE_OUTPUT(Input,o);
o.vColor = v.color;
o.tex = v.texcoord.xy;
}
void surf (Input IN, inout SurfaceOutput o) {
o.Albedo = tex2D(_MainTex, IN.tex);
}
ENDCG
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert vertex:vert noforwardadd
ENDCG
}
FallBack "Diffuse"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment