Firstborn/Library/PackageCache/com.unity.shadergraph@12.1.11/Documentation~/Normal-Reconstruct-Z-Node.md
Schaken-Mods 9092858a58 updated to the latest editor
I updated everything to the latest Unity Editor. Also realized I had the wrong shaders on my hairs, those are fixed and the hairs look MUCH better!
2023-05-07 17:43:11 -05:00

26 lines
712 B
Markdown

# Normal Reconstruct Z Node
## Description
Derives the correct Z value for generated normal maps using a given **X** and **Y** value from input **In**.
## Ports
| Name | Direction | Type | Description |
|:------------ |:-------------|:-----|:---|
| In | Input | Vector 2 | Normal X and Y value |
| Out | Output | Vector 3 | Output value |
## Generated Code Example
The following example code represents one possible outcome of this node.
```
void Unity_NormalReconstructZ_float(float2 In, out float3 Out)
{
float reconstructZ = sqrt(1.0 - saturate(dot(In.xy, In.xy)));
float3 normalVector = float3(In.x, In.y, reconstructZ);
Out = normalize(normalVector);
}
```