API

Function getShaderUniform

  • Get a declared uniform's current value. Scalars are returned as numbers. Vector and matrix values are returned as the material's live backing Float32Array, with stable identity and no copy. Do not mutate this array directly: doing so bypasses material versioning and GPU invalidation. Passing an already-mutated backing array to setShaderUniform will not trigger an update because the setter cannot detect a difference. To update the uniform, prepare the new values in separate storage and pass that separate value to setShaderUniform.

    Parameters

    Returns number | Float32Array<ArrayBufferLike>