Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. Shader "Custom/UnlitTransparent" {
  2. Properties {
  3. _MainTex ("Texture", 2D) = "white" {}
  4. _Color ("Color", Color) = (1,1,1,1)
  5. _Amount ("Expand", Range(0, 10)) = 1
  6. }
  7.  
  8. SubShader {
  9. Tags { "RenderType" = "Transparent" "Queue" = "Transparent" "IgnoreProjector" = "True" "ForceNoShadowCasting" = "True" }
  10. LOD 100
  11.  
  12. Cull Off
  13. ZWrite Off
  14. Blend SrcAlpha OneMinusSrcAlpha
  15.  
  16. CGINCLUDE
  17. #include "UnityCG.cginc"
  18.  
  19. sampler2D _MainTex;
  20. float4 _MainTex_ST;
  21. fixed4 _Color;
  22. float _Amount;
  23.  
  24. struct v2f {
  25. float4 pos : SV_POSITION;
  26. float2 uv : TEXCOORD0;
  27. };
  28.  
  29. v2f vert (appdata_full v) {
  30. v2f o;
  31. float4 pos = v.vertex;
  32. pos.xyz += v.normal * _Amount;
  33. o.pos = mul (UNITY_MATRIX_MVP, pos);
  34. o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
  35. return o;
  36. }
  37.  
  38. fixed4 frag (v2f i) : SV_Target {
  39. return tex2D (_MainTex, i.uv) * _Color;
  40. }
  41. ENDCG
  42.  
  43. Pass {
  44. Tags { "LightMode" = "ForwardBase" }
  45. CGPROGRAM
  46. #pragma vertex vert
  47. #pragma fragment frag
  48. ENDCG
  49. }
  50. }
  51. Fallback Off
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement