Skip to content

Commit

Permalink
DOC-1737 Edited the Clear Coat docs. (#2106)
Browse files Browse the repository at this point in the history
* Edited the Clear Coat docs.

* Renamed complex-lit-shader.md to shader-complex-lit.md

* Edited the Complex Lit intro, added it to TOC.

* Change from Erik.
  • Loading branch information
oleks-k authored Oct 7, 2020
1 parent af3805b commit 1498f28
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@

* [Shaders and Materials](shaders-in-universalrp.md)
* [Shading Models](shading-model.md)
* [Complex Lit](shader-complex-lit.md)
* [Lit](lit-shader.md)
* [Simple Lit](simple-lit-shader.md)
* [Baked Lit](baked-lit-shader.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The __Surface Inputs__ describe the surface itself. For example, you can use the
| __Base Map__ | Adds color to the surface, also known as the diffuse map. To assign a Texture to the __Base Map__ setting, click the object picker next to it. This opens the Asset Browser, where you can select from the Textures in your Project. Alternatively, you can use the [color picker](https://docs.unity3d.com/Manual/EditingValueProperties.html). The color next to the setting shows the tint on top of your assigned Texture. To assign another tint, you can click this color swatch. If you select __Transparent__ or __Alpha Clipping__ under __Surface Options__, your Material uses the Texture’s alpha channel or color. |
| __Metallic / Specular Map__ | Shows a map input for your chosen __Workflow Mode__ in the __Surface Options__.<br/>For the [__Metallic Map__](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterMetallic.html) workflow, the map gets the color from the __Base Map__ assigned above. Use the slider to control how metallic the surface appears. 1 is fully metallic, like silver or copper, and 0 is fully dielectric, like plastic or wood. You can generally use values in between 0 and 1 for dirty or corroded metals.<br/>For the [__Specular Map__](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterSpecular.html) setting, you can assign a texture to it by clicking the object picker next to it. This opens the Asset Browser, where you can select from the Textures in your Project. Alternatively, you can use the [color picker](https://docs.unity3d.com/Manual/EditingValueProperties.html).<br/>For both workflows, you can use the __Smoothness__ slider to control the spread of highlights on the surface. 0 gives a wide, rough highlight. 1 gives a small, sharp highlight like glass. Values in between produce semi-glossy looks. For example, 0.5 produces a plastic-like glossiness.<br/>Use the __Source__ drop-down menu to select where the shader samples a smoothness map from. Options are: __Metallic Alpha__ (alpha channel from the metallic map), and __Albedo Alpha__ (alpha channel from the base map). The default value is __Metallic Alpha__.<br/>If the selected source has the alpha channel, the shader samples the channel and multiplies each sample by the __Smoothness__ value. |
| __Normal Map__ | Adds a normal map to the surface. With a [normal map](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterNormalMap.html?), you can add surface details like bumps, scratches and grooves. To add the map, click the object picker next to it. The normal map picks up ambient lighting in the environment. <br/>The float value next to the setting is a multiplier for the effect of the __Normal Map__. Low values decrease the effect of the normal map. High values create stronger effects. |
| __Height Map__ | URP implements the parallax mapping technique which uses the [height map](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterHeightMap.html?) to achieve surface-level occlusion effect by shifting the areas of the visible surface texture. To add the map, click the object picker next to it. <br/>The float value next to the setting is a multiplier for the effect of the __Height Map__. Low values decrease the effect of the height map. High values create stronger effects. |
| __Height Map__ | URP implements the parallax mapping technique which uses the [height map](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterHeightMap.html) to achieve surface-level occlusion effect by shifting the areas of the visible surface texture. To add the map, click the object picker next to it. <br/>The float value next to the setting is a multiplier for the effect of the __Height Map__. Low values decrease the effect of the height map. High values create stronger effects. |
| __Occlusion Map__ | Select an [occlusion map](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterOcclusionMap.html). This simulates shadows from ambient light and reflection, which makes lighting look more realistic as less light reaches corners and crevices of objects. To select the occlusion map, click the object picker next to it. |
| __Emission__ | Makes the surface look like it emits lights. When enabled, the __Emission Map__ and __Emission Color__ settings appear.<br/>To assign an __Emission Map__, click the object picture next to it. This opens the Asset Browser, where you can select from the textures in your Project.<br/>For __Emission Color__, you can use the [color picker](https://docs.unity3d.com/Manual/EditingValueProperties.html) to assign a tint on top of the color. This can be more than 100% white, which is useful for effects like lava, that shines brighter than white while still being another color.<br/>If you have not assigned an __Emission Map__, the __Emission__ setting only uses the tint you’ve assigned in __Emission Color__.<br/>If you do not enable __Emission__, URP sets the emission to black and does not calculate emission. |
| __Tiling__ | A 2D multiplier value that scales the Texture to fit across a mesh according to the U and V axes. This is good for surfaces like floors and walls. The default value is 1, which means no scaling. Set a higher value to make the Texture repeat across your mesh. Set a lower value to stretch the Texture. Try different values until you reach your desired effect. |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Complex Lit Shader

The Complex Lit Shader is similar to the Lit shader, but it adds advanced material features. These features often are considerably more resource intensive and therefore are only supported on [Unity Shader Model 4.5](https://docs.unity3d.com/Manual/SL-ShaderCompileTargets.html) hardware. Complex Lit shader is always rendered using forward rendering and used as a fallback shader in deferred rendering. Complex Lit contains all the features that are incompatible with deferred rendering. This Shader uses the most computationally heavy [shading model](shading-model.md) in the Universal Render Pipeline (URP).
The Complex Lit Shader contains all the functionality of the Lit shader and adds advanced material features. Some features in this shader might be considerably more resource-intensive and require [Unity Shader Model 4.5](https://docs.unity3d.com/Manual/SL-ShaderCompileTargets.html) hardware.

In the Deferred Rendering Path, URP renders objects that have the Complex Lit shader using the Forward Rendering Path. If the hardware of the target platform does not support features in the Complex Lit shader, URP uses the Lit shader instead.

## Using the Complex Lit Shader in the Editor

Expand Down Expand Up @@ -49,12 +51,26 @@ The __Surface Inputs__ describe the surface itself. For example, you can use the
| __Base Map__ | Adds color to the surface, also known as the diffuse map. To assign a Texture to the __Base Map__ setting, click the object picker next to it. This opens the Asset Browser, where you can select from the Textures in your Project. Alternatively, you can use the [color picker](https://docs.unity3d.com/Manual/EditingValueProperties.html). The color next to the setting shows the tint on top of your assigned Texture. To assign another tint, you can click this color swatch. If you select __Transparent__ or __Alpha Clipping__ under __Surface Options__, your Material uses the Texture’s alpha channel or color. |
| __Metallic / Specular Map__ | Shows a map input for your chosen __Workflow Mode__ in the __Surface Options__.<br/>For the [__Metallic Map__](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterMetallic.html) workflow, the map gets the color from the __Base Map__ assigned above. Use the slider to control how metallic the surface appears. 1 is fully metallic, like silver or copper, and 0 is fully dielectric, like plastic or wood. You can generally use values in between 0 and 1 for dirty or corroded metals.<br/>For the [__Specular Map__](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterSpecular.html) setting, you can assign a texture to it by clicking the object picker next to it. This opens the Asset Browser, where you can select from the Textures in your Project. Alternatively, you can use the [color picker](https://docs.unity3d.com/Manual/EditingValueProperties.html).<br/>For both workflows, you can use the __Smoothness__ slider to control the spread of highlights on the surface. 0 gives a wide, rough highlight. 1 gives a small, sharp highlight like glass. Values in between produce semi-glossy looks. For example, 0.5 produces a plastic-like glossiness.<br/>Use the __Source__ drop-down menu to select where the shader samples a smoothness map from. Options are: __Metallic Alpha__ (alpha channel from the metallic map), and __Albedo Alpha__ (alpha channel from the base map). The default value is __Metallic Alpha__.<br/>If the selected source has the alpha channel, the shader samples the channel and multiplies each sample by the __Smoothness__ value. |
| __Normal Map__ | Adds a normal map to the surface. With a [normal map](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterNormalMap.html?), you can add surface details like bumps, scratches and grooves. To add the map, click the object picker next to it. The normal map picks up ambient lighting in the environment. <br/>The float value next to the setting is a multiplier for the effect of the __Normal Map__. Low values decrease the effect of the normal map. High values create stronger effects. |
| __Height Map__ | URP implements the parallax mapping technique which uses the [height map](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterHeightMap.html) to achieve surface-level occlusion effect by shifting the areas of the visible surface texture. To add the map, click the object picker next to it. <br/>The float value next to the setting is a multiplier for the effect of the __Height Map__. Low values decrease the effect of the height map. High values create stronger effects. |
| __Occlusion Map__ | Select an [occlusion map](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterOcclusionMap.html). This simulates shadows from ambient light and reflection, which makes lighting look more realistic as less light reaches corners and crevices of objects. To select the occlusion map, click the object picker next to it. |
| __Clear Coat Map__ | Adds a second material layer which simulates a transparent and thin coating on top of the base material. The feature is enabled by checking the Clear Coat checkbox. Setting the mask to 0 does not disable the feature.<br/>Clear coat has roughly twice the cost of a base material as lighting is evaluated once per layer. Clear coat has effect mask (intensity) and a smoothness features. The IOR of the coat is fixed to 1.5.<br/>The clear coat can be controlled using a map where the red channel represents the mask property and the green channel represents the smoothness property. If a map is provided then the constant values for mask are used as multipliers for the map's per pixel values. The clear coat affects slightly the color and the smoothness values of the underlying base material.<br/>Clear coat support on OpenGL ES is restricted to 3.1 and up.|
| __Clear Coat__ | Select this check box to enable the Clear Coat feature. The feature adds a second material layer which simulates a transparent and thin coating on top of the base material. The feature affects the color and the Smoothness values of the underlying base material slightly. The index of refraction (IOR) of the Clear Coat is 1.5.<br/>**Performance impact**: Rendering Clear Coat has roughly twice the cost of rendering a base material, because the lighting is evaluated once per layer.<br/>**Mask**: This property defines the intensity of the effect: 0 - no effect, 1 - maximum effect. Setting the Mask value to 0 does not disable the feature.<br/>**Smoothness**: This property defines the spread of highlights on the surface. 0 gives wide, rough highlights. 1 gives sharp, glasslike highlights.<br/>There is the Clear Coat map property to the left of the Mask property. The channels have the following mapping:<br/>Red: the Mask property.<br/>Green: the Smoothness property.<br/>If a Clear Coat map is present, URP multiplies the map's pixel values by value of the Mask property. |
| __Emission__ | Makes the surface look like it emits lights. When enabled, the __Emission Map__ and __Emission Color__ settings appear.<br/>To assign an __Emission Map__, click the object picture next to it. This opens the Asset Browser, where you can select from the textures in your Project.<br/>For __Emission Color__, you can use the [color picker](https://docs.unity3d.com/Manual/EditingValueProperties.html) to assign a tint on top of the color. This can be more than 100% white, which is useful for effects like lava, that shines brighter than white while still being another color.<br/>If you have not assigned an __Emission Map__, the __Emission__ setting only uses the tint you’ve assigned in __Emission Color__.<br/>If you do not enable __Emission__, URP sets the emission to black and does not calculate emission. |
| __Tiling__ | A 2D multiplier value that scales the Texture to fit across a mesh according to the U and V axes. This is good for surfaces like floors and walls. The default value is 1, which means no scaling. Set a higher value to make the Texture repeat across your mesh. Set a lower value to stretch the Texture. Try different values until you reach your desired effect. |
| __Offset__ | The 2D offset that positions the Texture on the mesh. To adjust the position on your mesh, move the Texture across the U or V axes. |

### Detail Inputs

Use the __Detail Inputs__ settings to add extra details to the surface.

__Requirement__: GPU supporting shader model 2.5 or higher.

| Property | Description |
| --------------------------- | ------------------------------------------------------------ |
| __Mask__ | Select a texture that defines areas where Unity overlays the Detail maps over the Surface Inputs maps. The mask uses the alpha channel of the selected texture. The __Tiling__ and __Offset__ settings have no effect on the mask. |
| __Base Map__ | Select the texture containing the surface details. Unity blends this map with the Surface Base Map using the overlay mode. |
| __Normal Map__ | Select the texture containing the normal vector data. Use a [normal map](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterNormalMap.html?) to add surface details like bumps, scratches and grooves.<br/>Use the slider next to the setting to change the intensity of the effect of the map. The default value is 1. |
| __Tiling__ | Use this setting to scale the __Base Map__ and the __Normal Map__ on the mesh along the U and V axes, so that the maps fit the mesh best. The default value is 1. Select a value higher than one to make the maps repeat themselves across the mesh. Set a value lower than 1 to stretch the maps. |
| __Offset__ | The offset that moves the __Base Map__ and the __Normal Map__ on the mesh along the U and V axes. |

### Advanced

Expand All @@ -72,14 +88,16 @@ The __Advanced__ settings affect the underlying calculations of your rendering.

This Shader uses [channel packing](http://wiki.polycount.com/wiki/ChannelPacking), so you can use a single RGBA texture for the metallic, smoothness and occlusion properties. When you use texture packing, you only have to load one texture into memory instead of three separate ones. When you write your texture maps in a program like Substance or Photoshop, you can pack the maps like this:

**Base Map**

| Channel | Property |
| :-------- | ---------- |
| **Red** | Metallic |
| **Green** | Occlusion |
| **Blue** | None |
| **Alpha** | Smoothness |

### Clear Coat Map
**Clear Coat Map**

| Channel | Property |
| :-------- | ---------- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

The Universal Render Pipeline uses a different shading approach than the Unity built-in Render Pipeline. As a result, built-in Lit and custom Lit Shaders do not work with the URP. Instead, URP has a new set of standard Shaders. URP provides the following Shaders for the most common use case scenarios:

- [Complex Lit](shader-complex-lit.md)
- [Lit](lit-shader.md)
- [Simple Lit](simple-lit-shader.md)
- [Baked Lit](baked-lit-shader.md)
Expand Down

0 comments on commit 1498f28

Please sign in to comment.