Skip to content

Commit

Permalink
Documentation/staging
Browse files Browse the repository at this point in the history
Regular docs sync to main
  • Loading branch information
RobJessop authored and Evergreen committed Mar 4, 2023
1 parent d788606 commit e837679
Show file tree
Hide file tree
Showing 14 changed files with 110 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ The StackLit Shader is a higher quality than the Lit Shader, but more resource i

![](Images/HDRPFeatures-HairShader.png)

The Hair Shader is purpose-built to accurately render realistic hair in your Unity Project. It uses an improved Kajiya Kay lighting model which features better energy conservation and provides you with more flexibility. For more information, including a full list of Shader properties, see the [Hair Shader](hair-shader.md) and [Hair Master Stack](master-stack-hair.md) documentation.
The Hair Shader is purpose-built to accurately render realistic and stylized hair in your Unity Project. Use the improved Kajiya Kay lighting model which features better energy conservation and provides you with more flexibility. For more information, including a full list of Shader properties, see the [Hair Shader](hair-shader.md) and [Hair Master Stack](master-stack-hair.md) documentation.

### Fabric Shader

Expand Down Expand Up @@ -388,6 +388,12 @@ The Custom Pass API allows you to render GameObjects from another point of view,

You can also use this Camera override to render some GameObjects with a different field of view, like arms in a first-person application.

### High Quality Line Rendering

![img](Images/HQLines-Hero.png)

High Quality Line Rendering allows you to render hair, wires, and other line-based geometry with high quality anti-aliasing and transparency. For more information, refer to [High Quality Line Rendering](Override-High-Quality-Lines.md).

### Custom Pass AOV Export

![img](Images/aov_example.png)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Mesh Renderer Extension

Use the Mesh Renderer Extension component to activate and control [High Quality Line Rendering](Override-High-Quality-Lines.md) on a Mesh Renderer.

