@luma.gl/engine 9.0.0-alpha.16 → 9.0.0-alpha.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 (183) hide show
  1. package/dist/animation/key-frames.d.ts +1 -1
  2. package/dist/animation/key-frames.d.ts.map +1 -1
  3. package/dist/animation/key-frames.js +55 -54
  4. package/dist/animation/key-frames.js.map +1 -0
  5. package/dist/animation/timeline.d.ts +4 -4
  6. package/dist/animation/timeline.d.ts.map +1 -1
  7. package/dist/animation/timeline.js +101 -94
  8. package/dist/animation/timeline.js.map +1 -0
  9. package/dist/animation-loop/animation-loop.d.ts +4 -2
  10. package/dist/animation-loop/animation-loop.d.ts.map +1 -1
  11. package/dist/animation-loop/animation-loop.js +358 -414
  12. package/dist/animation-loop/animation-loop.js.map +1 -0
  13. package/dist/animation-loop/animation-props.d.ts +3 -1
  14. package/dist/animation-loop/animation-props.d.ts.map +1 -1
  15. package/dist/animation-loop/animation-props.js +1 -0
  16. package/dist/animation-loop/animation-props.js.map +1 -0
  17. package/dist/animation-loop/make-animation-loop.d.ts +1 -1
  18. package/dist/animation-loop/make-animation-loop.d.ts.map +1 -1
  19. package/dist/animation-loop/make-animation-loop.js +25 -26
  20. package/dist/animation-loop/make-animation-loop.js.map +1 -0
  21. package/dist/animation-loop/render-loop.js +5 -17
  22. package/dist/animation-loop/render-loop.js.map +1 -0
  23. package/dist/dist.dev.js +5240 -0
  24. package/dist/geometries/cone-geometry.d.ts +1 -1
  25. package/dist/geometries/cone-geometry.d.ts.map +1 -1
  26. package/dist/geometries/cone-geometry.js +18 -12
  27. package/dist/geometries/cone-geometry.js.map +1 -0
  28. package/dist/geometries/cube-geometry.d.ts +1 -1
  29. package/dist/geometries/cube-geometry.d.ts.map +1 -1
  30. package/dist/geometries/cube-geometry.js +60 -187
  31. package/dist/geometries/cube-geometry.js.map +1 -0
  32. package/dist/geometries/cylinder-geometry.d.ts +1 -1
  33. package/dist/geometries/cylinder-geometry.d.ts.map +1 -1
  34. package/dist/geometries/cylinder-geometry.js +15 -10
  35. package/dist/geometries/cylinder-geometry.js.map +1 -0
  36. package/dist/geometries/ico-sphere-geometry.d.ts +1 -1
  37. package/dist/geometries/ico-sphere-geometry.d.ts.map +1 -1
  38. package/dist/geometries/ico-sphere-geometry.js +160 -141
  39. package/dist/geometries/ico-sphere-geometry.js.map +1 -0
  40. package/dist/geometries/plane-geometry.d.ts +1 -1
  41. package/dist/geometries/plane-geometry.d.ts.map +1 -1
  42. package/dist/geometries/plane-geometry.js +111 -93
  43. package/dist/geometries/plane-geometry.js.map +1 -0
  44. package/dist/geometries/sphere-geometry.d.ts +1 -1
  45. package/dist/geometries/sphere-geometry.d.ts.map +1 -1
  46. package/dist/geometries/sphere-geometry.js +95 -76
  47. package/dist/geometries/sphere-geometry.js.map +1 -0
  48. package/dist/geometries/truncated-cone-geometry.d.ts +1 -1
  49. package/dist/geometries/truncated-cone-geometry.d.ts.map +1 -1
  50. package/dist/geometries/truncated-cone-geometry.js +126 -105
  51. package/dist/geometries/truncated-cone-geometry.js.map +1 -0
  52. package/dist/geometry/geometry-table.d.ts +1 -1
  53. package/dist/geometry/geometry-table.d.ts.map +1 -1
  54. package/dist/geometry/geometry-table.js +1 -0
  55. package/dist/geometry/geometry-table.js.map +1 -0
  56. package/dist/geometry/geometry-utils.js +32 -22
  57. package/dist/geometry/geometry-utils.js.map +1 -0
  58. package/dist/geometry/geometry.d.ts +4 -4
  59. package/dist/geometry/geometry.d.ts.map +1 -1
  60. package/dist/geometry/geometry.js +109 -96
  61. package/dist/geometry/geometry.js.map +1 -0
  62. package/dist/geometry/primitive-utils.js +1 -30
  63. package/dist/geometry/primitive-utils.js.map +1 -0
  64. package/dist/index.cjs +2222 -0
  65. package/dist/index.js +16 -20
  66. package/dist/index.js.map +1 -0
  67. package/dist/lib/clip-space.js +1 -50
  68. package/dist/lib/clip-space.js.map +1 -0
  69. package/dist/lib/model-utils.js +28 -101
  70. package/dist/lib/model-utils.js.map +1 -0
  71. package/dist/lib/model.d.ts +1 -1
  72. package/dist/lib/model.d.ts.map +1 -1
  73. package/dist/lib/model.js +129 -121
  74. package/dist/lib/model.js.map +1 -0
  75. package/dist/lib/pipeline-factory.d.ts +3 -3
  76. package/dist/lib/pipeline-factory.d.ts.map +1 -1
  77. package/dist/lib/pipeline-factory.js +165 -136
  78. package/dist/lib/pipeline-factory.js.map +1 -0
  79. package/dist.min.js +245 -0
  80. package/package.json +22 -13
  81. package/src/.DS_Store +0 -0
  82. package/src/animation/timeline.ts +1 -1
  83. package/src/animation-loop/animation-loop.ts +5 -5
  84. package/src/animation-loop/make-animation-loop.ts +2 -1
  85. package/src/geometry/geometry.ts +2 -2
  86. package/src/lib/pipeline-factory.ts +1 -1
  87. package/dist/bundle.d.ts +0 -2
  88. package/dist/bundle.d.ts.map +0 -1
  89. package/dist/bundle.js +0 -5
  90. package/dist/dist.min.js +0 -31
  91. package/dist/es5/animation/key-frames.js +0 -84
  92. package/dist/es5/animation/key-frames.js.map +0 -1
  93. package/dist/es5/animation/timeline.js +0 -183
  94. package/dist/es5/animation/timeline.js.map +0 -1
  95. package/dist/es5/animation-loop/animation-loop.js +0 -534
  96. package/dist/es5/animation-loop/animation-loop.js.map +0 -1
  97. package/dist/es5/animation-loop/animation-props.js +0 -2
  98. package/dist/es5/animation-loop/animation-props.js.map +0 -1
  99. package/dist/es5/animation-loop/make-animation-loop.js +0 -53
  100. package/dist/es5/animation-loop/make-animation-loop.js.map +0 -1
  101. package/dist/es5/animation-loop/render-loop.js +0 -39
  102. package/dist/es5/animation-loop/render-loop.js.map +0 -1
  103. package/dist/es5/bundle.js +0 -6
  104. package/dist/es5/bundle.js.map +0 -1
  105. package/dist/es5/geometries/cone-geometry.js +0 -43
  106. package/dist/es5/geometries/cone-geometry.js.map +0 -1
  107. package/dist/es5/geometries/cube-geometry.js +0 -84
  108. package/dist/es5/geometries/cube-geometry.js.map +0 -1
  109. package/dist/es5/geometries/cylinder-geometry.js +0 -39
  110. package/dist/es5/geometries/cylinder-geometry.js.map +0 -1
  111. package/dist/es5/geometries/ico-sphere-geometry.js +0 -185
  112. package/dist/es5/geometries/ico-sphere-geometry.js.map +0 -1
  113. package/dist/es5/geometries/plane-geometry.js +0 -137
  114. package/dist/es5/geometries/plane-geometry.js.map +0 -1
  115. package/dist/es5/geometries/sphere-geometry.js +0 -120
  116. package/dist/es5/geometries/sphere-geometry.js.map +0 -1
  117. package/dist/es5/geometries/truncated-cone-geometry.js +0 -160
  118. package/dist/es5/geometries/truncated-cone-geometry.js.map +0 -1
  119. package/dist/es5/geometry/geometry-table.js +0 -2
  120. package/dist/es5/geometry/geometry-table.js.map +0 -1
  121. package/dist/es5/geometry/geometry-utils.js +0 -39
  122. package/dist/es5/geometry/geometry-utils.js.map +0 -1
  123. package/dist/es5/geometry/geometry.js +0 -150
  124. package/dist/es5/geometry/geometry.js.map +0 -1
  125. package/dist/es5/geometry/primitive-utils.js +0 -2
  126. package/dist/es5/geometry/primitive-utils.js.map +0 -1
  127. package/dist/es5/index.js +0 -112
  128. package/dist/es5/index.js.map +0 -1
  129. package/dist/es5/lib/clip-space.js +0 -2
  130. package/dist/es5/lib/clip-space.js.map +0 -1
  131. package/dist/es5/lib/model-utils.js +0 -52
  132. package/dist/es5/lib/model-utils.js.map +0 -1
  133. package/dist/es5/lib/model.js +0 -173
  134. package/dist/es5/lib/model.js.map +0 -1
  135. package/dist/es5/lib/pipeline-factory.js +0 -244
  136. package/dist/es5/lib/pipeline-factory.js.map +0 -1
  137. package/dist/esm/animation/key-frames.js +0 -57
  138. package/dist/esm/animation/key-frames.js.map +0 -1
  139. package/dist/esm/animation/timeline.js +0 -113
  140. package/dist/esm/animation/timeline.js.map +0 -1
  141. package/dist/esm/animation-loop/animation-loop.js +0 -367
  142. package/dist/esm/animation-loop/animation-loop.js.map +0 -1
  143. package/dist/esm/animation-loop/animation-props.js +0 -2
  144. package/dist/esm/animation-loop/animation-props.js.map +0 -1
  145. package/dist/esm/animation-loop/make-animation-loop.js +0 -28
  146. package/dist/esm/animation-loop/make-animation-loop.js.map +0 -1
  147. package/dist/esm/animation-loop/render-loop.js +0 -7
  148. package/dist/esm/animation-loop/render-loop.js.map +0 -1
  149. package/dist/esm/bundle.js +0 -4
  150. package/dist/esm/bundle.js.map +0 -1
  151. package/dist/esm/geometries/cone-geometry.js +0 -21
  152. package/dist/esm/geometries/cone-geometry.js.map +0 -1
  153. package/dist/esm/geometries/cube-geometry.js +0 -67
  154. package/dist/esm/geometries/cube-geometry.js.map +0 -1
  155. package/dist/esm/geometries/cylinder-geometry.js +0 -18
  156. package/dist/esm/geometries/cylinder-geometry.js.map +0 -1
  157. package/dist/esm/geometries/ico-sphere-geometry.js +0 -170
  158. package/dist/esm/geometries/ico-sphere-geometry.js.map +0 -1
  159. package/dist/esm/geometries/plane-geometry.js +0 -119
  160. package/dist/esm/geometries/plane-geometry.js.map +0 -1
  161. package/dist/esm/geometries/sphere-geometry.js +0 -102
  162. package/dist/esm/geometries/sphere-geometry.js.map +0 -1
  163. package/dist/esm/geometries/truncated-cone-geometry.js +0 -136
  164. package/dist/esm/geometries/truncated-cone-geometry.js.map +0 -1
  165. package/dist/esm/geometry/geometry-table.js +0 -2
  166. package/dist/esm/geometry/geometry-table.js.map +0 -1
  167. package/dist/esm/geometry/geometry-utils.js +0 -37
  168. package/dist/esm/geometry/geometry-utils.js.map +0 -1
  169. package/dist/esm/geometry/geometry.js +0 -119
  170. package/dist/esm/geometry/geometry.js.map +0 -1
  171. package/dist/esm/geometry/primitive-utils.js +0 -2
  172. package/dist/esm/geometry/primitive-utils.js.map +0 -1
  173. package/dist/esm/index.js +0 -16
  174. package/dist/esm/index.js.map +0 -1
  175. package/dist/esm/lib/clip-space.js +0 -2
  176. package/dist/esm/lib/clip-space.js.map +0 -1
  177. package/dist/esm/lib/model-utils.js +0 -40
  178. package/dist/esm/lib/model-utils.js.map +0 -1
  179. package/dist/esm/lib/model.js +0 -146
  180. package/dist/esm/lib/model.js.map +0 -1
  181. package/dist/esm/lib/pipeline-factory.js +0 -180
  182. package/dist/esm/lib/pipeline-factory.js.map +0 -1
  183. package/src/bundle.ts +0 -4
package/dist/index.js CHANGED
@@ -1,20 +1,16 @@
1
- // luma.gl Engine API
2
- // Animation
3
- export { Timeline } from './animation/timeline.js';
4
- export { KeyFrames } from './animation/key-frames.js';
5
- export { AnimationLoopTemplate } from './animation-loop/render-loop.js';
6
- export { AnimationLoop } from './animation-loop/animation-loop.js';
7
- export { makeAnimationLoop } from './animation-loop/make-animation-loop.js';
8
- export { Model } from './lib/model.js';
9
- export { PipelineFactory } from './lib/pipeline-factory.js';
10
- // Utils
11
- // export {default as ClipSpace} from './lib/clip-space.js';
12
- // Geometries
13
- export { default as Geometry } from './geometry/geometry.js';
14
- export { ConeGeometry } from './geometries/cone-geometry.js';
15
- export { CubeGeometry } from './geometries/cube-geometry.js';
16
- export { CylinderGeometry } from './geometries/cylinder-geometry.js';
17
- export { IcoSphereGeometry } from './geometries/ico-sphere-geometry.js';
18
- export { PlaneGeometry } from './geometries/plane-geometry.js';
19
- export { SphereGeometry } from './geometries/sphere-geometry.js';
20
- export { TruncatedConeGeometry } from './geometries/truncated-cone-geometry.js';
1
+ export { Timeline } from "./animation/timeline.js";
2
+ export { KeyFrames } from "./animation/key-frames.js";
3
+ export { AnimationLoopTemplate } from "./animation-loop/render-loop.js";
4
+ export { AnimationLoop } from "./animation-loop/animation-loop.js";
5
+ export { makeAnimationLoop } from "./animation-loop/make-animation-loop.js";
6
+ export { Model } from "./lib/model.js";
7
+ export { PipelineFactory } from "./lib/pipeline-factory.js";
8
+ export { default as Geometry } from "./geometry/geometry.js";
9
+ export { ConeGeometry } from "./geometries/cone-geometry.js";
10
+ export { CubeGeometry } from "./geometries/cube-geometry.js";
11
+ export { CylinderGeometry } from "./geometries/cylinder-geometry.js";
12
+ export { IcoSphereGeometry } from "./geometries/ico-sphere-geometry.js";
13
+ export { PlaneGeometry } from "./geometries/plane-geometry.js";
14
+ export { SphereGeometry } from "./geometries/sphere-geometry.js";
15
+ export { TruncatedConeGeometry } from "./geometries/truncated-cone-geometry.js";
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["Timeline","KeyFrames","AnimationLoopTemplate","AnimationLoop","makeAnimationLoop","Model","PipelineFactory","default","Geometry","ConeGeometry","CubeGeometry","CylinderGeometry","IcoSphereGeometry","PlaneGeometry","SphereGeometry","TruncatedConeGeometry"],"sources":["../src/index.ts"],"sourcesContent":["// luma.gl Engine API\n\n// Animation\nexport {Timeline} from './animation/timeline';\nexport {KeyFrames} from './animation/key-frames';\nexport type {AnimationProps} from './animation-loop/animation-props';\n\nexport {AnimationLoopTemplate} from './animation-loop/render-loop';\n\nexport type {AnimationLoopProps} from './animation-loop/animation-loop';\nexport {AnimationLoop} from './animation-loop/animation-loop';\n\nexport type {MakeAnimationLoopProps} from './animation-loop/make-animation-loop';\nexport {makeAnimationLoop} from './animation-loop/make-animation-loop';\n\nexport type {ModelProps} from './lib/model';\nexport {Model} from './lib/model';\n\nexport {PipelineFactory} from './lib/pipeline-factory';\n\n// Utils\n// export {default as ClipSpace} from './lib/clip-space';\n\n// Geometries\nexport {default as Geometry} from './geometry/geometry';\n\n// Primitives\nexport type {ConeGeometryProps} from './geometries/cone-geometry';\nexport {ConeGeometry} from './geometries/cone-geometry';\nexport type {CubeGeometryProps} from './geometries/cube-geometry';\nexport {CubeGeometry} from './geometries/cube-geometry';\nexport type {CylinderGeometryProps} from './geometries/cylinder-geometry';\nexport {CylinderGeometry} from './geometries/cylinder-geometry';\nexport type {IcoSphereGeometryProps} from './geometries/ico-sphere-geometry';\nexport {IcoSphereGeometry} from './geometries/ico-sphere-geometry';\nexport type {PlaneGeometryProps} from './geometries/plane-geometry';\nexport {PlaneGeometry} from './geometries/plane-geometry';\nexport type {SphereGeometryProps} from './geometries/sphere-geometry';\nexport {SphereGeometry} from './geometries/sphere-geometry';\nexport type {TruncatedConeGeometryProps} from './geometries/truncated-cone-geometry';\nexport {TruncatedConeGeometry} from './geometries/truncated-cone-geometry';\n\n"],"mappings":"SAGQA,QAAQ;AAAA,SACRC,SAAS;AAAA,SAGTC,qBAAqB;AAAA,SAGrBC,aAAa;AAAA,SAGbC,iBAAiB;AAAA,SAGjBC,KAAK;AAAA,SAELC,eAAe;AAAA,SAMfC,OAAO,IAAIC,QAAQ;AAAA,SAInBC,YAAY;AAAA,SAEZC,YAAY;AAAA,SAEZC,gBAAgB;AAAA,SAEhBC,iBAAiB;AAAA,SAEjBC,aAAa;AAAA,SAEbC,cAAc;AAAA,SAEdC,qBAAqB"}
@@ -1,51 +1,2 @@
1
- "use strict";
2
- // ClipSpace
3
- /*
4
- import GL from '@luma.gl/constants';
5
- import Model, {ModelProps} from './model.js';
6
- import Geometry from '../geometry/geometry.js';
7
1
 
8
- const CLIPSPACE_VERTEX_SHADER = glsl`\
9
- attribute vec2 aClipSpacePosition;
10
- attribute vec2 aTexCoord;
11
- attribute vec2 aCoordinate;
12
-
13
- varying vec2 position;
14
- varying vec2 coordinate;
15
- varying vec2 uv;
16
-
17
- void main(void) {
18
- gl_Position = vec4(aClipSpacePosition, 0., 1.);
19
- position = aClipSpacePosition;
20
- coordinate = aCoordinate;
21
- uv = aTexCoord;
22
- }
23
- `;
24
-
25
- /* eslint-disable indent, no-multi-spaces *
26
- const POSITIONS = [-1, -1, 1, -1, -1, 1, 1, 1];
27
-
28
-
29
- export default class ClipSpace extends Model {
30
- constructor(gl: WebGLRenderingContext, opts?: ModelProps) {
31
- const TEX_COORDS = POSITIONS.map((coord) => (coord === -1 ? 0 : coord));
32
-
33
- super(
34
- gl,
35
- Object.assign({}, opts, {
36
- vs: CLIPSPACE_VERTEX_SHADER,
37
- geometry: new Geometry({
38
- drawMode: GL.TRIANGLE_STRIP,
39
- vertexCount: 4,
40
- attributes: {
41
- aClipSpacePosition: {size: 2, value: new Float32Array(POSITIONS)},
42
- aTexCoord: {size: 2, value: new Float32Array(TEX_COORDS)},
43
- aCoordinate: {size: 2, value: new Float32Array(TEX_COORDS)}
44
- }
45
- })
46
- })
47
- );
48
- this.setVertexCount(4);
49
- }
50
- }
51
- */
2
+ //# sourceMappingURL=clip-space.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clip-space.js","names":[],"sources":["../../src/lib/clip-space.ts"],"sourcesContent":["\n// ClipSpace\n/*\nimport GL from '@luma.gl/constants';\nimport Model, {ModelProps} from './model';\nimport Geometry from '../geometry/geometry';\n\nconst CLIPSPACE_VERTEX_SHADER = glsl`\\\nattribute vec2 aClipSpacePosition;\nattribute vec2 aTexCoord;\nattribute vec2 aCoordinate;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_Position = vec4(aClipSpacePosition, 0., 1.);\n position = aClipSpacePosition;\n coordinate = aCoordinate;\n uv = aTexCoord;\n}\n`;\n\n/* eslint-disable indent, no-multi-spaces *\nconst POSITIONS = [-1, -1, 1, -1, -1, 1, 1, 1];\n\n\nexport default class ClipSpace extends Model {\n constructor(gl: WebGLRenderingContext, opts?: ModelProps) {\n const TEX_COORDS = POSITIONS.map((coord) => (coord === -1 ? 0 : coord));\n\n super(\n gl,\n Object.assign({}, opts, {\n vs: CLIPSPACE_VERTEX_SHADER,\n geometry: new Geometry({\n drawMode: GL.TRIANGLE_STRIP,\n vertexCount: 4,\n attributes: {\n aClipSpacePosition: {size: 2, value: new Float32Array(POSITIONS)},\n aTexCoord: {size: 2, value: new Float32Array(TEX_COORDS)},\n aCoordinate: {size: 2, value: new Float32Array(TEX_COORDS)}\n }\n })\n })\n );\n this.setVertexCount(4);\n }\n}\n*/"],"mappings":""}
@@ -1,113 +1,40 @@
1
1
  import { Buffer, assert } from '@luma.gl/api';
2
- // Support for mapping new geometries with glTF attribute names to "classic" luma.gl shader names
3
2
  const GLTF_TO_LUMA_ATTRIBUTE_MAP = {
4
- POSITION: 'positions',
5
- NORMAL: 'normals',
6
- COLOR_0: 'colors',
7
- TEXCOORD_0: 'texCoords',
8
- TEXCOORD_1: 'texCoords1',
9
- TEXCOORD_2: 'texCoords2'
3
+ POSITION: 'positions',
4
+ NORMAL: 'normals',
5
+ COLOR_0: 'colors',
6
+ TEXCOORD_0: 'texCoords',
7
+ TEXCOORD_1: 'texCoords1',
8
+ TEXCOORD_2: 'texCoords2'
10
9
  };
11
- /*
12
- export function getAttributeLayoutsFromGeometry(geometry: Geometry) {
13
- const layouts: Record<string, {}> = {};
14
- let indices = geometry.indices;
15
-
10
+ export function getIndexBufferFromGeometry(device, geometry) {
11
+ if (!geometry.indices) {
12
+ return undefined;
13
+ }
14
+ const data = geometry.indices.value || geometry.indices;
15
+ assert(data instanceof Uint16Array || data instanceof Uint32Array, 'attribute array for "indices" must be of integer type');
16
+ return device.createBuffer({
17
+ usage: Buffer.INDEX,
18
+ data
19
+ });
20
+ }
21
+ export function getAttributeBuffersFromGeometry(device, geometry) {
22
+ const buffers = {};
16
23
  for (const [name, attribute] of Object.entries(geometry.attributes)) {
17
24
  const remappedName = mapAttributeName(name);
18
-
19
- if (attribute.constant) {
25
+ if (attribute !== null && attribute !== void 0 && attribute.constant) {
20
26
  throw new Error('constant attributes not supported');
21
27
  } else {
22
- const typedArray = attribute.value;
23
- // Create accessor by copying the attribute and removing `value``
24
- const accessor = {...attribute};
25
- delete accessor.value;
26
- buffers[remappedName] = [device.createBuffer(typedArray), accessor];
27
-
28
- inferAttributeAccessor(name, accessor);
28
+ const typedArray = attribute === null || attribute === void 0 ? void 0 : attribute.value;
29
+ buffers[remappedName] = device.createBuffer({
30
+ data: typedArray,
31
+ id: "".concat(remappedName, "-buffer")
32
+ });
29
33
  }
30
34
  }
31
- }
32
-
33
- export class Table {
34
- length: number;
35
- // columns: Record<string, TypedArray> = {};
36
- }
37
-
38
- export class GPUTable {
39
- length: number;
40
- columns: Record<string, Buffer> = {};
41
- }
42
-
43
- export function convertTableToGPUTable(table: Table) {
44
- // for (const ) {}
45
- }
46
-
47
- export function renameTableColumns(table: Table, map: (name: string) => string) {
48
- const newColumns = table.columns.reduce()
49
- table.clone();
50
- }
51
- */
52
- export function getIndexBufferFromGeometry(device, geometry) {
53
- if (!geometry.indices) {
54
- return undefined;
55
- }
56
- // @ts-expect-error
57
- const data = geometry.indices.value || geometry.indices;
58
- assert(data instanceof Uint16Array || data instanceof Uint32Array, 'attribute array for "indices" must be of integer type');
59
- return device.createBuffer({ usage: Buffer.INDEX, data });
60
- }
61
- export function getAttributeBuffersFromGeometry(device, geometry) {
62
- const buffers = {};
63
- for (const [name, attribute] of Object.entries(geometry.attributes)) {
64
- const remappedName = mapAttributeName(name);
65
- if (attribute?.constant) {
66
- throw new Error('constant attributes not supported');
67
- }
68
- else {
69
- const typedArray = attribute?.value;
70
- buffers[remappedName] = device.createBuffer({ data: typedArray, id: `${remappedName}-buffer` });
71
- }
72
- }
73
- return buffers;
35
+ return buffers;
74
36
  }
