Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#

math.smoothstep

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static float smoothstep(float xMin, float xMax, float x);

Parameters

Parameter Description
xMin The minimum range of the x parameter.
xMax The maximum range of the x parameter.
x The value to be interpolated.

Returns

float Returns a value camped to the range [0, 1].

Description

Returns a smooth Hermite interpolation between 0.0f and 1.0f when x is in the interval (inclusive) [xMin, xMax].


Declaration

public static float2 smoothstep(float2 xMin, float2 xMax, float2 x);

Parameters

Parameter Description
xMin The minimum range of the x parameter.
xMax The maximum range of the x parameter.
x The value to be interpolated.

Returns

float2 Returns component values camped to the range [0, 1].

Description

Returns a componentwise smooth Hermite interpolation between 0.0f and 1.0f when x is in the interval (inclusive) [xMin, xMax].


Declaration

public static float3 smoothstep(float3 xMin, float3 xMax, float3 x);

Parameters

Parameter Description
xMin The minimum range of the x parameter.
xMax The maximum range of the x parameter.
x The value to be interpolated.

Returns

float3 Returns component values camped to the range [0, 1].

Description

Returns a componentwise smooth Hermite interpolation between 0.0f and 1.0f when x is in the interval (inclusive) [xMin, xMax].


Declaration

public static float4 smoothstep(float4 xMin, float4 xMax, float4 x);

Parameters

Parameter Description
xMin The minimum range of the x parameter.
xMax The maximum range of the x parameter.
x The value to be interpolated.

Returns

float4 Returns component values camped to the range [0, 1].

Description

Returns a componentwise smooth Hermite interpolation between 0.0f and 1.0f when x is in the interval (inclusive) [xMin, xMax].


Declaration

public static double smoothstep(double xMin, double xMax, double x);

Parameters

Parameter Description
xMin The minimum range of the x parameter.
xMax The maximum range of the x parameter.
x The value to be interpolated.

Returns

double Returns a value camped to the range [0, 1].

Description

Returns a smooth Hermite interpolation between 0.0 and 1.0 when x is in the interval (inclusive) [xMin, xMax].


Declaration

public static double2 smoothstep(double2 xMin, double2 xMax, double2 x);

Parameters

Parameter Description
xMin The minimum range of the x parameter.
xMax The maximum range of the x parameter.
x The value to be interpolated.

Returns

double2 Returns component values camped to the range [0, 1].

Description

Returns a componentwise smooth Hermite interpolation between 0.0 and 1.0 when x is in the interval (inclusive) [xMin, xMax].


Declaration

public static double3 smoothstep(double3 xMin, double3 xMax, double3 x);

Parameters

Parameter Description
xMin The minimum range of the x parameter.
xMax The maximum range of the x parameter.
x The value to be interpolated.

Returns

double3 Returns component values camped to the range [0, 1].

Description

Returns a componentwise smooth Hermite interpolation between 0.0 and 1.0 when x is in the interval (inclusive) [xMin, xMax].


Declaration

public static double4 smoothstep(double4 xMin, double4 xMax, double4 x);

Parameters

Parameter Description
xMin The minimum range of the x parameter.
xMax The maximum range of the x parameter.
x The value to be interpolated.

Returns

double4 Returns component values camped to the range [0, 1].

Description

Returns a componentwise smooth Hermite interpolation between 0.0 and 1.0 when x is in the interval (inclusive) [xMin, xMax].