From 063ea8827612cca0318834b49cf3632cf31bca0f Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Tue, 1 Oct 2024 22:12:21 +0900 Subject: [PATCH] more docs --- src/buffer-views.ts | 18 +++++++++++++++++- src/test.ts | 0 2 files changed, 17 insertions(+), 1 deletion(-) delete mode 100644 src/test.ts diff --git a/src/buffer-views.ts b/src/buffer-views.ts index e6a35aa..60ca1c1 100644 --- a/src/buffer-views.ts +++ b/src/buffer-views.ts @@ -378,7 +378,8 @@ export type StructuredView = ArrayBufferViews & { * }); * ``` * - * data definition can come from ` + * data definition can come from `defs.uniforms.`, `defs.storages.` + * and `defs.structs.`. * * What this function does: * @@ -479,6 +480,21 @@ export type StructuredView = ArrayBufferViews & { * result.views.worldViewPosition.set([12, 34, 56]); * result.views.mode[0] = 8; * ``` + * + * Further, `set` is just a short cut for `setStructuredView` passing in the root + * `result'views`. + * + * So, for example, if you want to set the light at index 2, this would work. + * + * ```js + * setStructuredView({ + * lightWorldPosition: [1, 2, 3], + * shininess: 4, + * lightDirection: [5, 6, 7], + * innerLimit: 8, + * outerLimit: 9, + * }, result.views.lights[2]); + * ``` */ export function makeStructuredView(varDef: VariableDefinition | StructDefinition, arrayBuffer?: ArrayBuffer, offset = 0): StructuredView { const asVarDef = varDef as VariableDefinition; diff --git a/src/test.ts b/src/test.ts deleted file mode 100644 index e69de29..0000000