Uniforms
Use Uniform for small values that configure a kernel.
import { Uniform } from '@volten/core';
const multiplier = new Uniform(10, 'f32');const direction = new Uniform([1, 0, 0], 'vec3f');Good examples are scalars, vectors, matrices, and small structs.
Updating a Uniform
Section titled “Updating a Uniform”Use set() to update the value:
multiplier.set(20);direction.set([0, 1, 0]);Uniform Layout
Section titled “Uniform Layout”Most users can ignore uniform layout mode.
import { volten } from '@volten/core';
const v = await volten({ uniformLayoutMode: 'auto'});Labels
Section titled “Labels”const params = new Uniform([1, 2, 3, 4], 'vec4f', { label: 'simulation params'});