RO_Effect_Vertex_02.shader 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. Shader "RO/RO_Effect_Vertex_02"
  2. {
  3. Properties
  4. {
  5. [HDR]_MainTexColor("MainTexColor", Color) = (1,1,1,1)
  6. _MainTex("MainTex", 2D) = "white" {}
  7. _Vector0("UV_Speed", Vector) = (0,0,0,0)
  8. _VertexStr("VertexStr", Float) = 0
  9. _FresnelColor("FresnelColor", Color) = (0,0,0,0)
  10. _Fresnel("Fresnel(X_Bias,Y_Scale,Z_Power)", Vector) = (0,0,0,0)
  11. [HideInInspector] _texcoord( "", 2D ) = "white" {}
  12. [HideInInspector] __dirty( "", Int ) = 1
  13. }
  14. SubShader
  15. {
  16. Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+0" "IgnoreProjector" = "True" "IsEmissive" = "true" "PreviewType" = "Plane"}
  17. Cull Back
  18. CGPROGRAM
  19. #include "UnityShaderVariables.cginc"
  20. #pragma target 3.0
  21. #pragma surface surf Unlit alpha:fade keepalpha noshadow vertex:vertexDataFunc
  22. struct Input
  23. {
  24. float3 worldPos;
  25. float3 worldNormal;
  26. float2 uv_texcoord;
  27. float4 vertexColor : COLOR;
  28. };
  29. uniform sampler2D _MainTex;
  30. uniform float4 _MainTex_ST;
  31. uniform float4 _Vector0;
  32. uniform float _VertexStr;
  33. uniform float4 _FresnelColor;
  34. uniform float4 _Fresnel;
  35. uniform float4 _MainTexColor;
  36. void vertexDataFunc( inout appdata_full v, out Input o )
  37. {
  38. UNITY_INITIALIZE_OUTPUT( Input, o );
  39. float2 uv0_MainTex = v.texcoord.xy * _MainTex_ST.xy + _MainTex_ST.zw;
  40. float2 appendResult25 = (float2(( uv0_MainTex.x + ( _Time.y * _Vector0.x ) ) , ( uv0_MainTex.y + ( _Time.y * _Vector0.y ) )));
  41. float4 tex2DNode2 = tex2Dlod( _MainTex, float4( appendResult25, 0, 0.0) );
  42. float2 appendResult34 = (float2(( uv0_MainTex.x + ( _Time.y * _Vector0.z ) ) , ( uv0_MainTex.y + ( _Time.y * _Vector0.w ) )));
  43. float4 tex2DNode36 = tex2Dlod( _MainTex, float4( appendResult34, 0, 0.0) );
  44. float temp_output_65_0 = ( tex2DNode2.r * tex2DNode36.r );
  45. float3 ase_vertexNormal = v.normal.xyz;
  46. v.vertex.xyz += ( temp_output_65_0 * _VertexStr * ase_vertexNormal * v.texcoord.z );
  47. }
  48. inline half4 LightingUnlit( SurfaceOutput s, half3 lightDir, half atten )
  49. {
  50. return half4 ( 0, 0, 0, s.Alpha );
  51. }
  52. void surf( Input i , inout SurfaceOutput o )
  53. {
  54. float3 ase_worldPos = i.worldPos;
  55. float3 ase_worldViewDir = normalize( UnityWorldSpaceViewDir( ase_worldPos ) );
  56. float3 ase_worldNormal = i.worldNormal;
  57. float fresnelNdotV43 = dot( ase_worldNormal, ase_worldViewDir );
  58. float fresnelNode43 = ( _Fresnel.x + _Fresnel.y * pow( 1.0 - fresnelNdotV43, _Fresnel.z ) );
  59. float2 uv0_MainTex = i.uv_texcoord * _MainTex_ST.xy + _MainTex_ST.zw;
  60. float2 appendResult25 = (float2(( uv0_MainTex.x + ( _Time.y * _Vector0.x ) ) , ( uv0_MainTex.y + ( _Time.y * _Vector0.y ) )));
  61. float4 tex2DNode2 = tex2D( _MainTex, appendResult25 );
  62. float2 appendResult34 = (float2(( uv0_MainTex.x + ( _Time.y * _Vector0.z ) ) , ( uv0_MainTex.y + ( _Time.y * _Vector0.w ) )));
  63. float4 tex2DNode36 = tex2D( _MainTex, appendResult34 );
  64. float temp_output_65_0 = ( tex2DNode2.r * tex2DNode36.r );
  65. float4 temp_output_49_0 = saturate( ( ( _FresnelColor * saturate( fresnelNode43 ) ) + ( _MainTexColor * temp_output_65_0 * i.vertexColor ) ) );
  66. o.Emission = temp_output_49_0.rgb;
  67. o.Alpha = saturate( ( ( _MainTexColor.a + temp_output_65_0 ) * _MainTexColor.a * i.vertexColor.a ) );
  68. }
  69. ENDCG
  70. }
  71. }