Skip to content

Commit 41aa8ed

Browse files
markg-unityEvergreen
authored andcommitted
DOCG-7342 Improvements to Dither node docs
1 parent a79ae44 commit 41aa8ed

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

Packages/com.unity.shadergraph/Documentation~/Dither-Node.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
# Dither Node
1+
# Dither node
22

3-
## Description
3+
The Dither node adds a structured form of noise to the input. Use the Dither node to reduce the color bands that might appear if you move from a high number of colors to a low number (quantizing), or to simulate transparency by adding random alpha pixels to an opaque object.
44

5-
Dither is an intentional form of noise used to randomize quantization error. It is used to prevent large-scale patterns such as color banding in images. The **Dither** node applies dithering in screen-space to ensure a uniform distribution of the pattern. This can be adjusted by connecting another node to input **Screen Position**.
5+
The Dither node applies dithering in screen space to ensure a uniform distribution of the pattern. To change the space the node uses, connect another node to the **Screen Position** input, such as a [UV node](UV-Nodes.md).
66

7-
This [Node](Node.md) is commonly used as an input to **Alpha Clip Threshold** on the [Master Node](Master-Stack.md) to give the appearance of transparency to an opaque item. This is useful for creating geometry that appears to be transparent but has the advantages of rendering as opaque, such as writing depth or being rendered in deferred.
7+
To use a dither pattern for transparency, connect the Dither node to the **Alpha Clip Threshold** input in the [Master Stack](Master-Stack.md). As a result, when you adjust the overall alpha value of the material, some pixels are discarded because the alpha value is lower than their alpha clip threshold. This technique is useful for creating geometry that appears to be transparent but has the advantages of rendering as opaque, such as writing to the depth buffer or rendering using a deferred [rendering path](https://docs.unity3d.com/Manual/built-in-rendering-paths.html).
88

99
## Ports
1010

11-
| Name | Direction | Type | Binding | Description |
11+
| **Name** | **Direction** | **Type** | **Binding** | **Description** |
1212
|:------------ |:-------------|:-----|:---|:---|
13-
| In | Input | Dynamic Vector | None | Input value |
14-
| Screen Position | Input | Vector 4 | Screen Position | Coordinates used to apply dither pattern |
15-
| Out | Output | Dynamic Vector | None | Output value |
13+
| **In** | Input | Dynamic vector | None | The input to dither. The noise stays within the overall minimum and maximum range of the input values. |
14+
| **Screen Position** | Input | Vector 4 | Screen Position | The coordinates Unity uses to calculate the dither pattern. For more information about the options, refer to the [Screen Position node](Screen-Position-Node.md). |
15+
| **Out** | Output | Dynamic vector | None | The dithered output. |
1616

17-
## Generated Code Example
17+
## Generated code example
1818

1919
The following example code represents one possible outcome of this node.
2020

@@ -33,3 +33,4 @@ void Unity_Dither_float4(float4 In, float4 ScreenPosition, out float4 Out)
3333
Out = In - DITHER_THRESHOLDS[index];
3434
}
3535
```
36+

0 commit comments

Comments
 (0)