@luma.gl/shadertools 9.0.12 → 9.0.15
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.
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { NumberArray } from '@math.gl/types';
|
|
2
3
|
import { UniformFormat } from "../../types.js";
|
|
3
4
|
import { PropType } from "../filters/prop-types.js";
|
|
5
|
+
import { Sampler, Texture } from '@luma.gl/core';
|
|
4
6
|
export type UniformValue = number | boolean | Readonly<NumberArray>;
|
|
5
7
|
export type UniformInfo = {
|
|
6
8
|
format?: UniformFormat;
|
|
@@ -9,7 +11,7 @@ export type UniformInfo = {
|
|
|
9
11
|
* A shader module definition object
|
|
10
12
|
* @note Can be viewed as the ShaderModuleProps for a ShaderModuleInstance
|
|
11
13
|
*/
|
|
12
|
-
export type ShaderModule<PropsT extends Record<string, unknown> = Record<string, unknown>, UniformsT extends Record<string, UniformValue> = Record<string, UniformValue>, BindingsT extends Record<string,
|
|
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> = {}> = {
|
|
13
15
|
/** Used for type inference not for values */
|
|
14
16
|
props?: Required<PropsT>;
|
|
15
17
|
/** Used for type inference, not currently used for values */
|
|
@@ -23,8 +25,8 @@ export type ShaderModule<PropsT extends Record<string, unknown> = Record<string,
|
|
|
23
25
|
uniformPropTypes?: Record<keyof UniformsT, UniformInfo>;
|
|
24
26
|
/** Default uniform values */
|
|
25
27
|
defaultUniforms?: Required<UniformsT>;
|
|
26
|
-
/** Function that maps
|
|
27
|
-
getUniforms?: (
|
|
28
|
+
/** Function that maps props to uniforms & bindings */
|
|
29
|
+
getUniforms?: (props?: any, oldProps?: any) => Record<string, UniformValue>;
|
|
28
30
|
/** uniform buffers, textures, samplers, storage, ... */
|
|
29
31
|
bindings?: Record<keyof BindingsT, {
|
|
30
32
|
location: number;
|
|
@@ -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,EAAC,uBAAoB;AAC1C,OAAO,EAAC,QAAQ,EAAC,iCAA8B;AAE/C,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;AAEpE,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB,GAAG,QAAQ,CAAC;AAEb;;;GAGG;AACH,MAAM,MAAM,YAAY,CACtB,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,EAC7E,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,
|
|
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,EAAC,uBAAoB;AAC1C,OAAO,EAAC,QAAQ,EAAC,iCAA8B;AAC/C,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAE/C,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;AAEpE,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB,GAAG,QAAQ,CAAC;AAEb;;;GAGG;AACH,M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AC,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luma.gl/shadertools",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.15",
|
|
4
4
|
"description": "Shader module system for luma.gl",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"@math.gl/core": "^4.0.0",
|
|
53
53
|
"@math.gl/types": "^4.0.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "48b6e702cf6ad35748cfa88ffd249c17861ff2af"
|
|
56
56
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import {NumberArray} from '@math.gl/types';
|
|
6
6
|
import {UniformFormat} from '../../types';
|
|
7
7
|
import {PropType} from '../filters/prop-types';
|
|
8
|
+
import {Sampler, Texture} from '@luma.gl/core';
|
|
8
9
|
|
|
9
10
|
export type UniformValue = number | boolean | Readonly<NumberArray>; // Float32Array> | Readonly<Int32Array> | Readonly<Uint32Array> | Readonly<number[]>;
|
|
10
11
|
|
|
@@ -19,7 +20,7 @@ export type UniformInfo = {
|
|
|
19
20
|
export type ShaderModule<
|
|
20
21
|
PropsT extends Record<string, unknown> = Record<string, unknown>,
|
|
21
22
|
UniformsT extends Record<string, UniformValue> = Record<string, UniformValue>,
|
|
22
|
-
BindingsT extends Record<string,
|
|
23
|
+
BindingsT extends Record<string, Buffer | Texture | Sampler> = {}
|
|
23
24
|
> = {
|
|
24
25
|
/** Used for type inference not for values */
|
|
25
26
|
props?: Required<PropsT>;
|
|
@@ -37,9 +38,8 @@ export type ShaderModule<
|
|
|
37
38
|
/** Default uniform values */
|
|
38
39
|
defaultUniforms?: Required<UniformsT>; // Record<keyof UniformsT, UniformValue>;
|
|
39
40
|
|
|
40
|
-
/** Function that maps
|
|
41
|
-
|
|
42
|
-
getUniforms?: (settings?: any, prevUniforms?: any) => Record<string, UniformValue>;
|
|
41
|
+
/** Function that maps props to uniforms & bindings */
|
|
42
|
+
getUniforms?: (props?: any, oldProps?: any) => Record<string, UniformValue>;
|
|
43
43
|
|
|
44
44
|
/** uniform buffers, textures, samplers, storage, ... */
|
|
45
45
|
bindings?: Record<keyof BindingsT, {location: number; type: 'texture' | 'sampler' | 'uniforms'}>;
|