Reorganize textures + colour fog/cloud ramps

This commit is contained in:
Nick 2022-05-22 21:51:31 -04:00
parent d42467a131
commit e1cf0a6414
10 changed files with 18 additions and 9 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

View File

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 4.4 MiB

After

Width:  |  Height:  |  Size: 4.4 MiB

View File

Before

Width:  |  Height:  |  Size: 3.3 MiB

After

Width:  |  Height:  |  Size: 3.3 MiB

View File

@ -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]);

View File

@ -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();

View File

@ -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;

View File

@ -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;