Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -399,15 +399,11 @@ private static void GenerateTableRows(DebugUI.Table table, List<VolumeParameterC
for (int i = 0; i < results.parameterList.Count; ++i)
{
var parameter = results.parameterList[i];

#if UNITY_EDITOR
string displayName = UnityEditor.ObjectNames.NicifyVariableName(parameter.debugId); // In the editor, make the name more readable
#elif DEVELOPMENT_BUILD
string displayName = parameter.debugId; // In the development player, just the debug id
#if UNITY_EDITOR || DEVELOPMENT_BUILD
string displayName = VolumeDebugData.GetVolumeParameterDebugId(parameter);// In the development player, just the debug id
#else
string displayName = i.ToString(); // Everywhere else, just a dummy id ( TODO: The Volume panel code should be stripped completely in nom-development builds )
#endif

table.children.Add(new DebugUI.Table.Row()
{
displayName = displayName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,7 @@ internal static void FindParameters(object o, List<VolumeParameter> parameters,
{
VolumeParameter volumeParameter = (VolumeParameter)field.GetValue(o);
#if UNITY_EDITOR || DEVELOPMENT_BUILD
var attr = (DisplayInfoAttribute[])field.GetCustomAttributes(typeof(DisplayInfoAttribute), true);
if (attr.Length != 0)
{
volumeParameter.debugId = attr[0].name;
}
else
{
volumeParameter.debugId = field.Name;
}
VolumeDebugData.AddVolumeParameterDebugId(volumeParameter, field);
#endif
parameters.Add(volumeParameter);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Reflection;

namespace UnityEngine.Rendering
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
internal static class VolumeDebugData
{
static Lazy<Dictionary<int, string>> debugIds = new(() => new Dictionary<int, string>());

internal static string GetVolumeParameterDebugId(VolumeParameter parameter)
{
return debugIds.Value.TryGetValue(parameter.fieldHash, out var debugId) ? debugId : string.Empty;
}

internal static void AddVolumeParameterDebugId(VolumeParameter parameter, FieldInfo field)
{
var fieldHash = field.GetHashCode();
parameter.fieldHash = fieldHash;
if (debugIds.Value.ContainsKey(fieldHash))
return;

var displayInfo = field.GetCustomAttribute<DisplayInfoAttribute>(true);
var debugId = displayInfo != null ? displayInfo.name : field.Name;
#if UNITY_EDITOR
debugId = UnityEditor.ObjectNames.NicifyVariableName(debugId); // In the editor, make the name more readable
#endif
debugIds.Value.Add(fieldHash, debugId);
}
}
#endif
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace UnityEngine.Rendering
public abstract class VolumeParameter : ICloneable
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
internal string debugId { get; set; }
internal int fieldHash { get; set; }
#endif

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,11 @@ HDRP provides the following upscale filter methods:

| **Upscale Filter Name** | Description |
| ------------------------------------ | ------------------------------------------------------------ |
| Catmull-Rom | Catmull-Rom uses four bilinear samples. This uses the least resources, but it can cause blurry images after HDRP performs the upscaling step.<br/><br/> Catmull-Rom has no dependencies and runs at the end of the post-processing pipeline. |
| Contrast Adaptive Sharpen (CAS) | Contrast Adaptive Sharpen (CAS) uses **FidelityFX (CAS) AMD™**. This method produces a sharp image with an aggressive sharpening step. Do not use this option when the dynamic resolution screen percentage is less than 50%. For information about FidelityFX and Contrast Adaptive Sharpening, see[ AMD FidelityFX](https://www.amd.com/en/technologies/radeon-software-fidelityfx).<br/><br/> Contrast Adaptive Sharpen (CAS) has no dependencies and runs at the end of the post-processing pipeline. |
| FidelityFX Super Resolution 1.0 | FidelityFX Super Resolution 1.0 uses a spatial super-resolution method that balances quality and performance. For more information, see [AMD FidelityFX](https://www.amd.com/en/technologies/radeon-software-fidelityfx).<br/><br/> FidelityFX Super Resolution 1.0 has no dependencies and runs at the end of the post-processing pipeline.<br />FidelityFX Super Resolution 1.0 also runs when at 100% resolution as it can have beneficial sharpening effects. <br />For more information, see the section [Notes on FidelityFX Super Resolution 1.0](Dynamic-Resolution.md#notes-on-fidelityfx-super-resolution-1.0-(FSR))|
| Temporal Anti-Aliasing (TAA) Upscale | Temporal Anti-Aliasing (TAA) Upscale uses temporal integration to produce a sharp image. Unity performs this method alongside the normal anti-aliasing.<br />HDRP executes this upscale filter before post processing and at the same time as the TAA step. This means you can only use the TAA anti-aliasing method. This filter is not compatible with other anti-aliasing methods. <br /><br/>Temporal Anti-Aliasing (TAA) Upscale performs antialiasing on each frame. This means that it also runs when you enable Dynamic Resolution, even when the screen percentage is at 100% resolution. <br />For more information, see the section [Notes on TAA Upscale](Dynamic-Resolution.md#Notes). |
| **Catmull-Rom** | Catmull-Rom uses four bilinear samples. This uses the least resources, but it can cause blurry images after HDRP performs the upscaling step.<br/><br/>Catmull-Rom has no dependencies and runs at the end of the post-processing pipeline. |
| **Contrast Adaptive Sharpen (CAS)** | Contrast Adaptive Sharpen (CAS) uses **FidelityFX (CAS) AMD™**. This method produces a sharp image with an aggressive sharpening step. Do not use this option when the dynamic resolution screen percentage is less than 50%. For information about FidelityFX and Contrast Adaptive Sharpening, refer to [AMD FidelityFX](https://www.amd.com/en/technologies/radeon-software-fidelityfx).<br/><br/>Contrast Adaptive Sharpen (CAS) has no dependencies and runs at the end of the post-processing pipeline. |
| **AMD FidelityFX Super Resolution 1.0 (FSR1)** | FidelityFX Super Resolution 1.0 uses a spatial super-resolution method that balances quality and performance. For more information, refer to [AMD FidelityFX](https://www.amd.com/en/technologies/radeon-software-fidelityfx).<br/><br/>FSR1 has no dependencies and runs at the end of the post-processing pipeline.<br/><br/>FSR1 also runs when at 100% resolution as it can have beneficial sharpening effects.<br/><br/>For more information, refer to the section [Notes on FidelityFX Super Resolution 1.0](Dynamic-Resolution.md#notes-on-fidelityfx-super-resolution-10-fsr)|
| **Temporal Anti-Aliasing (TAA) Upscale** | Temporal Anti-Aliasing (TAA) Upscale uses temporal integration to produce a sharp image. Unity performs this method alongside the normal anti-aliasing.<br/><br/>HDRP executes this upscale filter before post processing and at the same time as the TAA step. This means you can only use the TAA anti-aliasing method. This filter is not compatible with other anti-aliasing methods.<br/><br/>Temporal Anti-Aliasing (TAA) Upscale performs antialiasing on each frame. This means that it also runs when you enable Dynamic Resolution, even when the screen percentage is at 100% resolution.<br/><br/>For more information, see the section [Notes on TAA Upscale](Dynamic-Resolution.md#notes-on-temporal-anti-aliasing-taa-upscale). |
| **NVIDIA Deep Learning Super Sampling (DLSS)** | HDRP supports DLSS only on the following platforms:<ul><li>DirectX 11 on Windows 64-bit</li><li>DirectX 12 on Windows 64-bit</li><li>Vulkan on Windows 64-bit</li></ul>Refer to [DLSS in HDRP](deep-learning-super-sampling-in-hdrp.md). |

## Overriding upscale options with code

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,31 +76,56 @@ These settings control the draw distance and resolution of the decals atlas that
| **- Layers** | Enable the checkbox to allow decals to only affect specific layers. <a name="decallayers"></a>|

<a name="DynamicResolution"></a>

### Dynamic Resolution

For more information about dynamic resolution and upscale filters, refer to [Dynamic Resolution](Dynamic-Resolution.md).

| **Property** | **Description** |
| ------------------------------------------- | ------------------------------------------------------------ |
| **Enable** | Enable the checkbox to make HDRP support dynamic resolution in your Unity Project. |
| **- Enable DLSS** | Enable the checkbox to make HDRP support NVIDIA Deep Learning Super Sampling (DLSS).<br/>This property only appears if you enable the NVIDIA package (com.unity.modules.nvidia) in your Unity project. |
| **-- Mode** | Use the drop-down to select which performance mode DLSS operates on. The options are:<br/>&#8226; **Balanced**: - Balances performance with quality.<br/>&#8226; **MaxPerf**: - Fast performance, lower quality.<br/>&#8226; **MaxQuality**: - High quality, lower performance.<br/>&#8226; **UltraPerformance**: - Fastest performance, lowest quality. |
| **-- Injection Point** | Use the drop-down to select at which point DLSS runs in the rendering pipeline: <br/>&#8226; **Before Post**: - DLSS runs when all post processing effects are at full resolution.<br/>&#8226; **After Depth Of Field**: - Depth of field runs at a low resolution and DLSS upscales everything in the next rendering step. All other post processing effects run at full resolution. <br/>&#8226; **After Post Process**: - DLSS runs at the end of the pipeline when all post process are at low resolution.<br/>&#8226; |
| **-- Use Optimal Settings** | Enable the checkbox to make DLSS control the Sharpness and Screen Percentage automatically. |
| **-- Sharpness** | Controls how the DLSS upsampler renders edges on the image. More sharpness usually means more contrast and a clearer image but can increase flickering and fireflies. Unity ignores this property if you enable **Use Optimal Settings**. |
| **- Dynamic Resolution Type** | Use the drop-down to select the type of dynamic resolution HDRP uses:<br />&#8226; **Software**: This option allocates render targets to accommodate the maximum resolution possible, then rescales the viewport accordingly. This allows the viewport to render at varying resolutions. <br />&#8226; **Hardware**: This option treats the render targets, up until the back buffer, as if they are all the scaled size. This means HDRP clears the render targets faster. |
| **- Upscale Filter** | Use the drop-down to select the filter that HDRP uses for upscaling unless overridden by user via script.<br />&#8226; **Catmull-Rom**: A bicubic upsample with 4 taps.<br />&#8226; **Contrast Adaptive Sharpen**: An ultra sharp upsample. This option is not meant for screen percentages less than 50% and still sharpens when the screen percentage is set to 100%. This uses **FidelityFX (CAS) AMD™**: For information about FidelityFX and Contrast Adaptive Sharpening, see [AMD FidelityFX](https://www.amd.com/en/technologies/radeon-software-fidelityfx). <br />&#8226; **FidelityFX Super Resolution 1.0 AMD™**: a spatial super-resolution technology that leverages cutting-edge algorithms to produce impressive upscaling quality at very fast performance. |
| **- Use Mip Bias** | Apply a negative bias on the texture samplers of deferred, opaque and transparent passes. This improves detail on textures but increases the texture fetching cost. Cost varies per platform. |
| **- Minimum Screen Percentage** | The minimum screen percentage that dynamic resolution can reach. |
| **- Maximum Screen Percentage** | The maximum screen percentage that dynamic resolution can reach. This value must be higher than the **Min Screen Percentage**. |
| **- Force Screen Percentage** | Enable the checkbox to force HDRP to use a specific screen percentage for dynamic resolution. This feature is useful for debugging dynamic resolution. |
| **- Forced Screen Percentage** | The specific screen percentage that HDRP uses for dynamic resolution. This property is only visible when you enable the **Force Screen Percentage**.. |
| **- Low Res Transparency Min Threshold** | The minimum percentage threshold allowed to clamp low resolution transparency. When the resolution percentage falls below this threshold, HDRP will clamp the low resolution to this percentage. |
| **- Ray Tracing Half Resolution Threshold** | The minimum percentage threshold allowed to render ray tracing effects at half resolution. When the resolution percentage falls below this threshold, HDRP will render ray tracing effects at full resolution. |
| **Water** <a name="water"></a> | Controls for the Water System. |
| **- Enable** | Enable the Water System.|
| **- Simulation Resolution** | Set the resolution of the water simulation. Higher values use more system resources but provide higher visual quality. |
| **- Script Interactions** | Enable to have HDRP calculate the height of the water simulation on the CPU. Also makes it possible for you to query height data for specific points on the water's surface. You can use this data for customizations like your own buoyancy implementation, for example. |
<a name="water-scriptinteractions"></a>
| **Enable DLSS** | Enables NVIDIA Deep Learning Super Sampling (DLSS). This option is available only if you enable the NVIDIA built-in package in the [Package Manager window](https://docs.unity3d.com/Manual/upm-ui.html). For more information, refer to [DLSS settings](#dlss-settings). |
| **Dynamic Resolution Type** | Sets how HDRP renders at a lower resolution. The options are:<ul><li>**Software**: Allocates render targets to accommodate the maximum resolution possible, then rescales the viewport accordingly. This allows the viewport to render at varying resolutions.</li><li>**Hardware**: Treats the render targets up to the back buffer as if they're all the scaled size. This means HDRP clears the render targets faster.</li></ul> |
| **Default Upscale Filter** | Sets the upscale filter HDRP uses to increase the resolution after rendering at a lower resolution.<br/><br/>The options are: <ul><li>**Catmull-Rom**: A bicubic upsample with 4 taps.</li><li>**Contrast Adaptive Sharpen**: An ultra-sharp upsample. This option is not meant for screen percentages less than 50% and still sharpens when you set the screen percentage to 100%. This filter uses FidelityFX (CAS) AMD™.</li><li>**FidelityFX Super Resolution 1.0 AMD™ (FSR1)**: A spatial super-resolution technology that leverages cutting-edge algorithms to produce high upscaling quality at very fast performance.</li><li>**TAA Upscale**: A temporal anti-aliasing upscaler that uses information from previous frames to produce high-quality visuals.</li></ul>If you enable **Enable DLSS**, this property becomes **Default Fallback Upscale Filter**. HDRP uses this filter if your build platform doesn't support DLSS.|
| **Injection Point** | Sets when HDRP applies the Catmull-Rom upscale filter. This property is available here only if you set **Default Upscale Filter** to **Catmull-Rom**. For more information, refer to [Injection points dropdown](#injection-points). |
| **Override FSR Sharpness** | Enables an **FSR Sharpness** slider that lets you set the sharpness of the FSR1 upscale filter. A value of 1.0 means maximum sharpness. A value of 0 means no sharpening. You can also set the sharpness per camera in the [Camera Inspector window](hdrp-camera-component-reference.md). This property is available only if you set **Default Upscale Filter** to **FidelityFX Super Resolution 1.0**. |
| **TAA Upscale Injection Point** | Sets when HDRP applies the TAA Upscaling filter. This property is available here only if you set **Default Upscale Filter** to **TAA Upscaling**. For more information, refer to [Injection points dropdown](#injection-points). |
| **Use Mip Bias** | Apply a negative bias on the texture samplers of deferred, opaque, and transparent passes. This improves detail on textures but increases the texture fetching cost. Cost varies per platform. |
| **Force Screen Percentage** | The specific screen percentage that HDRP uses for dynamic resolution. This property is only visible when you enable the **Force Screen Percentage**. |
| **Minimum Screen Percentage** | The minimum screen percentage that dynamic resolution can reach. |
| **Maximum Screen Percentage** | The maximum screen percentage that dynamic resolution can reach. This value must be higher than the **Min Screen Percentage**. |
| **Low Res Transparency Min Threshold** | Sets the minimum resolution that HDRP can render transparency, as a percentage of full screen resolution. |
| **Low Res Screen Space GI Min Threshold** | Sets the minimum resolution that HDRP can render screen-space global illumination, as a percentage of full screen resolution. |
| **Ray Tracing Half Resolution Threshold** | Sets the minimum resolution that HDRP can render ray tracing at half resolution. If the resolution falls below this threshold, HDRP renders ray tracing at full resolution. |

<a name="dlss-settings"></a>
#### DLSS settings

The following properties are available only if you enable **Enable DLSS**.

| **Property** | **Description** |
|-|-|
| **DLSS Mode** | Sets whether DLSS prioritizes quality or performance. The options are:<ul><li>**Maximum Quality**</li><li>**Balanced**</li><li>**Maximum Performance**</li><li>**Ultra Performance**</li></ul> |
| **DLSS Injection Point** | Sets when DLSS runs in the rendering pipeline. For more information, refer to [Injection points dropdown](#injection-points). |
| **DLSS Use Optimal Settings** | Enables DLSS controlling screen percentage automatically. |

<a name="injection-points"></a>
#### Injection points dropdown

| **Option** | **Description** |
|-|-|
|**Before Post Process**|HDRP upscales when post-processing effects are at full resolution.|
|**After Depth Of Field**|HDRP upscales when depth of field is at low resolution, but post-processing effects are at full resolution.|
|**After Post Process**|HDRP upscales at the end of the pipeline, when post-processing effects are at low resolution.|

## Water

Controls for the Water System.

| **Property** | **Description** |
|-|-|
| **Enable** | Enable the Water System.|
| **Simulation Resolution** | Set the resolution of the water simulation. Higher values use more system resources but provide higher visual quality. |
| **Script Interactions** | Enable to have HDRP calculate the height of the water simulation on the CPU. Also makes it possible for you to query height data for specific points on the water's surface. You can use this data for customizations like your own buoyancy implementation, for example. |

<a name="Lighting"></a>

Expand Down
Loading