Skip to main content

MaterialPropertyBlock

A container for material properties that can be applied to materials or renderers.

TypeNameInterface Description
Functionsconstructor()

Parameters

rtti: - Optional parameter for initializing the block with existing RTTI data.

FunctionssetFloat(name: string, val: number): void

Function: Sets a float property value in the material property block. name should match a float property defined by the target material/shader that will consume this block.

Parameters

name: - The name of the float property to set.

val: - The float value to assign to the property.

FunctionssetFloatArray(name: string, data: number[] | Float32Array): void

Function: Sets a float array property in the material property block. name should match a float-array property defined by the target material/shader that will consume this block. When data is a Float32Array, it is treated as a tightly packed scalar array.

Parameters

name: - The name of the property to set.

data: - An array of numbers or a Float32Array containing the float values.

FunctionssetMatrix(name: string, mat: Matrix4x4f): void

Function: Sets a matrix property in the material property block. name should match a matrix property defined by the target material/shader that will consume this block.

Parameters

name: - The name of the matrix property to set.

mat: - The Matrix4x4f value to assign to the property.

FunctionssetTexture(name: string, texture: Texture): void

Function: Sets a texture property in the material property block. name should match a texture property defined by the target material/shader that will consume this block.

Parameters

name: - The name of the texture property to set.

texture: - The Texture object to assign to the property.

FunctionssetVector(name: string, value: Vector2f | Vector3f | Vector4f): void

Function: Sets a vector property in the material property block with the specified name. name should match a vector property defined by the target material/shader that will consume this block. The vector dimension must also match the target property: pass Vector2f for vec2, Vector3f for vec3, and Vector4f for vec4.

Parameters

name: - The name of the vector property to set.

value: - The vector value to assign, which can be of type Vector2f, Vector3f, or Vector4f.

FunctionssetVector2Array(name: string, data: Vector2f[] | Float32Array): void

Function: Sets a vector2 array property in the material property block. name should match a vec2-array property defined by the target material/shader that will consume this block. When data is a Float32Array, values are read as a tightly packed [x0, y0, x1, y1, ...] layout.

Parameters

name: - The name of the property to set.

data: - An array of Vector2f objects or a Float32Array containing the vector2 data.

FunctionssetVector3Array(name: string, data: Vector3f[] | Float32Array): void

Function: Sets a vector3 array property in the material property block. name should match a vec3-array property defined by the target material/shader that will consume this block. When data is a Float32Array, values are read as a tightly packed [x0, y0, z0, x1, y1, z1, ...] layout.

Parameters

name: - The name of the property to set.

data: - An array of Vector3f objects or a Float32Array containing the vector data.

FunctionssetVector4Array(name: string, data: Vector4f[] | Float32Array): void

Function: Sets a vector4 array property in the material property block. name should match a vec4-array property defined by the target material/shader that will consume this block. When data is a Float32Array, values are read as a tightly packed [x0, y0, z0, w0, x1, y1, z1, w1, ...] layout.

Parameters

name: - The name of the property to set.

data: - An array of Vector4f objects or a Float32Array containing the vector data.

Examples

constructor()

let obj = new APJS.MaterialPropertyBlock();

Use Case

@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
onStart() {
// TODO: instantiate / use MaterialPropertyBlock here
}
onUpdate(deltaTime: number) {
}
}
Copyright © 2026 TikTok. All rights reserved.
About TikTokHelp CenterCareersContactLegalTerms of ServicePrivacy PolicyCookies