2025-07-25 15:29:14 +05:00

267 lines
16 KiB
Plaintext

// Made with Amplify Shader Editor v1.9.2
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polyart/Dreamscape/Builtin/Planet"
{
Properties
{
[Header(Base)]_PlanetTexture("PlanetTexture", 2D) = "white" {}
_PlanetClouds("PlanetClouds", 2D) = "white" {}
_PlanetColor("Planet Color", Color) = (1,1,1,0)
_CloudColor("Cloud Color", Color) = (1,1,1,0)
_PlanetVisibility("Planet Visibility", Float) = 1
_CloudVisibility("Cloud Visibility", Float) = 1
_PlanetSpeedX("Planet Speed X", Float) = 0.002
_CloudSpeedX("Cloud Speed X", Float) = 0.002
[Header(Light Direction)]_LightDirection("Light Direction", Color) = (1,1,1,0)
[Header(Edge Glow)]_EdgeColor("Edge Color", Color) = (1,1,1,0)
_EdgeStrength("Edge Strength", Float) = 200
_GlowAmount("Glow Amount", Float) = 1
_FresnelBias("Fresnel Bias", Float) = 0
_FresnelScale("Fresnel Scale", Float) = 0
_FresnelPower("Fresnel Power", Float) = 0
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+0" "IgnoreProjector" = "True" "IsEmissive" = "true" }
Cull Back
CGINCLUDE
#include "UnityShaderVariables.cginc"
#include "UnityPBSLighting.cginc"
#include "Lighting.cginc"
#pragma target 3.0
struct Input
{
float2 uv_texcoord;
float3 worldPos;
float3 worldNormal;
};
uniform float4 _CloudColor;
uniform sampler2D _PlanetClouds;
uniform float _CloudSpeedX;
uniform float _CloudVisibility;
uniform float4 _PlanetColor;
uniform sampler2D _PlanetTexture;
uniform float _PlanetSpeedX;
uniform float _PlanetVisibility;
uniform float4 _EdgeColor;
uniform float _EdgeStrength;
uniform float _FresnelBias;
uniform float _FresnelScale;
uniform float _FresnelPower;
uniform float4 _LightDirection;
uniform float _GlowAmount;
inline half4 LightingUnlit( SurfaceOutput s, half3 lightDir, half atten )
{
return half4 ( 0, 0, 0, s.Alpha );
}
void surf( Input i , inout SurfaceOutput o )
{
float2 appendResult5 = (float2(_CloudSpeedX , 0.0));
float2 panner6 = ( 1.0 * _Time.y * appendResult5 + i.uv_texcoord);
float2 appendResult17 = (float2(_PlanetSpeedX , 0.0));
float2 panner18 = ( _Time.y * appendResult17 + i.uv_texcoord);
float4 vTexture51 = ( ( ( _CloudColor * tex2D( _PlanetClouds, panner6 ) ) * _CloudVisibility ) + ( ( _PlanetColor * tex2D( _PlanetTexture, panner18 ) ) * _PlanetVisibility ) );
float3 ase_worldPos = i.worldPos;
float3 ase_worldViewDir = normalize( UnityWorldSpaceViewDir( ase_worldPos ) );
float3 ase_worldNormal = i.worldNormal;
float fresnelNdotV1 = dot( ase_worldNormal, ase_worldViewDir );
float fresnelNode1 = ( _FresnelBias + _FresnelScale * pow( 1.0 - fresnelNdotV1, _FresnelPower ) );
float3 ase_vertexNormal = mul( unity_WorldToObject, float4( ase_worldNormal, 0 ) );
ase_vertexNormal = normalize( ase_vertexNormal );
float dotResult36 = dot( ( 1.0 - _LightDirection ) , float4( ase_vertexNormal , 0.0 ) );
float clampResult37 = clamp( dotResult36 , 0.0 , 1.0 );
float4 temp_output_38_0 = ( ( ( _EdgeColor * _EdgeStrength ) * fresnelNode1 ) * clampResult37 );
float clampResult45 = clamp( ( pow( clampResult37 , 2.0 ) * 2.0 ) , 0.0 , 1.0 );
float4 lerpResult42 = lerp( float4( 0,0,0,0 ) , ( ( vTexture51 * temp_output_38_0 ) * _GlowAmount ) , clampResult45);
o.Emission = lerpResult42.rgb;
o.Alpha = clampResult45;
}
ENDCG
CGPROGRAM
#pragma surface surf Unlit alpha:fade keepalpha fullforwardshadows nofog
ENDCG
Pass
{
Name "ShadowCaster"
Tags{ "LightMode" = "ShadowCaster" }
ZWrite On
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
#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_GLES || SHADER_API_GLES3 || SHADER_API_METAL || SHADER_API_VULKAN )
#define CAN_SKIP_VPOS
#endif
#include "UnityCG.cginc"
#include "Lighting.cginc"
#include "UnityPBSLighting.cginc"
sampler3D _DitherMaskLOD;
struct v2f
{
V2F_SHADOW_CASTER;
float2 customPack1 : TEXCOORD1;
float3 worldPos : TEXCOORD2;
float3 worldNormal : TEXCOORD3;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
v2f vert( appdata_full v )
{
v2f o;
UNITY_SETUP_INSTANCE_ID( v );
UNITY_INITIALIZE_OUTPUT( v2f, o );
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
UNITY_TRANSFER_INSTANCE_ID( v, o );
Input customInputData;
float3 worldPos = mul( unity_ObjectToWorld, v.vertex ).xyz;
half3 worldNormal = UnityObjectToWorldNormal( v.normal );
o.worldNormal = worldNormal;
o.customPack1.xy = customInputData.uv_texcoord;
o.customPack1.xy = v.texcoord;
o.worldPos = worldPos;
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 = IN.worldPos;
half3 worldViewDir = normalize( UnityWorldSpaceViewDir( worldPos ) );
surfIN.worldPos = worldPos;
surfIN.worldNormal = IN.worldNormal;
SurfaceOutput o;
UNITY_INITIALIZE_OUTPUT( SurfaceOutput, o )
surf( surfIN, o );
#if defined( CAN_SKIP_VPOS )
float2 vpos = IN.pos;
#endif
half alphaRef = tex3D( _DitherMaskLOD, float3( vpos.xy * 0.25, o.Alpha * 0.9375 ) ).a;
clip( alphaRef - 0.01 );
SHADOW_CASTER_FRAGMENT( IN )
}
ENDCG
}
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=19200
Node;AmplifyShaderEditor.CommentaryNode;50;-4503.239,-93.39008;Inherit;False;1982.156;1409.661;Comment;24;51;7;13;22;11;21;12;23;10;9;15;3;20;18;6;14;2;47;19;5;17;48;16;4;;1,1,1,1;0;0
Node;AmplifyShaderEditor.RangedFloatNode;4;-4249.987,436.8028;Inherit;False;Property;_CloudSpeedX;Cloud Speed X;7;0;Create;True;0;0;0;False;0;False;0.002;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;16;-4180.922,1085.307;Inherit;False;Property;_PlanetSpeedX;Planet Speed X;6;0;Create;True;0;0;0;False;0;False;0.002;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;48;-4105.239,322.4302;Inherit;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.DynamicAppendNode;5;-4028.986,441.8028;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.DynamicAppendNode;17;-3959.92,1090.307;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;47;-4303.348,969.7122;Inherit;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.SimpleTimeNode;19;-3997.554,1186.958;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.PannerNode;6;-3880.987,416.8028;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
Node;AmplifyShaderEditor.PannerNode;18;-3811.921,1065.307;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
Node;AmplifyShaderEditor.TexturePropertyNode;2;-4404.794,146.7372;Inherit;True;Property;_PlanetClouds;PlanetClouds;1;0;Create;True;0;0;0;False;0;False;None;None;False;white;Auto;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1
Node;AmplifyShaderEditor.TexturePropertyNode;14;-4089.726,797.2422;Inherit;True;Property;_PlanetTexture;PlanetTexture;0;1;[Header];Create;True;1;Base;0;0;False;0;False;None;None;False;white;Auto;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1
Node;AmplifyShaderEditor.ColorNode;9;-3609.279,-43.39006;Inherit;False;Property;_CloudColor;Cloud Color;3;0;Create;True;0;0;0;False;0;False;1,1,1,0;1,1,1,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SamplerNode;3;-3692.987,150.8032;Inherit;True;Property;_TextureSample0;Texture Sample 0;1;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;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;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.ColorNode;20;-3542.214,606.1152;Inherit;False;Property;_PlanetColor;Planet Color;2;0;Create;True;0;0;0;False;0;False;1,1,1,0;1,1,1,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SamplerNode;15;-3623.921,799.3083;Inherit;True;Property;_TextureSample1;Texture Sample 1;1;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;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;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;10;-3337.268,-36.6568;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;21;-3268.203,611.8484;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.ColorNode;32;-2165.364,1323.683;Inherit;False;Property;_LightDirection;Light Direction;8;1;[Header];Create;True;1;Light Direction;0;0;False;0;False;1,1,1,0;1,1,1,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RangedFloatNode;12;-3341.489,70.17934;Inherit;False;Property;_CloudVisibility;Cloud Visibility;5;0;Create;True;0;0;0;False;0;False;1;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;23;-3273.424,718.6844;Inherit;False;Property;_PlanetVisibility;Planet Visibility;4;0;Create;True;0;0;0;False;0;False;1;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.NormalVertexDataNode;46;-2070.148,1718.816;Inherit;False;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.OneMinusNode;33;-1845.343,1327.746;Inherit;False;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;11;-3136.522,-37.07489;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.RangedFloatNode;27;-2178.882,822.9297;Inherit;False;Property;_EdgeStrength;Edge Strength;10;0;Create;True;0;0;0;False;0;False;200;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;22;-3067.456,611.4304;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.ColorNode;25;-2236.553,604.4058;Inherit;False;Property;_EdgeColor;Edge Color;9;0;Create;True;0;0;0;False;1;Header(Edge Glow);False;1,1,1,0;1,1,1,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RangedFloatNode;29;-2341.657,988.7684;Inherit;False;Property;_FresnelBias;Fresnel Bias;12;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;31;-2348.657,1141.768;Inherit;False;Property;_FresnelPower;Fresnel Power;14;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;30;-2349.657,1064.768;Inherit;False;Property;_FresnelScale;Fresnel Scale;13;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.DotProductOpNode;36;-1680.872,1393.977;Inherit;False;2;0;COLOR;0,0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;26;-1923.222,701.2476;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleAddOpNode;13;-2931.949,-36.29425;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.FresnelNode;1;-2044,949;Inherit;False;Standard;WorldNormal;ViewDir;False;False;5;0;FLOAT3;0,0,1;False;4;FLOAT3;0,0,0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;5;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;51;-2715.03,-43.13955;Inherit;False;vTexture;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;28;-1584.657,701.7684;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.ClampOpNode;37;-1482.181,1392.872;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;38;-1378.421,874.0699;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.PowerNode;43;-1164.89,1476.35;Inherit;False;False;2;0;FLOAT;0;False;1;FLOAT;2;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;52;-1238.77,217.2658;Inherit;False;51;vTexture;1;0;OBJECT;;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;24;-997.2556,389.8067;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RangedFloatNode;41;-973.808,504.6804;Inherit;False;Property;_GlowAmount;Glow Amount;11;0;Create;True;0;0;0;False;0;False;1;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;44;-898.8896,1481.35;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;2;False;1;FLOAT;0
Node;AmplifyShaderEditor.ClampOpNode;45;-692.2125,1079.517;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;40;-744.808,387.6804;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.LerpOp;42;-440.808,358.6804;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleTimeNode;7;-3872.628,543.4496;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.WorldNormalVector;35;-2147.796,1519.814;Inherit;False;True;1;0;FLOAT3;0,0,1;False;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
Node;AmplifyShaderEditor.SimpleAddOpNode;39;-1151.757,1358.927;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;-73.21096,312.6602;Float;False;True;-1;2;;0;0;Unlit;Polyart/Dreamscape/Builtin/Planet;False;False;False;False;False;False;False;False;False;True;False;False;False;False;True;False;False;False;False;False;False;Back;0;False;;0;False;;False;0;False;;0;False;;False;0;Transparent;0.5;True;True;0;False;Transparent;;Transparent;All;12;all;True;True;True;True;0;False;;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;2;15;10;25;False;0.5;True;2;5;False;;10;False;;0;0;False;;0;False;;0;False;;0;False;;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;True;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;;-1;0;False;;0;0;0;False;0.1;False;;0;False;;False;15;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;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;5;0;4;0
WireConnection;17;0;16;0
WireConnection;6;0;48;0
WireConnection;6;2;5;0
WireConnection;18;0;47;0
WireConnection;18;2;17;0
WireConnection;18;1;19;0
WireConnection;3;0;2;0
WireConnection;3;1;6;0
WireConnection;15;0;14;0
WireConnection;15;1;18;0
WireConnection;10;0;9;0
WireConnection;10;1;3;0
WireConnection;21;0;20;0
WireConnection;21;1;15;0
WireConnection;33;0;32;0
WireConnection;11;0;10;0
WireConnection;11;1;12;0
WireConnection;22;0;21;0
WireConnection;22;1;23;0
WireConnection;36;0;33;0
WireConnection;36;1;46;0
WireConnection;26;0;25;0
WireConnection;26;1;27;0
WireConnection;13;0;11;0
WireConnection;13;1;22;0
WireConnection;1;1;29;0
WireConnection;1;2;30;0
WireConnection;1;3;31;0
WireConnection;51;0;13;0
WireConnection;28;0;26;0
WireConnection;28;1;1;0
WireConnection;37;0;36;0
WireConnection;38;0;28;0
WireConnection;38;1;37;0
WireConnection;43;0;37;0
WireConnection;24;0;52;0
WireConnection;24;1;38;0
WireConnection;44;0;43;0
WireConnection;45;0;44;0
WireConnection;40;0;24;0
WireConnection;40;1;41;0
WireConnection;42;1;40;0
WireConnection;42;2;45;0
WireConnection;39;0;38;0
WireConnection;39;1;37;0
WireConnection;0;2;42;0
WireConnection;0;9;45;0
ASEEND*/
//CHKSM=512AD2AAEA9164225117FC2EBB6B64EE2DAFFA2F