Graphics Settings + Disabling Minimap Asteroids
Created graphics settings data structure Added nebula quality option to graphics settings Added option to display asteroids in minimap (expensive)
This commit is contained in:
parent
bbf1d53d1c
commit
b93d2d213b
25 changed files with 1733 additions and 257 deletions
|
|
@ -254,6 +254,11 @@ public class ActionGameManager : MonoBehaviour
|
|||
|
||||
ItemManager = new ItemManager(CultCache, Settings.GameplaySettings, Debug.Log);
|
||||
ZoneRenderer.ItemManager = ItemManager;
|
||||
|
||||
// If hiding minimap asteroids, turn them off to start with
|
||||
if (!PlayerSettings.GraphicsSettings.ShowAsteroidsInMinimap)
|
||||
ZoneRenderer.ShowAsteroidUI = false;
|
||||
|
||||
// TODO: Process Stories
|
||||
|
||||
// _loadoutPath = GameDataDirectory.CreateSubdirectory("Loadouts");
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ MonoImporter:
|
|||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 54
|
||||
executionOrder: 55
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ MonoImporter:
|
|||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 53
|
||||
executionOrder: 54
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ public class PlayerSettings
|
|||
[Key(3)] public Dictionary<string, string> HashedStoryFiles = new Dictionary<string, string>();
|
||||
[Key(4)] public PlayerGameplaySettings GameplaySettings = new PlayerGameplaySettings();
|
||||
[Key(5)] public PlayerInputSettings InputSettings = new PlayerInputSettings();
|
||||
[Key(6)] public PlayerGraphicsSettings GraphicsSettings = new PlayerGraphicsSettings();
|
||||
|
||||
public string FormatTemperature(float t)
|
||||
{
|
||||
|
|
@ -56,9 +57,24 @@ public class PlayerGameplaySettings
|
|||
[Key(1)] public int SignificantDigits = 3;
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public class PlayerGraphicsSettings
|
||||
{
|
||||
[Key(0)] public Quality NebulaQuality = Quality.Normal;
|
||||
[Key(1)] public bool ShowAsteroidsInMinimap;
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public class PlayerInputSettings
|
||||
{
|
||||
[Key(0)] public Dictionary<(string action, int binding), string> InputActionMap = new Dictionary<(string action, int binding), string>();
|
||||
[Key(1)] public List<string> ActionBarInputs = new List<string>();
|
||||
}
|
||||
|
||||
public enum Quality
|
||||
{
|
||||
Low,
|
||||
Normal,
|
||||
High,
|
||||
Ultra
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@ using Random = UnityEngine.Random;
|
|||
|
||||
public class MainMenu : MonoBehaviour
|
||||
{
|
||||
public VolumeCloudRenderer CloudRenderer;
|
||||
public GameSettings Settings;
|
||||
public ConfirmationDialog Dialog;
|
||||
public bool InGame;
|
||||
|
|
@ -243,6 +244,17 @@ public class MainMenu : MonoBehaviour
|
|||
{
|
||||
_nextMenu.panel.Clear();
|
||||
_nextMenu.panel.Title.text = TitleSubtitle("graphics", "settings");
|
||||
_nextMenu.panel.AddField("Nebula Quality",
|
||||
() => (int)ActionGameManager.PlayerSettings.GraphicsSettings.NebulaQuality,
|
||||
i =>
|
||||
{
|
||||
ActionGameManager.PlayerSettings.GraphicsSettings.NebulaQuality = (Quality)i;
|
||||
CloudRenderer.quality = ActionGameManager.PlayerSettings.GraphicsSettings.NebulaQuality;
|
||||
},
|
||||
Enum.GetNames(typeof(Quality)));
|
||||
_nextMenu.panel.AddField("Show Asteroids in Minimap",
|
||||
() => ActionGameManager.PlayerSettings.GraphicsSettings.ShowAsteroidsInMinimap,
|
||||
b => ActionGameManager.PlayerSettings.GraphicsSettings.ShowAsteroidsInMinimap = b);
|
||||
_nextMenu.panel.AddButton("Back",
|
||||
() =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ using int2 = Unity.Mathematics.int2;
|
|||
public class MapRenderer : MonoBehaviour
|
||||
{
|
||||
public ActionGameManager GameManager;
|
||||
public ZoneRenderer ZoneRenderer;
|
||||
public TextMeshProUGUI Title;
|
||||
public Camera MapOverlayCamera;
|
||||
public Camera GravityCamera;
|
||||
|
|
@ -49,6 +50,10 @@ public class MapRenderer : MonoBehaviour
|
|||
TintCamera.gameObject.SetActive(true);
|
||||
InfluenceCamera.gameObject.SetActive(true);
|
||||
Title.text = $"Zone: {GameManager.Zone.GalaxyZone.Name}";
|
||||
|
||||
// If hiding minimap asteroids, turn them back on for the map screen
|
||||
if (!ActionGameManager.PlayerSettings.GraphicsSettings.ShowAsteroidsInMinimap)
|
||||
ZoneRenderer.ShowAsteroidUI = true;
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
|
|
@ -61,6 +66,10 @@ public class MapRenderer : MonoBehaviour
|
|||
GravityCamera.gameObject.SetActive(false);
|
||||
TintCamera.gameObject.SetActive(false);
|
||||
InfluenceCamera.gameObject.SetActive(false);
|
||||
|
||||
// If hiding minimap asteroids, turn them back off when leaving the map screen
|
||||
if (!ActionGameManager.PlayerSettings.GraphicsSettings.ShowAsteroidsInMinimap)
|
||||
ZoneRenderer.ShowAsteroidUI = false;
|
||||
}
|
||||
|
||||
void ReleaseTextures()
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ MonoImporter:
|
|||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
executionOrder: 51
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
|
|
|
|||
|
|
@ -29,14 +29,6 @@ public class HaltonSequence
|
|||
}
|
||||
}
|
||||
|
||||
public enum Quality
|
||||
{
|
||||
Low,
|
||||
Normal, //Low sample count
|
||||
High, //High sample count and high shadow sample count.
|
||||
Ultra
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cloud renderer post processing.
|
||||
/// </summary>
|
||||
|
|
@ -85,6 +77,8 @@ public class VolumeCloudRenderer : EffectBase
|
|||
|
||||
private void Start() {
|
||||
this.EnsureMaterial(true);
|
||||
if (Application.isPlaying)
|
||||
quality = ActionGameManager.PlayerSettings.GraphicsSettings.NebulaQuality;
|
||||
}
|
||||
|
||||
[ImageEffectOpaque]
|
||||
|
|
|
|||
|
|
@ -18,20 +18,24 @@ using static Unity.Mathematics.noise;
|
|||
[RequireComponent( typeof( Camera ) )]
|
||||
public class VolumeSampling : MonoBehaviour
|
||||
{
|
||||
public Transform GridTransform;
|
||||
public Camera GridCamera;
|
||||
public GameSettings Settings;
|
||||
private float _flowScroll;
|
||||
|
||||
public RenderTexture NebulaSurfaceHeight;
|
||||
public RenderTexture NebulaPatchHeight;
|
||||
public RenderTexture NebulaPatch;
|
||||
public RenderTexture NebulaTint;
|
||||
|
||||
private float _flowScroll;
|
||||
private Transform _gridTransform;
|
||||
|
||||
void Update()
|
||||
{
|
||||
if(_gridTransform==null)
|
||||
_gridTransform = GridCamera?.transform;
|
||||
// Shader needs to know the position and scale of cameras used to render input textures
|
||||
if(GridTransform != null)
|
||||
Shader.SetGlobalVector("_GridTransform", new Vector4(GridTransform.position.x,GridTransform.position.z,GridTransform.localScale.x));
|
||||
if(GridCamera != null)
|
||||
Shader.SetGlobalVector("_GridTransform", new Vector4(_gridTransform.position.x,_gridTransform.position.z,GridCamera.orthographicSize*2));
|
||||
|
||||
// Volumetric sampling parameters are used by several shaders
|
||||
Shader.SetGlobalTexture("_NebulaSurfaceHeight", NebulaSurfaceHeight);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ MonoImporter:
|
|||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
executionOrder: 52
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ public class ZoneRenderer : MonoBehaviour
|
|||
private IDisposable[] _perspectiveSubscriptions = new IDisposable[2];
|
||||
private List<IDisposable> _zoneSubscriptions = new List<IDisposable>();
|
||||
private PlanetObject[] _suns;
|
||||
private bool _showAsteroidUI;
|
||||
|
||||
public Dictionary<Wormhole, (GameObject gravity, CompassIcon icon)> WormholeInstances = new Dictionary<Wormhole, (GameObject, CompassIcon)>();
|
||||
private List<ItemPickup> _loot = new List<ItemPickup>();
|
||||
|
|
@ -144,6 +145,22 @@ public class ZoneRenderer : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
public bool ShowAsteroidUI
|
||||
{
|
||||
get { return _showAsteroidUI; }
|
||||
set
|
||||
{
|
||||
if (value != _showAsteroidUI)
|
||||
{
|
||||
_showAsteroidUI = value;
|
||||
foreach (var beltUI in _beltObjects.Values)
|
||||
{
|
||||
beltUI.Filter.gameObject.SetActive(_showAsteroidUI);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetIconSize(float size)
|
||||
{
|
||||
foreach(var entityInstance in EntityInstances.Values) entityInstance.MapIcon.transform.localScale = Vector3.one * size;
|
||||
|
|
@ -466,7 +483,8 @@ public class ZoneRenderer : MonoBehaviour
|
|||
Graphics.DrawMeshInstanced(meshes[i].Mesh, 0, meshes[i].Material, _beltMatrices[belt.Key][i]);
|
||||
}
|
||||
|
||||
_beltObjects[belt.Key].Update(belt.Value.Positions);
|
||||
if(_showAsteroidUI)
|
||||
_beltObjects[belt.Key].Update(belt.Value.Positions);
|
||||
}
|
||||
|
||||
foreach (var planet in Planets)
|
||||
|
|
@ -510,16 +528,15 @@ public class ZoneRenderer : MonoBehaviour
|
|||
wormhole.icon.transform.rotation = Quaternion.Euler(0, 0, Mathf.Atan2(difference.y, difference.x) * Mathf.Rad2Deg - 90);
|
||||
}
|
||||
|
||||
var fogPos = FogCameraParent.position;
|
||||
//var fogPos = FogCameraParent.position;
|
||||
SectorBoundaryBrush.material.SetFloat("_Power", Settings.PlanetSettings.ZoneDepthExponent);
|
||||
SectorBoundaryBrush.material.SetFloat("_Depth", Settings.PlanetSettings.ZoneDepth + Settings.PlanetSettings.ZoneBoundaryFog);
|
||||
var startDepth = Zone.PowerPulse(Settings.MinimapZoneGravityRange, Settings.PlanetSettings.ZoneDepthExponent) *
|
||||
Settings.PlanetSettings.ZoneDepth;
|
||||
var depthRange = Settings.PlanetSettings.ZoneDepth - startDepth + _maxDepth;
|
||||
// var startDepth = Zone.PowerPulse(Settings.MinimapZoneGravityRange, Settings.PlanetSettings.ZoneDepthExponent) *
|
||||
// Settings.PlanetSettings.ZoneDepth;
|
||||
//var depthRange = Settings.PlanetSettings.ZoneDepth - startDepth + _maxDepth;
|
||||
// MinimapGravityQuad.material.SetFloat("_StartDepth", startDepth);
|
||||
// MinimapGravityQuad.material.SetFloat("_DepthRange", depthRange);
|
||||
Shader.SetGlobalFloat("_GridOffset", Settings.PlanetSettings.ZoneBoundaryFog);
|
||||
Shader.SetGlobalVector("_GridTransform", new Vector4(fogPos.x, fogPos.z, _viewDistance * 2));
|
||||
//Shader.SetGlobalFloat("_GridOffset", Settings.PlanetSettings.ZoneBoundaryFog);
|
||||
// var gravPos = MinimapGravityQuad.transform.position;
|
||||
// gravPos.y = -Settings.PlanetSettings.ZoneDepth - _maxDepth;
|
||||
// MinimapGravityQuad.transform.position = gravPos;
|
||||
|
|
|
|||
Loading…
Reference in a new issue