wallhammer-web 0.0.0-stage → 0.4.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.
- package/LICENSE +21 -0
- package/README.md +88 -2
- package/dist/base/data.d.ts +67 -0
- package/dist/base/data.js +10 -0
- package/dist/base/destructible.d.ts +167 -0
- package/dist/base/destructible.js +47 -0
- package/dist/base/env-slot.d.ts +101 -0
- package/dist/base/env-slot.js +8 -0
- package/dist/base/frames.d.ts +138 -0
- package/dist/base/frames.js +459 -0
- package/dist/base/index.d.ts +21 -0
- package/dist/base/index.js +11 -0
- package/dist/base/mat34.d.ts +46 -0
- package/dist/base/mat34.js +173 -0
- package/dist/base/material.d.ts +87 -0
- package/dist/base/material.js +6 -0
- package/dist/base/math.d.ts +27 -0
- package/dist/base/math.js +60 -0
- package/dist/base/progress.d.ts +38 -0
- package/dist/base/progress.js +81 -0
- package/dist/base/rig.d.ts +177 -0
- package/dist/base/rig.js +97 -0
- package/dist/base/trig.d.ts +29 -0
- package/dist/base/trig.js +169 -0
- package/dist/base/up.d.ts +26 -0
- package/dist/base/up.js +40 -0
- package/dist/base/view.d.ts +128 -0
- package/dist/base/view.js +136 -0
- package/dist/camera/camera.d.ts +99 -0
- package/dist/camera/camera.js +228 -0
- package/dist/camera/follow.d.ts +120 -0
- package/dist/camera/follow.js +320 -0
- package/dist/camera/free.d.ts +153 -0
- package/dist/camera/free.js +359 -0
- package/dist/camera/index.d.ts +10 -0
- package/dist/camera/index.js +6 -0
- package/dist/camera/orbit.d.ts +93 -0
- package/dist/camera/orbit.js +261 -0
- package/dist/camera/path.d.ts +48 -0
- package/dist/camera/path.js +179 -0
- package/dist/core/ballistic.d.ts +66 -0
- package/dist/core/ballistic.js +104 -0
- package/dist/core/bodies.d.ts +77 -0
- package/dist/core/bodies.js +125 -0
- package/dist/core/clock.d.ts +37 -0
- package/dist/core/clock.js +87 -0
- package/dist/core/cover-fade.d.ts +14 -0
- package/dist/core/cover-fade.js +38 -0
- package/dist/core/index.d.ts +13 -0
- package/dist/core/index.js +8 -0
- package/dist/core/kepler.d.ts +74 -0
- package/dist/core/kepler.js +108 -0
- package/dist/core/level-fade.d.ts +66 -0
- package/dist/core/level-fade.js +123 -0
- package/dist/core/palette.d.ts +15 -0
- package/dist/core/palette.js +47 -0
- package/dist/env/atmosphere.d.ts +129 -0
- package/dist/env/atmosphere.js +707 -0
- package/dist/env/cloud-field.d.ts +44 -0
- package/dist/env/cloud-field.js +111 -0
- package/dist/env/environment.d.ts +217 -0
- package/dist/env/environment.js +441 -0
- package/dist/env/frame-block.d.ts +29 -0
- package/dist/env/frame-block.js +152 -0
- package/dist/env/glsl.d.ts +35 -0
- package/dist/env/glsl.js +246 -0
- package/dist/env/index.d.ts +13 -0
- package/dist/env/index.js +9 -0
- package/dist/env/sky.d.ts +48 -0
- package/dist/env/sky.js +227 -0
- package/dist/env/sun.d.ts +31 -0
- package/dist/env/sun.js +42 -0
- package/dist/gen-arch/build.d.ts +17 -0
- package/dist/gen-arch/build.js +414 -0
- package/dist/gen-arch/damage/damaged.d.ts +44 -0
- package/dist/gen-arch/damage/damaged.js +1119 -0
- package/dist/gen-arch/damage/fall-material.d.ts +10 -0
- package/dist/gen-arch/damage/fall-material.js +47 -0
- package/dist/gen-arch/damage/fall.d.ts +78 -0
- package/dist/gen-arch/damage/fall.js +797 -0
- package/dist/gen-arch/damage/rubble.d.ts +22 -0
- package/dist/gen-arch/damage/rubble.js +188 -0
- package/dist/gen-arch/index.d.ts +25 -0
- package/dist/gen-arch/index.js +16 -0
- package/dist/gen-arch/interior/interior-plan.d.ts +114 -0
- package/dist/gen-arch/interior/interior-plan.js +615 -0
- package/dist/gen-arch/interior/interior.d.ts +97 -0
- package/dist/gen-arch/interior/interior.js +966 -0
- package/dist/gen-arch/structure/building-shader.d.ts +25 -0
- package/dist/gen-arch/structure/building-shader.js +946 -0
- package/dist/gen-arch/structure/buildings.d.ts +248 -0
- package/dist/gen-arch/structure/buildings.js +294 -0
- package/dist/gen-arch/structure/dims.d.ts +77 -0
- package/dist/gen-arch/structure/dims.js +39 -0
- package/dist/gen-arch/structure/distant.d.ts +62 -0
- package/dist/gen-arch/structure/distant.js +316 -0
- package/dist/gen-arch/structure/env-slots.d.ts +18 -0
- package/dist/gen-arch/structure/env-slots.js +47 -0
- package/dist/gen-arch/structure/facade.d.ts +193 -0
- package/dist/gen-arch/structure/facade.js +159 -0
- package/dist/gen-arch/structure/parts.d.ts +31 -0
- package/dist/gen-arch/structure/parts.js +69 -0
- package/dist/gen-arch/structure/roof.d.ts +76 -0
- package/dist/gen-arch/structure/roof.js +568 -0
- package/dist/gen-arch/structure/structure-material.d.ts +23 -0
- package/dist/gen-arch/structure/structure-material.js +55 -0
- package/dist/gen-arch/structure/writer.d.ts +94 -0
- package/dist/gen-arch/structure/writer.js +195 -0
- package/dist/gen-core/cell.d.ts +138 -0
- package/dist/gen-core/cell.js +150 -0
- package/dist/gen-core/cube-sphere.d.ts +57 -0
- package/dist/gen-core/cube-sphere.js +159 -0
- package/dist/gen-core/field.d.ts +55 -0
- package/dist/gen-core/field.js +154 -0
- package/dist/gen-core/geometry.d.ts +31 -0
- package/dist/gen-core/geometry.js +231 -0
- package/dist/gen-core/hash.d.ts +18 -0
- package/dist/gen-core/hash.js +58 -0
- package/dist/gen-core/height-field.d.ts +33 -0
- package/dist/gen-core/height-field.js +137 -0
- package/dist/gen-core/index.d.ts +22 -0
- package/dist/gen-core/index.js +17 -0
- package/dist/gen-core/instance-cells.d.ts +37 -0
- package/dist/gen-core/instance-cells.js +72 -0
- package/dist/gen-core/near-scatter.d.ts +56 -0
- package/dist/gen-core/near-scatter.js +120 -0
- package/dist/gen-core/noise.d.ts +23 -0
- package/dist/gen-core/noise.js +72 -0
- package/dist/gen-core/occupancy.d.ts +21 -0
- package/dist/gen-core/occupancy.js +104 -0
- package/dist/gen-core/sphere-patch.d.ts +138 -0
- package/dist/gen-core/sphere-patch.js +544 -0
- package/dist/gen-core/strip-surface.d.ts +34 -0
- package/dist/gen-core/strip-surface.js +246 -0
- package/dist/gen-core/strip.d.ts +102 -0
- package/dist/gen-core/strip.js +817 -0
- package/dist/gen-ground/env-slots.d.ts +48 -0
- package/dist/gen-ground/env-slots.js +78 -0
- package/dist/gen-ground/ground.d.ts +78 -0
- package/dist/gen-ground/ground.js +208 -0
- package/dist/gen-ground/index.d.ts +9 -0
- package/dist/gen-ground/index.js +7 -0
- package/dist/gen-ground/markings.d.ts +46 -0
- package/dist/gen-ground/markings.js +124 -0
- package/dist/gen-ground/materials.d.ts +18 -0
- package/dist/gen-ground/materials.js +22 -0
- package/dist/gen-ground/terrain-shader.d.ts +5 -0
- package/dist/gen-ground/terrain-shader.js +151 -0
- package/dist/gen-mesh/bare-shapes.d.ts +194 -0
- package/dist/gen-mesh/bare-shapes.js +596 -0
- package/dist/gen-mesh/bisect-surface.d.ts +47 -0
- package/dist/gen-mesh/bisect-surface.js +261 -0
- package/dist/gen-mesh/box.d.ts +18 -0
- package/dist/gen-mesh/box.js +2 -0
- package/dist/gen-mesh/cell-morph-mesh.d.ts +52 -0
- package/dist/gen-mesh/cell-morph-mesh.js +258 -0
- package/dist/gen-mesh/cell-surface-mesh.d.ts +32 -0
- package/dist/gen-mesh/cell-surface-mesh.js +140 -0
- package/dist/gen-mesh/chunk-mesh.d.ts +25 -0
- package/dist/gen-mesh/chunk-mesh.js +112 -0
- package/dist/gen-mesh/drape-mesh.d.ts +36 -0
- package/dist/gen-mesh/drape-mesh.js +98 -0
- package/dist/gen-mesh/height-field-mesh.d.ts +14 -0
- package/dist/gen-mesh/height-field-mesh.js +98 -0
- package/dist/gen-mesh/index.d.ts +26 -0
- package/dist/gen-mesh/index.js +15 -0
- package/dist/gen-mesh/line-mesh.d.ts +25 -0
- package/dist/gen-mesh/line-mesh.js +62 -0
- package/dist/gen-mesh/mesh-builder.d.ts +115 -0
- package/dist/gen-mesh/mesh-builder.js +315 -0
- package/dist/gen-mesh/packed-mesh.d.ts +53 -0
- package/dist/gen-mesh/packed-mesh.js +205 -0
- package/dist/gen-mesh/prism-mesh.d.ts +33 -0
- package/dist/gen-mesh/prism-mesh.js +176 -0
- package/dist/gen-mesh/rig-mesh.d.ts +9 -0
- package/dist/gen-mesh/rig-mesh.js +135 -0
- package/dist/gen-mesh/strip-mesh.d.ts +45 -0
- package/dist/gen-mesh/strip-mesh.js +258 -0
- package/dist/gen-plan/drain.d.ts +58 -0
- package/dist/gen-plan/drain.js +270 -0
- package/dist/gen-plan/grid.d.ts +37 -0
- package/dist/gen-plan/grid.js +182 -0
- package/dist/gen-plan/horizon.d.ts +50 -0
- package/dist/gen-plan/horizon.js +185 -0
- package/dist/gen-plan/index.d.ts +15 -0
- package/dist/gen-plan/index.js +13 -0
- package/dist/gen-plan/line-tiles.d.ts +35 -0
- package/dist/gen-plan/line-tiles.js +190 -0
- package/dist/gen-plan/lines.d.ts +31 -0
- package/dist/gen-plan/lines.js +183 -0
- package/dist/gen-plan/plots.d.ts +40 -0
- package/dist/gen-plan/plots.js +282 -0
- package/dist/gen-plan/route.d.ts +55 -0
- package/dist/gen-plan/route.js +297 -0
- package/dist/gen-plan/sites.d.ts +32 -0
- package/dist/gen-plan/sites.js +209 -0
- package/dist/gen-tex/code-stamp.d.ts +31 -0
- package/dist/gen-tex/code-stamp.js +137 -0
- package/dist/gen-tex/index.d.ts +7 -0
- package/dist/gen-tex/index.js +5 -0
- package/dist/gen-tex/light-horizon.d.ts +47 -0
- package/dist/gen-tex/light-horizon.js +180 -0
- package/dist/gen-tex/textures.d.ts +8 -0
- package/dist/gen-tex/textures.js +49 -0
- package/dist/gen-tex/value-textures.d.ts +46 -0
- package/dist/gen-tex/value-textures.js +102 -0
- package/dist/gen-vegetation/env-slots.d.ts +20 -0
- package/dist/gen-vegetation/env-slots.js +29 -0
- package/dist/gen-vegetation/index.d.ts +8 -0
- package/dist/gen-vegetation/index.js +7 -0
- package/dist/gen-vegetation/materials.d.ts +7 -0
- package/dist/gen-vegetation/materials.js +17 -0
- package/dist/gen-vegetation/planting.d.ts +170 -0
- package/dist/gen-vegetation/planting.js +363 -0
- package/dist/gen-vegetation/tree-shader.d.ts +23 -0
- package/dist/gen-vegetation/tree-shader.js +229 -0
- package/dist/gen-vegetation/trees.d.ts +59 -0
- package/dist/gen-vegetation/trees.js +329 -0
- package/dist/gpu/device.d.ts +286 -0
- package/dist/gpu/device.js +1157 -0
- package/dist/gpu/gl.d.ts +134 -0
- package/dist/gpu/gl.js +276 -0
- package/dist/gpu/index.d.ts +4 -0
- package/dist/gpu/index.js +3 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +13 -0
- package/dist/motion/graph.d.ts +244 -0
- package/dist/motion/graph.js +739 -0
- package/dist/motion/index.d.ts +8 -0
- package/dist/motion/index.js +8 -0
- package/dist/motion/pose-ops.d.ts +30 -0
- package/dist/motion/pose-ops.js +232 -0
- package/dist/motion/reach.d.ts +45 -0
- package/dist/motion/reach.js +264 -0
- package/dist/motion/skeleton.d.ts +49 -0
- package/dist/motion/skeleton.js +99 -0
- package/dist/platform/byte-store.d.ts +21 -0
- package/dist/platform/byte-store.js +137 -0
- package/dist/platform/canvas.d.ts +29 -0
- package/dist/platform/canvas.js +76 -0
- package/dist/platform/context-loss.d.ts +8 -0
- package/dist/platform/context-loss.js +17 -0
- package/dist/platform/free-input.d.ts +51 -0
- package/dist/platform/free-input.js +100 -0
- package/dist/platform/index.d.ts +18 -0
- package/dist/platform/index.js +10 -0
- package/dist/platform/input.d.ts +48 -0
- package/dist/platform/input.js +117 -0
- package/dist/platform/keys.d.ts +12 -0
- package/dist/platform/keys.js +29 -0
- package/dist/platform/loop.d.ts +41 -0
- package/dist/platform/loop.js +84 -0
- package/dist/platform/walk-input.d.ts +74 -0
- package/dist/platform/walk-input.js +226 -0
- package/dist/platform/worker.d.ts +51 -0
- package/dist/platform/worker.js +170 -0
- package/dist/render/bone-instances.d.ts +24 -0
- package/dist/render/bone-instances.js +74 -0
- package/dist/render/cells.d.ts +70 -0
- package/dist/render/cells.js +144 -0
- package/dist/render/glsl.d.ts +66 -0
- package/dist/render/glsl.js +173 -0
- package/dist/render/index.d.ts +26 -0
- package/dist/render/index.js +16 -0
- package/dist/render/instance-sets.d.ts +97 -0
- package/dist/render/instance-sets.js +241 -0
- package/dist/render/near-instances.d.ts +75 -0
- package/dist/render/near-instances.js +219 -0
- package/dist/render/particles.d.ts +63 -0
- package/dist/render/particles.js +215 -0
- package/dist/render/pieces.d.ts +57 -0
- package/dist/render/pieces.js +151 -0
- package/dist/render/point-lights.d.ts +97 -0
- package/dist/render/point-lights.js +243 -0
- package/dist/render/renderer.d.ts +447 -0
- package/dist/render/renderer.js +1100 -0
- package/dist/render/rig.d.ts +74 -0
- package/dist/render/rig.js +576 -0
- package/dist/render/shadow-areas.d.ts +49 -0
- package/dist/render/shadow-areas.js +125 -0
- package/dist/render/shadow-glsl.d.ts +12 -0
- package/dist/render/shadow-glsl.js +146 -0
- package/dist/render/transient.d.ts +61 -0
- package/dist/render/transient.js +213 -0
- package/dist/render/value-glsl.d.ts +17 -0
- package/dist/render/value-glsl.js +208 -0
- package/dist/render/value-layers.d.ts +180 -0
- package/dist/render/value-layers.js +333 -0
- package/dist/runtime/atmosphere.d.ts +37 -0
- package/dist/runtime/atmosphere.js +304 -0
- package/dist/runtime/cloud-shell.d.ts +29 -0
- package/dist/runtime/cloud-shell.js +158 -0
- package/dist/runtime/engine.d.ts +155 -0
- package/dist/runtime/engine.js +305 -0
- package/dist/runtime/environment-link.d.ts +22 -0
- package/dist/runtime/environment-link.js +49 -0
- package/dist/runtime/index.d.ts +13 -0
- package/dist/runtime/index.js +12 -0
- package/dist/runtime/precipitation-glsl.d.ts +2 -0
- package/dist/runtime/precipitation-glsl.js +70 -0
- package/dist/runtime/precipitation.d.ts +11 -0
- package/dist/runtime/precipitation.js +78 -0
- package/dist/runtime/sky.d.ts +30 -0
- package/dist/runtime/sky.js +114 -0
- package/dist/runtime/streaming.d.ts +245 -0
- package/dist/runtime/streaming.js +602 -0
- package/dist/sim/agenda.d.ts +167 -0
- package/dist/sim/agenda.js +425 -0
- package/dist/sim/bytes.d.ts +34 -0
- package/dist/sim/bytes.js +125 -0
- package/dist/sim/destruction/apply.d.ts +59 -0
- package/dist/sim/destruction/apply.js +243 -0
- package/dist/sim/destruction/cell-states.d.ts +54 -0
- package/dist/sim/destruction/cell-states.js +198 -0
- package/dist/sim/destruction/index.d.ts +11 -0
- package/dist/sim/destruction/index.js +10 -0
- package/dist/sim/destruction/int-geometry.d.ts +17 -0
- package/dist/sim/destruction/int-geometry.js +131 -0
- package/dist/sim/destruction/pick.d.ts +13 -0
- package/dist/sim/destruction/pick.js +59 -0
- package/dist/sim/destruction/rubble.d.ts +8 -0
- package/dist/sim/destruction/rubble.js +159 -0
- package/dist/sim/destruction/state.d.ts +15 -0
- package/dist/sim/destruction/state.js +83 -0
- package/dist/sim/destruction/structure.d.ts +30 -0
- package/dist/sim/destruction/structure.js +139 -0
- package/dist/sim/events.d.ts +37 -0
- package/dist/sim/events.js +106 -0
- package/dist/sim/fixed.d.ts +21 -0
- package/dist/sim/fixed.js +64 -0
- package/dist/sim/flow-probe.d.ts +58 -0
- package/dist/sim/flow-probe.js +158 -0
- package/dist/sim/flow.d.ts +257 -0
- package/dist/sim/flow.js +967 -0
- package/dist/sim/index.d.ts +28 -0
- package/dist/sim/index.js +20 -0
- package/dist/sim/interlock.d.ts +47 -0
- package/dist/sim/interlock.js +252 -0
- package/dist/sim/movers.d.ts +228 -0
- package/dist/sim/movers.js +1083 -0
- package/dist/sim/nav.d.ts +72 -0
- package/dist/sim/nav.js +292 -0
- package/dist/sim/paths.d.ts +80 -0
- package/dist/sim/paths.js +197 -0
- package/dist/sim/regions.d.ts +87 -0
- package/dist/sim/regions.js +517 -0
- package/dist/sim/simulation.d.ts +114 -0
- package/dist/sim/simulation.js +291 -0
- package/dist/sim/states.d.ts +23 -0
- package/dist/sim/states.js +54 -0
- package/dist/sim/table.d.ts +49 -0
- package/dist/sim/table.js +126 -0
- package/dist/sim/zones.d.ts +11 -0
- package/dist/sim/zones.js +196 -0
- package/dist/tools/collision-lines.d.ts +12 -0
- package/dist/tools/collision-lines.js +50 -0
- package/dist/tools/data-view-glsl.d.ts +3 -0
- package/dist/tools/data-view-glsl.js +63 -0
- package/dist/tools/data-view-layers.d.ts +20 -0
- package/dist/tools/data-view-layers.js +60 -0
- package/dist/tools/debug-view.d.ts +30 -0
- package/dist/tools/debug-view.js +4 -0
- package/dist/tools/index.d.ts +10 -0
- package/dist/tools/index.js +7 -0
- package/dist/tools/mesh-checks.d.ts +67 -0
- package/dist/tools/mesh-checks.js +188 -0
- package/dist/tools/profile.d.ts +85 -0
- package/dist/tools/profile.js +173 -0
- package/dist/world/cell-cache.d.ts +32 -0
- package/dist/world/cell-cache.js +60 -0
- package/dist/world/cell-format.d.ts +25 -0
- package/dist/world/cell-format.js +232 -0
- package/dist/world/collide.d.ts +192 -0
- package/dist/world/collide.js +822 -0
- package/dist/world/index.d.ts +16 -0
- package/dist/world/index.js +12 -0
- package/dist/world/mesh-solids.d.ts +48 -0
- package/dist/world/mesh-solids.js +169 -0
- package/dist/world/pick.d.ts +34 -0
- package/dist/world/pick.js +177 -0
- package/dist/world/providers.d.ts +66 -0
- package/dist/world/providers.js +83 -0
- package/dist/world/sphere.d.ts +69 -0
- package/dist/world/sphere.js +271 -0
- package/dist/world/streaming.d.ts +288 -0
- package/dist/world/streaming.js +801 -0
- package/dist/world/walker.d.ts +145 -0
- package/dist/world/walker.js +502 -0
- package/docs/architecture.md +111 -0
- package/docs/cameras.md +302 -0
- package/docs/concepts.md +123 -0
- package/docs/destruction.md +127 -0
- package/docs/frames.md +199 -0
- package/docs/generators.md +575 -0
- package/docs/getting-started.md +123 -0
- package/docs/headless.md +50 -0
- package/docs/motion.md +160 -0
- package/docs/planet.md +152 -0
- package/docs/recipes.md +521 -0
- package/docs/reference.md +364 -0
- package/docs/rendering.md +823 -0
- package/docs/rigs.md +203 -0
- package/docs/simulation.md +235 -0
- package/docs/streaming.md +590 -0
- package/docs/system.md +166 -0
- package/docs/tools.md +175 -0
- package/docs/walking.md +262 -0
- package/package.json +131 -3
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
// Shaders of the value layers: numbers shown over a scene through a colour ramp. A value lives in a two-byte texel
|
|
2
|
+
// as a 16-bit word (0 = no value, 1–65535 across the value range, see `quantizeValues`); two time steps are bound at
|
|
3
|
+
// once and blended. Three shapes read the same words: a grid laid on the ground (one word per cell, or a cell that
|
|
4
|
+
// names a table row), discs (table row = instance number) and prisms (table row from a vertex attribute).
|
|
5
|
+
// Colours are shown exactly as the ramp gives them, without light or haze, so they can be read against a legend.
|
|
6
|
+
import { DRAPE_ATTRIBS, PRISM_ATTRIBS } from '../gen-mesh/index.js';
|
|
7
|
+
/**
|
|
8
|
+
* GLSL helpers for reading value words; put it right after `#include <header>`. The helpers take fetched texels,
|
|
9
|
+
* never samplers.
|
|
10
|
+
*/
|
|
11
|
+
export const VALUE_GLSL = /* glsl */ `
|
|
12
|
+
precision highp sampler2D;
|
|
13
|
+
// The 16-bit word of a two-byte texel (red = low byte, green = high byte). 0 means "no value".
|
|
14
|
+
float valueWord(vec4 texel) {
|
|
15
|
+
return floor(texel.r * 255.0 + 0.5) + floor(texel.g * 255.0 + 0.5) * 256.0;
|
|
16
|
+
}
|
|
17
|
+
// Texel of row i in a table texture that is w texels wide.
|
|
18
|
+
ivec2 tableCell(int i, int w) {
|
|
19
|
+
return ivec2(i % w, i / w);
|
|
20
|
+
}
|
|
21
|
+
// x: the value as 0–1 across its range, y: 1 when there is a value, else 0.
|
|
22
|
+
vec2 valueOf(float word) {
|
|
23
|
+
return vec2(max(word - 1.0, 0.0) / 65534.0, step(0.5, word));
|
|
24
|
+
}
|
|
25
|
+
// Two time steps blended by t. Where only one of them has a value, that value fades in or out.
|
|
26
|
+
vec2 blendSteps(vec2 a, vec2 b, float t) {
|
|
27
|
+
float k = b.y * (a.y > 0.5 ? t : 1.0);
|
|
28
|
+
return vec2(mix(a.x, b.x, k), mix(a.y, b.y, t));
|
|
29
|
+
}
|
|
30
|
+
// Position on the ramp of value v when the ramp spans the part range.x–range.y of the value range.
|
|
31
|
+
float rampPosition(vec2 range, float v) {
|
|
32
|
+
return clamp((v - range.x) / max(range.y - range.x, 1e-6), 0.0, 1.0);
|
|
33
|
+
}
|
|
34
|
+
// Texture coordinate in a 256-texel ramp for position t (texel centres at both ends).
|
|
35
|
+
float rampCoord(float t) {
|
|
36
|
+
return t * (255.0 / 256.0) + 0.5 / 256.0;
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
const BLEND = { src: 'src-alpha', dst: 'one-minus-src-alpha', srcAlpha: 'one', dstAlpha: 'one-minus-src-alpha' };
|
|
40
|
+
const RASTER_VS = /* glsl */ `#include <header>
|
|
41
|
+
in vec3 a_pos;
|
|
42
|
+
out vec3 v_world;
|
|
43
|
+
void main() {
|
|
44
|
+
v_world = a_pos;
|
|
45
|
+
gl_Position = u_viewProj * vec4(a_pos, 1.0);
|
|
46
|
+
}`;
|
|
47
|
+
const RASTER_FS = /* glsl */ `#include <header>
|
|
48
|
+
${VALUE_GLSL}
|
|
49
|
+
uniform sampler2D u_valuesA;
|
|
50
|
+
uniform sampler2D u_valuesB;
|
|
51
|
+
uniform sampler2D u_ramp;
|
|
52
|
+
uniform sampler2D u_cells;
|
|
53
|
+
uniform vec4 u_grid; // xy position of the grid's corner, zw cells per metre
|
|
54
|
+
uniform vec4 u_size; // xy cells of the grid, z width of the value table in texels
|
|
55
|
+
uniform vec4 u_style; // x blend of the two steps, y opacity, z 1 = smooth between cells, w 1 = cells name table rows
|
|
56
|
+
uniform vec4 u_range; // xy part of the value range the ramp spans, z darkening of the outline between rows
|
|
57
|
+
in vec3 v_world;
|
|
58
|
+
out vec4 o_color;
|
|
59
|
+
|
|
60
|
+
vec2 valueAt(ivec2 p) {
|
|
61
|
+
return blendSteps(valueOf(valueWord(texelFetch(u_valuesA, p, 0))), valueOf(valueWord(texelFetch(u_valuesB, p, 0))), u_style.x);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
void main() {
|
|
65
|
+
vec2 g = (v_world.xz - u_grid.xy) * u_grid.zw;
|
|
66
|
+
if (g.x < 0.0 || g.y < 0.0 || g.x >= u_size.x || g.y >= u_size.y) discard;
|
|
67
|
+
ivec2 last = ivec2(u_size.xy) - 1;
|
|
68
|
+
vec2 v = vec2(0.0);
|
|
69
|
+
float edge = 0.0;
|
|
70
|
+
if (u_style.w > 0.5) {
|
|
71
|
+
// Each cell names a table row (row + 1, 0 = nothing here); the value comes from the table.
|
|
72
|
+
ivec2 p = min(ivec2(g), last);
|
|
73
|
+
float row = valueWord(texelFetch(u_cells, p, 0));
|
|
74
|
+
if (row < 0.5) discard;
|
|
75
|
+
v = valueAt(tableCell(int(row) - 1, int(u_size.z)));
|
|
76
|
+
float rx = valueWord(texelFetch(u_cells, min(p + ivec2(1, 0), last), 0));
|
|
77
|
+
float rz = valueWord(texelFetch(u_cells, min(p + ivec2(0, 1), last), 0));
|
|
78
|
+
edge = (rx != row || rz != row) ? u_range.z : 0.0;
|
|
79
|
+
} else if (u_style.z > 0.5) {
|
|
80
|
+
// Bilinear between cell centres; cells without a value take no part, and the sheet ends half-way to them.
|
|
81
|
+
vec2 q = g - 0.5;
|
|
82
|
+
ivec2 p0 = clamp(ivec2(floor(q)), ivec2(0), last);
|
|
83
|
+
ivec2 p1 = min(p0 + ivec2(1), last);
|
|
84
|
+
vec2 f = clamp(q - vec2(p0), 0.0, 1.0);
|
|
85
|
+
vec2 v00 = valueAt(p0);
|
|
86
|
+
vec2 v10 = valueAt(ivec2(p1.x, p0.y));
|
|
87
|
+
vec2 v01 = valueAt(ivec2(p0.x, p1.y));
|
|
88
|
+
vec2 v11 = valueAt(p1);
|
|
89
|
+
vec4 w = vec4((1.0 - f.x) * (1.0 - f.y), f.x * (1.0 - f.y), (1.0 - f.x) * f.y, f.x * f.y) * vec4(v00.y, v10.y, v01.y, v11.y);
|
|
90
|
+
float sum = w.x + w.y + w.z + w.w;
|
|
91
|
+
if (sum < 1e-4) discard;
|
|
92
|
+
v = vec2(dot(w, vec4(v00.x, v10.x, v01.x, v11.x)) / sum, smoothstep(0.4, 0.6, sum));
|
|
93
|
+
} else {
|
|
94
|
+
v = valueAt(min(ivec2(g), last));
|
|
95
|
+
}
|
|
96
|
+
if (v.y <= 0.0) discard;
|
|
97
|
+
vec3 col = texture(u_ramp, vec2(rampCoord(rampPosition(u_range.xy, v.x)), 0.5)).rgb;
|
|
98
|
+
o_color = vec4(col * (1.0 - edge), v.y * u_style.y);
|
|
99
|
+
}`;
|
|
100
|
+
const RASTER_STATE = { depthWrite: false, depthFunc: 'lequal', cullBack: false, blend: BLEND, polygonOffset: [-1, -2] };
|
|
101
|
+
/** A grid of values laid on a sheet over the ground (`drapeTiles`). */
|
|
102
|
+
export const RASTER_VALUE_MATERIAL = {
|
|
103
|
+
name: 'value-raster',
|
|
104
|
+
attribs: DRAPE_ATTRIBS,
|
|
105
|
+
passes: { color: { vs: RASTER_VS, fs: RASTER_FS } },
|
|
106
|
+
state: { color: RASTER_STATE, data: RASTER_STATE },
|
|
107
|
+
};
|
|
108
|
+
/** Attribute locations of the disc material: the quad corner and one instance (centre and radius). */
|
|
109
|
+
export const POINT_VALUE_ATTRIBS = { a_corner: 0, a_point: 1 };
|
|
110
|
+
const POINT_VS = /* glsl */ `#include <header>
|
|
111
|
+
${VALUE_GLSL}
|
|
112
|
+
in vec2 a_corner;
|
|
113
|
+
in vec4 a_point; // xyz centre, w radius in metres
|
|
114
|
+
uniform sampler2D u_valuesA;
|
|
115
|
+
uniform sampler2D u_valuesB;
|
|
116
|
+
uniform vec4 u_style; // x blend of the two steps, y opacity, z width of the value table in texels, w how much the value sets the size (0–1)
|
|
117
|
+
uniform vec4 u_range; // xy part of the value range the ramp spans, z smallest radius in pixels, w radius scale
|
|
118
|
+
out vec2 v_corner;
|
|
119
|
+
flat out vec2 v_value;
|
|
120
|
+
flat out float v_px;
|
|
121
|
+
void main() {
|
|
122
|
+
ivec2 c = tableCell(gl_InstanceID, int(u_style.z));
|
|
123
|
+
vec2 v = blendSteps(valueOf(valueWord(texelFetch(u_valuesA, c, 0))), valueOf(valueWord(texelFetch(u_valuesB, c, 0))), u_style.x);
|
|
124
|
+
float t = rampPosition(u_range.xy, v.x);
|
|
125
|
+
vec3 p = a_point.xyz;
|
|
126
|
+
// Metres per screen pixel at the point (grows with depth in a perspective view).
|
|
127
|
+
float mpp = max(u_view.x + u_camRight.w * (dot(p, u_camForward.xyz) - u_camForward.w), 1e-4);
|
|
128
|
+
// Area, not radius, follows the value.
|
|
129
|
+
float r = a_point.w * u_range.w * mix(1.0, 0.35 + 0.65 * sqrt(t), u_style.w);
|
|
130
|
+
r = max(r, u_range.z * mpp);
|
|
131
|
+
v_corner = a_corner;
|
|
132
|
+
v_value = vec2(t, v.y);
|
|
133
|
+
v_px = r / mpp;
|
|
134
|
+
vec3 world = p + (u_camRight.xyz * a_corner.x + u_camUp.xyz * a_corner.y) * r;
|
|
135
|
+
gl_Position = v.y > 0.0 ? u_viewProj * vec4(world, 1.0) : vec4(0.0, 0.0, 2.0, 1.0);
|
|
136
|
+
}`;
|
|
137
|
+
const POINT_FS = /* glsl */ `#include <header>
|
|
138
|
+
${VALUE_GLSL}
|
|
139
|
+
uniform sampler2D u_ramp;
|
|
140
|
+
uniform vec4 u_style;
|
|
141
|
+
in vec2 v_corner;
|
|
142
|
+
flat in vec2 v_value;
|
|
143
|
+
flat in float v_px;
|
|
144
|
+
out vec4 o_color;
|
|
145
|
+
void main() {
|
|
146
|
+
float d = length(v_corner);
|
|
147
|
+
// One screen pixel in units of the radius.
|
|
148
|
+
float aa = 1.0 / max(v_px, 1.0);
|
|
149
|
+
float a = 1.0 - smoothstep(1.0 - aa, 1.0, d);
|
|
150
|
+
if (a <= 0.0) discard;
|
|
151
|
+
vec3 col = texture(u_ramp, vec2(rampCoord(v_value.x), 0.5)).rgb;
|
|
152
|
+
// A darker rim keeps overlapping discs apart.
|
|
153
|
+
float rimAt = 1.0 - max(0.14, 1.5 * aa);
|
|
154
|
+
col *= 1.0 - 0.45 * smoothstep(rimAt - aa, rimAt, d);
|
|
155
|
+
o_color = vec4(col, a * v_value.y * u_style.y);
|
|
156
|
+
}`;
|
|
157
|
+
const POINT_STATE = { depthTest: false, depthWrite: false, cullBack: false, blend: BLEND };
|
|
158
|
+
/** Discs that face the view, one per instance, coloured and sized by the value of their table row. */
|
|
159
|
+
export const POINT_VALUE_MATERIAL = {
|
|
160
|
+
name: 'value-points',
|
|
161
|
+
attribs: POINT_VALUE_ATTRIBS,
|
|
162
|
+
passes: { color: { vs: POINT_VS, fs: POINT_FS } },
|
|
163
|
+
state: { color: POINT_STATE, data: POINT_STATE },
|
|
164
|
+
};
|
|
165
|
+
const SHAPE_VS = /* glsl */ `#include <header>
|
|
166
|
+
${VALUE_GLSL}
|
|
167
|
+
in vec3 a_pos;
|
|
168
|
+
in float a_ref; // table row
|
|
169
|
+
uniform sampler2D u_valuesA;
|
|
170
|
+
uniform sampler2D u_valuesB;
|
|
171
|
+
uniform vec4 u_style; // x blend of the two steps, y opacity, z width of the value table in texels, w 1 = rows without a value are drawn too
|
|
172
|
+
uniform vec4 u_range; // xy part of the value range the ramp spans
|
|
173
|
+
out vec3 v_world;
|
|
174
|
+
flat out vec2 v_value;
|
|
175
|
+
void main() {
|
|
176
|
+
ivec2 c = tableCell(int(a_ref + 0.5), int(u_style.z));
|
|
177
|
+
vec2 v = blendSteps(valueOf(valueWord(texelFetch(u_valuesA, c, 0))), valueOf(valueWord(texelFetch(u_valuesB, c, 0))), u_style.x);
|
|
178
|
+
v_value = vec2(rampPosition(u_range.xy, v.x), v.y);
|
|
179
|
+
v_world = a_pos;
|
|
180
|
+
bool shown = v.y > 0.0 || u_style.w > 0.5;
|
|
181
|
+
gl_Position = shown ? u_viewProj * vec4(a_pos, 1.0) : vec4(0.0, 0.0, 2.0, 1.0);
|
|
182
|
+
}`;
|
|
183
|
+
const SHAPE_FS = /* glsl */ `#include <header>
|
|
184
|
+
${VALUE_GLSL}
|
|
185
|
+
uniform sampler2D u_ramp;
|
|
186
|
+
uniform vec4 u_style;
|
|
187
|
+
uniform vec4 u_neutral; // rgb colour of rows without a value
|
|
188
|
+
in vec3 v_world;
|
|
189
|
+
flat in vec2 v_value;
|
|
190
|
+
out vec4 o_color;
|
|
191
|
+
void main() {
|
|
192
|
+
// Face direction from the surface itself: the mesh carries no normals.
|
|
193
|
+
vec3 n = cross(dFdx(v_world), dFdy(v_world));
|
|
194
|
+
float len = length(n);
|
|
195
|
+
n = len > 1e-12 ? n / len : vec3(0.0, 1.0, 0.0);
|
|
196
|
+
// Faces that look up show the ramp colour itself; upright faces a little darker, so the shape reads as a solid.
|
|
197
|
+
float shade = 0.8 + 0.2 * abs(n.y) - 0.06 * abs(n.z);
|
|
198
|
+
vec3 col = mix(u_neutral.rgb, texture(u_ramp, vec2(rampCoord(v_value.x), 0.5)).rgb, v_value.y);
|
|
199
|
+
o_color = vec4(col * shade, u_style.y * max(v_value.y, u_style.w));
|
|
200
|
+
}`;
|
|
201
|
+
const SHAPE_STATE = { depthFunc: 'lequal', blend: BLEND, polygonOffset: [-1, -2] };
|
|
202
|
+
/** Prisms (`prismMesh`) coloured by the value of the table row each of them carries. */
|
|
203
|
+
export const SHAPE_VALUE_MATERIAL = {
|
|
204
|
+
name: 'value-shapes',
|
|
205
|
+
attribs: PRISM_ATTRIBS,
|
|
206
|
+
passes: { color: { vs: SHAPE_VS, fs: SHAPE_FS } },
|
|
207
|
+
state: { color: SHAPE_STATE, data: SHAPE_STATE },
|
|
208
|
+
};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import type { MeshData, TextureData, VertexLayout } from '../base/data.ts';
|
|
2
|
+
import type { RGB, Vec3 } from '../base/math.ts';
|
|
3
|
+
import type { Device, Texture } from '../gpu/index.ts';
|
|
4
|
+
import { PieceLayer } from './pieces.ts';
|
|
5
|
+
import { MeshLayer } from './renderer.ts';
|
|
6
|
+
import type { DrawContext, Renderer } from './renderer.ts';
|
|
7
|
+
/**
|
|
8
|
+
* The two time steps a value layer shows, as textures of `width` × `height` words. A step is recognised by its array:
|
|
9
|
+
* showing an array that is already loaded costs nothing, so walking through steps in order uploads one texture per
|
|
10
|
+
* step. Pass a new array when the values of a step change.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ValueSteps {
|
|
13
|
+
readonly width: number;
|
|
14
|
+
readonly height: number;
|
|
15
|
+
/** Blend between the two shown steps, 0–1. */
|
|
16
|
+
mix: number;
|
|
17
|
+
private readonly device;
|
|
18
|
+
private held;
|
|
19
|
+
private second;
|
|
20
|
+
constructor(device: Device, width: number, height: number);
|
|
21
|
+
/** False until the first `show`. */
|
|
22
|
+
get ready(): boolean;
|
|
23
|
+
/** Texture of the first shown step (null before the first `show`). */
|
|
24
|
+
get a(): Texture | null;
|
|
25
|
+
/** Texture of the second shown step; the first one again when only one step is shown. */
|
|
26
|
+
get b(): Texture | null;
|
|
27
|
+
/** Shows step `a`, or a blend from `a` to `b` by `mix` (0–1). Each array holds `width` × `height` words, row by row. */
|
|
28
|
+
show(a: Uint16Array, b?: Uint16Array, mix?: number): void;
|
|
29
|
+
private load;
|
|
30
|
+
dispose(): void;
|
|
31
|
+
}
|
|
32
|
+
/** What all value layers let the caller change while they are shown. */
|
|
33
|
+
export interface ValueStyle {
|
|
34
|
+
/** 0–1. */
|
|
35
|
+
opacity?: number;
|
|
36
|
+
/** The part of the value range the ramp spans, both ends 0–1 of the range the words were quantised to. Default [0, 1]. */
|
|
37
|
+
range?: readonly [number, number];
|
|
38
|
+
}
|
|
39
|
+
/** A regular grid in the plane of the ground: cell (0, 0) starts at (`x0`, `z0`), rows run toward +z. */
|
|
40
|
+
export interface ValueGrid {
|
|
41
|
+
x0: number;
|
|
42
|
+
z0: number;
|
|
43
|
+
/** Cell size in metres. */
|
|
44
|
+
cellX: number;
|
|
45
|
+
cellZ: number;
|
|
46
|
+
cols: number;
|
|
47
|
+
rows: number;
|
|
48
|
+
}
|
|
49
|
+
export interface RasterValueOptions extends ValueStyle {
|
|
50
|
+
grid: ValueGrid;
|
|
51
|
+
/** Colour ramp (`colorRamp`). */
|
|
52
|
+
ramp: TextureData;
|
|
53
|
+
/** Blend values between cell centres instead of showing flat cells. Default true. Not used with `lookup`. */
|
|
54
|
+
smooth?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Cells that name table rows instead of holding values: `cells` has one word per grid cell (row + 1, 0 = nothing
|
|
57
|
+
* here), and a time step is then a table of `rows` words (laid out by `valueTableSize`). Borders between rows are
|
|
58
|
+
* darkened by `outline` (0–1, default 0.35).
|
|
59
|
+
*/
|
|
60
|
+
lookup?: {
|
|
61
|
+
cells: Uint16Array;
|
|
62
|
+
rows: number;
|
|
63
|
+
outline?: number;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/** A sheet tile as `drapeTiles` returns it. */
|
|
67
|
+
export interface ValueSheetTile {
|
|
68
|
+
mesh: MeshData;
|
|
69
|
+
min: Vec3;
|
|
70
|
+
max: Vec3;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* A grid of values on a sheet over the ground. The sheet (tiles from `drapeTiles`) only carries the surface; which
|
|
74
|
+
* cell a fragment shows follows from its position, so the grid and the sheet need not match in size or density.
|
|
75
|
+
* Outside the grid and in cells without a value nothing is drawn. Draws in the `color` and `data` passes, blended,
|
|
76
|
+
* without writing depth; register it after the layers it should lie on.
|
|
77
|
+
*/
|
|
78
|
+
export declare class RasterValueLayer extends PieceLayer {
|
|
79
|
+
readonly steps: ValueSteps;
|
|
80
|
+
readonly grid: ValueGrid;
|
|
81
|
+
private readonly renderer;
|
|
82
|
+
private rampTexture;
|
|
83
|
+
private readonly cellTexture;
|
|
84
|
+
private readonly lookup;
|
|
85
|
+
private readonly outline;
|
|
86
|
+
private opacity;
|
|
87
|
+
private range;
|
|
88
|
+
private smooth;
|
|
89
|
+
constructor(renderer: Renderer, o: RasterValueOptions);
|
|
90
|
+
/** Uploads sheet tiles and adds them as pieces. */
|
|
91
|
+
addTiles(tiles: readonly ValueSheetTile[]): void;
|
|
92
|
+
/** Shows one time step, or a blend of two (see `ValueSteps.show`). */
|
|
93
|
+
show(a: Uint16Array, b?: Uint16Array, mix?: number): void;
|
|
94
|
+
setStyle(s: ValueStyle & {
|
|
95
|
+
smooth?: boolean;
|
|
96
|
+
}): void;
|
|
97
|
+
/** Replaces the colour ramp. */
|
|
98
|
+
setRamp(ramp: TextureData): void;
|
|
99
|
+
private sync;
|
|
100
|
+
draw(ctx: DrawContext): void;
|
|
101
|
+
/** Frees the sheet, the ramp and the step textures. The caller takes the layer out of the renderer. */
|
|
102
|
+
dispose(): void;
|
|
103
|
+
}
|
|
104
|
+
/** One point per instance: centre x, y, z and radius in metres (`a_point`). */
|
|
105
|
+
export declare const POINT_VALUE_LAYOUT: VertexLayout;
|
|
106
|
+
export interface PointValueOptions extends ValueStyle {
|
|
107
|
+
/** x, y, z and radius in metres for every point; point i takes row i of the value table. */
|
|
108
|
+
points: Float32Array;
|
|
109
|
+
/** Colour ramp (`colorRamp`). */
|
|
110
|
+
ramp: TextureData;
|
|
111
|
+
/** How much the value sets the size, 0 (all points keep their radius) to 1 (area follows the value). Default 0. */
|
|
112
|
+
sizeByValue?: number;
|
|
113
|
+
/** No disc gets smaller than this many pixels in radius. Default 2. */
|
|
114
|
+
minRadiusPx?: number;
|
|
115
|
+
/** Multiplies every radius. Default 1. */
|
|
116
|
+
radiusScale?: number;
|
|
117
|
+
/** Hide discs behind nearer surfaces. Default false: the discs lie over the whole image. */
|
|
118
|
+
depthTest?: boolean;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Discs that face the view, coloured (and optionally sized) by a value per point; one instanced draw call. A time
|
|
122
|
+
* step is a table of one word per point (laid out by `valueTableSize`); points without a value are not drawn.
|
|
123
|
+
*/
|
|
124
|
+
export declare class PointValueLayer extends MeshLayer {
|
|
125
|
+
readonly steps: ValueSteps;
|
|
126
|
+
readonly count: number;
|
|
127
|
+
private readonly renderer;
|
|
128
|
+
private readonly instances;
|
|
129
|
+
private rampTexture;
|
|
130
|
+
private opacity;
|
|
131
|
+
private range;
|
|
132
|
+
private sizeByValue;
|
|
133
|
+
private minRadiusPx;
|
|
134
|
+
private radiusScale;
|
|
135
|
+
constructor(renderer: Renderer, o: PointValueOptions);
|
|
136
|
+
/** Shows one time step, or a blend of two (see `ValueSteps.show`). */
|
|
137
|
+
show(a: Uint16Array, b?: Uint16Array, mix?: number): void;
|
|
138
|
+
setStyle(s: ValueStyle & {
|
|
139
|
+
sizeByValue?: number;
|
|
140
|
+
minRadiusPx?: number;
|
|
141
|
+
radiusScale?: number;
|
|
142
|
+
}): void;
|
|
143
|
+
private sync;
|
|
144
|
+
draw(ctx: DrawContext): void;
|
|
145
|
+
/** Frees the points, the ramp and the step textures. The caller takes the layer out of the renderer. */
|
|
146
|
+
dispose(): void;
|
|
147
|
+
}
|
|
148
|
+
export interface ShapeValueOptions extends ValueStyle {
|
|
149
|
+
/** Number of table rows the prisms refer to (largest `ref` + 1). */
|
|
150
|
+
rows: number;
|
|
151
|
+
/** Colour ramp (`colorRamp`). */
|
|
152
|
+
ramp: TextureData;
|
|
153
|
+
/** Colour of prisms whose row has no value. Default: they are not drawn. */
|
|
154
|
+
neutral?: RGB | null;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Prisms tinted by a value per table row (`prismMesh`: every prism carries its row). A time step is a table of one
|
|
158
|
+
* word per row (laid out by `valueTableSize`). Blended over what is already drawn, with depth, so register it after
|
|
159
|
+
* the layers it wraps. Meshes are added as pieces and culled per box.
|
|
160
|
+
*/
|
|
161
|
+
export declare class ShapeValueLayer extends PieceLayer {
|
|
162
|
+
readonly steps: ValueSteps;
|
|
163
|
+
private readonly renderer;
|
|
164
|
+
private rampTexture;
|
|
165
|
+
private opacity;
|
|
166
|
+
private range;
|
|
167
|
+
private neutral;
|
|
168
|
+
constructor(renderer: Renderer, o: ShapeValueOptions);
|
|
169
|
+
/** Uploads a prism mesh and adds it as one piece with its box. */
|
|
170
|
+
addShapes(shapes: ValueSheetTile): void;
|
|
171
|
+
/** Shows one time step, or a blend of two (see `ValueSteps.show`). */
|
|
172
|
+
show(a: Uint16Array, b?: Uint16Array, mix?: number): void;
|
|
173
|
+
setStyle(s: ValueStyle & {
|
|
174
|
+
neutral?: RGB | null;
|
|
175
|
+
}): void;
|
|
176
|
+
private sync;
|
|
177
|
+
draw(ctx: DrawContext): void;
|
|
178
|
+
/** Frees the prisms, the ramp and the step textures. The caller takes the layer out of the renderer. */
|
|
179
|
+
dispose(): void;
|
|
180
|
+
}
|