Skip to content

Commit

Permalink
Deploying to gh-pages from @ 3420af7 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Jun 9, 2024
1 parent e7a93e4 commit 88a0d3e
Show file tree
Hide file tree
Showing 117 changed files with 955 additions and 734 deletions.
4 changes: 4 additions & 0 deletions CHANGELIST.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change List

### 1.8.0

* Support creating 3d textures from images/canvases...

### 1.7.0

* Add `primitives.deindex`
Expand Down
7 changes: 3 additions & 4 deletions dist/1.x/attribute-utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ export type BuffersAndAttributes = {
};
export declare function makeTypedArrayFromArrayUnion(array: ArrayUnion, name: string): TypedArray;
export declare function getNumComponents(array: ArrayUnion, arrayName: string): number;
type TypedArrayWithOffsetAndStride = {
export type TypedArrayWithOffsetAndStride = {
data: TypedArray;
offset: number; /** In elements not bytes */
stride: number; /** In elements not bytes */
offset: number; /** In elements, not bytes */
stride: number; /** In elements, not bytes */
};
/**
* Given a set of named arrays, generates an array `GPUBufferLayout`s
Expand Down Expand Up @@ -228,4 +228,3 @@ export declare function setVertexAndIndexBuffers(passEncoder: GPURenderPassEncod
* @param buffersAndAttributes As returned from {@link createBuffersAndAttributesFromArrays}
*/
export declare function drawArrays(passEncoder: GPURenderPassEncoder, buffersAndAttributes: BuffersAndAttributes): void;
export {};
26 changes: 6 additions & 20 deletions dist/1.x/buffer-views.d.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
import { StructDefinition, TypeDefinition, VariableDefinition } from './data-definitions.js';
import { TypedArrayConstructor, TypedArray } from './typed-arrays.js';
type TypeDef = {
numElements: number;
align: number;
size: number;
type: string;
View: TypedArrayConstructor;
flatten?: boolean;
pad?: readonly number[];
};
declare const typeInfo: {
readonly [K: string]: TypeDef;
};
export type kType = Extract<keyof typeof typeInfo, string>;
export declare const kTypes: readonly kType[];
import { TypedArray } from './typed-arrays.js';
import { WGSLType } from './wgsl-types.js';
/**
* Set which intrinsic types to make views for.
*
Expand All @@ -27,16 +14,16 @@ export declare const kTypes: readonly kType[];
* what you want.
*
* If you do want individual views then you'd call
* `setIntrinsicsToView(['vec3f`])` and now you get
* `setIntrinsicsToView(['vec3f'])` and now you get
* an array of 200 `Float32Array`s.
*
* Note: `setIntrinsicsToView` always sets ALL types. The list you
* pass it is the types you want views created for, all other types
* will be reset to do the default. In other words
*
* ```js
* setIntrinsicsToView(['vec3f`])
* setIntrinsicsToView(['vec2f`])
* setIntrinsicsToView(['vec3f'])
* setIntrinsicsToView(['vec2f'])
* ```
*
* Only `vec2f` will have views created. `vec3f` has been reset to the default by
Expand All @@ -52,7 +39,7 @@ export declare const kTypes: readonly kType[];
* @param types array of types to make views for
* @param flatten whether to flatten or expand the specified types.
*/
export declare function setIntrinsicsToView(types?: readonly kType[], flatten?: boolean): void;
export declare function setIntrinsicsToView(types?: readonly WGSLType[], flatten?: boolean): void;
export type TypedArrayOrViews = TypedArray | Views | Views[];
export interface Views {
[x: string]: TypedArrayOrViews;
Expand Down Expand Up @@ -254,4 +241,3 @@ export declare function getSizeAndAlignmentOfUnsizedArrayElement(varDef: Variabl
size: number;
align: number;
};
export {};
4 changes: 3 additions & 1 deletion dist/1.x/data-definitions.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/// <reference types="dist" />
import { WGSLType } from './wgsl-types.js';
export type FieldDefinition = {
offset: number;
type: TypeDefinition;
Expand All @@ -13,8 +14,9 @@ export type StructDefinition = TypeDefinition & {
fields: FieldDefinitions;
size: number;
};
export { WGSLType };
export type IntrinsicDefinition = TypeDefinition & {
type: string;
type: WGSLType;
numElements?: number;
};
export type ArrayDefinition = TypeDefinition & {
Expand Down
53 changes: 8 additions & 45 deletions dist/1.x/primitives.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,7 @@ export declare function createPlaneVertices({ width, depth, subdivisionsWidth, s
depth?: number | undefined;
subdivisionsWidth?: number | undefined;
subdivisionsDepth?: number | undefined;
}): {
position: Float32Array;
normal: Float32Array;
texcoord: Float32Array;
indices: Uint16Array;
};
}): Arrays;
/**
* Creates sphere vertices.
*
Expand Down Expand Up @@ -95,12 +90,7 @@ export declare function createSphereVertices({ radius, subdivisionsAxis, subdivi
endLatitudeInRadians?: number | undefined;
startLongitudeInRadians?: number | undefined;
endLongitudeInRadians?: number | undefined;
}): {
position: Float32Array;
normal: Float32Array;
texcoord: Float32Array;
indices: Uint16Array;
};
}): Arrays;
/**
* Creates the vertices and indices for a cube.
*
Expand All @@ -112,12 +102,7 @@ export declare function createSphereVertices({ radius, subdivisionsAxis, subdivi
*/
export declare function createCubeVertices({ size }?: {
size?: number | undefined;
}): {
position: Float32Array;
normal: Float32Array;
texcoord: Float32Array;
indices: Uint16Array;
};
}): Arrays;
/**
* Creates vertices for a truncated cone, which is like a cylinder
* except that it has different top and bottom radii. A truncated cone
Expand All @@ -144,22 +129,15 @@ export declare function createTruncatedConeVertices({ bottomRadius, topRadius, h
verticalSubdivisions?: number | undefined;
topCap?: boolean | undefined;
bottomCap?: boolean | undefined;
}): {
position: Float32Array;
normal: Float32Array;
texcoord: Float32Array;
indices: Uint16Array;
};
}): Arrays;
/**
* Creates 3D 'F' vertices.
* An 'F' is useful because you can easily tell which way it is oriented.
* The created 'F' has position, normal, texcoord, and color arrays.
*
* @return The created vertices.
*/
export declare function create3DFVertices(): {
[k: string]: Uint8Array | Uint16Array | Float32Array;
};
export declare function create3DFVertices(): Arrays;
/**
* Creates cylinder vertices. The cylinder will be created around the origin
* along the y-axis.
Expand All @@ -180,12 +158,7 @@ export declare function createCylinderVertices({ radius, height, radialSubdivisi
verticalSubdivisions?: number | undefined;
topCap?: boolean | undefined;
bottomCap?: boolean | undefined;
}): {
position: Float32Array;
normal: Float32Array;
texcoord: Float32Array;
indices: Uint16Array;
};
}): Arrays;
/**
* Creates vertices for a torus
*
Expand All @@ -205,12 +178,7 @@ export declare function createTorusVertices({ radius, thickness, radialSubdivisi
bodySubdivisions?: number | undefined;
startAngle?: number | undefined;
endAngle?: number | undefined;
}): {
position: Float32Array;
normal: Float32Array;
texcoord: Float32Array;
indices: Uint16Array;
};
}): Arrays;
/**
* Creates disc vertices. The disc will be in the xz plane, centered at
* the origin. When creating, at least 3 divisions, or pie
Expand Down Expand Up @@ -242,12 +210,7 @@ export declare function createDiscVertices({ radius, divisions, stacks, innerRad
stacks?: number | undefined;
innerRadius?: number | undefined;
stackPower?: number | undefined;
}): {
position: Float32Array;
normal: Float32Array;
texcoord: Float32Array;
indices: Uint16Array;
};
}): Arrays;
/**
* Given indexed vertices creates a new set of vertices un-indexed by expanding the vertices by index.
*/
Expand Down
Loading

0 comments on commit 88a0d3e

Please sign in to comment.