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:

Slope Gradient Component

Add the Slope Gradient component to generate a normalized gradient from a slope range. The output gradient may be optionally constrained by surface tags.

Provider

Gradient Signal Gem

Slope Gradient properties

Slope Gradient component properties

PropertyDescriptionValuesDefault
PreviewDisplays the output gradient of this component after all properties are applied.
Pin Preview to ShapeSets an entity with a compatible Shape component to use as the bounds of the preview if Constrain to Shape is Enabled.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 uses the bounds 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
Surface Tags to trackAn optional array of surface tags. This component will generate a gradient only where these surface tags exist.Array: Surface TagsNone
Slope MinSets the minimum surface slope angle that generates a gradient value.Float: 0.0 - 90.00.0
Slope MaxSets the maximum surface slope angle that generates a gradient value.Float: 0.0 - 90.020.0
Ramp TypeSets the function used to interpolate between slope ranges.Linear Ramp Down, Linear Ramp Up, or Smooth StepLinear Ramp Down
Smooth Step SettingsRefer to Smooth Step Settings properties below.

Smooth Step Settings properties

Smooth Step Settings properties are available only for Ramp Type Smooth Step.

PropertyDescriptionValuesDefault
Falloff MidpointSets the midpoint of falloff values.Float: 0.0 - 1.00.5
Falloff RangeSets the range of falloff.Float: 0.0 - 1.00.5
Falloff SoftnessSets the amount of smoothing applied to falloff values.Float: 0.0 - 1.00.25

SurfaceSlopeGradientRequestBus

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

Request NameDescriptionParameterReturnScriptable
AddTagAdds a surface tag to the Surface Tags to track array.Surface Tag: StringNoneYes
GetNumTagsReturns the number of tags in the Surface Tags to track array.NoneCount: IntegerYes
GetRampTypeReturns the value of the Ramp Type property.NoneRamp Type Index: IntegerYes
GetSlopeMaxReturns the value of the Slope Max property.NoneFloatYes
GetSlopeMinReturns the value of the Slope Min property.NoneFloatYes
GetTagReturns the surface tag at the specified index of the Surface Tags to track array.Surface Tag Index: IntegerSurface Tag: StringYes
RemoveTagRemoves the surface tag at the specified index of the Surface Tags to track array.Surface Tag Index: IntegerNoneYes
SetRampTypeSets the value of the Ramp Type property.Ramp Type Index: IntegerNoneYes
SetSlopeMaxSets the value of the Slope Max property.FloatNoneYes
SetSlopeMinSets the value of the Slope Min property.FloatNoneYes