From 8a17c693e455571fb0be81da43173b36612a7b2d Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Tue, 18 Jul 2023 20:59:21 -0700 Subject: [PATCH] better --- NewHorizons/Builder/Atmosphere/FogBuilder.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/NewHorizons/Builder/Atmosphere/FogBuilder.cs b/NewHorizons/Builder/Atmosphere/FogBuilder.cs index 46915f8c..8c1025bc 100644 --- a/NewHorizons/Builder/Atmosphere/FogBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/FogBuilder.cs @@ -59,9 +59,10 @@ namespace NewHorizons.Builder.Atmosphere PFC.lodFadeDistance = PFC.fogRadius * 0.5f; PFC.fogDensity = atmo.fogDensity; PFC.fogExponent = 1f; - var colorRampTexture = atmo.fogTint == null ? _ramp : ImageUtilities.TintImage(_ramp, atmo.fogTint.ToColor()); - // maybe dont tint image since this overrides? oh well - if (atmo.fogRampPath != null) colorRampTexture = ImageUtilities.GetTexture(mod, atmo.fogRampPath, wrap: false); + var colorRampTexture = + atmo.fogRampPath != null ? ImageUtilities.GetTexture(mod, atmo.fogRampPath) : + atmo.fogTint != null ? ImageUtilities.TintImage(_ramp, atmo.fogTint.ToColor()) : + _ramp; PFC.fogColorRampTexture = colorRampTexture; PFC.fogColorRampIntensity = 1f; if (atmo.fogTint != null) @@ -97,9 +98,10 @@ namespace NewHorizons.Builder.Atmosphere MR.materials = _dbImpostorMaterials; MR.allowOcclusionWhenDynamic = true; - var colorRampTexture = atmo.fogTint == null ? _ramp : ImageUtilities.TintImage(_ramp, atmo.fogTint.ToColor()); - // maybe dont tint image since this overrides? oh well - if (atmo.fogRampPath != null) colorRampTexture = ImageUtilities.GetTexture(mod, atmo.fogRampPath, wrap: false); + var colorRampTexture = + atmo.fogRampPath != null ? ImageUtilities.GetTexture(mod, atmo.fogRampPath) : + atmo.fogTint != null ? ImageUtilities.TintImage(_ramp, atmo.fogTint.ToColor()) : + _ramp; if (atmo.fogTint != null) { MR.material.SetColor(Tint, atmo.fogTint.ToColor());