Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Custom/Outline" {
- Properties {
- _MainTex ("MainTex", 2D) = "white" {}
- _Outline ("_Outline", Range(1,5)) = 0
- _OutlineClr ("Outline Color", Color) = (1, 1, 0, 1)
- }
- SubShader {
- Pass {
- Tags { "RenderType"="Opaque" }
- ZWrite Off
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- #pragma multi_compile_instancing
- #include "UnityCG.cginc"
- half _Outline;
- half4 _OutlineClr;
- struct appdata
- {
- half4 vertex : POSITION;
- half4 normal : NORMAL;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- struct v2f {
- half4 pos : SV_POSITION;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- half4 vert(appdata v) : SV_POSITION {
- v2f o;
- v.vertex *= _Outline;
- o.pos = UnityObjectToClipPos(v.vertex);
- return o.pos;
- }
- half4 frag(v2f i) : COLOR {
- return _OutlineClr;
- }
- ENDCG
- }
- CGPROGRAM
- #pragma surface surf Lambert noforwardadd exclude_path:prepass nolightmap
- sampler2D _MainTex;
- struct Input {
- half2 uv_MainTex;
- };
- void surf(Input IN, inout SurfaceOutput o) {
- o.Albedo = tex2D(_MainTex, IN.uv_MainTex);
- }
- ENDCG
- }
- FallBack "Diffuse"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement