glre 0.21.0 → 0.22.0

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.
Files changed (48) hide show
  1. package/README.md +150 -80
  2. package/dist/index.d.ts +524 -7
  3. package/dist/index.js +46 -13
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +46 -13
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/native.d.ts +6 -64
  8. package/dist/native.js +46 -13
  9. package/dist/native.js.map +1 -1
  10. package/dist/native.mjs +46 -13
  11. package/dist/native.mjs.map +1 -1
  12. package/dist/react.d.ts +7 -11
  13. package/dist/react.js +46 -13
  14. package/dist/react.js.map +1 -1
  15. package/dist/react.mjs +46 -13
  16. package/dist/react.mjs.map +1 -1
  17. package/dist/solid.d.ts +6 -63
  18. package/dist/solid.js +46 -13
  19. package/dist/solid.js.map +1 -1
  20. package/dist/solid.mjs +46 -13
  21. package/dist/solid.mjs.map +1 -1
  22. package/package.json +25 -60
  23. package/src/code/glsl.ts +186 -0
  24. package/src/code/wgsl.ts +170 -0
  25. package/src/index.ts +105 -0
  26. package/src/native.ts +24 -0
  27. package/src/node/cache.ts +67 -0
  28. package/src/node/const.ts +147 -0
  29. package/src/node/conv.ts +122 -0
  30. package/src/node/index.ts +96 -0
  31. package/src/node/node.ts +114 -0
  32. package/src/node/types.ts +101 -0
  33. package/src/node/uniform.ts +99 -0
  34. package/src/react.ts +18 -0
  35. package/src/solid.ts +15 -0
  36. package/src/types.ts +90 -0
  37. package/src/utils.ts +53 -0
  38. package/src/webgl/buffer.ts +78 -0
  39. package/src/webgl/index.ts +79 -0
  40. package/src/webgl/program.ts +61 -0
  41. package/src/webgl/shader.ts +60 -0
  42. package/src/webgl/texture.ts +93 -0
  43. package/src/webgpu/buffer.ts +96 -0
  44. package/src/webgpu/device.ts +91 -0
  45. package/src/webgpu/index.ts +40 -0
  46. package/src/webgpu/pipeline.ts +94 -0
  47. package/src/webgpu/texture.ts +139 -0
  48. package/dist/types-f429c8b1.d.ts +0 -79
package/dist/index.d.ts CHANGED
@@ -1,9 +1,526 @@
1
- import { G as GL } from './types-f429c8b1.js';
2
- export { Fun } from 'refr';
3
- import 'reev';
1
+ import * as reev from 'reev';
2
+ import { EventState, Nested } from 'reev';
3
+ import * as refr from 'refr';
4
+ import { Queue, Frame } from 'refr';
5
+ export { Frame, Fun, Queue } from 'refr';
6
+ import * as refr_dist_types_687121c7 from 'refr/dist/types-687121c7';
4
7
 
5
- declare const createGL: (props?: Partial<GL>) => GL;
6
- declare const gl: GL;
7
- declare const createTF: (props?: Partial<GL>, self?: GL) => GL;
8
+ declare const TYPES: readonly ["float", "int", "uint", "bool", "color", "vec2", "vec3", "vec4", "mat2", "mat3", "mat4", "ivec2", "ivec3", "ivec4", "uvec2", "uvec3", "uvec4", "bvec2", "bvec3", "bvec4"];
9
+ type NodeType = (typeof TYPES)[number];
10
+ declare const SWIZZLES: readonly ["x", "y", "z", "w", "r", "g", "b", "a", "s", "t", "p", "q"];
11
+ type AllSwizzles<T extends string> = T | `${T}${T}` | `${T}${T}${T}` | `${T}${T}${T}${T}`;
12
+ type Swillzes = AllSwizzles<'x' | 'y' | 'z' | 'w'> | AllSwizzles<'r' | 'g' | 'b' | 'a'> | AllSwizzles<'p' | 'q'> | AllSwizzles<'s' | 't'>;
13
+ declare const OPERATORS: readonly ["add", "sub", "mul", "div", "mod", "equal", "notEqual", "lessThan", "lessThanEqual", "greaterThan", "greaterThanEqual", "and", "or", "not", "assign", "xor", "bitAnd", "bitNot", "bitOr", "bitXor", "shiftLeft", "shiftRight"];
14
+ type Operator = (typeof OPERATORS)[number];
15
+ declare const FUNCTIONS: readonly ["abs", "acos", "asin", "atan", "atan2", "ceil", "clamp", "cos", "cross", "degrees", "distance", "dot", "exp", "exp2", "faceforward", "floor", "fract", "length", "all", "any", "bitcast", "cbrt", "dFdx", "dFdy", "difference", "equals", "fwidth", "inverseSqrt", "lengthSq", "log", "log2", "max", "min", "mix", "negate", "normalize", "oneMinus", "pow", "pow2", "pow3", "pow4", "radians", "reciprocal", "reflect", "refract", "round", "saturate", "sign", "sin", "smoothstep", "sqrt", "step", "tan", "transformDirection", "trunc"];
16
+ type MathFunction = (typeof FUNCTIONS)[number];
17
+ declare const CACHE_BOOLS: readonly [true, false];
18
+ declare const CACHE_INTS: readonly [0, 1, 2, 3, 4, 5];
19
+ declare const CACHE_FLOATS: readonly [0, 1, 0.5, 2];
8
20
 
