Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Kopernicus:FOR[RedGiantSun]
- {
- @Body[Sun]
- {
- @Properties
- {
- //Red Giant Branch sun, based upon page 3 of this arxiv.org paper: https://arxiv.org/pdf/0801.4031.pdf
- displayName = The Dun
- radius = 256
- mass = 0.668
- @radius *= 6.957e7
- @mass *= 1.988435e28
- description = In the ancient times, the Dun was a small, bright yellow-white orb in the Kerbin sky. At that time, the sun was in the main sequence, fusing hydrogen into helium. It's done now, so it's not really the Sun anymore, it's the monstrous, cooler, reddish Dun.
- }
- !COLOR,* {}
- COLOR
- {
- Temperature = 2602
- RED = 0
- GREEN = 0
- BLUE = 0
- }
- @COLOR
- {
- // Set Temperature = Temperature \ 100
- @Temperature /= 100
- @Temperature = #$Temperature$.0
- @Temperature = #$Temperature[0,.]$
- }
- // Calculate Red:
- // If Temperature <= 66 Then
- @COLOR:HAS[~Temperature[>66]]
- {
- // Red = 255
- @RED = 1
- }
- // Else
- @COLOR:HAS[#Temperature[>66]]
- {
- // Red = Temperature - 60
- @RED = #$Temperature$
- @RED -= 60
- // Red = 329.698727446 * (Red ^ -0.1332047592)
- @RED != -0.1332047592
- @RED *= 329.698727446
- @RED /= 255
- }
- // If Red < 0 Then Red = 0
- @COLOR:HAS[#RED[<0]]
- {
- @RED = 0
- }
- // If Red > 255 Then Red = 255
- @COLOR:HAS[#RED[>1]]
- {
- @RED = 1
- }
- // Calculate Green:
- // If Temperature <= 66 Then
- @COLOR:HAS[~Temperature[>66]]
- {
- // Green = Temperature
- // Green = 99.4708025861 * Ln(Green) - 161.1195681661
- // APPROX TO Green = -0.0431*Temperature^2 + 6.9703*Temperature - 0.206
- // REWRITE AS Green = Temperature * (-0.0431*Temperature + 6.9703) - 0.206
- @GREEN = #$Temperature$
- @GREEN *= -0.0431
- @GREEN += 6.9703
- @GREEN *= #$Temperature$
- @GREEN -= 0.206
- @GREEN /= 255
- }
- // Else
- @COLOR:HAS[#Temperature[>66]]
- {
- // Green = Temperature - 60
- @GREEN = #$Temperature$
- @GREEN -= 60
- // Green = 288.1221695283 * (Green ^ -0.0755148492)
- @GREEN != -0.0755148492
- @GREEN *= 288.1221695283
- @GREEN /= 255
- }
- // If Green < 0 Then Green = 0
- @COLOR:HAS[#GREEN[<0]]
- {
- @GREEN = 0
- }
- // If Green > 255 Then Green = 255
- @COLOR:HAS[#GREEN[>1]]
- {
- @GREEN = 1
- }
- // Calculate Blue:
- // If Temperature >= 66 Then
- @COLOR:HAS[~Temperature[<66]]
- {
- // Blue = 255
- @BLUE = 1
- }
- // If Temperature <= 19 Then
- @COLOR:HAS[~Temperature[>19]]
- {
- // Blue = 0
- @BLUE = 0
- }
- @COLOR:HAS[#Temperature[<66],#Temperature[>19]]
- {
- // Blue = Temperature - 10
- @Temperature -=10
- // Blue = 138.5177312231 * Ln(Blue) - 305.0447927307
- // APPROX TO Blue = -0.0784*Temperature^2 + 10.274*Temperature - 73.434
- // REWRITE AS Blue = Temperature*(-0.0784*Temperature+10.274)-73.434
- @BLUE = #$Temperature$
- @BLUE *= -0.0784
- @BLUE += 10.274
- @BLUE *= #$Temperature$
- @BLUE -= 73.434
- @BLUE /= 255
- // RESTORE Temperature
- @Temperature += 10
- }
- // If Blue < 0 Then Blue = 0
- @COLOR:HAS[#BLUE[<0]]
- {
- @BLUE = 0
- }
- // If Blue > 255 Then Blue = 255
- @COLOR:HAS[#BLUE[>1]]
- {
- @BLUE = 1
- }
- // APPLY CHANGES
- %Orbit
- {
- %color = #$../COLOR/RED$,$../COLOR/GREEN$,$../COLOR/BLUE$
- }
- @ScaledVersion
- {
- Material
- {
- %emitColor0 = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
- %emitColor1 = #$emitColor0$
- @emitColor1[*] *= 0.9
- %rimColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
- @rimColor[*] *= 1.7
- rimBlend = 0.8
- rimPower = 1
- %sunspotColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
- @sunspotColor[*] *= 0.01
- }
- Light
- {
- %IVASunColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
- %scaledSunlightColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
- %sunlightColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
- %sunAU = #$../../Properties/radius$
- %sunLensFlareColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
- !brightnessCurve {}
- brightnessCurve
- {
- key = 0.0000005 0 0 0
- key = 0.00001 0.007 0 0
- key = 0.0001 0.1 0 0
- key = 0.001 0.3 0 0
- key = 0.01 0.4 0 0
- key = 0.1 4 0 0
- key = 0.2 6 0 0
- key = 0.3 10 0 0
- }
- }
- Coronas
- {
- Corona
- {
- Material
- {
- texture = NowItsOver/PluginData/SwirlCorona.png
- }
- }
- Corona
- {
- Material
- {
- texture = NowItsOver/PluginData/SwirlCorona.png
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment