You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
4.6 KiB

  1. // Made with Amplify Shader Editor
  2. // Available at the Unity Asset Store - http://u3d.as/y3X
  3. Shader "ASESampleShaders/AnimatedFireShaderFunction"
  4. {
  5. Properties
  6. {
  7. [HideInInspector] __dirty( "", Int ) = 1
  8. [Header(Burn Effect)]
  9. _FireTexture("Fire Texture", 2D) = "white" {}
  10. _BurnMask("Burn Mask", 2D) = "white" {}
  11. _FireIntensity("Fire Intensity", Range( 0 , 2)) = 2
  12. _Albedo("Albedo", 2D) = "white" {}
  13. _Normals("Normals", 2D) = "bump" {}
  14. _Specular("Specular", 2D) = "white" {}
  15. _Smoothness("Smoothness", Float) = 1
  16. [HideInInspector] _texcoord( "", 2D ) = "white" {}
  17. }
  18. SubShader
  19. {
  20. Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "IsEmissive" = "true" }
  21. Cull Back
  22. CGPROGRAM
  23. #include "UnityShaderVariables.cginc"
  24. #pragma target 3.0
  25. #pragma surface surf StandardSpecular keepalpha addshadow fullforwardshadows vertex:vertexDataFunc
  26. struct Input
  27. {
  28. float2 texcoord_0;
  29. float2 uv_texcoord;
  30. };
  31. uniform sampler2D _Normals;
  32. uniform sampler2D _Albedo;
  33. uniform sampler2D _BurnMask;
  34. uniform float4 _BurnMask_ST;
  35. uniform sampler2D _FireTexture;
  36. uniform float _FireIntensity;
  37. uniform sampler2D _Specular;
  38. uniform float _Smoothness;
  39. void vertexDataFunc( inout appdata_full v, out Input o )
  40. {
  41. UNITY_INITIALIZE_OUTPUT( Input, o );
  42. o.texcoord_0.xy = v.texcoord.xy * float2( 1,1 ) + float2( 0,0 );
  43. }
  44. void surf( Input i , inout SurfaceOutputStandardSpecular o )
  45. {
  46. o.Normal = UnpackNormal( tex2D( _Normals,i.texcoord_0) );
  47. o.Albedo = tex2D( _Albedo,i.texcoord_0).xyz;
  48. float2 uv_BurnMask = i.uv_texcoord * _BurnMask_ST.xy + _BurnMask_ST.zw;
  49. o.Emission = ( ( tex2D( _BurnMask,uv_BurnMask) * tex2D( _FireTexture,(abs( i.texcoord_0+_Time.x * float2(-1,0 )))) ) * ( _FireIntensity * ( _SinTime.w + 1.5 ) ) ).xyz;
  50. o.Specular = tex2D( _Specular,i.texcoord_0).xyz;
  51. o.Smoothness = _Smoothness;
  52. o.Alpha = 1;
  53. }
  54. ENDCG
  55. }
  56. Fallback "Diffuse"
  57. CustomEditor "ASEMaterialInspector"
  58. }
  59. /*ASEBEGIN
  60. Version=7206
  61. 796;92;1124;966;1213.376;278.8553;1.3;False;False
  62. Node;AmplifyShaderEditor.RangedFloatNode;19;-855.2775,119.1449;Float;False;Property;_FireIntensity;Fire Intensity;4;0;2;0;2;0;1;FLOAT
  63. Node;AmplifyShaderEditor.TextureCoordinatesNode;4;-1413.839,183.3731;Float;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;FLOAT;FLOAT;FLOAT;FLOAT
  64. Node;AmplifyShaderEditor.SamplerNode;13;-535.8399,-92.72685;Float;True;Property;_Normals;Normals;6;0;None;True;0;True;bump;Auto;True;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;0,0;False;1;FLOAT2;1.0;False;2;FLOAT;1.0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1.0;False;5;FLOAT3;FLOAT;FLOAT;FLOAT;FLOAT
  65. Node;AmplifyShaderEditor.FunctionNode;21;-541.476,199.8449;Float;False;Burn Effect;0;;2;2;0;FLOAT;0;False;1;FLOAT2;0.0,0;False;1;FLOAT4
  66. Node;AmplifyShaderEditor.SamplerNode;17;-535.7401,-292.4268;Float;True;Property;_Albedo;Albedo;5;0;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;0,0;False;1;FLOAT2;1.0;False;2;FLOAT;1.0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1.0;False;5;FLOAT4;FLOAT;FLOAT;FLOAT;FLOAT
  67. Node;AmplifyShaderEditor.RangedFloatNode;15;-9.840205,290.5776;Float;False;Property;_Smoothness;Smoothness;8;0;1;0;0;0;1;FLOAT
  68. Node;AmplifyShaderEditor.SamplerNode;16;-520.8406,351.0728;Float;True;Property;_Specular;Specular;7;0;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;0,0;False;1;FLOAT2;1.0;False;2;FLOAT;1.0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1.0;False;5;FLOAT4;FLOAT;FLOAT;FLOAT;FLOAT
  69. Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;291.1997,-174.2;Float;False;True;2;Float;ASEMaterialInspector;0;StandardSpecular;ASESampleShaders/AnimatedFireShaderFunction;False;False;False;False;False;False;False;False;False;False;False;False;Back;0;0;False;0;0;Opaque;0.5;True;True;0;False;Opaque;Geometry;All;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;False;0;255;255;0;0;0;0;False;0;4;10;25;False;0.5;True;0;Zero;Zero;0;Zero;Zero;Add;Add;0;False;0;0,0,0,0;VertexOffset;False;Cylindrical;Relative;0;;-1;-1;-1;-1;16;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT3;0,0,0;False;4;FLOAT;0.0;False;5;FLOAT;0.0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0.0;False;9;FLOAT;0.0;False;10;OBJECT;0.0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;13;OBJECT;0.0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
  70. WireConnection;13;1;4;0
  71. WireConnection;21;0;19;0
  72. WireConnection;21;1;4;0
  73. WireConnection;17;1;4;0
  74. WireConnection;16;1;4;0
  75. WireConnection;0;0;17;0
  76. WireConnection;0;1;13;0
  77. WireConnection;0;2;21;0
  78. WireConnection;0;3;16;0
  79. WireConnection;0;4;15;0
  80. ASEEND*/
  81. //CHKSM=EDF930C79FDA46758F6BA9A9F205BA1B206358E2