9
- export { GL, createGL, createTF, gl as default, gl };
21
+ interface Node {
22
+ id: string;
23
+ type: NodeType;
24
+ value?: any;
25
+ property?: string;
26
+ parent?: Node;
27
+ children?: Node[];
28
+ operator?: Operator;
29
+ mathFunction?: MathFunction;
30
+ }
31
+ interface ProxyCallback {
32
+ path: string[];
33
+ args: any[];
34
+ }
35
+ type NodeCreator = (value?: any) => X;
36
+ interface OperatorMethods {
37
+ add(x: X | number): X;
38
+ sub(x: X | number): X;
39
+ mul(x: X | number): X;
40
+ div(x: X | number): X;
41
+ mod(x: X | number): X;
42
+ equal(x: X | number): X;
43
+ notEqual(x: X | number): X;
44
+ lessThan(x: X | number): X;
45
+ lessThanEqual(x: X | number): X;
46
+ greaterThan(x: X | number): X;
47
+ greaterThanEqual(x: X | number): X;
48
+ and(x: X): X;
49
+ or(x: X): X;
50
+ not(): X;
51
+ }
52
+ interface MathMethods {
53
+ abs(): X;
54
+ acos(): X;
55
+ asin(): X;
56
+ atan(): X;
57
+ ceil(): X;
58
+ cos(): X;
59
+ floor(): X;
60
+ fract(): X;
61
+ length(): X;
62
+ normalize(): X;
63
+ sin(): X;
64
+ sqrt(): X;
65
+ tan(): X;
66
+ toVar(): X;
67
+ }
68
+ type SwizzleProperties = {
69
+ [k in Swillzes]: X;
70
+ };
71
+ interface X extends MathMethods, OperatorMethods, SwizzleProperties {
72
+ readonly id: string;
73
+ readonly type: NodeType;
74
+ readonly value: any;
75
+ readonly property: string;
76
+ (...args: any[]): X;
77
+ }
78
+ interface UniformNode extends X {
79
+ set(value: any): void;
80
+ onObjectUpdate(callback: (context: any) => any): UniformNode;
81
+ onRenderUpdate(callback: (context: any) => any): UniformNode;
82
+ }
83
+ interface FunctionNode {
84
+ (...args: any[]): X;
85
+ call(x: X[]): X;
86
+ }
87
+ interface ConditionalNode {
88
+ ElseIf(condition: X, callback: () => void): ConditionalNode;
89
+ Else(callback: () => void): void;
90
+ }
91
+ interface ConversionContext {
92
+ target: 'webgl' | 'webgpu';
93
+ nodes: Map<string, Node>;
94
+ variables: Map<string, string>;
95
+ functions: Map<string, string>;
96
+ }
97
+
98
+ declare const getCachedBool: (x: boolean) => X;
99
+ declare const getCachedInt: (x: number) => X;
100
+ declare const getCachedFloat: (x: number) => X;
101
+ declare const findDuplicateNodes: (nodes: X[]) => Map<string, X[]>;
102
+
103
+ declare const convertToNode: (x: unknown) => X;
104
+ declare const float: (x: unknown) => X;
105
+ declare const int: (x: unknown) => X;
106
+ declare const bool: (x: unknown) => X;
107
+ declare const vec2: (x?: any, y?: any) => X;
108
+ declare const vec3: (x?: any, y?: any, z?: any) => X;
109
+ declare const vec4: (x?: any, y?: any, z?: any, w?: any) => X;
110
+ declare const color: (r?: any, g?: any, b?: any) => X;
111
+
112
+ declare const createNode: (type: NodeType, value?: any, options?: Partial<Node>) => Node;
113
+ declare const node: (type: NodeType, value?: any, options?: Partial<Node>) => X;
114
+
115
+ interface UpdateContext {
116
+ object?: any;
117
+ camera?: any;
118
+ renderer?: any;
119
+ scene?: any;
120
+ time?: number;
121
+ }
122
+ declare const uniform: (initialValue: any) => UniformNode;
123
+ declare const iPrevTime: UniformNode;
124
+ declare const iDeltaTime: UniformNode;
125
+ declare const updateUniforms: (context: UpdateContext) => void;
126
+
127
+ declare const Fn: (jsFunc: Function) => FunctionNode;
128
+ declare const If: (condition: X, callback: () => void) => ConditionalNode;
129
+ declare const gl_FragCoord: X;
130
+ declare const gl_Position: X;
131
+ declare const iTime: UniformNode;
132
+ declare const iResolution: UniformNode;
133
+ declare const iMouse: UniformNode;
134
+ declare const abs: (x: X) => X;
135
+ declare const sin: (x: X) => X;
136
+ declare const cos: (x: X) => X;
137
+ declare const tan: (x: X) => X;
138
+ declare const sqrt: (x: X) => X;
139
+ declare const floor: (x: X) => X;
140
+ declare const ceil: (x: X) => X;
141
+ declare const fract: (x: X) => X;
142
+ declare const normalize: (x: X) => X;
143
+ declare const length: (x: X) => X;
144
+
145
+ type Uniform = number | number[];
146
+ type Attribute = number[];
147
+ type Attributes = Record<string, Attribute>;
148
+ type Uniforms = Record<string, Uniform>;
149
+ type PrecisionMode = 'highp' | 'mediump' | 'lowp';
150
+ type GLClearMode = 'COLOR_BUFFER_BIT' | 'DEPTH_BUFFER_BIT' | 'STENCIL_BUFFER_BIT';
151
+ type GLDrawMode = 'POINTS' | 'LINE_STRIP' | 'LINE_LOOP' | 'LINES' | 'TRIANGLE_STRIP' | 'TRIANGLE_FAN' | 'TRIANGLES';
152
+ type GLDrawType = 'UNSIGNED_BYTE' | 'UNSIGNED_SHORT' | 'UNSIGNED_INT';
153
+ type GL = EventState<{
154
+ /**
155
+ * initial value
156
+ */
157
+ isNative: boolean;
158
+ isWebGL: boolean;
159
+ isLoop: boolean;
160
+ isGL: true;
161
+ width: number;
162
+ height: number;
163
+ size: [number, number];
164
+ mouse: [number, number];
165
+ count: number;
166
+ vs: string | X;
167
+ fs: string | X;
168
+ vert: string | X;
169
+ frag: string | X;
170
+ vertex: string | X;
171
+ fragment: string | X;
172
+ /**
173
+ * for webgl
174
+ */
175
+ int: PrecisionMode;
176
+ float: PrecisionMode;
177
+ sampler2D: PrecisionMode;
178
+ samplerCube: PrecisionMode;
179
+ lastActiveUnit: number;
180
+ /**
181
+ * core state
182
+ */
183
+ gl: any;
184
+ pg: any;
185
+ el: any;
186
+ queue: Queue;
187
+ frame: Frame;
188
+ stride: Nested<number>;
189
+ location: Nested<any>;
190
+ activeUnit: Nested<number>;
191
+ default: any;
192
+ /**
193
+ * events
194
+ */
195
+ ref?: any;
196
+ init(): void;
197
+ loop(): void;
198
+ mount(): void;
199
+ clean(): void;
200
+ render(): void;
201
+ resize(e?: Event): void;
202
+ mousemove(e: Event): void;
203
+ /**
204
+ * setter
205
+ */
206
+ _uniform?(key: string, value: Uniform, isMatrix?: boolean): GL;
207
+ uniform(key: string, value: Uniform, isMatrix?: boolean): GL;
208
+ uniform(target: {
209
+ [key: string]: Uniform;
210
+ }): GL;
211
+ _texture?(key: string, value: string): GL;
212
+ texture(key: string, value: string): GL;
213
+ texture(target: {
214
+ [key: string]: string;
215
+ }): GL;
216
+ _attribute?(key: string, value: Attribute, iboValue?: Attribute): GL;
217
+ attribute(key: string, value: Attribute, iboValue?: Attribute): GL;
218
+ attribute(target: {
219
+ [key: string]: Attribute;
220
+ }): GL;
221
+ }>;
222
+
223
+ interface GLSLContext extends ConversionContext {
224
+ target: 'webgl';
225
+ precision: 'lowp' | 'mediump' | 'highp';
226
+ version: '100' | '300 es';
227
+ }
228
+ declare const nodeToGLSL: (nodeProxy: X, context?: Partial<GLSLContext>) => string;
229
+ declare const glsl: (fragmentNode: X, options?: {
230
+ precision?: "lowp" | "mediump" | "highp";
231
+ version?: "100" | "300 es";
232
+ uniforms?: Record<string, any>;
233
+ }) => string;
234
+
235
+ interface WGSLContext extends ConversionContext {
236
+ target: 'webgpu';
237
+ }
238
+ declare const nodeToWGSL: (nodeProxy: X, context?: Partial<WGSLContext>) => string;
239
+ declare const wgsl: (fragmentNode: X, options?: {
240
+ uniforms?: Record<string, any>;
241
+ }) => string;
242
+
243
+ declare const is: {
244
+ arr: (arg: any) => arg is any[];
245
+ bol: (a: unknown) => a is boolean;
246
+ str: (a: unknown) => a is string;
247
+ num: (a: unknown) => a is number;
248
+ int: (a: unknown) => a is number;
249
+ fun: (a: unknown) => a is Function;
250
+ und: (a: unknown) => a is undefined;
251
+ nul: (a: unknown) => a is null;
252
+ set: (a: unknown) => a is Set<unknown>;
253
+ map: (a: unknown) => a is Map<unknown, unknown>;
254
+ obj: (a: unknown) => a is object;
255
+ nan: (a: unknown) => a is number;
256
+ };
257
+ declare const isServer: () => boolean;
258
+ declare const isWebGPUSupported: () => boolean;
259
+ /**
260
+ * each
261
+ */
262
+ type EachFn<Value, Key, This> = (this: This, value: Value, key: Key) => void;
263
+ type Eachable<Value = any, Key = any, This = any> = {
264
+ forEach(cb: EachFn<Value, Key, This>, ctx?: This): void;
265
+ };
266
+ declare const each: <Value, Key, This>(obj: Eachable<Value, Key, This>, fn: EachFn<Value, Key, This>) => void;
267
+ declare const flush: <Value extends Function, Key, This>(obj: Eachable<Value, Key, This>, ...args: any[]) => void;
268
+ /**
269
+ * other
270
+ */
271
+ declare const replace: (x?: string, from?: string, to?: string) => string;
272
+ declare const ext: (src?: string) => string;
273
+ declare const fig: (x?: number) => number;
274
+ declare const dig: (x?: number) => number;
275
+ declare const sig: (value?: number, digit?: number) => number;
276
+
277
+ declare const createVbo: (c: WebGLRenderingContext, data: number[]) => WebGLBuffer;
278
+ declare const createIbo: (c: WebGLRenderingContext, data: number[]) => WebGLBuffer;
279
+ declare const createAttribute: (c: WebGLRenderingContext, stride: number, location: number, vbo: WebGLBuffer, ibo?: WebGLBuffer) => void;
280
+ declare const deleteBuffer: (c: WebGLRenderingContext, buffer: WebGLBuffer) => void;
281
+ declare const vertexStride: (count: number, value: number[], iboValue?: number[]) => number;
282
+ declare const updateVbo: (c: WebGLRenderingContext, buffer: WebGLBuffer, data: number[], usage?: 35044) => void;
283
+ declare const updateIbo: (c: WebGLRenderingContext, buffer: WebGLBuffer, data: number[], usage?: 35044) => void;
284
+
285
+ declare const createProgram: (c: WebGLRenderingContext, vs: WebGLShader, fs: WebGLShader) => WebGLProgram;
286
+ declare const deleteProgram: (c: WebGLRenderingContext, pg: WebGLProgram) => void;
287
+ declare const getProgramInfo: (c: WebGLRenderingContext, pg: WebGLProgram) => {
288
+ linked: any;
289
+ log: string | null;
290
+ activeAttributes: any;
291
+ activeUniforms: any;
292
+ };
293
+ declare const getUniformType: (value: number | number[], isMatrix?: boolean) => string;
294
+ declare const getUniformLocation: (c: WebGLRenderingContext, pg: WebGLProgram, name: string) => WebGLUniformLocation | null;
295
+ declare const getAttribLocation: (c: WebGLRenderingContext, pg: WebGLProgram, name: string) => number;
296
+
297
+ declare const deleteShader: (c: WebGLRenderingContext, shader: WebGLShader) => void;
298
+ declare const createVertexShader: (c: WebGLRenderingContext, source?: string) => WebGLShader;
299
+ declare const createFragmentShader: (c: WebGLRenderingContext, source?: string) => WebGLShader;
300
+ declare const getShaderInfo: (c: WebGLRenderingContext, shader: WebGLShader) => {
301
+ compiled: any;
302
+ log: string | null;
303
+ source: string | null;
304
+ };
305
+
306
+ declare const createTexture: (c: WebGLRenderingContext, img: HTMLImageElement) => WebGLTexture;
307
+ declare const activeTexture: (c: WebGLRenderingContext, location: WebGLUniformLocation | null, unit: number, texture: WebGLTexture) => void;
308
+ declare const deleteTexture: (c: WebGLRenderingContext, texture: WebGLTexture) => void;
309
+ declare const createEmptyTexture: (c: WebGLRenderingContext, w?: number, h?: number, format?: 6408, type?: 5121) => WebGLTexture;
310
+ declare const createCubeTexture: (c: WebGLRenderingContext, imgs: HTMLImageElement[]) => WebGLTexture;
311
+
312
+ declare const webgl: (gl: GL) => GL;
313
+
314
+ declare const createBuffer: (device: any, data: Float32Array | Uint32Array | number[], usage: number) => any;
315
+ declare const createVertexBuffer: (device: any, data: number[]) => any;
316
+ declare const createIndexBuffer: (device: any, data: number[]) => any;
317
+ declare const createUniformBuffer: (device: any, size: number) => any;
318
+ declare const createStorageBuffer: (device: any, size: number) => any;
319
+ declare const updateBuffer: (device: any, buffer: any, data: Float32Array | Uint32Array | number[], offset?: number) => void;
320
+ declare const destroyBuffer: (buffer: any) => any;
321
+ declare const calculateBufferSize: (data: number[]) => number;
322
+ declare const alignBufferSize: (size: number, alignment?: number) => number;
323
+ declare const createBuffers: (device: any, bufferConfigs: Array<{
324
+ data: number[];
325
+ usage: number;
326
+ }>) => any[];
327
+ declare const BufferUsage: {
328
+ readonly VERTEX: 32;
329
+ readonly INDEX: 64;
330
+ readonly UNIFORM: 64;
331
+ readonly STORAGE: 128;
332
+ readonly COPY_SRC: 4;
333
+ readonly COPY_DST: 8;
334
+ readonly MAP_READ: 1;
335
+ readonly MAP_WRITE: 2;
336
+ };
337
+
338
+ declare const requestWebGPUDevice: () => Promise<{
339
+ adapter: any;
340
+ device: any;
341
+ }>;
342
+ declare const checkWebGPUSupport: () => boolean;
343
+ declare const getDeviceLimits: (device: any) => {
344
+ maxTextureDimension1D: any;
345
+ maxTextureDimension2D: any;
346
+ maxTextureDimension3D: any;
347
+ maxTextureArrayLayers: any;
348
+ maxBindGroups: any;
349
+ maxDynamicUniformBuffersPerPipelineLayout: any;
350
+ maxDynamicStorageBuffersPerPipelineLayout: any;
351
+ maxSampledTexturesPerShaderStage: any;
352
+ maxSamplersPerShaderStage: any;
353
+ maxStorageBuffersPerShaderStage: any;
354
+ maxStorageTexturesPerShaderStage: any;
355
+ maxUniformBuffersPerShaderStage: any;
356
+ maxUniformBufferBindingSize: any;
357
+ maxStorageBufferBindingSize: any;
358
+ maxVertexBuffers: any;
359
+ maxVertexAttributes: any;
360
+ maxVertexBufferArrayStride: any;
361
+ maxComputeWorkgroupStorageSize: any;
362
+ maxComputeInvocationsPerWorkgroup: any;
363
+ maxComputeWorkgroupSizeX: any;
364
+ maxComputeWorkgroupSizeY: any;
365
+ maxComputeWorkgroupSizeZ: any;
366
+ maxComputeWorkgroupsPerDimension: any;
367
+ };
368
+ declare const setupDeviceErrorHandling: (device: any) => void;
369
+ declare const configureCanvasContext: (canvas: HTMLCanvasElement, device: any, format?: any) => RenderingContext;
370
+
371
+ declare const createRenderPipeline: (device: any, vertexShader?: string, fragmentShader?: string, format?: string) => any;
372
+ declare const createComputePipeline: (device: any, computeShader: string) => any;
373
+ declare const createShaderModule: (device: any, code: string) => any;
374
+ declare const createBindGroupLayout: (device: any, entries: any[]) => any;
375
+ declare const createBindGroup: (device: any, layout: any, entries: any[]) => any;
376
+ declare const createRenderPass: (encoder: any, colorAttachment: any, depthStencilAttachment?: any) => any;
377
+ declare const createCommandEncoder: (device: any) => any;
378
+
379
+ declare const createTextureFromImage: (device: any, image: HTMLImageElement | ImageBitmap, format?: string) => any;
380
+ declare const createDepthTexture: (device: any, w?: number, h?: number, format?: string) => any;
381
+ declare const createSampler: (device: any, options?: {
382
+ magFilter?: string;
383
+ minFilter?: string;
384
+ addressModeU?: string;
385
+ addressModeV?: string;
386
+ addressModeW?: string;
387
+ }) => any;
388
+ declare const createTextureView: (texture: any, options?: {
389
+ format?: string;
390
+ dimension?: string;
391
+ aspect?: string;
392
+ baseMipLevel?: number;
393
+ mipLevelCount?: number;
394
+ baseArrayLayer?: number;
395
+ arrayLayerCount?: number;
396
+ }) => any;
397
+ declare const updateTexture: (device: any, texture: any, data: Uint8Array | Uint8ClampedArray, w?: number, h?: number) => void;
398
+ declare const destroyTexture: (texture: any) => any;
399
+ declare const TextureUsage: {
400
+ readonly COPY_SRC: 1;
401
+ readonly COPY_DST: 2;
402
+ readonly TEXTURE_BINDING: 4;
403
+ readonly STORAGE_BINDING: 8;
404
+ readonly RENDER_ATTACHMENT: 16;
405
+ };
406
+ declare const TextureFormat: {
407
+ readonly RGBA8_UNORM: "rgba8unorm";
408
+ readonly RGBA8_SRGB: "rgba8unorm-srgb";
409
+ readonly BGRA8_UNORM: "bgra8unorm";
410
+ readonly BGRA8_SRGB: "bgra8unorm-srgb";
411
+ readonly DEPTH24_PLUS: "depth24plus";
412
+ readonly DEPTH32_FLOAT: "depth32float";
413
+ };
414
+
415
+ declare const webgpu: (gl: GL) => reev.EventState<{
416
+ isNative: boolean;
417
+ isWebGL: boolean;
418
+ isLoop: boolean;
419
+ isGL: true;
420
+ width: number;
421
+ height: number;
422
+ size: [number, number];
423
+ mouse: [number, number];
424
+ count: number;
425
+ vs: string | X;
426
+ fs: string | X;
427
+ vert: string | X;
428
+ frag: string | X;
429
+ vertex: string | X;
430
+ fragment: string | X;
431
+ int: PrecisionMode;
432
+ float: PrecisionMode;
433
+ sampler2D: PrecisionMode;
434
+ samplerCube: PrecisionMode;
435
+ lastActiveUnit: number;
436
+ gl: any;
437
+ pg: any;
438
+ el: any;
439
+ queue: refr_dist_types_687121c7.Q;
440
+ frame: refr_dist_types_687121c7.a;
441
+ stride: reev.Nested<number>;
442
+ location: reev.Nested<any>;
443
+ activeUnit: reev.Nested<number>;
444
+ default: any;
445
+ ref?: any;
446
+ init(): void;
447
+ loop(): void;
448
+ mount(): void;
449
+ clean(): void;
450
+ render(): void;
451
+ resize(e?: Event): void;
452
+ mousemove(e: Event): void;
453
+ _uniform?(key: string, value: Uniform, isMatrix?: boolean): GL;
454
+ uniform(key: string, value: Uniform, isMatrix?: boolean): GL;
455
+ uniform(target: {
456
+ [key: string]: Uniform;
457
+ }): GL;
458
+ _texture?(key: string, value: string): GL;
459
+ texture(key: string, value: string): GL;
460
+ texture(target: {
461
+ [key: string]: string;
462
+ }): GL;
463
+ _attribute?(key: string, value: Attribute, iboValue?: Attribute): GL;
464
+ attribute(key: string, value: Attribute, iboValue?: Attribute): GL;
465
+ attribute(target: {
466
+ [key: string]: Attribute;
467
+ }): GL;
468
+ }, any[] | unknown[]>;
469
+
470
+ declare const isGL: (a: unknown) => a is EventState<GL>;
471
+ declare const createGL: (props?: Partial<GL>) => EventState<{
472
+ isNative: boolean;
473
+ isWebGL: boolean;
474
+ isLoop: boolean;
475
+ isGL: true;
476
+ width: number;
477
+ height: number;
478
+ size: [number, number];
479
+ mouse: [number, number];
480
+ count: number;
481
+ vs: string | X;
482
+ fs: string | X;
483
+ vert: string | X;
484
+ frag: string | X;
485
+ vertex: string | X;
486
+ fragment: string | X;
487
+ int: PrecisionMode;
488
+ float: PrecisionMode;
489
+ sampler2D: PrecisionMode;
490
+ samplerCube: PrecisionMode;
491
+ lastActiveUnit: number;
492
+ gl: any;
493
+ pg: any;
494
+ el: any;
495
+ queue: refr.Queue;
496
+ frame: refr.Frame;
497
+ stride: reev.Nested<number>;
498
+ location: reev.Nested<any>;
499
+ activeUnit: reev.Nested<number>;
500
+ default: any;
501
+ ref?: any;
502
+ init(): void;
503
+ loop(): void;
504
+ mount(): void;
505
+ clean(): void;
506
+ render(): void;
507
+ resize(e?: Event): void;
508
+ mousemove(e: Event): void;
509
+ _uniform?(key: string, value: Uniform, isMatrix?: boolean): GL;
510
+ uniform(key: string, value: Uniform, isMatrix?: boolean): GL;
511
+ uniform(target: {
512
+ [key: string]: Uniform;
513
+ }): GL;
514
+ _texture?(key: string, value: string): GL;
515
+ texture(key: string, value: string): GL;
516
+ texture(target: {
517
+ [key: string]: string;
518
+ }): GL;
519
+ _attribute?(key: string, value: Attribute, iboValue?: Attribute): GL;
520
+ attribute(key: string, value: Attribute, iboValue?: Attribute): GL;
521
+ attribute(target: {
522
+ [key: string]: Attribute;
523
+ }): GL;
524
+ }, any[] | unknown[]>;
525
+
526
+ export { Attribute, Attributes, BufferUsage, CACHE_BOOLS, CACHE_FLOATS, CACHE_INTS, ConditionalNode, ConversionContext, FUNCTIONS, Fn, FunctionNode, GL, GLClearMode, GLDrawMode, GLDrawType, If, MathFunction, MathMethods, Node, NodeCreator, NodeType, OPERATORS, Operator, OperatorMethods, PrecisionMode, ProxyCallback, SWIZZLES, Swillzes, SwizzleProperties, TYPES, TextureFormat, TextureUsage, Uniform, UniformNode, Uniforms, X, abs, activeTexture, alignBufferSize, bool, calculateBufferSize, ceil, checkWebGPUSupport, color, configureCanvasContext, convertToNode, cos, createAttribute, createBindGroup, createBindGroupLayout, createBuffer, createBuffers, createCommandEncoder, createComputePipeline, createCubeTexture, createDepthTexture, createEmptyTexture, createFragmentShader, createGL, createIbo, createIndexBuffer, createNode, createProgram, createRenderPass, createRenderPipeline, createSampler, createShaderModule, createStorageBuffer, createTexture, createTextureFromImage, createTextureView, createUniformBuffer, createVbo, createVertexBuffer, createVertexShader, createGL as default, deleteBuffer, deleteProgram, deleteShader, deleteTexture, destroyBuffer, destroyTexture, dig, each, ext, fig, findDuplicateNodes, float, floor, flush, fract, getAttribLocation, getCachedBool, getCachedFloat, getCachedInt, getDeviceLimits, getProgramInfo, getShaderInfo, getUniformLocation, getUniformType, gl_FragCoord, gl_Position, glsl, iDeltaTime, iMouse, iPrevTime, iResolution, iTime, int, is, isGL, isServer, isWebGPUSupported, length, node, nodeToGLSL, nodeToWGSL, normalize, replace, requestWebGPUDevice, setupDeviceErrorHandling, sig, sin, sqrt, tan, uniform, updateBuffer, updateIbo, updateTexture, updateUniforms, updateVbo, vec2, vec3, vec4, vertexStride, webgl, webgpu, wgsl };