vgpu-render 0.0.0-stage → 0.1.0

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 (65) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +555 -2
  3. package/dist/assets/fira-mono-medium-subset.d.ts +4 -0
  4. package/dist/assets/fira-mono-medium-subset.js +889 -0
  5. package/dist/assets/fira-mono-msdf-atlas.d.ts +13 -0
  6. package/dist/assets/fira-mono-msdf-atlas.js +6222 -0
  7. package/dist/camera-2d.d.ts +43 -0
  8. package/dist/camera-2d.js +75 -0
  9. package/dist/color-space.d.ts +32 -0
  10. package/dist/color-space.js +45 -0
  11. package/dist/curve.d.ts +16 -0
  12. package/dist/curve.js +46 -0
  13. package/dist/debug-draw-3d.d.ts +14 -0
  14. package/dist/debug-draw-3d.js +36 -0
  15. package/dist/frame-recorder-2d.d.ts +177 -0
  16. package/dist/frame-recorder-2d.js +378 -0
  17. package/dist/frame-recorder.d.ts +361 -0
  18. package/dist/frame-recorder.js +515 -0
  19. package/dist/geometry-generators.d.ts +101 -0
  20. package/dist/geometry-generators.js +481 -0
  21. package/dist/gpu-debug-draw-2d.d.ts +48 -0
  22. package/dist/gpu-debug-draw-2d.js +450 -0
  23. package/dist/gpu-debug-draw-3d.d.ts +52 -0
  24. package/dist/gpu-debug-draw-3d.js +890 -0
  25. package/dist/gpu-instancing.d.ts +34 -0
  26. package/dist/gpu-instancing.js +93 -0
  27. package/dist/gpu-text-3d.d.ts +98 -0
  28. package/dist/gpu-text-3d.js +467 -0
  29. package/dist/index.d.ts +21 -0
  30. package/dist/index.js +21 -0
  31. package/dist/infinite-grid-2d.d.ts +73 -0
  32. package/dist/infinite-grid-2d.js +253 -0
  33. package/dist/infinite-grid-3d.d.ts +134 -0
  34. package/dist/infinite-grid-3d.js +407 -0
  35. package/dist/layout-3d.d.ts +227 -0
  36. package/dist/layout-3d.js +226 -0
  37. package/dist/mesh-batch-3d.d.ts +10 -0
  38. package/dist/mesh-batch-3d.js +67 -0
  39. package/dist/scene-examples.d.ts +39 -0
  40. package/dist/scene-examples.js +200 -0
  41. package/dist/scenes-2d.d.ts +18 -0
  42. package/dist/scenes-2d.js +160 -0
  43. package/dist/scenes-3d.d.ts +46 -0
  44. package/dist/scenes-3d.js +1994 -0
  45. package/dist/shape2d-shader.d.ts +14 -0
  46. package/dist/shape2d-shader.js +287 -0
  47. package/dist/text-atlas.d.ts +174 -0
  48. package/dist/text-atlas.js +495 -0
  49. package/dist/text-font.d.ts +149 -0
  50. package/dist/text-font.js +209 -0
  51. package/dist/text-layout.d.ts +116 -0
  52. package/dist/text-layout.js +340 -0
  53. package/dist/text-msdf-baked.d.ts +36 -0
  54. package/dist/text-msdf-baked.js +112 -0
  55. package/dist/text-msdf-font.d.ts +79 -0
  56. package/dist/text-msdf-font.js +153 -0
  57. package/dist/text-msdf.d.ts +70 -0
  58. package/dist/text-msdf.js +242 -0
  59. package/dist/text-raster.d.ts +40 -0
  60. package/dist/text-raster.js +60 -0
  61. package/dist/text-scenes.d.ts +85 -0
  62. package/dist/text-scenes.js +338 -0
  63. package/dist/text-sdf.d.ts +28 -0
  64. package/dist/text-sdf.js +119 -0
  65. package/package.json +80 -4
