diff --git a/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/OSXPlayer/Metal/None/004-CloudsFlaresDecals.png b/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/OSXPlayer/Metal/None/004-CloudsFlaresDecals.png index 953d582d5d9..11530564916 100644 --- a/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/OSXPlayer/Metal/None/004-CloudsFlaresDecals.png +++ b/TestProjects/HDRP_RuntimeTests/Assets/ReferenceImages/Linear/OSXPlayer/Metal/None/004-CloudsFlaresDecals.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:72b30e4dac5fb0e3a33a4bf655cf04dd40ceee895ca26725033c196e80dd53b8 -size 2289114 +oid sha256:3f3de8341770d5992b58275247735eabc4dea7f0c0c15d17c5643f0819941253 +size 304 diff --git a/com.unity.render-pipelines.core/CHANGELOG.md b/com.unity.render-pipelines.core/CHANGELOG.md index bf3c3877993..5d0623d28c2 100644 --- a/com.unity.render-pipelines.core/CHANGELOG.md +++ b/com.unity.render-pipelines.core/CHANGELOG.md @@ -6,8 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [13.1.6] - 2022-01-14 -Version Updated -The version number for this package has increased due to a version update of a related graphics package. +### Fixed +- Fixed undo in for `DebugUI.EnumFields` on the rendering debugger. (case 1386964) ## [13.1.5] - 2021-12-17 diff --git a/com.unity.render-pipelines.core/Documentation~/Images/view-lighting-tool-light-anchor0.png b/com.unity.render-pipelines.core/Documentation~/Images/view-lighting-tool-light-anchor0.png index be21b1e5a06..1335b5b0343 100644 --- a/com.unity.render-pipelines.core/Documentation~/Images/view-lighting-tool-light-anchor0.png +++ b/com.unity.render-pipelines.core/Documentation~/Images/view-lighting-tool-light-anchor0.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a23852b0c240cee4a72c6bb73783e0938a229f4bfc8f0742ac32f31203905840 -size 46503 +oid sha256:38028e8534c62c6c780bcfb6413d4f8f4851e54d3d920fb200a6fa93f6cf82d6 +size 158513 diff --git a/com.unity.render-pipelines.core/Documentation~/TableOfContents.md b/com.unity.render-pipelines.core/Documentation~/TableOfContents.md index ddfd5f11c5a..6eb3f533b2e 100644 --- a/com.unity.render-pipelines.core/Documentation~/TableOfContents.md +++ b/com.unity.render-pipelines.core/Documentation~/TableOfContents.md @@ -15,4 +15,4 @@ * [Synchronizing shader code and C#](generating-shader-includes.md) * [Look Dev](Look-Dev.md) * [Environment Library](Look-Dev-Environment-Library.md) -* [View Lighting Tool](view-lighting-tool.md) +* [Light Anchor](view-lighting-tool.md) diff --git a/com.unity.render-pipelines.core/Documentation~/View-Lighting-Tool.md b/com.unity.render-pipelines.core/Documentation~/View-Lighting-Tool.md index 243cac909b1..7bec6aab282 100644 --- a/com.unity.render-pipelines.core/Documentation~/View-Lighting-Tool.md +++ b/com.unity.render-pipelines.core/Documentation~/View-Lighting-Tool.md @@ -1,28 +1,17 @@ -## View Lighting tool +## Light Anchor -The View Lighting tool allows you to set up lighting in camera space. It uses the main Camera (the one that renders to the Game view) to set the orientation of the Light using spherical coordinates, and it uses a target and distance to set the position of the Light. +The Light Anchor can help to place light sources around subjects, in relation to a Camera and an anchor point. It's particularly effective for cinematic lighting, which often requires multiple light sources orbiting a subject. -Since the View Lighting tool uses camera-space, it is especially useful when setting up lighting for cinematics. +## Using the Light Anchor Component -To be able to use the view lighting tool, we need to have at least one camera tagged as "MainCamera" (only one will be used). +To use the Light Anchor, you must set the Tag of at least one Camera to "MainCamera". By default, the Anchor's position will be the same as the position of the GameObject the Light Anchor Component is attached to. -## Using the View Lighting tool +Use the **Orbit** and **Elevation** to control the orientation of the light, in degrees, relative to the main Camera's and Anchor's positions. If the Light has a Cookie or an IES Profile, use the **Roll** to change their orientation. Use the **Distance** to control how far from the anchor, in meters, you want to place the Light. -The View Lighting tool uses the Light Anchor component to position and orient the Light. When this component is attached to a Light, you can use a custom Scene view gizmo to position the Light, and use the component's Inspector to orient the Light. +Using the **Anchor Position Override**, you can provide a custom GameObject as an anchor point for the light. This is useful if you want the light to follow a specific GameObject in the Scene. -To get started with the View Lighting tool: - -1. In the Scene view or Hierarchy, select a GameObject with an attached Light component. -2. In the Inspector click **Add Component > Rendering > Light Anchor**. -3. To use the Light Anchor gizmo, click the custom tool button then, in the drop-down, click **Light Anchor**.
![](Images/view-lighting-tool-gizmo.png) -4. You can now use the gizmo to move the Light's target. This gizmo also shows you a visualization of the yaw, pitch, and roll from the target to the Light. To change the yaw, pitch, and roll, as well as the distance from the Light to the target, see [Light Anchor](#light-anchor). - -### Light Anchor - -The Light Anchor controls the Light's orientation and the distance it is from the target position. **Yaw** and **Pitch** control the orientation and **Distance** controls the distance between the Light and the target. If the Light has a cookie or uses [IES](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/IES-Profile.html), **Roll** controls the orientation of the cookie or IES profile. - -To quickly reset the angle of a knob to zero. Right-click on it. +You can set a **Position Offset** for this custom Anchor. This is useful if the Transform position of the custom Anchor isn't centered appropriately for the light to orbit correctly around the custom Anchor. ![](Images/view-lighting-tool-light-anchor0.png) -The Light Anchor component also includes a list of **Presets** that you can use to quickly set the Light's orientation relative to the Game view. +The Light Anchor component also includes a list of **Presets** that you can use to set the Light's orientation relative to the main Camera. diff --git a/com.unity.render-pipelines.core/Editor/Debugging/DebugState.cs b/com.unity.render-pipelines.core/Editor/Debugging/DebugState.cs index 06d417e61c4..3ad6d26f5f8 100644 --- a/com.unity.render-pipelines.core/Editor/Debugging/DebugState.cs +++ b/com.unity.render-pipelines.core/Editor/Debugging/DebugState.cs @@ -134,10 +134,52 @@ public DebugStateAttribute(params Type[] types) [Serializable, DebugState(typeof(DebugUI.BoolField), typeof(DebugUI.Foldout), typeof(DebugUI.HistoryBoolField))] public sealed class DebugStateBool : DebugState { } + /// + /// Enums Debug State. + /// + [Serializable, DebugState(typeof(DebugUI.EnumField), typeof(DebugUI.HistoryEnumField))] + public sealed class DebugStateEnum : DebugState, ISerializationCallbackReceiver + { + DebugUI.EnumField m_EnumField; + + /// + /// Set the value of the Debug Item. + /// + /// Input value. + /// Debug Item field. + public override void SetValue(object value, DebugUI.IValueField field) + { + m_EnumField = field as DebugUI.EnumField; + base.SetValue(value, field); + } + + void UpdateValue() + { + if (m_EnumField != null) + { + base.SetValue(value, m_EnumField); + // There might be cases that the value does not map the index, look for the correct index + var newCurrentIndex = Array.IndexOf(m_EnumField.enumValues, value); + if (m_EnumField.currentIndex != newCurrentIndex) + m_EnumField.currentIndex = newCurrentIndex; + } + } + + /// + /// On Before Serialize Callback + /// + public void OnBeforeSerialize() => UpdateValue(); + + /// + /// On After Deserialize Callback + /// + public void OnAfterDeserialize() => UpdateValue(); + } + /// /// Integer Debug State. /// - [Serializable, DebugState(typeof(DebugUI.IntField), typeof(DebugUI.EnumField), typeof(DebugUI.HistoryEnumField))] + [Serializable, DebugState(typeof(DebugUI.IntField))] public sealed class DebugStateInt : DebugState { } /// diff --git a/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.Builtins.cs b/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.Builtins.cs index 0a1905762fb..22fa7926da9 100644 --- a/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.Builtins.cs +++ b/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.Builtins.cs @@ -304,7 +304,7 @@ public sealed class DebugUIDrawerEnumField : DebugUIDrawer public override bool OnGUI(DebugUI.Widget widget, DebugState state) { var w = Cast(widget); - var s = Cast(state); + var s = Cast(state); if (w.indexes == null) w.InitIndexes(); diff --git a/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.cs b/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.cs index 42bd940dc3d..3ce8b5fa531 100644 --- a/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.cs +++ b/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.cs @@ -81,7 +81,7 @@ public virtual void End(DebugUI.Widget widget, DebugState state) /// Input value. protected void Apply(DebugUI.IValueField widget, DebugState state, object value) { - Undo.RegisterCompleteObjectUndo(state, "Debug Property Change"); + Undo.RegisterCompleteObjectUndo(state, $"Debug Property '{state.queryPath}' Change"); state.SetValue(value, widget); widget.SetValue(value); EditorUtility.SetDirty(state); diff --git a/com.unity.render-pipelines.core/Editor/Debugging/DebugWindow.cs b/com.unity.render-pipelines.core/Editor/Debugging/DebugWindow.cs index 1b1d27dc5f8..d1a0e6a97d5 100644 --- a/com.unity.render-pipelines.core/Editor/Debugging/DebugWindow.cs +++ b/com.unity.render-pipelines.core/Editor/Debugging/DebugWindow.cs @@ -422,7 +422,7 @@ void OnGUI() GUI.Toggle(elementRect, m_Settings.selectedPanel == i, panel.displayName, s_Styles.sectionElement); if (EditorGUI.EndChangeCheck()) { - Undo.RegisterCompleteObjectUndo(m_Settings, "Debug Panel Selection"); + Undo.RegisterCompleteObjectUndo(m_Settings, $"Debug Panel '{panel.displayName}' Selection"); var previousPanel = m_Settings.selectedPanel >= 0 && m_Settings.selectedPanel < panels.Count ? panels[m_Settings.selectedPanel] : null; diff --git a/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeBakingWindow.cs b/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeBakingWindow.cs index 5b40e5356ee..3ac6f10d422 100644 --- a/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeBakingWindow.cs +++ b/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeBakingWindow.cs @@ -131,8 +131,8 @@ void InitializeBakingSetList() m_RenameSelectedBakingSet = false; // Rename profile asset to match name: - set.profile.name = set.name; AssetDatabase.RenameAsset(AssetDatabase.GetAssetPath(set.profile), set.name); + set.profile.name = set.name; } } else @@ -163,6 +163,9 @@ void InitializeBakingSetList() AssetDatabase.DeleteAsset(pathToDelete); Undo.RegisterCompleteObjectUndo(sceneData.parentAsset, "Deleted baking set"); ReorderableList.defaultBehaviours.DoRemoveButton(list); + // A new set will be selected automatically, so we perform the same operations as if we did the selection explicitly. + OnBakingSetSelected(m_BakingSets); + } }; diff --git a/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentEditor.cs b/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentEditor.cs index 42c2bee8539..7beda9e0df3 100644 --- a/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentEditor.cs +++ b/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentEditor.cs @@ -186,6 +186,11 @@ protected void EndAdditionalPropertiesScope() /// protected Editor m_Inspector; + /// + /// Obtains the that is being edited from this volume component + /// + protected Volume volume => inspector?.target as Volume; + List<(GUIContent displayName, int displayOrder, SerializedDataParameter param)> m_Parameters; static Dictionary s_ParameterDrawers; diff --git a/com.unity.render-pipelines.core/Runtime/Volume/VolumeParameter.cs b/com.unity.render-pipelines.core/Runtime/Volume/VolumeParameter.cs index 5e9b4d26fdd..d0422522c5b 100644 --- a/com.unity.render-pipelines.core/Runtime/Volume/VolumeParameter.cs +++ b/com.unity.render-pipelines.core/Runtime/Volume/VolumeParameter.cs @@ -1447,6 +1447,23 @@ public TextureParameter(Texture value, bool overrideState = false) : base(value, overrideState) { } // TODO: Texture interpolation + + /// + /// Returns a hash code for the current object. + /// + /// A hash code for the current object. + public override int GetHashCode() + { + int hash = base.GetHashCode(); + + unchecked + { + if (value != null) + hash = 23 * CoreUtils.GetTextureHash(value); + } + + return hash; + } } /// @@ -1462,6 +1479,23 @@ public class NoInterpTextureParameter : VolumeParameter /// The initial override state for the parameter. public NoInterpTextureParameter(Texture value, bool overrideState = false) : base(value, overrideState) { } + + /// + /// Returns a hash code for the current object. + /// + /// A hash code for the current object. + public override int GetHashCode() + { + int hash = base.GetHashCode(); + + unchecked + { + if (value != null) + hash = 23 * CoreUtils.GetTextureHash(value); + } + + return hash; + } } /// @@ -1477,6 +1511,23 @@ public class Texture2DParameter : VolumeParameter /// The initial override state for the parameter. public Texture2DParameter(Texture value, bool overrideState = false) : base(value, overrideState) { } + + /// + /// Returns a hash code for the current object. + /// + /// A hash code for the current object. + public override int GetHashCode() + { + int hash = base.GetHashCode(); + + unchecked + { + if (value != null) + hash = 23 * CoreUtils.GetTextureHash(value); + } + + return hash; + } } /// @@ -1492,6 +1543,23 @@ public class Texture3DParameter : VolumeParameter /// The initial override state for the parameter. public Texture3DParameter(Texture value, bool overrideState = false) : base(value, overrideState) { } + + /// + /// Returns a hash code for the current object. + /// + /// A hash code for the current object. + public override int GetHashCode() + { + int hash = base.GetHashCode(); + + unchecked + { + if (value != null) + hash = 23 * CoreUtils.GetTextureHash(value); + } + + return hash; + } } /// @@ -1509,6 +1577,23 @@ public RenderTextureParameter(RenderTexture value, bool overrideState = false) : base(value, overrideState) { } // TODO: RenderTexture interpolation + + /// + /// Returns a hash code for the current object. + /// + /// A hash code for the current object. + public override int GetHashCode() + { + int hash = base.GetHashCode(); + + unchecked + { + if (value != null) + hash = 23 * CoreUtils.GetTextureHash(value); + } + + return hash; + } } /// @@ -1524,6 +1609,23 @@ public class NoInterpRenderTextureParameter : VolumeParameter /// The initial override state for the parameter. public NoInterpRenderTextureParameter(RenderTexture value, bool overrideState = false) : base(value, overrideState) { } + + /// + /// Returns a hash code for the current object. + /// + /// A hash code for the current object. + public override int GetHashCode() + { + int hash = base.GetHashCode(); + + unchecked + { + if (value != null) + hash = 23 * CoreUtils.GetTextureHash(value); + } + + return hash; + } } /// @@ -1540,6 +1642,23 @@ public class CubemapParameter : VolumeParameter public CubemapParameter(Texture value, bool overrideState = false) : base(value, overrideState) { } // TODO: Cubemap interpolation + + /// + /// Returns a hash code for the current object. + /// + /// A hash code for the current object. + public override int GetHashCode() + { + int hash = base.GetHashCode(); + + unchecked + { + if (value != null) + hash = 23 * CoreUtils.GetTextureHash(value); + } + + return hash; + } } /// @@ -1555,6 +1674,23 @@ public class NoInterpCubemapParameter : VolumeParameter /// The initial override state for the parameter. public NoInterpCubemapParameter(Cubemap value, bool overrideState = false) : base(value, overrideState) { } + + /// + /// Returns a hash code for the current object. + /// + /// A hash code for the current object. + public override int GetHashCode() + { + int hash = base.GetHashCode(); + + unchecked + { + if (value != null) + hash = 23 * CoreUtils.GetTextureHash(value); + } + + return hash; + } } /// diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index c63b9f730f5..bd604eea296 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -6,8 +6,32 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [13.1.6] - 2022-01-14 -Version Updated -The version number for this package has increased due to a version update of a related graphics package. +### Fixed +- Fixed sky jittering when TAA is enabled. +- Fixed issue with HDRI Sky and shadow filtering quality set to high. +- Fixed the default custom pass buffer format from R8G8B8A8_SNorm to R8G8B8A8_UNorm. Additionally, an option in the custom pass buffer format settings is available to use the old format. +- Fixed an issue where sometimes full screen debug would cause render graph errors. +- Fixed a nullref exception when creating a new scene while LightExplorer is open. +- Fixed issue that caused the uber post process to run even if nothing is to be done, leading to different results when disabling every post process manually vs disabling the whole post-processing pipeline. +- Fixed issue that placed an OnDemand shadow in the atlas before it was ever rendered. +- Fixed issue at edge of screen on some platforms when SSAO is on. +- Fixed warning when an APV baking set is renamed. +- Fixed the Exposure field name to Exposure Compensation name in sky volume overrides (case 1392530). +- Fixed issue where scene list was not refreshed upon deleting an APV baking set. +- Fixed Post Process not editable in the default frame settings. +- Fixed errors spamming when in player mode due to ray tracing light cluster debug view (case 1390471). +- Fixed missing unit in ray tracing related tooltips and docs (case 1397491). +- Fixed artifacts on gpu light culling when the frustum near and far are very spread out (case 1386436) +- Fixed an issue where forced sky update (like PBR sky amortized updated) would not update ambient probe. +- Fixed a null ref exception in Volume Explorer +- Fixed static lighting sky update when using an HDRI sky with a render texture in parameter. +- Fixed the volumetric clouds for the indoor template scenes by disabling them (normal and DXR) (case 1381761). +- Fixed using the wrong coordinate to compute the sampling direction for the screen space global illumination. +- Fixed error messages when trying to use HDSceneColor, NormalFromHeight, DDX, DDY or DDXY shader graph nodes in ray tracing. +- Fixed NullReferenceException when opening a Volume Component with a Diffusion Profile with any inspector. + +### Changed +- Disabled the "Reflect Sky" feature in the case of transparent screen space reflections for the water system. ## [13.1.5] - 2021-12-17 diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Compositor-Main.md b/com.unity.render-pipelines.high-definition/Documentation~/Compositor-Main.md index aa1eb89bc82..5a70968d2fa 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Compositor-Main.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Compositor-Main.md @@ -1,9 +1,10 @@ # Graphics Compositor The Graphics Compositor allows for real-time compositing operations between Unity's High Definition Render Pipeline (HDRP) and external media sources, such as videos or images. Depending on the requirements for your application, the Graphics Compositor provides multiple composition techniques. You can use each technique independently or use more than one at the same time to create a combination of different types of composition operations. The techniques that the Graphics Compositor includes are: -- **Camera Stacking:** Allows you to render multiple [HDRP Cameras](HDRP-Camera.md) to the same render target. -- **Graph-Based Composition:** Allows you to use arbitrary mathematical operations to combine multiple Composition Layers to generate the final frame. -- **3D Composition:** Allows you to use Composition Layers as 3D surfaces in a Unity Scene. This means that, for example, Unity can calculate reflections and refractions between different Composition Layers and GameObjects. + +* **Camera Stacking:** Allows you to render multiple [HDRP Cameras](HDRP-Camera.md) to the same render target. +* **Graph-Based Composition:** Allows you to use arbitrary mathematical operations to combine multiple Composition Layers to generate the final frame. +* **3D Composition:** Allows you to use Composition Layers as 3D surfaces in a Unity Scene. This means that, for example, Unity can calculate reflections and refractions between different Composition Layers and GameObjects. The following table provides a high level overview of the advantages and disadvantages of each compositing technique: @@ -13,20 +14,20 @@ The following table provides a high level overview of the advantages and disadva | **Graph-Based Composition** | Low | High | High| Low | | **3D Composition** | Low | High | Low | High | -[*] *Feature Coverage* indicates whether features such as [screen-space reflections](Override-Screen-Space-Reflection.md), transparencies or refractions can work between layers. +[*] Feature Coverage indicates whether features such as [screen-space reflections](Override-Screen-Space-Reflection.md), transparencies or refractions can work between layers. -Furthermore, the Graphics Compositor includes functionality such as *"localized post-processing"*, where a Post-Processing Volume only affects certain GameObjects in the Scene. +The Graphics Compositor also includes functionality such as localized post-processing, where a Post-Processing Volume only affects certain GameObjects in the Scene. -For a high level overview of the Graphics Compositor's functionality please refer to the [User Guide](Compositor-User-Guide.md) section. For a description on specific options in the user interface, please refer to the [User Options](Compositor-User-Options.md) section. +For an overview of the Graphics Compositor's functionality, see the [User Guide](Compositor-User-Guide.md). For a description on specific options in the user interface, see the [User Options](Compositor-User-Options.md). ## Composition example The following example uses the Graphics Compositor to render a watermark on top of a Unity Scene. -![](Images/Compositor-HDRPTemplateWithLogo.png) -*The result* +![](Images/Compositor-CompositorSimpleGraph.png) +The composition graph. -![](Images/Compositor-CompositorSimpleGraph.png) +![](Images/Compositor-HDRPTemplateWithLogo.png) -*The composition graph for the watermark example* +The result. diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Compositor-User-Guide.md b/com.unity.render-pipelines.high-definition/Documentation~/Compositor-User-Guide.md index 58f44cce93d..8de4bc7cf99 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Compositor-User-Guide.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Compositor-User-Guide.md @@ -1,31 +1,32 @@ # Using the Graphics Compositor -To open the Graphics Compositor window in the Unity Editor, select **Window > Rendering > Graphics Compositor** from the menu. From this window, you can enable the Graphics Compositor and control its configuration. The first time you enable the Graphics Compositor, it automatically uses a default *"pass-through"* composition profile that forwards the output of the main [Camera](HDRP-Camera.md) to the final composed frame. You can add more [Layers](#layer-types) to this profile and edit their properties or you can load another profile from disk. For information on the properties in the Compositor window, see [Compositor window](Compositor-User-Options.md). +To open the Graphics Compositor window in the Unity Editor, select **Window > Rendering > Graphics Compositor** from the menu. From this window, you can enable the Graphics Compositor and control its configuration. The first time you enable the Graphics Compositor, it automatically uses a default pass-through composition profile that forwards the output of the main [Camera](HDRP-Camera.md) to the final composed frame. You can add more [Layers](#layer-types) to this profile and edit their properties or you can load another profile from disk. For information on the properties in the Compositor window, see [Compositor window](Compositor-User-Options.md). ## General Workflow -- The composition output render in the Game view, while you can edit the scene in the Scene view. To have a live preview of the output, it is best practice to have the Scene view and Game view side-by-side, or undock the Game view from the Editor and put it on a separate monitor (if available). -- If the Game view is set to show **Display 1**, , make sure the Graphics Compositor outputs (in the Compositor window) to **Display 1**. Furthermore, you should set any Cameras in the scene to output to other displays, such as **Display 2** or **Display 3**. This ensures that no unnecessary drawing operations occur and that there are no conflicts in the display output. +* The composition output render in the Game view, while you can edit the scene in the Scene view. To have a live preview of the output, it's best practice to have the Scene view and Game view side-by-side, or undock the Game view from the Editor and put it on a separate monitor (if available). +* If you set the Game view to show **Display 1**, , make sure the Graphics Compositor outputs (in the Compositor window) to **Display 1**. Furthermore, you should set any Cameras in the scene to output to other displays, such as **Display 2** or **Display 3**. This ensures that no unnecessary drawing operations occur and that there are no conflicts in the display output. ## Alpha-based composition -Many compositing operations require an alpha channel. To properly use all features of the graphics compositor, it is recommended (but not necessary) to: -- Set the color buffer format for Rendering to 16-bit half float (R16G16B16A16) -- Set the buffer format for post-processing to 16-bit half float (R16G16B16A16) +Many compositing operations require an alpha channel. To use all features of the graphics compositor, it's recommended to: +* Set the color buffer format for Rendering to 16-bit half float (R16G16B16A16) +* Set the buffer format for post-processing to 16-bit half float (R16G16B16A16) Both buffer format options are in the [HDRP Asset](HDRP-Asset.md). If the compositor detects a buffer format without an alpha channel, it displays a warning. For more information, seen [Alpha Output](Alpha-Output.md). ## Layer Types The Graphics Compositor tool typically handles two types of layers: -- **Composition Layers**: The composition layers are the render targets (images) the compositor blends together to produce the final image. You can define them in the [Composition Graph](#composition-graph). The Composition Graph defines the number of layers and how to combine them but does not define each layer's content. -- **Sub-layers**: The sub-layers are responsible for generating the content of the composition layers. You can define them in the Graphics Compositor window, in the [Render Schedule](#render-schedule) section. You can stack multiple Sub-layers to define the content of a Composition Layer. In this case all Sub-layers share the same render target. +* **Composition Layers**: The composition layers are the render targets (images) the compositor blends together to produce the final image. You can define them in the [Composition Graph](#composition-graph). The Composition Graph defines the number of layers and how to combine them but doesn't define each layer's content. +* **Sub-layers**: The sub-layers are responsible for generating the content of the composition layers. You can define them in the Graphics Compositor window, in the [Render Schedule](#render-schedule) section. You can stack multiple Sub-layers to define the content of a Composition Layer. In this case all Sub-layers share the same render target. ## Composition Graph -To produce the output image, the Graphics Compositor uses a graph of compositing operations that combine a number of Composition Layers. Specifically, the Graphics Compositor uses the [Shader Graph](https://docs.unity3d.com/Packages/com.unity.shadergraph@latest/index.html) with an [Unlit Master Node](https://docs.unity3d.com/Packages/com.unity.shadergraph@latest/index.html?subfolder=/manual/Unlit-Master-Node.html) as its target. To specify the output image, the Compositor uses the value you connect to the **Color** port. You do not need to connect any other ports on the Master Node. +To produce the output image, the Graphics Compositor uses a graph of compositing operations that combine several Composition Layers. Specifically, the Graphics Compositor uses the [Shader Graph](https://docs.unity3d.com/Packages/com.unity.shadergraph@latest/index.html) with an [Unlit Master Node](https://docs.unity3d.com/Packages/com.unity.shadergraph@latest/index.html?subfolder=/manual/Unlit-Master-Node.html) as its target. To specify the output image, the Compositor uses the value you connect to the **Color** port. You don't need to connect any other ports on the Master Node. **Note**: When the output of the composition is to a render target, the Material you create from the Master Node must be double-sided. When you create a Composition Graph, there are two main types of input property you can expose: -- **Composition Layer**: Any **Texture2D** properties act as Composition Layers which correspond to a layer the graph composites to generate the final frame. These properties appear automatically as Composition Layers in the [Render Schedule](#render-schedule) section of the Graphics Compositor window. The **Mode** option for them in Shader Graph corresponds to the default value the Shader uses when you toggle off the visibility of the layer in the Render Schedule list.
**Note**: By default, this value is set to white, but for many compositing operations and behaviors, you may want to set this to black instead. -- **Composition Parameters**: This refers to any exposed property that is not a Texture2D. Composition Parameters can control various aspects of the composition. Examples of Composition Parameters include a Float input to control the overall brightness or a Color input to tint a Texture2D. These properties appear automatically in the [Composition Parameters](#composition-parameters) section of the Graphics Compositor window. + +* **Composition Layer**: Any **Texture2D** properties act as Composition Layers which correspond to a layer the graph composites to generate the final frame. These properties appear automatically as Composition Layers in the [Render Schedule](#render-schedule) section of the Graphics Compositor window. The **Mode** option for them in Shader Graph corresponds to the default value the Shader uses when you toggle off the visibility of the layer in the Render Schedule list.
**Note**: By default, this value is set to white, but for many compositing operations and behaviors, you may want to set this to black instead. +* **Composition Parameters**: This refers to any exposed property that'sn't a Texture2D. Composition Parameters can control various aspects of the composition. Examples of Composition Parameters include a Float input to control the overall brightness or a Color input to tint a Texture2D. These properties appear automatically in the [Composition Parameters](#composition-parameters) section of the Graphics Compositor window. The following graph contains examples of the property types described above. The **Logo** property is an example of a Composition Layer and the **Opacity** property is an example of an input property to control an aspect of the composition: @@ -41,9 +42,9 @@ Similarly, to delete a Composition Layer, remove the corresponding Texture 2D pr ## Adding content to Composition Layers Each Composition Layer can source its content from one or more Sub-layers. There are three types of Sub-layer: -- **Camera Sub-layer:** The source of the content is a Unity Camera. You can select which Camera to use in the properties of the Sub-layer. -- **Video Sub-layer:** The source of the content is a Unity Video Player. You can select which Video Player to use in the properties of the Sub-layer. -- **Image Sub-layer:** The source of the content is a static image. You can select which image to use in the properties of the Sub-layer. +* **Camera Sub-layer:** The source of the content is a Unity Camera. You can select which Camera to use in the properties of the Sub-layer. +* **Video Sub-layer:** The source of the content is a Unity Video Player. You can select which Video Player to use in the properties of the Sub-layer. +* **Image Sub-layer:** The source of the content is a static image. You can select which image to use in the properties of the Sub-layer. To add a Sub-layer to a Composition Layer, select the Composition Layer and click the **Add** drop-down button. From the drop-down, you can select the type of Sub-layer. @@ -51,23 +52,23 @@ To remove a Sub-layer, select the Sub-layer and click the **Delete** button.
## Object ID Custom Pass @@ -475,6 +477,7 @@ To change the buffer format of the Custom Pass component in your HDRP asset, go | **Format** | **Bits Per Pixel** | **Description** | | ------------ | ------------------ | ------------------------------------------------------------ | | R8G8B8A8 | 32 | This format is the most resource efficient, but it might cause banding issues. HDRP uses this format by default. | +| Signed R8G8B8A8 | 32 | This format is similar to R8G8B8A8 but you can store unsigned data. | | R11G11B10 | 32 | This format has a higher precision than R8G8B8A8 but does not support alpha channels. | | R16G16B16A16 | 64 | This format has the highest precision but uses twice as much memory as R8G8B8A8 and R11G11B10. | diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass-Scripting.md b/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass-Scripting.md index b9f4c262c99..ad08464f874 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass-Scripting.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass-Scripting.md @@ -6,9 +6,9 @@ When you create your own C# Custom Pass using the instructions in [The Custom Pa -## **The Custom Pass C# template** +## The Custom Pass C# template -To create a new Custom pass, go to **Assets > Create > Rendering > HDRP C# Custom Pass**. This creates a new script that contains the Custom Pass C# template: +To create a new Custom pass, go to **Assets** > **Create** > **Rendering** > **HDRP C# Custom Pass**. This creates a new script that contains the Custom Pass C# template: ```C# class #SCRIPTNAME# : CustomPass @@ -31,9 +31,9 @@ The C# Custom Pass template includes the following entry points to code your cus The `Setup` and `Execute` methods give you access to a `ScriptableRenderContext` and a `CommandBuffer`. For information on using `CommandBuffers` with a `ScriptableRenderContext`, see [Scheduling and executing commands in the Scriptable Render Pipeline](https://docs.unity3d.com/Manual/srp-using-scriptable-render-context.html). -## **Creating a full-screen Custom Pass in C#** +## Creating a full-screen Custom Pass in C# -The following code demonstrates how to create a full-screen Custom Pass that applies an outline effect to an object in your scene. +This section demonstrates how to create a full-screen Custom Pass that applies an outline effect to an object in your scene. ![A mesh in a scene rendered using this outline effect](images/CustomPass_FrameDebugger.png) @@ -42,7 +42,7 @@ This effect uses a transparent full screen pass with a blend mode that replaces This shader code performs the following steps: 1. Renders the objects in the outline layer to a buffer called `outlineBuffer`. -2. Samples the color in `outlineBuffer`. If the color is below the threshold, then it means that the pixel might be in an outline. +2. Samples the color in `outlineBuffer`. If the color is below the threshold, it means that the pixel might be in an outline. 3. Searches neighboring pixels to check if this is the case. 4. If Unity finds a pixel above the threshold, it applies the outline effect. @@ -52,13 +52,13 @@ This shader code performs the following steps: This section provides an example of a Custom Pass C# script that applies an outline effect to every GameObject in a Layer. -The following pass renders all the GameObjects in the `Outline Layer` into a custom buffer named `outlineBuffer` in the code. It then performs an edge detection algorithm over the screen that checks for all the GameObjects rendered in the `outlineBuffer`. This edge detection algorithm creates an outline around objects rendered in the `outlineBuffer`. Finally, `CoreUtils.DrawFullScreen` applies the full screen effect. +The following pass renders all the GameObjects in the `Outline Layer` into a custom buffer named `outlineBuffer` in the code. It performs an edge detection algorithm over the screen that checks for all the GameObjects rendered in the `outlineBuffer`. This edge detection algorithm creates an outline around objects rendered in the `outlineBuffer`. `CoreUtils.DrawFullScreen` applies the full screen effect. This example only supports a single outline color for all the objects in a Layer. To use this example Custom Pass script: -1. Create a new C# script (menu: **Assets > Create > C# Script)**. +1. Create a new C# script (menu: **Assets** > **Create** > **C# Script)**. 2. Name your script. In this example, the new script is called “Outline”. 3. Enter the following code: @@ -126,7 +126,7 @@ class Outline : CustomPass To create a new shader: -1. Create a new Unity shader using **Assets> Create> Shader > HDRP Custom FullScreen Pass** +1. Create a new Unity shader using **Assets** > **Create** > **Shader** > **HDRP Custom FullScreen Pass** 2. Name the new shader source file “Outline” 3. Enter the following code: @@ -374,7 +374,7 @@ public class OutlineDrawer : CustomPassDrawer When you create a Custom Pass drawer, Unity provides a default list of Custom Pass properties. Unity still does this when `DoPassGUI` is empty. These properties are the same properties that Unity provides in the [draw renderers CustomPass Volume](Custom-Pass-Creating.md#Draw-Renderers-Custom-Pass) component by default. -If you don't need all of these settings, you can override the `commonPassUIFlags` property to remove some of them. The following example only keeps the name and the target buffer enum: +If you don't need all these settings, you can override the `commonPassUIFlags` property to remove some of them. The following example only keeps the name and the target buffer enum: ```c# protected override PassUIFlag commonPassUIFlags => PassUIFlag.Name | PassUIFlag.TargetColorBuffer; diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass-Troubleshooting.md b/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass-Troubleshooting.md index 6c7802f067e..34e3043d8a2 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass-Troubleshooting.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass-Troubleshooting.md @@ -6,10 +6,10 @@ This section provides examples of common issues you might encounter when using a ![](images/Custom_Pass_Troubleshooting_01.png) -A scaling issue can appear in your built scene when you have two cameras that do not use the same resolution. This is most common between in-game and scene views. This can happen when: +A scaling issue can appear in your built scene when you have two cameras that don't use the same resolution. This is most common between Game and Scene views. This can happen when: - Your code calls [CommandBuffer.SetRenderTarget](https://docs.unity3d.com/ScriptReference/Rendering.CommandBuffer.SetRenderTarget.html), and `CoreUtilsSetRenderTarget` sets the viewport. -- You have not multiplied by `_RTHandleScale.xy` in your shader code for UVs when sampling an `RTHandle` buffer. +- You haven't multiplied by `_RTHandleScale.xy` in your shader code for UVs when sampling an `RTHandle` buffer. To fix the causes in these cases: @@ -34,7 +34,7 @@ To fix this: ## Jittering GameObjects -In some cases when [Temporal anti-aliasing (TAA)](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@10.1/manual/Anti-Aliasing.html?q=anti#TAA) is enabled, some GameObjects appear to jitter. +Sometimes when you enable [Temporal antialiasing (TAA)](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@10.1/manual/Anti-Aliasing.html?q=anti#TAA), some GameObjects appear to jitter. ![](images/Custom_Pass_Troubleshooting_02.gif) @@ -50,13 +50,13 @@ The following conditions can cause particles in the scene to face the wrong dire - The particle system is only visible in a Custom Pass. - There is no override implemented for`AggregateCullingParameters`. -Unity calculates the orientation of the particles in the Built-in Particle System when it executes `AggregateCullingParameters` during the culling step. Therefore, if there is no override, HRDP does not render it properly. +Unity calculates the orientation of the particles in the Built-in Particle System when it executes `AggregateCullingParameters` during the culling step. This means if there is no override, HRDP doesn't render it properly. -## Decals are not visible +## Decals aren't visible The following conditions can make a decal in your scene invisible: -- The decal is applied to a GameObject that Unity renders in a Custom Pass +- You applied the decal to a GameObject that Unity renders in a Custom Pass - The decal is on a transparent object that Unity renders before the **AfterOpaqueDepthAndNormal** [Injection point](Custom-Pass-Injection-Points.md) To fix this issue, change the Injection point of the GameObject to any Injection Point after **AfterOpaqueDepthAndNormal** @@ -77,11 +77,11 @@ You can then add more layers or custom culling options to the `cullingResult` yo ## Screen turns black when Unity loads shaders -If your screen turns black when Unity loads shaders, this could be because Unity is trying to render a shader that is not referenced in the scene. This can happen when: +If your screen turns black when Unity loads shaders, this could be because Unity is trying to render a shader that's not referenced in the scene. This can happen when: - The Custom Pass only uses `Shader.Find` to look for your shader. -- Your shader is not in your project’s Resources folder. -- Your shader is not referenced in the Custom Pass. +- Your shader isn't in your project’s Resources folder. +- Your shader isn't referenced in the Custom Pass. To fix this, you can add the following lines of code to reference your shader in the Custom Pass: diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass-Volume-Workflow.md b/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass-Volume-Workflow.md index 0eb38af32f7..76c02750e5f 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass-Volume-Workflow.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Custom-Pass-Volume-Workflow.md @@ -6,22 +6,27 @@ The workflow for Custom Pass Volumes is similar to the HDRP [Volumes](https://do - Unity stores Custom Pass data on a GameObject rather than an asset in your project. - If you have more than one Custom Pass Volume in your scene with the same injection point, Unity executes the Volume in order of [Priority](Custom-Pass-Creating.md#Custom-Pass-Volume). -To create a Custom Pass Volume that affects every camera in the scene, set the Custom Pass Volume component’s **Mode** to **Global**. To create a Custom Pass Volume that only affects cameras within the boundaries of the Volume, set the Custom Pass Volume component’s **Mode** to **Local**. +You can choose whether a Custom Pass Volume affects every camera in the scene or only affects cameras within the boundaries of the Volume. To do this: + +1. Go to the Inspector window for your Custom Pass. +2. Go to **Custom Pass Volume (Script)** > **Mode** + * To create a Custom Pass Volume that affects every camera in the scene, set the **Mode** to **Global**. + * To create a Custom Pass Volume that only affects cameras within the boundaries of the Volume, set the **Mode** to **Local**. You can use the **Priority** field to determine the execution order of multiple Custom Pass Volumes in your scene. If two Custom Pass Volumes have the same priority, Unity executes them in one of the following ways: - When both Custom Pass Volumes are **Global**, the execution order is undefined. -- When both Custom Pass Volumes are **Local**, Unity executes the Volume with the smallest collider first (ignoring the fade radius). If both Volumes have the same collider size, the order is undefined. +- When both Custom Pass Volumes are **Local**, Unity executes the Volume with the smallest Collider first (ignoring the fade radius). If both Volumes have the same Collider size, the order is undefined. - When one Custom Pass Volume is **Local** and the other is **Global**, Unity executes the **Local** Volume first, then the **Global** Volume. -If the **Mode** of your Custom Pass Volume is set to **Local**, you can use the **Fade Radius** property in the [Custom Pass Volume Component](Custom-Pass-Creating.md#Custom-Pass-Volume) to smooth the transition between your normal rendering and the Custom Pass. The fade radius value is measured in meters and does not scale when you transform the object it is assigned to. +If you set the **Mode** of your Custom Pass Volume to **Local**, you can use the **Fade Radius** property in the [Custom Pass Volume Component](Custom-Pass-Creating.md#Custom-Pass-Volume) to smooth the transition between your normal rendering and the Custom Pass. The fade radius value is measured in meters and doesn't scale when you transform the object it's assigned to. The image below visualises the outer bounds of the fade radius as a wireframe box. The Custom Pass Volume in this image has a [Box Collider](https://docs.unity3d.com/Manual/class-BoxCollider.html) component which visualises the Volume. ![A Custom Pass Volume visualised using a Box Collider, with its fade radius visualised as a wireframe box.](images/CustomPassVolumeBox_Collider.png) -When a Custom Pass Volume's **Mode** is set to **Camera**, HDRP only executes the custom pass volume in its **Target Camera**. To make sure HDRP always executes the custom pass volume, it ignores the Camera's volume layer mask when a **Target Camera** is set. +When you set a Custom Pass Volume's **Mode** to **Camera**, HDRP only executes the custom pass volume in its **Target Camera**. To make sure HDRP always executes the custom pass volume, it ignores the Camera's volume layer mask when you set a **Target Camera**. ## Using C# to change the fade radius -To change the fade radius in code, you can use the built in `_FadeValue` variable in the shader, and `CustomPass.fadeValue` in your C# script. These variables operate on a 0 - 1 scale that represents how far the Camera is from the collider bounding Volume. To learn more, see [Scripting your own Custom Pass in C#](Custom-Pass-Scripting.md). +To change the fade radius in code, you can use the built in `_FadeValue` variable in the shader, and `CustomPass.fadeValue` in your C# script. These variables operate on a 0 to 1 scale that represents how far the Camera is from the Collider bounding Volume. To learn more, see [Scripting your own Custom Pass in C#](Custom-Pass-Scripting.md). diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Custom-Post-Process.md b/com.unity.render-pipelines.high-definition/Documentation~/Custom-Post-Process.md index d938aee7c1d..b414b9f35e5 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Custom-Post-Process.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Custom-Post-Process.md @@ -1,28 +1,34 @@ # Custom Post Process -The High Definition Render Pipeline (HDRP) allows you to write your own post-processing effects that automatically integrate into [Volume](Volumes.md). A custom effect needs two files. A **C# Custom Post Process**(C# file) and an associated **FullScreen Shader** (HLSL file). You can generate a template of each: +The High Definition Render Pipeline (HDRP) allows you to write your own post-processing effects that automatically integrate into [Volumes](Volumes.md). A custom effect needs two files: +* A **C# Custom Post Process**(C# file) +* An associated **FullScreen Shader** (HLSL file). -* **C# Custom Post Process**: Right click in the Assets folder and select **Create > Rendering > HDRP C# Post Process Volume**. +You can generate a template of each file: -* **FullScreen Shader**: Right click in the Assets folder and select **Create > Shader > HDRP > Post Process**. +* **C# Custom Post Process**: Right click in the Assets folder and select **Create** > **Rendering** > **HDRP C# Post Process Volume**. -Note that by default, your custom effect does not run if you just add it to a Volume. You also need to add the effect to your Project's list of supported effects. (it's the same list used to order the effect, see the Effect Ordering section). +* **FullScreen Shader**: Right click in the Assets folder and select **Create** > **Shader** > **HDRP** > **Post Process**. + +**Note**: By default, your custom effect doesn't run if you just add it to a Volume. You also need to add the effect to your Project's list of supported effects. (it's the same list used to order the effect, see the Effect Ordering section). ## Example This example shows you how to create a **grayscale** effect. To get started: -1. Create a **C# Custom Post Process** file (right click in the Assets folder: **Create > Rendering > HDRP C# Post Process Volume**) and call it **GrayScale**. Note that, because of how serialization works in Unity, the file name and the class name must be identical or Unity does not serialize it properly. +1. Create a **C# Custom Post Process** file (right click in the Assets folder: **Create** > **Rendering** > **HDRP C# Post Process Volume**) and call it **GrayScale**. + +**Note**: Because of how serialization works in Unity, the file name and the class name must be identical or Unity doesn't serialize it properly. 2. Copy the example code from the [GrayScale C# script section](#CSharp) into your **C# Post Process Volume**. -3. Create a full screen post-process Shader (right click in the Assets folder: **Create > Shader > HDRP > Post Process**) and call it **GrayScale**. +3. Create a full screen post-process Shader (right click in the Assets folder: **Create** > **Shader** > **HDRP** > **Post Process**) and call it **GrayScale**. 4. Copy the example code from the [GrayScale Shader section](#Shader) into your post-process Shader. -5. Add the **GrayScale** effect to the list of custom post-processes that your Project executes. To do this, go to **Edit > Project Settings > HDRP Default Settings** and, at the bottom of the **After Post Process** list, click on the **+** and select **GrayScale**. +5. Add the **GrayScale** effect to the list of custom post-processes that your Project executes. To do this, go to **Edit** > **Project Settings** > **HDRP Default Settings** and, at the bottom of the **After Post Process** list, click on the **+** and select **GrayScale**. -6. Now you can add the **GrayScale** post-process override to a **Volumes** in the Scene. To change the effect settings, click the small `all` text just below the foldout arrow and adjust with the **Intensity** slider. +6. Now you can add the **GrayScale** post-process override to **Volumes** in the Scene. To change the effect settings, click the small **all** text just below the foldout arrow and adjust with the **Intensity** slider. 7. Optionally, you can create a custom editor for your post-processing effect. For information on how to do this, see [custom editor](#CustomEditor). @@ -30,8 +36,9 @@ This example shows you how to create a **grayscale** effect. To get started: ### GrayScale C# script -This is the C# Custom Post Process file. Custom post-process effects store both configuration data and logic in the same class. To create the settings for the effect, you can either use a pre-existing class that inherits from [VolumeParameter](https://docs.unity3d.com/Packages/com.unity.render-pipelines.core@latest/index.html?subfolder=/api/UnityEngine.Rendering.VolumeParameter-1.html), or, if you want to use a property that the pre-existing classes do not include, create a new class that inherits from VolumeParameter. -```CSharp +This is the C# Custom Post Process file. Custom post-process effects store both configuration data and logic in the same class. To create the settings for the effect, you can either use a pre-existing class that inherits from [VolumeParameter](https://docs.unity3d.com/Packages/com.unity.render-pipelines.core@latest/index.html?subfolder=/api/UnityEngine.Rendering.VolumeParameter-1.html), or, if you want to use a property that the pre-existing classes don't include, create a new class that inherits from VolumeParameter. + +```C# using UnityEngine; using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; @@ -76,7 +83,7 @@ This example code uses a `ClampedFloatParameter` that you can clamp to a range. * The third parameter represents the maximum value to clamp the property to. -HDRP calls the `IsActive()`function before the `Render` function to process the effect. If this function returns `false`, HDRP does not process the effect. It is good practice to check every property configuration where the effect either breaks or does nothing. In this example, `IsActive()` makes sure that HDRP can find the `GrayScale.shader` and that the intensity is greater than 0. +HDRP calls the `IsActive()` function before the `Render` function to process the effect. If this function returns `false`, HDRP doesn't process the effect. It's good practice to check every property configuration where the effect either breaks or doesn'thing. In this example, `IsActive()` makes sure that HDRP can find the `GrayScale.shader` and that the intensity is greater than 0. The **injectionPoint** override allows you to specify where in the pipeline HDRP executes the effect. There are currently five injection points: @@ -107,7 +114,10 @@ In the `Render` function, you have access to a [CommandBuffer](https://docs.unit ### GrayScale Shader -HDRP gives you total control over the vertex and fragment Shader so you can edit both of them to suit your needs. Note that there are a number of utility functions in [Common.hlsl](https://github.com/Unity-Technologies/Graphics/blob/master/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl) and [Color.hlsl](https://github.com/Unity-Technologies/Graphics/blob/master/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl) that the Shader includes by default. This means that you have access to these utility functions in your effect. For example, the GrayScale Shader uses the Luminance() function to convert a linear RGB value to its luminance equivalent. +HDRP gives you total control over the vertex and fragment Shader so you can edit both of them to suit your needs. + +There are several utility functions in [Common.hlsl](https://github.com/Unity-Technologies/Graphics/blob/master/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl) and [Color.hlsl](https://github.com/Unity-Technologies/Graphics/blob/master/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl) that the Shader includes by default. This means that you have access to these utility functions in your effect. For example, the GrayScale Shader uses the `Luminance()` function to convert a linear RGB value to its luminance equivalent. + ```glsl Shader "Hidden/Shader/GrayScale" { @@ -195,9 +205,12 @@ Shader "Hidden/Shader/GrayScale" } ``` -If none of your Scenes reference the Shader, Unity does not build the Shader and the effect does not work when you run your application outside of the Editor. To resolve this, either add the Shader to a [Resources folder](https://docs.unity3d.com/Manual/LoadingResourcesatRuntime.html), or go to **Edit > Project Settings > Graphics** and add the Shader to the **Always Included Shaders** list. +If none of your Scenes reference the Shader, Unity doesn't build the Shader and the effect doesn't work when you run your application outside of the Editor. To resolve this, do one of the following: + +* Add the Shader to a [Resources folder](https://docs.unity3d.com/Manual/LoadingResourcesatRuntime.html) +* Go to **Edit** > **Project Settings** > **Graphics** and add the Shader to the **Always Included Shaders** list. -:warning: Note that, when HDRP executes your post-process effect, it uses a render target pooling system. It means that you don't know what the current color buffer contains, which is why you should never use any instructions that could show this color buffer. Do not use transparency, blend modes, or the **clip()** instruction in your Shader, otherwise your effect breaks. +**Note**: When HDRP executes your post-process effect, it uses a render target pooling system. It means that you don't know what the current color buffer contains, which is why you should never use any instructions that could display this color buffer. don't use transparency, blend modes, or the **clip()** instruction in your Shader, otherwise your effect breaks. #### Shader inputs @@ -218,7 +231,7 @@ By default, the Shader template provides you with the following inputs: HDRP allows you to customize the order of your custom post-processing effect at each injection point. To order your effects: -1. Go to **Edit > Project Settings > Graphics** and select the [HDRP Global Settings](Default-Settings-Window.md) tab. +1. Go to **Edit** > **Project Settings** > **Graphics** and select the [HDRP Global Settings](Default-Settings-Window.md) tab. 2. Scroll down until you find the **Custom Post Process Orders** section. This section contains three lists, one for each injection point. @@ -245,8 +258,8 @@ HDRP processes effects from the top of the list to the bottom and the order of e By default, Unity automatically creates an editor for classes but, if you want more control over how Unity displays certain properties, you can create a custom editor. If you do create a custom editor script, make sure to put it in a folder named **Editor**. The following is an example of a custom editor for the GrayScale effect: -``` +```C# using UnityEditor.Rendering; using UnityEngine; @@ -287,11 +300,12 @@ sealed class GrayScaleEditor : VolumeComponentEditor } ``` -This custom editor is not really useful as it produces the same result as the editor that Unity creates. Custom Volume component editors also support an [additonal properties toggle](More-Options.md). To add it, you have to set hasAdvancedMode override to true. Then, inside the OnInspectorGUI, you can use the isInAdvancedMode boolean to display more properties. + +This custom editor isn't useful as it produces the same result as the editor that Unity creates. Custom Volume component editors also support an [additonal properties toggle](More-Options.md). To add it, you have to set the `hasAdvancedMode` override to true. Then, inside `OnInspectorGUI`, you can use the `isInAdvancedMode` Boolean to display more properties. ## Dynamic resolution and DLSS support -If you want to use DLSS and/or dynamic resolution on your pass, and you need to interpolate or sample UVs from color / normal or velocity, you must use the following functions to calculate the correct UVs: +If you want to use DLSS or dynamic resolution on your pass, and you need to interpolate or sample UVs from color, normal, or velocity, you must use the following functions to calculate the correct UVs: ```glsl #include "Packages/com.unity.render-pipelines.high-dynamic/Runtime/ShaderLibrary/ShaderVariables.hlsl" @@ -303,20 +317,20 @@ float2 correctUvs = ClampAndScaleUVForBilinearPostProcessTexture(UV); // use the ``` -## TroubleShooting +## Troubleshooting -If your effect does not display correctly: +If your effect doesn't display correctly: * In your Project Settings, make sure this effect is listed under one of the post process order lists (see [Effect Ordering](#EffectOrdering)). -* Check that your effect's Shader compiles and that the reference to the Material in your post process Volume is not null. +* Check that your effect's Shader compiles and that the reference to the Material in your post process Volume isn't null. * In the Volume that contains your post process, make sure that it has a high enough priority and that your Camera is inside its bounds. * Check that your shader doesn't contain any **clip()** instructions, that the blend mode is set to Off and the output alpha is always 1. -* If your effect does not work with dynamic resolution, use the _PostProcessScreenSize constant to make it fit the size of the screen correctly. You only need to do this when you use dynamic resolution scaling (DRS), and you need normal / velocity and color. +* If your effect doesn't work with dynamic resolution, use the _PostProcessScreenSize constant to make it fit the size of the screen correctly. You only need to do this when you use dynamic resolution scaling (DRS), and you need normal / velocity and color. -## Known issues and Limitations +## Known issues and limitations -* Renaming a custom post process class name and file will remove it from the list in HDRP Project Settings causing the effect to not be rendered anymore. +* Renaming a custom post process class name and file will remove it from the list in HDRP Project Settings causing the effect not to be rendered anymore. diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Diffusion-Profile.md b/com.unity.render-pipelines.high-definition/Documentation~/Diffusion-Profile.md index c6807788b4f..ab977eb9280 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Diffusion-Profile.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Diffusion-Profile.md @@ -13,8 +13,8 @@ To create a Diffusion Profile, navigate to __Assets > Create > Rendering > HDRP |:---|:---| | **Name** | The name of the Diffusion Profile. | | **Scattering Distance** | Use the color picker (circle icon) to define how far each light channel in the Diffusion Profile travels below the surface:

**R**: Defines how far the red light channel travels below the surface.
**G**: Controls how far the green light channel travels below the surface.
**B**: Controls how far the blue light channel travels below the surface.

The overall color affects the Transmission tint. | -| **Max Radius** | The maximum radius of the effect you define in **Scattering Distance**. The size of this value depends on the world scale. For example, when the world scale is 1, this value is in meters. When the world scale is 0.001, this value is in millimeters.

When the size of this radius is smaller than a pixel on the screen, HDRP does not apply Subsurface Scattering. | -| **Index of Refraction** | This value is controlled by the highest of the **Scattering Distance** RGB values.Use the slider to set the refractive behavior of the Material. Larger values increase the intensity of specular reflection. For example, the index of refraction of skin is about 1.4. For more example values for the index of refraction of different materials, see Pixel and Poly’s [list of indexes of refraction values](https://pixelandpoly.com/ior.html). | +| **Max Radius** | The maximum radius of the effect you define in **Scattering Distance**. The size of this value depends on the world scale. For example, when the world scale is 1, this value is in meters. When the world scale is 0.001, this value is in millimeters.

When the size of this radius is smaller than a pixel on the screen, HDRP doesn't apply Subsurface Scattering. | +| **Index of Refraction** | This value is controlled by the highest of the **Scattering Distance** RGB values. Use the slider to set the refractive behavior of the Material. Larger values increase the intensity of specular reflection. For example, the index of refraction of skin is about 1.4. For more example values for the index of refraction of different materials, see Pixel and Poly’s [list of indexes of refraction values](https://pixelandpoly.com/ior.html). | | **World Scale** | Controls the scale of Unity’s world units for this Diffusion Profile. By default, HDRP assumes that 1 Unity unit is 1 meter. This property only affects the subsurface scattering pass. | @@ -23,7 +23,7 @@ To create a Diffusion Profile, navigate to __Assets > Create > Rendering > HDRP | Property| Description | |:---|:---| -| **Texturing Mode** | Use the drop-down to select when HDRP applies the albedo of the Material.
• **Post-Scatter**: HDRP applies the albedo to the Material after the subsurface scattering pass pass. This means that the contents of the albedo texture are not blurred. Use this mode for scanned data and photographs that already contain some blur due to subsurface scattering.
• **Pre- and Post-Scatter**: Albedo is partially applied twice, before and after the subsurface scattering pass pass. Effectively, this blurs the albedo, resulting in a softer, more natural look. | +| **Texturing Mode** | Use the drop-down to select when HDRP applies the albedo of the Material.
• **Post-Scatter**: HDRP applies the albedo to the Material after the subsurface scattering pass. This means that the contents of the albedo texture aren't blurred. Use this mode for scanned data and photographs that already contain some blur due to subsurface scattering.
• **Pre- and Post-Scatter**: Albedo is partially applied twice, before and after the subsurface scattering pass. Effectively, this blurs the albedo, resulting in a softer, more natural look. | @@ -31,8 +31,8 @@ To create a Diffusion Profile, navigate to __Assets > Create > Rendering > HDRP | Property| Description | |:---|:---| -| **Transmission Mode** | Use the drop-down to select a method for calculating light transmission.
• **Thick Object**: is for geometrically thick objects. Note that since this mode makes use of shadow maps, directional lights automatically fall back to the thin object mode that relies solely on thickness maps (since shadow maps of directional lights do not offer sufficient precision for thickness estimation).
• **Thin Object**: is for thin, double-sided, geometry. | -| **Transmission Tint** | Specifies the tint of the translucent lighting (that is transmitted through objects). | +| **Transmission Mode** | Use the drop-down to select a method for calculating light transmission.
• **Thick Object**: is for geometrically thick objects. Note that since this mode makes use of shadow maps, directional lights automatically fall back to the thin object mode that relies solely on thickness maps (since shadow maps of directional lights don't offer enough precision for thickness estimation).
• **Thin Object**: is for thin, double-sided, geometry. | +| **Transmission Tint** | Specifies the tint of the translucent lighting (that's transmitted through objects). | | **Min-Max Thickness (mm)** | Sets the range of thickness values (in millimeters) corresponding to the [0, 1] range of texel values stored in the Thickness Map. This range corresponds to the minimum and maximum values of the Thickness Remap (mm) slider below. | | **Thickness Remap (mm)** | Sets the range of thickness values (in millimeters) corresponding to the [0, 1] range of texel values stored in the Thickness Map. This range is displayed by the Min-Max Thickness (mm) fields above. | @@ -53,4 +53,4 @@ The main difference between the two __Transmission Modes__ is how they use shado If you disable shadows on your Light, both __Transmission Modes__ give the same results, and derive their appearance from the __Thickness Map__ and the __Diffusion Profile__. The results change if you enable shadows. The __Thin Object__ mode (that only evaluates shadowing once, at the front face) is likely to cause self-shadowing issues (for thick objects) that can cause the object to appear completely black. The __Thick Object__ mode derives the thickness from the shadow map, taking the largest value between the baked thickness and the shadow thickness, and uses this to evaluate the light transmittance. -Because you cannot control the distances HDRP derives from the shadow map, the best way to approach __Thick Object__ is to enable shadows, then adjust the __Scattering Distance__ until the overall transmission intensity is in the desired range, and then use the __Thickness Map__ to mask any shadow mapping artifacts. +Because you can't control the distances HDRP derives from the shadow map, the best way to approach __Thick Object__ is to enable shadows, then adjust the __Scattering Distance__ until the overall transmission intensity is in the desired range, and then use the __Thickness Map__ to mask any shadow mapping artifacts. diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Images/CustomPostProcess1.png b/com.unity.render-pipelines.high-definition/Documentation~/Images/CustomPostProcess1.png index f4277a3a833..31de157d205 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Images/CustomPostProcess1.png +++ b/com.unity.render-pipelines.high-definition/Documentation~/Images/CustomPostProcess1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:61147bbe5277ee849faa4ba34075ad2d314a7d8088028e6abe646094a9ffec52 -size 44219 +oid sha256:fd47db3b7401ee492838a710c351064eee44753dc60a24b57c13a075b87bc5bd +size 192663 diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Images/Custom_Pass_Frame_Debug.png b/com.unity.render-pipelines.high-definition/Documentation~/Images/Custom_Pass_Frame_Debug.png index 9400085877a..131f1d5741a 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Images/Custom_Pass_Frame_Debug.png +++ b/com.unity.render-pipelines.high-definition/Documentation~/Images/Custom_Pass_Frame_Debug.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:113049c042ab65e58334f5a48fde6b8b5f543efa09d7a96366afb2eedc111ed5 -size 102078 +oid sha256:91d02a29d5e22854ed1c6013f2bc83e46b7a22a3107e1087eb83c375e27ee077 +size 107101 diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Images/MaskMapAndDetailMap2.png b/com.unity.render-pipelines.high-definition/Documentation~/Images/MaskMapAndDetailMap2.png index 22d9a913b67..fcb4daa5094 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Images/MaskMapAndDetailMap2.png +++ b/com.unity.render-pipelines.high-definition/Documentation~/Images/MaskMapAndDetailMap2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6bb9721ef92b29d405098d718e234dfe5bb44310a2c2608c43fa2b320d78080e -size 302736 +oid sha256:a524d41832c600d9dbdd45e9fb19918f6b1e07041c6fb6107972ae42cf9f3371 +size 351760 diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Images/Matcap1.png b/com.unity.render-pipelines.high-definition/Documentation~/Images/Matcap1.png index 58545a4612f..5d6dfabe4d8 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Images/Matcap1.png +++ b/com.unity.render-pipelines.high-definition/Documentation~/Images/Matcap1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:aa4540fdedc5b37c4e1fa730ecdc4d4fbaa6ac772884f944ea2ab25ab637df46 -size 4757 +oid sha256:ccdabff17ba7be61f90bafe91f8fa6956faff94bbde381123347c0d3ab728a59 +size 633937 diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Images/RenderPipelineDebug2.png b/com.unity.render-pipelines.high-definition/Documentation~/Images/RenderPipelineDebug2.png index bba70b0ae13..a0381722e1f 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Images/RenderPipelineDebug2.png +++ b/com.unity.render-pipelines.high-definition/Documentation~/Images/RenderPipelineDebug2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0e14e87cfc151f107faf112691c7a5770e037fdd2106bcf95fd70d159526dac4 -size 167393 +oid sha256:b702206ae4bc0d4dbcb18bd6dd3f99fbabe88578206b9a8a73dd846e8a29c92f +size 405935 diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Mask-Map-and-Detail-Map.md b/com.unity.render-pipelines.high-definition/Documentation~/Mask-Map-and-Detail-Map.md index f27996da428..6440d288429 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Mask-Map-and-Detail-Map.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Mask-Map-and-Detail-Map.md @@ -7,7 +7,12 @@ This document describes the format of the mask map and detail map so that you ca To create a mask map: 1. Open image editing software that supports channel editing (such as Adobe Photoshop). -2. Drag your grayscale textures into their respective color channel. For information about which texture belongs in which channel, see [mask map](#MaskMap) and [detail map](#DetailMap).
![](Images/MaskMapAndDetailMap1.png) +2. Import your grayscale textures onto separate layers. +3. Make only one of the layers visble. +4. Under **Adjustments**, select **Curves**. +5. Leaving only the color channel you want that texture to be in, set the outputs of the other channels to 0 and the inputs to 4. For information about which texture belongs in which channel, see [mask map](#MaskMap) and [detail map](#DetailMap).
![](Images/MaskMapAndDetailMap1.png) +6. Merge the curve with layer you've just worked on. +7. Repeat steps 3 to 6 for your other layers. 3. Export your image. 4. When you import the image into Unity, make sure that it uses linear color space. @@ -15,12 +20,12 @@ To create a mask map: ## Mask map -The mask map contains four grayscale textures, one in each color channel. HDRP uses the mask map to store the metallic map, occlusion map, detail mask, and smoothness map for the material. The mask map stores these textures in the following channels: +The mask map contains four grayscale textures, one in each color channel. The default expected value of each channel is 0.5. HDRP uses the mask map to store the metallic map, ambient occlusion map, detail mask, and smoothness map for the material. The mask map stores these textures in the following channels: | **Color channel** | **Map** | | ----------------- | ----------- | | **Red** | Metallic | -| **Green** | Occlusion | +| **Green** | Ambient Occlusion| | **Blue** | Detail mask | | **Alpha** | Smoothness | @@ -47,7 +52,7 @@ The following example image demonstrates the individual components of a full det ### Desaturated albedo (red channel) -The red channel represents the albedo variation. It makes the underlying material's albedo gradually darken down to black when going from `0.5` to `0` or brighten up to white when going from `0.5` to `1`. A value of `0.5` is neutral, which means the detail map does not modify the albedo. +The red channel represents the albedo variation. It makes the underlying material's albedo gradually darken down to black when going from `0.5` to `0` or brighten up to white when going from `0.5` to `1`. A value of `0.5` is neutral, which means the detail map doesn't modify the albedo. The image below shows the impact of the detail albedo on the final color. HDRP calculates color interpolation in sRGB space. @@ -55,7 +60,7 @@ The image below shows the impact of the detail albedo on the final color. HDRP c ### Smoothness (blue channel) -The blue channel represents the smoothness variation and HDRP calculates it the same way as the albedo variation. The underlying material's smoothness gradually decreases if the detail smoothness is below `0.5` or increases if it is above `0.5`. A value of `0.5` is neutral, which means the detail map does not modify the smoothness. +The blue channel represents the smoothness variation and HDRP calculates it the same way as the albedo variation. The underlying material's smoothness gradually decreases if the detail smoothness is below `0.5` or increases if it's above `0.5`. A value of `0.5` is neutral, which means the detail map doesn't modify the smoothness. The image below shows the impact of the detail smoothness on the final color. diff --git a/com.unity.render-pipelines.high-definition/Documentation~/MatCap.md b/com.unity.render-pipelines.high-definition/Documentation~/MatCap.md index c48a5909ec6..efe67eb25e1 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/MatCap.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/MatCap.md @@ -1,23 +1,23 @@ # MatCap mode -In MatCap mode, the High Definition Render Pipeline (HDRP) replaces the functionality of the Scene window's Lighting button with a material capture (MatCap) view. MatCap mode uses an image that completely captures a Material, including baked-in lighting. When using MatCap mode, HDRP replaces all of the Materials and lighting in the Scene with what is in the MatCap. +In MatCap mode, the High Definition Render Pipeline (HDRP) replaces the functionality of the Scene view's Lighting button with a material capture (MatCap) view. MatCap mode uses an image that completely captures a Material, including baked-in lighting. When using MatCap mode, HDRP replaces all the Materials and lighting in the Scene with what's in the MatCap. -MatCap mode is particularly useful to navigate and get a sense of the Scene without setting up the Scene lighting. For example, if you were to edit a dark area, like the inside of a cave, it would be difficult to navigate with low lighting MatCap mode makes it much easier to navigate in such dark areas. +MatCap mode is useful to navigate and get a sense of the Scene without setting up the Scene lighting. For example, if you were to edit a dark area, like the inside of a cave, MatCap mode makes it much easier to navigate in this low lighting. ## Using MatCap -To activate MatCap mode, disable the Lighting toggle in the Scene window. +To activate MatCap mode, disable the Lighting toggle in the Scene view. ![](Images/MatCap1.png) -MatCap mode preserves the normal maps and you can use the original Material albedo. To configure MatCap mode, go to **Edit > Preferences > HD Render Pipeline** and use the following properties. +MatCap mode preserves the normal maps and you can use the original Material albedo. To configure MatCap mode, go to **Edit** > **Preferences** > **HD Render Pipeline** and use the following properties. ## Properties | **Property** | **Description** | | ----------------------------- | ------------------------------------------------------------ | -| **Mix Albedo in MatCap Mode** | Enable the checkbox to make HDRP mix the albedo of the Material with its material capture. | -| **MatCap Intensity Scale** | Set the intensity of the material capture. This increases the brightness of the Scene. This is especially useful if the albedo darkens the Scene considerably. | +| **Mix Albedo in MatCap Mode** | Enable to make HDRP mix the albedo of the Material with its material capture. | +| **MatCap Intensity Scale** | Set the intensity of the material capture. This increases the brightness of the Scene. This is useful if the albedo darkens the Scene considerably. | ## Default material captures @@ -32,11 +32,11 @@ You can also activate MatCap view as a **Lighting Debug Mode** in the [Rendering ## MatCap examples -MatCap off: ![](Images/MatCap2.png) +MatCap off -MatCap on: ![](Images/MatCap3.png) +MatCap on -MatCap on with albedo: ![](Images/MatCap4.png) +MatCap on with albedo diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Material-API.md b/com.unity.render-pipelines.high-definition/Documentation~/Material-API.md index 275fe90f993..54629cdbfbc 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Material-API.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Material-API.md @@ -1,26 +1,27 @@ # Material Scripting API -Most HDRP shaders allow enabling and disabling functionalities through the use of Shader keywords. +Most HDRP shaders allow you to enable and disable functionalities through the use of Shader keywords. -For example, on the HDRP Lit Shader, normal mapping code is stripped from materials that do not use a normal map. Since these materials don’t include the code for normal mapping, they are faster to run, and to compile. -Enabling the keyword for normal mapping is done automatically when activated through the material Inspector, but needs to be done explicitely from a script. +For example, on the HDRP Lit Shader, normal mapping code is stripped from Materials that don't use a normal map. These Materials don’t include the code for normal mapping, so they're faster to run and compile. The keyword for normal mapping is activated automatically when you use the Material Inspector, but you need to do it explicitly when you use a script. You can find more information about Material parameters in Unity in the [Material section](https://docs.unity3d.com/Manual/MaterialsAccessingViaScript.html) of the Unity Manual. Information about shader variants, shader keywords and access in standalone builds can be found [here](https://docs.unity3d.com/Manual/shader-variants-and-keywords.html). -## Modifying HDRP materials in scripts +## Modifying HDRP Materials in scripts -When you change a Material’s properties in the Inspector, HDRP sets up properties, keywords and passes on the Material to make sure HDRP can render it correctly.This is called a validation step. -When you use a script to change a Material’s properties, HDRP does not perform this step automatically. This means you must validate that Material manually. +When you change a Material’s properties in the Inspector, HDRP sets up properties, keywords, and passes on the Material to make sure HDRP can render it correctly. This is called a validation step. +When you use a script to change a Material’s properties, HDRP doesn't perform this step automatically. This means you must validate that Material manually. ### Validating a Material in HDRP To validate a Material In HDRP, use the function `ValidateMaterial` to force HDRP to perform a validation step on any Material made from an HDRP Shader or a ShaderGraph that has a HDRP Target. + The following example script: + * Creates a Material with the [HDRP/Lit](Lit-Shader.md) shader, * Enables Alpha Clipping and sets its cutoff value to `0.2`, * Uses the `ValidateMaterial` function to enable the Alpha Clipping keywords on the Material. -```csharp +```C# using UnityEngine.Rendering.HighDefinition; public class CreateCutoutMaterial : MonoBehaviour @@ -38,20 +39,22 @@ public class CreateCutoutMaterial : MonoBehaviour ### HDRP Material API -However, some properties of HDRP shaders are not independent, and they require changes to other properties or keywords in order to have any effect. +Some properties of HDRP shaders aren't independent, and they require changes to other properties or keywords to have any effect. To help modify these properties, HDRP provides a set of functions that will take care of setting all the required states. You can find a list of available methods in the [Scripting API](.../api/UnityEngine.Rendering.HighDefinition.HDMaterial.html). Please refer to the documentation to know with which shaders the methods are compatible. -The below example script: +The example script below: + * Creates a Material with the HDRP/Lit shader, * Enables Alpha Clipping and sets its cutoff value to `0.2`. Keywords are automatically set appropriately. To do this, it uses the following helper functions: + * material.SetAlphaClipping * material.SetAlphaCutoff -```csharp +```C# using UnityEngine.Rendering.HighDefinition; public class CreateCutoutMaterial : MonoBehaviour @@ -67,12 +70,13 @@ public class CreateCutoutMaterial : MonoBehaviour ## Making shader variants available at runtime -Unity uses the set of keywords enabled on a Material to determine which Shader Variant to use. When you build a project, only the Shader Variants currently in use by the materials of the project will be included in the build. -Because Shader Variants have to be compiled at project build time, changing keywords on a material at runtime can require using a Variant that has not been built. +Unity uses the set of keywords enabled on a Material to determine which Shader Variant to use. When you build a project, Unity only includes the Shader Variants in the build that the Materials of the project are currently using. +Because Unity has to compile Shader Variants at build time, changing keywords on a Material at runtime can require using a Variant that Unity hasn't built. To make all Shader Variants you need available at runtime, you need to ensure Unity knows that you need them. There are several ways to do that: -1. You can record the shader variants used during a play session and store them in a **Shader Variant Collection** asset. To do that, navigate to the Project Settings window, open the Graphics tab and select Save to asset… This will build a collection containing all Shader Variants currently in use and save them out as an asset. You must then add this asset to the list of Preloaded Shaders for the variants to be included in a build. + +1. You can record the shader variants used during a play session and store them in a **Shader Variant Collection** asset. To do that, navigate to the Project Settings window, open the Graphics tab and select **Save to asset…** This will build a collection containing all Shader Variants currently in use and save them out as an asset. You must then add this asset to the list of Preloaded Shaders for the variants to be included in a build. ![](Images/shader-variants.png) -2. You can include at least one Material using each variant in your Assets folder. This Material must be used in a scene or be placed in your Resources Folder, otherwise Unity ignores this Material when it builds the project. +2. You can include at least one Material using each variant in your Assets folder. You must use this Material in a scene or place it in your Resources Folder, otherwise Unity ignores this Material when it builds the project. diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Material-Upgrade.md b/com.unity.render-pipelines.high-definition/Documentation~/Material-Upgrade.md index 89fa89615d5..eab8f8cc250 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Material-Upgrade.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Material-Upgrade.md @@ -1,21 +1,24 @@ # Upgrading Materials between HDRP versions -Between different High Definition Render Pipeline (HDRP) versions materials might need an upgrade to work properly. This page describes how the process works and how you can remedy potential issues. +Between different versions of the High Definition Render Pipeline (HDRP), you might need to upgrade materials for them to work. This page describes how to upgrade materials and how to fix issues. ## Automatic Material Upgrade -To determine whether a material upgrade is needed or not, HDRP checks if the value *m_LastMaterialVersion* in the file ProjectSettings/HDRPProjectSettings.asset is the latest required. -If it is not, all materials in the project will be reimported and saved to disk if they needed change. Note that if a version control system is used, then the materials will also be checked out before saving their content to disk. +To determine whether you need to upgrade a material, HDRP checks if the value `m_LastMaterialVersion` in the file ProjectSettings/HDRPProjectSettings.asset is the latest required. +If it's not, HDRP reimports all materials in the project and saves them to disk if they changed change. -When the upgrade is done and the materials are written to disk, the value of *m_LastMaterialVersion* is updated and written to HDRPProjectSettings.asset. +**Note**: If you use a version control system, the materials will also be checked out before saving their content to disk. If your version control system requires checkout operations (for example, Perforce), you must set it up correctly in your project before upgrading your materials. Otherwise, the material will be upgraded and the file marked as non read-only, but they won't be checked out by the VCS. -When a material saved with an older version of HDRP is imported, then this will also be upgraded automatically and written to disk when done. +When the upgrade has finished and the materials has been saved to disk, HDRP updates the value of `m_LastMaterialVersion` and writes the new value to HDRPProjectSettings.asset. -Please note that if a version control system that requires check out operations is in use (e.g. Perforce), it is important that it is correctly setup in the project before the upgrade operation happens. If this is not the case, the material will be upgraded and the file marked as non read-only, but they will not be checked out by the VCS. +When you import a material saved with an older version of HDRP, this material will also be upgraded automatically and written to disk. ## Manual Material Upgrade -In case the above process fails and a material is not working as expected when upgrading HDRP version, it is suggested to run the upgrade process manually. To do so, you can either: +In case the automatic material upgrade fails and a material isn't working as expected when upgrading an HDRP version, run the upgrade process manually. To do so, you can either: -- Open the [Render Pipeline Wizard](Render-Pipeline-Wizard.md) and under the **Project Migration Quick-links** click on the Upgrade HDRP Materials to Latest Version button. Or: -- Select **Edit > Render Pipelines > HD Render Pipeline > Upgrade from Previous Version > Upgrade HDRP Materials to Latest Version** +- Use the [Render Pipeline Wizard](Render-Pipeline-Wizard.md) + 1. Open the Render Pipeline Wizard. + 2. Go to **Project Migration Quick-links** + 3. Click **Upgrade HDRP Materials to Latest Version**. +- Select **Edit** > **Render Pipelines** > **HD Render Pipeline** > **Upgrade from Previous Version** > **Upgrade HDRP Materials to Latest Version**. diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Override-Diffusion-Profile.md b/com.unity.render-pipelines.high-definition/Documentation~/Override-Diffusion-Profile.md index ed2ee36e15f..435dac57231 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Override-Diffusion-Profile.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Override-Diffusion-Profile.md @@ -20,15 +20,15 @@ To add a **Diffusion Profile Override** to a Volume: | **Property** | **Description** | | ------------------------------------------ | ------------------------------------------------------------ | | **Diffusion Profile List** | Assign a Diffusion Profile to each field to create a list of Diffusion Profiles that Materials in this Volume can use. Click the plus icon to add another field. To remove a Diffusion Profile from the list, select it in the list and click the minus icon. | -| **Fill Profile List With Scene Materials** | Click this button to remove every Diffusion Profile in the **Diffusion Profile List** and then re-populate the list with Diffusion Profiles that Materials within the bounds of this local Volume use. Note that this does not work with Materials that use a ShaderGraph Shader.
This property is only available when you select **Local** from the **Mode** drop-down in the Volume component. Add a Collider to this GameObject to set the bounds of the Volume. | +| **Fill Profile List With Scene Materials** | Click this button to remove every Diffusion Profile in the **Diffusion Profile List** and then re-populate the list with Diffusion Profiles that Materials within the bounds of this local Volume use. Note that this doesn't work with Materials that use a ShaderGraph Shader.
This property is only available when you select **Local** from the **Mode** drop-down in the Volume component. Add a Collider to this GameObject to set the bounds of the Volume. | ## Details -If a Material references a Diffusion Profile that is not in the list of available Diffusion Profiles, that Material uses the default Diffusion Profile, which has a green tint. +If a Material references a Diffusion Profile that isn't in the list of available Diffusion Profiles, that Material uses the default Diffusion Profile, which has a green tint. -If the Volume with the Diffusion Profile Override is local, the **Fill Profiles With Scene Materials** button appears. Click this button to fetch the Diffusion Profiles from Materials inside the Volume's bounds and fill the **Diffusion Profile List** with them. Note that this does not work with Materials that use a ShaderGraph Shader. +If the Volume with the Diffusion Profile Override is local, the **Fill Profiles With Scene Materials** button appears. Click this button to fetch the Diffusion Profiles from Materials inside the Volume's bounds and fill the **Diffusion Profile List** with them. Note that this doesn't work with Materials that use a ShaderGraph Shader. -If multiple Volumes overlap and affect the Camera simultaneously, HDRP interpolates between multiple values for the same Volume override property in order to handle overlapping values. However, interpolating a final value for the **Diffusion Profile List** is not possible. Instead, HDRP selects the **Diffusion Profile List** from the Volume with the highest **Priority**. +If multiple Volumes overlap and affect the Camera simultaneously, HDRP interpolates between multiple values for the same Volume override property to handle overlapping values. However, interpolating a final value for the **Diffusion Profile List** isn't possible. Instead, HDRP selects the **Diffusion Profile List** from the Volume with the highest **Priority**. There is a small performance overhead to find which Diffusion Profile a Material uses. This means that the fewer Diffusion Profiles you use, the faster this process is. Rather than limit the number of Diffusion Profiles you use, you can use the **Diffusion Profile Override** to optimize the search process. If you have multiple Scenes, and each one only uses a single Diffusion Profile, you can use this override on a global Volume in each Scene to select a Diffusion Profile per Scene, instead of placing the Diffusion Profile from each Scene into the HDRP Graphics Settings. This reduces the resource intensity of the search in the Shader. This technique is particularly effective if your Scene contains a lot of overdraw to produce visual effects like foliage and vegetation. diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Override-Gradient-Sky.md b/com.unity.render-pipelines.high-definition/Documentation~/Override-Gradient-Sky.md index 49b005907e5..4b4cb23fb3f 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Override-Gradient-Sky.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Override-Gradient-Sky.md @@ -28,7 +28,7 @@ After you add a **Gradient Sky** override, you must set the Volume to use **Grad | **Bottom** | Use the color picker to select the color of the lower hemisphere of the sky. This is below the horizon. | | **Gradient Diffusion** | Set the size of the **Middle** property in the Skybox. Higher values make the gradient thinner, shrinking the size of the **Middle** section. Low values make the gradient thicker, increasing the size of the **Middle** section. | | **Intensity Mode** | Use the drop-down to select the method that HDRP uses to calculate the sky intensity.
• **Exposure**: HDRP calculates intensity from an exposure value in EV100.
• **Multiplier**: HDRP calculates intensity from a flat multiplier. | -| - **Exposure** | Set the amount of light per unit area that HDRP applies to the HDRI Sky cubemap.
This property only appears when you select **Exposure** from the **Intensity Mode** drop-down. | +| - **Exposure Compensation** | Set the amount of light per unit area that HDRP applies to the HDRI Sky cubemap.
This property only appears when you select **Exposure** from the **Intensity Mode** drop-down. | | - **Multiplier** | Set the multiplier for HDRP to apply to the Scene as environmental light. HDRP multiplies the environment light in your Scene by this value.
This property only appears when you select **Multiplier** from the **Intensity Mode** drop-down. | | **Update Mode** | Use the drop-down to set the rate at which HDRP updates the sky environment (using Ambient and Reflection Probes).
• **On Changed**: HDRP updates the sky environment when one of the sky properties changes.
• **On Demand**: HDRP waits until you manually call for a sky environment update from a script.
• **Realtime**: HDRP updates the sky environment at regular intervals defined by the **Update Period**. | | - **Update Period** | Set the period (in seconds) for HDRP to update the sky environment. Set the value to 0 if you want HDRP to update the sky environment every frame. This property only appears when you set the **Update Mode** to **Realtime**. | diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Override-HDRI-Sky.md b/com.unity.render-pipelines.high-definition/Documentation~/Override-HDRI-Sky.md index 1638b586ed3..057ef3f6681 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Override-HDRI-Sky.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Override-HDRI-Sky.md @@ -32,7 +32,7 @@ After you add an **HDRI Sky** override, you must set the Volume to use **HDRI Sk | - **Flowmap** | Assign a flowmap, in LatLong layout, that HDRP uses to distort UVs when rendering the sky.
This property only appears when you select **Flowmap** from the **Distortion Mode** drop-down. | | - **Upper Hemisphere Only** | Check the box if the flowmap contains distortion for the sky above the horizon only.
This property only appears when you select **Flowmap** from the **Distortion Mode** drop-down. | | **Intensity Mode** | Use the drop-down to select the method that HDRP uses to calculate the sky intensity.
• **Exposure**: HDRP calculates intensity from an exposure value in EV100.
• **Multiplier**: HDRP calculates intensity from a flat multiplier.
• **Lux**: HDRP calculates intensity in terms of a target Lux value. | -| - **Exposure** | Set the amount of light per unit area that HDRP applies to the HDRI Sky cubemap.
This property only appears when you select **Exposure** from the **Intensity Mode** drop-down. | +| - **Exposure Compensation** | Set the amount of light per unit area that HDRP applies to the HDRI Sky cubemap.
This property only appears when you select **Exposure** from the **Intensity Mode** drop-down. | | - **Multiplier** | Set the multiplier for HDRP to apply to the Scene as environmental light. HDRP multiplies the environment light in your Scene by this value.
This property only appears when you select **Multiplier** from the **Intensity Mode** drop-down. | | - **Desired Lux Value** | Set an absolute intensity for the HDR Texture you set in **HDRI Sky**, in [Lux](Physical-Light-Units.md#Lux). This value represents the light received in a direction perpendicular to the ground. This is similar to the Lux unit you use to represent the Sun and thus is complimentary.
This property only appears when you select **Lux** from the **Sky Intensity Mode** drop-down. | | - **Upper Hemisphere Lux Value** | Displays the relative intensity, in Lux, for the current HDR texture set in **HDRI Sky**. The final multiplier HDRP applies for intensity is **Desired Lux Value** / **Upper Hemisphere Lux Value**. This field is an informative helper.
This property only appears when you select **Lux** from the **Sky Intensity Mode** drop-down. | diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Override-Physically-Based-Sky.md b/com.unity.render-pipelines.high-definition/Documentation~/Override-Physically-Based-Sky.md index e1d5bd61ae2..5bd331a386c 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Override-Physically-Based-Sky.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Override-Physically-Based-Sky.md @@ -107,7 +107,7 @@ To make this section visible, set **Type** to **Custom Planet**. | ------------------------- | ------------------------------------------------------------ | | **Number Of Bounces** | The number of scattering events. This increases the quality of the sky visuals but also increases the pre-computation time. | | **Intensity Mode** | Use the drop-down to select the method that HDRP uses to calculate the sky intensity:
• **Exposure**: HDRP calculates intensity from an exposure value in EV100.
• **Multiplier**: HDRP calculates intensity from a flat multiplier. | -| **- Exposure** | The exposure for HDRP to apply to the Scene as environmental light. HDRP uses 2 to the power of your **Exposure** value to calculate the environment light in your Scene. | +| **- Exposure Compensation** | The exposure compensation for HDRP to apply to the Scene as environmental light. HDRP uses 2 to the power of your **Exposure Compensation** value to calculate the environment light in your Scene. | | **- Multiplier** | The multiplier for HDRP to apply to the Scene as environmental light. HDRP multiplies the environment light in your Scene by this value. To make this property visible, set **Intensity Mode** to **Multiplier**. | | **Update Mode** | The rate at which HDRP updates the sky environment (using Ambient and Reflection Probes):
• **On Changed**: HDRP updates the sky environment when one of the sky properties changes.
• **On Demand**: HDRP waits until you manually call for a sky environment update from a script.
• **Realtime**: HDRP updates the sky environment at regular intervals defined by the **Update Period**. | | **- Update Period** | The period (in seconds) for HDRP to update the sky environment. Set the value to 0 if you want HDRP to update the sky environment every frame. This property only appears when you set the **Update Mode** to **Realtime**. | diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Override-Screen-Space-GI.md b/com.unity.render-pipelines.high-definition/Documentation~/Override-Screen-Space-GI.md index fb2d8375b53..8e0b8ab02ce 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Override-Screen-Space-GI.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Override-Screen-Space-GI.md @@ -61,7 +61,7 @@ HDRP uses the [Volume](Volumes.md) framework to calculate SSGI, so to enable and | **LayerMask** | Defines the layers that HDRP processes this ray-traced effect for. | | **Mode** | Defines if HDRP should evaluate the effect in **Performance** or **Quality** mode.
This property only appears if you select set **Supported Ray Tracing Mode** in your HDRP Asset to **Both**. | | **Quality** | Specifies the preset HDRP uses to populate the values of the following nested properties. The options are:
• **Low**: A preset that emphasizes performance over quality.
• **Medium**: A preset that balances performance and quality.
• **High**: A preset that emphasizes quality over performance.
• **Custom**: Allows you to override each property individually.
This property only appears if you set **Mode** to **Performance**. | -| **Max Ray Length** | Controls the maximal length of rays. The higher this value is, the more resource-intensive ray traced global illumination is. | +| **Max Ray Length** | Controls the maximal length of rays in meters. The higher this value is, the more resource-intensive ray traced global illumination is. | | **Clamp Value** | Set a value to control the threshold that HDRP uses to clamp the pre-exposed value. This reduces the range of values and makes the global illumination more stable to denoise, but reduces quality. | | **Full Resolution** | Enable this feature to increase the ray budget to one ray per pixel, per frame. Disable this feature to decrease the ray budget to one ray per four pixels, per frame.
This property only appears if you set **Mode** to **Performance**. | | **Sample Count** | Controls the number of rays per pixel per frame. Increasing this value increases execution time linearly.
This property only appears if you set **Mode** to **Quality**. | diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Override-Screen-Space-Reflection.md b/com.unity.render-pipelines.high-definition/Documentation~/Override-Screen-Space-Reflection.md index 14ec94cbd42..37dab37c348 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Override-Screen-Space-Reflection.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Override-Screen-Space-Reflection.md @@ -47,7 +47,7 @@ HDRP uses the [Volume](Volumes.md) framework to calculate SSR, so to enable and | **Algorithm** | Specifies the algorithm to use for the screen-space reflection effect. The options are:
• **Approximation**: Approximates screen-space reflection to quickly calculate a result. This solution is less precise than **PBR Accumulation**, particularly for rough surfaces, but is less resource intensive.
• **PBR Accumulation**: Accumulates multiple frames to calculate a more accurate result. You can control the amount of accumulation using **Accumulation Factor**. This solution might produce more ghosting than **Approximation**, due to the accumulation, and is also more resources intensive. HDRP does not apply this algorithm to transparent material and instead always uses **Approximation**. | | **Minimum Smoothness** | Use the slider to set the minimum amount of surface smoothness at which HDRP performs SSR tracing. Lower values result in HDRP performing SSR tracing for less smooth GameObjects. If the smoothness value of the pixel is lower than this value, HDRP falls back to the next available reflection method in the [reflection hierarchy](Reflection-in-HDRP.md#ReflectionHierarchy). | | **Smoothness Fade Start** | Use the slider to set the smoothness value at which SSR reflections begin to fade out. Lower values result in HDRP fading out SSR reflections for less smooth GameObjects. The fade is in the range [Minimum Smoothness, Smoothness Fade Start]. | -| **Reflect Sky** | Indicates whether HDRP should use SSR to handle sky reflection. If you disable this property, pixels that reflect the sky use the next level of the [reflection hierarchy](Reflection-in-HDRP.md#ReflectionHierarchy).
**Note**: SSR uses the depth buffer to calculate reflection and HDRP does not add transparent GameObjects to the depth buffer. If you enable this property, transparent GameObject that appear over the sky in the color buffer can cause visual artifacts and incorrect looking reflection. This is a common limitation for SSR techniques. | +| **Reflect Sky** | Indicates whether HDRP should use SSR to handle sky reflection. If you disable this property, pixels that reflect the sky use the next level of the [reflection hierarchy](Reflection-in-HDRP.md#ReflectionHierarchy).
**Note**: SSR uses the depth buffer to calculate reflection and HDRP does not add transparent GameObjects to the depth buffer. If you enable this property, transparent GameObject that appear over the sky in the color buffer can cause visual artifacts and incorrect looking reflection. This is a common limitation for SSR techniques. This only affects SSR on opaque objects and is not supported for SSR on transparent.| | **Screen Edge Fade Distance** | Use the slider to control the distance at which HDRP fades out screen space reflections when the destination of the ray is near the boundaries of the screen. Increase this value to increase the distance from the screen edge at which HDRP fades out screen space reflections for a ray destination. | | **Object Thickness** | Use the slider to control the thickness of the GameObjects on screen. Because the SSR algorithm can not distinguish thin GameObjects from thick ones, this property helps trace rays behind GameObjects. The algorithm applies this property to every GameObject uniformly. | | **Quality** | Specifies the quality level to use for this effect. Each quality level applies different preset values. Unity also stops you from editing the properties that the preset overrides. If you want to set your own values for every property, select **Custom**. | @@ -68,7 +68,7 @@ HDRP uses the [Volume](Volumes.md) framework to calculate SSR, so to enable and | **Quality** | Specifies the preset HDRP uses to populate the values of the following nested properties. The options are:
• **Low**: A preset that emphasizes performance over quality.
• **Medium**: A preset that balances performance and quality.
• **High**: A preset that emphasizes quality over performance.
• **Custom**: Allows you to override each property individually.
This property only appears if you set **Mode** to **Performance**. | | **Minimum Smoothness** | See **Minimum Smoothness** in [Screen-space](#screen-space). | | **Smoothness Fade Start** | See **Smoothness Fade Start** in [Screen-space](#screen-space). | -| **Max Ray Length** | Controls the maximum length of reflection rays. The higher this value is, the more resource-intensive ray-traced reflection is if a ray doesn't find an intersection. | +| **Max Ray Length** | Controls the maximum length of reflection rays in meters. The higher this value is, the more resource-intensive ray-traced reflection is if a ray doesn't find an intersection. | | **Clamp Value** | Controls the threshold that HDRP uses to clamp the pre-exposed value. This reduces the range of values and makes the reflections more stable to denoise, but reduces quality. | | **Full Resolution** | Enable this feature to increase the ray budget to one ray per pixel, per frame. Disable this feature to decrease the ray budget to one ray per four pixels, per frame.
This property only appears if you set **Mode** to **Performance**. | | **Sample Count** | Controls the number of rays per pixel per frame. Increasing this value increases execution time linearly.
This property only appears if you set **Mode** to **Quality**. | diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Getting-Started.md b/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Getting-Started.md index b154372f2cd..7e12f25e224 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Getting-Started.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Getting-Started.md @@ -1,6 +1,6 @@ # Getting started with ray tracing -The High Definition Render Pipeline (HDRP) includes preview ray tracing support from Unity 2019.3. Ray tracing allows you to access data that is not on screen. For example, you can use it to request position data, normal data, or lighting data, and then use this data to compute quantities that are hard to approximate using classic rasterization techniques. +The High Definition Render Pipeline (HDRP) includes preview ray tracing support from Unity 2019.3. Ray tracing allows you to access data that's not on screen. For example, you can use it to request position data, normal data, or lighting data, and then use this data to compute quantities that are hard to approximate using classic rasterization techniques. This document covers: @@ -12,7 +12,7 @@ This document covers: ## Hardware requirements -Full ray tracing hardware acceleration is available on following GPUs: +Full ray tracing hardware acceleration is available on the following GPUs: - NVIDIA GeForce 20 series: - RTX 2060 - RTX 2060 Super @@ -55,9 +55,9 @@ NVIDIA also provides a ray tracing fallback for some previous generation graphic If your computer has one of these graphics cards, it can run ray tracing in Unity. -Before you open Unity, make sure to update your NVIDIA drivers to the latest version, and also make sure your Windows version is at least 1809. +Before you open Unity, make sure to update your NVIDIA drivers to the latest version, and make sure your Windows version is at least 1809. -The boolean [SystemInfo.supportsRayTracing](https://docs.unity3d.com/ScriptReference/SystemInfo-supportsRayTracing.html) can be used to validate if the current system supports ray tracing. This function checks the operating system, GPU, graphics driver and API. +You can use the Boolean [`SystemInfo.supportsRayTracing`](https://docs.unity3d.com/ScriptReference/SystemInfo-supportsRayTracing.html) to check if the current system supports ray tracing. This function checks the operating system, GPU, graphics driver and API. @@ -87,7 +87,7 @@ You can use the [Render Pipeline Wizard](Render-Pipeline-Wizard.md) to set up ra To enable ray tracing for specific effects, enable the ray tracing features in the [HDRP Asset](#ManualSetup-EnableAssetFeatures). -Your HDRP Project now supports ray tracing. For information on how to set up ray tracing for your Scene, see [final setup](#final-setup). +For information on how to set up ray tracing for your Scene, see [final setup](#final-setup). @@ -107,7 +107,7 @@ To set up ray tracing manually, you need to: HDRP enables DirextX12 by default. To enable DirectX 12 manually: -1. Open the Project Settings window (menu: **Edit > Project Settings**), then select the **Player** tab. +1. Open the Project Settings window (menu: **Edit** > **Project Settings**), then select the **Player** tab. 2. Select the **Other Settings** drop-down, and in the **Rendering** section, disable Auto Graphics API for Windows. This exposes the Graphics APIs for Windows section. 3. In the **Graphics APIs for Windows** section, click the plus (**+**) button and select **Direct3d12**. 4. Unity uses Direct3d11 by default. To make Unity use Direct3d12, move **Direct3d12 (Experimental)** to the top of the list. @@ -121,9 +121,9 @@ The Unity Editor window should now include the <DX12> tag in the title bar #### Disabling static batching -Next, you need to disable static batching, because HDRP does not support this feature with ray tracing in **Play Mode**. To do this: +Next, you need to disable static batching, because HDRP doesn't support this feature with ray tracing in **Play Mode**. To do this: -1. Open the Project Settings window (menu: **Edit > Project Settings**), then select the **Player** tab. +1. Open the Project Settings window (menu: **Edit** > **Project Settings**), then select the **Player** tab. 2. Select the **Other Settings** drop-down, then in the **Rendering** section, disable **Static Batching**. @@ -139,7 +139,7 @@ Now that Unity is running in DirectX 12, and you have disabled [static batching] #### Ray tracing resources -To verify that HDRP has properly assigned ray tracing resources: +To verify that HDRP has assigned ray tracing resources: 1. Open the Project Settings window (menu: **Edit** > **Project Settings**), then select the **HDRP Default Settings** tab. 2. Find the **Render Pipeline Resources** field and make sure there is a Render Pipeline Resources Asset assigned to it. @@ -148,7 +148,7 @@ To verify that HDRP has properly assigned ray tracing resources: #### (Optional) Enable ray-traced effects in your HDRP Asset -HDRP uses ray tracing to replace certain rasterized effects. In order to use a ray tracing effect in your Project, you must first enable the rasterized version of the effect. The four effects that require you to modify your HDRP Asset are: +HDRP uses ray tracing to replace certain rasterized effects. To use a ray tracing effect in your Project, you must first enable the rasterized version of the effect. The four effects that require you to modify your HDRP Asset are: * **Screen Space Shadows** * **Screen Space Reflections** @@ -167,7 +167,7 @@ Your HDRP Project now fully supports ray tracing. For information on how to set ### Final setup -Now that your HDRP Project supports ray tracing, there are a few steps you must complete in order to actually use it in your Scene. +Now that your HDRP Project supports ray tracing, there are steps you must complete to use it in your Scene. 1. [Frame Settings validation](#frame-settings) 2. [Build settings validation](#build-settings) @@ -199,7 +199,7 @@ To build your Project to a Unity Player, ray tracing requires that the build use #### Scene validation -To check whether it is possible to use ray tracing in a Scene, HDRP includes a menu option that validates each GameObject in the Scene. If you do not setup GameObjects correctly, this process throws warnings in the Console window. For the list of things this option checks for, see [Menu items](Menu-Items.md#other). To use it: +To check whether it's possible to use ray tracing in a Scene, HDRP includes a menu option that validates each GameObject in the Scene. If you don't setup GameObjects correctly, this process throws warnings in the Console window. For the list of things this option checks for, see [Menu items](Menu-Items.md#other). To use it: 1. Click **Edit** > **Render Pipeline** > **HD Render Pipeline** > **Check Scene Content for Ray Tracing**. 2. In the Console window (menu: **Window > General > Console**), check if there are any warnings. @@ -207,7 +207,7 @@ To check whether it is possible to use ray tracing in a Scene, HDRP includes a m ## Ray tracing effects overview -HDRP uses ray tracing to replace some of its screen space effects, shadowing techniques, and Mesh rendering techniques. +HDRP uses ray tracing to replace some of its screen space effects, shadowing techniques, and Mesh rendering techniques: - [Ray-Traced Ambient Occlusion](Ray-Traced-Ambient-Occlusion.md) replaces [screen space ambient occlusion](Override-Ambient-Occlusion.md) with a more accurate, ray-traced, ambient occlusion technique that can use off screen data. - [Ray-Traced Contact Shadows](Ray-Traced-Contact-Shadows.md) replaces [contact shadows](Override-Contact-Shadows.md) with a more accurate, ray-traced, contact shadow technique that can use off screen data. @@ -227,12 +227,12 @@ When you enable ray tracing, HDRP automatically creates a ray tracing accelerati As a result, ray tracing can change how some Meshes appear in your scene in the following ways: -- If your Mesh has a Material assigned that does not have the HDRenderPipeline tag, HDRP does not add it to the acceleration structure and does not apply any ray traced effects to the mesh as a result. -- If your Mesh has a Decal Material assigned, HDRP does not add it to the acceleration structure and the Mesh does not appear in your scene. +- If your Mesh has a Material assigned that doesn't have the HDRenderPipeline tag, HDRP doesn't add it to the acceleration structure and doesn't apply any ray traced effects to the mesh as a result. +- If your Mesh has a Decal Material assigned, HDRP doesn't add it to the acceleration structure and the Mesh doesn't appear in your scene. - If a Mesh has a combination of Materials that are single and double-sided, HDRP flags all Materials you have assigned to this mesh as double-sided. ## Ray tracing light culling -Ray tracing requires HDRP to cull lights differently to how it culls lights for rasterization. With rasterization, only lights that affect the current frustum matter. Since ray tracing uses off-screen data for effects such as reflection, HDRP needs to take into account lights that affect off screen geometry. For this reason, HDRP defines a range around the camera where it gathers light. To control this range, use the [Light Cluster](Ray-Tracing-Light-Cluster.md) Volume override. It is important to set a range that accurately represents the environment scale. A higher range makes HDRP include lights further away, but it also increases the resource intensity of light culling for ray tracing. +Ray tracing requires HDRP to cull lights differently to how it culls lights for rasterization. With rasterization, only lights that affect the current frustum matter. Since ray tracing uses off-screen data for effects such as reflection, HDRP needs to consider lights that affect off screen geometry. For this reason, HDRP defines a range around the camera where it gathers light. To control this range, use the [Light Cluster](Ray-Tracing-Light-Cluster.md) Volume override. It's important to set a range that accurately represents the environment scale. A higher range makes HDRP include lights further away, but it also increases the resource intensity of light culling for ray tracing. ## Ray tracing mode HDRP includes two ray tracing modes that define how it evaluates certain ray-traced effects. The modes are: @@ -267,25 +267,26 @@ This section contains information on the limitations of HDRP's ray tracing imple There is no support for ray tracing on platforms other than DX12 for now. HDRP ray tracing in Unity has the following limitations: -- Does not support vertex animation. -- Does not support decals. -- Does not support the volumetric part of the [fog](Override-Fog.md). -- Does not support tessellation. -- Does not support per pixel displacement (parallax occlusion mapping, height map, depth offset). -- Does not support VFX and Terrain. -- Does not have accurate culling for shadows, you may experience missing shadows in the ray traced effects. -- Does not support MSAA. -- Does not support [Graphics.DrawMesh](https://docs.unity3d.com/ScriptReference/Graphics.DrawMesh.html). -- Ray tracing is not supported when rendering [Reflection Probes](Reflection-Probe.md). -- HDRP does not support [orthographic projection](HDRP-Camera.md). If you enable orthographic projection mode, you might experience rendering problems for Transparent Materials, volumetrics and planar reflections. -- Ray Traced and Screen Space effects will not appear recursively in [Ray Traced Reflections](Ray-Traced-Reflections.md), [Ray Traced Global Illumination](Ray-Traced-Global-Illumination.md) or [Recursive Ray Tracing](Ray-Tracing-Recursive-Rendering.md). This means, for example, you will not be able to see [Screen Space Global Illumination](Override-Screen-Space-GI.md) in [ray-traced reflection](Ray-Traced-Reflections.md). + +- Doesn't support vertex animation. +- Doesn't support decals. +- Doesn't support the volumetric part of the [fog](Override-Fog.md). +- Doesn't support tessellation. +- Doesn't support per pixel displacement (parallax occlusion mapping, height map, depth offset). +- Doesn't support VFX and Terrain. +- Doesn't have accurate culling for shadows, you may experience missing shadows in the ray traced effects. +- Doesn't support MSAA. +- Doesn't support [Graphics.DrawMesh](https://docs.unity3d.com/ScriptReference/Graphics.DrawMesh.html). +- Ray tracing isn't supported when rendering [Reflection Probes](Reflection-Probe.md). +- HDRP doesn't support [orthographic projection](HDRP-Camera.md). If you enable orthographic projection mode, you might experience rendering problems for Transparent Materials, volumetrics and planar reflections. +- Ray Traced and Screen Space effects won't appear recursively in [Ray Traced Reflections](Ray-Traced-Reflections.md), [Ray Traced Global Illumination](Ray-Traced-Global-Illumination.md) or [Recursive Ray Tracing](Ray-Tracing-Recursive-Rendering.md). This means, for example, you won't be able to see [Screen Space Global Illumination](Override-Screen-Space-GI.md) in [ray-traced reflection](Ray-Traced-Reflections.md). ### Unsupported shader graph nodes for ray tracing -When building your custom shaders using shader graph, some nodes are incompatible with ray tracing. You need either to avoid using them or provide an alternative behavior using the ray tracing shader node. Here is the list of the incompatible nodes: -- DDX, DDY and DDXY nodes. -- All the nodes under Inputs > Geometry (Position, View Direction, Normal, etc.) in View Space mode. -Furthermore, Shader Graphs that use [Custom Interpolators](../../com.unity.shadergraph/Documentation~/Custom-Interpolators.md) are not supported in ray tracing. +When building your custom shaders using shader graph, some nodes are incompatible with ray tracing. You need either to avoid using them or provide an alternative behavior using the [ray tracing shader node](SGNode-Raytracing-Quality). Here is the list of the incompatible nodes: +- DDX, DDY and DDXY nodes, and NormalFromHeight nodes. +- All the nodes under **Inputs** > **Geometry** (Position, View Direction, Normal, etc.) in View Space mode. +Furthermore, Shader Graphs that use [Custom Interpolators](../../com.unity.shadergraph/Documentation~/Custom-Interpolators.md) aren't supported in ray tracing. ### Unsupported features of path tracing diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Light-Cluster.md b/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Light-Cluster.md index daba7300860..8f40149202b 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Light-Cluster.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Light-Cluster.md @@ -18,4 +18,4 @@ For ray tracing, HDRP builds an axis-aligned grid which, in each cell, stores th | **Property** | **Description** | | ------------------------ | ------------------------------------------------------------ | -| **Camera Cluster Range** | The range of the cluster grid. The cluster grid itself has its center on the Camera's position and extends in all directions because an intersection may occur outside of the Camera frustum. | +| **Camera Cluster Range** | The range of the cluster grid in meters. The cluster grid itself has its center on the Camera's position and extends in all directions because an intersection may occur outside of the Camera frustum. | diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Path-Tracing.md b/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Path-Tracing.md index 36ebded679d..be7ace2765c 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Path-Tracing.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Path-Tracing.md @@ -118,14 +118,23 @@ HDRP path tracing in Unity 2020.2 has the following limitations: - If a Mesh in your scene has a Material assigned that does not have the `HDRenderPipeline` tag, the mesh will not appear in your scene. For more information, see [Ray tracing and Meshes](Ray-Tracing-Getting-Started.md#RayTracingMeshes). - Does not support 3D Text and TextMeshPro. -- Does not support Shader Graph nodes that use derivatives (for example, a normal map that derives from a texture). -- Does not support Shader Graphs that use [Custom Interpolators](../../com.unity.shadergraph/Documentation~/Custom-Interpolators.md). - Does not support decals. - Does not support tessellation. - Does not support Tube and Disc-shaped Area Lights. - Does not support Translucent Opaque Materials. -- Does not support several of HDRP's Materials. This includes Eye, Hair, and Decal. +- Does not support several of HDRP's Materials. This includes Eye, non-physical Hair and Decal. - Does not support per-pixel displacement (parallax occlusion mapping, height map, depth offset). - Does not support MSAA. - Does not support [Graphics.DrawMesh](https://docs.unity3d.com/ScriptReference/Graphics.DrawMesh.html). - Does not support [Streaming Virtual Texturing](https://docs.unity3d.com/Documentation/Manual/svt-streaming-virtual-texturing.html). + +### Unsupported shader graph nodes for path tracing + +When building your custom shaders using shader graph, some nodes are incompatible with ray/path tracing. You need either to avoid using them or provide an alternative behavior using the [ray tracing shader node](SGNode-Raytracing-Quality). Here is the list of the incompatible nodes: +- DDX, DDY, DDXY, NormalFromHeight and HDSceneColor nodes. +- All the nodes under Inputs > Geometry (Position, View Direction, Normal, etc.) in View Space mode. +Furthermore, Shader Graphs that use [Custom Interpolators](../../com.unity.shadergraph/Documentation~/Custom-Interpolators.md) are not supported in ray/path tracing. + +### Unsupported features of ray tracing + +For information about unsupported features of ray tracing in general, see [Ray tracing limitations](Ray-Tracing-Getting-Started.md#limitations). diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Recursive-Rendering.md b/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Recursive-Rendering.md index 86e86c7e043..f182f17edd1 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Recursive-Rendering.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Recursive-Rendering.md @@ -39,7 +39,7 @@ Since recursive rendering uses an independent render pass, HDRP cannot render an | -------------- | ------------------------------------------------------------ | | **LayerMask** | Defines the layers that HDRP processes this ray-traced effect for. | | **Max Depth** | Controls the maximum number of times a ray can reflect or refract before it stops and returns the final color. Increasing this value increases execution time exponentially. | -| **Max Ray Length** | Controls the length of the rays that HDRP uses for ray tracing after the initial intersection. For the primary ray, HDRP uses the camera's near and far planes.| +| **Max Ray Length** | Controls the length of the rays in meters that HDRP uses for ray tracing after the initial intersection. For the primary ray, HDRP uses the camera's near and far planes.| | **Min Smoothness** | Defines the threshold at which reflection rays are not cast if the smoothness value of the target surface is inferior to the one defined by the parameter. | | **Ray Miss** | Determines what HDRP does when recursive rendering doesn't find an intersection. Choose from one of the following options:
•**Reflection probes**: HDRP uses reflection probes in your scene to calculate the last recursive rendering bounce.
•**Sky**: HDRP uses the sky defined by the current [Volume](Volumes.md) settings to calculate the last recursive rendering bounce.
•**Both** : HDRP uses both reflection probes and the sky defined by the current [Volume](Volumes.md) settings to calculate the last recursive rendering bounce.
•**Nothing**: HDRP does not calculate indirect lighting when recursive rendering doesn't find an intersection.

This property is set to **Both** by default. | | **Last Bounce** | Determines what HDRP does when recursive rendering lights the last bounce. Choose from one of the following options:
•**Reflection probes**: HDRP uses reflection probes in your scene to calculate the last bounce.
•**Sky**: HDRP uses the sky defined by the current [Volume](Volumes.md) settings to calculate the last recursive rendering bounce.
•**Both**: HDRP uses both reflection probes and the sky defined by the current [Volume](Volumes.md) settings to calculate the last recursive rendering bounce.
•**Nothing**: HDRP does not calculate indirect lighting when it evaluates the last bounce.

This property is set to **Both** by default. | diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Render-Pipeline-Debug-Window.md b/com.unity.render-pipelines.high-definition/Documentation~/Render-Pipeline-Debug-Window.md index 288fec3ee9c..d2baf1996d0 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Render-Pipeline-Debug-Window.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Render-Pipeline-Debug-Window.md @@ -1,58 +1,57 @@ # Rendering Debugger -The **Rendering Debugger** is a specific window for the Scriptable Render Pipeline that contains debugging and visualization tools. You can use these tools to quickly understand and solve any issues you might encounter. It contains mostly graphics-related tools but you can extend it to include tools for any other field, such as animation. The **Rendering Debugger** separates debug items into different sections as follows: +The **Rendering Debugger** is a specific window for the Scriptable Render Pipeline that contains debugging and visualization tools. You can use these tools to understand and solve any issues you might encounter. It contains graphics-related tools but you can extend it to include tools for any other field, such as animation. The **Rendering Debugger** separates debug items into the following sections: -- [Decals](#DecalsPanel) -- [Display Stats](#StatsPanel) -- [Material](#MaterialPanel) -- [Lighting](#LightingPanel) -- [Volume](#VolumePanel) -- [Rendering](#RenderingPanel) -- [Camera](#CameraPanel) +* [Decals](#DecalsPanel) +* [Display Stats](#StatsPanel) +* [Material](#MaterialPanel) +* [Lighting](#LightingPanel) +* [Volume](#VolumePanel) +* [Rendering](#RenderingPanel) +* [Camera](#CameraPanel) -![](Images/RenderPipelineDebug1.png)
*The Rendering Debugger.* +![](Images/RenderPipelineDebug1.png) +The Rendering Debugger ## Using the Rendering Debugger The Rendering Debugger window is available in the following modes: * The Editor. - * The Play mode. - * At runtime in the standalone Unity Player, on any device. The window is only available in **Development Builds**. To open the Rendering Debugger in the Editor: -* Enable **Runtime Debug Shaders** in **HDRP Global Settings** (in the menu: **Edit > Project Settings > Graphics > HDRP Settings**). +* Enable **Runtime Debug Shaders** in **HDRP Global Settings** (in the menu: **Edit** > **Project Settings** > **Graphics** > **HDRP Settings**). -* Select **Window > Analysis > Rendering Debugger**. +* Select **Window** > **Analysis** > **Rendering Debugger**. To open the window in the Play mode, or at runtime in a Development Build, use the keyboard shortcut Ctrl+Backspace (Ctrl+Delete on macOS) or press L3 and R3 (Left Stick and Right Stick) on a controller. -You can display read-only items, such as the FPS counter, independently of the **Rendering Debugger** window. When you disable the **Rendering Debugger** window, they are still visible in the top right corner of the screen. Use this functionality to track particular values without cluttering the screen. +You can display read-only items, such as the FPS counter, independently of the **Rendering Debugger** window. When you disable the **Rendering Debugger** window, they're still visible in the top right corner of the screen. Use this functionality to track particular values without cluttering the screen. -You can disable the runtime UI entirely by using the [enableRuntimeUI](https://docs.unity3d.com/Packages/com.unity.render-pipelines.core@latest/api/UnityEngine.Rendering.DebugManager.html#UnityEngine_Rendering_DebugManager_enableRuntimeUI) property. +You can disable the runtime UI entirely by using the [`enableRuntimeUI`](https://docs.unity3d.com/Packages/com.unity.render-pipelines.core@latest/api/UnityEngine.Rendering.DebugManager.html#UnityEngine_Rendering_DebugManager_enableRuntimeUI) property. ### Navigation at runtime To change the current active item: -- **Keyboard**: Use the arrow keys. -- **Xbox controller**: Use the Directional pad (D-Pad). -- **PlayStation controller**: Use the Directional buttons. +* **Keyboard**: Use the arrow keys. +* **Xbox controller**: Use the Directional pad (D-Pad). +* **PlayStation controller**: Use the Directional buttons. To change the current tab: -- **Keyboard**: Use the Page up and Page down keys (Fn + Up and Fn + Down keys respectively for MacOS). -- **Xbox controller**: Use the Left Bumper and Right Bumper. -- **PlayStation controller**: Use the L1 button and R1 button. +* **Keyboard**: Use the Page up and Page down keys (Fn + Up and Fn + Down keys respectively for MacOS). +* **Xbox controller**: Use the Left Bumper and Right Bumper. +* **PlayStation controller**: Use the L1 button and R1 button. To display the current active item independently of the debug window: -- **Keyboard**: Press the right Shift key. -- **Xbox controller**: Press the X button. -- **PlayStation controller**: Press the Square button. +* **Keyboard**: Press the right Shift key. +* **Xbox controller**: Press the X button. +* **PlayStation controller**: Press the Square button. @@ -69,25 +68,76 @@ The **Decals** panel has tools that you can use to debug [decals](Decal-Shader.m ## Display Stats panel -The **display stats** panel is only visible in play mode and can be used to debug performance issues in your project. - -| **Debug Option** | **Description** | -| ----------------- | ------------------------------------------------------------ | -| **Frame Rate** | Shows the frame rate in frames per second for the current camera view. | -| **Frame Time** | Shows the total frame time for the current camera view. | -| **RT Mode** | If ray tracing is enabled, shows the ray tracing Tier used during rendering. | -| **Count Rays** | If ray tracing is enabled, enable the checkbox to count the number of traced rays per effect (In MRays / frame). | -| **- Ambient Occlusion** | The number of rays that were traced for Ambient Occlusion (AO) computations, when RT AO is enabled. | -| **- Shadows Directional** | The number of rays that were traced for directional lights, when RT shadows are enabled. | -| **- Shadows Area** | The number of rays that were traced towards area lights, when RT shadows are enabled. | -| **- Shadows Point/Spot** | The number of rays that were traced towards punctual (point/spot) lights, when RT shadows are enabled. | -| **- Reflection Forward** | The number of rays that were traced for reflection computations using forward shading. | -| **- Reflection Deferred** | The number of rays that were traced for reflection computations using deferred shading. | -| **- Diffuse GI Forward** | The number of rays that were traced for diffuse Global Illumination (GI) computations using forward shading. | -| **- Diffuse GI Deferred** | The number of rays that were traced for diffuse Global Illumination (GI) computations using deferred shading. | -| **- Recursive** | The number of rays that were traced for diffuse Global Illumination (GI) computations when recursive RT is enabled. | -| **- Total** | The total number of rays that were traced. | -| **Debug XR Layout** | Enable the checkbox to display XR passes debug informations.
This mode is only available in the editor and development builds. | +The **display stats** panel is only visible in play mode. You can use it to debug performance issues in your project. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Debug OptionDescription
Frame RateDisplays the frame rate in frames per second for the current camera view.
Frame TimeDisplays the total frame time for the current camera view.
RT ModeIf you enable ray tracing, it displays the ray tracing Tier used during rendering.
Count RaysIf you enable ray tracing, enable the checkbox to count the number of traced rays per effect (in MRays / frame).
Ambient OcclusionThe number of rays that were traced for Ambient Occlusion (AO) computations, when you enable RT AO.
Shadows DirectionalThe number of rays that were traced for directional lights, when you enable RT shadows.
Shadows AreaThe number of rays that were traced towards area lights, when you enable RT shadows.
Shadows Point/SpotThe number of rays that were traced towards punctual (point/spot) lights, when you enable RT shadows.
Reflection ForwardThe number of rays that were traced for reflection computations using forward shading.
Reflection DeferredTThe number of rays that were traced for reflection computations using deferred shading.
Diffuse GI ForwardThe number of rays that were traced for diffuse Global Illumination (GI) computations using forward shading.
Diffuse GI DeferredThe number of rays that were traced for diffuse Global Illumination (GI) computations using deferred shading.
RecursiveThe number of rays that were traced for diffuse Global Illumination (GI) computations when you enable recursive RT.
TotalThe total number of rays that were traced.
Debug XR LayoutEnable to display XR passes debug informations.

This mode is only available in the editor and development builds.
@@ -95,21 +145,75 @@ The **display stats** panel is only visible in play mode and can be used to debu The **Material** panel has tools that you can use to visualize different Material properties. -| **Debug Option** | **Description** | -| ---------------------------- | ------------------------------------------------------------ | -| **Common Material Property** | Use the drop-down to select a Material property to visualize on every GameObject on screen. All HDRP Materials share the properties available. | -| **Material** | Use the drop-down to select a Material property to visualize on every GameObject on screen using a specific Shader. The properties available depend on the HDRP Material type you select in the drop-down. | -| **Engine** | Use the drop-down to select a Material property to visualize on every GameObject on a screen that uses a specific Shader. The properties available are the same as **Material** but are in the form that the lighting engine uses them (for example, **Smoothness** is **Perceptual Roughness**). | -| **Attributes** | Use the drop-down to select a 3D GameObject attribute, like Texture Coordinates or Vertex Color, to visualize on screen. | -| **Properties** | Use the drop-down to select a property that the debugger uses to highlight GameObjects on screen. The debugger highlights GameObjects that use a Material with the property that you select. | -| **GBuffer** | Use the drop-down to select a property to visualize from the GBuffer for deferred Materials. | -| **Material Validator** | Use the drop-down to select properties to show validation colors for.
• **Diffuse Color**: Select this option to check if the diffuse colors in your Scene adheres to an acceptable [PBR](Glossary.md#PhysicallyBasedRendering) range. If the Material color is out of this range, the debugger displays it in the **Too High Color** color if it is above the range, or in the **Too Low Color** if it is below the range.
• **Metal or SpecularColor**: Select this option to check if a pixel contains a metallic or specular color that adheres to an acceptable PBR range. If it does not, the debugger highlights it in the **Not A Pure Metal Color**.For information about the acceptable PBR ranges in Unity, see the [Material Charts documentation](https://docs.unity3d.com/Manual/StandardShaderMaterialCharts.html). | -| **- Too High Color** | Use the color picker to select the color that the debugger displays when a Material's diffuse color is above the acceptable PBR range.
This property only appears when you select **Diffuse Color** or **Metal or SpecularColor** from the **Material Validator** drop-down. | -| **- Too Low Color** | Use the color picker to select the color that the debugger displays when a Material's diffuse color is below the acceptable PBR range.
This property only appears when you select **Diffuse Color** or **Metal or SpecularColor** from the **Material Validator** drop-down. | -| **- Not A Pure Metal Color** | Use the color picker to select the color that the debugger displays if a pixel defined as metallic has a non-zero albedo value. The debugger only highlights these pixels if you enable the **True Metals** checkbox.
This property only appears when you select **Diffuse Color** or **Metal or SpecularColor** from the **Material Validator** drop-down. | -| **- Pure Metals** | Enable the checkbox to make the debugger highlight any pixels which Unity defines as metallic, but which have a non-zero albedo value. The debugger uses the **Not A Pure Metal Color** to highlight these pixels.
This property only appears when you select **Diffuse Color** or **Metal or SpecularColor** from the **Material Validator** drop-down. | -| **Override Global Material Texture Mip Bias** | Enable the checkbox to override the mipmap level bias of texture samplers in material shaders. Use the **Debug Global Material Texture Mip Bias Value** to control the mipmap level bias override.
When using this feature, be aware of the following:
• It only affects gbuffer, forward opaque, transparency and decal passes.
• It does not affect virtual texturing sampling.
• It does not affect custom passes. | -| **Debug Global Material Texture Mip Bias Value** | Use the slider to control the amount of mip bias of texture samplers in material shaders. | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Debug OptionDescription
Common Material PropertyUse the drop-down to select a Material property to visualize on every GameObject on screen. All HDRP Materials share the properties available.
MaterialUse the drop-down to select a Material property to visualize on every GameObject on screen using a specific Shader. The properties available depend on the HDRP Material type you select in the drop-down.
EngineUse the drop-down to select a Material property to visualize on every GameObject on a screen that uses a specific Shader. The properties available are the same as Material but are in the form that the lighting engine uses them (for example, Smoothness is Perceptual Roughness).
AttributesUse the drop-down to select a 3D GameObject attribute, like Texture Coordinates or Vertex Color, to visualize on screen.
PropertiesUse the drop-down to select a property that the debugger uses to highlight GameObjects on screen. The debugger highlights GameObjects that use a Material with the property that you select.
GBufferUse the drop-down to select a property to visualize from the GBuffer for deferred Materials.
Material ValidatorUse the drop-down to select properties to display validation colors for:
  • Diffuse Color: Select this option to check if the diffuse colors in your Scene adheres to an acceptable PBR range. If the Material color is out of this range, the debugger displays it in the Too High Color color if it's above the range, or in the Too Low Color if it's below the range.
  • +
  • Metal or SpecularColor: Select this option to check if a pixel contains a metallic or specular color that adheres to an acceptable PBR range. If it doesn't, the debugger highlights it in the Not A Pure Metal Color. For information about the acceptable PBR ranges in Unity, see the Material Charts documentation.
Too High ColorUse the color picker to select the color that the debugger displays when a Material's diffuse color is above the acceptable PBR range.
This property only appears when you select Diffuse Color or Metal or SpecularColor from the Material Validator drop-down.
Too Low ColorUse the color picker to select the color that the debugger displays when a Material's diffuse color is below the acceptable PBR range.
This property only appears when you select Diffuse Color or Metal or SpecularColor from the Material Validator drop-down.
Not A Pure Metal ColorUse the color picker to select the color that the debugger displays if a pixel defined as metallic has a non-zero albedo value. The debugger only highlights these pixels if you enable the True Metals checkbox.
This property only appears when you select Diffuse Color or Metal or SpecularColor from the Material Validator drop-down.
Pure MetalsEnable the checkbox to make the debugger highlight any pixels which Unity defines as metallic, but which have a non-zero albedo value. The debugger uses the Not A Pure Metal Color to highlight these pixels.
This property only appears when you select Diffuse Color or Metal or SpecularColor from the Material Validator drop-down.
Override Global Material Texture Mip BiasEnable the checkbox to override the mipmap level bias of texture samplers in material shaders. Use the Debug Global Material Texture Mip Bias Value to control the mipmap level bias override.
When using this feature, be aware of the following: +
    +
  • It only affects gbuffer, forward opaque, transparency and decal passes.
  • +
  • It doesn't affect virtual texturing sampling.
  • +
  • It doesn't affect custom passes.
  • +
Debug Global Material Texture Mip Bias ValueUse the slider to control the amount of mip bias of texture samplers in material shaders.
If the geometry or the shading normal is denormalized, the view renders the target pixel red. @@ -119,72 +223,286 @@ If the geometry or the shading normal is denormalized, the view renders the targ The **Lighting** panel has tools that you can use to visualize various components of the lighting system in your Scene, like, shadowing and direct/indirect lighting. -| **Shadow Debug Option** | **Description** | -| ----------------------- | ------------------------------------------------------------ | -| **Debug Mode** | Use the drop-down to select which shadow debug information to overlay on the screen.
•**None**: Select this mode to remove the shadow debug information from the screen.
• **VisualizePunctualLightAtlas**: Select this mode to overlay the shadow atlas for [punctual Lights](Glossary.md#PunctualLight) in your Scene.
• **VisualizeDirectionalLightAtlas**: Select this mode to overlay the shadow atlas for Directional Lights in your Scene.
• **VisualizeAreaLightAtlas**: Select this mode to overlay the shadow atlas for area Lights in your Scene.
• **VisualizeShadowMap**: Select this mode to overlay a single shadow map for a Light in your Scene.
• **SingleShadow**: Select this mode to replace the Scene's lighting with a single Light. To select which Light to isolate, see **Use Selection** or **Shadow Map Index**. | -| **- Use Selection** | Enable the checkbox to show the shadow map for the Light you select in the Scene.
This property only appears when you select **VisualizeShadowMap** or **SingleShadow** from the **Shadow Debug Mode** drop-down. | -| **- Shadow Map Index** | Use the slider to select the index of the shadow map to view. To use this property correctly, you must have at least one [Light](Light-Component.md) in your Scene that uses shadow maps. | -| **Global Scale Factor** | Use the slider to set the global scale that HDRP applies to the shadow rendering resolution. | -| **Clear Shadow Atlas** | Enable the checkbox to clear the shadow atlas every frame. | -| **Range Minimum Value** | Set the minimum shadow value to display in the various shadow debug overlays. | -| **Range Maximum Value** | Set the maximum shadow value to display in the various shadow debug overlays. | -| **Log Cached Shadow Atlas Status** | Press the button to log in the Console the list of lights placed in the the cached shadow atlas. | - -| **Lighting Debug Option** | **Description** | -| ------------------------------------- | ------------------------------------------------------------ | -| **Show Lights By Type** | Allows the user to enable or disable lights in the scene based on their type. | -| **- Directional Lights** | Enable the checkbox to see Directional Lights in your Scene. Disable this checkbox to remove Directional Lights from your Scene's lighting. | -| **- Punctual Lights** | Enable the checkbox to see [Punctual Lights](Glossary.md#PunctualLight) in your Scene. Disable this checkbox to remove Punctual Lights from your Scene's lighting. | -| **- Area Lights** | Enable the checkbox to see Area Lights in your Scene. Disable this checkbox to remove Aera Lights from your Scene's lighting. | -| **- Reflection Probes** | Enable the checkbox to see Reflection Probes in your Scene. Disable this checkbox to remove Reflection Probes from your Scene's lighting. | -| **Exposure** | Allows you to select an [Exposure](Override-Exposure.md) debug mode to use. | -| **- Debug Mode** | Use the drop-down to select a debug mode. See [Exposure](Override-Exposure.md#exposure-debug-modes) documentation for more information. | -| - **Show Tonemap curve** | Enable the checkbox to overlay the tonemap curve to the histogram debug view.
This property only appears when you select **HistogramView** from **Debug Mode**. | -| **- Center Around Exposure** | Enable the checkbox to center the histogram around the current exposure value.
This property only appears when you select **HistogramView** from **Debug Mode**. | -| **- Display RGB Histogram** | Enable the checkbox to display the Final Image Histogram as an RGB histogram instead of just luminance.
This property only appears when you select **FinalImageHistogramView** from **Debug Mode**. | -| **- Display Mask Only** | Enable the checkbox to display only the metering mask in the picture-in-picture.When disabled, the mask displays after weighting the scene color instead.
This property only appears when you select **MeteringWeighted** from **Debug Mode**. | -| **- Debug Exposure Compensation** | Set an additional exposure compensation for debug purposes. | -| **Debug Mode** | Use the drop-down to select a lighting mode to debug. For example, you can visualize diffuse lighting, specular lighting, direct diffuse lighting, direct specular lighting, indirect diffuse lighting, indirect specular lighting, emissive lighting and Directional Light shadow cascades. | -| **Hierarchy Debug Mode** | Use the drop-down to select a light type to show the direct lighting for or a Reflection Probe type to show the indirect lighting for. | -| **Light Layers Visualization** | Enable the checkbox to visualize light layers of objects in your Scene. | -| **- Use Selected Light** | Enable the checkbox to visualize objects affected by the selected light. | -| **- Switch to Light's Shadow Layers** | Enable the checkbox to visualize objects casting shadows for the selected light. | -| **- Filter Layers** | Use the drop-down to filter light layers that you want to visialize. Objects having a matching layer will be displayed in a specific color. | -| **- Layers Color** | Use the color pickers to select the display color of each light layer. | - -| **Material Overrides** | **Description** | -| ------------------------------ | ------------------------------------------------------------ | -| **Override Smoothness** | Enable the checkbox to override the smoothness for the entire Scene. | -| **- Smoothness** | Use the slider to set the smoothness override value that HDRP uses for the entire Scene. | -| **Override Albedo** | Enable the checkbox to override the albedo for the entire Scene. | -| **- Albedo** | Use the color picker to set the albedo color that HDRP uses for the entire Scene. | -| **Override Normal** | Enable the checkbox to override the normals for the entire Scene with object normals for lighting debug. | -| **Override Specular Color** | Enable the checkbox to override the specular color for the entire Scene. | -| **- Specular Color** | Use the color picker to set the specular color that HDRP uses for the entire Scene. | -| **Override Ambient Occlusion** | Enable the checkbox to override the ambient occlusion for the entire Scene. | -| **- Ambient Occlusion** | Use the slider to set the Ambient Occlusion override value that HDRP uses for the entire Scene. | -| **Override Emissive Color** | Enable the checkbox to override the emissive color for the entire Scene. | -| **- Emissive Color** | Use the color picker to set the emissive color that HDRP uses for the entire Scene. | - -| **Debug Option** | **Description** | -| ------------------------------------ | ------------------------------------------------------------ | -| **Fullscreen Debug Mode** | Use the drop-down to select a fullscreen lighting effect to debug. For example, you can visualize [Contact Shadows](Override-Contact-Shadows.md), the depth pyramid, and indirect diffuse lighting. | -| **Tile/Cluster Debug** | Use the drop-down to select an internal HDRP lighting structure to visualize on screen.
• **None**: Select this option to turn off this debug feature.
• **Tile**: Select this option to show an overlay of each lighting tile, and the number of lights in them.
• **Cluster**: Select this option to show an overlay of each lighting cluster that intersects opaque geometry, and the number of lights in them.
• **Material Feature Variants**: Select this option to show the index of the lighting Shader variant that HDRP uses for a tile. You can find variant descriptions in the *lit.hlsl* file. | -| **- Tile/Cluster Debug By Category** | Use the drop-down to select the Light type that you want to show the Tile/Cluster debug information for. The options include [Light Types](Light-Component.md), [Decals](Decal-Projector.md), and [Local Volumetric Fog](Local-Volumetric-Fog.md).
This property only appears when you select **Tile** or **Cluster** from the **Tile/Cluster Debug** drop-down. | -| **- Cluster Debug Mode** | Use the drop-down to select the visualization mode for the cluster. The options are:
**VisualizeOpaque**: Shows cluster information on opaque geometry.
**VisualizeSlice**: Shows cluster information at a set distance from the camera.
This property only appears when you select **Cluster** from the **Tile/Cluster Debug** drop-down.. | -| **- Cluster Distance** | Use this slider to set the distance from the camera at which to display the cluster slice. This property only appears when you select **VisualizeSlice** from the **Cluster Debug Mode** drop-down. | -| **Display Sky Reflection** | Enable the checkbox to display an overlay of the cube map that the current sky generates and HDRP uses for lighting. | -| **- Sky Reflection Mipmap** | Use the slider to set the mipmap level of the sky reflection cubemap. Use this to view the sky reflection cubemap's different mipmap levels.
This property only appears when you enable the **Display Sky Reflection** checkbox. | -| **Display Light Volumes** | Enable the checkbox to show an overlay of all light bounding volumes. | -| **- Light Volume Debug Type** | Use the drop-down to select the method HDRP uses to display the light volumes.
• **Gradient**: Select this option to display the light volumes as a gradient.
• **ColorAndEdge**: Select this option to display the light volumes as a plain color (a different color for each Light Type) with a red border for readability.
This property only appears when you enable the **Display Light Volumes** checkbox. | -| **- Max Debug Light Count** | Use the slider to rescale the gradient. Lower this value to make the screen turn red faster. Use this property to change the maximum acceptable number of lights for your application and still see areas in red.
This property only appears when you set the **Display Light Volumes** mode to **Gradient**. | -| **Display Cookie Atlas** | Enable the checkbox to display an overlay of the cookie atlas. | -| **- Mip Level** | Use the slider to set the mipmap level of the cookie atlas.
This property only appears when you enable the **Display Cookie Atlas** checkbox. | -| **- Clear Cookie Atlas** | Enable the checkbox to clear the cookie atlas at each frame.
This property only appears when you enable the **Display Cookie Atlas** checkbox. | -| **Display Planar Reflection Atlas** | Enable the checkbox to display an overlay of the planar reflection atlas. | -| **- Mip Level** | Use the slider to set the mipmap level of the planar reflection atlas.
This property only appears when you enable the **Display Planar Reflection Atlas** checkbox. | -| **- Clear Planar Atlas** | Enable the checkbox to clear the planar reflection atlas at each frame.
This property only appears when you enable the **Display Planar Reflection Atlas** checkbox. | -| **Debug Overlay Screen Ratio** | Set the size of the debug overlay textures with a ratio of the screen size. The default value is 0.33 which is 33% of the screen size. | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Shadow Debug OptionDescription
Debug ModeUse the drop-down to select which shadow debug information to overlay on the screen:
+
    +
  • None: Select this mode to remove the shadow debug information from the screen.
  • +
  • VisualizePunctualLightAtlas: Select this mode to overlay the shadow atlas for Punctual Lights in your Scene.
  • +
  • VisualizeDirectionalLightAtlas: Select this mode to overlay the shadow atlas for Directional Lights in your Scene.
  • +
  • VisualizeAreaLightAtlas: Select this mode to overlay the shadow atlas for area Lights in your Scene.
  • +
  • VisualizeShadowMap: Select this mode to overlay a single shadow map for a Light in your Scene.
  • +
  • SingleShadow: Select this mode to replace the Scene's lighting with a single Light. To select which Light to isolate, see Use Selection or Shadow Map Index.
  • +
Use SelectionEnable the checkbox to display the shadow map for the Light you select in the Scene.
This property only appears when you select VisualizeShadowMap or SingleShadow from the Shadow Debug Mode drop-down.
Shadow Map IndexUse the slider to select the index of the shadow map to view. To use this property correctly, you must have at least one Light in your Scene that uses shadow maps.
Global Scale FactorUse the slider to set the global scale that HDRP applies to the shadow rendering resolution.
Clear Shadow AtlasEnable the checkbox to clear the shadow atlas every frame.
Range Minimum ValueSet the minimum shadow value to display in the various shadow debug overlays.
Range Maximum ValueSet the maximum shadow value to display in the various shadow debug overlays.
Log Cached Shadow Atlas StatusSet the maximum shadow value to display in the various shadow debug overlays.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Lighting Debug OptionDescription
Show Lights By TypeAllows the user to enable or disable lights in the scene based on their type.
Directional LightsEnable the checkbox to see Directional Lights in your Scene. Disable this checkbox to remove Directional Lights from your Scene's lighting.
Punctual LightsEnable the checkbox to see Punctual Lights in your Scene. Disable this checkbox to remove Punctual Lights from your Scene's lighting.
Area LightsEnable the checkbox to see Area Lights in your Scene. Disable this checkbox to remove Aera Lights from your Scene's lighting.
Reflection ProbesEnable the checkbox to see Reflection Probes in your Scene. Disable this checkbox to remove Reflection Probes from your Scene's lighting.
ExposureAllows you to select an Exposure debug mode to use.
Debug ModeUse the drop-down to select a debug mode. See Exposure documentation for more information.
Show Tonemap curveEnable the checkbox to overlay the tonemap curve to the histogram debug view.
This property only appears when you select HistogramView from Debug Mode.
Center Around ExposureEnable the checkbox to center the histogram around the current exposure value.
This property only appears when you select HistogramView from Debug Mode.
Display RGB HistogramEnable the checkbox to display the Final Image Histogram as an RGB histogram instead of just luminance.
This property only appears when you select FinalImageHistogramView from Debug Mode.
Display Mask OnlyEnable the checkbox to display only the metering mask in the picture-in-picture. When disabled, the mask displays after weighting the scene color instead.
This property only appears when you select MeteringWeighted from Debug Mode.
Debug Exposure CompensationSet an additional exposure compensation for debug purposes.
Debug ModeUse the drop-down to select a lighting mode to debug. For example, you can visualize diffuse lighting, specular lighting, direct diffuse lighting, direct specular lighting, indirect diffuse lighting, indirect specular lighting, emissive lighting and Directional Light shadow cascades.
Hierarchy Debug ModeUse the drop-down to select a light type to display the direct lighting for or a Reflection Probe type to display the indirect lighting for.
Light Layers VisualizationEnable the checkbox to visualize light layers of objects in your Scene.
Use Selected LightEnable the checkbox to visualize objects affected by the selected light.
Switch to Light's Shadow LayersEnable the checkbox to visualize objects casting shadows for the selected light.
Filter LayersUse the drop-down to filter light layers that you want to visialize. Objects having a matching layer will be displayed in a specific color.
Layers ColorUse the color pickers to select the display color of each light layer.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Material OverridesDescription
Override SmoothnessEnable the checkbox to override the smoothness for the entire Scene.
SmoothnessUse the slider to set the smoothness override value that HDRP uses for the entire Scene.
Override AlbedoEnable the checkbox to override the albedo for the entire Scene.
AlbedoUse the color picker to set the albedo color that HDRP uses for the entire Scene.
Override NormalEnable the checkbox to override the normals for the entire Scene with object normals for lighting debug.
Override Specular ColorEnable the checkbox to override the specular color for the entire Scene.
Specular ColorUse the color picker to set the specular color that HDRP uses for the entire Scene.
Override Ambient OcclusionEnable the checkbox to override the ambient occlusion for the entire Scene.
Ambient OcclusionUse the slider to set the Ambient Occlusion override value that HDRP uses for the entire Scene.
Override Emissive ColorEnable the checkbox to override the emissive color for the entire Scene.
Emissive ColorUse the color picker to set the emissive color that HDRP uses for the entire Scene.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Debug OptionDescription
Fullscreen Debug ModeUse the drop-down to select a fullscreen lighting effect to debug. For example, you can visualize Contact Shadows, the depth pyramid, and indirect diffuse lighting.
Tile/Cluster DebugUse the drop-down to select an internal HDRP lighting structure to visualize on screen. +
    +
  • None: Select this option to disable this debug feature.
  • +
  • Tile: Select this option to display an overlay of each lighting tile, and the number of lights in them.
  • +
  • Cluster: Select this option to display an overlay of each lighting cluster that intersects opaque geometry, and the number of lights in them.
  • +
  • Material Feature Variants: Select this option to display the index of the lighting Shader variant that HDRP uses for a tile. You can find variant descriptions in the lit.hlsl file.
  • +
Tile/Cluster Debug By CategoryUse the drop-down to select the Light type that you want to display the Tile/Cluster debug information for. The options include Light Types, Decals, and Local Volumetric Fog.
This property only appears when you select Tile or Cluster from the Tile/Cluster Debug drop-down.
Cluster Debug ModeUse the drop-down to select the visualization mode for the cluster. The options are:
VisualizeOpaque: displays cluster information on opaque geometry.
VisualizeSlice: Displays cluster information at a set distance from the camera.
This property only appears when you select Cluster from the Tile/Cluster Debug drop-down..
Cluster DistanceUse this slider to set the distance from the camera at which to display the cluster slice. This property only appears when you select VisualizeSlice from the Cluster Debug Mode drop-down.
Display Sky ReflectionEnable the checkbox to display an overlay of the cube map that the current sky generates and HDRP uses for lighting.
Sky Reflection MipmapUse the slider to set the mipmap level of the sky reflection cubemap. Use this to view the sky reflection cubemap's different mipmap levels.
This property only appears when you enable the Display Sky Reflection checkbox.
Display Light VolumesEnable the checkbox to display an overlay of all light bounding volumes.
Light Volume Debug TypeUse the drop-down to select the method HDRP uses to display the light volumes. +
    +
  • Gradient: Select this option to display the light volumes as a gradient.
  • +
  • ColorAndEdge: Select this option to display the light volumes as a plain color (a different color for each Light Type) with a red border for readability.
    This property only appears when you enable the Display Light Volumes checkbox. +
Max Debug Light CountUse the slider to rescale the gradient. Lower this value to make the screen turn red faster. Use this property to change the maximum acceptable number of lights for your application and still see areas in red.
This property only appears when you set the Display Light Volumes mode to Gradient.
Display Cookie AtlasEnable the checkbox to display an overlay of the cookie atlas.
Mip LevelUse the slider to set the mipmap level of the cookie atlas.
This property only appears when you enable the Display Cookie Atlas checkbox.
Clear Cookie AtlasEnable the checkbox to clear the cookie atlas at each frame.
This property only appears when you enable the Display Cookie Atlas checkbox.
Display Planar Reflection AtlasEnable the checkbox to display an overlay of the planar reflection atlas.
Mip LevelUse the slider to set the mipmap level of the planar reflection atlas.
This property only appears when you enable the Display Planar Reflection Atlas checkbox.
Clear Planar AtlasEnable the checkbox to clear the planar reflection atlas at each frame.
This property only appears when you enable the Display Planar Reflection Atlas checkbox.
Debug Overlay Screen RatioSet the size of the debug overlay textures with a ratio of the screen size. The default value is 0.33 which is 33% of the screen size.
@@ -198,7 +516,7 @@ The **Volume** panel has tools that you can use to visualize the Volume Componen | **Camera** | Use the drop-down to select which camera to use as volume anchor. | | **Parameter** | List of parameters for the selected component. | | **Interpolated Value** | Current value affecting the choosen camera for each parameter. | -| **Other columns** | Each one of the remaining columns display the parameter values of a volume affecting the selected **Camera**. They are sorted from left to right by decreasing influence. | +| **Other columns** | Each one of the remaining columns display the parameter values of a volume affecting the selected **Camera**. They're sorted from left to right by decreasing influence. | @@ -206,12 +524,88 @@ The **Volume** panel has tools that you can use to visualize the Volume Componen The **Rendering** panel has tools that you can use to visualize various HDRP rendering features. -| **Debug Option** | **Description** | -| ----------------------------- | ------------------------------------------------------------ | -| **Fullscreen Debug Mode** | Use the drop-down to select a rendering mode to display as an overlay on the screen.
• **Motion Vectors**: Select this option to display motion vectors. Note that object motion vectors are not visible in the Scene view.
• **NaN Tracker**: Select this option to display an overlay that highlights [NaN](https://en.wikipedia.org/wiki/NaN) values.
• **ColorLog**: Select this option to show how the raw, log-encoded buffer looks before color grading takes place.
• **DepthOfFieldCoc**: Select this option to display the circle of confusion for the depth of field effect. The circle of confusion shows how much the depth of field effect blurs a given pixel/area.
• **Quad Overdraw**: Select this option to display an overlay that highlights gpu quads running multiple fragment shaders. This is mainly caused by small or thin triangles. Use LODs to reduce the amount of overdraw when objects are far away. (This mode is currently not supported on Metal and PS4).
• **Vertex Density**: Select this option to display an overlay that highlights pixels running multiple vertex shaders. A vertex can be run multiple times when part of different triangles. This helps finding models that need LODs. (This mode is currently not supported on Metal).
• **TransparencyOverdraw**: Select this option to view the number of transparent pixels that draw over one another. This represents the amount of on-screen overlapping of transparent pixel. This is useful to see the amount of pixel overdraw for transparent GameObjects from different points of view in the Scene. This debug option displays each pixel as a heat map going from black (which represents no transparent pixels) through blue to red (at which there are **Max Pixel Cost** number of transparent pixels).
• **RequestedVirtualTextureTiles**: Select this option to display what texture tile each pixel uses. Pixels that this debug view renders with the same color request the same texture tile to be streamed into video memory by the streaming virtual texturing system. This debug view is useful to see which areas of the screen use textures that the virtual texturing system steams into video memory. It can help to identify issues with the virtual texture streaming system. | -| - **Max Pixel Cost** | The scale of the transparency overdraw heat map. For example, a value of 10 displays a red pixel if 10 transparent pixels overlap. Any number of overdraw above this value also displays as red.
This property only appears if you set **Fullscreen Debug Mode** to **TransparencyOverdraw**. | -| **MipMaps** | Use the drop-down to select a mipmap streaming property to debug.
• **None**: Select this option to disable this debug feature.
• **MipRatio**: Select this option to display a heat map of pixel to texel ratio. A blue tint represents areas with too little Texture detail (the Texture is too small). A bed tint represents areas with too much Texture detail (the Texture is too large for the screen area). If the debugger shows the original colour for a pixel, this means that the level of detail is just right.
• **MipCount**: Select this option to display mip count as grayscale from black to white as the number of mips increases (for up to 14 mips, or 16K size). Red inidates Textures with more than 14 mips. Magenta indicates Textures with 0 mips or that the Shader does not support mip count.
• **MipCountReduction**: Select this option to display the difference between the current mip count and the original mip count as a green scale. A brighter green represents a larger reduction (that mip streaming saves more Texture memory). Magenta means that the debugger does not know the original mip count.
• **StreamingMipBudget**: Select this option to display the mip status due to streaming budget. Green means that streaming Textures saves some memory. Red means that mip levels are lower than is optimal, due to full Texture memory budget. White means that streaming Textures saves no memory.
• **StreamingMip**: Select this option to display the same information as **StreamingMipBudget**, but to apply the colors to the original Textures. | -| **- Terrain Texture** | Use the drop-down to select the terrain Texture to debug the mipmap for. This property only appears when you select an option other than **None** from the **MipMaps** drop-down. | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Debug OptionDescription
Fullscreen Debug ModeUse the drop-down to select a rendering mode to display as an overlay on the screen.
Motion VectorsSelect this option to display motion vectors. Note that object motion vectors aren't visible in the Scene view.
NaN TrackerSelect this option to display an overlay that highlights NaN values.
ColorLogSelect this option to display how the raw, log-encoded buffer looks before color grading takes place.
DepthOfFieldCocSelect this option to display the circle of confusion for the depth of field effect. The circle of confusion displays how much the depth of field effect blurs a given pixel/area.
Quad OverdrawSelect this option to display an overlay that highlights gpu quads running multiple fragment shaders. This is mainly caused by small or thin triangles. Use LODs to reduce the amount of overdraw when objects are far away. (This mode is currently not supported on Metal and PS4).
Vertex DensitySelect this option to display an overlay that highlights pixels running multiple vertex shaders. A vertex can be run multiple times when part of different triangles. This helps finding models that need LODs. (This mode is currently not supported on Metal).
TransparencyOverdrawSelect this option to view the number of transparent pixels that draw over one another. This represents the amount of on-screen overlapping of transparent pixel. This is useful to see the amount of pixel overdraw for transparent GameObjects from different points of view in the Scene. This debug option displays each pixel as a heat map going from black (which represents no transparent pixels) through blue to red (at which there are Max Pixel Cost number of transparent pixels).
RequestedVirtualTextureTilesSelect this option to display what texture tile each pixel uses. Pixels that this debug view renders with the same color request the same texture tile to be streamed into video memory by the streaming virtual texturing system. This debug view is useful to see which areas of the screen use textures that the virtual texturing system steams into video memory. It can help to identify issues with the virtual texture streaming system.
Max Pixel CostThe scale of the transparency overdraw heat map. For example, a value of 10 displays a red pixel if 10 transparent pixels overlap. Any number of overdraw above this value also displays as red.
This property only appears if you set Fullscreen Debug Mode to TransparencyOverdraw.
MipMapsUse the drop-down to select a mipmap streaming property to debug.
NoneSelect this option to disable this debug feature.
MipRatioSelect this option to display a heat map of pixel to texel ratio. A blue tint represents areas with too little Texture detail (the Texture is too small). A bed tint represents areas with too much Texture detail (the Texture is too large for the screen area). If the debugger displays the original color for a pixel, this means that the level of detail is just right.
MipCountSelect this option to display mip count as grayscale from black to white as the number of mips increases (for up to 14 mips, or 16K size). Red inidates Textures with more than 14 mips. Magenta indicates Textures with 0 mips or that the Shader doesn't support mip count.
MipCountReductionSelect this option to display the difference between the current mip count and the original mip count as a green scale. A brighter green represents a larger reduction (that mip streaming saves more Texture memory). Magenta means that the debugger doesn't know the original mip count.
StreamingMipBudgetSelect this option to display the mip status due to streaming budget. Green means that streaming Textures saves some memory. Red means that mip levels are lower than is optimal, due to full Texture memory budget. White means that streaming Textures saves no memory.
StreamingMipSelect this option to display the same information as StreamingMipBudget, but to apply the colors to the original Textures.
Terrain TextureUse the drop-down to select the terrain Texture to debug the mipmap for. This property only appears when you select an option other than None from the MipMaps drop-down.
| **Color Picker** | **Description** | | --------------------- | ------------------------------------------------------------ | @@ -220,15 +614,44 @@ The **Rendering** panel has tools that you can use to visualize various HDRP ren The **Color Picker** works with whichever debug mode HDRP displays at the time. This means that you can see the values of various components of the rendering like Albedo or Diffuse Lighting. By default, this displays the value of the main High Dynamic Range (HDR) color buffer. -| **Debug Option** | **Description** | -| ----------------------------- | ------------------------------------------------------------ | -| **False Color Mode** | Enable the checkbox to define intensity ranges that the debugger uses to show a color temperature gradient for the current frame. The color temperature gradient goes from blue, to green, to yellow, to red. | -| **- Range Threshold 0** | Set the first split for the intensity range.
This property only appears when you enable the **False Color Mode** checkbox. | -| **- Range Threshold 1** | Set the second split for the intensity range.
This property only appears when you enable the **False Color Mode** checkbox. | -| **- Range Threshold 2** | Set the third split for the intensity range.
This property only appears when you enable the **False Color Mode** checkbox. | -| **- Range Threshold 3** | Set the final split for the intensity range.
This property only appears when you enable the **False Color Mode** checkbox. | -| **MSAA Samples** | Use the drop-down to select the number of samples the debugger uses for [MSAA](Anti-Aliasing.md#MSAA). | -| **Freeze Camera for Culling** | Use the drop-down to select a Camera to freeze in order to check its culling. To check if the Camera's culling works correctly, freeze the Camera and move occluders around it. | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Debug OptionDescription
False Color ModeEnable the checkbox to define intensity ranges that the debugger uses to display a color temperature gradient for the current frame. The color temperature gradient goes from blue, to green, to yellow, to red.
Range Threshold 0Set the first split for the intensity range.
This property only appears when you enable the False Color Mode checkbox.
Range Threshold 1Set the second split for the intensity range.
This property only appears when you enable the False Color Mode checkbox.
Range Threshold 2Set the third split for the intensity range.
This property only appears when you enable the False Color Mode checkbox.
Range Threshold 3Set the final split for the intensity range.
This property only appears when you enable the False Color Mode checkbox.
MSAA SamplesUse the drop-down to select the number of samples the debugger uses for MSAA.
Freeze Camera for CullingUse the drop-down to select a Camera to freeze to check its culling. To check if the Camera's culling works correctly, freeze the Camera and move occluders around it.
| **Debug Option** | **Description** | @@ -239,25 +662,25 @@ The **Color Picker** works with whichever debug mode HDRP displays at the time. | **Log Frame Information** | Press the button to log in the Console informations about the passes rendered during a frame. | | **Log Resources** | Press the button to log in the Console the list of resources used when rendering a frame. | -The **NVIDIA device debug view** is a panel that shows a list of the current feature states of NVIDIA Deep Learning Super Sampling (DLSS). Each row represents an active screen in which DLSS is running. +The **NVIDIA device debug view** is a panel that displays a list of the current feature states of NVIDIA Deep Learning Super Sampling (DLSS). Each row represents an active screen in which DLSS is running. | **Information** | **Description** | | ------------------------ | ------------------ | -| **NVUnityPlugin Version**| Shows the current internal version id of the NVIDIA Unity Plugin that interacts with DLSS. | -| **NGX API Version** | Shows the actual version which DLSS operates on. | -| **Device Status** | Shows the current status of the NVIDIA driver. If an internal error occurred when initializing the driver, Unity displays the error here. | -| **DLSS Supported** | Shows **True** if your project supports DLSS at runtime. Otherwise, shows **False**. | -| **DLSS Slot ID** | Shows an internal ID for the particular DLSS view being displayed. | -| **Status** | Shows whether the view is **valid** or **invalid**. A view is invalid if there is an internal error, or if the Scriptable Render Pipeline passes incorrect parameters. | -| **Input resolution** | Shows the current input resolution. Unity calculates this from the screen percentage specified for dynamic resolution scaling. | -| **Output resolution** | Shows the target resolution for this particular DLSS view. | -| **Quality** | Shows the quality selected for this particular DLSS view. | +| **NVUnityPlugin Version**| Displays the current internal version id of the NVIDIA Unity Plugin that interacts with DLSS. | +| **NGX API Version** | Displays the actual version which DLSS operates on. | +| **Device Status** | Displays the current status of the NVIDIA driver. If an internal error occurred when initializing the driver, Unity displays the error here. | +| **DLSS Supported** | Displays **True** if your project supports DLSS at runtime. Otherwise, displays **False**. | +| **DLSS Slot ID** | Displays an internal ID for the particular DLSS view being displayed. | +| **Status** | Displays whether the view is **valid** or **invalid**. A view is invalid if there is an internal error, or if the Scriptable Render Pipeline passes incorrect parameters. | +| **Input resolution** | Displays the current input resolution. Unity calculates this from the screen percentage specified for dynamic resolution scaling. | +| **Output resolution** | Displays the target resolution for this particular DLSS view. | +| **Quality** | Displays the quality selected for this particular DLSS view. | ## Camera panels -In the **Rendering Debugger**, each active Camera in the Scene has its own debug window. Use the Camera's debug window to temporarily change that Camera's [Frame Settings](Frame-Settings.md) without altering the Camera data in the Scene. The Camera window helps you to understand why a specific feature does not work correctly. You can access all of the information that HDRP uses the render the Camera you select. +In the **Rendering Debugger**, each active Camera in the Scene has its own debug window. Use the Camera's debug window to temporarily change that Camera's [Frame Settings](Frame-Settings.md) without altering the Camera data in the Scene. The Camera window helps you to understand why a specific feature doesn't work correctly. You can access all the information that HDRP uses the render the Camera you select. **Note**: The Camera debug window is only available for Cameras, not Reflection Probes. @@ -265,16 +688,21 @@ The following columns are available for each Frame Setting: | **Column** | **Description** | | -------------- | ------------------------------------------------------------ | -| **Debug** | Displays Frame Setting values you can modify for the selected Camera. You can use these to temporarily alter the Camera’s Frame Settings for debugging purposes. You cannot enable Frame Setting features that your HDRP Asset does not support. | +| **Debug** | Displays Frame Setting values you can modify for the selected Camera. You can use these to temporarily alter the Camera’s Frame Settings for debugging purposes. You can't enable Frame Setting features that your HDRP Asset doesn't support. | | **Sanitized** | Displays the Frame Setting values that the selected Camera uses after Unity checks to see if your HDRP Asset supports them. | -| **Overridden** | Displays the Frame Setting values that the selected Camera overrides. If you do not check the **Custom Frame Settings** checkbox, check it and do not override any settings, this column is identical to the **Default** column. | +| **Overridden** | Displays the Frame Setting values that the selected Camera overrides. If you don't check the **Custom Frame Settings** checkbox, check it and don't override any settings, this column is identical to the **Default** column. | | **Default** | Displays the default Frame Setting values in your current [HDRP Asset](HDRP-Asset.md). | -Unity processes **Sanitized**, **Overridden**, and **Default** in a specific order. First it checks the **Default** Frame Settings, then checks the selected Camera’s **Overridden** Frame Settings. Finally, it checks whether the HDRP Asset supports the selected Camera’s Frame Settings and displays that result in the **Sanitized** column. +Unity processes **Sanitized**, **Overridden**, and **Default** in a specific order: + +1. It checks the **Default** Frame Settings +2. It checks the selected Camera’s **Overridden** Frame Settings. +3. It checks whether the HDRP Asset supports the selected Camera’s Frame Settings +4. It displays that result in the **Sanitized** column. ### Interpreting the Camera window ![](Images/RenderPipelineDebug2.png) -- In the image above, the **Light Layers** checkbox is disabled at the **Sanitized** step. This means that, although **Light Layers** is enabled in the Frame Settings this Camera uses, it is not enabled in the HDRP Asset’s **Render Pipeline Supported Features**. -- Also in the image above, the **Decals** checkbox is disabled at the **Overridden** step. This means that **Decals** is enabled in the default Camera Frame Settings and then **Decals** is disabled for that specific Camera’s **Custom Frame Settings**. +- In the image above, **Ray Tracing** is disabled at the **Sanitized** step, but enabled at the **Default** and **Overridden** steps. This means that, although **Ray Tracing** is enabled in the Frame Settings this Camera uses, it's not enabled in the HDRP Asset’s **Render Pipeline Supported Features**. +- Also in the image above, **Decals** is disabled at the **Overridden** step, but enabled at the **Default** step. This means that **Decals** is enabled in the default Camera Frame Settings but disabled for that specific Camera’s **Custom Frame Settings**. diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-To-HDRP.md b/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-To-HDRP.md index 3f7f86030f1..a9c6526eec3 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-To-HDRP.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-To-HDRP.md @@ -1,35 +1,21 @@ # Converting a Project from the Built-in Renderer to the High Definition Render Pipeline -The High Definition Render Pipeline (HDRP) uses a new set of [Shaders](https://docs.unity3d.com/Manual/class-Shader.html) and [lighting units](Physical-Light-Units.md), both of which are incompatible with the Built-in Renderer. To upgrade a Unity Project to HDRP, you must first convert all of your [Materials](#MaterialConversion) and Shaders, then adjust individual [Light](#LightAdjustment) settings accordingly. +The High Definition Render Pipeline (HDRP) uses a new set of [Shaders](https://docs.unity3d.com/Manual/class-Shader.html) and [lighting units](Physical-Light-Units.md), both of which are incompatible with the Built-in Renderer. To upgrade a Unity Project to HDRP, you must first convert all your [Materials](#MaterialConversion) and Shaders, then adjust individual [Light](#LightAdjustment) settings accordingly. -This document explains how to convert the **3D With Extras** template Project to HDRP, but you can use the same workflow to convert your own Project. To follow this document and upgrade the **3D With Extras** Project, create a Project that uses the **3D With Extras** template. To do this: - -1. Open the Unity Hub. - -2. In the **Projects** tab, select **New**. - -3. In the **Template** section, select **3D With Extras**. - -4. Enter a **Project Name** and set the **Location** for Unity to save the Project to. - -5. Click **Create**. - -6. The Unity Editor opens and looks like this: - -![](Images/UpgradingToHDRP1.png) +This document explains how to convert your Project to HDRP. ## Setting up HDRP Firstly, to install HDRP, add the High Definition RP package to your Unity Project: -3. Open a Unity project. +3. Open your Unity project. 2. Open the __Package Manager__ window (__Window > Package Manager__). -3. In the __Package Manager__ window, in the **Packages** field, select **Unity Registry**. +3. In the __Package Manager__ window, in the **Packages:** field, select **Unity Registry**. 4. Select **High Definition RP** from the list of packages. -5. In the bottom right corner of the Package Manager window, select __Install__. Unity installs URP into your Project. +5. In the bottom right corner of the Package Manager window, select __Install__. Unity installs HDRP into your Project. -HDRP is now available to use in your Project. Note that when you install HDRP, Unity automatically attaches two HDRP-specific components to GameObjects in your Scene. It attaches the **HD Additional Light Data** component to Lights, and the **HD Additional Camera Data** component to Cameras. If you do not set your Project to use HDRP, and any HDRP component is present in your Scene, Unity throws errors. To fix these errors, see the following instructions on how to set up HDRP in your Project. +HDRP is now available to use in your Project. Note that when you install HDRP, Unity automatically attaches two HDRP-specific components to GameObjects in your Scene. It attaches the **HD Additional Light Data** component to Lights, and the **HD Additional Camera Data** component to Cameras. If you don't set your Project to use HDRP, and any HDRP component is present in your Scene, Unity throws errors. To fix these errors, see the following instructions on how to set up HDRP in your Project. To set up HDRP, use the [HDRP Wizard](Render-Pipeline-Wizard.md). @@ -37,9 +23,9 @@ To set up HDRP, use the [HDRP Wizard](Render-Pipeline-Wizard.md). 2. In the **Configuration Checking** section, go to the **HDRP** tab and click **Fix All**. This fixes every HDRP configuration issue with your Project. -HDRP is now set up inside your Project, but your Scene does not render correctly and uses the magenta error Shader to display GameObjects. This is because GameObjects in the Scene still use Shaders made for the Built-in Renderer. To find out how to upgrade Built-in Shaders to HDRP Shaders, see the [Upgrading Materials](#MaterialConversion) section. +HDRP is now set up inside your Project, but your Scene doesn't render correctly and uses the magenta error Shader to display GameObjects. This is because GameObjects in the Scene still use Shaders made for the Built-in Renderer. To find out how to upgrade Built-in Shaders to HDRP Shaders, see the [Upgrading Materials](#MaterialConversion) section. -HDRP includes its own [implementation for post-processing](Post-Processing-Main.md) and no longer supports the Post Processing package. If you are converting the **3D With Extras** Project, or if your own Project uses the Post Processing package, remove the Post Processing package from the Project. To do this: +HDRP includes its own [implementation for post-processing](Post-Processing-Main.md) and no longer supports the Post Processing package. If your Project uses the Post Processing package, remove the Post Processing package from the Project. To do this: 1. In the Unity Editor, open the Package Manager window (menu: **Window > Package Manager**). @@ -65,9 +51,9 @@ You can find these options in either: * The Render Pipeline Wizard window, inside the **Project Migration Quick-links** section. -This process cannot automatically upgrade custom Materials or Shaders to HDRP. You must [convert custom Materials and Shaders manually](#ManualConversion). Also, since HDRP supports more height map displacement techniques and decompression options, this processes cannot upgrade heightmap related properties correctly. This means your height mapped materials may look incorrect. If you upgrade a Material that uses a heightmap, modify the Material's **Amplitude** and **Base** properties until the result more closely matches the Built-in Renderer version. +This process can't automatically upgrade custom Materials or Shaders to HDRP. You must [convert custom Materials and Shaders manually](#ManualConversion). Also, since HDRP supports more height map displacement techniques and decompression options, this processes can't upgrade heightmap related properties correctly. This means your height mapped materials may look incorrect. If you upgrade a Material that uses a heightmap, modify the Material's **Amplitude** and **Base** properties until the result more closely matches the Built-in Renderer version. -This process also cannot upgrade particle shaders. Even though HDRP does not support particle shaders, it does provide some Shader Graphs that are compatible with the [Built-in Particle System](https://docs.unity3d.com/Manual/Built-inParticleSystem.html). These Shader Graphs work in a similar way to the built-in particle shaders. To use these Shader Graphs, import the **Particle System Shader Samples** sample: +This process also can't upgrade particle shaders. Even though HDRP doesn't support particle shaders, it does provide some Shader Graphs that are compatible with the [Built-in Particle System](https://docs.unity3d.com/Manual/Built-inParticleSystem.html). These Shader Graphs work in a similar way to the built-in particle shaders. To use these Shader Graphs, import the **Particle System Shader Samples** sample: 1. Open the Package Manager window (menu: **Window > Package Manager**). 2. Find and click the **High Definition RP** entry. @@ -91,7 +77,7 @@ The Built-in Shader to HDRP Shader conversion process combines the different det ## Adjusting lighting -HDRP uses [physical Light units](Physical-Light-Units.md) to control the intensity of Lights. These units do not match the arbitrary units that the Built-in render pipeline uses. +HDRP uses [physical Light units](Physical-Light-Units.md) to control the intensity of Lights. These units don't match the arbitrary units that the Built-in render pipeline uses. For light intensity units, directional Lights use [Lux](Physical-Light-Units.md#Lux) and all other Lights can use [Lumen](Physical-Light-Units.md#Lumen), [Candela](Physical-Light-Units.md#Candela), [EV](Physical-Light-Units.md#EV), or simulate Lux at a certain distance. @@ -113,20 +99,20 @@ To set up lighting in your HDRP Project: 2. Create a new Volume Profile for this Volume. To do this, open the Inspector for the Volume and click the **New** button. 3. Add a **Shadows** override (**Add Override > Shadowing > Shadows**), then enable **Max Distance** and set it to **50**. -4. On the Light that represents the Sun (which is the Light component on the **Directional Light** GameObject), set the **Intensity** to **100000** and the **Color** to white. Then, to see the sun in the sky, go to the **Shape** section and set the **Angular Diameter** to **3**. -5. The Scene is now over-exposed. To fix this, select the **Global Settings** GameObject you created in step **3a** and add an **Exposure** override to its Volume component (**Add Override > Exposure**). Then, set the **Mode** to **Automatic**. +4. On a Light component that represents the Sun, set the **Intensity** to **100000** and the **Color** to white. Then, to see the sun in the sky, go to the **Shape** section and set the **Angular Diameter** to **3**. +5. The Scene is now over-exposed. To fix this, select the **Global Settings** GameObject you created in step **3** and add an **Exposure** override to its Volume component (**Add Override > Exposure**). Then, set the **Mode** to **Automatic**. 6. To refresh the exposure, go to the Scene view and enable **Animate Materials**. ![](Images/UpgradingToHDRP2.png) 7. Correct the Light cookie, because HDRP supports colored light cookies, and the Built-in light cookies use a texture format that only contains alpha: - 1. In the Project window, select **Assets > ExampleAssets> Textures > Light_Cookies > Spotlight_Cookie**. + 1. In the Project window, select your Light cookie from your **Assets** folder. 2. In the Inspector, change the import type from **Cookie** to **Default**. 3. Set the **Wrap Mode** to **Clamp**. . -8. Correct the construction Light: - 1. In the Hierarchy window, select **ExampleAssets > Props > ConstructionLight > Spot Light** and view the Light component in the Inspector. +8. Correct spot lights: + 1. In the Hierarchy window, select a spot light and view the Light component in the Inspector. - 2. Change the **Intensity** to **17000** **Lumen**. This is to represent two 8500 Lumen light bulbs. + 2. Change the **Intensity** to **17000** **Lumen** to represent two 8500 Lumen light bulbs. 3. In the **Emission** section, enable [additional properties](More-Options.md). @@ -135,21 +121,21 @@ To set up lighting in your HDRP Project: 1. In the Project window, select **Assets/ExampleAssets/Materials/Lightbulb_Mat.mat**. 2. In the **Emission Inputs** section of the Inspector, enable **Use Emission Intensity**, set **Emissive Color** to white, and set the **Emission Intensity** to **8500 Luminance**. -10. Finally, if you disabled **Auto Generate** in step **2d**, go to the Lighting window and press the **Generate Lighting** button. You can also re-enable **Auto Generate**. +10. Finally, if you disabled **Auto Generate** in step **2**, go to the Lighting window and press the **Generate Lighting** button. You can also re-enable **Auto Generate**. ## Post-processing -HDRP no longer supports the **Post Processing** package and instead includes its own [implementation for post-processing](Post-Processing-Main.md). To convert the Scene to HDRP post-processing: +HDRP no longer supports the **Post Processing** package and instead includes its own [implementation for post-processing](Post-Processing-Main.md). If your Project used the Post Processing package's Scripting API to edit post-processing effects, you need to update your scripts to work with the new post-processing effects. To convert the Scene to HDRP post-processing: -1. In the Hierarchy, delete the **Post-process Volume** GameObject. - - 1. If your Project used the Post Processing package's Scripting API to edit post-processing effects, you need to update your scripts to work with the new post-processing effects. -2. Create a new **Global Volume** GameObject (menu: **GameObject > Volume > Global Volume**) and name it "**Post-processes**". You can find all the post processes in the **Post-processing** sub-menu when you select **Add Override** in the Volume Inspector. +1. In the Hierarchy, delete your post-processing GameObject. +2. Create a new **Global Volume** GameObject (menu: **GameObject > Volume > Global Volume**) and name it "Post-processes". You can find all the post processes in the **Post-processing** sub-menu when you select **Add Override** in the Volume Inspector. 3. Add a **Tonemapping** override to the Volume (**Add Override > Post-processing > Tonemapping**) then enable **Mode** and set it to **ACES**. 4. Add a **Bloom** override to the Volume (**Add Override > Post-processing > Bloom**) then enable **Intensity** and set it to **0.2**. - Note that the result of the bloom is not the same as the one in the Post Processing package. This is because HDRP's bloom effect is physically accurate, and mimics the quality of a camera lens. + +**Note**: The result of the bloom isn't the same as the one in the Post Processing package. This is because HDRP's bloom effect is physically accurate, and mimics the quality of a camera lens. + 5. Add a **Motion Blur** override to the Volume (**Add Override > Post-processing > Motion Blur**) then enable **Intensity** and set it to **0.1**. 6. Add a **Vignette** override to the Volume (**Add Override > Post-processing > Vignette**) then set the following property values. @@ -163,12 +149,5 @@ HDRP no longer supports the **Post Processing** package and instead includes its 2. In the **Near Blur** section, enable **Start** and set it to **0** then enable **End** and set it to 0.5 - 3. In the **Far Blur** section, enable **Start** and set it to **2** then enable **End** and set it to **10**. - Note that this effect is only visible in the Game view. -8. Finally, select the **Global Settings** GameObject to view it in the Inspector. In the Volume component, add an **Ambient** **Occlusion** override (**Add Override > Lighting > Ambient Occlusion**), then enable **Intensity** and set it to **0.5**. - -## Result - -Now the Scene in the Game view should look like this: - -![](Images/UpgradingToHDRP3.png) + 3. In the **Far Blur** section, enable **Start** and set it to **2** then enable **End** and set it to **10**. This effect is only visible in the Game view. +8. Select the **Global Settings** GameObject to view it in the Inspector. In the Volume component, add an **Ambient** **Occlusion** override (**Add Override > Lighting > Ambient Occlusion**), then enable **Intensity** and set it to **0.5**. diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-from-2019.2-to-2019.3.md b/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-from-2019.2-to-2019.3.md index bc98467b06f..7aa0a8b086c 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-from-2019.2-to-2019.3.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-from-2019.2-to-2019.3.md @@ -4,22 +4,20 @@ In the High Definition Render Pipeline (HDRP), some features work differently be ## New Scene -New Scene system in HDRP rely on a prefab in your project. It also depend on default settings set for the Volumes. If you already have configured one with the Wizard, you need to update it regarding the **Default Volume Profile Asset** (in **Edit > Project Settings > HDRP Default Settings**). +The New Scene system in HDRP relies on a Prefab in your project. It also depends on default settings set for the Volumes. If you have already configured one with the Wizard, you need to update it regarding the **Default Volume Profile Asset** (in **Edit > Project Settings > HDRP Default Settings**). -If you use default prefab (the one created by the wizard) and rely on default **Default Volume Profile Asset**, then your prefab will not be sync anymore with the default volume profile and you must update it. +If you use the default Prefab (the one created by the wizard) and rely on the default **Default Volume Profile Asset**, then your Prefab won't be in sync with the default volume profile and you must update it. -The easiest way is to ask the Wizard to recreate a new one: +The easiest way is to recreate a new one using the Wizard: 1. Open the Wizard (**Window > Rendering > HDRP Wizard**) -2. Remove the prefab set in **Default Scene Prefab**. -3. [*Optional*] Keep a copy of your previous prefab if it have been customized to not lost your version. To do so, just rename the prefab. It will prevent to be overridden. +2. Remove the Prefab set in **Default Scene Prefab**. +3. [*Optional*] Keep a copy of your previous Prefab if you have customized it, so you don't lose your version. To do so, rename the Prefab. It will prevent the Prefab being overridden. 4. Look at the **Configuration Checking** below for the line **Default Scene Prefab** and click on the **Fix** button. -5. [*Optional*] Report your custom change in the new created prefab. +5. [*Optional*] Report your custom change in the new created Prefab. Then repeat this for **Default DXR Scene Prefab** if you were also using DXR. -New Scene system in HDRP rely on a prefab in your project. If you have already configured one with the Wizard, you need to update it. - ## Procedural Sky @@ -33,7 +31,7 @@ To install the Procedural Sky override into a 7.x Project: 3. In the **Samples** section, click on the **Import in project** button for the **Procedural Sky** entry. If you have a Scene open that uses the Procedural Sky, the sky re-appears, but its settings are reset to the default values. 4. To recover your sky settings, you must quit Unity without saving and then re-open your Project. -The last step is important because, if you haven't installed the sample and load a Scene that uses a Procedural Sky, then the Procedural Sky data in the Volume is lost. Unity does not serialize this so you can close and re-open Unity to recover your settings. +The last step is important because, if you haven't installed the sample and load a Scene that uses a Procedural Sky, then the Procedural Sky data in the Volume is lost. Unity doesn't serialize this so you can close and re-open Unity to recover your settings. ## Sky Intensity Mode @@ -60,18 +58,18 @@ Before 7.x, HDRP synchronized the width and height of an area [Light](Light-Comp ## Cookie textures (Spot, Area and Directional lights) and Planar Reflection Probes -Before 7.x, we stored cookies of Spot, Area and directional lights and planars into texture arrays. Due to the usage of these arrays, we were limited to use the same size for every element in one array. For cookie textures, a convertion code ensured that if a texture size wasn't exatcly the same as the size of the texture array (defined in the HDRP asset), then it was scaled to fit the size of the array. +Before 7.x, we stored cookies of Spot, Area, and directional lights and planars into texture arrays. Due to the usage of these arrays, we were limited to use the same size for every element in one array. For cookie textures, a convertion code ensured that if a texture size wasn't exatcly the same as the size of the texture array (defined in the HDRP asset), then it was scaled to fit the size of the array. Now that we're using an atlas we don't have this limitation anymore. It means that the cookie size you were using might differ now that we use the real size of the texture and could result in more sharp / pixelated cokies if your texture were too big or too small. If you encounter this kind of issue, we recommend fixing the images directly. For Planar Reflection Probes it also means that you can use different resolution per probe. -You may also encounter this error in the console: `No more space in the 2D Cookie Texture Atlas. To solve this issue, increase the resolution of the cookie atlas in the HDRP settings.` This means that there is no space left in the Cookie atlas because there are too many of them in the view or the cookie textures are too big. To solve this issue you can either lower the resolution of the cookie textures or increase the atlas resolution in the HDRP settings. +You may also encounter this error in the console: `No more space in the 2D Cookie Texture Atlas. To solve this issue, increase the resolution of the cookie atlas in the HDRP settings.` This means that there is no space left in the Cookie atlas because there are too many of them in the view or the cookie textures are too big. To solve this issue you can either lower the resolution of the cookie textures or increase the atlas resolution by going to **Edit** > **Project Settings** > **Quality** > **HDRP** > **DefaultHDRPAsset** > **Lighting** > **Cookies** > **2D Atlas Size**. ## Max Smoothness, Emission Radius, Bake Shadows Radius and Bake Shadows Angle Before 7.x, Max Smoothness, Emission Radius, and Bake Shadows Radius were separate controls for Point and Spot Lights. From 7.x, the UI displays a single property, called **Radius** that controls all of the properties mentioned above. Also, Max Smoothness, Angular Diameter, and Bake Shadows Angle were separate controls for Directional Lights. The UI now displays a single property, called **Angular Diameter**, that controls all the mentioned above. -When upgrading, a slight shift of highlight shape or shadow penumbra size can occur. This happens if you set the original properties to values that do not match what the automatic conversion from "Radius" or "Angular Diameter" results in. +When upgrading, a slight shift of highlight shape or shadow penumbra size can occur. This happens if you set the original properties to values that don't match what the automatic conversion from "Radius" or "Angular Diameter" results in. ## Realtime GI Enlighten @@ -96,7 +94,7 @@ From 7.x, there is no Render Settings shorcut in the context menu to create pre- ## HDRP Configuration Package -From 7.x, HDRP has an additional small package as a dependency. This is the HDRP-Config package. You can change properties in this package to disable or tweak features that you cannot control dynamically in HDRP’s UI. Currently, this include: +From 7.x, HDRP has an additional small package as a dependency. This is the HDRP-Config package. You can change properties in this package to disable or tweak features that you can't control dynamically in HDRP’s UI. Currently, this include: * Selecting the Shadow Filtering quality when in Deferred Mode. * Camera Relative Rendering. * Raytracing. @@ -114,10 +112,10 @@ To do this, Unity opens a prompt when you begin the upgrade, asking if you want When you enter Play Mode in a Scene with baked Probes authored prior to 7.x, you may encounter a warning about a missing Script for a GameObject named **SceneIDMap**. To fix this, load the Scene in the Unity Editor and select **Edit > Render Pipeline > Fix Warning 'referenced script in (Game Object 'SceneIDMap') is missing' in loaded scenes**. -## Light Intensity and Sky Exposure versus HDRP Default Settings. +## Light Intensity and Sky Exposure versus HDRP Default Settings By default, HDRP uses physically correct intensities for Lights. Because of this, the exposure of the default HDRI sky present in HDRP is set to **11** to match a Directional Light intensity of **10000**. For reference, you can find similar values in the template Project. -When the HDRP Wizard has been set up correctly, if you create a new Scene, Unity automatically creates GameObjects with the correct intensities so that everything is coherent. However, if the HDRP Wizard is not set up correctly, or if you create Directional Lights from scratch, the intensity is not physically correct. The consequence is that the Light does not match the default sky exposure and thus, any GameObject in the Scene looks black because of the automatic exposure compensating for the overly bright sky. +When the HDRP Wizard has been set up correctly, if you create a new Scene, Unity automatically creates GameObjects with the correct intensities so that everything is coherent. However, if the HDRP Wizard isn't set up correctly, or if you create Directional Lights from scratch, the intensity isn't physically correct. The consequence is that the Light doesn't match the default sky exposure, so any GameObject in the Scene looks black because of the automatic exposure compensating for the overly bright sky. To avoid this, make sure that you use coherent values for light intensity compared to the current sky exposure. ## Iridescence color space diff --git a/com.unity.render-pipelines.high-definition/Documentation~/VR-Overview.md b/com.unity.render-pipelines.high-definition/Documentation~/VR-Overview.md index ff94ec36f9c..19b06553734 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/VR-Overview.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/VR-Overview.md @@ -6,8 +6,8 @@ Please refer to [Unity XR](https://docs.unity3d.com/Manual/XR.html) documentatio ## Recommended Settings -HDRP has been designed to fully support Single-Pass Instanced mode. This mode gives you the best performance on all platforms. -HDRP also supports multi-pass but this is slower on the CPU and some features, like Auto-Exposure, can cause issues. +Unity has designed HDRP to fully support Single-Pass Instanced mode. This mode gives you the best performance on all platforms. +HDRP also supports multi-pass but this is slower on the CPU and some features, like Auto Exposure, can cause issues. If you encounter a problem with a specific feature, you can disable it in your Project’s [HDRP Asset](HDRP-Asset.md). You can also watch the presentation from Unite Copenhagen (October 2019) to learn more tips: [Maximizing visual fidelity in VR: HDRP support](https://youtu.be/_WkSAn55EBM) @@ -21,19 +21,20 @@ You can also watch the presentation from Unite Copenhagen (October 2019) to lear * PlayStationVR * Open VR* -Note: Valve is currently developing their OpenVR Unity XR plugin for 2019.3 and beyond. +**Note**: Valve is currently developing their OpenVR Unity XR plugin for 2019.3 and beyond. For more information, see [Unity XR platform updates](https://blogs.unity3d.com/2020/01/24/unity-xr-platform-updates/) on the Unity blog, and [XR Plugin Architecture](https://docs.unity3d.com/Manual/XRPluginArchitecture.html) in the Unity Manual. The XR Plugin architecture links to the OpenVR desktop package and has further info and recommendations. ## Resolution Control -There are multiple methods that you can use to control the resolution of your render targets in HDRP, but be aware that HDRP does not support every method available in standard Unity using the built-in render pipeline. [XRSettings.renderViewportScale](https://docs.unity3d.com/ScriptReference/XR.XRSettings-renderViewportScale.html) has no effect in HDRP and generates a warning if you use it. Use one of the following methods instead: +There are multiple methods that you can use to control the resolution of your render targets in HDRP, but be aware that HDRP doesn't support every method available in standard Unity using the built-in render pipeline. [XRSettings.renderViewportScale](https://docs.unity3d.com/ScriptReference/XR.XRSettings-renderViewportScale.html) has no effect in HDRP and generates a warning if you use it. Use one of the following methods instead: * **Dynamic Resolution**: You can use the [dynamic resolution system](Dynamic-Resolution.md) to change the resolution at runtime. This is the best method to use if you want to change the resolution at runtime. * **Eye Texture**: You can set the device back-buffer resolution by changing [XRSettings.eyeTextureResolutionScale](https://docs.unity3d.com/ScriptReference/XR.XRSettings-eyeTextureResolutionScale.html). This is a resource intensive operation that reallocates all render targets. -Be aware that SteamVR will apply a default 150% supersampling value. You can change this value in the settings of SteamVR.? +Be aware that SteamVR will apply a default 150% supersampling value. You can change this value in the settings of SteamVR. + ## Enable VR single-pass after startup -Due to some technical limitations that will be resolved in later versions, you need the following code in your script if your app does not boot directly in VR mode: +**Note**: Due to some technical limitations that Unity will resolve in later versions of HDRP, you need the following code in your script if your app doesn't boot directly in VR mode: ```csharp private void Awake() @@ -46,6 +47,6 @@ private void Awake() You can use the following defines to include or exclude code from your scripts. -* ENABLE_VR: The C++ side of the engine sets this define to indicate if the platform supports VR. +* ENABLE_VR: The C++ side of the engine sets this define to specify if the platform supports VR. * ENABLE_VR_MODULE: Unity sets this define if your Project includes the [built-in VR module com.unity.modules.vr](https://docs.unity3d.com/Manual/upm-ui-disable.html). * ENABLE_XR_MODULE: Unity sets this define if your Project includes the [built-in XR module com.unity.modules.xr](https://docs.unity3d.com/Manual/upm-ui-disable.html). diff --git a/com.unity.render-pipelines.high-definition/Documentation~/hdrp-custom-material-inspector.md b/com.unity.render-pipelines.high-definition/Documentation~/hdrp-custom-material-inspector.md index d477f7abddc..eb056bd5097 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/hdrp-custom-material-inspector.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/hdrp-custom-material-inspector.md @@ -1,6 +1,6 @@ # HDRP custom Material Inspectors -Custom Material Inspectors allow you to define how Unity displays properties in the Material Inspector for a particular shader. The High Definition Render Pipeline (HDRP) makes heavy use of this feature to make the editing experience for all of its shaders as simple and intuitive as possible. +Custom Material Inspectors allow you to define how Unity displays properties in the Material Inspector for a particular shader. The High Definition Render Pipeline (HDRP) makes heavy use of this feature to make the editing experience for all its shaders as simple and intuitive as possible. This page contains information about how to create custom Material Inspectors in HDRP. For general information about what custom Material Inspectors are and how to assign one to a material, see [custom Material Inspector](https://docs.unity3d.com/Packages/com.unity.render-pipelines.core@latest?subfolder=/manual/custom-material-inspector.html). @@ -61,11 +61,13 @@ class ColorUIBlock : MaterialUIBlock ``` -This code sample fetches the `_MyColor` property in the shader and displays it. Note that if the Custom Material Inspector is for a Shader Graph, for the UI block to find the property, you must set the correct reference name in the Shader Graph's Node Settings. To do this: +This code sample fetches the `_MyColor` property in the shader and displays it. + +**Note**: If the Custom Material Inspector is for a Shader Graph, for the UI block to find the property, you must set the correct reference name in the Shader Graph's Node Settings. To do this: 1. Open the Shader Graph. 2. Select the property to display and view it in the Node Settings tab of the Graph Inspector. -3. Set **Reference** to the name `FindProperty` uses. In this example, it is **_MyColor**. +3. Set **Reference** to the name `FindProperty` uses. In this example, it's **_MyColor**. ![](Images/custom-material-inspector-node-settings-example.png) @@ -75,7 +77,7 @@ The following image shows how the Inspector looks for the UI block in the code s #### Implementing a foldout section -By default, UI blocks are not nested in a foldout. The foldouts in other HDRP Material Inspectors use the `MaterialHeaderScope` class. This class specifies the name of the header and whether the section is expanded or not. For an example of how to implement a UI block in a foldout, see the following code sample: +By default, UI blocks aren't nested in a foldout. The foldouts in other HDRP Material Inspectors use the `MaterialHeaderScope` class. This class specifies the name of the header and whether the section is expanded or not. For an example of how to implement a UI block in a foldout, see the following code sample: ```CSharp @@ -109,9 +111,9 @@ class ColorUIBlock : MaterialUIBlock ``` -Note that to track whether the foldout is expanded or not, `MateralHeaderScope` uses an `ExpandableBit`. To assign the `ExpandableBit`, this UI block example has a constructor that takes an ExpandableBit as a parameter. Because Unity serializes the state of each foldout in Editor preferences, you should use the `User[0..19]` part of the ExpandableBit enum to avoid overlap with built-in reserved bits. For an example of how to do this, see the code sample in [Custom Lit Material Inspector](#custom-lit-material-inspector). +**Note**: To track whether the foldout is expanded or not, `MateralHeaderScope` uses an `ExpandableBit`. To assign the `ExpandableBit`, this UI block example has a constructor that takes an ExpandableBit as a parameter. Because Unity serializes the state of each foldout in Editor preferences, you should use the `User[0..19]` part of the ExpandableBit enum to avoid overlap with built-in reserved bits. For an example of how to do this, see the code sample in [Custom Lit Material Inspector](#custom-lit-material-inspector). -You can also hardcode the bit in a UI block but this is not best practice especially if you intend to create a lot of UI blocks that multiple materials share. +You can also hardcode the bit in a UI block but this isn't best practice especially if you intend to create a lot of UI blocks that multiple materials share. The following image shows how the Inspector looks for the UI block in the above code sample. @@ -243,6 +245,6 @@ public class ScratchInspectorExample : HDShaderGUI ``` -Note that `HDShaderGUI` directly inherits from `ShaderGUI`, which means you can override `ShaderGUI` functions such as `OnMaterialPreviewGUI`. The only function you cannot override is `OnGUI` because `HDShaderGUI` seals it. Instead, override the `OnMaterialGUI` function. +**Note**: `HDShaderGUI` directly inherits from `ShaderGUI`, which means you can override `ShaderGUI` functions such as `OnMaterialPreviewGUI`. The only function you can't override is `OnGUI` because `HDShaderGUI` seals it. Instead, override the `OnMaterialGUI` function. -The `ValidateMaterial` function is very important because it ensures that the Material uses the correct keyword setup. HDRP stores the Material state in the properties themselves, this function reads these properties and then sets up the shader keywords these properties require. For example, if you enable the `doubleSidedEnable` property on a Material, HDRP requires the `_DOUBLESIDED_ON` shader keyword otherwise the material does not work. `HDShaderUtils.ResetMaterialKeywords` enables/disables this shader keyword based on the value of the `doubleSidedEnable` property. +The `ValidateMaterial` function is important because it ensures that the Material uses the correct keyword setup. HDRP stores the Material state in the properties themselves, this function reads these properties and then sets up the shader keywords these properties require. For example, if you enable the `doubleSidedEnable` property on a Material, HDRP requires the `_DOUBLESIDED_ON` shader keyword otherwise the material doesn't work. `HDShaderUtils.ResetMaterialKeywords` enables/disables this shader keyword based on the value of the `doubleSidedEnable` property. diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/DiffusionProfileOverrideEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/DiffusionProfileOverrideEditor.cs index caea11d3551..ec8425ac1cf 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/DiffusionProfileOverrideEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/DiffusionProfileOverrideEditor.cs @@ -14,7 +14,6 @@ namespace UnityEditor.Rendering.HighDefinition sealed class DiffusionProfileOverrideEditor : VolumeComponentEditor { SerializedDataParameter m_DiffusionProfiles; - Volume m_Volume; DiffusionProfileSettingsListUI listUI = new DiffusionProfileSettingsListUI(); @@ -23,8 +22,6 @@ sealed class DiffusionProfileOverrideEditor : VolumeComponentEditor public override void OnEnable() { var o = new PropertyFetcher(serializedObject); - - m_Volume = (m_Inspector.target as Volume); m_DiffusionProfiles = Unpack(o.Find(x => x.diffusionProfiles)); } @@ -36,7 +33,7 @@ public override void OnInspectorGUI() // If the volume is null it means that we're editing the component from the asset // So we can't access the bounds of the volume to fill diffusion profiles used in the volume - if (m_Volume != null && !m_Volume.isGlobal) + if (volume != null && !volume.isGlobal) { if (GUILayout.Button("Fill Profile List With Scene Materials")) FillProfileListWithScene(); @@ -54,10 +51,10 @@ void DrawDiffusionProfileElement(SerializedProperty element, Rect rect, int inde void FillProfileListWithScene() { var profiles = new HashSet(); - if (m_Volume.isGlobal) + if (volume.isGlobal) return; - var volumeCollider = m_Volume.GetComponent(); + var volumeCollider = volume.GetComponent(); // Get all mesh renderers that are within the current volume var diffusionProfiles = new List(); diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightExplorerExtension.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightExplorerExtension.cs index a1c16d1e4d1..94c2fe7f265 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightExplorerExtension.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightExplorerExtension.cs @@ -241,7 +241,8 @@ protected virtual LightingExplorerTableColumn[] GetHDLightColumns() new LightingExplorerTableColumn(LightingExplorerTableColumn.DataType.Checkbox, HDStyles.ColorTemperatureMode, "m_UseColorTemperature", 150), // 6: Color Temperature Mode new LightingExplorerTableColumn(LightingExplorerTableColumn.DataType.Float, HDStyles.ColorTemperature, "m_ColorTemperature", 120, (r, prop, dep) => // 7: Color Temperature { - using (new EditorGUI.DisabledScope(!prop.serializedObject.FindProperty("m_UseColorTemperature").boolValue)) + // Sometimes during scene transition, the target object can be null, causing exceptions. + using (new EditorGUI.DisabledScope(prop.serializedObject.targetObject == null || !prop.serializedObject.FindProperty("m_UseColorTemperature").boolValue)) { EditorGUI.PropertyField(r, prop, GUIContent.none); } @@ -839,7 +840,7 @@ protected virtual LightingExplorerTableColumn[] GetVolumeColumns() { new LightingExplorerTableColumn(LightingExplorerTableColumn.DataType.Checkbox, HDStyles.Enabled, "m_Enabled", 60), // 0: Enabled new LightingExplorerTableColumn(LightingExplorerTableColumn.DataType.Name, HDStyles.Name, null, 200), // 1: Name - new LightingExplorerTableColumn(LightingExplorerTableColumn.DataType.Enum, HDStyles.VolumeMode, "isGlobal", 75, (r, prop, dep) => // 2: Is Global + new LightingExplorerTableColumn(LightingExplorerTableColumn.DataType.Enum, HDStyles.VolumeMode, "m_IsGlobal", 75, (r, prop, dep) => // 2: Is Global { if (!TryGetAdditionalVolumeData(prop, out var volumeData)) { diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs index 1aa91e6db26..8200bb4fefe 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs @@ -1051,7 +1051,8 @@ static void DrawShadowMapContent(SerializedHDLight serialized, Editor owner) { HDLightEditor editor = owner as HDLightEditor; var additionalLightData = editor.GetAdditionalDataForTargetIndex(0); - if (!HDCachedShadowManager.instance.LightHasBeenPlacedInAtlas(additionalLightData)) + // If the light was registered, but not placed it means it doesn't fit. + if (additionalLightData.lightIdxForCachedShadows >= 0 && !HDCachedShadowManager.instance.LightHasBeenPlacedInAtlas(additionalLightData)) { string warningMessage = "The shadow for this light doesn't fit the cached shadow atlas and therefore won't be rendered. Please ensure you have enough space in the cached shadow atlas. You can use the light explorer (Window->Rendering->Light Explorer) to see which lights fit and which don't.\nConsult HDRP Shadow documentation for more information about cached shadow management."; // Loop backward in "tile" size to check diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDScreenSpaceReflectionEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDScreenSpaceReflectionEditor.cs index dd771289ebd..efdbb17199e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDScreenSpaceReflectionEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDScreenSpaceReflectionEditor.cs @@ -93,7 +93,7 @@ public override void OnEnable() static public readonly GUIContent k_EnabledTransparent = EditorGUIUtility.TrTextContent("Enabled (Transparent)", "Enable Transparent Screen Space Reflections"); static public readonly GUIContent k_Algo = EditorGUIUtility.TrTextContent("Algorithm", "The screen space reflection algorithm used."); static public readonly GUIContent k_TracingText = EditorGUIUtility.TrTextContent("Tracing", "Controls the technique used to compute the reflection.Controls the technique used to compute the reflections. Ray marching uses a ray-marched screen-space solution, Ray tracing uses a hardware accelerated world-space solution. Mixed uses first Ray marching, then Ray tracing if it fails to intersect on-screen geometry."); - static public readonly GUIContent k_ReflectSkyText = EditorGUIUtility.TrTextContent("Reflect Sky", "When enabled, SSR handles sky reflection."); + static public readonly GUIContent k_ReflectSkyText = EditorGUIUtility.TrTextContent("Reflect Sky", "When enabled, SSR handles sky reflection for opaque objects (not supported for SSR on transparent)."); static public readonly GUIContent k_LayerMaskText = EditorGUIUtility.TrTextContent("Layer Mask", "Layer mask used to include the objects for ray traced reflections."); static public readonly GUIContent k_RayMissFallbackHierarchyText = EditorGUIUtility.TrTextContent("Ray Miss", "Controls the order in which fall backs are used when a ray misses."); static public readonly GUIContent k_LastBounceFallbackHierarchyText = EditorGUIUtility.TrTextContent("Last Bounce", "Controls the fallback hierarchy for lighting the last bounce."); @@ -104,7 +104,7 @@ public override void OnEnable() static public readonly GUIContent k_AccumulationFactorText = EditorGUIUtility.TrTextContent("Accumulation Factor", "Controls Controls the amount of accumulation (0 no accumulation, 1 just accumulate)."); static public readonly GUIContent k_DepthBufferThicknessText = EditorGUIUtility.TrTextContent("Object Thickness", "Controls the typical thickness of objects the reflection rays may pass behind."); static public readonly GUIContent k_RayMaxIterationsText = EditorGUIUtility.TrTextContent("Max Ray Steps", "Sets the maximum number of steps HDRP uses for ray marching. Affects both correctness and performance."); - static public readonly GUIContent k_RayLengthText = EditorGUIUtility.TrTextContent("Max Ray Length", "Controls the maximal length of reflection rays. The higher this value is, the more expensive ray traced reflections are."); + static public readonly GUIContent k_RayLengthText = EditorGUIUtility.TrTextContent("Max Ray Length", "Controls the maximal length of reflection rays in meters. The higher this value is, the more expensive ray traced reflections are."); static public readonly GUIContent k_ClampValueText = EditorGUIUtility.TrTextContent("Clamp Value", "Clamps the exposed intensity."); static public readonly GUIContent k_SampleCountText = EditorGUIUtility.TrTextContent("Sample Count", "Number of samples for reflections."); static public readonly GUIContent k_BounceCountText = EditorGUIUtility.TrTextContent("Bounce Count", "Number of bounces for reflection rays."); diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/HDSceneColorNode.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/HDSceneColorNode.cs index 8c19fe210d7..1a0074cbbfa 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/HDSceneColorNode.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/HDSceneColorNode.cs @@ -83,7 +83,9 @@ public void GenerateNodeFunction(FunctionRegistry registry, GenerationMode gener { s.AppendLine("exposureMultiplier = 1.0;"); } - s.AppendLine("#if defined(REQUIRE_OPAQUE_TEXTURE) && defined(_SURFACE_TYPE_TRANSPARENT) && defined(SHADERPASS) && (SHADERPASS != SHADERPASS_LIGHT_TRANSPORT)"); + s.AppendLine("#if defined(REQUIRE_OPAQUE_TEXTURE) && defined(_SURFACE_TYPE_TRANSPARENT) && defined(SHADERPASS)" + + " && (SHADERPASS != SHADERPASS_LIGHT_TRANSPORT) && (SHADERPASS != SHADERPASS_PATH_TRACING)" + + " && (SHADERPASS != SHADERPASS_RAYTRACING_VISIBILITY) && (SHADERPASS != SHADERPASS_RAYTRACING_FORWARD)"); s.AppendLine("return SampleCameraColor(uv, lod) * exposureMultiplier;"); s.AppendLine("#endif"); s.AppendLine("return $precision3(0.0, 0.0, 0.0);"); diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Raytracing/GlobalIlluminationEditor.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Raytracing/GlobalIlluminationEditor.cs index 25f077dcd97..56f70f3f906 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Raytracing/GlobalIlluminationEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Raytracing/GlobalIlluminationEditor.cs @@ -99,7 +99,7 @@ public override void OnEnable() base.OnEnable(); } - static public readonly GUIContent k_RayLengthText = EditorGUIUtility.TrTextContent("Max Ray Length", "Controls the maximal length of global illumination rays. The higher this value is, the more expensive ray traced global illumination is."); + static public readonly GUIContent k_RayLengthText = EditorGUIUtility.TrTextContent("Max Ray Length", "Controls the maximal length of global illumination rays in meters. The higher this value is, the more expensive ray traced global illumination is."); static public readonly GUIContent k_FullResolutionSSText = EditorGUIUtility.TrTextContent("Full Resolution", "Controls if the screen space global illumination should be evaluated at half resolution."); static public readonly GUIContent k_DepthBufferThicknessText = EditorGUIUtility.TrTextContent("Depth Tolerance", "Controls the tolerance when comparing the depth of two pixels."); static public readonly GUIContent k_RayMissFallbackHierarchyText = EditorGUIUtility.TrTextContent("Ray Miss", "Controls the fallback hierarchy for indirect diffuse in case the ray misses."); diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Raytracing/RecursiveRenderingEditor.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Raytracing/RecursiveRenderingEditor.cs index d84fbbea6f8..ccbde45a53c 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Raytracing/RecursiveRenderingEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Raytracing/RecursiveRenderingEditor.cs @@ -30,7 +30,7 @@ public override void OnEnable() m_LastBounce = Unpack(o.Find(x => x.lastBounce)); } - static public readonly GUIContent k_RayLengthText = EditorGUIUtility.TrTextContent("Max Ray Length", "This defines the maximal travel distance of rays."); + static public readonly GUIContent k_RayLengthText = EditorGUIUtility.TrTextContent("Max Ray Length", "This defines the maximal travel distance of rays in meters."); public override void OnInspectorGUI() { diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/FrameSettingsUI.Drawers.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/FrameSettingsUI.Drawers.cs index bc0074600dc..674d1affdba 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/FrameSettingsUI.Drawers.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/FrameSettingsUI.Drawers.cs @@ -180,9 +180,6 @@ static internal void Drawer_SectionRenderingSettings(SerializedFrameSettings ser area.AmmendInfo(FrameSettingsField.ObjectMotionVectors, ignoreDependencies: true); area.AmmendInfo(FrameSettingsField.TransparentsWriteMotionVector, ignoreDependencies: true); - var isEditingCamera = owner is HDCameraEditor; - area.AmmendInfo(FrameSettingsField.Postprocess, overrideable: () => isEditingCamera); - var hdrpAsset = GetHDRPAssetFor(owner); RenderPipelineSettings qualityLevelSettings = hdrpAsset?.currentPlatformRenderPipelineSettings ?? default; area.AmmendInfo( diff --git a/com.unity.render-pipelines.high-definition/Editor/SceneTemplates/Indoors/SkyandFogSettingsProfile.asset b/com.unity.render-pipelines.high-definition/Editor/SceneTemplates/Indoors/SkyandFogSettingsProfile.asset index 9d535f655d1..bcd845b2b8a 100644 --- a/com.unity.render-pipelines.high-definition/Editor/SceneTemplates/Indoors/SkyandFogSettingsProfile.asset +++ b/com.unity.render-pipelines.high-definition/Editor/SceneTemplates/Indoors/SkyandFogSettingsProfile.asset @@ -13,12 +13,9 @@ MonoBehaviour: m_Name: GradientSky m_EditorClassIdentifier: active: 1 - m_AdvancedMode: 0 rotation: m_OverrideState: 0 m_Value: 0 - min: 0 - max: 360 skyIntensityMode: m_OverrideState: 0 m_Value: 0 @@ -28,11 +25,9 @@ MonoBehaviour: multiplier: m_OverrideState: 0 m_Value: 1 - min: 0 upperHemisphereLuxValue: m_OverrideState: 0 m_Value: 1 - min: 0 upperHemisphereLuxColor: m_OverrideState: 0 m_Value: {x: 0, y: 0, z: 0} @@ -45,28 +40,18 @@ MonoBehaviour: updatePeriod: m_OverrideState: 0 m_Value: 0 - min: 0 includeSunInBaking: m_OverrideState: 0 m_Value: 0 top: m_OverrideState: 1 m_Value: {r: 0, g: 0, b: 0, a: 1} - hdr: 1 - showAlpha: 0 - showEyeDropper: 1 middle: m_OverrideState: 1 m_Value: {r: 0, g: 0, b: 0, a: 1} - hdr: 1 - showAlpha: 0 - showEyeDropper: 1 bottom: m_OverrideState: 1 m_Value: {r: 0, g: 0, b: 0, a: 1} - hdr: 1 - showAlpha: 0 - showEyeDropper: 1 gradientDiffusion: m_OverrideState: 0 m_Value: 1 @@ -87,6 +72,7 @@ MonoBehaviour: - {fileID: 5344652756874662184} - {fileID: -466525434632250678} - {fileID: 4745465664678062571} + - {fileID: 7531768051861600863} --- !u!114 &4745465664678062571 MonoBehaviour: m_ObjectHideFlags: 3 @@ -100,7 +86,6 @@ MonoBehaviour: m_Name: Exposure m_EditorClassIdentifier: active: 1 - m_AdvancedMode: 0 mode: m_OverrideState: 1 m_Value: 0 @@ -206,19 +191,15 @@ MonoBehaviour: adaptationSpeedDarkToLight: m_OverrideState: 0 m_Value: 3 - min: 0.001 adaptationSpeedLightToDark: m_OverrideState: 0 m_Value: 1 - min: 0.001 weightTextureMask: m_OverrideState: 0 m_Value: {fileID: 0} histogramPercentages: m_OverrideState: 0 m_Value: {x: 40, y: 90} - min: 0 - max: 100 histogramUseCurveRemapping: m_OverrideState: 0 m_Value: 0 @@ -243,7 +224,6 @@ MonoBehaviour: proceduralSoftness: m_OverrideState: 0 m_Value: 0.5 - min: 0 --- !u!114 &5344652756874662184 MonoBehaviour: m_ObjectHideFlags: 3 @@ -257,7 +237,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: active: 1 - m_AdvancedMode: 0 quality: m_OverrideState: 0 m_Value: 1 @@ -270,32 +249,21 @@ MonoBehaviour: color: m_OverrideState: 0 m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1} - hdr: 1 - showAlpha: 0 - showEyeDropper: 1 tint: m_OverrideState: 0 m_Value: {r: 1, g: 1, b: 1, a: 1} - hdr: 1 - showAlpha: 0 - showEyeDropper: 1 maxFogDistance: m_OverrideState: 0 m_Value: 5000 - min: 0 mipFogMaxMip: m_OverrideState: 0 m_Value: 0.5 - min: 0 - max: 1 mipFogNear: m_OverrideState: 0 m_Value: 0 - min: 0 mipFogFar: m_OverrideState: 0 m_Value: 1000 - min: 0 baseHeight: m_OverrideState: 0 m_Value: 0 @@ -305,61 +273,42 @@ MonoBehaviour: meanFreePath: m_OverrideState: 0 m_Value: 400 - min: 1 enableVolumetricFog: m_OverrideState: 1 m_Value: 1 albedo: m_OverrideState: 0 m_Value: {r: 1, g: 1, b: 1, a: 1} - hdr: 0 - showAlpha: 1 - showEyeDropper: 1 globalLightProbeDimmer: m_OverrideState: 0 m_Value: 1 - min: 0 - max: 1 depthExtent: m_OverrideState: 0 m_Value: 64 - min: 0.1 denoisingMode: m_OverrideState: 0 m_Value: 2 anisotropy: m_OverrideState: 0 m_Value: 0 - min: -1 - max: 1 sliceDistributionUniformity: m_OverrideState: 0 m_Value: 0.75 - min: 0 - max: 1 m_FogControlMode: m_OverrideState: 0 m_Value: 0 screenResolutionPercentage: m_OverrideState: 0 m_Value: 12.5 - min: 6.25 - max: 100 volumeSliceCount: m_OverrideState: 0 m_Value: 64 - min: 1 - max: 1024 m_VolumetricFogBudget: m_OverrideState: 0 - m_Value: 0.33 - min: 0 - max: 1 + m_Value: 0.333 m_ResolutionDepthRatio: m_OverrideState: 0 - m_Value: 0.666 - min: 0 - max: 1 + m_Value: 0.5 directionalLightsOnly: m_OverrideState: 0 m_Value: 0 @@ -376,13 +325,349 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: active: 1 - m_AdvancedMode: 0 skyType: m_OverrideState: 1 m_Value: 3 + cloudType: + m_OverrideState: 0 + m_Value: 0 skyAmbientMode: m_OverrideState: 1 m_Value: 0 + windOrientation: + m_OverrideState: 0 + m_Value: 0 + windSpeed: + m_OverrideState: 0 + m_Value: 100 fogType: m_OverrideState: 1 m_Value: 0 +--- !u!114 &7531768051861600863 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7e9e4ed5a6f56fb4ebd693e39684f36f, type: 3} + m_Name: VolumetricClouds + m_EditorClassIdentifier: + active: 1 + enable: + m_OverrideState: 1 + m_Value: 0 + localClouds: + m_OverrideState: 0 + m_Value: 0 + earthCurvature: + m_OverrideState: 0 + m_Value: 0 + cloudTiling: + m_OverrideState: 0 + m_Value: {x: 1, y: 1} + cloudOffset: + m_OverrideState: 0 + m_Value: {x: 0, y: 0} + lowestCloudAltitude: + m_OverrideState: 0 + m_Value: 1000 + cloudThickness: + m_OverrideState: 0 + m_Value: 8000 + fadeInMode: + m_OverrideState: 0 + m_Value: 0 + fadeInStart: + m_OverrideState: 0 + m_Value: 0 + fadeInDistance: + m_OverrideState: 0 + m_Value: 0 + numPrimarySteps: + m_OverrideState: 0 + m_Value: 64 + numLightSteps: + m_OverrideState: 0 + m_Value: 6 + cloudMap: + m_OverrideState: 0 + m_Value: {fileID: 0} + cloudLut: + m_OverrideState: 0 + m_Value: {fileID: 0} + cloudControl: + m_OverrideState: 0 + m_Value: 0 + cloudPreset: + m_OverrideState: 0 + m_Value: 1 + cumulusMap: + m_OverrideState: 0 + m_Value: {fileID: 0} + cumulusMapMultiplier: + m_OverrideState: 0 + m_Value: 1 + altoStratusMap: + m_OverrideState: 0 + m_Value: {fileID: 0} + altoStratusMapMultiplier: + m_OverrideState: 0 + m_Value: 1 + cumulonimbusMap: + m_OverrideState: 0 + m_Value: {fileID: 0} + cumulonimbusMapMultiplier: + m_OverrideState: 0 + m_Value: 1 + rainMap: + m_OverrideState: 0 + m_Value: {fileID: 0} + cloudMapResolution: + m_OverrideState: 0 + m_Value: 64 + customDensityCurve: + m_OverrideState: 0 + m_Value: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.2 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.5 + value: 0.7 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.8 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + customErosionCurve: + m_OverrideState: 0 + m_Value: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.9 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.2 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.8 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0.9 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + customAmbientOcclusionCurve: + m_OverrideState: 0 + m_Value: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + scatteringTint: + m_OverrideState: 0 + m_Value: {r: 0, g: 0, b: 0, a: 1} + powderEffectIntensity: + m_OverrideState: 0 + m_Value: 0.25 + multiScattering: + m_OverrideState: 0 + m_Value: 0.5 + densityMultiplier: + m_OverrideState: 0 + m_Value: 0.25 + shapeFactor: + m_OverrideState: 0 + m_Value: 0.75 + shapeScale: + m_OverrideState: 0 + m_Value: 2.5 + shapeOffset: + m_OverrideState: 0 + m_Value: {x: 0, y: 0, z: 0} + erosionFactor: + m_OverrideState: 0 + m_Value: 0.5 + erosionScale: + m_OverrideState: 0 + m_Value: 50 + erosionNoiseType: + m_OverrideState: 0 + m_Value: 1 + ambientLightProbeDimmer: + m_OverrideState: 0 + m_Value: 1 + sunLightDimmer: + m_OverrideState: 0 + m_Value: 1 + erosionOcclusion: + m_OverrideState: 0 + m_Value: 0.1 + globalWindSpeed: + m_OverrideState: 0 + m_Value: + mode: 1 + customValue: 100 + additiveValue: 0 + multiplyValue: 1 + orientation: + m_OverrideState: 0 + m_Value: + mode: 1 + customValue: 0 + additiveValue: 0 + multiplyValue: 1 + altitudeDistortion: + m_OverrideState: 0 + m_Value: 0.5 + cloudMapSpeedMultiplier: + m_OverrideState: 0 + m_Value: 0.5 + shapeSpeedMultiplier: + m_OverrideState: 0 + m_Value: 1 + erosionSpeedMultiplier: + m_OverrideState: 0 + m_Value: 0.25 + verticalShapeWindSpeed: + m_OverrideState: 0 + m_Value: 0 + verticalErosionWindSpeed: + m_OverrideState: 0 + m_Value: 0 + temporalAccumulationFactor: + m_OverrideState: 0 + m_Value: 0.95 + ghostingReduction: + m_OverrideState: 0 + m_Value: 0 + shadows: + m_OverrideState: 0 + m_Value: 0 + shadowResolution: + m_OverrideState: 0 + m_Value: 256 + shadowPlaneHeightOffset: + m_OverrideState: 0 + m_Value: 0 + shadowDistance: + m_OverrideState: 0 + m_Value: 8000 + shadowOpacity: + m_OverrideState: 0 + m_Value: 1 + shadowOpacityFallback: + m_OverrideState: 0 + m_Value: 0 + m_Version: 2 + m_ObsoleteWindSpeed: + m_OverrideState: 0 + m_Value: 1 + m_ObsoleteOrientation: + m_OverrideState: 0 + m_Value: 0 + m_ObsoleteShapeOffsetX: + m_OverrideState: 0 + m_Value: 0 + m_ObsoleteShapeOffsetY: + m_OverrideState: 0 + m_Value: 0 + m_ObsoleteShapeOffsetZ: + m_OverrideState: 0 + m_Value: 0 diff --git a/com.unity.render-pipelines.high-definition/Editor/SceneTemplates/IndoorsDXR/SkyandFogSettingsProfile.asset b/com.unity.render-pipelines.high-definition/Editor/SceneTemplates/IndoorsDXR/SkyandFogSettingsProfile.asset index 9d535f655d1..42fca3acce5 100644 --- a/com.unity.render-pipelines.high-definition/Editor/SceneTemplates/IndoorsDXR/SkyandFogSettingsProfile.asset +++ b/com.unity.render-pipelines.high-definition/Editor/SceneTemplates/IndoorsDXR/SkyandFogSettingsProfile.asset @@ -13,12 +13,9 @@ MonoBehaviour: m_Name: GradientSky m_EditorClassIdentifier: active: 1 - m_AdvancedMode: 0 rotation: m_OverrideState: 0 m_Value: 0 - min: 0 - max: 360 skyIntensityMode: m_OverrideState: 0 m_Value: 0 @@ -28,11 +25,9 @@ MonoBehaviour: multiplier: m_OverrideState: 0 m_Value: 1 - min: 0 upperHemisphereLuxValue: m_OverrideState: 0 m_Value: 1 - min: 0 upperHemisphereLuxColor: m_OverrideState: 0 m_Value: {x: 0, y: 0, z: 0} @@ -45,28 +40,18 @@ MonoBehaviour: updatePeriod: m_OverrideState: 0 m_Value: 0 - min: 0 includeSunInBaking: m_OverrideState: 0 m_Value: 0 top: m_OverrideState: 1 m_Value: {r: 0, g: 0, b: 0, a: 1} - hdr: 1 - showAlpha: 0 - showEyeDropper: 1 middle: m_OverrideState: 1 m_Value: {r: 0, g: 0, b: 0, a: 1} - hdr: 1 - showAlpha: 0 - showEyeDropper: 1 bottom: m_OverrideState: 1 m_Value: {r: 0, g: 0, b: 0, a: 1} - hdr: 1 - showAlpha: 0 - showEyeDropper: 1 gradientDiffusion: m_OverrideState: 0 m_Value: 1 @@ -87,6 +72,7 @@ MonoBehaviour: - {fileID: 5344652756874662184} - {fileID: -466525434632250678} - {fileID: 4745465664678062571} + - {fileID: 7427120438444646716} --- !u!114 &4745465664678062571 MonoBehaviour: m_ObjectHideFlags: 3 @@ -100,7 +86,6 @@ MonoBehaviour: m_Name: Exposure m_EditorClassIdentifier: active: 1 - m_AdvancedMode: 0 mode: m_OverrideState: 1 m_Value: 0 @@ -206,19 +191,15 @@ MonoBehaviour: adaptationSpeedDarkToLight: m_OverrideState: 0 m_Value: 3 - min: 0.001 adaptationSpeedLightToDark: m_OverrideState: 0 m_Value: 1 - min: 0.001 weightTextureMask: m_OverrideState: 0 m_Value: {fileID: 0} histogramPercentages: m_OverrideState: 0 m_Value: {x: 40, y: 90} - min: 0 - max: 100 histogramUseCurveRemapping: m_OverrideState: 0 m_Value: 0 @@ -243,7 +224,6 @@ MonoBehaviour: proceduralSoftness: m_OverrideState: 0 m_Value: 0.5 - min: 0 --- !u!114 &5344652756874662184 MonoBehaviour: m_ObjectHideFlags: 3 @@ -257,7 +237,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: active: 1 - m_AdvancedMode: 0 quality: m_OverrideState: 0 m_Value: 1 @@ -270,32 +249,21 @@ MonoBehaviour: color: m_OverrideState: 0 m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1} - hdr: 1 - showAlpha: 0 - showEyeDropper: 1 tint: m_OverrideState: 0 m_Value: {r: 1, g: 1, b: 1, a: 1} - hdr: 1 - showAlpha: 0 - showEyeDropper: 1 maxFogDistance: m_OverrideState: 0 m_Value: 5000 - min: 0 mipFogMaxMip: m_OverrideState: 0 m_Value: 0.5 - min: 0 - max: 1 mipFogNear: m_OverrideState: 0 m_Value: 0 - min: 0 mipFogFar: m_OverrideState: 0 m_Value: 1000 - min: 0 baseHeight: m_OverrideState: 0 m_Value: 0 @@ -305,61 +273,42 @@ MonoBehaviour: meanFreePath: m_OverrideState: 0 m_Value: 400 - min: 1 enableVolumetricFog: m_OverrideState: 1 m_Value: 1 albedo: m_OverrideState: 0 m_Value: {r: 1, g: 1, b: 1, a: 1} - hdr: 0 - showAlpha: 1 - showEyeDropper: 1 globalLightProbeDimmer: m_OverrideState: 0 m_Value: 1 - min: 0 - max: 1 depthExtent: m_OverrideState: 0 m_Value: 64 - min: 0.1 denoisingMode: m_OverrideState: 0 m_Value: 2 anisotropy: m_OverrideState: 0 m_Value: 0 - min: -1 - max: 1 sliceDistributionUniformity: m_OverrideState: 0 m_Value: 0.75 - min: 0 - max: 1 m_FogControlMode: m_OverrideState: 0 m_Value: 0 screenResolutionPercentage: m_OverrideState: 0 m_Value: 12.5 - min: 6.25 - max: 100 volumeSliceCount: m_OverrideState: 0 m_Value: 64 - min: 1 - max: 1024 m_VolumetricFogBudget: m_OverrideState: 0 - m_Value: 0.33 - min: 0 - max: 1 + m_Value: 0.333 m_ResolutionDepthRatio: m_OverrideState: 0 - m_Value: 0.666 - min: 0 - max: 1 + m_Value: 0.5 directionalLightsOnly: m_OverrideState: 0 m_Value: 0 @@ -376,13 +325,349 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: active: 1 - m_AdvancedMode: 0 skyType: m_OverrideState: 1 m_Value: 3 + cloudType: + m_OverrideState: 0 + m_Value: 0 skyAmbientMode: m_OverrideState: 1 m_Value: 0 + windOrientation: + m_OverrideState: 0 + m_Value: 0 + windSpeed: + m_OverrideState: 0 + m_Value: 100 fogType: m_OverrideState: 1 m_Value: 0 +--- !u!114 &7427120438444646716 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7e9e4ed5a6f56fb4ebd693e39684f36f, type: 3} + m_Name: VolumetricClouds + m_EditorClassIdentifier: + active: 1 + enable: + m_OverrideState: 1 + m_Value: 0 + localClouds: + m_OverrideState: 0 + m_Value: 0 + earthCurvature: + m_OverrideState: 0 + m_Value: 0 + cloudTiling: + m_OverrideState: 0 + m_Value: {x: 1, y: 1} + cloudOffset: + m_OverrideState: 0 + m_Value: {x: 0, y: 0} + lowestCloudAltitude: + m_OverrideState: 0 + m_Value: 1000 + cloudThickness: + m_OverrideState: 0 + m_Value: 8000 + fadeInMode: + m_OverrideState: 0 + m_Value: 0 + fadeInStart: + m_OverrideState: 0 + m_Value: 0 + fadeInDistance: + m_OverrideState: 0 + m_Value: 0 + numPrimarySteps: + m_OverrideState: 0 + m_Value: 64 + numLightSteps: + m_OverrideState: 0 + m_Value: 6 + cloudMap: + m_OverrideState: 0 + m_Value: {fileID: 0} + cloudLut: + m_OverrideState: 0 + m_Value: {fileID: 0} + cloudControl: + m_OverrideState: 0 + m_Value: 0 + cloudPreset: + m_OverrideState: 0 + m_Value: 1 + cumulusMap: + m_OverrideState: 0 + m_Value: {fileID: 0} + cumulusMapMultiplier: + m_OverrideState: 0 + m_Value: 1 + altoStratusMap: + m_OverrideState: 0 + m_Value: {fileID: 0} + altoStratusMapMultiplier: + m_OverrideState: 0 + m_Value: 1 + cumulonimbusMap: + m_OverrideState: 0 + m_Value: {fileID: 0} + cumulonimbusMapMultiplier: + m_OverrideState: 0 + m_Value: 1 + rainMap: + m_OverrideState: 0 + m_Value: {fileID: 0} + cloudMapResolution: + m_OverrideState: 0 + m_Value: 64 + customDensityCurve: + m_OverrideState: 0 + m_Value: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.2 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.5 + value: 0.7 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.8 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + customErosionCurve: + m_OverrideState: 0 + m_Value: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.9 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.2 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.8 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0.9 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + customAmbientOcclusionCurve: + m_OverrideState: 0 + m_Value: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + scatteringTint: + m_OverrideState: 0 + m_Value: {r: 0, g: 0, b: 0, a: 1} + powderEffectIntensity: + m_OverrideState: 0 + m_Value: 0.25 + multiScattering: + m_OverrideState: 0 + m_Value: 0.5 + densityMultiplier: + m_OverrideState: 0 + m_Value: 0.25 + shapeFactor: + m_OverrideState: 0 + m_Value: 0.75 + shapeScale: + m_OverrideState: 0 + m_Value: 2.5 + shapeOffset: + m_OverrideState: 0 + m_Value: {x: 0, y: 0, z: 0} + erosionFactor: + m_OverrideState: 0 + m_Value: 0.5 + erosionScale: + m_OverrideState: 0 + m_Value: 50 + erosionNoiseType: + m_OverrideState: 0 + m_Value: 1 + ambientLightProbeDimmer: + m_OverrideState: 0 + m_Value: 1 + sunLightDimmer: + m_OverrideState: 0 + m_Value: 1 + erosionOcclusion: + m_OverrideState: 0 + m_Value: 0.1 + globalWindSpeed: + m_OverrideState: 0 + m_Value: + mode: 1 + customValue: 100 + additiveValue: 0 + multiplyValue: 1 + orientation: + m_OverrideState: 0 + m_Value: + mode: 1 + customValue: 0 + additiveValue: 0 + multiplyValue: 1 + altitudeDistortion: + m_OverrideState: 0 + m_Value: 0.5 + cloudMapSpeedMultiplier: + m_OverrideState: 0 + m_Value: 0.5 + shapeSpeedMultiplier: + m_OverrideState: 0 + m_Value: 1 + erosionSpeedMultiplier: + m_OverrideState: 0 + m_Value: 0.25 + verticalShapeWindSpeed: + m_OverrideState: 0 + m_Value: 0 + verticalErosionWindSpeed: + m_OverrideState: 0 + m_Value: 0 + temporalAccumulationFactor: + m_OverrideState: 0 + m_Value: 0.95 + ghostingReduction: + m_OverrideState: 0 + m_Value: 0 + shadows: + m_OverrideState: 0 + m_Value: 0 + shadowResolution: + m_OverrideState: 0 + m_Value: 256 + shadowPlaneHeightOffset: + m_OverrideState: 0 + m_Value: 0 + shadowDistance: + m_OverrideState: 0 + m_Value: 8000 + shadowOpacity: + m_OverrideState: 0 + m_Value: 1 + shadowOpacityFallback: + m_OverrideState: 0 + m_Value: 0 + m_Version: 2 + m_ObsoleteWindSpeed: + m_OverrideState: 0 + m_Value: 1 + m_ObsoleteOrientation: + m_OverrideState: 0 + m_Value: 0 + m_ObsoleteShapeOffsetX: + m_OverrideState: 0 + m_Value: 0 + m_ObsoleteShapeOffsetY: + m_OverrideState: 0 + m_Value: 0 + m_ObsoleteShapeOffsetZ: + m_OverrideState: 0 + m_Value: 0 diff --git a/com.unity.render-pipelines.high-definition/Editor/Sky/SkySettingsEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Sky/SkySettingsEditor.cs index 02c43ac462d..38286d14624 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Sky/SkySettingsEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Sky/SkySettingsEditor.cs @@ -25,6 +25,7 @@ protected enum SkySettingsUIElement } GUIContent m_SkyIntensityModeLabel = new UnityEngine.GUIContent("Intensity Mode"); + GUIContent m_ExposureCompensationLabel = new GUIContent("Exposure Compensation", "Sets the exposure compensation of the sky in EV."); SerializedDataParameter m_SkyExposure; SerializedDataParameter m_SkyMultiplier; @@ -89,7 +90,7 @@ protected void CommonSkySettingsGUI() using (new IndentLevelScope()) { if (m_IntensityMode.value.GetEnumValue() == SkyIntensityMode.Exposure) - PropertyField(m_SkyExposure); + PropertyField(m_SkyExposure, m_ExposureCompensationLabel); else if (m_IntensityMode.value.GetEnumValue() == SkyIntensityMode.Multiplier) PropertyField(m_SkyMultiplier); else if (m_IntensityMode.value.GetEnumValue() == SkyIntensityMode.Lux) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/Mesh/PassDepthForwardOnly.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/Mesh/PassDepthForwardOnly.template new file mode 100644 index 00000000000..e86c721a0ea --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/Mesh/PassDepthForwardOnly.template @@ -0,0 +1,17 @@ +Pass +{ + Tags { "LightMode"="DepthForwardOnly" } + + ZWrite On + Blend Off + + HLSLPROGRAM + #define VFX_PASSDEPTH VFX_PASSDEPTH_ACTUAL + #pragma multi_compile _ WRITE_NORMAL_BUFFER + #pragma multi_compile _ WRITE_DECAL_BUFFER + #pragma multi_compile _ WRITE_MSAA_DEPTH + ${VFXIncludeRP("Templates/Mesh/PassDepthOrMV.template")} + + + ENDHLSL +} diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/Mesh/PassDepthForwardOnly.template.meta b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/Mesh/PassDepthForwardOnly.template.meta new file mode 100644 index 00000000000..7c8bde8ebf1 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/Mesh/PassDepthForwardOnly.template.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 251722a6d90822e4db4f5cc082ae48c8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/PlanarPrimitive/PassDepthForwardOnly.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/PlanarPrimitive/PassDepthForwardOnly.template new file mode 100644 index 00000000000..7f02f127278 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/PlanarPrimitive/PassDepthForwardOnly.template @@ -0,0 +1,15 @@ +Pass +{ + Tags { "LightMode"="DepthForwardOnly" } + + ZWrite On + Blend Off + + HLSLPROGRAM + #define VFX_PASSDEPTH VFX_PASSDEPTH_ACTUAL + #pragma multi_compile _ WRITE_NORMAL_BUFFER + #pragma multi_compile _ WRITE_MSAA_DEPTH + ${VFXIncludeRP("Templates/PlanarPrimitive/PassDepthOrMV.template")} + + ENDHLSL +} diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/PlanarPrimitive/PassDepthForwardOnly.template.meta b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/PlanarPrimitive/PassDepthForwardOnly.template.meta new file mode 100644 index 00000000000..4ddf46f2937 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/PlanarPrimitive/PassDepthForwardOnly.template.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 782f19a04d88d9f4aaf1c889cea63180 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleLitMesh.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleLitMesh.template index 3cc4082b655..0c8a6c431df 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleLitMesh.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleLitMesh.template @@ -4,7 +4,8 @@ Tags{ "RenderPipeline" = "HDRenderPipeline" } ${VFXInclude("Shaders/VFXParticleHeader.template")} ${VFXIncludeRP("Templates/Mesh/PassSelection.template")} - ${VFXIncludeRP("Templates/Mesh/PassDepth.template"),IS_OPAQUE_PARTICLE} + ${VFXIncludeRP("Templates/Mesh/PassDepth.template"),IS_OPAQUE_NOT_SIMPLE_LIT_PARTICLE} + ${VFXIncludeRP("Templates/Mesh/PassDepthForwardOnly.template"),HDRP_MATERIAL_TYPE_SIMPLELIT} ${VFXIncludeRP("Templates/Mesh/PassVelocity.template"),USE_MOTION_VECTORS_PASS} ${VFXIncludeRP("Templates/Mesh/PassGBuffer.template"),IS_OPAQUE_NOT_SIMPLE_LIT_PARTICLE} ${VFXIncludeRP("Templates/Mesh/PassForward.template")} diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleLitPlanarPrimitive.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleLitPlanarPrimitive.template index c1ec8d659e0..c565abd909e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleLitPlanarPrimitive.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleLitPlanarPrimitive.template @@ -6,7 +6,8 @@ ${VFXInclude("Shaders/VFXParticleHeader.template")} ${VFXIncludeRP("Templates/PlanarPrimitive/PassSelection.template")} - ${VFXIncludeRP("Templates/PlanarPrimitive/PassDepth.template"),IS_OPAQUE_PARTICLE} + ${VFXIncludeRP("Templates/PlanarPrimitive/PassDepth.template"),IS_OPAQUE_NOT_SIMPLE_LIT_PARTICLE} + ${VFXIncludeRP("Templates/PlanarPrimitive/PassDepthForwardOnly.template"),HDRP_MATERIAL_TYPE_SIMPLELIT} ${VFXIncludeRP("Templates/PlanarPrimitive/PassVelocity.template"),USE_MOTION_VECTORS_PASS} ${VFXIncludeRP("Templates/PlanarPrimitive/PassGBuffer.template"),IS_OPAQUE_NOT_SIMPLE_LIT_PARTICLE} ${VFXIncludeRP("Templates/PlanarPrimitive/PassForward.template")} 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 7da02e3aa4d..f36c153e151 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/GlobalIllumination.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/GlobalIllumination.cs @@ -167,7 +167,7 @@ public bool secondDenoiserPassSS public ClampedIntParameter textureLodBias = new ClampedIntParameter(7, 0, 7); /// - /// Controls the length of GI rays. + /// Controls the length of GI rays in meters. /// public float rayLength { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs index a0e3db878c8..115426edf0c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs @@ -1549,7 +1549,9 @@ public ShadowUpdateMode shadowUpdateMode } else if (legacyLight.shadows != LightShadows.None && m_ShadowUpdateMode == ShadowUpdateMode.EveryFrame && value != ShadowUpdateMode.EveryFrame) { - HDShadowManager.cachedShadowManager.RegisterLight(this); + // If we are OnDemand not rendered on placement, we defer the registering of the light until the rendering is requested. + if (!(shadowUpdateMode == ShadowUpdateMode.OnDemand && !onDemandShadowRenderOnPlacement)) + HDShadowManager.cachedShadowManager.RegisterLight(this); } m_ShadowUpdateMode = value; @@ -3229,7 +3231,9 @@ internal void RefreshCachedShadow() if (!ShadowIsUpdatedEveryFrame() && legacyLight.shadows != LightShadows.None) { - HDShadowManager.cachedShadowManager.RegisterLight(this); + // If we are OnDemand not rendered on placement, we defer the registering of the light until the rendering is requested. + if (!(shadowUpdateMode == ShadowUpdateMode.OnDemand && !onDemandShadowRenderOnPlacement)) + HDShadowManager.cachedShadowManager.RegisterLight(this); } } @@ -3649,9 +3653,11 @@ internal void CreateHDLightRenderEntity(bool autoDestroy = false) void OnEnable() { - if (shadowUpdateMode != ShadowUpdateMode.EveryFrame && legacyLight.shadows != LightShadows.None) + if (!ShadowIsUpdatedEveryFrame() && legacyLight.shadows != LightShadows.None) { - HDShadowManager.cachedShadowManager.RegisterLight(this); + // If we are OnDemand not rendered on placement, we defer the registering of the light until the rendering is requested. + if (!(shadowUpdateMode == ShadowUpdateMode.OnDemand && !onDemandShadowRenderOnPlacement)) + HDShadowManager.cachedShadowManager.RegisterLight(this); } SetEmissiveMeshRendererEnabled(true); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild.compute index 6f2d45561dc..a8925945841 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild.compute @@ -454,7 +454,7 @@ void FinePruneLights(uint threadID, int iNrCoarseLights, uint2 viTilLL, float vL { LightVolumeData lightData = _LightVolumeData[idxCoarse]; const bool bIsSpotDisc = true; // (lightData.flags&IS_CIRCULAR_SPOT_SHAPE) != 0; - for(int i=0; i float2(distSq, fDist2D*lightData.cotan) ); + bool validInPixel = all( float2(lightData.radiusSq, fSclProj) > float2(distSq, fDist2D*lightData.cotan) ); #ifdef PLATFORM_SUPPORTS_WAVE_INTRINSICS //a wave is on the same tile, and the loop is uniform for the wave. // thus we early out if at least 1 thread in the wave passed this light, saving some ALU. - lightValid = WaveActiveAnyTrue(isValid); + lightValid = WaveActiveAnyTrue(validInPixel); #else - lightValid = isValid; + lightValid = validInPixel; #endif + if (lightValid) + break; } } else if (uLightVolume == LIGHTVOLUMETYPE_SPHERE) { LightVolumeData lightData = _LightVolumeData[idxCoarse]; - for(int i=0; idistSq; + bool validInPixel = lightData.radiusSq>distSq; #ifdef PLATFORM_SUPPORTS_WAVE_INTRINSICS - lightValid = WaveActiveAnyTrue(isValid); + lightValid = WaveActiveAnyTrue(validInPixel); #else - lightValid = isValid; + lightValid = validInPixel; #endif + if (lightValid) + break; } } else if (uLightVolume == LIGHTVOLUMETYPE_BOX) { LightVolumeData lightData = _LightVolumeData[idxCoarse]; - for(int i=0; i - /// When enabled, SSR handles sky reflection. + /// When enabled, SSR handles sky reflection for opaque objects (not supported for SSR on transparent). ///
public BoolParameter reflectSky = new BoolParameter(true); @@ -169,7 +169,7 @@ public int rayMaxIterations public ClampedIntParameter textureLodBias = new ClampedIntParameter(1, 0, 7); /// - /// Controls the length of reflection rays. + /// Controls the length of reflection rays in meters. /// public float rayLength { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDCachedShadowAtlas.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDCachedShadowAtlas.cs index d5fe7abf8d1..b749dbdfc4a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDCachedShadowAtlas.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDCachedShadowAtlas.cs @@ -557,7 +557,6 @@ internal void ScheduleShadowUpdate(HDAdditionalLightData lightData) if (!lightData.isActiveAndEnabled) return; int lightIdx = lightData.lightIdxForCachedShadows; - Debug.Assert(lightIdx >= 0); if (!m_PlacedShadows.ContainsKey(lightIdx)) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAtlas.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAtlas.cs index 8332db2b832..7823f486823 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAtlas.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAtlas.cs @@ -192,6 +192,7 @@ public TextureHandle GetOutputTexture(RenderGraph renderGraph) if (m_UseSharedTexture) { Debug.Assert(m_Output.IsValid()); + return m_Output; // Should always be valid. } else diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/SimpleLit.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/SimpleLit.hlsl index 0748c7e8119..aa9cfcdbade 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/SimpleLit.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/SimpleLit.hlsl @@ -235,6 +235,14 @@ PreLightData GetPreLightData(float3 V, PositionInputs posInput, inout BSDFData b return preLightData; } +NormalData ConvertSurfaceDataToNormalData(SurfaceData surfaceData) +{ + NormalData normalData; + normalData.normalWS = surfaceData.normalWS; + normalData.perceptualRoughness = PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness); + return normalData; +} + #ifdef HAS_LIGHTLOOP bool IsNonZeroBSDF(float3 V, float3 L, PreLightData preLightData, BSDFData bsdfData) 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 93168de2d92..df02af04dc7 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 @@ -1180,6 +1180,9 @@ unsafe internal void UpdateShaderVariablesGlobalCB(ref ShaderVariablesGlobal cb, cb._DeExposureMultiplier = m_AdditionalCameraData == null ? 1.0f : m_AdditionalCameraData.deExposureMultiplier; + // IMPORTANT NOTE: This checks if we have Movec and not Transparent Motion Vectors because in that case we need to write camera motion vectors + // for transparent objects, otherwise the transparent objects will look completely broken upon motion if Transparent Motion Vectors is off. + // If TransparentsWriteMotionVector the camera motion vectors are baked into the per object motion vectors. cb._TransparentCameraOnlyMotionVectors = (frameSettings.IsEnabled(FrameSettingsField.MotionVectors) && !frameSettings.IsEnabled(FrameSettingsField.TransparentsWriteMotionVector)) ? 1 : 0; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs index f3667ca039d..f1df9135c56 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs @@ -1075,7 +1075,7 @@ class RenderSSRPassData public HDCamera hdCamera; } - void UpdateSSRConstantBuffer(HDCamera hdCamera, ScreenSpaceReflection settings, ref ShaderVariablesScreenSpaceReflection cb) + void UpdateSSRConstantBuffer(HDCamera hdCamera, ScreenSpaceReflection settings, bool isTransparent, ref ShaderVariablesScreenSpaceReflection cb) { float n = hdCamera.camera.nearClipPlane; float f = hdCamera.camera.farClipPlane; @@ -1084,7 +1084,7 @@ void UpdateSSRConstantBuffer(HDCamera hdCamera, ScreenSpaceReflection settings, cb._SsrThicknessScale = 1.0f / (1.0f + thickness); cb._SsrThicknessBias = -n / (f - n) * (thickness * cb._SsrThicknessScale); cb._SsrIterLimit = settings.rayMaxIterations; - cb._SsrReflectsSky = settings.reflectSky.value ? 1 : 0; + cb._SsrReflectsSky = isTransparent ? 0 : (settings.reflectSky.value ? 1 : 0); cb._SsrStencilBit = (int)StencilUsage.TraceReflectionRay; float roughnessFadeStart = 1 - settings.smoothnessFadeStart; cb._SsrRoughnessFadeEnd = 1 - settings.minSmoothness; @@ -1156,7 +1156,7 @@ TextureHandle RenderSSR(RenderGraph renderGraph, var colorPyramid = renderGraph.ImportTexture(colorPyramidRT); var volumeSettings = hdCamera.volumeStack.GetComponent(); - UpdateSSRConstantBuffer(hdCamera, volumeSettings, ref passData.cb); + UpdateSSRConstantBuffer(hdCamera, volumeSettings, transparent, ref passData.cb); passData.hdCamera = hdCamera; passData.blueNoise = GetBlueNoiseManager(); 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 579d73d6256..b3804b51faa 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 @@ -4609,6 +4609,14 @@ class UberPostPassData TextureHandle UberPass(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle logLut, TextureHandle bloomTexture, TextureHandle source) { bool isSceneView = hdCamera.camera.cameraType == CameraType.SceneView; + var featureFlags = GetUberFeatureFlags(isSceneView); + // If we have nothing to do in Uber post we just skip it. + if (featureFlags == UberPostFeatureFlags.None && !m_ColorGradingFS && !m_BloomFS && + m_CurrentDebugDisplaySettings.data.fullScreenDebugMode != FullScreenDebugMode.ColorLog) + { + return source; + } + using (var builder = renderGraph.AddRenderPass("Uber Post", out var passData, ProfilingSampler.Get(HDProfileId.UberPost))) { TextureHandle dest = GetPostprocessOutputHandle(renderGraph, "Uber Post Destination"); @@ -4617,7 +4625,7 @@ TextureHandle UberPass(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle // if they are used or not so they can set default values if needed passData.uberPostCS = defaultResources.shaders.uberPostCS; passData.uberPostCS.shaderKeywords = null; - var featureFlags = GetUberFeatureFlags(isSceneView); + passData.uberPostKernel = passData.uberPostCS.FindKernel("Uber"); if (PostProcessEnableAlpha()) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index f9408734914..b51d85da032 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -2000,6 +2000,8 @@ AOVRequestData aovRequest var decalCullingResults = renderRequest.cullingResults.decalCullResults; var target = renderRequest.target; + m_FullScreenDebugPushed = false; + // Updates RTHandle hdCamera.BeginRender(cmd); @@ -2630,7 +2632,9 @@ public Texture2D ExportSkyToTexture(Camera camera) static bool NeedMotionVectorForTransparent(FrameSettings frameSettings) { - return frameSettings.IsEnabled(FrameSettingsField.TransparentsWriteMotionVector); + // IMPORTANT NOTE: This is not checking for Transparent Motion Vectors because we need to explicitly write camera motion vectors + // for transparent objects too, otherwise the transparent objects will look completely broken upon motion if Transparent Motion Vectors is off. + return frameSettings.IsEnabled(FrameSettingsField.MotionVectors); } /// diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingLightCluster.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingLightCluster.cs index e4661374205..4b699c55d34 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingLightCluster.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingLightCluster.cs @@ -621,7 +621,7 @@ class LightClusterDebugPassData public int lightClusterDebugKernel; public Vector3 clusterCellSize; public Material debugMaterial; - public ComputeBuffer lightCluster; + public ComputeBufferHandle lightCluster; public ComputeShader lightClusterDebugCS; public TextureHandle depthStencilBuffer; @@ -631,6 +631,10 @@ class LightClusterDebugPassData public void EvaluateClusterDebugView(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depthStencilBuffer, TextureHandle depthPyramid) { + // TODO: Investigate why this behavior causes a leak in player mode only. + if (FullScreenDebugMode.LightCluster != m_RenderPipeline.m_CurrentDebugDisplaySettings.data.fullScreenDebugMode) + return; + TextureHandle debugTexture; using (var builder = renderGraph.AddRenderPass("Debug Texture for the Light Cluster", out var passData, ProfilingSampler.Get(HDProfileId.RaytracingDebugCluster))) { @@ -639,7 +643,7 @@ public void EvaluateClusterDebugView(RenderGraph renderGraph, HDCamera hdCamera, passData.texWidth = hdCamera.actualWidth; passData.texHeight = hdCamera.actualHeight; passData.clusterCellSize = clusterCellSize; - passData.lightCluster = m_LightCluster; + passData.lightCluster = builder.ReadComputeBuffer(renderGraph.ImportComputeBuffer(m_LightCluster)); passData.lightClusterDebugCS = m_RenderPipelineRayTracingResources.lightClusterDebugCS; passData.lightClusterDebugKernel = passData.lightClusterDebugCS.FindKernel("DebugLightCluster"); passData.debugMaterial = m_DebugMaterial; 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 8e8a9c22827..0fb7dc496f5 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 @@ -10,9 +10,9 @@ namespace UnityEngine.Rendering.HighDefinition public sealed class LightCluster : VolumeComponent { /// - /// Controls the range of the cluster around the camera. + /// Controls the range of the cluster around the camera in meters. /// - [Tooltip("Controls the range of the cluster around the camera.")] + [Tooltip("Controls the range of the cluster around the camera in meters.")] public MinFloatParameter cameraClusterRange = new MinFloatParameter(10.0f, 0.001f); /// /// Default constructor for the light cluster volume component. 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 f1ce8a0a5a1..f03f62d98b2 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 @@ -29,7 +29,7 @@ public sealed class RecursiveRendering : VolumeComponent public ClampedIntParameter maxDepth = new ClampedIntParameter(4, 1, 10); /// - /// This defines the maximal travel distance of rays. + /// This defines the maximal travel distance of rays in meters. /// public MinFloatParameter rayLength = new MinFloatParameter(10.0f, 0.0f); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/RenderPipelineSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/RenderPipelineSettings.cs index 858f7f255ff..3dd963af6e1 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/RenderPipelineSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/RenderPipelineSettings.cs @@ -53,7 +53,10 @@ public enum ColorBufferFormat public enum CustomBufferFormat { /// Regular R8G8B8A8 format. - R8G8B8A8 = GraphicsFormat.R8G8B8A8_SNorm, + [InspectorName("Signed R8G8B8A8")] + SignedR8G8B8A8 = GraphicsFormat.R8G8B8A8_SNorm, + /// Regular R8G8B8A8 format. + R8G8B8A8 = GraphicsFormat.R8G8B8A8_UNorm, /// R16G16B16A16 high quality HDR format. R16G16B16A16 = GraphicsFormat.R16G16B16A16_SFloat, /// R11G11B10 medium quality HDR format. diff --git a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/DownsampleDepth.shader b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/DownsampleDepth.shader index e6c8dc51fab..207db215b64 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/DownsampleDepth.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/DownsampleDepth.shader @@ -70,7 +70,7 @@ Shader "Hidden/HDRP/DownsampleDepth" float4 depths = GATHER_RED_TEXTURE2D_X(_CameraDepthTexture, s_linear_clamp_sampler, input.texcoord * _ScaleBias.xy + _ScaleBias.zw); outputDepth = MinDepth(depths); #else - uint2 fullResUpperCorner = uint2(input.positionCS.xy * 2.0); + uint2 fullResUpperCorner = uint2((((float2)input.positionCS.xy - 0.5f) * 2.0) + 0.5f); float4 depths; depths.x = LoadCameraDepth(fullResUpperCorner); depths.y = LoadCameraDepth(fullResUpperCorner + uint2(0, 1)); 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 f2704227e30..37ba44e6357 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 @@ -150,8 +150,8 @@ public override int GetHashCode() hash = hash * 23 + dirLightShadow.overrideState.GetHashCode(); hash = hash * 23 + rectLightShadow.overrideState.GetHashCode(); #else - hash = hdriSky.value != null ? hash * 23 + hdriSky.GetHashCode() : hash; - hash = flowmap.value != null ? hash * 23 + flowmap.GetHashCode() : hash; + hash = hash * 23 + hdriSky.GetHashCode(); + hash = hash * 23 + flowmap.GetHashCode(); hash = hash * 23 + distortionMode.GetHashCode(); hash = hash * 23 + upperHemisphereOnly.GetHashCode(); hash = hash * 23 + scrollOrientation.GetHashCode(); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISky.shader b/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISky.shader index cde9fdc022e..dd3b024f408 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISky.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISky.shader @@ -14,7 +14,7 @@ Shader "Hidden/HDRP/Sky/HDRISky" #pragma multi_compile_local_fragment _ USE_FLOWMAP #pragma multi_compile_fragment _ DEBUG_DISPLAY - #pragma multi_compile_local_fragment SHADOW_LOW SHADOW_MEDIUM SHADOW_HIGH SHADOW_VERY_HIGH + #pragma multi_compile_fragment SHADOW_LOW SHADOW_MEDIUM SHADOW_HIGH SHADOW_VERY_HIGH #pragma multi_compile USE_FPTL_LIGHTLIST USE_CLUSTERED_LIGHTLIST diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs index 9bcd970a98c..33ebc8928e0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs @@ -884,7 +884,7 @@ public void UpdateEnvironment(HDCamera hdCamera, // Debug.Log("Update Sky Lighting"); RenderSkyToCubemap(skyContext); - if (updateAmbientProbe && !renderingContext.computeAmbientProbeRequested) + if (updateAmbientProbe) { using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.UpdateSkyAmbientProbe))) { @@ -892,7 +892,6 @@ public void UpdateEnvironment(HDCamera hdCamera, cmd.SetComputeTextureParam(m_ComputeAmbientProbeCS, m_ComputeAmbientProbeKernel, m_AmbientProbeInputCubemap, renderingContext.skyboxCubemapRT); cmd.DispatchCompute(m_ComputeAmbientProbeCS, m_ComputeAmbientProbeKernel, 1, 1, 1); cmd.RequestAsyncReadback(renderingContext.ambientProbeResult, renderingContext.OnComputeAmbientProbeDone); - renderingContext.computeAmbientProbeRequested = true; // When the profiler is enabled, we don't want to submit the render context because // it will break all the profiling sample Begin() calls issued previously, which leads diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyRenderingContext.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyRenderingContext.cs index 620f35cdf00..acb09cccbe7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyRenderingContext.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyRenderingContext.cs @@ -15,7 +15,6 @@ internal class SkyRenderingContext public bool supportsConvolution { get; private set; } = false; internal bool ambientProbeIsReady = false; - public bool computeAmbientProbeRequested = false; public SkyRenderingContext(int resolution, int bsdfCount, bool supportsConvolution, SphericalHarmonicsL2 ambientProbe, string name) { @@ -44,7 +43,6 @@ public SkyRenderingContext(int resolution, int bsdfCount, bool supportsConvoluti public void Reset() { ambientProbeIsReady = false; - computeAmbientProbeRequested = false; } public void Cleanup() diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyUtils.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyUtils.hlsl index 86f45268c11..7bd22553d30 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyUtils.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyUtils.hlsl @@ -13,7 +13,7 @@ float4x4 _PixelCoordToViewDirWS; // Generates a world-space view direction for sky and atmospheric effects float3 GetSkyViewDirWS(float2 positionCS) { - float4 viewDirWS = mul(float4(positionCS.xy + _TaaJitterStrength.xy, 1.0f, 1.0f), _PixelCoordToViewDirWS); + float4 viewDirWS = mul(float4(positionCS.xy, 1.0f, 1.0f), _PixelCoordToViewDirWS); return normalize(viewDirWS.xyz); } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs index aa5716a9f63..78a49bfad29 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs @@ -756,6 +756,11 @@ protected virtual void CalculateNodeHasError() } } + protected string GetRayTracingError() => $@" + #if defined(SHADER_STAGE_RAY_TRACING) + #error '{name}' node is not supported in ray tracing, please provide an alternate implementation, relying for instance on the 'Raytracing Quality' keyword + #endif"; + public virtual void CollectPreviewMaterialProperties(List properties) { using (var tempSlots = PooledList.Get()) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalFromHeightNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalFromHeightNode.cs index 37152e95c4d..bb610eb0795 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalFromHeightNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalFromHeightNode.cs @@ -87,6 +87,7 @@ public void GenerateNodeFunction(FunctionRegistry registry, GenerationMode gener FindOutputSlot(OutputSlotId).concreteValueType.ToShaderString()); using (s.BlockScope()) { + s.AppendLine(GetRayTracingError()); s.AppendLine("$precision3 worldDerivativeX = ddx(Position);"); s.AppendLine("$precision3 worldDerivativeY = ddy(Position);"); s.AppendNewLine(); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Math/Derivative/DDXNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Math/Derivative/DDXNode.cs index de3a41281b9..ceedef1d0e6 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Math/Derivative/DDXNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Math/Derivative/DDXNode.cs @@ -14,18 +14,19 @@ public DDXNode() protected override MethodInfo GetFunctionToConvert() { - return GetType().GetMethod("Unity_DDX", BindingFlags.Static | BindingFlags.NonPublic); + return GetType().GetMethod("Unity_DDX", BindingFlags.Instance | BindingFlags.NonPublic); } - static string Unity_DDX( + string Unity_DDX( [Slot(0, Binding.None)] DynamicDimensionVector In, [Slot(1, Binding.None, ShaderStageCapability.Fragment)] out DynamicDimensionVector Out) { return -@" -{ +$@" +{{ + {GetRayTracingError()} Out = ddx(In); -} +}} "; } } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Math/Derivative/DDXYNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Math/Derivative/DDXYNode.cs index 78ab83869c0..a1c8342aa09 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Math/Derivative/DDXYNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Math/Derivative/DDXYNode.cs @@ -14,18 +14,19 @@ public DDXYNode() protected override MethodInfo GetFunctionToConvert() { - return GetType().GetMethod("Unity_DDXY", BindingFlags.Static | BindingFlags.NonPublic); + return GetType().GetMethod("Unity_DDXY", BindingFlags.Instance | BindingFlags.NonPublic); } - static string Unity_DDXY( + string Unity_DDXY( [Slot(0, Binding.None)] DynamicDimensionVector In, [Slot(1, Binding.None, ShaderStageCapability.Fragment)] out DynamicDimensionVector Out) { return -@" -{ +$@" +{{ + {GetRayTracingError()} Out = abs(ddx(In)) + abs(ddy(In)); -} +}} "; } } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Math/Derivative/DDYNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Math/Derivative/DDYNode.cs index b14e1545346..d7836024b28 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Math/Derivative/DDYNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Math/Derivative/DDYNode.cs @@ -14,18 +14,19 @@ public DDYNode() protected override MethodInfo GetFunctionToConvert() { - return GetType().GetMethod("Unity_DDY", BindingFlags.Static | BindingFlags.NonPublic); + return GetType().GetMethod("Unity_DDY", BindingFlags.Instance | BindingFlags.NonPublic); } - static string Unity_DDY( + string Unity_DDY( [Slot(0, Binding.None)] DynamicDimensionVector In, [Slot(1, Binding.None, ShaderStageCapability.Fragment)] out DynamicDimensionVector Out) { return -@" -{ +$@" +{{ + {GetRayTracingError()} Out = ddy(In); -} +}} "; } }