A GameObject must have a [Mesh Filter component](https://docs.unity3d.com/2023.1/Documentation/Manual/class-MeshFilter.html) and a [Mesh Renderer component](https://docs.unity3d.com/2023.1/Documentation/Manual/class-MeshRenderer.html) for you to be able to add and use a Mesh Render Extension component.

## High Quality Line Rendering

### Properties

| **Property** | **Description** |
|------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Enable** | Enable the high quality line rendering path. |
| **Group** | Set the sorting group that the Mesh Renderer belongs to. HDRP sorts Mesh Renderers in the same group together correctly, for proper transparency. You can add the Mesh Renderer to one of eight groups. |
| **LOD Mode** | Set the method used for culling line segments. The options are **None**, **Camera Distance**, and **Fixed**.|
| **Camera Distance LOD** | Set the curve that defines the percentage of lines (the y axis) HDRP draws based on the distance to the camera in meters (the x axis). This property appears only if you set **LOD Mode** to **Camera Distance**. |
| **Fixed LOD** | Set the amount of lines in the mesh HDRP draws. A value of `1` means HDRP draws all the lines. This property appears only if you set **LOD Mode** to **Fixed**. |
| **Shading Fraction** | Set the amount of the vertices in the mesh HDRP uses as positions for shading samples in this frame. A value of `1` means HDRP uses all of the mesh's vertices. |
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# High Quality Line Rendering

Rendering line topology via traditional hardware rasterization, for example to represent hair or fur, can easily suffer from image quality problems.

Use the **High Quality Line Rendering** override to draw line geometry with analytic anti-aliasing and transparent sorting.

![](Images/HQLines-HW.png)
An example of hardware lines.

![](Images/HQLines-SW.png)
An example of high quality lines.

## How High Quality Line Rendering works

The High Quality Line Renderer is a line segment software rasterizer designed for fast, high quality transparency and anti-aliasing.

Outlined below are the general steps of this raster algorithm.

1. The camera's view frustum is divided into many clusters. A single cluster is 8 pixels wide by 8 pixels high. The length is derived from the **Cluster Count**.
2. Each cluster computes a list of the visible line segments that intersect with it.
3. Clusters are processed in front-to-back order. For each cluster, the segment list is unpacked and sorted from front-to-back, and the **Sorting Quality** determines the maximum amount of segments sorted in a single cluster.
4. The sorted segment list is processed. For each segment pixel, HDRP computes the shading contribution, computes the analytically anti-aliased coverage mask, and blends the fragment behind the final tile result.
5. HDRP computes the average opacity of the tile. If the average opacity is greater than the **Tile Opacity Threshold**, the tile is complete. A threshold lower than 1.0 can greatly improve performance.
6. HDRP repeats steps 3 to 5 until all tiles have been processed.

## Enable High Quality Line Rendering

[!include[](snippets/Volume-Override-Enable-Override.md)]

* To enable High Quality Line Rendering in your HDRP Asset go to **Rendering** > **High Quality Line Rendering**.
* To enable High Quality Line Rendering in your Frame Settings go to **Edit** > **Project Settings** > **Graphics** > **HDRP Global Settings** > **Frame Settings (Default Values)** > **Camera** > **Rendering** > **High Quality Line Rendering**.

## Using High Quality Line Rendering

Once you've enabled High Quality Line Rendering in your project, follow these steps to render high quality lines in your scene:

1. In the Scene or Hierarchy window, select a GameObject that contains a [Volume](Volumes.md) component to view it in the Inspector.
2. In the Inspector, navigate to **Add Override** > **Rendering** and select **High Quality Lines**. HDRP now applies High Quality Line Rendering to any Camera this Volume affects.
3. In the Scene or Hierarchy view, select a GameObject that contains a [Mesh Renderer component](https://docs.unity3d.com/2023.1/Documentation/Manual/class-MeshRenderer.html).
4. In the Inspector, navigate to **Add Component**, then find and add the [Mesh Renderer Extension component](Mesh-Renderer-Extension.md).

Unity warns you if there is any configuration issue with your GameObject that prevents High Quality Line Rendering:

- If you're warned about the Topology, ensure that the mesh connected to your MeshFilter component is composed of LineTopology.
- If you're warned about the Material, open your Material's shader graph and enable **Support High Quality Line Rendering** in the Master Stack.

You can use the [Rendering Debugger](Render-Pipeline-Debug-Window.md) to visualize the underlying data used to calculate the high quality lines.

## Properties

| **Property** || **Description** |
|--|--|--|
| **Composition Mode** || Determine when in the render pipeline lines are rendered into the main frame. |
|| **Before Color Pyramid** | Use this setting if you want lines to appear in transparency effects. |
|| **After Temporal Anti-Aliasing** | Use this setting if you use [Temporal Anti-Aliasing](Anti-Aliasing.html#temporal-antialiasing-taa), so HDRP uses a stable depth buffer. |
|| **After Depth Of Field** | Use this setting if the lines will be in focus against a blurrier scene. |
| **Cluster Count** || Set the number of clusters in a tile, between the camera's near and far plane. |
| **Sorting Quality** || Set the quality of the line rendering, which affects the maximum number of segments HDRP can sort within a cluster. The options are **Low**, **Medium**, **High** and **Ultra**. The higher the quality, the more memory high quality line rendering uses. |
| **Tile Opacity Threshold** || Set the opacity value that qualifies as an opaque tile. A threshold lower than 1.0 can greatly improve performance. |
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ The **Rendering** panel has tools that you can use to visualize various HDRP ren
</thead>
<tbody>
<tr>
<td rowspan="11"><strong>Fullscreen Debug Mode</strong></td>
<td rowspan="12"><strong>Fullscreen Debug Mode</strong></td>
<td colspan="2">Use the drop-down to select a rendering mode to display as an overlay on the screen.</td>
</tr>
<tr>
Expand Down Expand Up @@ -658,6 +658,10 @@ Debug View Color Scale:<br/>
<td>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.<br/>This property only appears if you set <strong>Fullscreen Debug Mode</strong> to <strong>TransparencyOverdraw</strong>.</td>
</tr>
<tr>
<td><strong>High Quality Lines</strong></td>
<td>Select this option to view underlying data used by tile-based software rasterizer for the <a href="Override-High-Quality-Lines.md">High Quality Line Rendering</a> feature.<ul><li> <strong>Segments per Tile</strong> displays a heatmap representing the number of segments in each tile. </li><li><strong>Tile Processor UV</strong> displays the uv coordinate for each tile.</li><li><strong>Cluster Depth</strong> displays segments based on their depth in the cluster structure that's used for transparent sorting.</li></ul></td>
</tr>
<tr>
<td rowspan="8"><strong>MipMaps</strong></td>
<td colspan="2">Use the drop-down to select a mipmap streaming property to debug.</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
* Volume Overrides List
* [Exposure](Override-Exposure.md)
* [Fog](Override-Fog.md)
* Rendering
* [High Quality Lines](Override-High-Quality-Lines.md)
* Lighting
* [Ambient Occlusion](Override-Ambient-Occlusion.md)
* [Indirect Lighting Controller](Override-Indirect-Lighting-Controller.md)
Expand Down Expand Up @@ -206,6 +208,7 @@
* [Debugging Ray-Traced Effects](Ray-Tracing-Debug.md)
* Components
* [Decal Projector](Decal-Projector.md)
* [Mesh Renderer Extension](Mesh-Renderer-Extension.md)
* [Lens Flare](shared/lens-flare/lens-flare-component.md)
* [Lens Flare asset](shared/lens-flare/lens-flare-asset.md)
* Tools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,5 @@ Depending on the [Graph Settings](#graph-settings) you use, Shader Graph can add
<th>Description</th>
</tr>
[!include[](snippets/shader-properties/support-vfx-graph.md)]
[!include[](snippets/shader-properties/support-high-quality-line-rendering.md)]
</table>
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,5 @@ This set of settings only appears if you set **Surface Type** to **Transparent**
<th>Description</th>
</tr>
[!include[](snippets/shader-properties/support-vfx-graph.md)]
[!include[](snippets/shader-properties/support-high-quality-line-rendering.md)]
</table>
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,5 @@ This set of settings only appears if you set **Surface Type** to **Transparent**
<th>Description</th>
</tr>
[!include[](snippets/shader-properties/support-vfx-graph.md)]
[!include[](snippets/shader-properties/support-high-quality-line-rendering.md)]
</table>
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,5 @@ This set of settings only appears if you set **Surface Type** to **Transparent**
<th>Description</th>
</tr>
[!include[](snippets/shader-properties/support-vfx-graph.md)]
[!include[](snippets/shader-properties/support-high-quality-line-rendering.md)]
</table>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<tr>
<td>**Support High Quality Line Rendering**</td>
<td>
Indicates whether this Shader Graph supports the [High Quality Line Rendering](../../Override-High-Quality-Lines.md) feature. Enabling this property will only have an effect on renderers with line topology.
</td>
</tr>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ This page contains an overview of new features, improvements, and issues resolve

Starting from HDRP 15, two new options are available to perform sharpening with Temporal Anti-aliasing. The first new option is a post-process pass that will offer higher quality sharpening, control on how much sharpening will happen and an option to reduce possible ringing artifacts. The second option is to run Contrast Adaptive Sharpening from AMD FidelityFX.

### High Quality Line Rendering

Introducing a specialized rendering path for line topology with the **High Quality Line Renderer**. Use this feature to render hair, wires, and other line-based geometry with high quality anti-aliasing and transparency.

| Hardware Lines | High Quality Lines |
|:--------------------------:|:--------------------------:|
| ![](Images/HQLines-HW.png) | ![](Images/HQLines-SW.png) |

### Specular Fade

Specular light can now completely be faded when using a specular color workflow using the **HDRP/Lit** and **HDRP/StackLit** shaders by toggling a new option that can be found in the HDRP Global Settings under **Miscellaneous/Specular Fade**.
Expand Down

0 comments on commit e837679

Please sign in to comment.