@luma.gl/shadertools 9.0.15 → 9.0.17

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 (67) hide show
  1. package/dist/dist.dev.js +787 -195
  2. package/dist/dist.min.js +79 -79
  3. package/dist/index.cjs +18 -2854
  4. package/dist/index.cjs.map +4 -4
  5. package/dist/lib/shader-module/shader-module.d.ts +22 -13
  6. package/dist/lib/shader-module/shader-module.d.ts.map +1 -1
  7. package/dist/lib/shader-module/shader-pass.d.ts +4 -2
  8. package/dist/lib/shader-module/shader-pass.d.ts.map +1 -1
  9. package/dist/lib/utils/uniform-types.d.ts +49 -0
  10. package/dist/lib/utils/uniform-types.d.ts.map +1 -0
  11. package/dist/lib/utils/uniform-types.js +1 -0
  12. package/dist/lib/wgsl/get-shader-layout-wgsl.js +5 -5
  13. package/dist/modules/engine/picking/picking.d.ts +5 -5
  14. package/dist/modules/engine/picking/picking.d.ts.map +1 -1
  15. package/dist/modules/engine/picking/picking.js +2 -2
  16. package/dist/modules/engine/project/project.d.ts +9 -8
  17. package/dist/modules/engine/project/project.d.ts.map +1 -1
  18. package/dist/modules/lighting/lights/lighting-uniforms.d.ts +13 -13
  19. package/dist/modules/lighting/lights/lighting-uniforms.d.ts.map +1 -1
  20. package/dist/modules/lighting/no-material/dirlight.d.ts +2 -2
  21. package/dist/modules/lighting/no-material/dirlight.d.ts.map +1 -1
  22. package/dist/modules/lighting/no-material/dirlight.js +1 -1
  23. package/dist/modules/lighting/pbr-material/pbr-material.d.ts +14 -13
  24. package/dist/modules/lighting/pbr-material/pbr-material.d.ts.map +1 -1
  25. package/dist/modules/lighting/pbr-material/pbr-material.js +0 -11
  26. package/dist/modules/postprocessing/image-blur-filters/tiltshift.d.ts +2 -2
  27. package/dist/modules/postprocessing/image-blur-filters/tiltshift.d.ts.map +1 -1
  28. package/dist/modules/postprocessing/image-blur-filters/triangleblur.d.ts +1 -1
  29. package/dist/modules/postprocessing/image-blur-filters/triangleblur.d.ts.map +1 -1
  30. package/dist/modules/postprocessing/image-blur-filters/zoomblur.d.ts +1 -1
  31. package/dist/modules/postprocessing/image-blur-filters/zoomblur.d.ts.map +1 -1
  32. package/dist/modules/postprocessing/image-fun-filters/colorhalftone.d.ts +1 -1
  33. package/dist/modules/postprocessing/image-fun-filters/colorhalftone.d.ts.map +1 -1
  34. package/dist/modules/postprocessing/image-fun-filters/dotscreen.d.ts +1 -1
  35. package/dist/modules/postprocessing/image-fun-filters/dotscreen.d.ts.map +1 -1
  36. package/dist/modules/postprocessing/image-fun-filters/hexagonalpixelate.d.ts +1 -1
  37. package/dist/modules/postprocessing/image-fun-filters/hexagonalpixelate.d.ts.map +1 -1
  38. package/dist/modules/postprocessing/image-fun-filters/magnify.d.ts +2 -2
  39. package/dist/modules/postprocessing/image-fun-filters/magnify.d.ts.map +1 -1
  40. package/dist/modules/postprocessing/image-warp-filters/bulgepinch.d.ts +1 -1
  41. package/dist/modules/postprocessing/image-warp-filters/bulgepinch.d.ts.map +1 -1
  42. package/dist/modules-webgl1/project/project.d.ts +6 -4
  43. package/dist/modules-webgl1/project/project.d.ts.map +1 -1
  44. package/package.json +4 -3
  45. package/src/lib/shader-module/shader-module.ts +24 -12
  46. package/src/lib/shader-module/shader-pass.ts +7 -4
  47. package/src/lib/utils/uniform-types.ts +91 -0
  48. package/src/lib/wgsl/get-shader-layout-wgsl.ts +5 -5
  49. package/src/modules/engine/picking/picking.ts +9 -9
  50. package/src/modules/engine/project/project.ts +10 -9
  51. package/src/modules/lighting/lights/lighting-uniforms.ts +16 -16
  52. package/src/modules/lighting/no-material/dirlight.ts +3 -3
  53. package/src/modules/lighting/pbr-material/pbr-material.ts +14 -24
  54. package/src/modules/postprocessing/image-blur-filters/tiltshift.ts +2 -2
  55. package/src/modules/postprocessing/image-blur-filters/triangleblur.ts +1 -1
  56. package/src/modules/postprocessing/image-blur-filters/zoomblur.ts +1 -1
  57. package/src/modules/postprocessing/image-fun-filters/colorhalftone.ts +1 -1
  58. package/src/modules/postprocessing/image-fun-filters/dotscreen.ts +1 -1
  59. package/src/modules/postprocessing/image-fun-filters/hexagonalpixelate.ts +1 -1
  60. package/src/modules/postprocessing/image-fun-filters/magnify.ts +2 -2
  61. package/src/modules/postprocessing/image-warp-filters/bulgepinch.ts +1 -1
  62. package/src/modules-webgl1/project/project.ts +8 -7
  63. package/dist/libs/wgsl-reflect/wgsl_reflect.module.d.ts +0 -1112
  64. package/dist/libs/wgsl-reflect/wgsl_reflect.module.d.ts.map +0 -1
  65. package/dist/libs/wgsl-reflect/wgsl_reflect.module.js +0 -3389
  66. package/src/libs/wgsl-reflect/wgsl_reflect.module.js +0 -3394
  67. package/src/libs/wgsl-reflect/wgsl_reflect.module.js.map +0 -1
@@ -1,37 +1,45 @@
1
- /// <reference types="node" />
2
- import { NumberArray } from '@math.gl/types';
3
1
  import { UniformFormat } from "../../types.js";
4
2
  import { PropType } from "../filters/prop-types.js";
5
- import { Sampler, Texture } from '@luma.gl/core';
6
- export type UniformValue = number | boolean | Readonly<NumberArray>;
3
+ import type { UniformTypes, UniformValue } from "../utils/uniform-types.js";
4
+ type Binding = unknown;
7
5
  export type UniformInfo = {
8
6
  format?: UniformFormat;
9
7
  } & PropType;
8
+ type BindingKeys<T> = {
9
+ [K in keyof T]: T[K] extends UniformValue ? never : K;
10
+ }[keyof T];
11
+ type UniformKeys<T> = {
12
+ [K in keyof T]: T[K] extends UniformValue ? K : never;
13
+ }[keyof T];
14
+ export type PickBindings<T> = {
15
+ [K in BindingKeys<Required<T>>]: T[K];
16
+ };
17
+ export type PickUniforms<T> = {
18
+ [K in UniformKeys<Required<T>>]: T[K];
19
+ };
10
20
  /**
11
21
  * A shader module definition object
12
- * @note Can be viewed as the ShaderModuleProps for a ShaderModuleInstance
22
+ * @note `UniformsT` & `BindingsT` are deduced from `PropsT` by default. If
23
+ * a custom type for `UniformsT` is used, `BindingsT` should be also be provided.
13
24
  */
14
- export type ShaderModule<PropsT extends Record<string, unknown> = Record<string, unknown>, UniformsT extends Record<string, UniformValue> = Record<string, UniformValue>, BindingsT extends Record<string, Buffer | Texture | Sampler> = {}> = {
25
+ export type ShaderModule<PropsT extends Record<string, any> = Record<string, any>, UniformsT extends Record<string, UniformValue> = PickUniforms<PropsT>, BindingsT extends Record<string, Binding> = PickBindings<PropsT>> = {
15
26
  /** Used for type inference not for values */
16
27
  props?: Required<PropsT>;
17
28
  /** Used for type inference, not currently used for values */
18
29
  uniforms?: UniformsT;
30
+ /** Used for type inference, not currently used for values */
31
+ bindings?: BindingsT;
19
32
  name: string;
20
33
  fs?: string;
21
34
  vs?: string;
22
35
  /** Uniform shader types @note: Both order and types MUST match uniform block declarations in shader */
23
- uniformTypes?: Record<keyof UniformsT, UniformFormat>;
36
+ uniformTypes?: Required<UniformTypes<UniformsT>>;
24
37
  /** Uniform JS prop types */
25
38
  uniformPropTypes?: Record<keyof UniformsT, UniformInfo>;
26
39
  /** Default uniform values */
27
40
  defaultUniforms?: Required<UniformsT>;
28
41
  /** Function that maps props to uniforms & bindings */
29
- getUniforms?: (props?: any, oldProps?: any) => Record<string, UniformValue>;
30
- /** uniform buffers, textures, samplers, storage, ... */
31
- bindings?: Record<keyof BindingsT, {
32
- location: number;
33
- type: 'texture' | 'sampler' | 'uniforms';
34
- }>;
42
+ getUniforms?: (props?: Partial<PropsT>, prevUniforms?: UniformsT) => Partial<UniformsT & BindingsT>;
35
43
  defines?: Record<string, string | number>;
36
44
  /** Injections */
37
45
  inject?: Record<string, string | {
@@ -52,4 +60,5 @@ export type ShaderModuleDeprecation = {
52
60
  old: string;
53
61
  deprecated?: boolean;
54
62
  };
63
+ export {};
55
64
  //# sourceMappingURL=shader-module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shader-module.d.ts","sourceRoot":"","sources":["../../../src/lib/shader-module/shader-module.ts"],"names":[],"mappings":";AAIA,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,aAAa,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CAAC,SAAS,CAAC,CAAC,CAAC;IACjD,6BAA6B;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,SAAS,EAAE,WAAW,CAAC,CAAC;IACxD,6BAA6B;IAC7B,eAAe,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;IAEtC,sDAAsD;IACtD,WAAW,CAAC,EAAE,CACZ,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EACvB,YAAY,CAAC,EAAE,SAAS,KACrB,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;IAEpC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAC1C,iBAAiB;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;IACrE,YAAY,CAAC,EAAE,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IACxC,2CAA2C;IAC3C,YAAY,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAEzC,eAAe;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,8DAA8D;AAC9D,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC"}
@@ -1,9 +1,11 @@
1
- import type { ShaderModule, UniformValue } from "./shader-module.js";
1
+ import type { Binding } from '@luma.gl/core';
2
+ import type { PickBindings, PickUniforms, ShaderModule } from "./shader-module.js";
3
+ import type { UniformValue } from "../utils/uniform-types.js";
2
4
  /**
3
5
  * A shaderpass is a shader module with additional information
4
6
  * on how to run
5
7
  */
6
- export type ShaderPass<PropsT extends Record<string, unknown> = Record<string, unknown>, UniformsT extends Record<string, UniformValue> = Record<string, UniformValue>> = ShaderModule<PropsT, UniformsT> & {
8
+ export type ShaderPass<PropsT extends Record<string, any> = Record<string, any>, UniformsT extends Record<string, UniformValue> = PickUniforms<PropsT>, BindingsT extends Record<string, Binding> = PickBindings<PropsT>> = ShaderModule<PropsT, UniformsT, BindingsT> & {
7
9
  passes: ShaderPassData[];
8
10
  };
9
11
  type ShaderPassData = {
@@ -1 +1 @@
1
- {"version":3,"file":"shader-pass.d.ts","sourceRoot":"","sources":["../../../src/lib/shader-module/shader-pass.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,YAAY,EAAE,YAAY,EAAC,2BAAwB;AAEhE;;;GAGG;AACH,MAAM,MAAM,UAAU,CACpB,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChE,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,IAC3E,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG;IACpC,MAAM,EAAE,cAAc,EAAE,CAAC;CAC1B,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CACzC,CAAC"}
1
+ {"version":3,"file":"shader-pass.d.ts","sourceRoot":"","sources":["../../../src/lib/shader-module/shader-pass.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAC,2BAAwB;AAC9E,OAAO,KAAK,EAAC,YAAY,EAAC,kCAA+B;AAEzD;;;GAGG;AACH,MAAM,MAAM,UAAU,CACpB,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACxD,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,EACrE,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,IAC9D,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,GAAG;IAC/C,MAAM,EAAE,cAAc,EAAE,CAAC;CAC1B,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CACzC,CAAC"}
@@ -0,0 +1,49 @@
1
+ import type { Matrix3, Matrix4, Vector2, Vector3, Vector4 } from '@math.gl/core';
2
+ export type NumberArray2 = [number, number];
3
+ export type NumberArray3 = [number, number, number];
4
+ export type NumberArray4 = [number, number, number, number];
5
+ export type NumberArray6 = [number, number, number, number, number, number];
6
+ export type NumberArray8 = [number, number, number, number, number, number, number, number];
7
+ export type NumberArray9 = [number, number, number, number, number, number, number, number, number];
8
+ export type NumberArray12 = [
9
+ number,
10
+ number,
11
+ number,
12
+ number,
13
+ number,
14
+ number,
15
+ number,
16
+ number,
17
+ number,
18
+ number,
19
+ number,
20
+ number
21
+ ];
22
+ export type NumberArray16 = [
23
+ number,
24
+ number,
25
+ number,
26
+ number,
27
+ number,
28
+ number,
29
+ number,
30
+ number,
31
+ number,
32
+ number,
33
+ number,
34
+ number,
35
+ number,
36
+ number,
37
+ number,
38
+ number
39
+ ];
40
+ export type UniformValue = Readonly<number | boolean | NumberArray2 | NumberArray3 | NumberArray4 | NumberArray6 | NumberArray8 | NumberArray9 | NumberArray12 | NumberArray16 | Vector2 | Vector3 | Vector4 | Matrix3 | Matrix4>;
41
+ type UniformType<ValueT extends UniformValue> = ValueT extends number | boolean ? 'f32' | 'i32' | 'u32' : ValueT extends Readonly<NumberArray2 | Vector2> ? 'vec2<f32>' | 'vec2<i32>' | 'vec2<u32>' : ValueT extends Readonly<NumberArray3 | Vector3> ? 'vec3<f32>' | 'vec3<i32>' | 'vec3<u32>' : ValueT extends Readonly<NumberArray4 | Vector4> ? 'vec4<f32>' | 'vec4<i32>' | 'vec4<u32>' | 'mat2x2<f32>' : ValueT extends Readonly<NumberArray6> ? 'mat2x3<f32>' | 'mat3x2<f32>' : ValueT extends Readonly<NumberArray8> ? 'mat2x4<f32>' | 'mat4x2<f32>' : ValueT extends Readonly<NumberArray9 | Matrix3> ? 'mat3x3<f32>' : ValueT extends Readonly<NumberArray12> ? 'mat3x4<f32>' | 'mat4x3<f32>' : ValueT extends Readonly<NumberArray16 | Matrix4> ? 'mat4x4<f32>' : never;
42
+ type UniformProps = {
43
+ [name: string]: UniformValue;
44
+ };
45
+ export type UniformTypes<PropsT extends UniformProps> = {
46
+ [name in keyof PropsT]: UniformType<PropsT[name]>;
47
+ };
48
+ export {};
49
+ //# sourceMappingURL=uniform-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uniform-types.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/uniform-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAE/E,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC5C,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACpD,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC5D,MAAM,MA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,CAAC,YAAY,GAAG,OAAO,CAAC,GAC/C,WAAW,GAAG,WAAW,GAAG,WAAW,GACvC,MAAM,SAAS,QAAQ,CAAC,YAAY,GAAG,OAAO,CAAC,GAC/C,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,aAAa,GACvD,MAAM,SAAS,QAAQ,CAAC,YAAY,CAAC,GACrC,aAAa,GAAG,aAAa,GAC7B,MAAM,SAAS,QAAQ,CAAC,YAAY,CAAC,GACrC,aAAa,GAAG,aAAa,GAC7B,MAAM,SAAS,QAAQ,CAAC,YAAY,GAAG,OAAO,CAAC,GAC/C,aAAa,GACb,MAAM,SAAS,QAAQ,CAAC,aAAa,CAAC,GACtC,aAAa,GAAG,aAAa,GAC7B,MAAM,SAAS,QAAQ,CAAC,aAAa,GAAG,OAAO,CAAC,GAChD,aAAa,GACb,KAAK,CAAC;AAEV,KAAK,YAAY,GAAG;IAClB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,MAAM,SAAS,YAAY,IAAI;KACrD,IAAI,IAAI,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CAClD,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
  import { log } from '@luma.gl/core';
5
- import { WgslReflect } from '../../libs/wgsl-reflect/wgsl_reflect.module.js';
5
+ import { WgslReflect } from 'wgsl_reflect';
6
6
  /**
7
7
  * Parse a ShaderLayout from WGSL shader source code.
8
8
  * @param source WGSL source code (can contain both @vertex and @fragment entry points)
@@ -20,10 +20,10 @@ export function getShaderLayoutFromWGSL(source) {
20
20
  }
21
21
  for (const uniform of parsedWGSL.uniforms) {
22
22
  const members = [];
23
- for (const member of uniform.type.members) {
23
+ for (const attribute of uniform.type?.members || []) {
24
24
  members.push({
25
- name: member.name,
26
- type: getType(member.type)
25
+ name: attribute.name,
26
+ type: getType(attribute.type)
27
27
  });
28
28
  }
29
29
  shaderLayout.bindings.push({
@@ -45,7 +45,7 @@ export function getShaderLayoutFromWGSL(source) {
45
45
  const type = getType(wgslAttribute.type);
46
46
  shaderLayout.attributes.push({
47
47
  name: wgslAttribute.name,
48
- location: wgslAttribute.location,
48
+ location: Number(wgslAttribute.location),
49
49
  type
50
50
  });
51
51
  }
@@ -1,5 +1,5 @@
1
- import { NumberArray } from "../../../types.js";
2
1
  import { ShaderModule } from "../../../lib/shader-module/shader-module.js";
2
+ import type { NumberArray3, NumberArray4 } from "../../../lib/utils/uniform-types.js";
3
3
  /**
4
4
  * Props for the picking module, which depending on mode renders picking colors or highlighted item.
5
5
  * When active, renders picking colors, assumed to be rendered to off-screen "picking" buffer.
@@ -11,9 +11,9 @@ export type PickingProps = {
11
11
  /** Set to true when picking an attribute value instead of object index */
12
12
  isAttribute?: boolean;
13
13
  /** Set to a picking color to visually highlight that item, or `null` to explicitly clear **/
14
- highlightedObjectColor?: NumberArray | null;
14
+ highlightedObjectColor?: NumberArray3 | null;
15
15
  /** Color of visual highlight of "selected" item */
16
- highlightColor?: NumberArray;
16
+ highlightColor?: NumberArray3 | NumberArray4;
17
17
  /** Color range 0-1 or 0-255 */
18
18
  useFloatColors?: boolean;
19
19
  };
@@ -35,9 +35,9 @@ export type PickingUniforms = {
35
35
  /** Do we have a highlighted item? */
36
36
  isHighlightActive?: boolean;
37
37
  /** Set to a picking color to visually highlight that item */
38
- highlightedObjectColor?: NumberArray;
38
+ highlightedObjectColor?: NumberArray3;
39
39
  /** Color of visual highlight of "selected" item */
40
- highlightColor?: NumberArray;
40
+ highlightColor?: NumberArray4;
41
41
  };
42
42
  /**
43
43
  * Provides support for color-coding-based picking and highlighting.
@@ -1 +1 @@
1
- {"version":3,"file":"picking.d.ts","sourceRoot":"","sources":["../../../../src/modules/engine/picking/picking.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,WAAW,EAA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AAI,CAAC;IAC7C,mDAAmD;IACnD,cAAc,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC;IAC7C,+BAA+B;IAC/B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0EAA0E;IAC1E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,+BAA+B;IAC/B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,6DAA6D;IAC7D,sBAAsB,CAAC,EAAE,YAAY,CAAC;IACtC,mDAAmD;IACnD,cAAc,CAAC,EAAE,YAAY,CAAC;CAC/B,CAAC;AAuIF;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,EAAE,YAAY,CAAC,YAAY,EAAE,eAAe,CAqB/D,CAAC"}
@@ -3,7 +3,7 @@
3
3
  // Copyright (c) vis.gl contributors
4
4
  import { glsl } from "../../../lib/glsl-utils/highlight.js";
5
5
  // cyan color
6
- const DEFAULT_HIGHLIGHT_COLOR = new Float32Array([0, 1, 1, 1]);
6
+ const DEFAULT_HIGHLIGHT_COLOR = [0, 1, 1, 1];
7
7
  const vs = `\
8
8
  uniform pickingUniforms {
9
9
  float isActive;
@@ -121,7 +121,7 @@ export const picking = {
121
121
  isAttribute: false,
122
122
  isHighlightActive: false,
123
123
  useFloatColors: true,
124
- highlightedObjectColor: new Float32Array([0, 0, 0]),
124
+ highlightedObjectColor: [0, 0, 0],
125
125
  highlightColor: DEFAULT_HIGHLIGHT_COLOR
126
126
  },
127
127
  getUniforms
@@ -1,23 +1,24 @@
1
- import { NumericArray as NumberArray, Matrix4, Vector3 } from '@math.gl/core';
1
+ import { Matrix4, Vector3 } from '@math.gl/core';
2
2
  import { ShaderModule } from "../../../lib/shader-module/shader-module.js";
3
+ import type { NumberArray3, NumberArray16 } from "../../../lib/utils/uniform-types.js";
3
4
  /**
4
5
  * @note Projection uniforms are normally constant across draw calls,
5
6
  * at least for each view.
6
7
  */
7
8
  export type ProjectionProps = {
8
- viewMatrix?: Readonly<Matrix4 | NumberArray>;
9
- projectionMatrix?: Readonly<Matrix4 | NumberArray>;
10
- cameraPositionWorld?: Readonly<Vector3 | NumberArray>;
9
+ viewMatrix?: Readonly<Matrix4 | NumberArray16>;
10
+ projectionMatrix?: Readonly<Matrix4 | NumberArray16>;
11
+ cameraPositionWorld?: Readonly<Vector3 | NumberArray3>;
11
12
  };
12
13
  /**
13
14
  * @note Projection uniforms are normally constant across draw calls,
14
15
  * at least for each view.
15
16
  */
16
17
  export type ProjectionUniforms = {
17
- viewMatrix?: Readonly<Matrix4 | NumberArray>;
18
- projectionMatrix?: Readonly<Matrix4 | NumberArray>;
19
- viewProjectionMatrix?: Readonly<Matrix4 | NumberArray>;
20
- cameraPositionWorld?: Readonly<Vector3 | NumberArray>;
18
+ viewMatrix?: Readonly<Matrix4 | NumberArray16>;
19
+ projectionMatrix?: Readonly<Matrix4 | NumberArray16>;
20
+ viewProjectionMatrix?: Readonly<Matrix4 | NumberArray16>;
21
+ cameraPositionWorld?: Readonly<Vector3 | NumberArray3>;
21
22
  };
22
23
  /**
23
24
  * Projects coordinates
@@ -1 +1 @@
1
- {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../../src/modules/engine/project/project.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,YAAY,IAAI,WAAW,EAAE,OAAO,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAC,YAAY,EAAC,oDAAiD;AAKtE;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,CAAC,EAAE,QAAQ,CAAC,OAAO,GAAG,WAAW,CAAC,CAAC;IAC7C,gBAAgB,CAAC,EAAE,QAAQ,CAAC,OAAO,GAAG,WAAW,CAAC,CAAC;IACnD,mBAAmB,CAAC,E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,CAAC,CAAC;IACzD,mBAAmB,CAAC,EAAE,QAAQ,CAAC,OAAO,GAAG,YAAY,CAAC,CAAC;CACxD,CAAC;AAsHF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,YAAY,CAAC,eAAe,EAAE,kBAAkB,CAYxE,CAAC"}
@@ -1,24 +1,24 @@
1
- import type { NumberArray } from '@math.gl/types';
2
1
  import { ShaderModule } from "../../../lib/shader-module/shader-module.js";
2
+ import type { NumberArray3 } from "../../../lib/utils/uniform-types.js";
3
3
  /** Lighting helper types */
4
4
  export type Light = AmbientLight | PointLight | DirectionalLight;
5
5
  export type AmbientLight = {
6
6
  type: 'ambient';
7
- color?: Readonly<NumberArray>;
7
+ color?: Readonly<NumberArray3>;
8
8
  intensity?: number;
9
9
  };
10
10
  export type PointLight = {
11
11
  type: 'point';
12
- position: Readonly<NumberArray>;
13
- color?: Readonly<NumberArray>;
12
+ position: Readonly<NumberArray3>;
13
+ color?: Readonly<NumberArray3>;
14
14
  intensity?: number;
15
15
  attenuation?: number;
16
16
  };
17
17
  export type DirectionalLight = {
18
18
  type: 'directional';
19
- position: Readonly<NumberArray>;
20
- direction: Readonly<NumberArray>;
21
- color?: Readonly<NumberArray>;
19
+ position: Readonly<NumberArray3>;
20
+ direction: Readonly<NumberArray3>;
21
+ color?: Readonly<NumberArray3>;
22
22
  intensity?: number;
23
23
  };
24
24
  export type LightingProps = {
@@ -33,14 +33,14 @@ export type LightingProps = {
33
33
  };
34
34
  export type LightingUniforms = {
35
35
  enabled: number;
36
- ambientLightColor: Readonly<NumberArray>;
36
+ ambientLightColor: Readonly<NumberArray3>;
37
37
  numberOfLights: number;
38
38
  lightType: number;
39
- lightColor: Readonly<NumberArray>;
40
- lightPosition: Readonly<NumberArray>;
41
- lightDirection: Readonly<NumberArray>;
42
- lightAttenuation: Readonly<NumberArray>;
39
+ lightColor: Readonly<NumberArray3>;
40
+ lightPosition: Readonly<NumberArray3>;
41
+ lightDirection: Readonly<NumberArray3>;
42
+ lightAttenuation: Readonly<NumberArray3>;
43
43
  };
44
44
  /** UBO ready lighting module */
45
- export declare const lighting: ShaderModule<LightingProps, LightingUniforms>;
45
+ export declare const lighting: ShaderModule<LightingProps, LightingUniforms, {}>;
46
46
  //# sourceMappingURL=lighting-uniforms.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lighting-uniforms.d.ts","sourceRoot":"","sources":["../../../../src/modules/lighting/lights/lighting-uniforms.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAC,YAAY,EAAC,oDAAiD;AAetE,4BAA4B;AAE5B,MAAM,MAAM,KAAK,GAAG,YAAY,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAEjE,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,aAAa,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IAChC,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,M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type { NumberArray } from '@math.gl/types';
1
+ import type { Vector3 } from '@math.gl/core';
2
2
  import { ShaderModule } from "../../../lib/shader-module/shader-module.js";
3
3
  export type DirlightProps = {
4
- lightDirection?: NumberArray | [number, number, number];
4
+ lightDirection?: Vector3 | [number, number, number];
5
5
  };
6
6
  export type DirlightUniforms = DirlightProps;
7
7
  export declare const VS_WGSL = " \nvoid dirlight_setNormal(normal: vec3<f32>) {\n dirlight_vNormal = normalize(normal);\n}\n";
@@ -1 +1 @@
1
- {"version":3,"file":"dirlight.d.ts","sourceRoot":"","sources":["../../../../src/modules/lighting/no-material/dirlight.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAC,YAAY,EAAC,oDAAiD;AAEtE,MAAM,MAAM,aAAa,GAAG;IAC1B,cAAc,CAAC,EAAE,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CACzD,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAG7C,eAAO,MAAM,OAAO,mGAInB,CAAC;AAGF,eAAO,MAAM,OAAO,4UAUnB,CAAC;AAwBF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,YAAY,CAAC,aAAa,EAAE,gBAAgB,CAkBlE,CAAC"}
1
+ {"version":3,"file":"dirlight.d.ts","sourceRoot":"","sources":["../../../../src/modules/lighting/no-material/dirlight.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAC,YAAY,EAAC,oDAAiD;AAEtE,MAAM,MAAM,aAAa,GAAG;IAC1B,cAAc,CAAC,EAAE,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAG7C,eAAO,MAAM,OAAO,mGAInB,CAAC;AAGF,eAAO,MAAM,OAAO,4UAUnB,CAAC;AAwBF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,YAAY,CAAC,aAAa,EAAE,gBAAgB,CAkBlE,CAAC"}
@@ -54,7 +54,7 @@ export const dirlight = {
54
54
  lightDirection: 'vec3<f32>'
55
55
  },
56
56
  defaultUniforms: {
57
- lightDirection: new Float32Array([1, 1, 2])
57
+ lightDirection: [1, 1, 2]
58
58
  },
59
59
  getUniforms
60
60
  };
@@ -1,24 +1,25 @@
1
- import type { NumberArray, Texture } from '@luma.gl/core';
1
+ import type { Texture } from '@luma.gl/core';
2
2
  import type { Vector2, Vector3, Vector4 } from '@math.gl/core';
3
+ import type { NumberArray2, NumberArray3, NumberArray4 } from "../../../lib/utils/uniform-types.js";
3
4
  import { ShaderModule } from "../../../lib/shader-module/shader-module.js";
4
5
  export type PBRMaterialProps = PBRMaterialBindings & {
5
6
  unlit: boolean;
6
7
  baseColorMapEnabled: boolean;
7
- baseColorFactor: Readonly<Vector4 | NumberArray>;
8
+ baseColorFactor: Readonly<Vector4 | NumberArray4>;
8
9
  normalMapEnabled: boolean;
9
10
  normalScale: number;
10
11
  emissiveMapEnabled: boolean;
11
- emissiveFactor: Readonly<Vector3 | NumberArray>;
12
- metallicRoughnessValues: Readonly<Vector2 | NumberArray>;
12
+ emissiveFactor: Readonly<Vector3 | NumberArray3>;
13
+ metallicRoughnessValues: Readonly<Vector2 | NumberArray2>;
13
14
  metallicRoughnessMapEnabled: boolean;
14
15
  occlusionMapEnabled: boolean;
15
16
  occlusionStrength: number;
16
17
  alphaCutoffEnabled: boolean;
17
18
  alphaCutoff: number;
18
19
  IBLenabled: boolean;
19
- scaleIBLAmbient: Readonly<Vector2 | NumberArray>;
20
- scaleDiffBaseMR: Readonly<Vector4 | NumberArray>;
21
- scaleFGDSpec: Readonly<Vector4 | NumberArray>;
20
+ scaleIBLAmbient: Readonly<Vector2 | NumberArray2>;
21
+ scaleDiffBaseMR: Readonly<Vector4 | NumberArray4>;
22
+ scaleFGDSpec: Readonly<Vector4 | NumberArray4>;
22
23
  };
23
24
  /** Non-uniform block bindings for pbr module */
24
25
  type PBRMaterialBindings = {
@@ -34,21 +35,21 @@ type PBRMaterialBindings = {
34
35
  export type PBRMaterialUniforms = {
35
36
  unlit: boolean;
36
37
  baseColorMapEnabled: boolean;
37
- baseColorFactor: Readonly<Vector4 | NumberArray>;
38
+ baseColorFactor: Readonly<Vector4 | NumberArray4>;
38
39
  normalMapEnabled: boolean;
39
40
  normalScale: number;
40
41
  emissiveMapEnabled: boolean;
41
- emissiveFactor: Readonly<Vector3 | NumberArray>;
42
- metallicRoughnessValues: Readonly<Vector2 | NumberArray>;
42
+ emissiveFactor: Readonly<Vector3 | NumberArray3>;
43
+ metallicRoughnessValues: Readonly<Vector2 | NumberArray2>;
43
44
  metallicRoughnessMapEnabled: boolean;
44
45
  occlusionMapEnabled: boolean;
45
46
  occlusionStrength: number;
46
47
  alphaCutoffEnabled: boolean;
47
48
  alphaCutoff: number;
48
49
  IBLenabled: boolean;
49
- scaleIBLAmbient: Readonly<Vector2 | NumberArray>;
50
- scaleDiffBaseMR: Readonly<Vector4 | NumberArray>;
51
- scaleFGDSpec: Readonly<Vector4 | NumberArray>;
50
+ scaleIBLAmbient: Readonly<Vector2 | NumberArray2>;
51
+ scaleDiffBaseMR: Readonly<Vector4 | NumberArray4>;
52
+ scaleFGDSpec: Readonly<Vector4 | NumberArray4>;
52
53
  };
53
54
  /**
54
55
  * An implementation of PBR (Physically-Based Rendering).
@@ -1 +1 @@
1
- {"version":3,"file":"pbr-material.d.ts","sourceRoot":"","sources":["../../../../src/modules/lighting/pbr-material/pbr-material.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,WAAW,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAE7D,OAAO,EAAC,YAAY,EAAC,oDA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M,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,OAAO,CAAC;IAGf,mBAAmB,EAAE,OAAO,CAAC;IAC7B,eAAe,EAAE,QAAQ,CAAC,OAAO,GAAG,YAAY,CAAC,CAAC;IAElD,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IAEpB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,cAAc,EAAE,QAAQ,CAAC,OAAO,GAAG,YAAY,CAAC,CAAC;IAEjD,uBAAuB,EAAE,QAAQ,CAAC,OAAO,GAAG,YAAY,CAAC,CAAC;IAC1D,2BAA2B,EAAE,OAAO,CAAC;IAErC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAE1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IAGpB,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,QAAQ,CAAC,OAAO,GAAG,YAAY,CAAC,CAAC;IAIlD,eAAe,EAAE,QAAQ,CAAC,OAAO,GAAG,YAAY,CAAC,CAAC;IAClD,YAAY,EAAE,QAAQ,CAAC,OAAO,GAAG,YAAY,CAAC,CAAC;CAChD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,gBAAgB,EAAE,mBAAmB,CAgD3E,CAAC"}
@@ -47,16 +47,5 @@ export const pbrMaterial = {
47
47
  scaleDiffBaseMR: 'vec4<f32>',
48
48
  scaleFGDSpec: 'vec4<f32>'
49
49
  },
50
- bindings: {
51
- baseColorSampler: { type: 'texture', location: 8 }, // #ifdef HAS_BASECOLORMAP
52
- normalSampler: { type: 'texture', location: 9 }, // #ifdef HAS_NORMALMAP
53
- emissiveSampler: { type: 'texture', location: 10 }, // #ifdef HAS_EMISSIVEMAP
54
- metallicRoughnessSampler: { type: 'texture', location: 11 }, // #ifdef HAS_METALROUGHNESSMAP
55
- occlusionSampler: { type: 'texture', location: 12 }, // #ifdef HAS_OCCLUSIONMAP
56
- // IBL Samplers
57
- diffuseEnvSampler: { type: 'texture', location: 13 }, // #ifdef USE_IBL (samplerCube)
58
- specularEnvSampler: { type: 'texture', location: 14 }, // #ifdef USE_IBL (samplerCube)
59
- brdfLUT: { type: 'texture', location: 15 } // #ifdef USE_IBL
60
- },
61
50
  dependencies: [lighting]
62
51
  };
@@ -5,9 +5,9 @@ import { ShaderPass } from "../../../lib/shader-module/shader-pass.js";
5
5
  */
6
6
  export type TiltShiftProps = {
7
7
  /** The x,y coordinate of the start of the line segment. */
8
- start?: number[];
8
+ start?: [number, number];
9
9
  /** The xm y coordinate of the end of the line segment. */
10
- end?: number[];
10
+ end?: [number, number];
11
11
  /** The maximum radius of the pyramid blur. */
12
12
  blurRadius?: number;
13
13
  /** The distance from the line at which the maximum blur radius is reached. */
@@ -1 +1 @@
1
- {"version":3,"file":"tiltshift.d.ts","sourceRoot":"","sources":["../../../../src/modules/postprocessing/image-blur-filters/tiltshift.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,UAAU,EAAC,kDAA+C;AAiDlE;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,0DAA0D;IAC1D,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,EAAE,UAAU,CAAC,cAAc,EAAE,cAAc,CAsBhE,CAAC"}
1
+ {"version":3,"file":"tiltshift.d.ts","sourceRoot":"","sources":["../../../../src/modules/postprocessing/image-blur-filters/tiltshift.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,UAAU,EAAC,kDAA+C;AAiDlE;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,0DAA0D;IAC1D,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,EAAE,UAAU,CAAC,cAAc,EAAE,cAAc,CAsBhE,CAAC"}
@@ -9,7 +9,7 @@ export type TriangleBlurProps = {
9
9
  /** The radius of the pyramid convolved with the image. */
10
10
  radius?: number;
11
11
  /** @deprecated internal property */
12
- delta?: number[];
12
+ delta?: [number, number];
13
13
  };
14
14
  /**
15
15
  * @filter Triangle Blur
@@ -1 +1 @@
1
- {"version":3,"file":"triangleblur.d.ts","sourceRoot":"","sources":["../../../../src/modules/postprocessing/image-blur-filters/triangleblur.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAC,kDAA+C;AAwClE;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,UAAU,CAAC,iBAAiB,EAAE,iBAAiB,CAgBzE,CAAC"}
1
+ {"version":3,"file":"triangleblur.d.ts","sourceRoot":"","sources":["../../../../src/modules/postprocessing/image-blur-filters/triangleblur.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAC,kDAA+C;AAwClE;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,UAAU,CAAC,iBAAiB,EAAE,iBAAiB,CAgBzE,CAAC"}
@@ -4,7 +4,7 @@ import { ShaderPass } from "../../../lib/shader-module/shader-pass.js";
4
4
  */
5
5
  export type ZoomBlurProps = {
6
6
  /** - The x, y coordinate of the blur origin. */
7
- center?: number[];
7
+ center?: [number, number];
8
8
  /** - The strength of the blur. Values in the range 0 to 1 are usually sufficient, where 0 doesn't change the image and 1 creates a highly blurred image. */
9
9
  strength?: number;
10
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"zoomblur.d.ts","sourceRoot":"","sources":["../../../../src/modules/postprocessing/image-blur-filters/zoomblur.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAC,kDAA+C;AAsClE;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,4JAA4J;IAC5J,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,UAAU,CAAC,aAAa,EAAE,aAAa,CAa7D,CAAC"}
1
+ {"version":3,"file":"zoomblur.d.ts","sourceRoot":"","sources":["../../../../src/modules/postprocessing/image-blur-filters/zoomblur.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAC,kDAA+C;AAsClE;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,gDAAgD;IAChD,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,4JAA4J;IAC5J,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,UAAU,CAAC,aAAa,EAAE,aAAa,CAa7D,CAAC"}
@@ -7,7 +7,7 @@ import { ShaderPass } from "../../../lib/shader-module/shader-pass.js";
7
7
  */
8
8
  export type ColorHalftoneProps = {
9
9
  /** The x,y coordinate of the pattern origin. */
10
- center?: number[];
10
+ center?: [number, number];
11
11
  /** The rotation of the pattern in radians. */
12
12
  angle?: number;
13
13
  /** The diameter of a dot in pixels. */
@@ -1 +1 @@
1
- {"version":3,"file":"colorhalftone.d.ts","sourceRoot":"","sources":["../../../../src/modules/postprocessing/image-fun-filters/colorhalftone.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAC,kDAA+C;AAyClE;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,UAAU,CAAC,kBAAkB,EAAE,kBAAkB,CAc5E,CAAC"}
1
+ {"version":3,"file":"colorhalftone.d.ts","sourceRoot":"","sources":["../../../../src/modules/postprocessing/image-fun-filters/colorhalftone.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAC,kDAA+C;AAyClE;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gDAAgD;IAChD,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,UAAU,CAAC,kBAAkB,EAAE,kBAAkB,CAc5E,CAAC"}
@@ -6,7 +6,7 @@ import { ShaderPass } from "../../../lib/shader-module/shader-pass.js";
6
6
  */
7
7
  export type DotScreenProps = {
8
8
  /** The x, y coordinate of the pattern origin. */
9
- center?: number[];
9
+ center?: [number, number];
10
10
  /** The rotation of the pattern in radians. */
11
11
  angle?: number;
12
12
  /** The diameter of a dot in pixels. */
@@ -1 +1 @@
1
- {"version":3,"file":"dotscreen.d.ts","sourceRoot":"","sources":["../../../../src/modules/postprocessing/image-fun-filters/dotscreen.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAC,kDAA+C;AA4BlE;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,UAAU,CAAC,cAAc,EAAE,cAAc,CAchE,CAAC"}
1
+ {"version":3,"file":"dotscreen.d.ts","sourceRoot":"","sources":["../../../../src/modules/postprocessing/image-fun-filters/dotscreen.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAC,kDAA+C;AA4BlE;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,iDAAiD;IACjD,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,UAAU,CAAC,cAAc,EAAE,cAAc,CAchE,CAAC"}
@@ -6,7 +6,7 @@ import { ShaderPass } from "../../../lib/shader-module/shader-pass.js";
6
6
  */
7
7
  export type HexagonalPixelateProps = {
8
8
  /** The [x, y] coordinates of the pattern center. */
9
- center?: number[];
9
+ center?: [number, number];
10
10
  /** The width of an individual tile, in pixels. */
11
11
  scale?: number;
12
12
  };
@@ -1 +1 @@
1
- {"version":3,"file":"hexagonalpixelate.d.ts","sourceRoot":"","sources":["../../../../src/modules/postprocessing/image-fun-filters/hexagonalpixelate.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAC,kDAA+C;AAgDlE;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,UAAU,CAAC,sBAAsB,EAAE,sBAAsB,CAYxF,CAAC"}
1
+ {"version":3,"file":"hexagonalpixelate.d.ts","sourceRoot":"","sources":["../../../../src/modules/postprocessing/image-fun-filters/hexagonalpixelate.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAC,kDAA+C;AAgDlE;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,oDAAoD;IACpD,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,UAAU,CAAC,sBAAsB,EAAE,sBAAsB,CAYxF,CAAC"}
@@ -4,7 +4,7 @@ import { ShaderPass } from "../../../lib/shader-module/shader-pass.js";
4
4
  */
5
5
  export type MagnifyProps = {
6
6
  /** x, y position in screen coords, both x and y is normalized and in range `[0, 1]`. `[0, 0]` is the up left corner, `[1, 1]` is the bottom right corner. Default value is `[0, 0]`. */
7
- screenXY?: number[];
7
+ screenXY?: [number, number];
8
8
  /** effect radius in pixels. Default value is `100`. */
9
9
  radiusPixels?: number;
10
10
  /** magnify level. Default value is `2`. */
@@ -12,7 +12,7 @@ export type MagnifyProps = {
12
12
  /** border width of the effect circle, will not show border if value <= 0.0. Default value is `0`. */
13
13
  borderWidthPixels?: number;
14
14
  /** border color of the effect circle. Default value is `[255, 255, 255, 255]`. */
15
- borderColor?: number[];
15
+ borderColor?: [number, number, number, number];
16
16
  };
17
17
  /**
18
18
  * Magnify - display a circle with magnify effect applied to surrounding the pixels given position
@@ -1 +1 @@
1
- {"version":3,"file":"magnify.d.ts","sourceRoot":"","sources":["../../../../src/modules/postprocessing/image-fun-filters/magnify.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAC,kDAA+C;AA0BlE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,wLAAwL;IACxL,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,uDAAuD;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qGAAqG;IACrG,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,UAAU,CAAC,YAAY,EAAE,YAAY,CAmB1D,CAAC"}
1
+ {"version":3,"file":"magnify.d.ts","sourceRoot":"","sources":["../../../../src/modules/postprocessing/image-fun-filters/magnify.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAC,kDAA+C;AA0BlE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,wLAAwL;IACxL,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,uDAAuD;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qGAAqG;IACrG,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kFAAkF;IAClF,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CAChD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,UAAU,CAAC,YAAY,EAAE,YAAY,CAmB1D,CAAC"}