Advertisement
Guest User

Laser Sight Shader

a guest
Jan 30th, 2018
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1.  
  2. Shader "Player/LaserSight" {
  3. Properties {
  4. _Color ("Main Color", Color) = (1,1,1,1)
  5. _MainTex ("MainTex", 2D) = "white"
  6. _NoiseTex ("NoiseTex", 2D) = "white"
  7. }
  8.  
  9. CGINCLUDE
  10.  
  11. #include "UnityCG.cginc"
  12.  
  13. sampler2D _MainTex;
  14. sampler2D _NoiseTex;
  15.  
  16. half4 _MainTex_ST;
  17. half4 _NoiseTex_ST;
  18.  
  19. half4 _Color;
  20.  
  21. struct v2f {
  22. half4 pos : SV_POSITION;
  23. half4 uv : TEXCOORD0;
  24. };
  25.  
  26. v2f vert(appdata_full v)
  27. {
  28. v2f o;
  29.  
  30. o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
  31. o.uv.xy = TRANSFORM_TEX(v.texcoord, _MainTex);
  32. o.uv.zw = TRANSFORM_TEX(v.texcoord, _NoiseTex);
  33.  
  34. return o;
  35. }
  36.  
  37. fixed4 frag( v2f i ) : COLOR
  38. {
  39. fixed4 tex = tex2D (_MainTex, i.uv.xy) * tex2D (_NoiseTex, i.uv.zw);
  40. tex.rgb *= _Color;
  41. return tex;
  42. }
  43.  
  44. ENDCG
  45.  
  46. SubShader {
  47. Tags { "RenderType" = "Transparent" "Reflection" = "LaserScope" "Queue" = "Transparent"}
  48. Cull Off
  49. ZWrite Off
  50. Blend SrcAlpha One
  51.  
  52. Pass {
  53.  
  54. CGPROGRAM
  55.  
  56. #pragma vertex vert
  57. #pragma fragment frag
  58. #pragma fragmentoption ARB_precision_hint_fastest
  59.  
  60. ENDCG
  61.  
  62. }
  63.  
  64. }
  65. FallBack Off
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement