diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index b74c37bf5f6..78dc94a9d7d 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -6,8 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [13.1.4] - 2021-12-04 -Version Updated -The version number for this package has increased due to a version update of a related graphics package. +### Fixed + +- Fixed option to force motion blur off when in XR. ## [13.1.3] - 2021-11-17 diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.Skin.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.Skin.cs index ea796cac629..e476ee18092 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.Skin.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.Skin.cs @@ -258,6 +258,7 @@ public class Styles public static readonly GUIContent XRSinglePass = EditorGUIUtility.TrTextContent("Single Pass", "When enabled, XR views are rendered simultaneously and the render loop is processed only once. This setting will improve CPU and GPU performance but will use more GPU memory."); public static readonly GUIContent XROcclusionMesh = EditorGUIUtility.TrTextContent("Occlusion Mesh", "When enabled, the occlusion mesh will be rendered for each view during the depth prepass to reduce shaded fragments."); public static readonly GUIContent XRCameraJitter = EditorGUIUtility.TrTextContent("Camera Jitter", "When enabled, jitter will be added to the camera to provide more samples for temporal effects. This is usually not required in VR due to micro variations from the tracking."); + public static readonly GUIContent XRMotionBlur = EditorGUIUtility.TrTextContent("Allow Motion Blur", "When enabled, motion blur can be used in XR. When this option is disabled, regardless of the settings, motion blur will be turned off when in XR."); public static readonly GUIContent lutSize = EditorGUIUtility.TrTextContent("Grading LUT Size", "Sets size of the internal and external color grading lookup textures (LUTs)."); public static readonly GUIContent lutFormat = EditorGUIUtility.TrTextContent("Grading LUT Format", "Specifies the encoding format for color grading lookup textures. Lower precision formats are faster and use less memory at the expense of color precision."); diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs index 02fe197789e..0fb32ecda1b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs @@ -703,6 +703,7 @@ static void Drawer_SectionXRSettings(SerializedHDRenderPipelineAsset serialized, EditorGUILayout.PropertyField(serialized.renderPipelineSettings.xrSettings.singlePass, Styles.XRSinglePass); EditorGUILayout.PropertyField(serialized.renderPipelineSettings.xrSettings.occlusionMesh, Styles.XROcclusionMesh); EditorGUILayout.PropertyField(serialized.renderPipelineSettings.xrSettings.cameraJitter, Styles.XRCameraJitter); + EditorGUILayout.PropertyField(serialized.renderPipelineSettings.xrSettings.allowMotionBlur, Styles.XRMotionBlur); } static void Drawer_SectionVTSettings(SerializedHDRenderPipelineAsset serialized, Editor owner) diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedXRSettings.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedXRSettings.cs index 4a462298ef0..b94bc038312 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedXRSettings.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedXRSettings.cs @@ -9,6 +9,7 @@ class SerializedXRSettings public SerializedProperty singlePass; public SerializedProperty occlusionMesh; public SerializedProperty cameraJitter; + public SerializedProperty allowMotionBlur; public SerializedXRSettings(SerializedProperty root) { @@ -17,6 +18,7 @@ public SerializedXRSettings(SerializedProperty root) singlePass = root.Find((GlobalXRSettings s) => s.singlePass); occlusionMesh = root.Find((GlobalXRSettings s) => s.occlusionMesh); cameraJitter = root.Find((GlobalXRSettings s) => s.cameraJitter); + allowMotionBlur = root.Find((GlobalXRSettings s) => s.allowMotionBlur); } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index 20f5fde2f9a..9dee36c7303 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -3620,6 +3620,13 @@ TextureHandle MotionBlurPass(RenderGraph renderGraph, HDCamera hdCamera, Texture { if (m_MotionBlur.IsActive() && m_AnimatedMaterialsEnabled && !hdCamera.resetPostProcessingHistory && m_MotionBlurFS) { + // If we are in XR we need to check if motion blur is allowed at all. + if (hdCamera.xr.enabled) + { + if (!m_Asset.currentPlatformRenderPipelineSettings.xrSettings.allowMotionBlur) + return source; + } + using (var builder = renderGraph.AddRenderPass("Motion Blur", out var passData, ProfilingSampler.Get(HDProfileId.MotionBlur))) { PrepareMotionBlurPassData(renderGraph, builder, passData, hdCamera, source, motionVectors, depthTexture); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/GlobalXRSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/GlobalXRSettings.cs index 07e631a68b6..5395ab1fe56 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/GlobalXRSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/GlobalXRSettings.cs @@ -12,7 +12,8 @@ public struct GlobalXRSettings { singlePass = true, occlusionMesh = true, - cameraJitter = false + cameraJitter = false, + allowMotionBlur = true }; /// Use single pass. @@ -21,5 +22,7 @@ public struct GlobalXRSettings public bool occlusionMesh; /// Add jitter to camera for temporal effects. public bool cameraJitter; + /// Allow motion blur when in XR. + public bool allowMotionBlur; } }