123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282 |
- // Made with Amplify Shader Editor
- // Available at the Unity Asset Store - http://u3d.as/y3X
- Shader "SyntyStudios/PlanetsLines"
- {
- Properties
- {
- _ASEOutlineColor( "Outline Color", Color ) = (0.5181034,0.4426903,0.6764706,0)
- _ASEOutlineWidth( "Outline Width", Float ) = 0.01
- _RimColor("RimColor", Color) = (0,0,0,0)
- _RimPower("RimPower", Range( 0 , 10)) = 0
- _PlanetSurfaceColor("PlanetSurfaceColor", 2D) = "white" {}
- _PlanetSurfaceTiling("PlanetSurfaceTiling", Float) = 0
- _PlanetSurfaceContrast("PlanetSurfaceContrast", Float) = 0
- _BaseColor("BaseColor", Color) = (0,0,0,0)
- _Second_Color("Second_Color", Color) = (0,0,0,0)
- _Clouds("Clouds", 2D) = "white" {}
- _Cloud_Falloff("Cloud_Falloff", Float) = 0
- _Cloud_Tiling("Cloud_Tiling", Float) = 0
- _Cloud_Contrast("Cloud_Contrast", Float) = 0
- [HideInInspector] _texcoord( "", 2D ) = "white" {}
- [HideInInspector] __dirty( "", Int ) = 1
- }
- SubShader
- {
- Tags{ }
- Cull Front
- CGPROGRAM
- #pragma target 3.0
- #pragma surface outlineSurf Outline keepalpha noshadow noambient novertexlights nolightmap nodynlightmap nodirlightmap nometa noforwardadd vertex:outlineVertexDataFunc
- uniform half4 _ASEOutlineColor;
- uniform half _ASEOutlineWidth;
- void outlineVertexDataFunc( inout appdata_full v, out Input o )
- {
- UNITY_INITIALIZE_OUTPUT( Input, o );
- v.vertex.xyz *= ( 1 + _ASEOutlineWidth);
- }
- inline half4 LightingOutline( SurfaceOutput s, half3 lightDir, half atten ) { return half4 ( 0,0,0, s.Alpha); }
- void outlineSurf( Input i, inout SurfaceOutput o )
- {
- o.Emission = _ASEOutlineColor.rgb;
- o.Alpha = 1;
- }
- ENDCG
-
- Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "IsEmissive" = "true" }
- Cull Back
- CGINCLUDE
- #include "UnityPBSLighting.cginc"
- #include "Lighting.cginc"
- #pragma target 4.6
- #ifdef UNITY_PASS_SHADOWCASTER
- #undef INTERNAL_DATA
- #undef WorldReflectionVector
- #undef WorldNormalVector
- #define INTERNAL_DATA half3 internalSurfaceTtoW0; half3 internalSurfaceTtoW1; half3 internalSurfaceTtoW2;
- #define WorldReflectionVector(data,normal) reflect (data.worldRefl, half3(dot(data.internalSurfaceTtoW0,normal), dot(data.internalSurfaceTtoW1,normal), dot(data.internalSurfaceTtoW2,normal)))
- #define WorldNormalVector(data,normal) half3(dot(data.internalSurfaceTtoW0,normal), dot(data.internalSurfaceTtoW1,normal), dot(data.internalSurfaceTtoW2,normal))
- #endif
- struct Input
- {
- float2 uv_texcoord;
- float3 worldPos;
- float3 worldNormal;
- INTERNAL_DATA
- float3 viewDir;
- };
- uniform float4 _BaseColor;
- uniform float4 _Second_Color;
- uniform float _PlanetSurfaceContrast;
- uniform sampler2D _PlanetSurfaceColor;
- uniform float _PlanetSurfaceTiling;
- uniform float _Cloud_Contrast;
- uniform sampler2D _Clouds;
- uniform float _Cloud_Tiling;
- uniform float _Cloud_Falloff;
- uniform sampler2D Normals;
- uniform float4 Normals_ST;
- uniform float _RimPower;
- uniform float4 _RimColor;
- float4 CalculateContrast( float contrastValue, float4 colorTarget )
- {
- float t = 0.5 * ( 1.0 - contrastValue );
- return mul( float4x4( contrastValue,0,0,t, 0,contrastValue,0,t, 0,0,contrastValue,t, 0,0,0,1 ), colorTarget );
- }
- inline float4 TriplanarSamplingCF( sampler2D topTexMap, sampler2D midTexMap, sampler2D botTexMap, float3 worldPos, float3 worldNormal, float falloff, float tilling, float3 normalScale, float3 index )
- {
- float3 projNormal = ( pow( abs( worldNormal ), falloff ) );
- projNormal /= ( projNormal.x + projNormal.y + projNormal.z ) + 0.00001;
- float3 nsign = sign( worldNormal );
- float negProjNormalY = max( 0, projNormal.y * -nsign.y );
- projNormal.y = max( 0, projNormal.y * nsign.y );
- half4 xNorm; half4 yNorm; half4 yNormN; half4 zNorm;
- xNorm = ( tex2D( midTexMap, tilling * worldPos.zy * float2( nsign.x, 1.0 ) ) );
- yNorm = ( tex2D( topTexMap, tilling * worldPos.xz * float2( nsign.y, 1.0 ) ) );
- yNormN = ( tex2D( botTexMap, tilling * worldPos.xz * float2( nsign.y, 1.0 ) ) );
- zNorm = ( tex2D( midTexMap, tilling * worldPos.xy * float2( -nsign.z, 1.0 ) ) );
- return xNorm * projNormal.x + yNorm * projNormal.y + yNormN * negProjNormalY + zNorm * projNormal.z;
- }
- void surf( Input i , inout SurfaceOutputStandard o )
- {
- o.Normal = float3(0,0,1);
- float2 temp_cast_0 = (_PlanetSurfaceTiling).xx;
- float2 uv_TexCoord78 = i.uv_texcoord * temp_cast_0;
- float4 lerpResult24 = lerp( _BaseColor , _Second_Color , CalculateContrast(_PlanetSurfaceContrast,tex2D( _PlanetSurfaceColor, uv_TexCoord78 )));
- float3 ase_worldPos = i.worldPos;
- float3 ase_worldNormal = WorldNormalVector( i, float3( 0, 0, 1 ) );
- float3 localPos = mul( unity_WorldToObject, float4( ase_worldPos, 1 ) );
- float3 localNormal = mul( unity_WorldToObject, float4( ase_worldNormal, 0 ) );
- float4 triplanar36 = TriplanarSamplingCF( _Clouds, _Clouds, _Clouds, localPos, localNormal, _Cloud_Falloff, _Cloud_Tiling, float3( 1,1,1 ), float3(0,0,0) );
- float4 lerpResult56 = lerp( _BaseColor , _Second_Color , ( CalculateContrast(_Cloud_Contrast,triplanar36) * -1.0 ));
- float4 clampResult34 = clamp( ( lerpResult24 + lerpResult56 ) , float4( 0,0,0,0 ) , float4( 1,1,1,0 ) );
- o.Albedo = clampResult34.rgb;
- float2 uvNormals = i.uv_texcoord * Normals_ST.xy + Normals_ST.zw;
- float3 normalizeResult52 = normalize( i.viewDir );
- float dotResult53 = dot( UnpackNormal( tex2D( Normals, uvNormals ) ) , normalizeResult52 );
- o.Emission = ( pow( ( 1.0 - saturate( dotResult53 ) ) , _RimPower ) * _RimColor ).rgb;
- o.Alpha = 1;
- }
- ENDCG
- CGPROGRAM
- #pragma surface surf Standard keepalpha fullforwardshadows exclude_path:deferred
- ENDCG
- Pass
- {
- Name "ShadowCaster"
- Tags{ "LightMode" = "ShadowCaster" }
- ZWrite On
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- #pragma target 4.6
- #pragma multi_compile_shadowcaster
- #pragma multi_compile UNITY_PASS_SHADOWCASTER
- #pragma skip_variants FOG_LINEAR FOG_EXP FOG_EXP2
- #include "HLSLSupport.cginc"
- #if ( SHADER_API_D3D11 || SHADER_API_GLCORE || SHADER_API_GLES3 || SHADER_API_METAL || SHADER_API_VULKAN )
- #define CAN_SKIP_VPOS
- #endif
- #include "UnityCG.cginc"
- #include "Lighting.cginc"
- #include "UnityPBSLighting.cginc"
- struct v2f
- {
- V2F_SHADOW_CASTER;
- float2 customPack1 : TEXCOORD1;
- float4 tSpace0 : TEXCOORD2;
- float4 tSpace1 : TEXCOORD3;
- float4 tSpace2 : TEXCOORD4;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- v2f vert( appdata_full v )
- {
- v2f o;
- UNITY_SETUP_INSTANCE_ID( v );
- UNITY_INITIALIZE_OUTPUT( v2f, o );
- UNITY_TRANSFER_INSTANCE_ID( v, o );
- Input customInputData;
- float3 worldPos = mul( unity_ObjectToWorld, v.vertex ).xyz;
- half3 worldNormal = UnityObjectToWorldNormal( v.normal );
- half3 worldTangent = UnityObjectToWorldDir( v.tangent.xyz );
- half tangentSign = v.tangent.w * unity_WorldTransformParams.w;
- half3 worldBinormal = cross( worldNormal, worldTangent ) * tangentSign;
- o.tSpace0 = float4( worldTangent.x, worldBinormal.x, worldNormal.x, worldPos.x );
- o.tSpace1 = float4( worldTangent.y, worldBinormal.y, worldNormal.y, worldPos.y );
- o.tSpace2 = float4( worldTangent.z, worldBinormal.z, worldNormal.z, worldPos.z );
- o.customPack1.xy = customInputData.uv_texcoord;
- o.customPack1.xy = v.texcoord;
- TRANSFER_SHADOW_CASTER_NORMALOFFSET( o )
- return o;
- }
- half4 frag( v2f IN
- #if !defined( CAN_SKIP_VPOS )
- , UNITY_VPOS_TYPE vpos : VPOS
- #endif
- ) : SV_Target
- {
- UNITY_SETUP_INSTANCE_ID( IN );
- Input surfIN;
- UNITY_INITIALIZE_OUTPUT( Input, surfIN );
- surfIN.uv_texcoord = IN.customPack1.xy;
- float3 worldPos = float3( IN.tSpace0.w, IN.tSpace1.w, IN.tSpace2.w );
- half3 worldViewDir = normalize( UnityWorldSpaceViewDir( worldPos ) );
- surfIN.viewDir = IN.tSpace0.xyz * worldViewDir.x + IN.tSpace1.xyz * worldViewDir.y + IN.tSpace2.xyz * worldViewDir.z;
- surfIN.worldPos = worldPos;
- surfIN.worldNormal = float3( IN.tSpace0.z, IN.tSpace1.z, IN.tSpace2.z );
- surfIN.internalSurfaceTtoW0 = IN.tSpace0.xyz;
- surfIN.internalSurfaceTtoW1 = IN.tSpace1.xyz;
- surfIN.internalSurfaceTtoW2 = IN.tSpace2.xyz;
- SurfaceOutputStandard o;
- UNITY_INITIALIZE_OUTPUT( SurfaceOutputStandard, o )
- surf( surfIN, o );
- #if defined( CAN_SKIP_VPOS )
- float2 vpos = IN.pos;
- #endif
- SHADOW_CASTER_FRAGMENT( IN )
- }
- ENDCG
- }
- }
- Fallback "Diffuse"
- CustomEditor "ASEMaterialInspector"
- }
- /*ASEBEGIN
- Version=16200
- 2567;32;2546;1397;2324.105;642.5294;1.220396;True;False
- Node;AmplifyShaderEditor.CommentaryNode;70;-1673.343,686.0548;Float;False;1576;713;Rim;10;45;46;47;48;49;50;53;52;51;54;;1,1,1,1;0;0
- Node;AmplifyShaderEditor.CommentaryNode;71;-1662.508,-781.329;Float;False;1766.6;1423.4;Color;19;11;25;22;34;68;69;55;56;24;32;40;33;36;41;38;39;76;77;78;;1,1,1,1;0;0
- Node;AmplifyShaderEditor.RangedFloatNode;77;-1599.269,-294.5719;Float;False;Property;_PlanetSurfaceTiling;PlanetSurfaceTiling;3;0;Create;True;0;0;False;0;0;1;0;0;0;1;FLOAT;0
- Node;AmplifyShaderEditor.ViewDirInputsCoordNode;51;-1573.078,1062.281;Float;False;Tangent;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
- Node;AmplifyShaderEditor.RangedFloatNode;39;-1565.325,486.334;Float;False;Property;_Cloud_Falloff;Cloud_Falloff;8;0;Create;True;0;0;False;0;0;4.24;0;0;0;1;FLOAT;0
- Node;AmplifyShaderEditor.TexturePropertyNode;11;-1586.811,150.7875;Float;True;Property;_Clouds;Clouds;7;0;Create;True;0;0;False;0;None;cd460ee4ac5c1e746b7a734cc7cc64dd;False;white;Auto;Texture2D;0;1;SAMPLER2D;0
- Node;AmplifyShaderEditor.RangedFloatNode;38;-1567.476,390.2261;Float;False;Property;_Cloud_Tiling;Cloud_Tiling;9;0;Create;True;0;0;False;0;0;-3.3;0;0;0;1;FLOAT;0
- Node;AmplifyShaderEditor.TextureCoordinatesNode;78;-1507.654,-138.5063;Float;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
- Node;AmplifyShaderEditor.NormalizeNode;52;-1314.381,1077.18;Float;False;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
- Node;AmplifyShaderEditor.SamplerNode;54;-1606.078,833.2802;Float;True;Global;Normals;Normals;11;0;Create;True;0;0;False;0;None;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;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
- Node;AmplifyShaderEditor.TriplanarNode;36;-1150.284,216.6518;Float;True;Cylindrical;Object;False;Top Texture 1;_TopTexture1;white;2;None;Mid Texture 1;_MidTexture1;white;3;None;Bot Texture 1;_BotTexture1;white;5;None;Triplanar Sampler;False;9;0;SAMPLER2D;;False;5;FLOAT;1;False;1;SAMPLER2D;;False;6;FLOAT;0;False;2;SAMPLER2D;;False;7;FLOAT;0;False;8;FLOAT3;1,1,1;False;3;FLOAT;1;False;4;FLOAT;100;False;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
- Node;AmplifyShaderEditor.RangedFloatNode;41;-969.606,498.4164;Float;False;Property;_Cloud_Contrast;Cloud_Contrast;10;0;Create;True;0;0;False;0;0;1.2;0;0;0;1;FLOAT;0
- Node;AmplifyShaderEditor.SamplerNode;76;-1217.293,-259.18;Float;True;Property;_PlanetSurfaceColor;PlanetSurfaceColor;2;0;Create;True;0;0;False;0;None;67c01b19dd0b2354f932b32748d8491d;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.DotProductOpNode;53;-1116.681,960.7805;Float;False;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.RangedFloatNode;33;-1148.485,19.93264;Float;False;Property;_PlanetSurfaceContrast;PlanetSurfaceContrast;4;0;Create;True;0;0;False;0;0;-3.6;0;0;0;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleContrastOpNode;40;-714.9214,193.1523;Float;False;2;1;COLOR;0,0,0,0;False;0;FLOAT;0;False;1;COLOR;0
- Node;AmplifyShaderEditor.RangedFloatNode;69;-562.1989,361.8764;Float;False;Constant;_Float0;Float 0;17;0;Create;True;0;0;False;0;-1;0;0;0;0;1;FLOAT;0
- Node;AmplifyShaderEditor.ColorNode;25;-1042.563,-517.2394;Float;False;Property;_Second_Color;Second_Color;6;0;Create;True;0;0;False;0;0,0,0,0;0.1441393,0.4042835,0.4558824,0;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
- Node;AmplifyShaderEditor.SaturateNode;50;-952.4819,973.2805;Float;False;1;0;FLOAT;1.23;False;1;FLOAT;0
- Node;AmplifyShaderEditor.ColorNode;22;-1042.363,-698.514;Float;False;Property;_BaseColor;BaseColor;5;0;Create;True;0;0;False;0;0,0,0,0;0.1547362,0.5726225,0.7794118,0;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
- Node;AmplifyShaderEditor.SimpleContrastOpNode;32;-727.4271,-165.3801;Float;False;2;1;COLOR;0,0,0,0;False;0;FLOAT;0;False;1;COLOR;0
- Node;AmplifyShaderEditor.SimpleMultiplyOpNode;68;-437.2452,191.3373;Float;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
- Node;AmplifyShaderEditor.LerpOp;56;-412.8538,12.16079;Float;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
- Node;AmplifyShaderEditor.OneMinusNode;49;-774.4789,989.5795;Float;False;1;0;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.RangedFloatNode;47;-895.0806,1104.98;Float;False;Property;_RimPower;RimPower;1;0;Create;True;0;0;False;0;0;1.48;0;10;0;1;FLOAT;0
- Node;AmplifyShaderEditor.LerpOp;24;-460.3137,-340.9896;Float;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
- Node;AmplifyShaderEditor.PowerNode;48;-582.6812,1020.981;Float;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.ColorNode;46;-686.8806,1212.779;Float;False;Property;_RimColor;RimColor;0;0;Create;True;0;0;False;0;0,0,0,0;0.3693436,0.2705991,0.4044118,0;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
- Node;AmplifyShaderEditor.SimpleAddOpNode;55;-234.7532,-190.6395;Float;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
- Node;AmplifyShaderEditor.ClampOpNode;34;-60.48365,-334.0549;Float;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;1,1,1,0;False;1;COLOR;0
- Node;AmplifyShaderEditor.SimpleMultiplyOpNode;45;-339.2808,1083.179;Float;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
- Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;253.4892,163.7044;Float;False;True;6;Float;ASEMaterialInspector;0;0;Standard;SyntyStudios/PlanetsLines;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;ForwardOnly;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;True;0.01;0.5181034,0.4426903,0.6764706,0;VertexScale;False;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;16;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
- WireConnection;78;0;77;0
- WireConnection;52;0;51;0
- WireConnection;36;0;11;0
- WireConnection;36;1;11;0
- WireConnection;36;2;11;0
- WireConnection;36;3;38;0
- WireConnection;36;4;39;0
- WireConnection;76;1;78;0
- WireConnection;53;0;54;0
- WireConnection;53;1;52;0
- WireConnection;40;1;36;0
- WireConnection;40;0;41;0
- WireConnection;50;0;53;0
- WireConnection;32;1;76;0
- WireConnection;32;0;33;0
- WireConnection;68;0;40;0
- WireConnection;68;1;69;0
- WireConnection;56;0;22;0
- WireConnection;56;1;25;0
- WireConnection;56;2;68;0
- WireConnection;49;0;50;0
- WireConnection;24;0;22;0
- WireConnection;24;1;25;0
- WireConnection;24;2;32;0
- WireConnection;48;0;49;0
- WireConnection;48;1;47;0
- WireConnection;55;0;24;0
- WireConnection;55;1;56;0
- WireConnection;34;0;55;0
- WireConnection;45;0;48;0
- WireConnection;45;1;46;0
- WireConnection;0;0;34;0
- WireConnection;0;2;45;0
- ASEEND*/
- //CHKSM=632CFCD41DCA57B25A2A250D9400B002971ACBCF
|