Seven is the number.
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.

126 lines
4.8 KiB

4 years ago
  1. // Upgrade NOTE: replaced 'UNITY_INSTANCE_ID' with 'UNITY_VERTEX_INPUT_INSTANCE_ID'
  2. // Made with Amplify Shader Editor
  3. // Available at the Unity Asset Store - http://u3d.as/y3X
  4. Shader "Custom/Ring"
  5. {
  6. Properties
  7. {
  8. [HideInInspector] __dirty( "", Int ) = 1
  9. _Ringsalpha("Rings (alpha)", 2D) = "white" {}
  10. _Color0("Color 0", Color) = (1,0,0,0)
  11. _Ringintensity("Ring intensity", Range( 0 , 5)) = 5
  12. [HideInInspector] _texcoord( "", 2D ) = "white" {}
  13. }
  14. SubShader
  15. {
  16. Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+0" "IgnoreProjector" = "True" }
  17. Cull Off
  18. CGINCLUDE
  19. #include "UnityPBSLighting.cginc"
  20. #include "Lighting.cginc"
  21. #pragma target 3.0
  22. struct Input
  23. {
  24. float2 uv_texcoord;
  25. };
  26. uniform float4 _Color0;
  27. uniform sampler2D _Ringsalpha;
  28. uniform float4 _Ringsalpha_ST;
  29. uniform float _Ringintensity;
  30. void surf( Input i , inout SurfaceOutputStandard o )
  31. {
  32. o.Albedo = _Color0.rgb;
  33. float2 uv_Ringsalpha = i.uv_texcoord * _Ringsalpha_ST.xy + _Ringsalpha_ST.zw;
  34. o.Alpha = ( tex2D( _Ringsalpha,uv_Ringsalpha).a * _Ringintensity );
  35. }
  36. ENDCG
  37. CGPROGRAM
  38. #pragma surface surf Standard alpha:fade keepalpha
  39. ENDCG
  40. Pass
  41. {
  42. Name "ShadowCaster"
  43. Tags{ "LightMode" = "ShadowCaster" }
  44. ZWrite On
  45. CGPROGRAM
  46. #pragma vertex vert
  47. #pragma fragment frag
  48. #pragma target 3.0
  49. #pragma multi_compile_shadowcaster
  50. #pragma multi_compile UNITY_PASS_SHADOWCASTER
  51. #pragma skip_variants FOG_LINEAR FOG_EXP FOG_EXP2
  52. # include "HLSLSupport.cginc"
  53. #if ( SHADER_API_D3D11 || SHADER_API_GLCORE || SHADER_API_GLES3 )
  54. #define CAN_SKIP_VPOS
  55. #endif
  56. #include "UnityCG.cginc"
  57. #include "Lighting.cginc"
  58. #include "UnityPBSLighting.cginc"
  59. sampler3D _DitherMaskLOD;
  60. struct v2f
  61. {
  62. V2F_SHADOW_CASTER;
  63. float3 worldPos : TEXCOORD6;
  64. float4 texcoords01 : TEXCOORD4;
  65. UNITY_VERTEX_INPUT_INSTANCE_ID
  66. };
  67. v2f vert( appdata_full v )
  68. {
  69. v2f o;
  70. UNITY_SETUP_INSTANCE_ID( v );
  71. UNITY_INITIALIZE_OUTPUT( v2f, o );
  72. UNITY_TRANSFER_INSTANCE_ID( v, o );
  73. float3 worldPos = mul( unity_ObjectToWorld, v.vertex ).xyz;
  74. half3 worldNormal = UnityObjectToWorldNormal( v.normal );
  75. o.texcoords01 = float4( v.texcoord.xy, v.texcoord1.xy );
  76. o.worldPos = worldPos;
  77. TRANSFER_SHADOW_CASTER_NORMALOFFSET( o )
  78. return o;
  79. }
  80. fixed4 frag( v2f IN
  81. #if !defined( CAN_SKIP_VPOS )
  82. , UNITY_VPOS_TYPE vpos : VPOS
  83. #endif
  84. ) : SV_Target
  85. {
  86. UNITY_SETUP_INSTANCE_ID( IN );
  87. Input surfIN;
  88. UNITY_INITIALIZE_OUTPUT( Input, surfIN );
  89. surfIN.uv_texcoord = IN.texcoords01.xy;
  90. float3 worldPos = IN.worldPos;
  91. fixed3 worldViewDir = normalize( UnityWorldSpaceViewDir( worldPos ) );
  92. SurfaceOutputStandard o;
  93. UNITY_INITIALIZE_OUTPUT( SurfaceOutputStandard, o )
  94. surf( surfIN, o );
  95. #if defined( CAN_SKIP_VPOS )
  96. float2 vpos = IN.pos;
  97. #endif
  98. half alphaRef = tex3D( _DitherMaskLOD, float3( vpos.xy * 0.25, o.Alpha * 0.9375 ) ).a;
  99. clip( alphaRef - 0.01 );
  100. SHADOW_CASTER_FRAGMENT( IN )
  101. }
  102. ENDCG
  103. }
  104. }
  105. Fallback "Diffuse"
  106. CustomEditor "ASEMaterialInspector"
  107. }
  108. /*ASEBEGIN
  109. Version=6001
  110. 2567;29;1666;974;1022.9;1135.2;1.9;True;True
  111. Node;AmplifyShaderEditor.SamplerNode;1;-451,94;Float;True;Property;_Ringsalpha;Rings (alpha);0;0;Assets/Exo planets/Textures/Planets/Atawi/Atawi_Rings.tga;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;1.0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1.0;False;FLOAT4;FLOAT;FLOAT;FLOAT;FLOAT
  112. Node;AmplifyShaderEditor.RangedFloatNode;4;-443.4,315.4001;Float;False;Property;_Ringintensity;Ring intensity;2;0;5;0;5;FLOAT
  113. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;3;-89.40002,186.4001;Float;True;0;FLOAT;0.0;False;1;FLOAT;0.0;False;FLOAT
  114. Node;AmplifyShaderEditor.ColorNode;2;-365.4,-162.5999;Float;False;Property;_Color0;Color 0;1;0;1,0,0,0;COLOR;FLOAT;FLOAT;FLOAT;FLOAT
  115. Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;207,-9;Float;False;True;2;Float;ASEMaterialInspector;Standard;Custom/Ring;False;False;False;False;False;False;False;False;False;False;False;False;Off;0;0;False;0;0;Transparent;0.5;True;True;0;False;Transparent;Transparent;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;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;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
  116. WireConnection;3;0;1;4
  117. WireConnection;3;1;4;0
  118. WireConnection;0;0;2;0
  119. WireConnection;0;9;3;0
  120. ASEEND*/
  121. //CHKSM=C290C9AEC8DFC229E1C43ABF3DCB5828C4FAE703