This documentation is for a prerelease version of O3DE. Click here to switch to the latest release, or select a version from the dropdown.

Version:

Gradient Mixer Component

The Gradient Mixer component generates a new gradient by blending a number of input gradient layers with layer blending operations.

Provider

Gradient Signal Gem

Gradient Mixer properties

Gradient Mixer component properties

PropertyDescriptionValuesDefault
PreviewDisplays the output gradient of this component, in world space, after all properties are applied. Select the Show Larger Preview button to view a separate dockable window with a larger preview gradient.
Pin Preview to ShapeSets an entity with a compatible Shape component to use as the position and bounding box of the preview.EntityIdCurrent Entity
Preview PositionSets the world location of the preview.

This field is available only if there is no entity selected in Pin Preview to Shape.
Vector3: -Infinity to InfinityX:0.0, Y:0.0, Z:0.0
Preview SizeSets the dimensions of the preview.Vector3: 0.0 to InfinityX:1.0, Y:1.0, Z:1.0
Constrain to ShapeIf Enabled, the gradient preview only displays the gradient that lies within the shape of the entity selected in Pin Preview to Shape.

This field is available only if an entity is selected in Pin Preview to Shape.
BooleanDisabled
LayersAn array of gradients and gradient operations to evaluate. Gradient operations are applied in the same order as this array.
Layers - EnabledToggles the influence of this gradient layer.BooleanEnabled
Layers - OperationSets the function that is used to mix this gradient layer with the result of all previous layers. Refer to the Gradient mixing operations section that follows for more information.Initialize, Multiply, Linear Dodge (Add), Subtract, Darken (Min), Lighten (Max), Average, Normal, or Overlay.Initialize
Layers - GradientRefer to the Gradient properties section that follows.

Gradient properties

Gradient properties

PropertyDescriptionValuesDefault
Gradient Entity IdSets an entity with an active Gradient or Gradient Modifier component.EntityIdNone
OpacitySets the opacity of the input gradient.Float: 0.0 - 1.01.0
Invert InputInverts the values of the input gradient.BooleanDisabled
Preview (Input)Displays the gradient provided by the entity set in Gradient Entity Id with the following gradient properties applied.
Enable TransformIf Enabled, the translation, scale, and rotation of the input gradient may be modified.BooleanDisabled
TranslateSets the translation of the input gradient.Vector3: -Infinity to InfinityX:0.0, Y:0.0, Z:0.0
ScaleSets the scale of the input gradient.Vector3: 0.0001 to InfinityX:1.0, Y:1.0, Z:1.0
RotateSets the rotation of the input gradient.Vector3: -Infinity to InfinityX:0.0, Y:0.0, Z:0.0
Enable LevelsIf Enabled, the input and output values of the input gradient may be modified by the following properties.BooleanDisabled
Input MidRemaps the midpoint of values greater than 0 and less than 1 in the input gradient. An Input Mid value of 0.5 will result in a darker output gradient. An Input Mid value of 2.0 will result in a lighter output gradient.Float: 0.0 - 10.01.0
Input MinRemaps the input gradient so that it lies between Input Min and Input Max. All output gradient values less than or equal to Input Min are set to 0.Float: 0.0 - 1.00.0
Input MaxRemaps the input gradient so that it lies between Input Min and Input Max. All output gradient values greater than or equal to Input Max are set to 1.Float: 0.0 - 1.01.0
Output MinSets a minimum value for the output gradient. Remaps the input gradient so that it lies between Output Min and Output Max.Float: 0.0 - 1.00.0
Output MaxSets a maximum value for the output gradient. Remaps the input gradient so that it lies between Output Min and Output Max.Float: 0.0 - 1.01.0

Gradient mixing operations

The following examples mix these gradients:

First GradientSecond Gradient
Linear ramp gradientNoise gradient
Note:
The Opacity property of a gradient applies after its Operation.
Mixing OperationDescriptionMixed Gradient
InitializeInitializes the values of the mixed gradient to the values of the current gradient layer. Unlike the Normal operation, when Opacity is less than 1, the current gradient layer will not blend with the result of previous layers.Example gradients mixed with the initialize operation
MultiplyMultiplies the values of the current gradient with the result of previous layers.Example gradients mixed with the multiply operation
Linear Dodge (Add)Adds the values of the current gradient with the result of previous layers.Example gradients mixed with the linear dodge-add operation
SubtractSubtracts the values of the current gradient from the result of previous layers.Example gradients mixed with the subtract operation
Darken (Min)Selects the minimum value from the current gradient and the result of previous layers.Example gradients mixed with the darken-min operation
Lighten (Max)Selects the maximum value from the current gradient and the result of previous layers.Example gradients mixed with the lighten-max operation
AverageAverages the values of the current gradient and the result of previous layers.Example gradients mixed with the average operation
NormalUses the value of Opacity to average the values of the current gradient and the result of previous layers. Selects the value of the current gradient if Opacity equals 1.Example gradients mixed with the normal operation
OverlayIncreases the contrast of high and low values in the mixed gradient. If the result of previous layers has a value less than .5, the operation will darken the blend of gradients. For values greater than .5 the blend of gradients becomes lighter.Example gradients mixed with the overlay operation

MixedGradientRequestBus

Use the following request functions with the MixedGradientRequestBus EBus interface to communicate with Gradient Mixer components in your game.

Method NameDescriptionParameterReturnScriptable
AddLayerAdds a layer to the end of the Layers array.Mixed Gradient LayerNoneYes
GetLayerReturns the mixed gradient layer at the specified index.Layer Index: IntegerMixed Gradient LayerYes
GetNumLayersReturns the number of mixed gradient layers.NoneCount: IntegerYes
RemoveLayerRemoves the mixed gradient layer at the specified index.Layer Index: IntegerNoneYes