diff --git a/.gitignore b/.gitignore index 98112ec..1b54988 100644 --- a/.gitignore +++ b/.gitignore @@ -505,4 +505,8 @@ MigrationBackup/ # End of https://www.toptal.com/developers/gitignore/api/unity,rider,visualstudio,visualstudiocode -.DS_Store \ No newline at end of file +.DS_Store + +# I am not sure about the liscense of these shaders +Assets/Plugins/WaterShaders/ +Assets/Plugins/WaterShaders.meta \ No newline at end of file diff --git a/Assets/Scenes/World.unity b/Assets/Scenes/World.unity index 525525a..1979e34 100644 --- a/Assets/Scenes/World.unity +++ b/Assets/Scenes/World.unity @@ -4507,6 +4507,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 385efbb587b84105b268631c62e8988f, type: 3} m_Name: m_EditorClassIdentifier: + _FaceTransform: {fileID: 373691837} --- !u!4 &652638165 Transform: m_ObjectHideFlags: 0 @@ -6230,6 +6231,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 1773566604} + - component: {fileID: 1773566605} - component: {fileID: 1773566603} m_Layer: 0 m_Name: PostProcessing @@ -6270,6 +6272,21 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1773566605 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1773566602} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a2cfb4bc5c534b03b209443e5573ac32, type: 3} + m_Name: + m_EditorClassIdentifier: + _isPersistant: 0 + _main: {fileID: 11400000, guid: 4b9cedcad8dd7c44a81de7c9c9be6b54, type: 2} + _underwater: {fileID: 11400000, guid: 62f8d741270724075bf722d16dec5162, type: 2} --- !u!114 &1780912054 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Managers/PostProcessingManager.cs b/Assets/Scripts/Managers/PostProcessingManager.cs new file mode 100644 index 0000000..fd921ff --- /dev/null +++ b/Assets/Scripts/Managers/PostProcessingManager.cs @@ -0,0 +1,64 @@ +using System; +using CodeBlaze.Vloxy.Demo.Utils; +using CodeBlaze.Vloxy.Engine.Data; +using UnityEngine; +using UnityEngine.Rendering; + +namespace CodeBlaze.Vloxy.Demo.Managers { + + public enum PostProcessingMode { + MAIN, + UNDERWATER + } + + public class PostProcessingManager : SingletonBehaviour { + + [SerializeField] private VolumeProfile _main; + [SerializeField] private VolumeProfile _underwater; + + private Volume _volume; + + public PostProcessingMode Mode { get; private set; } + + private void Start() { + _volume = GetComponent(); + + SetProfileMain(); + } + + public void UpdateMode(Block block) { + switch (block) { + case Block.WATER: + if (Mode != PostProcessingMode.UNDERWATER) SetProfileUnderwater(); + break; + default: + if (Mode != PostProcessingMode.MAIN) SetProfileMain(); + break; + } + } + + private void SetProfileMain() { + _volume.profile = _main; + + var drawDistance = WorldAPI.Current.World.Settings.Chunk.DrawDistance; + + RenderSettings.fogMode = FogMode.Linear; + RenderSettings.fogEndDistance = drawDistance * 32 - 16; + + Mode = PostProcessingMode.MAIN; + } + + private void SetProfileUnderwater() { + _volume.profile = _underwater; + + var drawDistance = WorldAPI.Current.World.Settings.Chunk.DrawDistance; + + RenderSettings.fogMode = FogMode.Linear; + RenderSettings.fogEndDistance = Mathf.Max(64, drawDistance * 32 - 128); + + Mode = PostProcessingMode.UNDERWATER; + } + + } + +} \ No newline at end of file diff --git a/Assets/Scripts/Managers/PostProcessingManager.cs.meta b/Assets/Scripts/Managers/PostProcessingManager.cs.meta new file mode 100644 index 0000000..b9653f4 --- /dev/null +++ b/Assets/Scripts/Managers/PostProcessingManager.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a2cfb4bc5c534b03b209443e5573ac32 +timeCreated: 1714970851 \ No newline at end of file diff --git a/Assets/Scripts/Player/VloxyInputController.cs b/Assets/Scripts/Player/VloxyInputController.cs index 6632641..191ce5f 100644 --- a/Assets/Scripts/Player/VloxyInputController.cs +++ b/Assets/Scripts/Player/VloxyInputController.cs @@ -7,20 +7,22 @@ namespace CodeBlaze.Vloxy.Demo.Player { public class VloxyInputController : MonoBehaviour { - + + [SerializeField] private Transform _FaceTransform; + private VloxyInput.PlayerActions _PlayerMap; private VloxyCharacterInteractions _CharacterInteractions; private VloxyCharacterController _CharacterController; private VloxyCameraController _CameraController; - + private void Awake() { _CharacterInteractions = GetComponent(); - + _CharacterController = GetComponentInChildren(); _CameraController = GetComponentInChildren(); } - + private void Update() { if (Keyboard.current[Key.P].wasPressedThisFrame) { if (_PlayerMap.enabled) { @@ -29,7 +31,12 @@ private void Update() { _PlayerMap.Enable(); } } - + + // TODO : This prints warnings for the first few frames, as the chunk isn't loaded + PostProcessingManager.Current.UpdateMode( + WorldAPI.Current.World.ChunkManager.GetBlock(Vector3Int.FloorToInt(_FaceTransform.position)) + ); + CharacterInput(); } @@ -39,14 +46,14 @@ private void LateUpdate() { private void OnEnable() { _PlayerMap = GameManager.Current.InputMaps.Player; - + _PlayerMap.Enable(); - + _PlayerMap.Toggle.performed += ToggleOnPerformed; _PlayerMap.Quit.performed += QuitOnPerformed; _PlayerMap.BreakBlock.performed += BreakBlockOnPerformed; _PlayerMap.PlaceBlock.performed += PlaceBlockOnPerformed; - + Cursor.lockState = CursorLockMode.Locked; } @@ -69,24 +76,24 @@ private void QuitOnPerformed(InputAction.CallbackContext obj) { #if !UNITY_EDITOR SceneManager.LoadScene(0); #endif - + #if UNITY_EDITOR // Application.Quit(); // UnityEditor.EditorApplication.isPlaying = false; #endif } - + private void BreakBlockOnPerformed(InputAction.CallbackContext obj) { _CharacterInteractions.BreakBlock(); } - + private void PlaceBlockOnPerformed(InputAction.CallbackContext obj) { _CharacterInteractions.PlaceBlock(); } - + private void CharacterInput() { if (!_PlayerMap.enabled) return; - + var move = _PlayerMap.Move.ReadValue(); var input = new VloxyCharacterController.Input { diff --git a/Assets/Settings/URP/UrpPostProcessingProfile.asset b/Assets/Settings/URP/Main.asset similarity index 98% rename from Assets/Settings/URP/UrpPostProcessingProfile.asset rename to Assets/Settings/URP/Main.asset index cd38f83..8cedfcb 100644 --- a/Assets/Settings/URP/UrpPostProcessingProfile.asset +++ b/Assets/Settings/URP/Main.asset @@ -63,7 +63,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3} - m_Name: UrpPostProcessingProfile + m_Name: Main m_EditorClassIdentifier: components: - {fileID: 3870444541769218594} diff --git a/Assets/Settings/URP/UrpPostProcessingProfile.asset.meta b/Assets/Settings/URP/Main.asset.meta similarity index 100% rename from Assets/Settings/URP/UrpPostProcessingProfile.asset.meta rename to Assets/Settings/URP/Main.asset.meta diff --git a/Assets/Settings/URP/Underwater.asset b/Assets/Settings/URP/Underwater.asset new file mode 100644 index 0000000..f4196c4 --- /dev/null +++ b/Assets/Settings/URP/Underwater.asset @@ -0,0 +1,163 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-6692942426037315030 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5485954d14dfb9a4c8ead8edb0ded5b1, type: 3} + m_Name: LiftGammaGain + m_EditorClassIdentifier: + active: 1 + lift: + m_OverrideState: 1 + m_Value: {x: 0, y: 0.7071836, z: 1, w: 0} + gamma: + m_OverrideState: 1 + m_Value: {x: 0, y: 0.82316446, z: 1, w: 0} + gain: + m_OverrideState: 1 + m_Value: {x: 0, y: 0.7773938, z: 1, w: 0} +--- !u!114 &-6644755081694344559 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 899c54efeace73346a0a16faa3afe726, type: 3} + m_Name: Vignette + m_EditorClassIdentifier: + active: 1 + color: + m_OverrideState: 1 + m_Value: {r: 0, g: 0, b: 0, a: 1} + center: + m_OverrideState: 1 + m_Value: {x: 0.5, y: 0.5} + intensity: + m_OverrideState: 1 + m_Value: 0.4 + smoothness: + m_OverrideState: 1 + m_Value: 0.1 + rounded: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &-942842996603021615 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 29fa0085f50d5e54f8144f766051a691, type: 3} + m_Name: FilmGrain + m_EditorClassIdentifier: + active: 1 + type: + m_OverrideState: 1 + m_Value: 0 + intensity: + m_OverrideState: 1 + m_Value: 0.1 + response: + m_OverrideState: 1 + m_Value: 0.8 + texture: + m_OverrideState: 1 + m_Value: {fileID: 0} +--- !u!114 &-905501839028520348 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66f335fb1ffd8684294ad653bf1c7564, type: 3} + m_Name: ColorAdjustments + m_EditorClassIdentifier: + active: 1 + postExposure: + m_OverrideState: 0 + m_Value: 0 + contrast: + m_OverrideState: 0 + m_Value: -3.1 + colorFilter: + m_OverrideState: 0 + m_Value: {r: 1, g: 1, b: 1, a: 1} + hueShift: + m_OverrideState: 1 + m_Value: 26 + saturation: + m_OverrideState: 1 + m_Value: 100 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3} + m_Name: Underwater + m_EditorClassIdentifier: + components: + - {fileID: 3870444541769218594} + - {fileID: -6644755081694344559} + - {fileID: -942842996603021615} + - {fileID: -6692942426037315030} + - {fileID: -905501839028520348} +--- !u!114 &3870444541769218594 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 97c23e3b12dc18c42a140437e53d3951, type: 3} + m_Name: Tonemapping + m_EditorClassIdentifier: + active: 1 + mode: + m_OverrideState: 1 + m_Value: 2 + neutralHDRRangeReductionMode: + m_OverrideState: 0 + m_Value: 2 + acesPreset: + m_OverrideState: 0 + m_Value: 3 + hueShiftAmount: + m_OverrideState: 0 + m_Value: 0 + detectPaperWhite: + m_OverrideState: 0 + m_Value: 0 + paperWhite: + m_OverrideState: 0 + m_Value: 300 + detectBrightnessLimits: + m_OverrideState: 0 + m_Value: 1 + minNits: + m_OverrideState: 0 + m_Value: 0.005 + maxNits: + m_OverrideState: 0 + m_Value: 1000 diff --git a/Assets/Settings/URP/Underwater.asset.meta b/Assets/Settings/URP/Underwater.asset.meta new file mode 100644 index 0000000..043ac38 --- /dev/null +++ b/Assets/Settings/URP/Underwater.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 62f8d741270724075bf722d16dec5162 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Settings/URP/UniversalRenderPipelineAsset.asset b/Assets/Settings/URP/UniversalRenderPipelineAsset.asset index 8373f57..c88c388 100644 --- a/Assets/Settings/URP/UniversalRenderPipelineAsset.asset +++ b/Assets/Settings/URP/UniversalRenderPipelineAsset.asset @@ -104,6 +104,10 @@ MonoBehaviour: m_PrefilterDBufferMRT1: 1 m_PrefilterDBufferMRT2: 1 m_PrefilterDBufferMRT3: 1 + m_PrefilterSoftShadowsQualityLow: 1 + m_PrefilterSoftShadowsQualityMedium: 1 + m_PrefilterSoftShadowsQualityHigh: 1 + m_PrefilterSoftShadows: 0 m_PrefilterScreenCoord: 1 m_PrefilterNativeRenderPass: 1 m_ShaderVariantLogLevel: 0 diff --git a/Packages/io.codeblaze.vloxyengine/Editor/NoiseEditor.cs b/Packages/io.codeblaze.vloxyengine/Editor/NoiseEditor.cs index 851450f..41431d7 100644 --- a/Packages/io.codeblaze.vloxyengine/Editor/NoiseEditor.cs +++ b/Packages/io.codeblaze.vloxyengine/Editor/NoiseEditor.cs @@ -17,11 +17,9 @@ public class NoiseEditor : UnityEditor.Editor { private void OnEnable() { Image = new Texture2D(256, 256); - - UpdatePreview(); } - private void UpdatePreview() { + private void GeneratePreview() { var settings = (NoiseSettings) target; NoiseProfile = new NoiseProfile(new NoiseProfile.Settings { @@ -54,17 +52,20 @@ public override void OnInspectorGUI() { DrawDefaultInspector(); + EditorGUILayout.Separator(); EditorGUILayout.LabelField("Preview"); - PreviewScale = Mathf.RoundToInt(EditorGUILayout.Slider("Scale", PreviewScale, 1f, 100f)); - if (EditorGUI.EndChangeCheck()) UpdatePreview(); + PreviewScale = Mathf.RoundToInt(EditorGUILayout.Slider("Scale", PreviewScale, 1f, 100f)); + EditorGUILayout.Separator(); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Label(Image); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); + + if (GUILayout.Button( "Update Preview")) GeneratePreview(); } } diff --git a/Packages/io.codeblaze.vloxyengine/Runtime/Engine/Components/ChunkManager.cs b/Packages/io.codeblaze.vloxyengine/Runtime/Engine/Components/ChunkManager.cs index 9880b37..5b77d9d 100644 --- a/Packages/io.codeblaze.vloxyengine/Runtime/Engine/Components/ChunkManager.cs +++ b/Packages/io.codeblaze.vloxyengine/Runtime/Engine/Components/ChunkManager.cs @@ -44,6 +44,20 @@ internal ChunkManager(VloxySettings settings) { #region API + public Block GetBlock(Vector3Int position) { + var chunk_pos = VloxyUtils.GetChunkCoords(position); + var block_pos = VloxyUtils.GetBlockIndex(position); + + if (!_Chunks.ContainsKey(chunk_pos)) { + VloxyLogger.Warn($"Chunk : {chunk_pos} not loaded"); + return Block.ERROR; + } + + var chunk = _Chunks[chunk_pos]; + + return (Block) chunk.GetBlock(block_pos); + } + /// /// Set a block at a position /// diff --git a/Packages/io.codeblaze.vloxyengine/Runtime/Engine/Jobs/Collider/ColliderBuildScheduler.cs b/Packages/io.codeblaze.vloxyengine/Runtime/Engine/Jobs/Collider/ColliderBuildScheduler.cs index 522e3cc..b36f835 100644 --- a/Packages/io.codeblaze.vloxyengine/Runtime/Engine/Jobs/Collider/ColliderBuildScheduler.cs +++ b/Packages/io.codeblaze.vloxyengine/Runtime/Engine/Jobs/Collider/ColliderBuildScheduler.cs @@ -59,8 +59,17 @@ internal void Complete() { _ChunkManager.ReCollideChunk(position); if (behaviour.Mesh.vertexCount <= 0) continue; + + var triangles = behaviour.Mesh.GetTriangles(0); + + if (triangles.Length <= 0) continue; + // TODO : probably expensive mesh copy + var mesh = new UnityEngine.Mesh(); + + mesh.vertices = behaviour.Mesh.vertices; + mesh.triangles = triangles; - behaviour.Collider.sharedMesh = behaviour.Mesh; + behaviour.Collider.sharedMesh = mesh; } _Jobs.Clear(); diff --git a/Packages/io.codeblaze.vloxyengine/Runtime/Engine/Mesher/GreedyMesher.cs b/Packages/io.codeblaze.vloxyengine/Runtime/Engine/Mesher/GreedyMesher.cs index ba2d216..04693a5 100644 --- a/Packages/io.codeblaze.vloxyengine/Runtime/Engine/Mesher/GreedyMesher.cs +++ b/Packages/io.codeblaze.vloxyengine/Runtime/Engine/Mesher/GreedyMesher.cs @@ -1,5 +1,5 @@ using CodeBlaze.Vloxy.Engine.Data; - +using CodeBlaze.Vloxy.Engine.Utils.Extensions; using Unity.Burst; using Unity.Collections; using Unity.Mathematics; @@ -158,7 +158,7 @@ internal static MeshBuffer GenerateMesh( deltaAxis2[axis2] = height; // create quad - CreateQuad( + vertex_count += CreateQuad( mesh, vertex_count, currentMask, directionMask, width, height, chunkItr, @@ -167,8 +167,6 @@ internal static MeshBuffer GenerateMesh( chunkItr + deltaAxis1 + deltaAxis2 ); - vertex_count += 4; - // reset delta's deltaAxis1 = int3.zero; deltaAxis2 = int3.zero; @@ -196,20 +194,19 @@ internal static MeshBuffer GenerateMesh( } [BurstCompile] - private static void CreateQuad( + private static int CreateQuad( MeshBuffer mesh, int vertex_count, Mask mask, int3 directionMask, int width, int height, int3 v1, int3 v2, int3 v3, int3 v4 ) { - switch (mask.MeshIndex) { - case 0: CreateQuad0(mesh, vertex_count, mask, directionMask, width, height, v1, v2, v3, v4); - break; - case 1: CreateQuad1(mesh, vertex_count, mask, directionMask, width, height, v1, v2, v3, v4); - break; - } + return mask.MeshIndex switch { + 0 => CreateQuadMesh0(mesh, vertex_count, mask, directionMask, width, height, v1, v2, v3, v4), + 1 => CreateQuadMesh1(mesh, vertex_count, mask, directionMask, width, height, v1, v2, v3, v4), + _ => 0 + }; } [BurstCompile] - private static void CreateQuad0( + private static int CreateQuadMesh0( MeshBuffer mesh, int vertex_count, Mask mask, int3 directionMask, int width, int height, float3 v1, float3 v2, float3 v3, float3 v4 ) { @@ -278,6 +275,7 @@ private static void CreateQuad0( indexBuffer.Add(vertex_count); // 0 0 indexBuffer.Add(vertex_count + 2 - mask.Normal); // 1 3 indexBuffer.Add(vertex_count + 2 + mask.Normal); // 3 1 + indexBuffer.Add(vertex_count + 3); // 3 3 indexBuffer.Add(vertex_count + 1 + mask.Normal); // 2 0 indexBuffer.Add(vertex_count + 1 - mask.Normal); // 0 2 @@ -285,14 +283,17 @@ private static void CreateQuad0( indexBuffer.Add(vertex_count + 1); // 1 1 indexBuffer.Add(vertex_count + 1 + mask.Normal); // 2 0 indexBuffer.Add(vertex_count + 1 - mask.Normal); // 0 2 + indexBuffer.Add(vertex_count + 2); // 2 2 indexBuffer.Add(vertex_count + 2 - mask.Normal); // 1 3 indexBuffer.Add(vertex_count + 2 + mask.Normal); // 3 1 } + + return 4; } [BurstCompile] - private static void CreateQuad1( + private static int CreateQuadMesh1( MeshBuffer mesh, int vertex_count, Mask mask, int3 directionMask, int width, int height, float3 v1, float3 v2, float3 v3, float3 v4 ) { @@ -378,6 +379,73 @@ private static void CreateQuad1( indexBuffer.Add(vertex_count + 2 - mask.Normal); // 1 3 indexBuffer.Add(vertex_count + 2 + mask.Normal); // 3 1 } + + if ((normal != new int3(0, 1, 0)).AndReduce()) return 4; + + normal *= -1; + + // 1 Bottom Left + var vertex5 = new Vertex { + Position = v1, + Normal = normal, + UV0 = uv1, + UV1 = new float2(0, 0), + UV2 = mask.AO + }; + + // 2 Top Left + var vertex6 = new Vertex { + Position = v2, + Normal = normal, + UV0 = uv2, + UV1 = new float2(0, 1), + UV2 = mask.AO + }; + + // 3 Bottom Right + var vertex7 = new Vertex { + Position = v3, + Normal = normal, + UV0 = uv3, + UV1 = new float2(1, 0), + UV2 = mask.AO + }; + + // 4 Top Right + var vertex8 = new Vertex { + Position = v4, + Normal = normal, + UV0 = uv4, + UV1 = new float2(1, 1), + UV2 = mask.AO + }; + + mesh.VertexBuffer.Add(vertex5); + mesh.VertexBuffer.Add(vertex6); + mesh.VertexBuffer.Add(vertex7); + mesh.VertexBuffer.Add(vertex8); + + vertex_count += 4; + + if (mask.AO[0] + mask.AO[3] > mask.AO[1] + mask.AO[2]) { // + - + indexBuffer.Add(vertex_count + 2 + mask.Normal); // 3 1 + indexBuffer.Add(vertex_count + 2 - mask.Normal); // 1 3 + indexBuffer.Add(vertex_count); // 0 0 + + indexBuffer.Add(vertex_count + 1 - mask.Normal); // 0 2 + indexBuffer.Add(vertex_count + 1 + mask.Normal); // 2 0 + indexBuffer.Add(vertex_count + 3); // 3 3 + } else { // + - + indexBuffer.Add(vertex_count + 1 - mask.Normal); // 0 2 + indexBuffer.Add(vertex_count + 1 + mask.Normal); // 2 0 + indexBuffer.Add(vertex_count + 1); // 1 1 + + indexBuffer.Add(vertex_count + 2 + mask.Normal); // 3 1 + indexBuffer.Add(vertex_count + 2 - mask.Normal); // 1 3 + indexBuffer.Add(vertex_count + 2); // 2 2 + } + + return 8; } [BurstCompile] diff --git a/Packages/io.codeblaze.vloxyengine/Runtime/Engine/Noise/NoiseProfile.cs b/Packages/io.codeblaze.vloxyengine/Runtime/Engine/Noise/NoiseProfile.cs index 25b9e60..e50efb0 100644 --- a/Packages/io.codeblaze.vloxyengine/Runtime/Engine/Noise/NoiseProfile.cs +++ b/Packages/io.codeblaze.vloxyengine/Runtime/Engine/Noise/NoiseProfile.cs @@ -55,7 +55,6 @@ private int ComputeNoise(int3 position) { } public struct Settings { - public int Height; public int WaterLevel; public int Seed; @@ -63,7 +62,6 @@ public struct Settings { public float Persistance; public float Lacunarity; public int Octaves; - } } @@ -71,11 +69,9 @@ public struct Settings { [BurstCompile] [StructLayout(LayoutKind.Sequential)] public struct NoiseValue { - public int3 Position; public int WaterLevel; public int Height; - } } \ No newline at end of file diff --git a/Packages/manifest.json b/Packages/manifest.json index 2f2a535..c95ba9b 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,16 +1,16 @@ { "dependencies": { "com.tayx.graphy": "3.0.2", - "com.unity.ai.navigation": "1.1.4", - "com.unity.burst": "1.8.10", - "com.unity.collab-proxy": "2.0.7", + "com.unity.ai.navigation": "1.1.5", + "com.unity.burst": "1.8.12", + "com.unity.collab-proxy": "2.2.0", "com.unity.collections": "2.1.4", - "com.unity.ide.rider": "3.0.25", + "com.unity.ide.rider": "3.0.27", "com.unity.inputsystem": "1.7.0", - "com.unity.render-pipelines.universal": "14.0.8", + "com.unity.render-pipelines.universal": "14.0.10", "com.unity.test-framework": "1.1.33", "com.unity.textmeshpro": "3.0.6", - "com.unity.timeline": "1.7.5", + "com.unity.timeline": "1.7.6", "com.unity.ugui": "1.0.0", "com.unity.modules.ai": "1.0.0", "com.unity.modules.androidjni": "1.0.0", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index dde529a..0e90f73 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -8,7 +8,7 @@ "url": "https://package.openupm.com" }, "com.unity.ai.navigation": { - "version": "1.1.4", + "version": "1.1.5", "depth": 0, "source": "registry", "dependencies": { @@ -17,16 +17,17 @@ "url": "https://packages.unity.com" }, "com.unity.burst": { - "version": "1.8.10", + "version": "1.8.12", "depth": 0, "source": "registry", "dependencies": { - "com.unity.mathematics": "1.2.1" + "com.unity.mathematics": "1.2.1", + "com.unity.modules.jsonserialize": "1.0.0" }, "url": "https://packages.unity.com" }, "com.unity.collab-proxy": { - "version": "2.0.7", + "version": "2.2.0", "depth": 0, "source": "registry", "dependencies": {}, @@ -51,7 +52,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.rider": { - "version": "3.0.25", + "version": "3.0.27", "depth": 0, "source": "registry", "dependencies": { @@ -83,7 +84,7 @@ "url": "https://packages.unity.com" }, "com.unity.render-pipelines.core": { - "version": "14.0.8", + "version": "14.0.10", "depth": 1, "source": "builtin", "dependencies": { @@ -94,14 +95,23 @@ } }, "com.unity.render-pipelines.universal": { - "version": "14.0.8", + "version": "14.0.10", "depth": 0, "source": "builtin", "dependencies": { "com.unity.mathematics": "1.2.1", - "com.unity.burst": "1.8.4", - "com.unity.render-pipelines.core": "14.0.8", - "com.unity.shadergraph": "14.0.8" + "com.unity.burst": "1.8.9", + "com.unity.render-pipelines.core": "14.0.10", + "com.unity.shadergraph": "14.0.10", + "com.unity.render-pipelines.universal-config": "14.0.9" + } + }, + "com.unity.render-pipelines.universal-config": { + "version": "14.0.9", + "depth": 1, + "source": "builtin", + "dependencies": { + "com.unity.render-pipelines.core": "14.0.9" } }, "com.unity.searcher": { @@ -112,11 +122,11 @@ "url": "https://packages.unity.com" }, "com.unity.shadergraph": { - "version": "14.0.8", + "version": "14.0.10", "depth": 1, "source": "builtin", "dependencies": { - "com.unity.render-pipelines.core": "14.0.8", + "com.unity.render-pipelines.core": "14.0.10", "com.unity.searcher": "4.9.2" } }, @@ -141,7 +151,7 @@ "url": "https://packages.unity.com" }, "com.unity.timeline": { - "version": "1.7.5", + "version": "1.7.6", "depth": 0, "source": "registry", "dependencies": { diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 2c0f14e..ca371e5 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -48,6 +48,7 @@ PlayerSettings: defaultScreenHeightWeb: 600 m_StereoRenderingPath: 0 m_ActiveColorSpace: 0 + unsupportedMSAAFallback: 0 m_SpriteBatchVertexThreshold: 300 m_MTRendering: 1 mipStripping: 0 @@ -75,6 +76,7 @@ PlayerSettings: androidMinimumWindowWidth: 400 androidMinimumWindowHeight: 300 androidFullscreenMode: 1 + androidAutoRotationBehavior: 1 defaultIsNativeResolution: 0 macRetinaSupport: 1 runInBackground: 1 @@ -135,6 +137,8 @@ PlayerSettings: vulkanEnableLateAcquireNextImage: 0 vulkanEnableCommandBufferRecycling: 1 loadStoreDebugModeEnabled: 0 + visionOSBundleVersion: 1.0 + tvOSBundleVersion: 1.0 bundleVersion: 0.1 preloadedAssets: - {fileID: 0} @@ -148,6 +152,7 @@ PlayerSettings: isWsaHolographicRemotingEnabled: 0 enableFrameTimingStats: 0 enableOpenGLProfilerGPURecorders: 1 + allowHDRDisplaySupport: 0 useHDRDisplay: 0 hdrBitDepth: 0 m_ColorGamuts: 00000000 @@ -612,7 +617,6 @@ PlayerSettings: switchScreenResolutionBehavior: 2 switchUseCPUProfiler: 0 switchEnableFileSystemTrace: 0 - switchUseGOLDLinker: 0 switchLTOSetting: 0 switchApplicationID: 0x01004b9000490000 switchNSODependencies: @@ -742,7 +746,6 @@ PlayerSettings: switchSocketBufferEfficiency: 4 switchSocketInitializeEnabled: 1 switchNetworkInterfaceManagerInitializeEnabled: 1 - switchPlayerConnectionEnabled: 1 switchUseNewStyleFilepaths: 0 switchUseLegacyFmodPriorities: 1 switchUseMicroSleepForYield: 1 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index 88bb9cf..307ccd3 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2022.3.10f1 -m_EditorVersionWithRevision: 2022.3.10f1 (ff3792e53c62) +m_EditorVersion: 2022.3.19f1 +m_EditorVersionWithRevision: 2022.3.19f1 (244b723c30a6) diff --git a/ProjectSettings/ShaderGraphSettings.asset b/ProjectSettings/ShaderGraphSettings.asset index 9b28428..3250b06 100644 --- a/ProjectSettings/ShaderGraphSettings.asset +++ b/ProjectSettings/ShaderGraphSettings.asset @@ -12,5 +12,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: de02f9e1d18f588468e474319d09a723, type: 3} m_Name: m_EditorClassIdentifier: + shaderVariantLimit: 128 customInterpolatorErrorThreshold: 32 customInterpolatorWarningThreshold: 16