Main Menu

Added Main Menu scene
Tweaked world map to incorporate secondary colors in zone icons + glowing links
Entity Serialization is now generic
Zone Serialization now includes entities
Fixed bug where wormhole traversal would unbind from player entity
Game Manager no longer spawns entities (loadout file format changed)
Wrote extension to randomly select weighted items from collections (for generating enemies)
This commit is contained in:
Reinier Vens 2021-03-13 03:23:58 +00:00
commit e6181c11dc
53 changed files with 3763 additions and 49169 deletions

View file

@ -16,58 +16,13 @@ using static Unity.Mathematics.noise;
[RequireComponent( typeof( Camera ) ), ImageEffectAllowedInSceneView]
public class VolumeSampling : MonoBehaviour
{
// public int Octaves = 4;
// public float Frequency = 1;
// public float Lacunarity = 2;
// public float Gain = .5f;
// public int NoiseTextureCount = 16;
// public int NoiseTextureSize = 32;
public Material _volMaterial;
public Transform GridTransform;
private Camera _camera;
// private Texture3D[] _noiseTextures;
// private int _currentNoiseTexture;
private void Start()
{
_camera = GetComponent<Camera>();
// _noiseTextures = new Texture3D[NoiseTextureCount];
// var samples = new Color[NoiseTextureSize * NoiseTextureSize * NoiseTextureSize];
// for (int i = 0; i < NoiseTextureCount; i++)
// {
// var iv = (float) i / NoiseTextureCount;
// var tex = new Texture3D(NoiseTextureSize,NoiseTextureSize,NoiseTextureSize, GraphicsFormat.R8_UNorm, TextureCreationFlags.None);
// tex.filterMode = FilterMode.Bilinear;
// for (int z = 0; z < NoiseTextureSize; z++)
// {
// var zf = (float) z / NoiseTextureSize;
// int zOffset = z * NoiseTextureSize * NoiseTextureSize;
// for (int y = 0; y < NoiseTextureSize; y++)
// {
// var yf = (float) y / NoiseTextureSize;
// int yOffset = y * NoiseTextureSize;
// for (int x = 0; x < NoiseTextureSize; x++)
// {
// var xf = (float) x / NoiseTextureSize;
// var index = x + yOffset + zOffset;
// float freq = Frequency, amp = 1;
// float sum = 0;
// var p = float4(xf, yf, zf, iv);
// for(int o = 0; o < Octaves; o++)
// {
// sum += (pnoise(p * freq, 1 / freq) + 1) / 2 * amp;
// freq *= Lacunarity;
// amp *= Gain;
// }
//
// samples[index] = Color.white * sum;
// }
// }
// }
// tex.SetPixels(samples);
// tex.Apply();
// _noiseTextures[i] = tex;
// }
}
[ImageEffectOpaque]
@ -79,10 +34,6 @@ public class VolumeSampling : MonoBehaviour
Graphics.Blit(source, destination);
return;
}
// _currentNoiseTexture = (_currentNoiseTexture + 1) % NoiseTextureCount;
//
// _volMaterial.SetTexture("_NoiseTex", _noiseTextures[_currentNoiseTexture]);
// Shader needs this matrix to generate world space rays
_volMaterial.SetMatrix("_CamProj", (_camera.projectionMatrix * _camera.worldToCameraMatrix).inverse);