Advertisement
GregroxMun

Untitled

Jan 18th, 2021
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.65 KB | None | 0 0
  1. @Kopernicus:FOR[KaedithStar]
  2. {
  3. Body
  4. {
  5. name = Kaedith's Star A
  6. Template
  7. {
  8. name = Sun
  9. }
  10. Properties
  11. {
  12. radius = 3.09884e6
  13. mass = 1.24121e27
  14. description = Kaedith's Star is one of the closest stars to the Kerbin solar system. A very small, cool red dwarf star. Its discovery about a century ago is a story of drama and science, which is why two of the most popular movies of the last decade featured the star. One a science fiction flick, the other a drama-documentary.
  15. }
  16. Orbit
  17. {
  18. referenceBody = Sun
  19. semiMajorAxis = 5.506e12
  20. }
  21.  
  22. !COLOR,* {}
  23. COLOR
  24. {
  25. Temperature = 2514
  26. RED = 0
  27. GREEN = 0
  28. BLUE = 0
  29. }
  30.  
  31. @COLOR
  32. {
  33. // Set Temperature = Temperature \ 100
  34. @Temperature /= 100
  35. @Temperature = #$Temperature$.0
  36. @Temperature = #$Temperature[0,.]$
  37. }
  38.  
  39.  
  40.  
  41. // Calculate Red:
  42.  
  43. // If Temperature <= 66 Then
  44. @COLOR:HAS[~Temperature[>66]]
  45. {
  46. // Red = 255
  47. @RED = 1
  48. }
  49. // Else
  50. @COLOR:HAS[#Temperature[>66]]
  51. {
  52. // Red = Temperature - 60
  53. @RED = #$Temperature$
  54. @RED -= 60
  55.  
  56. // Red = 329.698727446 * (Red ^ -0.1332047592)
  57. @RED != -0.1332047592
  58. @RED *= 329.698727446
  59. @RED /= 255
  60. }
  61. // If Red < 0 Then Red = 0
  62. @COLOR:HAS[#RED[<0]]
  63. {
  64. @RED = 0
  65. }
  66. // If Red > 255 Then Red = 255
  67. @COLOR:HAS[#RED[>1]]
  68. {
  69. @RED = 1
  70. }
  71.  
  72.  
  73.  
  74. // Calculate Green:
  75.  
  76. // If Temperature <= 66 Then
  77. @COLOR:HAS[~Temperature[>66]]
  78. {
  79. // Green = Temperature
  80. // Green = 99.4708025861 * Ln(Green) - 161.1195681661
  81. // APPROX TO Green = -0.0431*Temperature^2 + 6.9703*Temperature - 0.206
  82. // REWRITE AS Green = Temperature * (-0.0431*Temperature + 6.9703) - 0.206
  83. @GREEN = #$Temperature$
  84. @GREEN *= -0.0431
  85. @GREEN += 6.9703
  86. @GREEN *= #$Temperature$
  87. @GREEN -= 0.206
  88. @GREEN /= 255
  89. }
  90. // Else
  91. @COLOR:HAS[#Temperature[>66]]
  92. {
  93. // Green = Temperature - 60
  94. @GREEN = #$Temperature$
  95. @GREEN -= 60
  96.  
  97. // Green = 288.1221695283 * (Green ^ -0.0755148492)
  98. @GREEN != -0.0755148492
  99. @GREEN *= 288.1221695283
  100. @GREEN /= 255
  101. }
  102. // If Green < 0 Then Green = 0
  103. @COLOR:HAS[#GREEN[<0]]
  104. {
  105. @GREEN = 0
  106. }
  107. // If Green > 255 Then Green = 255
  108. @COLOR:HAS[#GREEN[>1]]
  109. {
  110. @GREEN = 1
  111. }
  112.  
  113.  
  114.  
  115. // Calculate Blue:
  116.  
  117. // If Temperature >= 66 Then
  118. @COLOR:HAS[~Temperature[<66]]
  119. {
  120. // Blue = 255
  121. @BLUE = 1
  122. }
  123. // If Temperature <= 19 Then
  124. @COLOR:HAS[~Temperature[>19]]
  125. {
  126. // Blue = 0
  127. @BLUE = 0
  128. }
  129. @COLOR:HAS[#Temperature[<66],#Temperature[>19]]
  130. {
  131. // Blue = Temperature - 10
  132. @Temperature -=10
  133.  
  134. // Blue = 138.5177312231 * Ln(Blue) - 305.0447927307
  135. // APPROX TO Blue = -0.0784*Temperature^2 + 10.274*Temperature - 73.434
  136. // REWRITE AS Blue = Temperature*(-0.0784*Temperature+10.274)-73.434
  137. @BLUE = #$Temperature$
  138. @BLUE *= -0.0784
  139. @BLUE += 10.274
  140. @BLUE *= #$Temperature$
  141. @BLUE -= 73.434
  142. @BLUE /= 255
  143.  
  144. // RESTORE Temperature
  145. @Temperature += 10
  146. }
  147. // If Blue < 0 Then Blue = 0
  148. @COLOR:HAS[#BLUE[<0]]
  149. {
  150. @BLUE = 0
  151. }
  152. // If Blue > 255 Then Blue = 255
  153. @COLOR:HAS[#BLUE[>1]]
  154. {
  155. @BLUE = 1
  156. }
  157.  
  158. // APPLY CHANGES
  159.  
  160. %Orbit
  161. {
  162. %color = #$../COLOR/RED$,$../COLOR/GREEN$,$../COLOR/BLUE$
  163. }
  164. %ScaledVersion
  165. {
  166. %Material
  167. {
  168. %emitColor0 = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
  169. %emitColor1 = #$emitColor0$
  170. @emitColor1[*] *= 0.6
  171. %rimColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
  172. @rimColor[*] *= 1.7
  173. rimBlend = 0.8
  174. rimPower = 1.2
  175. sunspotPower = 2
  176. %sunspotColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
  177. @sunspotColor[*] *= 0.01
  178. sunspotTex = Kaedith'sStar/PluginData/AsunspotTex.png
  179. }
  180. Light
  181. {
  182. %IVASunColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
  183. %scaledSunlightColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
  184. %sunlightColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
  185. %sunAU = #$../../Properties/radius$
  186. %sunLensFlareColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
  187. scaledSunlightIntensity = 1.57
  188. sunlightIntensity = 1
  189. !brightnessCurve {}
  190. brightnessCurve
  191. {
  192. key = 0.0000005 0 0 0
  193. key = 0.00001 0.007 0 0
  194. key = 0.0001 0.1 0 0
  195. key = 0.001 0.3 0 0
  196. key = 0.01 0.4 0 0
  197. key = 0.1 4 0 0
  198. key = 0.2 6 0 0
  199. key = 0.3 10 0 0
  200. }
  201. IntensityCurve
  202. {
  203. key = 566660.010666667 1.8 -1.58825394956168E-06 -1.58825394956168E-06
  204. key = 1133320.02133333 1.27279220613579 -5.61532568990691E-07 -5.61532568990691E-07
  205. key = 2266640.04266667 0.9 -1.9853174369521E-07 -1.9853174369521E-07
  206. key = 3399960.064 0.734846922834954 -1.08066993288506E-07 -1.08066993288506E-07
  207. key = 6799920.128 0.519615242270663 -3.82074518883717E-08 -3.82074518883717E-08
  208. key = 20399760.384 0.3 -7.35302754426705E-09 -7.35302754426705E-09
  209. key = 40799520.768 0.212132034355964 -2.59968781940134E-09 -2.59968781940134E-09
  210. key = 350000000 0 -1.03466968703035E-10 0
  211. }
  212. ScaledIntensityCurve
  213. {
  214. key = 566660.010666667 1.8 -1.58825394956168E-06 -1.58825394956168E-06
  215. key = 1133320.02133333 1.27279220613579 -5.61532568990691E-07 -5.61532568990691E-07
  216. key = 2266640.04266667 0.9 -1.9853174369521E-07 -1.9853174369521E-07
  217. key = 3399960.064 0.734846922834954 -1.08066993288506E-07 -1.08066993288506E-07
  218. key = 6799920.128 0.519615242270663 -3.82074518883717E-08 -3.82074518883717E-08
  219. key = 20399760.384 0.3 -7.35302754426705E-09 -7.35302754426705E-09
  220. key = 40799520.768 0.212132034355964 -2.59968781940134E-09 -2.59968781940134E-09
  221. key = 350000000 0 -1.03466968703035E-10 0
  222. }
  223. IVAIntensityCurve
  224. {
  225. key = 566660.010666667 1.8 -1.58825394956168E-06 -1.58825394956168E-06
  226. key = 1133320.02133333 1.27279220613579 -5.61532568990691E-07 -5.61532568990691E-07
  227. key = 2266640.04266667 0.9 -1.9853174369521E-07 -1.9853174369521E-07
  228. key = 3399960.064 0.734846922834954 -1.08066993288506E-07 -1.08066993288506E-07
  229. key = 6799920.128 0.519615242270663 -3.82074518883717E-08 -3.82074518883717E-08
  230. key = 20399760.384 0.3 -7.35302754426705E-09 -7.35302754426705E-09
  231. key = 40799520.768 0.212132034355964 -2.59968781940134E-09 -2.59968781940134E-09
  232. key = 350000000 0 -1.03466968703035E-10 0
  233. }
  234. @IntensityCurve
  235. {
  236. @key,*[*, ] *= #$../sunlightIntensity$
  237. @key,*[0, ] /= #$../sunlightIntensity$
  238. }
  239. @ScaledIntensityCurve
  240. {
  241. @key,*[*, ] *= #$../sunlightIntensity$
  242. @key,*[0, ] /= #$../sunlightIntensity$
  243. }
  244. @IVAIntensityCurve
  245. {
  246. @key,*[*, ] *= #$../sunlightIntensity$
  247. @key,*[0, ] /= #$../sunlightIntensity$
  248. }
  249. }
  250. %Coronas
  251. {
  252. %Corona
  253. {
  254. %Material
  255. {
  256. texture = Kaedith'sStar/Corona/OrangeCorona
  257. }
  258. }
  259. %Corona
  260. {
  261. %Material
  262. {
  263. texture = Kaedith'sStar/Corona/OrangeCorona
  264. }
  265. }
  266. }
  267. }
  268. }
  269. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement