From 79f01d73d8c7f5719ded53140cb836a153bb0278 Mon Sep 17 00:00:00 2001 From: Cameron Micka Date: Tue, 7 May 2024 14:49:11 -0700 Subject: [PATCH 1/9] Improved 2023 support. --- .../Editor/Utilities/ScreenshotUtilities.cs | 4 ++++ .../Experimental/Acrylic/Scripts/AcrylicBlurRenderPass.cs | 8 ++++---- .../Runtime/Utilities/FlyCameraController.cs | 4 ++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/com.microsoft.mrtk.graphicstools.unity/Editor/Utilities/ScreenshotUtilities.cs b/com.microsoft.mrtk.graphicstools.unity/Editor/Utilities/ScreenshotUtilities.cs index bcfa8cbe..b72810ec 100644 --- a/com.microsoft.mrtk.graphicstools.unity/Editor/Utilities/ScreenshotUtilities.cs +++ b/com.microsoft.mrtk.graphicstools.unity/Editor/Utilities/ScreenshotUtilities.cs @@ -86,7 +86,11 @@ public static bool CaptureScreenshot(string path, int superSize = 1, bool transp if (camera == null) { +#if UNITY_2023_1_OR_NEWER + camera = GameObject.FindFirstObjectByType(); +#else camera = GameObject.FindObjectOfType(); +#endif if (camera == null) { diff --git a/com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Acrylic/Scripts/AcrylicBlurRenderPass.cs b/com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Acrylic/Scripts/AcrylicBlurRenderPass.cs index 80dda26c..436b1e03 100644 --- a/com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Acrylic/Scripts/AcrylicBlurRenderPass.cs +++ b/com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Acrylic/Scripts/AcrylicBlurRenderPass.cs @@ -19,7 +19,7 @@ class AcrylicBlurRenderPass : ScriptableRenderPass { public bool setMaterialTexture = false; private string profilerLabel; -#if UNITY_6000_0_OR_NEWER +#if UNITY_2022_1_OR_NEWER private RTHandle target1; private RTHandle target2; #else @@ -96,7 +96,7 @@ public override void Configure(CommandBuffer cmd, RenderTextureDescriptor camera } } -#if UNITY_6000_0_OR_NEWER +#if UNITY_2022_1_OR_NEWER private static RenderTargetIdentifier GetIdentifier(RTHandle target) { return Shader.PropertyToID(target.name); @@ -117,7 +117,7 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData var handle = providedTexture==null ? GetIdentifier(target1) : providedTexture; var renderer = renderingData.cameraData.renderer; -#if UNITY_6000_0_OR_NEWER +#if UNITY_2022_1_OR_NEWER var colorTargetHandle = renderer.cameraColorTargetHandle; #else var colorTargetHandle = renderer.cameraColorTarget; @@ -198,7 +198,7 @@ private void SwapTempTargets() target2 = rttmp; } -#if UNITY_6000_0_OR_NEWER +#if UNITY_2022_1_OR_NEWER private void ConfigureTempRenderTarget(ref RTHandle target, string id, int width, int height, int slices, CommandBuffer cmd) { target = RTHandles.Alloc(id, name: id); diff --git a/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/FlyCameraController.cs b/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/FlyCameraController.cs index f58c390e..5281b4b8 100644 --- a/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/FlyCameraController.cs +++ b/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/FlyCameraController.cs @@ -95,7 +95,11 @@ private void OnEnable() /// private void Start() { +#if UNITY_2023_1_OR_NEWER + SubsystemManager.GetSubsystems(xrDisplaySubsystems); +#else SubsystemManager.GetInstances(xrDisplaySubsystems); +#endif } /// From 659cb08cd3e6aab0082ad84178b038c14a1fd653 Mon Sep 17 00:00:00 2001 From: Cameron Micka Date: Tue, 7 May 2024 14:50:36 -0700 Subject: [PATCH 2/9] Version bump. --- .../package.json | 4 ++-- com.microsoft.mrtk.graphicstools.unity/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/com.microsoft.mrtk.graphicstools.shadergraph.unity/package.json b/com.microsoft.mrtk.graphicstools.shadergraph.unity/package.json index 1fb199a3..26df481e 100644 --- a/com.microsoft.mrtk.graphicstools.shadergraph.unity/package.json +++ b/com.microsoft.mrtk.graphicstools.shadergraph.unity/package.json @@ -1,8 +1,8 @@ { "name": "com.microsoft.mrtk.graphicstools.shadergraph.unity", - "version": "0.6.5", + "version": "0.7.0", "displayName": "MRTK Graphics Tools Shader Graph", - "description": "Graphics tools and components for developing Mixed Reality applications in Unity Shader Graph.", + "description": "Graphics tools and components for developing Mixed Reality applications in Unity Shader Graph.", "documentationUrl": "https://aka.ms/mrtk3graphics", "msftFeatureCategory": "MRTK3", "unity": "2021.3", diff --git a/com.microsoft.mrtk.graphicstools.unity/package.json b/com.microsoft.mrtk.graphicstools.unity/package.json index 60ac32f7..e683415c 100644 --- a/com.microsoft.mrtk.graphicstools.unity/package.json +++ b/com.microsoft.mrtk.graphicstools.unity/package.json @@ -1,6 +1,6 @@ { "name": "com.microsoft.mrtk.graphicstools.unity", - "version": "0.6.9", + "version": "0.7.0", "displayName": "MRTK Graphics Tools", "description": "Graphics tools and components for developing Mixed Reality applications in Unity.", "documentationUrl": "https://aka.ms/mrtk3graphics", From 376d2aa43dbbcced29263f04d46461f02d07a758 Mon Sep 17 00:00:00 2001 From: Cameron Micka Date: Wed, 2 Oct 2024 16:56:49 -0700 Subject: [PATCH 3/9] UNITY_6000_0_OR_NEWER support. --- .../Editor/Utilities/ScreenshotUtilities.cs | 4 ++-- .../Acrylic/Scripts/AcrylicBlurRenderPass.cs | 10 ++++++++-- .../Acrylic/Scripts/AcrylicLayer.cs | 2 ++ .../Magnifier/Scripts/MagnifierManager.cs | 2 ++ .../Utilities/ClearRenderTargetPass.cs | 11 +++++++---- .../Runtime/Utilities/DrawFullscreenPass.cs | 14 ++++++++++---- .../Runtime/Utilities/FlyCameraController.cs | 4 ++-- .../MaterialGallery/Scripts/MaterialMatrix.cs | 19 +++++++++++++------ 8 files changed, 46 insertions(+), 20 deletions(-) diff --git a/com.microsoft.mrtk.graphicstools.unity/Editor/Utilities/ScreenshotUtilities.cs b/com.microsoft.mrtk.graphicstools.unity/Editor/Utilities/ScreenshotUtilities.cs index b72810ec..9e2788ee 100644 --- a/com.microsoft.mrtk.graphicstools.unity/Editor/Utilities/ScreenshotUtilities.cs +++ b/com.microsoft.mrtk.graphicstools.unity/Editor/Utilities/ScreenshotUtilities.cs @@ -86,8 +86,8 @@ public static bool CaptureScreenshot(string path, int superSize = 1, bool transp if (camera == null) { -#if UNITY_2023_1_OR_NEWER - camera = GameObject.FindFirstObjectByType(); +#if UNITY_6000_0_OR_NEWER + camera = GameObject.FindFirstObjectByType(); #else camera = GameObject.FindObjectOfType(); #endif diff --git a/com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Acrylic/Scripts/AcrylicBlurRenderPass.cs b/com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Acrylic/Scripts/AcrylicBlurRenderPass.cs index 436b1e03..6af7825d 100644 --- a/com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Acrylic/Scripts/AcrylicBlurRenderPass.cs +++ b/com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Acrylic/Scripts/AcrylicBlurRenderPass.cs @@ -56,7 +56,10 @@ public AcrylicBlurRenderPass(string _profilerLabel, int _downSamplePasses, int _ private Vector4 info = Vector4.zero; - public override void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor) +#if UNITY_6000_0_OR_NEWER + [System.Obsolete] +#endif + public override void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor) { int width = cameraTextureDescriptor.width / downSample; int height = cameraTextureDescriptor.height / downSample; @@ -110,7 +113,10 @@ private static RenderTargetIdentifier GetIdentifier(RenderTargetHandle target) #endif - public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData) +#if UNITY_6000_0_OR_NEWER + [System.Obsolete] +#endif + public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData) { CommandBuffer cmd = CommandBufferPool.Get(profilerLabel); cmd.Clear(); diff --git a/com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Acrylic/Scripts/AcrylicLayer.cs b/com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Acrylic/Scripts/AcrylicLayer.cs index 82336a76..712c8e4a 100644 --- a/com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Acrylic/Scripts/AcrylicLayer.cs +++ b/com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Acrylic/Scripts/AcrylicLayer.cs @@ -4,7 +4,9 @@ #if GT_USE_URP using System; using UnityEngine; +#if !UNITY_6000_0_OR_NEWER using UnityEngine.Experimental.Rendering.Universal; +#endif using UnityEngine.Profiling; using UnityEngine.Rendering; using UnityEngine.Rendering.Universal; diff --git a/com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Magnifier/Scripts/MagnifierManager.cs b/com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Magnifier/Scripts/MagnifierManager.cs index 8a87cffc..b378d9ef 100644 --- a/com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Magnifier/Scripts/MagnifierManager.cs +++ b/com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Magnifier/Scripts/MagnifierManager.cs @@ -4,7 +4,9 @@ #if GT_USE_URP using System.Collections.Generic; using UnityEngine; +#if !UNITY_6000_0_OR_NEWER using UnityEngine.Experimental.Rendering.Universal; +#endif using UnityEngine.Rendering.Universal; namespace Microsoft.MixedReality.GraphicsTools diff --git a/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/ClearRenderTargetPass.cs b/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/ClearRenderTargetPass.cs index 339255d5..f2c9e8f4 100644 --- a/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/ClearRenderTargetPass.cs +++ b/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/ClearRenderTargetPass.cs @@ -20,10 +20,13 @@ public ClearRenderTargetPass(ClearRenderTarget.PassSettings passSettings) renderPassEvent = settings.RenderPassEvent; } - /// - /// Queues a ClearRenderTarget command based on the pass settings. - /// - public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData) + /// + /// Queues a ClearRenderTarget command based on the pass settings. + /// +#if UNITY_6000_0_OR_NEWER + [System.Obsolete] +#endif + public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData) { CommandBuffer cmd = CommandBufferPool.Get(); diff --git a/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/DrawFullscreenPass.cs b/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/DrawFullscreenPass.cs index c9581e07..d0f80914 100644 --- a/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/DrawFullscreenPass.cs +++ b/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/DrawFullscreenPass.cs @@ -34,8 +34,11 @@ public DrawFullscreenPass(string tag) profilerTag = tag; } - /// - public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderingData) + /// +#if UNITY_6000_0_OR_NEWER + [System.Obsolete] +#endif + public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderingData) { RenderTextureDescriptor blitTargetDescriptor = renderingData.cameraData.cameraTargetDescriptor; blitTargetDescriptor.depthBufferBits = 0; @@ -69,8 +72,11 @@ public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderin } } - /// - public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData) + /// +#if UNITY_6000_0_OR_NEWER + [System.Obsolete] +#endif + public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData) { CommandBuffer cmd = CommandBufferPool.Get(profilerTag); diff --git a/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/FlyCameraController.cs b/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/FlyCameraController.cs index 5281b4b8..bd2aba8d 100644 --- a/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/FlyCameraController.cs +++ b/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/FlyCameraController.cs @@ -95,8 +95,8 @@ private void OnEnable() /// private void Start() { -#if UNITY_2023_1_OR_NEWER - SubsystemManager.GetSubsystems(xrDisplaySubsystems); +#if UNITY_6000_0_OR_NEWER + SubsystemManager.GetSubsystems(xrDisplaySubsystems); #else SubsystemManager.GetInstances(xrDisplaySubsystems); #endif diff --git a/com.microsoft.mrtk.graphicstools.unity/Samples~/MaterialGallery/Scripts/MaterialMatrix.cs b/com.microsoft.mrtk.graphicstools.unity/Samples~/MaterialGallery/Scripts/MaterialMatrix.cs index cbbf8f4d..bbfb7a74 100644 --- a/com.microsoft.mrtk.graphicstools.unity/Samples~/MaterialGallery/Scripts/MaterialMatrix.cs +++ b/com.microsoft.mrtk.graphicstools.unity/Samples~/MaterialGallery/Scripts/MaterialMatrix.cs @@ -52,9 +52,13 @@ private void Update() // Poll for when the render pipeline changes. if (useDefaultMaterial) { - if (lastRenderPipelineAsset != GraphicsSettings.renderPipelineAsset) - { - BuildMatrix(); +#if UNITY_6000_0_OR_NEWER + if (lastRenderPipelineAsset != GraphicsSettings.defaultRenderPipeline) +#else + if (lastRenderPipelineAsset != GraphicsSettings.renderPipelineAsset) +#endif + { + BuildMatrix(); } } } @@ -83,9 +87,12 @@ private void BuildMatrix() if (useDefaultMaterial) { - lastRenderPipelineAsset = GraphicsSettings.renderPipelineAsset; - - if (lastRenderPipelineAsset != null) +#if UNITY_6000_0_OR_NEWER + lastRenderPipelineAsset = GraphicsSettings.defaultRenderPipeline; +#else + lastRenderPipelineAsset = GraphicsSettings.renderPipelineAsset; +#endif + if (lastRenderPipelineAsset != null) { currentMaterial = lastRenderPipelineAsset.defaultMaterial; } From 301277c055055e4341a7739510ec23653ab05bf8 Mon Sep 17 00:00:00 2001 From: Cameron Micka Date: Wed, 2 Oct 2024 17:07:44 -0700 Subject: [PATCH 4/9] Convert tabs to spaces. --- .../Editor/Utilities/ScreenshotUtilities.cs | 2 +- .../Acrylic/Scripts/AcrylicBlurRenderPass.cs | 8 ++++---- .../Runtime/Utilities/ClearRenderTargetPass.cs | 10 +++++----- .../Runtime/Utilities/DrawFullscreenPass.cs | 12 ++++++------ .../Runtime/Utilities/FlyCameraController.cs | 2 +- .../MaterialGallery/Scripts/MaterialMatrix.cs | 14 +++++++------- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/com.microsoft.mrtk.graphicstools.unity/Editor/Utilities/ScreenshotUtilities.cs b/com.microsoft.mrtk.graphicstools.unity/Editor/Utilities/ScreenshotUtilities.cs index 9e2788ee..e329b7bc 100644 --- a/com.microsoft.mrtk.graphicstools.unity/Editor/Utilities/ScreenshotUtilities.cs +++ b/com.microsoft.mrtk.graphicstools.unity/Editor/Utilities/ScreenshotUtilities.cs @@ -87,7 +87,7 @@ public static bool CaptureScreenshot(string path, int superSize = 1, bool transp if (camera == null) { #if UNITY_6000_0_OR_NEWER - camera = GameObject.FindFirstObjectByType(); + camera = GameObject.FindFirstObjectByType(); #else camera = GameObject.FindObjectOfType(); #endif diff --git a/com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Acrylic/Scripts/AcrylicBlurRenderPass.cs b/com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Acrylic/Scripts/AcrylicBlurRenderPass.cs index 6af7825d..2af683cd 100644 --- a/com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Acrylic/Scripts/AcrylicBlurRenderPass.cs +++ b/com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Acrylic/Scripts/AcrylicBlurRenderPass.cs @@ -57,9 +57,9 @@ public AcrylicBlurRenderPass(string _profilerLabel, int _downSamplePasses, int _ private Vector4 info = Vector4.zero; #if UNITY_6000_0_OR_NEWER - [System.Obsolete] + [System.Obsolete] #endif - public override void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor) + public override void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor) { int width = cameraTextureDescriptor.width / downSample; int height = cameraTextureDescriptor.height / downSample; @@ -114,9 +114,9 @@ private static RenderTargetIdentifier GetIdentifier(RenderTargetHandle target) #endif #if UNITY_6000_0_OR_NEWER - [System.Obsolete] + [System.Obsolete] #endif - public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData) + public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData) { CommandBuffer cmd = CommandBufferPool.Get(profilerLabel); cmd.Clear(); diff --git a/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/ClearRenderTargetPass.cs b/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/ClearRenderTargetPass.cs index f2c9e8f4..a38eba11 100644 --- a/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/ClearRenderTargetPass.cs +++ b/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/ClearRenderTargetPass.cs @@ -20,13 +20,13 @@ public ClearRenderTargetPass(ClearRenderTarget.PassSettings passSettings) renderPassEvent = settings.RenderPassEvent; } - /// - /// Queues a ClearRenderTarget command based on the pass settings. - /// + /// + /// Queues a ClearRenderTarget command based on the pass settings. + /// #if UNITY_6000_0_OR_NEWER - [System.Obsolete] + [System.Obsolete] #endif - public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData) + public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData) { CommandBuffer cmd = CommandBufferPool.Get(); diff --git a/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/DrawFullscreenPass.cs b/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/DrawFullscreenPass.cs index d0f80914..647eb8a1 100644 --- a/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/DrawFullscreenPass.cs +++ b/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/DrawFullscreenPass.cs @@ -34,11 +34,11 @@ public DrawFullscreenPass(string tag) profilerTag = tag; } - /// + /// #if UNITY_6000_0_OR_NEWER - [System.Obsolete] + [System.Obsolete] #endif - public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderingData) + public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderingData) { RenderTextureDescriptor blitTargetDescriptor = renderingData.cameraData.cameraTargetDescriptor; blitTargetDescriptor.depthBufferBits = 0; @@ -72,11 +72,11 @@ public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderin } } - /// + /// #if UNITY_6000_0_OR_NEWER - [System.Obsolete] + [System.Obsolete] #endif - public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData) + public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData) { CommandBuffer cmd = CommandBufferPool.Get(profilerTag); diff --git a/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/FlyCameraController.cs b/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/FlyCameraController.cs index bd2aba8d..fdeff153 100644 --- a/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/FlyCameraController.cs +++ b/com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/FlyCameraController.cs @@ -96,7 +96,7 @@ private void OnEnable() private void Start() { #if UNITY_6000_0_OR_NEWER - SubsystemManager.GetSubsystems(xrDisplaySubsystems); + SubsystemManager.GetSubsystems(xrDisplaySubsystems); #else SubsystemManager.GetInstances(xrDisplaySubsystems); #endif diff --git a/com.microsoft.mrtk.graphicstools.unity/Samples~/MaterialGallery/Scripts/MaterialMatrix.cs b/com.microsoft.mrtk.graphicstools.unity/Samples~/MaterialGallery/Scripts/MaterialMatrix.cs index bbfb7a74..faff3282 100644 --- a/com.microsoft.mrtk.graphicstools.unity/Samples~/MaterialGallery/Scripts/MaterialMatrix.cs +++ b/com.microsoft.mrtk.graphicstools.unity/Samples~/MaterialGallery/Scripts/MaterialMatrix.cs @@ -53,12 +53,12 @@ private void Update() if (useDefaultMaterial) { #if UNITY_6000_0_OR_NEWER - if (lastRenderPipelineAsset != GraphicsSettings.defaultRenderPipeline) + if (lastRenderPipelineAsset != GraphicsSettings.defaultRenderPipeline) #else - if (lastRenderPipelineAsset != GraphicsSettings.renderPipelineAsset) + if (lastRenderPipelineAsset != GraphicsSettings.renderPipelineAsset) #endif - { - BuildMatrix(); + { + BuildMatrix(); } } } @@ -88,11 +88,11 @@ private void BuildMatrix() if (useDefaultMaterial) { #if UNITY_6000_0_OR_NEWER - lastRenderPipelineAsset = GraphicsSettings.defaultRenderPipeline; + lastRenderPipelineAsset = GraphicsSettings.defaultRenderPipeline; #else - lastRenderPipelineAsset = GraphicsSettings.renderPipelineAsset; + lastRenderPipelineAsset = GraphicsSettings.renderPipelineAsset; #endif - if (lastRenderPipelineAsset != null) + if (lastRenderPipelineAsset != null) { currentMaterial = lastRenderPipelineAsset.defaultMaterial; } From 531a303b11ee4c758f435fb0418440ca77035848 Mon Sep 17 00:00:00 2001 From: Cameron Micka Date: Wed, 2 Oct 2024 17:13:22 -0700 Subject: [PATCH 5/9] Bump package version. --- com.microsoft.mrtk.graphicstools.shadergraph.unity/package.json | 2 +- com.microsoft.mrtk.graphicstools.unity/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/com.microsoft.mrtk.graphicstools.shadergraph.unity/package.json b/com.microsoft.mrtk.graphicstools.shadergraph.unity/package.json index 8e6ec4d5..69517934 100644 --- a/com.microsoft.mrtk.graphicstools.shadergraph.unity/package.json +++ b/com.microsoft.mrtk.graphicstools.shadergraph.unity/package.json @@ -1,6 +1,6 @@ { "name": "com.microsoft.mrtk.graphicstools.shadergraph.unity", - "version": "0.7.2", + "version": "0.7.3", "displayName": "MRTK Graphics Tools Shader Graph", "description": "Graphics tools and components for developing Mixed Reality applications in Unity Shader Graph.", "documentationUrl": "https://aka.ms/mrtk3graphics", diff --git a/com.microsoft.mrtk.graphicstools.unity/package.json b/com.microsoft.mrtk.graphicstools.unity/package.json index 006ebf76..3f36a05d 100644 --- a/com.microsoft.mrtk.graphicstools.unity/package.json +++ b/com.microsoft.mrtk.graphicstools.unity/package.json @@ -1,6 +1,6 @@ { "name": "com.microsoft.mrtk.graphicstools.unity", - "version": "0.7.2", + "version": "0.7.3", "displayName": "MRTK Graphics Tools", "description": "Graphics tools and components for developing Mixed Reality applications in Unity.", "documentationUrl": "https://aka.ms/mrtk3graphics", From bc4489abe0f44d3f2920ba5e68268b36a0b4cbfb Mon Sep 17 00:00:00 2001 From: Cameron Micka Date: Mon, 2 Dec 2024 14:04:32 -0800 Subject: [PATCH 6/9] Project update and remove unneeded deps. --- .../Packages/manifest.json | 14 ++-- .../Packages/packages-lock.json | 74 ++++++------------- .../ProjectSettings/ProjectVersion.txt | 4 +- 3 files changed, 32 insertions(+), 60 deletions(-) diff --git a/GraphicsToolsUnityProject/Packages/manifest.json b/GraphicsToolsUnityProject/Packages/manifest.json index 434e33e3..a5c553d0 100644 --- a/GraphicsToolsUnityProject/Packages/manifest.json +++ b/GraphicsToolsUnityProject/Packages/manifest.json @@ -2,16 +2,14 @@ "dependencies": { "com.microsoft.mrtk.graphicstools.shadergraph.unity": "file:../../com.microsoft.mrtk.graphicstools.shadergraph.unity", "com.microsoft.mrtk.graphicstools.unity": "file:../../com.microsoft.mrtk.graphicstools.unity", - "com.unity.asset-store-validation": "0.5.1", - "com.unity.ide.visualstudio": "2.0.17", + "com.unity.asset-store-validation": "0.6.0", + "com.unity.ide.visualstudio": "2.0.22", "com.unity.ide.vscode": "1.2.5", - "com.unity.inputsystem": "1.4.4", - "com.unity.memoryprofiler": "0.7.1-preview.1", - "com.unity.render-pipelines.universal": "12.1.8", - "com.unity.textmeshpro": "3.0.6", + "com.unity.inputsystem": "1.7.0", + "com.unity.textmeshpro": "3.0.9", "com.unity.ugui": "1.0.0", - "com.unity.xr.management": "4.2.1", - "com.unity.xr.oculus": "3.2.2", + "com.unity.xr.management": "4.4.1", + "com.unity.xr.oculus": "3.3.0", "com.unity.modules.ai": "1.0.0", "com.unity.modules.androidjni": "1.0.0", "com.unity.modules.animation": "1.0.0", diff --git a/GraphicsToolsUnityProject/Packages/packages-lock.json b/GraphicsToolsUnityProject/Packages/packages-lock.json index 5e53d566..9599ca80 100644 --- a/GraphicsToolsUnityProject/Packages/packages-lock.json +++ b/GraphicsToolsUnityProject/Packages/packages-lock.json @@ -15,7 +15,7 @@ "dependencies": {} }, "com.unity.asset-store-validation": { - "version": "0.5.1", + "version": "0.6.0", "depth": 0, "source": "registry", "dependencies": { @@ -24,21 +24,14 @@ "url": "https://packages.unity.com" }, "com.unity.burst": { - "version": "1.8.2", - "depth": 1, + "version": "1.8.11", + "depth": 2, "source": "registry", "dependencies": { "com.unity.mathematics": "1.2.1" }, "url": "https://packages.unity.com" }, - "com.unity.editorcoroutines": { - "version": "1.0.0", - "depth": 1, - "source": "registry", - "dependencies": {}, - "url": "https://packages.unity.com" - }, "com.unity.ext.nunit": { "version": "1.0.6", "depth": 2, @@ -47,7 +40,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.visualstudio": { - "version": "2.0.17", + "version": "2.0.22", "depth": 0, "source": "registry", "dependencies": { @@ -63,7 +56,7 @@ "url": "https://packages.unity.com" }, "com.unity.inputsystem": { - "version": "1.4.4", + "version": "1.7.0", "depth": 0, "source": "registry", "dependencies": { @@ -73,30 +66,21 @@ }, "com.unity.mathematics": { "version": "1.2.6", - "depth": 1, + "depth": 2, "source": "registry", "dependencies": {}, "url": "https://packages.unity.com" }, - "com.unity.memoryprofiler": { - "version": "0.7.1-preview.1", - "depth": 0, - "source": "registry", - "dependencies": { - "com.unity.editorcoroutines": "1.0.0" - }, - "url": "https://packages.unity.com" - }, "com.unity.nuget.newtonsoft-json": { - "version": "3.0.2", + "version": "3.2.1", "depth": 1, "source": "registry", "dependencies": {}, "url": "https://packages.unity.com" }, "com.unity.render-pipelines.core": { - "version": "12.1.8", - "depth": 1, + "version": "12.1.14", + "depth": 2, "source": "builtin", "dependencies": { "com.unity.ugui": "1.0.0", @@ -105,43 +89,34 @@ } }, "com.unity.render-pipelines.universal": { - "version": "12.1.8", - "depth": 0, + "version": "12.1.14", + "depth": 1, "source": "builtin", "dependencies": { "com.unity.mathematics": "1.2.1", - "com.unity.burst": "1.8.2", - "com.unity.render-pipelines.core": "12.1.8", - "com.unity.shadergraph": "12.1.8" + "com.unity.burst": "1.8.9", + "com.unity.render-pipelines.core": "12.1.14", + "com.unity.shadergraph": "12.1.14" } }, "com.unity.searcher": { "version": "4.9.1", - "depth": 2, + "depth": 3, "source": "registry", "dependencies": {}, "url": "https://packages.unity.com" }, "com.unity.shadergraph": { - "version": "12.1.8", - "depth": 1, + "version": "12.1.14", + "depth": 2, "source": "builtin", "dependencies": { - "com.unity.render-pipelines.core": "12.1.8", + "com.unity.render-pipelines.core": "12.1.14", "com.unity.searcher": "4.9.1" } }, - "com.unity.subsystemregistration": { - "version": "1.1.0", - "depth": 1, - "source": "registry", - "dependencies": { - "com.unity.modules.subsystems": "1.0.0" - }, - "url": "https://packages.unity.com" - }, "com.unity.test-framework": { - "version": "1.1.31", + "version": "1.1.33", "depth": 1, "source": "registry", "dependencies": { @@ -152,7 +127,7 @@ "url": "https://packages.unity.com" }, "com.unity.textmeshpro": { - "version": "3.0.6", + "version": "3.0.9", "depth": 0, "source": "registry", "dependencies": { @@ -180,20 +155,19 @@ "url": "https://packages.unity.com" }, "com.unity.xr.management": { - "version": "4.2.1", + "version": "4.4.1", "depth": 0, "source": "registry", "dependencies": { - "com.unity.modules.subsystems": "1.0.0", "com.unity.modules.vr": "1.0.0", "com.unity.modules.xr": "1.0.0", - "com.unity.xr.legacyinputhelpers": "2.1.7", - "com.unity.subsystemregistration": "1.0.6" + "com.unity.modules.subsystems": "1.0.0", + "com.unity.xr.legacyinputhelpers": "2.1.7" }, "url": "https://packages.unity.com" }, "com.unity.xr.oculus": { - "version": "3.2.2", + "version": "3.3.0", "depth": 0, "source": "registry", "dependencies": { diff --git a/GraphicsToolsUnityProject/ProjectSettings/ProjectVersion.txt b/GraphicsToolsUnityProject/ProjectSettings/ProjectVersion.txt index 3643b022..39a629e9 100644 --- a/GraphicsToolsUnityProject/ProjectSettings/ProjectVersion.txt +++ b/GraphicsToolsUnityProject/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2021.3.16f1 -m_EditorVersionWithRevision: 2021.3.16f1 (4016570cf34f) +m_EditorVersion: 2021.3.35f1 +m_EditorVersionWithRevision: 2021.3.35f1 (157b46ce122a) From 62afd9db76c2a22c55a2d85df21c92d970cdc7c6 Mon Sep 17 00:00:00 2001 From: Cameron Micka Date: Mon, 2 Dec 2024 14:04:49 -0800 Subject: [PATCH 7/9] Extra comments. --- .../Runtime/Shaders/GraphicsToolsStandard.shader | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/com.microsoft.mrtk.graphicstools.unity/Runtime/Shaders/GraphicsToolsStandard.shader b/com.microsoft.mrtk.graphicstools.unity/Runtime/Shaders/GraphicsToolsStandard.shader index 76cc3af4..9109d71a 100644 --- a/com.microsoft.mrtk.graphicstools.unity/Runtime/Shaders/GraphicsToolsStandard.shader +++ b/com.microsoft.mrtk.graphicstools.unity/Runtime/Shaders/GraphicsToolsStandard.shader @@ -191,6 +191,7 @@ Shader "Graphics Tools/Standard" ENDHLSL } + // Shadow casting pass. Pass { Name "ShadowCaster" @@ -231,6 +232,7 @@ Shader "Graphics Tools/Standard" ENDHLSL } + // Depth pass. // From Packages/com.unity.render-pipelines.universal/Shader/Lit.hlsl Pass { @@ -286,8 +288,8 @@ Shader "Graphics Tools/Standard" ENDHLSL } + // This pass is used when drawing to a _CameraNormalsTexture texture. // From Packages/com.unity.render-pipelines.universal/Shader/Lit.hlsl - // This pass is used when drawing to a _CameraNormalsTexture texture Pass { Name "DepthNormals" From a06e99b9d92656b0c791b0bf87d7526c5cb36fd0 Mon Sep 17 00:00:00 2001 From: Cameron Micka Date: Mon, 2 Dec 2024 14:20:09 -0800 Subject: [PATCH 8/9] Package update. --- .../package.json | 4 ++-- com.microsoft.mrtk.graphicstools.unity/CHANGELOG.md | 6 ++++++ com.microsoft.mrtk.graphicstools.unity/package.json | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/com.microsoft.mrtk.graphicstools.shadergraph.unity/package.json b/com.microsoft.mrtk.graphicstools.shadergraph.unity/package.json index 9238eef2..7f9c836d 100644 --- a/com.microsoft.mrtk.graphicstools.shadergraph.unity/package.json +++ b/com.microsoft.mrtk.graphicstools.shadergraph.unity/package.json @@ -1,12 +1,12 @@ { "name": "com.microsoft.mrtk.graphicstools.shadergraph.unity", - "version": "0.8.0", + "version": "0.8.1", "displayName": "MRTK Graphics Tools Shader Graph", "description": "Graphics tools and components for developing Mixed Reality applications in Unity Shader Graph.", "documentationUrl": "https://aka.ms/mrtk3graphics", "msftFeatureCategory": "MRTK3", "unity": "2021.3", - "unityRelease": "26f1", + "unityRelease": "35f1", "author": "Microsoft", "license": "MIT", "repository": { diff --git a/com.microsoft.mrtk.graphicstools.unity/CHANGELOG.md b/com.microsoft.mrtk.graphicstools.unity/CHANGELOG.md index 0c7e494a..39a1015b 100644 --- a/com.microsoft.mrtk.graphicstools.unity/CHANGELOG.md +++ b/com.microsoft.mrtk.graphicstools.unity/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this package will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## [0.8.1] - 2024-12-02 + +### Changed + +- Added support for Unity URP SSAO's "Depth normal" mode. + ## [0.8.0] - 2024-11-21 ### Changed diff --git a/com.microsoft.mrtk.graphicstools.unity/package.json b/com.microsoft.mrtk.graphicstools.unity/package.json index 8058af02..e751cd48 100644 --- a/com.microsoft.mrtk.graphicstools.unity/package.json +++ b/com.microsoft.mrtk.graphicstools.unity/package.json @@ -1,12 +1,12 @@ { "name": "com.microsoft.mrtk.graphicstools.unity", - "version": "0.8.0", + "version": "0.8.1", "displayName": "MRTK Graphics Tools", "description": "Graphics tools and components for developing Mixed Reality applications in Unity.", "documentationUrl": "https://aka.ms/mrtk3graphics", "msftFeatureCategory": "MRTK3", "unity": "2021.3", - "unityRelease": "26f1", + "unityRelease": "35f1", "author": "Microsoft", "license": "MIT", "repository": { From 61691e9f8eef7684ba0c2d8bfe1635e89dbe0bf9 Mon Sep 17 00:00:00 2001 From: Cameron Micka Date: Thu, 27 Mar 2025 11:51:39 -0700 Subject: [PATCH 9/9] Changelog updates. --- com.microsoft.mrtk.graphicstools.unity/CHANGELOG.md | 12 ++++++++++++ .../Editor/LightCombiner/LightCombinerWindow.cs | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/com.microsoft.mrtk.graphicstools.unity/CHANGELOG.md b/com.microsoft.mrtk.graphicstools.unity/CHANGELOG.md index 39a1015b..0cbe4b47 100644 --- a/com.microsoft.mrtk.graphicstools.unity/CHANGELOG.md +++ b/com.microsoft.mrtk.graphicstools.unity/CHANGELOG.md @@ -4,6 +4,18 @@ All notable changes to this package will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## [0.8.3] - 2025-03-26 + +### Changed + +- This change introduces a new experimental light type called an AreaLight - area lights allow light to emit from a polygonal surface (quad) rather than a single point. + +## [0.8.2] - 2025-03-13 + +### Changed + +- Added the LightCombinerWindow which is an editor window that provides a user interface to combine light maps with albedo textures. + ## [0.8.1] - 2024-12-02 ### Changed diff --git a/com.microsoft.mrtk.graphicstools.unity/Editor/LightCombiner/LightCombinerWindow.cs b/com.microsoft.mrtk.graphicstools.unity/Editor/LightCombiner/LightCombinerWindow.cs index 57e44a79..f0d06265 100644 --- a/com.microsoft.mrtk.graphicstools.unity/Editor/LightCombiner/LightCombinerWindow.cs +++ b/com.microsoft.mrtk.graphicstools.unity/Editor/LightCombiner/LightCombinerWindow.cs @@ -484,7 +484,7 @@ private List GetAllLightmappedRenderers(Scene scene) return output; } - private static Mesh SaveMesh(Mesh mesh, string workingDirectory, string fileName) + private static UnityEngine.Mesh SaveMesh(UnityEngine.Mesh mesh, string workingDirectory, string fileName) { var path = AssetDatabase.GenerateUniqueAssetPath(Path.Combine(workingDirectory, $"{fileName}.asset")); AssetDatabase.CreateAsset(mesh, path);