Reorganize textures + colour fog/cloud ramps
BIN
NewHorizons/AssetBundle/textures/Clouds_Bottom_ramp.png
Normal file
|
After Width: | Height: | Size: 179 B |
|
Before Width: | Height: | Size: 180 B After Width: | Height: | Size: 180 B |
BIN
NewHorizons/AssetBundle/textures/FogColorRamp.png
Normal file
|
After Width: | Height: | Size: 233 B |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 4.4 MiB After Width: | Height: | Size: 4.4 MiB |
|
Before Width: | Height: | Size: 3.3 MiB After Width: | Height: | Size: 3.3 MiB |
@ -1,4 +1,4 @@
|
|||||||
using NewHorizons.External.Modules;
|
using NewHorizons.External.Modules;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using OWML.Common;
|
using OWML.Common;
|
||||||
using System;
|
using System;
|
||||||
@ -11,15 +11,18 @@ namespace NewHorizons.Builder.Atmosphere
|
|||||||
private static Shader _sphereShader = null;
|
private static Shader _sphereShader = null;
|
||||||
private static Material[] _gdCloudMaterials;
|
private static Material[] _gdCloudMaterials;
|
||||||
private static GameObject _lightningPrefab;
|
private static GameObject _lightningPrefab;
|
||||||
|
private static Texture2D _colorRamp;
|
||||||
private static readonly int Color1 = Shader.PropertyToID("_Color");
|
private static readonly int Color1 = Shader.PropertyToID("_Color");
|
||||||
private static readonly int TintColor = Shader.PropertyToID("_TintColor");
|
private static readonly int TintColor = Shader.PropertyToID("_TintColor");
|
||||||
private static readonly int MainTex = Shader.PropertyToID("_MainTex");
|
private static readonly int MainTex = Shader.PropertyToID("_MainTex");
|
||||||
private static readonly int RampTex = Shader.PropertyToID("_RampTex");
|
private static readonly int RampTex = Shader.PropertyToID("_RampTex");
|
||||||
private static readonly int CapTex = Shader.PropertyToID("_CapTex");
|
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)
|
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 (_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");
|
GameObject cloudsMainGO = new GameObject("Clouds");
|
||||||
cloudsMainGO.SetActive(false);
|
cloudsMainGO.SetActive(false);
|
||||||
@ -46,6 +49,7 @@ namespace NewHorizons.Builder.Atmosphere
|
|||||||
bottomTSRTempArray[0] = new Material(bottomTSRMaterials[0]);
|
bottomTSRTempArray[0] = new Material(bottomTSRMaterials[0]);
|
||||||
bottomTSRTempArray[0].SetColor(Color1, bottomColor);
|
bottomTSRTempArray[0].SetColor(Color1, bottomColor);
|
||||||
bottomTSRTempArray[0].SetColor(TintColor, bottomColor);
|
bottomTSRTempArray[0].SetColor(TintColor, bottomColor);
|
||||||
|
bottomTSRTempArray[0].SetTexture(ColorRamp, ImageUtilities.TintImage(_colorRamp, bottomColor));
|
||||||
|
|
||||||
bottomTSRTempArray[1] = new Material(bottomTSRMaterials[1]);
|
bottomTSRTempArray[1] = new Material(bottomTSRMaterials[1]);
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,16 @@
|
|||||||
using NewHorizons.External.Modules;
|
using NewHorizons.External.Modules;
|
||||||
|
using NewHorizons.Utility;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
namespace NewHorizons.Builder.Atmosphere
|
namespace NewHorizons.Builder.Atmosphere
|
||||||
{
|
{
|
||||||
public static class FogBuilder
|
public static class FogBuilder
|
||||||
{
|
{
|
||||||
|
private static Texture2D _ramp;
|
||||||
|
|
||||||
public static void Make(GameObject planetGO, Sector sector, AtmosphereModule atmo)
|
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");
|
GameObject fogGO = new GameObject("FogSphere");
|
||||||
fogGO.SetActive(false);
|
fogGO.SetActive(false);
|
||||||
fogGO.transform.parent = sector?.transform ?? planetGO.transform;
|
fogGO.transform.parent = sector?.transform ?? planetGO.transform;
|
||||||
@ -28,7 +33,7 @@ namespace NewHorizons.Builder.Atmosphere
|
|||||||
PFC.fogRadius = atmo.FogSize;
|
PFC.fogRadius = atmo.FogSize;
|
||||||
PFC.fogDensity = atmo.FogDensity;
|
PFC.fogDensity = atmo.FogDensity;
|
||||||
PFC.fogExponent = 1f;
|
PFC.fogExponent = 1f;
|
||||||
PFC.fogColorRampTexture = dbPlanetaryFogController.fogColorRampTexture;
|
PFC.fogColorRampTexture = atmo.FogTint == null ? _ramp : ImageUtilities.TintImage(_ramp, atmo.FogTint.ToColor());
|
||||||
PFC.fogColorRampIntensity = 1f;
|
PFC.fogColorRampIntensity = 1f;
|
||||||
PFC.fogTint = atmo.FogTint.ToColor();
|
PFC.fogTint = atmo.FogTint.ToColor();
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using NewHorizons.Components;
|
using NewHorizons.Components;
|
||||||
using NewHorizons.Components.SizeControllers;
|
using NewHorizons.Components.SizeControllers;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using OWML.Utils;
|
using OWML.Utils;
|
||||||
@ -160,7 +160,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
|
|
||||||
public static GameObject MakeStarGraphics(GameObject rootObject, Sector sector, StarModule starModule)
|
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");
|
var starGO = new GameObject("Star");
|
||||||
starGO.transform.parent = sector?.transform ?? rootObject.transform;
|
starGO.transform.parent = sector?.transform ?? rootObject.transform;
|
||||||
@ -236,7 +236,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
var colour = starModule.SupernovaTint.ToColor();
|
var colour = starModule.SupernovaTint.ToColor();
|
||||||
|
|
||||||
var supernovaMaterial = new Material(supernova._supernovaMaterial);
|
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);
|
supernovaMaterial.SetTexture(ColorRamp, ramp);
|
||||||
supernova._supernovaMaterial = supernovaMaterial;
|
supernova._supernovaMaterial = supernovaMaterial;
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using NewHorizons.Components;
|
using NewHorizons.Components;
|
||||||
using NewHorizons.External.Modules;
|
using NewHorizons.External.Modules;
|
||||||
using NewHorizons.Handlers;
|
using NewHorizons.Handlers;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
@ -55,11 +55,11 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
if (_mainTexture == null)
|
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)
|
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;
|
Vector3 position;
|
||||||
|
|||||||