diff --git a/NewHorizons/Builder/Body/SupernovaEffectBuilder.cs b/NewHorizons/Builder/Body/SupernovaEffectBuilder.cs index 80d6ea31..cfd57de3 100644 --- a/NewHorizons/Builder/Body/SupernovaEffectBuilder.cs +++ b/NewHorizons/Builder/Body/SupernovaEffectBuilder.cs @@ -28,6 +28,8 @@ namespace NewHorizons.Builder.Body if (currentController._atmosphere == null && atmosphere != null) currentController._atmosphere = atmosphere; + if (config.Atmosphere != null && config.Atmosphere.atmosphereSunIntensity != 0) currentController._atmosphereOrigSunIntensity = config.Atmosphere.atmosphereSunIntensity; + if (currentController._fog == null && fog != null) currentController._fog = fog; return currentController; @@ -39,6 +41,7 @@ namespace NewHorizons.Builder.Body var supernovaEffectController = supernovaController.AddComponent(); supernovaEffectController._ambientLight = ambientLight; supernovaEffectController._ambientLightOrigIntensity = config.Base.ambientLight; + if (config.Atmosphere != null && config.Atmosphere.atmosphereSunIntensity != 0) supernovaEffectController._atmosphereOrigSunIntensity = config.Atmosphere.atmosphereSunIntensity; supernovaEffectController._atmosphere = atmosphere; supernovaEffectController._atmosphereRenderer = atmosphereRenderer; supernovaEffectController._fog = fog; diff --git a/NewHorizons/Components/NHSupernovaPlanetEffectController.cs b/NewHorizons/Components/NHSupernovaPlanetEffectController.cs index b6c9fa3d..49739c43 100644 --- a/NewHorizons/Components/NHSupernovaPlanetEffectController.cs +++ b/NewHorizons/Components/NHSupernovaPlanetEffectController.cs @@ -14,6 +14,7 @@ namespace NewHorizons.Components public float _ambientLightOrigIntensity; public LODGroup _atmosphere; public Renderer _atmosphereRenderer; + public float _atmosphereOrigSunIntensity = 1; public PlanetaryFogController _fog; public Renderer _fogImpostor; public Color _fogOrigTint; @@ -114,7 +115,7 @@ namespace NewHorizons.Components if (_atmosphere != null) { - s_matPropBlock_Atmosphere.SetFloat(s_propID_SunIntensity, 1f - collapseProgress); + s_matPropBlock_Atmosphere.SetFloat(s_propID_SunIntensity, _atmosphereOrigSunIntensity * (1f - collapseProgress)); foreach (var lod in _atmosphereLODs) foreach (var renderer in lod.renderers) @@ -123,7 +124,7 @@ namespace NewHorizons.Components if (_atmosphereRenderer != null) { - s_matPropBlock_Atmosphere.SetFloat(s_propID_SunIntensity, 1f - collapseProgress); + s_matPropBlock_Atmosphere.SetFloat(s_propID_SunIntensity, _atmosphereOrigSunIntensity * (1f - collapseProgress)); _atmosphereRenderer.SetPropertyBlock(s_matPropBlock_Atmosphere); }