setParameter

fun setParameter(name: String, x: Boolean)

Sets a boolean parameter.

Parameters

name

Parameter name as defined in the material

x

Boolean value


fun setParameter(name: String, x: Float)

Sets a float parameter.

Parameters

name

Parameter name as defined in the material

x

Float value


fun setParameter(name: String, x: Int)

Sets an integer parameter.

Parameters

name

Parameter name as defined in the material

x

Integer value


fun setParameter(name: String, x: UInt)

Sets an unsigned integer parameter.

Parameters

name

Parameter name as defined in the material

x

Unsigned integer value


fun setParameter(name: String, x: Boolean, y: Boolean)

Sets a 2-component boolean vector parameter.


fun setParameter(name: String, x: Float, y: Float)

Sets a 2-component float vector parameter.


fun setParameter(name: String, x: Int, y: Int)

Sets a 2-component integer vector parameter.


fun setParameter(name: String, x: UInt, y: UInt)

Sets a 2-component unsigned integer vector parameter.


fun setParameter(name: String, x: Boolean, y: Boolean, z: Boolean)

Sets a 3-component boolean vector parameter.


fun setParameter(name: String, x: Float, y: Float, z: Float)

Sets a 3-component float vector parameter.


fun setParameter(name: String, x: Int, y: Int, z: Int)

Sets a 3-component integer vector parameter.


fun setParameter(name: String, x: UInt, y: UInt, z: UInt)

Sets a 3-component unsigned integer vector parameter.


fun setParameter(name: String, x: Boolean, y: Boolean, z: Boolean, w: Boolean)

Sets a 4-component boolean vector parameter.


fun setParameter(name: String, x: Float, y: Float, z: Float, w: Float)

Sets a 4-component float vector parameter.


fun setParameter(name: String, x: Int, y: Int, z: Int, w: Int)

Sets a 4-component integer vector parameter.


fun setParameter(name: String, x: UInt, y: UInt, z: UInt, w: UInt)

Sets a 4-component unsigned integer vector parameter.


fun setParameter(name: String, texture: Texture?, sampler: TextureSampler)

Sets a texture parameter with sampler configuration.

Note: Depth textures cannot be sampled with linear filtering unless comparison mode is set to COMPARE_TO_TEXTURE.

Parameters

name

Parameter name as defined in the material

texture

Texture to bind, or null

sampler

Sampler configuration (filtering, wrapping, comparison function)


fun setParameter(name: String, element: MaterialInstance.BooleanElement, v: BooleanArray, offset: Int, count: Int)

Sets a parameter from a boolean array.

Parameters

name

Parameter name as defined in the material

element

Array element type (BOOL, BOOL2, BOOL3, or BOOL4)

v

Source array, flattened

offset

Index into v to start copying from

count

Number of elements to copy


fun setParameter(name: String, element: MaterialInstance.IntElement, v: IntArray, offset: Int, count: Int)

Sets a parameter from an integer array.

Parameters

name

Parameter name as defined in the material

element

Array element type (INT, INT2, INT3, or INT4)

v

Source array, flattened

offset

Index into v to start copying from

count

Number of elements to copy


fun setParameter(name: String, element: MaterialInstance.UIntElement, v: IntArray, offset: Int, count: Int)

Sets a parameter from an unsigned integer array.

Parameters

name

Parameter name as defined in the material

element

Array element type (UINT, UINT2, UINT3, or UINT4)

v

Source array of bit patterns, flattened

offset

Index into v to start copying from

count

Number of elements to copy


fun setParameter(name: String, element: MaterialInstance.FloatElement, v: FloatArray, offset: Int, count: Int)

Sets a parameter from a float array.

Parameters

name

Parameter name as defined in the material

element

Array element type (FLOAT, FLOAT2, FLOAT3, FLOAT4, MAT3, or MAT4)

v

Source array, flattened (matrices column-major)

offset

Index into v to start copying from

count

Number of elements to copy


fun setParameter(name: String, type: RgbType, r: Float, g: Float, b: Float)

Sets an RGB color parameter, converted to linear from type's space.

Parameters

name

Parameter name as defined in the material

type

Whether color is in linear or sRGB space

r

Red channel 0, 1

g

Green channel 0, 1

b

Blue channel 0, 1


fun setParameter(name: String, type: RgbaType, r: Float, g: Float, b: Float, a: Float)

Sets an RGBA color parameter, converted to linear from type's space.

Parameters

name

Parameter name as defined in the material

type

Whether color is in linear or sRGB space, and whether alpha is premultiplied

r

Red channel 0, 1

g

Green channel 0, 1

b

Blue channel 0, 1

a

Alpha channel 0, 1