@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.
- package/dist/dist.dev.js +787 -195
- package/dist/dist.min.js +79 -79
- package/dist/index.cjs +18 -2854
- package/dist/index.cjs.map +4 -4
- package/dist/lib/shader-module/shader-module.d.ts +22 -13
- package/dist/lib/shader-module/shader-module.d.ts.map +1 -1
- package/dist/lib/shader-module/shader-pass.d.ts +4 -2
- package/dist/lib/shader-module/shader-pass.d.ts.map +1 -1
- package/dist/lib/utils/uniform-types.d.ts +49 -0
- package/dist/lib/utils/uniform-types.d.ts.map +1 -0
- package/dist/lib/utils/uniform-types.js +1 -0
- package/dist/lib/wgsl/get-shader-layout-wgsl.js +5 -5
- package/dist/modules/engine/picking/picking.d.ts +5 -5
- package/dist/modules/engine/picking/picking.d.ts.map +1 -1
- package/dist/modules/engine/picking/picking.js +2 -2
- package/dist/modules/engine/project/project.d.ts +9 -8
- package/dist/modules/engine/project/project.d.ts.map +1 -1
- package/dist/modules/lighting/lights/lighting-uniforms.d.ts +13 -13
- package/dist/modules/lighting/lights/lighting-uniforms.d.ts.map +1 -1
- package/dist/modules/lighting/no-material/dirlight.d.ts +2 -2
- package/dist/modules/lighting/no-material/dirlight.d.ts.map +1 -1
- package/dist/modules/lighting/no-material/dirlight.js +1 -1
- package/dist/modules/lighting/pbr-material/pbr-material.d.ts +14 -13
- package/dist/modules/lighting/pbr-material/pbr-material.d.ts.map +1 -1
- package/dist/modules/lighting/pbr-material/pbr-material.js +0 -11
- package/dist/modules/postprocessing/image-blur-filters/tiltshift.d.ts +2 -2
- package/dist/modules/postprocessing/image-blur-filters/tiltshift.d.ts.map +1 -1
- package/dist/modules/postprocessing/image-blur-filters/triangleblur.d.ts +1 -1
- package/dist/modules/postprocessing/image-blur-filters/triangleblur.d.ts.map +1 -1
- package/dist/modules/postprocessing/image-blur-filters/zoomblur.d.ts +1 -1
- package/dist/modules/postprocessing/image-blur-filters/zoomblur.d.ts.map +1 -1
- package/dist/modules/postprocessing/image-fun-filters/colorhalftone.d.ts +1 -1
- package/dist/modules/postprocessing/image-fun-filters/colorhalftone.d.ts.map +1 -1
- package/dist/modules/postprocessing/image-fun-filters/dotscreen.d.ts +1 -1
- package/dist/modules/postprocessing/image-fun-filters/dotscreen.d.ts.map +1 -1
- package/dist/modules/postprocessing/image-fun-filters/hexagonalpixelate.d.ts +1 -1
- package/dist/modules/postprocessing/image-fun-filters/hexagonalpixelate.d.ts.map +1 -1
- package/dist/modules/postprocessing/image-fun-filters/magnify.d.ts +2 -2
- package/dist/modules/postprocessing/image-fun-filters/magnify.d.ts.map +1 -1
- package/dist/modules/postprocessing/image-warp-filters/bulgepinch.d.ts +1 -1
- package/dist/modules/postprocessing/image-warp-filters/bulgepinch.d.ts.map +1 -1
- package/dist/modules-webgl1/project/project.d.ts +6 -4
- package/dist/modules-webgl1/project/project.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/lib/shader-module/shader-module.ts +24 -12
- package/src/lib/shader-module/shader-pass.ts +7 -4
- package/src/lib/utils/uniform-types.ts +91 -0
- package/src/lib/wgsl/get-shader-layout-wgsl.ts +5 -5
- package/src/modules/engine/picking/picking.ts +9 -9
- package/src/modules/engine/project/project.ts +10 -9
- package/src/modules/lighting/lights/lighting-uniforms.ts +16 -16
- package/src/modules/lighting/no-material/dirlight.ts +3 -3
- package/src/modules/lighting/pbr-material/pbr-material.ts +14 -24
- package/src/modules/postprocessing/image-blur-filters/tiltshift.ts +2 -2
- package/src/modules/postprocessing/image-blur-filters/triangleblur.ts +1 -1
- package/src/modules/postprocessing/image-blur-filters/zoomblur.ts +1 -1
- package/src/modules/postprocessing/image-fun-filters/colorhalftone.ts +1 -1
- package/src/modules/postprocessing/image-fun-filters/dotscreen.ts +1 -1
- package/src/modules/postprocessing/image-fun-filters/hexagonalpixelate.ts +1 -1
- package/src/modules/postprocessing/image-fun-filters/magnify.ts +2 -2
- package/src/modules/postprocessing/image-warp-filters/bulgepinch.ts +1 -1
- package/src/modules-webgl1/project/project.ts +8 -7
- package/dist/libs/wgsl-reflect/wgsl_reflect.module.d.ts +0 -1112
- package/dist/libs/wgsl-reflect/wgsl_reflect.module.d.ts.map +0 -1
- package/dist/libs/wgsl-reflect/wgsl_reflect.module.js +0 -3389
- package/src/libs/wgsl-reflect/wgsl_reflect.module.js +0 -3394
- package/src/libs/wgsl-reflect/wgsl_reflect.module.js.map +0 -1
|
@@ -33,7 +33,7 @@ vec4 magnify_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
33
33
|
*/
|
|
34
34
|
export type MagnifyProps = {
|
|
35
35
|
/** 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]`. */
|
|
36
|
-
screenXY?: number
|
|
36
|
+
screenXY?: [number, number];
|
|
37
37
|
/** effect radius in pixels. Default value is `100`. */
|
|
38
38
|
radiusPixels?: number;
|
|
39
39
|
/** magnify level. Default value is `2`. */
|
|
@@ -41,7 +41,7 @@ export type MagnifyProps = {
|
|
|
41
41
|
/** border width of the effect circle, will not show border if value <= 0.0. Default value is `0`. */
|
|
42
42
|
borderWidthPixels?: number;
|
|
43
43
|
/** border color of the effect circle. Default value is `[255, 255, 255, 255]`. */
|
|
44
|
-
borderColor?: number
|
|
44
|
+
borderColor?: [number, number, number, number];
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
/**
|
|
@@ -39,7 +39,7 @@ vec4 bulgePinch_sampleColor(sampler2D source, vec2 texSize, vec2 texCoord) {
|
|
|
39
39
|
/** Bulges or pinches the image in a circle. */
|
|
40
40
|
export type BulgePinchProps = {
|
|
41
41
|
/** The [x, y] coordinates of the center of the circle of effect. */
|
|
42
|
-
center?: number
|
|
42
|
+
center?: [number, number];
|
|
43
43
|
/** The radius of the circle of effect. */
|
|
44
44
|
radius?: number;
|
|
45
45
|
/** strength -1 to 1 (-1 is strong pinch, 0 is no effect, 1 is strong bulge) */
|
|
@@ -2,20 +2,21 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {Matrix4} from '@math.gl/core';
|
|
5
|
+
import {Vector3, Matrix4} from '@math.gl/core';
|
|
6
6
|
import {glsl} from '../../lib/glsl-utils/highlight';
|
|
7
7
|
import {ShaderModule} from '../../lib/shader-module/shader-module';
|
|
8
|
+
import type {NumberArray3, NumberArray16} from '../../lib/utils/uniform-types';
|
|
8
9
|
|
|
9
10
|
type ProjectionProps = {
|
|
10
|
-
modelMatrix?:
|
|
11
|
-
viewMatrix?:
|
|
12
|
-
projectionMatrix?:
|
|
13
|
-
cameraPositionWorld?:
|
|
11
|
+
modelMatrix?: Readonly<Matrix4 | NumberArray16>;
|
|
12
|
+
viewMatrix?: Readonly<Matrix4 | NumberArray16>;
|
|
13
|
+
projectionMatrix?: Readonly<Matrix4 | NumberArray16>;
|
|
14
|
+
cameraPositionWorld?: Readonly<Vector3 | NumberArray3>;
|
|
14
15
|
};
|
|
15
16
|
|
|
16
|
-
const IDENTITY_MATRIX = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
|
|
17
|
+
const IDENTITY_MATRIX: NumberArray16 = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
|
|
17
18
|
|
|
18
|
-
const DEFAULT_MODULE_OPTIONS = {
|
|
19
|
+
const DEFAULT_MODULE_OPTIONS: ProjectionProps = {
|
|
19
20
|
modelMatrix: IDENTITY_MATRIX,
|
|
20
21
|
viewMatrix: IDENTITY_MATRIX,
|
|
21
22
|
projectionMatrix: IDENTITY_MATRIX,
|