@protomaze/geometry 0.3.1 → 0.3.2

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,5 +1,6 @@
1
1
  import type { Mesh } from 'three/webgpu';
2
2
  import { Matrix4, Vector2, Vector3 } from 'three/webgpu';
3
+ import type { Uniform } from '../three/Tsl';
3
4
  /**
4
5
  * What drawing in pixels or metres needs to know about the frame being drawn. An engine fills it
5
6
  * in before every frame and hands it to each primitive's `setFrame`.
@@ -33,12 +34,12 @@ export interface GeometryFrame {
33
34
  * top-left, for whatever looks things up by frame pixel (`screenCoordinate` there is the
34
35
  * target's). Pixel sizes come from `frameSize`, never from `viewport`, which is the target's.
35
36
  */
36
- export declare function pickPassUniforms(): {
37
- window: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<Matrix4>>;
38
- origin: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<Vector2>>;
39
- frameSize: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<Vector2>>;
40
- };
41
- export type PickPass = ReturnType<typeof pickPassUniforms>;
37
+ export declare function pickPassUniforms(): PickPass;
38
+ export interface PickPass {
39
+ window: Uniform<Matrix4>;
40
+ origin: Uniform<Vector2>;
41
+ frameSize: Uniform<Vector2>;
42
+ }
42
43
  /** What a primitive needs to be drawn into a pick pass: the pass, and the id it writes. */
