Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Kopernicus:FOR[WHATEVER]
- {
- @Body[Sun]
- {
- DefineStar
- {
- //Define a Main Sequence Star from mass in SmallSolar Units.
- SolarMass = 0.1
- }
- StellarProperties
- {
- mass = 1.988435e28
- @mass *= #$../DefineStar/SolarMass$
- radius = #$../DefineStar/SolarMass$
- @radius != 0.74
- @radius *= 6.957e7
- SurfaceArea = #$radius$
- @SurfaceArea != 2
- RelativeSurfaceTemperature = #$../DefineStar/SolarMass$
- @RelativeSurfaceTemperature != 0.505
- SurfaceTemperature = #$RelativeSurfaceTemperature$
- @SurfaceTemperature *= 5772
- TempRatio = #$SurfaceTemperature$
- @TempRatio /= 5772
- TempRatioToTheFourth = #$TempRatio$
- @TempRatioToTheFourth != 4
- StarLuminosity = #$TempRatioToTheFourth$
- @StarLuminosity *= #$SurfaceArea$
- SqrtStarLuminosity = #$StarLuminosity$
- @SqrtStarLuminosity != 0.5
- }
- @Properties
- {
- %mass = #$../StellarProperties/mass$
- %radius = #$../StellarProperties/radius$
- }
- !COLOR,* {}
- COLOR
- {
- Temperature = #$../StellarProperties/SurfaceTemperature$
- 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
- %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
- {
- %sunLensFlareColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
- @sunLensFlareColor[*] *= 0.3
- %IVASunColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
- %scaledSunlightColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
- %sunlightColor = #$../../COLOR/RED$,$../../COLOR/GREEN$,$../../COLOR/BLUE$
- %sunAU = #$../../StellarProperties/radius$
- !brightnessCurve {}
- brightnessCurve
- {
- key = 0.001 0 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 = RealisticStars/PluginData/NoCorona.png
- }
- }
- %Corona
- {
- %Material
- {
- texture = RealisticStars/PluginData/NoCorona.png
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement