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
|
|
@ -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