GregroxMun

sun rgb template

May 11th, 2017
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.75 KB | None | 0 0
  1. @Kopernicus:FOR[WHATEVER]
  2. {
  3. @Body[Sun]
  4. {
  5.  
  6.  
  7. !COLOR,* {}
  8. COLOR
  9. {
  10. Temperature = 5800
  11. RED = 0
  12. GREEN = 0
  13. BLUE = 0
  14. }
  15.  
  16. @COLOR
  17. {
  18. // Set Temperature = Temperature \ 100
  19. @Temperature /= 100
  20. @Temperature = #$Temperature$.0
  21. @Temperature = #$Temperature[0,.]$
  22. }
  23.  
  24.  
  25.  
  26. // Calculate Red:
  27.  
  28. // If Temperature <= 66 Then
  29. @COLOR:HAS[~Temperature[>66]]
  30. {
  31. // Red = 255
  32. @RED = 1
  33. }
  34. // Else
  35. @COLOR:HAS[#Temperature[>66]]
  36. {
  37. // Red = Temperature - 60
  38. @RED = #$Temperature$
  39. @RED -= 60
  40.  
  41. // Red = 329.698727446 * (Red ^ -0.1332047592)
  42. @RED != -0.1332047592
  43. @RED *= 329.698727446
  44. @RED /= 255
  45. }
  46. // If Red < 0 Then Red = 0
  47. @COLOR:HAS[#RED[<0]]
  48. {
  49. @RED = 0
  50. }
  51. // If Red > 255 Then Red = 255
  52. @COLOR:HAS[#RED[>1]]
  53. {
  54. @RED = 1
  55. }
  56.  
  57.  
  58.  
  59. // Calculate Green:
  60.  
  61. // If Temperature <= 66 Then
  62. @COLOR:HAS[~Temperature[>66]]
  63. {
  64. // Green = Temperature
  65. // Green = 99.4708025861 * Ln(Green) - 161.1195681661
  66. // APPROX TO Green = -0.0431*Temperature^2 + 6.9703*Temperature - 0.206
  67. // REWRITE AS Green = Temperature * (-0.0431*Temperature + 6.9703) - 0.206
  68. @GREEN = #$Temperature$
  69. @GREEN *= -0.0431
  70. @GREEN += 6.9703
  71. @GREEN *= #$Temperature$
  72. @GREEN -= 0.206
  73. @GREEN /= 255
  74. }
  75. // Else
  76. @COLOR:HAS[#Temperature[>66]]
  77. {
  78. // Green = Temperature - 60
  79. @GREEN = #$Temperature$
  80. @GREEN -= 60
  81.  
  82. // Green = 288.1221695283 * (Green ^ -0.0755148492)
  83. @GREEN != -0.0755148492
  84. @GREEN *= 288.1221695283
  85. @GREEN /= 255
  86. }
  87. // If Green < 0 Then Green = 0
  88. @COLOR:HAS[#GREEN[<0]]
  89. {
  90. @GREEN = 0
  91. }
  92. // If Green > 255 Then Green = 255
  93. @COLOR:HAS[#GREEN[>1]]
  94. {
  95. @GREEN = 1
  96. }
  97.  
  98.  
  99.  
  100. // Calculate Blue:
  101.  
  102. // If Temperature >= 66 Then
  103. @COLOR:HAS[~Temperature[<66]]
  104. {
  105. // Blue = 255
  106. @BLUE = 1
  107. }
  108. // If Temperature <= 19 Then
  109. @COLOR:HAS[~Temperature[>19]]
  110. {
  111. // Blue = 0
  112. @BLUE = 0
  113. }
  114. @COLOR:HAS[#Temperature[<66],#Temperature[>19-]]
  115. {
  116. // Blue = Temperature - 10
  117. @Temperature -=10
  118.  
  119. // Blue = 138.5177312231 * Ln(Blue) - 305.0447927307
  120. // APPROX TO Blue = -0.0784*Temperature^2 + 10.274*Temperature - 73.434
  121. // REWRITE AS Blue = Temperature*(-0.0784*Temperature+10.274)-73.434
  122. @BLUE = #$Temperature$
  123. @BLUE *= -0.0784
  124. @BLUE += 10.274
  125. @BLUE *= #$Temperature$
  126. @BLUE -= 73.434
  127. @BLUE /= 255
  128.  
  129. // RESTORE Temperature
  130. @Temperature += 10
  131. }
  132. // If Blue < 0 Then Blue = 0
  133. @COLOR:HAS[#BLUE[<0]]
  134. {
  135. @BLUE = 0
  136. }
  137. // If Blue > 255 Then Blue = 255
  138. @COLOR:HAS[#BLUE[>1]]
  139. {
  140. @BLUE = 1
  141. }
  142.  
  143. // APPLY CHANGES
  144.  
  145. %ScaledVersion
  146. {
  147. %Material
  148. {
  149. %emitColor0 = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
  150. %emitColor1 = #$emitColor0$
  151. @emitColor1[*] *= 0.9
  152. %rimColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
  153. @rimColor[*] *= 1.7
  154. rimBlend = 0.8
  155. rimPower = 1
  156. %sunspotColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
  157. @sunspotCOlor[*] *= 0.01
  158. }
  159. %Light
  160. {
  161. %sunLensFlareColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
  162. @sunLensFlareColor[*] *= 0.3
  163. %IVASunColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
  164. %scaledSunlightColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
  165. %sunlightColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
  166. }
  167. %Coronas
  168. {
  169. %Corona
  170. {
  171. %Material
  172. {
  173. texture = RealisticStars/PluginData/NoCorona.png
  174. }
  175. }
  176. %Corona
  177. {
  178. %Material
  179. {
  180. texture = RealisticStars/PluginData/NoCorona.png
  181. }
  182. }
  183. }
  184. }
  185. }
  186. }
Advertisement
Add Comment
Please, Sign In to add comment