mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
atmosphere sun intensity override
This commit is contained in:
parent
a77dbd161a
commit
42a21d8b13
@ -9,6 +9,7 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
private static readonly int InnerRadius = Shader.PropertyToID("_InnerRadius");
|
||||
private static readonly int OuterRadius = Shader.PropertyToID("_OuterRadius");
|
||||
private static readonly int SkyColor = Shader.PropertyToID("_SkyColor");
|
||||
private static readonly int SunIntensity = Shader.PropertyToID("_SunIntensity");
|
||||
|
||||
public static readonly List<(GameObject, Material)> Skys = new();
|
||||
|
||||
@ -41,8 +42,17 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
|
||||
atmo.SetActive(true);
|
||||
|
||||
if (atmosphereModule.atmosphereSunIntensity == 0)
|
||||
{
|
||||
// do it based on distance
|
||||
Skys.Add((planetGO, material));
|
||||
}
|
||||
else
|
||||
{
|
||||
// use the override instead
|
||||
material.SetFloat(SunIntensity, atmosphereModule.atmosphereSunIntensity);
|
||||
}
|
||||
}
|
||||
|
||||
atmoGO.transform.position = planetGO.transform.TransformPoint(Vector3.zero);
|
||||
atmoGO.SetActive(true);
|
||||
|
||||
@ -40,6 +40,15 @@ namespace NewHorizons.External.Modules
|
||||
/// </summary>
|
||||
public MColor atmosphereTint;
|
||||
|
||||
/// <summary>
|
||||
/// How intense should the sun appear in the sky.
|
||||
/// Also affects general atmosphere brightness.
|
||||
/// Default value of 1 matches Timber Hearth.
|
||||
/// If not set, this will be determined based off the distance to the sun.
|
||||
/// </summary>
|
||||
[Range(0f, double.MaxValue)]
|
||||
public float atmosphereSunIntensity;
|
||||
|
||||
/// <summary>
|
||||
/// Describes the clouds in the atmosphere
|
||||
/// </summary>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user