Documentation / @ripl/3d / createTexture
Function: createTexture() ​
createTexture(
source,options?):Texture
Defined in: 3d/src/core/texture.ts:203
Creates a Texture from an image source.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
source | TextureSource | The image to sample. |
options? | TextureOptions | Sampling and transform options. |
Returns ​
The texture.
Example ​
ts
const canvas = new OffscreenCanvas(64, 64);
// …draw into canvas…
const texture = createTexture(canvas, { repeat: [4, 4] });