mirror of
https://github.com/visgl/luma.gl.git
synced 2025-12-08 17:36:19 +00:00
1.8 KiB
1.8 KiB
UniformStore
A uniform store holds uniform values for a set of different uniform buffers, It can optionally creates managed uniform buffers for those
Usage
Types
The UniformStore class is designed so that the setUniforms function will be strictly typed.
export class UniformStore<TUniformGroups extends Record<string, Record<string, UniformValue>>> {
Methods
constructor
Create a new UniformStore instance
- @param device
- @param blocks
- @param props
constructor(
device: Device,
blocks: Record<string, {
uniformFormats: Record<string, UniformFormat>;
defaultValues?: Record<string, UniformValue>;
}>
)
destroy()
Destroy any managed uniform buffers
destroy(): void;
setUniforms
Set uniforms
setUniforms(uniforms: Partial<TUniformGroups>): void
getUniformBufferByteLength()
Get the required minimum length of one of the uniform buffers managed by this UniformStore.
getUniformBufferByteLength(uniformBufferName: keyof TUniformGroups): number
getUniformBufferData()
Get formatted binary memory that can be uploaded to an application created uniform buffer
getUniformBufferData(uniformBufferName: keyof TUniformGroups): Uint8Array
getManagedUniformBuffer()
Creates one of the managed uniform buffers
getUniformBuffer(device: Device, uniformBufferName: keyof TUniformGroups): Buffer
updateUniformBuffer()
Update one uniform buffer. Only updates if values have changed
updateUniformBuffer(uniformBufferName: keyof TUniformGroups): void
updateUniformBuffers()
Updates all uniform buffers where values have changed
updateUniformBuffers(): void