BBMOD_MaterialPropertyBlock.set

A function defined in BBMOD_MaterialPropertyBlock.gml

set(_name, _type, _value)

Description

Sets a property to given value.

Arguments

Name Type Description
_name String The name of the property (shader uniform name).
_type Real The property type. Use values from BBMOD_EShaderUniformType.
_value Any The property value. Must match the shader uniform type!

Returns

Struct.BBMOD_MaterialPropertyBlock Returns self.

Example

var _materialProps = new BBMOD_MaterialPropertyBlock();
_materialProps.set("u_fOutlineStrength", BBMOD_EShaderUniformType.Float, 0.5);
_materialProps.set("u_vOutlineColor", BBMOD_EShaderUniformType.Color, BBMOD_C_AQUA);

Note

You cannot have multiple properties with the same name but a different type! The property type and value is overriden each time you use this method!

See also

BBMOD_MaterialPropertyBlock.set_color, BBMOD_MaterialPropertyBlock.set_float, BBMOD_MaterialPropertyBlock.set_float2, BBMOD_MaterialPropertyBlock.set_float3, BBMOD_MaterialPropertyBlock.set_float4, BBMOD_MaterialPropertyBlock.set_float_array, BBMOD_MaterialPropertyBlock.set_int, BBMOD_MaterialPropertyBlock.set_int2, BBMOD_MaterialPropertyBlock.set_int3, BBMOD_MaterialPropertyBlock.set_int4, BBMOD_MaterialPropertyBlock.set_int_array, BBMOD_MaterialPropertyBlock.set_matrix, BBMOD_MaterialPropertyBlock.set_matrix_array, BBMOD_MaterialPropertyBlock.set_sampler

Do you find this page helpful?

Copyright © 2024, BlueBurn. Built on April 26, 2024 using GMDoc.