Move zone presentation tuning into render settings
This commit is contained in:
parent
842760a580
commit
bc545e3f5c
4 changed files with 58 additions and 8 deletions
|
|
@ -1835,6 +1835,10 @@ static void RequireDaemonRenderQueryAuthority(string root)
|
|||
"public double MinimapAsteroidSize { get; }",
|
||||
"public AetheriaRuntimeExponentialCurve BodyIconSizeCurve { get; }",
|
||||
"public double MinimapZoneGravityRange { get; }",
|
||||
"public double AsteroidVerticalOffset { get; }",
|
||||
"public double PlanetRotationSpeed { get; }",
|
||||
"public double ZoneBoundaryPower { get; }",
|
||||
"public double ZoneBoundaryDepth { get; }",
|
||||
"public int ResolveDefaultMinimapZoomIndex()",
|
||||
"public int ResolveNextMinimapZoomIndex(int currentIndex)",
|
||||
"public double ResolveMinimapDistance(int zoomIndex)",
|
||||
|
|
@ -2009,7 +2013,8 @@ static void RequireDaemonRenderQueryAuthority(string root)
|
|||
ContainsUnitySettingsMember(zoneRenderer, "DefaultViewDistance") ||
|
||||
ContainsUnitySettingsMember(zoneRenderer, "MinimapAsteroidSize") ||
|
||||
ContainsUnitySettingsMember(zoneRenderer, "IconSize") ||
|
||||
ContainsUnitySettingsMember(zoneRenderer, "MinimapZoneGravityRange"))
|
||||
ContainsUnitySettingsMember(zoneRenderer, "MinimapZoneGravityRange") ||
|
||||
ContainsUnitySettingsMember(zoneRenderer, "PlanetRotationSpeed"))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"ZoneRenderer must initialize view/minimap presentation through shared daemon render settings instead of Unity GameSettings.");
|
||||
|
|
@ -2170,6 +2175,10 @@ static void RequireDaemonRenderQueryAuthority(string root)
|
|||
"AetheriaRuntimeDaemonRenderQueries.QueryWormholeExits(",
|
||||
"RenderSettings.WormholeDistanceRatio",
|
||||
"RenderSettings.MinimapZoneGravityRange",
|
||||
"RenderSettings.AsteroidVerticalOffset",
|
||||
"RenderSettings.PlanetRotationSpeed",
|
||||
"RenderSettings.ZoneBoundaryPower",
|
||||
"RenderSettings.ZoneBoundaryDepth",
|
||||
"AddWormhole(exit)",
|
||||
"public void AddWormhole(AetheriaRuntimeDaemonWormholeExit exit)",
|
||||
"private double DaemonSimulationTimeSeconds => _daemonZoneSnapshot?.SimulationTimeSeconds ?? 0;",
|
||||
|
|
@ -2270,7 +2279,11 @@ static void RequireDaemonRenderQueryAuthority(string root)
|
|||
"Settings.MinimapIconSize",
|
||||
"Settings.MinimapAsteroidSize",
|
||||
"Settings.IconSize",
|
||||
"Settings.MinimapZoneGravityRange"
|
||||
"Settings.MinimapZoneGravityRange",
|
||||
"Settings.PlanetSettings.AsteroidVerticalOffset",
|
||||
"Settings.PlanetRotationSpeed",
|
||||
"Settings.PlanetSettings.ZoneDepthExponent",
|
||||
"Settings.PlanetSettings.ZoneDepth + Settings.PlanetSettings.ZoneBoundaryFog"
|
||||
};
|
||||
|
||||
var missingActionGameManagerRenderSymbols = requiredActionGameManagerRenderSymbols
|
||||
|
|
@ -2283,6 +2296,27 @@ static void RequireDaemonRenderQueryAuthority(string root)
|
|||
string.Join(", ", missingActionGameManagerRenderSymbols));
|
||||
}
|
||||
|
||||
var zoneRendererPresentationSettings = new Dictionary<string, string>
|
||||
{
|
||||
["ActionGameManager.Instance.Settings.PlanetSettings.AsteroidVerticalOffset"] = "ActionGameManager.Instance.Settings.PlanetSettings.AsteroidVerticalOffset",
|
||||
["PlanetRotationSpeed"] = "Settings.PlanetRotationSpeed",
|
||||
["Settings.PlanetSettings.ZoneDepthExponent"] = "Settings.PlanetSettings.ZoneDepthExponent",
|
||||
["Settings.PlanetSettings.ZoneDepth + Settings.PlanetSettings.ZoneBoundaryFog"] = "Settings.PlanetSettings.ZoneDepth + Settings.PlanetSettings.ZoneBoundaryFog"
|
||||
};
|
||||
var survivingZoneRendererPresentationSettings = zoneRendererPresentationSettings
|
||||
.Where(symbol =>
|
||||
symbol.Key == "PlanetRotationSpeed"
|
||||
? ContainsUnitySettingsMember(zoneRenderer, symbol.Key)
|
||||
: zoneRenderer.Contains(symbol.Key, StringComparison.Ordinal))
|
||||
.Select(symbol => symbol.Value)
|
||||
.ToArray();
|
||||
if (survivingZoneRendererPresentationSettings.Length > 0)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"ZoneRenderer still reads zone presentation tuning from Unity GameSettings instead of shared daemon render settings: " +
|
||||
string.Join(", ", survivingZoneRendererPresentationSettings));
|
||||
}
|
||||
|
||||
var forbiddenRenderLoopSymbols = new[]
|
||||
{
|
||||
"Settings.GameplaySettings.TargetDetectionInfoThreshold",
|
||||
|
|
|
|||
|
|
@ -598,7 +598,11 @@ public class ActionGameManager : MonoBehaviour
|
|||
bodyIconSizeCurve.Exponent,
|
||||
bodyIconSizeCurve.Multiplier,
|
||||
bodyIconSizeCurve.Constant),
|
||||
Settings.MinimapZoneGravityRange);
|
||||
Settings.MinimapZoneGravityRange,
|
||||
Settings.PlanetSettings.AsteroidVerticalOffset,
|
||||
Settings.PlanetRotationSpeed,
|
||||
Settings.PlanetSettings.ZoneDepthExponent,
|
||||
Settings.PlanetSettings.ZoneDepth + Settings.PlanetSettings.ZoneBoundaryFog);
|
||||
}
|
||||
|
||||
private readonly (float2 direction, string name)[] _directions = {
|
||||
|
|
|
|||
|
|
@ -541,7 +541,7 @@ public class ZoneRenderer : MonoBehaviour
|
|||
// SlimeRenderer.SpawnPositions[i] = _suns[i].Body.transform.position.Flatland();
|
||||
// }
|
||||
|
||||
Shader.SetGlobalFloat("_AsteroidVerticalOffset", ActionGameManager.Instance.Settings.PlanetSettings.AsteroidVerticalOffset);
|
||||
Shader.SetGlobalFloat("_AsteroidVerticalOffset", (float)RenderSettings.AsteroidVerticalOffset);
|
||||
RefreshDaemonBodyPoses();
|
||||
RefreshDaemonAsteroidBeltPoses();
|
||||
RefreshDaemonVisibleEntityInstances();
|
||||
|
|
@ -625,7 +625,7 @@ public class ZoneRenderer : MonoBehaviour
|
|||
gasGiantObject.SunMaterial.LightingDirection = new Vector3(toParent.x, 0, toParent.y);
|
||||
}
|
||||
}
|
||||
else planet.Value.Body.transform.rotation *= Quaternion.AngleAxis(Settings.PlanetRotationSpeed, Vector3.up);
|
||||
else planet.Value.Body.transform.rotation *= Quaternion.AngleAxis((float)RenderSettings.PlanetRotationSpeed, Vector3.up);
|
||||
}
|
||||
|
||||
foreach (var entityInstance in _entityInstancesByDaemonIndex.Values)
|
||||
|
|
@ -654,8 +654,8 @@ public class ZoneRenderer : MonoBehaviour
|
|||
}
|
||||
|
||||
//var fogPos = FogCameraParent.position;
|
||||
SectorBoundaryBrush.material.SetFloat("_Power", Settings.PlanetSettings.ZoneDepthExponent);
|
||||
SectorBoundaryBrush.material.SetFloat("_Depth", Settings.PlanetSettings.ZoneDepth + Settings.PlanetSettings.ZoneBoundaryFog);
|
||||
SectorBoundaryBrush.material.SetFloat("_Power", (float)RenderSettings.ZoneBoundaryPower);
|
||||
SectorBoundaryBrush.material.SetFloat("_Depth", (float)RenderSettings.ZoneBoundaryDepth);
|
||||
var gravityBand = AetheriaRuntimeDaemonRenderQueries.QueryGravityTerrainBand(
|
||||
_daemonZoneSnapshot,
|
||||
RenderSettings.MinimapZoneGravityRange,
|
||||
|
|
|
|||
|
|
@ -70,7 +70,11 @@ namespace GameCult.Aetheria.State.Verse
|
|||
double minimapIconScale = 0.0,
|
||||
double minimapAsteroidSize = 0.0,
|
||||
AetheriaRuntimeExponentialCurve bodyIconSizeCurve = default,
|
||||
double minimapZoneGravityRange = 0.0)
|
||||
double minimapZoneGravityRange = 0.0,
|
||||
double asteroidVerticalOffset = 0.0,
|
||||
double planetRotationSpeed = 0.0,
|
||||
double zoneBoundaryPower = 0.0,
|
||||
double zoneBoundaryDepth = 0.0)
|
||||
{
|
||||
TemperatureEmissionCurve = temperatureEmissionCurve;
|
||||
LockIndicatorFrequency = lockIndicatorFrequency;
|
||||
|
|
@ -93,6 +97,10 @@ namespace GameCult.Aetheria.State.Verse
|
|||
MinimapAsteroidSize = Math.Max(0.0, minimapAsteroidSize);
|
||||
BodyIconSizeCurve = bodyIconSizeCurve;
|
||||
MinimapZoneGravityRange = Math.Max(0.0, minimapZoneGravityRange);
|
||||
AsteroidVerticalOffset = asteroidVerticalOffset;
|
||||
PlanetRotationSpeed = planetRotationSpeed;
|
||||
ZoneBoundaryPower = zoneBoundaryPower;
|
||||
ZoneBoundaryDepth = zoneBoundaryDepth;
|
||||
}
|
||||
|
||||
public AetheriaRuntimeExponentialCurve TemperatureEmissionCurve { get; }
|
||||
|
|
@ -116,6 +124,10 @@ namespace GameCult.Aetheria.State.Verse
|
|||
public double MinimapAsteroidSize { get; }
|
||||
public AetheriaRuntimeExponentialCurve BodyIconSizeCurve { get; }
|
||||
public double MinimapZoneGravityRange { get; }
|
||||
public double AsteroidVerticalOffset { get; }
|
||||
public double PlanetRotationSpeed { get; }
|
||||
public double ZoneBoundaryPower { get; }
|
||||
public double ZoneBoundaryDepth { get; }
|
||||
|
||||
public int ResolveDefaultMinimapZoomIndex()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue