Skip to content

Instantly share code, notes, and snippets.

@hiepnd
Last active November 9, 2016 04:31
Show Gist options
  • Save hiepnd/facf16a3ddbfecebe321fafcb45be421 to your computer and use it in GitHub Desktop.
Save hiepnd/facf16a3ddbfecebe321fafcb45be421 to your computer and use it in GitHub Desktop.
Shader "Screw/Texture Flat" {
Properties {
_MainTex ("Texture", 2D) = "white" {}
_Color ("Color", Color) = (1, 1, 1, 1)
}
SubShader {
Tags { "RenderType"="Opaque" "Queue" = "Geometry"}
LOD 200
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
struct VertexInput {
half4 vertex : POSITION;
half2 texcoord : TEXCOORD;
};
struct VertexOutput {
half4 pos : SV_POSITION;
half2 uv : TEXCOORD;
};
sampler2D _MainTex;
half4 _Color;
VertexOutput vert (VertexInput i) {
VertexOutput o;
o.pos = mul(UNITY_MATRIX_MVP, i.vertex);
o.uv = i.texcoord;
return o;
}
half _GrayScaleFactor;
half4 frag (VertexOutput i) : COLOR {
half4 color = tex2D(_MainTex, i.uv);
return color * _Color;
}
ENDCG
}
}
FallBack "Diffuse"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment