|
1 |
| -# Emission Node |
| 1 | +# Emission node |
2 | 2 |
|
3 |
| -The Emission Node allows you to apply emission in your Shader Graph. |
| 3 | +The Emission node outputs a color that makes a material appear as a visible source of light. |
4 | 4 |
|
5 | 5 | ## Render pipeline compatibility
|
6 | 6 |
|
7 |
| -| **Node** | **Universal Render Pipeline (URP)** | **High Definition Render Pipeline (HDRP)** | |
8 |
| -| -------- | ----------------------------------- | ------------------------------------------ | |
9 |
| -| Emission | No | Yes | |
| 7 | +The Emission node is compatible only with the High Definition Render Pipeline (HDRP). |
10 | 8 |
|
11 | 9 | ## Ports
|
12 | 10 |
|
13 |
| -| Name | Direction | Type | Description | |
14 |
| -| :------------ | :-------- | :------------- | :----------------------------------------------------------- | |
15 |
| -| **color** | Input | LDR Color(RGB) | Sets the low dynamic range (LDR) color of the emission. | |
16 |
| -| **intensity** | Input | Float | Sets the intensity of the emission color. | |
17 |
| -| **output** | Output | HDR Color(RGB) | Outputs the high dynamic range (HDR) color that this Node produces. | |
| 11 | +| **Name** | **Direction** | **Type** | **Description** | |
| 12 | +|-|-|-|-| |
| 13 | +| **Color** | Input | Low dynamic range (LDR) RGB color | Sets the low dynamic range (LDR) color to make emissive. | |
| 14 | +| **Intensity** | Input | Float | Sets the intensity of the emission of the output color. | |
| 15 | +| **Exposure Weight** | Input | Float | Sets how much the [exposure](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/Override-Exposure.html) of the scene affects emission. The range is between 0 and 1. A value of 0 means that exposure does not affect this part of the emission. A value of 1 means that exposure fully affects this part of the emission. | |
| 16 | +| **Output** | Output | High dynamic range (HDR) RGB color | The emissive color. | |
18 | 17 |
|
19 |
| -## Notes |
| 18 | +## Properties |
20 | 19 |
|
21 |
| -### Emission Unit |
| 20 | +| **Name** | **Description** | |
| 21 | +|-|-| |
| 22 | +| **Intensity Unit** | Sets the unit of the **Intensity** property. For more information, refer to [Understand physical light units](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/Physical-Light-Units.html). The options are: <ul><li>**Nits**: Sets the units as nits, which is a measure of luminance, the surface power of a light source.</li><li>**EV100**: Sets the units as EV<sub>100</sub>, which is a measure of exposure value.</li></ul> | |
| 23 | +| **Normalize Color** | Adjusts the intensity of the input color so the red, green, and blue values look similar. As a result, colors are more balanced in the **Output**. | |
22 | 24 |
|
23 |
| -You can use two [physical light units](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/Physical-Light-Units.html) to control the strength of the emission: |
| 25 | +## Generated code example |
24 | 26 |
|
25 |
| -* [Nits](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/Physical-Light-Units.html%23Nits). |
26 |
| -* [EV<sub>100</sub>](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/Physical-Light-Units.html%23EV). |
| 27 | +```hlsl |
| 28 | +float3 Unity_HDRP_GetEmissionHDRColor_float(float3 ldrColor, float luminanceIntensity, float exposureWeight) |
| 29 | +{ |
| 30 | + // Convert the LDR color. This line is generated only if Normalize Color is enabled. |
| 31 | + ldrColor = ldrColor * rcp(max(Luminance(ldrColor), 1e-6)); |
27 | 32 |
|
| 33 | + float3 hdrColor = ldrColor * luminanceIntensity; |
| 34 | + float inverseExposureMultiplier = GetInverseCurrentExposureMultiplier(); |
| 35 | + hdrColor = lerp(hdrColor * inverseExposureMultiplier, hdrColor, exposureWeight); |
| 36 | + return hdrColor; |
| 37 | +} |
| 38 | +``` |
28 | 39 |
|
29 |
| -### Exposure Weight |
30 |
| -You can use Exposure Weight to determine how exposure affects emission. It is a value between **0** and **1** where. A value of **0** means that exposure does not effect this part of the emission. A value of **1** means that exposure fully affects this part of the emission. |
| 40 | +## Additional resources |
| 41 | + |
| 42 | +- [Add light emission to a material](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterEmission.html) |
0 commit comments