43
44
  export interface PickOptions {
44
45
  pass: PickPass;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protomaze/geometry",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Protomaze Geometry: GPU points, lines, tubes and areas in 2D and 3D, styled, filtered, highlighted and picked on the GPU",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,5 +1,6 @@
1
1
  import { Mesh, RenderTarget, Scene } from 'three/webgpu';
2
2
  import { ColorRamp } from '../common/Colors';
3
+ import { Uniform } from './Tsl';
3
4
  /**
4
5
  * The heatmap: whatever is in `scene` adds its weight into a half-float target the frame's size,
5
6
  * and one full-screen pass (`quad`, in the engine's scene, over everything) colours each pixel's
@@ -13,15 +14,15 @@ export declare class DensityMap {
13
14
  private readonly colors;
14
15
  private colorMap;
15
16
  /** The sum that takes the top colour. */
16
- readonly top: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
17
+ readonly top: Uniform<number>;
17
18
  /** The whole map's opacity. */
18
- readonly opacity: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
19
+ readonly opacity: Uniform<number>;
19
20
  constructor(ramp?: ColorRamp);
20
21
  /**
21
22
  * The colours to colour the sum with: a ramp from 0 to `top`, or a colour map with
22
23
  * `retrieveColor`, read from 0 to `top` as it is. Read again only when given another.
23
24
  */
24
- setColorMap(colorMap: ColorRamp, top?: number): void;
25
+ setColorMap(colorMap: ColorRamp, top?: any): void;
25
26
  /** Whether anything adds to the map this frame; the colouring pass is shown only then. */
26
27
  update(): boolean;
27
28
  /** Sums this frame's weights into the target, through `draw`, the engine's draw into a target. */
@@ -1,6 +1,6 @@
1
1
  import { DataTexture } from 'three/webgpu';
2
2
  import { ColorLike, ColorRamp } from '../common/Colors';
3
- import { N } from './Tsl';
3
+ import { N, Uniform } from './Tsl';
4
4
  /**
5
5
  * How a feature is drawn, from strongest to weakest: depth and the selection's glow follow it.
6
6
  */
@@ -116,30 +116,30 @@ export declare class FeatureLook {
116
116
  readonly categories: DataTexture;
117
117
  readonly ramp: DataTexture;
118
118
  /** 1 while a range is applied: the GPU then decides pass or fail per feature. */
119
- readonly rangeActive: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
120
- readonly rangeLow: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
121
- readonly rangeHigh: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
119
+ readonly rangeActive: Uniform<number>;
120
+ readonly rangeLow: Uniform<number>;
121
+ readonly rangeHigh: Uniform<number>;
122
122
  /** What a feature out of the range becomes: 0 its fail look (`setFail`), 1 hidden, 2 faded. */
123
- readonly rangeOutside: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
123
+ readonly rangeOutside: Uniform<number>;
124
124
  /** The feature pointed at, -1 for none: drawn lit while `hoverLights`. */
125
- readonly hoverIndex: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
126
- readonly hoverLights: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
125
+ readonly hoverIndex: Uniform<number>;
126
+ readonly hoverLights: Uniform<number>;
127
127
  /** 1 while the category table applies. */
128
- readonly categoryActive: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
128
+ readonly categoryActive: Uniform<number>;
129
129
  /** 0 each feature's own colour, 1 its category's, 2 its `colorValue` through the ramp. */
130
- readonly colorMode: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
131
- readonly rampLow: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
132
- readonly rampHigh: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
130
+ readonly colorMode: Uniform<number>;
131
+ readonly rampLow: Uniform<number>;
132
+ readonly rampHigh: Uniform<number>;
133
133
  /** What the GPU's filters fade: this much of its alpha left, this much towards grey. */
134
- readonly fadeOpacity: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
135
- readonly fadeDesaturate: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
134
+ readonly fadeOpacity: Uniform<number>;
135
+ readonly fadeDesaturate: Uniform<number>;
136
136
  /** How bright the plain ones are while something is lit, 0 to 1, and towards what (0 black, 1 white). */
137
- readonly othersShade: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
137
+ readonly othersShade: Uniform<number>;
138
138
  /** How opaque a lit feature is whose own style or the GPU's filters fade or hide it, 0 to 1. */
139
- readonly outsideOpacity: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
140
- readonly othersToward: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
139
+ readonly outsideOpacity: Uniform<number>;
140
+ readonly othersToward: Uniform<number>;
141
141
  /** The whole set's opacity. */
142
- readonly opacity: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
142
+ readonly opacity: Uniform<number>;
143
143
  private dirty;
144
144
  /** How many features the look has room for: its textures' whole rows. */
145
145
  get capacity(): number;
package/three/Ground.d.ts CHANGED
@@ -1,5 +1,6 @@
1
+ import type { Color } from 'three/webgpu';
1
2
  import { Mesh, Vector3 } from 'three/webgpu';
2
- import { N } from './Tsl';
3
+ import { N, Uniform } from './Tsl';
3
4
  export interface GroundOptions {
4
5
  /** Where the picture lies, in world units: min x, min y, max x, max y. The ground reaches far past it. */
5
6
  bounds: [number, number, number, number];
@@ -30,13 +31,13 @@ export declare class Ground {
30
31
  readonly options: GroundOptions;
31
32
  readonly mesh: Mesh;
32
33
  private texture;
33
- readonly color: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<import("three/webgpu").Color>>;
34
- readonly gridColor: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<Vector3>>;
35
- readonly gridOpacity: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
34
+ readonly color: Uniform<Color>;
35
+ readonly gridColor: Uniform<Vector3>;
36
+ readonly gridOpacity: Uniform<number>;
36
37
  /** The haze the ground fades into with distance, and where it starts and is whole. */
37
38
  readonly fogColor: N;
38
- readonly fogNear: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
39
- readonly fogFar: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
39
+ readonly fogNear: Uniform<number>;
40
+ readonly fogFar: Uniform<number>;
40
41
  /** The camera relative to the origin. */
41
42
  readonly eye: N;
42
43
  /** The plane's middle relative to the origin. */
package/three/Halo.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Mesh, RenderTarget, Scene } from 'three/webgpu';
2
+ import { Uniform } from './Tsl';
2
3
  /**
3
4
  * The dark halo round what is seen through the scene's surface - pipes under the street: their
4
5
  * silhouettes where the surface hides them (the bodies' `window` pass, in `scene`), drawn into a
@@ -14,8 +15,8 @@ export declare class Halo {
14
15
  readonly quad: Mesh;
15
16
  readonly target: RenderTarget<import("three/webgpu").Texture>;
16
17
  /** How far the blur reaches, in frame pixels, and how dark the halo is at most. */
17
- readonly blur: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
18
- readonly strength: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
18
+ readonly blur: Uniform<number>;
19
+ readonly strength: Uniform<number>;
19
20
  constructor();
20
21
  /** Whether any silhouette is drawn this frame. */
21
22
  get active(): boolean;
@@ -1,4 +1,5 @@
1
1
  import { Vector3 } from 'three/webgpu';
2
+ import { Uniform } from './Tsl';
2
3
  import { N } from './Tsl';
3
4
  /**
4
5
  * The finishes bodies are painted in, by `materialCode`, the first for any other; the colour is
@@ -21,13 +22,13 @@ export declare function materialCode(value: unknown): number;
21
22
  * to the origin, set each frame.
22
23
  */
23
24
  export declare class Lighting {
24
- readonly up: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<Vector3>>;
25
- readonly sun: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<Vector3>>;
26
- readonly eye: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<Vector3>>;
25
+ readonly up: Uniform<Vector3>;
26
+ readonly sun: Uniform<Vector3>;
27
+ readonly eye: Uniform<Vector3>;
27
28
  /** How bright the sky is from below and from above, and the sun on top of it. */
28
- readonly ambient: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
29
- readonly skyGain: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
30
- readonly sunGain: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
29
+ readonly ambient: Uniform<number>;
30
+ readonly skyGain: Uniform<number>;
31
+ readonly sunGain: Uniform<number>;
31
32
  /** Every material's shininess and sheen, a texel each. */
32
33
  readonly materials: import("three/webgpu").DataTexture;
33
34
  constructor();
package/three/Sky.d.ts CHANGED
@@ -1,4 +1,6 @@
1
+ import type { Color } from 'three/webgpu';
1
2
  import { Mesh, Vector3 } from 'three/webgpu';
3
+ import { Uniform } from './Tsl';
2
4
  /**
3
5
  * The sky behind a view in perspective: dark overhead, lighter towards the horizon, with a faint
4
6
  * glow just above it - each pixel's colour from the direction it looks in, the view's own
@@ -7,14 +9,14 @@ import { Mesh, Vector3 } from 'three/webgpu';
7
9
  */
8
10
  export declare class Sky {
9
11
  readonly mesh: Mesh;
10
- readonly zenith: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<import("three/webgpu").Color>>;
11
- readonly horizon: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<import("three/webgpu").Color>>;
12
- readonly glow: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<import("three/webgpu").Color>>;
12
+ readonly zenith: Uniform<Color>;
13
+ readonly horizon: Uniform<Color>;
14
+ readonly glow: Uniform<Color>;
13
15
  /** What a view looking down past the ground sees. */
14
- readonly below: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<import("three/webgpu").Color>>;
16
+ readonly below: Uniform<Color>;
15
17
  /** The camera relative to the origin, and the ground's up. */
16
- readonly eye: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<Vector3>>;
17
- readonly up: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<Vector3>>;
18
+ readonly eye: Uniform<Vector3>;
19
+ readonly up: Uniform<Vector3>;
18
20
  constructor();
19
21
  setColors(colors: {
20
22
  zenith: string;
package/three/Tsl.d.ts CHANGED
@@ -4,6 +4,14 @@ import { BufferGeometry, Color, DataTexture, InstancedBufferGeometry, Mesh, Mesh
4
4
  * to release, and the package runs on three 0.178 and later.
5
5
  */
6
6
  export type N = any;
7
+ /**
8
+ * A uniform as the package hands it out: its `value`, to set from outside; inside, a TSL node to
9
+ * build shaders with. Typed by its value alone - the node itself as loosely as `N` - so that the
10
+ * package's declarations hold under any @types/three: its node types change from release to release.
11
+ */
12
+ export type Uniform<T> = {
13
+ value: T;
14
+ } & N;
7
15
  /** The width of every per-feature texture: feature `i` is texel `(i % 1024, i / 1024)`. */
8
16
  export declare const TEXTURE_WIDTH = 1024;
9
17
  /** Texel of feature `index` (an int node) in a per-feature texture. */
@@ -14,7 +22,7 @@ export declare function featureTexture(data: Float32Array, rows: number): DataTe
14
22
  export declare function rowTexture(data: Float32Array, linear?: boolean): DataTexture;
15
23
  export declare function rowsFor(count: number): number;
16
24
  /** A vertex that is not drawn: outside clip space, so its triangles are clipped away whole. */
17
- export declare const GONE: () => import("three/tsl").ShaderNodeObject<import("three/webgpu").ConstNode<import("three/webgpu").Vector4>>;
25
+ export declare const GONE: () => N;
18
26
  /** Makes a material add what it draws into the target: a weight into the density sum. */
19
27
  export declare function additive(material: MeshBasicNodeMaterial): void;
20
28
  /**
@@ -2,7 +2,7 @@ import { Texture, Vector3 } from 'three/webgpu';
2
2
  import { GeometryOccluder, PickOptions } from '../../engine/GeometryFrame';
3
3
  import { FeatureLook } from '../FeatureLook';
4
4
  import { Lighting } from '../Shading';
5
- import { N } from '../Tsl';
5
+ import { N, Uniform } from '../Tsl';
6
6
  /**
7
7
  * The passes a body - a tube, a sphere - is drawn in: `solid` itself, `window` its silhouette
8
8
  * where the scene's surface hides it, into the halo's mask, `bloom` the selected ones alone,
@@ -39,37 +39,30 @@ export interface BodyOptions {
39
39
  lighting?: Lighting;
40
40
  }
41
41
  /** The uniforms every body shares. */
42
- export declare function bodyUniforms(): {
42
+ export interface BodyUniforms {
43
43
  /** Frame pixels per world unit at one unit from the camera. */
44
- focal: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
44
+ focal: Uniform<number>;
45
45
  /** Frame pixels per view pixel. */
46
- pixelRatio: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
46
+ pixelRatio: Uniform<number>;
47
47
  /** 1 on a flat (orthographic) map, where a pixel is `1 / pxPerWorld` everywhere. */
48
- orthographic: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
49
- pxPerWorld: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
48
+ orthographic: Uniform<number>;
49
+ pxPerWorld: Uniform<number>;
50
50
  /** How much of a body shows where the scene's surface is in front of it. */
51
- ghostAlpha: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
51
+ ghostAlpha: Uniform<number>;
52
52
  /** And how much lighter it is drawn there, so it reads as seen through something. */
53
- ghostLighten: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
53
+ ghostLighten: Uniform<number>;
54
54
  /** The outline look's colour and width (view pixels). */
55
- outlineRgb: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<Vector3>>;
56
- outlineWidth: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
55
+ outlineRgb: Uniform<Vector3>;
56
+ outlineWidth: Uniform<number>;
57
57
  /** How much a selected body is lit towards white. */
58
- litMix: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
59
- };
60
- export type BodyUniforms = ReturnType<typeof bodyUniforms>;
58
+ litMix: Uniform<number>;
59
+ }
60
+ export declare function bodyUniforms(): BodyUniforms;
61
61
  /**
62
62
  * What a body's vertex shader hands its fragment: colour and alpha, normal, distance from the
63
63
  * camera, position relative to the origin, material and selection, index.
64
64
  */
65
- export declare function bodyVaryings(): {
66
- vColor: import("three/tsl").ShaderNodeObject<import("three/webgpu").PropertyNode>;
67
- vNormal: import("three/tsl").ShaderNodeObject<import("three/webgpu").PropertyNode>;
68
- vDistance: import("three/tsl").ShaderNodeObject<import("three/webgpu").PropertyNode>;
69
- vPosition: import("three/tsl").ShaderNodeObject<import("three/webgpu").PropertyNode>;
70
- vMaterial: import("three/tsl").ShaderNodeObject<import("three/webgpu").PropertyNode>;
71
- vIndex: import("three/tsl").ShaderNodeObject<import("three/webgpu").PropertyNode>;
72
- };
65
+ export declare function bodyVaryings(): Record<'vColor' | 'vNormal' | 'vDistance' | 'vPosition' | 'vMaterial' | 'vIndex', N>;
73
66
  /** A world unit's worth of pixels at clip w `w`: what a size in view pixels is in world units. */
74
67
  export declare function pixelSize(u: BodyUniforms, w: N): N;
75
68
  /** How a body is blended and depth-tested in each pass. */
@@ -79,4 +72,4 @@ export declare function bodyMaterial(pass: BodyPass): import("three/webgpu").Mes
79
72
  * the scene's surface hides it, for the halo; its colour for the bloom; or painted in its
80
73
  * material, ghosted where the surface is in front - and nothing where an occluder hides it.
81
74
  */
82
- export declare function bodyFragment(pass: BodyPass, options: BodyOptions, u: BodyUniforms, lighting: Lighting): import("three/tsl").ShaderNodeObject<import("three/src/nodes/TSL.js").ShaderCallNodeInternal>;
75
+ export declare function bodyFragment(pass: BodyPass, options: BodyOptions, u: BodyUniforms, lighting: Lighting): N;
@@ -2,6 +2,7 @@ import { Mesh, Vector3 } from 'three/webgpu';
2
2
  import { GeometryFrame, GeometryPasses, GeometryPrimitive, PickOptions } from '../../engine/GeometryFrame';
3
3
  import { FeatureLook } from '../FeatureLook';
4
4
  import { Lighting } from '../Shading';
5
+ import { Uniform } from '../Tsl';
5
6
  /** One area: its rings, the outer first and holes after, relative to the engine's origin. */
6
7
  export interface GpuArea {
7
8
  rings: readonly (readonly (readonly number[])[])[];
@@ -45,22 +46,22 @@ export declare class GpuAreas implements GeometryPrimitive {
45
46
  readonly look: FeatureLook;
46
47
  readonly lighting: Lighting;
47
48
  triangles: number;
48
- readonly pixelRatio: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
49
+ readonly pixelRatio: Uniform<number>;
49
50
  /** Hatching: the stripes' spacing and width, in view pixels. */
50
- readonly hatch: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<Vector3>>;
51
+ readonly hatch: Uniform<Vector3>;
51
52
  /** A volume's walls darker towards their foot over this height, as if the ground shaded them. */
52
- readonly footShade: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
53
+ readonly footShade: Uniform<number>;
53
54
  /** How much a selected area is lit towards white. */
54
- readonly litMix: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
55
+ readonly litMix: Uniform<number>;
55
56
  /**
56
57
  * Windows on a volume's walls, a grid of them a storey high: lit, this much of them, in
57
58
  * `windowRgb` - a city at night - or 0 for dark glass only.
58
59
  */
59
- readonly windows: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
60
- readonly windowsLit: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
61
- readonly windowRgb: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<Vector3>>;
60
+ readonly windows: Uniform<number>;
61
+ readonly windowsLit: Uniform<number>;
62
+ readonly windowRgb: Uniform<Vector3>;
62
63
  /** The windows' grid: width and height of a bay, in world units. */
63
- readonly windowGrid: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<Vector3>>;
64
+ readonly windowGrid: Uniform<Vector3>;
64
65
  private readonly up;
65
66
  constructor(areas: GpuArea[], options?: GpuAreasOptions);
66
67
  passes(): GeometryPasses;
@@ -1,6 +1,7 @@
1
1
  import { CanvasTexture, Mesh, Texture, Vector3 } from 'three/webgpu';
2
2
  import { GeometryFrame, GeometryPasses, GeometryPrimitive, PickOptions } from '../../engine/GeometryFrame';
3
3
  import { FeatureLook } from '../FeatureLook';
4
+ import { Uniform } from '../Tsl';
4
5
  /**
5
6
  * An icon to draw: where, relative to the engine's origin, and its cell in the atlas - or a
6
7
  * negative `IconShape`, drawn in the shader.
@@ -84,17 +85,17 @@ export declare class GpuIcons implements GeometryPrimitive {
84
85
  private readonly perspective;
85
86
  private readonly focal;
86
87
  /** 1 for the outline look: a selected one's rim in `rimRgb`, not lit to white. */
87
- readonly outlineMode: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
88
+ readonly outlineMode: Uniform<number>;
88
89
  /** The rim's colour: near white on a dark map, ink on a light one. */
89
- readonly rimRgb: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<Vector3>>;
90
+ readonly rimRgb: Uniform<Vector3>;
90
91
  /** How much bigger a lit icon is drawn. */
91
- readonly litScale: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
92
+ readonly litScale: Uniform<number>;
92
93
  private readonly up;
93
94
  constructor(icons: GpuIcon[], atlas: CanvasTexture | Texture | null, size: number, pickOrOptions?: PickOptions | GpuIconsOptions);
94
95
  private readonly options;
95
96
  /** How bright the icons that are not lit are while something is: see `FeatureLook.othersShade`. */
96
- get othersShade(): import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
97
- get othersToward(): import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
97
+ get othersShade(): any;
98
+ get othersToward(): any;
98
99
  passes(): GeometryPasses;
99
100
  setFrame(frame: GeometryFrame): void;
100
101
  /**
@@ -1,6 +1,7 @@
1
1
  import { Mesh, Vector2, Vector3 } from 'three/webgpu';
2
2
  import { GeometryFrame, GeometryOccluder, GeometryPasses, GeometryPrimitive, PickOptions } from '../../engine/GeometryFrame';
3
3
  import { FeatureLook, FeatureState } from '../FeatureLook';
4
+ import { Uniform } from '../Tsl';
4
5
  /** The outline look's white (#EBE8E0), as the shader takes it. */
5
6
  export declare const OUTLINE_RGB: [number, number, number];
6
7
  /** How one feature's line is drawn, written into the shared look. */
@@ -107,52 +108,52 @@ export declare class GpuLines implements GeometryPrimitive {
107
108
  /** How many features: each its own depth on a 2D map. */
108
109
  private readonly featureCount;
109
110
  /** Pixels per world unit at the view, per frame. */
110
- readonly pxPerWorld: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
111
+ readonly pxPerWorld: Uniform<number>;
111
112
  /** Frame pixels per view pixel. */
112
- readonly pixelRatio: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
113
+ readonly pixelRatio: Uniform<number>;
113
114
  /** Where the layer stands among the line layers, 0 lowest; decides which is nearer. */
114
- readonly rank: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
115
+ readonly rank: Uniform<number>;
115
116
  /**
116
117
  * How a selected line is set off: 0 nothing (the bloom pass does it), 1 a glow drawn in the
117
118
  * fragment shader, 2 an outline round it (`casingMesh`).
118
119
  */
119
- readonly glowMode: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
120
+ readonly glowMode: Uniform<number>;
120
121
  /** The outline's colour: white on a dark map, ink on a light one. */
121
- readonly outlineRgb: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<Vector3>>;
122
+ readonly outlineRgb: Uniform<Vector3>;
122
123
  /** The outline's width, in view pixels, past the line on either side. */
123
- readonly outlineWidth: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
124
+ readonly outlineWidth: Uniform<number>;
124
125
  /** The glow's reach, in view pixels, past a selected line. */
125
- readonly glowWidth: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
126
+ readonly glowWidth: Uniform<number>;
126
127
  /** On the ground and in space: frame pixels per world unit at one unit from the camera. */
127
- readonly focal: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
128
+ readonly focal: Uniform<number>;
128
129
  /** The camera's near plane: in space, an end behind it is pulled in front. */
129
- readonly near: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
130
+ readonly near: Uniform<number>;
130
131
  /**
131
132
  * World units per metre on the ground, for real widths and ends: 1 / cos(latitude) on a web
132
133
  * mercator map, where a world unit shrinks away from the equator; 1 elsewhere.
133
134
  */
134
- readonly worldPerMetre: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
135
+ readonly worldPerMetre: Uniform<number>;
135
136
  /**
136
137
  * 1 while the symbols at the lines' ends are drawn, 0 when they are not: the lines then run on
137
138
  * to their ends rather than stopping short of nothing.
138
139
  */
139
- readonly endsShown: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
140
+ readonly endsShown: Uniform<number>;
140
141
  /** A dashed line's dash and gap, in view pixels. */
141
- readonly dash: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<Vector2>>;
142
+ readonly dash: Uniform<Vector2>;
142
143
  /** Flowing lines: pulses this far apart, in view pixels, moving at this many a second. */
143
- readonly flowSpacing: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
144
- readonly flowSpeed: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
145
- readonly time: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
144
+ readonly flowSpacing: Uniform<number>;
145
+ readonly flowSpeed: Uniform<number>;
146
+ readonly time: Uniform<number>;
146
147
  private readonly up;
147
148
  /** One entry per feature: its parts, usually one polyline, several for a multi-line. */
148
149
  constructor(features: LinePath[][], options?: GpuLinesOptions);
149
150
  /** 1 while a range is being dragged: the GPU then decides pass or fail per feature. */
150
- get dragActive(): import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
151
- get dragLow(): import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
152
- get dragHigh(): import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
151
+ get dragActive(): any;
152
+ get dragLow(): any;
153
+ get dragHigh(): any;
153
154
  /** How bright the lines that are not lit are while something is: see `FeatureLook.othersShade`. */
154
- get othersShade(): import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
155
- get othersToward(): import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
155
+ get othersShade(): any;
156
+ get othersToward(): any;
156
157
  passes(): GeometryPasses;
157
158
  setFrame(frame: GeometryFrame): void;
158
159
  setStyle(index: number, style: LineFeatureStyle): void;
@@ -2,6 +2,7 @@ import { Mesh } from 'three/webgpu';
2
2
  import { GeometryFrame, GeometryPasses, GeometryPrimitive } from '../../engine/GeometryFrame';
3
3
  import { FeatureLook } from '../FeatureLook';
4
4
  import { Lighting } from '../Shading';
5
+ import { Uniform } from '../Tsl';
5
6
  import { BodyOptions } from './Body';
6
7
  /** A sphere: its centre relative to the origin, its feature's index, its radius, its reach (0: always). */
7
8
  export type GpuSphere = {
@@ -33,18 +34,8 @@ export declare class GpuSpheres implements GeometryPrimitive {
33
34
  readonly densityMesh: Mesh;
34
35
  readonly look: FeatureLook;
35
36
  readonly lighting: Lighting;
36
- readonly uniforms: {
37
- focal: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
38
- pixelRatio: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
39
- orthographic: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
40
- pxPerWorld: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
41
- ghostAlpha: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
42
- ghostLighten: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
43
- outlineRgb: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<import("three/webgpu").Vector3>>;
44
- outlineWidth: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
45
- litMix: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
46
- };
47
- readonly near: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
37
+ readonly uniforms: import("./Body").BodyUniforms;
38
+ readonly near: Uniform<number>;
48
39
  constructor(spheres: GpuSphere[], options?: GpuSpheresOptions);
49
40
  passes(): GeometryPasses;
50
41
  setFrame(frame: GeometryFrame): void;
@@ -1,7 +1,8 @@
1
- import { Mesh, Vector3 } from 'three/webgpu';
1
+ import { Mesh } from 'three/webgpu';
2
2
  import { GeometryFrame, GeometryPasses, GeometryPrimitive } from '../../engine/GeometryFrame';
3
3
  import { FeatureLook } from '../FeatureLook';
4
4
  import { Lighting } from '../Shading';
5
+ import { Uniform } from '../Tsl';
5
6
  import { BodyOptions } from './Body';
6
7
  /**
7
8
  * A tube's cross-section, in world units: half its width, half its height, and its corners'
@@ -74,24 +75,14 @@ export declare class GpuTubes implements GeometryPrimitive {
74
75
  readonly arrowMesh: Mesh | null;
75
76
  readonly look: FeatureLook;
76
77
  readonly lighting: Lighting;
77
- readonly uniforms: {
78
- focal: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
79
- pixelRatio: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
80
- orthographic: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
81
- pxPerWorld: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
82
- ghostAlpha: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
83
- ghostLighten: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
84
- outlineRgb: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<Vector3>>;
85
- outlineWidth: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
86
- litMix: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
87
- };
78
+ readonly uniforms: import("./Body").BodyUniforms;
88
79
  segments: number;
89
- readonly near: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
80
+ readonly near: Uniform<number>;
90
81
  /**
91
82
  * How far from the camera the junctions are drawn: a tube ending in one further off runs on to
92
83
  * its axis rather than stopping at a wall that is not there.
93
84
  */
94
- readonly shaftReach: import("three/tsl").ShaderNodeObject<import("three/webgpu").UniformNode<number>>;
85
+ readonly shaftReach: Uniform<number>;
95
86
  private readonly up;
96
87
  constructor(tubes: GpuTube[], options?: GpuTubesOptions);
97
88
  passes(): GeometryPasses;