mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Merge branch 'dev' of https://github.com/Outer-Wilds-New-Horizons/new-horizons into dev
This commit is contained in:
commit
1eb3e04729
@ -1,6 +1,7 @@
|
|||||||
using NewHorizons.External.Modules;
|
using NewHorizons.External.Modules;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using NewHorizons.Utility.Files;
|
using NewHorizons.Utility.Files;
|
||||||
|
using OWML.Common;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
namespace NewHorizons.Builder.Atmosphere
|
namespace NewHorizons.Builder.Atmosphere
|
||||||
{
|
{
|
||||||
@ -35,7 +36,7 @@ namespace NewHorizons.Builder.Atmosphere
|
|||||||
if (_dbImpostorMaterials == null) _dbImpostorMaterials = SearchUtilities.Find("DarkBramble_Body/Atmosphere_DB/FogLOD").GetComponent<MeshRenderer>().sharedMaterials.MakePrefabMaterials();
|
if (_dbImpostorMaterials == null) _dbImpostorMaterials = SearchUtilities.Find("DarkBramble_Body/Atmosphere_DB/FogLOD").GetComponent<MeshRenderer>().sharedMaterials.MakePrefabMaterials();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static PlanetaryFogController Make(GameObject planetGO, Sector sector, AtmosphereModule atmo)
|
public static PlanetaryFogController Make(GameObject planetGO, Sector sector, AtmosphereModule atmo, IModBehaviour mod)
|
||||||
{
|
{
|
||||||
InitPrefabs();
|
InitPrefabs();
|
||||||
|
|
||||||
@ -58,7 +59,10 @@ namespace NewHorizons.Builder.Atmosphere
|
|||||||
PFC.lodFadeDistance = PFC.fogRadius * 0.5f;
|
PFC.lodFadeDistance = PFC.fogRadius * 0.5f;
|
||||||
PFC.fogDensity = atmo.fogDensity;
|
PFC.fogDensity = atmo.fogDensity;
|
||||||
PFC.fogExponent = 1f;
|
PFC.fogExponent = 1f;
|
||||||
var colorRampTexture = atmo.fogTint == null ? _ramp : ImageUtilities.TintImage(_ramp, atmo.fogTint.ToColor());
|
var colorRampTexture =
|
||||||
|
atmo.fogRampPath != null ? ImageUtilities.GetTexture(mod, atmo.fogRampPath) :
|
||||||
|
atmo.fogTint != null ? ImageUtilities.TintImage(_ramp, atmo.fogTint.ToColor()) :
|
||||||
|
_ramp;
|
||||||
PFC.fogColorRampTexture = colorRampTexture;
|
PFC.fogColorRampTexture = colorRampTexture;
|
||||||
PFC.fogColorRampIntensity = 1f;
|
PFC.fogColorRampIntensity = 1f;
|
||||||
if (atmo.fogTint != null)
|
if (atmo.fogTint != null)
|
||||||
@ -78,7 +82,7 @@ namespace NewHorizons.Builder.Atmosphere
|
|||||||
return PFC;
|
return PFC;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Renderer MakeProxy(GameObject proxyGO, AtmosphereModule atmo)
|
public static Renderer MakeProxy(GameObject proxyGO, AtmosphereModule atmo, IModBehaviour mod)
|
||||||
{
|
{
|
||||||
InitPrefabs();
|
InitPrefabs();
|
||||||
|
|
||||||
@ -94,7 +98,10 @@ namespace NewHorizons.Builder.Atmosphere
|
|||||||
MR.materials = _dbImpostorMaterials;
|
MR.materials = _dbImpostorMaterials;
|
||||||
MR.allowOcclusionWhenDynamic = true;
|
MR.allowOcclusionWhenDynamic = true;
|
||||||
|
|
||||||
var colorRampTexture = atmo.fogTint == null ? _ramp : ImageUtilities.TintImage(_ramp, atmo.fogTint.ToColor());
|
var colorRampTexture =
|
||||||
|
atmo.fogRampPath != null ? ImageUtilities.GetTexture(mod, atmo.fogRampPath) :
|
||||||
|
atmo.fogTint != null ? ImageUtilities.TintImage(_ramp, atmo.fogTint.ToColor()) :
|
||||||
|
_ramp;
|
||||||
if (atmo.fogTint != null)
|
if (atmo.fogTint != null)
|
||||||
{
|
{
|
||||||
MR.material.SetColor(Tint, atmo.fogTint.ToColor());
|
MR.material.SetColor(Tint, atmo.fogTint.ToColor());
|
||||||
|
|||||||
@ -120,7 +120,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
|
|
||||||
if (body.Config.Atmosphere.fogSize != 0)
|
if (body.Config.Atmosphere.fogSize != 0)
|
||||||
{
|
{
|
||||||
fog = FogBuilder.MakeProxy(proxy, body.Config.Atmosphere);
|
fog = FogBuilder.MakeProxy(proxy, body.Config.Atmosphere, body.Mod);
|
||||||
fogCurveMaxVal = body.Config.Atmosphere.fogDensity;
|
fogCurveMaxVal = body.Config.Atmosphere.fogDensity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@ namespace NewHorizons.External.Modules
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// How dense the fog is, if you put fog.
|
/// How dense the fog is, if you put fog.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Range(0f, 1f)] public float fogDensity;
|
[Range(0f, double.MaxValue)] public float fogDensity;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Radius of fog sphere, independent of the atmosphere. This has to be set for there to be fog.
|
/// Radius of fog sphere, independent of the atmosphere. This has to be set for there to be fog.
|
||||||
@ -58,6 +58,12 @@ namespace NewHorizons.External.Modules
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public MColor fogTint;
|
public MColor fogTint;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Relative filepath to the fog color ramp texture, if you put fog.
|
||||||
|
/// x axis is angle to sun (left at midnight, right at noon), y axis is distance to camera (close at bottom, far at top).
|
||||||
|
/// </summary>
|
||||||
|
public string fogRampPath;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Lets you survive on the planet without a suit.
|
/// Lets you survive on the planet without a suit.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
2
NewHorizons/External/Modules/SpawnModule.cs
vendored
2
NewHorizons/External/Modules/SpawnModule.cs
vendored
@ -29,7 +29,7 @@ namespace NewHorizons.External.Modules
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Offsets the player/ship by this local vector when spawning. Used to prevent spawning in the floor. Optional: defaults to (0, 4, 0).
|
/// Offsets the player/ship by this local vector when spawning. Used to prevent spawning in the floor. Optional: defaults to (0, 4, 0).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public MVector3? offset;
|
public MVector3 offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
|
|||||||
@ -652,7 +652,7 @@ namespace NewHorizons.Handlers
|
|||||||
|
|
||||||
if (body.Config.Atmosphere.fogSize != 0)
|
if (body.Config.Atmosphere.fogSize != 0)
|
||||||
{
|
{
|
||||||
fog = FogBuilder.Make(go, sector, body.Config.Atmosphere);
|
fog = FogBuilder.Make(go, sector, body.Config.Atmosphere, body.Mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
atmosphere = AtmosphereBuilder.Make(go, sector, body.Config.Atmosphere, surfaceSize).GetComponentInChildren<LODGroup>();
|
atmosphere = AtmosphereBuilder.Make(go, sector, body.Config.Atmosphere, surfaceSize).GetComponentInChildren<LODGroup>();
|
||||||
|
|||||||
@ -345,7 +345,6 @@
|
|||||||
"type": "number",
|
"type": "number",
|
||||||
"description": "How dense the fog is, if you put fog.",
|
"description": "How dense the fog is, if you put fog.",
|
||||||
"format": "float",
|
"format": "float",
|
||||||
"maximum": 1.0,
|
|
||||||
"minimum": 0.0
|
"minimum": 0.0
|
||||||
},
|
},
|
||||||
"fogSize": {
|
"fogSize": {
|
||||||
@ -358,6 +357,10 @@
|
|||||||
"description": "Colour of fog on the planet, if you put fog.",
|
"description": "Colour of fog on the planet, if you put fog.",
|
||||||
"$ref": "#/definitions/MColor"
|
"$ref": "#/definitions/MColor"
|
||||||
},
|
},
|
||||||
|
"fogRampPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Relative filepath to the fog color ramp texture, if you put fog.\nx axis is angle to sun (left at midnight, right at noon), y axis is distance to camera (close at bottom, far at top)."
|
||||||
|
},
|
||||||
"hasOxygen": {
|
"hasOxygen": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Lets you survive on the planet without a suit."
|
"description": "Lets you survive on the planet without a suit."
|
||||||
@ -3050,14 +3053,7 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"offset": {
|
"offset": {
|
||||||
"description": "Offsets the player/ship by this local vector when spawning. Used to prevent spawning in the floor. Optional: defaults to (0, 4, 0).",
|
"description": "Offsets the player/ship by this local vector when spawning. Used to prevent spawning in the floor. Optional: defaults to (0, 4, 0).",
|
||||||
"oneOf": [
|
|
||||||
{
|
|
||||||
"type": "null"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/MVector3"
|
"$ref": "#/definitions/MVector3"
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"rotation": {
|
"rotation": {
|
||||||
"description": "Rotation of the object",
|
"description": "Rotation of the object",
|
||||||
@ -3102,14 +3098,7 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"offset": {
|
"offset": {
|
||||||
"description": "Offsets the player/ship by this local vector when spawning. Used to prevent spawning in the floor. Optional: defaults to (0, 4, 0).",
|
"description": "Offsets the player/ship by this local vector when spawning. Used to prevent spawning in the floor. Optional: defaults to (0, 4, 0).",
|
||||||
"oneOf": [
|
|
||||||
{
|
|
||||||
"type": "null"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/MVector3"
|
"$ref": "#/definitions/MVector3"
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"rotation": {
|
"rotation": {
|
||||||
"description": "Rotation of the object",
|
"description": "Rotation of the object",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user