diff --git a/NewHorizons/AssetBundle/textures/Clouds_Bottom_ramp.png b/NewHorizons/AssetBundle/textures/Clouds_Bottom_ramp.png new file mode 100644 index 00000000..ad4857da Binary files /dev/null and b/NewHorizons/AssetBundle/textures/Clouds_Bottom_ramp.png differ diff --git a/NewHorizons/AssetBundle/Effects_SUN_Supernova_d.png b/NewHorizons/AssetBundle/textures/Effects_SUN_Supernova_d.png similarity index 100% rename from NewHorizons/AssetBundle/Effects_SUN_Supernova_d.png rename to NewHorizons/AssetBundle/textures/Effects_SUN_Supernova_d.png diff --git a/NewHorizons/AssetBundle/textures/FogColorRamp.png b/NewHorizons/AssetBundle/textures/FogColorRamp.png new file mode 100644 index 00000000..5bc8a0b9 Binary files /dev/null and b/NewHorizons/AssetBundle/textures/FogColorRamp.png differ diff --git a/NewHorizons/AssetBundle/StarColorOverTime.png b/NewHorizons/AssetBundle/textures/StarColorOverTime.png similarity index 100% rename from NewHorizons/AssetBundle/StarColorOverTime.png rename to NewHorizons/AssetBundle/textures/StarColorOverTime.png diff --git a/NewHorizons/AssetBundle/Tornado_BH_CycloneDetail_d.png b/NewHorizons/AssetBundle/textures/Tornado_BH_CycloneDetail_d.png similarity index 100% rename from NewHorizons/AssetBundle/Tornado_BH_CycloneDetail_d.png rename to NewHorizons/AssetBundle/textures/Tornado_BH_CycloneDetail_d.png diff --git a/NewHorizons/AssetBundle/Tornado_BH_Cyclone_02_d.png b/NewHorizons/AssetBundle/textures/Tornado_BH_Cyclone_02_d.png similarity index 100% rename from NewHorizons/AssetBundle/Tornado_BH_Cyclone_02_d.png rename to NewHorizons/AssetBundle/textures/Tornado_BH_Cyclone_02_d.png diff --git a/NewHorizons/Builder/Atmosphere/CloudsBuilder.cs b/NewHorizons/Builder/Atmosphere/CloudsBuilder.cs index b8ec7b43..43e7dc89 100644 --- a/NewHorizons/Builder/Atmosphere/CloudsBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/CloudsBuilder.cs @@ -1,4 +1,4 @@ -using NewHorizons.External.Modules; +using NewHorizons.External.Modules; using NewHorizons.Utility; using OWML.Common; using System; @@ -11,15 +11,18 @@ namespace NewHorizons.Builder.Atmosphere private static Shader _sphereShader = null; private static Material[] _gdCloudMaterials; private static GameObject _lightningPrefab; + private static Texture2D _colorRamp; private static readonly int Color1 = Shader.PropertyToID("_Color"); private static readonly int TintColor = Shader.PropertyToID("_TintColor"); private static readonly int MainTex = Shader.PropertyToID("_MainTex"); private static readonly int RampTex = Shader.PropertyToID("_RampTex"); private static readonly int CapTex = Shader.PropertyToID("_CapTex"); + private static readonly int ColorRamp = Shader.PropertyToID("_ColorRamp"); public static void Make(GameObject planetGO, Sector sector, AtmosphereModule atmo, IModBehaviour mod) { if (_lightningPrefab == null) _lightningPrefab = GameObject.Find("GiantsDeep_Body/Sector_GD/Clouds_GD/LightningGenerator_GD"); + if (_colorRamp == null) _colorRamp = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/textures/Clouds_Bottom_ramp.png"); GameObject cloudsMainGO = new GameObject("Clouds"); cloudsMainGO.SetActive(false); @@ -46,6 +49,7 @@ namespace NewHorizons.Builder.Atmosphere bottomTSRTempArray[0] = new Material(bottomTSRMaterials[0]); bottomTSRTempArray[0].SetColor(Color1, bottomColor); bottomTSRTempArray[0].SetColor(TintColor, bottomColor); + bottomTSRTempArray[0].SetTexture(ColorRamp, ImageUtilities.TintImage(_colorRamp, bottomColor)); bottomTSRTempArray[1] = new Material(bottomTSRMaterials[1]); diff --git a/NewHorizons/Builder/Atmosphere/FogBuilder.cs b/NewHorizons/Builder/Atmosphere/FogBuilder.cs index b7d3ef0f..2bf6c9a8 100644 --- a/NewHorizons/Builder/Atmosphere/FogBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/FogBuilder.cs @@ -1,11 +1,16 @@ -using NewHorizons.External.Modules; +using NewHorizons.External.Modules; +using NewHorizons.Utility; using UnityEngine; namespace NewHorizons.Builder.Atmosphere { public static class FogBuilder { + private static Texture2D _ramp; + public static void Make(GameObject planetGO, Sector sector, AtmosphereModule atmo) { + if (_ramp == null) _ramp = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/textures/FogColorRamp.png"); + GameObject fogGO = new GameObject("FogSphere"); fogGO.SetActive(false); fogGO.transform.parent = sector?.transform ?? planetGO.transform; @@ -28,7 +33,7 @@ namespace NewHorizons.Builder.Atmosphere PFC.fogRadius = atmo.FogSize; PFC.fogDensity = atmo.FogDensity; PFC.fogExponent = 1f; - PFC.fogColorRampTexture = dbPlanetaryFogController.fogColorRampTexture; + PFC.fogColorRampTexture = atmo.FogTint == null ? _ramp : ImageUtilities.TintImage(_ramp, atmo.FogTint.ToColor()); PFC.fogColorRampIntensity = 1f; PFC.fogTint = atmo.FogTint.ToColor(); diff --git a/NewHorizons/Builder/Body/StarBuilder.cs b/NewHorizons/Builder/Body/StarBuilder.cs index cfbccae0..c173eb35 100644 --- a/NewHorizons/Builder/Body/StarBuilder.cs +++ b/NewHorizons/Builder/Body/StarBuilder.cs @@ -1,4 +1,4 @@ -using NewHorizons.Components; +using NewHorizons.Components; using NewHorizons.Components.SizeControllers; using NewHorizons.Utility; using OWML.Utils; @@ -160,7 +160,7 @@ namespace NewHorizons.Builder.Body public static GameObject MakeStarGraphics(GameObject rootObject, Sector sector, StarModule starModule) { - if (_colorOverTime == null) _colorOverTime = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/StarColorOverTime.png"); + if (_colorOverTime == null) _colorOverTime = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/textures/StarColorOverTime.png"); var starGO = new GameObject("Star"); starGO.transform.parent = sector?.transform ?? rootObject.transform; @@ -236,7 +236,7 @@ namespace NewHorizons.Builder.Body var colour = starModule.SupernovaTint.ToColor(); var supernovaMaterial = new Material(supernova._supernovaMaterial); - var ramp = ImageUtilities.LerpGreyscaleImage(ImageUtilities.GetTexture(Main.Instance, "AssetBundle/Effects_SUN_Supernova_d.png"), Color.white, colour); + var ramp = ImageUtilities.LerpGreyscaleImage(ImageUtilities.GetTexture(Main.Instance, "AssetBundle/textures/Effects_SUN_Supernova_d.png"), Color.white, colour); supernovaMaterial.SetTexture(ColorRamp, ramp); supernova._supernovaMaterial = supernovaMaterial; diff --git a/NewHorizons/Builder/Props/TornadoBuilder.cs b/NewHorizons/Builder/Props/TornadoBuilder.cs index 3bbe97c3..85088554 100644 --- a/NewHorizons/Builder/Props/TornadoBuilder.cs +++ b/NewHorizons/Builder/Props/TornadoBuilder.cs @@ -1,4 +1,4 @@ -using NewHorizons.Components; +using NewHorizons.Components; using NewHorizons.External.Modules; using NewHorizons.Handlers; using NewHorizons.Utility; @@ -55,11 +55,11 @@ namespace NewHorizons.Builder.Props } if (_mainTexture == null) { - _mainTexture = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/Tornado_BH_Cyclone_02_d.png"); + _mainTexture = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/textures/Tornado_BH_Cyclone_02_d.png"); } if (_detailTexture == null) { - _detailTexture = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/Tornado_BH_CycloneDetail_d.png"); + _detailTexture = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/textures/Tornado_BH_CycloneDetail_d.png"); } Vector3 position;