Advertisement
333GameStudio

Glow Shader

Dec 10th, 2016
19,023
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. Shader "Glow" {
  2. Properties {
  3. _MainTex ("Texture", 2D) = "white" {}
  4. _Color ("Color", Color) = (1,1,1,1)
  5. _Glow ("Intensity", Range(0, 3)) = 1
  6. }
  7. SubShader {
  8. Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
  9. LOD 100
  10. Cull Off
  11. ZWrite On
  12. Blend SrcAlpha OneMinusSrcAlpha
  13.  
  14. Pass {
  15. CGPROGRAM
  16. #pragma vertex vert
  17. #pragma fragment frag
  18.  
  19. sampler2D _MainTex;
  20. half4 _MainTex_ST;
  21. fixed4 _Color;
  22. half _Glow;
  23.  
  24. struct vertIn {
  25. float4 pos : POSITION;
  26. half2 tex : TEXCOORD0;
  27. };
  28.  
  29. struct v2f {
  30. float4 pos : SV_POSITION;
  31. half2 tex : TEXCOORD0;
  32. };
  33.  
  34. v2f vert (vertIn v) {
  35. v2f o;
  36. o.pos = mul(UNITY_MATRIX_MVP, v.pos);
  37. o.tex = v.tex * _MainTex_ST.xy + _MainTex_ST.zw;
  38. return o;
  39. }
  40.  
  41. fixed4 frag (v2f f) : SV_Target {
  42. fixed4 col = tex2D(_MainTex, f.tex);
  43. col *= _Color;
  44. col *= _Glow;
  45. return col;
  46. }
  47. ENDCG
  48. }
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement