UV Animation_alpha.shader 8.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  2. // Shader created with Shader Forge v1.35
  3. // Shader Forge (c) Neat Corporation / Joachim Holmer - http://www.acegikmo.com/shaderforge/
  4. // Note: Manually altering this data may prevent you from opening it in Shader Forge
  5. /*SF_DATA;ver:1.35;sub:START;pass:START;ps:flbk:,iptp:0,cusa:False,bamd:0,lico:1,lgpr:1,limd:0,spmd:1,trmd:0,grmd:0,uamb:True,mssp:True,bkdf:False,hqlp:False,rprd:False,enco:False,rmgx:True,imps:True,rpth:0,vtps:0,hqsc:True,nrmq:1,nrsp:0,vomd:0,spxs:False,tesm:0,olmd:1,culm:2,bsrc:3,bdst:7,dpts:2,wrdp:False,dith:0,atcv:False,rfrpo:True,rfrpn:Refraction,coma:15,ufog:False,aust:True,igpj:True,qofs:0,qpre:3,rntp:2,fgom:False,fgoc:False,fgod:False,fgor:False,fgmd:0,fgcr:0.5,fgcg:0.5,fgcb:0.5,fgca:1,fgde:0.01,fgrn:0,fgrf:300,stcl:False,stva:128,stmr:255,stmw:255,stcp:6,stps:0,stfa:0,stfz:0,ofsf:0,ofsu:0,f2p0:True,fnsp:True,fnfb:True;n:type:ShaderForge.SFN_Final,id:1168,x:33103,y:32809,varname:node_1168,prsc:2|emission-51-OUT,alpha-152-OUT;n:type:ShaderForge.SFN_Tex2d,id:9588,x:32319,y:32707,ptovrint:False,ptlb:Texture,ptin:_Texture,varname:node_9588,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,tex:7e00af7069f7d814c9f8030051a2f8ce,ntxv:0,isnm:False|UVIN-8912-OUT;n:type:ShaderForge.SFN_TexCoord,id:7960,x:31920,y:32624,varname:node_7960,prsc:2,uv:0,uaff:False;n:type:ShaderForge.SFN_Time,id:3610,x:31708,y:32695,varname:node_3610,prsc:2;n:type:ShaderForge.SFN_Multiply,id:3255,x:31961,y:32784,varname:node_3255,prsc:2|A-3610-T,B-6647-OUT;n:type:ShaderForge.SFN_Append,id:6647,x:31738,y:32856,varname:node_6647,prsc:2|A-3960-OUT,B-412-OUT;n:type:ShaderForge.SFN_ValueProperty,id:3960,x:31537,y:32856,ptovrint:False,ptlb:Speed_U1,ptin:_Speed_U1,varname:node_3960,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,v1:0;n:type:ShaderForge.SFN_ValueProperty,id:412,x:31537,y:32939,ptovrint:False,ptlb:Speed_V1,ptin:_Speed_V1,varname:node_412,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,v1:0;n:type:ShaderForge.SFN_Add,id:8912,x:32149,y:32652,varname:node_8912,prsc:2|A-7960-UVOUT,B-3255-OUT;n:type:ShaderForge.SFN_Color,id:9041,x:32351,y:33094,ptovrint:False,ptlb:color,ptin:_color,varname:node_9041,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,c1:0.5,c2:0.5,c3:0.5,c4:1;n:type:ShaderForge.SFN_Multiply,id:8496,x:32721,y:32849,varname:node_8496,prsc:2|A-6642-OUT,B-9041-RGB,C-4289-RGB;n:type:ShaderForge.SFN_Tex2d,id:4398,x:32280,y:32916,ptovrint:False,ptlb:Alpha Texture,ptin:_AlphaTexture,varname:node_4398,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,ntxv:0,isnm:False|UVIN-6122-OUT;n:type:ShaderForge.SFN_Multiply,id:51,x:32890,y:32938,varname:node_51,prsc:2|A-4412-OUT,B-8496-OUT;n:type:ShaderForge.SFN_Multiply,id:6642,x:32600,y:32725,varname:node_6642,prsc:2|A-9588-RGB,B-4398-RGB;n:type:ShaderForge.SFN_VertexColor,id:4289,x:32304,y:33284,varname:node_4289,prsc:2;n:type:ShaderForge.SFN_Add,id:6122,x:32133,y:33060,varname:node_6122,prsc:2|A-5312-UVOUT,B-3323-OUT;n:type:ShaderForge.SFN_TexCoord,id:5312,x:31911,y:32930,varname:node_5312,prsc:2,uv:0,uaff:False;n:type:ShaderForge.SFN_Multiply,id:3323,x:31906,y:33154,varname:node_3323,prsc:2|A-7110-T,B-6323-OUT;n:type:ShaderForge.SFN_Time,id:7110,x:31650,y:32998,varname:node_7110,prsc:2;n:type:ShaderForge.SFN_Append,id:6323,x:31642,y:33221,varname:node_6323,prsc:2|A-3381-OUT,B-2450-OUT;n:type:ShaderForge.SFN_ValueProperty,id:3381,x:31459,y:33226,ptovrint:False,ptlb:Speed_u1,ptin:_Speed_u1,varname:node_3381,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,v1:0;n:type:ShaderForge.SFN_ValueProperty,id:2450,x:31432,y:33321,ptovrint:False,ptlb:Speed_v2,ptin:_Speed_v2,varname:node_2450,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,v1:0;n:type:ShaderForge.SFN_Slider,id:4412,x:32631,y:32654,ptovrint:False,ptlb:亮度,ptin:_,varname:node_4412,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,min:0,cur:1,max:5;n:type:ShaderForge.SFN_Multiply,id:152,x:32911,y:33159,varname:node_152,prsc:2|A-4289-A,B-9041-A,C-8679-OUT;n:type:ShaderForge.SFN_Slider,id:4167,x:32349,y:33462,ptovrint:False,ptlb:alpha,ptin:_alpha,varname:node_4167,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,min:0,cur:1,max:5;n:type:ShaderForge.SFN_Multiply,id:8679,x:32754,y:33297,varname:node_8679,prsc:2|A-9052-OUT,B-4167-OUT;n:type:ShaderForge.SFN_Multiply,id:9052,x:32634,y:33060,varname:node_9052,prsc:2|A-9588-A,B-4398-A;proporder:9041-9588-4412-3960-412-4398-3381-2450-4167;pass:END;sub:END;*/
  6. Shader "Particles/UV Animation_alpha" {
  7. Properties {
  8. _color ("color", Color) = (0.5,0.5,0.5,1)
  9. _Texture ("Texture", 2D) = "white" {}
  10. _ ("亮度", Range(0, 5)) = 1
  11. _Speed_U1 ("Speed_U1", Float ) = 0
  12. _Speed_V1 ("Speed_V1", Float ) = 0
  13. _AlphaTexture ("Alpha Texture", 2D) = "white" {}
  14. _Speed_u1 ("Speed_u1", Float ) = 0
  15. _Speed_v2 ("Speed_v2", Float ) = 0
  16. _alpha ("alpha", Range(0, 5)) = 1
  17. [HideInInspector]_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
  18. }
  19. SubShader {
  20. Tags {
  21. "IgnoreProjector"="True"
  22. "Queue"="Transparent"
  23. "RenderType"="Transparent"
  24. }
  25. LOD 100
  26. Pass {
  27. Name "FORWARD"
  28. Tags {
  29. "LightMode"="ForwardBase"
  30. }
  31. Blend SrcAlpha OneMinusSrcAlpha
  32. Cull Off
  33. ZWrite Off
  34. CGPROGRAM
  35. #pragma vertex vert
  36. #pragma fragment frag
  37. #define UNITY_PASS_FORWARDBASE
  38. #include "UnityCG.cginc"
  39. #pragma multi_compile_fwdbase
  40. #pragma only_renderers d3d9 d3d11 glcore gles gles3 metal d3d11_9x
  41. #pragma target 2.0
  42. uniform float4 _TimeEditor;
  43. uniform sampler2D _Texture; uniform float4 _Texture_ST;
  44. uniform float _Speed_U1;
  45. uniform float _Speed_V1;
  46. uniform float4 _color;
  47. uniform sampler2D _AlphaTexture; uniform float4 _AlphaTexture_ST;
  48. uniform float _Speed_u1;
  49. uniform float _Speed_v2;
  50. uniform float _;
  51. uniform float _alpha;
  52. struct VertexInput {
  53. float4 vertex : POSITION;
  54. float2 texcoord0 : TEXCOORD0;
  55. float4 vertexColor : COLOR;
  56. };
  57. struct VertexOutput {
  58. float4 pos : SV_POSITION;
  59. float2 uv0 : TEXCOORD0;
  60. float4 vertexColor : COLOR;
  61. };
  62. VertexOutput vert (VertexInput v) {
  63. VertexOutput o = (VertexOutput)0;
  64. o.uv0 = v.texcoord0;
  65. o.vertexColor = v.vertexColor;
  66. o.pos = UnityObjectToClipPos(v.vertex );
  67. return o;
  68. }
  69. float4 frag(VertexOutput i, float facing : VFACE) : COLOR {
  70. float isFrontFace = ( facing >= 0 ? 1 : 0 );
  71. float faceSign = ( facing >= 0 ? 1 : -1 );
  72. ////// Lighting:
  73. ////// Emissive:
  74. float4 node_3610 = _Time + _TimeEditor;
  75. float2 node_8912 = (i.uv0+(node_3610.g*float2(_Speed_U1,_Speed_V1)));
  76. float4 _Texture_var = tex2D(_Texture,TRANSFORM_TEX(node_8912, _Texture));
  77. float4 node_7110 = _Time + _TimeEditor;
  78. float2 node_6122 = (i.uv0+(node_7110.g*float2(_Speed_u1,_Speed_v2)));
  79. float4 _AlphaTexture_var = tex2D(_AlphaTexture,TRANSFORM_TEX(node_6122, _AlphaTexture));
  80. float3 emissive = (_*((_Texture_var.rgb*_AlphaTexture_var.rgb)*_color.rgb*i.vertexColor.rgb));
  81. float3 finalColor = emissive;
  82. return fixed4(finalColor,(i.vertexColor.a*_color.a*((_Texture_var.a*_AlphaTexture_var.a)*_alpha)));
  83. }
  84. ENDCG
  85. }
  86. }
  87. CustomEditor "ShaderForgeMaterialInspector"
  88. }