Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Custom/UnlitTransparent" {
- Properties {
- _MainTex ("Texture", 2D) = "white" {}
- _Color ("Color", Color) = (1,1,1,1)
- _Amount ("Expand", Range(0, 10)) = 1
- }
- SubShader {
- Tags { "RenderType" = "Transparent" "Queue" = "Transparent" "IgnoreProjector" = "True" "ForceNoShadowCasting" = "True" }
- LOD 100
- Cull Off
- ZWrite Off
- Blend SrcAlpha OneMinusSrcAlpha
- CGINCLUDE
- #include "UnityCG.cginc"
- sampler2D _MainTex;
- float4 _MainTex_ST;
- fixed4 _Color;
- float _Amount;
- struct v2f {
- float4 pos : SV_POSITION;
- float2 uv : TEXCOORD0;
- };
- v2f vert (appdata_full v) {
- v2f o;
- float4 pos = v.vertex;
- pos.xyz += v.normal * _Amount;
- o.pos = mul (UNITY_MATRIX_MVP, pos);
- o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
- return o;
- }
- fixed4 frag (v2f i) : SV_Target {
- return tex2D (_MainTex, i.uv) * _Color;
- }
- ENDCG
- Pass {
- Tags { "LightMode" = "ForwardBase" }
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- ENDCG
- }
- }
- Fallback Off
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement