@thunderclap-engine/engine 0.0.0-stage → 1.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.
- package/CHANGELOG.md +390 -0
- package/LICENSE +21 -0
- package/README.md +333 -2
- package/dist/analytics/analytics.d.ts +80 -0
- package/dist/analytics/analytics.js +129 -0
- package/dist/analytics/index.d.ts +1 -0
- package/dist/analytics/index.js +1 -0
- package/dist/anim/aim.d.ts +43 -0
- package/dist/anim/aim.js +157 -0
- package/dist/anim/clip.d.ts +98 -0
- package/dist/anim/clip.js +282 -0
- package/dist/anim/compress.d.ts +65 -0
- package/dist/anim/compress.js +339 -0
- package/dist/anim/foot-ik.d.ts +74 -0
- package/dist/anim/foot-ik.js +241 -0
- package/dist/anim/graph.d.ts +153 -0
- package/dist/anim/graph.js +532 -0
- package/dist/anim/ik.d.ts +105 -0
- package/dist/anim/ik.js +435 -0
- package/dist/anim/index.d.ts +36 -0
- package/dist/anim/index.js +21 -0
- package/dist/anim/match.d.ts +66 -0
- package/dist/anim/match.js +153 -0
- package/dist/anim/mixer.d.ts +113 -0
- package/dist/anim/mixer.js +314 -0
- package/dist/anim/morph.d.ts +41 -0
- package/dist/anim/morph.js +94 -0
- package/dist/anim/pose.d.ts +74 -0
- package/dist/anim/pose.js +254 -0
- package/dist/anim/quat.d.ts +44 -0
- package/dist/anim/quat.js +187 -0
- package/dist/anim/retarget.d.ts +97 -0
- package/dist/anim/retarget.js +366 -0
- package/dist/anim/root-motion.d.ts +44 -0
- package/dist/anim/root-motion.js +224 -0
- package/dist/anim/skin-pose.d.ts +39 -0
- package/dist/anim/skin-pose.js +53 -0
- package/dist/anim/socket.d.ts +47 -0
- package/dist/anim/socket.js +84 -0
- package/dist/anim/spring-chain.d.ts +73 -0
- package/dist/anim/spring-chain.js +294 -0
- package/dist/assets/atlas.d.ts +90 -0
- package/dist/assets/atlas.js +212 -0
- package/dist/assets/baked.d.ts +33 -0
- package/dist/assets/baked.js +38 -0
- package/dist/assets/bundle.d.ts +88 -0
- package/dist/assets/bundle.js +464 -0
- package/dist/assets/cache.d.ts +56 -0
- package/dist/assets/cache.js +123 -0
- package/dist/assets/gltf-load.d.ts +252 -0
- package/dist/assets/gltf-load.js +661 -0
- package/dist/assets/gltf-skin.d.ts +36 -0
- package/dist/assets/gltf-skin.js +109 -0
- package/dist/assets/gltf.d.ts +706 -0
- package/dist/assets/gltf.js +1376 -0
- package/dist/assets/index.d.ts +20 -0
- package/dist/assets/index.js +10 -0
- package/dist/assets/ktx2.d.ts +71 -0
- package/dist/assets/ktx2.js +213 -0
- package/dist/assets/manifest.d.ts +79 -0
- package/dist/assets/manifest.js +7 -0
- package/dist/assets/meshopt.d.ts +23 -0
- package/dist/assets/meshopt.js +403 -0
- package/dist/audio/audio.d.ts +733 -0
- package/dist/audio/audio.js +2013 -0
- package/dist/audio/dsp.d.ts +61 -0
- package/dist/audio/dsp.js +159 -0
- package/dist/audio/duck.d.ts +44 -0
- package/dist/audio/duck.js +101 -0
- package/dist/audio/envelope.d.ts +53 -0
- package/dist/audio/envelope.js +106 -0
- package/dist/audio/index.d.ts +13 -0
- package/dist/audio/index.js +14 -0
- package/dist/audio/music.d.ts +113 -0
- package/dist/audio/music.js +548 -0
- package/dist/audio/occlusion.d.ts +55 -0
- package/dist/audio/occlusion.js +61 -0
- package/dist/audio/persist.d.ts +23 -0
- package/dist/audio/persist.js +27 -0
- package/dist/audio/recipes.d.ts +55 -0
- package/dist/audio/recipes.js +227 -0
- package/dist/audio/send.d.ts +41 -0
- package/dist/audio/send.js +118 -0
- package/dist/audio/sprites.d.ts +59 -0
- package/dist/audio/sprites.js +43 -0
- package/dist/audio/synth.d.ts +103 -0
- package/dist/audio/synth.js +197 -0
- package/dist/audio/variations.d.ts +25 -0
- package/dist/audio/variations.js +55 -0
- package/dist/audio/zones.d.ts +100 -0
- package/dist/audio/zones.js +167 -0
- package/dist/core/detached-surface.d.ts +44 -0
- package/dist/core/detached-surface.js +104 -0
- package/dist/core/events.d.ts +24 -0
- package/dist/core/events.js +43 -0
- package/dist/core/game.d.ts +409 -0
- package/dist/core/game.js +530 -0
- package/dist/core/hash.d.ts +24 -0
- package/dist/core/hash.js +49 -0
- package/dist/core/index.d.ts +17 -0
- package/dist/core/index.js +9 -0
- package/dist/core/loop.d.ts +113 -0
- package/dist/core/loop.js +185 -0
- package/dist/core/math.d.ts +58 -0
- package/dist/core/math.js +210 -0
- package/dist/core/noise.d.ts +40 -0
- package/dist/core/noise.js +247 -0
- package/dist/core/pool.d.ts +42 -0
- package/dist/core/pool.js +85 -0
- package/dist/core/random.d.ts +61 -0
- package/dist/core/random.js +199 -0
- package/dist/core/scene.d.ts +79 -0
- package/dist/core/scene.js +195 -0
- package/dist/core/timer.d.ts +66 -0
- package/dist/core/timer.js +286 -0
- package/dist/fx/billboard-wgsl.d.ts +29 -0
- package/dist/fx/billboard-wgsl.js +158 -0
- package/dist/fx/billboard.d.ts +249 -0
- package/dist/fx/billboard.js +702 -0
- package/dist/fx/debug-draw.d.ts +127 -0
- package/dist/fx/debug-draw.js +523 -0
- package/dist/fx/debug-wgsl.d.ts +7 -0
- package/dist/fx/debug-wgsl.js +32 -0
- package/dist/fx/decals-wgsl.d.ts +15 -0
- package/dist/fx/decals-wgsl.js +173 -0
- package/dist/fx/decals.d.ts +216 -0
- package/dist/fx/decals.js +607 -0
- package/dist/fx/effect.d.ts +129 -0
- package/dist/fx/effect.js +349 -0
- package/dist/fx/effects/hit-spark.json +48 -0
- package/dist/fx/effects/index.d.ts +8 -0
- package/dist/fx/effects/index.js +9 -0
- package/dist/fx/effects/magic-aura.json +47 -0
- package/dist/fx/effects/smoke-puff.json +34 -0
- package/dist/fx/emit-surface.d.ts +40 -0
- package/dist/fx/emit-surface.js +124 -0
- package/dist/fx/flicker.d.ts +30 -0
- package/dist/fx/flicker.js +42 -0
- package/dist/fx/index.d.ts +31 -0
- package/dist/fx/index.js +20 -0
- package/dist/fx/particles-wgsl.d.ts +57 -0
- package/dist/fx/particles-wgsl.js +828 -0
- package/dist/fx/particles.d.ts +566 -0
- package/dist/fx/particles.js +1533 -0
- package/dist/fx/random.d.ts +15 -0
- package/dist/fx/random.js +20 -0
- package/dist/fx/sky-wgsl.d.ts +23 -0
- package/dist/fx/sky-wgsl.js +127 -0
- package/dist/fx/sky.d.ts +96 -0
- package/dist/fx/sky.js +175 -0
- package/dist/fx/text-atlas.d.ts +143 -0
- package/dist/fx/text-atlas.js +327 -0
- package/dist/fx/trail-wgsl.d.ts +11 -0
- package/dist/fx/trail-wgsl.js +42 -0
- package/dist/fx/trail.d.ts +194 -0
- package/dist/fx/trail.js +555 -0
- package/dist/fx/water-wgsl.d.ts +34 -0
- package/dist/fx/water-wgsl.js +197 -0
- package/dist/fx/water.d.ts +176 -0
- package/dist/fx/water.js +371 -0
- package/dist/geom/collide/bvh.d.ts +151 -0
- package/dist/geom/collide/bvh.js +493 -0
- package/dist/geom/collide/debug.d.ts +14 -0
- package/dist/geom/collide/debug.js +74 -0
- package/dist/geom/collide/grid.d.ts +26 -0
- package/dist/geom/collide/grid.js +91 -0
- package/dist/geom/collide/index.d.ts +8 -0
- package/dist/geom/collide/index.js +8 -0
- package/dist/geom/collide/queries.d.ts +70 -0
- package/dist/geom/collide/queries.js +583 -0
- package/dist/geom/collide/serialize.d.ts +14 -0
- package/dist/geom/collide/serialize.js +145 -0
- package/dist/geom/collide/shapes.d.ts +161 -0
- package/dist/geom/collide/shapes.js +686 -0
- package/dist/geom/collide/slide.d.ts +66 -0
- package/dist/geom/collide/slide.js +375 -0
- package/dist/geom/collide/tile-slide.d.ts +88 -0
- package/dist/geom/collide/tile-slide.js +255 -0
- package/dist/geom/geometry.d.ts +95 -0
- package/dist/geom/geometry.js +322 -0
- package/dist/geom/heightfield.d.ts +72 -0
- package/dist/geom/heightfield.js +295 -0
- package/dist/geom/hull.d.ts +27 -0
- package/dist/geom/hull.js +279 -0
- package/dist/geom/index.d.ts +35 -0
- package/dist/geom/index.js +23 -0
- package/dist/geom/iso.d.ts +74 -0
- package/dist/geom/iso.js +89 -0
- package/dist/geom/lod.d.ts +29 -0
- package/dist/geom/lod.js +27 -0
- package/dist/geom/ops.d.ts +47 -0
- package/dist/geom/ops.js +285 -0
- package/dist/geom/primitives.d.ts +97 -0
- package/dist/geom/primitives.js +359 -0
- package/dist/geom/shapes.d.ts +43 -0
- package/dist/geom/shapes.js +88 -0
- package/dist/geom/simplify.d.ts +38 -0
- package/dist/geom/simplify.js +519 -0
- package/dist/geom/split.d.ts +37 -0
- package/dist/geom/split.js +413 -0
- package/dist/geom/sweep.d.ts +83 -0
- package/dist/geom/sweep.js +534 -0
- package/dist/geom/tangents.d.ts +16 -0
- package/dist/geom/tangents.js +124 -0
- package/dist/geom/triangulate.d.ts +19 -0
- package/dist/geom/triangulate.js +147 -0
- package/dist/host/default.d.ts +10 -0
- package/dist/host/default.js +10 -0
- package/dist/host/index.d.ts +4 -0
- package/dist/host/index.js +3 -0
- package/dist/host/types.d.ts +144 -0
- package/dist/host/types.js +1 -0
- package/dist/host/web-links.d.ts +38 -0
- package/dist/host/web-links.js +110 -0
- package/dist/host/web.d.ts +30 -0
- package/dist/host/web.js +216 -0
- package/dist/host/xr.d.ts +24 -0
- package/dist/host/xr.js +59 -0
- package/dist/i18n/i18n.d.ts +59 -0
- package/dist/i18n/i18n.js +241 -0
- package/dist/i18n/index.d.ts +3 -0
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/message.d.ts +72 -0
- package/dist/i18n/message.js +369 -0
- package/dist/i18n/negotiate.d.ts +17 -0
- package/dist/i18n/negotiate.js +58 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +1 -0
- package/dist/input/bindings.d.ts +31 -0
- package/dist/input/bindings.js +141 -0
- package/dist/input/clock.d.ts +44 -0
- package/dist/input/clock.js +49 -0
- package/dist/input/follow.d.ts +133 -0
- package/dist/input/follow.js +218 -0
- package/dist/input/gestures.d.ts +281 -0
- package/dist/input/gestures.js +662 -0
- package/dist/input/glyphs.d.ts +35 -0
- package/dist/input/glyphs.js +216 -0
- package/dist/input/gyro.d.ts +85 -0
- package/dist/input/gyro.js +140 -0
- package/dist/input/index.d.ts +19 -0
- package/dist/input/index.js +16 -0
- package/dist/input/input.d.ts +543 -0
- package/dist/input/input.js +1492 -0
- package/dist/input/look.d.ts +327 -0
- package/dist/input/look.js +681 -0
- package/dist/input/magnify.d.ts +177 -0
- package/dist/input/magnify.js +131 -0
- package/dist/input/pointer-dispatch.d.ts +138 -0
- package/dist/input/pointer-dispatch.js +180 -0
- package/dist/input/pointer-router.d.ts +204 -0
- package/dist/input/pointer-router.js +533 -0
- package/dist/input/pointer-sources.d.ts +164 -0
- package/dist/input/pointer-sources.js +306 -0
- package/dist/input/rays.d.ts +138 -0
- package/dist/input/rays.js +615 -0
- package/dist/input/record.d.ts +209 -0
- package/dist/input/record.js +601 -0
- package/dist/input/touch-zones.d.ts +147 -0
- package/dist/input/touch-zones.js +300 -0
- package/dist/input/types.d.ts +158 -0
- package/dist/input/types.js +1 -0
- package/dist/input/xr-source.d.ts +53 -0
- package/dist/input/xr-source.js +164 -0
- package/dist/nav/astar.d.ts +45 -0
- package/dist/nav/astar.js +182 -0
- package/dist/nav/corridor.d.ts +40 -0
- package/dist/nav/corridor.js +95 -0
- package/dist/nav/crowd.d.ts +94 -0
- package/dist/nav/crowd.js +624 -0
- package/dist/nav/flow.d.ts +61 -0
- package/dist/nav/flow.js +193 -0
- package/dist/nav/grid.d.ts +108 -0
- package/dist/nav/grid.js +210 -0
- package/dist/nav/heap.d.ts +22 -0
- package/dist/nav/heap.js +92 -0
- package/dist/nav/index.d.ts +37 -0
- package/dist/nav/index.js +19 -0
- package/dist/nav/mesh/areas.d.ts +44 -0
- package/dist/nav/mesh/areas.js +98 -0
- package/dist/nav/mesh/bake-options.d.ts +33 -0
- package/dist/nav/mesh/bake-options.js +76 -0
- package/dist/nav/mesh/contour.d.ts +22 -0
- package/dist/nav/mesh/contour.js +323 -0
- package/dist/nav/mesh/flow3.d.ts +35 -0
- package/dist/nav/mesh/flow3.js +229 -0
- package/dist/nav/mesh/links.d.ts +38 -0
- package/dist/nav/mesh/links.js +72 -0
- package/dist/nav/mesh/mesh-path.d.ts +152 -0
- package/dist/nav/mesh/mesh-path.js +643 -0
- package/dist/nav/mesh/mesh-reach.d.ts +78 -0
- package/dist/nav/mesh/mesh-reach.js +450 -0
- package/dist/nav/mesh/navmesh.d.ts +117 -0
- package/dist/nav/mesh/navmesh.js +647 -0
- package/dist/nav/mesh/polymesh.d.ts +24 -0
- package/dist/nav/mesh/polymesh.js +384 -0
- package/dist/nav/mesh/regions.d.ts +12 -0
- package/dist/nav/mesh/regions.js +367 -0
- package/dist/nav/mesh/serialize.d.ts +13 -0
- package/dist/nav/mesh/serialize.js +197 -0
- package/dist/nav/mesh/voxelize.d.ts +111 -0
- package/dist/nav/mesh/voxelize.js +552 -0
- package/dist/nav/obstacles.d.ts +75 -0
- package/dist/nav/obstacles.js +294 -0
- package/dist/nav/path.d.ts +59 -0
- package/dist/nav/path.js +177 -0
- package/dist/nav/query-queue.d.ts +46 -0
- package/dist/nav/query-queue.js +308 -0
- package/dist/nav/reach.d.ts +53 -0
- package/dist/nav/reach.js +148 -0
- package/dist/nav/steer.d.ts +36 -0
- package/dist/nav/steer.js +78 -0
- package/dist/platform/boot.d.ts +28 -0
- package/dist/platform/boot.js +43 -0
- package/dist/platform/device-mode.d.ts +40 -0
- package/dist/platform/device-mode.js +104 -0
- package/dist/platform/device.d.ts +31 -0
- package/dist/platform/device.js +91 -0
- package/dist/platform/environment.d.ts +42 -0
- package/dist/platform/environment.js +82 -0
- package/dist/platform/gpu.d.ts +40 -0
- package/dist/platform/gpu.js +57 -0
- package/dist/platform/index.d.ts +18 -0
- package/dist/platform/index.js +10 -0
- package/dist/platform/letterbox.d.ts +43 -0
- package/dist/platform/letterbox.js +57 -0
- package/dist/platform/links.d.ts +20 -0
- package/dist/platform/links.js +43 -0
- package/dist/platform/screens.d.ts +36 -0
- package/dist/platform/screens.js +138 -0
- package/dist/platform/surface.d.ts +72 -0
- package/dist/platform/surface.js +157 -0
- package/dist/platform/xr-fake.d.ts +168 -0
- package/dist/platform/xr-fake.js +434 -0
- package/dist/platform/xr-surface.d.ts +120 -0
- package/dist/platform/xr-surface.js +214 -0
- package/dist/platform/xr-types.d.ts +262 -0
- package/dist/post/ao.d.ts +12 -0
- package/dist/post/ao.js +136 -0
- package/dist/post/blend.d.ts +27 -0
- package/dist/post/blend.js +129 -0
- package/dist/post/depth-pass.d.ts +43 -0
- package/dist/post/depth-pass.js +118 -0
- package/dist/post/dof.d.ts +1 -0
- package/dist/post/dof.js +66 -0
- package/dist/post/exposure.d.ts +80 -0
- package/dist/post/exposure.js +322 -0
- package/dist/post/index.d.ts +12 -0
- package/dist/post/index.js +11 -0
- package/dist/post/lens-dirt.d.ts +13 -0
- package/dist/post/lens-dirt.js +91 -0
- package/dist/post/lut.d.ts +19 -0
- package/dist/post/lut.js +50 -0
- package/dist/post/motion-blur.d.ts +9 -0
- package/dist/post/motion-blur.js +78 -0
- package/dist/post/post-stack.d.ts +302 -0
- package/dist/post/post-stack.js +1137 -0
- package/dist/post/settings.d.ts +485 -0
- package/dist/post/settings.js +416 -0
- package/dist/post/shaders.d.ts +25 -0
- package/dist/post/shaders.js +410 -0
- package/dist/post/ssr.d.ts +16 -0
- package/dist/post/ssr.js +155 -0
- package/dist/post/taa.d.ts +74 -0
- package/dist/post/taa.js +235 -0
- package/dist/post/white-balance.d.ts +25 -0
- package/dist/post/white-balance.js +98 -0
- package/dist/render/bindings.d.ts +98 -0
- package/dist/render/bindings.js +281 -0
- package/dist/render/blend.d.ts +13 -0
- package/dist/render/blend.js +26 -0
- package/dist/render/camera-2d.d.ts +72 -0
- package/dist/render/camera-2d.js +92 -0
- package/dist/render/camera.d.ts +302 -0
- package/dist/render/camera.js +671 -0
- package/dist/render/color.d.ts +16 -0
- package/dist/render/color.js +41 -0
- package/dist/render/compressed.d.ts +104 -0
- package/dist/render/compressed.js +248 -0
- package/dist/render/diagnostics.d.ts +15 -0
- package/dist/render/diagnostics.js +43 -0
- package/dist/render/dynamic-resolution.d.ts +70 -0
- package/dist/render/dynamic-resolution.js +126 -0
- package/dist/render/fake-gpu.d.ts +204 -0
- package/dist/render/fake-gpu.js +426 -0
- package/dist/render/flipbook.d.ts +56 -0
- package/dist/render/flipbook.js +87 -0
- package/dist/render/frame.d.ts +278 -0
- package/dist/render/frame.js +174 -0
- package/dist/render/fullscreen.d.ts +54 -0
- package/dist/render/fullscreen.js +91 -0
- package/dist/render/gpu-timer.d.ts +73 -0
- package/dist/render/gpu-timer.js +186 -0
- package/dist/render/index.d.ts +53 -0
- package/dist/render/index.js +29 -0
- package/dist/render/instance-list.d.ts +185 -0
- package/dist/render/instance-list.js +547 -0
- package/dist/render/lights.d.ts +181 -0
- package/dist/render/lights.js +233 -0
- package/dist/render/lod.d.ts +54 -0
- package/dist/render/lod.js +52 -0
- package/dist/render/material.d.ts +165 -0
- package/dist/render/material.js +292 -0
- package/dist/render/mesh.d.ts +284 -0
- package/dist/render/mesh.js +472 -0
- package/dist/render/mipmap.d.ts +16 -0
- package/dist/render/mipmap.js +121 -0
- package/dist/render/parallax.d.ts +50 -0
- package/dist/render/parallax.js +47 -0
- package/dist/render/pbr-wgsl.d.ts +31 -0
- package/dist/render/pbr-wgsl.js +119 -0
- package/dist/render/ping-pong.d.ts +42 -0
- package/dist/render/ping-pong.js +74 -0
- package/dist/render/renderer.d.ts +741 -0
- package/dist/render/renderer.js +2486 -0
- package/dist/render/scene-pipelines.d.ts +44 -0
- package/dist/render/scene-pipelines.js +92 -0
- package/dist/render/scene-target.d.ts +170 -0
- package/dist/render/scene-target.js +450 -0
- package/dist/render/shadow.d.ts +74 -0
- package/dist/render/shadow.js +208 -0
- package/dist/render/skin.d.ts +112 -0
- package/dist/render/skin.js +240 -0
- package/dist/render/snapshot.d.ts +36 -0
- package/dist/render/snapshot.js +34 -0
- package/dist/render/standard.d.ts +162 -0
- package/dist/render/standard.js +263 -0
- package/dist/render/texture.d.ts +142 -0
- package/dist/render/texture.js +228 -0
- package/dist/render/tile-layer.d.ts +110 -0
- package/dist/render/tile-layer.js +304 -0
- package/dist/render/transform.d.ts +115 -0
- package/dist/render/transform.js +318 -0
- package/dist/render/wgsl.d.ts +131 -0
- package/dist/render/wgsl.js +528 -0
- package/dist/save/codec.d.ts +49 -0
- package/dist/save/codec.js +169 -0
- package/dist/save/index.d.ts +8 -0
- package/dist/save/index.js +8 -0
- package/dist/save/journal.d.ts +24 -0
- package/dist/save/journal.js +102 -0
- package/dist/save/migrate.d.ts +15 -0
- package/dist/save/migrate.js +37 -0
- package/dist/save/schema.d.ts +72 -0
- package/dist/save/schema.js +154 -0
- package/dist/save/settings.d.ts +28 -0
- package/dist/save/settings.js +59 -0
- package/dist/save/slots.d.ts +56 -0
- package/dist/save/slots.js +200 -0
- package/dist/save/storage.d.ts +35 -0
- package/dist/save/storage.js +62 -0
- package/dist/save/store.d.ts +114 -0
- package/dist/save/store.js +269 -0
- package/dist/testing/fake-host.d.ts +103 -0
- package/dist/testing/fake-host.js +163 -0
- package/dist/testing/fixed-clock.d.ts +25 -0
- package/dist/testing/fixed-clock.js +30 -0
- package/dist/testing/index.d.ts +4 -0
- package/dist/testing/index.js +5 -0
- package/dist/testing/test-game.d.ts +76 -0
- package/dist/testing/test-game.js +92 -0
- package/dist/tween/ease.d.ts +77 -0
- package/dist/tween/ease.js +192 -0
- package/dist/tween/index.d.ts +8 -0
- package/dist/tween/index.js +7 -0
- package/dist/tween/timeline.d.ts +78 -0
- package/dist/tween/timeline.js +269 -0
- package/dist/tween/tween.d.ts +168 -0
- package/dist/tween/tween.js +320 -0
- package/dist/ui/anchor.d.ts +206 -0
- package/dist/ui/anchor.js +307 -0
- package/dist/ui/caption.d.ts +122 -0
- package/dist/ui/caption.js +286 -0
- package/dist/ui/cursor.d.ts +105 -0
- package/dist/ui/cursor.js +261 -0
- package/dist/ui/dom.d.ts +30 -0
- package/dist/ui/dom.js +92 -0
- package/dist/ui/floats.d.ts +86 -0
- package/dist/ui/floats.js +260 -0
- package/dist/ui/hud.d.ts +198 -0
- package/dist/ui/hud.js +431 -0
- package/dist/ui/index.d.ts +37 -0
- package/dist/ui/index.js +34 -0
- package/dist/ui/inventory-card.d.ts +52 -0
- package/dist/ui/inventory-card.js +173 -0
- package/dist/ui/inventory-context.d.ts +29 -0
- package/dist/ui/inventory-context.js +125 -0
- package/dist/ui/inventory-drag.d.ts +63 -0
- package/dist/ui/inventory-drag.js +394 -0
- package/dist/ui/inventory-grid.d.ts +66 -0
- package/dist/ui/inventory-grid.js +625 -0
- package/dist/ui/inventory-radial.d.ts +39 -0
- package/dist/ui/inventory-radial.js +168 -0
- package/dist/ui/inventory.d.ts +128 -0
- package/dist/ui/inventory.js +154 -0
- package/dist/ui/layout.d.ts +356 -0
- package/dist/ui/layout.js +856 -0
- package/dist/ui/link.d.ts +64 -0
- package/dist/ui/link.js +155 -0
- package/dist/ui/loading.d.ts +40 -0
- package/dist/ui/loading.js +157 -0
- package/dist/ui/loupe.d.ts +74 -0
- package/dist/ui/loupe.js +164 -0
- package/dist/ui/menu-nav.d.ts +33 -0
- package/dist/ui/menu-nav.js +28 -0
- package/dist/ui/minimap-canvas.d.ts +145 -0
- package/dist/ui/minimap-canvas.js +460 -0
- package/dist/ui/notify.d.ts +40 -0
- package/dist/ui/notify.js +141 -0
- package/dist/ui/orb.d.ts +53 -0
- package/dist/ui/orb.js +304 -0
- package/dist/ui/overlay.d.ts +213 -0
- package/dist/ui/overlay.js +394 -0
- package/dist/ui/padnav.d.ts +53 -0
- package/dist/ui/padnav.js +146 -0
- package/dist/ui/perf.d.ts +130 -0
- package/dist/ui/perf.js +329 -0
- package/dist/ui/rotate-card.d.ts +54 -0
- package/dist/ui/rotate-card.js +97 -0
- package/dist/ui/stack.d.ts +128 -0
- package/dist/ui/stack.js +312 -0
- package/dist/ui/styles.d.ts +13 -0
- package/dist/ui/styles.js +200 -0
- package/dist/ui/text-scale.d.ts +67 -0
- package/dist/ui/text-scale.js +102 -0
- package/dist/ui/theme.d.ts +70 -0
- package/dist/ui/theme.js +98 -0
- package/dist/ui/toast.d.ts +23 -0
- package/dist/ui/toast.js +46 -0
- package/dist/ui/tooltip.d.ts +89 -0
- package/dist/ui/tooltip.js +333 -0
- package/dist/ui/widgets-2.d.ts +134 -0
- package/dist/ui/widgets-2.js +399 -0
- package/dist/ui/widgets-3.d.ts +91 -0
- package/dist/ui/widgets-3.js +212 -0
- package/dist/ui/widgets.d.ts +34 -0
- package/dist/ui/widgets.js +50 -0
- package/dist/ui/world-panel/index.d.ts +5 -0
- package/dist/ui/world-panel/index.js +5 -0
- package/dist/ui/world-panel/layout.d.ts +38 -0
- package/dist/ui/world-panel/layout.js +68 -0
- package/dist/ui/world-panel/paint.d.ts +96 -0
- package/dist/ui/world-panel/paint.js +136 -0
- package/dist/ui/world-panel/panel.d.ts +235 -0
- package/dist/ui/world-panel/panel.js +762 -0
- package/dist/ui/world-panel/wgsl.d.ts +10 -0
- package/dist/ui/world-panel/wgsl.js +52 -0
- package/dist/ui/world-panel/widgets.d.ts +207 -0
- package/dist/ui/world-panel/widgets.js +569 -0
- package/dist/voxel/chunks.d.ts +77 -0
- package/dist/voxel/chunks.js +149 -0
- package/dist/voxel/grid.d.ts +84 -0
- package/dist/voxel/grid.js +223 -0
- package/dist/voxel/index.d.ts +22 -0
- package/dist/voxel/index.js +7 -0
- package/dist/voxel/mesher-worker.d.ts +14 -0
- package/dist/voxel/mesher-worker.js +47 -0
- package/dist/voxel/mesher.d.ts +73 -0
- package/dist/voxel/mesher.js +306 -0
- package/dist/voxel/ray.d.ts +32 -0
- package/dist/voxel/ray.js +73 -0
- package/dist/voxel/wgsl.d.ts +16 -0
- package/dist/voxel/wgsl.js +28 -0
- package/dist/voxel/worker-client.d.ts +79 -0
- package/dist/voxel/worker-client.js +122 -0
- package/package.json +177 -3
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
export type RGB = [number, number, number];
|
|
2
|
+
export interface BloomSettings {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
/** Strength of the bloom added to the image. */
|
|
5
|
+
intensity: number;
|
|
6
|
+
/** Scene-colour brightness above which non-emissive pixels also bloom. */
|
|
7
|
+
threshold: number;
|
|
8
|
+
/** Soft knee width around the threshold. */
|
|
9
|
+
knee: number;
|
|
10
|
+
/** Multiplier on the emissive target (the main bloom source). */
|
|
11
|
+
emissiveWeight: number;
|
|
12
|
+
/** 0..1: how much each coarser level is added back on the way up (bigger = wider glow). */
|
|
13
|
+
scatter: number;
|
|
14
|
+
/** Mip levels (2..8). Changing it takes effect on next resize. */
|
|
15
|
+
levels: number;
|
|
16
|
+
/**
|
|
17
|
+
* Lens dirt (ws/post-3): a texture multiplied into the bloom term at the composite
|
|
18
|
+
* (`bloom × (1 + dirt × intensity)`), so glow shows the smudges. `createLensDirtTexture`
|
|
19
|
+
* paints a procedural one; `texture: null` (or no `dirt`) is off and costs nothing.
|
|
20
|
+
*/
|
|
21
|
+
dirt?: LensDirtSettings;
|
|
22
|
+
}
|
|
23
|
+
/** The lens-dirt texture and its strength (ws/post-3). See `BloomSettings.dirt`. */
|
|
24
|
+
export interface LensDirtSettings {
|
|
25
|
+
/** An `rgba8unorm` 2D texture sampled over the whole screen, or `null` for none. */
|
|
26
|
+
texture: GPUTexture | null;
|
|
27
|
+
/** How much the dirt brightens the bloom where it is white (0 = none). */
|
|
28
|
+
intensity: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The screen-space floor mist (ws/api-render: `PostSettings.mist`, formerly `fog`): a noisy
|
|
32
|
+
* haze rising from the bottom of the screen, composited after bloom. It is not distance fog;
|
|
33
|
+
* `Lights.fog` (render) fades 3D surfaces with their distance inside the materials. The two
|
|
34
|
+
* stack: the distance fog is already in the scene colour when the mist goes on top.
|
|
35
|
+
*/
|
|
36
|
+
export interface MistSettings {
|
|
37
|
+
enabled: boolean;
|
|
38
|
+
/** Mist colour (linear, HDR ok). */
|
|
39
|
+
color: RGB;
|
|
40
|
+
/** Max opacity of the mist at the bottom (0..1). */
|
|
41
|
+
density: number;
|
|
42
|
+
/** Screen height (0 = top, 1 = bottom) where mist starts. */
|
|
43
|
+
top: number;
|
|
44
|
+
/** Screen height where mist reaches full density. */
|
|
45
|
+
bottom: number;
|
|
46
|
+
/** Shape curve of the height falloff (>1 hugs the floor). */
|
|
47
|
+
falloff: number;
|
|
48
|
+
/** Noise frequency (bigger = smaller wisps). */
|
|
49
|
+
noiseScale: number;
|
|
50
|
+
/** Drift speed. */
|
|
51
|
+
speed: number;
|
|
52
|
+
/** How much nearby glow (bloom) lights the mist. */
|
|
53
|
+
lightScatter: number;
|
|
54
|
+
}
|
|
55
|
+
export interface GodRaySettings {
|
|
56
|
+
enabled: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Light position in logical coordinates (may be off-screen): the 2D placement, used unless
|
|
59
|
+
* `direction` is set and the frame has a 3D view.
|
|
60
|
+
*/
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
/**
|
|
64
|
+
* World-space direction the light travels, like `Lights.sun.direction` (ws/api-render). When
|
|
65
|
+
* set and the frame has a 3D view (`PostInputs.view`), the rays come from where that
|
|
66
|
+
* direction's source sits on screen each frame (`godRaySource`) instead of `x`/`y`, and they
|
|
67
|
+
* go out while the sun is behind the camera. `null` or absent: `x`/`y`.
|
|
68
|
+
*/
|
|
69
|
+
direction?: RGB | null;
|
|
70
|
+
intensity: number;
|
|
71
|
+
/** Per-sample falloff (0.9..0.99). */
|
|
72
|
+
decay: number;
|
|
73
|
+
/** Ray length as a fraction of the distance to the light (0..1). */
|
|
74
|
+
density: number;
|
|
75
|
+
/** Per-sample weight. */
|
|
76
|
+
weight: number;
|
|
77
|
+
color: RGB;
|
|
78
|
+
/** Radius (logical px) of the bright disc at the light position. 0 disables it. */
|
|
79
|
+
sourceRadius: number;
|
|
80
|
+
/** Brightness of the disc. */
|
|
81
|
+
sourceIntensity: number;
|
|
82
|
+
/** How much the scene's bloom also casts rays (glowing things shed shafts). */
|
|
83
|
+
bloomSource: number;
|
|
84
|
+
}
|
|
85
|
+
export interface VignetteSettings {
|
|
86
|
+
enabled: boolean;
|
|
87
|
+
intensity: number;
|
|
88
|
+
/** Distance from centre (0..1, 1 = corner) where darkening starts. */
|
|
89
|
+
radius: number;
|
|
90
|
+
softness: number;
|
|
91
|
+
color: RGB;
|
|
92
|
+
}
|
|
93
|
+
export type Tonemap = 'aces' | 'reinhard' | 'none';
|
|
94
|
+
export interface GradeSettings {
|
|
95
|
+
enabled: boolean;
|
|
96
|
+
/** Linear exposure multiplier before tonemapping. */
|
|
97
|
+
exposure: number;
|
|
98
|
+
tonemap: Tonemap;
|
|
99
|
+
lift: RGB;
|
|
100
|
+
gamma: RGB;
|
|
101
|
+
gain: RGB;
|
|
102
|
+
saturation: number;
|
|
103
|
+
contrast: number;
|
|
104
|
+
/** Ordered-noise dither to kill banding in dark gradients. */
|
|
105
|
+
dither: boolean;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Screen-space ambient occlusion over the scene depth (ws/post-depth). Needs a frame with a
|
|
109
|
+
* depth buffer (`PostInputs.depth`); the 2D path has none and the pass is skipped.
|
|
110
|
+
*/
|
|
111
|
+
export interface AoSettings {
|
|
112
|
+
enabled: boolean;
|
|
113
|
+
/** Sample radius in world units. */
|
|
114
|
+
radius: number;
|
|
115
|
+
/** Strength of the darkening (0 = none). */
|
|
116
|
+
intensity: number;
|
|
117
|
+
/** Depth tolerance (world units along the normal) before a sample counts as occluding. */
|
|
118
|
+
bias: number;
|
|
119
|
+
/** Contrast of the occlusion term (>1 deepens creases). */
|
|
120
|
+
power: number;
|
|
121
|
+
}
|
|
122
|
+
/** Depth of field from linear depth (ws/post-depth): sharp at `focusDistance`, blurred by CoC. */
|
|
123
|
+
export interface DofSettings {
|
|
124
|
+
enabled: boolean;
|
|
125
|
+
/** Distance from the eye (world units) in sharp focus. */
|
|
126
|
+
focusDistance: number;
|
|
127
|
+
/** Depth either side of the focus distance over which the blur ramps to `maxBlur`. */
|
|
128
|
+
focusRange: number;
|
|
129
|
+
/** Largest circle of confusion, in px at the output resolution. */
|
|
130
|
+
maxBlur: number;
|
|
131
|
+
/** Blur what is closer than the focus too (off: only the far side blurs). */
|
|
132
|
+
nearBlur: boolean;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* FXAA 3.11 (console preset) over the composite's output (ws/post-2): one extra full-res pass,
|
|
136
|
+
* recorded only while enabled.
|
|
137
|
+
*/
|
|
138
|
+
export interface FxaaSettings {
|
|
139
|
+
enabled: boolean;
|
|
140
|
+
/** How much of the anti-aliased result replaces the pixel (0..1). */
|
|
141
|
+
subpixel: number;
|
|
142
|
+
/** Local contrast (0..1 of the brightest luma) below which a pixel is left alone. */
|
|
143
|
+
edgeThreshold: number;
|
|
144
|
+
}
|
|
145
|
+
/** A 3D colour lookup applied after the grade (ws/post-2). `texture: null` means off. */
|
|
146
|
+
export interface LutSettings {
|
|
147
|
+
/** A `size`³ `rgba8unorm` 3D texture (`createLutTexture`, `identityLut`), or `null` for none. */
|
|
148
|
+
texture: GPUTexture | null;
|
|
149
|
+
/** Texels per axis of `texture`. */
|
|
150
|
+
size: 16 | 32;
|
|
151
|
+
/** Blend between the graded colour (0) and the looked-up colour (1). */
|
|
152
|
+
intensity: number;
|
|
153
|
+
}
|
|
154
|
+
/** Film grain after the grade (ws/post-2). `intensity` 0 is off. */
|
|
155
|
+
export interface GrainSettings {
|
|
156
|
+
/** Peak noise amplitude (display units, 0..1). */
|
|
157
|
+
intensity: number;
|
|
158
|
+
/** Grain cell size in output px (1 = per pixel). */
|
|
159
|
+
size: number;
|
|
160
|
+
/** 0..1: how much less grain bright pixels get (1 = none in white). */
|
|
161
|
+
luminanceResponse: number;
|
|
162
|
+
/** Re-seed every frame; off, the grain is a fixed pattern. */
|
|
163
|
+
animated: boolean;
|
|
164
|
+
}
|
|
165
|
+
/** Chromatic aberration: red and blue sampled radially either side of green (ws/post-2). */
|
|
166
|
+
export interface AberrationSettings {
|
|
167
|
+
/** Largest channel offset in output px (reached at the corners when `radialOnly`). 0 is off. */
|
|
168
|
+
intensity: number;
|
|
169
|
+
/** Grow the offset with the squared distance from the centre, so the centre stays clean. */
|
|
170
|
+
radialOnly: boolean;
|
|
171
|
+
}
|
|
172
|
+
/** Unsharp mask on the scene colour (ws/post-2). `amount` 0 is off. */
|
|
173
|
+
export interface SharpenSettings {
|
|
174
|
+
/** Strength of the 5-tap unsharp mask (0..2 is sensible). */
|
|
175
|
+
amount: number;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* A depth and normal outline for toon looks (ws/post-2): a Roberts cross over the linear depth
|
|
179
|
+
* and the normals from depth, mixed into the scene colour before fog. Needs the scene depth;
|
|
180
|
+
* without one the pass is off (one warning).
|
|
181
|
+
*/
|
|
182
|
+
export interface OutlineSettings {
|
|
183
|
+
enabled: boolean;
|
|
184
|
+
/** Line colour (linear). */
|
|
185
|
+
color: RGB;
|
|
186
|
+
/** Line width in output px (the cross is sampled at this distance). */
|
|
187
|
+
thickness: number;
|
|
188
|
+
/** Relative depth step (fraction of the nearer depth) that counts as an edge. */
|
|
189
|
+
depthThreshold: number;
|
|
190
|
+
/** Normal difference (1 - cos of the angle) that counts as an edge. */
|
|
191
|
+
normalThreshold: number;
|
|
192
|
+
/** Opacity of the line (0..1). */
|
|
193
|
+
intensity: number;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Temporal anti-aliasing (ws/post-3): the stack keeps a history colour texture at scene res,
|
|
197
|
+
* reprojects it by the previous frame's view-projection against the current depth, clamps it to
|
|
198
|
+
* the current pixel's 3×3 neighbourhood and blends it in by `feedback`. Needs the scene depth
|
|
199
|
+
* and a frame with a view (3D path); when on, FXAA is skipped. Resize and the first frame
|
|
200
|
+
* reset the history. `PostStack.taa.jitter(frame)` gives the frame's sub-pixel offset.
|
|
201
|
+
*
|
|
202
|
+
* Reprojection (ws/post-5): with a velocity target (`PostInputs.velocity`) and `reprojection`
|
|
203
|
+
* `'velocity'` (the default) each pixel finds its history at `uv - velocity` (the velocity of
|
|
204
|
+
* the nearest depth in its 3×3, so a moving or skinned object's edge follows it), falling back
|
|
205
|
+
* to the camera matrix where nothing wrote a velocity; the history is dropped where its depth
|
|
206
|
+
* or velocity disagree with the pixel's by more than `depthReject` / `velocityReject`.
|
|
207
|
+
* Without the target, or in `'camera'`, the camera matrix alone reprojects, as before.
|
|
208
|
+
*/
|
|
209
|
+
export interface TaaSettings {
|
|
210
|
+
enabled: boolean;
|
|
211
|
+
/** Weight of the (clamped) history in the blend, 0..0.98 (0.9 = ~10 frames of memory). */
|
|
212
|
+
feedback: number;
|
|
213
|
+
/** Unsharp amount on the resolved colour, undoing the blend's softness (0 = none). */
|
|
214
|
+
sharpen: number;
|
|
215
|
+
/** `'aabb'`: clamp the history to the neighbourhood min/max; `'variance'`: to mean ± 1 σ. */
|
|
216
|
+
clampMode: 'aabb' | 'variance';
|
|
217
|
+
/**
|
|
218
|
+
* What finds a pixel's history (ws/post-5): `'velocity'` the velocity target where the frame
|
|
219
|
+
* has one (else the camera), `'camera'` the camera's previous view-projection only.
|
|
220
|
+
*/
|
|
221
|
+
reprojection: TaaReprojection;
|
|
222
|
+
/**
|
|
223
|
+
* `'velocity'` only: drop the history where its linear depth differs from the pixel's by more
|
|
224
|
+
* than this fraction of the nearer one (0.1 = 10 %).
|
|
225
|
+
*/
|
|
226
|
+
depthReject: number;
|
|
227
|
+
/** `'velocity'` only: drop the history where its velocity differs by more than this, in px. */
|
|
228
|
+
velocityReject: number;
|
|
229
|
+
/**
|
|
230
|
+
* How the resolve reads the history between texels (ws/post-6): `'catmull-rom'` (the
|
|
231
|
+
* default) a 5-tap Catmull-Rom sample, which keeps a slowly moving surface sharp;
|
|
232
|
+
* `'bilinear'` one bilinear tap, which softens it a little more every frame it moves by a
|
|
233
|
+
* fraction of a pixel. Either is clamped to the 3×3 neighbourhood.
|
|
234
|
+
*/
|
|
235
|
+
historyFilter: TaaHistoryFilter;
|
|
236
|
+
}
|
|
237
|
+
/** What TAA reprojects its history by (ws/post-5). See `TaaSettings.reprojection`. */
|
|
238
|
+
export type TaaReprojection = 'camera' | 'velocity';
|
|
239
|
+
/** How TAA samples its history (ws/post-6). See `TaaSettings.historyFilter`. */
|
|
240
|
+
export type TaaHistoryFilter = 'bilinear' | 'catmull-rom';
|
|
241
|
+
/**
|
|
242
|
+
* Screen-space reflections (ws/post-3): a half-res view-space ray march over the scene depth
|
|
243
|
+
* from normals derived from it (the AO pass's helper), sampling the scene colour where the ray
|
|
244
|
+
* meets the depth, faded at the screen edges and composited into the scene before bloom.
|
|
245
|
+
* Needs the scene depth. Per surface (ws/post-4): with a rough-metal target
|
|
246
|
+
* (`PostInputs.roughMetal`) each pixel fades by its own roughness against `roughnessCutoff` and
|
|
247
|
+
* is weighted by its metalness (Schlick Fresnel from F0 0.04 for a dielectric, 1 for a metal);
|
|
248
|
+
* without it every surface reads as a smooth mirror at full weight, as before.
|
|
249
|
+
*/
|
|
250
|
+
export interface SsrSettings {
|
|
251
|
+
enabled: boolean;
|
|
252
|
+
/** Ray-march steps (8..64); `maxDistance / maxSteps` is the step length. */
|
|
253
|
+
maxSteps: number;
|
|
254
|
+
/** Depth thickness (view units) a ray point may sit behind the surface and still hit. */
|
|
255
|
+
thickness: number;
|
|
256
|
+
/** Longest reflected ray in view units. */
|
|
257
|
+
maxDistance: number;
|
|
258
|
+
/** Roughness at and above which no reflection shows (0..1); below it the term fades in. */
|
|
259
|
+
roughnessCutoff: number;
|
|
260
|
+
/** Strength of the reflection added to the scene. */
|
|
261
|
+
intensity: number;
|
|
262
|
+
/** Width of the screen-edge fade in uv (0 = hard cut at the border). */
|
|
263
|
+
fadeEdges: number;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Exposure (ws/post-3). `'manual'`: `grade.exposure` is the multiplier, as before. `'auto'`:
|
|
267
|
+
* a compute pass builds a 64-bin log-luminance histogram of the scene colour, a second averages
|
|
268
|
+
* the bins between the percentile bounds, and the EV eases toward `log2(keyValue / average)`
|
|
269
|
+
* clamped to `minEv..maxEv` at `speedUp` / `speedDown` per second (`PostInputs.dt`).
|
|
270
|
+
* `PostStack.exposure` reads the current EV (the multiplier is `2^EV`).
|
|
271
|
+
*/
|
|
272
|
+
export interface ExposureSettings {
|
|
273
|
+
mode: 'manual' | 'auto';
|
|
274
|
+
/** Lowest EV auto mode may settle at (a negative EV darkens). */
|
|
275
|
+
minEv: number;
|
|
276
|
+
/** Highest EV auto mode may settle at. */
|
|
277
|
+
maxEv: number;
|
|
278
|
+
/** Rate (1/s) at which the EV rises toward a brighter target (a dark scene brightening). */
|
|
279
|
+
speedUp: number;
|
|
280
|
+
/** Rate (1/s) at which the EV falls toward a darker target. */
|
|
281
|
+
speedDown: number;
|
|
282
|
+
/** Middle-grey the metered average is mapped to (0.18 = photographic 18 %). */
|
|
283
|
+
keyValue: number;
|
|
284
|
+
/** Lower percentile (0..1) of the histogram the average ignores (dark outliers). */
|
|
285
|
+
histogramLow: number;
|
|
286
|
+
/** Upper percentile (0..1) of the histogram the average ignores (highlights). */
|
|
287
|
+
histogramHigh: number;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* White balance (ws/post-3): a 3×3 colour matrix before the exposure and grade that tints the
|
|
291
|
+
* image toward the colour of a black body at `temperature` (lower = warmer, 6500 K = none),
|
|
292
|
+
* shifted by `tint` (positive toward magenta, negative toward green). Bradford chromatic
|
|
293
|
+
* adaptation from the 6500 K white to the target white, in linear sRGB; see `white-balance.ts`.
|
|
294
|
+
*/
|
|
295
|
+
export interface WhiteBalanceSettings {
|
|
296
|
+
/** Colour temperature in kelvin (1667..25000); 6500 is the identity. */
|
|
297
|
+
temperature: number;
|
|
298
|
+
/** Green–magenta shift (-1..1); 0 is the identity. */
|
|
299
|
+
tint: number;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Camera motion blur (ws/post-3): per-pixel velocity from the current depth reprojected by the
|
|
303
|
+
* previous frame's view-projection (the matrix TAA keeps), the scene colour sampled along it
|
|
304
|
+
* before bloom. Needs the scene depth. Objects moving on their own do not blur (no velocity
|
|
305
|
+
* target yet; see the README's wish list).
|
|
306
|
+
*/
|
|
307
|
+
/** What a motion-blur pixel moves by (ws/post-4). See `MotionBlurSettings.mode`. */
|
|
308
|
+
export type MotionBlurMode = 'camera' | 'object';
|
|
309
|
+
export interface MotionBlurSettings {
|
|
310
|
+
enabled: boolean;
|
|
311
|
+
/**
|
|
312
|
+
* `'object'` (the default): with a velocity target (`PostInputs.velocity`) each pixel blurs
|
|
313
|
+
* along the velocity the renderer wrote for it, so moving and skinned objects smear under a
|
|
314
|
+
* still camera; pixels with no velocity fall back to the camera's reprojection. Without the
|
|
315
|
+
* target, and in `'camera'`, only the camera's movement blurs (the depth reprojected by the
|
|
316
|
+
* previous view-projection).
|
|
317
|
+
*/
|
|
318
|
+
mode: MotionBlurMode;
|
|
319
|
+
/** Scale on the frame-to-frame velocity (1 = the full frame's movement). */
|
|
320
|
+
intensity: number;
|
|
321
|
+
/** Taps along the velocity (2..16). */
|
|
322
|
+
maxSamples: number;
|
|
323
|
+
}
|
|
324
|
+
export interface PostSettings {
|
|
325
|
+
bloom: BloomSettings;
|
|
326
|
+
/** The screen-space floor mist (not `Lights.fog`, the distance fog). */
|
|
327
|
+
mist: MistSettings;
|
|
328
|
+
godRays: GodRaySettings;
|
|
329
|
+
vignette: VignetteSettings;
|
|
330
|
+
grade: GradeSettings;
|
|
331
|
+
ao: AoSettings;
|
|
332
|
+
dof: DofSettings;
|
|
333
|
+
fxaa: FxaaSettings;
|
|
334
|
+
lut: LutSettings;
|
|
335
|
+
grain: GrainSettings;
|
|
336
|
+
aberration: AberrationSettings;
|
|
337
|
+
sharpen: SharpenSettings;
|
|
338
|
+
outline: OutlineSettings;
|
|
339
|
+
taa: TaaSettings;
|
|
340
|
+
ssr: SsrSettings;
|
|
341
|
+
exposure: ExposureSettings;
|
|
342
|
+
whiteBalance: WhiteBalanceSettings;
|
|
343
|
+
motionBlur: MotionBlurSettings;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* The tuned look the engine shipped with (ws/api-render names it): bloom, a cool floor mist,
|
|
347
|
+
* god rays from the top centre of a 1920×1080 design, a vignette and a slight saturation and
|
|
348
|
+
* contrast lift. `PostStack` and `createGame` start from it. A new settings object each call.
|
|
349
|
+
*/
|
|
350
|
+
export declare function cinematicPostSettings(): PostSettings;
|
|
351
|
+
/**
|
|
352
|
+
* A neutral preset (ws/api-render): every pass off but the tone map (ACES, exposure 1, no
|
|
353
|
+
* lift, gamma, gain, saturation or contrast change, dithered), so the image is the scene and
|
|
354
|
+
* nothing else. Start here and turn on what the game wants. A new settings object each call.
|
|
355
|
+
*/
|
|
356
|
+
export declare function neutralPostSettings(): PostSettings;
|
|
357
|
+
type DeepPartial<T> = {
|
|
358
|
+
[K in keyof T]?: T[K] extends object ? Partial<T[K]> : T[K];
|
|
359
|
+
};
|
|
360
|
+
export type PostSettingsPatch = DeepPartial<PostSettings>;
|
|
361
|
+
/**
|
|
362
|
+
* A deep copy of `s` (ws/post-4): every section and every array (`RGB`) is new, so mutating
|
|
363
|
+
* the copy or blending it never touches the original. GPU handles (`lut.texture`,
|
|
364
|
+
* `bloom.dirt.texture`) are shared, not copied.
|
|
365
|
+
*/
|
|
366
|
+
export declare function clonePostSettings(s: PostSettings): PostSettings;
|
|
367
|
+
/** Shallow-per-section merge of `patch` into `target` (mutates target). */
|
|
368
|
+
export declare function applyPostPatch(target: PostSettings, patch: PostSettingsPatch): PostSettings;
|
|
369
|
+
/**
|
|
370
|
+
* Cost caps, separate from the look settings so presets and `blendTo` never undo them.
|
|
371
|
+
* Defaults are full quality. See `PostStack.quality`.
|
|
372
|
+
*/
|
|
373
|
+
export interface PostQuality {
|
|
374
|
+
/** Upper bound on `bloom.levels` (2..8). Fewer levels = less wide halo, fewer passes. */
|
|
375
|
+
maxBloomLevels: number;
|
|
376
|
+
/** God-ray march samples (8..64). Fewer samples are re-weighted to keep the same reach. */
|
|
377
|
+
raySamples: number;
|
|
378
|
+
/** Floor-mist fbm octaves for the main layer (2..5); the second layer uses one fewer. */
|
|
379
|
+
fogOctaves: number;
|
|
380
|
+
/**
|
|
381
|
+
* Run the composite (mist, tonemap, grade, dither) at the scene's resolution and upscale
|
|
382
|
+
* the result with one bilinear fetch, instead of compositing every output pixel. Only acts
|
|
383
|
+
* when the scene is smaller than the output (reduced resolution). Softer mist and dither;
|
|
384
|
+
* saves most of the composite's fill at high DPR.
|
|
385
|
+
*/
|
|
386
|
+
compositeAtScene: boolean;
|
|
387
|
+
/** Ambient-occlusion spiral samples per pixel (4..16). */
|
|
388
|
+
aoSamples: number;
|
|
389
|
+
/** Depth-of-field gather taps per pixel (8..32). */
|
|
390
|
+
dofTaps: number;
|
|
391
|
+
/** Allow the FXAA pass; `false` (the low tier) keeps `fxaa.enabled` from adding a pass. */
|
|
392
|
+
fxaa: boolean;
|
|
393
|
+
/** Allow the outline pass; `false` (the low tier) keeps it off. */
|
|
394
|
+
outline: boolean;
|
|
395
|
+
/** Allow TAA (ws/post-3); `false` (the XR tier) keeps `taa.enabled` from adding the pass. */
|
|
396
|
+
taa: boolean;
|
|
397
|
+
/** Allow SSR; `false` (the low and XR tiers) keeps it off. */
|
|
398
|
+
ssr: boolean;
|
|
399
|
+
/** Allow the auto-exposure compute passes; `false` leaves `exposure.mode` reading as manual. */
|
|
400
|
+
autoExposure: boolean;
|
|
401
|
+
/** Allow camera motion blur; `false` (the low and XR tiers) keeps it off. */
|
|
402
|
+
motionBlur: boolean;
|
|
403
|
+
}
|
|
404
|
+
export declare function defaultPostQuality(): PostQuality;
|
|
405
|
+
/**
|
|
406
|
+
* The low tier's caps: fewer bloom levels, samples and octaves; no FXAA, outline, SSR or
|
|
407
|
+
* motion-blur pass. TAA and auto-exposure stay (cheap, and TAA replaces FXAA).
|
|
408
|
+
*/
|
|
409
|
+
export declare function lowPostQuality(): PostQuality;
|
|
410
|
+
/** A device class for `postQualityFor` (ws/post-3). */
|
|
411
|
+
export type PostQualityTier = 'phone' | 'tablet' | 'desktop' | 'xr';
|
|
412
|
+
/**
|
|
413
|
+
* The cost caps for a device class (ws/post-3): `'phone'` is `lowPostQuality()`; `'tablet'`
|
|
414
|
+
* trims the samples and skips SSR; `'desktop'` is everything; `'xr'` is full quality with
|
|
415
|
+
* TAA, SSR and motion blur off: frame budget and comfort first (SSR costs a march per eye;
|
|
416
|
+
* motion blur in a headset reads as lag). TAA keeps one history per eye since ws/xr-taa, so a
|
|
417
|
+
* game may opt in with `{ ...postQualityFor('xr'), taa: true }` and `taa.enabled`.
|
|
418
|
+
*/
|
|
419
|
+
export declare function postQualityFor(tier: PostQualityTier): PostQuality;
|
|
420
|
+
/**
|
|
421
|
+
* What the depth passes need from the frame's projection (ws/post-depth): the clip → view
|
|
422
|
+
* inverse, the clip planes and the output width (`dof.maxBlur` is in output px). `null` when
|
|
423
|
+
* the frame rendered no depth; the packed uniforms then turn AO and DoF off.
|
|
424
|
+
*/
|
|
425
|
+
export interface PostDepthInfo {
|
|
426
|
+
near: number;
|
|
427
|
+
far: number;
|
|
428
|
+
/** Inverse of the projection, column-major. */
|
|
429
|
+
invProj: ArrayLike<number>;
|
|
430
|
+
/** The projection's own x/y scale (`proj[0]`, `proj[5]`), to project a world radius. */
|
|
431
|
+
projX: number;
|
|
432
|
+
projY: number;
|
|
433
|
+
outputWidth: number;
|
|
434
|
+
/**
|
|
435
|
+
* The projection is orthographic (`proj[11] === 0`, ws/post-4): AO and SSR project a view
|
|
436
|
+
* point without the divide by depth, and SSR's eye ray is the view axis.
|
|
437
|
+
*/
|
|
438
|
+
ortho?: boolean;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Per-frame state the temporal passes need (ws/post-3), kept by `PostStack`: the sub-pixel
|
|
442
|
+
* jitter in uv, whether this frame resets the history, the matrix from this frame's clip space
|
|
443
|
+
* to the previous frame's (`prevViewProj × invViewProj`) and the auto-exposure multiplier.
|
|
444
|
+
*/
|
|
445
|
+
export interface PostFrameState {
|
|
446
|
+
jitterX: number;
|
|
447
|
+
jitterY: number;
|
|
448
|
+
/** 1 on a frame whose history is invalid (first frame, resize): TAA copies the current colour. */
|
|
449
|
+
reset: number;
|
|
450
|
+
/** Current clip → previous clip, column-major. */
|
|
451
|
+
reproj: ArrayLike<number>;
|
|
452
|
+
/** Linear exposure multiplier used while `exposure.mode` is `'auto'` (`2^EV`). */
|
|
453
|
+
autoExposure: number;
|
|
454
|
+
/** 1 when SSR reads the frame's rough-metal target (ws/post-4), else 0 (the constant path). */
|
|
455
|
+
roughMetal?: number;
|
|
456
|
+
/** 1 when motion blur gathers along the frame's velocity target (ws/post-4), else 0. */
|
|
457
|
+
objectVelocity?: number;
|
|
458
|
+
/** 1 when TAA reprojects by the frame's velocity target (ws/post-5), else 0. */
|
|
459
|
+
taaVelocity?: number;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Uniform layout shared by all post shaders: 22 × vec4f + mat4x4f + 17 × vec4f + mat4x4f +
|
|
463
|
+
* vec4f.
|
|
464
|
+
*/
|
|
465
|
+
export declare const POST_UNIFORM_FLOATS = 192;
|
|
466
|
+
export declare const WGSL_POST_UNIFORMS = "\nstruct PostUniforms {\n frame: vec4f, // time, aspect, 1/width, 1/height\n enables: vec4f, // bloom, fog, rays, vignette\n enables2: vec4f, // grade, tonemap (0 none, 1 aces, 2 reinhard), dither, exposure\n bloom: vec4f, // intensity, threshold, knee, emissiveWeight\n bloom2: vec4f, // scatter, -, -, -\n fogColor: vec4f, // rgb, density\n fog: vec4f, // top, bottom, noiseScale, speed\n fog2: vec4f, // lightScatter, falloff, -, -\n rays: vec4f, // light uv x, y, intensity, decay\n rays2: vec4f, // density, weight, source radius (uv-y units), source intensity\n raysColor: vec4f, // rgb, bloomSource\n vignette: vec4f, // intensity, radius, softness, -\n vignetteColor: vec4f,\n lift: vec4f,\n gamma: vec4f,\n gain: vec4f,\n grade: vec4f, // saturation, contrast, -, -\n quality: vec4f, // ray samples, fog octaves, ortho projection (1, ws/post-4), -\n ao: vec4f, // enabled (0 without depth), radius, intensity, bias\n ao2: vec4f, // power, samples, proj x scale, proj y scale\n dof: vec4f, // enabled (0 without depth), focus distance, focus range, max blur (uv of width)\n dof2: vec4f, // near blur, taps, near plane, far plane\n invProj: mat4x4f, // clip -> view\n fxaa: vec4f, // enabled, subpixel, edgeThreshold, -\n lut: vec4f, // enabled, (size-1)/size, intensity, 0.5/size\n grain: vec4f, // intensity, cell size (px), luminanceResponse, seed\n aberration: vec4f, // intensity (px), radialOnly, -, -\n sharpen: vec4f, // amount, -, -, -\n outline: vec4f, // enabled (0 without depth), thickness (scene px), depthThreshold, normalThreshold\n outlineColor: vec4f, // rgb, intensity\n // Post 3 (ws/post-3).\n taa: vec4f, // enabled (0 without depth), feedback, sharpen, clampMode (0 aabb, 1 variance)\n taa2: vec4f, // view jitter x (uv), view jitter y (uv), reset (1 = copy the current frame), velocity reprojection (1, ws/post-5)\n ssr: vec4f, // enabled (0 without depth), maxSteps, thickness, maxDistance\n ssr2: vec4f, // roughnessCutoff, intensity, fadeEdges (uv), rough-metal target (1)\n exposure: vec4f, // auto (1), histogramLow, histogramHigh, keyValue\n wb0: vec4f, // white-balance matrix row 0 (rgb weights), enabled\n wb1: vec4f, // row 1\n wb2: vec4f, // row 2\n motionBlur: vec4f, // enabled (0 without depth), intensity, samples, velocity target (1 = object)\n dirt: vec4f, // enabled, intensity, -, -\n reproj: mat4x4f, // current clip -> previous frame's clip (identity on a reset)\n // Post 5 (ws/post-5).\n taa3: vec4f, // depthReject (fraction), velocityReject (px), history filter (1 = Catmull-Rom, ws/post-6), -\n};\n@group(0) @binding(0) var<uniform> P: PostUniforms;\n";
|
|
467
|
+
/**
|
|
468
|
+
* Where a directional light's source sits on screen (ws/api-render): the point at infinity
|
|
469
|
+
* opposite `direction` (the way the light travels) through `viewProj` (column-major), in
|
|
470
|
+
* logical px of a `width × height` view, written to `out` as x, y. Returns 1 when the source is
|
|
471
|
+
* in front of the camera and 0 when it is behind (or the projection is orthographic, which has
|
|
472
|
+
* no point at infinity); `out` is left alone then. No allocation.
|
|
473
|
+
*/
|
|
474
|
+
export declare function godRaySource(viewProj: ArrayLike<number>, direction: ArrayLike<number>, width: number, height: number, out: {
|
|
475
|
+
0: number;
|
|
476
|
+
1: number;
|
|
477
|
+
} | number[] | Float32Array): number;
|
|
478
|
+
/**
|
|
479
|
+
* The god-ray source for this frame: `x`/`y`, or `godRaySource` of `direction` through `view`.
|
|
480
|
+
* Writes x, y and visibility into `out`.
|
|
481
|
+
*/
|
|
482
|
+
export declare function resolveGodRays(r: GodRaySettings, viewProj: ArrayLike<number> | null, logicalWidth: number, logicalHeight: number, out: Float32Array): void;
|
|
483
|
+
/** Pack settings into the uniform array (no allocation). */
|
|
484
|
+
export declare function packPostUniforms(out: Float32Array, s: PostSettings, time: number, width: number, height: number, logicalWidth: number, logicalHeight: number, quality?: PostQuality, depth?: PostDepthInfo | null, grainSeed?: number, frame?: PostFrameState | null, rays?: Float32Array | null): void;
|
|
485
|
+
export {};
|