@thi.ng/webgl 5.0.14 → 6.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +112 -213
- package/README.md +15 -5
- package/api/buffers.d.ts +1 -1
- package/api/canvas.d.ts +1 -1
- package/api/material.d.ts +1 -1
- package/api/model.d.ts +3 -3
- package/api/multipass.d.ts +4 -4
- package/api/shader.d.ts +12 -6
- package/api/texture.d.ts +1 -1
- package/buffer.d.ts +3 -3
- package/buffer.js +4 -4
- package/canvas.d.ts +2 -2
- package/canvas.js +6 -3
- package/checks.d.ts +1 -1
- package/checks.js +1 -1
- package/draw.d.ts +1 -1
- package/draw.js +4 -4
- package/error.d.ts +11 -3
- package/error.js +2 -5
- package/fbo.d.ts +1 -1
- package/fbo.js +5 -5
- package/geo/cube.d.ts +1 -1
- package/geo/cube.js +2 -2
- package/geo/quad.d.ts +1 -1
- package/geo/quad.js +14 -11
- package/index.d.ts +32 -32
- package/index.js +32 -32
- package/{api/logger.d.ts → logger.d.ts} +1 -1
- package/{api/logger.js → logger.js} +1 -1
- package/material.d.ts +2 -2
- package/matrices.d.ts +2 -2
- package/matrices.js +5 -2
- package/multipass.d.ts +1 -1
- package/multipass.js +33 -15
- package/package.json +151 -40
- package/rbo.d.ts +1 -1
- package/rbo.js +1 -1
- package/readpixels.d.ts +1 -1
- package/readpixels.js +1 -1
- package/shader.d.ts +6 -6
- package/shader.js +33 -23
- package/shaders/lambert.d.ts +3 -3
- package/shaders/lambert.js +43 -11
- package/shaders/phong.d.ts +3 -3
- package/shaders/phong.js +38 -10
- package/shaders/pipeline.d.ts +1 -1
- package/shaders/pipeline.js +5 -1
- package/syntax.d.ts +2 -2
- package/syntax.js +2 -2
- package/texture.d.ts +1 -1
- package/texture.js +10 -6
- package/textures/checkerboard.js +9 -2
- package/textures/stripes.js +8 -2
- package/uniforms.d.ts +2 -2
- package/uniforms.js +2 -2
- package/utils.d.ts +4 -4
- package/utils.js +1 -1
- package/lib/index.js +0 -1820
- package/lib/index.js.map +0 -1
- package/lib/index.umd.js +0 -1
- package/lib/index.umd.js.map +0 -1
package/canvas.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { adaptDPI } from "@thi.ng/adapt-dpi";
|
|
2
|
-
import { isString } from "@thi.ng/checks";
|
|
3
|
-
import { error } from "./error";
|
|
2
|
+
import { isString } from "@thi.ng/checks/is-string";
|
|
3
|
+
import { error } from "./error.js";
|
|
4
4
|
const defaultOpts = {
|
|
5
5
|
alpha: true,
|
|
6
6
|
antialias: true,
|
|
@@ -19,7 +19,10 @@ export const glCanvas = (opts = {}) => {
|
|
|
19
19
|
opts.height && (canvas.height = opts.height);
|
|
20
20
|
opts.autoScale !== false && adaptDPI(canvas, canvas.width, canvas.height);
|
|
21
21
|
opts.parent && opts.parent.appendChild(canvas);
|
|
22
|
-
const gl = canvas.getContext(opts.version === 2 ? "webgl2" : "webgl",
|
|
22
|
+
const gl = canvas.getContext(opts.version === 2 ? "webgl2" : "webgl", {
|
|
23
|
+
...defaultOpts,
|
|
24
|
+
...opts.opts,
|
|
25
|
+
});
|
|
23
26
|
if (!gl) {
|
|
24
27
|
error("WebGL unavailable");
|
|
25
28
|
}
|
package/checks.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ITexture } from "./api/texture";
|
|
1
|
+
import { ITexture } from "./api/texture.js";
|
|
2
2
|
export declare const isGL2Context: (gl: WebGLRenderingContext | WebGL2RenderingContext) => gl is WebGL2RenderingContext;
|
|
3
3
|
export declare const isFloatTexture: (tex: ITexture) => boolean;
|
|
4
4
|
//# sourceMappingURL=checks.d.ts.map
|
package/checks.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TextureType } from "./api/texture";
|
|
1
|
+
import { TextureType } from "./api/texture.js";
|
|
2
2
|
export const isGL2Context = (gl) => typeof WebGL2RenderingContext !== "undefined" &&
|
|
3
3
|
gl instanceof WebGL2RenderingContext;
|
|
4
4
|
export const isFloatTexture = (tex) => tex.type === TextureType.FLOAT ||
|
package/draw.d.ts
CHANGED
package/draw.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { isArray } from "@thi.ng/checks";
|
|
2
|
-
import { isGL2Context } from "./checks";
|
|
3
|
-
import { error } from "./error";
|
|
4
|
-
import { bindTextures, unbindTextures } from "./texture";
|
|
1
|
+
import { isArray } from "@thi.ng/checks/is-array";
|
|
2
|
+
import { isGL2Context } from "./checks.js";
|
|
3
|
+
import { error } from "./error.js";
|
|
4
|
+
import { bindTextures, unbindTextures } from "./texture.js";
|
|
5
5
|
export const draw = (specs, opts = {}) => {
|
|
6
6
|
const _specs = isArray(specs) ? specs : [specs];
|
|
7
7
|
for (let i = 0, n = _specs.length; i < n; i++) {
|
package/error.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export declare const WebGLError: {
|
|
3
|
+
new (msg?: string | undefined): {
|
|
4
|
+
name: string;
|
|
5
|
+
message: string;
|
|
6
|
+
stack?: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
9
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
10
|
+
stackTraceLimit: number;
|
|
11
|
+
};
|
|
4
12
|
export declare const error: (msg?: string | undefined) => never;
|
|
5
13
|
//# sourceMappingURL=error.d.ts.map
|
package/error.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
super(`WebGL error ${msg ? ": " + msg : ""}`);
|
|
4
|
-
}
|
|
5
|
-
}
|
|
1
|
+
import { defError } from "@thi.ng/errors/deferror";
|
|
2
|
+
export const WebGLError = defError(() => "WebGL");
|
|
6
3
|
export const error = (msg) => {
|
|
7
4
|
throw new WebGLError(msg);
|
|
8
5
|
};
|
package/fbo.d.ts
CHANGED
package/fbo.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { assert } from "@thi.ng/
|
|
2
|
-
import { TEX_FORMATS } from "./api/texture";
|
|
3
|
-
import { isGL2Context } from "./checks";
|
|
4
|
-
import { error } from "./error";
|
|
5
|
-
import { RBO } from "./rbo";
|
|
1
|
+
import { assert } from "@thi.ng/errors/assert";
|
|
2
|
+
import { TEX_FORMATS } from "./api/texture.js";
|
|
3
|
+
import { isGL2Context } from "./checks.js";
|
|
4
|
+
import { error } from "./error.js";
|
|
5
|
+
import { RBO } from "./rbo.js";
|
|
6
6
|
const GL_COLOR_ATTACHMENT0_WEBGL = 0x8ce0;
|
|
7
7
|
const GL_MAX_COLOR_ATTACHMENTS_WEBGL = 0x8cdf;
|
|
8
8
|
/**
|
package/geo/cube.d.ts
CHANGED
package/geo/cube.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DrawMode } from "../api/model";
|
|
1
|
+
import { DrawMode } from "../api/model.js";
|
|
2
2
|
// prettier-ignore
|
|
3
3
|
export const defCubeModel = (opts) => {
|
|
4
|
-
opts =
|
|
4
|
+
opts = { size: 1, normal: true, uv: true, ...opts };
|
|
5
5
|
const s = opts.size;
|
|
6
6
|
const spec = {
|
|
7
7
|
attribs: {
|
package/geo/quad.d.ts
CHANGED
package/geo/quad.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { DrawMode } from "../api/model";
|
|
1
|
+
import { DrawMode } from "../api/model.js";
|
|
2
2
|
export const defQuadModel = (opts) => {
|
|
3
|
-
let { size, uv, center } =
|
|
3
|
+
let { size, uv, center } = { size: 2, uv: true, center: true, ...opts };
|
|
4
4
|
size *= 0.5;
|
|
5
5
|
const o = center ? 0 : size;
|
|
6
6
|
return {
|
|
7
|
-
attribs:
|
|
7
|
+
attribs: {
|
|
8
|
+
position: {
|
|
8
9
|
data: new Float32Array([
|
|
9
10
|
o - size,
|
|
10
11
|
o - size,
|
|
@@ -16,14 +17,16 @@ export const defQuadModel = (opts) => {
|
|
|
16
17
|
o + size,
|
|
17
18
|
]),
|
|
18
19
|
size: 2,
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
},
|
|
21
|
+
...(uv
|
|
22
|
+
? {
|
|
23
|
+
uv: {
|
|
24
|
+
data: new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]),
|
|
25
|
+
size: 2,
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
: null),
|
|
29
|
+
},
|
|
27
30
|
uniforms: {},
|
|
28
31
|
shader: null,
|
|
29
32
|
mode: DrawMode.TRIANGLE_STRIP,
|
package/index.d.ts
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
export * from "./api/blend";
|
|
2
|
-
export * from "./api/buffers";
|
|
3
|
-
export * from "./api/canvas";
|
|
4
|
-
export * from "./api/ext";
|
|
5
|
-
export * from "./api/glsl";
|
|
6
|
-
export * from "./api/
|
|
7
|
-
export * from "./api/
|
|
8
|
-
export * from "./api/
|
|
9
|
-
export * from "./api/
|
|
10
|
-
export * from "./
|
|
11
|
-
export * from "./
|
|
12
|
-
export * from "./
|
|
13
|
-
export * from "./
|
|
14
|
-
export * from "./
|
|
15
|
-
export * from "./
|
|
16
|
-
export * from "./
|
|
17
|
-
export * from "./material";
|
|
18
|
-
export * from "./matrices";
|
|
19
|
-
export * from "./multipass";
|
|
20
|
-
export * from "./rbo";
|
|
21
|
-
export * from "./readpixels";
|
|
22
|
-
export * from "./shader";
|
|
23
|
-
export * from "./syntax";
|
|
24
|
-
export * from "./texture";
|
|
25
|
-
export * from "./utils";
|
|
26
|
-
export * from "./shaders/lambert";
|
|
27
|
-
export * from "./shaders/phong";
|
|
28
|
-
export * from "./shaders/pipeline";
|
|
29
|
-
export * from "./textures/checkerboard";
|
|
30
|
-
export * from "./textures/stripes";
|
|
31
|
-
export * from "./geo/cube";
|
|
32
|
-
export * from "./geo/quad";
|
|
1
|
+
export * from "./api/blend.js";
|
|
2
|
+
export * from "./api/buffers.js";
|
|
3
|
+
export * from "./api/canvas.js";
|
|
4
|
+
export * from "./api/ext.js";
|
|
5
|
+
export * from "./api/glsl.js";
|
|
6
|
+
export * from "./api/material.js";
|
|
7
|
+
export * from "./api/model.js";
|
|
8
|
+
export * from "./api/shader.js";
|
|
9
|
+
export * from "./api/texture.js";
|
|
10
|
+
export * from "./buffer.js";
|
|
11
|
+
export * from "./canvas.js";
|
|
12
|
+
export * from "./checks.js";
|
|
13
|
+
export * from "./draw.js";
|
|
14
|
+
export * from "./error.js";
|
|
15
|
+
export * from "./fbo.js";
|
|
16
|
+
export * from "./logger.js";
|
|
17
|
+
export * from "./material.js";
|
|
18
|
+
export * from "./matrices.js";
|
|
19
|
+
export * from "./multipass.js";
|
|
20
|
+
export * from "./rbo.js";
|
|
21
|
+
export * from "./readpixels.js";
|
|
22
|
+
export * from "./shader.js";
|
|
23
|
+
export * from "./syntax.js";
|
|
24
|
+
export * from "./texture.js";
|
|
25
|
+
export * from "./utils.js";
|
|
26
|
+
export * from "./shaders/lambert.js";
|
|
27
|
+
export * from "./shaders/phong.js";
|
|
28
|
+
export * from "./shaders/pipeline.js";
|
|
29
|
+
export * from "./textures/checkerboard.js";
|
|
30
|
+
export * from "./textures/stripes.js";
|
|
31
|
+
export * from "./geo/cube.js";
|
|
32
|
+
export * from "./geo/quad.js";
|
|
33
33
|
//# sourceMappingURL=index.d.ts.map
|
package/index.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
export * from "./api/blend";
|
|
2
|
-
export * from "./api/buffers";
|
|
3
|
-
export * from "./api/canvas";
|
|
4
|
-
export * from "./api/ext";
|
|
5
|
-
export * from "./api/glsl";
|
|
6
|
-
export * from "./api/
|
|
7
|
-
export * from "./api/
|
|
8
|
-
export * from "./api/
|
|
9
|
-
export * from "./api/
|
|
10
|
-
export * from "./
|
|
11
|
-
export * from "./
|
|
12
|
-
export * from "./
|
|
13
|
-
export * from "./
|
|
14
|
-
export * from "./
|
|
15
|
-
export * from "./
|
|
16
|
-
export * from "./
|
|
17
|
-
export * from "./material";
|
|
18
|
-
export * from "./matrices";
|
|
19
|
-
export * from "./multipass";
|
|
20
|
-
export * from "./rbo";
|
|
21
|
-
export * from "./readpixels";
|
|
22
|
-
export * from "./shader";
|
|
23
|
-
export * from "./syntax";
|
|
24
|
-
export * from "./texture";
|
|
25
|
-
export * from "./utils";
|
|
26
|
-
export * from "./shaders/lambert";
|
|
27
|
-
export * from "./shaders/phong";
|
|
28
|
-
export * from "./shaders/pipeline";
|
|
29
|
-
export * from "./textures/checkerboard";
|
|
30
|
-
export * from "./textures/stripes";
|
|
31
|
-
export * from "./geo/cube";
|
|
32
|
-
export * from "./geo/quad";
|
|
1
|
+
export * from "./api/blend.js";
|
|
2
|
+
export * from "./api/buffers.js";
|
|
3
|
+
export * from "./api/canvas.js";
|
|
4
|
+
export * from "./api/ext.js";
|
|
5
|
+
export * from "./api/glsl.js";
|
|
6
|
+
export * from "./api/material.js";
|
|
7
|
+
export * from "./api/model.js";
|
|
8
|
+
export * from "./api/shader.js";
|
|
9
|
+
export * from "./api/texture.js";
|
|
10
|
+
export * from "./buffer.js";
|
|
11
|
+
export * from "./canvas.js";
|
|
12
|
+
export * from "./checks.js";
|
|
13
|
+
export * from "./draw.js";
|
|
14
|
+
export * from "./error.js";
|
|
15
|
+
export * from "./fbo.js";
|
|
16
|
+
export * from "./logger.js";
|
|
17
|
+
export * from "./material.js";
|
|
18
|
+
export * from "./matrices.js";
|
|
19
|
+
export * from "./multipass.js";
|
|
20
|
+
export * from "./rbo.js";
|
|
21
|
+
export * from "./readpixels.js";
|
|
22
|
+
export * from "./shader.js";
|
|
23
|
+
export * from "./syntax.js";
|
|
24
|
+
export * from "./texture.js";
|
|
25
|
+
export * from "./utils.js";
|
|
26
|
+
export * from "./shaders/lambert.js";
|
|
27
|
+
export * from "./shaders/phong.js";
|
|
28
|
+
export * from "./shaders/pipeline.js";
|
|
29
|
+
export * from "./textures/checkerboard.js";
|
|
30
|
+
export * from "./textures/stripes.js";
|
|
31
|
+
export * from "./geo/cube.js";
|
|
32
|
+
export * from "./geo/quad.js";
|
package/material.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Material } from "./api/material";
|
|
2
|
-
import type { ShaderUniformSpecs } from "./api/shader";
|
|
1
|
+
import type { Material } from "./api/material.js";
|
|
2
|
+
import type { ShaderUniformSpecs } from "./api/shader.js";
|
|
3
3
|
export declare const DEFAULT_MATERIAL: Material;
|
|
4
4
|
export declare const defMaterial: (mat?: Partial<Material>, flags?: Partial<Record<keyof Material, boolean>>, base?: Material) => ShaderUniformSpecs;
|
|
5
5
|
//# sourceMappingURL=material.d.ts.map
|
package/matrices.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IObjectOf } from "@thi.ng/api";
|
|
2
2
|
import type { ReadonlyVec } from "@thi.ng/vectors";
|
|
3
|
-
import type { GLMat4 } from "./api/glsl";
|
|
4
|
-
import type { ShaderUniforms } from "./api/shader";
|
|
3
|
+
import type { GLMat4 } from "./api/glsl.js";
|
|
4
|
+
import type { ShaderUniforms } from "./api/shader.js";
|
|
5
5
|
/**
|
|
6
6
|
* Computes the inverse transpose of given 4x4 matrix uniform, i.e.
|
|
7
7
|
* `transpose(invert(m))`.
|
package/matrices.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { isNumber } from "@thi.ng/checks";
|
|
2
|
-
import { IDENT44
|
|
1
|
+
import { isNumber } from "@thi.ng/checks/is-number";
|
|
2
|
+
import { IDENT44 } from "@thi.ng/matrices/constants";
|
|
3
|
+
import { mulM44 } from "@thi.ng/matrices/mulm";
|
|
4
|
+
import { normal44 } from "@thi.ng/matrices/normal-mat";
|
|
5
|
+
import { ortho } from "@thi.ng/matrices/ortho";
|
|
3
6
|
const $ = (a, b, id) => a[id] || b[id].defaultVal || IDENT44;
|
|
4
7
|
/**
|
|
5
8
|
* Computes the inverse transpose of given 4x4 matrix uniform, i.e.
|
package/multipass.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Multipass, MultipassOpts, PassOpts } from "./api/multipass";
|
|
1
|
+
import type { Multipass, MultipassOpts, PassOpts } from "./api/multipass.js";
|
|
2
2
|
export declare const defMultiPass: (opts: MultipassOpts) => Multipass;
|
|
3
3
|
/**
|
|
4
4
|
* Returns a dynamically generated single pass spec ({@link PassOpts}) for use
|
package/multipass.js
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
import { assert } from "@thi.ng/
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { assert } from "@thi.ng/errors/assert";
|
|
2
|
+
import { assign } from "@thi.ng/shader-ast/ast/assign";
|
|
3
|
+
import { defMain } from "@thi.ng/shader-ast/ast/function";
|
|
4
|
+
import { INT0, ivec2 } from "@thi.ng/shader-ast/ast/lit";
|
|
5
|
+
import { $xy } from "@thi.ng/shader-ast/ast/swizzle";
|
|
6
|
+
import { texelFetch } from "@thi.ng/shader-ast/builtin/texture";
|
|
7
|
+
import { assocObj } from "@thi.ng/transducers/assoc-obj";
|
|
8
|
+
import { map } from "@thi.ng/transducers/map";
|
|
9
|
+
import { range } from "@thi.ng/transducers/range";
|
|
10
|
+
import { some } from "@thi.ng/transducers/some";
|
|
11
|
+
import { transduce } from "@thi.ng/transducers/transduce";
|
|
12
|
+
import { compileModel } from "./buffer.js";
|
|
13
|
+
import { isFloatTexture, isGL2Context } from "./checks.js";
|
|
14
|
+
import { draw } from "./draw.js";
|
|
15
|
+
import { defFBO } from "./fbo.js";
|
|
16
|
+
import { defQuadModel } from "./geo/quad.js";
|
|
17
|
+
import { defShader } from "./shader.js";
|
|
18
|
+
import { PASSTHROUGH_VS } from "./shaders/pipeline.js";
|
|
19
|
+
import { defTexture } from "./texture.js";
|
|
12
20
|
export const defMultiPass = (opts) => {
|
|
13
21
|
const gl = opts.gl;
|
|
14
22
|
const numPasses = opts.passes.length;
|
|
@@ -70,9 +78,9 @@ const initPasses = (opts, textures) => {
|
|
|
70
78
|
const gl = opts.gl;
|
|
71
79
|
const model = compileModel(gl, defQuadModel({ uv: false }));
|
|
72
80
|
return opts.passes.map((pass) => {
|
|
73
|
-
const m = pass.model ? compileModel(gl, pass.model) :
|
|
81
|
+
const m = pass.model ? compileModel(gl, pass.model) : { ...model };
|
|
74
82
|
m.shader = initShader(gl, pass, textures);
|
|
75
|
-
m.uniforms =
|
|
83
|
+
m.uniforms = { ...pass.uniformVals };
|
|
76
84
|
pass.inputs.length > 0 &&
|
|
77
85
|
(m.textures = pass.inputs.map((id) => textures[id]));
|
|
78
86
|
return m;
|
|
@@ -90,7 +98,10 @@ const initShader = (gl, pass, textures) => {
|
|
|
90
98
|
position: "vec2",
|
|
91
99
|
},
|
|
92
100
|
varying: pass.varying,
|
|
93
|
-
uniforms:
|
|
101
|
+
uniforms: {
|
|
102
|
+
...pass.uniforms,
|
|
103
|
+
...transduce(map((i) => [`input${i}`, ["sampler2D", i]]), assocObj(), range(numIns)),
|
|
104
|
+
},
|
|
94
105
|
outputs: numOuts
|
|
95
106
|
? transduce(map((i) => [
|
|
96
107
|
`output${i}`,
|
|
@@ -117,7 +128,14 @@ const initShader = (gl, pass, textures) => {
|
|
|
117
128
|
return defShader(gl, spec);
|
|
118
129
|
};
|
|
119
130
|
const initTextures = (opts) => Object.keys(opts.textures).reduce((acc, id) => {
|
|
120
|
-
acc[id] = defTexture(opts.gl,
|
|
131
|
+
acc[id] = defTexture(opts.gl, {
|
|
132
|
+
width: opts.width,
|
|
133
|
+
height: opts.height,
|
|
134
|
+
filter: opts.gl.NEAREST,
|
|
135
|
+
wrap: opts.gl.CLAMP_TO_EDGE,
|
|
136
|
+
image: null,
|
|
137
|
+
...opts.textures[id],
|
|
138
|
+
});
|
|
121
139
|
return acc;
|
|
122
140
|
}, {});
|
|
123
141
|
const initBuffers = (opts, textures, useMainBuffer) => (useMainBuffer
|