75
37
  function mapAttributeName(name) {
76
- // @ts-ignore-error
77
- return GLTF_TO_LUMA_ATTRIBUTE_MAP[name] || name;
78
- }
79
- /*
80
- // Check for well known attribute names
81
- // eslint-disable-next-line complexity
82
- export function inferAttributeAccessor(attributeName, attribute) {
83
- let category;
84
- switch (attributeName) {
85
- case 'texCoords':
86
- case 'texCoord1':
87
- case 'texCoord2':
88
- case 'texCoord3':
89
- category = 'uvs';
90
- break;
91
- case 'vertices':
92
- case 'positions':
93
- case 'normals':
94
- case 'pickingColors':
95
- category = 'vectors';
96
- break;
97
- default:
98
- }
99
-
100
- // Check for categorys
101
- switch (category) {
102
- case 'vectors':
103
- attribute.size = attribute.size || 3;
104
- break;
105
- case 'uvs':
106
- attribute.size = attribute.size || 2;
107
- break;
108
- default:
109
- }
110
-
111
- assert(Number.isFinite(attribute.size), `attribute ${attributeName} needs size`);
38
+ return GLTF_TO_LUMA_ATTRIBUTE_MAP[name] || name;
112
39
  }
113
- */
40
+ //# sourceMappingURL=model-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-utils.js","names":["Buffer","assert","GLTF_TO_LUMA_ATTRIBUTE_MAP","POSITION","NORMAL","COLOR_0","TEXCOORD_0","TEXCOORD_1","TEXCOORD_2","getIndexBufferFromGeometry","device","geometry","indices","undefined","data","value","Uint16Array","Uint32Array","createBuffer","usage","INDEX","getAttributeBuffersFromGeometry","buffers","name","attribute","Object","entries","attributes","remappedName","mapAttributeName","constant","Error","typedArray","id","concat"],"sources":["../../src/lib/model-utils.ts"],"sourcesContent":["import {Device, Buffer, assert} from '@luma.gl/api';\nimport type Geometry from '../geometry/geometry';\n\n// Support for mapping new geometries with glTF attribute names to \"classic\" luma.gl shader names\nconst GLTF_TO_LUMA_ATTRIBUTE_MAP = {\n POSITION: 'positions',\n NORMAL: 'normals',\n COLOR_0: 'colors',\n TEXCOORD_0: 'texCoords',\n TEXCOORD_1: 'texCoords1',\n TEXCOORD_2: 'texCoords2'\n};\n\n/*\nexport function getAttributeLayoutsFromGeometry(geometry: Geometry) {\n const layouts: Record<string, {}> = {};\n let indices = geometry.indices;\n\n for (const [name, attribute] of Object.entries(geometry.attributes)) {\n const remappedName = mapAttributeName(name);\n\n if (attribute.constant) {\n throw new Error('constant attributes not supported');\n } else {\n const typedArray = attribute.value;\n // Create accessor by copying the attribute and removing `value``\n const accessor = {...attribute};\n delete accessor.value;\n buffers[remappedName] = [device.createBuffer(typedArray), accessor];\n\n inferAttributeAccessor(name, accessor);\n }\n }\n}\n\nexport class Table {\n length: number;\n // columns: Record<string, TypedArray> = {};\n}\n\nexport class GPUTable {\n length: number;\n columns: Record<string, Buffer> = {};\n}\n\nexport function convertTableToGPUTable(table: Table) {\n // for (const ) {}\n}\n\nexport function renameTableColumns(table: Table, map: (name: string) => string) {\n const newColumns = table.columns.reduce()\n table.clone();\n}\n*/\n\nexport function getIndexBufferFromGeometry(device: Device, geometry: Geometry): Buffer | undefined {\n if (!geometry.indices) {\n return undefined;\n }\n\n // @ts-expect-error\n const data = geometry.indices.value || geometry.indices;\n assert(\n data instanceof Uint16Array || data instanceof Uint32Array,\n 'attribute array for \"indices\" must be of integer type'\n );\n return device.createBuffer({usage: Buffer.INDEX, data});\n}\n\nexport function getAttributeBuffersFromGeometry(device: Device, geometry: Geometry): Record<string, Buffer> {\n const buffers: Record<string, Buffer> = {};\n\n for (const [name, attribute] of Object.entries(geometry.attributes)) {\n const remappedName = mapAttributeName(name);\n if (attribute?.constant) {\n throw new Error('constant attributes not supported');\n } else {\n const typedArray = attribute?.value;\n buffers[remappedName] = device.createBuffer({data: typedArray, id: `${remappedName}-buffer`});\n }\n }\n\n return buffers;\n}\n\nfunction mapAttributeName(name: string): string {\n // @ts-ignore-error\n return GLTF_TO_LUMA_ATTRIBUTE_MAP[name] || name;\n}\n\n/*\n// Check for well known attribute names\n// eslint-disable-next-line complexity\nexport function inferAttributeAccessor(attributeName, attribute) {\n let category;\n switch (attributeName) {\n case 'texCoords':\n case 'texCoord1':\n case 'texCoord2':\n case 'texCoord3':\n category = 'uvs';\n break;\n case 'vertices':\n case 'positions':\n case 'normals':\n case 'pickingColors':\n category = 'vectors';\n break;\n default:\n }\n\n // Check for categorys\n switch (category) {\n case 'vectors':\n attribute.size = attribute.size || 3;\n break;\n case 'uvs':\n attribute.size = attribute.size || 2;\n break;\n default:\n }\n\n assert(Number.isFinite(attribute.size), `attribute ${attributeName} needs size`);\n}\n*/\n"],"mappings":"AAAA,SAAgBA,MAAM,EAAEC,MAAM,QAAO,cAAc;AAInD,MAAMC,0BAA0B,GAAG;EACjCC,QAAQ,EAAE,WAAW;EACrBC,MAAM,EAAE,SAAS;EACjBC,OAAO,EAAE,QAAQ;EACjBC,UAAU,EAAE,WAAW;EACvBC,UAAU,EAAE,YAAY;EACxBC,UAAU,EAAE;AACd,CAAC;AA4CD,OAAO,SAASC,0BAA0BA,CAACC,MAAc,EAAEC,QAAkB,EAAsB;EACjG,IAAI,CAACA,QAAQ,CAACC,OAAO,EAAE;IACrB,OAAOC,SAAS;EAClB;EAGA,MAAMC,IAAI,GAAGH,QAAQ,CAACC,OAAO,CAACG,KAAK,IAAIJ,QAAQ,CAACC,OAAO;EACvDX,MAAM,CACJa,IAAI,YAAYE,WAAW,IAAIF,IAAI,YAAYG,WAAW,EAC1D,uDAAuD,CACxD;EACD,OAAOP,MAAM,CAACQ,YAAY,CAAC;IAACC,KAAK,EAAEnB,MAAM,CAACoB,KAAK;IAAEN;EAAI,CAAC,CAAC;AACzD;AAEA,OAAO,SAASO,+BAA+BA,CAACX,MAAc,EAAEC,QAAkB,EAA0B;EAC1G,MAAMW,OAA+B,GAAG,CAAC,CAAC;EAE1C,KAAK,MAAM,CAACC,IAAI,EAAEC,SAAS,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACf,QAAQ,CAACgB,UAAU,CAAC,EAAE;IACnE,MAAMC,YAAY,GAAGC,gBAAgB,CAACN,IAAI,CAAC;IAC3C,IAAIC,SAAS,aAATA,SAAS,eAATA,SAAS,CAAEM,QAAQ,EAAE;MACvB,MAAM,IAAIC,KAAK,CAAC,mCAAmC,CAAC;IACtD,CAAC,MAAM;MACL,MAAMC,UAAU,GAAGR,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAET,KAAK;MACnCO,OAAO,CAACM,YAAY,CAAC,GAAGlB,MAAM,CAACQ,YAAY,CAAC;QAACJ,IAAI,EAAEkB,UAAU;QAAEC,EAAE,KAAAC,MAAA,CAAKN,YAAY;MAAS,CAAC,CAAC;IAC/F;EACF;EAEA,OAAON,OAAO;AAChB;AAEA,SAASO,gBAAgBA,CAACN,IAAY,EAAU;EAE9C,OAAOrB,0BAA0B,CAACqB,IAAI,CAAC,IAAIA,IAAI;AACjD"}
@@ -2,7 +2,7 @@ import type { Device, Buffer, RenderPipelineProps, RenderPass, Binding, Primitiv
2
2
  import { RenderPipeline } from '@luma.gl/api';
3
3
  import type { ShaderModule } from '@luma.gl/shadertools';
4
4
  import type Geometry from '../geometry/geometry';
5
- export type ModelProps = Omit<RenderPipelineProps, 'vs' | 'fs'> & {
5
+ export declare type ModelProps = Omit<RenderPipelineProps, 'vs' | 'fs'> & {
6
6
  vs?: {
7
7
  glsl?: string;
8
8
  wgsl?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/lib/model.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAC9G,OAAO,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AAIjD,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,mBAAmB,EAAE,IAAI,GAAG,IAAI,CAAC,GAAG;IAEhE,EAAE,CAAC,EAAE;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAC,GAAG,MAAM,GAAG,IAAI,CAAC;IACpD,EAAE,CAAC,EAAE;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAC,GAAG,MAAM,GAAG,IAAI,CAAC;IACpD,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IACrD,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC5B,CAAC;AAcF,aAAa;AACb,qBAAa,KAAK;IAChB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,E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Aa,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAMvD,uBAAuB;IACvB,WAAW,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAMpD,WAAW,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAMhD,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;CAWvC"}
package/dist/lib/model.js CHANGED
@@ -1,138 +1,146 @@
1
- // luma.gl, MIT license
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import { RenderPipeline } from '@luma.gl/api';
3
- import { getAttributeBuffersFromGeometry, getIndexBufferFromGeometry } from './model-utils.js';
4
- import { PipelineFactory } from './pipeline-factory.js';
3
+ import { getAttributeBuffersFromGeometry, getIndexBufferFromGeometry } from "./model-utils.js";
4
+ import { PipelineFactory } from "./pipeline-factory.js";
5
5
  const DEFAULT_MODEL_PROPS = {
6
- ...RenderPipeline._DEFAULT_PROPS,
7
- vs: null,
8
- fs: null,
9
- id: 'unnamed',
10
- handle: undefined,
11
- userData: {},
12
- modules: [],
13
- moduleSettings: {},
14
- geometry: null
6
+ ...RenderPipeline._DEFAULT_PROPS,
7
+ vs: null,
8
+ fs: null,
9
+ id: 'unnamed',
10
+ handle: undefined,
11
+ userData: {},
12
+ modules: [],
13
+ moduleSettings: {},
14
+ geometry: null
15
15
  };
16
- /** v9 API */
17
16
  export class Model {
18
- constructor(device, props) {
19
- this.fs = null;
20
- this.props = { ...DEFAULT_MODEL_PROPS, ...props };
21
- props = this.props;
22
- this.id = this.props.id;
23
- this.device = device;
24
- // Create the pipeline
25
- if (!props.vs) {
26
- throw new Error('no vertex shader');
27
- }
28
- this.vs = getShaderSource(this.device, props.vs);
29
- if (props.fs) {
30
- this.fs = getShaderSource(this.device, props.fs);
31
- }
32
- this.vertexCount = this.props.vertexCount;
33
- this.topology = this.props.topology;
34
- if (this.props.geometry) {
35
- this.vertexCount = this.props.geometry.vertexCount;
36
- this.topology = this.props.geometry.topology || 'triangle-list';
37
- }
38
- const pipelineFactory = PipelineFactory.getDefaultPipelineFactory(this.device);
39
- const { pipeline, getUniforms } = pipelineFactory.createRenderPipeline({
40
- ...this.props,
41
- vs: this.vs,
42
- fs: this.fs,
43
- topology: this.topology,
44
- parameters: props.parameters,
45
- layout: props.layout
46
- });
47
- this.pipeline = pipeline;
48
- this._getModuleUniforms = getUniforms;
49
- if (this.props.geometry) {
50
- this._setGeometry(this.props.geometry);
51
- }
52
- this.setUniforms(this._getModuleUniforms()); // Get all default module uniforms
53
- this.setProps(this.props);
17
+ constructor(device, props) {
18
+ _defineProperty(this, "device", void 0);
19
+ _defineProperty(this, "pipeline", void 0);
20
+ _defineProperty(this, "id", void 0);
21
+ _defineProperty(this, "vs", void 0);
22
+ _defineProperty(this, "fs", null);
23
+ _defineProperty(this, "topology", void 0);
24
+ _defineProperty(this, "vertexCount", void 0);
25
+ _defineProperty(this, "props", void 0);
26
+ _defineProperty(this, "_getModuleUniforms", void 0);
27
+ this.props = {
28
+ ...DEFAULT_MODEL_PROPS,
29
+ ...props
30
+ };
31
+ props = this.props;
32
+ this.id = this.props.id;
33
+ this.device = device;
34
+ if (!props.vs) {
35
+ throw new Error('no vertex shader');
54
36
  }
55
- destroy() {
56
- this.pipeline.destroy();
37
+ this.vs = getShaderSource(this.device, props.vs);
38
+ if (props.fs) {
39
+ this.fs = getShaderSource(this.device, props.fs);
57
40
  }
58
- draw(renderPass) {
59
- this.pipeline.draw({
60
- renderPass,
61
- vertexCount: this.vertexCount,
62
- instanceCount: this.props.instanceCount
63
- });
64
- return this;
41
+ this.vertexCount = this.props.vertexCount;
42
+ this.topology = this.props.topology;
43
+ if (this.props.geometry) {
44
+ this.vertexCount = this.props.geometry.vertexCount;
45
+ this.topology = this.props.geometry.topology || 'triangle-list';
65
46
  }
66
- setProps(props) {
67
- if (props.indices) {
68
- this.setIndexBuffer(props.indices);
69
- }
70
- if (props.attributes) {
71
- this.setAttributes(props.attributes);
72
- }
73
- if (props.bindings) {
74
- this.setBindings(props.bindings);
75
- }
76
- if (props.uniforms) {
77
- this.setUniforms(props.uniforms);
78
- }
79
- if (props.moduleSettings) {
80
- this.updateModuleSettings(props.moduleSettings);
81
- }
82
- return this;
47
+ const pipelineFactory = PipelineFactory.getDefaultPipelineFactory(this.device);
48
+ const {
49
+ pipeline,
50
+ getUniforms
51
+ } = pipelineFactory.createRenderPipeline({
52
+ ...this.props,
53
+ vs: this.vs,
54
+ fs: this.fs,
55
+ topology: this.topology,
56
+ parameters: props.parameters,
57
+ layout: props.layout
58
+ });
59
+ this.pipeline = pipeline;
60
+ this._getModuleUniforms = getUniforms;
61
+ if (this.props.geometry) {
62
+ this._setGeometry(this.props.geometry);
83
63
  }
84
- updateModuleSettings(props) {
85
- const uniforms = this._getModuleUniforms(props);
86
- this.setUniforms(uniforms);
87
- return this;
64
+ this.setUniforms(this._getModuleUniforms());
65
+ this.setProps(this.props);
66
+ }
67
+ destroy() {
68
+ this.pipeline.destroy();
69
+ }
70
+ draw(renderPass) {
71
+ this.pipeline.draw({
72
+ renderPass,
73
+ vertexCount: this.vertexCount,
74
+ instanceCount: this.props.instanceCount
75
+ });
76
+ return this;
77
+ }
78
+ setProps(props) {
79
+ if (props.indices) {
80
+ this.setIndexBuffer(props.indices);
88
81
  }
89
- setIndexBuffer(indices) {
90
- this.pipeline.setIndexBuffer(indices);
91
- // this._indices = indices;
92
- return this;
82
+ if (props.attributes) {
83
+ this.setAttributes(props.attributes);
93
84
  }
94
- setAttributes(attributes) {
95
- this.pipeline.setAttributes(attributes);
96
- Object.assign(this.props.attributes, attributes);
97
- return this;
85
+ if (props.bindings) {
86
+ this.setBindings(props.bindings);
98
87
  }
99
- /** Set the bindings */
100
- setBindings(bindings) {
101
- this.pipeline.setBindings(bindings);
102
- Object.assign(this.props.bindings, bindings);
103
- return this;
88
+ if (props.uniforms) {
89
+ this.setUniforms(props.uniforms);
104
90
  }
105
- setUniforms(uniforms) {
106
- this.pipeline.setUniforms(uniforms);
107
- Object.assign(this.props.uniforms, uniforms);
108
- return this;
91
+ if (props.moduleSettings) {
92
+ this.updateModuleSettings(props.moduleSettings);
109
93
  }
110
- _setGeometry(geometry) {
111
- // this._deleteGeometryBuffers();
112
- const geometryBuffers = getAttributeBuffersFromGeometry(this.device, geometry);
113
- this.setAttributes(geometryBuffers);
114
- const indexBuffer = getIndexBufferFromGeometry(this.device, geometry);
115
- if (indexBuffer) {
116
- this.setIndexBuffer(indexBuffer);
117
- }
94
+ return this;
95
+ }
96
+ updateModuleSettings(props) {
97
+ const uniforms = this._getModuleUniforms(props);
98
+ this.setUniforms(uniforms);
99
+ return this;
100
+ }
101
+ setIndexBuffer(indices) {
102
+ this.pipeline.setIndexBuffer(indices);
103
+ return this;
104
+ }
105
+ setAttributes(attributes) {
106
+ this.pipeline.setAttributes(attributes);
107
+ Object.assign(this.props.attributes, attributes);
108
+ return this;
109
+ }
110
+ setBindings(bindings) {
111
+ this.pipeline.setBindings(bindings);
112
+ Object.assign(this.props.bindings, bindings);
113
+ return this;
114
+ }
115
+ setUniforms(uniforms) {
116
+ this.pipeline.setUniforms(uniforms);
117
+ Object.assign(this.props.uniforms, uniforms);
118
+ return this;
119
+ }
120
+ _setGeometry(geometry) {
121
+ const geometryBuffers = getAttributeBuffersFromGeometry(this.device, geometry);
122
+ this.setAttributes(geometryBuffers);
123
+ const indexBuffer = getIndexBufferFromGeometry(this.device, geometry);
124
+ if (indexBuffer) {
125
+ this.setIndexBuffer(indexBuffer);
118
126
  }
127
+ }
119
128
  }
120
- /** Create a shader from the different overloads */
121
129
  function getShaderSource(device, shader) {
122
- // TODO - detect WGSL/GLSL and throw an error if not supported
123
- if (typeof shader === 'string') {
124
- return shader;
125
- }
126
- switch (device.info.type) {
127
- case 'webgpu':
128
- if (shader?.wgsl) {
129
- return shader.wgsl;
130
- }
131
- throw new Error('WebGPU does not support GLSL shaders');
132
- default:
133
- if (shader?.glsl) {
134
- return shader.glsl;
135
- }
136
- throw new Error('WebGL does not support WGSL shaders');
137
- }
130
+ if (typeof shader === 'string') {
131
+ return shader;
132
+ }
133
+ switch (device.info.type) {
134
+ case 'webgpu':
135
+ if (shader !== null && shader !== void 0 && shader.wgsl) {
136
+ return shader.wgsl;
137
+ }
138
+ throw new Error('WebGPU does not support GLSL shaders');
139
+ default:
140
+ if (shader !== null && shader !== void 0 && shader.glsl) {
141
+ return shader.glsl;
142
+ }
143
+ throw new Error('WebGL does not support WGSL shaders');
144
+ }
138
145
  }
146
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.js","names":["RenderPipeline","getAttributeBuffersFromGeometry","getIndexBufferFromGeometry","PipelineFactory","DEFAULT_MODEL_PROPS","_DEFAULT_PROPS","vs","fs","id","handle","undefined","userData","modules","moduleSettings","geometry","Model","constructor","device","props","_defineProperty","Error","getShaderSource","vertexCount","topology","pipelineFactory","getDefaultPipelineFactory","pipeline","getUniforms","createRenderPipeline","parameters","layout","_getModuleUniforms","_setGeometry","setUniforms","setProps","destroy","draw","renderPass","instanceCount","indices","setIndexBuffer","attributes","setAttributes","bindings","setBindings","uniforms","updateModuleSettings","Object","assign","geometryBuffers","indexBuffer","shader","info","type","wgsl","glsl"],"sources":["../../src/lib/model.ts"],"sourcesContent":["// luma.gl, MIT license\n\nimport type {Device, Buffer, RenderPipelineProps, RenderPass, Binding, PrimitiveTopology} from '@luma.gl/api';\nimport {RenderPipeline} from '@luma.gl/api';\nimport type { ShaderModule } from '@luma.gl/shadertools';\nimport type Geometry from '../geometry/geometry';\nimport {getAttributeBuffersFromGeometry, getIndexBufferFromGeometry} from './model-utils';\nimport {PipelineFactory} from './pipeline-factory';\n\nexport type ModelProps = Omit<RenderPipelineProps, 'vs' | 'fs'> & {\n // Model also accepts a string\n vs?: {glsl?: string; wgsl?: string} | string | null;\n fs?: {glsl?: string; wgsl?: string} | string | null;\n modules?: ShaderModule[];\n moduleSettings?: Record<string, Record<string, any>>;\n geometry?: Geometry | null;\n};\n\nconst DEFAULT_MODEL_PROPS: Required<ModelProps> = {\n ...RenderPipeline._DEFAULT_PROPS,\n vs: null,\n fs: null,\n id: 'unnamed',\n handle: undefined,\n userData: {},\n modules: [],\n moduleSettings: {},\n geometry: null\n};\n\n/** v9 API */\nexport class Model {\n readonly device: Device;\n readonly pipeline: RenderPipeline;\n readonly id: string;\n readonly vs: string;\n readonly fs: string | null = null;\n readonly topology: PrimitiveTopology;\n readonly vertexCount;\n props: Required<ModelProps>;\n\n private _getModuleUniforms: (props?: Record<string, Record<string, any>>) => Record<string, any>;\n\n constructor(device: Device, props: ModelProps) {\n this.props = {...DEFAULT_MODEL_PROPS, ...props};\n props = this.props;\n this.id = this.props.id;\n this.device = device;\n\n // Create the pipeline\n if (!props.vs) {\n throw new Error('no vertex shader');\n }\n this.vs = getShaderSource(this.device, props.vs);\n if (props.fs) {\n this.fs = getShaderSource(this.device, props.fs);\n }\n\n this.vertexCount = this.props.vertexCount;\n this.topology = this.props.topology;\n\n if (this.props.geometry) {\n this.vertexCount = this.props.geometry.vertexCount;\n this.topology = this.props.geometry.topology || 'triangle-list';\n }\n\n const pipelineFactory = PipelineFactory.getDefaultPipelineFactory(this.device);\n const {pipeline, getUniforms} = pipelineFactory.createRenderPipeline({\n ...this.props,\n vs: this.vs,\n fs: this.fs,\n topology: this.topology,\n parameters: props.parameters,\n layout: props.layout\n });\n\n this.pipeline = pipeline;\n this._getModuleUniforms = getUniforms;\n\n if (this.props.geometry) {\n this._setGeometry(this.props.geometry);\n }\n this.setUniforms(this._getModuleUniforms()) // Get all default module uniforms\n this.setProps(this.props);\n }\n\n destroy(): void {\n this.pipeline.destroy();\n }\n\n draw(renderPass?: RenderPass): this {\n this.pipeline.draw({\n renderPass,\n vertexCount: this.vertexCount,\n instanceCount: this.props.instanceCount\n });\n return this;\n }\n\n setProps(props: ModelProps): this {\n if (props.indices) {\n this.setIndexBuffer(props.indices);\n }\n if (props.attributes) {\n this.setAttributes(props.attributes);\n }\n if (props.bindings) {\n this.setBindings(props.bindings);\n }\n if (props.uniforms) {\n this.setUniforms(props.uniforms);\n }\n if (props.moduleSettings) {\n this.updateModuleSettings(props.moduleSettings);\n }\n return this;\n }\n\n updateModuleSettings(props: Record<string, any>): this {\n const uniforms = this._getModuleUniforms(props);\n this.setUniforms(uniforms);\n return this;\n }\n\n setIndexBuffer(indices: Buffer): this {\n this.pipeline.setIndexBuffer(indices);\n // this._indices = indices;\n return this;\n }\n\n setAttributes(attributes: Record<string, Buffer>): this {\n this.pipeline.setAttributes(attributes);\n Object.assign(this.props.attributes, attributes);\n return this;\n }\n\n /** Set the bindings */\n setBindings(bindings: Record<string, Binding>): this {\n this.pipeline.setBindings(bindings);\n Object.assign(this.props.bindings, bindings);\n return this;\n }\n\n setUniforms(uniforms: Record<string, any>): this {\n this.pipeline.setUniforms(uniforms);\n Object.assign(this.props.uniforms, uniforms);\n return this;\n }\n\n _setGeometry(geometry: Geometry): void {\n // this._deleteGeometryBuffers();\n\n const geometryBuffers = getAttributeBuffersFromGeometry(this.device, geometry);\n this.setAttributes(geometryBuffers);\n\n const indexBuffer = getIndexBufferFromGeometry(this.device, geometry);\n if (indexBuffer) {\n this.setIndexBuffer(indexBuffer);\n }\n }\n}\n\n/** Create a shader from the different overloads */\nfunction getShaderSource(device: Device, shader: string | {glsl?: string; wgsl?: string}): string {\n // TODO - detect WGSL/GLSL and throw an error if not supported\n if (typeof shader === 'string') {\n return shader;\n }\n\n switch (device.info.type) {\n case 'webgpu':\n if (shader?.wgsl) {\n return shader.wgsl;\n }\n throw new Error('WebGPU does not support GLSL shaders');\n\n default:\n if (shader?.glsl) {\n return shader.glsl;\n }\n throw new Error('WebGL does not support WGSL shaders');\n }\n}\n"],"mappings":";AAGA,SAAQA,cAAc,QAAO,cAAc;AAAC,SAGpCC,+BAA+B,EAAEC,0BAA0B;AAAA,SAC3DC,eAAe;A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AAQ;IAC/C,IAAI,CAACnB,QAAQ,CAACO,WAAW,CAACY,QAAQ,CAAC;IACnCE,MAAM,CAACC,MAAM,CAAC,IAAI,CAAC9B,KAAK,CAAC2B,QAAQ,EAAEA,QAAQ,CAAC;IAC5C,OAAO,IAAI;EACb;EAEAb,YAAYA,CAAClB,QAAkB,EAAQ;IAGrC,MAAMmC,eAAe,GAAGhD,+BAA+B,CAAC,IAAI,CAACgB,MAAM,EAAEH,QAAQ,CAAC;IAC9E,IAAI,CAAC4B,aAAa,CAACO,eAAe,CAAC;IAEnC,MAAMC,WAAW,GAAGhD,0BAA0B,CAAC,IAAI,CAACe,MAAM,EAAEH,QAAQ,CAAC;IACrE,IAAIoC,WAAW,EAAE;MACf,IAAI,CAACV,cAAc,CAACU,WAAW,CAAC;IAClC;EACF;AACF;AAGA,SAAS7B,eAAeA,CAACJ,MAAc,EAAEkC,MAA+C,EAAU;EAEhG,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IAC9B,OAAOA,MAAM;EACf;EAEA,QAAQlC,MAAM,CAACmC,IAAI,CAACC,IAAI;IACtB,KAAK,QAAQ;MACX,IAAIF,MAAM,aAANA,MAAM,eAANA,MAAM,CAAEG,IAAI,EAAE;QAChB,OAAOH,MAAM,CAACG,IAAI;MACpB;MACA,MAAM,IAAIlC,KAAK,CAAC,sCAAsC,CAAC;IAEzD;MACE,IAAI+B,MAAM,aAANA,MAAM,eAANA,MAAM,CAAEI,IAAI,EAAE;QAChB,OAAOJ,MAAM,CAACI,IAAI;MACpB;MACA,MAAM,IAAInC,KAAK,CAAC,qCAAqC,CAAC;EAAC;AAE7D"}
@@ -1,7 +1,7 @@
1
1
  import type { RenderPipelineParameters, PrimitiveTopology, ShaderLayout } from '@luma.gl/api';
2
2
  import { Device, RenderPipeline } from '@luma.gl/api/';
3
3
  import type { ShaderModule } from '@luma.gl/shadertools';
4
- export type GetRenderPipelineOptions = {
4
+ export declare type GetRenderPipelineOptions = {
5
5
  vs: string;
6
6
  fs: string | null;
7
7
  topology: PrimitiveTopology;
@@ -14,7 +14,7 @@ export type GetRenderPipelineOptions = {
14
14
  varyings?: string[];
15
15
  bufferMode?: number;
16
16
  };
17
- export type GetComputePipelineOptions = {
17
+ export declare type GetComputePipelineOptions = {
18
18
  cs: string;
19
19
  parameters?: RenderPipelineParameters;
20
20
  modules?: ShaderModule[];
@@ -24,7 +24,7 @@ export type GetComputePipelineOptions = {
24
24
  varyings?: string[];
25
25
  bufferMode?: number;
26
26
  };
27
- type GetUniformsFunc = (props?: Record<string, any>) => Record<string, any>;
27
+ declare type GetUniformsFunc = (props?: Record<string, any>) => Record<string, any>;
28
28
  /** Efficiently create shared pipelines with varying parameters */
29
29
  export declare class PipelineFactory {
30
30
  readonly device: Device;
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline-factory.d.ts","sourceRoot":"","sources":["../../src/lib/pipeline-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,wBAAwB,EAAE,iBAAiB,EAAE,YAAY,EAAC,MAAM,cAAc,CAAC;AAC5F,OAAO,EAAC,MAAM,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,MAAM,MAAM,wBAAwB,GAAG;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,MAAM,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAC7B,UAAU,CAAC,EAAE,wBAAwB,CAAC;IAEtC,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,kBAAkB,CAAC,EAAE,OAAO,C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