summaryrefslogtreecommitdiff
path: root/Assets/BOXOPHOBIC/Atmospheric Height Fog/Core/Shaders/UI Default (Height Fog Support).shader
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/BOXOPHOBIC/Atmospheric Height Fog/Core/Shaders/UI Default (Height Fog Support).shader')
-rw-r--r--Assets/BOXOPHOBIC/Atmospheric Height Fog/Core/Shaders/UI Default (Height Fog Support).shader280
1 files changed, 280 insertions, 0 deletions
diff --git a/Assets/BOXOPHOBIC/Atmospheric Height Fog/Core/Shaders/UI Default (Height Fog Support).shader b/Assets/BOXOPHOBIC/Atmospheric Height Fog/Core/Shaders/UI Default (Height Fog Support).shader
new file mode 100644
index 00000000..a30f1675
--- /dev/null
+++ b/Assets/BOXOPHOBIC/Atmospheric Height Fog/Core/Shaders/UI Default (Height Fog Support).shader
@@ -0,0 +1,280 @@
+// Made with Amplify Shader Editor
+// Available at the Unity Asset Store - http://u3d.as/y3X
+Shader "UI/Default (Height Fog Support)"
+{
+ Properties
+ {
+ [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
+ _Color ("Tint", Color) = (1,1,1,1)
+
+ _StencilComp ("Stencil Comparison", Float) = 8
+ _Stencil ("Stencil ID", Float) = 0
+ _StencilOp ("Stencil Operation", Float) = 0
+ _StencilWriteMask ("Stencil Write Mask", Float) = 255
+ _StencilReadMask ("Stencil Read Mask", Float) = 255
+
+ _ColorMask ("Color Mask", Float) = 15
+
+ [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
+ [HideInInspector] _texcoord( "", 2D ) = "white" {}
+
+ }
+
+ SubShader
+ {
+ LOD 0
+
+ Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" "CanUseSpriteAtlas"="True" }
+
+ Stencil
+ {
+ Ref [_Stencil]
+ ReadMask [_StencilReadMask]
+ WriteMask [_StencilWriteMask]
+ CompFront [_StencilComp]
+ PassFront [_StencilOp]
+ FailFront Keep
+ ZFailFront Keep
+ CompBack Always
+ PassBack Keep
+ FailBack Keep
+ ZFailBack Keep
+ }
+
+
+ Cull Off
+ Lighting Off
+ ZWrite Off
+ ZTest [unity_GUIZTestMode]
+ Blend SrcAlpha OneMinusSrcAlpha
+ ColorMask [_ColorMask]
+
+
+ Pass
+ {
+ Name "Default"
+ CGPROGRAM
+
+ #pragma vertex vert
+ #pragma fragment frag
+ #pragma target 3.0
+
+ #include "UnityCG.cginc"
+ #include "UnityUI.cginc"
+
+ #pragma multi_compile __ UNITY_UI_CLIP_RECT
+ #pragma multi_compile __ UNITY_UI_ALPHACLIP
+
+ #include "UnityShaderVariables.cginc"
+ #define ASE_NEEDS_FRAG_COLOR
+ #pragma multi_compile AHF_NOISEMODE_OFF AHF_NOISEMODE_PROCEDURAL3D
+
+
+ struct appdata_t
+ {
+ float4 vertex : POSITION;
+ float4 color : COLOR;
+ float2 texcoord : TEXCOORD0;
+ UNITY_VERTEX_INPUT_INSTANCE_ID
+
+ };
+
+ struct v2f
+ {
+ float4 vertex : SV_POSITION;
+ fixed4 color : COLOR;
+ half2 texcoord : TEXCOORD0;
+ float4 worldPosition : TEXCOORD1;
+ UNITY_VERTEX_INPUT_INSTANCE_ID
+ UNITY_VERTEX_OUTPUT_STEREO
+ float4 ase_texcoord2 : TEXCOORD2;
+ };
+
+ uniform fixed4 _Color;
+ uniform fixed4 _TextureSampleAdd;
+ uniform float4 _ClipRect;
+ uniform sampler2D _MainTex;
+ uniform float4 _MainTex_ST;
+ uniform half4 AHF_FogColorStart;
+ uniform half4 AHF_FogColorEnd;
+ uniform half AHF_FogDistanceStart;
+ uniform half AHF_FogDistanceEnd;
+ uniform half AHF_FogDistanceFalloff;
+ uniform half AHF_FogColorDuo;
+ uniform half4 AHF_DirectionalColor;
+ uniform half3 AHF_DirectionalDir;
+ uniform half AHF_DirectionalIntensity;
+ uniform half AHF_DirectionalFalloff;
+ uniform half3 AHF_FogAxisOption;
+ uniform half AHF_FogHeightEnd;
+ uniform half AHF_FogHeightStart;
+ uniform half AHF_FogHeightFalloff;
+ uniform half AHF_FogLayersMode;
+ uniform half AHF_NoiseScale;
+ uniform half3 AHF_NoiseSpeed;
+ uniform half AHF_NoiseDistanceEnd;
+ uniform half AHF_NoiseIntensity;
+ uniform half AHF_NoiseModeBlend;
+ uniform half AHF_FogIntensity;
+ float3 mod3D289( float3 x ) { return x - floor( x / 289.0 ) * 289.0; }
+ float4 mod3D289( float4 x ) { return x - floor( x / 289.0 ) * 289.0; }
+ float4 permute( float4 x ) { return mod3D289( ( x * 34.0 + 1.0 ) * x ); }
+ float4 taylorInvSqrt( float4 r ) { return 1.79284291400159 - r * 0.85373472095314; }
+ float snoise( float3 v )
+ {
+ const float2 C = float2( 1.0 / 6.0, 1.0 / 3.0 );
+ float3 i = floor( v + dot( v, C.yyy ) );
+ float3 x0 = v - i + dot( i, C.xxx );
+ float3 g = step( x0.yzx, x0.xyz );
+ float3 l = 1.0 - g;
+ float3 i1 = min( g.xyz, l.zxy );
+ float3 i2 = max( g.xyz, l.zxy );
+ float3 x1 = x0 - i1 + C.xxx;
+ float3 x2 = x0 - i2 + C.yyy;
+ float3 x3 = x0 - 0.5;
+ i = mod3D289( i);
+ float4 p = permute( permute( permute( i.z + float4( 0.0, i1.z, i2.z, 1.0 ) ) + i.y + float4( 0.0, i1.y, i2.y, 1.0 ) ) + i.x + float4( 0.0, i1.x, i2.x, 1.0 ) );
+ float4 j = p - 49.0 * floor( p / 49.0 ); // mod(p,7*7)
+ float4 x_ = floor( j / 7.0 );
+ float4 y_ = floor( j - 7.0 * x_ ); // mod(j,N)
+ float4 x = ( x_ * 2.0 + 0.5 ) / 7.0 - 1.0;
+ float4 y = ( y_ * 2.0 + 0.5 ) / 7.0 - 1.0;
+ float4 h = 1.0 - abs( x ) - abs( y );
+ float4 b0 = float4( x.xy, y.xy );
+ float4 b1 = float4( x.zw, y.zw );
+ float4 s0 = floor( b0 ) * 2.0 + 1.0;
+ float4 s1 = floor( b1 ) * 2.0 + 1.0;
+ float4 sh = -step( h, 0.0 );
+ float4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;
+ float4 a1 = b1.xzyw + s1.xzyw * sh.zzww;
+ float3 g0 = float3( a0.xy, h.x );
+ float3 g1 = float3( a0.zw, h.y );
+ float3 g2 = float3( a1.xy, h.z );
+ float3 g3 = float3( a1.zw, h.w );
+ float4 norm = taylorInvSqrt( float4( dot( g0, g0 ), dot( g1, g1 ), dot( g2, g2 ), dot( g3, g3 ) ) );
+ g0 *= norm.x;
+ g1 *= norm.y;
+ g2 *= norm.z;
+ g3 *= norm.w;
+ float4 m = max( 0.6 - float4( dot( x0, x0 ), dot( x1, x1 ), dot( x2, x2 ), dot( x3, x3 ) ), 0.0 );
+ m = m* m;
+ m = m* m;
+ float4 px = float4( dot( x0, g0 ), dot( x1, g1 ), dot( x2, g2 ), dot( x3, g3 ) );
+ return 42.0 * dot( m, px);
+ }
+
+
+
+ v2f vert( appdata_t IN )
+ {
+ v2f OUT;
+ UNITY_SETUP_INSTANCE_ID( IN );
+ UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
+ UNITY_TRANSFER_INSTANCE_ID(IN, OUT);
+ OUT.worldPosition = IN.vertex;
+ float3 ase_worldPos = mul(unity_ObjectToWorld, IN.vertex).xyz;
+ OUT.ase_texcoord2.xyz = ase_worldPos;
+
+
+ //setting value to unused interpolator channels and avoid initialization warnings
+ OUT.ase_texcoord2.w = 0;
+
+ OUT.worldPosition.xyz += float3( 0, 0, 0 ) ;
+ OUT.vertex = UnityObjectToClipPos(OUT.worldPosition);
+
+ OUT.texcoord = IN.texcoord;
+
+ OUT.color = IN.color * _Color;
+ return OUT;
+ }
+
+ fixed4 frag(v2f IN ) : SV_Target
+ {
+ float2 uv_MainTex = IN.texcoord.xy * _MainTex_ST.xy + _MainTex_ST.zw;
+ float4 temp_output_4_0 = ( IN.color * ( tex2D( _MainTex, uv_MainTex ) + _TextureSampleAdd ) );
+ float3 ase_worldPos = IN.ase_texcoord2.xyz;
+ float3 WorldPosition2_g874 = ase_worldPos;
+ float temp_output_7_0_g876 = AHF_FogDistanceStart;
+ half FogDistanceMask12_g874 = pow( abs( saturate( ( ( distance( WorldPosition2_g874 , _WorldSpaceCameraPos ) - temp_output_7_0_g876 ) / ( AHF_FogDistanceEnd - temp_output_7_0_g876 ) ) ) ) , AHF_FogDistanceFalloff );
+ float3 lerpResult258_g874 = lerp( (AHF_FogColorStart).rgb , (AHF_FogColorEnd).rgb , ( saturate( ( FogDistanceMask12_g874 - 0.5 ) ) * AHF_FogColorDuo ));
+ float3 normalizeResult318_g874 = normalize( ( WorldPosition2_g874 - _WorldSpaceCameraPos ) );
+ float dotResult145_g874 = dot( normalizeResult318_g874 , AHF_DirectionalDir );
+ half DirectionalMask30_g874 = pow( abs( ( (dotResult145_g874*0.5 + 0.5) * AHF_DirectionalIntensity ) ) , AHF_DirectionalFalloff );
+ float3 lerpResult40_g874 = lerp( lerpResult258_g874 , (AHF_DirectionalColor).rgb , DirectionalMask30_g874);
+ float3 temp_output_2_0_g875 = lerpResult40_g874;
+ float3 gammaToLinear3_g875 = GammaToLinearSpace( temp_output_2_0_g875 );
+ #ifdef UNITY_COLORSPACE_GAMMA
+ float3 staticSwitch1_g875 = temp_output_2_0_g875;
+ #else
+ float3 staticSwitch1_g875 = gammaToLinear3_g875;
+ #endif
+ float3 temp_output_256_0_g874 = staticSwitch1_g875;
+ float3 temp_output_92_86_g873 = temp_output_256_0_g874;
+ half3 AHF_FogAxisOption181_g874 = AHF_FogAxisOption;
+ float3 break159_g874 = ( WorldPosition2_g874 * AHF_FogAxisOption181_g874 );
+ float temp_output_7_0_g877 = AHF_FogHeightEnd;
+ half FogHeightMask16_g874 = pow( abs( saturate( ( ( ( break159_g874.x + break159_g874.y + break159_g874.z ) - temp_output_7_0_g877 ) / ( AHF_FogHeightStart - temp_output_7_0_g877 ) ) ) ) , AHF_FogHeightFalloff );
+ float lerpResult328_g874 = lerp( ( FogDistanceMask12_g874 * FogHeightMask16_g874 ) , saturate( ( FogDistanceMask12_g874 + FogHeightMask16_g874 ) ) , AHF_FogLayersMode);
+ float simplePerlin3D193_g874 = snoise( ( ( WorldPosition2_g874 * ( 1.0 / AHF_NoiseScale ) ) + ( -AHF_NoiseSpeed * _Time.y ) ) );
+ float temp_output_7_0_g879 = AHF_NoiseDistanceEnd;
+ half NoiseDistanceMask7_g874 = saturate( ( ( distance( WorldPosition2_g874 , _WorldSpaceCameraPos ) - temp_output_7_0_g879 ) / ( 0.0 - temp_output_7_0_g879 ) ) );
+ float lerpResult198_g874 = lerp( 1.0 , (simplePerlin3D193_g874*0.5 + 0.5) , ( NoiseDistanceMask7_g874 * AHF_NoiseIntensity * AHF_NoiseModeBlend ));
+ half NoiseSimplex3D24_g874 = lerpResult198_g874;
+ #if defined(AHF_NOISEMODE_OFF)
+ float staticSwitch42_g874 = lerpResult328_g874;
+ #elif defined(AHF_NOISEMODE_PROCEDURAL3D)
+ float staticSwitch42_g874 = ( lerpResult328_g874 * NoiseSimplex3D24_g874 );
+ #else
+ float staticSwitch42_g874 = lerpResult328_g874;
+ #endif
+ float temp_output_43_0_g874 = ( staticSwitch42_g874 * AHF_FogIntensity );
+ float temp_output_92_87_g873 = temp_output_43_0_g874;
+ float3 lerpResult82_g873 = lerp( (temp_output_4_0).rgb , temp_output_92_86_g873 , temp_output_92_87_g873);
+ float4 appendResult9 = (float4(lerpResult82_g873 , (temp_output_4_0).a));
+
+ half4 color = appendResult9;
+
+ #ifdef UNITY_UI_CLIP_RECT
+ color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
+ #endif
+
+ #ifdef UNITY_UI_ALPHACLIP
+ clip (color.a - 0.001);
+ #endif
+
+ return color;
+ }
+ ENDCG
+ }
+ }
+
+
+
+}
+/*ASEBEGIN
+Version=18103
+1927;1;1906;1020;359.1003;561.1945;1;True;False
+Node;AmplifyShaderEditor.TemplateShaderPropertyNode;2;-512,0;Inherit;False;0;0;_MainTex;Shader;0;5;SAMPLER2D;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
+Node;AmplifyShaderEditor.SamplerNode;3;-320,0;Inherit;True;Property;_TextureSample0;Texture Sample 0;0;0;Create;True;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
+Node;AmplifyShaderEditor.TemplateShaderPropertyNode;11;-320,192;Inherit;False;0;0;_TextureSampleAdd;Pass;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
+Node;AmplifyShaderEditor.VertexColorNode;12;-512,-256;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
+Node;AmplifyShaderEditor.SimpleAddOpNode;10;64,64;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT4;0,0,0,0;False;1;COLOR;0
+Node;AmplifyShaderEditor.SimpleMultiplyOpNode;4;256,-256;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
+Node;AmplifyShaderEditor.SwizzleNode;6;448,-256;Inherit;False;FLOAT3;0;1;2;3;1;0;COLOR;0,0,0,0;False;1;FLOAT3;0
+Node;AmplifyShaderEditor.FunctionNode;21;640,-256;Inherit;False;Apply Height Fog;-1;;873;950890317d4f36a48a68d150cdab0168;0;1;81;FLOAT3;0,0,0;False;3;FLOAT3;85;FLOAT3;86;FLOAT;87
+Node;AmplifyShaderEditor.SwizzleNode;7;448,-160;Inherit;False;FLOAT;3;1;2;3;1;0;COLOR;0,0,0,0;False;1;FLOAT;0
+Node;AmplifyShaderEditor.DynamicAppendNode;9;896,-256;Inherit;False;FLOAT4;4;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
+Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;1;1088,-256;Float;False;True;-1;2;;0;4;UI/Default (Height Fog Support);5056123faa0c79b47ab6ad7e8bf059a4;True;Default;0;0;Default;2;True;2;5;False;-1;10;False;-1;0;1;False;-1;0;False;-1;False;False;True;2;False;-1;True;True;True;True;True;0;True;-9;True;True;0;True;-5;255;True;-8;255;True;-7;0;True;-4;0;True;-6;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;True;2;False;-1;True;0;True;-11;False;True;5;Queue=Transparent=Queue=0;IgnoreProjector=True;RenderType=Transparent=RenderType;PreviewType=Plane;CanUseSpriteAtlas=True;False;0;False;False;False;False;False;False;False;False;False;False;True;2;0;;0;0;Standard;0;0;1;True;False;;0
+WireConnection;3;0;2;0
+WireConnection;10;0;3;0
+WireConnection;10;1;11;0
+WireConnection;4;0;12;0
+WireConnection;4;1;10;0
+WireConnection;6;0;4;0
+WireConnection;21;81;6;0
+WireConnection;7;0;4;0
+WireConnection;9;0;21;85
+WireConnection;9;3;7;0
+WireConnection;1;0;9;0
+ASEEND*/
+//CHKSM=49D35CE9F5579F0E10E33D6935C93B9E757590B8 \ No newline at end of file