-
Notifications
You must be signed in to change notification settings - Fork 817
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regular docs sync to main
- Loading branch information
Showing
14 changed files
with
110 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+3.88 MB
...com.unity.render-pipelines.high-definition/Documentation~/Images/HQLines-HW.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+602 KB
...m.unity.render-pipelines.high-definition/Documentation~/Images/HQLines-Hero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.16 MB
...com.unity.render-pipelines.high-definition/Documentation~/Images/HQLines-SW.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions
18
...nity.render-pipelines.high-definition/Documentation~/Mesh-Renderer-Extension.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | |
59 changes: 59 additions & 0 deletions
59
....render-pipelines.high-definition/Documentation~/Override-High-Quality-Lines.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
||
 | ||
An example of hardware lines. | ||
|
||
 | ||
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. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...ocumentation~/snippets/shader-properties/support-high-quality-line-rendering.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters