Skip to content

Fix Vertex Color Mode documentation #4976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 8, 2021
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
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed remapping of depth pyramid debug view
- Fixed an issue with asymmetric projection matrices and fog / pathtracing. (case 1330290).
- Fixed gbuffer depth debug mode for materials not rendered during the prepass.
- Fixed Vertex Color Mode documentation for layered lit shader.

### Changed
- Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
| **World Scale** | Set the world-space size of the Texture in meters. If you set this to **1**, then HDRP maps the Texture to 1 meter in world space.If you set this to **2**, then HDRP maps the Texture to 0.5 meters in world space.This property only appears when you select **Planar** or **Triplanar** from the **BlendMask UV Mapping** drop-down. |
| **Tiling** | Set an **X** and **Y** tile rate for the **Layer Mask** UV. HDRP uses the **X** and **Y** values to tile the Texture assigned to the **Layer Mask** across the Material’s surface, in object space. |
| **Offset** | Set an **X** and **Y** offset for the **Layer Mask** UV. HDRP uses the **X** and **Y** values to offset the Texture assigned to the **Layer Mask** from the Material’s surface, in object space. |
| **Vertex Color Mode** | Use the drop-down to select the method HDRP uses to combine the **Layer Mask** to manager layer visibility.<br/>&#8226; **None**: Only the **Layer Mask** affects visibility. HDRP does not combine it with vertex colors.<br/>&#8226; **Multiply**: Multiplies the vertex colors from a layer with the corresponding values from the channel in the **Layer Mask** that represents that layer. The default value for a pixel in the mask is 1. Multiplying the vertex colors of a layer by the **Layer Mask** reduces the intensity of that layer, unless the value in the **Layer Mask** is 1.<br/>&#8226; **Add**: Remaps vertex color values to between 0 and 1, and then adds them to the corresponding values from the channel in the **Layer Mask** that represents that layer. **Layer Mask** values between 0 and 0.5 reduce the effect of that layer, values between 0.5 and 1 increase the effect of that layer. |
| **Vertex Color Mode** | Use the drop-down to select the method HDRP uses to combine the **Layer Mask** to manager layer visibility.<br/>&#8226; **None**: Only the **Layer Mask** affects visibility. HDRP does not combine it with vertex colors.<br/>&#8226; **Multiply**: Multiplies the vertex colors from a layer with the corresponding values from the channel in the **Layer Mask** that represents that layer. The default value for a pixel in the mask is 1. Multiplying the vertex colors of a layer by the **Layer Mask** reduces the intensity of that layer, unless the value in the **Layer Mask** is 1.<br/>&#8226; **Add**: Remaps vertex color values to between -1 and 1, and then adds them to the corresponding values from the channel in the **Layer Mask** that represents that layer. Vertex color values between 0 and 0.5 reduce the effect of that layer, values between 0.5 and 1 increase the effect of that layer. |
| **Main Layer Influence** | Enable the checkbox to allow the **Main Layer** to influence the albedo, normal, and height of **Layer 1**, **Layer 2**, and **Layer 3**. You can change the strength of the influence for each layer. |
| **Use Height Based Blend** | Enable the checkbox to blend the layers with a heightmap. HDRP then evaluates the height of each layer to check whether to display that layer or the layer above. |
| **Height Transition** | Use the slider to set the transition blend size between the Materials in each layer. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,14 +504,10 @@ float4 GetBlendMask(LayerTexCoord layerTexCoord, float4 vertexColor, bool useLod
// Settings this specific Main layer blend mask in alpha allow to be transparent in case we don't use it and 1 is provide by default.
float4 blendMasks = useLodSampling ? SAMPLE_UVMAPPING_TEXTURE2D_LOD(_LayerMaskMap, sampler_LayerMaskMap, layerTexCoord.blendMask, lod) : SAMPLE_UVMAPPING_TEXTURE2D(_LayerMaskMap, sampler_LayerMaskMap, layerTexCoord.blendMask);

// Wind uses vertex alpha as an intensity parameter.
// So in case Layered shader uses wind, we need to hardcode the alpha here so that the main layer can be visible without affecting wind intensity.
// It also means that when using wind, users can't use vertex color to modulate the effect of influence from the main layer.
float4 maskVertexColor = vertexColor;
#if defined(_LAYER_MASK_VERTEX_COLOR_MUL)
blendMasks *= saturate(maskVertexColor);
blendMasks *= saturate(vertexColor);
#elif defined(_LAYER_MASK_VERTEX_COLOR_ADD)
blendMasks = saturate(blendMasks + maskVertexColor * 2.0 - 1.0);
blendMasks = saturate(blendMasks + vertexColor * 2.0 - 1.0);
#endif

return blendMasks;
Expand Down