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.

114 lines
6.3 KiB

4 years ago
  1. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  2. // Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
  3. // Shader created with Shader Forge v1.26
  4. // Shader Forge (c) Neat Corporation / Joachim Holmer - http://www.acegikmo.com/shaderforge/
  5. // Note: Manually altering this data may prevent you from opening it in Shader Forge
  6. /*SF_DATA;ver:1.26;sub:START;pass:START;ps:flbk:,iptp:0,cusa:False,bamd:0,lico:0,lgpr:1,limd:0,spmd:1,trmd:0,grmd:0,uamb:True,mssp:True,bkdf:False,hqlp:False,rprd:False,enco:False,rmgx:True,rpth:0,vtps:0,hqsc:True,nrmq:1,nrsp:0,vomd:0,spxs:False,tesm:0,olmd:1,culm:1,bsrc:0,bdst:0,dpts:2,wrdp:False,dith:0,rfrpo:True,rfrpn:Refraction,coma:15,ufog:False,aust:True,igpj:True,qofs:2,qpre:3,rntp:2,fgom:False,fgoc:False,fgod:False,fgor:False,fgmd:0,fgcr:0.5,fgcg:0.5,fgcb:0.5,fgca:1,fgde:0.01,fgrn:0,fgrf:300,stcl:False,stva:128,stmr:255,stmw:255,stcp:6,stps:0,stfa:0,stfz:0,ofsf:0,ofsu:0,f2p0:False,fnsp:False,fnfb:False;n:type:ShaderForge.SFN_Final,id:1,x:32701,y:32821,varname:node_1,prsc:2|emission-1494-OUT,custl-1494-OUT,voffset-8312-OUT;n:type:ShaderForge.SFN_ViewVector,id:1486,x:31147,y:32972,varname:node_1486,prsc:2;n:type:ShaderForge.SFN_Color,id:1488,x:31749,y:32534,ptovrint:False,ptlb:Atmosphere Color,ptin:_AtmosphereColor,varname:node_2430,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,c1:0.006704159,c2:0.9117647,c3:0.9117647,c4:1;n:type:ShaderForge.SFN_NormalVector,id:1489,x:31147,y:32822,prsc:2,pt:False;n:type:ShaderForge.SFN_Dot,id:1490,x:31429,y:32903,varname:node_1490,prsc:2,dt:0|A-1489-OUT,B-1486-OUT;n:type:ShaderForge.SFN_Clamp01,id:1491,x:31670,y:32903,varname:node_1491,prsc:2|IN-1490-OUT;n:type:ShaderForge.SFN_Power,id:1492,x:31884,y:32890,varname:node_1492,prsc:2|VAL-1491-OUT,EXP-1497-OUT;n:type:ShaderForge.SFN_Multiply,id:1494,x:32144,y:32672,varname:node_1494,prsc:2|A-1488-RGB,B-5402-OUT,C-1492-OUT;n:type:ShaderForge.SFN_Vector1,id:1497,x:31643,y:33074,varname:node_1497,prsc:2,v1:3;n:type:ShaderForge.SFN_Vector1,id:5402,x:31560,y:32670,varname:node_5402,prsc:2,v1:10;n:type:ShaderForge.SFN_NormalVector,id:7440,x:32308,y:33445,prsc:2,pt:False;n:type:ShaderForge.SFN_RemapRange,id:3865,x:32308,y:33282,varname:node_3865,prsc:2,frmn:0,frmx:1,tomn:0,tomx:1|IN-1089-OUT;n:type:ShaderForge.SFN_Multiply,id:8312,x:32507,y:33373,varname:node_8312,prsc:2|A-3865-OUT,B-7440-OUT;n:type:ShaderForge.SFN_Slider,id:1089,x:31906,y:33129,ptovrint:False,ptlb:Atmosphere size,ptin:_Atmospheresize,varname:node_1089,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,min:-1,cur:0,max:5;proporder:1488-1089;pass:END;sub:END;*/
  7. Shader "Exo-Planets/AtmosphereSun" {
  8. Properties {
  9. _AtmosphereColor ("Atmosphere Color", Color) = (0.006704159,0.9117647,0.9117647,1)
  10. _Atmospheresize ("Atmosphere size", Range(-1, 5)) = 0
  11. }
  12. SubShader {
  13. Tags {
  14. "IgnoreProjector"="True"
  15. "Queue"="Transparent+2"
  16. "RenderType"="Transparent"
  17. }
  18. Pass {
  19. Name "FORWARD"
  20. Tags {
  21. "LightMode"="ForwardBase"
  22. }
  23. Blend One One
  24. Cull Front
  25. ZWrite Off
  26. CGPROGRAM
  27. #pragma vertex vert
  28. #pragma fragment frag
  29. #define UNITY_PASS_FORWARDBASE
  30. #include "UnityCG.cginc"
  31. #pragma multi_compile_fwdbase
  32. #pragma exclude_renderers xbox360 ps3
  33. #pragma target 3.0
  34. uniform float4 _AtmosphereColor;
  35. uniform float _Atmospheresize;
  36. struct VertexInput {
  37. float4 vertex : POSITION;
  38. float3 normal : NORMAL;
  39. };
  40. struct VertexOutput {
  41. float4 pos : SV_POSITION;
  42. float4 posWorld : TEXCOORD0;
  43. float3 normalDir : TEXCOORD1;
  44. };
  45. VertexOutput vert (VertexInput v) {
  46. VertexOutput o = (VertexOutput)0;
  47. o.normalDir = UnityObjectToWorldNormal(-v.normal);
  48. v.vertex.xyz += ((_Atmospheresize*1.0+0.0)*v.normal);
  49. o.posWorld = mul(unity_ObjectToWorld, v.vertex);
  50. o.pos = UnityObjectToClipPos(v.vertex );
  51. return o;
  52. }
  53. float4 frag(VertexOutput i) : COLOR {
  54. i.normalDir = normalize(i.normalDir);
  55. float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
  56. float3 normalDirection = i.normalDir;
  57. ////// Lighting:
  58. ////// Emissive:
  59. float3 node_1494 = (_AtmosphereColor.rgb*10.0*pow(saturate(dot(i.normalDir,viewDirection)),3.0));
  60. float3 emissive = node_1494;
  61. float3 finalColor = emissive + node_1494;
  62. return fixed4(finalColor,1);
  63. }
  64. ENDCG
  65. }
  66. Pass {
  67. Name "ShadowCaster"
  68. Tags {
  69. "LightMode"="ShadowCaster"
  70. }
  71. Offset 1, 1
  72. CGPROGRAM
  73. #pragma vertex vert
  74. #pragma fragment frag
  75. #define UNITY_PASS_SHADOWCASTER
  76. #include "UnityCG.cginc"
  77. #include "Lighting.cginc"
  78. #pragma fragmentoption ARB_precision_hint_fastest
  79. #pragma multi_compile_shadowcaster
  80. #pragma exclude_renderers xbox360 ps3
  81. #pragma target 3.0
  82. uniform float _Atmospheresize;
  83. struct VertexInput {
  84. float4 vertex : POSITION;
  85. float3 normal : NORMAL;
  86. };
  87. struct VertexOutput {
  88. V2F_SHADOW_CASTER;
  89. float3 normalDir : TEXCOORD1;
  90. };
  91. VertexOutput vert (VertexInput v) {
  92. VertexOutput o = (VertexOutput)0;
  93. o.normalDir = UnityObjectToWorldNormal(-v.normal);
  94. v.vertex.xyz += ((_Atmospheresize*1.0+0.0)*v.normal);
  95. o.pos = UnityObjectToClipPos(v.vertex );
  96. TRANSFER_SHADOW_CASTER(o)
  97. return o;
  98. }
  99. float4 frag(VertexOutput i) : COLOR {
  100. i.normalDir = normalize(i.normalDir);
  101. float3 normalDirection = i.normalDir;
  102. SHADOW_CASTER_FRAGMENT(i)
  103. }
  104. ENDCG
  105. }
  106. }
  107. FallBack "Diffuse"
  108. CustomEditor "ShaderForgeMaterialInspector"
  109. }