From 21a77a1677ceece7f07720ccbfc9b6dccc4e37e3 Mon Sep 17 00:00:00 2001 From: tim Date: Tue, 15 Feb 2022 13:13:22 +0100 Subject: [PATCH 01/19] Physical Camera Refactor. --- .../Camera/CameraUI.PhysicalCamera.Drawers.cs | 154 +++++++++++++++ .../Camera/CameraUI.PhysicalCamera.Skin.cs | 16 ++ .../Camera/HDCameraUI.Drawers.cs | 1 - .../HDCameraUI.PhysicalCamera.Drawers.cs | 183 +----------------- .../Camera/HDCameraUI.PhysicalCamera.Skin.cs | 28 --- .../Camera/HDCameraUI.PresetInspector.cs | 2 - .../Camera/SerializedHDCamera.cs | 20 -- .../HDAdditionalCameraData.Migration.cs | 21 +- .../Camera/HDAdditionalCameraData.cs | 17 +- .../Runtime/RenderPipeline/Camera/HDCamera.cs | 8 - .../HDRenderPipeline.PostProcess.cs | 24 +-- .../RenderPipeline/PathTracing/PathTracing.cs | 4 +- ...PipelineCameraUI.PhysicalCamera.Drawers.cs | 14 +- ...lRenderPipelineCameraUI.PresetInspector.cs | 2 - 14 files changed, 231 insertions(+), 263 deletions(-) diff --git a/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Drawers.cs b/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Drawers.cs index 8f211b34230..3be12f815b9 100644 --- a/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Drawers.cs +++ b/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Drawers.cs @@ -4,6 +4,9 @@ namespace UnityEditor.Rendering { + + using CED = CoreEditorDrawer; + /// Camera UI Shared Properties among SRP public static partial class CameraUI { @@ -119,6 +122,157 @@ public static void Drawer_PhysicalCamera_Lens_Shift(ISerializedCamera p, Editor { EditorGUILayout.PropertyField(p.baseCameraSettings.lensShift, Styles.shift); } + + public static void Drawer_PhysicalCamera_FocusDistance(ISerializedCamera p, Editor owner) + { + var cam = p.baseCameraSettings; + EditorGUILayout.PropertyField(cam.focusDistance, Styles.focusDistance); + } + + public static void Drawer_PhysicalCamera_CameraBody_ISO(ISerializedCamera p, Editor owner) + { + var cam = p.baseCameraSettings; + EditorGUILayout.PropertyField(cam.iso, Styles.ISO); + } + + static EditorPrefBoolFlags m_ShutterSpeedState = new EditorPrefBoolFlags($"HDRP:{nameof(CameraUI)}:ShutterSpeedState"); + + enum ShutterSpeedUnit + { + Second, + OneOverSecond + } + + static readonly string[] k_ShutterSpeedUnitNames = + { + "Second", + "1 \u2215 Second" // Don't use a slash here else Unity will auto-create a submenu... + }; + + public static void Drawer_PhysicalCamera_CameraBody_ShutterSpeed(ISerializedCamera p, Editor owner) + { + var cam = p.baseCameraSettings; + + // Custom layout for shutter speed + const int k_UnitMenuWidth = 90; + const int k_OffsetPerIndent = 15; + const int k_LabelFieldSeparator = 2; + const int k_Offset = 1; + int oldIndentLevel = EditorGUI.indentLevel; + + // Don't take into account the indentLevel when rendering the units field + EditorGUI.indentLevel = 0; + + var lineRect = EditorGUILayout.GetControlRect(); + var fieldRect = new Rect(k_OffsetPerIndent + k_LabelFieldSeparator + k_Offset, lineRect.y, lineRect.width - k_UnitMenuWidth, lineRect.height); + var unitMenu = new Rect(fieldRect.xMax + k_LabelFieldSeparator, lineRect.y, k_UnitMenuWidth - k_LabelFieldSeparator, lineRect.height); + + // We cannot had the shutterSpeedState as this is not a serialized property but a global edition mode. + // This imply that it will never go bold nor can be reverted in prefab overrides + + m_ShutterSpeedState.value = (ShutterSpeedUnit)EditorGUI.Popup(unitMenu, (int)m_ShutterSpeedState.value, k_ShutterSpeedUnitNames); + // Reset the indent level + EditorGUI.indentLevel = oldIndentLevel; + + EditorGUI.BeginProperty(fieldRect, Styles.shutterSpeed, cam.shutterSpeed); + { + // if we we use (1 / second) units, then change the value for the display and then revert it back + if (m_ShutterSpeedState.value == ShutterSpeedUnit.OneOverSecond && cam.shutterSpeed.floatValue > 0) + cam.shutterSpeed.floatValue = 1.0f / cam.shutterSpeed.floatValue; + EditorGUI.PropertyField(fieldRect, cam.shutterSpeed, Styles.shutterSpeed); + if (m_ShutterSpeedState.value == ShutterSpeedUnit.OneOverSecond && cam.shutterSpeed.floatValue > 0) + cam.shutterSpeed.floatValue = 1.0f / cam.shutterSpeed.floatValue; + } + EditorGUI.EndProperty(); + } + + public static void Drawer_PhysicalCamera_Lens_Aperture(ISerializedCamera p, Editor owner) + { + var cam = p.baseCameraSettings; + + // Custom layout for aperture + var rect = EditorGUILayout.BeginHorizontal(); + { + // Magic values/offsets to get the UI look consistent + const float textRectSize = 80; + const float textRectPaddingRight = 62; + const float unitRectPaddingRight = 97; + const float sliderPaddingLeft = 2; + const float sliderPaddingRight = 77; + + var labelRect = rect; + labelRect.width = EditorGUIUtility.labelWidth; + labelRect.height = EditorGUIUtility.singleLineHeight; + EditorGUI.LabelField(labelRect, Styles.aperture); + + GUI.SetNextControlName("ApertureSlider"); + var sliderRect = rect; + sliderRect.x += labelRect.width + sliderPaddingLeft; + sliderRect.width = rect.width - labelRect.width - sliderPaddingRight; + float newVal = GUI.HorizontalSlider(sliderRect, cam.aperture.floatValue, Camera.kMinAperture, Camera.kMaxAperture); + + // keep only 2 digits of precision, like the otehr editor fields + newVal = Mathf.Floor(100 * newVal) / 100.0f; + + if (cam.aperture.floatValue != newVal) + { + cam.aperture.floatValue = newVal; + // Note: We need to move the focus when the slider changes, otherwise the textField will not update + GUI.FocusControl("ApertureSlider"); + } + + var unitRect = rect; + unitRect.x += rect.width - unitRectPaddingRight; + unitRect.width = textRectSize; + unitRect.height = EditorGUIUtility.singleLineHeight; + EditorGUI.LabelField(unitRect, "f /", EditorStyles.label); + + var textRect = rect; + textRect.x = rect.width - textRectPaddingRight; + textRect.width = textRectSize; + textRect.height = EditorGUIUtility.singleLineHeight; + string newAperture = EditorGUI.TextField(textRect, cam.aperture.floatValue.ToString()); + if (float.TryParse(newAperture, out float parsedValue)) + cam.aperture.floatValue = Mathf.Clamp(parsedValue, Camera.kMinAperture, Camera.kMaxAperture); + } + + EditorGUILayout.EndHorizontal(); + EditorGUILayout.Space(EditorGUIUtility.singleLineHeight); + } + + public static void Drawer_PhysicalCamera_ApertureShape(ISerializedCamera p, Editor owner) + { + var cam = p.baseCameraSettings; + + EditorGUILayout.PropertyField(cam.bladeCount, Styles.bladeCount); + + using (var horizontal = new EditorGUILayout.HorizontalScope()) + using (var propertyScope = new EditorGUI.PropertyScope(horizontal.rect, Styles.curvature, cam.curvature)) + { + var v = cam.curvature.vector2Value; + + // The layout system breaks alignment when mixing inspector fields with custom layout'd + // fields as soon as a scrollbar is needed in the inspector, so we'll do the layout + // manually instead + const int kFloatFieldWidth = 50; + const int kSeparatorWidth = 5; + float indentOffset = EditorGUI.indentLevel * 15f; + var lineRect = EditorGUILayout.GetControlRect(); + var labelRect = new Rect(lineRect.x, lineRect.y, EditorGUIUtility.labelWidth - indentOffset, lineRect.height); + var floatFieldLeft = new Rect(labelRect.xMax, lineRect.y, kFloatFieldWidth + indentOffset, lineRect.height); + var sliderRect = new Rect(floatFieldLeft.xMax + kSeparatorWidth - indentOffset, lineRect.y, lineRect.width - labelRect.width - kFloatFieldWidth * 2 - kSeparatorWidth * 2, lineRect.height); + var floatFieldRight = new Rect(sliderRect.xMax + kSeparatorWidth - indentOffset, lineRect.y, kFloatFieldWidth + indentOffset, lineRect.height); + + EditorGUI.PrefixLabel(labelRect, propertyScope.content); + v.x = EditorGUI.FloatField(floatFieldLeft, v.x); + EditorGUI.MinMaxSlider(sliderRect, ref v.x, ref v.y, Camera.kMinAperture, Camera.kMaxAperture); + v.y = EditorGUI.FloatField(floatFieldRight, v.y); + cam.curvature.vector2Value = v; + } + + EditorGUILayout.PropertyField(cam.barrelClipping, Styles.barrelClipping); + EditorGUILayout.PropertyField(cam.anamorphism, Styles.anamorphism); + } } } } diff --git a/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Skin.cs b/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Skin.cs index 6ed88b18a18..21b9632d317 100644 --- a/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Skin.cs +++ b/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Skin.cs @@ -67,6 +67,22 @@ public static class Styles /// Shift content /// public static readonly GUIContent shift = EditorGUIUtility.TrTextContent("Shift", "Offset from the camera sensor. Use these properties to simulate a shift lens. Measured as a multiple of the sensor size."); + + // Camera Body + public static readonly GUIContent ISO = EditorGUIUtility.TrTextContent("ISO", "Sets the light sensitivity of the Camera sensor. This property affects Exposure if you set its Mode to Use Physical Camera."); + public static readonly GUIContent shutterSpeed = EditorGUIUtility.TrTextContent("Shutter Speed", "The amount of time the Camera sensor is capturing light."); + + // Lens + public static readonly GUIContent aperture = EditorGUIUtility.TrTextContent("Aperture", "The f-stop (f-number) of the lens. Lower values give a wider lens aperture."); + public static readonly GUIContent focusDistance = EditorGUIUtility.TrTextContent("Focus Distance", "The distance from the camera where objects appear sharp when Depth Of Field is enabled."); + + // Aperture Shape + public static readonly GUIContent apertureShape = EditorGUIUtility.TrTextContent("Aperture Shape", "Common sensor sizes. Choose an item to set Sensor Size, or edit Sensor Size for your custom settings."); + public static readonly GUIContent bladeCount = EditorGUIUtility.TrTextContent("Blade Count", "The number of blades in the lens aperture. Higher values give a rounder aperture shape."); + public static readonly GUIContent curvature = EditorGUIUtility.TrTextContent("Curvature", "Controls the curvature of the lens aperture blades. The minimum value results in fully-curved, perfectly-circular bokeh, and the maximum value results in visible aperture blades."); + public static readonly GUIContent barrelClipping = EditorGUIUtility.TrTextContent("Barrel Clipping", "Controls the self-occlusion of the lens, creating a cat's eye effect."); + public static readonly GUIContent anamorphism = EditorGUIUtility.TrTextContent("Anamorphism", "Use the slider to stretch the sensor to simulate an anamorphic look."); + } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs index 41d9556b7bb..9d31cc4b9e6 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs @@ -1,4 +1,3 @@ -using System.Linq; using UnityEngine; using UnityEngine.Rendering.HighDefinition; diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.PhysicalCamera.Drawers.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.PhysicalCamera.Drawers.cs index 258edd27d3a..d4adc1025e2 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.PhysicalCamera.Drawers.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.PhysicalCamera.Drawers.cs @@ -1,8 +1,3 @@ -using System; -using System.Runtime.CompilerServices; -using UnityEngine; -using UnityEngine.Rendering.HighDefinition; - namespace UnityEditor.Rendering.HighDefinition { using CED = CoreEditorDrawer; @@ -19,9 +14,9 @@ partial class PhysicalCamera CED.Group( GroupOption.Indent, CameraUI.PhysicalCamera.Drawer_PhysicalCamera_CameraBody_Sensor, - Drawer_PhysicalCamera_CameraBody_ISO, - Drawer_PhysicalCamera_CameraBody_ShutterSpeed, - Drawer_PhysicalCamera_CameraBody_GateFit + CameraUI.PhysicalCamera.Drawer_PhysicalCamera_CameraBody_ISO, + CameraUI.PhysicalCamera.Drawer_PhysicalCamera_CameraBody_ShutterSpeed, + CameraUI.PhysicalCamera.Drawer_PhysicalCamera_CameraBody_GateFit ) ), CED.Group( @@ -31,16 +26,16 @@ partial class PhysicalCamera GroupOption.Indent, CameraUI.PhysicalCamera.Drawer_PhysicalCamera_Lens_FocalLength, CameraUI.PhysicalCamera.Drawer_PhysicalCamera_Lens_Shift, - Drawer_PhysicalCamera_Lens_Aperture, - Drawer_PhysicalCamera_FocusDistance + CameraUI.PhysicalCamera.Drawer_PhysicalCamera_Lens_Aperture, + CameraUI.PhysicalCamera.Drawer_PhysicalCamera_FocusDistance ) ), CED.Group( - Styles.apertureShape, + CameraUI.PhysicalCamera.Styles.apertureShape, GroupOption.Indent, CED.Group( GroupOption.Indent, - Drawer_PhysicalCamera_ApertureShape + CameraUI.PhysicalCamera.Drawer_PhysicalCamera_ApertureShape ) ) ); @@ -53,7 +48,7 @@ partial class PhysicalCamera CED.Group( GroupOption.Indent, CameraUI.PhysicalCamera.Drawer_PhysicalCamera_CameraBody_Sensor, - Drawer_PhysicalCamera_CameraBody_GateFit + CameraUI.PhysicalCamera.Drawer_PhysicalCamera_CameraBody_GateFit ) ), CED.Group( @@ -66,168 +61,6 @@ partial class PhysicalCamera ) ) ); - - static void Drawer_PhysicalCamera_FocusDistance(SerializedHDCamera p, Editor owner) - { - EditorGUILayout.PropertyField(p.focusDistance, Styles.focusDistance); - } - - static void Drawer_PhysicalCamera_CameraBody_ISO(SerializedHDCamera p, Editor owner) - { - EditorGUILayout.PropertyField(p.iso, Styles.ISO); - } - - static EditorPrefBoolFlags m_ShutterSpeedState = new EditorPrefBoolFlags($"HDRP:{typeof(HDCameraUI).Name}:ShutterSpeedState"); - - enum ShutterSpeedUnit - { - Second, - OneOverSecond - } - - static readonly string[] k_ShutterSpeedUnitNames = - { - "Second", - "1 \u2215 Second" // Don't use a slash here else Unity will auto-create a submenu... - }; - - static void Drawer_PhysicalCamera_CameraBody_GateFit(SerializedHDCamera p, Editor owner) - { - using (var horizontal = new EditorGUILayout.HorizontalScope()) - using (var propertyScope = new EditorGUI.PropertyScope(horizontal.rect, CameraUI.PhysicalCamera.Styles.gateFit, p.gateFit)) - using (var checkScope = new EditorGUI.ChangeCheckScope()) - { - int gateValue = (int)(Camera.GateFitMode)EditorGUILayout.EnumPopup(propertyScope.content, (Camera.GateFitMode)p.gateFit.intValue); - if (checkScope.changed) - { - p.gateFit.intValue = gateValue; - } - // Change same property on base camera - p.baseCameraSettings.gateFit.intValue = gateValue; - } - } - - static void Drawer_PhysicalCamera_CameraBody_ShutterSpeed(SerializedHDCamera p, Editor owner) - { - // Custom layout for shutter speed - const int k_UnitMenuWidth = 90; - const int k_OffsetPerIndent = 15; - const int k_LabelFieldSeparator = 2; - const int k_Offset = 1; - int oldIndentLevel = EditorGUI.indentLevel; - - // Don't take into account the indentLevel when rendering the units field - EditorGUI.indentLevel = 0; - - var lineRect = EditorGUILayout.GetControlRect(); - var fieldRect = new Rect(k_OffsetPerIndent + k_LabelFieldSeparator + k_Offset, lineRect.y, lineRect.width - k_UnitMenuWidth, lineRect.height); - var unitMenu = new Rect(fieldRect.xMax + k_LabelFieldSeparator, lineRect.y, k_UnitMenuWidth - k_LabelFieldSeparator, lineRect.height); - - // We cannot had the shutterSpeedState as this is not a serialized property but a global edition mode. - // This imply that it will never go bold nor can be reverted in prefab overrides - - m_ShutterSpeedState.value = (ShutterSpeedUnit)EditorGUI.Popup(unitMenu, (int)m_ShutterSpeedState.value, k_ShutterSpeedUnitNames); - // Reset the indent level - EditorGUI.indentLevel = oldIndentLevel; - - EditorGUI.BeginProperty(fieldRect, Styles.shutterSpeed, p.shutterSpeed); - { - // if we we use (1 / second) units, then change the value for the display and then revert it back - if (m_ShutterSpeedState.value == ShutterSpeedUnit.OneOverSecond && p.shutterSpeed.floatValue > 0) - p.shutterSpeed.floatValue = 1.0f / p.shutterSpeed.floatValue; - EditorGUI.PropertyField(fieldRect, p.shutterSpeed, Styles.shutterSpeed); - if (m_ShutterSpeedState.value == ShutterSpeedUnit.OneOverSecond && p.shutterSpeed.floatValue > 0) - p.shutterSpeed.floatValue = 1.0f / p.shutterSpeed.floatValue; - } - EditorGUI.EndProperty(); - } - - static void Drawer_PhysicalCamera_Lens_Aperture(SerializedHDCamera p, Editor owner) - { - // Custom layout for aperture - var rect = EditorGUILayout.BeginHorizontal(); - { - // Magic values/offsets to get the UI look consistent - const float textRectSize = 80; - const float textRectPaddingRight = 62; - const float unitRectPaddingRight = 97; - const float sliderPaddingLeft = 2; - const float sliderPaddingRight = 77; - - var labelRect = rect; - labelRect.width = EditorGUIUtility.labelWidth; - labelRect.height = EditorGUIUtility.singleLineHeight; - EditorGUI.LabelField(labelRect, Styles.aperture); - - GUI.SetNextControlName("ApertureSlider"); - var sliderRect = rect; - sliderRect.x += labelRect.width + sliderPaddingLeft; - sliderRect.width = rect.width - labelRect.width - sliderPaddingRight; - float newVal = GUI.HorizontalSlider(sliderRect, p.aperture.floatValue, HDPhysicalCamera.kMinAperture, HDPhysicalCamera.kMaxAperture); - - // keep only 2 digits of precision, like the otehr editor fields - newVal = Mathf.Floor(100 * newVal) / 100.0f; - - if (p.aperture.floatValue != newVal) - { - p.aperture.floatValue = newVal; - // Note: We need to move the focus when the slider changes, otherwise the textField will not update - GUI.FocusControl("ApertureSlider"); - } - - var unitRect = rect; - unitRect.x += rect.width - unitRectPaddingRight; - unitRect.width = textRectSize; - unitRect.height = EditorGUIUtility.singleLineHeight; - EditorGUI.LabelField(unitRect, "f /", EditorStyles.label); - - var textRect = rect; - textRect.x = rect.width - textRectPaddingRight; - textRect.width = textRectSize; - textRect.height = EditorGUIUtility.singleLineHeight; - string newAperture = EditorGUI.TextField(textRect, p.aperture.floatValue.ToString()); - if (float.TryParse(newAperture, out float parsedValue)) - p.aperture.floatValue = Mathf.Clamp(parsedValue, HDPhysicalCamera.kMinAperture, HDPhysicalCamera.kMaxAperture); - } - - EditorGUILayout.EndHorizontal(); - EditorGUILayout.Space(EditorGUIUtility.singleLineHeight); - } - - static void Drawer_PhysicalCamera_ApertureShape(SerializedHDCamera p, Editor owner) - { - var cam = p.baseCameraSettings; - - EditorGUILayout.PropertyField(p.bladeCount, Styles.bladeCount); - - using (var horizontal = new EditorGUILayout.HorizontalScope()) - using (var propertyScope = new EditorGUI.PropertyScope(horizontal.rect, Styles.curvature, p.curvature)) - { - var v = p.curvature.vector2Value; - - // The layout system breaks alignment when mixing inspector fields with custom layout'd - // fields as soon as a scrollbar is needed in the inspector, so we'll do the layout - // manually instead - const int kFloatFieldWidth = 50; - const int kSeparatorWidth = 5; - float indentOffset = EditorGUI.indentLevel * 15f; - var lineRect = EditorGUILayout.GetControlRect(); - var labelRect = new Rect(lineRect.x, lineRect.y, EditorGUIUtility.labelWidth - indentOffset, lineRect.height); - var floatFieldLeft = new Rect(labelRect.xMax, lineRect.y, kFloatFieldWidth + indentOffset, lineRect.height); - var sliderRect = new Rect(floatFieldLeft.xMax + kSeparatorWidth - indentOffset, lineRect.y, lineRect.width - labelRect.width - kFloatFieldWidth * 2 - kSeparatorWidth * 2, lineRect.height); - var floatFieldRight = new Rect(sliderRect.xMax + kSeparatorWidth - indentOffset, lineRect.y, kFloatFieldWidth + indentOffset, lineRect.height); - - EditorGUI.PrefixLabel(labelRect, propertyScope.content); - v.x = EditorGUI.FloatField(floatFieldLeft, v.x); - EditorGUI.MinMaxSlider(sliderRect, ref v.x, ref v.y, HDPhysicalCamera.kMinAperture, HDPhysicalCamera.kMaxAperture); - v.y = EditorGUI.FloatField(floatFieldRight, v.y); - - p.curvature.vector2Value = v; - } - - EditorGUILayout.PropertyField(p.barrelClipping, Styles.barrelClipping); - EditorGUILayout.PropertyField(p.anamorphism, Styles.anamorphism); - } } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.PhysicalCamera.Skin.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.PhysicalCamera.Skin.cs index 30c93810df7..8b137891791 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.PhysicalCamera.Skin.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.PhysicalCamera.Skin.cs @@ -1,29 +1 @@ -using System.Linq; -using UnityEngine; -namespace UnityEditor.Rendering.HighDefinition -{ - static partial class HDCameraUI - { - partial class PhysicalCamera - { - class Styles - { - // Camera Body - public static readonly GUIContent ISO = EditorGUIUtility.TrTextContent("ISO", "Sets the light sensitivity of the Camera sensor. This property affects Exposure if you set its Mode to Use Physical Camera."); - public static readonly GUIContent shutterSpeed = EditorGUIUtility.TrTextContent("Shutter Speed", "The amount of time the Camera sensor is capturing light."); - - // Lens - public static readonly GUIContent aperture = EditorGUIUtility.TrTextContent("Aperture", "The f-stop (f-number) of the lens. Lower values give a wider lens aperture."); - public static readonly GUIContent focusDistance = EditorGUIUtility.TrTextContent("Focus Distance", "The distance from the camera where objects appear sharp when Depth Of Field is enabled."); - - // Aperture Shape - public static readonly GUIContent apertureShape = EditorGUIUtility.TrTextContent("Aperture Shape", "Common sensor sizes. Choose an item to set Sensor Size, or edit Sensor Size for your custom settings."); - public static readonly GUIContent bladeCount = EditorGUIUtility.TrTextContent("Blade Count", "The number of blades in the lens aperture. Higher values give a rounder aperture shape."); - public static readonly GUIContent curvature = EditorGUIUtility.TrTextContent("Curvature", "Controls the curvature of the lens aperture blades. The minimum value results in fully-curved, perfectly-circular bokeh, and the maximum value results in visible aperture blades."); - public static readonly GUIContent barrelClipping = EditorGUIUtility.TrTextContent("Barrel Clipping", "Controls the self-occlusion of the lens, creating a cat's eye effect."); - public static readonly GUIContent anamorphism = EditorGUIUtility.TrTextContent("Anamorphism", "Use the slider to stretch the sensor to simulate an anamorphic look."); - } - } - } -} diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.PresetInspector.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.PresetInspector.cs index da3552b8932..427f261c5a7 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.PresetInspector.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.PresetInspector.cs @@ -1,6 +1,4 @@ -using System.Linq; using UnityEngine; -using UnityEngine.Rendering.HighDefinition; namespace UnityEditor.Rendering.HighDefinition { diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/SerializedHDCamera.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/SerializedHDCamera.cs index e13b17670a3..c6d96dcb5ee 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/SerializedHDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/SerializedHDCamera.cs @@ -21,15 +21,6 @@ class SerializedHDCamera : ISerializedCamera public SerializedProperty antialiasing { get; } // HDRP specific properties - public SerializedProperty gateFit; - public SerializedProperty focusDistance; - public SerializedProperty iso; - public SerializedProperty shutterSpeed; - public SerializedProperty aperture; - public SerializedProperty bladeCount; - public SerializedProperty curvature; - public SerializedProperty barrelClipping; - public SerializedProperty anamorphism; public SerializedProperty exposureTarget; public SerializedProperty allowDeepLearningSuperSampling; @@ -83,17 +74,6 @@ public SerializedHDCamera(SerializedObject serializedObject) clearDepth = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.clearDepth); antialiasing = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.antialiasing); - // HDRP specific properties - gateFit = serializedAdditionalDataObject.FindProperty("physicalParameters.m_GateFit"); - focusDistance = serializedAdditionalDataObject.FindProperty("physicalParameters.m_FocusDistance"); - iso = serializedAdditionalDataObject.FindProperty("physicalParameters.m_Iso"); - shutterSpeed = serializedAdditionalDataObject.FindProperty("physicalParameters.m_ShutterSpeed"); - aperture = serializedAdditionalDataObject.FindProperty("physicalParameters.m_Aperture"); - bladeCount = serializedAdditionalDataObject.FindProperty("physicalParameters.m_BladeCount"); - curvature = serializedAdditionalDataObject.FindProperty("physicalParameters.m_Curvature"); - barrelClipping = serializedAdditionalDataObject.FindProperty("physicalParameters.m_BarrelClipping"); - anamorphism = serializedAdditionalDataObject.FindProperty("physicalParameters.m_Anamorphism"); - exposureTarget = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.exposureTarget); allowDeepLearningSuperSampling = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.allowDeepLearningSuperSampling); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.Migration.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.Migration.cs index e3ba9fc8086..49b70119c11 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.Migration.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.Migration.cs @@ -28,13 +28,15 @@ protected enum Version AddCustomPostprocessAndCustomPass, /// Version Step. UpdateMSAA, + /// Version Step. + UpdatePhysicalCameraPropertiesToCore } [SerializeField, FormerlySerializedAs("version")] [ExcludeCopy] Version m_Version = MigrationDescription.LastVersion(); - static readonly MigrationDescription k_Migration = MigrationDescription.New( + private static readonly MigrationDescription k_Migration = MigrationDescription.New( MigrationStep.New(Version.SeparatePassThrough, (HDAdditionalCameraData data) => { #pragma warning disable 618 // Type or member is obsolete @@ -76,6 +78,23 @@ protected enum Version MigrationStep.New(Version.UpdateMSAA, (HDAdditionalCameraData data) => { FrameSettings.MigrateMSAA(ref data.renderingPathCustomFrameSettings, ref data.renderingPathCustomFrameSettingsOverrideMask); + }), + MigrationStep.New(Version.UpdatePhysicalCameraPropertiesToCore, (HDAdditionalCameraData data) => + { + var camera = data.GetComponent(); + var physicalProps = data.physicalParameters; + if (camera != null) + { + camera.iso = physicalProps.iso; + camera.shutterSpeed = physicalProps.shutterSpeed; + camera.aperture = physicalProps.aperture; + camera.focusDistance = physicalProps.focusDistance; + camera.gateFit = physicalProps.m_GateFit; + camera.bladeCount = physicalProps.bladeCount; + camera.curvature = physicalProps.curvature; + camera.barrelClipping = physicalProps.barrelClipping; + camera.anamorphism = physicalProps.anamorphism; + } }) ); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs index 527380ac356..44bae089ee1 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs @@ -8,6 +8,7 @@ namespace UnityEngine.Rendering.HighDefinition /// Holds the physical settings set on cameras. /// [Serializable] + [Obsolete("Properties have been migrated to Camera class")] public struct HDPhysicalCamera { /// @@ -36,14 +37,14 @@ public struct HDPhysicalCamera // Lens // Note: focalLength is already defined in the regular camera component - [SerializeField] [Range(kMinAperture, kMaxAperture)] float m_Aperture; + [SerializeField] [Range(Camera.kMinAperture, Camera.kMaxAperture)] float m_Aperture; [SerializeField] [Min(0.1f)] float m_FocusDistance; #pragma warning disable 0414 - [SerializeField] Camera.GateFitMode m_GateFit; // This is private with no public access because it is mainly just used to drive UX, the code should still access the main camera version. + [SerializeField] internal Camera.GateFitMode m_GateFit; // This is private with no public access because it is mainly just used to drive UX, the code should still access the main camera version. #pragma warning restore 0414 // Aperture shape - [SerializeField] [Range(kMinBladeCount, kMaxBladeCount)] int m_BladeCount; + [SerializeField] [Range(Camera.kMinBladeCount, Camera.kMaxBladeCount)] int m_BladeCount; [SerializeField] Vector2 m_Curvature; [SerializeField] [Range(0f, 1f)] float m_BarrelClipping; [SerializeField] [Range(-1f, 1f)] float m_Anamorphism; @@ -81,7 +82,7 @@ public float shutterSpeed public float aperture { get => m_Aperture; - set => m_Aperture = Mathf.Clamp(value, kMinAperture, kMaxAperture); + set => m_Aperture = Mathf.Clamp(value, Camera.kMinAperture, Camera.kMaxAperture); } /// @@ -90,7 +91,7 @@ public float aperture public int bladeCount { get => m_BladeCount; - set => m_BladeCount = Mathf.Clamp(value, kMinBladeCount, kMaxBladeCount); + set => m_BladeCount = Mathf.Clamp(value, Camera.kMinBladeCount, Camera.kMaxBladeCount); } /// @@ -101,8 +102,8 @@ public Vector2 curvature get => m_Curvature; set { - m_Curvature.x = Mathf.Max(value.x, kMinAperture); - m_Curvature.y = Mathf.Min(value.y, kMaxAperture); + m_Curvature.x = Mathf.Max(value.x, Camera.kMinAperture); + m_Curvature.y = Mathf.Min(value.y, Camera.kMaxAperture); } } @@ -335,6 +336,7 @@ public enum TAAQualityLevel /// Physical camera parameters. [ValueCopy] // reference should not be same. only content. + [Obsolete("Physical camera properties have been migrated to Camera.")] public HDPhysicalCamera physicalParameters = HDPhysicalCamera.GetDefaults(); /// Vertical flip mode. @@ -622,7 +624,6 @@ public void CopyTo(HDAdditionalCameraData data) data.probeLayerMask = probeLayerMask; data.hasPersistentHistory = hasPersistentHistory; data.exposureTarget = exposureTarget; - physicalParameters = data.physicalParameters; data.renderingPathCustomFrameSettings = renderingPathCustomFrameSettings; data.renderingPathCustomFrameSettingsOverrideMask = renderingPathCustomFrameSettingsOverrideMask; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index 5fa4c69084b..b41ccf2251b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -618,10 +618,6 @@ RTHandle Allocator(string id, int frameIndex, RTHandleSystem rtHandleSystem) internal bool allowDynamicResolution => m_AdditionalCameraData != null && m_AdditionalCameraData.allowDynamicResolution; - // We set the values of the physical camera in the Update() call. Here we initialize with - // the defaults, in case someone is trying to access the values before the first Update - internal HDPhysicalCamera physicalParameters { get; private set; } = HDPhysicalCamera.GetDefaults(); - internal IEnumerable aovRequests => m_AdditionalCameraData != null && !m_AdditionalCameraData.Equals(null) ? m_AdditionalCameraData.aovRequests @@ -1697,7 +1693,6 @@ void UpdateVolumeAndPhysicalParameters() { volumeLayerMask = m_AdditionalCameraData.volumeLayerMask; volumeAnchor = m_AdditionalCameraData.volumeAnchorOverride; - physicalParameters = m_AdditionalCameraData.physicalParameters; } else { @@ -1715,7 +1710,6 @@ void UpdateVolumeAndPhysicalParameters() { volumeLayerMask = mainCamAdditionalData.volumeLayerMask; volumeAnchor = mainCamAdditionalData.volumeAnchorOverride; - physicalParameters = mainCamAdditionalData.physicalParameters; needFallback = false; } } @@ -1723,8 +1717,6 @@ void UpdateVolumeAndPhysicalParameters() if (needFallback) { volumeLayerMask = GetSceneViewLayerMaskFallback(); - // Use the default physical camera values so the exposure will look reasonable - physicalParameters = HDPhysicalCamera.GetDefaults(); } } } 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 2879443b4d0..6b8a767aa6c 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 @@ -154,9 +154,6 @@ public RTHandle Allocator(string id, int frameIndex, RTHandleSystem rtHandleSyst // Debug Exposure compensation (Drive by debug menu) to add to all exposure processed value float m_DebugExposureCompensation; - // Physical camera copy - HDPhysicalCamera m_PhysicalCamera; - // HDRP has the following behavior regarding alpha: // - If post processing is disabled, the alpha channel of the rendering passes (if any) will be passed to the frame buffer by the final pass // - If post processing is enabled, then post processing passes will either copy (exposure, color grading, etc) or process (DoF, TAA, etc) the alpha channel, if one exists. @@ -324,9 +321,6 @@ void BeginPostProcessFrame(CommandBuffer cmd, HDCamera camera, HDRenderPipeline m_AfterDynamicResUpscaleRes = new Vector2Int((int)Mathf.Round(camera.finalViewport.width), (int)Mathf.Round(camera.finalViewport.height)); m_BeforeDynamicResUpscaleRes = new Vector2Int(camera.actualWidth, camera.actualHeight); - // Grab a copy of the physical camera settings - m_PhysicalCamera = camera.physicalParameters; - // Prefetch all the volume components we need to save some cycles as most of these will // be needed in multiple places var stack = camera.volumeStack; @@ -983,7 +977,7 @@ void DoFixedExposure(HDCamera hdCamera, CommandBuffer cmd) else // ExposureMode.UsePhysicalCamera { kernel = cs.FindKernel("KManualCameraExposure"); - exposureParams = new Vector4(m_Exposure.compensation.value + m_DebugExposureCompensation, m_PhysicalCamera.aperture, m_PhysicalCamera.shutterSpeed, m_PhysicalCamera.iso); + exposureParams = new Vector4(m_Exposure.compensation.value + m_DebugExposureCompensation, hdCamera.camera.aperture, hdCamera.camera.shutterSpeed, hdCamera.camera.iso); } cmd.SetComputeVectorParam(cs, HDShaderIDs._ExposureParams, exposureParams); @@ -2076,11 +2070,11 @@ DepthOfFieldParameters PrepareDoFParameters(HDCamera camera) parameters.threadGroup8 = new Vector2Int(threadGroup8X, threadGroup8Y); - parameters.physicalCameraCurvature = m_PhysicalCamera.curvature; - parameters.physicalCameraAnamorphism = m_PhysicalCamera.anamorphism; - parameters.physicalCameraAperture = m_PhysicalCamera.aperture; - parameters.physicalCameraBarrelClipping = m_PhysicalCamera.barrelClipping; - parameters.physicalCameraBladeCount = m_PhysicalCamera.bladeCount; + parameters.physicalCameraCurvature = camera.camera.curvature; + parameters.physicalCameraAnamorphism = camera.camera.anamorphism; + parameters.physicalCameraAperture = camera.camera.aperture; + parameters.physicalCameraBarrelClipping = camera.camera.barrelClipping; + parameters.physicalCameraBladeCount = camera.camera.bladeCount; parameters.nearFocusStart = m_DepthOfField.nearFocusStart.value; parameters.nearFocusEnd = m_DepthOfField.nearFocusEnd.value; @@ -2090,7 +2084,7 @@ DepthOfFieldParameters PrepareDoFParameters(HDCamera camera) if (m_DepthOfField.focusDistanceMode.value == FocusDistanceMode.Volume) parameters.focusDistance = m_DepthOfField.focusDistance.value; else - parameters.focusDistance = m_PhysicalCamera.focusDistance; + parameters.focusDistance = camera.camera.focusDistance; parameters.focusMode = m_DepthOfField.focusMode.value; @@ -2247,7 +2241,7 @@ static void DoDepthOfField(in DepthOfFieldParameters dofParameters, CommandBuffe int bladeCount = dofParameters.physicalCameraBladeCount; - float rotation = (dofParameters.physicalCameraAperture - HDPhysicalCamera.kMinAperture) / (HDPhysicalCamera.kMaxAperture - HDPhysicalCamera.kMinAperture); + float rotation = (dofParameters.physicalCameraAperture - Camera.kMinAperture) / (Camera.kMaxAperture - Camera.kMinAperture); rotation *= (360f / bladeCount) * Mathf.Deg2Rad; // TODO: Crude approximation, make it correct float ngonFactor = 1f; @@ -3862,7 +3856,7 @@ void PrepareBloomData(RenderGraph renderGraph, in RenderGraphBuilder builder, Bl if (m_Bloom.anamorphic.value) { // Positive anamorphic ratio values distort vertically - negative is horizontal - float anamorphism = m_PhysicalCamera.anamorphism * 0.5f; + float anamorphism = camera.camera.anamorphism * 0.5f; scaleW *= anamorphism < 0 ? 1f + anamorphism : 1f; scaleH *= anamorphism > 0 ? 1f - anamorphism : 1f; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/PathTracing.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/PathTracing.cs index 40352a8d802..40121368eb5 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/PathTracing.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/PathTracing.cs @@ -277,9 +277,9 @@ private Vector4 ComputeDoFConstants(HDCamera hdCamera, PathTracing settings) bool enableDof = (dofSettings.focusMode.value == DepthOfFieldMode.UsePhysicalCamera) && !(hdCamera.camera.cameraType == CameraType.SceneView); // focalLength is in mm, so we need to convert to meters. We also want the aperture radius, not diameter, so we divide by two. - float apertureRadius = (enableDof && hdCamera.physicalParameters.aperture > 0) ? 0.5f * 0.001f * hdCamera.camera.focalLength / hdCamera.physicalParameters.aperture : 0.0f; + float apertureRadius = (enableDof && hdCamera.camera.aperture > 0) ? 0.5f * 0.001f * hdCamera.camera.focalLength / hdCamera.camera.aperture : 0.0f; - float focusDistance = (dofSettings.focusDistanceMode.value == FocusDistanceMode.Volume) ? dofSettings.focusDistance.value : hdCamera.physicalParameters.focusDistance; + float focusDistance = (dofSettings.focusDistanceMode.value == FocusDistanceMode.Volume) ? dofSettings.focusDistance.value : hdCamera.camera.focusDistance; return new Vector4(apertureRadius, focusDistance, 0.0f, 0.0f); } diff --git a/com.unity.render-pipelines.universal/Editor/Camera/UniversalRenderPipelineCameraUI.PhysicalCamera.Drawers.cs b/com.unity.render-pipelines.universal/Editor/Camera/UniversalRenderPipelineCameraUI.PhysicalCamera.Drawers.cs index b79f0545473..5697d67c208 100644 --- a/com.unity.render-pipelines.universal/Editor/Camera/UniversalRenderPipelineCameraUI.PhysicalCamera.Drawers.cs +++ b/com.unity.render-pipelines.universal/Editor/Camera/UniversalRenderPipelineCameraUI.PhysicalCamera.Drawers.cs @@ -14,6 +14,8 @@ public partial class PhysicalCamera CED.Group( GroupOption.Indent, CameraUI.PhysicalCamera.Drawer_PhysicalCamera_CameraBody_Sensor, + CameraUI.PhysicalCamera.Drawer_PhysicalCamera_CameraBody_ISO, + CameraUI.PhysicalCamera.Drawer_PhysicalCamera_CameraBody_ShutterSpeed, CameraUI.PhysicalCamera.Drawer_PhysicalCamera_CameraBody_GateFit ) ), @@ -23,7 +25,17 @@ public partial class PhysicalCamera CED.Group( GroupOption.Indent, CameraUI.PhysicalCamera.Drawer_PhysicalCamera_Lens_FocalLength, - CameraUI.PhysicalCamera.Drawer_PhysicalCamera_Lens_Shift + CameraUI.PhysicalCamera.Drawer_PhysicalCamera_Lens_Shift, + CameraUI.PhysicalCamera.Drawer_PhysicalCamera_Lens_Aperture, + CameraUI.PhysicalCamera.Drawer_PhysicalCamera_FocusDistance + ) + ), + CED.Group( + CameraUI.PhysicalCamera.Styles.apertureShape, + GroupOption.Indent, + CED.Group( + GroupOption.Indent, + CameraUI.PhysicalCamera.Drawer_PhysicalCamera_ApertureShape ) ) ); diff --git a/com.unity.render-pipelines.universal/Editor/Camera/UniversalRenderPipelineCameraUI.PresetInspector.cs b/com.unity.render-pipelines.universal/Editor/Camera/UniversalRenderPipelineCameraUI.PresetInspector.cs index 0ecd9ab0eec..d6d483e6277 100644 --- a/com.unity.render-pipelines.universal/Editor/Camera/UniversalRenderPipelineCameraUI.PresetInspector.cs +++ b/com.unity.render-pipelines.universal/Editor/Camera/UniversalRenderPipelineCameraUI.PresetInspector.cs @@ -1,6 +1,4 @@ using UnityEngine; -using UnityEngine.Rendering; -using UnityEngine.Rendering.Universal; namespace UnityEditor.Rendering.Universal { From 56b034be0274aa9364f3e59ef34f12eeab1cc8fd Mon Sep 17 00:00:00 2001 From: Tim Cooper Date: Wed, 16 Feb 2022 10:45:42 +0100 Subject: [PATCH 02/19] Update com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Drawers.cs Co-authored-by: alex-vazquez <76204843+alex-vazquez@users.noreply.github.com> --- .../Editor/Camera/CameraUI.PhysicalCamera.Drawers.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Drawers.cs b/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Drawers.cs index 3be12f815b9..4965da81518 100644 --- a/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Drawers.cs +++ b/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Drawers.cs @@ -139,16 +139,12 @@ public static void Drawer_PhysicalCamera_CameraBody_ISO(ISerializedCamera p, Edi enum ShutterSpeedUnit { + [InspectorName("Second")] Second, + [InpsectorName("1 \u2215 Second")] // Don't use a slash here else Unity will auto-create a submenu... OneOverSecond } - static readonly string[] k_ShutterSpeedUnitNames = - { - "Second", - "1 \u2215 Second" // Don't use a slash here else Unity will auto-create a submenu... - }; - public static void Drawer_PhysicalCamera_CameraBody_ShutterSpeed(ISerializedCamera p, Editor owner) { var cam = p.baseCameraSettings; From 88ac62a28658ab43cccf8824377093be317e41eb Mon Sep 17 00:00:00 2001 From: Tim Cooper Date: Wed, 16 Feb 2022 10:45:47 +0100 Subject: [PATCH 03/19] Update com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Drawers.cs Co-authored-by: alex-vazquez <76204843+alex-vazquez@users.noreply.github.com> --- .../Editor/Camera/CameraUI.PhysicalCamera.Drawers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Drawers.cs b/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Drawers.cs index 4965da81518..bdc7db9a74f 100644 --- a/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Drawers.cs +++ b/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Drawers.cs @@ -166,7 +166,7 @@ public static void Drawer_PhysicalCamera_CameraBody_ShutterSpeed(ISerializedCame // We cannot had the shutterSpeedState as this is not a serialized property but a global edition mode. // This imply that it will never go bold nor can be reverted in prefab overrides - m_ShutterSpeedState.value = (ShutterSpeedUnit)EditorGUI.Popup(unitMenu, (int)m_ShutterSpeedState.value, k_ShutterSpeedUnitNames); + m_ShutterSpeedState.value = (ShutterSpeedUnit)EditorGUI.EnumPopup(unitMenu, m_ShutterSpeedState.value); // Reset the indent level EditorGUI.indentLevel = oldIndentLevel; From 9dcddb1165d2865f0911669d6800a48347f513b6 Mon Sep 17 00:00:00 2001 From: Tim Cooper Date: Wed, 16 Feb 2022 10:46:03 +0100 Subject: [PATCH 04/19] Update com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.Migration.cs Co-authored-by: alex-vazquez <76204843+alex-vazquez@users.noreply.github.com> --- .../HDAdditionalCameraData.Migration.cs | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.Migration.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.Migration.cs index 49b70119c11..bd6c7f6d081 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.Migration.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.Migration.cs @@ -82,19 +82,22 @@ protected enum Version MigrationStep.New(Version.UpdatePhysicalCameraPropertiesToCore, (HDAdditionalCameraData data) => { var camera = data.GetComponent(); + if (camera == null) return; var physicalProps = data.physicalParameters; - if (camera != null) + if (physicalProps == null) { - camera.iso = physicalProps.iso; - camera.shutterSpeed = physicalProps.shutterSpeed; - camera.aperture = physicalProps.aperture; - camera.focusDistance = physicalProps.focusDistance; - camera.gateFit = physicalProps.m_GateFit; - camera.bladeCount = physicalProps.bladeCount; - camera.curvature = physicalProps.curvature; - camera.barrelClipping = physicalProps.barrelClipping; - camera.anamorphism = physicalProps.anamorphism; + Debug.Log($"Unable to execute migration step `{Version.UpdatePhysicalCameraPropertiesToCore}` migrate camera {camera.name} as the physicalParameters is null"); + return; } + camera.iso = physicalProps.iso; + camera.shutterSpeed = physicalProps.shutterSpeed; + camera.aperture = physicalProps.aperture; + camera.focusDistance = physicalProps.focusDistance; + camera.gateFit = physicalProps.m_GateFit; + camera.bladeCount = physicalProps.bladeCount; + camera.curvature = physicalProps.curvature; + camera.barrelClipping = physicalProps.barrelClipping; + camera.anamorphism = physicalProps.anamorphism; }) ); From 6cf7ceb8fe7e7bbbb8a2dc82a33bc6d4ca1873b6 Mon Sep 17 00:00:00 2001 From: Tim Cooper Date: Wed, 16 Feb 2022 10:46:30 +0100 Subject: [PATCH 05/19] Update com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs Co-authored-by: alex-vazquez <76204843+alex-vazquez@users.noreply.github.com> --- .../Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs index 44bae089ee1..46b62c9649c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs @@ -336,7 +336,7 @@ public enum TAAQualityLevel /// Physical camera parameters. [ValueCopy] // reference should not be same. only content. - [Obsolete("Physical camera properties have been migrated to Camera.")] + [Obsolete("Physical camera properties have been migrated to Camera.", false)] public HDPhysicalCamera physicalParameters = HDPhysicalCamera.GetDefaults(); /// Vertical flip mode. From bfe6c5d597c9c01bae2617405accf751ce34c4f1 Mon Sep 17 00:00:00 2001 From: Tim Cooper Date: Wed, 16 Feb 2022 10:46:54 +0100 Subject: [PATCH 06/19] Update com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs Co-authored-by: alex-vazquez <76204843+alex-vazquez@users.noreply.github.com> --- .../Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs index 46b62c9649c..7b04539e7a3 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs @@ -8,7 +8,7 @@ namespace UnityEngine.Rendering.HighDefinition /// Holds the physical settings set on cameras. /// [Serializable] - [Obsolete("Properties have been migrated to Camera class")] + [Obsolete("Properties have been migrated to Camera class", false)] public struct HDPhysicalCamera { /// From 18fa024e0edf32c2cb5bb5198af162dd7f0d3e70 Mon Sep 17 00:00:00 2001 From: tim Date: Wed, 16 Feb 2022 11:19:09 +0100 Subject: [PATCH 07/19] PR Feedback --- .../Camera/CameraUI.PhysicalCamera.Drawers.cs | 18 ++++++++- .../Camera/CameraUI.PhysicalCamera.Skin.cs | 39 +++++++++++++++++-- .../HDAdditionalCameraData.Migration.cs | 23 +++++------ .../HDRenderPipeline.PostProcess.cs | 23 +++++------ 4 files changed, 74 insertions(+), 29 deletions(-) diff --git a/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Drawers.cs b/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Drawers.cs index bdc7db9a74f..2ae770078b8 100644 --- a/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Drawers.cs +++ b/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Drawers.cs @@ -123,12 +123,19 @@ public static void Drawer_PhysicalCamera_Lens_Shift(ISerializedCamera p, Editor EditorGUILayout.PropertyField(p.baseCameraSettings.lensShift, Styles.shift); } + + /// Draws Focus Distance related fields on the inspector + /// The serialized camera + /// The editor owner calling this drawer public static void Drawer_PhysicalCamera_FocusDistance(ISerializedCamera p, Editor owner) { var cam = p.baseCameraSettings; EditorGUILayout.PropertyField(cam.focusDistance, Styles.focusDistance); } + /// Draws ISO related fields on the inspector + /// The serialized camera + /// The editor owner calling this drawer public static void Drawer_PhysicalCamera_CameraBody_ISO(ISerializedCamera p, Editor owner) { var cam = p.baseCameraSettings; @@ -141,10 +148,13 @@ enum ShutterSpeedUnit { [InspectorName("Second")] Second, - [InpsectorName("1 \u2215 Second")] // Don't use a slash here else Unity will auto-create a submenu... + [InspectorName("1 \u2215 Second")] // Don't use a slash here else Unity will auto-create a submenu... OneOverSecond } + /// Draws Shutter Speed related fields on the inspector + /// The serialized camera + /// The editor owner calling this drawer public static void Drawer_PhysicalCamera_CameraBody_ShutterSpeed(ISerializedCamera p, Editor owner) { var cam = p.baseCameraSettings; @@ -182,6 +192,9 @@ public static void Drawer_PhysicalCamera_CameraBody_ShutterSpeed(ISerializedCame EditorGUI.EndProperty(); } + /// Draws Lens Aperture related fields on the inspector + /// The serialized camera + /// The editor owner calling this drawer public static void Drawer_PhysicalCamera_Lens_Aperture(ISerializedCamera p, Editor owner) { var cam = p.baseCameraSettings; @@ -236,6 +249,9 @@ public static void Drawer_PhysicalCamera_Lens_Aperture(ISerializedCamera p, Edit EditorGUILayout.Space(EditorGUIUtility.singleLineHeight); } + /// Draws Aperture Shape related fields on the inspector + /// The serialized camera + /// The editor owner calling this drawer public static void Drawer_PhysicalCamera_ApertureShape(ISerializedCamera p, Editor owner) { var cam = p.baseCameraSettings; diff --git a/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Skin.cs b/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Skin.cs index 21b9632d317..0c1d5aa6020 100644 --- a/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Skin.cs +++ b/com.unity.render-pipelines.core/Editor/Camera/CameraUI.PhysicalCamera.Skin.cs @@ -59,7 +59,7 @@ public static class Styles public static readonly GUIContent lens = EditorGUIUtility.TrTextContent("Lens"); /// - /// Focal Length Content + /// Focal Length content /// public static readonly GUIContent focalLength = EditorGUIUtility.TrTextContent("Focal Length", "The simulated distance between the lens and the sensor of the physical camera. Larger values give a narrower field of view."); @@ -68,21 +68,52 @@ public static class Styles /// public static readonly GUIContent shift = EditorGUIUtility.TrTextContent("Shift", "Offset from the camera sensor. Use these properties to simulate a shift lens. Measured as a multiple of the sensor size."); - // Camera Body + /// + /// ISO content + /// public static readonly GUIContent ISO = EditorGUIUtility.TrTextContent("ISO", "Sets the light sensitivity of the Camera sensor. This property affects Exposure if you set its Mode to Use Physical Camera."); + + /// + /// Shutter Speed content + /// public static readonly GUIContent shutterSpeed = EditorGUIUtility.TrTextContent("Shutter Speed", "The amount of time the Camera sensor is capturing light."); - // Lens + /// + /// Aperture content + /// public static readonly GUIContent aperture = EditorGUIUtility.TrTextContent("Aperture", "The f-stop (f-number) of the lens. Lower values give a wider lens aperture."); + + /// + /// Focus Distance content + /// public static readonly GUIContent focusDistance = EditorGUIUtility.TrTextContent("Focus Distance", "The distance from the camera where objects appear sharp when Depth Of Field is enabled."); // Aperture Shape + + /// + /// Aperture Shape content + /// public static readonly GUIContent apertureShape = EditorGUIUtility.TrTextContent("Aperture Shape", "Common sensor sizes. Choose an item to set Sensor Size, or edit Sensor Size for your custom settings."); + + /// + /// Blade Count content + /// public static readonly GUIContent bladeCount = EditorGUIUtility.TrTextContent("Blade Count", "The number of blades in the lens aperture. Higher values give a rounder aperture shape."); + + /// + /// Curvature content + /// public static readonly GUIContent curvature = EditorGUIUtility.TrTextContent("Curvature", "Controls the curvature of the lens aperture blades. The minimum value results in fully-curved, perfectly-circular bokeh, and the maximum value results in visible aperture blades."); + + /// + /// Barrel Clipping content + /// public static readonly GUIContent barrelClipping = EditorGUIUtility.TrTextContent("Barrel Clipping", "Controls the self-occlusion of the lens, creating a cat's eye effect."); - public static readonly GUIContent anamorphism = EditorGUIUtility.TrTextContent("Anamorphism", "Use the slider to stretch the sensor to simulate an anamorphic look."); + /// + /// Anamorphism content + /// + public static readonly GUIContent anamorphism = EditorGUIUtility.TrTextContent("Anamorphism", "Use the slider to stretch the sensor to simulate an anamorphic look."); } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.Migration.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.Migration.cs index bd6c7f6d081..49b70119c11 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.Migration.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.Migration.cs @@ -82,22 +82,19 @@ protected enum Version MigrationStep.New(Version.UpdatePhysicalCameraPropertiesToCore, (HDAdditionalCameraData data) => { var camera = data.GetComponent(); - if (camera == null) return; var physicalProps = data.physicalParameters; - if (physicalProps == null) + if (camera != null) { - Debug.Log($"Unable to execute migration step `{Version.UpdatePhysicalCameraPropertiesToCore}` migrate camera {camera.name} as the physicalParameters is null"); - return; + camera.iso = physicalProps.iso; + camera.shutterSpeed = physicalProps.shutterSpeed; + camera.aperture = physicalProps.aperture; + camera.focusDistance = physicalProps.focusDistance; + camera.gateFit = physicalProps.m_GateFit; + camera.bladeCount = physicalProps.bladeCount; + camera.curvature = physicalProps.curvature; + camera.barrelClipping = physicalProps.barrelClipping; + camera.anamorphism = physicalProps.anamorphism; } - camera.iso = physicalProps.iso; - camera.shutterSpeed = physicalProps.shutterSpeed; - camera.aperture = physicalProps.aperture; - camera.focusDistance = physicalProps.focusDistance; - camera.gateFit = physicalProps.m_GateFit; - camera.bladeCount = physicalProps.bladeCount; - camera.curvature = physicalProps.curvature; - camera.barrelClipping = physicalProps.barrelClipping; - camera.anamorphism = physicalProps.anamorphism; }) ); 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 6b8a767aa6c..e12b5911c72 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 @@ -1994,7 +1994,7 @@ struct DepthOfFieldParameters public bool useMipSafePath; } - DepthOfFieldParameters PrepareDoFParameters(HDCamera camera) + DepthOfFieldParameters PrepareDoFParameters(HDCamera hdCamera) { DepthOfFieldParameters parameters = new DepthOfFieldParameters(); @@ -2040,14 +2040,14 @@ DepthOfFieldParameters PrepareDoFParameters(HDCamera camera) parameters.pbDoFCombineKernel = parameters.pbDoFGatherCS.FindKernel("KMain"); parameters.minMaxCoCTileSize = 8; - parameters.camera = camera; + parameters.camera = hdCamera; parameters.viewportSize = postProcessViewportSize; - parameters.resetPostProcessingHistory = camera.resetPostProcessingHistory; + parameters.resetPostProcessingHistory = hdCamera.resetPostProcessingHistory; parameters.nearLayerActive = m_DepthOfField.IsNearLayerActive(); parameters.farLayerActive = m_DepthOfField.IsFarLayerActive(); parameters.highQualityFiltering = m_DepthOfField.highQualityFiltering; - parameters.useTiles = !camera.xr.singlePassEnabled; + parameters.useTiles = !hdCamera.xr.singlePassEnabled; parameters.resolution = m_DepthOfField.resolution; @@ -2070,11 +2070,12 @@ DepthOfFieldParameters PrepareDoFParameters(HDCamera camera) parameters.threadGroup8 = new Vector2Int(threadGroup8X, threadGroup8Y); - parameters.physicalCameraCurvature = camera.camera.curvature; - parameters.physicalCameraAnamorphism = camera.camera.anamorphism; - parameters.physicalCameraAperture = camera.camera.aperture; - parameters.physicalCameraBarrelClipping = camera.camera.barrelClipping; - parameters.physicalCameraBladeCount = camera.camera.bladeCount; + var camera = hdCamera.camera; + parameters.physicalCameraCurvature = camera.curvature; + parameters.physicalCameraAnamorphism = camera.anamorphism; + parameters.physicalCameraAperture = camera.aperture; + parameters.physicalCameraBarrelClipping = camera.barrelClipping; + parameters.physicalCameraBladeCount = camera.bladeCount; parameters.nearFocusStart = m_DepthOfField.nearFocusStart.value; parameters.nearFocusEnd = m_DepthOfField.nearFocusEnd.value; @@ -2084,7 +2085,7 @@ DepthOfFieldParameters PrepareDoFParameters(HDCamera camera) if (m_DepthOfField.focusDistanceMode.value == FocusDistanceMode.Volume) parameters.focusDistance = m_DepthOfField.focusDistance.value; else - parameters.focusDistance = camera.camera.focusDistance; + parameters.focusDistance = hdCamera.camera.focusDistance; parameters.focusMode = m_DepthOfField.focusMode.value; @@ -2172,7 +2173,7 @@ DepthOfFieldParameters PrepareDoFParameters(HDCamera camera) parameters.resolution = DepthOfFieldResolution.Half; } - if (camera.msaaEnabled) + if (hdCamera.msaaEnabled) { // When MSAA is enabled, DoF should use the min depth of the MSAA samples to avoid 1-pixel ringing around in-focus objects [case 1347291] parameters.dofCoCCS.EnableKeyword("USE_MIN_DEPTH"); From f8cb7ac1a309dbf806f9aa2c21e4c2afb8b8db0a Mon Sep 17 00:00:00 2001 From: tim Date: Wed, 16 Feb 2022 13:05:51 +0100 Subject: [PATCH 08/19] Update formatting to please formatting tool. --- .../RenderPipeline/Camera/HDCameraUI.PhysicalCamera.Skin.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.PhysicalCamera.Skin.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.PhysicalCamera.Skin.cs index 8b137891791..e69de29bb2d 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.PhysicalCamera.Skin.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.PhysicalCamera.Skin.cs @@ -1 +0,0 @@ - From bb0f1b4ea7c38d3883d6fa8b2fddbe5f360eba48 Mon Sep 17 00:00:00 2001 From: tim Date: Thu, 25 Nov 2021 14:30:52 +0100 Subject: [PATCH 09/19] Begin unifying postfx settings. # Conflicts: # com.unity.render-pipelines.high-definition/Editor/PostProcessing/LiftGammaGainEditor.cs # com.unity.render-pipelines.high-definition/Editor/PostProcessing/ShadowsMidtonesHighlightsEditor.cs # com.unity.render-pipelines.high-definition/Editor/PostProcessing/TrackballUIDrawer.cs # com.unity.render-pipelines.universal/Editor/Overrides/FilmGrainEditor.cs # com.unity.render-pipelines.universal/Runtime/Overrides/ChannelMixer.cs # com.unity.render-pipelines.universal/Runtime/Overrides/FilmGrain.cs # com.unity.render-pipelines.universal/Runtime/Overrides/LiftGammaGain.cs # com.unity.render-pipelines.universal/Runtime/Overrides/PaniniProjection.cs # com.unity.render-pipelines.universal/Runtime/Overrides/ShadowsMidtonesHighlights.cs # com.unity.render-pipelines.universal/Runtime/Overrides/WhiteBalance.cs # com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPass.cs --- .../PostProcessing}/ChannelMixerEditor.cs | 4 +- .../ChannelMixerEditor.cs.meta | 2 +- .../Editor/PostProcessing/FilmGrainEditor.cs | 5 +- .../PostProcessing}/FilmGrainEditor.cs.meta | 2 +- .../PostProcessing}/LiftGammaGainEditor.cs | 5 +- .../LiftGammaGainEditor.cs.meta | 2 +- .../ShadowsMidtonesHighlightsEditor.cs | 2 +- .../ShadowsMidtonesHighlightsEditor.cs.meta | 2 +- .../Editor/SavedParameter.cs | 16 +- .../Editor/SavedParameter.cs.meta | 2 +- .../Editor/TrackballUIDrawer.cs | 3 +- .../Editor/TrackballUIDrawer.cs.meta | 2 +- .../Runtime/PostProcessing/Components.meta | 8 + .../PostProcessing/Components/ChannelMixer.cs | 10 +- .../Components/ChannelMixer.cs.meta | 2 +- .../PostProcessing/Components/FilmGrain.cs | 10 +- .../Components/FilmGrain.cs.meta | 2 +- .../Components/HDRPUpgradable.meta | 8 + .../Components/HDRPUpgradable/ChannelMixer.cs | 13 + .../HDRPUpgradable}/ChannelMixer.cs.meta | 0 .../Components/HDRPUpgradable/FilmGrain.cs | 14 + .../HDRPUpgradable}/FilmGrain.cs.meta | 0 .../HDRPUpgradable/LiftGammaGain.cs | 14 + .../HDRPUpgradable}/LiftGammaGain.cs.meta | 0 .../HDRPUpgradable/PaniniProjection.cs | 13 + .../HDRPUpgradable}/PaniniProjection.cs.meta | 0 .../ShadowsMidtonesHighlights.cs | 14 + .../ShadowsMidtonesHighlights.cs.meta | 0 .../Components/HDRPUpgradable/WhiteBalance.cs | 13 + .../HDRPUpgradable}/WhiteBalance.cs.meta | 0 .../Components/IPostProcessComponent.cs | 16 ++ .../Components}/IPostProcessComponent.cs.meta | 2 +- .../Components/LiftGammaGain.cs | 12 +- .../Components/LiftGammaGain.cs.meta | 2 +- .../Components/PaniniProjection.cs | 8 +- .../Components/PaniniProjection.cs.meta | 11 + .../Components/ShadowsMidtonesHighlights.cs | 12 +- .../ShadowsMidtonesHighlights.cs.meta | 11 + .../Components/URPUpgradable.meta | 8 + .../Components/URPUpgradable/ChannelMixer.cs | 9 + .../URPUpgradable}/ChannelMixer.cs.meta | 0 .../Components/URPUpgradable/FilmGrain.cs | 11 + .../URPUpgradable}/FilmGrain.cs.meta | 0 .../Components/URPUpgradable/LiftGammaGain.cs | 10 + .../URPUpgradable}/LiftGammaGain.cs.meta | 0 .../URPUpgradable/PaniniProjection.cs | 9 + .../URPUpgradable}/PaniniProjection.cs.meta | 0 .../ShadowsMidtonesHighlights.cs | 9 + .../ShadowsMidtonesHighlights.cs.meta | 0 .../Components/URPUpgradable/WhiteBalance.cs | 9 + .../URPUpgradable}/WhiteBalance.cs.meta | 0 .../PostProcessing/Components/WhiteBalance.cs | 10 +- .../Components/WhiteBalance.cs.meta | 11 + .../Runtime/Volume/VolumeManager.cs | 2 +- .../Runtime/Volume/VolumeStack.cs | 9 +- .../PostProcessing/LiftGammaGainEditor.cs | 46 ---- .../ShadowsMidtonesHighlightsEditor.cs | 115 -------- .../PostProcessing/TrackballUIDrawer.cs | 245 ------------------ .../PostProcessing/IPostProcessComponent.cs | 14 - .../Editor/Overrides/FilmGrainEditor.cs | 70 ----- .../ShadowsMidtonesHighlightsEditor.cs.meta | 11 - .../Runtime/Overrides/ChannelMixer.cs | 82 ------ .../Runtime/Overrides/FilmGrain.cs | 117 --------- .../Runtime/Overrides/LiftGammaGain.cs | 41 --- .../Runtime/Overrides/PaniniProjection.cs | 29 --- .../Overrides/ShadowsMidtonesHighlights.cs | 67 ----- .../Runtime/Overrides/WhiteBalance.cs | 29 --- .../Runtime/Passes/PostProcessPass.cs | 17 -- 68 files changed, 283 insertions(+), 939 deletions(-) rename {com.unity.render-pipelines.universal/Editor/Overrides => com.unity.render-pipelines.core/Editor/PostProcessing}/ChannelMixerEditor.cs (97%) rename {com.unity.render-pipelines.universal/Editor/Overrides => com.unity.render-pipelines.core/Editor/PostProcessing}/ChannelMixerEditor.cs.meta (83%) rename {com.unity.render-pipelines.high-definition => com.unity.render-pipelines.core}/Editor/PostProcessing/FilmGrainEditor.cs (95%) rename {com.unity.render-pipelines.universal/Editor/Overrides => com.unity.render-pipelines.core/Editor/PostProcessing}/FilmGrainEditor.cs.meta (83%) rename {com.unity.render-pipelines.universal/Editor/Overrides => com.unity.render-pipelines.core/Editor/PostProcessing}/LiftGammaGainEditor.cs (94%) rename {com.unity.render-pipelines.universal/Editor/Overrides => com.unity.render-pipelines.core/Editor/PostProcessing}/LiftGammaGainEditor.cs.meta (83%) rename {com.unity.render-pipelines.universal/Editor/Overrides => com.unity.render-pipelines.core/Editor/PostProcessing}/ShadowsMidtonesHighlightsEditor.cs (99%) rename {com.unity.render-pipelines.high-definition => com.unity.render-pipelines.core}/Editor/PostProcessing/ShadowsMidtonesHighlightsEditor.cs.meta (83%) rename {com.unity.render-pipelines.universal => com.unity.render-pipelines.core}/Editor/SavedParameter.cs (80%) rename {com.unity.render-pipelines.universal => com.unity.render-pipelines.core}/Editor/SavedParameter.cs.meta (83%) rename {com.unity.render-pipelines.universal => com.unity.render-pipelines.core}/Editor/TrackballUIDrawer.cs (98%) rename {com.unity.render-pipelines.universal => com.unity.render-pipelines.core}/Editor/TrackballUIDrawer.cs.meta (83%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components.meta rename {com.unity.render-pipelines.high-definition => com.unity.render-pipelines.core}/Runtime/PostProcessing/Components/ChannelMixer.cs (93%) rename com.unity.render-pipelines.high-definition/Editor/PostProcessing/FilmGrainEditor.cs.meta => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ChannelMixer.cs.meta (83%) rename {com.unity.render-pipelines.high-definition => com.unity.render-pipelines.core}/Runtime/PostProcessing/Components/FilmGrain.cs (93%) rename com.unity.render-pipelines.high-definition/Editor/PostProcessing/TrackballUIDrawer.cs.meta => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/FilmGrain.cs.meta (83%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable.meta create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ChannelMixer.cs rename {com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable}/ChannelMixer.cs.meta (100%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/FilmGrain.cs rename {com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable}/FilmGrain.cs.meta (100%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/LiftGammaGain.cs rename {com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable}/LiftGammaGain.cs.meta (100%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/PaniniProjection.cs rename {com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable}/PaniniProjection.cs.meta (100%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ShadowsMidtonesHighlights.cs rename {com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable}/ShadowsMidtonesHighlights.cs.meta (100%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/WhiteBalance.cs rename {com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable}/WhiteBalance.cs.meta (100%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/IPostProcessComponent.cs rename {com.unity.render-pipelines.high-definition/Runtime/PostProcessing => com.unity.render-pipelines.core/Runtime/PostProcessing/Components}/IPostProcessComponent.cs.meta (83%) rename {com.unity.render-pipelines.high-definition => com.unity.render-pipelines.core}/Runtime/PostProcessing/Components/LiftGammaGain.cs (80%) rename com.unity.render-pipelines.high-definition/Editor/PostProcessing/LiftGammaGainEditor.cs.meta => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LiftGammaGain.cs.meta (83%) rename {com.unity.render-pipelines.high-definition => com.unity.render-pipelines.core}/Runtime/PostProcessing/Components/PaniniProjection.cs (80%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/PaniniProjection.cs.meta rename {com.unity.render-pipelines.high-definition => com.unity.render-pipelines.core}/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs (86%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs.meta create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable.meta create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ChannelMixer.cs rename {com.unity.render-pipelines.universal/Runtime/Overrides => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable}/ChannelMixer.cs.meta (100%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/FilmGrain.cs rename {com.unity.render-pipelines.universal/Runtime/Overrides => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable}/FilmGrain.cs.meta (100%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/LiftGammaGain.cs rename {com.unity.render-pipelines.universal/Runtime/Overrides => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable}/LiftGammaGain.cs.meta (100%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/PaniniProjection.cs rename {com.unity.render-pipelines.universal/Runtime/Overrides => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable}/PaniniProjection.cs.meta (100%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ShadowsMidtonesHighlights.cs rename {com.unity.render-pipelines.universal/Runtime/Overrides => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable}/ShadowsMidtonesHighlights.cs.meta (100%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/WhiteBalance.cs rename {com.unity.render-pipelines.universal/Runtime/Overrides => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable}/WhiteBalance.cs.meta (100%) rename {com.unity.render-pipelines.high-definition => com.unity.render-pipelines.core}/Runtime/PostProcessing/Components/WhiteBalance.cs (79%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/WhiteBalance.cs.meta delete mode 100644 com.unity.render-pipelines.high-definition/Editor/PostProcessing/LiftGammaGainEditor.cs delete mode 100644 com.unity.render-pipelines.high-definition/Editor/PostProcessing/ShadowsMidtonesHighlightsEditor.cs delete mode 100644 com.unity.render-pipelines.high-definition/Editor/PostProcessing/TrackballUIDrawer.cs delete mode 100644 com.unity.render-pipelines.high-definition/Runtime/PostProcessing/IPostProcessComponent.cs delete mode 100644 com.unity.render-pipelines.universal/Editor/Overrides/FilmGrainEditor.cs delete mode 100644 com.unity.render-pipelines.universal/Editor/Overrides/ShadowsMidtonesHighlightsEditor.cs.meta delete mode 100644 com.unity.render-pipelines.universal/Runtime/Overrides/ChannelMixer.cs delete mode 100644 com.unity.render-pipelines.universal/Runtime/Overrides/FilmGrain.cs delete mode 100644 com.unity.render-pipelines.universal/Runtime/Overrides/LiftGammaGain.cs delete mode 100644 com.unity.render-pipelines.universal/Runtime/Overrides/PaniniProjection.cs delete mode 100644 com.unity.render-pipelines.universal/Runtime/Overrides/ShadowsMidtonesHighlights.cs delete mode 100644 com.unity.render-pipelines.universal/Runtime/Overrides/WhiteBalance.cs diff --git a/com.unity.render-pipelines.universal/Editor/Overrides/ChannelMixerEditor.cs b/com.unity.render-pipelines.core/Editor/PostProcessing/ChannelMixerEditor.cs similarity index 97% rename from com.unity.render-pipelines.universal/Editor/Overrides/ChannelMixerEditor.cs rename to com.unity.render-pipelines.core/Editor/PostProcessing/ChannelMixerEditor.cs index 5ccd9c9265f..d1bfbf9bf7c 100644 --- a/com.unity.render-pipelines.universal/Editor/Overrides/ChannelMixerEditor.cs +++ b/com.unity.render-pipelines.core/Editor/PostProcessing/ChannelMixerEditor.cs @@ -1,7 +1,7 @@ using UnityEngine; -using UnityEngine.Rendering.Universal; +using UnityEngine.Rendering; -namespace UnityEditor.Rendering.Universal +namespace UnityEditor.Rendering { [CustomEditor(typeof(ChannelMixer))] sealed class ChannelMixerEditor : VolumeComponentEditor diff --git a/com.unity.render-pipelines.universal/Editor/Overrides/ChannelMixerEditor.cs.meta b/com.unity.render-pipelines.core/Editor/PostProcessing/ChannelMixerEditor.cs.meta similarity index 83% rename from com.unity.render-pipelines.universal/Editor/Overrides/ChannelMixerEditor.cs.meta rename to com.unity.render-pipelines.core/Editor/PostProcessing/ChannelMixerEditor.cs.meta index d9e9232896d..2c7352d0902 100644 --- a/com.unity.render-pipelines.universal/Editor/Overrides/ChannelMixerEditor.cs.meta +++ b/com.unity.render-pipelines.core/Editor/PostProcessing/ChannelMixerEditor.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: fc48c81d1dba94248b35e9384c12bc77 +guid: df9260d364f24416a998c3e898d5ab03 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/FilmGrainEditor.cs b/com.unity.render-pipelines.core/Editor/PostProcessing/FilmGrainEditor.cs similarity index 95% rename from com.unity.render-pipelines.high-definition/Editor/PostProcessing/FilmGrainEditor.cs rename to com.unity.render-pipelines.core/Editor/PostProcessing/FilmGrainEditor.cs index 3f66ad3397c..1387e64184d 100644 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/FilmGrainEditor.cs +++ b/com.unity.render-pipelines.core/Editor/PostProcessing/FilmGrainEditor.cs @@ -1,8 +1,7 @@ -using UnityEditor.Rendering; using UnityEngine; -using UnityEngine.Rendering.HighDefinition; +using UnityEngine.Rendering; -namespace UnityEditor.Rendering.HighDefinition +namespace UnityEditor.Rendering { [CustomEditor(typeof(FilmGrain))] sealed class FilmGrainEditor : VolumeComponentEditor diff --git a/com.unity.render-pipelines.universal/Editor/Overrides/FilmGrainEditor.cs.meta b/com.unity.render-pipelines.core/Editor/PostProcessing/FilmGrainEditor.cs.meta similarity index 83% rename from com.unity.render-pipelines.universal/Editor/Overrides/FilmGrainEditor.cs.meta rename to com.unity.render-pipelines.core/Editor/PostProcessing/FilmGrainEditor.cs.meta index fa03636da85..1c8d3de9cb0 100644 --- a/com.unity.render-pipelines.universal/Editor/Overrides/FilmGrainEditor.cs.meta +++ b/com.unity.render-pipelines.core/Editor/PostProcessing/FilmGrainEditor.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 38f8c5e5ea2961a43b1bb65bf161393c +guid: 2a6885a824b0a44529d574c292f71313 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/com.unity.render-pipelines.universal/Editor/Overrides/LiftGammaGainEditor.cs b/com.unity.render-pipelines.core/Editor/PostProcessing/LiftGammaGainEditor.cs similarity index 94% rename from com.unity.render-pipelines.universal/Editor/Overrides/LiftGammaGainEditor.cs rename to com.unity.render-pipelines.core/Editor/PostProcessing/LiftGammaGainEditor.cs index f28a50186fc..1bb8935822b 100644 --- a/com.unity.render-pipelines.universal/Editor/Overrides/LiftGammaGainEditor.cs +++ b/com.unity.render-pipelines.core/Editor/PostProcessing/LiftGammaGainEditor.cs @@ -1,7 +1,8 @@ +using UnityEditor.Rendering.Universal; using UnityEngine; -using UnityEngine.Rendering.Universal; +using UnityEngine.Rendering; -namespace UnityEditor.Rendering.Universal +namespace UnityEditor.Rendering { [CustomEditor(typeof(LiftGammaGain))] sealed class LiftGammaGainEditor : VolumeComponentEditor diff --git a/com.unity.render-pipelines.universal/Editor/Overrides/LiftGammaGainEditor.cs.meta b/com.unity.render-pipelines.core/Editor/PostProcessing/LiftGammaGainEditor.cs.meta similarity index 83% rename from com.unity.render-pipelines.universal/Editor/Overrides/LiftGammaGainEditor.cs.meta rename to com.unity.render-pipelines.core/Editor/PostProcessing/LiftGammaGainEditor.cs.meta index 952037cec16..f80d9963141 100644 --- a/com.unity.render-pipelines.universal/Editor/Overrides/LiftGammaGainEditor.cs.meta +++ b/com.unity.render-pipelines.core/Editor/PostProcessing/LiftGammaGainEditor.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5a5420665d101df4c8b55860ae8aaa17 +guid: a735f828368e344d185095618eac8a2f MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/com.unity.render-pipelines.universal/Editor/Overrides/ShadowsMidtonesHighlightsEditor.cs b/com.unity.render-pipelines.core/Editor/PostProcessing/ShadowsMidtonesHighlightsEditor.cs similarity index 99% rename from com.unity.render-pipelines.universal/Editor/Overrides/ShadowsMidtonesHighlightsEditor.cs rename to com.unity.render-pipelines.core/Editor/PostProcessing/ShadowsMidtonesHighlightsEditor.cs index c6cf7be1d75..386c65a8306 100644 --- a/com.unity.render-pipelines.universal/Editor/Overrides/ShadowsMidtonesHighlightsEditor.cs +++ b/com.unity.render-pipelines.core/Editor/PostProcessing/ShadowsMidtonesHighlightsEditor.cs @@ -2,7 +2,7 @@ using UnityEngine.Rendering; using UnityEngine.Rendering.Universal; -namespace UnityEditor.Rendering.Universal +namespace UnityEditor.Rendering { // TODO: handle retina / EditorGUIUtility.pixelsPerPoint [CustomEditor(typeof(ShadowsMidtonesHighlights))] diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ShadowsMidtonesHighlightsEditor.cs.meta b/com.unity.render-pipelines.core/Editor/PostProcessing/ShadowsMidtonesHighlightsEditor.cs.meta similarity index 83% rename from com.unity.render-pipelines.high-definition/Editor/PostProcessing/ShadowsMidtonesHighlightsEditor.cs.meta rename to com.unity.render-pipelines.core/Editor/PostProcessing/ShadowsMidtonesHighlightsEditor.cs.meta index 1e5512d6866..4d8aa9676d8 100644 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ShadowsMidtonesHighlightsEditor.cs.meta +++ b/com.unity.render-pipelines.core/Editor/PostProcessing/ShadowsMidtonesHighlightsEditor.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c4edd925ae361ce44b0d945f73b8f7ba +guid: fc86639ae30ea4353adb7e1f3106faf4 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/com.unity.render-pipelines.universal/Editor/SavedParameter.cs b/com.unity.render-pipelines.core/Editor/SavedParameter.cs similarity index 80% rename from com.unity.render-pipelines.universal/Editor/SavedParameter.cs rename to com.unity.render-pipelines.core/Editor/SavedParameter.cs index cebcb996ace..572a4c3d0b1 100644 --- a/com.unity.render-pipelines.universal/Editor/SavedParameter.cs +++ b/com.unity.render-pipelines.core/Editor/SavedParameter.cs @@ -1,13 +1,13 @@ using System; using UnityEngine.Assertions; -namespace UnityEditor.Rendering.Universal +namespace UnityEditor.Rendering { - class SavedParameter + public class SavedParameter where T : IEquatable { - internal delegate void SetParameter(string key, T value); - internal delegate T GetParameter(string key, T defaultValue); + public delegate void SetParameter(string key, T value); + public delegate T GetParameter(string key, T defaultValue); readonly string m_Key; bool m_Loaded; @@ -58,25 +58,25 @@ public T value } // Pre-specialized class for easier use and compatibility with existing code - sealed class SavedBool : SavedParameter + public sealed class SavedBool : SavedParameter { public SavedBool(string key, bool value) : base(key, value, EditorPrefs.GetBool, EditorPrefs.SetBool) { } } - sealed class SavedInt : SavedParameter + public sealed class SavedInt : SavedParameter { public SavedInt(string key, int value) : base(key, value, EditorPrefs.GetInt, EditorPrefs.SetInt) { } } - sealed class SavedFloat : SavedParameter + public sealed class SavedFloat : SavedParameter { public SavedFloat(string key, float value) : base(key, value, EditorPrefs.GetFloat, EditorPrefs.SetFloat) { } } - sealed class SavedString : SavedParameter + public sealed class SavedString : SavedParameter { public SavedString(string key, string value) : base(key, value, EditorPrefs.GetString, EditorPrefs.SetString) { } diff --git a/com.unity.render-pipelines.universal/Editor/SavedParameter.cs.meta b/com.unity.render-pipelines.core/Editor/SavedParameter.cs.meta similarity index 83% rename from com.unity.render-pipelines.universal/Editor/SavedParameter.cs.meta rename to com.unity.render-pipelines.core/Editor/SavedParameter.cs.meta index cf91ea3d91e..d127dd2722a 100644 --- a/com.unity.render-pipelines.universal/Editor/SavedParameter.cs.meta +++ b/com.unity.render-pipelines.core/Editor/SavedParameter.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f334589a3e8ed644fa711158935ddabd +guid: 1755d9337deec47028b2c4a5a42aebc1 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/com.unity.render-pipelines.universal/Editor/TrackballUIDrawer.cs b/com.unity.render-pipelines.core/Editor/TrackballUIDrawer.cs similarity index 98% rename from com.unity.render-pipelines.universal/Editor/TrackballUIDrawer.cs rename to com.unity.render-pipelines.core/Editor/TrackballUIDrawer.cs index fcb7fdf1e96..06ab3a88f0a 100644 --- a/com.unity.render-pipelines.universal/Editor/TrackballUIDrawer.cs +++ b/com.unity.render-pipelines.core/Editor/TrackballUIDrawer.cs @@ -1,9 +1,8 @@ using System; using UnityEngine; -namespace UnityEditor.Rendering.Universal +namespace UnityEditor.Rendering { - // TODO: Should be cleaned up and put into CoreRP/Editor sealed class TrackballUIDrawer { static readonly int s_ThumbHash = "colorWheelThumb".GetHashCode(); diff --git a/com.unity.render-pipelines.universal/Editor/TrackballUIDrawer.cs.meta b/com.unity.render-pipelines.core/Editor/TrackballUIDrawer.cs.meta similarity index 83% rename from com.unity.render-pipelines.universal/Editor/TrackballUIDrawer.cs.meta rename to com.unity.render-pipelines.core/Editor/TrackballUIDrawer.cs.meta index 391362c88cd..f0b38ee09fc 100644 --- a/com.unity.render-pipelines.universal/Editor/TrackballUIDrawer.cs.meta +++ b/com.unity.render-pipelines.core/Editor/TrackballUIDrawer.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b81c1a435d4bc9e40a19e0326117db7c +guid: bfe579c3d1aa0488abb07d6cf59b46f5 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components.meta new file mode 100644 index 00000000000..7bb2168fcbd --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2dae45576f3e24047b264f9774cc0a07 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ChannelMixer.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ChannelMixer.cs similarity index 93% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ChannelMixer.cs rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ChannelMixer.cs index c77d660586a..940593df07a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ChannelMixer.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ChannelMixer.cs @@ -1,13 +1,13 @@ using System; -namespace UnityEngine.Rendering.HighDefinition +namespace UnityEngine.Rendering { /// /// A volume component that holds settings for the Channel Mixer effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Channel Mixer", typeof(HDRenderPipeline))] - [HDRPHelpURLAttribute("Post-Processing-Channel-Mixer")] - public sealed class ChannelMixer : VolumeComponent, IPostProcessComponent + [Serializable, VolumeComponentMenu("Post-processing/Channel Mixer")] + //[HDRPHelpURLAttribute("Post-Processing-Channel-Mixer")] + public class ChannelMixer : VolumeComponent, IPostProcessComponent { /// /// Controls the influence of the red channel in the output red channel. @@ -82,5 +82,7 @@ public bool IsActive() || blueOutGreenIn.value != 0f || blueOutBlueIn.value != 100f; } + + public bool IsTileCompatible() => true; } } diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/FilmGrainEditor.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ChannelMixer.cs.meta similarity index 83% rename from com.unity.render-pipelines.high-definition/Editor/PostProcessing/FilmGrainEditor.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ChannelMixer.cs.meta index 9553f049e90..9244d0c17b9 100644 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/FilmGrainEditor.cs.meta +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ChannelMixer.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4ed48a0d569d0234696bbbb588b62a33 +guid: 699e93f098d804659b3a84fc04005329 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/FilmGrain.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/FilmGrain.cs similarity index 93% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/FilmGrain.cs rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/FilmGrain.cs index 5516c19c484..2142759579f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/FilmGrain.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/FilmGrain.cs @@ -1,6 +1,6 @@ using System; -namespace UnityEngine.Rendering.HighDefinition +namespace UnityEngine.Rendering { /// /// Presets for the effect. @@ -68,9 +68,9 @@ public enum FilmGrainLookup /// /// A volume component that holds settings for the Film Grain effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Film Grain", typeof(HDRenderPipeline))] - [HDRPHelpURLAttribute("Post-Processing-Film-Grain")] - public sealed class FilmGrain : VolumeComponent, IPostProcessComponent + [Serializable, VolumeComponentMenu("Post-processing/Film Grain")] + //[HDRPHelpURLAttribute("Post-Processing-Film-Grain")] + public class FilmGrain : VolumeComponent, IPostProcessComponent { /// /// Specifies the type of grain to use. Use to provide your own . @@ -106,6 +106,8 @@ public bool IsActive() return intensity.value > 0f && (type.value != FilmGrainLookup.Custom || texture.value != null); } + + public bool IsTileCompatible() => true; } /// diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/TrackballUIDrawer.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/FilmGrain.cs.meta similarity index 83% rename from com.unity.render-pipelines.high-definition/Editor/PostProcessing/TrackballUIDrawer.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/FilmGrain.cs.meta index 621387afadd..0d9393eba47 100644 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/TrackballUIDrawer.cs.meta +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/FilmGrain.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e9c2396d6ada5be4084a85f9fdaa1681 +guid: 3a7b47e902b374226887f8cfe8a6acc5 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable.meta new file mode 100644 index 00000000000..c890554df99 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4e3cb89499ab24bcf8c1e0717bdd7782 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ChannelMixer.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ChannelMixer.cs new file mode 100644 index 00000000000..f263649e906 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ChannelMixer.cs @@ -0,0 +1,13 @@ +using System; + +namespace UnityEngine.Rendering.HighDefinition.Obsolete +{ + /// + /// A volume component that holds settings for the Channel Mixer effect. + /// + [Serializable] + [Obsolete] + public sealed class ChannelMixer : UnityEngine.Rendering.ChannelMixer, IDeprecatedVolumeComponent + { + } +} diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ChannelMixer.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ChannelMixer.cs.meta similarity index 100% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ChannelMixer.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ChannelMixer.cs.meta diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/FilmGrain.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/FilmGrain.cs new file mode 100644 index 00000000000..32709ae055b --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/FilmGrain.cs @@ -0,0 +1,14 @@ +using System; + +namespace UnityEngine.Rendering.HighDefinition.Obsolete +{ + /// + /// A volume component that holds settings for the Film Grain effect. + /// + [Serializable] + [Obsolete] + //[HDRPHelpURLAttribute("Post-Processing-Film-Grain")] + public sealed class FilmGrain : UnityEngine.Rendering.FilmGrain, IDeprecatedVolumeComponent + { + } +} diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/FilmGrain.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/FilmGrain.cs.meta similarity index 100% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/FilmGrain.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/FilmGrain.cs.meta diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/LiftGammaGain.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/LiftGammaGain.cs new file mode 100644 index 00000000000..eed46ea300f --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/LiftGammaGain.cs @@ -0,0 +1,14 @@ +using System; + +namespace UnityEngine.Rendering.HighDefinition.Obsolete +{ + /// + /// A volume component that holds settings for the Lift, Gamma, Gain effect. + /// + [Serializable] + [Obsolete] + // [HDRPHelpURLAttribute("Post-Processing-Lift-Gamma-Gain")] + public sealed class LiftGammaGain : UnityEngine.Rendering.LiftGammaGain, IDeprecatedVolumeComponent + { + } +} diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/LiftGammaGain.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/LiftGammaGain.cs.meta similarity index 100% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/LiftGammaGain.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/LiftGammaGain.cs.meta diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/PaniniProjection.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/PaniniProjection.cs new file mode 100644 index 00000000000..f708146fd67 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/PaniniProjection.cs @@ -0,0 +1,13 @@ +using System; + +namespace UnityEngine.Rendering.HighDefinition.Obsolete +{ + /// + /// A volume component that holds settings for the Panini Projection effect. + /// + [Serializable] + [Obsolete] + public sealed class PaniniProjection : UnityEngine.Rendering.PaniniProjection, IDeprecatedVolumeComponent + { + } +} diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/PaniniProjection.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/PaniniProjection.cs.meta similarity index 100% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/PaniniProjection.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/PaniniProjection.cs.meta diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ShadowsMidtonesHighlights.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ShadowsMidtonesHighlights.cs new file mode 100644 index 00000000000..554d72a1637 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ShadowsMidtonesHighlights.cs @@ -0,0 +1,14 @@ +using System; + +namespace UnityEngine.Rendering.HighDefinition.Obsolete +{ + /// + /// A volume component that holds settings for the Shadows, Midtones, Highlights effect. + /// + [Serializable] + [Obsolete] + //[HDRPHelpURLAttribute("Post-Processing-Shadows-Midtones-Highlights")] + public sealed class ShadowsMidtonesHighlights : UnityEngine.Rendering.ShadowsMidtonesHighlights, IDeprecatedVolumeComponent + { + } +} diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ShadowsMidtonesHighlights.cs.meta similarity index 100% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ShadowsMidtonesHighlights.cs.meta diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/WhiteBalance.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/WhiteBalance.cs new file mode 100644 index 00000000000..148e3fec9c1 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/WhiteBalance.cs @@ -0,0 +1,13 @@ +using System; + +namespace UnityEngine.Rendering.HighDefinition.Obsolete +{ + /// + /// A volume component that holds settings for the White Balance effect. + /// + [Serializable] + [Obsolete] + //[HDRPHelpURLAttribute("Post-Processing-White-Balance")] + public sealed class WhiteBalance : UnityEngine.Rendering.WhiteBalance, IDeprecatedVolumeComponent + { } +} diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/WhiteBalance.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/WhiteBalance.cs.meta similarity index 100% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/WhiteBalance.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/WhiteBalance.cs.meta diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/IPostProcessComponent.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/IPostProcessComponent.cs new file mode 100644 index 00000000000..e0c4a0bd4d4 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/IPostProcessComponent.cs @@ -0,0 +1,16 @@ +namespace UnityEngine.Rendering +{ + public interface IPostProcessComponent + { + bool IsActive(); + + bool IsTileCompatible() + { + return false; + } + } + + public interface IDeprecatedVolumeComponent + { + } +} diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/IPostProcessComponent.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/IPostProcessComponent.cs.meta similarity index 83% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/IPostProcessComponent.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/IPostProcessComponent.cs.meta index ffd72ae3d67..830da2310dc 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/IPostProcessComponent.cs.meta +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/IPostProcessComponent.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6e12ae426fcdb934d8fb1226d4e0b771 +guid: 61ab74a0c79c14bd89b7e2d371171a96 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/LiftGammaGain.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LiftGammaGain.cs similarity index 80% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/LiftGammaGain.cs rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LiftGammaGain.cs index 923e23c712a..453fcd73475 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/LiftGammaGain.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LiftGammaGain.cs @@ -1,13 +1,13 @@ using System; -namespace UnityEngine.Rendering.HighDefinition +namespace UnityEngine.Rendering { /// /// A volume component that holds settings for the Lift, Gamma, Gain effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Lift, Gamma, Gain", typeof(HDRenderPipeline))] - [HDRPHelpURLAttribute("Post-Processing-Lift-Gamma-Gain")] - public sealed class LiftGammaGain : VolumeComponent, IPostProcessComponent + [Serializable, VolumeComponentMenu("Post-processing/Lift, Gamma, Gain")] + //[HDRPHelpURLAttribute("Post-Processing-Lift-Gamma-Gain")] + public class LiftGammaGain : VolumeComponent, IPostProcessComponent { /// /// Controls the dark tones of the render. @@ -39,6 +39,8 @@ public bool IsActive() || gain != defaultState; } - LiftGammaGain() => displayName = "Lift, Gamma, Gain"; + protected LiftGammaGain() => displayName = "Lift, Gamma, Gain"; + + public bool IsTileCompatible() => true; } } diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/LiftGammaGainEditor.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LiftGammaGain.cs.meta similarity index 83% rename from com.unity.render-pipelines.high-definition/Editor/PostProcessing/LiftGammaGainEditor.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LiftGammaGain.cs.meta index f90f13b8e0b..cf0ce4dc0b4 100644 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/LiftGammaGainEditor.cs.meta +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LiftGammaGain.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 267c16b1a0f481f43b0115aa5d9b8a0f +guid: 5b3e8dae02ac74f91b46038bf0c87dad MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/PaniniProjection.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/PaniniProjection.cs similarity index 80% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/PaniniProjection.cs rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/PaniniProjection.cs index 3433a63a319..fda203a0473 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/PaniniProjection.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/PaniniProjection.cs @@ -1,13 +1,13 @@ using System; -namespace UnityEngine.Rendering.HighDefinition +namespace UnityEngine.Rendering { /// /// A volume component that holds settings for the Panini Projection effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Panini Projection", typeof(HDRenderPipeline))] - [HDRPHelpURLAttribute("Post-Processing-Panini-Projection")] - public sealed class PaniniProjection : VolumeComponent, IPostProcessComponent + [Serializable, VolumeComponentMenu("Post-processing/Panini Projection")] + //[HDRPHelpURLAttribute("Post-Processing-Panini-Projection")] + public class PaniniProjection : VolumeComponent, IPostProcessComponent { /// /// Controls the panini projection distance. This controls the strength of the distorion. diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/PaniniProjection.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/PaniniProjection.cs.meta new file mode 100644 index 00000000000..e4e3bf2241b --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/PaniniProjection.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fba9f35c50bd6473eaa5bcfb5c49a94a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs similarity index 86% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs index e720db1eff1..c727d0fbaf7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs @@ -1,13 +1,13 @@ using System; -namespace UnityEngine.Rendering.HighDefinition +namespace UnityEngine.Rendering { /// /// A volume component that holds settings for the Shadows, Midtones, Highlights effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Shadows, Midtones, Highlights", typeof(HDRenderPipeline))] - [HDRPHelpURLAttribute("Post-Processing-Shadows-Midtones-Highlights")] - public sealed class ShadowsMidtonesHighlights : VolumeComponent, IPostProcessComponent + [Serializable, VolumeComponentMenu("Post-processing/Shadows, Midtones, Highlights")] + //[HDRPHelpURLAttribute("Post-Processing-Shadows-Midtones-Highlights")] + public class ShadowsMidtonesHighlights : VolumeComponent, IPostProcessComponent { /// /// Controls the darkest portions of the render. @@ -65,6 +65,8 @@ public bool IsActive() || highlights != defaultState; } - ShadowsMidtonesHighlights() => displayName = "Shadows, Midtones, Highlights"; + protected ShadowsMidtonesHighlights() => displayName = "Shadows, Midtones, Highlights"; + + public bool IsTileCompatible() => true; } } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs.meta new file mode 100644 index 00000000000..f4336b4fcf2 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5217fb04a9181425fa6084b96c7a4e00 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable.meta new file mode 100644 index 00000000000..79fd6af8505 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0ad7131fc042b45e4b3d8f803c52c35a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ChannelMixer.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ChannelMixer.cs new file mode 100644 index 00000000000..698a85134d6 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ChannelMixer.cs @@ -0,0 +1,9 @@ +using System; + +namespace UnityEngine.Rendering.Universal.Obsolete +{ + [Serializable] + [Obsolete] + public sealed class ChannelMixer : UnityEngine.Rendering.ChannelMixer, IDeprecatedVolumeComponent + { } +} diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/ChannelMixer.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ChannelMixer.cs.meta similarity index 100% rename from com.unity.render-pipelines.universal/Runtime/Overrides/ChannelMixer.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ChannelMixer.cs.meta diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/FilmGrain.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/FilmGrain.cs new file mode 100644 index 00000000000..7a6fdbb3520 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/FilmGrain.cs @@ -0,0 +1,11 @@ +using System; + +namespace UnityEngine.Rendering.Universal.Obsolete +{ + + [Serializable] + [Obsolete] + public sealed class FilmGrain : UnityEngine.Rendering.FilmGrain, IDeprecatedVolumeComponent + { + } +} diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/FilmGrain.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/FilmGrain.cs.meta similarity index 100% rename from com.unity.render-pipelines.universal/Runtime/Overrides/FilmGrain.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/FilmGrain.cs.meta diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/LiftGammaGain.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/LiftGammaGain.cs new file mode 100644 index 00000000000..1fd8e15ac2a --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/LiftGammaGain.cs @@ -0,0 +1,10 @@ +using System; + +namespace UnityEngine.Rendering.Universal.Obsolete +{ + [Serializable] + [Obsolete] + public sealed class LiftGammaGain : UnityEngine.Rendering.LiftGammaGain, IDeprecatedVolumeComponent + { + } +} diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/LiftGammaGain.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/LiftGammaGain.cs.meta similarity index 100% rename from com.unity.render-pipelines.universal/Runtime/Overrides/LiftGammaGain.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/LiftGammaGain.cs.meta diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/PaniniProjection.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/PaniniProjection.cs new file mode 100644 index 00000000000..005fce20783 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/PaniniProjection.cs @@ -0,0 +1,9 @@ +using System; + +namespace UnityEngine.Rendering.Universal.Obsolete +{ + [Serializable] + [Obsolete] + public sealed class PaniniProjection : UnityEngine.Rendering.PaniniProjection, IDeprecatedVolumeComponent + { } +} diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/PaniniProjection.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/PaniniProjection.cs.meta similarity index 100% rename from com.unity.render-pipelines.universal/Runtime/Overrides/PaniniProjection.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/PaniniProjection.cs.meta diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ShadowsMidtonesHighlights.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ShadowsMidtonesHighlights.cs new file mode 100644 index 00000000000..14dbf0d611d --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ShadowsMidtonesHighlights.cs @@ -0,0 +1,9 @@ +using System; + +namespace UnityEngine.Rendering.Universal.Obsolete +{ + [Serializable] + [Obsolete] + public sealed class ShadowsMidtonesHighlights : UnityEngine.Rendering.ShadowsMidtonesHighlights, IDeprecatedVolumeComponent + { } +} diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/ShadowsMidtonesHighlights.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ShadowsMidtonesHighlights.cs.meta similarity index 100% rename from com.unity.render-pipelines.universal/Runtime/Overrides/ShadowsMidtonesHighlights.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ShadowsMidtonesHighlights.cs.meta diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/WhiteBalance.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/WhiteBalance.cs new file mode 100644 index 00000000000..f5f38ab4743 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/WhiteBalance.cs @@ -0,0 +1,9 @@ +using System; + +namespace UnityEngine.Rendering.Universal.Obsolete +{ + [Serializable] + [Obsolete] + public sealed class WhiteBalance : UnityEngine.Rendering.WhiteBalance, IDeprecatedVolumeComponent + { } +} diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/WhiteBalance.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/WhiteBalance.cs.meta similarity index 100% rename from com.unity.render-pipelines.universal/Runtime/Overrides/WhiteBalance.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/WhiteBalance.cs.meta diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/WhiteBalance.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/WhiteBalance.cs similarity index 79% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/WhiteBalance.cs rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/WhiteBalance.cs index ec770bf9f1e..aa3fedd5c25 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/WhiteBalance.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/WhiteBalance.cs @@ -1,13 +1,13 @@ using System; -namespace UnityEngine.Rendering.HighDefinition +namespace UnityEngine.Rendering { /// /// A volume component that holds settings for the White Balance effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/White Balance", typeof(HDRenderPipeline))] - [HDRPHelpURLAttribute("Post-Processing-White-Balance")] - public sealed class WhiteBalance : VolumeComponent, IPostProcessComponent + [Serializable, VolumeComponentMenu("Post-processing/White Balance")] + //[HDRPHelpURLAttribute("Post-Processing-White-Balance")] + public class WhiteBalance : VolumeComponent, IPostProcessComponent { /// /// Controls the color temperature HDRP uses for white balancing. @@ -30,5 +30,7 @@ public bool IsActive() return !Mathf.Approximately(temperature.value, 0f) || !Mathf.Approximately(tint.value, 0f); } + + public bool IsTileCompatible() => true; } } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/WhiteBalance.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/WhiteBalance.cs.meta new file mode 100644 index 00000000000..d9d0b91b56b --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/WhiteBalance.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7576fe1e51bbb403eb42da9b3189b603 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.core/Runtime/Volume/VolumeManager.cs b/com.unity.render-pipelines.core/Runtime/Volume/VolumeManager.cs index 8eb11f90364..8b7655e21ce 100644 --- a/com.unity.render-pipelines.core/Runtime/Volume/VolumeManager.cs +++ b/com.unity.render-pipelines.core/Runtime/Volume/VolumeManager.cs @@ -204,7 +204,7 @@ void ReloadBaseTypes() // Grab all the component types we can find baseComponentTypeArray = CoreUtils.GetAllTypesDerivedFrom() - .Where(t => !t.IsAbstract).ToArray(); + .Where(t => !t.IsAbstract && !t.GetInterfaces().Contains(typeof(IDeprecatedVolumeComponent))).ToArray(); var flags = System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic; // Keep an instance of each type to be used in a virtual lowest priority global volume diff --git a/com.unity.render-pipelines.core/Runtime/Volume/VolumeStack.cs b/com.unity.render-pipelines.core/Runtime/Volume/VolumeStack.cs index 3f556efb140..ebe5f72af2f 100644 --- a/com.unity.render-pipelines.core/Runtime/Volume/VolumeStack.cs +++ b/com.unity.render-pipelines.core/Runtime/Volume/VolumeStack.cs @@ -55,7 +55,14 @@ public T GetComponent() /// or null if the type is invalid. public VolumeComponent GetComponent(Type type) { - components.TryGetValue(type, out var comp); + VolumeComponent comp = null; + while (comp == null) + { + components.TryGetValue(type, out comp); + type = type.BaseType; + if (type == typeof(VolumeComponent) || type == null) + break; + } return comp; } diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/LiftGammaGainEditor.cs b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/LiftGammaGainEditor.cs deleted file mode 100644 index 900c87c5553..00000000000 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/LiftGammaGainEditor.cs +++ /dev/null @@ -1,46 +0,0 @@ -using UnityEditor.Rendering; -using UnityEngine; -using UnityEngine.Rendering.HighDefinition; - -namespace UnityEditor.Rendering.HighDefinition -{ - [CustomEditor(typeof(LiftGammaGain))] - sealed class LiftGammaGainEditor : VolumeComponentEditor - { - static class Styles - { - public static readonly GUIContent liftLabel = EditorGUIUtility.TrTextContent("Lift", "Use this control to apply a hue to the dark tones (shadows) and adjust their level."); - public static readonly GUIContent gammaLabel = EditorGUIUtility.TrTextContent("Gamma", "Use this control to apply a hue to the mid-range tones and adjust their level."); - public static readonly GUIContent gainLabel = EditorGUIUtility.TrTextContent("Gain", "Use this control to apply a hue to the highlights and adjust their level."); - } - - SerializedDataParameter m_Lift; - SerializedDataParameter m_Gamma; - SerializedDataParameter m_Gain; - - readonly TrackballUIDrawer m_TrackballUIDrawer = new TrackballUIDrawer(); - - public override void OnEnable() - { - var o = new PropertyFetcher(serializedObject); - - m_Lift = Unpack(o.Find(x => x.lift)); - m_Gamma = Unpack(o.Find(x => x.gamma)); - m_Gain = Unpack(o.Find(x => x.gain)); - } - - public override void OnInspectorGUI() - { - using (new EditorGUILayout.HorizontalScope()) - { - m_TrackballUIDrawer.OnGUI(m_Lift.value, m_Lift.overrideState, Styles.liftLabel, GetLiftValue); - GUILayout.Space(4f); - m_TrackballUIDrawer.OnGUI(m_Gamma.value, m_Gamma.overrideState, Styles.gammaLabel, GetLiftValue); - GUILayout.Space(4f); - m_TrackballUIDrawer.OnGUI(m_Gain.value, m_Gain.overrideState, Styles.gainLabel, GetLiftValue); - } - } - - Vector3 GetLiftValue(Vector4 x) => new Vector3(x.x + x.w, x.y + x.w, x.z + x.w); - } -} diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ShadowsMidtonesHighlightsEditor.cs b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ShadowsMidtonesHighlightsEditor.cs deleted file mode 100644 index 881a1f3ed5b..00000000000 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ShadowsMidtonesHighlightsEditor.cs +++ /dev/null @@ -1,115 +0,0 @@ -using UnityEngine; -using UnityEngine.Rendering.HighDefinition; -using UnityEngine.Rendering; -using UnityEngine.Experimental.Rendering; - -namespace UnityEditor.Rendering.HighDefinition -{ - // TODO: handle retina / EditorGUIUtility.pixelsPerPoint - [CustomEditor(typeof(ShadowsMidtonesHighlights))] - sealed class ShadowsMidtonesHighlightsEditor : VolumeComponentEditor - { - static class Styles - { - public static readonly GUIContent shadowsLabel = EditorGUIUtility.TrTextContent("Shadows", "Apply a hue to the shadows and adjust their level."); - public static readonly GUIContent midtonesLabel = EditorGUIUtility.TrTextContent("Midtones", "Apply a hue to the midtones and adjust their level."); - public static readonly GUIContent highlightsLabel = EditorGUIUtility.TrTextContent("Highlights", "Apply a hue to the highlights and adjust their level."); - } - - SerializedDataParameter m_Shadows; - SerializedDataParameter m_Midtones; - SerializedDataParameter m_Highlights; - SerializedDataParameter m_ShadowsStart; - SerializedDataParameter m_ShadowsEnd; - SerializedDataParameter m_HighlightsStart; - SerializedDataParameter m_HighlightsEnd; - - readonly TrackballUIDrawer m_TrackballUIDrawer = new TrackballUIDrawer(); - - // Curve drawing utilities - Rect m_CurveRect; - Material m_Material; - RenderTexture m_CurveTex; - - public override void OnEnable() - { - var o = new PropertyFetcher(serializedObject); - - m_Shadows = Unpack(o.Find(x => x.shadows)); - m_Midtones = Unpack(o.Find(x => x.midtones)); - m_Highlights = Unpack(o.Find(x => x.highlights)); - m_ShadowsStart = Unpack(o.Find(x => x.shadowsStart)); - m_ShadowsEnd = Unpack(o.Find(x => x.shadowsEnd)); - m_HighlightsStart = Unpack(o.Find(x => x.highlightsStart)); - m_HighlightsEnd = Unpack(o.Find(x => x.highlightsEnd)); - - m_Material = new Material(Shader.Find("Hidden/HD PostProcessing/Editor/Shadows Midtones Highlights Curve")); - } - - public override void OnInspectorGUI() - { - using (new EditorGUILayout.HorizontalScope()) - { - m_TrackballUIDrawer.OnGUI(m_Shadows.value, m_Shadows.overrideState, Styles.shadowsLabel, GetWheelValue); - GUILayout.Space(4f); - m_TrackballUIDrawer.OnGUI(m_Midtones.value, m_Midtones.overrideState, Styles.midtonesLabel, GetWheelValue); - GUILayout.Space(4f); - m_TrackballUIDrawer.OnGUI(m_Highlights.value, m_Highlights.overrideState, Styles.highlightsLabel, GetWheelValue); - } - EditorGUILayout.Space(); - - // Reserve GUI space - m_CurveRect = GUILayoutUtility.GetRect(128, 80); - m_CurveRect.xMin += EditorGUI.indentLevel * 15f; - - if (Event.current.type == EventType.Repaint) - { - float alpha = GUI.enabled ? 1f : 0.4f; - var limits = new Vector4(m_ShadowsStart.value.floatValue, m_ShadowsEnd.value.floatValue, m_HighlightsStart.value.floatValue, m_HighlightsEnd.value.floatValue); - - m_Material.SetVector(HDShaderIDs._ShaHiLimits, limits); - m_Material.SetVector(HDShaderIDs._Variants, new Vector4(alpha, Mathf.Max(m_HighlightsEnd.value.floatValue, 1f), 0f, 0f)); - - CheckCurveRT((int)m_CurveRect.width, (int)m_CurveRect.height); - - var oldRt = RenderTexture.active; - Graphics.Blit(null, m_CurveTex, m_Material, EditorGUIUtility.isProSkin ? 0 : 1); - RenderTexture.active = oldRt; - - GUI.DrawTexture(m_CurveRect, m_CurveTex); - - Handles.DrawSolidRectangleWithOutline(m_CurveRect, Color.clear, Color.white * 0.4f); - } - - PropertyField(m_ShadowsStart, EditorGUIUtility.TrTextContent("Start")); - m_ShadowsStart.value.floatValue = Mathf.Min(m_ShadowsStart.value.floatValue, m_ShadowsEnd.value.floatValue); - PropertyField(m_ShadowsEnd, EditorGUIUtility.TrTextContent("End")); - m_ShadowsEnd.value.floatValue = Mathf.Max(m_ShadowsStart.value.floatValue, m_ShadowsEnd.value.floatValue); - - PropertyField(m_HighlightsStart, EditorGUIUtility.TrTextContent("Start")); - m_HighlightsStart.value.floatValue = Mathf.Min(m_HighlightsStart.value.floatValue, m_HighlightsEnd.value.floatValue); - PropertyField(m_HighlightsEnd, EditorGUIUtility.TrTextContent("End")); - m_HighlightsEnd.value.floatValue = Mathf.Max(m_HighlightsStart.value.floatValue, m_HighlightsEnd.value.floatValue); - } - - void CheckCurveRT(int width, int height) - { - if (m_CurveTex == null || !m_CurveTex.IsCreated() || m_CurveTex.width != width || m_CurveTex.height != height) - { - CoreUtils.Destroy(m_CurveTex); - m_CurveTex = new RenderTexture(width, height, 0, GraphicsFormat.R8G8B8A8_SRGB); - m_CurveTex.hideFlags = HideFlags.HideAndDontSave; - } - } - - Vector3 GetWheelValue(Vector4 v) - { - float w = v.w * (Mathf.Sign(v.w) < 0f ? 1f : 4f); - return new Vector3( - Mathf.Max(v.x + w, 0f), - Mathf.Max(v.y + w, 0f), - Mathf.Max(v.z + w, 0f) - ); - } - } -} diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/TrackballUIDrawer.cs b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/TrackballUIDrawer.cs deleted file mode 100644 index fd7ab4cc5e2..00000000000 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/TrackballUIDrawer.cs +++ /dev/null @@ -1,245 +0,0 @@ -using System; -using UnityEngine; -using UnityEngine.Experimental.Rendering; - -namespace UnityEditor.Rendering.HighDefinition -{ - // TODO: Should be cleaned up and put into CoreRP/Editor - sealed class TrackballUIDrawer - { - static readonly int s_ThumbHash = "colorWheelThumb".GetHashCode(); - static GUIStyle s_WheelThumb; - static Vector2 s_WheelThumbSize; - static Material s_Material; - static bool s_MaterialConfigured; - - Func m_ComputeFunc; - bool m_ResetState; - Vector2 m_CursorPos; - - public void OnGUI(SerializedProperty property, SerializedProperty overrideState, GUIContent title, Func computeFunc) - { - if (property.propertyType != SerializedPropertyType.Vector4) - { - Debug.LogWarning("TrackballUIDrawer requires a Vector4 property"); - return; - } - - if (!s_MaterialConfigured) - { - // Initialization of materials with Shader.Find from static constructors is not allowed. - s_Material = new Material(Shader.Find("Hidden/HD PostProcessing/Editor/Trackball")) { hideFlags = HideFlags.HideAndDontSave }; - s_MaterialConfigured = true; - } - - m_ComputeFunc = computeFunc; - var value = property.vector4Value; - - using (new EditorGUILayout.VerticalScope()) - { - using (new EditorGUI.DisabledScope(!overrideState.boolValue)) - DrawWheel(ref value, overrideState.boolValue); - - DrawLabelAndOverride(title, overrideState); - } - - if (m_ResetState) - { - value = new Vector4(1f, 1f, 1f, 0f); - m_ResetState = false; - } - - property.vector4Value = value; - } - - void DrawWheel(ref Vector4 value, bool overrideState) - { - var wheelRect = GUILayoutUtility.GetAspectRect(1f); - float size = wheelRect.width; - float hsize = size / 2f; - float radius = 0.38f * size; - - Vector3 hsv; - Color.RGBToHSV(value, out hsv.x, out hsv.y, out hsv.z); - float offset = value.w; - - // Thumb - var thumbPos = Vector2.zero; - float theta = hsv.x * (Mathf.PI * 2f); - thumbPos.x = Mathf.Cos(theta + (Mathf.PI / 2f)); - thumbPos.y = Mathf.Sin(theta - (Mathf.PI / 2f)); - thumbPos *= hsv.y * radius; - - // Draw the wheel - if (Event.current.type == EventType.Repaint) - { - // Style init - if (s_WheelThumb == null) - { - s_WheelThumb = new GUIStyle("ColorPicker2DThumb"); - s_WheelThumbSize = new Vector2( - !Mathf.Approximately(s_WheelThumb.fixedWidth, 0f) ? s_WheelThumb.fixedWidth : s_WheelThumb.padding.horizontal, - !Mathf.Approximately(s_WheelThumb.fixedHeight, 0f) ? s_WheelThumb.fixedHeight : s_WheelThumb.padding.vertical - ); - } - - // Retina support - float scale = EditorGUIUtility.pixelsPerPoint; - - // Wheel texture - var oldRT = RenderTexture.active; - var rt = RenderTexture.GetTemporary((int)(size * scale), (int)(size * scale), 0, GraphicsFormat.R8G8B8A8_SRGB); - s_Material.SetFloat("_Offset", offset); - s_Material.SetFloat("_DisabledState", overrideState && GUI.enabled ? 1f : 0.5f); - s_Material.SetVector("_Resolution", new Vector2(size * scale, size * scale / 2f)); - Graphics.Blit(null, rt, s_Material, EditorGUIUtility.isProSkin ? 0 : 1); - RenderTexture.active = oldRT; - - GUI.DrawTexture(wheelRect, rt); - RenderTexture.ReleaseTemporary(rt); - - var thumbSize = s_WheelThumbSize; - var thumbSizeH = thumbSize / 2f; - s_WheelThumb.Draw(new Rect(wheelRect.x + hsize + thumbPos.x - thumbSizeH.x, wheelRect.y + hsize + thumbPos.y - thumbSizeH.y, thumbSize.x, thumbSize.y), false, false, false, false); - } - - // Input - var bounds = wheelRect; - bounds.x += hsize - radius; - bounds.y += hsize - radius; - bounds.width = bounds.height = radius * 2f; - hsv = GetInput(bounds, hsv, thumbPos, radius); - - - Vector3Int displayHSV = new Vector3Int(Mathf.RoundToInt(hsv.x * 360), Mathf.RoundToInt(hsv.y * 100), 100); - bool displayInputFields = EditorGUIUtility.currentViewWidth > 600; - if (displayInputFields) - { - var valuesRect = GUILayoutUtility.GetRect(1f, 17f); - valuesRect.width /= 5f; - float textOff = valuesRect.width * 0.2f; - EditorGUI.LabelField(valuesRect, "Y"); - valuesRect.x += textOff; - offset = EditorGUI.DelayedFloatField(valuesRect, offset); - offset = Mathf.Clamp(offset, -1.0f, 1.0f); - valuesRect.x += valuesRect.width + valuesRect.width * 0.05f; - EditorGUI.LabelField(valuesRect, "H"); - valuesRect.x += textOff; - displayHSV.x = EditorGUI.DelayedIntField(valuesRect, displayHSV.x); - hsv.x = displayHSV.x / 360.0f; - valuesRect.x += valuesRect.width + valuesRect.width * 0.05f; - EditorGUI.LabelField(valuesRect, "S"); - valuesRect.x += textOff; - displayHSV.y = EditorGUI.DelayedIntField(valuesRect, displayHSV.y); - displayHSV.y = Mathf.Clamp(displayHSV.y, 0, 100); - hsv.y = displayHSV.y / 100.0f; - valuesRect.x += valuesRect.width + valuesRect.width * 0.05f; - EditorGUI.LabelField(valuesRect, "V"); - valuesRect.x += textOff; - GUI.enabled = false; - EditorGUI.IntField(valuesRect, 100); - GUI.enabled = true; - } - - - value = Color.HSVToRGB(hsv.x, hsv.y, 1f); - value.w = offset; - - // Offset - var sliderRect = GUILayoutUtility.GetRect(1f, 17f); - float padding = sliderRect.width * 0.05f; // 5% padding - sliderRect.xMin += padding; - sliderRect.xMax -= padding; - value.w = GUI.HorizontalSlider(sliderRect, value.w, -1f, 1f); - - if (m_ComputeFunc == null) - return; - - // Values - var displayValue = m_ComputeFunc(value); - using (new EditorGUI.DisabledGroupScope(true)) - { - var valuesRect = GUILayoutUtility.GetRect(1f, 17f); - valuesRect.width /= (displayInputFields ? 4f : 3.0f); - if (displayInputFields) - { - GUI.Label(valuesRect, "RGB Value:", EditorStyles.centeredGreyMiniLabel); - valuesRect.x += valuesRect.width; - } - GUI.Label(valuesRect, displayValue.x.ToString("F2"), EditorStyles.centeredGreyMiniLabel); - valuesRect.x += valuesRect.width; - GUI.Label(valuesRect, displayValue.y.ToString("F2"), EditorStyles.centeredGreyMiniLabel); - valuesRect.x += valuesRect.width; - GUI.Label(valuesRect, displayValue.z.ToString("F2"), EditorStyles.centeredGreyMiniLabel); - valuesRect.x += valuesRect.width; - } - } - - void DrawLabelAndOverride(GUIContent title, SerializedProperty overrideState) - { - // Title - var areaRect = GUILayoutUtility.GetRect(1f, 17f); - var labelSize = EditorStyles.miniLabel.CalcSize(title); - var labelRect = new Rect(areaRect.x + areaRect.width / 2 - labelSize.x / 2, areaRect.y, labelSize.x, labelSize.y); - GUI.Label(labelRect, title, EditorStyles.miniLabel); - - // Override checkbox - var overrideRect = new Rect(labelRect.x - 17, labelRect.y + 3, 17f, 17f); - overrideState.boolValue = GUI.Toggle(overrideRect, overrideState.boolValue, EditorGUIUtility.TrTextContent("", "Override this setting for this volume."), CoreEditorStyles.smallTickbox); - } - - Vector3 GetInput(Rect bounds, Vector3 hsv, Vector2 thumbPos, float radius) - { - var e = Event.current; - var id = GUIUtility.GetControlID(s_ThumbHash, FocusType.Passive, bounds); - var mousePos = e.mousePosition; - - if (e.type == EventType.MouseDown && GUIUtility.hotControl == 0 && bounds.Contains(mousePos)) - { - if (e.button == 0) - { - var center = new Vector2(bounds.x + radius, bounds.y + radius); - float dist = Vector2.Distance(center, mousePos); - - if (dist <= radius) - { - e.Use(); - m_CursorPos = new Vector2(thumbPos.x + radius, thumbPos.y + radius); - GUIUtility.hotControl = id; - GUI.changed = true; - } - } - else if (e.button == 1) - { - e.Use(); - GUI.changed = true; - m_ResetState = true; - } - } - else if (e.type == EventType.MouseDrag && e.button == 0 && GUIUtility.hotControl == id) - { - e.Use(); - GUI.changed = true; - m_CursorPos += e.delta * 0.2f; // Sensitivity - GetWheelHueSaturation(m_CursorPos.x, m_CursorPos.y, radius, out hsv.x, out hsv.y); - } - else if (e.rawType == EventType.MouseUp && e.button == 0 && GUIUtility.hotControl == id) - { - e.Use(); - GUIUtility.hotControl = 0; - } - - return hsv; - } - - void GetWheelHueSaturation(float x, float y, float radius, out float hue, out float saturation) - { - float dx = (x - radius) / radius; - float dy = (y - radius) / radius; - float d = Mathf.Sqrt(dx * dx + dy * dy); - hue = Mathf.Atan2(dx, -dy); - hue = 1f - ((hue > 0) ? hue : (Mathf.PI * 2f) + hue) / (Mathf.PI * 2f); - saturation = Mathf.Clamp01(d); - } - } -} diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/IPostProcessComponent.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/IPostProcessComponent.cs deleted file mode 100644 index f8cf01376d0..00000000000 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/IPostProcessComponent.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace UnityEngine.Rendering.HighDefinition -{ - /// - /// Implement this interface on every post process volumes - /// - public interface IPostProcessComponent - { - /// - /// Tells if the post process needs to be rendered or not. - /// - /// true if the effect should be rendered, false otherwise. - bool IsActive(); - } -} diff --git a/com.unity.render-pipelines.universal/Editor/Overrides/FilmGrainEditor.cs b/com.unity.render-pipelines.universal/Editor/Overrides/FilmGrainEditor.cs deleted file mode 100644 index 2ffa440a49b..00000000000 --- a/com.unity.render-pipelines.universal/Editor/Overrides/FilmGrainEditor.cs +++ /dev/null @@ -1,70 +0,0 @@ -using UnityEngine; -using UnityEngine.Rendering.Universal; - -namespace UnityEditor.Rendering.Universal -{ - [CustomEditor(typeof(FilmGrain))] - sealed class FilmGrainEditor : VolumeComponentEditor - { - SerializedDataParameter m_Type; - SerializedDataParameter m_Intensity; - SerializedDataParameter m_Response; - SerializedDataParameter m_Texture; - - public override void OnEnable() - { - var o = new PropertyFetcher(serializedObject); - - m_Type = Unpack(o.Find(x => x.type)); - m_Intensity = Unpack(o.Find(x => x.intensity)); - m_Response = Unpack(o.Find(x => x.response)); - m_Texture = Unpack(o.Find(x => x.texture)); - } - - public override void OnInspectorGUI() - { - PropertyField(m_Type); - - if (m_Type.value.intValue == (int)FilmGrainLookup.Custom) - { - using (new IndentLevelScope()) - PropertyField(m_Texture); - - var texture = (target as FilmGrain).texture.value; - - if (texture != null) - { - var importer = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(texture)) as TextureImporter; - - // Fails when using an internal texture as you can't change import settings on - // builtin resources, thus the check for null - if (importer != null) - { - bool valid = importer.mipmapEnabled == false - && importer.alphaSource == TextureImporterAlphaSource.FromGrayScale - && importer.filterMode == FilterMode.Point - && importer.textureCompression == TextureImporterCompression.Uncompressed - && importer.textureType == TextureImporterType.SingleChannel; - - if (!valid) - CoreEditorUtils.DrawFixMeBox("Invalid texture import settings.", () => SetTextureImportSettings(importer)); - } - } - } - - PropertyField(m_Intensity); - PropertyField(m_Response); - } - - static void SetTextureImportSettings(TextureImporter importer) - { - importer.textureType = TextureImporterType.SingleChannel; - importer.alphaSource = TextureImporterAlphaSource.FromGrayScale; - importer.mipmapEnabled = false; - importer.filterMode = FilterMode.Point; - importer.textureCompression = TextureImporterCompression.Uncompressed; - importer.SaveAndReimport(); - AssetDatabase.Refresh(); - } - } -} diff --git a/com.unity.render-pipelines.universal/Editor/Overrides/ShadowsMidtonesHighlightsEditor.cs.meta b/com.unity.render-pipelines.universal/Editor/Overrides/ShadowsMidtonesHighlightsEditor.cs.meta deleted file mode 100644 index 5c647a266d0..00000000000 --- a/com.unity.render-pipelines.universal/Editor/Overrides/ShadowsMidtonesHighlightsEditor.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 4b15ac5de32362a4a9ef0bc5b349ac4d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/ChannelMixer.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/ChannelMixer.cs deleted file mode 100644 index 501c2938ba6..00000000000 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/ChannelMixer.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; - -namespace UnityEngine.Rendering.Universal -{ - /// - /// A volume component that holds settings for the Channel Mixer effect. - /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Channel Mixer", typeof(UniversalRenderPipeline))] - public sealed class ChannelMixer : VolumeComponent, IPostProcessComponent - { - /// - /// Modify influence of the red channel in the overall mix. - /// - [Tooltip("Modify influence of the red channel in the overall mix.")] - public ClampedFloatParameter redOutRedIn = new ClampedFloatParameter(100f, -200f, 200f); - - /// - /// Modify influence of the green channel in the overall mix. - /// - [Tooltip("Modify influence of the green channel in the overall mix.")] - public ClampedFloatParameter redOutGreenIn = new ClampedFloatParameter(0f, -200f, 200f); - - /// - /// Modify influence of the blue channel in the overall mix. - /// - [Tooltip("Modify influence of the blue channel in the overall mix.")] - public ClampedFloatParameter redOutBlueIn = new ClampedFloatParameter(0f, -200f, 200f); - - /// - /// Modify influence of the red channel in the overall mix. - /// - [Tooltip("Modify influence of the red channel in the overall mix.")] - public ClampedFloatParameter greenOutRedIn = new ClampedFloatParameter(0f, -200f, 200f); - - /// - /// Modify influence of the green channel in the overall mix. - /// - [Tooltip("Modify influence of the green channel in the overall mix.")] - public ClampedFloatParameter greenOutGreenIn = new ClampedFloatParameter(100f, -200f, 200f); - - /// - /// Modify influence of the blue channel in the overall mix. - /// - [Tooltip("Modify influence of the blue channel in the overall mix.")] - public ClampedFloatParameter greenOutBlueIn = new ClampedFloatParameter(0f, -200f, 200f); - - /// - /// Modify influence of the red channel in the overall mix. - /// - [Tooltip("Modify influence of the red channel in the overall mix.")] - public ClampedFloatParameter blueOutRedIn = new ClampedFloatParameter(0f, -200f, 200f); - - /// - /// Modify influence of the green channel in the overall mix. - /// - [Tooltip("Modify influence of the green channel in the overall mix.")] - public ClampedFloatParameter blueOutGreenIn = new ClampedFloatParameter(0f, -200f, 200f); - - /// - /// Modify influence of the blue channel in the overall mix. - /// - [Tooltip("Modify influence of the blue channel in the overall mix.")] - public ClampedFloatParameter blueOutBlueIn = new ClampedFloatParameter(100f, -200f, 200f); - - /// - public bool IsActive() - { - return redOutRedIn.value != 100f - || redOutGreenIn.value != 0f - || redOutBlueIn.value != 0f - || greenOutRedIn.value != 0f - || greenOutGreenIn.value != 100f - || greenOutBlueIn.value != 0f - || blueOutRedIn.value != 0f - || blueOutGreenIn.value != 0f - || blueOutBlueIn.value != 100f; - } - - /// - public bool IsTileCompatible() => true; - } -} diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/FilmGrain.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/FilmGrain.cs deleted file mode 100644 index 4c8f73791bb..00000000000 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/FilmGrain.cs +++ /dev/null @@ -1,117 +0,0 @@ -using System; - -namespace UnityEngine.Rendering.Universal -{ - /// - /// Presets for the effect. - /// - public enum FilmGrainLookup - { - /// - /// Thin grain preset. - /// - Thin1, - - /// - /// Thin grain preset. - /// - Thin2, - - /// - /// Medium grain preset. - /// - Medium1, - - /// - /// Medium grain preset. - /// - Medium2, - - /// - /// Medium grain preset. - /// - Medium3, - - /// - /// Medium grain preset. - /// - Medium4, - - /// - /// Medium grain preset. - /// - Medium5, - - /// - /// Medium grain preset. - /// - Medium6, - - /// - /// Large grain preset. - /// - Large01, - - /// - /// Large grain preset. - /// - Large02, - - /// - /// Custom grain preset. - /// - /// - Custom - } - - /// - /// A volume component that holds settings for the Film Grain effect. - /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Film Grain", typeof(UniversalRenderPipeline))] - public sealed class FilmGrain : VolumeComponent, IPostProcessComponent - { - /// - /// The type of grain to use. You can select a preset or provide your own texture by selecting Custom. - /// - [Tooltip("The type of grain to use. You can select a preset or provide your own texture by selecting Custom.")] - public FilmGrainLookupParameter type = new FilmGrainLookupParameter(FilmGrainLookup.Thin1); - - /// - /// Use this to set the strength of the Film Grain effect. - /// - [Tooltip("Use the slider to set the strength of the Film Grain effect.")] - public ClampedFloatParameter intensity = new ClampedFloatParameter(0f, 0f, 1f); - - /// - /// Controls the noisiness response curve based on scene luminance. Higher values mean less noise in light areas. - /// - [Tooltip("Controls the noisiness response curve based on scene luminance. Higher values mean less noise in light areas.")] - public ClampedFloatParameter response = new ClampedFloatParameter(0.8f, 0f, 1f); - - /// - /// A tileable texture to use for the grain. The neutral value is 0.5 where no grain is applied - /// - [Tooltip("A tileable texture to use for the grain. The neutral value is 0.5 where no grain is applied.")] - public NoInterpTextureParameter texture = new NoInterpTextureParameter(null); - - /// - public bool IsActive() => intensity.value > 0f && (type.value != FilmGrainLookup.Custom || texture.value != null); - - /// - public bool IsTileCompatible() => true; - } - - /// - /// A that holds a value. - /// - [Serializable] - public sealed class FilmGrainLookupParameter : VolumeParameter - { - /// - /// Creates a new instance. - /// - /// The initial value to store in the parameter. - /// The initial override state for the parameter. - public FilmGrainLookupParameter(FilmGrainLookup value, bool overrideState = false) : base(value, overrideState) { } - } -} diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/LiftGammaGain.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/LiftGammaGain.cs deleted file mode 100644 index d1bce433ec5..00000000000 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/LiftGammaGain.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; - -namespace UnityEngine.Rendering.Universal -{ - /// - /// A volume component that holds settings for the Split Toning effect. - /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Lift, Gamma, Gain", typeof(UniversalRenderPipeline))] - public sealed class LiftGammaGain : VolumeComponent, IPostProcessComponent - { - /// - /// Use this to control and apply a hue to the dark tones. This has a more exaggerated effect on shadows. - /// - [Tooltip("Use this to control and apply a hue to the dark tones. This has a more exaggerated effect on shadows.")] - public Vector4Parameter lift = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f)); - - /// - /// Use this to control and apply a hue to the mid-range tones with a power function. - /// - [Tooltip("Use this to control and apply a hue to the mid-range tones with a power function.")] - public Vector4Parameter gamma = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f)); - - /// - /// Use this to increase and apply a hue to the signal and make highlights brighter. - /// - [Tooltip("Use this to increase and apply a hue to the signal and make highlights brighter.")] - public Vector4Parameter gain = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f)); - - /// - public bool IsActive() - { - var defaultState = new Vector4(1f, 1f, 1f, 0f); - return lift != defaultState - || gamma != defaultState - || gain != defaultState; - } - - /// - public bool IsTileCompatible() => true; - } -} diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/PaniniProjection.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/PaniniProjection.cs deleted file mode 100644 index 3cb28b732d2..00000000000 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/PaniniProjection.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; - -namespace UnityEngine.Rendering.Universal -{ - /// - /// A volume component that holds settings for the Panini Projection effect. - /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Panini Projection", typeof(UniversalRenderPipeline))] - public sealed class PaniniProjection : VolumeComponent, IPostProcessComponent - { - /// - /// Controls the panini projection distance. This controls the strength of the distorion. - /// - [Tooltip("Panini projection distance.")] - public ClampedFloatParameter distance = new ClampedFloatParameter(0f, 0f, 1f); - - /// - /// Controls how much cropping HDRP applies to the screen with the panini projection effect. A value of 1 crops the distortion to the edge of the screen. - /// - [Tooltip("Panini projection crop to fit.")] - public ClampedFloatParameter cropToFit = new ClampedFloatParameter(1f, 0f, 1f); - - /// - public bool IsActive() => distance.value > 0f; - - /// - public bool IsTileCompatible() => false; - } -} diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/ShadowsMidtonesHighlights.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/ShadowsMidtonesHighlights.cs deleted file mode 100644 index 479316a3bdd..00000000000 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/ShadowsMidtonesHighlights.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System; - -namespace UnityEngine.Rendering.Universal -{ - /// - /// A volume component that holds settings for the Shadows, Midtones, Highlights effect. - /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Shadows, Midtones, Highlights", typeof(UniversalRenderPipeline))] - public sealed class ShadowsMidtonesHighlights : VolumeComponent, IPostProcessComponent - { - /// - /// Use this to control and apply a hue to the shadows. - /// - [Tooltip("Use this to control and apply a hue to the shadows.")] - public Vector4Parameter shadows = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f)); - - /// - /// Use this to control and apply a hue to the midtones. - /// - [Tooltip("Use this to control and apply a hue to the midtones.")] - public Vector4Parameter midtones = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f)); - - /// - /// Use this to control and apply a hue to the highlights. - /// - [Tooltip("Use this to control and apply a hue to the highlights.")] - public Vector4Parameter highlights = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f)); - - /// - /// Start point of the transition between shadows and midtones. - /// - [Header("Shadow Limits")] - [Tooltip("Start point of the transition between shadows and midtones.")] - public MinFloatParameter shadowsStart = new MinFloatParameter(0f, 0f); - - /// - /// End point of the transition between shadows and midtones. - /// - [Tooltip("End point of the transition between shadows and midtones.")] - public MinFloatParameter shadowsEnd = new MinFloatParameter(0.3f, 0f); - - /// - /// Start point of the transition between midtones and highlights - /// - [Header("Highlight Limits")] - [Tooltip("Start point of the transition between midtones and highlights.")] - public MinFloatParameter highlightsStart = new MinFloatParameter(0.55f, 0f); - - /// - /// End point of the transition between midtones and highlights. - /// - [Tooltip("End point of the transition between midtones and highlights.")] - public MinFloatParameter highlightsEnd = new MinFloatParameter(1f, 0f); - - /// - public bool IsActive() - { - var defaultState = new Vector4(1f, 1f, 1f, 0f); - return shadows != defaultState - || midtones != defaultState - || highlights != defaultState; - } - - /// - public bool IsTileCompatible() => true; - } -} diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/WhiteBalance.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/WhiteBalance.cs deleted file mode 100644 index 7b7eb0797a4..00000000000 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/WhiteBalance.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; - -namespace UnityEngine.Rendering.Universal -{ - /// - /// A volume component that holds settings for the White Balance effect. - /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/White Balance", typeof(UniversalRenderPipeline))] - public sealed class WhiteBalance : VolumeComponent, IPostProcessComponent - { - /// - /// Controls the color temperature URP uses for white balancing. - /// - [Tooltip("Sets the white balance to a custom color temperature.")] - public ClampedFloatParameter temperature = new ClampedFloatParameter(0f, -100, 100f); - - /// - /// Controls the white balance color to compensate for a green or magenta tint. - /// - [Tooltip("Sets the white balance to compensate for a green or magenta tint.")] - public ClampedFloatParameter tint = new ClampedFloatParameter(0f, -100, 100f); - - /// - public bool IsActive() => temperature.value != 0f || tint.value != 0f; - - /// - public bool IsTileCompatible() => true; - } -} diff --git a/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPass.cs b/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPass.cs index a1777de08a6..fd2198505a0 100644 --- a/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPass.cs +++ b/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPass.cs @@ -2,23 +2,6 @@ using System.Runtime.CompilerServices; using UnityEngine.Experimental.Rendering; -namespace UnityEngine.Rendering.Universal -{ - /// - /// Implement this interface on every post process volumes - /// - public interface IPostProcessComponent - { - /// - /// Tells if the post process needs to be rendered or not. - /// - /// True if the component is active, otherwise false. - bool IsActive(); - - bool IsTileCompatible(); - } -} - namespace UnityEngine.Rendering.Universal.Internal { /// From d61c3ca9bc9adf4b853ec896b0421f05f629e6cb Mon Sep 17 00:00:00 2001 From: tim Date: Mon, 29 Nov 2021 13:28:50 +0100 Subject: [PATCH 10/19] Add Upgrader For PostProcessing components. --- .../PostProcessing/Components/ChannelMixer.cs | 24 ++++++++++ .../PostProcessing/Components/FilmGrain.cs | 19 ++++++++ .../Components/HDRPUpgradable/ChannelMixer.cs | 3 +- .../HDRPUpgradable/LiftGammaGain.cs | 3 +- .../HDRPUpgradable/PaniniProjection.cs | 3 +- .../Components/HDRPUpgradable/WhiteBalance.cs | 3 +- .../Components/IPostProcessComponent.cs | 4 ++ .../Components/LiftGammaGain.cs | 18 ++++++++ .../Components/PaniniProjection.cs | 17 +++++++ .../Components/ShadowsMidtonesHighlights.cs | 22 +++++++++ .../PostProcessing/Components/WhiteBalance.cs | 17 +++++++ .../Runtime/Volume/VolumeProfile.cs | 45 ++++++++++++++++++- 12 files changed, 170 insertions(+), 8 deletions(-) diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ChannelMixer.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ChannelMixer.cs index 940593df07a..e6db1deadf9 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ChannelMixer.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ChannelMixer.cs @@ -84,5 +84,29 @@ public bool IsActive() } public bool IsTileCompatible() => true; + + public Type GetNewComponentType() + { + return typeof(ChannelMixer); + } + + public void CopyToNewComponent(VolumeComponent volumeComponent) + { + if (volumeComponent is not ChannelMixer mixer) + return; + + mixer.active = active; + mixer.hideFlags = hideFlags; + mixer.displayName = displayName; + mixer.redOutRedIn = redOutRedIn; + mixer.redOutGreenIn = redOutGreenIn; + mixer.redOutBlueIn = redOutBlueIn; + mixer.greenOutRedIn = greenOutRedIn; + mixer.greenOutGreenIn = greenOutGreenIn; + mixer.greenOutBlueIn = greenOutBlueIn; + mixer.blueOutRedIn = blueOutRedIn; + mixer.blueOutGreenIn = blueOutGreenIn; + mixer.blueOutBlueIn = blueOutBlueIn; + } } } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/FilmGrain.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/FilmGrain.cs index 2142759579f..dfdb798dda8 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/FilmGrain.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/FilmGrain.cs @@ -108,6 +108,25 @@ public bool IsActive() } public bool IsTileCompatible() => true; + + public Type GetNewComponentType() + { + return typeof(FilmGrain); + } + + public void CopyToNewComponent(VolumeComponent volumeComponent) + { + if (volumeComponent is not FilmGrain grain) + return; + + grain.active = active; + grain.hideFlags = hideFlags; + grain.displayName = displayName; + grain.type = type; + grain.intensity = intensity; + grain.response = response; + grain.texture = texture; + } } /// diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ChannelMixer.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ChannelMixer.cs index f263649e906..724824adf19 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ChannelMixer.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ChannelMixer.cs @@ -8,6 +8,5 @@ namespace UnityEngine.Rendering.HighDefinition.Obsolete [Serializable] [Obsolete] public sealed class ChannelMixer : UnityEngine.Rendering.ChannelMixer, IDeprecatedVolumeComponent - { - } + { } } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/LiftGammaGain.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/LiftGammaGain.cs index eed46ea300f..9088d4da44a 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/LiftGammaGain.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/LiftGammaGain.cs @@ -9,6 +9,5 @@ namespace UnityEngine.Rendering.HighDefinition.Obsolete [Obsolete] // [HDRPHelpURLAttribute("Post-Processing-Lift-Gamma-Gain")] public sealed class LiftGammaGain : UnityEngine.Rendering.LiftGammaGain, IDeprecatedVolumeComponent - { - } + { } } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/PaniniProjection.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/PaniniProjection.cs index f708146fd67..c61a0e869aa 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/PaniniProjection.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/PaniniProjection.cs @@ -8,6 +8,5 @@ namespace UnityEngine.Rendering.HighDefinition.Obsolete [Serializable] [Obsolete] public sealed class PaniniProjection : UnityEngine.Rendering.PaniniProjection, IDeprecatedVolumeComponent - { - } + { } } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/WhiteBalance.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/WhiteBalance.cs index 148e3fec9c1..76f62815802 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/WhiteBalance.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/WhiteBalance.cs @@ -9,5 +9,6 @@ namespace UnityEngine.Rendering.HighDefinition.Obsolete [Obsolete] //[HDRPHelpURLAttribute("Post-Processing-White-Balance")] public sealed class WhiteBalance : UnityEngine.Rendering.WhiteBalance, IDeprecatedVolumeComponent - { } + { + } } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/IPostProcessComponent.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/IPostProcessComponent.cs index e0c4a0bd4d4..b56b15363fd 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/IPostProcessComponent.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/IPostProcessComponent.cs @@ -1,3 +1,5 @@ +using System; + namespace UnityEngine.Rendering { public interface IPostProcessComponent @@ -12,5 +14,7 @@ bool IsTileCompatible() public interface IDeprecatedVolumeComponent { + public void CopyToNewComponent(VolumeComponent old); + public Type GetNewComponentType(); } } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LiftGammaGain.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LiftGammaGain.cs index 453fcd73475..4394b3c4619 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LiftGammaGain.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LiftGammaGain.cs @@ -42,5 +42,23 @@ public bool IsActive() protected LiftGammaGain() => displayName = "Lift, Gamma, Gain"; public bool IsTileCompatible() => true; + + public Type GetNewComponentType() + { + return typeof(LiftGammaGain); + } + + public void CopyToNewComponent(VolumeComponent volumeComponent) + { + if (volumeComponent is not LiftGammaGain lgg) + return; + + lgg.active = active; + lgg.displayName = displayName; + lgg.hideFlags = hideFlags; + lgg.lift = lift; + lgg.gamma = gamma; + lgg.gain = gain; + } } } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/PaniniProjection.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/PaniniProjection.cs index fda203a0473..ed44c42fe4b 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/PaniniProjection.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/PaniniProjection.cs @@ -30,5 +30,22 @@ public bool IsActive() { return distance.value > 0f; } + + public Type GetNewComponentType() + { + return typeof(PaniniProjection); + } + + public void CopyToNewComponent(VolumeComponent volumeComponent) + { + if (volumeComponent is not PaniniProjection panini) + return; + + panini.active = active; + panini.hideFlags = hideFlags; + panini.displayName = displayName; + panini.distance = distance; + panini.cropToFit = cropToFit; + } } } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs index c727d0fbaf7..13e73561d5e 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs @@ -68,5 +68,27 @@ public bool IsActive() protected ShadowsMidtonesHighlights() => displayName = "Shadows, Midtones, Highlights"; public bool IsTileCompatible() => true; + + public Type GetNewComponentType() + { + return typeof(ShadowsMidtonesHighlights); + } + + public void CopyToNewComponent(VolumeComponent volumeComponent) + { + if (volumeComponent is not ShadowsMidtonesHighlights smh) + return; + + smh.active = active; + smh.hideFlags = hideFlags; + smh.displayName = displayName; + smh.shadows = shadows; + smh.midtones = midtones; + smh.highlights = highlights; + smh.shadowsStart = shadowsStart; + smh.shadowsEnd = shadowsEnd; + smh.highlightsStart = highlightsStart; + smh.highlightsEnd = highlightsEnd; + } } } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/WhiteBalance.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/WhiteBalance.cs index aa3fedd5c25..328a02138bd 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/WhiteBalance.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/WhiteBalance.cs @@ -32,5 +32,22 @@ public bool IsActive() } public bool IsTileCompatible() => true; + + public Type GetNewComponentType() + { + return typeof(WhiteBalance); + } + + public void CopyToNewComponent(VolumeComponent volumeComponent) + { + if (volumeComponent is not WhiteBalance wb) + return; + + wb.active = active; + wb.hideFlags = hideFlags; + wb.displayName = displayName; + wb.temperature = temperature; + wb.tint = tint; + } } } diff --git a/com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs b/com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs index 9b0624b366e..468b3b81e6d 100644 --- a/com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs +++ b/com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs @@ -1,5 +1,8 @@ using System; using System.Collections.Generic; +#if UNITY_EDITOR +using UnityEditor; +#endif using UnityEngine.Assertions; namespace UnityEngine.Rendering @@ -13,7 +16,7 @@ public sealed class VolumeProfile : ScriptableObject /// /// A list of every setting that this Volume Profile stores. /// - public List components = new List(); + public List components = new(); /// /// A dirty check used to redraw the profile inspector when something has changed. This is @@ -30,6 +33,46 @@ void OnEnable() // harmless and happens because Unity does a redraw of the editor (and thus the current // frame) before the recompilation step. components.RemoveAll(x => x == null); + +#if UNITY_EDITOR + // Attempt to upgrade any deprecated components to their new component type. + // Find all the components on the volume that are marked as deprecated + var toUpgrade = new List(); + foreach (var volumeComponent in components) + { + if (volumeComponent != null && volumeComponent is IDeprecatedVolumeComponent) + { + var deprecatedComponent = (volumeComponent as IDeprecatedVolumeComponent); + toUpgrade.Add(deprecatedComponent); + } + } + + // Remove them from the volume. + foreach (var volumeComponent in toUpgrade) + Remove(volumeComponent.GetType()); + + // Add all the upgraded components. + foreach (var volumeComponent in toUpgrade) + { + var newType = volumeComponent.GetNewComponentType(); + if (newType == null) + continue; + + Add(newType); + + if (TryGet(volumeComponent.GetNewComponentType(), out var component)) + { + volumeComponent.CopyToNewComponent(component); + + if (EditorUtility.IsPersistent(this)) + { + AssetDatabase.AddObjectToAsset(component, this); + EditorUtility.SetDirty(this); + AssetDatabase.SaveAssets(); + } + } + } +#endif } /// From 680f8e5816ee51f6290451781766f4a46fd25793 Mon Sep 17 00:00:00 2001 From: tim Date: Mon, 29 Nov 2021 14:18:20 +0100 Subject: [PATCH 11/19] Reset the defaults if an upgrade happens. --- .../Runtime/Volume/VolumeManager.cs | 5 +++++ .../Runtime/Volume/VolumeProfile.cs | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.core/Runtime/Volume/VolumeManager.cs b/com.unity.render-pipelines.core/Runtime/Volume/VolumeManager.cs index 8b7655e21ce..23c07df897b 100644 --- a/com.unity.render-pipelines.core/Runtime/Volume/VolumeManager.cs +++ b/com.unity.render-pipelines.core/Runtime/Volume/VolumeManager.cs @@ -187,6 +187,11 @@ public void ResetMainStack() stack = m_DefaultStack; } + internal void RebuildDefaultStack() + { + m_DefaultStack = CreateStack(); + } + /// /// Destroy a Volume Stack /// diff --git a/com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs b/com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs index 468b3b81e6d..c0806ee8d29 100644 --- a/com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs +++ b/com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs @@ -66,12 +66,20 @@ void OnEnable() if (EditorUtility.IsPersistent(this)) { - AssetDatabase.AddObjectToAsset(component, this); EditorUtility.SetDirty(this); - AssetDatabase.SaveAssets(); + AssetDatabase.AddObjectToAsset(component, this); + AssetDatabase.RemoveObjectFromAsset(volumeComponent as ScriptableObject); } } } + + if (toUpgrade.Count > 0) + { + AssetDatabase.SaveAssets(); + AssetDatabase.Refresh(); + Reset(); + VolumeManager.instance.RebuildDefaultStack(); + } #endif } From a3e82861ba432cc4547731bbad6e83aa24a7d3b5 Mon Sep 17 00:00:00 2001 From: tim Date: Mon, 29 Nov 2021 14:56:18 +0100 Subject: [PATCH 12/19] Porting more post FX to be shared. # Conflicts: # com.unity.render-pipelines.universal/Editor/Overrides/ColorCurvesEditor.cs # com.unity.render-pipelines.universal/Runtime/Overrides/ColorAdjustments.cs # com.unity.render-pipelines.universal/Runtime/Overrides/ColorCurves.cs --- .../PostProcessing/ColorCurvesEditor.cs | 4 +- .../PostProcessing/ColorCurvesEditor.cs.meta | 0 .../Components/ColorAdjustments.cs | 38 +- .../Components/ColorAdjustments.cs.meta | 2 +- .../PostProcessing/Components/ColorCurves.cs | 33 +- .../Components/ColorCurves.cs.meta | 11 + .../HDRPUpgradable/ColorAdjustments.cs | 12 + .../HDRPUpgradable}/ColorAdjustments.cs.meta | 0 .../Components/HDRPUpgradable/ColorCurves.cs | 13 + .../HDRPUpgradable}/ColorCurves.cs.meta | 0 .../URPUpgradable/ColorAdjustments.cs | 10 + .../URPUpgradable}/ColorAdjustments.cs.meta | 0 .../Components/URPUpgradable/ColorCurves.cs | 10 + .../URPUpgradable}/ColorCurves.cs.meta | 0 .../Editor/Overrides/ColorCurvesEditor.cs | 374 ------------------ .../Runtime/Overrides/ColorAdjustments.cs | 55 --- .../Runtime/Overrides/ColorCurves.cs | 65 --- 17 files changed, 118 insertions(+), 509 deletions(-) rename {com.unity.render-pipelines.high-definition => com.unity.render-pipelines.core}/Editor/PostProcessing/ColorCurvesEditor.cs (99%) rename {com.unity.render-pipelines.high-definition => com.unity.render-pipelines.core}/Editor/PostProcessing/ColorCurvesEditor.cs.meta (100%) rename {com.unity.render-pipelines.high-definition => com.unity.render-pipelines.core}/Runtime/PostProcessing/Components/ColorAdjustments.cs (63%) rename com.unity.render-pipelines.universal/Editor/Overrides/ColorCurvesEditor.cs.meta => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorAdjustments.cs.meta (83%) rename {com.unity.render-pipelines.high-definition => com.unity.render-pipelines.core}/Runtime/PostProcessing/Components/ColorCurves.cs (75%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorCurves.cs.meta create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ColorAdjustments.cs rename {com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable}/ColorAdjustments.cs.meta (100%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ColorCurves.cs rename {com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable}/ColorCurves.cs.meta (100%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ColorAdjustments.cs rename {com.unity.render-pipelines.universal/Runtime/Overrides => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable}/ColorAdjustments.cs.meta (100%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ColorCurves.cs rename {com.unity.render-pipelines.universal/Runtime/Overrides => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable}/ColorCurves.cs.meta (100%) delete mode 100644 com.unity.render-pipelines.universal/Editor/Overrides/ColorCurvesEditor.cs delete mode 100644 com.unity.render-pipelines.universal/Runtime/Overrides/ColorAdjustments.cs delete mode 100644 com.unity.render-pipelines.universal/Runtime/Overrides/ColorCurves.cs diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ColorCurvesEditor.cs b/com.unity.render-pipelines.core/Editor/PostProcessing/ColorCurvesEditor.cs similarity index 99% rename from com.unity.render-pipelines.high-definition/Editor/PostProcessing/ColorCurvesEditor.cs rename to com.unity.render-pipelines.core/Editor/PostProcessing/ColorCurvesEditor.cs index f6bce9240e3..6243d305d15 100644 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ColorCurvesEditor.cs +++ b/com.unity.render-pipelines.core/Editor/PostProcessing/ColorCurvesEditor.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using UnityEngine; -using UnityEngine.Rendering.HighDefinition; using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering; -namespace UnityEditor.Rendering.HighDefinition +namespace UnityEditor.Rendering { using CurveState = InspectorCurveEditor.CurveState; diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ColorCurvesEditor.cs.meta b/com.unity.render-pipelines.core/Editor/PostProcessing/ColorCurvesEditor.cs.meta similarity index 100% rename from com.unity.render-pipelines.high-definition/Editor/PostProcessing/ColorCurvesEditor.cs.meta rename to com.unity.render-pipelines.core/Editor/PostProcessing/ColorCurvesEditor.cs.meta diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ColorAdjustments.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorAdjustments.cs similarity index 63% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ColorAdjustments.cs rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorAdjustments.cs index 64df48a9eaf..44b56811b63 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ColorAdjustments.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorAdjustments.cs @@ -1,13 +1,13 @@ using System; -namespace UnityEngine.Rendering.HighDefinition +namespace UnityEngine.Rendering { /// /// A volume component that holds settings for the Color Adjustments effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Color Adjustments", typeof(HDRenderPipeline))] - [HDRPHelpURLAttribute("Post-Processing-Color-Adjustments")] - public sealed class ColorAdjustments : VolumeComponent, IPostProcessComponent + [Serializable, VolumeComponentMenu("Post-processing/Color Adjustments")] + //[HDRPHelpURLAttribute("Post-Processing-Color-Adjustments")] + public class ColorAdjustments : VolumeComponent, IPostProcessComponent { /// /// Adjusts the brightness of the image just before color grading, in EV. @@ -46,10 +46,32 @@ public sealed class ColorAdjustments : VolumeComponent, IPostProcessComponent public bool IsActive() { return postExposure.value != 0f - || contrast.value != 0f - || colorFilter != Color.white - || hueShift != 0f - || saturation != 0f; + || contrast.value != 0f + || colorFilter != Color.white + || hueShift != 0f + || saturation != 0f; + } + + public bool IsTileCompatible() => true; + + public Type GetNewComponentType() + { + return typeof(ColorAdjustments); + } + + public void CopyToNewComponent(VolumeComponent volumeComponent) + { + if (volumeComponent is not ColorAdjustments ca) + return; + + ca.active = active; + ca.hideFlags = hideFlags; + ca.displayName = displayName; + ca.postExposure = postExposure; + ca.contrast = contrast; + ca.colorFilter = colorFilter; + ca.hueShift = hueShift; + ca.saturation = saturation; } } } diff --git a/com.unity.render-pipelines.universal/Editor/Overrides/ColorCurvesEditor.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorAdjustments.cs.meta similarity index 83% rename from com.unity.render-pipelines.universal/Editor/Overrides/ColorCurvesEditor.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorAdjustments.cs.meta index 9ee59f7db8c..9568b97bd40 100644 --- a/com.unity.render-pipelines.universal/Editor/Overrides/ColorCurvesEditor.cs.meta +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorAdjustments.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 471d118113469fd45ba63677546e2020 +guid: ac402dbf572dd4b1f870023361f8fc7d MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ColorCurves.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorCurves.cs similarity index 75% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ColorCurves.cs rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorCurves.cs index 372758bda9a..394ed2da9a3 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ColorCurves.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorCurves.cs @@ -1,13 +1,13 @@ using System; -namespace UnityEngine.Rendering.HighDefinition +namespace UnityEngine.Rendering { /// /// A volume component that holds settings for the Color Adjustments effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Color Curves", typeof(HDRenderPipeline))] - [HDRPHelpURLAttribute("Post-Processing-Color-Curves")] - public sealed class ColorCurves : VolumeComponent, IPostProcessComponent + [Serializable, VolumeComponentMenu("Post-processing/Color Curves")] + //[HDRPHelpURLAttribute("Post-Processing-Color-Curves")] + public class ColorCurves : VolumeComponent, IPostProcessComponent { // Note: we don't need tooltips as this component uses a custom editor with no use for tooltips @@ -64,5 +64,30 @@ public bool IsActive() { return true; } + + public bool IsTileCompatible() => true; + + public Type GetNewComponentType() + { + return typeof(ColorCurves); + } + + public void CopyToNewComponent(VolumeComponent volumeComponent) + { + if (volumeComponent is not ColorCurves curves) + return; + + curves.active = active; + curves.hideFlags = hideFlags; + curves.displayName = displayName; + curves.master = master; + curves.red = red; + curves.green = green; + curves.blue = blue; + curves.hueVsHue = hueVsHue; + curves.hueVsSat = hueVsSat; + curves.satVsSat = satVsSat; + curves.lumVsSat = lumVsSat; + } } } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorCurves.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorCurves.cs.meta new file mode 100644 index 00000000000..41642927401 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorCurves.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a2c42dd907cdd45a19bf92ecdcd90c35 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ColorAdjustments.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ColorAdjustments.cs new file mode 100644 index 00000000000..16f1976c132 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ColorAdjustments.cs @@ -0,0 +1,12 @@ +using System; + +namespace UnityEngine.Rendering.HighDefinition.Obsolete +{ + /// + /// A volume component that holds settings for the Color Adjustments effect. + /// + [Serializable] + [Obsolete] + public sealed class ColorAdjustments : Rendering.ColorAdjustments, IDeprecatedVolumeComponent + { } +} diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ColorAdjustments.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ColorAdjustments.cs.meta similarity index 100% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ColorAdjustments.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ColorAdjustments.cs.meta diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ColorCurves.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ColorCurves.cs new file mode 100644 index 00000000000..8902ca937ed --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ColorCurves.cs @@ -0,0 +1,13 @@ +using System; + +namespace UnityEngine.Rendering.HighDefinition.Obsolete +{ + /// + /// A volume component that holds settings for the Color Adjustments effect. + /// + [Serializable] + [Obsolete] + public sealed class ColorCurves : Rendering.ColorCurves, IDeprecatedVolumeComponent + { + } +} diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ColorCurves.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ColorCurves.cs.meta similarity index 100% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ColorCurves.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ColorCurves.cs.meta diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ColorAdjustments.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ColorAdjustments.cs new file mode 100644 index 00000000000..47556bdf6e2 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ColorAdjustments.cs @@ -0,0 +1,10 @@ +using System; + +namespace UnityEngine.Rendering.Universal.Obsolete +{ + [Serializable] + [Obsolete] + public sealed class ColorAdjustments : Rendering.ColorAdjustments, IDeprecatedVolumeComponent + { + } +} diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/ColorAdjustments.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ColorAdjustments.cs.meta similarity index 100% rename from com.unity.render-pipelines.universal/Runtime/Overrides/ColorAdjustments.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ColorAdjustments.cs.meta diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ColorCurves.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ColorCurves.cs new file mode 100644 index 00000000000..031213f86f8 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ColorCurves.cs @@ -0,0 +1,10 @@ +using System; + +namespace UnityEngine.Rendering.Universal.Obsolete +{ + [Serializable] + [Obsolete] + public sealed class ColorCurves : Rendering.ColorCurves, IDeprecatedVolumeComponent + { + } +} diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/ColorCurves.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ColorCurves.cs.meta similarity index 100% rename from com.unity.render-pipelines.universal/Runtime/Overrides/ColorCurves.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/ColorCurves.cs.meta diff --git a/com.unity.render-pipelines.universal/Editor/Overrides/ColorCurvesEditor.cs b/com.unity.render-pipelines.universal/Editor/Overrides/ColorCurvesEditor.cs deleted file mode 100644 index ae9b65a93cd..00000000000 --- a/com.unity.render-pipelines.universal/Editor/Overrides/ColorCurvesEditor.cs +++ /dev/null @@ -1,374 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.Rendering.Universal; - -namespace UnityEditor.Rendering.Universal -{ - using CurveState = InspectorCurveEditor.CurveState; - - [CustomEditor(typeof(ColorCurves))] - sealed class ColorCurvesEditor : VolumeComponentEditor - { - SerializedDataParameter m_Master; - SerializedDataParameter m_Red; - SerializedDataParameter m_Green; - SerializedDataParameter m_Blue; - - SerializedDataParameter m_HueVsHue; - SerializedDataParameter m_HueVsSat; - SerializedDataParameter m_SatVsSat; - SerializedDataParameter m_LumVsSat; - - // Internal references to the actual animation curves - // Needed for the curve editor - SerializedProperty m_RawMaster; - SerializedProperty m_RawRed; - SerializedProperty m_RawGreen; - SerializedProperty m_RawBlue; - - SerializedProperty m_RawHueVsHue; - SerializedProperty m_RawHueVsSat; - SerializedProperty m_RawSatVsSat; - SerializedProperty m_RawLumVsSat; - - InspectorCurveEditor m_CurveEditor; - Dictionary m_CurveDict; - static Material s_MaterialGrid; - - static GUIStyle s_PreLabel; - - static GUIContent[] s_Curves = - { - new GUIContent("Master"), - new GUIContent("Red"), - new GUIContent("Green"), - new GUIContent("Blue"), - new GUIContent("Hue Vs Hue"), - new GUIContent("Hue Vs Sat"), - new GUIContent("Sat Vs Sat"), - new GUIContent("Lum Vs Sat") - }; - - SavedInt m_SelectedCurve; - - public override void OnEnable() - { - var o = new PropertyFetcher(serializedObject); - - m_Master = Unpack(o.Find(x => x.master)); - m_Red = Unpack(o.Find(x => x.red)); - m_Green = Unpack(o.Find(x => x.green)); - m_Blue = Unpack(o.Find(x => x.blue)); - - m_HueVsHue = Unpack(o.Find(x => x.hueVsHue)); - m_HueVsSat = Unpack(o.Find(x => x.hueVsSat)); - m_SatVsSat = Unpack(o.Find(x => x.satVsSat)); - m_LumVsSat = Unpack(o.Find(x => x.lumVsSat)); - - m_RawMaster = o.Find("master.m_Value.m_Curve"); - m_RawRed = o.Find("red.m_Value.m_Curve"); - m_RawGreen = o.Find("green.m_Value.m_Curve"); - m_RawBlue = o.Find("blue.m_Value.m_Curve"); - - m_RawHueVsHue = o.Find("hueVsHue.m_Value.m_Curve"); - m_RawHueVsSat = o.Find("hueVsSat.m_Value.m_Curve"); - m_RawSatVsSat = o.Find("satVsSat.m_Value.m_Curve"); - m_RawLumVsSat = o.Find("lumVsSat.m_Value.m_Curve"); - - m_SelectedCurve = new SavedInt($"{target.GetType()}.SelectedCurve", 0); - - // Prepare the curve editor - m_CurveEditor = new InspectorCurveEditor(); - m_CurveDict = new Dictionary(); - - SetupCurve(m_RawMaster, new Color(1f, 1f, 1f), 2, false); - SetupCurve(m_RawRed, new Color(1f, 0f, 0f), 2, false); - SetupCurve(m_RawGreen, new Color(0f, 1f, 0f), 2, false); - SetupCurve(m_RawBlue, new Color(0f, 0.5f, 1f), 2, false); - SetupCurve(m_RawHueVsHue, new Color(1f, 1f, 1f), 0, true); - SetupCurve(m_RawHueVsSat, new Color(1f, 1f, 1f), 0, true); - SetupCurve(m_RawSatVsSat, new Color(1f, 1f, 1f), 0, false); - SetupCurve(m_RawLumVsSat, new Color(1f, 1f, 1f), 0, false); - } - - void SetupCurve(SerializedProperty prop, Color color, uint minPointCount, bool loop) - { - var state = CurveState.defaultState; - state.color = color; - state.visible = false; - state.minPointCount = minPointCount; - state.onlyShowHandlesOnSelection = true; - state.zeroKeyConstantValue = 0.5f; - state.loopInBounds = loop; - m_CurveEditor.Add(prop, state); - m_CurveDict.Add(prop, color); - } - - void ResetVisibleCurves() - { - foreach (var curve in m_CurveDict) - { - var state = m_CurveEditor.GetCurveState(curve.Key); - state.visible = false; - m_CurveEditor.SetCurveState(curve.Key, state); - } - } - - void SetCurveVisible(SerializedProperty rawProp, SerializedProperty overrideProp) - { - var state = m_CurveEditor.GetCurveState(rawProp); - state.visible = true; - state.editable = overrideProp.boolValue; - m_CurveEditor.SetCurveState(rawProp, state); - } - - void CurveOverrideToggle(SerializedProperty overrideProp) - { - overrideProp.boolValue = GUILayout.Toggle(overrideProp.boolValue, EditorGUIUtility.TrTextContent("Override"), EditorStyles.toolbarButton); - } - - int DoCurveSelectionPopup(int id) - { - GUILayout.Label(s_Curves[id], EditorStyles.toolbarPopup, GUILayout.MaxWidth(150f)); - - var lastRect = GUILayoutUtility.GetLastRect(); - var e = Event.current; - - if (e.type == EventType.MouseDown && e.button == 0 && lastRect.Contains(e.mousePosition)) - { - var menu = new GenericMenu(); - - for (int i = 0; i < s_Curves.Length; i++) - { - if (i == 4) - menu.AddSeparator(""); - - int current = i; // Capture local for closure - menu.AddItem(s_Curves[i], current == id, () => - { - m_SelectedCurve.value = current; - serializedObject.ApplyModifiedProperties(); - }); - } - - menu.DropDown(new Rect(lastRect.xMin, lastRect.yMax, 1f, 1f)); - } - - return id; - } - - void DrawBackgroundTexture(Rect rect, int pass) - { - if (s_MaterialGrid == null) - s_MaterialGrid = new Material(Shader.Find("Hidden/Universal Render Pipeline/Editor/CurveBackground")) { hideFlags = HideFlags.HideAndDontSave }; - - float scale = EditorGUIUtility.pixelsPerPoint; - - var oldRt = RenderTexture.active; - var rt = RenderTexture.GetTemporary(Mathf.CeilToInt(rect.width * scale), Mathf.CeilToInt(rect.height * scale), 0, RenderTextureFormat.ARGB32, RenderTextureReadWrite.sRGB); - s_MaterialGrid.SetFloat("_DisabledState", GUI.enabled ? 1f : 0.5f); - - Graphics.Blit(null, rt, s_MaterialGrid, pass); - RenderTexture.active = oldRt; - - GUI.DrawTexture(rect, rt); - RenderTexture.ReleaseTemporary(rt); - } - - void MarkTextureCurveAsDirty(int curveId) - { - var t = target as ColorCurves; - - if (t == null) - return; - - switch (curveId) - { - case 0: t.master.value.SetDirty(); break; - case 1: t.red.value.SetDirty(); break; - case 2: t.green.value.SetDirty(); break; - case 3: t.blue.value.SetDirty(); break; - case 4: t.hueVsHue.value.SetDirty(); break; - case 5: t.hueVsSat.value.SetDirty(); break; - case 6: t.satVsSat.value.SetDirty(); break; - case 7: t.lumVsSat.value.SetDirty(); break; - } - } - - public override void OnInspectorGUI() - { - EditorGUILayout.Space(); - ResetVisibleCurves(); - - using (new EditorGUI.DisabledGroupScope(serializedObject.isEditingMultipleObjects)) - { - int curveEditingId; - SerializedProperty currentCurveRawProp = null; - - // Top toolbar - using (new GUILayout.HorizontalScope(EditorStyles.toolbar)) - { - curveEditingId = DoCurveSelectionPopup(m_SelectedCurve.value); - curveEditingId = Mathf.Clamp(curveEditingId, 0, 7); - - EditorGUILayout.Space(); - - switch (curveEditingId) - { - case 0: - CurveOverrideToggle(m_Master.overrideState); - SetCurveVisible(m_RawMaster, m_Master.overrideState); - currentCurveRawProp = m_RawMaster; - break; - case 1: - CurveOverrideToggle(m_Red.overrideState); - SetCurveVisible(m_RawRed, m_Red.overrideState); - currentCurveRawProp = m_RawRed; - break; - case 2: - CurveOverrideToggle(m_Green.overrideState); - SetCurveVisible(m_RawGreen, m_Green.overrideState); - currentCurveRawProp = m_RawGreen; - break; - case 3: - CurveOverrideToggle(m_Blue.overrideState); - SetCurveVisible(m_RawBlue, m_Blue.overrideState); - currentCurveRawProp = m_RawBlue; - break; - case 4: - CurveOverrideToggle(m_HueVsHue.overrideState); - SetCurveVisible(m_RawHueVsHue, m_HueVsHue.overrideState); - currentCurveRawProp = m_RawHueVsHue; - break; - case 5: - CurveOverrideToggle(m_HueVsSat.overrideState); - SetCurveVisible(m_RawHueVsSat, m_HueVsSat.overrideState); - currentCurveRawProp = m_RawHueVsSat; - break; - case 6: - CurveOverrideToggle(m_SatVsSat.overrideState); - SetCurveVisible(m_RawSatVsSat, m_SatVsSat.overrideState); - currentCurveRawProp = m_RawSatVsSat; - break; - case 7: - CurveOverrideToggle(m_LumVsSat.overrideState); - SetCurveVisible(m_RawLumVsSat, m_LumVsSat.overrideState); - currentCurveRawProp = m_RawLumVsSat; - break; - } - - GUILayout.FlexibleSpace(); - - if (GUILayout.Button("Reset", EditorStyles.toolbarButton)) - { - MarkTextureCurveAsDirty(curveEditingId); - - switch (curveEditingId) - { - case 0: m_RawMaster.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f); break; - case 1: m_RawRed.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f); break; - case 2: m_RawGreen.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f); break; - case 3: m_RawBlue.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f); break; - case 4: m_RawHueVsHue.animationCurveValue = new AnimationCurve(); break; - case 5: m_RawHueVsSat.animationCurveValue = new AnimationCurve(); break; - case 6: m_RawSatVsSat.animationCurveValue = new AnimationCurve(); break; - case 7: m_RawLumVsSat.animationCurveValue = new AnimationCurve(); break; - } - } - - m_SelectedCurve.value = curveEditingId; - } - - // Curve area - var rect = GUILayoutUtility.GetAspectRect(2f); - var innerRect = new RectOffset(10, 10, 10, 10).Remove(rect); - - if (Event.current.type == EventType.Repaint) - { - // Background - EditorGUI.DrawRect(rect, new Color(0.15f, 0.15f, 0.15f, 1f)); - - if (curveEditingId == 4 || curveEditingId == 5) - DrawBackgroundTexture(innerRect, 0); - else if (curveEditingId == 6 || curveEditingId == 7) - DrawBackgroundTexture(innerRect, 1); - - // Bounds - Handles.color = Color.white * (GUI.enabled ? 1f : 0.5f); - Handles.DrawSolidRectangleWithOutline(innerRect, Color.clear, new Color(0.8f, 0.8f, 0.8f, 0.5f)); - - // Grid setup - Handles.color = new Color(1f, 1f, 1f, 0.05f); - int hLines = (int)Mathf.Sqrt(innerRect.width); - int vLines = (int)(hLines / (innerRect.width / innerRect.height)); - - // Vertical grid - int gridOffset = Mathf.FloorToInt(innerRect.width / hLines); - int gridPadding = ((int)(innerRect.width) % hLines) / 2; - - for (int i = 1; i < hLines; i++) - { - var offset = i * Vector2.right * gridOffset; - offset.x += gridPadding; - Handles.DrawLine(innerRect.position + offset, new Vector2(innerRect.x, innerRect.yMax - 1) + offset); - } - - // Horizontal grid - gridOffset = Mathf.FloorToInt(innerRect.height / vLines); - gridPadding = ((int)(innerRect.height) % vLines) / 2; - - for (int i = 1; i < vLines; i++) - { - var offset = i * Vector2.up * gridOffset; - offset.y += gridPadding; - Handles.DrawLine(innerRect.position + offset, new Vector2(innerRect.xMax - 1, innerRect.y) + offset); - } - } - - // Curve editor - using (new GUI.ClipScope(innerRect)) - { - if (m_CurveEditor.OnGUI(new Rect(0, 0, innerRect.width - 1, innerRect.height - 1))) - { - Repaint(); - GUI.changed = true; - MarkTextureCurveAsDirty(m_SelectedCurve.value); - } - } - - if (Event.current.type == EventType.Repaint) - { - // Borders - Handles.color = Color.black; - Handles.DrawLine(new Vector2(rect.x, rect.y - 20f), new Vector2(rect.xMax, rect.y - 20f)); - Handles.DrawLine(new Vector2(rect.x, rect.y - 21f), new Vector2(rect.x, rect.yMax)); - Handles.DrawLine(new Vector2(rect.x, rect.yMax), new Vector2(rect.xMax, rect.yMax)); - Handles.DrawLine(new Vector2(rect.xMax, rect.yMax), new Vector2(rect.xMax, rect.y - 20f)); - - bool editable = m_CurveEditor.GetCurveState(currentCurveRawProp).editable; - string editableString = editable ? string.Empty : "(Not Overriding)\n"; - - // Selection info - var selection = m_CurveEditor.GetSelection(); - var infoRect = innerRect; - infoRect.x += 5f; - infoRect.width = 100f; - infoRect.height = 30f; - - if (s_PreLabel == null) - s_PreLabel = new GUIStyle("ShurikenLabel"); - - if (selection.curve != null && selection.keyframeIndex > -1) - { - var key = selection.keyframe.Value; - GUI.Label(infoRect, $"{key.time:F3}\n{key.value:F3}", s_PreLabel); - } - else - { - GUI.Label(infoRect, editableString, s_PreLabel); - } - } - } - } - } -} diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/ColorAdjustments.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/ColorAdjustments.cs deleted file mode 100644 index 9b119df0473..00000000000 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/ColorAdjustments.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; - -namespace UnityEngine.Rendering.Universal -{ - /// - /// A volume component that holds settings for the Color Adjustments effect. - /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Color Adjustments", typeof(UniversalRenderPipeline))] - public sealed class ColorAdjustments : VolumeComponent, IPostProcessComponent - { - /// - /// Adjusts the overall exposure of the scene in EV100. - /// This is applied after HDR effect and right before tonemapping so it won't affect previous effects in the chain. - /// - [Tooltip("Adjusts the overall exposure of the scene in EV100. This is applied after HDR effect and right before tonemapping so it won't affect previous effects in the chain.")] - public FloatParameter postExposure = new FloatParameter(0f); - - /// - /// Controls the overall range of the tonal values. - /// - [Tooltip("Expands or shrinks the overall range of tonal values.")] - public ClampedFloatParameter contrast = new ClampedFloatParameter(0f, -100f, 100f); - - /// - /// Specifies the color that URP tints the render to. - /// - [Tooltip("Tint the render by multiplying a color.")] - public ColorParameter colorFilter = new ColorParameter(Color.white, true, false, true); - - /// - /// Controls the hue of all colors in the render. - /// - [Tooltip("Shift the hue of all colors.")] - public ClampedFloatParameter hueShift = new ClampedFloatParameter(0f, -180f, 180f); - - /// - /// Controls the intensity of all colors in the render. - /// - [Tooltip("Pushes the intensity of all colors.")] - public ClampedFloatParameter saturation = new ClampedFloatParameter(0f, -100f, 100f); - - /// - public bool IsActive() - { - return postExposure.value != 0f - || contrast.value != 0f - || colorFilter != Color.white - || hueShift != 0f - || saturation != 0f; - } - - /// - public bool IsTileCompatible() => true; - } -} diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/ColorCurves.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/ColorCurves.cs deleted file mode 100644 index 73d1f2211f9..00000000000 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/ColorCurves.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; - -namespace UnityEngine.Rendering.Universal -{ - /// - /// A volume component that holds settings for the Color Adjustments effect. - /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Color Curves", typeof(UniversalRenderPipeline))] - public sealed class ColorCurves : VolumeComponent, IPostProcessComponent - { - /// - /// Affects the luminance across the whole image. - /// - [Tooltip("Affects the luminance across the whole image.")] - public TextureCurveParameter master = new TextureCurveParameter(new TextureCurve(new[] { new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f) }, 0f, false, new Vector2(0f, 1f))); - - /// - /// Affects the red channel intensity across the whole image. - /// - [Tooltip("Affects the red channel intensity across the whole image.")] - public TextureCurveParameter red = new TextureCurveParameter(new TextureCurve(new[] { new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f) }, 0f, false, new Vector2(0f, 1f))); - - /// - /// Affects the green channel intensity across the whole image. - /// - [Tooltip("Affects the green channel intensity across the whole image.")] - public TextureCurveParameter green = new TextureCurveParameter(new TextureCurve(new[] { new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f) }, 0f, false, new Vector2(0f, 1f))); - - /// - /// Affects the blue channel intensity across the whole image. - /// - [Tooltip("Affects the blue channel intensity across the whole image.")] - public TextureCurveParameter blue = new TextureCurveParameter(new TextureCurve(new[] { new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f) }, 0f, false, new Vector2(0f, 1f))); - - /// - /// Shifts the input hue (x-axis) according to the output hue (y-axis). - /// - [Tooltip("Shifts the input hue (x-axis) according to the output hue (y-axis).")] - public TextureCurveParameter hueVsHue = new TextureCurveParameter(new TextureCurve(new Keyframe[] { }, 0.5f, true, new Vector2(0f, 1f))); - - /// - /// Adjusts saturation (y-axis) according to the input hue (x-axis). - /// - [Tooltip("Adjusts saturation (y-axis) according to the input hue (x-axis).")] - public TextureCurveParameter hueVsSat = new TextureCurveParameter(new TextureCurve(new Keyframe[] { }, 0.5f, true, new Vector2(0f, 1f))); - - /// - /// Adjusts saturation (y-axis) according to the input saturation (x-axis). - /// - [Tooltip("Adjusts saturation (y-axis) according to the input saturation (x-axis).")] - public TextureCurveParameter satVsSat = new TextureCurveParameter(new TextureCurve(new Keyframe[] { }, 0.5f, false, new Vector2(0f, 1f))); - - /// - /// Adjusts saturation (y-axis) according to the input luminance (x-axis). - /// - [Tooltip("Adjusts saturation (y-axis) according to the input luminance (x-axis).")] - public TextureCurveParameter lumVsSat = new TextureCurveParameter(new TextureCurve(new Keyframe[] { }, 0.5f, false, new Vector2(0f, 1f))); - - /// - public bool IsActive() => true; - - /// - public bool IsTileCompatible() => true; - } -} From 85f10cdebf989f1ab87b20b5642e72abb9f1a5bd Mon Sep 17 00:00:00 2001 From: tim Date: Mon, 29 Nov 2021 15:58:16 +0100 Subject: [PATCH 13/19] Tidy includes --- .../Editor/PostProcessing/LiftGammaGainEditor.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/com.unity.render-pipelines.core/Editor/PostProcessing/LiftGammaGainEditor.cs b/com.unity.render-pipelines.core/Editor/PostProcessing/LiftGammaGainEditor.cs index 1bb8935822b..c37ae94b712 100644 --- a/com.unity.render-pipelines.core/Editor/PostProcessing/LiftGammaGainEditor.cs +++ b/com.unity.render-pipelines.core/Editor/PostProcessing/LiftGammaGainEditor.cs @@ -1,4 +1,3 @@ -using UnityEditor.Rendering.Universal; using UnityEngine; using UnityEngine.Rendering; From cd20406d56b73447d8bd4cefdb0e78023c84e15b Mon Sep 17 00:00:00 2001 From: tim Date: Tue, 30 Nov 2021 11:24:41 +0100 Subject: [PATCH 14/19] Port Lens Distortion # Conflicts: # com.unity.render-pipelines.universal/Runtime/Overrides/LensDistortion.cs --- .../HDRPUpgradable/LensDistortion.cs | 13 +++++ .../HDRPUpgradable}/LensDistortion.cs.meta | 0 .../Components/LensDistortion.cs | 30 +++++++++-- .../Components/LensDistortion.cs.meta | 11 ++++ .../URPUpgradable/LensDistortion.cs | 9 ++++ .../URPUpgradable}/LensDistortion.cs.meta | 0 .../Runtime/Overrides/LensDistortion.cs | 51 ------------------- 7 files changed, 59 insertions(+), 55 deletions(-) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/LensDistortion.cs rename {com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable}/LensDistortion.cs.meta (100%) rename {com.unity.render-pipelines.high-definition => com.unity.render-pipelines.core}/Runtime/PostProcessing/Components/LensDistortion.cs (70%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LensDistortion.cs.meta create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/LensDistortion.cs rename {com.unity.render-pipelines.universal/Runtime/Overrides => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable}/LensDistortion.cs.meta (100%) delete mode 100644 com.unity.render-pipelines.universal/Runtime/Overrides/LensDistortion.cs diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/LensDistortion.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/LensDistortion.cs new file mode 100644 index 00000000000..619d098c8f3 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/LensDistortion.cs @@ -0,0 +1,13 @@ +using System; + +namespace UnityEngine.Rendering.HighDefinition.Obsolete +{ + /// + /// A volume component that holds settings for the Lens Distortion effect. + /// + [Serializable] + [Obsolete] + public sealed class LensDistortion : Rendering.LensDistortion, IDeprecatedVolumeComponent + { + } +} diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/LensDistortion.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/LensDistortion.cs.meta similarity index 100% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/LensDistortion.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/LensDistortion.cs.meta diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/LensDistortion.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LensDistortion.cs similarity index 70% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/LensDistortion.cs rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LensDistortion.cs index 429fe113f80..cca11c894c5 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/LensDistortion.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LensDistortion.cs @@ -1,13 +1,13 @@ using System; -namespace UnityEngine.Rendering.HighDefinition +namespace UnityEngine.Rendering { /// /// A volume component that holds settings for the Lens Distortion effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Lens Distortion", typeof(HDRenderPipeline))] - [HDRPHelpURLAttribute("Post-Processing-Lens-Distortion")] - public sealed class LensDistortion : VolumeComponent, IPostProcessComponent + [Serializable, VolumeComponentMenu("Post-processing/Lens Distortion")] + //[HDRPHelpURLAttribute("Post-Processing-Lens-Distortion")] + public class LensDistortion : VolumeComponent, IPostProcessComponent { /// /// Controls the overall strength of the distortion effect. @@ -48,5 +48,27 @@ public bool IsActive() return Mathf.Abs(intensity.value) > 0 && (xMultiplier.value > 0f || yMultiplier.value > 0f); } + + public bool IsTileCompatible() => false; + + public Type GetNewComponentType() + { + return typeof(LensDistortion); + } + + public void CopyToNewComponent(VolumeComponent volumeComponent) + { + if (volumeComponent is not LensDistortion lens) + return; + + lens.active = active; + lens.displayName = displayName; + lens.hideFlags = hideFlags; + lens.intensity = intensity; + lens.xMultiplier = xMultiplier; + lens.yMultiplier = yMultiplier; + lens.center = center; + lens.scale = scale; + } } } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LensDistortion.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LensDistortion.cs.meta new file mode 100644 index 00000000000..4827509413f --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LensDistortion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cf05c5679b85b4fed94a86e707e67faa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/LensDistortion.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/LensDistortion.cs new file mode 100644 index 00000000000..718fe78ef97 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/LensDistortion.cs @@ -0,0 +1,9 @@ +using System; + +namespace UnityEngine.Rendering.Universal.Obsolete +{ + [Serializable] + [Obsolete] + public sealed class LensDistortion : Rendering.LensDistortion, IDeprecatedVolumeComponent + { } +} diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/LensDistortion.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/LensDistortion.cs.meta similarity index 100% rename from com.unity.render-pipelines.universal/Runtime/Overrides/LensDistortion.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/LensDistortion.cs.meta diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/LensDistortion.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/LensDistortion.cs deleted file mode 100644 index cca0061cb95..00000000000 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/LensDistortion.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; - -namespace UnityEngine.Rendering.Universal -{ - /// - /// A volume component that holds settings for the Lens Distortion effect. - /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Lens Distortion", typeof(UniversalRenderPipeline))] - public sealed class LensDistortion : VolumeComponent, IPostProcessComponent - { - /// - /// Total distortion amount. - /// - [Tooltip("Total distortion amount.")] - public ClampedFloatParameter intensity = new ClampedFloatParameter(0f, -1f, 1f); - - /// - /// Intensity multiplier on X axis. Set it to 0 to disable distortion on this axis. - /// - [Tooltip("Intensity multiplier on X axis. Set it to 0 to disable distortion on this axis.")] - public ClampedFloatParameter xMultiplier = new ClampedFloatParameter(1f, 0f, 1f); - - /// - /// Intensity multiplier on Y axis. Set it to 0 to disable distortion on this axis. - /// - [Tooltip("Intensity multiplier on Y axis. Set it to 0 to disable distortion on this axis.")] - public ClampedFloatParameter yMultiplier = new ClampedFloatParameter(1f, 0f, 1f); - - /// - /// Distortion center point. 0.5,0.5 is center of the screen - /// - [Tooltip("Distortion center point. 0.5,0.5 is center of the screen")] - public Vector2Parameter center = new Vector2Parameter(new Vector2(0.5f, 0.5f)); - - /// - /// Controls global screen scaling for the distortion effect. Use this to hide screen borders when using high \"Intensity.\" - /// - [Tooltip("Controls global screen scaling for the distortion effect. Use this to hide screen borders when using high \"Intensity.\"")] - public ClampedFloatParameter scale = new ClampedFloatParameter(1f, 0.01f, 5f); - - /// - public bool IsActive() - { - return Mathf.Abs(intensity.value) > 0 - && (xMultiplier.value > 0f || yMultiplier.value > 0f); - } - - /// - public bool IsTileCompatible() => false; - } -} From 07ec61c06d1d315e3621e35941c912e669a4fbc0 Mon Sep 17 00:00:00 2001 From: tim Date: Tue, 30 Nov 2021 13:33:44 +0100 Subject: [PATCH 15/19] Unify split toning. # Conflicts: # com.unity.render-pipelines.universal/Runtime/Overrides/SplitToning.cs --- .../Components/HDRPUpgradable/SplitToning.cs | 14 ++++++++ .../HDRPUpgradable}/SplitToning.cs.meta | 0 .../PostProcessing/Components/SplitToning.cs | 28 ++++++++++++--- .../Components/SplitToning.cs.meta | 11 ++++++ .../Components/URPUpgradable/SplitToning.cs | 10 ++++++ .../URPUpgradable}/SplitToning.cs.meta | 0 .../Runtime/Overrides/SplitToning.cs | 35 ------------------- 7 files changed, 59 insertions(+), 39 deletions(-) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/SplitToning.cs rename {com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable}/SplitToning.cs.meta (100%) rename {com.unity.render-pipelines.high-definition => com.unity.render-pipelines.core}/Runtime/PostProcessing/Components/SplitToning.cs (62%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/SplitToning.cs.meta create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/SplitToning.cs rename {com.unity.render-pipelines.universal/Runtime/Overrides => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable}/SplitToning.cs.meta (100%) delete mode 100644 com.unity.render-pipelines.universal/Runtime/Overrides/SplitToning.cs diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/SplitToning.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/SplitToning.cs new file mode 100644 index 00000000000..b7fb784e73b --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/SplitToning.cs @@ -0,0 +1,14 @@ +using System; + +namespace UnityEngine.Rendering.HighDefinition.Obsolete +{ + /// + /// A volume component that holds settings for the Split Toning effect. + /// + [Serializable] + [Obsolete] + public sealed class SplitToning : Rendering.SplitToning + { + + } +} diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/SplitToning.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/SplitToning.cs.meta similarity index 100% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/SplitToning.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/SplitToning.cs.meta diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/SplitToning.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/SplitToning.cs similarity index 62% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/SplitToning.cs rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/SplitToning.cs index 63d370f280e..57b0dd7af36 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/SplitToning.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/SplitToning.cs @@ -1,13 +1,13 @@ using System; -namespace UnityEngine.Rendering.HighDefinition +namespace UnityEngine.Rendering { /// /// A volume component that holds settings for the Split Toning effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Split Toning", typeof(HDRenderPipeline))] - [HDRPHelpURLAttribute("Post-Processing-Split-Toning")] - public sealed class SplitToning : VolumeComponent, IPostProcessComponent + [Serializable, VolumeComponentMenu("Post-processing/Split Toning")] + //[HDRPHelpURLAttribute("Post-Processing-Split-Toning")] + public class SplitToning : VolumeComponent, IPostProcessComponent { /// /// Specifies the color to use for shadows. @@ -36,5 +36,25 @@ public bool IsActive() return shadows != Color.grey || highlights != Color.grey; } + + public bool IsTileCompatible() => true; + + public Type GetNewComponentType() + { + return typeof(SplitToning); + } + + public void CopyToNewComponent(VolumeComponent volumeComponent) + { + if (volumeComponent is not SplitToning lens) + return; + + lens.active = active; + lens.displayName = displayName; + lens.hideFlags = hideFlags; + lens.shadows = shadows; + lens.highlights = highlights; + lens.balance = balance; + } } } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/SplitToning.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/SplitToning.cs.meta new file mode 100644 index 00000000000..172f0ad72e6 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/SplitToning.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fafa23366cd4044d1b186540688e6fd3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/SplitToning.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/SplitToning.cs new file mode 100644 index 00000000000..69859b27919 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/SplitToning.cs @@ -0,0 +1,10 @@ +using System; + +namespace UnityEngine.Rendering.Universal.Obsolete +{ + [Serializable] + [Obsolete] + public sealed class SplitToning : Rendering.SplitToning, IDeprecatedVolumeComponent + { + } +} diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/SplitToning.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/SplitToning.cs.meta similarity index 100% rename from com.unity.render-pipelines.universal/Runtime/Overrides/SplitToning.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/SplitToning.cs.meta diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/SplitToning.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/SplitToning.cs deleted file mode 100644 index 4994896ce72..00000000000 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/SplitToning.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; - -namespace UnityEngine.Rendering.Universal -{ - /// - /// A volume component that holds settings for the Split Toning effect. - /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Split Toning", typeof(UniversalRenderPipeline))] - public sealed class SplitToning : VolumeComponent, IPostProcessComponent - { - /// - /// The color to use for shadows. - /// - [Tooltip("The color to use for shadows.")] - public ColorParameter shadows = new ColorParameter(Color.grey, false, false, true); - - /// - /// The color to use for highlights. - /// - [Tooltip("The color to use for highlights.")] - public ColorParameter highlights = new ColorParameter(Color.grey, false, false, true); - - /// - /// Balance between the colors in the highlights and shadows. - /// - [Tooltip("Balance between the colors in the highlights and shadows.")] - public ClampedFloatParameter balance = new ClampedFloatParameter(0f, -100f, 100f); - - /// - public bool IsActive() => shadows != Color.grey || highlights != Color.grey; - - /// - public bool IsTileCompatible() => true; - } -} From 54ff40454605dcfad55c43d18c7abf11558b3874 Mon Sep 17 00:00:00 2001 From: tim Date: Tue, 22 Feb 2022 12:54:05 +0100 Subject: [PATCH 16/19] Fix documentation links. --- .../Runtime/Documentation.cs | 40 +++++++++++++++++++ .../PostProcessing/Components/ChannelMixer.cs | 2 +- .../Components/ColorAdjustments.cs | 2 +- .../PostProcessing/Components/ColorCurves.cs | 2 +- .../PostProcessing/Components/FilmGrain.cs | 2 +- .../Components/HDRPUpgradable/FilmGrain.cs | 2 +- .../ShadowsMidtonesHighlights.cs | 2 +- .../Components/HDRPUpgradable/WhiteBalance.cs | 2 +- .../Components/LensDistortion.cs | 2 +- .../Components/LiftGammaGain.cs | 2 +- .../Components/PaniniProjection.cs | 2 +- .../Components/ShadowsMidtonesHighlights.cs | 2 +- .../PostProcessing/Components/SplitToning.cs | 2 +- .../PostProcessing/Components/WhiteBalance.cs | 2 +- 14 files changed, 53 insertions(+), 13 deletions(-) diff --git a/com.unity.render-pipelines.core/Runtime/Documentation.cs b/com.unity.render-pipelines.core/Runtime/Documentation.cs index e6ad4ecc7db..8cdc1906e83 100644 --- a/com.unity.render-pipelines.core/Runtime/Documentation.cs +++ b/com.unity.render-pipelines.core/Runtime/Documentation.cs @@ -122,4 +122,44 @@ public static bool TryGetHelpURL(Type type, out string url) return attribute != null; } } + + /// + /// Attribute to define the help url which will redirect to the active RP + /// + /// + /// [RPRedirectHelpURLAttribute("Volume")] + /// public class Volume : MonoBehaviour + /// + [Conditional("UNITY_EDITOR")] + public class RPRedirectHelpURLAttribute : CoreRPHelpURLAttribute + { + public RPRedirectHelpURLAttribute(string pageName) + : base(pageName, Documentation.packageName) + { + } + } + + internal class Documentation : DocumentationInfo + { + /// + /// The name of the package + /// + public static string packageName + { + get + { + if (GraphicsSettings.currentRenderPipeline.GetType().FullName == "UnityEngine.Rendering.HighDefinition.HDRenderPipelineAsset") + return "com.unity.render-pipelines.high-definition"; + + return "com.unity.render-pipelines.universal"; + } + } + + /// + /// Generates a help url for the given package and page name + /// + /// The page name + /// The full url page + public static string GetPageLink(string pageName) => GetPageLink(packageName, pageName); + } } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ChannelMixer.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ChannelMixer.cs index e6db1deadf9..2e99a5b9212 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ChannelMixer.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ChannelMixer.cs @@ -6,7 +6,7 @@ namespace UnityEngine.Rendering /// A volume component that holds settings for the Channel Mixer effect. /// [Serializable, VolumeComponentMenu("Post-processing/Channel Mixer")] - //[HDRPHelpURLAttribute("Post-Processing-Channel-Mixer")] + [RPRedirectHelpURLAttribute("Post-Processing-Channel-Mixer")] public class ChannelMixer : VolumeComponent, IPostProcessComponent { /// diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorAdjustments.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorAdjustments.cs index 44b56811b63..61580afcfd4 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorAdjustments.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorAdjustments.cs @@ -6,7 +6,7 @@ namespace UnityEngine.Rendering /// A volume component that holds settings for the Color Adjustments effect. /// [Serializable, VolumeComponentMenu("Post-processing/Color Adjustments")] - //[HDRPHelpURLAttribute("Post-Processing-Color-Adjustments")] + [RPRedirectHelpURLAttribute("Post-Processing-Color-Adjustments")] public class ColorAdjustments : VolumeComponent, IPostProcessComponent { /// diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorCurves.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorCurves.cs index 394ed2da9a3..3195fb2a6e2 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorCurves.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ColorCurves.cs @@ -6,7 +6,7 @@ namespace UnityEngine.Rendering /// A volume component that holds settings for the Color Adjustments effect. /// [Serializable, VolumeComponentMenu("Post-processing/Color Curves")] - //[HDRPHelpURLAttribute("Post-Processing-Color-Curves")] + [RPRedirectHelpURLAttribute("Post-Processing-Color-Curves")] public class ColorCurves : VolumeComponent, IPostProcessComponent { // Note: we don't need tooltips as this component uses a custom editor with no use for tooltips diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/FilmGrain.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/FilmGrain.cs index dfdb798dda8..997224421a1 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/FilmGrain.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/FilmGrain.cs @@ -69,7 +69,7 @@ public enum FilmGrainLookup /// A volume component that holds settings for the Film Grain effect. /// [Serializable, VolumeComponentMenu("Post-processing/Film Grain")] - //[HDRPHelpURLAttribute("Post-Processing-Film-Grain")] + [RPRedirectHelpURLAttribute("Post-Processing-Film-Grain")] public class FilmGrain : VolumeComponent, IPostProcessComponent { /// diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/FilmGrain.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/FilmGrain.cs index 32709ae055b..bb883317f3a 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/FilmGrain.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/FilmGrain.cs @@ -7,7 +7,7 @@ namespace UnityEngine.Rendering.HighDefinition.Obsolete /// [Serializable] [Obsolete] - //[HDRPHelpURLAttribute("Post-Processing-Film-Grain")] + [RPRedirectHelpURLAttribute("Post-Processing-Film-Grain")] public sealed class FilmGrain : UnityEngine.Rendering.FilmGrain, IDeprecatedVolumeComponent { } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ShadowsMidtonesHighlights.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ShadowsMidtonesHighlights.cs index 554d72a1637..6af350983ad 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ShadowsMidtonesHighlights.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ShadowsMidtonesHighlights.cs @@ -7,7 +7,7 @@ namespace UnityEngine.Rendering.HighDefinition.Obsolete /// [Serializable] [Obsolete] - //[HDRPHelpURLAttribute("Post-Processing-Shadows-Midtones-Highlights")] + [RPRedirectHelpURLAttribute("Post-Processing-Shadows-Midtones-Highlights")] public sealed class ShadowsMidtonesHighlights : UnityEngine.Rendering.ShadowsMidtonesHighlights, IDeprecatedVolumeComponent { } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/WhiteBalance.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/WhiteBalance.cs index 76f62815802..2b793892853 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/WhiteBalance.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/WhiteBalance.cs @@ -7,7 +7,7 @@ namespace UnityEngine.Rendering.HighDefinition.Obsolete /// [Serializable] [Obsolete] - //[HDRPHelpURLAttribute("Post-Processing-White-Balance")] + [RPRedirectHelpURLAttribute("Post-Processing-White-Balance")] public sealed class WhiteBalance : UnityEngine.Rendering.WhiteBalance, IDeprecatedVolumeComponent { } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LensDistortion.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LensDistortion.cs index cca11c894c5..241c174cabf 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LensDistortion.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LensDistortion.cs @@ -6,7 +6,7 @@ namespace UnityEngine.Rendering /// A volume component that holds settings for the Lens Distortion effect. /// [Serializable, VolumeComponentMenu("Post-processing/Lens Distortion")] - //[HDRPHelpURLAttribute("Post-Processing-Lens-Distortion")] + [RPRedirectHelpURLAttribute("Post-Processing-Lens-Distortion")] public class LensDistortion : VolumeComponent, IPostProcessComponent { /// diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LiftGammaGain.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LiftGammaGain.cs index 4394b3c4619..1683b37ecc2 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LiftGammaGain.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/LiftGammaGain.cs @@ -6,7 +6,7 @@ namespace UnityEngine.Rendering /// A volume component that holds settings for the Lift, Gamma, Gain effect. /// [Serializable, VolumeComponentMenu("Post-processing/Lift, Gamma, Gain")] - //[HDRPHelpURLAttribute("Post-Processing-Lift-Gamma-Gain")] + [RPRedirectHelpURLAttribute("Post-Processing-Lift-Gamma-Gain")] public class LiftGammaGain : VolumeComponent, IPostProcessComponent { /// diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/PaniniProjection.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/PaniniProjection.cs index ed44c42fe4b..81072b14693 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/PaniniProjection.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/PaniniProjection.cs @@ -6,7 +6,7 @@ namespace UnityEngine.Rendering /// A volume component that holds settings for the Panini Projection effect. /// [Serializable, VolumeComponentMenu("Post-processing/Panini Projection")] - //[HDRPHelpURLAttribute("Post-Processing-Panini-Projection")] + [RPRedirectHelpURLAttribute("Post-Processing-Panini-Projection")] public class PaniniProjection : VolumeComponent, IPostProcessComponent { /// diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs index 13e73561d5e..0068857ec8a 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/ShadowsMidtonesHighlights.cs @@ -6,7 +6,7 @@ namespace UnityEngine.Rendering /// A volume component that holds settings for the Shadows, Midtones, Highlights effect. /// [Serializable, VolumeComponentMenu("Post-processing/Shadows, Midtones, Highlights")] - //[HDRPHelpURLAttribute("Post-Processing-Shadows-Midtones-Highlights")] + [RPRedirectHelpURLAttribute("Post-Processing-Shadows-Midtones-Highlights")] public class ShadowsMidtonesHighlights : VolumeComponent, IPostProcessComponent { /// diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/SplitToning.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/SplitToning.cs index 57b0dd7af36..50c6d779f38 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/SplitToning.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/SplitToning.cs @@ -6,7 +6,7 @@ namespace UnityEngine.Rendering /// A volume component that holds settings for the Split Toning effect. /// [Serializable, VolumeComponentMenu("Post-processing/Split Toning")] - //[HDRPHelpURLAttribute("Post-Processing-Split-Toning")] + [RPRedirectHelpURLAttribute("Post-Processing-Split-Toning")] public class SplitToning : VolumeComponent, IPostProcessComponent { /// diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/WhiteBalance.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/WhiteBalance.cs index 328a02138bd..ae8268efc27 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/WhiteBalance.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/WhiteBalance.cs @@ -6,7 +6,7 @@ namespace UnityEngine.Rendering /// A volume component that holds settings for the White Balance effect. /// [Serializable, VolumeComponentMenu("Post-processing/White Balance")] - //[HDRPHelpURLAttribute("Post-Processing-White-Balance")] + [RPRedirectHelpURLAttribute("Post-Processing-White-Balance")] public class WhiteBalance : VolumeComponent, IPostProcessComponent { /// From 3668b8c0477fd777348b4cad9ff1c9e36d13a8b1 Mon Sep 17 00:00:00 2001 From: tim Date: Tue, 22 Feb 2022 13:32:03 +0100 Subject: [PATCH 17/19] Fix formatting. --- .../PostProcessing/Components/HDRPUpgradable/FilmGrain.cs | 1 - .../PostProcessing/Components/HDRPUpgradable/LiftGammaGain.cs | 1 - .../Components/HDRPUpgradable/ShadowsMidtonesHighlights.cs | 1 - .../PostProcessing/Components/HDRPUpgradable/WhiteBalance.cs | 1 - 4 files changed, 4 deletions(-) diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/FilmGrain.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/FilmGrain.cs index bb883317f3a..4858f532b2d 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/FilmGrain.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/FilmGrain.cs @@ -7,7 +7,6 @@ namespace UnityEngine.Rendering.HighDefinition.Obsolete /// [Serializable] [Obsolete] - [RPRedirectHelpURLAttribute("Post-Processing-Film-Grain")] public sealed class FilmGrain : UnityEngine.Rendering.FilmGrain, IDeprecatedVolumeComponent { } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/LiftGammaGain.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/LiftGammaGain.cs index 9088d4da44a..9574fe7e1f3 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/LiftGammaGain.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/LiftGammaGain.cs @@ -7,7 +7,6 @@ namespace UnityEngine.Rendering.HighDefinition.Obsolete /// [Serializable] [Obsolete] - // [HDRPHelpURLAttribute("Post-Processing-Lift-Gamma-Gain")] public sealed class LiftGammaGain : UnityEngine.Rendering.LiftGammaGain, IDeprecatedVolumeComponent { } } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ShadowsMidtonesHighlights.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ShadowsMidtonesHighlights.cs index 6af350983ad..4534062c143 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ShadowsMidtonesHighlights.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/ShadowsMidtonesHighlights.cs @@ -7,7 +7,6 @@ namespace UnityEngine.Rendering.HighDefinition.Obsolete /// [Serializable] [Obsolete] - [RPRedirectHelpURLAttribute("Post-Processing-Shadows-Midtones-Highlights")] public sealed class ShadowsMidtonesHighlights : UnityEngine.Rendering.ShadowsMidtonesHighlights, IDeprecatedVolumeComponent { } diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/WhiteBalance.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/WhiteBalance.cs index 2b793892853..42152d888ec 100644 --- a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/WhiteBalance.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/WhiteBalance.cs @@ -7,7 +7,6 @@ namespace UnityEngine.Rendering.HighDefinition.Obsolete /// [Serializable] [Obsolete] - [RPRedirectHelpURLAttribute("Post-Processing-White-Balance")] public sealed class WhiteBalance : UnityEngine.Rendering.WhiteBalance, IDeprecatedVolumeComponent { } From a410948569e36f8f3cd2968b6207cf21459166c2 Mon Sep 17 00:00:00 2001 From: tim Date: Tue, 30 Nov 2021 14:28:23 +0100 Subject: [PATCH 18/19] Port vignette with new editor type lookup. # Conflicts: # com.unity.render-pipelines.core/Editor/Volume/VolumeComponentEditor.cs # com.unity.render-pipelines.core/Editor/Volume/VolumeComponentListEditor.cs # com.unity.render-pipelines.high-definition/Runtime/Lighting/DiffusionProfileOverride.cs # com.unity.render-pipelines.universal/Runtime/Overrides/Bloom.cs # com.unity.render-pipelines.universal/Runtime/Overrides/ChromaticAberration.cs # com.unity.render-pipelines.universal/Runtime/Overrides/ColorLookup.cs # com.unity.render-pipelines.universal/Runtime/Overrides/DepthOfField.cs # com.unity.render-pipelines.universal/Runtime/Overrides/MotionBlur.cs # com.unity.render-pipelines.universal/Runtime/Overrides/Tonemapping.cs # com.unity.render-pipelines.universal/Runtime/Overrides/Vignette.cs --- .../Editor/PostProcessing/VignetteEditor.cs | 5 +- .../PostProcessing/VignetteEditor.cs.meta | 2 +- .../Editor/Volume/VolumeComponentProvider.cs | 2 +- .../Components/HDRPUpgradable/Vignette.cs | 14 ++++++ .../HDRPUpgradable}/Vignette.cs.meta | 0 .../Components/URPUpgradable/Vignette.cs | 10 ++++ .../URPUpgradable}/Vignette.cs.meta | 0 .../PostProcessing/Components/Vignette.cs | 34 ++++++++++++-- .../Components/Vignette.cs.meta | 11 +++++ .../Runtime/Volume/VolumeComponent.cs | 4 +- .../Lighting/AtmosphericScattering/Fog.cs | 2 +- .../Lighting/DiffusionProfileOverride.cs | 2 +- .../Runtime/Lighting/GlobalIllumination.cs | 2 +- .../Lighting/IndirectLightingController.cs | 2 +- .../ProbeVolume/ProbeVolumesOptions.cs | 2 +- .../ScreenSpaceLighting/AmbientOcclusion.cs | 2 +- .../ScreenSpaceReflection.cs | 2 +- .../ScreenSpaceRefraction.cs | 2 +- .../Runtime/Lighting/Shadow/ContactShadows.cs | 2 +- .../Lighting/Shadow/HDShadowSettings.cs | 2 +- .../Runtime/Lighting/Shadow/MicroShadowing.cs | 2 +- .../VolumetricLighting/VolumetricClouds.cs | 2 +- .../SubSurfaceScattering.cs | 2 +- .../PostProcessing/Components/Bloom.cs | 2 +- .../Components/ChromaticAberration.cs | 2 +- .../PostProcessing/Components/DepthOfField.cs | 2 +- .../PostProcessing/Components/Exposure.cs | 2 +- .../PostProcessing/Components/MotionBlur.cs | 2 +- .../PostProcessing/Components/Tonemapping.cs | 2 +- .../RenderPipeline/PathTracing/PathTracing.cs | 2 +- .../RenderPipeline/Raytracing/LightCluster.cs | 2 +- .../Raytracing/RayTracingSettings.cs | 2 +- .../Raytracing/RecursiveRendering.cs | 2 +- .../Sky/CloudSystem/CloudLayer/CloudLayer.cs | 2 +- .../Runtime/Sky/GradientSky/GradientSky.cs | 2 +- .../Runtime/Sky/HDRISky/HDRISky.cs | 2 +- .../PhysicallyBasedSky/PhysicallyBasedSky.cs | 2 +- .../Runtime/Sky/VisualEnvironment.cs | 2 +- .../Runtime/Water/WaterRendering.cs | 2 +- .../Editor/Overrides/VignetteEditor.cs | 22 +++++++++ .../Editor/Overrides/VignetteEditor.cs.meta | 11 +++++ .../Runtime/Overrides/Bloom.cs | 2 +- .../Runtime/Overrides/ChromaticAberration.cs | 2 +- .../Runtime/Overrides/ColorLookup.cs | 2 +- .../Runtime/Overrides/DepthOfField.cs | 2 +- .../Runtime/Overrides/MotionBlur.cs | 2 +- .../Runtime/Overrides/Tonemapping.cs | 2 +- .../Runtime/Overrides/Vignette.cs | 47 ------------------- 48 files changed, 139 insertions(+), 93 deletions(-) rename {com.unity.render-pipelines.high-definition => com.unity.render-pipelines.core}/Editor/PostProcessing/VignetteEditor.cs (96%) rename {com.unity.render-pipelines.high-definition => com.unity.render-pipelines.core}/Editor/PostProcessing/VignetteEditor.cs.meta (83%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/Vignette.cs rename {com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable}/Vignette.cs.meta (100%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/Vignette.cs rename {com.unity.render-pipelines.universal/Runtime/Overrides => com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable}/Vignette.cs.meta (100%) rename {com.unity.render-pipelines.high-definition => com.unity.render-pipelines.core}/Runtime/PostProcessing/Components/Vignette.cs (82%) create mode 100644 com.unity.render-pipelines.core/Runtime/PostProcessing/Components/Vignette.cs.meta create mode 100644 com.unity.render-pipelines.universal/Editor/Overrides/VignetteEditor.cs create mode 100644 com.unity.render-pipelines.universal/Editor/Overrides/VignetteEditor.cs.meta delete mode 100644 com.unity.render-pipelines.universal/Runtime/Overrides/Vignette.cs diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/VignetteEditor.cs b/com.unity.render-pipelines.core/Editor/PostProcessing/VignetteEditor.cs similarity index 96% rename from com.unity.render-pipelines.high-definition/Editor/PostProcessing/VignetteEditor.cs rename to com.unity.render-pipelines.core/Editor/PostProcessing/VignetteEditor.cs index 77bf9107740..9869ffe50ff 100644 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/VignetteEditor.cs +++ b/com.unity.render-pipelines.core/Editor/PostProcessing/VignetteEditor.cs @@ -1,8 +1,7 @@ -using UnityEditor.Rendering; using UnityEngine; -using UnityEngine.Rendering.HighDefinition; +using UnityEngine.Rendering; -namespace UnityEditor.Rendering.HighDefinition +namespace UnityEditor.Rendering { [CustomEditor(typeof(Vignette))] sealed class VignetteEditor : VolumeComponentEditor diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/VignetteEditor.cs.meta b/com.unity.render-pipelines.core/Editor/PostProcessing/VignetteEditor.cs.meta similarity index 83% rename from com.unity.render-pipelines.high-definition/Editor/PostProcessing/VignetteEditor.cs.meta rename to com.unity.render-pipelines.core/Editor/PostProcessing/VignetteEditor.cs.meta index e2393c61f83..ec5017d1677 100644 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/VignetteEditor.cs.meta +++ b/com.unity.render-pipelines.core/Editor/PostProcessing/VignetteEditor.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6cc820f325423224b8e3f8fea3bd1cb4 +guid: 4c6467b5fac7542da8374b37b5a13899 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentProvider.cs b/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentProvider.cs index e61718d786e..35b6823ce3b 100644 --- a/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentProvider.cs +++ b/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentProvider.cs @@ -50,7 +50,7 @@ public VolumeComponentProvider(VolumeProfile target, VolumeComponentListEditor t public void CreateComponentTree(List tree) { - var currentPipeline = RenderPipelineManager.currentPipeline; + var currentPipeline = GraphicsSettings.currentRenderPipeline; if (currentPipeline == null) { tree.Add(new GroupElement(0, "No SRP in use")); diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/Vignette.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/Vignette.cs new file mode 100644 index 00000000000..d932d0d1744 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/Vignette.cs @@ -0,0 +1,14 @@ +using System; + +namespace UnityEngine.Rendering.HighDefinition.Obsolete +{ + + /// + /// A volume component that holds settings for the Vignette effect. + /// + [Serializable] + [Obsolete] + public sealed class Vignette : Rendering.Vignette, IDeprecatedVolumeComponent + { + } +} diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Vignette.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/Vignette.cs.meta similarity index 100% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Vignette.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/HDRPUpgradable/Vignette.cs.meta diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/Vignette.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/Vignette.cs new file mode 100644 index 00000000000..adaff63622c --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/Vignette.cs @@ -0,0 +1,10 @@ +using System; + +namespace UnityEngine.Rendering.Universal.Obsolete +{ + [Serializable] + [Obsolete] + public sealed class Vignette : Rendering.Vignette, IDeprecatedVolumeComponent + { + } +} diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/Vignette.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/Vignette.cs.meta similarity index 100% rename from com.unity.render-pipelines.universal/Runtime/Overrides/Vignette.cs.meta rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/URPUpgradable/Vignette.cs.meta diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Vignette.cs b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/Vignette.cs similarity index 82% rename from com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Vignette.cs rename to com.unity.render-pipelines.core/Runtime/PostProcessing/Components/Vignette.cs index 4594a407f64..8a0f058790f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Vignette.cs +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/Vignette.cs @@ -1,6 +1,6 @@ using System; -namespace UnityEngine.Rendering.HighDefinition +namespace UnityEngine.Rendering { /// /// The mode HDRP uses to display the vignette effect. @@ -22,9 +22,9 @@ public enum VignetteMode /// /// A volume component that holds settings for the Vignette effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Vignette", typeof(HDRenderPipeline))] - [HDRPHelpURLAttribute("Post-Processing-Vignette")] - public sealed class Vignette : VolumeComponent, IPostProcessComponent + [Serializable, VolumeComponentMenu("Post-processing/Vignette")] + //[HDRPHelpURLAttribute("Post-Processing-Vignette")] + public class Vignette : VolumeComponent, IPostProcessComponent { /// /// Specifies the mode HDRP uses to display the vignette effect. @@ -90,6 +90,32 @@ public bool IsActive() return (mode.value == VignetteMode.Procedural && intensity.value > 0f) || (mode.value == VignetteMode.Masked && opacity.value > 0f && mask.value != null); } + + public bool IsTileCompatible() => true; + + public Type GetNewComponentType() + { + return typeof(Vignette); + } + + public void CopyToNewComponent(VolumeComponent volumeComponent) + { + if (volumeComponent is not Vignette vg) + return; + + vg.active = active; + vg.displayName = displayName; + vg.hideFlags = hideFlags; + vg.mode = mode; + vg.color = color; + vg.center = center; + vg.intensity = intensity; + vg.smoothness = smoothness; + vg.roundness = roundness; + vg.rounded = rounded; + vg.mask = mask; + vg.opacity = opacity; + } } /// diff --git a/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/Vignette.cs.meta b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/Vignette.cs.meta new file mode 100644 index 00000000000..c23d1294537 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/PostProcessing/Components/Vignette.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd38f3435b89f4783b10c8b1862958e1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs b/com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs index fa8aad49498..6e7e596254c 100644 --- a/com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs +++ b/com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs @@ -57,9 +57,9 @@ public VolumeComponentMenuForRenderPipeline(string menu, params Type[] pipelineT // Make sure that we only allow the class types that inherit from the render pipeline foreach (var t in pipelineTypes) { - if (!typeof(RenderPipeline).IsAssignableFrom(t)) + if (!typeof(RenderPipelineAsset).IsAssignableFrom(t)) throw new Exception( - $"You can only specify types that inherit from {typeof(RenderPipeline)}, please check {t}"); + $"You can only specify types that inherit from {typeof(RenderPipelineAsset)}, please check {t}"); } this.pipelineTypes = pipelineTypes; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/Fog.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/Fog.cs index c59623bf742..04c140c449e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/Fog.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/Fog.cs @@ -7,7 +7,7 @@ namespace UnityEngine.Rendering.HighDefinition /// /// Fog Volume Component. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Fog", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Fog", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Override-Fog")] public class Fog : VolumeComponentWithQuality { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/DiffusionProfileOverride.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/DiffusionProfileOverride.cs index c78d8bde978..d467443af94 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/DiffusionProfileOverride.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/DiffusionProfileOverride.cs @@ -5,7 +5,7 @@ namespace UnityEngine.Rendering.HighDefinition /// /// A volume component that holds Diffusion Profile Overrides. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Material/Diffusion Profile Override", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Material/Diffusion Profile Override", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Override-Diffusion-Profile")] public sealed class DiffusionProfileOverride : VolumeComponent { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/GlobalIllumination.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/GlobalIllumination.cs index f36c153e151..b098a0c808e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/GlobalIllumination.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/GlobalIllumination.cs @@ -6,7 +6,7 @@ namespace UnityEngine.Rendering.HighDefinition /// /// A volume component that holds settings for the global illumination (screen space and ray traced). /// - [Serializable, VolumeComponentMenuForRenderPipeline("Lighting/Screen Space Global Illumination", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Lighting/Screen Space Global Illumination", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Ray-Traced-Global-Illumination")] public sealed class GlobalIllumination : VolumeComponentWithQuality { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/IndirectLightingController.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/IndirectLightingController.cs index c1fd87a6a7c..0a052d6ab13 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/IndirectLightingController.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/IndirectLightingController.cs @@ -6,7 +6,7 @@ namespace UnityEngine.Rendering.HighDefinition /// /// Component that allow you to control the indirect specular and diffuse intensity /// - [Serializable, VolumeComponentMenuForRenderPipeline("Lighting/Indirect Lighting Controller", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Lighting/Indirect Lighting Controller", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Override-Indirect-Lighting-Controller")] public class IndirectLightingController : VolumeComponent { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ProbeVolume/ProbeVolumesOptions.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ProbeVolume/ProbeVolumesOptions.cs index 1aa34b2c065..982404705b8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ProbeVolume/ProbeVolumesOptions.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ProbeVolume/ProbeVolumesOptions.cs @@ -20,7 +20,7 @@ public APVLeakReductionModeParameter(APVLeakReductionMode value, bool overrideSt /// /// A volume component that holds settings for the Probe Volumes System per-camera options. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Lighting/Probe Volumes Options (Experimental)", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Lighting/Probe Volumes Options (Experimental)", typeof(HDRenderPipelineAsset))] public sealed class ProbeVolumesOptions : VolumeComponent { /// diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/AmbientOcclusion.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/AmbientOcclusion.cs index 11ba2546db6..426bcbf9a94 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/AmbientOcclusion.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/AmbientOcclusion.cs @@ -8,7 +8,7 @@ namespace UnityEngine.Rendering.HighDefinition /// /// A volume component that holds settings for the ambient occlusion. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Lighting/Ambient Occlusion", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Lighting/Ambient Occlusion", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Override-Ambient-Occlusion")] public sealed class AmbientOcclusion : VolumeComponentWithQuality { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceReflection.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceReflection.cs index b2251110c7b..872e79c484f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceReflection.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceReflection.cs @@ -33,7 +33,7 @@ public SSRAlgoParameter(ScreenSpaceReflectionAlgorithm value, bool overrideState /// /// A volume component that holds settings for screen space reflection and ray traced reflections. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Lighting/Screen Space Reflection", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Lighting/Screen Space Reflection", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Override-Screen-Space-Reflection")] public class ScreenSpaceReflection : VolumeComponentWithQuality { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceRefraction.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceRefraction.cs index f4ad411ef77..0da15b9651c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceRefraction.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceRefraction.cs @@ -5,7 +5,7 @@ namespace UnityEngine.Rendering.HighDefinition /// /// A volume component that holds settings for the Screen Space Refraction effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Lighting/Screen Space Refraction", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Lighting/Screen Space Refraction", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Override-Screen-Space-Refraction")] public class ScreenSpaceRefraction : VolumeComponent { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ContactShadows.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ContactShadows.cs index 8f4562cc0d7..2eb1cc1c62b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ContactShadows.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ContactShadows.cs @@ -6,7 +6,7 @@ namespace UnityEngine.Rendering.HighDefinition /// /// A volume component that holds settings for the Contact Shadows effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Shadowing/Contact Shadows", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Shadowing/Contact Shadows", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Override-Contact-Shadows")] public class ContactShadows : VolumeComponentWithQuality { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowSettings.cs index 6c21c338774..5e69affb05e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowSettings.cs @@ -5,7 +5,7 @@ namespace UnityEngine.Rendering.HighDefinition /// /// Settings for shadows. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Shadowing/Shadows", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Shadowing/Shadows", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Override-Shadows")] public class HDShadowSettings : VolumeComponent { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/MicroShadowing.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/MicroShadowing.cs index ccaf66fe861..2ebeb9bba1a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/MicroShadowing.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/MicroShadowing.cs @@ -5,7 +5,7 @@ namespace UnityEngine.Rendering.HighDefinition /// /// A volume component that holds settings for the Micro Shadows effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Shadowing/Micro Shadows", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Shadowing/Micro Shadows", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Override-Micro-Shadows")] public class MicroShadowing : VolumeComponent { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricClouds.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricClouds.cs index e09bd1f85ed..e420c7a5916 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricClouds.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricClouds.cs @@ -5,7 +5,7 @@ namespace UnityEngine.Rendering.HighDefinition /// /// A volume component that holds settings for the ambient occlusion. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Sky/Volumetric Clouds", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Sky/Volumetric Clouds", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Override-Volumetric-Clouds")] public sealed partial class VolumetricClouds : VolumeComponent { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubSurfaceScattering.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubSurfaceScattering.cs index dad9db99f6e..c70e16febb5 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubSurfaceScattering.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubSurfaceScattering.cs @@ -7,7 +7,7 @@ namespace UnityEngine.Rendering.HighDefinition /// This component setups subsurface scattering for ray-tracing. /// [HDRPHelpURLAttribute("Ray-Traced-Subsurface-Scattering")] - [Serializable, VolumeComponentMenuForRenderPipeline("Ray Tracing/SubSurface Scattering (Preview)", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Ray Tracing/SubSurface Scattering (Preview)", typeof(HDRenderPipelineAsset))] public sealed class SubSurfaceScattering : VolumeComponent { /// diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Bloom.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Bloom.cs index 1b48f719dee..7581c51b895 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Bloom.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Bloom.cs @@ -24,7 +24,7 @@ public enum BloomResolution : int /// /// A volume component that holds settings for the Bloom effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Bloom", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Bloom", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Post-Processing-Bloom")] public sealed class Bloom : VolumeComponentWithQuality, IPostProcessComponent { diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ChromaticAberration.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ChromaticAberration.cs index 8313e501a5a..6bd17767468 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ChromaticAberration.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ChromaticAberration.cs @@ -6,7 +6,7 @@ namespace UnityEngine.Rendering.HighDefinition /// /// A volume component that holds settings for the Chromatic Aberration effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Chromatic Aberration", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Chromatic Aberration", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Post-Processing-Chromatic-Aberration")] public sealed class ChromaticAberration : VolumeComponentWithQuality, IPostProcessComponent diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/DepthOfField.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/DepthOfField.cs index ec796d3286f..ac9c55b7636 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/DepthOfField.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/DepthOfField.cs @@ -68,7 +68,7 @@ public enum FocusDistanceMode /// /// A volume component that holds settings for the Depth Of Field effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Depth Of Field", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Depth Of Field", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Post-Processing-Depth-of-Field")] public sealed class DepthOfField : VolumeComponentWithQuality, IPostProcessComponent { diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Exposure.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Exposure.cs index 139d41686b9..4a2a55d41c1 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Exposure.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Exposure.cs @@ -5,7 +5,7 @@ namespace UnityEngine.Rendering.HighDefinition /// /// A volume component that holds settings for the Exposure effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Exposure", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Exposure", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Override-Exposure")] public sealed class Exposure : VolumeComponent, IPostProcessComponent { diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/MotionBlur.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/MotionBlur.cs index b08e6284d8c..5084a3c99ec 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/MotionBlur.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/MotionBlur.cs @@ -51,7 +51,7 @@ public CameraClampModeParameter(CameraClampMode value, bool overrideState = fals /// /// A volume component that holds settings for the Motion Blur effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Motion Blur", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Motion Blur", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Post-Processing-Motion-Blur")] public sealed class MotionBlur : VolumeComponentWithQuality, IPostProcessComponent { diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Tonemapping.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Tonemapping.cs index 2f7bf5ef176..0e77bdc0869 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Tonemapping.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Tonemapping.cs @@ -135,7 +135,7 @@ public FallbackHDRTonemapParameter(FallbackHDRTonemap value, bool overrideState /// /// A volume component that holds settings for the Tonemapping effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Tonemapping", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Tonemapping", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Post-Processing-Tonemapping")] public sealed class Tonemapping : VolumeComponent, IPostProcessComponent { diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/PathTracing.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/PathTracing.cs index 15eee02fd23..1fbdb25e39a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/PathTracing.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/PathTracing.cs @@ -78,7 +78,7 @@ public SkyImportanceSamplingParameter(SkyImportanceSamplingMode value, bool over /// /// A volume component that holds settings for the Path Tracing effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Ray Tracing/Path Tracing (Preview)", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Ray Tracing/Path Tracing (Preview)", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Ray-Tracing-Path-Tracing")] public sealed class PathTracing : VolumeComponent { diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/LightCluster.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/LightCluster.cs index 0fb7dc496f5..fef9510464f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/LightCluster.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/LightCluster.cs @@ -5,7 +5,7 @@ namespace UnityEngine.Rendering.HighDefinition /// /// A volume component that holds settings for the ray tracing light cluster. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Ray Tracing/Light Cluster (Preview)", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Ray Tracing/Light Cluster (Preview)", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Ray-Tracing-Light-Cluster")] public sealed class LightCluster : VolumeComponent { diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/RayTracingSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/RayTracingSettings.cs index c0e7bae3c2c..196a62e2e3c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/RayTracingSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/RayTracingSettings.cs @@ -59,7 +59,7 @@ public RTASCullingModeParameter(RTASCullingMode value, bool overrideState = fals /// A volume component that holds the general settings for ray traced effects. /// [HDRPHelpURLAttribute("Ray-Tracing-Settings")] - [Serializable, VolumeComponentMenuForRenderPipeline("Ray Tracing/Ray Tracing Settings (Preview)", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Ray Tracing/Ray Tracing Settings (Preview)", typeof(HDRenderPipelineAsset))] public sealed class RayTracingSettings : VolumeComponent { /// diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/RecursiveRendering.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/RecursiveRendering.cs index f03f62d98b2..0942936d6d0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/RecursiveRendering.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/RecursiveRendering.cs @@ -6,7 +6,7 @@ namespace UnityEngine.Rendering.HighDefinition /// Recursive Rendering Volume Component. /// This component setups recursive rendering. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Ray Tracing/Recursive Rendering (Preview)", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Ray Tracing/Recursive Rendering (Preview)", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Ray-Tracing-Recursive-Rendering")] public sealed class RecursiveRendering : VolumeComponent { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/CloudSystem/CloudLayer/CloudLayer.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/CloudSystem/CloudLayer/CloudLayer.cs index cbc3acf06ca..9b4a04b8f99 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/CloudSystem/CloudLayer/CloudLayer.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/CloudSystem/CloudLayer/CloudLayer.cs @@ -83,7 +83,7 @@ public CloudLayerEnumParameter(T value, bool overrideState = false) /// Cloud Layer Volume Component. /// This component setups the Cloud Layer for rendering. /// - [VolumeComponentMenuForRenderPipeline("Sky/Cloud Layer", typeof(HDRenderPipeline))] + [VolumeComponentMenuForRenderPipeline("Sky/Cloud Layer", typeof(HDRenderPipelineAsset))] [CloudUniqueID((int)CloudType.CloudLayer)] [HDRPHelpURLAttribute("Override-Cloud-Layer")] public partial class CloudLayer : CloudSettings diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/GradientSky/GradientSky.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/GradientSky/GradientSky.cs index 08194d36e22..05bc7360743 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/GradientSky/GradientSky.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/GradientSky/GradientSky.cs @@ -6,7 +6,7 @@ namespace UnityEngine.Rendering.HighDefinition /// Gradient Sky Volume Component. /// This component setups gradient sky for rendering. /// - [VolumeComponentMenuForRenderPipeline("Sky/Gradient Sky", typeof(HDRenderPipeline))] + [VolumeComponentMenuForRenderPipeline("Sky/Gradient Sky", typeof(HDRenderPipelineAsset))] [SkyUniqueID((int)SkyType.Gradient)] [HDRPHelpURLAttribute("Override-Gradient-Sky")] public class GradientSky : SkySettings diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISky.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISky.cs index 37ba44e6357..713676b2cf3 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISky.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISky.cs @@ -6,7 +6,7 @@ namespace UnityEngine.Rendering.HighDefinition /// HDRI Sky Volume Component. /// This component setups HDRI sky for rendering. /// - [VolumeComponentMenuForRenderPipeline("Sky/HDRI Sky", typeof(HDRenderPipeline))] + [VolumeComponentMenuForRenderPipeline("Sky/HDRI Sky", typeof(HDRenderPipelineAsset))] [SkyUniqueID((int)SkyType.HDRI)] [HDRPHelpURLAttribute("Override-HDRI-Sky")] public partial class HDRISky : SkySettings diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs index 616e13df028..8fa550d0543 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs @@ -34,7 +34,7 @@ public PhysicallyBasedSkyModelParameter(PhysicallyBasedSkyModel value, bool over /// /// Physically Based Sky Volume Component. /// - [VolumeComponentMenuForRenderPipeline("Sky/Physically Based Sky", typeof(HDRenderPipeline))] + [VolumeComponentMenuForRenderPipeline("Sky/Physically Based Sky", typeof(HDRenderPipelineAsset))] [SkyUniqueID((int)SkyType.PhysicallyBased)] [HDRPHelpURLAttribute("Override-Physically-Based-Sky")] public partial class PhysicallyBasedSky : SkySettings diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/VisualEnvironment.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/VisualEnvironment.cs index d34a9e2223c..d52f5b516b8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/VisualEnvironment.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/VisualEnvironment.cs @@ -7,7 +7,7 @@ namespace UnityEngine.Rendering.HighDefinition /// Visual Environment Volume Component. /// This component setups the sky used for rendering as well as the way ambient probe should be computed. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Visual Environment", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Visual Environment", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Override-Visual-Environment")] public sealed class VisualEnvironment : VolumeComponent { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Water/WaterRendering.cs b/com.unity.render-pipelines.high-definition/Runtime/Water/WaterRendering.cs index 1c5176b5615..a496e216dcd 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Water/WaterRendering.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Water/WaterRendering.cs @@ -5,7 +5,7 @@ namespace UnityEngine.Rendering.HighDefinition /// /// A volume component that holds settings for the water surface. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Lighting/WaterRendering", typeof(HDRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Lighting/WaterRendering", typeof(HDRenderPipelineAsset))] [HDRPHelpURLAttribute("Override-Water-Rendering")] public sealed partial class WaterRendering : VolumeComponent { diff --git a/com.unity.render-pipelines.universal/Editor/Overrides/VignetteEditor.cs b/com.unity.render-pipelines.universal/Editor/Overrides/VignetteEditor.cs new file mode 100644 index 00000000000..1710910fd8e --- /dev/null +++ b/com.unity.render-pipelines.universal/Editor/Overrides/VignetteEditor.cs @@ -0,0 +1,22 @@ +using UnityEngine.Rendering; +using UnityEngine.Rendering.Universal; + +namespace UnityEditor.Rendering.Universal +{ + [VolumeComponentEditor(typeof(Vignette))] + sealed class VignetteEditor : VolumeComponentEditor + { + SerializedDataParameter m_Intensity; + + public override void OnEnable() + { + var o = new PropertyFetcher(serializedObject); + m_Intensity = Unpack(o.Find(x => x.intensity)); + } + + public override void OnInspectorGUI() + { + PropertyField(m_Intensity); + } + } +} diff --git a/com.unity.render-pipelines.universal/Editor/Overrides/VignetteEditor.cs.meta b/com.unity.render-pipelines.universal/Editor/Overrides/VignetteEditor.cs.meta new file mode 100644 index 00000000000..4e5c9f14461 --- /dev/null +++ b/com.unity.render-pipelines.universal/Editor/Overrides/VignetteEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2ed8db9cd8165477f81d93160d5c2ebe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/Bloom.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/Bloom.cs index 0e32a135c3e..a67f30b7858 100644 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/Bloom.cs +++ b/com.unity.render-pipelines.universal/Runtime/Overrides/Bloom.cs @@ -14,7 +14,7 @@ public enum BloomDownscaleMode /// /// A volume component that holds settings for the Bloom effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Bloom", typeof(UniversalRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Bloom", typeof(UniversalRenderPipelineAsset))] public sealed partial class Bloom : VolumeComponent, IPostProcessComponent { /// diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/ChromaticAberration.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/ChromaticAberration.cs index dd84345262e..a799c1d967e 100644 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/ChromaticAberration.cs +++ b/com.unity.render-pipelines.universal/Runtime/Overrides/ChromaticAberration.cs @@ -5,7 +5,7 @@ namespace UnityEngine.Rendering.Universal /// /// A volume component that holds settings for the Chromatic Aberration effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Chromatic Aberration", typeof(UniversalRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Chromatic Aberration", typeof(UniversalRenderPipelineAsset))] public sealed class ChromaticAberration : VolumeComponent, IPostProcessComponent { /// diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/ColorLookup.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/ColorLookup.cs index b4b1ffcdaf5..70b1db9add8 100644 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/ColorLookup.cs +++ b/com.unity.render-pipelines.universal/Runtime/Overrides/ColorLookup.cs @@ -6,7 +6,7 @@ namespace UnityEngine.Rendering.Universal /// /// A volume component that holds settings for the color lookup effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Color Lookup", typeof(UniversalRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Color Lookup", typeof(UniversalRenderPipelineAsset))] public sealed class ColorLookup : VolumeComponent, IPostProcessComponent { /// diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/DepthOfField.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/DepthOfField.cs index a1cf4b8686b..161e9ff8a20 100644 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/DepthOfField.cs +++ b/com.unity.render-pipelines.universal/Runtime/Overrides/DepthOfField.cs @@ -26,7 +26,7 @@ public enum DepthOfFieldMode /// /// A volume component that holds settings for the Depth Of Field effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Depth Of Field", typeof(UniversalRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Depth Of Field", typeof(UniversalRenderPipelineAsset))] public sealed class DepthOfField : VolumeComponent, IPostProcessComponent { /// diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/MotionBlur.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/MotionBlur.cs index a3a670eed17..575a45a044a 100644 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/MotionBlur.cs +++ b/com.unity.render-pipelines.universal/Runtime/Overrides/MotionBlur.cs @@ -42,7 +42,7 @@ public enum MotionBlurQuality /// /// A volume component that holds settings for the motion blur effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Motion Blur", typeof(UniversalRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Motion Blur", typeof(UniversalRenderPipelineAsset))] public sealed class MotionBlur : VolumeComponent, IPostProcessComponent { /// diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/Tonemapping.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/Tonemapping.cs index 326ae79f87a..c4356bb6ca5 100644 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/Tonemapping.cs +++ b/com.unity.render-pipelines.universal/Runtime/Overrides/Tonemapping.cs @@ -29,7 +29,7 @@ public enum TonemappingMode /// /// A volume component that holds settings for the tonemapping effect. /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Tonemapping", typeof(UniversalRenderPipeline))] + [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Tonemapping", typeof(UniversalRenderPipelineAsset))] public sealed class Tonemapping : VolumeComponent, IPostProcessComponent { /// diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/Vignette.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/Vignette.cs deleted file mode 100644 index 47a5fb4895a..00000000000 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/Vignette.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; - -namespace UnityEngine.Rendering.Universal -{ - /// - /// A volume component that holds settings for the Vignette effect. - /// - [Serializable, VolumeComponentMenuForRenderPipeline("Post-processing/Vignette", typeof(UniversalRenderPipeline))] - public sealed class Vignette : VolumeComponent, IPostProcessComponent - { - /// - /// Specifies the color of the vignette. - /// - [Tooltip("Vignette color.")] - public ColorParameter color = new ColorParameter(Color.black, false, false, true); - - /// - /// Sets the center point for the vignette. - /// - [Tooltip("Sets the vignette center point (screen center is [0.5,0.5]).")] - public Vector2Parameter center = new Vector2Parameter(new Vector2(0.5f, 0.5f)); - - /// - /// Controls the strength of the vignette effect. - /// - [Tooltip("Amount of vignetting on screen.")] - public ClampedFloatParameter intensity = new ClampedFloatParameter(0f, 0f, 1f); - - /// - /// Controls the smoothness of the vignette borders. - /// - [Tooltip("Smoothness of the vignette borders.")] - public ClampedFloatParameter smoothness = new ClampedFloatParameter(0.2f, 0.01f, 1f); - - /// - /// Controls how round the vignette is, lower values result in a more square vignette. - /// - [Tooltip("Should the vignette be perfectly round or be dependent on the current aspect ratio?")] - public BoolParameter rounded = new BoolParameter(false); - - /// - public bool IsActive() => intensity.value > 0f; - - /// - public bool IsTileCompatible() => true; - } -} From e560bd90c3be406c9232d7f7dd26afce8fea7f85 Mon Sep 17 00:00:00 2001 From: Tim Cooper Date: Tue, 8 Mar 2022 10:40:36 +0100 Subject: [PATCH 19/19] Do not break user created volume components. --- .../Runtime/Volume/VolumeComponent.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs b/com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs index 6e7e596254c..224e898bf5e 100644 --- a/com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs +++ b/com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs @@ -57,9 +57,11 @@ public VolumeComponentMenuForRenderPipeline(string menu, params Type[] pipelineT // Make sure that we only allow the class types that inherit from the render pipeline foreach (var t in pipelineTypes) { - if (!typeof(RenderPipelineAsset).IsAssignableFrom(t)) - throw new Exception( - $"You can only specify types that inherit from {typeof(RenderPipelineAsset)}, please check {t}"); + if (!typeof(RenderPipelineAsset).IsAssignableFrom(t) && typeof(RenderPipeline).IsAssignableFrom(t)) + Debug.LogWarning($"You specify your volume component to support a {typeof(RenderPipeline)} instead of {typeof(RenderPipelineAsset)}, please check {t}"); + + if (!typeof(RenderPipelineAsset).IsAssignableFrom(t) && !typeof(RenderPipeline).IsAssignableFrom(t)) + throw new Exception($"You can only specify types that inherit from {typeof(RenderPipelineAsset)}, please check {t}"); } this.pipelineTypes = pipelineTypes;