@@ -0,0 +1,253 @@
1
+ /**
2
+ * Shader-driven infinite 2D grid, ported from `infinite_grid_2d.gdshader`
3
+ * (`hardalex/the reference grid library`, the same reference `InfiniteGrid3D` comes from).
4
+ *
5
+ * The reference is a full-viewport `ColorRect` in a canvas layer: the fragment shader maps screen
6
+ * pixels back to `Camera2D` world coordinates, so there is no geometry to run out of and no
7
+ * projection involved. The LOD ladder is the reference's: one decimal level per zoom octave, three
8
+ * layers (finer, current, coarser) blended with de-duplicated alpha, so overlapping levels cannot
9
+ * stack brightness.
10
+ *
11
+ * Unlike the reference shader, `world2d` has +y up while the framebuffer's y points down, so
12
+ * `screen_to_world` mirrors the y offset. Everything else — cell size, pixel width, LOD range,
13
+ * colors and the debug palette — mirrors the reference uniforms one to one.
14
+ */
15
+ import { draw, geometry } from "vgpu";
16
+ import { prepareShader } from "@vgpu/wgsl/prepare";
17
+ import { linearGridColor } from "./color-space.js";
18
+ const GRID_2D_SHADER = prepareShader(`
19
+ struct Grid2DUniforms {
20
+ viewportSize: vec2f,
21
+ cameraPosition: vec2f,
22
+ cameraZoom: f32,
23
+ cameraRotation: f32,
24
+ gridOrigin: vec2f,
25
+ cellSize: f32,
26
+ minPixelsBetweenCells: f32,
27
+ lineWidthPixels: f32,
28
+ minLodPower: f32,
29
+ maxLodPower: f32,
30
+ debugLodColors: u32,
31
+ thinLineColor: vec4f,
32
+ thickLineColor: vec4f,
33
+ }
34
+ @group(0) @binding(0) var<uniform> grid: Grid2DUniforms;
35
+
36
+ struct In { @location(0) position: vec3f }
37
+ struct Out { @builtin(position) clip: vec4f }
38
+
39
+ @vertex fn vs_main(input: In) -> Out {
40
+ var out: Out;
41
+ // The geometry is already a clip-space quad; z 0 is the near plane the 2D layer pins to.
42
+ out.clip = vec4f(input.position.xy, 0.0, 1.0);
43
+ return out;
44
+ }
45
+
46
+ fn rotate_2d(value: vec2f, angle: f32) -> vec2f {
47
+ let s = sin(angle);
48
+ let c = cos(angle);
49
+ return vec2f(c * value.x - s * value.y, s * value.x + c * value.y);
50
+ }
51
+
52
+ fn screen_to_world(screen: vec2f) -> vec2f {
53
+ let safeZoom = max(abs(grid.cameraZoom), 0.00001);
54
+ let centered = screen - grid.viewportSize * 0.5;
55
+ // +y up in world2d while the framebuffer's y points down, so the offset is mirrored.
56
+ let offset = vec2f(centered.x, -centered.y) / safeZoom;
57
+ return grid.cameraPosition + rotate_2d(offset, grid.cameraRotation);
58
+ }
59
+
60
+ // Line coverage in pixel units so lines keep a stable screen-space width.
61
+ fn grid_line_alpha(uv: vec2f, currentCellSize: f32) -> f32 {
62
+ let coord = uv / currentCellSize;
63
+ let pixelSize = max(abs(dpdx(coord)) + abs(dpdy(coord)), vec2f(0.00001));
64
+ let distanceToLine = min(fract(coord), 1.0 - fract(coord));
65
+ let distancePixels = distanceToLine / pixelSize;
66
+ // 1 px AA transition avoids hard edges and flicker on thin lines.
67
+ let halfLineWidthPixels = max(grid.lineWidthPixels, 0.25) * 0.5;
68
+ let coverage = 1.0 - smoothstep(
69
+ vec2f(max(halfLineWidthPixels - 0.5, 0.0)),
70
+ vec2f(halfLineWidthPixels + 0.5),
71
+ distancePixels
72
+ );
73
+ return max(coverage.x, coverage.y);
74
+ }
75
+
76
+ @fragment fn fs_main(input: Out) -> @location(0) vec4f {
77
+ let worldPosition = screen_to_world(input.clip.xy);
78
+ let uv = worldPosition - grid.gridOrigin;
79
+
80
+ let safeCellSize = max(grid.cellSize, 0.00001);
81
+ let minPower = min(grid.minLodPower, grid.maxLodPower - 2.0);
82
+ let maxPower = max(grid.maxLodPower, minPower + 2.0);
83
+ let worldPerPixel = 1.0 / max(abs(grid.cameraZoom), 0.00001);
84
+ let lodLevel = log(max((worldPerPixel * grid.minPixelsBetweenCells) / safeCellSize, 0.000001)) / log(10.0) + 1.0;
85
+ let currentLodPower = clamp(floor(lodLevel), minPower, maxPower);
86
+ let lodFade = fract(clamp(lodLevel, minPower, maxPower));
87
+
88
+ let lod0CellSize = safeCellSize * pow(10.0, clamp(currentLodPower, minPower, maxPower));
89
+ let lod1CellSize = safeCellSize * pow(10.0, clamp(currentLodPower + 1.0, minPower, maxPower));
90
+ let lod2CellSize = safeCellSize * pow(10.0, clamp(currentLodPower + 2.0, minPower, maxPower));
91
+
92
+ let lod0Alpha = grid_line_alpha(uv, lod0CellSize) * (1.0 - lodFade);
93
+ let lod1Alpha = grid_line_alpha(uv, lod1CellSize);
94
+ let lod2Alpha = grid_line_alpha(uv, lod2CellSize);
95
+
96
+ // De-duplicate: a coarser layer owns the pixels it covers, so the sum never exceeds 1.
97
+ let lod2VisibleAlpha = lod2Alpha;
98
+ let lod1VisibleAlpha = lod1Alpha * (1.0 - lod2VisibleAlpha);
99
+ let lod0VisibleAlpha = lod0Alpha * (1.0 - lod1Alpha) * (1.0 - lod2VisibleAlpha);
100
+
101
+ var lod0Color = grid.thinLineColor;
102
+ var lod1Color = mix(grid.thickLineColor, grid.thinLineColor, lodFade);
103
+ var lod2Color = grid.thickLineColor;
104
+ if (grid.debugLodColors != 0u) {
105
+ lod0Color = vec4f(0.1, 0.35, 1.0, lod0Color.a);
106
+ lod1Color = vec4f(0.1, 1.0, 0.25, lod1Color.a);
107
+ lod2Color = vec4f(1.0, 0.15, 0.1, lod2Color.a);
108
+ }
109
+
110
+ let lod0LayerAlpha = lod0VisibleAlpha * lod0Color.a;
111
+ let lod1LayerAlpha = lod1VisibleAlpha * lod1Color.a;
112
+ let lod2LayerAlpha = lod2VisibleAlpha * lod2Color.a;
113
+ let lineAlpha = clamp(lod0LayerAlpha + lod1LayerAlpha + lod2LayerAlpha, 0.0, 1.0);
114
+
115
+ let lineColor = (
116
+ lod0Color.rgb * lod0LayerAlpha +
117
+ lod1Color.rgb * lod1LayerAlpha +
118
+ lod2Color.rgb * lod2LayerAlpha
119
+ ) / max(lineAlpha, 0.00001);
120
+
121
+ if (lineAlpha <= 0.001) { discard; }
122
+ return vec4f(lineColor, lineAlpha);
123
+ }
124
+ `);
125
+ /** Reference defaults from `infinite_grid_2d.gd`, which differs from the 3D shader on purpose. */
126
+ export const DEFAULT_GRID_2D_OPTIONS = {
127
+ cellSize: 10,
128
+ minPixelsBetweenCells: 2,
129
+ lineWidthPixels: 1,
130
+ lodFinerLevels: 3,
131
+ lodTotalLevels: 8,
132
+ thinLineColor: [0.3, 0.3, 0.3, 0.5],
133
+ thickLineColor: [0.42, 0.42, 0.42, 0.7],
134
+ debugLodColors: false,
135
+ };
136
+ function finite(value, name) {
137
+ if (!Number.isFinite(value))
138
+ throw new RangeError(`${name} must be finite`);
139
+ return value;
140
+ }
141
+ function positive(value, name) {
142
+ const resolved = finite(value, name);
143
+ if (resolved <= 0)
144
+ throw new RangeError(`${name} must be greater than zero`);
145
+ return resolved;
146
+ }
147
+ function colorValue(value, name) {
148
+ if (value.length !== 4)
149
+ throw new RangeError(`${name} must contain four values`);
150
+ return [finite(value[0], `${name}[0]`), finite(value[1], `${name}[1]`), finite(value[2], `${name}[2]`), finite(value[3], `${name}[3]`)];
151
+ }
152
+ /** Validates and freezes the options; the shader's own clamps then only guard the LOD range. */
153
+ export function resolveGrid2DOptions(options = {}) {
154
+ const finer = Math.trunc(finite(options.lodFinerLevels ?? DEFAULT_GRID_2D_OPTIONS.lodFinerLevels, "lodFinerLevels"));
155
+ if (finer < 0 || finer > 12)
156
+ throw new RangeError("lodFinerLevels must be between 0 and 12");
157
+ const total = Math.trunc(finite(options.lodTotalLevels ?? DEFAULT_GRID_2D_OPTIONS.lodTotalLevels, "lodTotalLevels"));
158
+ if (total < 3 || total > 24)
159
+ throw new RangeError("lodTotalLevels must be between 3 and 24");
160
+ return {
161
+ cellSize: positive(options.cellSize ?? DEFAULT_GRID_2D_OPTIONS.cellSize, "cellSize"),
162
+ minPixelsBetweenCells: positive(options.minPixelsBetweenCells ?? DEFAULT_GRID_2D_OPTIONS.minPixelsBetweenCells, "minPixelsBetweenCells"),
163
+ lineWidthPixels: positive(options.lineWidthPixels ?? DEFAULT_GRID_2D_OPTIONS.lineWidthPixels, "lineWidthPixels"),
164
+ lodFinerLevels: finer,
165
+ lodTotalLevels: total,
166
+ thinLineColor: colorValue(options.thinLineColor ?? DEFAULT_GRID_2D_OPTIONS.thinLineColor, "thinLineColor"),
167
+ thickLineColor: colorValue(options.thickLineColor ?? DEFAULT_GRID_2D_OPTIONS.thickLineColor, "thickLineColor"),
168
+ debugLodColors: options.debugLodColors ?? DEFAULT_GRID_2D_OPTIONS.debugLodColors,
169
+ };
170
+ }
171
+ /**
172
+ * The decimal power range the shader may pick from: `lodFinerLevels` below the current level and
173
+ * `lodTotalLevels` in total, matching `_apply_lod_range_parameters`.
174
+ */
175
+ export function grid2dLodPowers(options) {
176
+ // `0 - n` rather than `-n` so a zero finer count yields +0, not -0.
177
+ const min = 0 - options.lodFinerLevels;
178
+ return { min, max: min + Math.max(options.lodTotalLevels, 3) - 1 };
179
+ }
180
+ /** Clip-space quad covering the whole viewport; the fragment stage does the rest. */
181
+ function buildFullScreenQuad(gpu) {
182
+ return geometry(gpu, {
183
+ buffers: [{
184
+ attributes: { position: "float32x3" },
185
+ data: new Float32Array([
186
+ -1, -1, 0, 1, -1, 0, -1, 1, 0,
187
+ -1, 1, 0, 1, -1, 0, 1, 1, 0,
188
+ ]),
189
+ }],
190
+ vertexCount: 6,
191
+ });
192
+ }
193
+ function buildDraw(gpu, quad) {
194
+ return draw(gpu, {
195
+ shader: GRID_2D_SHADER,
196
+ geometry: quad,
197
+ blend: "alpha",
198
+ cull: "none",
199
+ // Same overlay contract as the 2D primitives: near plane, no depth write.
200
+ depth: { write: false, compare: "less-equal" },
201
+ });
202
+ }
203
+ export class InfiniteGrid2D {
204
+ #gpu;
205
+ #geometry;
206
+ #draw;
207
+ #options;
208
+ #opacity = 1;
209
+ constructor(gpu, options = {}) {
210
+ this.#gpu = gpu;
211
+ this.#options = resolveGrid2DOptions(options);
212
+ this.#geometry = buildFullScreenQuad(gpu);
213
+ this.#draw = buildDraw(gpu, this.#geometry);
214
+ }
215
+ /** Reference-style property updates: every field is a per-frame uniform. */
216
+ setOptions(options) {
217
+ this.#options = resolveGrid2DOptions({ ...this.#options, ...options });
218
+ }
219
+ /** Demo extension: scales both line alphas without discarding their reference ratio. */
220
+ setOpacity(opacity) {
221
+ this.#opacity = Math.min(Math.max(opacity, 0), 1);
222
+ }
223
+ /**
224
+ * Draws the grid for one frame. `viewportSize` is the target size in canvas pixels, the same
225
+ * space the 2D projection uses, so the grid and the 2D primitives stay aligned.
226
+ */
227
+ draw(pass, camera, viewportSize) {
228
+ const options = this.#options;
229
+ const powers = grid2dLodPowers(options);
230
+ this.#draw.set({
231
+ grid: {
232
+ viewportSize: [viewportSize[0], viewportSize[1]],
233
+ cameraPosition: [camera.position[0], camera.position[1]],
234
+ cameraZoom: Math.max(camera.zoom, 1e-5),
235
+ cameraRotation: camera.rotation ?? 0,
236
+ gridOrigin: [0, 0],
237
+ cellSize: options.cellSize,
238
+ minPixelsBetweenCells: options.minPixelsBetweenCells,
239
+ lineWidthPixels: options.lineWidthPixels,
240
+ minLodPower: powers.min,
241
+ maxLodPower: powers.max,
242
+ debugLodColors: options.debugLodColors ? 1 : 0,
243
+ thinLineColor: linearGridColor(options.thinLineColor, options.thinLineColor[3] * this.#opacity),
244
+ thickLineColor: linearGridColor(options.thickLineColor, options.thickLineColor[3] * this.#opacity),
245
+ },
246
+ });
247
+ pass.draw(this.#draw);
248
+ }
249
+ destroy() {
250
+ this.#draw.dispose();
251
+ this.#geometry.destroy();
252
+ }
253
+ }
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Shader-driven infinite ground grid, ported from the reference reference
3
+ * `the upstream reference`.
4
+ *
5
+ * The port keeps the reference algorithm and parameters:
6
+ * - a finite XZ quad is drawn once and faded near its bounds, so it reads as endless;
7
+ * - lines are computed in the fragment shader from world XZ coordinates;
8
+ * - three decimal LOD layers (finer / current / coarser) are combined, and their
9
+ * alphas are de-duplicated so overlapping layers do not stack brightness;
10
+ * - the LOD distance follows the reference camera-state rules from
11
+ * `infinite_grid_3d.gd::_update_camera_lod_distance`.
12
+ *
13
+ * Everything else (`grid_size`, `cell_size`, `line_width_pixels`, LOD ranges,
14
+ * center/grazing/edge/far fades, stipple discard and line colors) mirrors the
15
+ * reference uniforms one to one. `setOpacity` is the only demo-side extension:
16
+ * it scales the two reference line alphas instead of replacing them.
17
+ */
18
+ import { type FramePass, type Gpu } from "vgpu";
19
+ /** Projection taken from the reference `Camera3D.PROJECTION_*` modes. */
20
+ export type GridProjection = "perspective" | "orthographic";
21
+ /** Reference `Color` values; alpha participates in the layer compositing. */
22
+ export type GridColor = readonly [number, number, number, number];
23
+ export type InfiniteGridOptions = {
24
+ /** Reference `grid_size`: side length of the finite quad. Default 2000. */
25
+ size?: number;
26
+ /** Reference `edge_fade_start_ratio`. Default 0. */
27
+ edgeFadeStartRatio?: number;
28
+ /** Reference `edge_fade_end_ratio`. Default 1. */
29
+ edgeFadeEndRatio?: number;
30
+ /** Reference `cell_size`: base world-space cell size. Default 1. */
31
+ cellSize?: number;
32
+ /** Reference `line_width_pixels`. Default 1. */
33
+ lineWidthPixels?: number;
34
+ /** Reference `lod_finer_levels`: decimal levels below `cellSize`. Default 3. */
35
+ lodFinerLevels?: number;
36
+ /** Reference `lod_total_levels`, minimum 3. Default 8. */
37
+ lodTotalLevels?: number;
38
+ /** Reference `enable_grazing_opacity`. Default true. */
39
+ enableGrazingOpacity?: boolean;
40
+ /** Reference `grazing_fade_start`, in degrees above the grid plane. Default 3. */
41
+ grazingFadeStart?: number;
42
+ /** Reference `grazing_fade_end`, in degrees above the grid plane. Default 20. */
43
+ grazingFadeEnd?: number;
44
+ /** Reference `enable_stipple_discard`. Default false. */
45
+ enableStippleDiscard?: boolean;
46
+ /** Reference `enable_lod_center_fade`. Default true. */
47
+ enableLodCenterFade?: boolean;
48
+ /** Reference `lod_center_fade_line_count`. Default 151. */
49
+ lodCenterFadeLineCount?: number;
50
+ /** Reference `thin_line_color`. Default [0.42, 0.42, 0.42, 0.45]. */
51
+ thinLineColor?: GridColor;
52
+ /** Reference `thick_line_color`. Default [0.62, 0.62, 0.62, 0.65]. */
53
+ thickLineColor?: GridColor;
54
+ /** Reference `debug_lod_colors`. Default false. */
55
+ debugLodColors?: boolean;
56
+ };
57
+ /**
58
+ * Per-frame camera state. `cameraForward` and `farClip` drive the reference LOD
59
+ * distance rules, so they are required rather than derived from the matrix.
60
+ */
61
+ export type GridCameraState = {
62
+ readonly viewProjection: ArrayLike<number>;
63
+ readonly cameraPosition: readonly [number, number, number];
64
+ /** Normalized view direction (camera to focus). */
65
+ readonly cameraForward: readonly [number, number, number];
66
+ readonly projection: GridProjection;
67
+ /** Reference `Camera3D.size`; only read in orthographic projection. */
68
+ readonly orthographicSize?: number;
69
+ readonly farClip: number;
70
+ };
71
+ type ResolvedGridOptions = {
72
+ size: number;
73
+ edgeFadeStartRatio: number;
74
+ edgeFadeEndRatio: number;
75
+ cellSize: number;
76
+ lineWidthPixels: number;
77
+ lodFinerLevels: number;
78
+ lodTotalLevels: number;
79
+ enableGrazingOpacity: boolean;
80
+ grazingFadeStart: number;
81
+ grazingFadeEnd: number;
82
+ enableStippleDiscard: boolean;
83
+ enableLodCenterFade: boolean;
84
+ lodCenterFadeLineCount: number;
85
+ thinLineColor: GridColor;
86
+ thickLineColor: GridColor;
87
+ debugLodColors: boolean;
88
+ };
89
+ /** Mirrors the reference property setters, including their clamps. */
90
+ export declare function resolveGridOptions(options: InfiniteGridOptions): ResolvedGridOptions;
91
+ /** Reference `_get_min_lod_cell_size()`. */
92
+ export declare function minLodCellSize(options: ResolvedGridOptions): number;
93
+ /** Reference `_apply_lod_range_parameters()`. */
94
+ export declare function lodPowers(options: ResolvedGridOptions): {
95
+ min: number;
96
+ max: number;
97
+ };
98
+ /** Reference `_apply_grazing_fade_parameters()`. */
99
+ export declare function grazingFactors(options: ResolvedGridOptions): {
100
+ start: number;
101
+ end: number;
102
+ };
103
+ export type LodState = {
104
+ lodDistance: number;
105
+ viewGridCenter: readonly [number, number];
106
+ cameraIsOrthogonal: boolean;
107
+ };
108
+ /**
109
+ * Reference `_update_camera_lod_distance()` with the grid plane at y = 0: the
110
+ * distance to the view floor drives the LOD, falling back to camera height near
111
+ * grazing angles so the LOD distance cannot blow up.
112
+ */
113
+ export declare function gridLodState(camera: GridCameraState, options?: InfiniteGridOptions): LodState;
114
+ /** The quad is centered on the camera XZ, matching `follow_viewport_camera`. */
115
+ export declare class InfiniteGrid3D {
116
+ #private;
117
+ constructor(gpu: Gpu, options?: InfiniteGridOptions);
118
+ prepare(camera: GridCameraState): void;
119
+ /**
120
+ * Applies reference-style property updates. Only `size` rebuilds the quad;
121
+ * every other field is a per-frame uniform, exactly like the reference setters.
122
+ */
123
+ setOptions(options: InfiniteGridOptions): void;
124
+ /** Reference `set_grid_size()`: rebuilds the finite quad. */
125
+ setSize(size: number): void;
126
+ /**
127
+ * Demo extension over the reference: scales `thin_line_color.a` and
128
+ * `thick_line_color.a` without discarding their reference ratio.
129
+ */
130
+ setOpacity(opacity: number): void;
131
+ draw(pass: FramePass): void;
132
+ destroy(): void;
133
+ }
134
+ export {};