Firstborn/Library/PackageCache/com.unity.shadergraph@12.1.11/Documentation~/Sphere-Mask-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

1.2 KiB

Sphere Mask Node

Description

Creates a sphere mask originating from input Center. The sphere is calculated using Distance and modified using the Radius and Hardness inputs. Sphere mask functionality works in both 2D and 3D spaces, and is based on the vector coordinates in the Coords input. These vector coordinates can either be 3D like world space position, or 2D like UV coordinates.

Ports

Name Direction Type Binding Description
Coords Input Dynamic Vector None Coordinate space input
Center Input Dynamic Vector None Coordinates of the sphere origin
Radius Input Float None Radius of the sphere
Hardness Input Float None Soften falloff of the sphere
Out Output Dynamic Vector None Output mask value

Generated Code Example

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

void Unity_SphereMask_float4(float4 Coords, float4 Center, float Radius, float Hardness, out float4 Out)
{
    Out = 1 - saturate((distance(Coords, Center) - Radius) / (1 - Hardness));
}