diff --git a/com.unity.render-pipelines.core/CHANGELOG.md b/com.unity.render-pipelines.core/CHANGELOG.md index 3d3a2368771..6a8972253fb 100644 --- a/com.unity.render-pipelines.core/CHANGELOG.md +++ b/com.unity.render-pipelines.core/CHANGELOG.md @@ -23,6 +23,7 @@ The version number for this package has increased due to a version update of a r - Fix LookDev's undo/redo on EnvironmentLibrary (case 1234725) - Fixed a wrong condition in CameraSwitcher, potentially causing out of bound exceptions. - Fixed issue with blue line in prefabs for volume mode. +- Fix hierarchicalbox gizmo outside facing check in symetry or homothety mode no longer move the center ## [8.0.1] - 2020-02-25 diff --git a/com.unity.render-pipelines.core/Editor/Gizmo/HierarchicalBox.cs b/com.unity.render-pipelines.core/Editor/Gizmo/HierarchicalBox.cs index be4761682b8..26b9250d279 100644 --- a/com.unity.render-pipelines.core/Editor/Gizmo/HierarchicalBox.cs +++ b/com.unity.render-pipelines.core/Editor/Gizmo/HierarchicalBox.cs @@ -244,9 +244,7 @@ public void DrawHandle() for (int i = 0, count = m_ControlIDs.Length; i < count; ++i) m_ControlIDs[i] = GUIUtility.GetControlID("HierarchicalBox".GetHashCode() + i, FocusType.Passive); - - EditorGUI.BeginChangeCheck(); - + var leftPosition = center + size.x * .5f * Vector3.left; var rightPosition = center + size.x * .5f * Vector3.right; var topPosition = center + size.y * .5f * Vector3.up; @@ -256,6 +254,8 @@ public void DrawHandle() var theChangedFace = NamedFace.None; + EditorGUI.BeginChangeCheck(); + EditorGUI.BeginChangeCheck(); Slider1D(m_ControlIDs[(int)NamedFace.Left], ref leftPosition, Vector3.left, EditorSnapSettings.scale, GetHandleColor(NamedFace.Left)); if (EditorGUI.EndChangeCheck()) @@ -338,6 +338,27 @@ public void DrawHandle() case NamedFace.Front: backPosition.z += delta; break; case NamedFace.Back: frontPosition.z -= delta; break; } + + //ensure that the box face are still facing outside + switch (theChangedFace) + { + case NamedFace.Left: + case NamedFace.Right: + if (rightPosition.x < leftPosition.x) + rightPosition.x = leftPosition.x = center.x; + break; + case NamedFace.Top: + case NamedFace.Bottom: + if (topPosition.y < bottomPosition.y) + topPosition.y = bottomPosition.y = center.y; + break; + case NamedFace.Front: + case NamedFace.Back: + if (frontPosition.z < backPosition.z) + frontPosition.z = backPosition.z = center.z; + break; + } + } if (useHomothety) @@ -367,21 +388,77 @@ public void DrawHandle() topPosition.y -= halfDelta; break; } + + //ensure that the box face are still facing outside + switch (theChangedFace) + { + case NamedFace.Left: + if (rightPosition.x < leftPosition.x) + leftPosition.x = rightPosition.x; + if (topPosition.y < bottomPosition.y) + topPosition.y = bottomPosition.y = center.y; + if (frontPosition.z < backPosition.z) + frontPosition.z = backPosition.z = center.z; + break; + case NamedFace.Right: + if (rightPosition.x < leftPosition.x) + rightPosition.x = leftPosition.x; + if (topPosition.y < bottomPosition.y) + topPosition.y = bottomPosition.y = center.y; + if (frontPosition.z < backPosition.z) + frontPosition.z = backPosition.z = center.z; + break; + case NamedFace.Top: + if (topPosition.y < bottomPosition.y) + topPosition.y = bottomPosition.y; + if (rightPosition.x < leftPosition.x) + rightPosition.x = leftPosition.x = center.x; + if (frontPosition.z < backPosition.z) + frontPosition.z = backPosition.z = center.z; + break; + case NamedFace.Bottom: + if (topPosition.y < bottomPosition.y) + bottomPosition.y = topPosition.y; + if (rightPosition.x < leftPosition.x) + rightPosition.x = leftPosition.x = center.x; + if (frontPosition.z < backPosition.z) + frontPosition.z = backPosition.z = center.z; + break; + case NamedFace.Front: + if (frontPosition.z < backPosition.z) + frontPosition.z = backPosition.z; + if (rightPosition.x < leftPosition.x) + rightPosition.x = leftPosition.x = center.x; + if (topPosition.y < bottomPosition.y) + topPosition.y = bottomPosition.y = center.y; + break; + case NamedFace.Back: + if (frontPosition.z < backPosition.z) + backPosition.z = frontPosition.z; + if (rightPosition.x < leftPosition.x) + rightPosition.x = leftPosition.x = center.x; + if (topPosition.y < bottomPosition.y) + topPosition.y = bottomPosition.y = center.y; + break; + } } var max = new Vector3(rightPosition.x, topPosition.y, frontPosition.z); var min = new Vector3(leftPosition.x, bottomPosition.y, backPosition.z); - //ensure that the box face are still facing outside - for (int axis = 0; axis < 3; ++axis) + if (!useSymetry && !useHomothety) { - if (min[axis] > max[axis]) + //ensure that the box face are still facing outside + for (int axis = 0; axis < 3; ++axis) { - // Control IDs in m_ControlIDs[0-3[ are for positive axes - if (GUIUtility.hotControl == m_ControlIDs[axis]) - max[axis] = min[axis]; - else - min[axis] = max[axis]; + if (min[axis] > max[axis]) + { + // Control IDs in m_ControlIDs[0-3[ are for positive axes + if (GUIUtility.hotControl == m_ControlIDs[axis]) + max[axis] = min[axis]; + else + min[axis] = max[axis]; + } } } diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 9fc890272df..bfe6afdacd9 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -75,6 +75,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed a serialization issue, preventing quality level parameters to undo/redo and update scene view on change. - Fixed an issue where opening the look dev window with the light theme would make the window blink and eventually crash unity. - Fixed culling for decals when used in prefabs and edited in context. +- Fixed XR single-pass macros in tessellation shaders. +- Fixed regression where moving face of the probe gizmo was not moving its position anymore. ### Changed - Shadowmask and realtime reflection probe property are hide in Quality settings diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Handles.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Handles.cs index 6591265fc2d..644e16383a4 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Handles.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Handles.cs @@ -102,12 +102,12 @@ public static void DrawHandles_EditInfluenceNormal(SerializedInfluenceVolume ser break; } } - + static void DrawBoxHandle(SerializedInfluenceVolume serialized, Editor owner, Transform transform, HierarchicalBox box) { using (new Handles.DrawingScope(Matrix4x4.TRS(Vector3.zero, transform.rotation, Vector3.one))) { - box.center = Quaternion.Inverse(transform.rotation)*transform.position; + box.center = Quaternion.Inverse(transform.rotation) * transform.position; box.size = serialized.boxSize.vector3Value; EditorGUI.BeginChangeCheck(); @@ -115,6 +115,10 @@ static void DrawBoxHandle(SerializedInfluenceVolume serialized, Editor owner, Tr box.DrawHandle(); if (EditorGUI.EndChangeCheck()) { + var newPosition = transform.rotation * box.center; + Undo.RecordObject(transform, "Moving Influence"); + transform.position = newPosition; + // Clamp blend distances var blendPositive = serialized.boxBlendDistancePositive.vector3Value; var blendNegative = serialized.boxBlendDistanceNegative.vector3Value; diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ContrastAdaptiveSharpen.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ContrastAdaptiveSharpen.compute index 7e29259723d..2d64cd54246 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ContrastAdaptiveSharpen.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ContrastAdaptiveSharpen.compute @@ -1,4 +1,4 @@ -#pragma kernel KMain +#pragma kernel KMain #pragma kernel KInitialize #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" @@ -7,7 +7,7 @@ #define A_GPU 1 #define A_HLSL 1 -#include "ffx_a.h" +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_a.hlsl" // two elements: // [0] = const0 // [1] = const1 @@ -42,7 +42,7 @@ void WritePix(AU2 gxy, AF4 casPix) _OutputTexture[COORD_TEXTURE2D_X(gxy)] = casPix; } -#include "ffx_cas.h" +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_cas.hlsl" [numthreads(64, 1, 1)] diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_a.h.meta b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_a.h.meta deleted file mode 100644 index 5e8da5eaa28..00000000000 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_a.h.meta +++ /dev/null @@ -1,27 +0,0 @@ -fileFormatVersion: 2 -guid: 8fa88e06d4412864faafeccb0dd1f265 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 1 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_a.h b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_a.hlsl similarity index 100% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_a.h rename to com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_a.hlsl diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_a.hlsl.meta b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_a.hlsl.meta new file mode 100644 index 00000000000..21ef14dc855 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_a.hlsl.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 09d6b4dd7349d95459ccc412508450cb +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_cas.h.meta b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_cas.h.meta deleted file mode 100644 index c047659b3d6..00000000000 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_cas.h.meta +++ /dev/null @@ -1,27 +0,0 @@ -fileFormatVersion: 2 -guid: 17dee6c96085bcf44bc645a7fb003797 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 1 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_cas.h b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_cas.hlsl similarity index 100% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_cas.h rename to com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_cas.hlsl diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_cas.hlsl.meta b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_cas.hlsl.meta new file mode 100644 index 00000000000..6094016656c --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_cas.hlsl.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c6604d0ef3ffab64089f9c5f537442c0 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_lpm.h.meta b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_lpm.h.meta deleted file mode 100644 index 7c08e1ba715..00000000000 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_lpm.h.meta +++ /dev/null @@ -1,27 +0,0 @@ -fileFormatVersion: 2 -guid: 010ce9ea342d9824a95a715800cc8a60 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 1 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_lpm.h b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_lpm.hlsl similarity index 100% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_lpm.h rename to com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_lpm.hlsl diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_lpm.hlsl.meta b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_lpm.hlsl.meta new file mode 100644 index 00000000000..c2e467885dd --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/ffx_lpm.hlsl.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 806df549cbaf41649a171cda59950cce +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/VertMesh.hlsl b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/VertMesh.hlsl index 208a00e9e0f..7e90f7fbb78 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/VertMesh.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/VertMesh.hlsl @@ -45,8 +45,6 @@ struct PackedVaryingsToDS #ifdef VARYINGS_NEED_PASS PackedVaryingsPassToDS vpass; #endif - - UNITY_VERTEX_OUTPUT_STEREO }; PackedVaryingsToDS PackVaryingsToDS(VaryingsToDS input) @@ -57,7 +55,6 @@ PackedVaryingsToDS PackVaryingsToDS(VaryingsToDS input) output.vpass = PackVaryingsPassToDS(input.vpass); #endif - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); return output; }