DriftTexture · interface
Weights
Explained in DriftTexture.
interface Weightsimport type { Weights } from '@driftengine/texture';Methods
read
read(name: string, shape?: readonly number[]): stringThe weight name as a value of the graph; refused if absent or held at another shape.
| Parameter | Type | Description |
|---|---|---|
name | string | |
shape? | readonly number[] |
derive
derive(name: string, shape: readonly number[], compute: (values: (part: string, shape?: readonly number[]) => Float32Array) => Float32Array): stringA weight computed once from others, kept under name. compute reads its parts through
values, which counts each as read; a source already holding name answers with it instead.
| Parameter | Type | Description |
|---|---|---|
name | string | |
shape | readonly number[] | |
compute | (values: (part: string, shape?: readonly number[]) => Float32Array) => Float32Array |
constant
constant(name: string, shape: readonly number[], data: Float32Array): stringA table computed from the graph's shapes, rebuilt on every run and never a weight.
| Parameter | Type | Description |
|---|---|---|
name | string | |
shape | readonly number[] | |
data | Float32Array |
ignore
ignore(nameOrPrefix: string): voidWeights the definition deliberately does not read: a name, or a prefix ending in a dot.
| Parameter | Type | Description |
|---|---|---|
nameOrPrefix | string |