Skip to content

Commit 04a57d8

Browse files
JordanL8Lewis Jordan
andauthored
Hdrp/docs/layered lit tessellation (#3641)
* Refactored lit tessellation shader to use an include for tessellation options Layered Lit Tessellation will use the same include later * Refactored layered surface inputs to use an include Layered lit tessellation will use this too * Refactored layer list to use an include Layered tessellation will use this * Refactored detail inputs to use an include This will be used by layered lit tessellation too * Refactored layers to use an include This will be used by layered lit tessellation * Added emission input snippets * Added subsurface scattering and transluscent info * Added the layered lit tessellation doc * Added force forward emissive to both layered docs * Fixed bugs with incldues * Updated includes in the stacklit doc * Fixed bug with missing material type for the fabric master stack * Changed html links to md Co-authored-by: Lewis Jordan <[email protected]>
1 parent 9e778c1 commit 04a57d8

24 files changed

+268
-126
lines changed

com.unity.render-pipelines.high-definition/Documentation~/Layered-Lit-Shader.md

Lines changed: 18 additions & 90 deletions
Large diffs are not rendered by default.

com.unity.render-pipelines.high-definition/Documentation~/Lit-Shader.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,7 @@ To create a new Lit Material, navigate to your Project's Asset window, right-cli
4242

4343
### Detail Inputs
4444

45-
| **Property** | **Description** |
46-
| -------------------------------- | ------------------------------------------------------------ |
47-
| **Detail Map** | Assign a [channel-packed Texture](Glossary.md#ChannelPacking) that HDRP uses to add micro details into the Material. The Detail Map uses the following channel settings:<br />&#8226; **Red**: Stores the grey scale as albedo.<br />&#8226; **Green**: Stores the green channel of the detail normal map.<br />&#8226; **Blue**: Stores the detail smoothness.<br />&#8226; **Alpha**: Stores the red channel of the detail normal map.<br />For more information on channel-packed Textures and the detail map, see [detail map](Mask-Map-and-Detail-Map.md#DetailMap). |
48-
| **Detail UV Mapping** | Use the drop-down to set the type of UV map to use for the **Detail Map**. If the Material’s **Base UV mapping** property is set to **Planar** or **Triplanar**, the **Detail UV Mapping** is also set to **Planar** or **Triplanar**.<br />The **Detail Map** Texture modifies the appearance of the Material so, by default, HDRP applies the **Tiling** and **Offset** of the **Base UV Map** to the **Detail Map** to synchronize the **Detail Map** and the rest of the Material Textures. HDRP then applies the **Detail Map** **Tiling** and **Offset** properties on top of the **Base Map Tiling** and **Offset**. For example, on a plane, if the **Tiling** for **Base UV Mapping** is 2, and this value is also 2, then the **Detail Map** Texture tiles by 4 on the plane.<br />This workflow allows you to change the **Tiling** of the Texture on the Material, without having to set the **Tiling** of the **Detail UV** too.<br />To separate the **Detail UV Map** from the **Base UV Map** to set it independently, disable the **Lock to Base Tiling/Offset** checkbox. |
49-
| **- Lock to Base Tiling/Offset** | Enable the checkbox to make the **Base UV Map**’s **Tiling** and **Offset** properties affect the **Detail Map**. HDRP multiplies these properties by the **Detail UV Map**’s **Tiling** and **Offset** properties respectively. To separate the **Detail UV Map** from the **Base UV Map** to set it independently, disable this checkbox. |
50-
| **Tiling** | Set an **X** and **Y** tile rate for the **Detail Map** UV. HDRP uses the **X** and **Y** values to tile the Texture assigned to the **Detail Map** across the Material’s surface, in object space. |
51-
| **Offset** | Set an **X** and **Y** offset for the **Detail Map** UV. HDRP uses the **X** and **Y** values to offset the Texture assigned to the **Detail Map** across the Material’s surface, in object space. |
52-
| **Detail Albedo Scale** | Use the slider to modulate the albedo of the detail map (red channel) between 0 and 2. This is an overlay effect. |
53-
| **Detail Normal Scale** | Use the slider to modulate the intensity of the detail normal map, between 0 and 2. The default value is 1 and has no scale. |
54-
| **Detail Smoothness Scale** | Use the slider modulate the smoothness of the detail map (blue channel) between 0 and 2, like an overlay effect. The default value is 1 and has no scale. |
45+
[!include[](snippets/shader-properties/detail-inputs.md)]
5546

5647
### Transparency Inputs
5748

com.unity.render-pipelines.high-definition/Documentation~/Lit-Tessellation-Shader.md

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,8 @@ To create a new Lit Tessellation Material:
3838
| **Displacement Mode** | Use this drop-down to select the method that HDRP uses to alter the height of the Material’s surface. For more information about the feature and for the list of properties each **Displacement Mode ** exposes, see the [Displacement Mode documentation](Displacement-Mode.md). |
3939

4040
### Tessellation Options
41-
These properties control how Unity tessellates your Material's surface and smooths geometry.
4241

43-
| **Properties** | **Description** |
44-
| ---------------------------- | ------------------------------------------------------------ |
45-
| **Tessellation Mode** | Specifies whether HDRP applies Phong tessellation or not. Materials can use a [displacement map](Displacement-Mode.md) to tessellate a mesh. To smooth the result of displacement, you can also apply Phong tessellation. The options for the property are:<br/>&#8226; **None**: HDRP only uses the displacement map to tessellate the mesh. If you do not assign a displacement map for this Material and select this option, HDRP does not apply tessellation.<br/>&#8226; **Phong**: HDRP applies Phong tessellation to the mesh. Phong tessellation applies vertex interpolation to make geometry smoother. If you assign a displacement map for this Material and select this option, HDRP applies smoothing to the displacement map. |
46-
| **Tessellation Factor** | The number of subdivisions that a triangle can have. If you want more subdivisions, set this to a higher value. More subdivisions increase the strength of the tessellation effect and further smooths the geometry. Note that higher values also increase the resource intensity of the tessellation effect. To maintain good performance on the Xbox One or PlayStation 4, do not use values greater than 15. This is because these platforms cannot consistently handle this many subdivisions. |
47-
| **Start Fade Distance** | The distance (in meters) to the Camera at which tessellation begins to fade out. HDRP fades tessellation out from this distance up until **End Fade Distance**, at which point it stops tessellating triangles altogether. |
48-
| **End Fade Distance** | The maximum distance (in meters) to the Camera at which HDRP tessellates triangles. HDRP does not tessellate triangles at distances that are further from the Camera further than this distance. |
49-
| **Triangle Size** | The screen space size (in pixels) at which HDRP should subdivide a triangle. For example, if you set this value to **100**, HDRP subdivides triangles that take up 100 pixels. If you want HDRP to tessellate smaller triangles, and thus produce smoother geometry, set this to a lower value.Note: increasing the number of triangles that this Shader tessellates makes the effect more resource intensive to process. |
50-
| **Shape Factor** | To smooth the Mesh surface, Phong tessellation spherizes the Mesh. This property represents the strength of the spherization effect. If you do not want HDRP to spherize the Mesh, set this to **0**. If you want HDRP to fully spherize the Mesh, set this to **1**. This property only appears when you select **Phong** from **Tessellation Mode**. |
51-
| **Triangle Culling Epsilon** | Specifies how HDRP culls tessellated triangles. If you want to disable back-face culling, set this to **-1.0**. If you want more aggressive culling and better performance, set this to a higher value. |
42+
[!include[](snippets/shader-properties/tessellation-options.md)]
5243

5344
### Surface Inputs
5445

@@ -73,16 +64,7 @@ These properties control how Unity tessellates your Material's surface and smoot
7364

7465
### Detail Inputs
7566

76-
| **Property** | **Description** |
77-
| -------------------------------- | ------------------------------------------------------------ |
78-
| **Detail Map** | Assign a [channel-packed Texture](Glossary.md#ChannelPacking) that HDRP uses to add micro details into the Material. The Detail Map uses the following channel settings:<br />&#8226; **Red**: Stores the grey scale as albedo.<br />&#8226; **Green**: Stores the green channel of the detail normal map.<br />&#8226; **Blue**: Stores the detail smoothness.<br />&#8226; **Alpha**: Stores the red channel of the detail normal map.<br />For more information on channel-packed Textures and the detail map, see [detail map](Mask-Map-and-Detail-Map.md#DetailMap). |
79-
| **Detail UV Mapping** | Use the drop-down to set the type of UV map to use for the **Detail Map**. If the Material’s **Base UV mapping** property is set to **Planar** or **Triplanar**, the **Detail UV Mapping** is also set to **Planar** or **Triplanar**.<br />The **Detail Map** Texture modifies the appearance of the Material so, by default, HDRP applies the **Tiling** and **Offset** of the **Base UV Map** to the **Detail Map** to synchronize the **Detail Map** and the rest of the Material Textures. HDRP then applies the **Detail Map** **Tiling** and **Offset** properties on top of the **Base Map Tiling** and **Offset**. For example, on a plane, if the **Tiling** for **Base UV Mapping** is 2, and this value is also 2, then the **Detail Map** Texture tiles by 4 on the plane.<br />This workflow allows you to change the **Tiling** of the Texture on the Material, without having to set the **Tiling** of the **Detail UV** too.<br />To separate the **Detail UV Map** from the **Base UV Map** to set it independently, disable the **Lock to Base Tiling/Offset** checkbox. |
80-
| **- Lock to Base Tiling/Offset** | Enable the checkbox to make the **Base UV Map**’s **Tiling** and **Offset** properties affect the **Detail Map**. HDRP multiplies these properties by the **Detail UV Map**’s **Tiling** and **Offset** properties respectively. To separate the **Detail UV Map** from the **Base UV Map** to set it independently, disable this checkbox. |
81-
| **Tiling** | Set an **X** and **Y** tile rate for the **Detail Map** UV. HDRP uses the **X** and **Y** values to tile the Texture assigned to the **Detail Map** across the Material’s surface, in object space. |
82-
| **Offset** | Set an **X** and **Y** offset for the **Detail Map** UV. HDRP uses the **X** and **Y** values to offset the Texture assigned to the **Detail Map** across the Material’s surface, in object space. |
83-
| **Detail Albedo Scale** | Use the slider to modulate the albedo of the detail map (red channel) between 0 and 2. This is an overlay effect. |
84-
| **Detail Normal Scale** | Use the slider to modulate the intensity of the detail normal map, between 0 and 2. The default value is 1 and has no scale. |
85-
| **Detail Smoothness Scale** | Use the slider modulate the smoothness of the detail map (blue channel) between 0 and 2, like an overlay effect. The default value is 1 and has no scale. |
67+
[!include[](snippets/shader-properties/detail-inputs.md)]
8668

8769
### Transparency Inputs
8870

com.unity.render-pipelines.high-definition/Documentation~/TableOfContents.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
* [Eye Shader](eye-shader.md)
103103
* [Hair Shader](hair-shader.md)
104104
* [Layered Lit Shader](Layered-Lit-Shader.md)
105+
* [Layered Lit Tessellation Shader](layered-lit-tessellation-shader.md)
105106
* [Lit Tessellation Shader](Lit-Tessellation-Shader.md)
106107
* [Lit Shader](Lit-Shader.md)
107108
* [Silk Shader](silk-shader.md)
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Layered Lit Tessellation Shader
2+
3+
The Layered Lit Tessellation Shader allows you to stack up to four tessellated Materials on the same GameObject in the High Definition Render Pipeline (HDRP).
4+
5+
The Materials that it uses for each layer are HDRP [Lit Tessellation Materials](Lit-Tessellation-Shader.md). This makes it easy to create layered Materials that provide adaptive vertex density for meshes. The **Main Layer** is the undermost layer and can influence upper layers with albedo, normals, and height. HDRP renders **Layer 1**, **Layer 2**, and **Layer 3** in that order on top of the **Main Layer**. For more information about Materials, Shaders, and Textures, see the[ Unity User Manual](https://docs.unity3d.com/Manual/Shaders.html).
6+
7+
## Creating a Layered Lit Tessellation Material
8+
9+
To create a new Lit Tessellation Material:
10+
11+
1. Right-click in your Project's Asset window.
12+
2. Select **Create > Material**. This adds a new Material to your Unity Project’s Asset folder.
13+
3. Select the Material and, in the Inspector, select the **Shader** drop-down.
14+
4. Select **HDRP > LayeredLitTessellation**.
15+
16+
## Properties
17+
Surface Options
18+
These properties control the overall look of your Material's surface and how Unity renders the Material on screen.
19+
20+
<table>
21+
<tr>
22+
<th>Property</th>
23+
<th>Description</th>
24+
</tr>
25+
[!include[](snippets/shader-properties/surface-options/surface-type.md)]
26+
[!include[](snippets/shader-properties/surface-options/rendering-pass.md)]
27+
[!include[](snippets/shader-properties/surface-options/blending-mode.md)]
28+
[!include[](snippets/shader-properties/surface-options/preserve-specular-lighting.md)]
29+
[!include[](snippets/shader-properties/surface-options/sorting-priority.md)]
30+
[!include[](snippets/shader-properties/surface-options/receive-fog.md)]
31+
[!include[](snippets/shader-properties/surface-options/depth-write.md)]
32+
[!include[](snippets/shader-properties/surface-options/depth-test.md)]
33+
[!include[](snippets/shader-properties/surface-options/cull-mode.md)]
34+
[!include[](snippets/shader-properties/surface-options/alpha-clipping.md)]
35+
[!include[](snippets/shader-properties/surface-options/alpha-clipping-threshold.md)]
36+
[!include[](snippets/shader-properties/surface-options/alpha-to-mask.md)]
37+
[!include[](snippets/shader-properties/surface-options/double-sided.md)]
38+
[!include[](snippets/shader-properties/surface-options/normal-mode.md)]
39+
[!include[](snippets/shader-properties/surface-options/material-type-layered.md)]
40+
[!include[](snippets/shader-properties/surface-options/transmission.md)]
41+
[!include[](snippets/shader-properties/surface-options/receive-decals.md)]
42+
[!include[](snippets/shader-properties/surface-options/geometric-specular-aa.md)]
43+
[!include[](snippets/shader-properties/surface-options/screen-space-variance.md)]
44+
[!include[](snippets/shader-properties/surface-options/gsaa-threshold.md)]
45+
[!include[](snippets/shader-properties/surface-options/displacement-mode.md)]
46+
[!include[](snippets/shader-properties/surface-options/lock-with-object-scale.md)]
47+
[!include[](snippets/shader-properties/surface-options/lock-with-height-map-tiling-rate.md)]
48+
</table>
49+
50+
51+
### Tessellation Options
52+
[!include[](snippets/shader-properties/tessellation-options.md)]
53+
54+
### Surface Inputs
55+
[!include[](snippets/shader-properties/surface-inputs/layered-surface-inputs.md)]
56+
### Layer List
57+
[!include[](snippets/shader-properties/layer-list.md)]
58+
59+
### Layers
60+
[!include[](snippets/shader-properties/layers.md)]
61+
62+
### Emission inputs
63+
<table>
64+
<tr>
65+
<th>Property</th>
66+
<th>Description</th>
67+
</tr>
68+
[!include[](snippets/shader-properties/emission-inputs/use-emission-intensity.md)]
69+
[!include[](snippets/shader-properties/emission-inputs/emissive-color.md)]
70+
[!include[](snippets/shader-properties/emission-inputs/emission-uv-mapping-layered-tessellation.md)]
71+
[!include[](snippets/shader-properties/emission-inputs/emission-uv-mapping-tiling.md)]
72+
[!include[](snippets/shader-properties/emission-inputs/emission-uv-mapping-offset.md)]
73+
[!include[](snippets/shader-properties/emission-inputs/emission-intensity.md)]
74+
[!include[](snippets/shader-properties/emission-inputs/exposure-weight.md)]
75+
[!include[](snippets/shader-properties/emission-inputs/emission-multiply-with-base.md)]
76+
</table>
77+
78+
79+
### Advanced Options
80+
<table>
81+
<tr>
82+
<th>Property</th>
83+
<th>Description</th>
84+
</tr>
85+
[!include[](snippets/shader-properties/advanced-options/enable-gpu-instancing.md)]
86+
[!include[](snippets/shader-properties/advanced-options/baked-emission.md)]
87+
[!include[](snippets/shader-properties/advanced-options/motion-vector-for-vertex-animation.md)]
88+
[!include[](snippets/shader-properties/advanced-options/specular-occlusion-mode.md)]
89+
[!include[](snippets/shader-properties/advanced-options/add-precomputed-velocity.md)]
90+
[!include[](snippets/shader-properties/advanced-options/force-forward-emissive.md)]
91+
</table>

com.unity.render-pipelines.high-definition/Documentation~/master-stack-fabric.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Depending on the [Graph Settings](#graph-settings) you use, Shader Graph can add
107107
<th>Property</th>
108108
<th>Description</th>
109109
</tr>
110-
[!include[](snippets/shader-properties/surface-options/fabric-material-type.md)]
110+
[!include[](snippets/shader-properties/surface-options/material-type-fabric.md)]
111111
[!include[](snippets/shader-properties/surface-options/surface-type.md)]
112112
[!include[](snippets/shader-properties/surface-options/rendering-pass.md)]
113113
[!include[](snippets/shader-properties/surface-options/blending-mode.md)]

com.unity.render-pipelines.high-definition/Documentation~/master-stack-stacklit.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Depending on the [Graph Settings](#graph-settings) you use, Shader Graph can add
9898
[!include[](snippets/shader-graph-blocks/iridescence-coat-fixup-tir-clamp.md)]
9999
[!include[](snippets/shader-graph-blocks/iridescence-thickness.md)]
100100
[!include[](snippets/shader-graph-blocks/iridescence-mask.md)]
101-
[!include[](snippets/shader-graph-blocks/haze-extents.md)]
101+
[!include[](snippets/shader-graph-blocks/haze-extent.md)]
102102
[!include[](snippets/shader-graph-blocks/haziness.md)]
103103
[!include[](snippets/shader-graph-blocks/hazy-gloss-max-dielectric-f0.md)]
104104
[!include[](snippets/shader-graph-blocks/lobe-mix.md)]
@@ -149,7 +149,7 @@ Depending on the [Graph Settings](#graph-settings) you use, Shader Graph can add
149149
[!include[](snippets/shader-properties/surface-options/ss-depth-offset.md)]
150150
[!include[](snippets/shader-properties/surface-options/base-color-parametrization.md)]
151151
[!include[](snippets/shader-properties/surface-options/energy-conserving-specular.md)]
152-
[!include[](snippets/shader-properties/surface-options/anisotropy.md)]
152+
[!include[](snippets/shader-properties/surface-options/anisotropy-stacklit.md)]
153153
[!include[](snippets/shader-properties/surface-options/coat.md)]
154154
[!include[](snippets/shader-properties/surface-options/coat-normal.md)]
155155
[!include[](snippets/shader-properties/surface-options/dual-specular-lobe.md)]
@@ -160,8 +160,8 @@ Depending on the [Graph Settings](#graph-settings) you use, Shader Graph can add
160160
[!include[](snippets/shader-properties/surface-options/specular-occlusion-mode-stacklit.md)]
161161
[!include[](snippets/shader-properties/surface-options/anisotropy-for-area-lights.md)]
162162
[!include[](snippets/shader-properties/surface-options/base-layer-uses-refracted-angles.md)]
163-
[!include[](snippets/shader-properties/surface-options/recompute-stack-and-iridescence.md
164-
[!include[](snippets/shader-properties/surface-options/honor-per-light-max-smoothness.md
163+
[!include[](snippets/shader-properties/surface-options/recompute-stack-and-iridescence.md)]
164+
[!include[](snippets/shader-properties/surface-options/honor-per-light-max-smoothness.md)]
165165
</table>
166166

167167
### Distortion
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<tr>
2+
<td>**Force Forward Emissive**</td>
3+
<td>Indicates whether to render the emissive contribution of this Material in a separate forward pass when the Lit Shader Mode is set to **Both** or **Deferred**. This removes a rendering artifact that makes emissive Materials appear completely black when HDRP processes them in the deferred rendering path when using either Screen Space or Ray-Traced Global Illumination.<br/>Limitation: When Unity performs a separate pass for the Emissive contribution, it also performs an additional DrawCall. This means it uses more resources on your CPU.</td>
4+
</tr>

0 commit comments

Comments
 (0)