-
Notifications
You must be signed in to change notification settings - Fork 0
Material Expressions
Ryan Sweeney edited this page May 10, 2024
·
7 revisions
- UV - Vector2
- Return - Distance Field - Scalar
- Return - Stencil - Scalar
- Return - Process Mask - Scalar
This material expression allows you to easily access the distance field with various options which are as follows:
- Distance Field Index - the settings index found in Project Settings.
- Outline Side - sets the distance field values so that they either cross the edge or sit on either side. The edge is determined by the stencil which can also be accessed in the expression.
The Distance Field returned value is the sampled result and the Stencil is the sampled stencil value.
The options for Distance Field Side:
- Both - DEFAULT - crosses the edge.
- Inside Only - All outside values will be set to a distance of 1.
- Outside Only - All inside values will be set to a distance of 1.
- Pixel Extent - Scalar
- Returns - Output - Scalar
This is a helper function that converts the current resolution to pixel values. 1px is calculated as follows - 1 / Max(ViewSize.x, ViewSize.y)