@luma.gl/engine 9.0.16 → 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.
- package/dist/dist.dev.js +1 -1
- package/dist/dist.min.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/shader-inputs.d.ts +6 -18
- package/dist/shader-inputs.d.ts.map +1 -1
- package/dist/shader-inputs.js +1 -1
- package/package.json +3 -3
- package/src/index.ts +0 -1
- package/src/shader-inputs.ts +12 -35
package/dist/index.d.ts
CHANGED
|
@@ -37,7 +37,6 @@ export type { SphereGeometryProps } from "./geometries/sphere-geometry.js";
|
|
|
37
37
|
export { SphereGeometry } from "./geometries/sphere-geometry.js";
|
|
38
38
|
export type { TruncatedConeGeometryProps } from "./geometries/truncated-cone-geometry.js";
|
|
39
39
|
export { TruncatedConeGeometry } from "./geometries/truncated-cone-geometry.js";
|
|
40
|
-
export type { ShaderModuleInputs } from "./shader-inputs.js";
|
|
41
40
|
export { ShaderInputs as _ShaderInputs } from "./shader-inputs.js";
|
|
42
41
|
export type { ComputationProps } from "./computation.js";
|
|
43
42
|
export { Computation } from "./computation.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,QAAQ,EAAC,gCAA6B;AAC9C,OAAO,EAAC,SAAS,EAAC,kCAA+B;AACjD,YAAY,EAAC,cAAc,EAAC,4CAAyC;AAErE,OAAO,EAAC,qBAAqB,EAAC,oDAAiD;AAE/E,YAAY,EAAC,kBAAkB,EAAC,2CAAwC;AACxE,OAAO,EAAC,aAAa,EAAC,2CAAwC;AAE9D,YAAY,EAAC,sBAAsB,EAAC,gDAA6C;AACjF,OAAO,EAAC,iBAAiB,EAA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Y,EAAC,iBAAiB,EAAC,sCAAmC;AAClE,OAAO,EAAC,YAAY,EAAC,sCAAmC;AACxD,YAAY,EAAC,qBAAqB,EAAC,0CAAuC;AAC1E,OAAO,EAAC,gBAAgB,EAAC,0CAAuC;AAChE,YAAY,EAAC,sBAAsB,EAAC,4CAAyC;AAC7E,OAAO,EAAC,iBAAiB,EAAC,4CAAyC;AACnE,YAAY,EAAC,kBAAkB,EAAC,uCAAoC;AACpE,OAAO,EAAC,aAAa,EAAC,uCAAoC;AAC1D,YAAY,EAAC,mBAAmB,EAAC,wCAAqC;AACtE,OAAO,EAAC,cAAc,EAAC,wCAAqC;AAC5D,YAAY,EAAC,0BAA0B,EAAC,gDAA6C;AACrF,OAAO,EAAC,qBAAqB,EAAC,gDAA6C;AAG3E,OAAO,EAAC,YAAY,IAAI,aAAa,EAAC,2BAAwB;AAC9D,YAAY,EAAC,gBAAgB,EAAC,yBAAsB;AACpD,OAAO,EAAC,WAAW,EAAC,yBAAsB"}
|
package/dist/index.js
CHANGED
|
@@ -25,5 +25,6 @@ export { IcoSphereGeometry } from "./geometries/ico-sphere-geometry.js";
|
|
|
25
25
|
export { PlaneGeometry } from "./geometries/plane-geometry.js";
|
|
26
26
|
export { SphereGeometry } from "./geometries/sphere-geometry.js";
|
|
27
27
|
export { TruncatedConeGeometry } from "./geometries/truncated-cone-geometry.js";
|
|
28
|
+
// EXPERIMENTAL
|
|
28
29
|
export { ShaderInputs as _ShaderInputs } from "./shader-inputs.js";
|
|
29
30
|
export { Computation } from "./computation.js";
|
package/dist/shader-inputs.d.ts
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { ShaderModuleInstance } from '@luma.gl/shadertools';
|
|
3
|
-
/** Minimal ShaderModule subset, we don't need shader code etc */
|
|
4
|
-
export type ShaderModuleInputs<PropsT extends Record<string, unknown> = Record<string, unknown>, UniformsT extends Record<string, UniformValue> = Record<string, UniformValue>, BindingsT extends Record<string, Texture | Sampler> = Record<string, Texture | Sampler>> = {
|
|
5
|
-
defaultUniforms?: UniformsT;
|
|
6
|
-
getUniforms?: (settings: Partial<PropsT>, prevUniforms?: UniformsT) => UniformsT;
|
|
7
|
-
/** Not used. Used to access props type */
|
|
8
|
-
props?: PropsT;
|
|
9
|
-
bindings?: Record<keyof BindingsT, {
|
|
10
|
-
location: number;
|
|
11
|
-
type: 'texture' | 'sampler' | 'uniforms';
|
|
12
|
-
}>;
|
|
13
|
-
uniformTypes?: any;
|
|
14
|
-
};
|
|
1
|
+
import type { Binding, UniformValue } from '@luma.gl/core';
|
|
2
|
+
import { ShaderModule, ShaderModuleInstance } from '@luma.gl/shadertools';
|
|
15
3
|
/**
|
|
16
4
|
* ShaderInputs holds uniform and binding values for one or more shader modules,
|
|
17
5
|
* - It can generate binary data for any uniform buffer
|
|
@@ -25,12 +13,12 @@ export declare class ShaderInputs<ShaderPropsT extends Partial<Record<string, Re
|
|
|
25
13
|
* @todo should should this include the resolved dependencies?
|
|
26
14
|
*/
|
|
27
15
|
modules: Readonly<{
|
|
28
|
-
[P in keyof ShaderPropsT]:
|
|
16
|
+
[P in keyof ShaderPropsT]: ShaderModule<ShaderPropsT[P]>;
|
|
29
17
|
}>;
|
|
30
18
|
/** Stores the uniform values for each module */
|
|
31
19
|
moduleUniforms: Record<keyof ShaderPropsT, Record<string, UniformValue>>;
|
|
32
20
|
/** Stores the uniform bindings for each module */
|
|
33
|
-
moduleBindings: Record<keyof ShaderPropsT, Record<string,
|
|
21
|
+
moduleBindings: Record<keyof ShaderPropsT, Record<string, Binding>>;
|
|
34
22
|
/** Tracks if uniforms have changed */
|
|
35
23
|
moduleUniformsChanged: Record<keyof ShaderPropsT, false | string>;
|
|
36
24
|
/**
|
|
@@ -38,7 +26,7 @@ export declare class ShaderInputs<ShaderPropsT extends Partial<Record<string, Re
|
|
|
38
26
|
* @param modules
|
|
39
27
|
*/
|
|
40
28
|
constructor(modules: {
|
|
41
|
-
[P in keyof ShaderPropsT]?:
|
|
29
|
+
[P in keyof ShaderPropsT]?: ShaderModule<ShaderPropsT[P], any>;
|
|
42
30
|
});
|
|
43
31
|
/** Destroy */
|
|
44
32
|
destroy(): void;
|
|
@@ -57,7 +45,7 @@ export declare class ShaderInputs<ShaderPropsT extends Partial<Record<string, Re
|
|
|
57
45
|
/** Get all uniform values for all modules */
|
|
58
46
|
getUniformValues(): Record<keyof ShaderPropsT, Record<string, UniformValue>>;
|
|
59
47
|
/** Merges all bindings for the shader (from the various modules) */
|
|
60
|
-
getBindings(): Record<string,
|
|
48
|
+
getBindings(): Record<string, Binding>;
|
|
61
49
|
getDebugTable(): Record<string, Record<string, unknown>>;
|
|
62
50
|
}
|
|
63
51
|
//# sourceMappingURL=shader-inputs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader-inputs.d.ts","sourceRoot":"","sources":["../src/shader-inputs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"shader-inputs.d.ts","sourceRoot":"","sources":["../src/shader-inputs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,OAAO,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAGzD,OAAO,EAAkB,YAAY,EAAE,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAEzF;;;;;;GAMG;AACH,qBAAa,YAAY,CACvB,YAAY,SAAS,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAC7E,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CACxC;IAED;;;OAGG;IACH,OAAO,EAAE,QAAQ,CAAC;SAAE,CAAC,IAAI,MAAM,YAAY,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;KAAC,CAAC,CAAC;IAE9E,gDAAgD;IAChD,cAAc,EAAE,MAAM,CAAC,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;IACzE,mDAAmD;IACnD,cAAc,EAAE,MAAM,CAAC,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACpE,sCAAsC;IACtC,qBAAqB,EAAE,MAAM,CAAC,MAAM,YAAY,EAAE,KAAK,GAAG,MAAM,CAAC,CAAC;IAElE;;;OAGG;gBACS,OAAO,EAAE;SAAE,CAAC,IAAI,MAAM,YAAY,CAAC,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;KAAC;IA2BrF,cAAc;IACd,OAAO,IAAI,IAAI;IAEf;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;SAAE,CAAC,IAAI,MAAM,YAAY,CAAC,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;KAAC,CAAC,GAAG,IAAI;IAyBtF,oEAAoE;IAKpE;;;OAGG;IACH,UAAU,IAAI,oBAAoB,EAAE;IAIpC,6CAA6C;IAC7C,gBAAgB,IAAI,MAAM,CAAC,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAI5E,oEAAoE;IACpE,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAQtC,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAYzD"}
|
package/dist/shader-inputs.js
CHANGED
|
@@ -64,7 +64,7 @@ export class ShaderInputs {
|
|
|
64
64
|
}
|
|
65
65
|
const oldUniforms = this.moduleUniforms[moduleName];
|
|
66
66
|
const oldBindings = this.moduleBindings[moduleName];
|
|
67
|
-
const uniformsAndBindings = module.getUniforms?.(moduleProps,
|
|
67
|
+
const uniformsAndBindings = module.getUniforms?.(moduleProps, oldUniforms) || moduleProps;
|
|
68
68
|
const { uniforms, bindings } = splitUniformsAndBindings(uniformsAndBindings);
|
|
69
69
|
this.moduleUniforms[moduleName] = { ...oldUniforms, ...uniforms };
|
|
70
70
|
this.moduleBindings[moduleName] = { ...oldBindings, ...bindings };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luma.gl/engine",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.17",
|
|
4
4
|
"description": "3D Engine Components for luma.gl",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"@luma.gl/core": "^9.0.0"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@luma.gl/shadertools": "9.0.
|
|
46
|
+
"@luma.gl/shadertools": "9.0.17",
|
|
47
47
|
"@math.gl/core": "^4.0.0",
|
|
48
48
|
"@probe.gl/log": "^4.0.2",
|
|
49
49
|
"@probe.gl/stats": "^4.0.2"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "f348f3221ab2842ffa877b6c99e0e9e4df82426e"
|
|
52
52
|
}
|
package/src/index.ts
CHANGED
|
@@ -57,7 +57,6 @@ export type {TruncatedConeGeometryProps} from './geometries/truncated-cone-geome
|
|
|
57
57
|
export {TruncatedConeGeometry} from './geometries/truncated-cone-geometry';
|
|
58
58
|
|
|
59
59
|
// EXPERIMENTAL
|
|
60
|
-
export type {ShaderModuleInputs} from './shader-inputs';
|
|
61
60
|
export {ShaderInputs as _ShaderInputs} from './shader-inputs';
|
|
62
61
|
export type {ComputationProps} from './computation';
|
|
63
62
|
export {Computation} from './computation';
|
package/src/shader-inputs.ts
CHANGED
|
@@ -2,33 +2,10 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {
|
|
5
|
+
import type {Binding, UniformValue} from '@luma.gl/core';
|
|
6
6
|
import {log, splitUniformsAndBindings} from '@luma.gl/core';
|
|
7
7
|
// import type {ShaderUniformType, UniformValue, UniformFormat, UniformInfoDevice, Texture, Sampler} from '@luma.gl/core';
|
|
8
|
-
import {_resolveModules, ShaderModuleInstance} from '@luma.gl/shadertools';
|
|
9
|
-
|
|
10
|
-
/** Minimal ShaderModule subset, we don't need shader code etc */
|
|
11
|
-
export type ShaderModuleInputs<
|
|
12
|
-
PropsT extends Record<string, unknown> = Record<string, unknown>,
|
|
13
|
-
UniformsT extends Record<string, UniformValue> = Record<string, UniformValue>,
|
|
14
|
-
BindingsT extends Record<string, Texture | Sampler> = Record<string, Texture | Sampler>
|
|
15
|
-
> = {
|
|
16
|
-
defaultUniforms?: UniformsT;
|
|
17
|
-
getUniforms?: (settings: Partial<PropsT>, prevUniforms?: UniformsT) => UniformsT;
|
|
18
|
-
|
|
19
|
-
/** Not used. Used to access props type */
|
|
20
|
-
props?: PropsT;
|
|
21
|
-
|
|
22
|
-
bindings?: Record<
|
|
23
|
-
keyof BindingsT,
|
|
24
|
-
{
|
|
25
|
-
location: number;
|
|
26
|
-
type: 'texture' | 'sampler' | 'uniforms';
|
|
27
|
-
}
|
|
28
|
-
>;
|
|
29
|
-
|
|
30
|
-
uniformTypes?: any;
|
|
31
|
-
};
|
|
8
|
+
import {_resolveModules, ShaderModule, ShaderModuleInstance} from '@luma.gl/shadertools';
|
|
32
9
|
|
|
33
10
|
/**
|
|
34
11
|
* ShaderInputs holds uniform and binding values for one or more shader modules,
|
|
@@ -46,12 +23,12 @@ export class ShaderInputs<
|
|
|
46
23
|
* The map of modules
|
|
47
24
|
* @todo should should this include the resolved dependencies?
|
|
48
25
|
*/
|
|
49
|
-
modules: Readonly<{[P in keyof ShaderPropsT]:
|
|
26
|
+
modules: Readonly<{[P in keyof ShaderPropsT]: ShaderModule<ShaderPropsT[P]>}>;
|
|
50
27
|
|
|
51
28
|
/** Stores the uniform values for each module */
|
|
52
29
|
moduleUniforms: Record<keyof ShaderPropsT, Record<string, UniformValue>>;
|
|
53
30
|
/** Stores the uniform bindings for each module */
|
|
54
|
-
moduleBindings: Record<keyof ShaderPropsT, Record<string,
|
|
31
|
+
moduleBindings: Record<keyof ShaderPropsT, Record<string, Binding>>;
|
|
55
32
|
/** Tracks if uniforms have changed */
|
|
56
33
|
moduleUniformsChanged: Record<keyof ShaderPropsT, false | string>;
|
|
57
34
|
|
|
@@ -59,7 +36,7 @@ export class ShaderInputs<
|
|
|
59
36
|
* Create a new UniformStore instance
|
|
60
37
|
* @param modules
|
|
61
38
|
*/
|
|
62
|
-
constructor(modules: {[P in keyof ShaderPropsT]?:
|
|
39
|
+
constructor(modules: {[P in keyof ShaderPropsT]?: ShaderModule<ShaderPropsT[P], any>}) {
|
|
63
40
|
// Extract modules with dependencies
|
|
64
41
|
const resolvedModules = _resolveModules(
|
|
65
42
|
Object.values(modules).filter(module => module.dependencies)
|
|
@@ -72,9 +49,9 @@ export class ShaderInputs<
|
|
|
72
49
|
log.log(1, 'Creating ShaderInputs with modules', Object.keys(modules))();
|
|
73
50
|
|
|
74
51
|
// Store the module definitions and create storage for uniform values and binding values, per module
|
|
75
|
-
this.modules = modules as {[P in keyof ShaderPropsT]:
|
|
52
|
+
this.modules = modules as {[P in keyof ShaderPropsT]: ShaderModule<ShaderPropsT[P]>};
|
|
76
53
|
this.moduleUniforms = {} as Record<keyof ShaderPropsT, Record<string, UniformValue>>;
|
|
77
|
-
this.moduleBindings = {} as Record<keyof ShaderPropsT, Record<string,
|
|
54
|
+
this.moduleBindings = {} as Record<keyof ShaderPropsT, Record<string, Binding>>;
|
|
78
55
|
|
|
79
56
|
// Initialize the modules
|
|
80
57
|
for (const [name, module] of Object.entries(modules)) {
|
|
@@ -103,10 +80,10 @@ export class ShaderInputs<
|
|
|
103
80
|
continue; // eslint-disable-line no-continue
|
|
104
81
|
}
|
|
105
82
|
|
|
106
|
-
const oldUniforms = this.moduleUniforms[moduleName];
|
|
83
|
+
const oldUniforms = this.moduleUniforms[moduleName] as (typeof module)['uniforms'];
|
|
107
84
|
const oldBindings = this.moduleBindings[moduleName];
|
|
108
85
|
const uniformsAndBindings =
|
|
109
|
-
module.getUniforms?.(moduleProps,
|
|
86
|
+
module.getUniforms?.(moduleProps, oldUniforms) || (moduleProps as any);
|
|
110
87
|
|
|
111
88
|
const {uniforms, bindings} = splitUniformsAndBindings(uniformsAndBindings);
|
|
112
89
|
this.moduleUniforms[moduleName] = {...oldUniforms, ...uniforms};
|
|
@@ -136,8 +113,8 @@ export class ShaderInputs<
|
|
|
136
113
|
}
|
|
137
114
|
|
|
138
115
|
/** Merges all bindings for the shader (from the various modules) */
|
|
139
|
-
getBindings(): Record<string,
|
|
140
|
-
const bindings = {} as Record<string,
|
|
116
|
+
getBindings(): Record<string, Binding> {
|
|
117
|
+
const bindings = {} as Record<string, Binding>;
|
|
141
118
|
for (const moduleBindings of Object.values(this.moduleBindings)) {
|
|
142
119
|
Object.assign(bindings, moduleBindings);
|
|
143
120
|
}
|
|
@@ -149,7 +126,7 @@ export class ShaderInputs<
|
|
|
149
126
|
for (const [moduleName, module] of Object.entries(this.moduleUniforms)) {
|
|
150
127
|
for (const [key, value] of Object.entries(module)) {
|
|
151
128
|
table[`${moduleName}.${key}`] = {
|
|
152
|
-
type: this.modules[moduleName].uniformTypes?.[key],
|
|
129
|
+
type: this.modules[moduleName].uniformTypes?.[key as keyof ShaderPropsT],
|
|
153
130
|
value: String(value)
|
|
154
131
|
};
|
|
155
132
|
}
|