Keywords
Last updated
Last updated
Advanced Dissolve is not just a one shader effect, it is a collection of various multiple effects that can be turned on/off any time, mixed together or used separately. Each of those effects is controlled using its own individual shader keyword.
All Advanced Dissolve keywords in material editor have background:
Advanced Dissolve shader has 9 groups of effects controlled by 39 keywords:
_AD_STATE_DISABLED
_AD_STATE_ENABLED
_AD_CUTOUT_STANDARD_SOURCE_NONE
_AD_CUTOUT_STANDARD_SOURCE_BASE_ALPHA
_AD_CUTOUT_STANDARD_SOURCE_CUSTOM_MAP
_AD_CUTOUT_STANDARD_SOURCE_TWO_CUSTOM_MAPS
_AD_CUTOUT_STANDARD_SOURCE_THREE_CUSTOM_MAPS
_AD_CUTOUT_STANDARD_SOURCE_USER_DEFINED
_AD_CUTOUT_STANDARD_SOURCE_MAPS_MAPPING_TYPE_DEFAULT
_AD_CUTOUT_STANDARD_SOURCE_MAPS_MAPPING_TYPE_TRIPLANAR
_AD_CUTOUT_STANDARD_SOURCE_MAPS_MAPPING_TYPE_SCREEN_SPACE
_AD_CUTOUT_GEOMETRIC_TYPE_NONE
_AD_CUTOUT_GEOMETRIC_TYPE_XYZ
_AD_CUTOUT_GEOMETRIC_TYPE_PLANE
_AD_CUTOUT_GEOMETRIC_TYPE_SPHERE
_AD_CUTOUT_GEOMETRIC_TYPE_CUBE
_AD_CUTOUT_GEOMETRIC_TYPE_CAPSULE
_AD_CUTOUT_GEOMETRIC_COUNT_ONE
_AD_CUTOUT_GEOMETRIC_COUNT_TWO
_AD_CUTOUT_GEOMETRIC_COUNT_THREE
_AD_CUTOUT_GEOMETRIC_COUNT_FOUR
_AD_EDGE_BASE_SOURCE_NONE
_AD_EDGE_BASE_SOURCE_CUTOUT_STANDARD
_AD_EDGE_BASE_SOURCE_CUTOUT_GEOMETRIC
_AD_EDGE_BASE_SOURCE_ALL
_AD_EDGE_ADDITIONAL_COLOR_NONE
_AD_EDGE_ADDITIONAL_COLOR_BASE_COLOR
_AD_EDGE_ADDITIONAL_COLOR_CUSTOM_MAP
_AD_EDGE_ADDITIONAL_COLOR_GRADIENT_MAP
_AD_EDGE_ADDITIONAL_COLOR_GRADIENT_COLOR
_AD_EDGE_ADDITIONAL_COLOR_USER_DEFINED
_AD_EDGE_UV_DISTORTION_SOURCE_DEFAULT
_AD_EDGE_UV_DISTORTION_SOURCE_CUSTOM_MAP
_AD_GLOBAL_CONTROL_ID_NONE
_AD_GLOBAL_CONTROL_ID_ONE
_AD_GLOBAL_CONTROL_ID_TWO
_AD_GLOBAL_CONTROL_ID_THREE
_AD_GLOBAL_CONTROL_ID_FOUR
In Unity 2019.4 and later versions all keywords are local and they do not contribute towards Unity’s global keyword count limit (256).
Kewords in materials can be enabled/disabled using Unity's Material.EnableKeyword and Material.DisableKeyword methods, or using Advanced Dissolve controller script explained in the Run-time API chapter.
SRP Batcher compatible shaders are keywords free. All used keywords are baked inside shader and unused ones are removed.