diff --git a/.gitattributes b/.gitattributes index a6344aac8c09253b3b630fb776ae94478aa0275b..8c9526bd1baa752a6847516f88849a38bd9d87ba 100644 --- a/.gitattributes +++ b/.gitattributes @@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text *tfevents* filter=lfs diff=lfs merge=lfs -text +asset-library/v01/benchmark/attempts.json filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md index 16182e3d6c3b7e862e5733615917246823f3aab5..8f596e19264384fa27ce9253c8cc6e0bc713cfbf 100644 --- a/README.md +++ b/README.md @@ -435,3 +435,8 @@ are included. [DVIDIA](https://dvidia.org/) · [Research](https://research.dvidia.org/) · [GitHub](https://github.com/Dvidia-Inference/dvidia-training) · [@iammrriver](https://x.com/iammrriver) · [hello@dvidia.org](mailto:hello@dvidia.org) + + +## Shoe asset library v0.1 + +[Explore the asset library](asset-library/v01/index.html): six original rigid shoe proxies and UR5e/Robotiq, PiPER and SO-101 scenes. [Complete benchmark](asset-library/v01/benchmark/report.html). Native loading and support tests do not establish shoe grasping, deformation or physical transfer. diff --git a/asset-library/v01/LICENSE b/asset-library/v01/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a7056f2889009b6b736691291d2e65e63bab2fdc --- /dev/null +++ b/asset-library/v01/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 DVIDIA contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/asset-library/v01/README.md b/asset-library/v01/README.md new file mode 100644 index 0000000000000000000000000000000000000000..bdfa4af2afb929f65aa2aeb5496eeb1726ff88f2 --- /dev/null +++ b/asset-library/v01/README.md @@ -0,0 +1,134 @@ +# DVIDIA asset library v0.1 + +Load a supported arm and synthetic shoes into local CPU simulation, inspect +their native 3D geometry, and save a portable scene descriptor. The first release +includes UR5e + Robotiq 2F-85, PiPER, SO-101, and left/right instances of trainers, +ankle boots and slippers. + +These shoes are original **rigid proxies with untested physical properties**. +This release supplies scene assets and an asset benchmark. It does not install +a trained shoe-organizing policy, calibrate deformation, or qualify a physical +robot. SO-101 has **five arm axes plus a gripper command**; UR5e and PiPER have +six arm axes plus a gripper command. + +## Install and provision once + +Clone the asset-library branch, or check out the exact source commit linked +from a published benchmark before installing its arm extra: + +~~~sh +git clone --branch feat/shoe-asset-library-v01 https://github.com/Dvidia-Inference/dvidia-training.git +cd dvidia-training +python3.12 -m venv .venv +source .venv/bin/activate +python -m pip install '.[arm]' +dvidia-assets list +dvidia-assets fetch ur5e --output ./robot-assets +dvidia-assets fetch piper --output ./robot-assets +dvidia-assets fetch so101 --output ./robot-assets +~~~ + +Fetch UR5e first when sharing one root: it requires a fresh output directory. +PiPER and SO-101 then add their own fresh robot folders. Run each fetch once. Fetch downloads only the +packaged, hash-pinned upstream allowlist. Keep the resulting model files and +Python dependencies; scene, load, benchmark and inspect then run offline. +Descriptors cannot introduce URLs, plugins, arbitrary XML or overrides to the +physical catalog. + +## Load shoes into the simulator + +~~~sh +dvidia-assets scene --robot piper --assets ./robot-assets \ + --pair trainer --output ./trainer-scene +python -m http.server 8000 --bind 127.0.0.1 --directory ./trainer-scene +~~~ + +On Windows use `py -3.12 -m venv .venv`, `.venv\Scripts\python.exe` +and `.venv\Scripts\dvidia-assets.exe`; activation is optional. + +Open http://localhost:8000. The selector offers only the exported shoe families. +Use `--pair all` with a fresh output directory to include trainers, ankle boots +and slippers in one preview. +Use a fresh output directory for each export. + +The exporter compiles verified native arm assets, adds shoe bodies and an +infinite flat support plane, and runs two seconds of physics with arm commands +held at initialization. The offline browser shows compiled arm meshes and shoe +collision primitives, recorded every 20 ms. Orbit the camera, scrub initial and +settled states and switch to collision geometry. **The browser replays saved +poses; it does not run physics.** Pair selection filters the recording visually. + +Download a descriptor and rerun exactly that selection: + +~~~sh +dvidia-assets load ./trainer-scene/scene.json \ + --assets ./robot-assets --output ./reloaded-scene +dvidia-assets inspect ./reloaded-scene +~~~ + +Descriptors contain robot ID, ordered shoe IDs, timestep, catalog version and +exact catalog hash. They contain no machine-specific paths. Incompatible +catalogs and changed or unknown descriptor fields are rejected. + +## Run the benchmark + +~~~sh +dvidia-assets benchmark --assets ./robot-assets \ + --seed 612047 --repeats 3 --output ./asset-benchmark +dvidia-assets inspect ./asset-benchmark +~~~ + +For an existing separate UR5e asset root, add --ur5e-assets PATH. Add +--source-commit FULL_COMMIT_SHA to record a frozen code revision. The benchmark +produces machine-readable receipts and a readable report, retains failures, +and measures its defined native asset protocol rather than a learned skill. +Read scenario definitions, denominators, negative controls and timing scope +before comparing results. + +## Hardware and offline use + +MuJoCo 3.15.0 runs on the CPU. No CUDA GPU, model weights, cloud inference service +or physical robot connection is required. The optional arm dependencies and +upstream model files require network access during provisioning. + +The browser needs JavaScript, WebGL2 and DecompressionStream. Serve the complete +exported directory through a local HTTP server; file URLs cannot reliably load +the data. All scripts, geometry, motion and notices are bundled locally. Browser +graphics support is separate from GPU compute for native simulation. + +Minimum RAM and CPU targets have **not** been established across machines. +The benchmark host's measured peak memory and timing are observations, not +universal minimum specifications or a real-time guarantee. + +## Evidence and licenses + +Each catalog property carries units, evidence status and source. Shoe geometry, +dimensions, mass and friction are authored assumptions. Left/right variants +are procedural instances, not independently captured real objects. The flat +plane, gravity and contact settings are simulation choices. No laces, fabric +dynamics, compressible soles, liquid contents or fracture are modeled. + +DVIDIA code, catalog and original shoes are MIT licensed. Arm models retain +their upstream licenses: UR5e BSD-3-Clause, Robotiq 2F-85 BSD-2-Clause, PiPER MIT +and SO-101 Apache-2.0. Exports retain original model licenses and READMEs under +licenses/. Three.js and OrbitControls are MIT; their notices accompany every +viewer. + +The preview integrity manifest records every file's byte count and SHA256. +Inspection checks the complete inventory, exact catalog and descriptors, +bounded compressed geometry and motion, finite poses, mesh indices and original +notices. Hashes establish consistency, not authenticity, accurate physics or +real-world transfer. + +## Rebuild the viewer + +The checked-in browser bundle uses pinned dependencies: + +~~~sh +npm ci --prefix viewer +npm run build:assets --prefix viewer +~~~ + +Next steps are measured object families, calibrated contact and robot/task +compatibility benchmarks. Appearance cannot establish friction, stiffness, +safe squeeze force or graspability. diff --git a/asset-library/v01/benchmark/attempts.json b/asset-library/v01/benchmark/attempts.json new file mode 100644 index 0000000000000000000000000000000000000000..a9dff0199a2a7ebec9c5baceb1b2506d816facb9 --- /dev/null +++ b/asset-library/v01/benchmark/attempts.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78a9ae2aa84bb484b6bddda21773663afa586e48321493fef2542218fc49f8eb +size 10492425 diff --git a/asset-library/v01/benchmark/integrity.json b/asset-library/v01/benchmark/integrity.json new file mode 100644 index 0000000000000000000000000000000000000000..5b8613c94dd2cc2aee3fa737d597f0241df8249d --- /dev/null +++ b/asset-library/v01/benchmark/integrity.json @@ -0,0 +1,21 @@ +{ + "files": { + "attempts.json": { + "bytes": 10492425, + "sha256": "78a9ae2aa84bb484b6bddda21773663afa586e48321493fef2542218fc49f8eb" + }, + "protocol.json": { + "bytes": 74622, + "sha256": "d5abad1ebf9eda71d1f47606ba0664b9e4bfe6970c54088bf43d5e818782268d" + }, + "report.html": { + "bytes": 4635, + "sha256": "bde9e1b21ca39168ec6ea34ae43e413d18304540f1df2e4936b9309a0de2e0b5" + }, + "report.json": { + "bytes": 3709, + "sha256": "83cc1d82bfcb4463dc6e34077b7b496b59216165dad1d91eabdfa2c33978a243" + } + }, + "schema": "dvidia.asset-library-integrity/v1" +} diff --git a/asset-library/v01/benchmark/protocol.json b/asset-library/v01/benchmark/protocol.json new file mode 100644 index 0000000000000000000000000000000000000000..de1a69f3c1a2dbfa8fc8d6ab3c795a1759342894 --- /dev/null +++ b/asset-library/v01/benchmark/protocol.json @@ -0,0 +1,2630 @@ +{ + "attempts": [ + { + "control": "table_support", + "family": "trainer", + "id": "ur5e-trainer-00-table_support", + "placements": [ + { + "position_m": [ + 0.39210293, + 0.3732585, + 0.06086079 + ], + "shoe_id": "trainer-left", + "yaw_rad": -0.18230593 + }, + { + "position_m": [ + 0.40988847, + 0.54626107, + 0.07331588 + ], + "shoe_id": "trainer-right", + "yaw_rad": -0.24487414 + } + ], + "repeat": 0, + "robot": "ur5e" + }, + { + "control": "table_disabled", + "family": "trainer", + "id": "ur5e-trainer-00-table_disabled", + "placements": [ + { + "position_m": [ + 0.39210293, + 0.3732585, + 0.06086079 + ], + "shoe_id": "trainer-left", + "yaw_rad": -0.18230593 + }, + { + "position_m": [ + 0.40988847, + 0.54626107, + 0.07331588 + ], + "shoe_id": "trainer-right", + "yaw_rad": -0.24487414 + } + ], + "repeat": 0, + "robot": "ur5e" + }, + { + "control": "table_support", + "family": "trainer", + "id": "piper-trainer-00-table_support", + "placements": [ + { + "position_m": [ + 0.39210293, + 0.3732585, + 0.06086079 + ], + "shoe_id": "trainer-left", + "yaw_rad": -0.18230593 + }, + { + "position_m": [ + 0.40988847, + 0.54626107, + 0.07331588 + ], + "shoe_id": "trainer-right", + "yaw_rad": -0.24487414 + } + ], + "repeat": 0, + "robot": "piper" + }, + { + "control": "table_disabled", + "family": "trainer", + "id": "piper-trainer-00-table_disabled", + "placements": [ + { + "position_m": [ + 0.39210293, + 0.3732585, + 0.06086079 + ], + "shoe_id": "trainer-left", + "yaw_rad": -0.18230593 + }, + { + "position_m": [ + 0.40988847, + 0.54626107, + 0.07331588 + ], + "shoe_id": "trainer-right", + "yaw_rad": -0.24487414 + } + ], + "repeat": 0, + "robot": "piper" + }, + { + "control": "table_support", + "family": "trainer", + "id": "so101-trainer-00-table_support", + "placements": [ + { + "position_m": [ + 0.39210293, + 0.3732585, + 0.06086079 + ], + "shoe_id": "trainer-left", + "yaw_rad": -0.18230593 + }, + { + "position_m": [ + 0.40988847, + 0.54626107, + 0.07331588 + ], + "shoe_id": "trainer-right", + "yaw_rad": -0.24487414 + } + ], + "repeat": 0, + "robot": "so101" + }, + { + "control": "table_disabled", + "family": "trainer", + "id": "so101-trainer-00-table_disabled", + "placements": [ + { + "position_m": [ + 0.39210293, + 0.3732585, + 0.06086079 + ], + "shoe_id": "trainer-left", + "yaw_rad": -0.18230593 + }, + { + "position_m": [ + 0.40988847, + 0.54626107, + 0.07331588 + ], + "shoe_id": "trainer-right", + "yaw_rad": -0.24487414 + } + ], + "repeat": 0, + "robot": "so101" + }, + { + "control": "table_support", + "family": "trainer", + "id": "ur5e-trainer-01-table_support", + "placements": [ + { + "position_m": [ + 0.3861364, + 0.39167611, + 0.06610602 + ], + "shoe_id": "trainer-left", + "yaw_rad": -0.17274214 + }, + { + "position_m": [ + 0.39088251, + 0.57077021, + 0.07325291 + ], + "shoe_id": "trainer-right", + "yaw_rad": -0.01222641 + } + ], + "repeat": 1, + "robot": "ur5e" + }, + { + "control": "table_disabled", + "family": "trainer", + "id": "ur5e-trainer-01-table_disabled", + "placements": [ + { + "position_m": [ + 0.3861364, + 0.39167611, + 0.06610602 + ], + "shoe_id": "trainer-left", + "yaw_rad": -0.17274214 + }, + { + "position_m": [ + 0.39088251, + 0.57077021, + 0.07325291 + ], + "shoe_id": "trainer-right", + "yaw_rad": -0.01222641 + } + ], + "repeat": 1, + "robot": "ur5e" + }, + { + "control": "table_support", + "family": "trainer", + "id": "piper-trainer-01-table_support", + "placements": [ + { + "position_m": [ + 0.3861364, + 0.39167611, + 0.06610602 + ], + "shoe_id": "trainer-left", + "yaw_rad": -0.17274214 + }, + { + "position_m": [ + 0.39088251, + 0.57077021, + 0.07325291 + ], + "shoe_id": "trainer-right", + "yaw_rad": -0.01222641 + } + ], + "repeat": 1, + "robot": "piper" + }, + { + "control": "table_disabled", + "family": "trainer", + "id": "piper-trainer-01-table_disabled", + "placements": [ + { + "position_m": [ + 0.3861364, + 0.39167611, + 0.06610602 + ], + "shoe_id": "trainer-left", + "yaw_rad": -0.17274214 + }, + { + "position_m": [ + 0.39088251, + 0.57077021, + 0.07325291 + ], + "shoe_id": "trainer-right", + "yaw_rad": -0.01222641 + } + ], + "repeat": 1, + "robot": "piper" + }, + { + "control": "table_support", + "family": "trainer", + "id": "so101-trainer-01-table_support", + "placements": [ + { + "position_m": [ + 0.3861364, + 0.39167611, + 0.06610602 + ], + "shoe_id": "trainer-left", + "yaw_rad": -0.17274214 + }, + { + "position_m": [ + 0.39088251, + 0.57077021, + 0.07325291 + ], + "shoe_id": "trainer-right", + "yaw_rad": -0.01222641 + } + ], + "repeat": 1, + "robot": "so101" + }, + { + "control": "table_disabled", + "family": "trainer", + "id": "so101-trainer-01-table_disabled", + "placements": [ + { + "position_m": [ + 0.3861364, + 0.39167611, + 0.06610602 + ], + "shoe_id": "trainer-left", + "yaw_rad": -0.17274214 + }, + { + "position_m": [ + 0.39088251, + 0.57077021, + 0.07325291 + ], + "shoe_id": "trainer-right", + "yaw_rad": -0.01222641 + } + ], + "repeat": 1, + "robot": "so101" + }, + { + "control": "table_support", + "family": "trainer", + "id": "ur5e-trainer-02-table_support", + "placements": [ + { + "position_m": [ + 0.40881126, + 0.38313113, + 0.06988607 + ], + "shoe_id": "trainer-left", + "yaw_rad": -0.13558536 + }, + { + "position_m": [ + 0.4023739, + 0.54727093, + 0.09453687 + ], + "shoe_id": "trainer-right", + "yaw_rad": -0.12723176 + } + ], + "repeat": 2, + "robot": "ur5e" + }, + { + "control": "table_disabled", + "family": "trainer", + "id": "ur5e-trainer-02-table_disabled", + "placements": [ + { + "position_m": [ + 0.40881126, + 0.38313113, + 0.06988607 + ], + "shoe_id": "trainer-left", + "yaw_rad": -0.13558536 + }, + { + "position_m": [ + 0.4023739, + 0.54727093, + 0.09453687 + ], + "shoe_id": "trainer-right", + "yaw_rad": -0.12723176 + } + ], + "repeat": 2, + "robot": "ur5e" + }, + { + "control": "table_support", + "family": "trainer", + "id": "piper-trainer-02-table_support", + "placements": [ + { + "position_m": [ + 0.40881126, + 0.38313113, + 0.06988607 + ], + "shoe_id": "trainer-left", + "yaw_rad": -0.13558536 + }, + { + "position_m": [ + 0.4023739, + 0.54727093, + 0.09453687 + ], + "shoe_id": "trainer-right", + "yaw_rad": -0.12723176 + } + ], + "repeat": 2, + "robot": "piper" + }, + { + "control": "table_disabled", + "family": "trainer", + "id": "piper-trainer-02-table_disabled", + "placements": [ + { + "position_m": [ + 0.40881126, + 0.38313113, + 0.06988607 + ], + "shoe_id": "trainer-left", + "yaw_rad": -0.13558536 + }, + { + "position_m": [ + 0.4023739, + 0.54727093, + 0.09453687 + ], + "shoe_id": "trainer-right", + "yaw_rad": -0.12723176 + } + ], + "repeat": 2, + "robot": "piper" + }, + { + "control": "table_support", + "family": "trainer", + "id": "so101-trainer-02-table_support", + "placements": [ + { + "position_m": [ + 0.40881126, + 0.38313113, + 0.06988607 + ], + "shoe_id": "trainer-left", + "yaw_rad": -0.13558536 + }, + { + "position_m": [ + 0.4023739, + 0.54727093, + 0.09453687 + ], + "shoe_id": "trainer-right", + "yaw_rad": -0.12723176 + } + ], + "repeat": 2, + "robot": "so101" + }, + { + "control": "table_disabled", + "family": "trainer", + "id": "so101-trainer-02-table_disabled", + "placements": [ + { + "position_m": [ + 0.40881126, + 0.38313113, + 0.06988607 + ], + "shoe_id": "trainer-left", + "yaw_rad": -0.13558536 + }, + { + "position_m": [ + 0.4023739, + 0.54727093, + 0.09453687 + ], + "shoe_id": "trainer-right", + "yaw_rad": -0.12723176 + } + ], + "repeat": 2, + "robot": "so101" + }, + { + "control": "table_support", + "family": "ankle-boot", + "id": "ur5e-ankle-boot-00-table_support", + "placements": [ + { + "position_m": [ + 0.41313419, + 0.37963844, + 0.07164243 + ], + "shoe_id": "ankle-boot-left", + "yaw_rad": -0.14819639 + }, + { + "position_m": [ + 0.38581205, + 0.56984695, + 0.09402534 + ], + "shoe_id": "ankle-boot-right", + "yaw_rad": -0.09206735 + } + ], + "repeat": 0, + "robot": "ur5e" + }, + { + "control": "table_disabled", + "family": "ankle-boot", + "id": "ur5e-ankle-boot-00-table_disabled", + "placements": [ + { + "position_m": [ + 0.41313419, + 0.37963844, + 0.07164243 + ], + "shoe_id": "ankle-boot-left", + "yaw_rad": -0.14819639 + }, + { + "position_m": [ + 0.38581205, + 0.56984695, + 0.09402534 + ], + "shoe_id": "ankle-boot-right", + "yaw_rad": -0.09206735 + } + ], + "repeat": 0, + "robot": "ur5e" + }, + { + "control": "table_support", + "family": "ankle-boot", + "id": "piper-ankle-boot-00-table_support", + "placements": [ + { + "position_m": [ + 0.41313419, + 0.37963844, + 0.07164243 + ], + "shoe_id": "ankle-boot-left", + "yaw_rad": -0.14819639 + }, + { + "position_m": [ + 0.38581205, + 0.56984695, + 0.09402534 + ], + "shoe_id": "ankle-boot-right", + "yaw_rad": -0.09206735 + } + ], + "repeat": 0, + "robot": "piper" + }, + { + "control": "table_disabled", + "family": "ankle-boot", + "id": "piper-ankle-boot-00-table_disabled", + "placements": [ + { + "position_m": [ + 0.41313419, + 0.37963844, + 0.07164243 + ], + "shoe_id": "ankle-boot-left", + "yaw_rad": -0.14819639 + }, + { + "position_m": [ + 0.38581205, + 0.56984695, + 0.09402534 + ], + "shoe_id": "ankle-boot-right", + "yaw_rad": -0.09206735 + } + ], + "repeat": 0, + "robot": "piper" + }, + { + "control": "table_support", + "family": "ankle-boot", + "id": "so101-ankle-boot-00-table_support", + "placements": [ + { + "position_m": [ + 0.41313419, + 0.37963844, + 0.07164243 + ], + "shoe_id": "ankle-boot-left", + "yaw_rad": -0.14819639 + }, + { + "position_m": [ + 0.38581205, + 0.56984695, + 0.09402534 + ], + "shoe_id": "ankle-boot-right", + "yaw_rad": -0.09206735 + } + ], + "repeat": 0, + "robot": "so101" + }, + { + "control": "table_disabled", + "family": "ankle-boot", + "id": "so101-ankle-boot-00-table_disabled", + "placements": [ + { + "position_m": [ + 0.41313419, + 0.37963844, + 0.07164243 + ], + "shoe_id": "ankle-boot-left", + "yaw_rad": -0.14819639 + }, + { + "position_m": [ + 0.38581205, + 0.56984695, + 0.09402534 + ], + "shoe_id": "ankle-boot-right", + "yaw_rad": -0.09206735 + } + ], + "repeat": 0, + "robot": "so101" + }, + { + "control": "table_support", + "family": "ankle-boot", + "id": "ur5e-ankle-boot-01-table_support", + "placements": [ + { + "position_m": [ + 0.39690193, + 0.3776201, + 0.07801294 + ], + "shoe_id": "ankle-boot-left", + "yaw_rad": -0.01024326 + }, + { + "position_m": [ + 0.41493842, + 0.55710976, + 0.09081332 + ], + "shoe_id": "ankle-boot-right", + "yaw_rad": -0.11809542 + } + ], + "repeat": 1, + "robot": "ur5e" + }, + { + "control": "table_disabled", + "family": "ankle-boot", + "id": "ur5e-ankle-boot-01-table_disabled", + "placements": [ + { + "position_m": [ + 0.39690193, + 0.3776201, + 0.07801294 + ], + "shoe_id": "ankle-boot-left", + "yaw_rad": -0.01024326 + }, + { + "position_m": [ + 0.41493842, + 0.55710976, + 0.09081332 + ], + "shoe_id": "ankle-boot-right", + "yaw_rad": -0.11809542 + } + ], + "repeat": 1, + "robot": "ur5e" + }, + { + "control": "table_support", + "family": "ankle-boot", + "id": "piper-ankle-boot-01-table_support", + "placements": [ + { + "position_m": [ + 0.39690193, + 0.3776201, + 0.07801294 + ], + "shoe_id": "ankle-boot-left", + "yaw_rad": -0.01024326 + }, + { + "position_m": [ + 0.41493842, + 0.55710976, + 0.09081332 + ], + "shoe_id": "ankle-boot-right", + "yaw_rad": -0.11809542 + } + ], + "repeat": 1, + "robot": "piper" + }, + { + "control": "table_disabled", + "family": "ankle-boot", + "id": "piper-ankle-boot-01-table_disabled", + "placements": [ + { + "position_m": [ + 0.39690193, + 0.3776201, + 0.07801294 + ], + "shoe_id": "ankle-boot-left", + "yaw_rad": -0.01024326 + }, + { + "position_m": [ + 0.41493842, + 0.55710976, + 0.09081332 + ], + "shoe_id": "ankle-boot-right", + "yaw_rad": -0.11809542 + } + ], + "repeat": 1, + "robot": "piper" + }, + { + "control": "table_support", + "family": "ankle-boot", + "id": "so101-ankle-boot-01-table_support", + "placements": [ + { + "position_m": [ + 0.39690193, + 0.3776201, + 0.07801294 + ], + "shoe_id": "ankle-boot-left", + "yaw_rad": -0.01024326 + }, + { + "position_m": [ + 0.41493842, + 0.55710976, + 0.09081332 + ], + "shoe_id": "ankle-boot-right", + "yaw_rad": -0.11809542 + } + ], + "repeat": 1, + "robot": "so101" + }, + { + "control": "table_disabled", + "family": "ankle-boot", + "id": "so101-ankle-boot-01-table_disabled", + "placements": [ + { + "position_m": [ + 0.39690193, + 0.3776201, + 0.07801294 + ], + "shoe_id": "ankle-boot-left", + "yaw_rad": -0.01024326 + }, + { + "position_m": [ + 0.41493842, + 0.55710976, + 0.09081332 + ], + "shoe_id": "ankle-boot-right", + "yaw_rad": -0.11809542 + } + ], + "repeat": 1, + "robot": "so101" + }, + { + "control": "table_support", + "family": "ankle-boot", + "id": "ur5e-ankle-boot-02-table_support", + "placements": [ + { + "position_m": [ + 0.41087493, + 0.36979048, + 0.08684175 + ], + "shoe_id": "ankle-boot-left", + "yaw_rad": -0.18034977 + }, + { + "position_m": [ + 0.41209292, + 0.56354541, + 0.07350168 + ], + "shoe_id": "ankle-boot-right", + "yaw_rad": 0.191159 + } + ], + "repeat": 2, + "robot": "ur5e" + }, + { + "control": "table_disabled", + "family": "ankle-boot", + "id": "ur5e-ankle-boot-02-table_disabled", + "placements": [ + { + "position_m": [ + 0.41087493, + 0.36979048, + 0.08684175 + ], + "shoe_id": "ankle-boot-left", + "yaw_rad": -0.18034977 + }, + { + "position_m": [ + 0.41209292, + 0.56354541, + 0.07350168 + ], + "shoe_id": "ankle-boot-right", + "yaw_rad": 0.191159 + } + ], + "repeat": 2, + "robot": "ur5e" + }, + { + "control": "table_support", + "family": "ankle-boot", + "id": "piper-ankle-boot-02-table_support", + "placements": [ + { + "position_m": [ + 0.41087493, + 0.36979048, + 0.08684175 + ], + "shoe_id": "ankle-boot-left", + "yaw_rad": -0.18034977 + }, + { + "position_m": [ + 0.41209292, + 0.56354541, + 0.07350168 + ], + "shoe_id": "ankle-boot-right", + "yaw_rad": 0.191159 + } + ], + "repeat": 2, + "robot": "piper" + }, + { + "control": "table_disabled", + "family": "ankle-boot", + "id": "piper-ankle-boot-02-table_disabled", + "placements": [ + { + "position_m": [ + 0.41087493, + 0.36979048, + 0.08684175 + ], + "shoe_id": "ankle-boot-left", + "yaw_rad": -0.18034977 + }, + { + "position_m": [ + 0.41209292, + 0.56354541, + 0.07350168 + ], + "shoe_id": "ankle-boot-right", + "yaw_rad": 0.191159 + } + ], + "repeat": 2, + "robot": "piper" + }, + { + "control": "table_support", + "family": "ankle-boot", + "id": "so101-ankle-boot-02-table_support", + "placements": [ + { + "position_m": [ + 0.41087493, + 0.36979048, + 0.08684175 + ], + "shoe_id": "ankle-boot-left", + "yaw_rad": -0.18034977 + }, + { + "position_m": [ + 0.41209292, + 0.56354541, + 0.07350168 + ], + "shoe_id": "ankle-boot-right", + "yaw_rad": 0.191159 + } + ], + "repeat": 2, + "robot": "so101" + }, + { + "control": "table_disabled", + "family": "ankle-boot", + "id": "so101-ankle-boot-02-table_disabled", + "placements": [ + { + "position_m": [ + 0.41087493, + 0.36979048, + 0.08684175 + ], + "shoe_id": "ankle-boot-left", + "yaw_rad": -0.18034977 + }, + { + "position_m": [ + 0.41209292, + 0.56354541, + 0.07350168 + ], + "shoe_id": "ankle-boot-right", + "yaw_rad": 0.191159 + } + ], + "repeat": 2, + "robot": "so101" + }, + { + "control": "table_support", + "family": "slipper", + "id": "ur5e-slipper-00-table_support", + "placements": [ + { + "position_m": [ + 0.3943295, + 0.36535188, + 0.09516022 + ], + "shoe_id": "slipper-left", + "yaw_rad": -0.18675829 + }, + { + "position_m": [ + 0.39152895, + 0.57139025, + 0.08879678 + ], + "shoe_id": "slipper-right", + "yaw_rad": 0.00590997 + } + ], + "repeat": 0, + "robot": "ur5e" + }, + { + "control": "table_disabled", + "family": "slipper", + "id": "ur5e-slipper-00-table_disabled", + "placements": [ + { + "position_m": [ + 0.3943295, + 0.36535188, + 0.09516022 + ], + "shoe_id": "slipper-left", + "yaw_rad": -0.18675829 + }, + { + "position_m": [ + 0.39152895, + 0.57139025, + 0.08879678 + ], + "shoe_id": "slipper-right", + "yaw_rad": 0.00590997 + } + ], + "repeat": 0, + "robot": "ur5e" + }, + { + "control": "table_support", + "family": "slipper", + "id": "piper-slipper-00-table_support", + "placements": [ + { + "position_m": [ + 0.3943295, + 0.36535188, + 0.09516022 + ], + "shoe_id": "slipper-left", + "yaw_rad": -0.18675829 + }, + { + "position_m": [ + 0.39152895, + 0.57139025, + 0.08879678 + ], + "shoe_id": "slipper-right", + "yaw_rad": 0.00590997 + } + ], + "repeat": 0, + "robot": "piper" + }, + { + "control": "table_disabled", + "family": "slipper", + "id": "piper-slipper-00-table_disabled", + "placements": [ + { + "position_m": [ + 0.3943295, + 0.36535188, + 0.09516022 + ], + "shoe_id": "slipper-left", + "yaw_rad": -0.18675829 + }, + { + "position_m": [ + 0.39152895, + 0.57139025, + 0.08879678 + ], + "shoe_id": "slipper-right", + "yaw_rad": 0.00590997 + } + ], + "repeat": 0, + "robot": "piper" + }, + { + "control": "table_support", + "family": "slipper", + "id": "so101-slipper-00-table_support", + "placements": [ + { + "position_m": [ + 0.3943295, + 0.36535188, + 0.09516022 + ], + "shoe_id": "slipper-left", + "yaw_rad": -0.18675829 + }, + { + "position_m": [ + 0.39152895, + 0.57139025, + 0.08879678 + ], + "shoe_id": "slipper-right", + "yaw_rad": 0.00590997 + } + ], + "repeat": 0, + "robot": "so101" + }, + { + "control": "table_disabled", + "family": "slipper", + "id": "so101-slipper-00-table_disabled", + "placements": [ + { + "position_m": [ + 0.3943295, + 0.36535188, + 0.09516022 + ], + "shoe_id": "slipper-left", + "yaw_rad": -0.18675829 + }, + { + "position_m": [ + 0.39152895, + 0.57139025, + 0.08879678 + ], + "shoe_id": "slipper-right", + "yaw_rad": 0.00590997 + } + ], + "repeat": 0, + "robot": "so101" + }, + { + "control": "table_support", + "family": "slipper", + "id": "ur5e-slipper-01-table_support", + "placements": [ + { + "position_m": [ + 0.40891878, + 0.38738392, + 0.08232337 + ], + "shoe_id": "slipper-left", + "yaw_rad": 0.20866705 + }, + { + "position_m": [ + 0.40539302, + 0.56254283, + 0.06338254 + ], + "shoe_id": "slipper-right", + "yaw_rad": -0.2118499 + } + ], + "repeat": 1, + "robot": "ur5e" + }, + { + "control": "table_disabled", + "family": "slipper", + "id": "ur5e-slipper-01-table_disabled", + "placements": [ + { + "position_m": [ + 0.40891878, + 0.38738392, + 0.08232337 + ], + "shoe_id": "slipper-left", + "yaw_rad": 0.20866705 + }, + { + "position_m": [ + 0.40539302, + 0.56254283, + 0.06338254 + ], + "shoe_id": "slipper-right", + "yaw_rad": -0.2118499 + } + ], + "repeat": 1, + "robot": "ur5e" + }, + { + "control": "table_support", + "family": "slipper", + "id": "piper-slipper-01-table_support", + "placements": [ + { + "position_m": [ + 0.40891878, + 0.38738392, + 0.08232337 + ], + "shoe_id": "slipper-left", + "yaw_rad": 0.20866705 + }, + { + "position_m": [ + 0.40539302, + 0.56254283, + 0.06338254 + ], + "shoe_id": "slipper-right", + "yaw_rad": -0.2118499 + } + ], + "repeat": 1, + "robot": "piper" + }, + { + "control": "table_disabled", + "family": "slipper", + "id": "piper-slipper-01-table_disabled", + "placements": [ + { + "position_m": [ + 0.40891878, + 0.38738392, + 0.08232337 + ], + "shoe_id": "slipper-left", + "yaw_rad": 0.20866705 + }, + { + "position_m": [ + 0.40539302, + 0.56254283, + 0.06338254 + ], + "shoe_id": "slipper-right", + "yaw_rad": -0.2118499 + } + ], + "repeat": 1, + "robot": "piper" + }, + { + "control": "table_support", + "family": "slipper", + "id": "so101-slipper-01-table_support", + "placements": [ + { + "position_m": [ + 0.40891878, + 0.38738392, + 0.08232337 + ], + "shoe_id": "slipper-left", + "yaw_rad": 0.20866705 + }, + { + "position_m": [ + 0.40539302, + 0.56254283, + 0.06338254 + ], + "shoe_id": "slipper-right", + "yaw_rad": -0.2118499 + } + ], + "repeat": 1, + "robot": "so101" + }, + { + "control": "table_disabled", + "family": "slipper", + "id": "so101-slipper-01-table_disabled", + "placements": [ + { + "position_m": [ + 0.40891878, + 0.38738392, + 0.08232337 + ], + "shoe_id": "slipper-left", + "yaw_rad": 0.20866705 + }, + { + "position_m": [ + 0.40539302, + 0.56254283, + 0.06338254 + ], + "shoe_id": "slipper-right", + "yaw_rad": -0.2118499 + } + ], + "repeat": 1, + "robot": "so101" + }, + { + "control": "table_support", + "family": "slipper", + "id": "ur5e-slipper-02-table_support", + "placements": [ + { + "position_m": [ + 0.40473021, + 0.39342813, + 0.06637683 + ], + "shoe_id": "slipper-left", + "yaw_rad": -0.1863574 + }, + { + "position_m": [ + 0.39971386, + 0.54759708, + 0.08089116 + ], + "shoe_id": "slipper-right", + "yaw_rad": -0.06194345 + } + ], + "repeat": 2, + "robot": "ur5e" + }, + { + "control": "table_disabled", + "family": "slipper", + "id": "ur5e-slipper-02-table_disabled", + "placements": [ + { + "position_m": [ + 0.40473021, + 0.39342813, + 0.06637683 + ], + "shoe_id": "slipper-left", + "yaw_rad": -0.1863574 + }, + { + "position_m": [ + 0.39971386, + 0.54759708, + 0.08089116 + ], + "shoe_id": "slipper-right", + "yaw_rad": -0.06194345 + } + ], + "repeat": 2, + "robot": "ur5e" + }, + { + "control": "table_support", + "family": "slipper", + "id": "piper-slipper-02-table_support", + "placements": [ + { + "position_m": [ + 0.40473021, + 0.39342813, + 0.06637683 + ], + "shoe_id": "slipper-left", + "yaw_rad": -0.1863574 + }, + { + "position_m": [ + 0.39971386, + 0.54759708, + 0.08089116 + ], + "shoe_id": "slipper-right", + "yaw_rad": -0.06194345 + } + ], + "repeat": 2, + "robot": "piper" + }, + { + "control": "table_disabled", + "family": "slipper", + "id": "piper-slipper-02-table_disabled", + "placements": [ + { + "position_m": [ + 0.40473021, + 0.39342813, + 0.06637683 + ], + "shoe_id": "slipper-left", + "yaw_rad": -0.1863574 + }, + { + "position_m": [ + 0.39971386, + 0.54759708, + 0.08089116 + ], + "shoe_id": "slipper-right", + "yaw_rad": -0.06194345 + } + ], + "repeat": 2, + "robot": "piper" + }, + { + "control": "table_support", + "family": "slipper", + "id": "so101-slipper-02-table_support", + "placements": [ + { + "position_m": [ + 0.40473021, + 0.39342813, + 0.06637683 + ], + "shoe_id": "slipper-left", + "yaw_rad": -0.1863574 + }, + { + "position_m": [ + 0.39971386, + 0.54759708, + 0.08089116 + ], + "shoe_id": "slipper-right", + "yaw_rad": -0.06194345 + } + ], + "repeat": 2, + "robot": "so101" + }, + { + "control": "table_disabled", + "family": "slipper", + "id": "so101-slipper-02-table_disabled", + "placements": [ + { + "position_m": [ + 0.40473021, + 0.39342813, + 0.06637683 + ], + "shoe_id": "slipper-left", + "yaw_rad": -0.1863574 + }, + { + "position_m": [ + 0.39971386, + 0.54759708, + 0.08089116 + ], + "shoe_id": "slipper-right", + "yaw_rad": -0.06194345 + } + ], + "repeat": 2, + "robot": "so101" + } + ], + "catalog": { + "catalog_sha256": "592f363389a96fef7f9223737aa72a2f1a74f400238924bf6790ec5bfd3302b7", + "environment": { + "default_layout": "Three columns x=.40,.76,1.12 m; two rows y=.38,.56 m; sole bottoms begin z=.08 m. Layout separates loading tests from reachability claims.", + "geometry": "Infinite collision plane at z=0; displayed with 2 m half extents. Not a finite tabletop or rack.", + "gravity_m_s2": [ + 0, + 0, + -9.81 + ], + "id": "open-support-plane", + "license": "MIT", + "name": "asset_table", + "property_evidence": "untested authored environment", + "version": "0.1.0" + }, + "license": "MIT", + "license_scope": "Original DVIDIA catalog and procedural shoes only; robot simulation assets retain their individual licenses.", + "limitations": [ + "All shoe physical properties are untested synthetic assumptions.", + "Left/right labels identify mirrored procedural instances, not scanned real shoes.", + "Arm command interfaces differ; installing a scene does not install a learned controller.", + "No deformation, real-world calibration, graspability claim or closed-loop sensor stack." + ], + "robots": [ + { + "arm_axes": 6, + "compatibility": { + "physical_robot_ready": false, + "scene_loading": true, + "scope": "Pinned native arm and gripper can share a rigid-shoe scene. This does not establish reachability, graspability, a shoe manipulation skill, or hardware compatibility.", + "shoe_grasp_qualified": false + }, + "expected_dimensions": { + "neq": 3, + "nq": 14, + "nu": 7, + "nv": 14 + }, + "gripper_command": "Native coupled gripper servo input [0,255]; not a measured gap or calibrated force.", + "gripper_command_axes": 1, + "gripper_mechanical_joints": 8, + "home_joint_positions": { + "elbow_joint": 1.5708, + "shoulder_lift_joint": -1.5708, + "shoulder_pan_joint": -1.5708, + "wrist_1_joint": -1.5708, + "wrist_2_joint": -1.5708, + "wrist_3_joint": 0 + }, + "id": "ur5e", + "immutable_id": "dvidia/robots/ur5e-2f85@0.1.0", + "licenses": { + "robotiq_2f85": "BSD-2-Clause", + "universal_robots_ur5e": "BSD-3-Clause" + }, + "name": "UR5e + Robotiq 2F-85", + "native_command_units": [ + "rad", + "rad", + "rad", + "rad", + "rad", + "rad", + "native_0_255" + ], + "openness_scope": "These licenses cover pinned simulation assets; SDK and physical hardware design licenses are separate.", + "source": { + "commit": "0059d4335f8156206f63a35662313385f7ad6d74", + "home_scope": "Authored scene initialization: UR5e and PiPER use the upstream home arm pose, zero gripper coordinates; SO101 uses its zero reference pose.", + "model_urls": [ + "https://github.com/google-deepmind/mujoco_menagerie/tree/0059d4335f8156206f63a35662313385f7ad6d74/universal_robots_ur5e", + "https://github.com/google-deepmind/mujoco_menagerie/tree/0059d4335f8156206f63a35662313385f7ad6d74/robotiq_2f85" + ], + "repository": "https://github.com/google-deepmind/mujoco_menagerie", + "verification": "Packaged SHA256 allowlist; assets are read from verified bytes, without network access." + }, + "version": "0.1.0" + }, + { + "arm_axes": 6, + "compatibility": { + "physical_robot_ready": false, + "scene_loading": true, + "scope": "Pinned native arm and gripper can share a rigid-shoe scene. This does not establish reachability, graspability, a shoe manipulation skill, or hardware compatibility.", + "shoe_grasp_qualified": false + }, + "expected_dimensions": { + "neq": 1, + "nq": 8, + "nu": 7, + "nv": 8 + }, + "gripper_command": "single-finger slide target in metres, native range [0,0.035]; not total jaw gap", + "gripper_command_axes": 1, + "gripper_mechanical_joints": 2, + "home_joint_positions": { + "joint1": 0, + "joint2": 1.57, + "joint3": -1.3485, + "joint4": 0, + "joint5": 0, + "joint6": 0, + "joint7": 0, + "joint8": 0 + }, + "id": "piper", + "immutable_id": "dvidia/robots/piper@0.1.0", + "licenses": { + "agilex_piper": "MIT" + }, + "name": "AgileX PiPER", + "native_command_units": [ + "rad", + "rad", + "rad", + "rad", + "rad", + "rad", + "m" + ], + "openness_scope": "These licenses cover pinned simulation assets; SDK and physical hardware design licenses are separate.", + "source": { + "commit": "0059d4335f8156206f63a35662313385f7ad6d74", + "home_scope": "Authored scene initialization: UR5e and PiPER use the upstream home arm pose, zero gripper coordinates; SO101 uses its zero reference pose.", + "model_urls": [ + "https://github.com/google-deepmind/mujoco_menagerie/tree/0059d4335f8156206f63a35662313385f7ad6d74/agilex_piper" + ], + "repository": "https://github.com/google-deepmind/mujoco_menagerie", + "verification": "Packaged SHA256 allowlist; assets are read from verified bytes, without network access." + }, + "version": "0.1.0" + }, + { + "arm_axes": 5, + "compatibility": { + "physical_robot_ready": false, + "scene_loading": true, + "scope": "Pinned native arm and gripper can share a rigid-shoe scene. This does not establish reachability, graspability, a shoe manipulation skill, or hardware compatibility.", + "shoe_grasp_qualified": false + }, + "expected_dimensions": { + "neq": 0, + "nq": 6, + "nu": 6, + "nv": 6 + }, + "gripper_command": "moving-jaw hinge angle target in radians; not linear jaw gap", + "gripper_command_axes": 1, + "gripper_mechanical_joints": 1, + "home_joint_positions": { + "elbow_flex": 0, + "gripper": 0, + "shoulder_lift": 0, + "shoulder_pan": 0, + "wrist_flex": 0, + "wrist_roll": 0 + }, + "id": "so101", + "immutable_id": "dvidia/robots/so101@0.1.0", + "licenses": { + "robotstudio_so101": "Apache-2.0" + }, + "name": "The Robot Studio SO101", + "native_command_units": [ + "rad", + "rad", + "rad", + "rad", + "rad", + "rad" + ], + "openness_scope": "These licenses cover pinned simulation assets; SDK and physical hardware design licenses are separate.", + "source": { + "commit": "0059d4335f8156206f63a35662313385f7ad6d74", + "home_scope": "Authored scene initialization: UR5e and PiPER use the upstream home arm pose, zero gripper coordinates; SO101 uses its zero reference pose.", + "model_urls": [ + "https://github.com/google-deepmind/mujoco_menagerie/tree/0059d4335f8156206f63a35662313385f7ad6d74/robotstudio_so101" + ], + "repository": "https://github.com/google-deepmind/mujoco_menagerie", + "verification": "Packaged SHA256 allowlist; assets are read from verified bytes, without network access." + }, + "version": "0.1.0" + } + ], + "schema": "dvidia.asset-catalog/v1", + "scope": "Reusable native scene assets with synthetic rigid shoes. Scene loading and gravity/contact checks do not demonstrate shoe manipulation, learning or physical robot transfer.", + "shoes": [ + { + "family": "trainer", + "fidelity": { + "deformation": "unsupported", + "geometry": "authored coarse proxy", + "measured_contact": "untested", + "native_contact": "available for numerical testing", + "physical_robot_ready": false, + "shoe_grasp_qualified": false + }, + "frame": { + "axes": "right-handed; +x toward toe, +y lateral, +z up", + "initial_bottom_z_m": 0.08, + "origin": "sole bottom center", + "sole_bottom_z_m": 0 + }, + "geometry": [ + { + "mass_fraction": 0.35, + "name": "sole", + "position_m": [ + 0, + 0, + 0.01 + ], + "rgba": [ + 0.16, + 0.17, + 0.18, + 1 + ], + "size_m": [ + 0.14, + 0.05, + 0.01 + ], + "type": "box" + }, + { + "mass_fraction": 0.55, + "name": "upper", + "position_m": [ + -0.005, + 0.003, + 0.052 + ], + "rgba": [ + 0.2, + 0.38, + 0.58, + 1 + ], + "size_m": [ + 0.122, + 0.047, + 0.035 + ], + "type": "ellipsoid" + }, + { + "mass_fraction": 0.1, + "name": "toe", + "position_m": [ + 0.095, + 0.003, + 0.045 + ], + "rgba": [ + 0.78, + 0.82, + 0.83, + 1 + ], + "size_m": [ + 0.04, + 0.047, + 0.026 + ], + "type": "ellipsoid" + } + ], + "id": "trainer-left", + "immutable_id": "dvidia/shoes/trainer-left@0.1.0", + "license": "MIT", + "name": "Trainer / left", + "pair_id": "dvidia/shoes/trainer-pair@0.1.0", + "properties": { + "contact_solver": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "MuJoCo solver parameters; no calibrated stiffness or damping", + "value": { + "condim": 4, + "priority": 1, + "solimp": [ + 0.9, + 0.95, + 0.001, + 0.5, + 2 + ], + "solref": [ + 0.02, + 1 + ] + } + }, + "deformation": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "model class", + "value": "Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation." + }, + "dimensions_m": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "m; length x, width y, maximum height z", + "value": [ + 0.28, + 0.1, + 0.087 + ] + }, + "mass_distribution": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "model assumption", + "value": "Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo." + }, + "mass_kg": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "kg", + "value": 0.3 + }, + "rolling_friction": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "m", + "value": 0.0001 + }, + "sliding_friction": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "dimensionless", + "value": 0.8 + }, + "torsional_friction": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "m", + "value": 0.005 + } + }, + "side": "left", + "source": { + "author": "DVIDIA", + "kind": "original_procedural", + "scope": "New primitive geometry; no redistributed scans, videos, photographs or model weights." + }, + "version": "0.1.0" + }, + { + "family": "trainer", + "fidelity": { + "deformation": "unsupported", + "geometry": "authored coarse proxy", + "measured_contact": "untested", + "native_contact": "available for numerical testing", + "physical_robot_ready": false, + "shoe_grasp_qualified": false + }, + "frame": { + "axes": "right-handed; +x toward toe, +y lateral, +z up", + "initial_bottom_z_m": 0.08, + "origin": "sole bottom center", + "sole_bottom_z_m": 0 + }, + "geometry": [ + { + "mass_fraction": 0.35, + "name": "sole", + "position_m": [ + 0, + 0, + 0.01 + ], + "rgba": [ + 0.16, + 0.17, + 0.18, + 1 + ], + "size_m": [ + 0.14, + 0.05, + 0.01 + ], + "type": "box" + }, + { + "mass_fraction": 0.55, + "name": "upper", + "position_m": [ + -0.005, + -0.003, + 0.052 + ], + "rgba": [ + 0.2, + 0.38, + 0.58, + 1 + ], + "size_m": [ + 0.122, + 0.047, + 0.035 + ], + "type": "ellipsoid" + }, + { + "mass_fraction": 0.1, + "name": "toe", + "position_m": [ + 0.095, + -0.003, + 0.045 + ], + "rgba": [ + 0.78, + 0.82, + 0.83, + 1 + ], + "size_m": [ + 0.04, + 0.047, + 0.026 + ], + "type": "ellipsoid" + } + ], + "id": "trainer-right", + "immutable_id": "dvidia/shoes/trainer-right@0.1.0", + "license": "MIT", + "name": "Trainer / right", + "pair_id": "dvidia/shoes/trainer-pair@0.1.0", + "properties": { + "contact_solver": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "MuJoCo solver parameters; no calibrated stiffness or damping", + "value": { + "condim": 4, + "priority": 1, + "solimp": [ + 0.9, + 0.95, + 0.001, + 0.5, + 2 + ], + "solref": [ + 0.02, + 1 + ] + } + }, + "deformation": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "model class", + "value": "Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation." + }, + "dimensions_m": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "m; length x, width y, maximum height z", + "value": [ + 0.28, + 0.1, + 0.087 + ] + }, + "mass_distribution": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "model assumption", + "value": "Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo." + }, + "mass_kg": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "kg", + "value": 0.3 + }, + "rolling_friction": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "m", + "value": 0.0001 + }, + "sliding_friction": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "dimensionless", + "value": 0.8 + }, + "torsional_friction": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "m", + "value": 0.005 + } + }, + "side": "right", + "source": { + "author": "DVIDIA", + "kind": "original_procedural", + "scope": "New primitive geometry; no redistributed scans, videos, photographs or model weights." + }, + "version": "0.1.0" + }, + { + "family": "ankle-boot", + "fidelity": { + "deformation": "unsupported", + "geometry": "authored coarse proxy", + "measured_contact": "untested", + "native_contact": "available for numerical testing", + "physical_robot_ready": false, + "shoe_grasp_qualified": false + }, + "frame": { + "axes": "right-handed; +x toward toe, +y lateral, +z up", + "initial_bottom_z_m": 0.08, + "origin": "sole bottom center", + "sole_bottom_z_m": 0 + }, + "geometry": [ + { + "mass_fraction": 0.35, + "name": "sole", + "position_m": [ + 0, + 0, + 0.012 + ], + "rgba": [ + 0.16, + 0.17, + 0.18, + 1 + ], + "size_m": [ + 0.145, + 0.054, + 0.012 + ], + "type": "box" + }, + { + "mass_fraction": 0.3, + "name": "upper", + "position_m": [ + 0.01, + 0.004, + 0.064 + ], + "rgba": [ + 0.37, + 0.24, + 0.16, + 1 + ], + "size_m": [ + 0.13, + 0.05, + 0.04 + ], + "type": "ellipsoid" + }, + { + "mass_fraction": 0.35, + "name": "ankle", + "position_m": [ + -0.085, + 0.004, + 0.135 + ], + "rgba": [ + 0.37, + 0.24, + 0.16, + 1 + ], + "size_m": [ + 0.047, + 0.049, + 0.055 + ], + "type": "ellipsoid" + } + ], + "id": "ankle-boot-left", + "immutable_id": "dvidia/shoes/ankle-boot-left@0.1.0", + "license": "MIT", + "name": "Ankle Boot / left", + "pair_id": "dvidia/shoes/ankle-boot-pair@0.1.0", + "properties": { + "contact_solver": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "MuJoCo solver parameters; no calibrated stiffness or damping", + "value": { + "condim": 4, + "priority": 1, + "solimp": [ + 0.9, + 0.95, + 0.001, + 0.5, + 2 + ], + "solref": [ + 0.02, + 1 + ] + } + }, + "deformation": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "model class", + "value": "Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation." + }, + "dimensions_m": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "m; length x, width y, maximum height z", + "value": [ + 0.29, + 0.108, + 0.19 + ] + }, + "mass_distribution": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "model assumption", + "value": "Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo." + }, + "mass_kg": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "kg", + "value": 0.5 + }, + "rolling_friction": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "m", + "value": 0.0001 + }, + "sliding_friction": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "dimensionless", + "value": 0.9 + }, + "torsional_friction": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "m", + "value": 0.005 + } + }, + "side": "left", + "source": { + "author": "DVIDIA", + "kind": "original_procedural", + "scope": "New primitive geometry; no redistributed scans, videos, photographs or model weights." + }, + "version": "0.1.0" + }, + { + "family": "ankle-boot", + "fidelity": { + "deformation": "unsupported", + "geometry": "authored coarse proxy", + "measured_contact": "untested", + "native_contact": "available for numerical testing", + "physical_robot_ready": false, + "shoe_grasp_qualified": false + }, + "frame": { + "axes": "right-handed; +x toward toe, +y lateral, +z up", + "initial_bottom_z_m": 0.08, + "origin": "sole bottom center", + "sole_bottom_z_m": 0 + }, + "geometry": [ + { + "mass_fraction": 0.35, + "name": "sole", + "position_m": [ + 0, + 0, + 0.012 + ], + "rgba": [ + 0.16, + 0.17, + 0.18, + 1 + ], + "size_m": [ + 0.145, + 0.054, + 0.012 + ], + "type": "box" + }, + { + "mass_fraction": 0.3, + "name": "upper", + "position_m": [ + 0.01, + -0.004, + 0.064 + ], + "rgba": [ + 0.37, + 0.24, + 0.16, + 1 + ], + "size_m": [ + 0.13, + 0.05, + 0.04 + ], + "type": "ellipsoid" + }, + { + "mass_fraction": 0.35, + "name": "ankle", + "position_m": [ + -0.085, + -0.004, + 0.135 + ], + "rgba": [ + 0.37, + 0.24, + 0.16, + 1 + ], + "size_m": [ + 0.047, + 0.049, + 0.055 + ], + "type": "ellipsoid" + } + ], + "id": "ankle-boot-right", + "immutable_id": "dvidia/shoes/ankle-boot-right@0.1.0", + "license": "MIT", + "name": "Ankle Boot / right", + "pair_id": "dvidia/shoes/ankle-boot-pair@0.1.0", + "properties": { + "contact_solver": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "MuJoCo solver parameters; no calibrated stiffness or damping", + "value": { + "condim": 4, + "priority": 1, + "solimp": [ + 0.9, + 0.95, + 0.001, + 0.5, + 2 + ], + "solref": [ + 0.02, + 1 + ] + } + }, + "deformation": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "model class", + "value": "Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation." + }, + "dimensions_m": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "m; length x, width y, maximum height z", + "value": [ + 0.29, + 0.108, + 0.19 + ] + }, + "mass_distribution": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "model assumption", + "value": "Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo." + }, + "mass_kg": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "kg", + "value": 0.5 + }, + "rolling_friction": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "m", + "value": 0.0001 + }, + "sliding_friction": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "dimensionless", + "value": 0.9 + }, + "torsional_friction": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "m", + "value": 0.005 + } + }, + "side": "right", + "source": { + "author": "DVIDIA", + "kind": "original_procedural", + "scope": "New primitive geometry; no redistributed scans, videos, photographs or model weights." + }, + "version": "0.1.0" + }, + { + "family": "slipper", + "fidelity": { + "deformation": "unsupported", + "geometry": "authored coarse proxy", + "measured_contact": "untested", + "native_contact": "available for numerical testing", + "physical_robot_ready": false, + "shoe_grasp_qualified": false + }, + "frame": { + "axes": "right-handed; +x toward toe, +y lateral, +z up", + "initial_bottom_z_m": 0.08, + "origin": "sole bottom center", + "sole_bottom_z_m": 0 + }, + "geometry": [ + { + "mass_fraction": 0.35, + "name": "sole", + "position_m": [ + 0, + 0, + 0.009 + ], + "rgba": [ + 0.16, + 0.17, + 0.18, + 1 + ], + "size_m": [ + 0.135, + 0.051, + 0.009 + ], + "type": "box" + }, + { + "mass_fraction": 0.65, + "name": "upper", + "position_m": [ + 0.045, + 0.002, + 0.038 + ], + "rgba": [ + 0.52, + 0.31, + 0.37, + 1 + ], + "size_m": [ + 0.09, + 0.049, + 0.017 + ], + "type": "ellipsoid" + } + ], + "id": "slipper-left", + "immutable_id": "dvidia/shoes/slipper-left@0.1.0", + "license": "MIT", + "name": "Slipper / left", + "pair_id": "dvidia/shoes/slipper-pair@0.1.0", + "properties": { + "contact_solver": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "MuJoCo solver parameters; no calibrated stiffness or damping", + "value": { + "condim": 4, + "priority": 1, + "solimp": [ + 0.9, + 0.95, + 0.001, + 0.5, + 2 + ], + "solref": [ + 0.02, + 1 + ] + } + }, + "deformation": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "model class", + "value": "Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation." + }, + "dimensions_m": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "m; length x, width y, maximum height z", + "value": [ + 0.27, + 0.102, + 0.055 + ] + }, + "mass_distribution": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "model assumption", + "value": "Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo." + }, + "mass_kg": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "kg", + "value": 0.15 + }, + "rolling_friction": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "m", + "value": 0.0001 + }, + "sliding_friction": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "dimensionless", + "value": 0.65 + }, + "torsional_friction": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "m", + "value": 0.005 + } + }, + "side": "left", + "source": { + "author": "DVIDIA", + "kind": "original_procedural", + "scope": "New primitive geometry; no redistributed scans, videos, photographs or model weights." + }, + "version": "0.1.0" + }, + { + "family": "slipper", + "fidelity": { + "deformation": "unsupported", + "geometry": "authored coarse proxy", + "measured_contact": "untested", + "native_contact": "available for numerical testing", + "physical_robot_ready": false, + "shoe_grasp_qualified": false + }, + "frame": { + "axes": "right-handed; +x toward toe, +y lateral, +z up", + "initial_bottom_z_m": 0.08, + "origin": "sole bottom center", + "sole_bottom_z_m": 0 + }, + "geometry": [ + { + "mass_fraction": 0.35, + "name": "sole", + "position_m": [ + 0, + 0, + 0.009 + ], + "rgba": [ + 0.16, + 0.17, + 0.18, + 1 + ], + "size_m": [ + 0.135, + 0.051, + 0.009 + ], + "type": "box" + }, + { + "mass_fraction": 0.65, + "name": "upper", + "position_m": [ + 0.045, + -0.002, + 0.038 + ], + "rgba": [ + 0.52, + 0.31, + 0.37, + 1 + ], + "size_m": [ + 0.09, + 0.049, + 0.017 + ], + "type": "ellipsoid" + } + ], + "id": "slipper-right", + "immutable_id": "dvidia/shoes/slipper-right@0.1.0", + "license": "MIT", + "name": "Slipper / right", + "pair_id": "dvidia/shoes/slipper-pair@0.1.0", + "properties": { + "contact_solver": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "MuJoCo solver parameters; no calibrated stiffness or damping", + "value": { + "condim": 4, + "priority": 1, + "solimp": [ + 0.9, + 0.95, + 0.001, + 0.5, + 2 + ], + "solref": [ + 0.02, + 1 + ] + } + }, + "deformation": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "model class", + "value": "Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation." + }, + "dimensions_m": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "m; length x, width y, maximum height z", + "value": [ + 0.27, + 0.102, + 0.055 + ] + }, + "mass_distribution": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "model assumption", + "value": "Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo." + }, + "mass_kg": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "kg", + "value": 0.15 + }, + "rolling_friction": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "m", + "value": 0.0001 + }, + "sliding_friction": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "dimensionless", + "value": 0.65 + }, + "torsional_friction": { + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value.", + "units": "m", + "value": 0.005 + } + }, + "side": "right", + "source": { + "author": "DVIDIA", + "kind": "original_procedural", + "scope": "New primitive geometry; no redistributed scans, videos, photographs or model weights." + }, + "version": "0.1.0" + } + ], + "units": { + "angle": "rad", + "length": "m", + "mass": "kg", + "quaternion": "wxyz", + "time": "s" + }, + "version": "0.1.0", + "world_frame": "right-handed; robot base reference at world origin, +z up" + }, + "catalog_sha256": "49f8cf25ea1a90a0760940353cd21e08c8de8d90e42c325738ec4faad5a96e15", + "comparison": "Both controls start at the identical free-joint positions, quaternions and held robot commands. table_disabled changes only the support plane collision masks to zero. Unexpected control support successes, errors and incomplete runs remain in the denominator.", + "contact_recording_scope": "Loaded shoe contacts are sampled every 20 ms. Expected outcomes require no non-table shoe contacts in any recorded sample; transients between samples are not ruled out.", + "duration_seconds": 1.0, + "gravity_m_s2": [ + 0.0, + 0.0, + -9.81 + ], + "implementation_sha256": { + "asset_benchmark.py": "922cce190521b2b6a404bcece90e0f9f84b007d4987011d25ff5c8f6f914c40e", + "asset_catalog.json": "592f363389a96fef7f9223737aa72a2f1a74f400238924bf6790ec5bfd3302b7", + "asset_library.py": "12520ca13b7806004be37a0d7e0d1e023c90410c1eba899296fdcd5b28fdc7f7", + "reference_assets.lock.json": "941eb6f9fd474635a590b82c66b59a9d5124d8e0d9ddc203006f5b921d8d2861", + "reference_sim.py": "c1201d22eb13dd07a236ee63cc4ba68e129f6067e8db61ed41af2d820eb5e3b8", + "robot_profiles.lock.json": "4b2ee2ca675aceb2f826983cb3082a3e08e9aa0ff419b23078abcff08ebcc6fe", + "robot_profiles.py": "fb90782a6a9979e282182118ae0e3e29d00f101255cc57378dd3f692672bb13d" + }, + "independence_note": "Matched seeded layouts are reused across robots and controls; these are synthetic numerical checks, not independent real shoes or held-out hardware trials.", + "planned_attempts": 54, + "repeats": 3, + "sample_interval_seconds": 0.02, + "schema": "dvidia.asset-library-protocol/v1", + "scope": "Native CPU scene loading, free rigid-shoe gravity and passive table support. Original procedural shoe proxies with assumed physical properties. No shoe grasping, organizing policy, deformation calibration, learned skill or hardware qualification.", + "seed": 612047, + "source_commit": "441ee2871620104246ab9caeb89825f12a14b889", + "thresholds": { + "angular_speed_limit_rad_s": 0.2, + "bottom_tolerance_m": 0.008, + "contact_normal_force_min_n": 1e-06, + "control_min_drop_m": 0.1, + "gravity_position_tolerance_m": 0.001, + "gravity_probe_seconds": 0.04, + "gravity_velocity_tolerance_m_s": 0.015, + "linear_speed_limit_m_s": 0.03, + "support_window_seconds": 0.2 + }, + "timestep_seconds": 0.002, + "timing_scope": "Native-step timings measure mj_step only on this host; state extraction, mj_forward, compilation, rendering, sensing, training and actuation are excluded. Attempt wall includes verification, compilation, physics and state extraction. Run wall ends before report serialization. Process peak RSS includes prior allocations and is not a minimum memory requirement. These measurements do not establish real-time robot performance." +} diff --git a/asset-library/v01/benchmark/report.html b/asset-library/v01/benchmark/report.html new file mode 100644 index 0000000000000000000000000000000000000000..e1e34d36792406046aa688eb01811d2fcf5b03d9 --- /dev/null +++ b/asset-library/v01/benchmark/report.html @@ -0,0 +1,31 @@ +DVIDIA · Shoe asset benchmark

DVIDIA RESEARCH

Shoe assets: load, drop, settle

Native CPU scene loading, free rigid-shoe gravity and passive table support. Original procedural shoe proxies with assumed physical properties. No shoe grasping, organizing policy, deformation calibration, learned skill or hardware qualification.

54 planned attempts. Failures and invalid attempts remain in the denominator. Support success is expected with the table; zero support successes are expected with its collisions disabled.

Frozen protocol and catalog · Every native trajectory · Report · Integrity

ArmControlAttemptsValidSupportedGravityOther contactExpected outcome
ur5etable_support999909
ur5etable_disabled990909
pipertable_support999909
pipertable_disabled990909
so101table_support999909
so101table_disabled990909

Measurement scope

Native-step timings measure mj_step only on this host; state extraction, mj_forward, compilation, rendering, sensing, training and actuation are excluded. Attempt wall includes verification, compilation, physics and state extraction. Run wall ends before report serialization. Process peak RSS includes prior allocations and is not a minimum memory requirement. These measurements do not establish real-time robot performance.

{
+  "attempt_wall": {
+    "count": 54,
+    "max_seconds": 6.704695750027895,
+    "p50_seconds": 0.10058806301094592,
+    "p95_seconds": 0.1465771359624341,
+    "p99_seconds": 3.3758932149712857,
+    "total_seconds": 12.352415461326018
+  },
+  "compile": {
+    "count": 54,
+    "max_seconds": 0.4138097499962896,
+    "p50_seconds": 0.06565612449776381,
+    "p95_seconds": 0.0985709686996415,
+    "p99_seconds": 0.37721267603570585,
+    "total_seconds": 4.094927620142698
+  },
+  "native_step": {
+    "count": 27000,
+    "max_seconds": 0.00011191610246896744,
+    "p50_seconds": 8.500181138515472e-06,
+    "p95_seconds": 1.5750061720609665e-05,
+    "p99_seconds": 2.3417582269757922e-05,
+    "total_seconds": 0.2501475957687944
+  },
+  "process_peak_rss_bytes": 1111916544,
+  "run_wall_seconds": 12.361563832964748,
+  "scope": "Native-step timings measure mj_step only on this host; state extraction, mj_forward, compilation, rendering, sensing, training and actuation are excluded. Attempt wall includes verification, compilation, physics and state extraction. Run wall ends before report serialization. Process peak RSS includes prior allocations and is not a minimum memory requirement. These measurements do not establish real-time robot performance.",
+  "simulated_seconds": 54.0,
+  "simulated_seconds_per_run_wall_second": 4.368379335306871
+}

Sampled trajectories are privileged native state. The first library checks composition and passive support. A manipulation controller and measured shoe properties are separate evidence requirements.

\ No newline at end of file diff --git a/asset-library/v01/benchmark/report.json b/asset-library/v01/benchmark/report.json new file mode 100644 index 0000000000000000000000000000000000000000..88c895a4dfc61b88e45f73f196cde72a9bc303aa --- /dev/null +++ b/asset-library/v01/benchmark/report.json @@ -0,0 +1,111 @@ +{ + "attempted": 54, + "attempts_sha256": "78a9ae2aa84bb484b6bddda21773663afa586e48321493fef2542218fc49f8eb", + "catalog_sha256": "49f8cf25ea1a90a0760940353cd21e08c8de8d90e42c325738ec4faad5a96e15", + "hardware": { + "cpu_model": "Apple M5", + "logical_cpu_count": 10, + "machine": "arm64", + "platform": "Darwin", + "python": "3.12.9", + "total_memory_bytes": 25769803776 + }, + "physical_robot_ready": false, + "protocol_sha256": "d5abad1ebf9eda71d1f47606ba0664b9e4bfe6970c54088bf43d5e818782268d", + "schema": "dvidia.asset-library-benchmark/v1", + "scope": "Native CPU scene loading, free rigid-shoe gravity and passive table support. Original procedural shoe proxies with assumed physical properties. No shoe grasping, organizing policy, deformation calibration, learned skill or hardware qualification.", + "shoe_manipulation_qualified": false, + "summary": [ + { + "attempted": 9, + "control": "table_support", + "expected_outcome": 9, + "gravity_success": 9, + "robot": "ur5e", + "support_success": 9, + "unexpected_contact_attempts": 0, + "valid": 9 + }, + { + "attempted": 9, + "control": "table_disabled", + "expected_outcome": 9, + "gravity_success": 9, + "robot": "ur5e", + "support_success": 0, + "unexpected_contact_attempts": 0, + "valid": 9 + }, + { + "attempted": 9, + "control": "table_support", + "expected_outcome": 9, + "gravity_success": 9, + "robot": "piper", + "support_success": 9, + "unexpected_contact_attempts": 0, + "valid": 9 + }, + { + "attempted": 9, + "control": "table_disabled", + "expected_outcome": 9, + "gravity_success": 9, + "robot": "piper", + "support_success": 0, + "unexpected_contact_attempts": 0, + "valid": 9 + }, + { + "attempted": 9, + "control": "table_support", + "expected_outcome": 9, + "gravity_success": 9, + "robot": "so101", + "support_success": 9, + "unexpected_contact_attempts": 0, + "valid": 9 + }, + { + "attempted": 9, + "control": "table_disabled", + "expected_outcome": 9, + "gravity_success": 9, + "robot": "so101", + "support_success": 0, + "unexpected_contact_attempts": 0, + "valid": 9 + } + ], + "timing": { + "attempt_wall": { + "count": 54, + "max_seconds": 6.704695750027895, + "p50_seconds": 0.10058806301094592, + "p95_seconds": 0.1465771359624341, + "p99_seconds": 3.3758932149712857, + "total_seconds": 12.352415461326018 + }, + "compile": { + "count": 54, + "max_seconds": 0.4138097499962896, + "p50_seconds": 0.06565612449776381, + "p95_seconds": 0.0985709686996415, + "p99_seconds": 0.37721267603570585, + "total_seconds": 4.094927620142698 + }, + "native_step": { + "count": 27000, + "max_seconds": 0.00011191610246896744, + "p50_seconds": 8.500181138515472e-06, + "p95_seconds": 1.5750061720609665e-05, + "p99_seconds": 2.3417582269757922e-05, + "total_seconds": 0.2501475957687944 + }, + "process_peak_rss_bytes": 1111916544, + "run_wall_seconds": 12.361563832964748, + "scope": "Native-step timings measure mj_step only on this host; state extraction, mj_forward, compilation, rendering, sensing, training and actuation are excluded. Attempt wall includes verification, compilation, physics and state extraction. Run wall ends before report serialization. Process peak RSS includes prior allocations and is not a minimum memory requirement. These measurements do not establish real-time robot performance.", + "simulated_seconds": 54.0, + "simulated_seconds_per_run_wall_second": 4.368379335306871 + } +} diff --git a/asset-library/v01/catalog.json b/asset-library/v01/catalog.json new file mode 100644 index 0000000000000000000000000000000000000000..4660981d1bcc629b6acba90285d4f37ab3d5a945 --- /dev/null +++ b/asset-library/v01/catalog.json @@ -0,0 +1,1129 @@ +{ + "schema": "dvidia.asset-catalog/v1", + "version": "0.1.0", + "license": "MIT", + "license_scope": "Original DVIDIA catalog and procedural shoes only; robot simulation assets retain their individual licenses.", + "scope": "Reusable native scene assets with synthetic rigid shoes. Scene loading and gravity/contact checks do not demonstrate shoe manipulation, learning or physical robot transfer.", + "units": { + "length": "m", + "mass": "kg", + "time": "s", + "angle": "rad", + "quaternion": "wxyz" + }, + "world_frame": "right-handed; robot base reference at world origin, +z up", + "robots": [ + { + "id": "ur5e", + "name": "UR5e + Robotiq 2F-85", + "version": "0.1.0", + "immutable_id": "dvidia/robots/ur5e-2f85@0.1.0", + "arm_axes": 6, + "gripper_command_axes": 1, + "gripper_mechanical_joints": 8, + "native_command_units": [ + "rad", + "rad", + "rad", + "rad", + "rad", + "rad", + "native_0_255" + ], + "gripper_command": "Native coupled gripper servo input [0,255]; not a measured gap or calibrated force.", + "licenses": { + "universal_robots_ur5e": "BSD-3-Clause", + "robotiq_2f85": "BSD-2-Clause" + }, + "source": { + "repository": "https://github.com/google-deepmind/mujoco_menagerie", + "commit": "0059d4335f8156206f63a35662313385f7ad6d74", + "verification": "Packaged SHA256 allowlist; assets are read from verified bytes, without network access.", + "model_urls": [ + "https://github.com/google-deepmind/mujoco_menagerie/tree/0059d4335f8156206f63a35662313385f7ad6d74/universal_robots_ur5e", + "https://github.com/google-deepmind/mujoco_menagerie/tree/0059d4335f8156206f63a35662313385f7ad6d74/robotiq_2f85" + ], + "home_scope": "Authored scene initialization: UR5e and PiPER use the upstream home arm pose, zero gripper coordinates; SO101 uses its zero reference pose." + }, + "home_joint_positions": { + "shoulder_pan_joint": -1.5708, + "shoulder_lift_joint": -1.5708, + "elbow_joint": 1.5708, + "wrist_1_joint": -1.5708, + "wrist_2_joint": -1.5708, + "wrist_3_joint": 0 + }, + "expected_dimensions": { + "nq": 14, + "nv": 14, + "nu": 7, + "neq": 3 + }, + "compatibility": { + "scene_loading": true, + "shoe_grasp_qualified": false, + "physical_robot_ready": false, + "scope": "Pinned native arm and gripper can share a rigid-shoe scene. This does not establish reachability, graspability, a shoe manipulation skill, or hardware compatibility." + }, + "openness_scope": "These licenses cover pinned simulation assets; SDK and physical hardware design licenses are separate." + }, + { + "id": "piper", + "name": "AgileX PiPER", + "version": "0.1.0", + "immutable_id": "dvidia/robots/piper@0.1.0", + "arm_axes": 6, + "gripper_command_axes": 1, + "gripper_mechanical_joints": 2, + "native_command_units": [ + "rad", + "rad", + "rad", + "rad", + "rad", + "rad", + "m" + ], + "gripper_command": "single-finger slide target in metres, native range [0,0.035]; not total jaw gap", + "licenses": { + "agilex_piper": "MIT" + }, + "source": { + "repository": "https://github.com/google-deepmind/mujoco_menagerie", + "commit": "0059d4335f8156206f63a35662313385f7ad6d74", + "verification": "Packaged SHA256 allowlist; assets are read from verified bytes, without network access.", + "model_urls": [ + "https://github.com/google-deepmind/mujoco_menagerie/tree/0059d4335f8156206f63a35662313385f7ad6d74/agilex_piper" + ], + "home_scope": "Authored scene initialization: UR5e and PiPER use the upstream home arm pose, zero gripper coordinates; SO101 uses its zero reference pose." + }, + "home_joint_positions": { + "joint1": 0, + "joint2": 1.57, + "joint3": -1.3485, + "joint4": 0, + "joint5": 0, + "joint6": 0, + "joint7": 0, + "joint8": 0 + }, + "expected_dimensions": { + "nq": 8, + "nv": 8, + "nu": 7, + "neq": 1 + }, + "compatibility": { + "scene_loading": true, + "shoe_grasp_qualified": false, + "physical_robot_ready": false, + "scope": "Pinned native arm and gripper can share a rigid-shoe scene. This does not establish reachability, graspability, a shoe manipulation skill, or hardware compatibility." + }, + "openness_scope": "These licenses cover pinned simulation assets; SDK and physical hardware design licenses are separate." + }, + { + "id": "so101", + "name": "The Robot Studio SO101", + "version": "0.1.0", + "immutable_id": "dvidia/robots/so101@0.1.0", + "arm_axes": 5, + "gripper_command_axes": 1, + "gripper_mechanical_joints": 1, + "native_command_units": [ + "rad", + "rad", + "rad", + "rad", + "rad", + "rad" + ], + "gripper_command": "moving-jaw hinge angle target in radians; not linear jaw gap", + "licenses": { + "robotstudio_so101": "Apache-2.0" + }, + "source": { + "repository": "https://github.com/google-deepmind/mujoco_menagerie", + "commit": "0059d4335f8156206f63a35662313385f7ad6d74", + "verification": "Packaged SHA256 allowlist; assets are read from verified bytes, without network access.", + "model_urls": [ + "https://github.com/google-deepmind/mujoco_menagerie/tree/0059d4335f8156206f63a35662313385f7ad6d74/robotstudio_so101" + ], + "home_scope": "Authored scene initialization: UR5e and PiPER use the upstream home arm pose, zero gripper coordinates; SO101 uses its zero reference pose." + }, + "home_joint_positions": { + "shoulder_pan": 0, + "shoulder_lift": 0, + "elbow_flex": 0, + "wrist_flex": 0, + "wrist_roll": 0, + "gripper": 0 + }, + "expected_dimensions": { + "nq": 6, + "nv": 6, + "nu": 6, + "neq": 0 + }, + "compatibility": { + "scene_loading": true, + "shoe_grasp_qualified": false, + "physical_robot_ready": false, + "scope": "Pinned native arm and gripper can share a rigid-shoe scene. This does not establish reachability, graspability, a shoe manipulation skill, or hardware compatibility." + }, + "openness_scope": "These licenses cover pinned simulation assets; SDK and physical hardware design licenses are separate." + } + ], + "shoes": [ + { + "id": "trainer-left", + "name": "Trainer / left", + "version": "0.1.0", + "immutable_id": "dvidia/shoes/trainer-left@0.1.0", + "family": "trainer", + "pair_id": "dvidia/shoes/trainer-pair@0.1.0", + "side": "left", + "license": "MIT", + "source": { + "kind": "original_procedural", + "author": "DVIDIA", + "scope": "New primitive geometry; no redistributed scans, videos, photographs or model weights." + }, + "properties": { + "dimensions_m": { + "value": [ + 0.28, + 0.1, + 0.087 + ], + "units": "m; length x, width y, maximum height z", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "mass_kg": { + "value": 0.3, + "units": "kg", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "sliding_friction": { + "value": 0.8, + "units": "dimensionless", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "torsional_friction": { + "value": 0.005, + "units": "m", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "rolling_friction": { + "value": 0.0001, + "units": "m", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "mass_distribution": { + "value": "Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.", + "units": "model assumption", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "deformation": { + "value": "Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.", + "units": "model class", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "contact_solver": { + "value": { + "condim": 4, + "priority": 1, + "solref": [ + 0.02, + 1 + ], + "solimp": [ + 0.9, + 0.95, + 0.001, + 0.5, + 2 + ] + }, + "units": "MuJoCo solver parameters; no calibrated stiffness or damping", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + } + }, + "frame": { + "origin": "sole bottom center", + "axes": "right-handed; +x toward toe, +y lateral, +z up", + "sole_bottom_z_m": 0, + "initial_bottom_z_m": 0.08 + }, + "geometry": [ + { + "name": "sole", + "type": "box", + "size_m": [ + 0.14, + 0.05, + 0.01 + ], + "position_m": [ + 0, + 0, + 0.01 + ], + "mass_fraction": 0.35, + "rgba": [ + 0.16, + 0.17, + 0.18, + 1 + ] + }, + { + "name": "upper", + "type": "ellipsoid", + "size_m": [ + 0.122, + 0.047, + 0.035 + ], + "position_m": [ + -0.005, + 0.003, + 0.052 + ], + "mass_fraction": 0.55, + "rgba": [ + 0.2, + 0.38, + 0.58, + 1 + ] + }, + { + "name": "toe", + "type": "ellipsoid", + "size_m": [ + 0.04, + 0.047, + 0.026 + ], + "position_m": [ + 0.095, + 0.003, + 0.045 + ], + "mass_fraction": 0.1, + "rgba": [ + 0.78, + 0.82, + 0.83, + 1 + ] + } + ], + "fidelity": { + "geometry": "authored coarse proxy", + "native_contact": "available for numerical testing", + "measured_contact": "untested", + "deformation": "unsupported", + "shoe_grasp_qualified": false, + "physical_robot_ready": false + } + }, + { + "id": "trainer-right", + "name": "Trainer / right", + "version": "0.1.0", + "immutable_id": "dvidia/shoes/trainer-right@0.1.0", + "family": "trainer", + "pair_id": "dvidia/shoes/trainer-pair@0.1.0", + "side": "right", + "license": "MIT", + "source": { + "kind": "original_procedural", + "author": "DVIDIA", + "scope": "New primitive geometry; no redistributed scans, videos, photographs or model weights." + }, + "properties": { + "dimensions_m": { + "value": [ + 0.28, + 0.1, + 0.087 + ], + "units": "m; length x, width y, maximum height z", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "mass_kg": { + "value": 0.3, + "units": "kg", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "sliding_friction": { + "value": 0.8, + "units": "dimensionless", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "torsional_friction": { + "value": 0.005, + "units": "m", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "rolling_friction": { + "value": 0.0001, + "units": "m", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "mass_distribution": { + "value": "Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.", + "units": "model assumption", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "deformation": { + "value": "Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.", + "units": "model class", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "contact_solver": { + "value": { + "condim": 4, + "priority": 1, + "solref": [ + 0.02, + 1 + ], + "solimp": [ + 0.9, + 0.95, + 0.001, + 0.5, + 2 + ] + }, + "units": "MuJoCo solver parameters; no calibrated stiffness or damping", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + } + }, + "frame": { + "origin": "sole bottom center", + "axes": "right-handed; +x toward toe, +y lateral, +z up", + "sole_bottom_z_m": 0, + "initial_bottom_z_m": 0.08 + }, + "geometry": [ + { + "name": "sole", + "type": "box", + "size_m": [ + 0.14, + 0.05, + 0.01 + ], + "position_m": [ + 0, + 0, + 0.01 + ], + "mass_fraction": 0.35, + "rgba": [ + 0.16, + 0.17, + 0.18, + 1 + ] + }, + { + "name": "upper", + "type": "ellipsoid", + "size_m": [ + 0.122, + 0.047, + 0.035 + ], + "position_m": [ + -0.005, + -0.003, + 0.052 + ], + "mass_fraction": 0.55, + "rgba": [ + 0.2, + 0.38, + 0.58, + 1 + ] + }, + { + "name": "toe", + "type": "ellipsoid", + "size_m": [ + 0.04, + 0.047, + 0.026 + ], + "position_m": [ + 0.095, + -0.003, + 0.045 + ], + "mass_fraction": 0.1, + "rgba": [ + 0.78, + 0.82, + 0.83, + 1 + ] + } + ], + "fidelity": { + "geometry": "authored coarse proxy", + "native_contact": "available for numerical testing", + "measured_contact": "untested", + "deformation": "unsupported", + "shoe_grasp_qualified": false, + "physical_robot_ready": false + } + }, + { + "id": "ankle-boot-left", + "name": "Ankle Boot / left", + "version": "0.1.0", + "immutable_id": "dvidia/shoes/ankle-boot-left@0.1.0", + "family": "ankle-boot", + "pair_id": "dvidia/shoes/ankle-boot-pair@0.1.0", + "side": "left", + "license": "MIT", + "source": { + "kind": "original_procedural", + "author": "DVIDIA", + "scope": "New primitive geometry; no redistributed scans, videos, photographs or model weights." + }, + "properties": { + "dimensions_m": { + "value": [ + 0.29, + 0.108, + 0.19 + ], + "units": "m; length x, width y, maximum height z", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "mass_kg": { + "value": 0.5, + "units": "kg", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "sliding_friction": { + "value": 0.9, + "units": "dimensionless", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "torsional_friction": { + "value": 0.005, + "units": "m", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "rolling_friction": { + "value": 0.0001, + "units": "m", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "mass_distribution": { + "value": "Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.", + "units": "model assumption", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "deformation": { + "value": "Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.", + "units": "model class", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "contact_solver": { + "value": { + "condim": 4, + "priority": 1, + "solref": [ + 0.02, + 1 + ], + "solimp": [ + 0.9, + 0.95, + 0.001, + 0.5, + 2 + ] + }, + "units": "MuJoCo solver parameters; no calibrated stiffness or damping", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + } + }, + "frame": { + "origin": "sole bottom center", + "axes": "right-handed; +x toward toe, +y lateral, +z up", + "sole_bottom_z_m": 0, + "initial_bottom_z_m": 0.08 + }, + "geometry": [ + { + "name": "sole", + "type": "box", + "size_m": [ + 0.145, + 0.054, + 0.012 + ], + "position_m": [ + 0, + 0, + 0.012 + ], + "mass_fraction": 0.35, + "rgba": [ + 0.16, + 0.17, + 0.18, + 1 + ] + }, + { + "name": "upper", + "type": "ellipsoid", + "size_m": [ + 0.13, + 0.05, + 0.04 + ], + "position_m": [ + 0.01, + 0.004, + 0.064 + ], + "mass_fraction": 0.3, + "rgba": [ + 0.37, + 0.24, + 0.16, + 1 + ] + }, + { + "name": "ankle", + "type": "ellipsoid", + "size_m": [ + 0.047, + 0.049, + 0.055 + ], + "position_m": [ + -0.085, + 0.004, + 0.135 + ], + "mass_fraction": 0.35, + "rgba": [ + 0.37, + 0.24, + 0.16, + 1 + ] + } + ], + "fidelity": { + "geometry": "authored coarse proxy", + "native_contact": "available for numerical testing", + "measured_contact": "untested", + "deformation": "unsupported", + "shoe_grasp_qualified": false, + "physical_robot_ready": false + } + }, + { + "id": "ankle-boot-right", + "name": "Ankle Boot / right", + "version": "0.1.0", + "immutable_id": "dvidia/shoes/ankle-boot-right@0.1.0", + "family": "ankle-boot", + "pair_id": "dvidia/shoes/ankle-boot-pair@0.1.0", + "side": "right", + "license": "MIT", + "source": { + "kind": "original_procedural", + "author": "DVIDIA", + "scope": "New primitive geometry; no redistributed scans, videos, photographs or model weights." + }, + "properties": { + "dimensions_m": { + "value": [ + 0.29, + 0.108, + 0.19 + ], + "units": "m; length x, width y, maximum height z", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "mass_kg": { + "value": 0.5, + "units": "kg", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "sliding_friction": { + "value": 0.9, + "units": "dimensionless", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "torsional_friction": { + "value": 0.005, + "units": "m", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "rolling_friction": { + "value": 0.0001, + "units": "m", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "mass_distribution": { + "value": "Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.", + "units": "model assumption", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "deformation": { + "value": "Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.", + "units": "model class", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "contact_solver": { + "value": { + "condim": 4, + "priority": 1, + "solref": [ + 0.02, + 1 + ], + "solimp": [ + 0.9, + 0.95, + 0.001, + 0.5, + 2 + ] + }, + "units": "MuJoCo solver parameters; no calibrated stiffness or damping", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + } + }, + "frame": { + "origin": "sole bottom center", + "axes": "right-handed; +x toward toe, +y lateral, +z up", + "sole_bottom_z_m": 0, + "initial_bottom_z_m": 0.08 + }, + "geometry": [ + { + "name": "sole", + "type": "box", + "size_m": [ + 0.145, + 0.054, + 0.012 + ], + "position_m": [ + 0, + 0, + 0.012 + ], + "mass_fraction": 0.35, + "rgba": [ + 0.16, + 0.17, + 0.18, + 1 + ] + }, + { + "name": "upper", + "type": "ellipsoid", + "size_m": [ + 0.13, + 0.05, + 0.04 + ], + "position_m": [ + 0.01, + -0.004, + 0.064 + ], + "mass_fraction": 0.3, + "rgba": [ + 0.37, + 0.24, + 0.16, + 1 + ] + }, + { + "name": "ankle", + "type": "ellipsoid", + "size_m": [ + 0.047, + 0.049, + 0.055 + ], + "position_m": [ + -0.085, + -0.004, + 0.135 + ], + "mass_fraction": 0.35, + "rgba": [ + 0.37, + 0.24, + 0.16, + 1 + ] + } + ], + "fidelity": { + "geometry": "authored coarse proxy", + "native_contact": "available for numerical testing", + "measured_contact": "untested", + "deformation": "unsupported", + "shoe_grasp_qualified": false, + "physical_robot_ready": false + } + }, + { + "id": "slipper-left", + "name": "Slipper / left", + "version": "0.1.0", + "immutable_id": "dvidia/shoes/slipper-left@0.1.0", + "family": "slipper", + "pair_id": "dvidia/shoes/slipper-pair@0.1.0", + "side": "left", + "license": "MIT", + "source": { + "kind": "original_procedural", + "author": "DVIDIA", + "scope": "New primitive geometry; no redistributed scans, videos, photographs or model weights." + }, + "properties": { + "dimensions_m": { + "value": [ + 0.27, + 0.102, + 0.055 + ], + "units": "m; length x, width y, maximum height z", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "mass_kg": { + "value": 0.15, + "units": "kg", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "sliding_friction": { + "value": 0.65, + "units": "dimensionless", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "torsional_friction": { + "value": 0.005, + "units": "m", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "rolling_friction": { + "value": 0.0001, + "units": "m", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "mass_distribution": { + "value": "Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.", + "units": "model assumption", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "deformation": { + "value": "Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.", + "units": "model class", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "contact_solver": { + "value": { + "condim": 4, + "priority": 1, + "solref": [ + 0.02, + 1 + ], + "solimp": [ + 0.9, + 0.95, + 0.001, + 0.5, + 2 + ] + }, + "units": "MuJoCo solver parameters; no calibrated stiffness or damping", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + } + }, + "frame": { + "origin": "sole bottom center", + "axes": "right-handed; +x toward toe, +y lateral, +z up", + "sole_bottom_z_m": 0, + "initial_bottom_z_m": 0.08 + }, + "geometry": [ + { + "name": "sole", + "type": "box", + "size_m": [ + 0.135, + 0.051, + 0.009 + ], + "position_m": [ + 0, + 0, + 0.009 + ], + "mass_fraction": 0.35, + "rgba": [ + 0.16, + 0.17, + 0.18, + 1 + ] + }, + { + "name": "upper", + "type": "ellipsoid", + "size_m": [ + 0.09, + 0.049, + 0.017 + ], + "position_m": [ + 0.045, + 0.002, + 0.038 + ], + "mass_fraction": 0.65, + "rgba": [ + 0.52, + 0.31, + 0.37, + 1 + ] + } + ], + "fidelity": { + "geometry": "authored coarse proxy", + "native_contact": "available for numerical testing", + "measured_contact": "untested", + "deformation": "unsupported", + "shoe_grasp_qualified": false, + "physical_robot_ready": false + } + }, + { + "id": "slipper-right", + "name": "Slipper / right", + "version": "0.1.0", + "immutable_id": "dvidia/shoes/slipper-right@0.1.0", + "family": "slipper", + "pair_id": "dvidia/shoes/slipper-pair@0.1.0", + "side": "right", + "license": "MIT", + "source": { + "kind": "original_procedural", + "author": "DVIDIA", + "scope": "New primitive geometry; no redistributed scans, videos, photographs or model weights." + }, + "properties": { + "dimensions_m": { + "value": [ + 0.27, + 0.102, + 0.055 + ], + "units": "m; length x, width y, maximum height z", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "mass_kg": { + "value": 0.15, + "units": "kg", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "sliding_friction": { + "value": 0.65, + "units": "dimensionless", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "torsional_friction": { + "value": 0.005, + "units": "m", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "rolling_friction": { + "value": 0.0001, + "units": "m", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "mass_distribution": { + "value": "Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.", + "units": "model assumption", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "deformation": { + "value": "Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.", + "units": "model class", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + }, + "contact_solver": { + "value": { + "condim": 4, + "priority": 1, + "solref": [ + 0.02, + 1 + ], + "solimp": [ + 0.9, + 0.95, + 0.001, + 0.5, + 2 + ] + }, + "units": "MuJoCo solver parameters; no calibrated stiffness or damping", + "evidence": "untested", + "source": "Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value." + } + }, + "frame": { + "origin": "sole bottom center", + "axes": "right-handed; +x toward toe, +y lateral, +z up", + "sole_bottom_z_m": 0, + "initial_bottom_z_m": 0.08 + }, + "geometry": [ + { + "name": "sole", + "type": "box", + "size_m": [ + 0.135, + 0.051, + 0.009 + ], + "position_m": [ + 0, + 0, + 0.009 + ], + "mass_fraction": 0.35, + "rgba": [ + 0.16, + 0.17, + 0.18, + 1 + ] + }, + { + "name": "upper", + "type": "ellipsoid", + "size_m": [ + 0.09, + 0.049, + 0.017 + ], + "position_m": [ + 0.045, + -0.002, + 0.038 + ], + "mass_fraction": 0.65, + "rgba": [ + 0.52, + 0.31, + 0.37, + 1 + ] + } + ], + "fidelity": { + "geometry": "authored coarse proxy", + "native_contact": "available for numerical testing", + "measured_contact": "untested", + "deformation": "unsupported", + "shoe_grasp_qualified": false, + "physical_robot_ready": false + } + } + ], + "environment": { + "id": "open-support-plane", + "version": "0.1.0", + "license": "MIT", + "geometry": "Infinite collision plane at z=0; displayed with 2 m half extents. Not a finite tabletop or rack.", + "name": "asset_table", + "gravity_m_s2": [ + 0, + 0, + -9.81 + ], + "property_evidence": "untested authored environment", + "default_layout": "Three columns x=.40,.76,1.12 m; two rows y=.38,.56 m; sole bottoms begin z=.08 m. Layout separates loading tests from reachability claims." + }, + "limitations": [ + "All shoe physical properties are untested synthetic assumptions.", + "Left/right labels identify mirrored procedural instances, not scanned real shoes.", + "Arm command interfaces differ; installing a scene does not install a learned controller.", + "No deformation, real-world calibration, graspability claim or closed-loop sensor stack." + ], + "catalog_sha256": "592f363389a96fef7f9223737aa72a2f1a74f400238924bf6790ec5bfd3302b7" +} diff --git a/asset-library/v01/index.html b/asset-library/v01/index.html new file mode 100644 index 0000000000000000000000000000000000000000..b23f656e8be8c8c71decf49b28c4bdd7e8b7c315 --- /dev/null +++ b/asset-library/v01/index.html @@ -0,0 +1,16 @@ +DVIDIA · Shoe asset library
DVIDIA / ASSET LIBRARYResearch notePinned source
+

VERSION 0.1 · LOCAL CPU SIMULATION

Load a robot. Add a pair of shoes.

Six original rigid shoe proxies across trainers, ankle boots and slippers, with left/right identities, three supported robot models and reusable scene files. Inspect the native 3D geometry, choose a pair, then download the scene and run it locally.

+

These are synthetic geometry and contact-development assets. Dimensions, mass and friction are declared assumptions. Deformation, shoe grasping and hardware transfer have not been validated. The browser replays recorded settling; native physics runs locally.

+

Run your own scene

git clone https://github.com/Dvidia-Inference/dvidia-training.git
+cd dvidia-training
+git checkout 45bef6315c9632b33915e1ce993babd2926b8f7d
+python3.12 -m venv .venv
+.venv/bin/python -m pip install '.[arm]'
+.venv/bin/dvidia-assets fetch piper --output runs/assets
+.venv/bin/dvidia-assets scene --robot piper --assets runs/assets --pair trainer --output runs/my-shoe-scene
+.venv/bin/python -m http.server 8360 --bind 127.0.0.1 --directory runs/my-shoe-scene
+

Open localhost:8360 after the command finishes. On Windows use .venv\Scripts\ executables. Provisioning needs a network connection; scene simulation uses the pinned local models. A discrete GPU is not required. Minimum memory and hard real-time performance remain unmeasured.

+ +
\ No newline at end of file diff --git a/asset-library/v01/library-integrity.json b/asset-library/v01/library-integrity.json new file mode 100644 index 0000000000000000000000000000000000000000..a465727e9c8eb4796486316014e8deb754b498a4 --- /dev/null +++ b/asset-library/v01/library-integrity.json @@ -0,0 +1,257 @@ +{ + "schema": "dvidia.asset-library-release/v0.1", + "files": { + "LICENSE": { + "bytes": 1076, + "sha256": "ab47d245880a661fdca3c6a4cb91671031302deee50d64f8d2d6df86832962e1" + }, + "README.md": { + "bytes": 5867, + "sha256": "057ff552dc5302a56eac066ba21b0feec3954bf1918d07f617cc2997f49b1e8d" + }, + "benchmark/attempts.json": { + "bytes": 10492425, + "sha256": "78a9ae2aa84bb484b6bddda21773663afa586e48321493fef2542218fc49f8eb" + }, + "benchmark/integrity.json": { + "bytes": 606, + "sha256": "4d58d3bed9409ca5f307e141eae4d49f8c1911814c3a9299fb7d10d33794b822" + }, + "benchmark/protocol.json": { + "bytes": 74622, + "sha256": "d5abad1ebf9eda71d1f47606ba0664b9e4bfe6970c54088bf43d5e818782268d" + }, + "benchmark/report.html": { + "bytes": 4635, + "sha256": "bde9e1b21ca39168ec6ea34ae43e413d18304540f1df2e4936b9309a0de2e0b5" + }, + "benchmark/report.json": { + "bytes": 3709, + "sha256": "83cc1d82bfcb4463dc6e34077b7b496b59216165dad1d91eabdfa2c33978a243" + }, + "catalog.json": { + "bytes": 37205, + "sha256": "8f040833aba0bea140cd4e85ed99f5ad86b1b3ea2dac7bd9a47acdfe25bf19a9" + }, + "index.html": { + "bytes": 4328, + "sha256": "56a8cc13b3a319e4a599011606e876c09b14ce458dc5f47331095a035c95a419" + }, + "previews/piper/LICENSE": { + "bytes": 1076, + "sha256": "ab47d245880a661fdca3c6a4cb91671031302deee50d64f8d2d6df86832962e1" + }, + "previews/piper/README.md": { + "bytes": 897, + "sha256": "195849dd9df960ae7e42a29433c46c810132f52154ccc0ef3df79649d5aa89af" + }, + "previews/piper/asset_library.bundle.js": { + "bytes": 529697, + "sha256": "fe7a98bf9b991a33d030114b9e447bd687230a9dbc381631fd316da408857ee9" + }, + "previews/piper/catalog.json": { + "bytes": 25194, + "sha256": "82e44bf83ca4c64051b5dc99ca0d301cb416dfee6dc043e86582d6fd4fa490ba" + }, + "previews/piper/geometry.bin.gz": { + "bytes": 3574720, + "sha256": "51365a5a661d8062e28c66abc6bdb843ee410811f84b49d62c5878c265b3631f" + }, + "previews/piper/index.html": { + "bytes": 9636, + "sha256": "41a97a426a2b72520e39a469eaa78f4b281c7fef9cf9607301af9c398594251f" + }, + "previews/piper/licenses/agilex_piper/LICENSE": { + "bytes": 1065, + "sha256": "e32d78fd3761052ab0b2bb42fef8a7a9ad3f298d315d305333c349d2aff1f134" + }, + "previews/piper/licenses/agilex_piper/README.md": { + "bytes": 1681, + "sha256": "ab0d218758ec6c298417407962f49179e369236e8f316dbaa7671756d6f8eb77" + }, + "previews/piper/model.json": { + "bytes": 53226, + "sha256": "a125a01e184c1e7bfab9fdfd7e0af9830b9f484633b415e5180048b357e32b90" + }, + "previews/piper/motion.bin.gz": { + "bytes": 5517, + "sha256": "7dac62907bf79874eceb0246e5c5ca25308549363cdad866daa7f0a97f480d18" + }, + "previews/piper/motion.json": { + "bytes": 24477, + "sha256": "a0f265dd67cff10d81709e9fb5a36c7c3ee7ce17bcd3a8e84d4dfff5ba0549d9" + }, + "previews/piper/preview-integrity.json": { + "bytes": 2364, + "sha256": "3b92ff77fea9983f6422b94bda96fa1376ef7379e7fe0743855303763ddf6668" + }, + "previews/piper/reference_replay.third-party.txt": { + "bytes": 1199, + "sha256": "ea4da6cf7a8a54649702f0eb8d057c8ced12f8fed2329c5e96d92a3316922813" + }, + "previews/piper/scene.json": { + "bytes": 290, + "sha256": "e7a0861dd038762ab9e42cf52ee1849d134fb37eaafe1c43dcf04e6131d94d4f" + }, + "previews/piper/scenes/ankle-boot.json": { + "bytes": 228, + "sha256": "3fb24e5e438a7672e3d54dbb2396c1170c72c86e9ac8b659740341de77d5c96c" + }, + "previews/piper/scenes/slipper.json": { + "bytes": 222, + "sha256": "d8ea8e04c7392b822d5b67fd335fd032f9d42e721f6861c4bcaebc920d55bda8" + }, + "previews/piper/scenes/trainer.json": { + "bytes": 222, + "sha256": "5b1c7dda306e489c2de3266e26ccd049803755c6d011f24e1f98457694876a89" + }, + "previews/so101/LICENSE": { + "bytes": 1076, + "sha256": "ab47d245880a661fdca3c6a4cb91671031302deee50d64f8d2d6df86832962e1" + }, + "previews/so101/README.md": { + "bytes": 897, + "sha256": "195849dd9df960ae7e42a29433c46c810132f52154ccc0ef3df79649d5aa89af" + }, + "previews/so101/asset_library.bundle.js": { + "bytes": 529697, + "sha256": "fe7a98bf9b991a33d030114b9e447bd687230a9dbc381631fd316da408857ee9" + }, + "previews/so101/catalog.json": { + "bytes": 25194, + "sha256": "82e44bf83ca4c64051b5dc99ca0d301cb416dfee6dc043e86582d6fd4fa490ba" + }, + "previews/so101/geometry.bin.gz": { + "bytes": 3182925, + "sha256": "494d7ce4ae7df05e51e0e9f7ed5c2dcb0a489817d72f8c83944e1d50e078396e" + }, + "previews/so101/index.html": { + "bytes": 9636, + "sha256": "41a97a426a2b72520e39a469eaa78f4b281c7fef9cf9607301af9c398594251f" + }, + "previews/so101/licenses/robotstudio_so101/LICENSE": { + "bytes": 11357, + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + "previews/so101/licenses/robotstudio_so101/README.md": { + "bytes": 1142, + "sha256": "e2344e7c14290bed85c7907247aecb8bf6cb4392e3de0d7c45680efe9bb9b5a9" + }, + "previews/so101/model.json": { + "bytes": 24776, + "sha256": "4cea6af308e91674c20c6cdf485f91b21bb71510b5d5b616abf622b24a6c2e30" + }, + "previews/so101/motion.bin.gz": { + "bytes": 6523, + "sha256": "9b1ab54e527faad6324a0ef3f8be958d61aa62041d85c8171a7a5d3356f37f29" + }, + "previews/so101/motion.json": { + "bytes": 20481, + "sha256": "5da18345066879ab48336df4735d863c497be2780b239c25b566003fab752407" + }, + "previews/so101/preview-integrity.json": { + "bytes": 2375, + "sha256": "fc1ec111e1b44b8102e9a2967f7c659ea33d0654d94b0742608159a8a3edc235" + }, + "previews/so101/reference_replay.third-party.txt": { + "bytes": 1199, + "sha256": "ea4da6cf7a8a54649702f0eb8d057c8ced12f8fed2329c5e96d92a3316922813" + }, + "previews/so101/scene.json": { + "bytes": 290, + "sha256": "24962e06594959eb2a432219425bd17b3fa74e428440c8e83c6edc5e984ae716" + }, + "previews/so101/scenes/ankle-boot.json": { + "bytes": 228, + "sha256": "f4a1f20229b52a54beb7eaf2e1e2f5b767ea9a5aea4945c15b637a67746dceca" + }, + "previews/so101/scenes/slipper.json": { + "bytes": 222, + "sha256": "1d78d4aac6129177b7053b102cd851dddc177483f15596554ef38e9d69e4d2a2" + }, + "previews/so101/scenes/trainer.json": { + "bytes": 222, + "sha256": "17ff0e251d0b53f0d9bb1cf3aa66ed59eea0a38f0f84956193d8837c3ad68e65" + }, + "previews/ur5e/LICENSE": { + "bytes": 1076, + "sha256": "ab47d245880a661fdca3c6a4cb91671031302deee50d64f8d2d6df86832962e1" + }, + "previews/ur5e/README.md": { + "bytes": 897, + "sha256": "195849dd9df960ae7e42a29433c46c810132f52154ccc0ef3df79649d5aa89af" + }, + "previews/ur5e/asset_library.bundle.js": { + "bytes": 529697, + "sha256": "fe7a98bf9b991a33d030114b9e447bd687230a9dbc381631fd316da408857ee9" + }, + "previews/ur5e/catalog.json": { + "bytes": 25194, + "sha256": "82e44bf83ca4c64051b5dc99ca0d301cb416dfee6dc043e86582d6fd4fa490ba" + }, + "previews/ur5e/geometry.bin.gz": { + "bytes": 1831265, + "sha256": "cc162219dac340db4c663b34b3e54b0e5574679a7f737fa90853129d8a68978f" + }, + "previews/ur5e/index.html": { + "bytes": 9636, + "sha256": "41a97a426a2b72520e39a469eaa78f4b281c7fef9cf9607301af9c398594251f" + }, + "previews/ur5e/licenses/robotiq_2f85/LICENSE": { + "bytes": 1297, + "sha256": "3d5edd18d1e22a17666e9bb84270171ed5ac90b192d24e0177fd171708ea2316" + }, + "previews/ur5e/licenses/robotiq_2f85/README.md": { + "bytes": 1367, + "sha256": "a10f34027d417f8f7b9102b74b42976031f0246f3090444728ab322bc4632aaf" + }, + "previews/ur5e/licenses/universal_robots_ur5e/LICENSE": { + "bytes": 1470, + "sha256": "5ec71ccf66c8d03261448f2441a586765b97f2248c860a1ae19689fb1c45cee6" + }, + "previews/ur5e/licenses/universal_robots_ur5e/README.md": { + "bytes": 1689, + "sha256": "435600d4f00cfdbd7edec4b60f0cd7fbb539f39abaefcd8bb3994beed3b1156a" + }, + "previews/ur5e/model.json": { + "bytes": 32333, + "sha256": "6a5343662febdb5a384451cc3beaac4b14f6c380c7f7bf8d7d4dd0a27e4456ef" + }, + "previews/ur5e/motion.bin.gz": { + "bytes": 35893, + "sha256": "057273906b6c4feb3872570b7d4ba845d453bc67cb08a70b012a7375ead9ab75" + }, + "previews/ur5e/motion.json": { + "bytes": 36560, + "sha256": "af3fede2c17b482325e0c4211bac4cead2fee6221b05cc4bbf0599011cd3aad6" + }, + "previews/ur5e/preview-integrity.json": { + "bytes": 2685, + "sha256": "9d4f72a84abda97a3748fdde396a71a07ffb5d30560454e29321bb61257fdfd9" + }, + "previews/ur5e/reference_replay.third-party.txt": { + "bytes": 1199, + "sha256": "ea4da6cf7a8a54649702f0eb8d057c8ced12f8fed2329c5e96d92a3316922813" + }, + "previews/ur5e/scene.json": { + "bytes": 289, + "sha256": "5d94197873f27b62431cf1b512c9622d72882c6bc22b4b11a190bdaf3fb04b13" + }, + "previews/ur5e/scenes/ankle-boot.json": { + "bytes": 227, + "sha256": "750f72fed16daac3c65263d90d633675b8a7832ddd1f163b2c4a7982037faaf1" + }, + "previews/ur5e/scenes/slipper.json": { + "bytes": 221, + "sha256": "21fff791ad71ebf89cb298af41b91c7b4520618c2aa978550f6765d90cc1b079" + }, + "previews/ur5e/scenes/trainer.json": { + "bytes": 221, + "sha256": "03e3e4ae0042df9387485642381fd090e80b446fda818136a2f3be78ceb2c9b4" + }, + "provenance.json": { + "bytes": 462, + "sha256": "95b0c5c6302527658938dcc66f470ca1ac44c534b3cb2d7b1f94a96ab886594c" + } + } +} diff --git a/asset-library/v01/previews/piper/LICENSE b/asset-library/v01/previews/piper/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a7056f2889009b6b736691291d2e65e63bab2fdc --- /dev/null +++ b/asset-library/v01/previews/piper/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 DVIDIA contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/asset-library/v01/previews/piper/README.md b/asset-library/v01/previews/piper/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7fd10d088e8f3f8d2bd46a8d7a54966e2aad5550 --- /dev/null +++ b/asset-library/v01/previews/piper/README.md @@ -0,0 +1,5 @@ +# DVIDIA asset library preview + +Recorded native MuJoCo scene settling with held arm commands. The browser displays saved poses and does not run physics. Shoes are authored rigid proxies with untested physical properties. No learned shoe skill, calibrated deformation, hardware or real-time qualification. + +Serve this directory with `python -m http.server 8000` and open http://localhost:8000. Everything is local; JavaScript, WebGL2 and DecompressionStream are required. The pair selector filters recorded objects visually; use a downloaded scene descriptor with dvidia-assets scene --config to compile and simulate only that pair. geometry.bin.gz and motion.bin.gz decode to bounded little-endian Float32 positions and wxyz quaternions. MIT applies to DVIDIA code and synthetic shoes. Robot model licenses and original READMEs remain under licenses/. Three.js/OrbitControls notices are included. diff --git a/asset-library/v01/previews/piper/asset_library.bundle.js b/asset-library/v01/previews/piper/asset_library.bundle.js new file mode 100644 index 0000000000000000000000000000000000000000..ae7d8edbc18ded9f1785e00e287bee9f3f73081c --- /dev/null +++ b/asset-library/v01/previews/piper/asset_library.bundle.js @@ -0,0 +1,3834 @@ +/* DVIDIA asset library. MIT; bundled Three.js r180, MIT. See reference_replay.third-party.txt. */ +(()=>{var Hn={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Gn={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Bl=0,uo=1,zl=2;var fo=1,kl=2,un=3,Sn=0,De=1,Ve=2,Tn=0,ni=1,po=2,mo=3,go=4,Vl=5,On=100,Hl=101,Gl=102,Wl=103,Xl=104,ql=200,Yl=201,Zl=202,Jl=203,sr=204,rr=205,$l=206,Kl=207,jl=208,Ql=209,tc=210,ec=211,nc=212,ic=213,sc=214,Ir=0,Pr=1,Dr=2,ii=3,Lr=4,Ur=5,Nr=6,Fr=7,_o=0,rc=1,ac=2,wn=0,oc=1,lc=2,cc=3,Or=4,hc=5,uc=6,dc=7;var xo=300,li=301,ci=302,Br=303,zr=304,Rs=306,ar=1e3,Fn=1001,or=1002,Ye=1003,fc=1004;var Cs=1005;var tn=1006,kr=1007;var Wn=1008;var sn=1009,yo=1010,vo=1011,ki=1012,Vr=1013,Xn=1014,dn=1015,Vi=1016,Hr=1017,Gr=1018,Hi=1020,Mo=35902,So=35899,bo=1021,Eo=1022,Je=1023,Pi=1026,Gi=1027,To=1028,Wr=1029,wo=1030,Xr=1031;var qr=1033,Is=33776,Ps=33777,Ds=33778,Ls=33779,Yr=35840,Zr=35841,Jr=35842,$r=35843,Kr=36196,jr=37492,Qr=37496,ta=37808,ea=37809,na=37810,ia=37811,sa=37812,ra=37813,aa=37814,oa=37815,la=37816,ca=37817,ha=37818,ua=37819,da=37820,fa=37821,pa=36492,ma=36494,ga=36495,_a=36283,xa=36284,ya=36285,va=36286;var rs=2300,lr=2301,ir=2302,io=2400,so=2401,ro=2402;var pc=3200,mc=3201;var Ao=0,gc=1,An="",Ce="srgb",bn="srgb-linear",as="linear",Yt="srgb";var ei=7680;var ao=519,_c=512,xc=513,yc=514,Ro=515,vc=516,Mc=517,Sc=518,bc=519,oo=35044;var Co="300 es",Qe=2e3,os=2001;var ln=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){let n=this._listeners;return n===void 0?!1:n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){let n=this._listeners;if(n===void 0)return;let s=n[t];if(s!==void 0){let r=s.indexOf(e);r!==-1&&s.splice(r,1)}}dispatchEvent(t){let e=this._listeners;if(e===void 0)return;let n=e[t.type];if(n!==void 0){t.target=this;let s=n.slice(0);for(let r=0,a=s.length;r>8&255]+Se[i>>16&255]+Se[i>>24&255]+"-"+Se[t&255]+Se[t>>8&255]+"-"+Se[t>>16&15|64]+Se[t>>24&255]+"-"+Se[e&63|128]+Se[e>>8&255]+"-"+Se[e>>16&255]+Se[e>>24&255]+Se[n&255]+Se[n>>8&255]+Se[n>>16&255]+Se[n>>24&255]).toLowerCase()}function zt(i,t,e){return Math.max(t,Math.min(e,i))}function Io(i,t){return(i%t+t)%t}function yh(i,t,e,n,s){return n+(i-t)*(s-n)/(e-t)}function vh(i,t,e){return i!==t?(e-i)/(t-i):0}function ss(i,t,e){return(1-e)*i+e*t}function Mh(i,t,e,n){return ss(i,t,1-Math.exp(-e*n))}function Sh(i,t=1){return t-Math.abs(Io(i,t*2)-t)}function bh(i,t,e){return i<=t?0:i>=e?1:(i=(i-t)/(e-t),i*i*(3-2*i))}function Eh(i,t,e){return i<=t?0:i>=e?1:(i=(i-t)/(e-t),i*i*i*(i*(i*6-15)+10))}function Th(i,t){return i+Math.floor(Math.random()*(t-i+1))}function wh(i,t){return i+Math.random()*(t-i)}function Ah(i){return i*(.5-Math.random())}function Rh(i){i!==void 0&&(pl=i);let t=pl+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Ch(i){return i*is}function Ih(i){return i*Di}function Ph(i){return(i&i-1)===0&&i!==0}function Dh(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function Lh(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function Uh(i,t,e,n,s){let r=Math.cos,a=Math.sin,o=r(e/2),c=a(e/2),l=r((t+n)/2),h=a((t+n)/2),d=r((t-n)/2),f=a((t-n)/2),p=r((n-t)/2),_=a((n-t)/2);switch(s){case"XYX":i.set(o*h,c*d,c*f,o*l);break;case"YZY":i.set(c*f,o*h,c*d,o*l);break;case"ZXZ":i.set(c*d,c*f,o*h,o*l);break;case"XZX":i.set(o*h,c*_,c*p,o*l);break;case"YXY":i.set(c*p,o*h,c*_,o*l);break;case"ZYZ":i.set(c*_,c*p,o*h,o*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function Ci(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function Re(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}var Po={DEG2RAD:is,RAD2DEG:Di,generateUUID:Wi,clamp:zt,euclideanModulo:Io,mapLinear:yh,inverseLerp:vh,lerp:ss,damp:Mh,pingpong:Sh,smoothstep:bh,smootherstep:Eh,randInt:Th,randFloat:wh,randFloatSpread:Ah,seededRandom:Rh,degToRad:Ch,radToDeg:Ih,isPowerOfTwo:Ph,ceilPowerOfTwo:Dh,floorPowerOfTwo:Lh,setQuaternionFromProperEuler:Uh,normalize:Re,denormalize:Ci},Pt=class i{constructor(t=0,e=0){i.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,n=this.y,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6],this.y=s[1]*e+s[4]*n+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=zt(this.x,t.x,e.x),this.y=zt(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=zt(this.x,t,e),this.y=zt(this.y,t,e),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(zt(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(zt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let n=Math.cos(e),s=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*n-a*s+t.x,this.y=r*s+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Ze=class{constructor(t=0,e=0,n=0,s=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=s}static slerpFlat(t,e,n,s,r,a,o){let c=n[s+0],l=n[s+1],h=n[s+2],d=n[s+3],f=r[a+0],p=r[a+1],_=r[a+2],y=r[a+3];if(o===0){t[e+0]=c,t[e+1]=l,t[e+2]=h,t[e+3]=d;return}if(o===1){t[e+0]=f,t[e+1]=p,t[e+2]=_,t[e+3]=y;return}if(d!==y||c!==f||l!==p||h!==_){let m=1-o,u=c*f+l*p+h*_+d*y,T=u>=0?1:-1,E=1-u*u;if(E>Number.EPSILON){let R=Math.sqrt(E),A=Math.atan2(R,u*T);m=Math.sin(m*A)/R,o=Math.sin(o*A)/R}let S=o*T;if(c=c*m+f*S,l=l*m+p*S,h=h*m+_*S,d=d*m+y*S,m===1-o){let R=1/Math.sqrt(c*c+l*l+h*h+d*d);c*=R,l*=R,h*=R,d*=R}}t[e]=c,t[e+1]=l,t[e+2]=h,t[e+3]=d}static multiplyQuaternionsFlat(t,e,n,s,r,a){let o=n[s],c=n[s+1],l=n[s+2],h=n[s+3],d=r[a],f=r[a+1],p=r[a+2],_=r[a+3];return t[e]=o*_+h*d+c*p-l*f,t[e+1]=c*_+h*f+l*d-o*p,t[e+2]=l*_+h*p+o*f-c*d,t[e+3]=h*_-o*d-c*f-l*p,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,s){return this._x=t,this._y=e,this._z=n,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let n=t._x,s=t._y,r=t._z,a=t._order,o=Math.cos,c=Math.sin,l=o(n/2),h=o(s/2),d=o(r/2),f=c(n/2),p=c(s/2),_=c(r/2);switch(a){case"XYZ":this._x=f*h*d+l*p*_,this._y=l*p*d-f*h*_,this._z=l*h*_+f*p*d,this._w=l*h*d-f*p*_;break;case"YXZ":this._x=f*h*d+l*p*_,this._y=l*p*d-f*h*_,this._z=l*h*_-f*p*d,this._w=l*h*d+f*p*_;break;case"ZXY":this._x=f*h*d-l*p*_,this._y=l*p*d+f*h*_,this._z=l*h*_+f*p*d,this._w=l*h*d-f*p*_;break;case"ZYX":this._x=f*h*d-l*p*_,this._y=l*p*d+f*h*_,this._z=l*h*_-f*p*d,this._w=l*h*d+f*p*_;break;case"YZX":this._x=f*h*d+l*p*_,this._y=l*p*d+f*h*_,this._z=l*h*_-f*p*d,this._w=l*h*d-f*p*_;break;case"XZY":this._x=f*h*d-l*p*_,this._y=l*p*d-f*h*_,this._z=l*h*_+f*p*d,this._w=l*h*d+f*p*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let n=e/2,s=Math.sin(n);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,n=e[0],s=e[4],r=e[8],a=e[1],o=e[5],c=e[9],l=e[2],h=e[6],d=e[10],f=n+o+d;if(f>0){let p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(h-c)*p,this._y=(r-l)*p,this._z=(a-s)*p}else if(n>o&&n>d){let p=2*Math.sqrt(1+n-o-d);this._w=(h-c)/p,this._x=.25*p,this._y=(s+a)/p,this._z=(r+l)/p}else if(o>d){let p=2*Math.sqrt(1+o-n-d);this._w=(r-l)/p,this._x=(s+a)/p,this._y=.25*p,this._z=(c+h)/p}else{let p=2*Math.sqrt(1+d-n-o);this._w=(a-s)/p,this._x=(r+l)/p,this._y=(c+h)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<1e-8?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(zt(this.dot(t),-1,1)))}rotateTowards(t,e){let n=this.angleTo(t);if(n===0)return this;let s=Math.min(1,e/n);return this.slerp(t,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let n=t._x,s=t._y,r=t._z,a=t._w,o=e._x,c=e._y,l=e._z,h=e._w;return this._x=n*h+a*o+s*l-r*c,this._y=s*h+a*c+r*o-n*l,this._z=r*h+a*l+n*c-s*o,this._w=a*h-n*o-s*c-r*l,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);let n=this._x,s=this._y,r=this._z,a=this._w,o=a*t._w+n*t._x+s*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=n,this._y=s,this._z=r,this;let c=1-o*o;if(c<=Number.EPSILON){let p=1-e;return this._w=p*a+e*this._w,this._x=p*n+e*this._x,this._y=p*s+e*this._y,this._z=p*r+e*this._z,this.normalize(),this}let l=Math.sqrt(c),h=Math.atan2(l,o),d=Math.sin((1-e)*h)/l,f=Math.sin(e*h)/l;return this._w=a*d+this._w*f,this._x=n*d+this._x*f,this._y=s*d+this._y*f,this._z=r*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),s=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(s*Math.sin(t),s*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},L=class i{constructor(t=0,e=0,n=0){i.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(ml.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(ml.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,n=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*s,this.y=r[1]*e+r[4]*n+r[7]*s,this.z=r[2]*e+r[5]*n+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,n=this.y,s=this.z,r=t.elements,a=1/(r[3]*e+r[7]*n+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*s+r[12])*a,this.y=(r[1]*e+r[5]*n+r[9]*s+r[13])*a,this.z=(r[2]*e+r[6]*n+r[10]*s+r[14])*a,this}applyQuaternion(t){let e=this.x,n=this.y,s=this.z,r=t.x,a=t.y,o=t.z,c=t.w,l=2*(a*s-o*n),h=2*(o*e-r*s),d=2*(r*n-a*e);return this.x=e+c*l+a*d-o*h,this.y=n+c*h+o*l-r*d,this.z=s+c*d+r*h-a*l,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,n=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*s,this.y=r[1]*e+r[5]*n+r[9]*s,this.z=r[2]*e+r[6]*n+r[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=zt(this.x,t.x,e.x),this.y=zt(this.y,t.y,e.y),this.z=zt(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=zt(this.x,t,e),this.y=zt(this.y,t,e),this.z=zt(this.z,t,e),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(zt(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let n=t.x,s=t.y,r=t.z,a=e.x,o=e.y,c=e.z;return this.x=s*c-r*o,this.y=r*a-n*c,this.z=n*o-s*a,this}projectOnVector(t){let e=t.lengthSq();if(e===0)return this.set(0,0,0);let n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return Ua.copy(this).projectOnVector(t),this.sub(Ua)}reflect(t){return this.sub(Ua.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(zt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y,s=this.z-t.z;return e*e+n*n+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){let s=Math.sin(e)*t;return this.x=s*Math.sin(n),this.y=Math.cos(e)*t,this.z=s*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},Ua=new L,ml=new Ze,Ut=class i{constructor(t,e,n,s,r,a,o,c,l){i.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,s,r,a,o,c,l)}set(t,e,n,s,r,a,o,c,l){let h=this.elements;return h[0]=t,h[1]=s,h[2]=o,h[3]=e,h[4]=r,h[5]=c,h[6]=n,h[7]=a,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,s=e.elements,r=this.elements,a=n[0],o=n[3],c=n[6],l=n[1],h=n[4],d=n[7],f=n[2],p=n[5],_=n[8],y=s[0],m=s[3],u=s[6],T=s[1],E=s[4],S=s[7],R=s[2],A=s[5],P=s[8];return r[0]=a*y+o*T+c*R,r[3]=a*m+o*E+c*A,r[6]=a*u+o*S+c*P,r[1]=l*y+h*T+d*R,r[4]=l*m+h*E+d*A,r[7]=l*u+h*S+d*P,r[2]=f*y+p*T+_*R,r[5]=f*m+p*E+_*A,r[8]=f*u+p*S+_*P,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],c=t[6],l=t[7],h=t[8];return e*a*h-e*o*l-n*r*h+n*o*c+s*r*l-s*a*c}invert(){let t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],c=t[6],l=t[7],h=t[8],d=h*a-o*l,f=o*c-h*r,p=l*r-a*c,_=e*d+n*f+s*p;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);let y=1/_;return t[0]=d*y,t[1]=(s*l-h*n)*y,t[2]=(o*n-s*a)*y,t[3]=f*y,t[4]=(h*e-s*c)*y,t[5]=(s*r-o*e)*y,t[6]=p*y,t[7]=(n*c-l*e)*y,t[8]=(a*e-n*r)*y,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,s,r,a,o){let c=Math.cos(r),l=Math.sin(r);return this.set(n*c,n*l,-n*(c*a+l*o)+a+t,-s*l,s*c,-s*(-l*a+c*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(Na.makeScale(t,e)),this}rotate(t){return this.premultiply(Na.makeRotation(-t)),this}translate(t,e){return this.premultiply(Na.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,n=t.elements;for(let s=0;s<9;s++)if(e[s]!==n[s])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}},Na=new Ut;function Do(i){for(let t=i.length-1;t>=0;--t)if(i[t]>=65535)return!0;return!1}function ls(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function Ec(){let i=ls("canvas");return i.style.display="block",i}var gl={};function Li(i){i in gl||(gl[i]=!0,console.warn(i))}function Tc(i,t,e){return new Promise(function(n,s){function r(){switch(i.clientWaitSync(t,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:s();break;case i.TIMEOUT_EXPIRED:setTimeout(r,e);break;default:n()}}setTimeout(r,e)})}var _l=new Ut().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),xl=new Ut().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Nh(){let i={enabled:!0,workingColorSpace:bn,spaces:{},convert:function(s,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===Yt&&(s.r=Mn(s.r),s.g=Mn(s.g),s.b=Mn(s.b)),this.spaces[r].primaries!==this.spaces[a].primaries&&(s.applyMatrix3(this.spaces[r].toXYZ),s.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Yt&&(s.r=Ii(s.r),s.g=Ii(s.g),s.b=Ii(s.b))),s},workingToColorSpace:function(s,r){return this.convert(s,this.workingColorSpace,r)},colorSpaceToWorking:function(s,r){return this.convert(s,r,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===An?as:this.spaces[s].transfer},getToneMappingMode:function(s){return this.spaces[s].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(s,r=this.workingColorSpace){return s.fromArray(this.spaces[r].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,r,a){return s.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(s,r){return Li("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),i.workingToColorSpace(s,r)},toWorkingColorSpace:function(s,r){return Li("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),i.colorSpaceToWorking(s,r)}},t=[.64,.33,.3,.6,.15,.06],e=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[bn]:{primaries:t,whitePoint:n,transfer:as,toXYZ:_l,fromXYZ:xl,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:Ce},outputColorSpaceConfig:{drawingBufferColorSpace:Ce}},[Ce]:{primaries:t,whitePoint:n,transfer:Yt,toXYZ:_l,fromXYZ:xl,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:Ce}}}),i}var Gt=Nh();function Mn(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function Ii(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}var _i,cr=class{static getDataURL(t,e="image/png"){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let n;if(t instanceof HTMLCanvasElement)n=t;else{_i===void 0&&(_i=ls("canvas")),_i.width=t.width,_i.height=t.height;let s=_i.getContext("2d");t instanceof ImageData?s.putImageData(t,0,0):s.drawImage(t,0,0,t.width,t.height),n=_i}return n.toDataURL(e)}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let e=ls("canvas");e.width=t.width,e.height=t.height;let n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);let s=n.getImageData(0,0,t.width,t.height),r=s.data;for(let a=0;a1),this.pmremVersion=0}get width(){return this.source.getSize(Oa).x}get height(){return this.source.getSize(Oa).y}get depth(){return this.source.getSize(Oa).z}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(let e in t){let n=t[e];if(n===void 0){console.warn(`THREE.Texture.setValues(): parameter '${e}' has value of undefined.`);continue}let s=this[e];if(s===void 0){console.warn(`THREE.Texture.setValues(): property '${e}' does not exist.`);continue}s&&n&&s.isVector2&&n.isVector2||s&&n&&s.isVector3&&n.isVector3||s&&n&&s.isMatrix3&&n.isMatrix3?s.copy(n):this[e]=n}}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==xo)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case ar:t.x=t.x-Math.floor(t.x);break;case Fn:t.x=t.x<0?0:1;break;case or:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case ar:t.y=t.y-Math.floor(t.y);break;case Fn:t.y=t.y<0?0:1;break;case or:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}};ze.DEFAULT_IMAGE=null;ze.DEFAULT_MAPPING=xo;ze.DEFAULT_ANISOTROPY=1;var le=class i{constructor(t=0,e=0,n=0,s=1){i.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=s}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,s){return this.x=t,this.y=e,this.z=n,this.w=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,n=this.y,s=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*s+a[12]*r,this.y=a[1]*e+a[5]*n+a[9]*s+a[13]*r,this.z=a[2]*e+a[6]*n+a[10]*s+a[14]*r,this.w=a[3]*e+a[7]*n+a[11]*s+a[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,s,r,c=t.elements,l=c[0],h=c[4],d=c[8],f=c[1],p=c[5],_=c[9],y=c[2],m=c[6],u=c[10];if(Math.abs(h-f)<.01&&Math.abs(d-y)<.01&&Math.abs(_-m)<.01){if(Math.abs(h+f)<.1&&Math.abs(d+y)<.1&&Math.abs(_+m)<.1&&Math.abs(l+p+u-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let E=(l+1)/2,S=(p+1)/2,R=(u+1)/2,A=(h+f)/4,P=(d+y)/4,N=(_+m)/4;return E>S&&E>R?E<.01?(n=0,s=.707106781,r=.707106781):(n=Math.sqrt(E),s=A/n,r=P/n):S>R?S<.01?(n=.707106781,s=0,r=.707106781):(s=Math.sqrt(S),n=A/s,r=N/s):R<.01?(n=.707106781,s=.707106781,r=0):(r=Math.sqrt(R),n=P/r,s=N/r),this.set(n,s,r,e),this}let T=Math.sqrt((m-_)*(m-_)+(d-y)*(d-y)+(f-h)*(f-h));return Math.abs(T)<.001&&(T=1),this.x=(m-_)/T,this.y=(d-y)/T,this.z=(f-h)/T,this.w=Math.acos((l+p+u-1)/2),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=zt(this.x,t.x,e.x),this.y=zt(this.y,t.y,e.y),this.z=zt(this.z,t.z,e.z),this.w=zt(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=zt(this.x,t,e),this.y=zt(this.y,t,e),this.z=zt(this.z,t,e),this.w=zt(this.w,t,e),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(zt(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},hr=class extends ln{constructor(t=1,e=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:tn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=n.depth,this.scissor=new le(0,0,t,e),this.scissorTest=!1,this.viewport=new le(0,0,t,e);let s={width:t,height:e,depth:n.depth},r=new ze(s);this.textures=[];let a=n.count;for(let o=0;o1;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,n=t.textures.length;e=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,$e),$e.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(ji),Bs.subVectors(this.max,ji),xi.subVectors(t.a,ji),yi.subVectors(t.b,ji),vi.subVectors(t.c,ji),Cn.subVectors(yi,xi),In.subVectors(vi,yi),Kn.subVectors(xi,vi);let e=[0,-Cn.z,Cn.y,0,-In.z,In.y,0,-Kn.z,Kn.y,Cn.z,0,-Cn.x,In.z,0,-In.x,Kn.z,0,-Kn.x,-Cn.y,Cn.x,0,-In.y,In.x,0,-Kn.y,Kn.x,0];return!Ba(e,xi,yi,vi,Bs)||(e=[1,0,0,0,1,0,0,0,1],!Ba(e,xi,yi,vi,Bs))?!1:(zs.crossVectors(Cn,In),e=[zs.x,zs.y,zs.z],Ba(e,xi,yi,vi,Bs))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,$e).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize($e).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(mn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),mn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),mn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),mn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),mn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),mn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),mn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),mn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(mn),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}},mn=[new L,new L,new L,new L,new L,new L,new L,new L],$e=new L,Os=new hn,xi=new L,yi=new L,vi=new L,Cn=new L,In=new L,Kn=new L,ji=new L,Bs=new L,zs=new L,jn=new L;function Ba(i,t,e,n,s){for(let r=0,a=i.length-3;r<=a;r+=3){jn.fromArray(i,r);let o=s.x*Math.abs(jn.x)+s.y*Math.abs(jn.y)+s.z*Math.abs(jn.z),c=t.dot(jn),l=e.dot(jn),h=n.dot(jn);if(Math.max(-Math.max(c,l,h),Math.min(c,l,h))>o)return!1}return!0}var Bh=new hn,Qi=new L,za=new L,si=class{constructor(t=new L,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let n=this.center;e!==void 0?n.copy(e):Bh.setFromPoints(t).getCenter(n);let s=0;for(let r=0,a=t.length;rthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Qi.subVectors(t,this.center);let e=Qi.lengthSq();if(e>this.radius*this.radius){let n=Math.sqrt(e),s=(n-this.radius)*.5;this.center.addScaledVector(Qi,s/n),this.radius+=s}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(za.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Qi.copy(t.center).add(za)),this.expandByPoint(Qi.copy(t.center).sub(za))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}},gn=new L,ka=new L,ks=new L,Pn=new L,Va=new L,Vs=new L,Ha=new L,ri=class{constructor(t=new L,e=new L(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,gn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=gn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(gn.copy(this.origin).addScaledVector(this.direction,e),gn.distanceToSquared(t))}distanceSqToSegment(t,e,n,s){ka.copy(t).add(e).multiplyScalar(.5),ks.copy(e).sub(t).normalize(),Pn.copy(this.origin).sub(ka);let r=t.distanceTo(e)*.5,a=-this.direction.dot(ks),o=Pn.dot(this.direction),c=-Pn.dot(ks),l=Pn.lengthSq(),h=Math.abs(1-a*a),d,f,p,_;if(h>0)if(d=a*c-o,f=a*o-c,_=r*h,d>=0)if(f>=-_)if(f<=_){let y=1/h;d*=y,f*=y,p=d*(d+a*f+2*o)+f*(a*d+f+2*c)+l}else f=r,d=Math.max(0,-(a*f+o)),p=-d*d+f*(f+2*c)+l;else f=-r,d=Math.max(0,-(a*f+o)),p=-d*d+f*(f+2*c)+l;else f<=-_?(d=Math.max(0,-(-a*r+o)),f=d>0?-r:Math.min(Math.max(-r,-c),r),p=-d*d+f*(f+2*c)+l):f<=_?(d=0,f=Math.min(Math.max(-r,-c),r),p=f*(f+2*c)+l):(d=Math.max(0,-(a*r+o)),f=d>0?r:Math.min(Math.max(-r,-c),r),p=-d*d+f*(f+2*c)+l);else f=a>0?-r:r,d=Math.max(0,-(a*f+o)),p=-d*d+f*(f+2*c)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,d),s&&s.copy(ka).addScaledVector(ks,f),p}intersectSphere(t,e){gn.subVectors(t.center,this.origin);let n=gn.dot(this.direction),s=gn.dot(gn)-n*n,r=t.radius*t.radius;if(s>r)return null;let a=Math.sqrt(r-s),o=n-a,c=n+a;return c<0?null:o<0?this.at(c,e):this.at(o,e)}intersectsSphere(t){return t.radius<0?!1:this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){let n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,s,r,a,o,c,l=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,f=this.origin;return l>=0?(n=(t.min.x-f.x)*l,s=(t.max.x-f.x)*l):(n=(t.max.x-f.x)*l,s=(t.min.x-f.x)*l),h>=0?(r=(t.min.y-f.y)*h,a=(t.max.y-f.y)*h):(r=(t.max.y-f.y)*h,a=(t.min.y-f.y)*h),n>a||r>s||((r>n||isNaN(n))&&(n=r),(a=0?(o=(t.min.z-f.z)*d,c=(t.max.z-f.z)*d):(o=(t.max.z-f.z)*d,c=(t.min.z-f.z)*d),n>c||o>s)||((o>n||n!==n)&&(n=o),(c=0?n:s,e)}intersectsBox(t){return this.intersectBox(t,gn)!==null}intersectTriangle(t,e,n,s,r){Va.subVectors(e,t),Vs.subVectors(n,t),Ha.crossVectors(Va,Vs);let a=this.direction.dot(Ha),o;if(a>0){if(s)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Pn.subVectors(this.origin,t);let c=o*this.direction.dot(Vs.crossVectors(Pn,Vs));if(c<0)return null;let l=o*this.direction.dot(Va.cross(Pn));if(l<0||c+l>a)return null;let h=-o*Pn.dot(Ha);return h<0?null:this.at(h/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},he=class i{constructor(t,e,n,s,r,a,o,c,l,h,d,f,p,_,y,m){i.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,s,r,a,o,c,l,h,d,f,p,_,y,m)}set(t,e,n,s,r,a,o,c,l,h,d,f,p,_,y,m){let u=this.elements;return u[0]=t,u[4]=e,u[8]=n,u[12]=s,u[1]=r,u[5]=a,u[9]=o,u[13]=c,u[2]=l,u[6]=h,u[10]=d,u[14]=f,u[3]=p,u[7]=_,u[11]=y,u[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new i().fromArray(this.elements)}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){let e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){let e=this.elements,n=t.elements,s=1/Mi.setFromMatrixColumn(t,0).length(),r=1/Mi.setFromMatrixColumn(t,1).length(),a=1/Mi.setFromMatrixColumn(t,2).length();return e[0]=n[0]*s,e[1]=n[1]*s,e[2]=n[2]*s,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,n=t.x,s=t.y,r=t.z,a=Math.cos(n),o=Math.sin(n),c=Math.cos(s),l=Math.sin(s),h=Math.cos(r),d=Math.sin(r);if(t.order==="XYZ"){let f=a*h,p=a*d,_=o*h,y=o*d;e[0]=c*h,e[4]=-c*d,e[8]=l,e[1]=p+_*l,e[5]=f-y*l,e[9]=-o*c,e[2]=y-f*l,e[6]=_+p*l,e[10]=a*c}else if(t.order==="YXZ"){let f=c*h,p=c*d,_=l*h,y=l*d;e[0]=f+y*o,e[4]=_*o-p,e[8]=a*l,e[1]=a*d,e[5]=a*h,e[9]=-o,e[2]=p*o-_,e[6]=y+f*o,e[10]=a*c}else if(t.order==="ZXY"){let f=c*h,p=c*d,_=l*h,y=l*d;e[0]=f-y*o,e[4]=-a*d,e[8]=_+p*o,e[1]=p+_*o,e[5]=a*h,e[9]=y-f*o,e[2]=-a*l,e[6]=o,e[10]=a*c}else if(t.order==="ZYX"){let f=a*h,p=a*d,_=o*h,y=o*d;e[0]=c*h,e[4]=_*l-p,e[8]=f*l+y,e[1]=c*d,e[5]=y*l+f,e[9]=p*l-_,e[2]=-l,e[6]=o*c,e[10]=a*c}else if(t.order==="YZX"){let f=a*c,p=a*l,_=o*c,y=o*l;e[0]=c*h,e[4]=y-f*d,e[8]=_*d+p,e[1]=d,e[5]=a*h,e[9]=-o*h,e[2]=-l*h,e[6]=p*d+_,e[10]=f-y*d}else if(t.order==="XZY"){let f=a*c,p=a*l,_=o*c,y=o*l;e[0]=c*h,e[4]=-d,e[8]=l*h,e[1]=f*d+y,e[5]=a*h,e[9]=p*d-_,e[2]=_*d-p,e[6]=o*h,e[10]=y*d+f}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(zh,t,kh)}lookAt(t,e,n){let s=this.elements;return Oe.subVectors(t,e),Oe.lengthSq()===0&&(Oe.z=1),Oe.normalize(),Dn.crossVectors(n,Oe),Dn.lengthSq()===0&&(Math.abs(n.z)===1?Oe.x+=1e-4:Oe.z+=1e-4,Oe.normalize(),Dn.crossVectors(n,Oe)),Dn.normalize(),Hs.crossVectors(Oe,Dn),s[0]=Dn.x,s[4]=Hs.x,s[8]=Oe.x,s[1]=Dn.y,s[5]=Hs.y,s[9]=Oe.y,s[2]=Dn.z,s[6]=Hs.z,s[10]=Oe.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,s=e.elements,r=this.elements,a=n[0],o=n[4],c=n[8],l=n[12],h=n[1],d=n[5],f=n[9],p=n[13],_=n[2],y=n[6],m=n[10],u=n[14],T=n[3],E=n[7],S=n[11],R=n[15],A=s[0],P=s[4],N=s[8],M=s[12],v=s[1],C=s[5],F=s[9],k=s[13],H=s[2],q=s[6],W=s[10],et=s[14],V=s[3],rt=s[7],ct=s[11],St=s[15];return r[0]=a*A+o*v+c*H+l*V,r[4]=a*P+o*C+c*q+l*rt,r[8]=a*N+o*F+c*W+l*ct,r[12]=a*M+o*k+c*et+l*St,r[1]=h*A+d*v+f*H+p*V,r[5]=h*P+d*C+f*q+p*rt,r[9]=h*N+d*F+f*W+p*ct,r[13]=h*M+d*k+f*et+p*St,r[2]=_*A+y*v+m*H+u*V,r[6]=_*P+y*C+m*q+u*rt,r[10]=_*N+y*F+m*W+u*ct,r[14]=_*M+y*k+m*et+u*St,r[3]=T*A+E*v+S*H+R*V,r[7]=T*P+E*C+S*q+R*rt,r[11]=T*N+E*F+S*W+R*ct,r[15]=T*M+E*k+S*et+R*St,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[4],s=t[8],r=t[12],a=t[1],o=t[5],c=t[9],l=t[13],h=t[2],d=t[6],f=t[10],p=t[14],_=t[3],y=t[7],m=t[11],u=t[15];return _*(+r*c*d-s*l*d-r*o*f+n*l*f+s*o*p-n*c*p)+y*(+e*c*p-e*l*f+r*a*f-s*a*p+s*l*h-r*c*h)+m*(+e*l*d-e*o*p-r*a*d+n*a*p+r*o*h-n*l*h)+u*(-s*o*h-e*c*d+e*o*f+s*a*d-n*a*f+n*c*h)}transpose(){let t=this.elements,e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){let s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=n),this}invert(){let t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],c=t[6],l=t[7],h=t[8],d=t[9],f=t[10],p=t[11],_=t[12],y=t[13],m=t[14],u=t[15],T=d*m*l-y*f*l+y*c*p-o*m*p-d*c*u+o*f*u,E=_*f*l-h*m*l-_*c*p+a*m*p+h*c*u-a*f*u,S=h*y*l-_*d*l+_*o*p-a*y*p-h*o*u+a*d*u,R=_*d*c-h*y*c-_*o*f+a*y*f+h*o*m-a*d*m,A=e*T+n*E+s*S+r*R;if(A===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let P=1/A;return t[0]=T*P,t[1]=(y*f*r-d*m*r-y*s*p+n*m*p+d*s*u-n*f*u)*P,t[2]=(o*m*r-y*c*r+y*s*l-n*m*l-o*s*u+n*c*u)*P,t[3]=(d*c*r-o*f*r-d*s*l+n*f*l+o*s*p-n*c*p)*P,t[4]=E*P,t[5]=(h*m*r-_*f*r+_*s*p-e*m*p-h*s*u+e*f*u)*P,t[6]=(_*c*r-a*m*r-_*s*l+e*m*l+a*s*u-e*c*u)*P,t[7]=(a*f*r-h*c*r+h*s*l-e*f*l-a*s*p+e*c*p)*P,t[8]=S*P,t[9]=(_*d*r-h*y*r-_*n*p+e*y*p+h*n*u-e*d*u)*P,t[10]=(a*y*r-_*o*r+_*n*l-e*y*l-a*n*u+e*o*u)*P,t[11]=(h*o*r-a*d*r-h*n*l+e*d*l+a*n*p-e*o*p)*P,t[12]=R*P,t[13]=(h*y*s-_*d*s+_*n*f-e*y*f-h*n*m+e*d*m)*P,t[14]=(_*o*s-a*y*s-_*n*c+e*y*c+a*n*m-e*o*m)*P,t[15]=(a*d*s-h*o*s+h*n*c-e*d*c-a*n*f+e*o*f)*P,this}scale(t){let e=this.elements,n=t.x,s=t.y,r=t.z;return e[0]*=n,e[4]*=s,e[8]*=r,e[1]*=n,e[5]*=s,e[9]*=r,e[2]*=n,e[6]*=s,e[10]*=r,e[3]*=n,e[7]*=s,e[11]*=r,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,s))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let n=Math.cos(e),s=Math.sin(e),r=1-n,a=t.x,o=t.y,c=t.z,l=r*a,h=r*o;return this.set(l*a+n,l*o-s*c,l*c+s*o,0,l*o+s*c,h*o+n,h*c-s*a,0,l*c-s*o,h*c+s*a,r*c*c+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,s,r,a){return this.set(1,n,r,0,t,1,a,0,e,s,1,0,0,0,0,1),this}compose(t,e,n){let s=this.elements,r=e._x,a=e._y,o=e._z,c=e._w,l=r+r,h=a+a,d=o+o,f=r*l,p=r*h,_=r*d,y=a*h,m=a*d,u=o*d,T=c*l,E=c*h,S=c*d,R=n.x,A=n.y,P=n.z;return s[0]=(1-(y+u))*R,s[1]=(p+S)*R,s[2]=(_-E)*R,s[3]=0,s[4]=(p-S)*A,s[5]=(1-(f+u))*A,s[6]=(m+T)*A,s[7]=0,s[8]=(_+E)*P,s[9]=(m-T)*P,s[10]=(1-(f+y))*P,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,n){let s=this.elements,r=Mi.set(s[0],s[1],s[2]).length(),a=Mi.set(s[4],s[5],s[6]).length(),o=Mi.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),t.x=s[12],t.y=s[13],t.z=s[14],Ke.copy(this);let l=1/r,h=1/a,d=1/o;return Ke.elements[0]*=l,Ke.elements[1]*=l,Ke.elements[2]*=l,Ke.elements[4]*=h,Ke.elements[5]*=h,Ke.elements[6]*=h,Ke.elements[8]*=d,Ke.elements[9]*=d,Ke.elements[10]*=d,e.setFromRotationMatrix(Ke),n.x=r,n.y=a,n.z=o,this}makePerspective(t,e,n,s,r,a,o=Qe,c=!1){let l=this.elements,h=2*r/(e-t),d=2*r/(n-s),f=(e+t)/(e-t),p=(n+s)/(n-s),_,y;if(c)_=r/(a-r),y=a*r/(a-r);else if(o===Qe)_=-(a+r)/(a-r),y=-2*a*r/(a-r);else if(o===os)_=-a/(a-r),y=-a*r/(a-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=h,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=d,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=_,l[14]=y,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,s,r,a,o=Qe,c=!1){let l=this.elements,h=2/(e-t),d=2/(n-s),f=-(e+t)/(e-t),p=-(n+s)/(n-s),_,y;if(c)_=1/(a-r),y=a/(a-r);else if(o===Qe)_=-2/(a-r),y=-(a+r)/(a-r);else if(o===os)_=-1/(a-r),y=-r/(a-r);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=h,l[4]=0,l[8]=0,l[12]=f,l[1]=0,l[5]=d,l[9]=0,l[13]=p,l[2]=0,l[6]=0,l[10]=_,l[14]=y,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){let e=this.elements,n=t.elements;for(let s=0;s<16;s++)if(e[s]!==n[s])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}},Mi=new L,Ke=new he,zh=new L(0,0,0),kh=new L(1,1,1),Dn=new L,Hs=new L,Oe=new L,yl=new he,vl=new Ze,en=class i{constructor(t=0,e=0,n=0,s=i.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,s=this._order){return this._x=t,this._y=e,this._z=n,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){let s=t.elements,r=s[0],a=s[4],o=s[8],c=s[1],l=s[5],h=s[9],d=s[2],f=s[6],p=s[10];switch(e){case"XYZ":this._y=Math.asin(zt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(f,l),this._z=0);break;case"YXZ":this._x=Math.asin(-zt(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,p),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-d,r),this._z=0);break;case"ZXY":this._x=Math.asin(zt(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,p),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(c,r));break;case"ZYX":this._y=Math.asin(-zt(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(c,r)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(zt(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-d,r)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-zt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,l),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return yl.makeRotationFromQuaternion(t),this.setFromRotationMatrix(yl,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return vl.setFromEuler(this),this.setFromQuaternion(vl,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};en.DEFAULT_ORDER="XYZ";var hs=class{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let e=0;e1){for(let n=0;n0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),s.instanceInfo=this._instanceInfo.map(o=>({...o})),s.availableInstanceIds=this._availableInstanceIds.slice(),s.availableGeometryIds=this._availableGeometryIds.slice(),s.nextIndexStart=this._nextIndexStart,s.nextVertexStart=this._nextVertexStart,s.geometryCount=this._geometryCount,s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.matricesTexture=this._matricesTexture.toJSON(t),s.indirectTexture=this._indirectTexture.toJSON(t),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(s.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(s.boundingBox=this.boundingBox.toJSON()));function r(o,c){return o[c.uuid]===void 0&&(o[c.uuid]=c.toJSON(t)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(t.geometries,this.geometry);let o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){let c=o.shapes;if(Array.isArray(c))for(let l=0,h=c.length;l0){s.children=[];for(let o=0;o0){s.animations=[];for(let o=0;o0&&(n.geometries=o),c.length>0&&(n.materials=c),l.length>0&&(n.textures=l),h.length>0&&(n.images=h),d.length>0&&(n.shapes=d),f.length>0&&(n.skeletons=f),p.length>0&&(n.animations=p),_.length>0&&(n.nodes=_)}return n.object=s,n;function a(o){let c=[];for(let l in o){let h=o[l];delete h.metadata,c.push(h)}return c}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(t,e,n,s,r){je.subVectors(s,e),xn.subVectors(n,e),Wa.subVectors(t,e);let a=je.dot(je),o=je.dot(xn),c=je.dot(Wa),l=xn.dot(xn),h=xn.dot(Wa),d=a*l-o*o;if(d===0)return r.set(0,0,0),null;let f=1/d,p=(l*c-o*h)*f,_=(a*h-o*c)*f;return r.set(1-p-_,_,p)}static containsPoint(t,e,n,s){return this.getBarycoord(t,e,n,s,yn)===null?!1:yn.x>=0&&yn.y>=0&&yn.x+yn.y<=1}static getInterpolation(t,e,n,s,r,a,o,c){return this.getBarycoord(t,e,n,s,yn)===null?(c.x=0,c.y=0,"z"in c&&(c.z=0),"w"in c&&(c.w=0),null):(c.setScalar(0),c.addScaledVector(r,yn.x),c.addScaledVector(a,yn.y),c.addScaledVector(o,yn.z),c)}static getInterpolatedAttribute(t,e,n,s,r,a){return Za.setScalar(0),Ja.setScalar(0),$a.setScalar(0),Za.fromBufferAttribute(t,e),Ja.fromBufferAttribute(t,n),$a.fromBufferAttribute(t,s),a.setScalar(0),a.addScaledVector(Za,r.x),a.addScaledVector(Ja,r.y),a.addScaledVector($a,r.z),a}static isFrontFacing(t,e,n,s){return je.subVectors(n,e),xn.subVectors(t,e),je.cross(xn).dot(s)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,s){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,n,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,s),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return je.subVectors(this.c,this.b),xn.subVectors(this.a,this.b),je.cross(xn).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return i.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return i.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,s,r){return i.getInterpolation(t,this.a,this.b,this.c,e,n,s,r)}containsPoint(t){return i.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return i.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let n=this.a,s=this.b,r=this.c,a,o;Ei.subVectors(s,n),Ti.subVectors(r,n),Xa.subVectors(t,n);let c=Ei.dot(Xa),l=Ti.dot(Xa);if(c<=0&&l<=0)return e.copy(n);qa.subVectors(t,s);let h=Ei.dot(qa),d=Ti.dot(qa);if(h>=0&&d<=h)return e.copy(s);let f=c*d-h*l;if(f<=0&&c>=0&&h<=0)return a=c/(c-h),e.copy(n).addScaledVector(Ei,a);Ya.subVectors(t,r);let p=Ei.dot(Ya),_=Ti.dot(Ya);if(_>=0&&p<=_)return e.copy(r);let y=p*l-c*_;if(y<=0&&l>=0&&_<=0)return o=l/(l-_),e.copy(n).addScaledVector(Ti,o);let m=h*_-p*d;if(m<=0&&d-h>=0&&p-_>=0)return wl.subVectors(r,s),o=(d-h)/(d-h+(p-_)),e.copy(s).addScaledVector(wl,o);let u=1/(m+y+f);return a=y*u,o=f*u,e.copy(n).addScaledVector(Ei,a).addScaledVector(Ti,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},wc={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ln={h:0,s:0,l:0},Ws={h:0,s:0,l:0};function Ka(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+(t-i)*6*e:e<1/2?t:e<2/3?i+(t-i)*6*(2/3-e):i}var Ot=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){let s=t;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Ce){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Gt.colorSpaceToWorking(this,e),this}setRGB(t,e,n,s=Gt.workingColorSpace){return this.r=t,this.g=e,this.b=n,Gt.colorSpaceToWorking(this,s),this}setHSL(t,e,n,s=Gt.workingColorSpace){if(t=Io(t,1),e=zt(e,0,1),n=zt(n,0,1),e===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+e):n+e-n*e,a=2*n-r;this.r=Ka(a,r,t+1/3),this.g=Ka(a,r,t),this.b=Ka(a,r,t-1/3)}return Gt.colorSpaceToWorking(this,s),this}setStyle(t,e=Ce){function n(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(t)){let r,a=s[1],o=s[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(t)){let r=s[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(r,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Ce){let n=wc[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Mn(t.r),this.g=Mn(t.g),this.b=Mn(t.b),this}copyLinearToSRGB(t){return this.r=Ii(t.r),this.g=Ii(t.g),this.b=Ii(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Ce){return Gt.workingToColorSpace(be.copy(this),t),Math.round(zt(be.r*255,0,255))*65536+Math.round(zt(be.g*255,0,255))*256+Math.round(zt(be.b*255,0,255))}getHexString(t=Ce){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Gt.workingColorSpace){Gt.workingToColorSpace(be.copy(this),e);let n=be.r,s=be.g,r=be.b,a=Math.max(n,s,r),o=Math.min(n,s,r),c,l,h=(o+a)/2;if(o===a)c=0,l=0;else{let d=a-o;switch(l=h<=.5?d/(a+o):d/(2-a-o),a){case n:c=(s-r)/d+(s0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(let e in t){let n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}let s=this[e];if(s===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(n):s&&s.isVector3&&n&&n.isVector3?s.copy(n):this[e]=n}}toJSON(t){let e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});let n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(t).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(t).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==ni&&(n.blending=this.blending),this.side!==Sn&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==sr&&(n.blendSrc=this.blendSrc),this.blendDst!==rr&&(n.blendDst=this.blendDst),this.blendEquation!==On&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==ii&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==ao&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ei&&(n.stencilFail=this.stencilFail),this.stencilZFail!==ei&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==ei&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function s(r){let a=[];for(let o in r){let c=r[o];delete c.metadata,a.push(c)}return a}if(e){let r=s(t.textures),a=s(t.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,n=null;if(e!==null){let s=e.length;n=new Array(s);for(let r=0;r!==s;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}},us=class extends En{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ot(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new en,this.combine=_o,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}};var de=new L,Xs=new Pt,qh=0,Te=class{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:qh++}),this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=oo,this.updateRanges=[],this.gpuType=dn,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let s=0,r=this.itemSize;se.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new hn);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new L(-1/0,-1/0,-1/0),new L(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,s=e.length;n0&&(t.userData=this.userData),this.parameters!==void 0){let c=this.parameters;for(let l in c)c[l]!==void 0&&(t[l]=c[l]);return t}t.data={attributes:{}};let e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let n=this.attributes;for(let c in n){let l=n[c];t.data.attributes[c]=l.toJSON(t.data)}let s={},r=!1;for(let c in this.morphAttributes){let l=this.morphAttributes[c],h=[];for(let d=0,f=l.length;d0&&(s[c]=h,r=!0)}r&&(t.data.morphAttributes=s,t.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(t.data.boundingSphere=o.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let n=t.index;n!==null&&this.setIndex(n.clone());let s=t.attributes;for(let l in s){let h=s[l];this.setAttribute(l,h.clone(e))}let r=t.morphAttributes;for(let l in r){let h=[],d=r[l];for(let f=0,p=d.length;f0){let s=e[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r(t.far-t.near)**2))&&(Al.copy(r).invert(),Qn.copy(t.ray).applyMatrix4(Al),!(n.boundingBox!==null&&Qn.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,Qn)))}_computeIntersections(t,e,n){let s,r=this.geometry,a=this.material,o=r.index,c=r.attributes.position,l=r.attributes.uv,h=r.attributes.uv1,d=r.attributes.normal,f=r.groups,p=r.drawRange;if(o!==null)if(Array.isArray(a))for(let _=0,y=f.length;_e.far?null:{distance:l,point:Ks.clone(),object:i}}function js(i,t,e,n,s,r,a,o,c,l){i.getVertexPosition(o,Ys),i.getVertexPosition(c,Zs),i.getVertexPosition(l,Js);let h=Zh(i,t,e,n,Ys,Zs,Js,Cl);if(h){let d=new L;Nn.getBarycoord(Cl,Ys,Zs,Js,d),s&&(h.uv=Nn.getInterpolatedAttribute(s,o,c,l,d,new Pt)),r&&(h.uv1=Nn.getInterpolatedAttribute(r,o,c,l,d,new Pt)),a&&(h.normal=Nn.getInterpolatedAttribute(a,o,c,l,d,new L),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));let f={a:o,b:c,c:l,normal:new L,materialIndex:0};Nn.getNormal(Ys,Zs,Js,f.normal),h.face=f,h.barycoord=d}return h}var Bn=class i extends Ie{constructor(t=1,e=1,n=1,s=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:s,heightSegments:r,depthSegments:a};let o=this;s=Math.floor(s),r=Math.floor(r),a=Math.floor(a);let c=[],l=[],h=[],d=[],f=0,p=0;_("z","y","x",-1,-1,n,e,t,a,r,0),_("z","y","x",1,-1,n,e,-t,a,r,1),_("x","z","y",1,1,t,n,e,s,a,2),_("x","z","y",1,-1,t,n,-e,s,a,3),_("x","y","z",1,-1,t,e,n,s,r,4),_("x","y","z",-1,-1,t,e,-n,s,r,5),this.setIndex(c),this.setAttribute("position",new oe(l,3)),this.setAttribute("normal",new oe(h,3)),this.setAttribute("uv",new oe(d,2));function _(y,m,u,T,E,S,R,A,P,N,M){let v=S/P,C=R/N,F=S/2,k=R/2,H=A/2,q=P+1,W=N+1,et=0,V=0,rt=new L;for(let ct=0;ct0?1:-1,h.push(rt.x,rt.y,rt.z),d.push(kt/P),d.push(1-ct/N),et+=1}}for(let ct=0;ct0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;let n={};for(let s in this.extensions)this.extensions[s]===!0&&(n[s]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}},ps=class extends ve{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new he,this.projectionMatrix=new he,this.projectionMatrixInverse=new he,this.coordinateSystem=Qe,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},Un=new L,Il=new Pt,Pl=new Pt,Ee=class extends ps{constructor(t=50,e=1,n=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=s,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){let e=.5*this.getFilmHeight()/t;this.fov=Di*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(is*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Di*2*Math.atan(Math.tan(is*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){Un.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Un.x,Un.y).multiplyScalar(-t/Un.z),Un.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Un.x,Un.y).multiplyScalar(-t/Un.z)}getViewSize(t,e){return this.getViewBounds(t,Il,Pl),e.subVectors(Pl,Il)}setViewOffset(t,e,n,s,r,a){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(is*.5*this.fov)/this.zoom,n=2*e,s=this.aspect*n,r=-.5*s,a=this.view;if(this.view!==null&&this.view.enabled){let c=a.fullWidth,l=a.fullHeight;r+=a.offsetX*s/c,e-=a.offsetY*n/l,s*=a.width/c,n*=a.height/l}let o=this.filmOffset;o!==0&&(r+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,e,e-n,t,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}},Ai=-90,Ri=1,dr=class extends ve{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let s=new Ee(Ai,Ri,t,e);s.layers=this.layers,this.add(s);let r=new Ee(Ai,Ri,t,e);r.layers=this.layers,this.add(r);let a=new Ee(Ai,Ri,t,e);a.layers=this.layers,this.add(a);let o=new Ee(Ai,Ri,t,e);o.layers=this.layers,this.add(o);let c=new Ee(Ai,Ri,t,e);c.layers=this.layers,this.add(c);let l=new Ee(Ai,Ri,t,e);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[n,s,r,a,o,c]=e;for(let l of e)this.remove(l);if(t===Qe)n.up.set(0,1,0),n.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else if(t===os)n.up.set(0,-1,0),n.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(let l of e)this.add(l),l.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:s}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());let[r,a,o,c,l,h]=this.children,d=t.getRenderTarget(),f=t.getActiveCubeFace(),p=t.getActiveMipmapLevel(),_=t.xr.enabled;t.xr.enabled=!1;let y=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,s),t.render(e,r),t.setRenderTarget(n,1,s),t.render(e,a),t.setRenderTarget(n,2,s),t.render(e,o),t.setRenderTarget(n,3,s),t.render(e,c),t.setRenderTarget(n,4,s),t.render(e,l),n.texture.generateMipmaps=y,t.setRenderTarget(n,5,s),t.render(e,h),t.setRenderTarget(d,f,p),t.xr.enabled=_,n.texture.needsPMREMUpdate=!0}},ms=class extends ze{constructor(t=[],e=li,n,s,r,a,o,c,l,h){super(t,e,n,s,r,a,o,c,l,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}},fr=class extends cn{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;let n={width:t,height:t,depth:1},s=[n,n,n,n,n,n];this.texture=new ms(s),this._setTextureOptions(e),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},s=new Bn(5,5,5),r=new nn({name:"CubemapFromEquirect",uniforms:hi(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:De,blending:Tn});r.uniforms.tEquirect.value=e;let a=new Pe(s,r),o=e.minFilter;return e.minFilter===Wn&&(e.minFilter=tn),new dr(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(t,e=!0,n=!0,s=!0){let r=t.getRenderTarget();for(let a=0;a<6;a++)t.setRenderTarget(this,a),t.clear(e,n,s);t.setRenderTarget(r)}},vn=class extends ve{constructor(){super(),this.isGroup=!0,this.type="Group"}},jh={type:"move"},Ni=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new vn,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new vn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new L,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new L),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new vn,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new L,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new L),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let e=this._hand;if(e)for(let n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let s=null,r=null,a=null,o=this._targetRay,c=this._grip,l=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(l&&t.hand){a=!0;for(let y of t.hand.values()){let m=e.getJointPose(y,n),u=this._getHandJoint(l,y);m!==null&&(u.matrix.fromArray(m.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,u.jointRadius=m.radius),u.visible=m!==null}let h=l.joints["index-finger-tip"],d=l.joints["thumb-tip"],f=h.position.distanceTo(d.position),p=.02,_=.005;l.inputState.pinching&&f>p+_?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&f<=p-_&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else c!==null&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1));o!==null&&(s=e.getPose(t.targetRaySpace,n),s===null&&r!==null&&(s=r),s!==null&&(o.matrix.fromArray(s.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,s.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(s.linearVelocity)):o.hasLinearVelocity=!1,s.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(s.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(jh)))}return o!==null&&(o.visible=s!==null),c!==null&&(c.visible=r!==null),l!==null&&(l.visible=a!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){let n=new vn;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}};var gs=class extends ve{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new en,this.environmentIntensity=1,this.environmentRotation=new en,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}};var to=new L,Qh=new L,tu=new Ut,qe=class{constructor(t=new L(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,s){return this.normal.set(t,e,n),this.constant=s,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){let s=to.subVectors(n,e).cross(Qh.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(s,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){let n=t.delta(to),s=this.normal.dot(n);if(s===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;let r=-(t.start.dot(this.normal)+this.constant)/s;return r<0||r>1?null:e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){let e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let n=e||tu.getNormalMatrix(t),s=this.coplanarPoint(to).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-s.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}},ti=new si,eu=new Pt(.5,.5),Qs=new L,Fi=class{constructor(t=new qe,e=new qe,n=new qe,s=new qe,r=new qe,a=new qe){this.planes=[t,e,n,s,r,a]}set(t,e,n,s,r,a){let o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(s),o[4].copy(r),o[5].copy(a),this}copy(t){let e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=Qe,n=!1){let s=this.planes,r=t.elements,a=r[0],o=r[1],c=r[2],l=r[3],h=r[4],d=r[5],f=r[6],p=r[7],_=r[8],y=r[9],m=r[10],u=r[11],T=r[12],E=r[13],S=r[14],R=r[15];if(s[0].setComponents(l-a,p-h,u-_,R-T).normalize(),s[1].setComponents(l+a,p+h,u+_,R+T).normalize(),s[2].setComponents(l+o,p+d,u+y,R+E).normalize(),s[3].setComponents(l-o,p-d,u-y,R-E).normalize(),n)s[4].setComponents(c,f,m,S).normalize(),s[5].setComponents(l-c,p-f,u-m,R-S).normalize();else if(s[4].setComponents(l-c,p-f,u-m,R-S).normalize(),e===Qe)s[5].setComponents(l+c,p+f,u+m,R+S).normalize();else if(e===os)s[5].setComponents(c,f,m,S).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),ti.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{let e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),ti.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(ti)}intersectsSprite(t){ti.center.set(0,0,0);let e=eu.distanceTo(t.center);return ti.radius=.7071067811865476+e,ti.applyMatrix4(t.matrixWorld),this.intersectsSphere(ti)}intersectsSphere(t){let e=this.planes,n=t.center,s=-t.radius;for(let r=0;r<6;r++)if(e[r].distanceToPoint(n)0?t.max.x:t.min.x,Qs.y=s.normal.y>0?t.max.y:t.min.y,Qs.z=s.normal.z>0?t.max.z:t.min.z,s.distanceToPoint(Qs)<0)return!1}return!0}containsPoint(t){let e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};var _s=class extends En{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ot(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}},pr=new L,mr=new L,Dl=new he,ns=new ri,tr=new si,eo=new L,Ll=new L,gr=class extends ve{constructor(t=new Ie,e=new _s){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){let t=this.geometry;if(t.index===null){let e=t.attributes.position,n=[0];for(let s=1,r=e.count;s0){let s=e[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;rn)return;eo.applyMatrix4(i.matrixWorld);let l=t.ray.origin.distanceTo(eo);if(!(lt.far))return{distance:l,point:Ll.clone().applyMatrix4(i.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:i}}var Ul=new L,Nl=new L,_r=class extends gr{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let t=this.geometry;if(t.index===null){let e=t.attributes.position,n=[];for(let s=0,r=e.count;s0){let M=(T-1)*y;for(let v=0;v0&&E(!0),e>0&&E(!1)),this.setIndex(h),this.setAttribute("position",new oe(d,3)),this.setAttribute("normal",new oe(f,3)),this.setAttribute("uv",new oe(p,2));function T(){let S=new L,R=new L,A=0,P=(e-t)/n;for(let N=0;N<=r;N++){let M=[],v=N/r,C=v*(e-t)+t;for(let F=0;F<=s;F++){let k=F/s,H=k*c+o,q=Math.sin(H),W=Math.cos(H);R.x=C*q,R.y=-v*n+m,R.z=C*W,d.push(R.x,R.y,R.z),S.set(q,P,W).normalize(),f.push(S.x,S.y,S.z),p.push(k,1-v),M.push(_++)}y.push(M)}for(let N=0;N0||M!==0)&&(h.push(v,C,k),A+=3),(e>0||M!==r-1)&&(h.push(C,F,k),A+=3)}l.addGroup(u,A,0),u+=A}function E(S){let R=_,A=new Pt,P=new L,N=0,M=S===!0?t:e,v=S===!0?1:-1;for(let F=1;F<=s;F++)d.push(0,m*v,0),f.push(0,v,0),p.push(.5,.5),_++;let C=_;for(let F=0;F<=s;F++){let H=F/s*c+o,q=Math.cos(H),W=Math.sin(H);P.x=M*W,P.y=m*v,P.z=M*q,d.push(P.x,P.y,P.z),f.push(0,v,0),A.x=q*.5+.5,A.y=W*.5*v+.5,p.push(A.x,A.y),_++}for(let F=0;F0)&&p.push(E,S,A),(u!==n-1||c=r)){let o=e[1];t=r)break t}a=n,n=0;break e}break n}for(;n>>1;te;)--a;if(++a,r!==0||a!==s){r>=a&&(a=Math.max(a,1),r=a-1);let o=this.getValueSize();this.times=n.slice(r,a),this.values=this.values.slice(r*o,a*o)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let n=this.times,s=this.values,r=n.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let a=null;for(let o=0;o!==r;o++){let c=n[o];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,c),t=!1;break}if(a!==null&&a>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,c,a),t=!1;break}a=c}if(s!==void 0&&nu(s))for(let o=0,c=s.length;o!==c;++o){let l=s[o];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,l),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),n=this.getValueSize(),s=this.getInterpolation()===ir,r=t.length-1,a=1;for(let o=1;o0){t[a]=t[r];for(let o=r*n,c=a*n,l=0;l!==n;++l)e[c+l]=e[o+l];++a}return a!==t.length?(this.times=t.slice(0,a),this.values=e.slice(0,a*n)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),n=this.constructor,s=new n(this.name,t,e);return s.createInterpolant=this.createInterpolant,s}};ke.prototype.ValueTypeName="";ke.prototype.TimeBufferType=Float32Array;ke.prototype.ValueBufferType=Float32Array;ke.prototype.DefaultInterpolation=lr;var zn=class extends ke{constructor(t,e,n){super(t,e,n)}};zn.prototype.ValueTypeName="bool";zn.prototype.ValueBufferType=Array;zn.prototype.DefaultInterpolation=rs;zn.prototype.InterpolantFactoryMethodLinear=void 0;zn.prototype.InterpolantFactoryMethodSmooth=void 0;var br=class extends ke{constructor(t,e,n,s){super(t,e,n,s)}};br.prototype.ValueTypeName="color";var Er=class extends ke{constructor(t,e,n,s){super(t,e,n,s)}};Er.prototype.ValueTypeName="number";var Tr=class extends oi{constructor(t,e,n,s){super(t,e,n,s)}interpolate_(t,e,n,s){let r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=(n-e)/(s-e),l=t*o;for(let h=l+o;l!==h;l+=4)Ze.slerpFlat(r,0,a,l-o,a,l,c);return r}},Ss=class extends ke{constructor(t,e,n,s){super(t,e,n,s)}InterpolantFactoryMethodLinear(t){return new Tr(this.times,this.values,this.getValueSize(),t)}};Ss.prototype.ValueTypeName="quaternion";Ss.prototype.InterpolantFactoryMethodSmooth=void 0;var kn=class extends ke{constructor(t,e,n){super(t,e,n)}};kn.prototype.ValueTypeName="string";kn.prototype.ValueBufferType=Array;kn.prototype.DefaultInterpolation=rs;kn.prototype.InterpolantFactoryMethodLinear=void 0;kn.prototype.InterpolantFactoryMethodSmooth=void 0;var wr=class extends ke{constructor(t,e,n,s){super(t,e,n,s)}};wr.prototype.ValueTypeName="vector";var Ar=class{constructor(t,e,n){let s=this,r=!1,a=0,o=0,c,l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.abortController=new AbortController,this.itemStart=function(h){o++,r===!1&&s.onStart!==void 0&&s.onStart(h,a,o),r=!0},this.itemEnd=function(h){a++,s.onProgress!==void 0&&s.onProgress(h,a,o),a===o&&(r=!1,s.onLoad!==void 0&&s.onLoad())},this.itemError=function(h){s.onError!==void 0&&s.onError(h)},this.resolveURL=function(h){return c?c(h):h},this.setURLModifier=function(h){return c=h,this},this.addHandler=function(h,d){return l.push(h,d),this},this.removeHandler=function(h){let d=l.indexOf(h);return d!==-1&&l.splice(d,2),this},this.getHandler=function(h){for(let d=0,f=l.length;dp.start-_.start);let f=0;for(let p=1;p 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,Iu=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,Pu=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,Du=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,Lu=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,Uu=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,Nu=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec3 vColor; +#endif`,Fu=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif +#ifdef USE_BATCHING_COLOR + vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); + vColor.xyz *= batchingColor.xyz; +#endif`,Ou=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,Bu=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,zu=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,ku=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,Vu=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,Hu=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE + emissiveColor = sRGBTransferEOTF( emissiveColor ); + #endif + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,Gu=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,Wu="gl_FragColor = linearToOutputTexel( gl_FragColor );",Xu=`vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferEOTF( in vec4 value ) { + return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +}`,qu=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,Yu=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,Zu=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,Ju=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,$u=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,Ku=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,ju=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,Qu=`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,td=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,ed=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,nd=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,id=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,sd=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,rd=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,ad=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,od=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,ld=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,cd=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,hd=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,ud=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,dd=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,fd=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,pd=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,md=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,gd=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,_d=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,xd=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER + varying float vFragDepth; + varying float vIsPerspective; +#endif`,yd=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,vd=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,Md=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,Sd=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,bd=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,Ed=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,Td=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,wd=`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,Ad=`#if defined( USE_MORPHCOLORS ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,Rd=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,Cd=`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } +#endif`,Id=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,Pd=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,Dd=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,Ld=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Ud=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Nd=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,Fd=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,Od=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,Bd=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,zd=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,kd=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,Vd=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Hd=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; +const float Inv255 = 1. / 255.; +const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); +const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); +const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); +const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); +vec4 packDepthToRGBA( const in float v ) { + if( v <= 0.0 ) + return vec4( 0., 0., 0., 0. ); + if( v >= 1.0 ) + return vec4( 1., 1., 1., 1. ); + float vuf; + float af = modf( v * PackFactors.a, vuf ); + float bf = modf( vuf * ShiftRight8, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); +} +vec3 packDepthToRGB( const in float v ) { + if( v <= 0.0 ) + return vec3( 0., 0., 0. ); + if( v >= 1.0 ) + return vec3( 1., 1., 1. ); + float vuf; + float bf = modf( v * PackFactors.b, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec3( vuf * Inv255, gf * PackUpscale, bf ); +} +vec2 packDepthToRG( const in float v ) { + if( v <= 0.0 ) + return vec2( 0., 0. ); + if( v >= 1.0 ) + return vec2( 1., 1. ); + float vuf; + float gf = modf( v * 256., vuf ); + return vec2( vuf * Inv255, gf ); +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors4 ); +} +float unpackRGBToDepth( const in vec3 v ) { + return dot( v, UnpackFactors3 ); +} +float unpackRGToDepth( const in vec2 v ) { + return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; +} +vec4 pack2HalfToRGBA( const in vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( const in vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,Gd=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,Wd=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,Xd=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,qd=`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,Yd=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,Zd=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,Jd=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + float depth = unpackRGBAToDepth( texture2D( depths, uv ) ); + #ifdef USE_REVERSED_DEPTH_BUFFER + return step( depth, compare ); + #else + return step( compare, depth ); + #endif + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow( sampler2D shadow, vec2 uv, float compare ) { + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + #ifdef USE_REVERSED_DEPTH_BUFFER + float hard_shadow = step( distribution.x, compare ); + #else + float hard_shadow = step( compare, distribution.x ); + #endif + if ( hard_shadow != 1.0 ) { + float distance = compare - distribution.x; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + + float lightToPositionLength = length( lightToPosition ); + if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { + float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + shadow = ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } +#endif`,$d=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,Kd=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,jd=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,Qd=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,tf=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,ef=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,nf=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,sf=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,rf=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,af=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,of=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 CineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,lf=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,cf=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + #else + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,hf=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,uf=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,df=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,ff=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`,pf=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,mf=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,gf=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,_f=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,xf=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,yf=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,vf=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,Mf=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + #ifdef USE_REVERSED_DEPTH_BUFFER + float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ]; + #else + float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5; + #endif + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #elif DEPTH_PACKING == 3202 + gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); + #elif DEPTH_PACKING == 3203 + gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); + #endif +}`,Sf=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,bf=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,Ef=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,Tf=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,wf=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,Af=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,Rf=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,Cf=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,If=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,Pf=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,Df=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,Lf=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,Uf=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,Nf=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,Ff=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,Of=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,Bf=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,zf=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,kf=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,Vf=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,Hf=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,Gf=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,Wf=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,Xf=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,qf=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix[ 3 ]; + vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,Yf=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,Bt={alphahash_fragment:pu,alphahash_pars_fragment:mu,alphamap_fragment:gu,alphamap_pars_fragment:_u,alphatest_fragment:xu,alphatest_pars_fragment:yu,aomap_fragment:vu,aomap_pars_fragment:Mu,batching_pars_vertex:Su,batching_vertex:bu,begin_vertex:Eu,beginnormal_vertex:Tu,bsdfs:wu,iridescence_fragment:Au,bumpmap_pars_fragment:Ru,clipping_planes_fragment:Cu,clipping_planes_pars_fragment:Iu,clipping_planes_pars_vertex:Pu,clipping_planes_vertex:Du,color_fragment:Lu,color_pars_fragment:Uu,color_pars_vertex:Nu,color_vertex:Fu,common:Ou,cube_uv_reflection_fragment:Bu,defaultnormal_vertex:zu,displacementmap_pars_vertex:ku,displacementmap_vertex:Vu,emissivemap_fragment:Hu,emissivemap_pars_fragment:Gu,colorspace_fragment:Wu,colorspace_pars_fragment:Xu,envmap_fragment:qu,envmap_common_pars_fragment:Yu,envmap_pars_fragment:Zu,envmap_pars_vertex:Ju,envmap_physical_pars_fragment:ad,envmap_vertex:$u,fog_vertex:Ku,fog_pars_vertex:ju,fog_fragment:Qu,fog_pars_fragment:td,gradientmap_pars_fragment:ed,lightmap_pars_fragment:nd,lights_lambert_fragment:id,lights_lambert_pars_fragment:sd,lights_pars_begin:rd,lights_toon_fragment:od,lights_toon_pars_fragment:ld,lights_phong_fragment:cd,lights_phong_pars_fragment:hd,lights_physical_fragment:ud,lights_physical_pars_fragment:dd,lights_fragment_begin:fd,lights_fragment_maps:pd,lights_fragment_end:md,logdepthbuf_fragment:gd,logdepthbuf_pars_fragment:_d,logdepthbuf_pars_vertex:xd,logdepthbuf_vertex:yd,map_fragment:vd,map_pars_fragment:Md,map_particle_fragment:Sd,map_particle_pars_fragment:bd,metalnessmap_fragment:Ed,metalnessmap_pars_fragment:Td,morphinstance_vertex:wd,morphcolor_vertex:Ad,morphnormal_vertex:Rd,morphtarget_pars_vertex:Cd,morphtarget_vertex:Id,normal_fragment_begin:Pd,normal_fragment_maps:Dd,normal_pars_fragment:Ld,normal_pars_vertex:Ud,normal_vertex:Nd,normalmap_pars_fragment:Fd,clearcoat_normal_fragment_begin:Od,clearcoat_normal_fragment_maps:Bd,clearcoat_pars_fragment:zd,iridescence_pars_fragment:kd,opaque_fragment:Vd,packing:Hd,premultiplied_alpha_fragment:Gd,project_vertex:Wd,dithering_fragment:Xd,dithering_pars_fragment:qd,roughnessmap_fragment:Yd,roughnessmap_pars_fragment:Zd,shadowmap_pars_fragment:Jd,shadowmap_pars_vertex:$d,shadowmap_vertex:Kd,shadowmask_pars_fragment:jd,skinbase_vertex:Qd,skinning_pars_vertex:tf,skinning_vertex:ef,skinnormal_vertex:nf,specularmap_fragment:sf,specularmap_pars_fragment:rf,tonemapping_fragment:af,tonemapping_pars_fragment:of,transmission_fragment:lf,transmission_pars_fragment:cf,uv_pars_fragment:hf,uv_pars_vertex:uf,uv_vertex:df,worldpos_vertex:ff,background_vert:pf,background_frag:mf,backgroundCube_vert:gf,backgroundCube_frag:_f,cube_vert:xf,cube_frag:yf,depth_vert:vf,depth_frag:Mf,distanceRGBA_vert:Sf,distanceRGBA_frag:bf,equirect_vert:Ef,equirect_frag:Tf,linedashed_vert:wf,linedashed_frag:Af,meshbasic_vert:Rf,meshbasic_frag:Cf,meshlambert_vert:If,meshlambert_frag:Pf,meshmatcap_vert:Df,meshmatcap_frag:Lf,meshnormal_vert:Uf,meshnormal_frag:Nf,meshphong_vert:Ff,meshphong_frag:Of,meshphysical_vert:Bf,meshphysical_frag:zf,meshtoon_vert:kf,meshtoon_frag:Vf,points_vert:Hf,points_frag:Gf,shadow_vert:Wf,shadow_frag:Xf,sprite_vert:qf,sprite_frag:Yf},st={common:{diffuse:{value:new Ot(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ut},alphaMap:{value:null},alphaMapTransform:{value:new Ut},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ut}},envmap:{envMap:{value:null},envMapRotation:{value:new Ut},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ut}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ut}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ut},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ut},normalScale:{value:new Pt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ut},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ut}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ut}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ut}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ot(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ot(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ut},alphaTest:{value:0},uvTransform:{value:new Ut}},sprite:{diffuse:{value:new Ot(16777215)},opacity:{value:1},center:{value:new Pt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ut},alphaMap:{value:null},alphaMapTransform:{value:new Ut},alphaTest:{value:0}}},fn={basic:{uniforms:we([st.common,st.specularmap,st.envmap,st.aomap,st.lightmap,st.fog]),vertexShader:Bt.meshbasic_vert,fragmentShader:Bt.meshbasic_frag},lambert:{uniforms:we([st.common,st.specularmap,st.envmap,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.fog,st.lights,{emissive:{value:new Ot(0)}}]),vertexShader:Bt.meshlambert_vert,fragmentShader:Bt.meshlambert_frag},phong:{uniforms:we([st.common,st.specularmap,st.envmap,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.fog,st.lights,{emissive:{value:new Ot(0)},specular:{value:new Ot(1118481)},shininess:{value:30}}]),vertexShader:Bt.meshphong_vert,fragmentShader:Bt.meshphong_frag},standard:{uniforms:we([st.common,st.envmap,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.roughnessmap,st.metalnessmap,st.fog,st.lights,{emissive:{value:new Ot(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Bt.meshphysical_vert,fragmentShader:Bt.meshphysical_frag},toon:{uniforms:we([st.common,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.gradientmap,st.fog,st.lights,{emissive:{value:new Ot(0)}}]),vertexShader:Bt.meshtoon_vert,fragmentShader:Bt.meshtoon_frag},matcap:{uniforms:we([st.common,st.bumpmap,st.normalmap,st.displacementmap,st.fog,{matcap:{value:null}}]),vertexShader:Bt.meshmatcap_vert,fragmentShader:Bt.meshmatcap_frag},points:{uniforms:we([st.points,st.fog]),vertexShader:Bt.points_vert,fragmentShader:Bt.points_frag},dashed:{uniforms:we([st.common,st.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Bt.linedashed_vert,fragmentShader:Bt.linedashed_frag},depth:{uniforms:we([st.common,st.displacementmap]),vertexShader:Bt.depth_vert,fragmentShader:Bt.depth_frag},normal:{uniforms:we([st.common,st.bumpmap,st.normalmap,st.displacementmap,{opacity:{value:1}}]),vertexShader:Bt.meshnormal_vert,fragmentShader:Bt.meshnormal_frag},sprite:{uniforms:we([st.sprite,st.fog]),vertexShader:Bt.sprite_vert,fragmentShader:Bt.sprite_frag},background:{uniforms:{uvTransform:{value:new Ut},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Bt.background_vert,fragmentShader:Bt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Ut}},vertexShader:Bt.backgroundCube_vert,fragmentShader:Bt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Bt.cube_vert,fragmentShader:Bt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Bt.equirect_vert,fragmentShader:Bt.equirect_frag},distanceRGBA:{uniforms:we([st.common,st.displacementmap,{referencePosition:{value:new L},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Bt.distanceRGBA_vert,fragmentShader:Bt.distanceRGBA_frag},shadow:{uniforms:we([st.lights,st.fog,{color:{value:new Ot(0)},opacity:{value:1}}]),vertexShader:Bt.shadow_vert,fragmentShader:Bt.shadow_frag}};fn.physical={uniforms:we([fn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ut},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ut},clearcoatNormalScale:{value:new Pt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ut},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ut},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ut},sheen:{value:0},sheenColor:{value:new Ot(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ut},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ut},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ut},transmissionSamplerSize:{value:new Pt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ut},attenuationDistance:{value:0},attenuationColor:{value:new Ot(0)},specularColor:{value:new Ot(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ut},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ut},anisotropyVector:{value:new Pt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ut}}]),vertexShader:Bt.meshphysical_vert,fragmentShader:Bt.meshphysical_frag};var Ma={r:0,b:0,g:0},ui=new en,Zf=new he;function Jf(i,t,e,n,s,r,a){let o=new Ot(0),c=r===!0?0:1,l,h,d=null,f=0,p=null;function _(E){let S=E.isScene===!0?E.background:null;return S&&S.isTexture&&(S=(E.backgroundBlurriness>0?e:t).get(S)),S}function y(E){let S=!1,R=_(E);R===null?u(o,c):R&&R.isColor&&(u(R,1),S=!0);let A=i.xr.getEnvironmentBlendMode();A==="additive"?n.buffers.color.setClear(0,0,0,1,a):A==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(i.autoClear||S)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil))}function m(E,S){let R=_(S);R&&(R.isCubeTexture||R.mapping===Rs)?(h===void 0&&(h=new Pe(new Bn(1,1,1),new nn({name:"BackgroundCubeMaterial",uniforms:hi(fn.backgroundCube.uniforms),vertexShader:fn.backgroundCube.vertexShader,fragmentShader:fn.backgroundCube.fragmentShader,side:De,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(A,P,N){this.matrixWorld.copyPosition(N.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(h)),ui.copy(S.backgroundRotation),ui.x*=-1,ui.y*=-1,ui.z*=-1,R.isCubeTexture&&R.isRenderTargetTexture===!1&&(ui.y*=-1,ui.z*=-1),h.material.uniforms.envMap.value=R,h.material.uniforms.flipEnvMap.value=R.isCubeTexture&&R.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=S.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(Zf.makeRotationFromEuler(ui)),h.material.toneMapped=Gt.getTransfer(R.colorSpace)!==Yt,(d!==R||f!==R.version||p!==i.toneMapping)&&(h.material.needsUpdate=!0,d=R,f=R.version,p=i.toneMapping),h.layers.enableAll(),E.unshift(h,h.geometry,h.material,0,0,null)):R&&R.isTexture&&(l===void 0&&(l=new Pe(new ai(2,2),new nn({name:"BackgroundMaterial",uniforms:hi(fn.background.uniforms),vertexShader:fn.background.vertexShader,fragmentShader:fn.background.fragmentShader,side:Sn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(l)),l.material.uniforms.t2D.value=R,l.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,l.material.toneMapped=Gt.getTransfer(R.colorSpace)!==Yt,R.matrixAutoUpdate===!0&&R.updateMatrix(),l.material.uniforms.uvTransform.value.copy(R.matrix),(d!==R||f!==R.version||p!==i.toneMapping)&&(l.material.needsUpdate=!0,d=R,f=R.version,p=i.toneMapping),l.layers.enableAll(),E.unshift(l,l.geometry,l.material,0,0,null))}function u(E,S){E.getRGB(Ma,Lo(i)),n.buffers.color.setClear(Ma.r,Ma.g,Ma.b,S,a)}function T(){h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0),l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}return{getClearColor:function(){return o},setClearColor:function(E,S=1){o.set(E),c=S,u(o,c)},getClearAlpha:function(){return c},setClearAlpha:function(E){c=E,u(o,c)},render:y,addToRenderList:m,dispose:T}}function $f(i,t){let e=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},s=f(null),r=s,a=!1;function o(v,C,F,k,H){let q=!1,W=d(k,F,C);r!==W&&(r=W,l(r.object)),q=p(v,k,F,H),q&&_(v,k,F,H),H!==null&&t.update(H,i.ELEMENT_ARRAY_BUFFER),(q||a)&&(a=!1,S(v,C,F,k),H!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t.get(H).buffer))}function c(){return i.createVertexArray()}function l(v){return i.bindVertexArray(v)}function h(v){return i.deleteVertexArray(v)}function d(v,C,F){let k=F.wireframe===!0,H=n[v.id];H===void 0&&(H={},n[v.id]=H);let q=H[C.id];q===void 0&&(q={},H[C.id]=q);let W=q[k];return W===void 0&&(W=f(c()),q[k]=W),W}function f(v){let C=[],F=[],k=[];for(let H=0;H=0){let ct=H[V],St=q[V];if(St===void 0&&(V==="instanceMatrix"&&v.instanceMatrix&&(St=v.instanceMatrix),V==="instanceColor"&&v.instanceColor&&(St=v.instanceColor)),ct===void 0||ct.attribute!==St||St&&ct.data!==St.data)return!0;W++}return r.attributesNum!==W||r.index!==k}function _(v,C,F,k){let H={},q=C.attributes,W=0,et=F.getAttributes();for(let V in et)if(et[V].location>=0){let ct=q[V];ct===void 0&&(V==="instanceMatrix"&&v.instanceMatrix&&(ct=v.instanceMatrix),V==="instanceColor"&&v.instanceColor&&(ct=v.instanceColor));let St={};St.attribute=ct,ct&&ct.data&&(St.data=ct.data),H[V]=St,W++}r.attributes=H,r.attributesNum=W,r.index=k}function y(){let v=r.newAttributes;for(let C=0,F=v.length;C=0){let rt=H[et];if(rt===void 0&&(et==="instanceMatrix"&&v.instanceMatrix&&(rt=v.instanceMatrix),et==="instanceColor"&&v.instanceColor&&(rt=v.instanceColor)),rt!==void 0){let ct=rt.normalized,St=rt.itemSize,kt=t.get(rt);if(kt===void 0)continue;let jt=kt.buffer,ne=kt.type,Xt=kt.bytesPerElement,Y=ne===i.INT||ne===i.UNSIGNED_INT||rt.gpuType===Vr;if(rt.isInterleavedBufferAttribute){let $=rt.data,dt=$.stride,It=rt.offset;if($.isInstancedInterleavedBuffer){for(let Mt=0;Mt0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let l=e.precision!==void 0?e.precision:"highp",h=c(l);h!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",h,"instead."),l=h);let d=e.logarithmicDepthBuffer===!0,f=e.reversedDepthBuffer===!0&&t.has("EXT_clip_control"),p=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),_=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),y=i.getParameter(i.MAX_TEXTURE_SIZE),m=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),u=i.getParameter(i.MAX_VERTEX_ATTRIBS),T=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),E=i.getParameter(i.MAX_VARYING_VECTORS),S=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),R=_>0,A=i.getParameter(i.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:c,textureFormatReadable:a,textureTypeReadable:o,precision:l,logarithmicDepthBuffer:d,reversedDepthBuffer:f,maxTextures:p,maxVertexTextures:_,maxTextureSize:y,maxCubemapSize:m,maxAttributes:u,maxVertexUniforms:T,maxVaryings:E,maxFragmentUniforms:S,vertexTextures:R,maxSamples:A}}function Qf(i){let t=this,e=null,n=0,s=!1,r=!1,a=new qe,o=new Ut,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){let p=d.length!==0||f||n!==0||s;return s=f,n=d.length,p},this.beginShadows=function(){r=!0,h(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(d,f){e=h(d,f,0)},this.setState=function(d,f,p){let _=d.clippingPlanes,y=d.clipIntersection,m=d.clipShadows,u=i.get(d);if(!s||_===null||_.length===0||r&&!m)r?h(null):l();else{let T=r?0:n,E=T*4,S=u.clippingState||null;c.value=S,S=h(_,f,E,p);for(let R=0;R!==E;++R)S[R]=e[R];u.clippingState=S,this.numIntersection=y?this.numPlanes:0,this.numPlanes+=T}};function l(){c.value!==e&&(c.value=e,c.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(d,f,p,_){let y=d!==null?d.length:0,m=null;if(y!==0){if(m=c.value,_!==!0||m===null){let u=p+y*4,T=f.matrixWorldInverse;o.getNormalMatrix(T),(m===null||m.length0){let l=new fr(c.height);return l.fromEquirectangularTexture(i,a),t.set(a,l),a.addEventListener("dispose",s),e(l.texture,a.mapping)}else return null}}return a}function s(a){let o=a.target;o.removeEventListener("dispose",s);let c=t.get(o);c!==void 0&&(t.delete(o),c.dispose())}function r(){t=new WeakMap}return{get:n,dispose:r}}var qi=4,Cc=[.125,.215,.35,.446,.526,.582],pi=20,Oo=new Ts,Ic=new Ot,Bo=null,zo=0,ko=0,Vo=!1,fi=(1+Math.sqrt(5))/2,Xi=1/fi,Pc=[new L(-fi,Xi,0),new L(fi,Xi,0),new L(-Xi,0,fi),new L(Xi,0,fi),new L(0,fi,-Xi),new L(0,fi,Xi),new L(-1,1,-1),new L(1,1,-1),new L(-1,1,1),new L(1,1,1)],ep=new L,Ea=class{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,s=100,r={}){let{size:a=256,position:o=ep}=r;Bo=this._renderer.getRenderTarget(),zo=this._renderer.getActiveCubeFace(),ko=this._renderer.getActiveMipmapLevel(),Vo=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let c=this._allocateTargets();return c.depthBuffer=!0,this._sceneToCubeUV(t,n,s,c,o),e>0&&this._blur(c,0,0,e),this._applyPMREM(c),this._cleanup(c),c}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Uc(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Lc(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?R:0,R,R),d.setRenderTarget(s),u&&d.render(m,c),d.render(t,c)}m.geometry.dispose(),m.material.dispose(),d.toneMapping=p,d.autoClear=f,t.background=T}_textureToCubeUV(t,e){let n=this._renderer,s=t.mapping===li||t.mapping===ci;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=Uc()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Lc());let r=s?this._cubemapMaterial:this._equirectMaterial,a=new Pe(this._lodPlanes[0],r),o=r.uniforms;o.envMap.value=t;let c=this._cubeSize;Sa(e,0,0,3*c,2*c),n.setRenderTarget(e),n.render(a,Oo)}_applyPMREM(t){let e=this._renderer,n=e.autoClear;e.autoClear=!1;let s=this._lodPlanes.length;for(let r=1;rpi&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${pi}`);let u=[],T=0;for(let P=0;PE-qi?s-E+qi:0),A=4*(this._cubeSize-S);Sa(e,R,A,3*S,2*S),c.setRenderTarget(e),c.render(d,Oo)}};function np(i){let t=[],e=[],n=[],s=i,r=i-qi+1+Cc.length;for(let a=0;ai-qi?c=Cc[a-i+qi-1]:a===0&&(c=0),n.push(c);let l=1/(o-2),h=-l,d=1+l,f=[h,h,d,h,d,d,h,h,d,d,h,d],p=6,_=6,y=3,m=2,u=1,T=new Float32Array(y*_*p),E=new Float32Array(m*_*p),S=new Float32Array(u*_*p);for(let A=0;A2?0:-1,M=[P,N,0,P+2/3,N,0,P+2/3,N+1,0,P,N,0,P+2/3,N+1,0,P,N+1,0];T.set(M,y*_*A),E.set(f,m*_*A);let v=[A,A,A,A,A,A];S.set(v,u*_*A)}let R=new Ie;R.setAttribute("position",new Te(T,y)),R.setAttribute("uv",new Te(E,m)),R.setAttribute("faceIndex",new Te(S,u)),t.push(R),s>qi&&s--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function Dc(i,t,e){let n=new cn(i,t,e);return n.texture.mapping=Rs,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Sa(i,t,e,n,s){i.viewport.set(t,e,n,s),i.scissor.set(t,e,n,s)}function ip(i,t,e){let n=new Float32Array(pi),s=new L(0,1,0);return new nn({name:"SphericalGaussianBlur",defines:{n:pi,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:Ko(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:Tn,depthTest:!1,depthWrite:!1})}function Lc(){return new nn({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Ko(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:Tn,depthTest:!1,depthWrite:!1})}function Uc(){return new nn({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ko(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:Tn,depthTest:!1,depthWrite:!1})}function Ko(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function sp(i){let t=new WeakMap,e=null;function n(o){if(o&&o.isTexture){let c=o.mapping,l=c===Br||c===zr,h=c===li||c===ci;if(l||h){let d=t.get(o),f=d!==void 0?d.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==f)return e===null&&(e=new Ea(i)),d=l?e.fromEquirectangular(o,d):e.fromCubemap(o,d),d.texture.pmremVersion=o.pmremVersion,t.set(o,d),d.texture;if(d!==void 0)return d.texture;{let p=o.image;return l&&p&&p.height>0||h&&p&&s(p)?(e===null&&(e=new Ea(i)),d=l?e.fromEquirectangular(o):e.fromCubemap(o),d.texture.pmremVersion=o.pmremVersion,t.set(o,d),o.addEventListener("dispose",r),d.texture):null}}}return o}function s(o){let c=0,l=6;for(let h=0;ht.maxTextureSize&&(R=Math.ceil(S/t.maxTextureSize),S=t.maxTextureSize);let A=new Float32Array(S*R*4*d),P=new cs(A,S,R,d);P.type=dn,P.needsUpdate=!0;let N=E*4;for(let v=0;v0)return i;let s=t*e,r=Fc[s];if(r===void 0&&(r=new Float32Array(s),Fc[s]=r),t!==0){n.toArray(r,0);for(let a=1,o=0;a!==t;++a)o+=e,i[a].toArray(r,o)}return r}function fe(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e":" "} ${o}: ${e[a]}`)}return n.join(` +`)}var Gc=new Ut;function em(i){Gt._getMatrix(Gc,Gt.workingColorSpace,i);let t=`mat3( ${Gc.elements.map(e=>e.toFixed(4))} )`;switch(Gt.getTransfer(i)){case as:return[t,"LinearTransferOETF"];case Yt:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",i),[t,"LinearTransferOETF"]}}function Wc(i,t,e){let n=i.getShaderParameter(t,i.COMPILE_STATUS),r=(i.getShaderInfoLog(t)||"").trim();if(n&&r==="")return"";let a=/ERROR: 0:(\d+)/.exec(r);if(a){let o=parseInt(a[1]);return e.toUpperCase()+` + +`+r+` + +`+tm(i.getShaderSource(t),o)}else return r}function nm(i,t){let e=em(t);return[`vec4 ${i}( vec4 value ) {`,` return ${e[1]}( vec4( value.rgb * ${e[0]}, value.a ) );`,"}"].join(` +`)}function im(i,t){let e;switch(t){case oc:e="Linear";break;case lc:e="Reinhard";break;case cc:e="Cineon";break;case Or:e="ACESFilmic";break;case uc:e="AgX";break;case dc:e="Neutral";break;case hc:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+i+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}var ba=new L;function sm(){Gt.getLuminanceCoefficients(ba);let i=ba.x.toFixed(4),t=ba.y.toFixed(4),e=ba.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${i}, ${t}, ${e} );`," return dot( weights, rgb );","}"].join(` +`)}function rm(i){return[i.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",i.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Us).join(` +`)}function am(i){let t=[];for(let e in i){let n=i[e];n!==!1&&t.push("#define "+e+" "+n)}return t.join(` +`)}function om(i,t){let e={},n=i.getProgramParameter(t,i.ACTIVE_ATTRIBUTES);for(let s=0;s/gm;function qo(i){return i.replace(lm,hm)}var cm=new Map;function hm(i,t){let e=Bt[t];if(e===void 0){let n=cm.get(t);if(n!==void 0)e=Bt[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,n);else throw new Error("Can not resolve #include <"+t+">")}return qo(e)}var um=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Yc(i){return i.replace(um,dm)}function dm(i,t,e,n){let s="";for(let r=parseInt(t);r0&&(m+=` +`),u=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_].filter(Us).join(` +`),u.length>0&&(u+=` +`)):(m=[Zc(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.batchingColor?"#define USE_BATCHING_COLOR":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+h:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+c:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",e.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(Us).join(` +`),u=[Zc(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+l:"",e.envMap?"#define "+h:"",e.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor||e.batchingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+c:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",e.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",e.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==wn?"#define TONE_MAPPING":"",e.toneMapping!==wn?Bt.tonemapping_pars_fragment:"",e.toneMapping!==wn?im("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",Bt.colorspace_pars_fragment,nm("linearToOutputTexel",e.outputColorSpace),sm(),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",` +`].filter(Us).join(` +`)),a=qo(a),a=Xc(a,e),a=qc(a,e),o=qo(o),o=Xc(o,e),o=qc(o,e),a=Yc(a),o=Yc(o),e.isRawShaderMaterial!==!0&&(T=`#version 300 es +`,m=[p,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+m,u=["#define varying in",e.glslVersion===Co?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===Co?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`)+` +`+u);let E=T+m+a,S=T+u+o,R=Hc(s,s.VERTEX_SHADER,E),A=Hc(s,s.FRAGMENT_SHADER,S);s.attachShader(y,R),s.attachShader(y,A),e.index0AttributeName!==void 0?s.bindAttribLocation(y,0,e.index0AttributeName):e.morphTargets===!0&&s.bindAttribLocation(y,0,"position"),s.linkProgram(y);function P(C){if(i.debug.checkShaderErrors){let F=s.getProgramInfoLog(y)||"",k=s.getShaderInfoLog(R)||"",H=s.getShaderInfoLog(A)||"",q=F.trim(),W=k.trim(),et=H.trim(),V=!0,rt=!0;if(s.getProgramParameter(y,s.LINK_STATUS)===!1)if(V=!1,typeof i.debug.onShaderError=="function")i.debug.onShaderError(s,y,R,A);else{let ct=Wc(s,R,"vertex"),St=Wc(s,A,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(y,s.VALIDATE_STATUS)+` + +Material Name: `+C.name+` +Material Type: `+C.type+` + +Program Info Log: `+q+` +`+ct+` +`+St)}else q!==""?console.warn("THREE.WebGLProgram: Program Info Log:",q):(W===""||et==="")&&(rt=!1);rt&&(C.diagnostics={runnable:V,programLog:q,vertexShader:{log:W,prefix:m},fragmentShader:{log:et,prefix:u}})}s.deleteShader(R),s.deleteShader(A),N=new Yi(s,y),M=om(s,y)}let N;this.getUniforms=function(){return N===void 0&&P(this),N};let M;this.getAttributes=function(){return M===void 0&&P(this),M};let v=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return v===!1&&(v=s.getProgramParameter(y,jp)),v},this.destroy=function(){n.releaseStatesOfProgram(this),s.deleteProgram(y),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=Qp++,this.cacheKey=t,this.usedTimes=1,this.program=y,this.vertexShader=R,this.fragmentShader=A,this}var ym=0,Yo=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){let e=t.vertexShader,n=t.fragmentShader,s=this._getShaderStage(e),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(t);return a.has(s)===!1&&(a.add(s),s.usedTimes++),a.has(r)===!1&&(a.add(r),r.usedTimes++),this}remove(t){let e=this.materialCache.get(t);for(let n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){let e=this.materialCache,n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){let e=this.shaderCache,n=e.get(t);return n===void 0&&(n=new Zo(t),e.set(t,n)),n}},Zo=class{constructor(t){this.id=ym++,this.code=t,this.usedTimes=0}};function vm(i,t,e,n,s,r,a){let o=new hs,c=new Yo,l=new Set,h=[],d=s.logarithmicDepthBuffer,f=s.vertexTextures,p=s.precision,_={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function y(M){return l.add(M),M===0?"uv":`uv${M}`}function m(M,v,C,F,k){let H=F.fog,q=k.geometry,W=M.isMeshStandardMaterial?F.environment:null,et=(M.isMeshStandardMaterial?e:t).get(M.envMap||W),V=et&&et.mapping===Rs?et.image.height:null,rt=_[M.type];M.precision!==null&&(p=s.getMaxPrecision(M.precision),p!==M.precision&&console.warn("THREE.WebGLProgram.getParameters:",M.precision,"not supported, using",p,"instead."));let ct=q.morphAttributes.position||q.morphAttributes.normal||q.morphAttributes.color,St=ct!==void 0?ct.length:0,kt=0;q.morphAttributes.position!==void 0&&(kt=1),q.morphAttributes.normal!==void 0&&(kt=2),q.morphAttributes.color!==void 0&&(kt=3);let jt,ne,Xt,Y;if(rt){let qt=fn[rt];jt=qt.vertexShader,ne=qt.fragmentShader}else jt=M.vertexShader,ne=M.fragmentShader,c.update(M),Xt=c.getVertexShaderID(M),Y=c.getFragmentShaderID(M);let $=i.getRenderTarget(),dt=i.state.buffers.depth.getReversed(),It=k.isInstancedMesh===!0,Mt=k.isBatchedMesh===!0,Ht=!!M.map,Me=!!M.matcap,w=!!et,ie=!!M.aoMap,Lt=!!M.lightMap,Rt=!!M.bumpMap,mt=!!M.normalMap,se=!!M.displacementMap,gt=!!M.emissiveMap,Ft=!!M.metalnessMap,_e=!!M.roughnessMap,ue=M.anisotropy>0,b=M.clearcoat>0,g=M.dispersion>0,O=M.iridescence>0,X=M.sheen>0,J=M.transmission>0,G=ue&&!!M.anisotropyMap,vt=b&&!!M.clearcoatMap,nt=b&&!!M.clearcoatNormalMap,_t=b&&!!M.clearcoatRoughnessMap,xt=O&&!!M.iridescenceMap,Q=O&&!!M.iridescenceThicknessMap,lt=X&&!!M.sheenColorMap,At=X&&!!M.sheenRoughnessMap,yt=!!M.specularMap,at=!!M.specularColorMap,Nt=!!M.specularIntensityMap,I=J&&!!M.transmissionMap,tt=J&&!!M.thicknessMap,it=!!M.gradientMap,ut=!!M.alphaMap,K=M.alphaTest>0,Z=!!M.alphaHash,pt=!!M.extensions,Dt=wn;M.toneMapped&&($===null||$.isXRRenderTarget===!0)&&(Dt=i.toneMapping);let Qt={shaderID:rt,shaderType:M.type,shaderName:M.name,vertexShader:jt,fragmentShader:ne,defines:M.defines,customVertexShaderID:Xt,customFragmentShaderID:Y,isRawShaderMaterial:M.isRawShaderMaterial===!0,glslVersion:M.glslVersion,precision:p,batching:Mt,batchingColor:Mt&&k._colorsTexture!==null,instancing:It,instancingColor:It&&k.instanceColor!==null,instancingMorph:It&&k.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:$===null?i.outputColorSpace:$.isXRRenderTarget===!0?$.texture.colorSpace:bn,alphaToCoverage:!!M.alphaToCoverage,map:Ht,matcap:Me,envMap:w,envMapMode:w&&et.mapping,envMapCubeUVHeight:V,aoMap:ie,lightMap:Lt,bumpMap:Rt,normalMap:mt,displacementMap:f&&se,emissiveMap:gt,normalMapObjectSpace:mt&&M.normalMapType===gc,normalMapTangentSpace:mt&&M.normalMapType===Ao,metalnessMap:Ft,roughnessMap:_e,anisotropy:ue,anisotropyMap:G,clearcoat:b,clearcoatMap:vt,clearcoatNormalMap:nt,clearcoatRoughnessMap:_t,dispersion:g,iridescence:O,iridescenceMap:xt,iridescenceThicknessMap:Q,sheen:X,sheenColorMap:lt,sheenRoughnessMap:At,specularMap:yt,specularColorMap:at,specularIntensityMap:Nt,transmission:J,transmissionMap:I,thicknessMap:tt,gradientMap:it,opaque:M.transparent===!1&&M.blending===ni&&M.alphaToCoverage===!1,alphaMap:ut,alphaTest:K,alphaHash:Z,combine:M.combine,mapUv:Ht&&y(M.map.channel),aoMapUv:ie&&y(M.aoMap.channel),lightMapUv:Lt&&y(M.lightMap.channel),bumpMapUv:Rt&&y(M.bumpMap.channel),normalMapUv:mt&&y(M.normalMap.channel),displacementMapUv:se&&y(M.displacementMap.channel),emissiveMapUv:gt&&y(M.emissiveMap.channel),metalnessMapUv:Ft&&y(M.metalnessMap.channel),roughnessMapUv:_e&&y(M.roughnessMap.channel),anisotropyMapUv:G&&y(M.anisotropyMap.channel),clearcoatMapUv:vt&&y(M.clearcoatMap.channel),clearcoatNormalMapUv:nt&&y(M.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:_t&&y(M.clearcoatRoughnessMap.channel),iridescenceMapUv:xt&&y(M.iridescenceMap.channel),iridescenceThicknessMapUv:Q&&y(M.iridescenceThicknessMap.channel),sheenColorMapUv:lt&&y(M.sheenColorMap.channel),sheenRoughnessMapUv:At&&y(M.sheenRoughnessMap.channel),specularMapUv:yt&&y(M.specularMap.channel),specularColorMapUv:at&&y(M.specularColorMap.channel),specularIntensityMapUv:Nt&&y(M.specularIntensityMap.channel),transmissionMapUv:I&&y(M.transmissionMap.channel),thicknessMapUv:tt&&y(M.thicknessMap.channel),alphaMapUv:ut&&y(M.alphaMap.channel),vertexTangents:!!q.attributes.tangent&&(mt||ue),vertexColors:M.vertexColors,vertexAlphas:M.vertexColors===!0&&!!q.attributes.color&&q.attributes.color.itemSize===4,pointsUvs:k.isPoints===!0&&!!q.attributes.uv&&(Ht||ut),fog:!!H,useFog:M.fog===!0,fogExp2:!!H&&H.isFogExp2,flatShading:M.flatShading===!0&&M.wireframe===!1,sizeAttenuation:M.sizeAttenuation===!0,logarithmicDepthBuffer:d,reversedDepthBuffer:dt,skinning:k.isSkinnedMesh===!0,morphTargets:q.morphAttributes.position!==void 0,morphNormals:q.morphAttributes.normal!==void 0,morphColors:q.morphAttributes.color!==void 0,morphTargetsCount:St,morphTextureStride:kt,numDirLights:v.directional.length,numPointLights:v.point.length,numSpotLights:v.spot.length,numSpotLightMaps:v.spotLightMap.length,numRectAreaLights:v.rectArea.length,numHemiLights:v.hemi.length,numDirLightShadows:v.directionalShadowMap.length,numPointLightShadows:v.pointShadowMap.length,numSpotLightShadows:v.spotShadowMap.length,numSpotLightShadowsWithMaps:v.numSpotLightShadowsWithMaps,numLightProbes:v.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:M.dithering,shadowMapEnabled:i.shadowMap.enabled&&C.length>0,shadowMapType:i.shadowMap.type,toneMapping:Dt,decodeVideoTexture:Ht&&M.map.isVideoTexture===!0&&Gt.getTransfer(M.map.colorSpace)===Yt,decodeVideoTextureEmissive:gt&&M.emissiveMap.isVideoTexture===!0&&Gt.getTransfer(M.emissiveMap.colorSpace)===Yt,premultipliedAlpha:M.premultipliedAlpha,doubleSided:M.side===Ve,flipSided:M.side===De,useDepthPacking:M.depthPacking>=0,depthPacking:M.depthPacking||0,index0AttributeName:M.index0AttributeName,extensionClipCullDistance:pt&&M.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(pt&&M.extensions.multiDraw===!0||Mt)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:M.customProgramCacheKey()};return Qt.vertexUv1s=l.has(1),Qt.vertexUv2s=l.has(2),Qt.vertexUv3s=l.has(3),l.clear(),Qt}function u(M){let v=[];if(M.shaderID?v.push(M.shaderID):(v.push(M.customVertexShaderID),v.push(M.customFragmentShaderID)),M.defines!==void 0)for(let C in M.defines)v.push(C),v.push(M.defines[C]);return M.isRawShaderMaterial===!1&&(T(v,M),E(v,M),v.push(i.outputColorSpace)),v.push(M.customProgramCacheKey),v.join()}function T(M,v){M.push(v.precision),M.push(v.outputColorSpace),M.push(v.envMapMode),M.push(v.envMapCubeUVHeight),M.push(v.mapUv),M.push(v.alphaMapUv),M.push(v.lightMapUv),M.push(v.aoMapUv),M.push(v.bumpMapUv),M.push(v.normalMapUv),M.push(v.displacementMapUv),M.push(v.emissiveMapUv),M.push(v.metalnessMapUv),M.push(v.roughnessMapUv),M.push(v.anisotropyMapUv),M.push(v.clearcoatMapUv),M.push(v.clearcoatNormalMapUv),M.push(v.clearcoatRoughnessMapUv),M.push(v.iridescenceMapUv),M.push(v.iridescenceThicknessMapUv),M.push(v.sheenColorMapUv),M.push(v.sheenRoughnessMapUv),M.push(v.specularMapUv),M.push(v.specularColorMapUv),M.push(v.specularIntensityMapUv),M.push(v.transmissionMapUv),M.push(v.thicknessMapUv),M.push(v.combine),M.push(v.fogExp2),M.push(v.sizeAttenuation),M.push(v.morphTargetsCount),M.push(v.morphAttributeCount),M.push(v.numDirLights),M.push(v.numPointLights),M.push(v.numSpotLights),M.push(v.numSpotLightMaps),M.push(v.numHemiLights),M.push(v.numRectAreaLights),M.push(v.numDirLightShadows),M.push(v.numPointLightShadows),M.push(v.numSpotLightShadows),M.push(v.numSpotLightShadowsWithMaps),M.push(v.numLightProbes),M.push(v.shadowMapType),M.push(v.toneMapping),M.push(v.numClippingPlanes),M.push(v.numClipIntersection),M.push(v.depthPacking)}function E(M,v){o.disableAll(),v.supportsVertexTextures&&o.enable(0),v.instancing&&o.enable(1),v.instancingColor&&o.enable(2),v.instancingMorph&&o.enable(3),v.matcap&&o.enable(4),v.envMap&&o.enable(5),v.normalMapObjectSpace&&o.enable(6),v.normalMapTangentSpace&&o.enable(7),v.clearcoat&&o.enable(8),v.iridescence&&o.enable(9),v.alphaTest&&o.enable(10),v.vertexColors&&o.enable(11),v.vertexAlphas&&o.enable(12),v.vertexUv1s&&o.enable(13),v.vertexUv2s&&o.enable(14),v.vertexUv3s&&o.enable(15),v.vertexTangents&&o.enable(16),v.anisotropy&&o.enable(17),v.alphaHash&&o.enable(18),v.batching&&o.enable(19),v.dispersion&&o.enable(20),v.batchingColor&&o.enable(21),v.gradientMap&&o.enable(22),M.push(o.mask),o.disableAll(),v.fog&&o.enable(0),v.useFog&&o.enable(1),v.flatShading&&o.enable(2),v.logarithmicDepthBuffer&&o.enable(3),v.reversedDepthBuffer&&o.enable(4),v.skinning&&o.enable(5),v.morphTargets&&o.enable(6),v.morphNormals&&o.enable(7),v.morphColors&&o.enable(8),v.premultipliedAlpha&&o.enable(9),v.shadowMapEnabled&&o.enable(10),v.doubleSided&&o.enable(11),v.flipSided&&o.enable(12),v.useDepthPacking&&o.enable(13),v.dithering&&o.enable(14),v.transmission&&o.enable(15),v.sheen&&o.enable(16),v.opaque&&o.enable(17),v.pointsUvs&&o.enable(18),v.decodeVideoTexture&&o.enable(19),v.decodeVideoTextureEmissive&&o.enable(20),v.alphaToCoverage&&o.enable(21),M.push(o.mask)}function S(M){let v=_[M.type],C;if(v){let F=fn[v];C=Ac.clone(F.uniforms)}else C=M.uniforms;return C}function R(M,v){let C;for(let F=0,k=h.length;F0?n.push(u):p.transparent===!0?s.push(u):e.push(u)}function c(d,f,p,_,y,m){let u=a(d,f,p,_,y,m);p.transmission>0?n.unshift(u):p.transparent===!0?s.unshift(u):e.unshift(u)}function l(d,f){e.length>1&&e.sort(d||Sm),n.length>1&&n.sort(f||Jc),s.length>1&&s.sort(f||Jc)}function h(){for(let d=t,f=i.length;d=r.length?(a=new $c,r.push(a)):a=r[s],a}function e(){i=new WeakMap}return{get:t,dispose:e}}function Em(){let i={};return{get:function(t){if(i[t.id]!==void 0)return i[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new L,color:new Ot};break;case"SpotLight":e={position:new L,direction:new L,color:new Ot,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new L,color:new Ot,distance:0,decay:0};break;case"HemisphereLight":e={direction:new L,skyColor:new Ot,groundColor:new Ot};break;case"RectAreaLight":e={color:new Ot,position:new L,halfWidth:new L,halfHeight:new L};break}return i[t.id]=e,e}}}function Tm(){let i={};return{get:function(t){if(i[t.id]!==void 0)return i[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Pt};break;case"SpotLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Pt};break;case"PointLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Pt,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[t.id]=e,e}}}var wm=0;function Am(i,t){return(t.castShadow?2:0)-(i.castShadow?2:0)+(t.map?1:0)-(i.map?1:0)}function Rm(i){let t=new Em,e=Tm(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let l=0;l<9;l++)n.probe.push(new L);let s=new L,r=new he,a=new he;function o(l){let h=0,d=0,f=0;for(let M=0;M<9;M++)n.probe[M].set(0,0,0);let p=0,_=0,y=0,m=0,u=0,T=0,E=0,S=0,R=0,A=0,P=0;l.sort(Am);for(let M=0,v=l.length;M0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=st.LTC_FLOAT_1,n.rectAreaLTC2=st.LTC_FLOAT_2):(n.rectAreaLTC1=st.LTC_HALF_1,n.rectAreaLTC2=st.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=d,n.ambient[2]=f;let N=n.hash;(N.directionalLength!==p||N.pointLength!==_||N.spotLength!==y||N.rectAreaLength!==m||N.hemiLength!==u||N.numDirectionalShadows!==T||N.numPointShadows!==E||N.numSpotShadows!==S||N.numSpotMaps!==R||N.numLightProbes!==P)&&(n.directional.length=p,n.spot.length=y,n.rectArea.length=m,n.point.length=_,n.hemi.length=u,n.directionalShadow.length=T,n.directionalShadowMap.length=T,n.pointShadow.length=E,n.pointShadowMap.length=E,n.spotShadow.length=S,n.spotShadowMap.length=S,n.directionalShadowMatrix.length=T,n.pointShadowMatrix.length=E,n.spotLightMatrix.length=S+R-A,n.spotLightMap.length=R,n.numSpotLightShadowsWithMaps=A,n.numLightProbes=P,N.directionalLength=p,N.pointLength=_,N.spotLength=y,N.rectAreaLength=m,N.hemiLength=u,N.numDirectionalShadows=T,N.numPointShadows=E,N.numSpotShadows=S,N.numSpotMaps=R,N.numLightProbes=P,n.version=wm++)}function c(l,h){let d=0,f=0,p=0,_=0,y=0,m=h.matrixWorldInverse;for(let u=0,T=l.length;u=a.length?(o=new Kc(i),a.push(o)):o=a[r],o}function n(){t=new WeakMap}return{get:e,dispose:n}}var Im=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,Pm=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function Dm(i,t,e){let n=new Fi,s=new Pt,r=new Pt,a=new le,o=new xr({depthPacking:mc}),c=new yr,l={},h=e.maxTextureSize,d={[Sn]:De,[De]:Sn,[Ve]:Ve},f=new nn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Pt},radius:{value:4}},vertexShader:Im,fragmentShader:Pm}),p=f.clone();p.defines.HORIZONTAL_PASS=1;let _=new Ie;_.setAttribute("position",new Te(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let y=new Pe(_,f),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=fo;let u=this.type;this.render=function(A,P,N){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||A.length===0)return;let M=i.getRenderTarget(),v=i.getActiveCubeFace(),C=i.getActiveMipmapLevel(),F=i.state;F.setBlending(Tn),F.buffers.depth.getReversed()===!0?F.buffers.color.setClear(0,0,0,0):F.buffers.color.setClear(1,1,1,1),F.buffers.depth.setTest(!0),F.setScissorTest(!1);let k=u!==un&&this.type===un,H=u===un&&this.type!==un;for(let q=0,W=A.length;qh||s.y>h)&&(s.x>h&&(r.x=Math.floor(h/rt.x),s.x=r.x*rt.x,V.mapSize.x=r.x),s.y>h&&(r.y=Math.floor(h/rt.y),s.y=r.y*rt.y,V.mapSize.y=r.y)),V.map===null||k===!0||H===!0){let St=this.type!==un?{minFilter:Ye,magFilter:Ye}:{};V.map!==null&&V.map.dispose(),V.map=new cn(s.x,s.y,St),V.map.texture.name=et.name+".shadowMap",V.camera.updateProjectionMatrix()}i.setRenderTarget(V.map),i.clear();let ct=V.getViewportCount();for(let St=0;St0||P.map&&P.alphaTest>0||P.alphaToCoverage===!0){let F=v.uuid,k=P.uuid,H=l[F];H===void 0&&(H={},l[F]=H);let q=H[k];q===void 0&&(q=v.clone(),H[k]=q,P.addEventListener("dispose",R)),v=q}if(v.visible=P.visible,v.wireframe=P.wireframe,M===un?v.side=P.shadowSide!==null?P.shadowSide:P.side:v.side=P.shadowSide!==null?P.shadowSide:d[P.side],v.alphaMap=P.alphaMap,v.alphaTest=P.alphaToCoverage===!0?.5:P.alphaTest,v.map=P.map,v.clipShadows=P.clipShadows,v.clippingPlanes=P.clippingPlanes,v.clipIntersection=P.clipIntersection,v.displacementMap=P.displacementMap,v.displacementScale=P.displacementScale,v.displacementBias=P.displacementBias,v.wireframeLinewidth=P.wireframeLinewidth,v.linewidth=P.linewidth,N.isPointLight===!0&&v.isMeshDistanceMaterial===!0){let F=i.properties.get(v);F.light=N}return v}function S(A,P,N,M,v){if(A.visible===!1)return;if(A.layers.test(P.layers)&&(A.isMesh||A.isLine||A.isPoints)&&(A.castShadow||A.receiveShadow&&v===un)&&(!A.frustumCulled||n.intersectsObject(A))){A.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,A.matrixWorld);let k=t.update(A),H=A.material;if(Array.isArray(H)){let q=k.groups;for(let W=0,et=q.length;W=1):V.indexOf("OpenGL ES")!==-1&&(et=parseFloat(/^OpenGL ES (\d)/.exec(V)[1]),W=et>=2);let rt=null,ct={},St=i.getParameter(i.SCISSOR_BOX),kt=i.getParameter(i.VIEWPORT),jt=new le().fromArray(St),ne=new le().fromArray(kt);function Xt(I,tt,it,ut){let K=new Uint8Array(4),Z=i.createTexture();i.bindTexture(I,Z),i.texParameteri(I,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(I,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let pt=0;pt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),l=new Pt,h=new WeakMap,d,f=new WeakMap,p=!1;try{p=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(b,g){return p?new OffscreenCanvas(b,g):ls("canvas")}function y(b,g,O){let X=1,J=ue(b);if((J.width>O||J.height>O)&&(X=O/Math.max(J.width,J.height)),X<1)if(typeof HTMLImageElement<"u"&&b instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&b instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&b instanceof ImageBitmap||typeof VideoFrame<"u"&&b instanceof VideoFrame){let G=Math.floor(X*J.width),vt=Math.floor(X*J.height);d===void 0&&(d=_(G,vt));let nt=g?_(G,vt):d;return nt.width=G,nt.height=vt,nt.getContext("2d").drawImage(b,0,0,G,vt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+J.width+"x"+J.height+") to ("+G+"x"+vt+")."),nt}else return"data"in b&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+J.width+"x"+J.height+")."),b;return b}function m(b){return b.generateMipmaps}function u(b){i.generateMipmap(b)}function T(b){return b.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:b.isWebGL3DRenderTarget?i.TEXTURE_3D:b.isWebGLArrayRenderTarget||b.isCompressedArrayTexture?i.TEXTURE_2D_ARRAY:i.TEXTURE_2D}function E(b,g,O,X,J=!1){if(b!==null){if(i[b]!==void 0)return i[b];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+b+"'")}let G=g;if(g===i.RED&&(O===i.FLOAT&&(G=i.R32F),O===i.HALF_FLOAT&&(G=i.R16F),O===i.UNSIGNED_BYTE&&(G=i.R8)),g===i.RED_INTEGER&&(O===i.UNSIGNED_BYTE&&(G=i.R8UI),O===i.UNSIGNED_SHORT&&(G=i.R16UI),O===i.UNSIGNED_INT&&(G=i.R32UI),O===i.BYTE&&(G=i.R8I),O===i.SHORT&&(G=i.R16I),O===i.INT&&(G=i.R32I)),g===i.RG&&(O===i.FLOAT&&(G=i.RG32F),O===i.HALF_FLOAT&&(G=i.RG16F),O===i.UNSIGNED_BYTE&&(G=i.RG8)),g===i.RG_INTEGER&&(O===i.UNSIGNED_BYTE&&(G=i.RG8UI),O===i.UNSIGNED_SHORT&&(G=i.RG16UI),O===i.UNSIGNED_INT&&(G=i.RG32UI),O===i.BYTE&&(G=i.RG8I),O===i.SHORT&&(G=i.RG16I),O===i.INT&&(G=i.RG32I)),g===i.RGB_INTEGER&&(O===i.UNSIGNED_BYTE&&(G=i.RGB8UI),O===i.UNSIGNED_SHORT&&(G=i.RGB16UI),O===i.UNSIGNED_INT&&(G=i.RGB32UI),O===i.BYTE&&(G=i.RGB8I),O===i.SHORT&&(G=i.RGB16I),O===i.INT&&(G=i.RGB32I)),g===i.RGBA_INTEGER&&(O===i.UNSIGNED_BYTE&&(G=i.RGBA8UI),O===i.UNSIGNED_SHORT&&(G=i.RGBA16UI),O===i.UNSIGNED_INT&&(G=i.RGBA32UI),O===i.BYTE&&(G=i.RGBA8I),O===i.SHORT&&(G=i.RGBA16I),O===i.INT&&(G=i.RGBA32I)),g===i.RGB&&(O===i.UNSIGNED_INT_5_9_9_9_REV&&(G=i.RGB9_E5),O===i.UNSIGNED_INT_10F_11F_11F_REV&&(G=i.R11F_G11F_B10F)),g===i.RGBA){let vt=J?as:Gt.getTransfer(X);O===i.FLOAT&&(G=i.RGBA32F),O===i.HALF_FLOAT&&(G=i.RGBA16F),O===i.UNSIGNED_BYTE&&(G=vt===Yt?i.SRGB8_ALPHA8:i.RGBA8),O===i.UNSIGNED_SHORT_4_4_4_4&&(G=i.RGBA4),O===i.UNSIGNED_SHORT_5_5_5_1&&(G=i.RGB5_A1)}return(G===i.R16F||G===i.R32F||G===i.RG16F||G===i.RG32F||G===i.RGBA16F||G===i.RGBA32F)&&t.get("EXT_color_buffer_float"),G}function S(b,g){let O;return b?g===null||g===Xn||g===Hi?O=i.DEPTH24_STENCIL8:g===dn?O=i.DEPTH32F_STENCIL8:g===ki&&(O=i.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):g===null||g===Xn||g===Hi?O=i.DEPTH_COMPONENT24:g===dn?O=i.DEPTH_COMPONENT32F:g===ki&&(O=i.DEPTH_COMPONENT16),O}function R(b,g){return m(b)===!0||b.isFramebufferTexture&&b.minFilter!==Ye&&b.minFilter!==tn?Math.log2(Math.max(g.width,g.height))+1:b.mipmaps!==void 0&&b.mipmaps.length>0?b.mipmaps.length:b.isCompressedTexture&&Array.isArray(b.image)?g.mipmaps.length:1}function A(b){let g=b.target;g.removeEventListener("dispose",A),N(g),g.isVideoTexture&&h.delete(g)}function P(b){let g=b.target;g.removeEventListener("dispose",P),v(g)}function N(b){let g=n.get(b);if(g.__webglInit===void 0)return;let O=b.source,X=f.get(O);if(X){let J=X[g.__cacheKey];J.usedTimes--,J.usedTimes===0&&M(b),Object.keys(X).length===0&&f.delete(O)}n.remove(b)}function M(b){let g=n.get(b);i.deleteTexture(g.__webglTexture);let O=b.source,X=f.get(O);delete X[g.__cacheKey],a.memory.textures--}function v(b){let g=n.get(b);if(b.depthTexture&&(b.depthTexture.dispose(),n.remove(b.depthTexture)),b.isWebGLCubeRenderTarget)for(let X=0;X<6;X++){if(Array.isArray(g.__webglFramebuffer[X]))for(let J=0;J=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+b+" texture units while this GPU supports only "+s.maxTextures),C+=1,b}function H(b){let g=[];return g.push(b.wrapS),g.push(b.wrapT),g.push(b.wrapR||0),g.push(b.magFilter),g.push(b.minFilter),g.push(b.anisotropy),g.push(b.internalFormat),g.push(b.format),g.push(b.type),g.push(b.generateMipmaps),g.push(b.premultiplyAlpha),g.push(b.flipY),g.push(b.unpackAlignment),g.push(b.colorSpace),g.join()}function q(b,g){let O=n.get(b);if(b.isVideoTexture&&Ft(b),b.isRenderTargetTexture===!1&&b.isExternalTexture!==!0&&b.version>0&&O.__version!==b.version){let X=b.image;if(X===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(X.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Y(O,b,g);return}}else b.isExternalTexture&&(O.__webglTexture=b.sourceTexture?b.sourceTexture:null);e.bindTexture(i.TEXTURE_2D,O.__webglTexture,i.TEXTURE0+g)}function W(b,g){let O=n.get(b);if(b.isRenderTargetTexture===!1&&b.version>0&&O.__version!==b.version){Y(O,b,g);return}e.bindTexture(i.TEXTURE_2D_ARRAY,O.__webglTexture,i.TEXTURE0+g)}function et(b,g){let O=n.get(b);if(b.isRenderTargetTexture===!1&&b.version>0&&O.__version!==b.version){Y(O,b,g);return}e.bindTexture(i.TEXTURE_3D,O.__webglTexture,i.TEXTURE0+g)}function V(b,g){let O=n.get(b);if(b.version>0&&O.__version!==b.version){$(O,b,g);return}e.bindTexture(i.TEXTURE_CUBE_MAP,O.__webglTexture,i.TEXTURE0+g)}let rt={[ar]:i.REPEAT,[Fn]:i.CLAMP_TO_EDGE,[or]:i.MIRRORED_REPEAT},ct={[Ye]:i.NEAREST,[fc]:i.NEAREST_MIPMAP_NEAREST,[Cs]:i.NEAREST_MIPMAP_LINEAR,[tn]:i.LINEAR,[kr]:i.LINEAR_MIPMAP_NEAREST,[Wn]:i.LINEAR_MIPMAP_LINEAR},St={[_c]:i.NEVER,[bc]:i.ALWAYS,[xc]:i.LESS,[Ro]:i.LEQUAL,[yc]:i.EQUAL,[Sc]:i.GEQUAL,[vc]:i.GREATER,[Mc]:i.NOTEQUAL};function kt(b,g){if(g.type===dn&&t.has("OES_texture_float_linear")===!1&&(g.magFilter===tn||g.magFilter===kr||g.magFilter===Cs||g.magFilter===Wn||g.minFilter===tn||g.minFilter===kr||g.minFilter===Cs||g.minFilter===Wn)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(b,i.TEXTURE_WRAP_S,rt[g.wrapS]),i.texParameteri(b,i.TEXTURE_WRAP_T,rt[g.wrapT]),(b===i.TEXTURE_3D||b===i.TEXTURE_2D_ARRAY)&&i.texParameteri(b,i.TEXTURE_WRAP_R,rt[g.wrapR]),i.texParameteri(b,i.TEXTURE_MAG_FILTER,ct[g.magFilter]),i.texParameteri(b,i.TEXTURE_MIN_FILTER,ct[g.minFilter]),g.compareFunction&&(i.texParameteri(b,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(b,i.TEXTURE_COMPARE_FUNC,St[g.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(g.magFilter===Ye||g.minFilter!==Cs&&g.minFilter!==Wn||g.type===dn&&t.has("OES_texture_float_linear")===!1)return;if(g.anisotropy>1||n.get(g).__currentAnisotropy){let O=t.get("EXT_texture_filter_anisotropic");i.texParameterf(b,O.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(g.anisotropy,s.getMaxAnisotropy())),n.get(g).__currentAnisotropy=g.anisotropy}}}function jt(b,g){let O=!1;b.__webglInit===void 0&&(b.__webglInit=!0,g.addEventListener("dispose",A));let X=g.source,J=f.get(X);J===void 0&&(J={},f.set(X,J));let G=H(g);if(G!==b.__cacheKey){J[G]===void 0&&(J[G]={texture:i.createTexture(),usedTimes:0},a.memory.textures++,O=!0),J[G].usedTimes++;let vt=J[b.__cacheKey];vt!==void 0&&(J[b.__cacheKey].usedTimes--,vt.usedTimes===0&&M(g)),b.__cacheKey=G,b.__webglTexture=J[G].texture}return O}function ne(b,g,O){return Math.floor(Math.floor(b/O)/g)}function Xt(b,g,O,X){let G=b.updateRanges;if(G.length===0)e.texSubImage2D(i.TEXTURE_2D,0,0,0,g.width,g.height,O,X,g.data);else{G.sort((Q,lt)=>Q.start-lt.start);let vt=0;for(let Q=1;Q0){I&&tt&&e.texStorage2D(i.TEXTURE_2D,ut,yt,Nt[0].width,Nt[0].height);for(let K=0,Z=Nt.length;K0){let pt=Fo(at.width,at.height,g.format,g.type);for(let Dt of g.layerUpdates){let Qt=at.data.subarray(Dt*pt/at.data.BYTES_PER_ELEMENT,(Dt+1)*pt/at.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,K,0,0,Dt,at.width,at.height,1,lt,Qt)}g.clearLayerUpdates()}else e.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,K,0,0,0,at.width,at.height,Q.depth,lt,at.data)}else e.compressedTexImage3D(i.TEXTURE_2D_ARRAY,K,yt,at.width,at.height,Q.depth,0,at.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else I?it&&e.texSubImage3D(i.TEXTURE_2D_ARRAY,K,0,0,0,at.width,at.height,Q.depth,lt,At,at.data):e.texImage3D(i.TEXTURE_2D_ARRAY,K,yt,at.width,at.height,Q.depth,0,lt,At,at.data)}else{I&&tt&&e.texStorage2D(i.TEXTURE_2D,ut,yt,Nt[0].width,Nt[0].height);for(let K=0,Z=Nt.length;K0){let K=Fo(Q.width,Q.height,g.format,g.type);for(let Z of g.layerUpdates){let pt=Q.data.subarray(Z*K/Q.data.BYTES_PER_ELEMENT,(Z+1)*K/Q.data.BYTES_PER_ELEMENT);e.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,Z,Q.width,Q.height,1,lt,At,pt)}g.clearLayerUpdates()}else e.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,Q.width,Q.height,Q.depth,lt,At,Q.data)}else e.texImage3D(i.TEXTURE_2D_ARRAY,0,yt,Q.width,Q.height,Q.depth,0,lt,At,Q.data);else if(g.isData3DTexture)I?(tt&&e.texStorage3D(i.TEXTURE_3D,ut,yt,Q.width,Q.height,Q.depth),it&&e.texSubImage3D(i.TEXTURE_3D,0,0,0,0,Q.width,Q.height,Q.depth,lt,At,Q.data)):e.texImage3D(i.TEXTURE_3D,0,yt,Q.width,Q.height,Q.depth,0,lt,At,Q.data);else if(g.isFramebufferTexture){if(tt)if(I)e.texStorage2D(i.TEXTURE_2D,ut,yt,Q.width,Q.height);else{let K=Q.width,Z=Q.height;for(let pt=0;pt>=1,Z>>=1}}else if(Nt.length>0){if(I&&tt){let K=ue(Nt[0]);e.texStorage2D(i.TEXTURE_2D,ut,yt,K.width,K.height)}for(let K=0,Z=Nt.length;K0&&ut++;let Z=ue(lt[0]);e.texStorage2D(i.TEXTURE_CUBE_MAP,ut,Nt,Z.width,Z.height)}for(let Z=0;Z<6;Z++)if(Q){I?it&&e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Z,0,0,0,lt[Z].width,lt[Z].height,yt,at,lt[Z].data):e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Z,0,Nt,lt[Z].width,lt[Z].height,0,yt,at,lt[Z].data);for(let pt=0;pt>G),At=Math.max(1,g.height>>G);J===i.TEXTURE_3D||J===i.TEXTURE_2D_ARRAY?e.texImage3D(J,G,_t,lt,At,g.depth,0,vt,nt,null):e.texImage2D(J,G,_t,lt,At,0,vt,nt,null)}e.bindFramebuffer(i.FRAMEBUFFER,b),gt(g)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,X,J,Q.__webglTexture,0,se(g)):(J===i.TEXTURE_2D||J>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&J<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,X,J,Q.__webglTexture,G),e.bindFramebuffer(i.FRAMEBUFFER,null)}function It(b,g,O){if(i.bindRenderbuffer(i.RENDERBUFFER,b),g.depthBuffer){let X=g.depthTexture,J=X&&X.isDepthTexture?X.type:null,G=S(g.stencilBuffer,J),vt=g.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,nt=se(g);gt(g)?o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,nt,G,g.width,g.height):O?i.renderbufferStorageMultisample(i.RENDERBUFFER,nt,G,g.width,g.height):i.renderbufferStorage(i.RENDERBUFFER,G,g.width,g.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,vt,i.RENDERBUFFER,b)}else{let X=g.textures;for(let J=0;J{delete g.__boundDepthTexture,delete g.__depthDisposeCallback,X.removeEventListener("dispose",J)};X.addEventListener("dispose",J),g.__depthDisposeCallback=J}g.__boundDepthTexture=X}if(b.depthTexture&&!g.__autoAllocateDepthBuffer){if(O)throw new Error("target.depthTexture not supported in Cube render targets");let X=b.texture.mipmaps;X&&X.length>0?Mt(g.__webglFramebuffer[0],b):Mt(g.__webglFramebuffer,b)}else if(O){g.__webglDepthbuffer=[];for(let X=0;X<6;X++)if(e.bindFramebuffer(i.FRAMEBUFFER,g.__webglFramebuffer[X]),g.__webglDepthbuffer[X]===void 0)g.__webglDepthbuffer[X]=i.createRenderbuffer(),It(g.__webglDepthbuffer[X],b,!1);else{let J=b.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,G=g.__webglDepthbuffer[X];i.bindRenderbuffer(i.RENDERBUFFER,G),i.framebufferRenderbuffer(i.FRAMEBUFFER,J,i.RENDERBUFFER,G)}}else{let X=b.texture.mipmaps;if(X&&X.length>0?e.bindFramebuffer(i.FRAMEBUFFER,g.__webglFramebuffer[0]):e.bindFramebuffer(i.FRAMEBUFFER,g.__webglFramebuffer),g.__webglDepthbuffer===void 0)g.__webglDepthbuffer=i.createRenderbuffer(),It(g.__webglDepthbuffer,b,!1);else{let J=b.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,G=g.__webglDepthbuffer;i.bindRenderbuffer(i.RENDERBUFFER,G),i.framebufferRenderbuffer(i.FRAMEBUFFER,J,i.RENDERBUFFER,G)}}e.bindFramebuffer(i.FRAMEBUFFER,null)}function Me(b,g,O){let X=n.get(b);g!==void 0&&dt(X.__webglFramebuffer,b,b.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),O!==void 0&&Ht(b)}function w(b){let g=b.texture,O=n.get(b),X=n.get(g);b.addEventListener("dispose",P);let J=b.textures,G=b.isWebGLCubeRenderTarget===!0,vt=J.length>1;if(vt||(X.__webglTexture===void 0&&(X.__webglTexture=i.createTexture()),X.__version=g.version,a.memory.textures++),G){O.__webglFramebuffer=[];for(let nt=0;nt<6;nt++)if(g.mipmaps&&g.mipmaps.length>0){O.__webglFramebuffer[nt]=[];for(let _t=0;_t0){O.__webglFramebuffer=[];for(let nt=0;nt0&>(b)===!1){O.__webglMultisampledFramebuffer=i.createFramebuffer(),O.__webglColorRenderbuffer=[],e.bindFramebuffer(i.FRAMEBUFFER,O.__webglMultisampledFramebuffer);for(let nt=0;nt0)for(let _t=0;_t0)for(let _t=0;_t0){if(gt(b)===!1){let g=b.textures,O=b.width,X=b.height,J=i.COLOR_BUFFER_BIT,G=b.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,vt=n.get(b),nt=g.length>1;if(nt)for(let xt=0;xt0?e.bindFramebuffer(i.DRAW_FRAMEBUFFER,vt.__webglFramebuffer[0]):e.bindFramebuffer(i.DRAW_FRAMEBUFFER,vt.__webglFramebuffer);for(let xt=0;xt0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&g.__useRenderToTexture!==!1}function Ft(b){let g=a.render.frame;h.get(b)!==g&&(h.set(b,g),b.update())}function _e(b,g){let O=b.colorSpace,X=b.format,J=b.type;return b.isCompressedTexture===!0||b.isVideoTexture===!0||O!==bn&&O!==An&&(Gt.getTransfer(O)===Yt?(X!==Je||J!==sn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",O)),g}function ue(b){return typeof HTMLImageElement<"u"&&b instanceof HTMLImageElement?(l.width=b.naturalWidth||b.width,l.height=b.naturalHeight||b.height):typeof VideoFrame<"u"&&b instanceof VideoFrame?(l.width=b.displayWidth,l.height=b.displayHeight):(l.width=b.width,l.height=b.height),l}this.allocateTextureUnit=k,this.resetTextureUnits=F,this.setTexture2D=q,this.setTexture2DArray=W,this.setTexture3D=et,this.setTextureCube=V,this.rebindTextures=Me,this.setupRenderTarget=w,this.updateRenderTargetMipmap=ie,this.updateMultisampleRenderTarget=mt,this.setupDepthRenderbuffer=Ht,this.setupFrameBufferTexture=dt,this.useMultisampledRTT=gt}function Fm(i,t){function e(n,s=An){let r,a=Gt.getTransfer(s);if(n===sn)return i.UNSIGNED_BYTE;if(n===Hr)return i.UNSIGNED_SHORT_4_4_4_4;if(n===Gr)return i.UNSIGNED_SHORT_5_5_5_1;if(n===Mo)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===So)return i.UNSIGNED_INT_10F_11F_11F_REV;if(n===yo)return i.BYTE;if(n===vo)return i.SHORT;if(n===ki)return i.UNSIGNED_SHORT;if(n===Vr)return i.INT;if(n===Xn)return i.UNSIGNED_INT;if(n===dn)return i.FLOAT;if(n===Vi)return i.HALF_FLOAT;if(n===bo)return i.ALPHA;if(n===Eo)return i.RGB;if(n===Je)return i.RGBA;if(n===Pi)return i.DEPTH_COMPONENT;if(n===Gi)return i.DEPTH_STENCIL;if(n===To)return i.RED;if(n===Wr)return i.RED_INTEGER;if(n===wo)return i.RG;if(n===Xr)return i.RG_INTEGER;if(n===qr)return i.RGBA_INTEGER;if(n===Is||n===Ps||n===Ds||n===Ls)if(a===Yt)if(r=t.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(n===Is)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Ps)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Ds)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Ls)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=t.get("WEBGL_compressed_texture_s3tc"),r!==null){if(n===Is)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Ps)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Ds)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Ls)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Yr||n===Zr||n===Jr||n===$r)if(r=t.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(n===Yr)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Zr)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Jr)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===$r)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Kr||n===jr||n===Qr)if(r=t.get("WEBGL_compressed_texture_etc"),r!==null){if(n===Kr||n===jr)return a===Yt?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===Qr)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===ta||n===ea||n===na||n===ia||n===sa||n===ra||n===aa||n===oa||n===la||n===ca||n===ha||n===ua||n===da||n===fa)if(r=t.get("WEBGL_compressed_texture_astc"),r!==null){if(n===ta)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===ea)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===na)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===ia)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===sa)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===ra)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===aa)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===oa)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===la)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===ca)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===ha)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===ua)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===da)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===fa)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===pa||n===ma||n===ga)if(r=t.get("EXT_texture_compression_bptc"),r!==null){if(n===pa)return a===Yt?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===ma)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===ga)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===_a||n===xa||n===ya||n===va)if(r=t.get("EXT_texture_compression_rgtc"),r!==null){if(n===_a)return r.COMPRESSED_RED_RGTC1_EXT;if(n===xa)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===ya)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===va)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Hi?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:e}}var Om=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,Bm=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`,Jo=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e){if(this.texture===null){let n=new ys(t.texture);(t.depthNear!==e.depthNear||t.depthFar!==e.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=n}}getMesh(t){if(this.texture!==null&&this.mesh===null){let e=t.cameras[0].viewport,n=new nn({vertexShader:Om,fragmentShader:Bm,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new Pe(new ai(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},$o=class extends ln{constructor(t,e){super();let n=this,s=null,r=1,a=null,o="local-floor",c=1,l=null,h=null,d=null,f=null,p=null,_=null,y=typeof XRWebGLBinding<"u",m=new Jo,u={},T=e.getContextAttributes(),E=null,S=null,R=[],A=[],P=new Pt,N=null,M=new Ee;M.viewport=new le;let v=new Ee;v.viewport=new le;let C=[M,v],F=new Cr,k=null,H=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let $=R[Y];return $===void 0&&($=new Ni,R[Y]=$),$.getTargetRaySpace()},this.getControllerGrip=function(Y){let $=R[Y];return $===void 0&&($=new Ni,R[Y]=$),$.getGripSpace()},this.getHand=function(Y){let $=R[Y];return $===void 0&&($=new Ni,R[Y]=$),$.getHandSpace()};function q(Y){let $=A.indexOf(Y.inputSource);if($===-1)return;let dt=R[$];dt!==void 0&&(dt.update(Y.inputSource,Y.frame,l||a),dt.dispatchEvent({type:Y.type,data:Y.inputSource}))}function W(){s.removeEventListener("select",q),s.removeEventListener("selectstart",q),s.removeEventListener("selectend",q),s.removeEventListener("squeeze",q),s.removeEventListener("squeezestart",q),s.removeEventListener("squeezeend",q),s.removeEventListener("end",W),s.removeEventListener("inputsourceschange",et);for(let Y=0;Y=0&&(A[It]=null,R[It].disconnect(dt))}for(let $=0;$=A.length){A.push(dt),It=Ht;break}else if(A[Ht]===null){A[Ht]=dt,It=Ht;break}if(It===-1)break}let Mt=R[It];Mt&&Mt.connect(dt)}}let V=new L,rt=new L;function ct(Y,$,dt){V.setFromMatrixPosition($.matrixWorld),rt.setFromMatrixPosition(dt.matrixWorld);let It=V.distanceTo(rt),Mt=$.projectionMatrix.elements,Ht=dt.projectionMatrix.elements,Me=Mt[14]/(Mt[10]-1),w=Mt[14]/(Mt[10]+1),ie=(Mt[9]+1)/Mt[5],Lt=(Mt[9]-1)/Mt[5],Rt=(Mt[8]-1)/Mt[0],mt=(Ht[8]+1)/Ht[0],se=Me*Rt,gt=Me*mt,Ft=It/(-Rt+mt),_e=Ft*-Rt;if($.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX(_e),Y.translateZ(Ft),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert(),Mt[10]===-1)Y.projectionMatrix.copy($.projectionMatrix),Y.projectionMatrixInverse.copy($.projectionMatrixInverse);else{let ue=Me+Ft,b=w+Ft,g=se-_e,O=gt+(It-_e),X=ie*w/b*ue,J=Lt*w/b*ue;Y.projectionMatrix.makePerspective(g,O,X,J,ue,b),Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert()}}function St(Y,$){$===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices($.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(s===null)return;let $=Y.near,dt=Y.far;m.texture!==null&&(m.depthNear>0&&($=m.depthNear),m.depthFar>0&&(dt=m.depthFar)),F.near=v.near=M.near=$,F.far=v.far=M.far=dt,(k!==F.near||H!==F.far)&&(s.updateRenderState({depthNear:F.near,depthFar:F.far}),k=F.near,H=F.far),F.layers.mask=Y.layers.mask|6,M.layers.mask=F.layers.mask&3,v.layers.mask=F.layers.mask&5;let It=Y.parent,Mt=F.cameras;St(F,It);for(let Ht=0;Ht0&&(m.alphaTest.value=u.alphaTest);let T=t.get(u),E=T.envMap,S=T.envMapRotation;E&&(m.envMap.value=E,di.copy(S),di.x*=-1,di.y*=-1,di.z*=-1,E.isCubeTexture&&E.isRenderTargetTexture===!1&&(di.y*=-1,di.z*=-1),m.envMapRotation.value.setFromMatrix4(zm.makeRotationFromEuler(di)),m.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=u.reflectivity,m.ior.value=u.ior,m.refractionRatio.value=u.refractionRatio),u.lightMap&&(m.lightMap.value=u.lightMap,m.lightMapIntensity.value=u.lightMapIntensity,e(u.lightMap,m.lightMapTransform)),u.aoMap&&(m.aoMap.value=u.aoMap,m.aoMapIntensity.value=u.aoMapIntensity,e(u.aoMap,m.aoMapTransform))}function a(m,u){m.diffuse.value.copy(u.color),m.opacity.value=u.opacity,u.map&&(m.map.value=u.map,e(u.map,m.mapTransform))}function o(m,u){m.dashSize.value=u.dashSize,m.totalSize.value=u.dashSize+u.gapSize,m.scale.value=u.scale}function c(m,u,T,E){m.diffuse.value.copy(u.color),m.opacity.value=u.opacity,m.size.value=u.size*T,m.scale.value=E*.5,u.map&&(m.map.value=u.map,e(u.map,m.uvTransform)),u.alphaMap&&(m.alphaMap.value=u.alphaMap,e(u.alphaMap,m.alphaMapTransform)),u.alphaTest>0&&(m.alphaTest.value=u.alphaTest)}function l(m,u){m.diffuse.value.copy(u.color),m.opacity.value=u.opacity,m.rotation.value=u.rotation,u.map&&(m.map.value=u.map,e(u.map,m.mapTransform)),u.alphaMap&&(m.alphaMap.value=u.alphaMap,e(u.alphaMap,m.alphaMapTransform)),u.alphaTest>0&&(m.alphaTest.value=u.alphaTest)}function h(m,u){m.specular.value.copy(u.specular),m.shininess.value=Math.max(u.shininess,1e-4)}function d(m,u){u.gradientMap&&(m.gradientMap.value=u.gradientMap)}function f(m,u){m.metalness.value=u.metalness,u.metalnessMap&&(m.metalnessMap.value=u.metalnessMap,e(u.metalnessMap,m.metalnessMapTransform)),m.roughness.value=u.roughness,u.roughnessMap&&(m.roughnessMap.value=u.roughnessMap,e(u.roughnessMap,m.roughnessMapTransform)),u.envMap&&(m.envMapIntensity.value=u.envMapIntensity)}function p(m,u,T){m.ior.value=u.ior,u.sheen>0&&(m.sheenColor.value.copy(u.sheenColor).multiplyScalar(u.sheen),m.sheenRoughness.value=u.sheenRoughness,u.sheenColorMap&&(m.sheenColorMap.value=u.sheenColorMap,e(u.sheenColorMap,m.sheenColorMapTransform)),u.sheenRoughnessMap&&(m.sheenRoughnessMap.value=u.sheenRoughnessMap,e(u.sheenRoughnessMap,m.sheenRoughnessMapTransform))),u.clearcoat>0&&(m.clearcoat.value=u.clearcoat,m.clearcoatRoughness.value=u.clearcoatRoughness,u.clearcoatMap&&(m.clearcoatMap.value=u.clearcoatMap,e(u.clearcoatMap,m.clearcoatMapTransform)),u.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=u.clearcoatRoughnessMap,e(u.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),u.clearcoatNormalMap&&(m.clearcoatNormalMap.value=u.clearcoatNormalMap,e(u.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(u.clearcoatNormalScale),u.side===De&&m.clearcoatNormalScale.value.negate())),u.dispersion>0&&(m.dispersion.value=u.dispersion),u.iridescence>0&&(m.iridescence.value=u.iridescence,m.iridescenceIOR.value=u.iridescenceIOR,m.iridescenceThicknessMinimum.value=u.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=u.iridescenceThicknessRange[1],u.iridescenceMap&&(m.iridescenceMap.value=u.iridescenceMap,e(u.iridescenceMap,m.iridescenceMapTransform)),u.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=u.iridescenceThicknessMap,e(u.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),u.transmission>0&&(m.transmission.value=u.transmission,m.transmissionSamplerMap.value=T.texture,m.transmissionSamplerSize.value.set(T.width,T.height),u.transmissionMap&&(m.transmissionMap.value=u.transmissionMap,e(u.transmissionMap,m.transmissionMapTransform)),m.thickness.value=u.thickness,u.thicknessMap&&(m.thicknessMap.value=u.thicknessMap,e(u.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=u.attenuationDistance,m.attenuationColor.value.copy(u.attenuationColor)),u.anisotropy>0&&(m.anisotropyVector.value.set(u.anisotropy*Math.cos(u.anisotropyRotation),u.anisotropy*Math.sin(u.anisotropyRotation)),u.anisotropyMap&&(m.anisotropyMap.value=u.anisotropyMap,e(u.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=u.specularIntensity,m.specularColor.value.copy(u.specularColor),u.specularColorMap&&(m.specularColorMap.value=u.specularColorMap,e(u.specularColorMap,m.specularColorMapTransform)),u.specularIntensityMap&&(m.specularIntensityMap.value=u.specularIntensityMap,e(u.specularIntensityMap,m.specularIntensityMapTransform))}function _(m,u){u.matcap&&(m.matcap.value=u.matcap)}function y(m,u){let T=t.get(u).light;m.referencePosition.value.setFromMatrixPosition(T.matrixWorld),m.nearDistance.value=T.shadow.camera.near,m.farDistance.value=T.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:s}}function Vm(i,t,e,n){let s={},r={},a=[],o=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function c(T,E){let S=E.program;n.uniformBlockBinding(T,S)}function l(T,E){let S=s[T.id];S===void 0&&(_(T),S=h(T),s[T.id]=S,T.addEventListener("dispose",m));let R=E.program;n.updateUBOMapping(T,R);let A=t.render.frame;r[T.id]!==A&&(f(T),r[T.id]=A)}function h(T){let E=d();T.__bindingPointIndex=E;let S=i.createBuffer(),R=T.__size,A=T.usage;return i.bindBuffer(i.UNIFORM_BUFFER,S),i.bufferData(i.UNIFORM_BUFFER,R,A),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,E,S),S}function d(){for(let T=0;T0&&(S+=R-A),T.__size=S,T.__cache={},this}function y(T){let E={boundary:0,storage:0};return typeof T=="number"||typeof T=="boolean"?(E.boundary=4,E.storage=4):T.isVector2?(E.boundary=8,E.storage=8):T.isVector3||T.isColor?(E.boundary=16,E.storage=12):T.isVector4?(E.boundary=16,E.storage=16):T.isMatrix3?(E.boundary=48,E.storage=48):T.isMatrix4?(E.boundary=64,E.storage=64):T.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",T),E}function m(T){let E=T.target;E.removeEventListener("dispose",m);let S=a.indexOf(E.__bindingPointIndex);a.splice(S,1),i.deleteBuffer(s[E.id]),delete s[E.id],delete r[E.id]}function u(){for(let T in s)i.deleteBuffer(s[T]);a=[],s={},r={}}return{bind:c,update:l,dispose:u}}var Ta=class{constructor(t={}){let{canvas:e=Ec(),context:n=null,depth:s=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:l=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:d=!1,reversedDepthBuffer:f=!1}=t;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=n.getContextAttributes().alpha}else p=a;let _=new Uint32Array(4),y=new Int32Array(4),m=null,u=null,T=[],E=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=wn,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let S=this,R=!1;this._outputColorSpace=Ce;let A=0,P=0,N=null,M=-1,v=null,C=new le,F=new le,k=null,H=new Ot(0),q=0,W=e.width,et=e.height,V=1,rt=null,ct=null,St=new le(0,0,W,et),kt=new le(0,0,W,et),jt=!1,ne=new Fi,Xt=!1,Y=!1,$=new he,dt=new L,It=new le,Mt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},Ht=!1;function Me(){return N===null?V:1}let w=n;function ie(x,D){return e.getContext(x,D)}try{let x={alpha:!0,depth:s,stencil:r,antialias:o,premultipliedAlpha:c,preserveDrawingBuffer:l,powerPreference:h,failIfMajorPerformanceCaveat:d};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${"180"}`),e.addEventListener("webglcontextlost",it,!1),e.addEventListener("webglcontextrestored",ut,!1),e.addEventListener("webglcontextcreationerror",K,!1),w===null){let D="webgl2";if(w=ie(D,x),w===null)throw ie(D)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(x){throw console.error("THREE.WebGLRenderer: "+x.message),x}let Lt,Rt,mt,se,gt,Ft,_e,ue,b,g,O,X,J,G,vt,nt,_t,xt,Q,lt,At,yt,at,Nt;function I(){Lt=new rp(w),Lt.init(),yt=new Fm(w,Lt),Rt=new jf(w,Lt,t,yt),mt=new Um(w,Lt),Rt.reversedDepthBuffer&&f&&mt.buffers.depth.setReversed(!0),se=new lp(w),gt=new Mm,Ft=new Nm(w,Lt,mt,gt,Rt,yt,se),_e=new tp(S),ue=new sp(S),b=new fu(w),at=new $f(w,b),g=new ap(w,b,se,at),O=new hp(w,g,b,se),Q=new cp(w,Rt,Ft),nt=new Qf(gt),X=new vm(S,_e,ue,Lt,Rt,at,nt),J=new km(S,gt),G=new bm,vt=new Cm(Lt),xt=new Jf(S,_e,ue,mt,O,p,c),_t=new Dm(S,O,Rt),Nt=new Vm(w,se,Rt,mt),lt=new Kf(w,Lt,se),At=new op(w,Lt,se),se.programs=X.programs,S.capabilities=Rt,S.extensions=Lt,S.properties=gt,S.renderLists=G,S.shadowMap=_t,S.state=mt,S.info=se}I();let tt=new $o(S,w);this.xr=tt,this.getContext=function(){return w},this.getContextAttributes=function(){return w.getContextAttributes()},this.forceContextLoss=function(){let x=Lt.get("WEBGL_lose_context");x&&x.loseContext()},this.forceContextRestore=function(){let x=Lt.get("WEBGL_lose_context");x&&x.restoreContext()},this.getPixelRatio=function(){return V},this.setPixelRatio=function(x){x!==void 0&&(V=x,this.setSize(W,et,!1))},this.getSize=function(x){return x.set(W,et)},this.setSize=function(x,D,B=!0){if(tt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}W=x,et=D,e.width=Math.floor(x*V),e.height=Math.floor(D*V),B===!0&&(e.style.width=x+"px",e.style.height=D+"px"),this.setViewport(0,0,x,D)},this.getDrawingBufferSize=function(x){return x.set(W*V,et*V).floor()},this.setDrawingBufferSize=function(x,D,B){W=x,et=D,V=B,e.width=Math.floor(x*B),e.height=Math.floor(D*B),this.setViewport(0,0,x,D)},this.getCurrentViewport=function(x){return x.copy(C)},this.getViewport=function(x){return x.copy(St)},this.setViewport=function(x,D,B,z){x.isVector4?St.set(x.x,x.y,x.z,x.w):St.set(x,D,B,z),mt.viewport(C.copy(St).multiplyScalar(V).round())},this.getScissor=function(x){return x.copy(kt)},this.setScissor=function(x,D,B,z){x.isVector4?kt.set(x.x,x.y,x.z,x.w):kt.set(x,D,B,z),mt.scissor(F.copy(kt).multiplyScalar(V).round())},this.getScissorTest=function(){return jt},this.setScissorTest=function(x){mt.setScissorTest(jt=x)},this.setOpaqueSort=function(x){rt=x},this.setTransparentSort=function(x){ct=x},this.getClearColor=function(x){return x.copy(xt.getClearColor())},this.setClearColor=function(){xt.setClearColor(...arguments)},this.getClearAlpha=function(){return xt.getClearAlpha()},this.setClearAlpha=function(){xt.setClearAlpha(...arguments)},this.clear=function(x=!0,D=!0,B=!0){let z=0;if(x){let U=!1;if(N!==null){let j=N.texture.format;U=j===qr||j===Xr||j===Wr}if(U){let j=N.texture.type,ot=j===sn||j===Xn||j===ki||j===Hi||j===Hr||j===Gr,ft=xt.getClearColor(),ht=xt.getClearAlpha(),wt=ft.r,Ct=ft.g,bt=ft.b;ot?(_[0]=wt,_[1]=Ct,_[2]=bt,_[3]=ht,w.clearBufferuiv(w.COLOR,0,_)):(y[0]=wt,y[1]=Ct,y[2]=bt,y[3]=ht,w.clearBufferiv(w.COLOR,0,y))}else z|=w.COLOR_BUFFER_BIT}D&&(z|=w.DEPTH_BUFFER_BIT),B&&(z|=w.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),w.clear(z)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",it,!1),e.removeEventListener("webglcontextrestored",ut,!1),e.removeEventListener("webglcontextcreationerror",K,!1),xt.dispose(),G.dispose(),vt.dispose(),gt.dispose(),_e.dispose(),ue.dispose(),O.dispose(),at.dispose(),Nt.dispose(),X.dispose(),tt.dispose(),tt.removeEventListener("sessionstart",on),tt.removeEventListener("sessionend",ll),Jn.stop()};function it(x){x.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),R=!0}function ut(){console.log("THREE.WebGLRenderer: Context Restored."),R=!1;let x=se.autoReset,D=_t.enabled,B=_t.autoUpdate,z=_t.needsUpdate,U=_t.type;I(),se.autoReset=x,_t.enabled=D,_t.autoUpdate=B,_t.needsUpdate=z,_t.type=U}function K(x){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",x.statusMessage)}function Z(x){let D=x.target;D.removeEventListener("dispose",Z),pt(D)}function pt(x){Dt(x),gt.remove(x)}function Dt(x){let D=gt.get(x).programs;D!==void 0&&(D.forEach(function(B){X.releaseProgram(B)}),x.isShaderMaterial&&X.releaseShaderCache(x))}this.renderBufferDirect=function(x,D,B,z,U,j){D===null&&(D=Mt);let ot=U.isMesh&&U.matrixWorld.determinant()<0,ft=fh(x,D,B,z,U);mt.setMaterial(z,ot);let ht=B.index,wt=1;if(z.wireframe===!0){if(ht=g.getWireframeAttribute(B),ht===void 0)return;wt=2}let Ct=B.drawRange,bt=B.attributes.position,Vt=Ct.start*wt,Jt=(Ct.start+Ct.count)*wt;j!==null&&(Vt=Math.max(Vt,j.start*wt),Jt=Math.min(Jt,(j.start+j.count)*wt)),ht!==null?(Vt=Math.max(Vt,0),Jt=Math.min(Jt,ht.count)):bt!=null&&(Vt=Math.max(Vt,0),Jt=Math.min(Jt,bt.count));let ce=Jt-Vt;if(ce<0||ce===1/0)return;at.setup(U,z,ft,B,ht);let te,Kt=lt;if(ht!==null&&(te=b.get(ht),Kt=At,Kt.setIndex(te)),U.isMesh)z.wireframe===!0?(mt.setLineWidth(z.wireframeLinewidth*Me()),Kt.setMode(w.LINES)):Kt.setMode(w.TRIANGLES);else if(U.isLine){let Tt=z.linewidth;Tt===void 0&&(Tt=1),mt.setLineWidth(Tt*Me()),U.isLineSegments?Kt.setMode(w.LINES):U.isLineLoop?Kt.setMode(w.LINE_LOOP):Kt.setMode(w.LINE_STRIP)}else U.isPoints?Kt.setMode(w.POINTS):U.isSprite&&Kt.setMode(w.TRIANGLES);if(U.isBatchedMesh)if(U._multiDrawInstances!==null)Li("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Kt.renderMultiDrawInstances(U._multiDrawStarts,U._multiDrawCounts,U._multiDrawCount,U._multiDrawInstances);else if(Lt.get("WEBGL_multi_draw"))Kt.renderMultiDraw(U._multiDrawStarts,U._multiDrawCounts,U._multiDrawCount);else{let Tt=U._multiDrawStarts,re=U._multiDrawCounts,Wt=U._multiDrawCount,Ne=ht?b.get(ht).bytesPerElement:1,gi=gt.get(z).currentProgram.getUniforms();for(let Fe=0;Fe{function j(){if(z.forEach(function(ot){gt.get(ot).currentProgram.isReady()&&z.delete(ot)}),z.size===0){U(x);return}setTimeout(j,10)}Lt.get("KHR_parallel_shader_compile")!==null?j():setTimeout(j,10)})};let qt=null;function pn(x){qt&&qt(x)}function on(){Jn.stop()}function ll(){Jn.start()}let Jn=new jc;Jn.setAnimationLoop(pn),typeof self<"u"&&Jn.setContext(self),this.setAnimationLoop=function(x){qt=x,tt.setAnimationLoop(x),x===null?Jn.stop():Jn.start()},tt.addEventListener("sessionstart",on),tt.addEventListener("sessionend",ll),this.render=function(x,D){if(D!==void 0&&D.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(R===!0)return;if(x.matrixWorldAutoUpdate===!0&&x.updateMatrixWorld(),D.parent===null&&D.matrixWorldAutoUpdate===!0&&D.updateMatrixWorld(),tt.enabled===!0&&tt.isPresenting===!0&&(tt.cameraAutoUpdate===!0&&tt.updateCamera(D),D=tt.getCamera()),x.isScene===!0&&x.onBeforeRender(S,x,D,N),u=vt.get(x,E.length),u.init(D),E.push(u),$.multiplyMatrices(D.projectionMatrix,D.matrixWorldInverse),ne.setFromProjectionMatrix($,Qe,D.reversedDepth),Y=this.localClippingEnabled,Xt=nt.init(this.clippingPlanes,Y),m=G.get(x,T.length),m.init(),T.push(m),tt.enabled===!0&&tt.isPresenting===!0){let j=S.xr.getDepthSensingMesh();j!==null&&Da(j,D,-1/0,S.sortObjects)}Da(x,D,0,S.sortObjects),m.finish(),S.sortObjects===!0&&m.sort(rt,ct),Ht=tt.enabled===!1||tt.isPresenting===!1||tt.hasDepthSensing()===!1,Ht&&xt.addToRenderList(m,x),this.info.render.frame++,Xt===!0&&nt.beginShadows();let B=u.state.shadowsArray;_t.render(B,x,D),Xt===!0&&nt.endShadows(),this.info.autoReset===!0&&this.info.reset();let z=m.opaque,U=m.transmissive;if(u.setupLights(),D.isArrayCamera){let j=D.cameras;if(U.length>0)for(let ot=0,ft=j.length;ot0&&hl(z,U,x,D),Ht&&xt.render(x),cl(m,x,D);N!==null&&P===0&&(Ft.updateMultisampleRenderTarget(N),Ft.updateRenderTargetMipmap(N)),x.isScene===!0&&x.onAfterRender(S,x,D),at.resetDefaultState(),M=-1,v=null,E.pop(),E.length>0?(u=E[E.length-1],Xt===!0&&nt.setGlobalState(S.clippingPlanes,u.state.camera)):u=null,T.pop(),T.length>0?m=T[T.length-1]:m=null};function Da(x,D,B,z){if(x.visible===!1)return;if(x.layers.test(D.layers)){if(x.isGroup)B=x.renderOrder;else if(x.isLOD)x.autoUpdate===!0&&x.update(D);else if(x.isLight)u.pushLight(x),x.castShadow&&u.pushShadow(x);else if(x.isSprite){if(!x.frustumCulled||ne.intersectsSprite(x)){z&&It.setFromMatrixPosition(x.matrixWorld).applyMatrix4($);let ot=O.update(x),ft=x.material;ft.visible&&m.push(x,ot,ft,B,It.z,null)}}else if((x.isMesh||x.isLine||x.isPoints)&&(!x.frustumCulled||ne.intersectsObject(x))){let ot=O.update(x),ft=x.material;if(z&&(x.boundingSphere!==void 0?(x.boundingSphere===null&&x.computeBoundingSphere(),It.copy(x.boundingSphere.center)):(ot.boundingSphere===null&&ot.computeBoundingSphere(),It.copy(ot.boundingSphere.center)),It.applyMatrix4(x.matrixWorld).applyMatrix4($)),Array.isArray(ft)){let ht=ot.groups;for(let wt=0,Ct=ht.length;wt0&&Ns(U,D,B),j.length>0&&Ns(j,D,B),ot.length>0&&Ns(ot,D,B),mt.buffers.depth.setTest(!0),mt.buffers.depth.setMask(!0),mt.buffers.color.setMask(!0),mt.setPolygonOffset(!1)}function hl(x,D,B,z){if((B.isScene===!0?B.overrideMaterial:null)!==null)return;u.state.transmissionRenderTarget[z.id]===void 0&&(u.state.transmissionRenderTarget[z.id]=new cn(1,1,{generateMipmaps:!0,type:Lt.has("EXT_color_buffer_half_float")||Lt.has("EXT_color_buffer_float")?Vi:sn,minFilter:Wn,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Gt.workingColorSpace}));let j=u.state.transmissionRenderTarget[z.id],ot=z.viewport||C;j.setSize(ot.z*S.transmissionResolutionScale,ot.w*S.transmissionResolutionScale);let ft=S.getRenderTarget(),ht=S.getActiveCubeFace(),wt=S.getActiveMipmapLevel();S.setRenderTarget(j),S.getClearColor(H),q=S.getClearAlpha(),q<1&&S.setClearColor(16777215,.5),S.clear(),Ht&&xt.render(B);let Ct=S.toneMapping;S.toneMapping=wn;let bt=z.viewport;if(z.viewport!==void 0&&(z.viewport=void 0),u.setupLightsView(z),Xt===!0&&nt.setGlobalState(S.clippingPlanes,z),Ns(x,B,z),Ft.updateMultisampleRenderTarget(j),Ft.updateRenderTargetMipmap(j),Lt.has("WEBGL_multisampled_render_to_texture")===!1){let Vt=!1;for(let Jt=0,ce=D.length;Jt0),bt=!!B.morphAttributes.position,Vt=!!B.morphAttributes.normal,Jt=!!B.morphAttributes.color,ce=wn;z.toneMapped&&(N===null||N.isXRRenderTarget===!0)&&(ce=S.toneMapping);let te=B.morphAttributes.position||B.morphAttributes.normal||B.morphAttributes.color,Kt=te!==void 0?te.length:0,Tt=gt.get(z),re=u.state.lights;if(Xt===!0&&(Y===!0||x!==v)){let Ae=x===v&&z.id===M;nt.setState(z,x,Ae)}let Wt=!1;z.version===Tt.__version?(Tt.needsLights&&Tt.lightsStateVersion!==re.state.version||Tt.outputColorSpace!==ft||U.isBatchedMesh&&Tt.batching===!1||!U.isBatchedMesh&&Tt.batching===!0||U.isBatchedMesh&&Tt.batchingColor===!0&&U.colorTexture===null||U.isBatchedMesh&&Tt.batchingColor===!1&&U.colorTexture!==null||U.isInstancedMesh&&Tt.instancing===!1||!U.isInstancedMesh&&Tt.instancing===!0||U.isSkinnedMesh&&Tt.skinning===!1||!U.isSkinnedMesh&&Tt.skinning===!0||U.isInstancedMesh&&Tt.instancingColor===!0&&U.instanceColor===null||U.isInstancedMesh&&Tt.instancingColor===!1&&U.instanceColor!==null||U.isInstancedMesh&&Tt.instancingMorph===!0&&U.morphTexture===null||U.isInstancedMesh&&Tt.instancingMorph===!1&&U.morphTexture!==null||Tt.envMap!==ht||z.fog===!0&&Tt.fog!==j||Tt.numClippingPlanes!==void 0&&(Tt.numClippingPlanes!==nt.numPlanes||Tt.numIntersection!==nt.numIntersection)||Tt.vertexAlphas!==wt||Tt.vertexTangents!==Ct||Tt.morphTargets!==bt||Tt.morphNormals!==Vt||Tt.morphColors!==Jt||Tt.toneMapping!==ce||Tt.morphTargetsCount!==Kt)&&(Wt=!0):(Wt=!0,Tt.__version=z.version);let Ne=Tt.currentProgram;Wt===!0&&(Ne=Fs(z,D,U));let gi=!1,Fe=!1,Ki=!1,ae=Ne.getUniforms(),Ge=Tt.uniforms;if(mt.useProgram(Ne.program)&&(gi=!0,Fe=!0,Ki=!0),z.id!==M&&(M=z.id,Fe=!0),gi||v!==x){mt.buffers.depth.getReversed()&&x.reversedDepth!==!0&&(x._reversedDepth=!0,x.updateProjectionMatrix()),ae.setValue(w,"projectionMatrix",x.projectionMatrix),ae.setValue(w,"viewMatrix",x.matrixWorldInverse);let Le=ae.map.cameraPosition;Le!==void 0&&Le.setValue(w,dt.setFromMatrixPosition(x.matrixWorld)),Rt.logarithmicDepthBuffer&&ae.setValue(w,"logDepthBufFC",2/(Math.log(x.far+1)/Math.LN2)),(z.isMeshPhongMaterial||z.isMeshToonMaterial||z.isMeshLambertMaterial||z.isMeshBasicMaterial||z.isMeshStandardMaterial||z.isShaderMaterial)&&ae.setValue(w,"isOrthographic",x.isOrthographicCamera===!0),v!==x&&(v=x,Fe=!0,Ki=!0)}if(U.isSkinnedMesh){ae.setOptional(w,U,"bindMatrix"),ae.setOptional(w,U,"bindMatrixInverse");let Ae=U.skeleton;Ae&&(Ae.boneTexture===null&&Ae.computeBoneTexture(),ae.setValue(w,"boneTexture",Ae.boneTexture,Ft))}U.isBatchedMesh&&(ae.setOptional(w,U,"batchingTexture"),ae.setValue(w,"batchingTexture",U._matricesTexture,Ft),ae.setOptional(w,U,"batchingIdTexture"),ae.setValue(w,"batchingIdTexture",U._indirectTexture,Ft),ae.setOptional(w,U,"batchingColorTexture"),U._colorsTexture!==null&&ae.setValue(w,"batchingColorTexture",U._colorsTexture,Ft));let We=B.morphAttributes;if((We.position!==void 0||We.normal!==void 0||We.color!==void 0)&&Q.update(U,B,Ne),(Fe||Tt.receiveShadow!==U.receiveShadow)&&(Tt.receiveShadow=U.receiveShadow,ae.setValue(w,"receiveShadow",U.receiveShadow)),z.isMeshGouraudMaterial&&z.envMap!==null&&(Ge.envMap.value=ht,Ge.flipEnvMap.value=ht.isCubeTexture&&ht.isRenderTargetTexture===!1?-1:1),z.isMeshStandardMaterial&&z.envMap===null&&D.environment!==null&&(Ge.envMapIntensity.value=D.environmentIntensity),Fe&&(ae.setValue(w,"toneMappingExposure",S.toneMappingExposure),Tt.needsLights&&ph(Ge,Ki),j&&z.fog===!0&&J.refreshFogUniforms(Ge,j),J.refreshMaterialUniforms(Ge,z,V,et,u.state.transmissionRenderTarget[x.id]),Yi.upload(w,dl(Tt),Ge,Ft)),z.isShaderMaterial&&z.uniformsNeedUpdate===!0&&(Yi.upload(w,dl(Tt),Ge,Ft),z.uniformsNeedUpdate=!1),z.isSpriteMaterial&&ae.setValue(w,"center",U.center),ae.setValue(w,"modelViewMatrix",U.modelViewMatrix),ae.setValue(w,"normalMatrix",U.normalMatrix),ae.setValue(w,"modelMatrix",U.matrixWorld),z.isShaderMaterial||z.isRawShaderMaterial){let Ae=z.uniformsGroups;for(let Le=0,La=Ae.length;Le0&&Ft.useMultisampledRTT(x)===!1?U=gt.get(x).__webglMultisampledFramebuffer:Array.isArray(Ct)?U=Ct[B]:U=Ct,C.copy(x.viewport),F.copy(x.scissor),k=x.scissorTest}else C.copy(St).multiplyScalar(V).floor(),F.copy(kt).multiplyScalar(V).floor(),k=jt;if(B!==0&&(U=gh),mt.bindFramebuffer(w.FRAMEBUFFER,U)&&z&&mt.drawBuffers(x,U),mt.viewport(C),mt.scissor(F),mt.setScissorTest(k),j){let ht=gt.get(x.texture);w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_CUBE_MAP_POSITIVE_X+D,ht.__webglTexture,B)}else if(ot){let ht=D;for(let wt=0;wt=0&&D<=x.width-z&&B>=0&&B<=x.height-U&&(x.textures.length>1&&w.readBuffer(w.COLOR_ATTACHMENT0+ft),w.readPixels(D,B,z,U,yt.convert(Ct),yt.convert(bt),j))}finally{let wt=N!==null?gt.get(N).__webglFramebuffer:null;mt.bindFramebuffer(w.FRAMEBUFFER,wt)}}},this.readRenderTargetPixelsAsync=async function(x,D,B,z,U,j,ot,ft=0){if(!(x&&x.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let ht=gt.get(x).__webglFramebuffer;if(x.isWebGLCubeRenderTarget&&ot!==void 0&&(ht=ht[ot]),ht)if(D>=0&&D<=x.width-z&&B>=0&&B<=x.height-U){mt.bindFramebuffer(w.FRAMEBUFFER,ht);let wt=x.textures[ft],Ct=wt.format,bt=wt.type;if(!Rt.textureFormatReadable(Ct))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Rt.textureTypeReadable(bt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");let Vt=w.createBuffer();w.bindBuffer(w.PIXEL_PACK_BUFFER,Vt),w.bufferData(w.PIXEL_PACK_BUFFER,j.byteLength,w.STREAM_READ),x.textures.length>1&&w.readBuffer(w.COLOR_ATTACHMENT0+ft),w.readPixels(D,B,z,U,yt.convert(Ct),yt.convert(bt),0);let Jt=N!==null?gt.get(N).__webglFramebuffer:null;mt.bindFramebuffer(w.FRAMEBUFFER,Jt);let ce=w.fenceSync(w.SYNC_GPU_COMMANDS_COMPLETE,0);return w.flush(),await Tc(w,ce,4),w.bindBuffer(w.PIXEL_PACK_BUFFER,Vt),w.getBufferSubData(w.PIXEL_PACK_BUFFER,0,j),w.deleteBuffer(Vt),w.deleteSync(ce),j}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(x,D=null,B=0){let z=Math.pow(2,-B),U=Math.floor(x.image.width*z),j=Math.floor(x.image.height*z),ot=D!==null?D.x:0,ft=D!==null?D.y:0;Ft.setTexture2D(x,0),w.copyTexSubImage2D(w.TEXTURE_2D,B,0,0,ot,ft,U,j),mt.unbindTexture()};let _h=w.createFramebuffer(),xh=w.createFramebuffer();this.copyTextureToTexture=function(x,D,B=null,z=null,U=0,j=null){j===null&&(U!==0?(Li("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),j=U,U=0):j=0);let ot,ft,ht,wt,Ct,bt,Vt,Jt,ce,te=x.isCompressedTexture?x.mipmaps[j]:x.image;if(B!==null)ot=B.max.x-B.min.x,ft=B.max.y-B.min.y,ht=B.isBox3?B.max.z-B.min.z:1,wt=B.min.x,Ct=B.min.y,bt=B.isBox3?B.min.z:0;else{let We=Math.pow(2,-U);ot=Math.floor(te.width*We),ft=Math.floor(te.height*We),x.isDataArrayTexture?ht=te.depth:x.isData3DTexture?ht=Math.floor(te.depth*We):ht=1,wt=0,Ct=0,bt=0}z!==null?(Vt=z.x,Jt=z.y,ce=z.z):(Vt=0,Jt=0,ce=0);let Kt=yt.convert(D.format),Tt=yt.convert(D.type),re;D.isData3DTexture?(Ft.setTexture3D(D,0),re=w.TEXTURE_3D):D.isDataArrayTexture||D.isCompressedArrayTexture?(Ft.setTexture2DArray(D,0),re=w.TEXTURE_2D_ARRAY):(Ft.setTexture2D(D,0),re=w.TEXTURE_2D),w.pixelStorei(w.UNPACK_FLIP_Y_WEBGL,D.flipY),w.pixelStorei(w.UNPACK_PREMULTIPLY_ALPHA_WEBGL,D.premultiplyAlpha),w.pixelStorei(w.UNPACK_ALIGNMENT,D.unpackAlignment);let Wt=w.getParameter(w.UNPACK_ROW_LENGTH),Ne=w.getParameter(w.UNPACK_IMAGE_HEIGHT),gi=w.getParameter(w.UNPACK_SKIP_PIXELS),Fe=w.getParameter(w.UNPACK_SKIP_ROWS),Ki=w.getParameter(w.UNPACK_SKIP_IMAGES);w.pixelStorei(w.UNPACK_ROW_LENGTH,te.width),w.pixelStorei(w.UNPACK_IMAGE_HEIGHT,te.height),w.pixelStorei(w.UNPACK_SKIP_PIXELS,wt),w.pixelStorei(w.UNPACK_SKIP_ROWS,Ct),w.pixelStorei(w.UNPACK_SKIP_IMAGES,bt);let ae=x.isDataArrayTexture||x.isData3DTexture,Ge=D.isDataArrayTexture||D.isData3DTexture;if(x.isDepthTexture){let We=gt.get(x),Ae=gt.get(D),Le=gt.get(We.__renderTarget),La=gt.get(Ae.__renderTarget);mt.bindFramebuffer(w.READ_FRAMEBUFFER,Le.__webglFramebuffer),mt.bindFramebuffer(w.DRAW_FRAMEBUFFER,La.__webglFramebuffer);for(let $n=0;$nMath.PI&&(n-=Ue),s<-Math.PI?s+=Ue:s>Math.PI&&(s-=Ue),n<=s?this._spherical.theta=Math.max(n,Math.min(s,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+s)/2?Math.max(n,this._spherical.theta):Math.min(s,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{let a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=a!=this._spherical.radius}if(me.setFromSpherical(this._spherical),me.applyQuaternion(this._quatInverse),e.copy(this.target).add(me),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){let o=me.length();a=this._clampDistance(o*this._scale);let c=o-a;this.object.position.addScaledVector(this._dollyDirection,c),this.object.updateMatrixWorld(),r=!!c}else if(this.object.isOrthographicCamera){let o=new L(this._mouse.x,this._mouse.y,0);o.unproject(this.object);let c=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=c!==this.object.zoom;let l=new L(this._mouse.x,this._mouse.y,0);l.unproject(this.object),this.object.position.sub(l).add(o),this.object.updateMatrixWorld(),a=me.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(Aa.origin.copy(this.object.position),Aa.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Aa.direction))jo||8*(1-this._lastQuaternion.dot(this.object.quaternion))>jo||this._lastTargetPosition.distanceToSquared(this.target)>jo?(this.dispatchEvent(ih),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?Ue/60*this.autoRotateSpeed*t:Ue/60/60*this.autoRotateSpeed}_getZoomScale(t){let e=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){me.setFromMatrixColumn(e,0),me.multiplyScalar(-t),this._panOffset.add(me)}_panUp(t,e){this.screenSpacePanning===!0?me.setFromMatrixColumn(e,1):(me.setFromMatrixColumn(e,0),me.crossVectors(this.object.up,me)),me.multiplyScalar(t),this._panOffset.add(me)}_pan(t,e){let n=this.domElement;if(this.object.isPerspectiveCamera){let s=this.object.position;me.copy(s).sub(this.target);let r=me.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*r/n.clientHeight,this.object.matrix),this._panUp(2*e*r/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;let n=this.domElement.getBoundingClientRect(),s=t-n.left,r=e-n.top,a=n.width,o=n.height;this._mouse.x=s/a*2-1,this._mouse.y=-(r/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let e=this.domElement;this._rotateLeft(Ue*this._rotateDelta.x/e.clientHeight),this._rotateUp(Ue*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(Ue*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-Ue*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(Ue*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-Ue*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{let e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._rotateStart.set(n,s)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{let e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panStart.set(n,s)}}_handleTouchStartDolly(t){let e=this._getSecondPointerPosition(t),n=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(n*n+s*s);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{let n=this._getSecondPointerPosition(t),s=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._rotateEnd.set(s,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let e=this.domElement;this._rotateLeft(Ue*this._rotateDelta.x/e.clientHeight),this._rotateUp(Ue*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{let e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panEnd.set(n,s)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){let e=this._getSecondPointerPosition(t),n=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(n*n+s*s);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);let a=(t.pageX+e.x)*.5,o=(t.pageY+e.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;edocument.getElementById(i),ah=64*1024*1024,Zt=(i,t)=>{if(!i)throw new Error(t)},ye,ge,Ca,Rn,qn,Yn,mi,He,rn,Ji,Ia=[],al=[],an=!1,ol=0,$i=100,el=!1,ng=0,nl=new L,oh=new L,hh=2;function ig(i){return Zt(typeof i=="string"&&/^[a-zA-Z0-9_.-]+(?:\/[a-zA-Z0-9_.-]+)*$/.test(i)&&!i.split("/").some(t=>t==="."||t===".."),"Invalid local asset path."),i}async function il(i,t){Zt(i,"Missing response body.");let e=i.getReader(),n=[],s=0;try{for(;;){let{done:o,value:c}=await e.read();if(o)break;if(s+=c.byteLength,s>t)throw await e.cancel(),new Error("Asset exceeds byte limit.");n.push(c)}}finally{e.releaseLock()}let r=new Uint8Array(s),a=0;for(let o of n)r.set(o,a),a+=o.length;return r.buffer}async function uh(i){let t=new URL(ig(i),location.href);Zt(t.origin===location.origin,"Unexpected asset origin.");let e=location.protocol==="https:"&&location.host==="dvidia-robot-simulation-lab.static.hf.space",n=await fetch(t,{credentials:"omit",referrerPolicy:"no-referrer",redirect:e?"follow":"error"}),s=new URL(n.url);return Zt(!s.username&&!s.password&&(s.origin===location.origin||e&&s.protocol==="https:"&&s.host==="us.aws.cdn.hf.co"),"Unexpected asset redirect."),Zt(n.ok,"Could not load "+i+" (HTTP "+n.status+")."),n}async function sg(i){return JSON.parse(new TextDecoder().decode(await il((await uh(i)).body,4*1024*1024)))}async function lh(i,t){Zt(i.href===t&&i.compression==="gzip"&&Number.isInteger(i.bytes)&&i.bytes>=0&&i.bytes<=ah&&Number.isInteger(i.compressed_bytes)&&i.compressed_bytes>=0&&i.compressed_bytes<=ah,"Invalid binary layout."),Zt(typeof DecompressionStream=="function","This browser needs DecompressionStream support.");let e=await il((await uh(t)).body,i.compressed_bytes);Zt(e.byteLength===i.compressed_bytes,"Compressed asset length mismatch.");let n=await il(new Blob([e]).stream().pipeThrough(new DecompressionStream("gzip")),i.bytes);if(Zt(n.byteLength===i.bytes,"Decoded asset length mismatch."),globalThis.crypto?.subtle){let s=[...new Uint8Array(await crypto.subtle.digest("SHA-256",n))].map(r=>r.toString(16).padStart(2,"0")).join("");Zt(s===i.sha256,"Decoded asset digest mismatch.")}return n}function rg(i,t){Zt(Array.isArray(i)&&i.length===t&&i.every(Number.isFinite),"Invalid native vector.")}function ag(i,t){Zt(ye.schema==="dvidia.asset-preview-model/v1"&&ge.schema==="dvidia.asset-preview-motion/v1"&&Rn.schema==="dvidia.asset-scene/v1"&&Ca.schema==="dvidia.asset-catalog/v1","Unsupported asset preview."),Zt(Number.isInteger(ge.body_count)&&ge.body_count>0&&ge.body_count<=128&&ye.bodies.length===ge.body_count&&ge.frame_count===101&&ge.frame_stride_floats===ge.body_count*7&&t.byteLength===101*ge.body_count*28,"Invalid body pose layout."),ye.bodies.forEach((r,a)=>Zt(r.id===a&&typeof r.name=="string","Invalid native body identity.")),Zt(Array.isArray(ye.meshes)&&ye.meshes.length<=128&&Array.isArray(ye.geoms)&&ye.geoms.length<=512,"Invalid native geometry inventory.");let e=new Set,n=new DataView(i);for(let r of ye.meshes){Zt(Number.isInteger(r.id)&&!e.has(r.id),"Invalid mesh identity."),e.add(r.id);let{vertex_count:a,index_count:o,position_byte_offset:c,index_byte_offset:l}=r;Zt([a,o,c,l].every(Number.isInteger)&&a>0&&o>=0&&o%3===0&&c>=0&&l>=0&&c%4===0&&l%4===0&&c+a*12<=i.byteLength&&l+o*4<=i.byteLength,"Invalid native mesh range.");for(let h=0;h=0&&r.body_ids.getFloat32(r+c*4,!0));Zt(a.every(Number.isFinite)&&Math.abs(Math.hypot(...a.slice(3))-1)<.001,"Invalid native body pose.")}Zt(Array.isArray(ge.rows)&&ge.rows.length===101,"Invalid recorded frames."),ge.rows.forEach((r,a)=>Zt(Number.isFinite(r.t_seconds)&&Math.abs(r.t_seconds-a*.02)<1e-8&&Number.isInteger(r.contact_count)&&r.contact_count>=0,"Invalid frame timestamp."))}function ch(i,t){t.set(i[1],i[2],i[3],i[0])}function og(i,t){switch(i.type){case"mesh":return t.get(i.mesh_id);case"box":return new Bn(...i.size.map(e=>e*2));case"sphere":return new Oi(i.size[0],24,16);case"ellipsoid":{let e=new Oi(1,32,20);return e.scale(...i.size),e}case"capsule":{let e=new vs(i.size[0],2*i.size[1],6,20);return e.rotateX(Math.PI/2),e}case"cylinder":{let e=new Ms(i.size[0],i.size[0],i.size[1]*2,28);return e.rotateX(Math.PI/2),e}case"plane":return new ai(Math.max(4,i.size[0]*2),Math.max(4,i.size[1]*2))}}function Zn(){!el&&Yn&&(el=!0,requestAnimationFrame(lg))}function Pa(i){Zt(Number.isInteger(i)&&i>=0&&i{let s=(i*Ji.length+n)*28;e.position.set(qn.getFloat32(s,!0),qn.getFloat32(s+4,!0),qn.getFloat32(s+8,!0)),e.quaternion.set(qn.getFloat32(s+16,!0),qn.getFloat32(s+20,!0),qn.getFloat32(s+24,!0),qn.getFloat32(s+12,!0))}),Et("clock").textContent=t.t_seconds.toFixed(2)+" / 2.00 s",Et("contacts").textContent=String(t.contact_count),Et("status").textContent="Recorded frame "+(i+1)+"/101 · Native physics step 2 ms · "+Ji.length+" body poses · Browser physics: none.",Zn()}function lg(i){if(el=!1,an){let t=Math.min(ge.frame_count-1,Math.max($i,0,Math.floor((i-ol)/20)));t!==$i&&Pa(t),t===ge.frame_count-1&&(an=!1,Et("play").textContent="Play settling",Et("play").setAttribute("aria-pressed","false"))}Yn.render(mi,He),Et("canvas").dataset.renderCount=String(++ng),an&&Zn()}function sl(i){let t=Math.max(1,1/He.aspect),e=hh*t,n={home:[1.35,-1.75,1.15],top:[0,0,2.3],front:[0,-2.3,.3]};He.position.copy(nl).add(new L(...n[i]).multiplyScalar(e)),rn.target.copy(nl),rn.update(),Zn()}function cg(i){Zt(Et("canvas").getContext("webgl2"),"WebGL2 is unavailable."),Yn=new Ta({canvas:Et("canvas"),antialias:!0,alpha:!0,powerPreference:"low-power"}),Yn.setPixelRatio(Math.min(devicePixelRatio||1,2)),Yn.outputColorSpace=Ce,Yn.toneMapping=Or,Yn.toneMappingExposure=1.25,mi=new gs,He=new Ee(38,1,.005,30),He.up.set(0,0,1),rn=new Ra(He,Et("canvas")),rn.minDistance=.2,rn.maxDistance=10,rn.addEventListener("change",Zn),mi.add(new Es(16120831,12634548,2.6));let t=new zi(16777215,3);t.position.set(2,-2,4),mi.add(t);let e=new zi(14543359,.9);e.position.set(-2,2,2),mi.add(e);let n=new ws(4,40,11057053,13752777);n.rotation.x=Math.PI/2,n.position.z=5e-4,n.material.transparent=!0,n.material.opacity=.35,mi.add(n),Ji=ye.bodies.map(()=>{let o=new vn;return mi.add(o),o});let s=new Map,r=new DataView(i);for(let o of ye.meshes){let c=new Float32Array(o.vertex_count*3),l=new Uint32Array(o.index_count);for(let d=0;d0&&o.group<=2){let h=new Pe(c,new Bi({color:new Ot().setRGB(...l.slice(0,3),bn),metalness:o.type==="mesh"?.16:0,roughness:.6,transparent:l[3]<1,opacity:l[3],side:Ve}));h.position.fromArray(o.position),ch(o.quaternion_wxyz,h.quaternion),h.userData.body=o.body_id,h.userData.plane=o.type==="plane",Ji[o.body_id].add(h),Ia.push(h)}if(o.collision){let h=new Pe(c,new Bi({color:11891781,transparent:!0,opacity:.52,roughness:.8,depthWrite:!1,side:Ve}));h.position.fromArray(o.position),ch(o.quaternion_wxyz,h.quaternion),h.visible=!1,h.userData.body=o.body_id,Ji[o.body_id].add(h),al.push(h)}}Pa(100);let a=new hn;for(let o of Ia)o.userData.plane||(o.updateWorldMatrix(!0,!1),a.expandByObject(o));a.getCenter(nl),a.getSize(oh),hh=Math.max(.55,oh.length()*.59),new ResizeObserver(()=>{let o=Et("stage").getBoundingClientRect(),c=He.aspect;He.aspect=o.width/o.height,He.position.sub(rn.target).multiplyScalar(Math.max(1,1/He.aspect)/Math.max(1,1/c)).add(rn.target),He.updateProjectionMatrix(),Yn.setSize(o.width,o.height,!1),Zn()}).observe(Et("stage")),sl("home"),Et("canvas").addEventListener("webglcontextlost",o=>{o.preventDefault(),dh(new Error("WebGL context was lost. Reload to reopen the preview."))})}function rl(){let i=Et("pair").value,t=i==="all"?Rn.shoe_ids:Rn.shoe_ids.filter(r=>r===i+"-left"||r===i+"-right"),e=new Set(t.map(r=>"shoe_"+r.replaceAll("-","_"))),n=Et("collision").getAttribute("aria-pressed")==="true";for(let r of Ia)r.visible=!n&&(!ye.bodies[r.userData.body].name.startsWith("shoe_")||e.has(ye.bodies[r.userData.body].name));for(let r of al)r.visible=n&&(!ye.bodies[r.userData.body].name.startsWith("shoe_")||e.has(ye.bodies[r.userData.body].name));let s=Ca.shoes.find(r=>t.includes(r.id));Et("family").textContent=i==="all"?t.length+" instances":s.family.replaceAll("-"," "),Et("dimensions").textContent=i==="all"?"Varies by family":s.properties.dimensions_m.value.map(r=>r.toFixed(3)).join(" × "),Et("mass").textContent=i==="all"?"Varies by family":String(s.properties.mass_kg.value),Et("descriptor").href=i==="all"?"scene.json":"scenes/"+i+".json",Et("descriptor").download=Rn.robot+"-"+i+".scene.json",Et("command").textContent="dvidia-assets scene --robot "+Rn.robot+" --assets ./robot-assets --pair "+i+` --output ./shoe-scene +python -m http.server 8000 --directory ./shoe-scene`,Et("stage").dataset.selectedShoes=String(t.length),Zn()}function tl(){an=!an,Et("play").textContent=an?"Pause settling":"Play settling",Et("play").setAttribute("aria-pressed",String(an)),an&&($i===100&&Pa(0),ol=performance.now()-$i*20,Zn())}function hg(){document.querySelectorAll("[data-camera]").forEach(i=>i.addEventListener("click",()=>sl(i.dataset.camera))),Et("pair").addEventListener("change",rl),Et("play").addEventListener("click",tl),Et("timeline").addEventListener("input",()=>{Pa(Number(Et("timeline").value)),an&&(ol=performance.now()-$i*20)}),Et("collision").addEventListener("click",()=>{let i=Et("collision").getAttribute("aria-pressed")!=="true";Et("collision").setAttribute("aria-pressed",String(i)),Et("mode-label").textContent=i?"Native collision shapes":"Visual geometry",rl()}),Et("copy").addEventListener("click",async()=>{try{Zt(navigator.clipboard,"Clipboard unavailable; select the command text instead."),await navigator.clipboard.writeText(Et("command").textContent),Et("copy").textContent="Copied"}catch{let i=document.createRange();i.selectNodeContents(Et("command"));let t=window.getSelection();t.removeAllRanges(),t.addRange(i),Et("copy").textContent="Command selected"}}),Et("canvas").addEventListener("keydown",i=>{let t=i.key;if(["h","H","Home"].includes(t)){i.preventDefault(),sl("home");return}if(t===" "){i.preventDefault(),tl();return}if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","+","=","-","_"].includes(t))return;i.preventDefault();let e=He.position.clone().sub(rn.target),n=new Vn().setFromVector3(e.applyAxisAngle(new L(1,0,0),-Math.PI/2));t==="ArrowLeft"&&(n.theta-=.1),t==="ArrowRight"&&(n.theta+=.1),t==="ArrowUp"&&(n.phi=Math.max(.01,n.phi-.1)),t==="ArrowDown"&&(n.phi=Math.min(Math.PI-.01,n.phi+.1)),["+","="].includes(t)&&(n.radius=Math.max(.2,n.radius*.9)),["-","_"].includes(t)&&(n.radius=Math.min(10,n.radius/.9)),e.setFromSpherical(n).applyAxisAngle(new L(1,0,0),Math.PI/2),He.position.copy(rn.target).add(e),rn.update(),Zn()}),document.addEventListener("visibilitychange",()=>{document.hidden&&an&&tl()})}function dh(i){an=!1,Et("loading").hidden=!1,Et("loading").textContent="The 3D preview could not open. "+i.message+" Serve all exported files together over HTTP. The scene descriptor and catalog remain downloadable.",Et("stage").dataset.ready="error",document.querySelectorAll("button,select,input").forEach(t=>t.disabled=!0)}async function ug(){Zt(location.protocol!=="file:","Start a local HTTP server to open the exported files."),[ye,ge,Ca,Rn]=await Promise.all(["model.json","motion.json","catalog.json","scene.json"].map(sg));let[i,t]=await Promise.all([lh(ye.geometry_binary,"geometry.bin.gz"),lh(ge.motion_binary,"motion.bin.gz")]);ag(i,t),qn=new DataView(t),cg(i);let e=Ca.robots.find(s=>s.id===Rn.robot);Zt(e,"Robot missing from catalog."),Et("robot-name").textContent=e.name,Et("axes").textContent=e.arm_axes+" arm axes + "+e.gripper_command_axes+" gripper command",Et("subtitle").textContent=e.name+" · Pinned native geometry, synthetic shoe assets and a portable scene descriptor.";for(let s of[...Et("pair").options])s.value!=="all"&&!Rn.shoe_ids.some(r=>r===s.value+"-left"||r===s.value+"-right")&&s.remove();Rn.shoe_ids.length!==6&&(Et("pair").options[0].textContent="All loaded shoes");let n=new URLSearchParams(location.search).get("pair");[...Et("pair").options].some(s=>s.value===n)&&(Et("pair").value=n),hg(),rl(),document.querySelectorAll("button,select,input").forEach(s=>s.disabled=!1),Et("loading").hidden=!0,Et("stage").dataset.ready="true",Et("stage").dataset.visualGeoms=String(Ia.length),Et("stage").dataset.collisionGeoms=String(al.length),/\/previews\/(ur5e|piper|so101)\/(?:index\.html)?$/.test(location.pathname)&&(Et("robot-links").hidden=!1)}ug().catch(dh);})(); diff --git a/asset-library/v01/previews/piper/catalog.json b/asset-library/v01/previews/piper/catalog.json new file mode 100644 index 0000000000000000000000000000000000000000..f3ea25306b566c6f084f7acef8f46e36d6e4506f --- /dev/null +++ b/asset-library/v01/previews/piper/catalog.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-catalog/v1","version":"0.1.0","license":"MIT","license_scope":"Original DVIDIA catalog and procedural shoes only; robot simulation assets retain their individual licenses.","scope":"Reusable native scene assets with synthetic rigid shoes. Scene loading and gravity/contact checks do not demonstrate shoe manipulation, learning or physical robot transfer.","units":{"length":"m","mass":"kg","time":"s","angle":"rad","quaternion":"wxyz"},"world_frame":"right-handed; robot base reference at world origin, +z up","robots":[{"id":"ur5e","name":"UR5e + Robotiq 2F-85","version":"0.1.0","immutable_id":"dvidia/robots/ur5e-2f85@0.1.0","arm_axes":6,"gripper_command_axes":1,"gripper_mechanical_joints":8,"native_command_units":["rad","rad","rad","rad","rad","rad","native_0_255"],"gripper_command":"Native coupled gripper servo input [0,255]; not a measured gap or calibrated force.","licenses":{"universal_robots_ur5e":"BSD-3-Clause","robotiq_2f85":"BSD-2-Clause"},"source":{"repository":"https://github.com/google-deepmind/mujoco_menagerie","commit":"0059d4335f8156206f63a35662313385f7ad6d74","verification":"Packaged SHA256 allowlist; assets are read from verified bytes, without network access.","model_urls":["https://github.com/google-deepmind/mujoco_menagerie/tree/0059d4335f8156206f63a35662313385f7ad6d74/universal_robots_ur5e","https://github.com/google-deepmind/mujoco_menagerie/tree/0059d4335f8156206f63a35662313385f7ad6d74/robotiq_2f85"],"home_scope":"Authored scene initialization: UR5e and PiPER use the upstream home arm pose, zero gripper coordinates; SO101 uses its zero reference pose."},"home_joint_positions":{"shoulder_pan_joint":-1.5708,"shoulder_lift_joint":-1.5708,"elbow_joint":1.5708,"wrist_1_joint":-1.5708,"wrist_2_joint":-1.5708,"wrist_3_joint":0},"expected_dimensions":{"nq":14,"nv":14,"nu":7,"neq":3},"compatibility":{"scene_loading":true,"shoe_grasp_qualified":false,"physical_robot_ready":false,"scope":"Pinned native arm and gripper can share a rigid-shoe scene. This does not establish reachability, graspability, a shoe manipulation skill, or hardware compatibility."},"openness_scope":"These licenses cover pinned simulation assets; SDK and physical hardware design licenses are separate."},{"id":"piper","name":"AgileX PiPER","version":"0.1.0","immutable_id":"dvidia/robots/piper@0.1.0","arm_axes":6,"gripper_command_axes":1,"gripper_mechanical_joints":2,"native_command_units":["rad","rad","rad","rad","rad","rad","m"],"gripper_command":"single-finger slide target in metres, native range [0,0.035]; not total jaw gap","licenses":{"agilex_piper":"MIT"},"source":{"repository":"https://github.com/google-deepmind/mujoco_menagerie","commit":"0059d4335f8156206f63a35662313385f7ad6d74","verification":"Packaged SHA256 allowlist; assets are read from verified bytes, without network access.","model_urls":["https://github.com/google-deepmind/mujoco_menagerie/tree/0059d4335f8156206f63a35662313385f7ad6d74/agilex_piper"],"home_scope":"Authored scene initialization: UR5e and PiPER use the upstream home arm pose, zero gripper coordinates; SO101 uses its zero reference pose."},"home_joint_positions":{"joint1":0,"joint2":1.57,"joint3":-1.3485,"joint4":0,"joint5":0,"joint6":0,"joint7":0,"joint8":0},"expected_dimensions":{"nq":8,"nv":8,"nu":7,"neq":1},"compatibility":{"scene_loading":true,"shoe_grasp_qualified":false,"physical_robot_ready":false,"scope":"Pinned native arm and gripper can share a rigid-shoe scene. This does not establish reachability, graspability, a shoe manipulation skill, or hardware compatibility."},"openness_scope":"These licenses cover pinned simulation assets; SDK and physical hardware design licenses are separate."},{"id":"so101","name":"The Robot Studio SO101","version":"0.1.0","immutable_id":"dvidia/robots/so101@0.1.0","arm_axes":5,"gripper_command_axes":1,"gripper_mechanical_joints":1,"native_command_units":["rad","rad","rad","rad","rad","rad"],"gripper_command":"moving-jaw hinge angle target in radians; not linear jaw gap","licenses":{"robotstudio_so101":"Apache-2.0"},"source":{"repository":"https://github.com/google-deepmind/mujoco_menagerie","commit":"0059d4335f8156206f63a35662313385f7ad6d74","verification":"Packaged SHA256 allowlist; assets are read from verified bytes, without network access.","model_urls":["https://github.com/google-deepmind/mujoco_menagerie/tree/0059d4335f8156206f63a35662313385f7ad6d74/robotstudio_so101"],"home_scope":"Authored scene initialization: UR5e and PiPER use the upstream home arm pose, zero gripper coordinates; SO101 uses its zero reference pose."},"home_joint_positions":{"shoulder_pan":0,"shoulder_lift":0,"elbow_flex":0,"wrist_flex":0,"wrist_roll":0,"gripper":0},"expected_dimensions":{"nq":6,"nv":6,"nu":6,"neq":0},"compatibility":{"scene_loading":true,"shoe_grasp_qualified":false,"physical_robot_ready":false,"scope":"Pinned native arm and gripper can share a rigid-shoe scene. This does not establish reachability, graspability, a shoe manipulation skill, or hardware compatibility."},"openness_scope":"These licenses cover pinned simulation assets; SDK and physical hardware design licenses are separate."}],"shoes":[{"id":"trainer-left","name":"Trainer / left","version":"0.1.0","immutable_id":"dvidia/shoes/trainer-left@0.1.0","family":"trainer","pair_id":"dvidia/shoes/trainer-pair@0.1.0","side":"left","license":"MIT","source":{"kind":"original_procedural","author":"DVIDIA","scope":"New primitive geometry; no redistributed scans, videos, photographs or model weights."},"properties":{"dimensions_m":{"value":[0.28,0.1,0.087],"units":"m; length x, width y, maximum height z","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_kg":{"value":0.3,"units":"kg","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"sliding_friction":{"value":0.8,"units":"dimensionless","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"torsional_friction":{"value":0.005,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"rolling_friction":{"value":0.0001,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_distribution":{"value":"Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.","units":"model assumption","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"deformation":{"value":"Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.","units":"model class","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"contact_solver":{"value":{"condim":4,"priority":1,"solref":[0.02,1],"solimp":[0.9,0.95,0.001,0.5,2]},"units":"MuJoCo solver parameters; no calibrated stiffness or damping","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."}},"frame":{"origin":"sole bottom center","axes":"right-handed; +x toward toe, +y lateral, +z up","sole_bottom_z_m":0,"initial_bottom_z_m":0.08},"geometry":[{"name":"sole","type":"box","size_m":[0.14,0.05,0.01],"position_m":[0,0,0.01],"mass_fraction":0.35,"rgba":[0.16,0.17,0.18,1]},{"name":"upper","type":"ellipsoid","size_m":[0.122,0.047,0.035],"position_m":[-0.005,0.003,0.052],"mass_fraction":0.55,"rgba":[0.2,0.38,0.58,1]},{"name":"toe","type":"ellipsoid","size_m":[0.04,0.047,0.026],"position_m":[0.095,0.003,0.045],"mass_fraction":0.1,"rgba":[0.78,0.82,0.83,1]}],"fidelity":{"geometry":"authored coarse proxy","native_contact":"available for numerical testing","measured_contact":"untested","deformation":"unsupported","shoe_grasp_qualified":false,"physical_robot_ready":false}},{"id":"trainer-right","name":"Trainer / right","version":"0.1.0","immutable_id":"dvidia/shoes/trainer-right@0.1.0","family":"trainer","pair_id":"dvidia/shoes/trainer-pair@0.1.0","side":"right","license":"MIT","source":{"kind":"original_procedural","author":"DVIDIA","scope":"New primitive geometry; no redistributed scans, videos, photographs or model weights."},"properties":{"dimensions_m":{"value":[0.28,0.1,0.087],"units":"m; length x, width y, maximum height z","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_kg":{"value":0.3,"units":"kg","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"sliding_friction":{"value":0.8,"units":"dimensionless","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"torsional_friction":{"value":0.005,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"rolling_friction":{"value":0.0001,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_distribution":{"value":"Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.","units":"model assumption","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"deformation":{"value":"Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.","units":"model class","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"contact_solver":{"value":{"condim":4,"priority":1,"solref":[0.02,1],"solimp":[0.9,0.95,0.001,0.5,2]},"units":"MuJoCo solver parameters; no calibrated stiffness or damping","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."}},"frame":{"origin":"sole bottom center","axes":"right-handed; +x toward toe, +y lateral, +z up","sole_bottom_z_m":0,"initial_bottom_z_m":0.08},"geometry":[{"name":"sole","type":"box","size_m":[0.14,0.05,0.01],"position_m":[0,0,0.01],"mass_fraction":0.35,"rgba":[0.16,0.17,0.18,1]},{"name":"upper","type":"ellipsoid","size_m":[0.122,0.047,0.035],"position_m":[-0.005,-0.003,0.052],"mass_fraction":0.55,"rgba":[0.2,0.38,0.58,1]},{"name":"toe","type":"ellipsoid","size_m":[0.04,0.047,0.026],"position_m":[0.095,-0.003,0.045],"mass_fraction":0.1,"rgba":[0.78,0.82,0.83,1]}],"fidelity":{"geometry":"authored coarse proxy","native_contact":"available for numerical testing","measured_contact":"untested","deformation":"unsupported","shoe_grasp_qualified":false,"physical_robot_ready":false}},{"id":"ankle-boot-left","name":"Ankle Boot / left","version":"0.1.0","immutable_id":"dvidia/shoes/ankle-boot-left@0.1.0","family":"ankle-boot","pair_id":"dvidia/shoes/ankle-boot-pair@0.1.0","side":"left","license":"MIT","source":{"kind":"original_procedural","author":"DVIDIA","scope":"New primitive geometry; no redistributed scans, videos, photographs or model weights."},"properties":{"dimensions_m":{"value":[0.29,0.108,0.19],"units":"m; length x, width y, maximum height z","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_kg":{"value":0.5,"units":"kg","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"sliding_friction":{"value":0.9,"units":"dimensionless","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"torsional_friction":{"value":0.005,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"rolling_friction":{"value":0.0001,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_distribution":{"value":"Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.","units":"model assumption","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"deformation":{"value":"Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.","units":"model class","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"contact_solver":{"value":{"condim":4,"priority":1,"solref":[0.02,1],"solimp":[0.9,0.95,0.001,0.5,2]},"units":"MuJoCo solver parameters; no calibrated stiffness or damping","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."}},"frame":{"origin":"sole bottom center","axes":"right-handed; +x toward toe, +y lateral, +z up","sole_bottom_z_m":0,"initial_bottom_z_m":0.08},"geometry":[{"name":"sole","type":"box","size_m":[0.145,0.054,0.012],"position_m":[0,0,0.012],"mass_fraction":0.35,"rgba":[0.16,0.17,0.18,1]},{"name":"upper","type":"ellipsoid","size_m":[0.13,0.05,0.04],"position_m":[0.01,0.004,0.064],"mass_fraction":0.3,"rgba":[0.37,0.24,0.16,1]},{"name":"ankle","type":"ellipsoid","size_m":[0.047,0.049,0.055],"position_m":[-0.085,0.004,0.135],"mass_fraction":0.35,"rgba":[0.37,0.24,0.16,1]}],"fidelity":{"geometry":"authored coarse proxy","native_contact":"available for numerical testing","measured_contact":"untested","deformation":"unsupported","shoe_grasp_qualified":false,"physical_robot_ready":false}},{"id":"ankle-boot-right","name":"Ankle Boot / right","version":"0.1.0","immutable_id":"dvidia/shoes/ankle-boot-right@0.1.0","family":"ankle-boot","pair_id":"dvidia/shoes/ankle-boot-pair@0.1.0","side":"right","license":"MIT","source":{"kind":"original_procedural","author":"DVIDIA","scope":"New primitive geometry; no redistributed scans, videos, photographs or model weights."},"properties":{"dimensions_m":{"value":[0.29,0.108,0.19],"units":"m; length x, width y, maximum height z","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_kg":{"value":0.5,"units":"kg","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"sliding_friction":{"value":0.9,"units":"dimensionless","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"torsional_friction":{"value":0.005,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"rolling_friction":{"value":0.0001,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_distribution":{"value":"Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.","units":"model assumption","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"deformation":{"value":"Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.","units":"model class","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"contact_solver":{"value":{"condim":4,"priority":1,"solref":[0.02,1],"solimp":[0.9,0.95,0.001,0.5,2]},"units":"MuJoCo solver parameters; no calibrated stiffness or damping","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."}},"frame":{"origin":"sole bottom center","axes":"right-handed; +x toward toe, +y lateral, +z up","sole_bottom_z_m":0,"initial_bottom_z_m":0.08},"geometry":[{"name":"sole","type":"box","size_m":[0.145,0.054,0.012],"position_m":[0,0,0.012],"mass_fraction":0.35,"rgba":[0.16,0.17,0.18,1]},{"name":"upper","type":"ellipsoid","size_m":[0.13,0.05,0.04],"position_m":[0.01,-0.004,0.064],"mass_fraction":0.3,"rgba":[0.37,0.24,0.16,1]},{"name":"ankle","type":"ellipsoid","size_m":[0.047,0.049,0.055],"position_m":[-0.085,-0.004,0.135],"mass_fraction":0.35,"rgba":[0.37,0.24,0.16,1]}],"fidelity":{"geometry":"authored coarse proxy","native_contact":"available for numerical testing","measured_contact":"untested","deformation":"unsupported","shoe_grasp_qualified":false,"physical_robot_ready":false}},{"id":"slipper-left","name":"Slipper / left","version":"0.1.0","immutable_id":"dvidia/shoes/slipper-left@0.1.0","family":"slipper","pair_id":"dvidia/shoes/slipper-pair@0.1.0","side":"left","license":"MIT","source":{"kind":"original_procedural","author":"DVIDIA","scope":"New primitive geometry; no redistributed scans, videos, photographs or model weights."},"properties":{"dimensions_m":{"value":[0.27,0.102,0.055],"units":"m; length x, width y, maximum height z","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_kg":{"value":0.15,"units":"kg","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"sliding_friction":{"value":0.65,"units":"dimensionless","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"torsional_friction":{"value":0.005,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"rolling_friction":{"value":0.0001,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_distribution":{"value":"Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.","units":"model assumption","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"deformation":{"value":"Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.","units":"model class","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"contact_solver":{"value":{"condim":4,"priority":1,"solref":[0.02,1],"solimp":[0.9,0.95,0.001,0.5,2]},"units":"MuJoCo solver parameters; no calibrated stiffness or damping","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."}},"frame":{"origin":"sole bottom center","axes":"right-handed; +x toward toe, +y lateral, +z up","sole_bottom_z_m":0,"initial_bottom_z_m":0.08},"geometry":[{"name":"sole","type":"box","size_m":[0.135,0.051,0.009],"position_m":[0,0,0.009],"mass_fraction":0.35,"rgba":[0.16,0.17,0.18,1]},{"name":"upper","type":"ellipsoid","size_m":[0.09,0.049,0.017],"position_m":[0.045,0.002,0.038],"mass_fraction":0.65,"rgba":[0.52,0.31,0.37,1]}],"fidelity":{"geometry":"authored coarse proxy","native_contact":"available for numerical testing","measured_contact":"untested","deformation":"unsupported","shoe_grasp_qualified":false,"physical_robot_ready":false}},{"id":"slipper-right","name":"Slipper / right","version":"0.1.0","immutable_id":"dvidia/shoes/slipper-right@0.1.0","family":"slipper","pair_id":"dvidia/shoes/slipper-pair@0.1.0","side":"right","license":"MIT","source":{"kind":"original_procedural","author":"DVIDIA","scope":"New primitive geometry; no redistributed scans, videos, photographs or model weights."},"properties":{"dimensions_m":{"value":[0.27,0.102,0.055],"units":"m; length x, width y, maximum height z","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_kg":{"value":0.15,"units":"kg","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"sliding_friction":{"value":0.65,"units":"dimensionless","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"torsional_friction":{"value":0.005,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"rolling_friction":{"value":0.0001,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_distribution":{"value":"Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.","units":"model assumption","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"deformation":{"value":"Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.","units":"model class","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"contact_solver":{"value":{"condim":4,"priority":1,"solref":[0.02,1],"solimp":[0.9,0.95,0.001,0.5,2]},"units":"MuJoCo solver parameters; no calibrated stiffness or damping","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."}},"frame":{"origin":"sole bottom center","axes":"right-handed; +x toward toe, +y lateral, +z up","sole_bottom_z_m":0,"initial_bottom_z_m":0.08},"geometry":[{"name":"sole","type":"box","size_m":[0.135,0.051,0.009],"position_m":[0,0,0.009],"mass_fraction":0.35,"rgba":[0.16,0.17,0.18,1]},{"name":"upper","type":"ellipsoid","size_m":[0.09,0.049,0.017],"position_m":[0.045,-0.002,0.038],"mass_fraction":0.65,"rgba":[0.52,0.31,0.37,1]}],"fidelity":{"geometry":"authored coarse proxy","native_contact":"available for numerical testing","measured_contact":"untested","deformation":"unsupported","shoe_grasp_qualified":false,"physical_robot_ready":false}}],"environment":{"id":"open-support-plane","version":"0.1.0","license":"MIT","geometry":"Infinite collision plane at z=0; displayed with 2 m half extents. Not a finite tabletop or rack.","name":"asset_table","gravity_m_s2":[0,0,-9.81],"property_evidence":"untested authored environment","default_layout":"Three columns x=.40,.76,1.12 m; two rows y=.38,.56 m; sole bottoms begin z=.08 m. Layout separates loading tests from reachability claims."},"limitations":["All shoe physical properties are untested synthetic assumptions.","Left/right labels identify mirrored procedural instances, not scanned real shoes.","Arm command interfaces differ; installing a scene does not install a learned controller.","No deformation, real-world calibration, graspability claim or closed-loop sensor stack."],"catalog_sha256":"592f363389a96fef7f9223737aa72a2f1a74f400238924bf6790ec5bfd3302b7"} diff --git a/asset-library/v01/previews/piper/geometry.bin.gz b/asset-library/v01/previews/piper/geometry.bin.gz new file mode 100644 index 0000000000000000000000000000000000000000..0178bd9b249beefb66c862cbc507dee60d01391c --- /dev/null +++ b/asset-library/v01/previews/piper/geometry.bin.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:51365a5a661d8062e28c66abc6bdb843ee410811f84b49d62c5878c265b3631f +size 3574720 diff --git a/asset-library/v01/previews/piper/index.html b/asset-library/v01/previews/piper/index.html new file mode 100644 index 0000000000000000000000000000000000000000..843d8afcbe1c31af867095f8ee47af0f07813da9 --- /dev/null +++ b/asset-library/v01/previews/piper/index.html @@ -0,0 +1,4 @@ + +DVIDIA · Asset library
DVIDIA RESEARCHResearch footprints ↗

A scene you can take with you.

Loading a reusable arm and shoe scene from the local asset library.

Recorded native 3D sceneVisual geometry
Drag to orbit · Scroll or pinch to zoom · Arrow keys orbit · + / − zoom · H home
Opening local geometry and recorded body poses…
2.00 / 2.00 s
Browser physics: none. Native body poses were recorded locally.

Geometry you can inspect. Assumptions you can see.

The arm uses its pinned upstream meshes and joint mechanism. Each shoe combines original boxes and ellipsoids for a lightweight collision model. The left and right instances have persistent identities.

Shoe mass, friction, size and shape are authored assumptions. These rigid proxies do not reproduce real shoe deformation, laces, fabric, insole compression or calibrated grasp forces.

What this preview measures.

A two-second native settling run under gravity, with arm commands held at initialization. Use the timeline to inspect initial and settled states, and collision mode to see the surfaces used by the engine.

It does not demonstrate a learned shoe-organizing policy, grasp success, physical transfer or a real-time guarantee. The browser replays Float32 body poses; the simulation used native precision.

diff --git a/asset-library/v01/previews/piper/licenses/agilex_piper/LICENSE b/asset-library/v01/previews/piper/licenses/agilex_piper/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..1ace5a240f199be4ae0567bed99051213893345c --- /dev/null +++ b/asset-library/v01/previews/piper/licenses/agilex_piper/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 RosenYin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/asset-library/v01/previews/piper/licenses/agilex_piper/README.md b/asset-library/v01/previews/piper/licenses/agilex_piper/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7a300b81e0556b580ed4e4942bf0aaa9c90944a8 --- /dev/null +++ b/asset-library/v01/previews/piper/licenses/agilex_piper/README.md @@ -0,0 +1,39 @@ +## AgileX PiPER Description (MJCF) + +> [!IMPORTANT] +> Requires MuJoCo 2.3.4 or later. + +## Changelog + +See [CHANGELOG.md](./CHANGELOG.md) for a full history of changes. + +### Overview + +This package contains a simplified robot description (MJCF) of the [AgileX PiPER](https://global.agilex.ai/products/piper). It is derived from the publicly available [model](https://github.com/agilexrobotics/Piper_ros/tree/ros-noetic-no-aloha/src/piper_description/urdf). + +

+ +

+ +### Derivation steps + +1. Added ` ` to the URDF's + `` clause in order to preserve visual geometries. +2. Loaded the URDF into MuJoCo and saved a corresponding MJCF. +3. Converted the the .objs to .xmls using [obj2mjcf](https://github.com/kevinzakka/obj2mjcf) and replaced the original stls with them (since each obj in mujoco can have 1 color). +4. Merged similar materials between the .objs +5. Created a `` section to define common properties for joints, actuators, and geoms. +6. Added an equality constraint so that the right finger mimics the position of the left finger. +7. Manually designed box collision geoms for the gripper. +8. Added `exclude` clause to prevent collisions between `base_link` and `link1`. +9. Added position controlled actuators. +10. Added `impratio=10` and `cone=elliptic` for better noslip. +11. Added `scene.xml` which includes the robot, with a textured groundplane, skybox, and haze. + +## License + +This model is released under an [MIT License](LICENSE). + +## Acknowledgement + +This model was graciously contributed by [Omar Rayyan](https://orayyan.com/). diff --git a/asset-library/v01/previews/piper/model.json b/asset-library/v01/previews/piper/model.json new file mode 100644 index 0000000000000000000000000000000000000000..75e3e112cdc184d88e8f170aaa4ebd22c9b08dfd --- /dev/null +++ b/asset-library/v01/previews/piper/model.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-preview-model/v1","meshes":[{"id":0,"position_byte_offset":0,"vertex_count":15416,"native_vertex_count":29901,"index_byte_offset":184992,"index_count":92526},{"id":1,"position_byte_offset":555096,"vertex_count":674,"native_vertex_count":851,"index_byte_offset":563184,"index_count":3951},{"id":2,"position_byte_offset":578988,"vertex_count":672,"native_vertex_count":866,"index_byte_offset":587052,"index_count":3939},{"id":3,"position_byte_offset":602808,"vertex_count":1093,"native_vertex_count":2882,"index_byte_offset":615924,"index_count":6405},{"id":4,"position_byte_offset":641544,"vertex_count":1095,"native_vertex_count":2831,"index_byte_offset":654684,"index_count":6417},{"id":5,"position_byte_offset":680352,"vertex_count":100,"native_vertex_count":333,"index_byte_offset":681552,"index_count":588},{"id":6,"position_byte_offset":683904,"vertex_count":98,"native_vertex_count":341,"index_byte_offset":685080,"index_count":576},{"id":7,"position_byte_offset":687384,"vertex_count":188,"native_vertex_count":570,"index_byte_offset":689640,"index_count":1128},{"id":8,"position_byte_offset":694152,"vertex_count":174,"native_vertex_count":606,"index_byte_offset":696240,"index_count":1032},{"id":9,"position_byte_offset":700368,"vertex_count":172,"native_vertex_count":630,"index_byte_offset":702432,"index_count":1020},{"id":10,"position_byte_offset":706512,"vertex_count":100,"native_vertex_count":335,"index_byte_offset":707712,"index_count":588},{"id":11,"position_byte_offset":710064,"vertex_count":182,"native_vertex_count":662,"index_byte_offset":712248,"index_count":1080},{"id":12,"position_byte_offset":716568,"vertex_count":172,"native_vertex_count":632,"index_byte_offset":718632,"index_count":1020},{"id":13,"position_byte_offset":722712,"vertex_count":100,"native_vertex_count":338,"index_byte_offset":723912,"index_count":588},{"id":14,"position_byte_offset":726264,"vertex_count":184,"native_vertex_count":680,"index_byte_offset":728472,"index_count":1092},{"id":15,"position_byte_offset":732840,"vertex_count":100,"native_vertex_count":335,"index_byte_offset":734040,"index_count":588},{"id":16,"position_byte_offset":736392,"vertex_count":174,"native_vertex_count":610,"index_byte_offset":738480,"index_count":1032},{"id":17,"position_byte_offset":742608,"vertex_count":100,"native_vertex_count":333,"index_byte_offset":743808,"index_count":588},{"id":18,"position_byte_offset":746160,"vertex_count":80,"native_vertex_count":268,"index_byte_offset":747120,"index_count":468},{"id":19,"position_byte_offset":748992,"vertex_count":106,"native_vertex_count":364,"index_byte_offset":750264,"index_count":624},{"id":20,"position_byte_offset":752760,"vertex_count":146,"native_vertex_count":482,"index_byte_offset":754512,"index_count":876},{"id":21,"position_byte_offset":758016,"vertex_count":132,"native_vertex_count":434,"index_byte_offset":759600,"index_count":780},{"id":22,"position_byte_offset":762720,"vertex_count":106,"native_vertex_count":352,"index_byte_offset":763992,"index_count":624},{"id":23,"position_byte_offset":766488,"vertex_count":150,"native_vertex_count":488,"index_byte_offset":768288,"index_count":900},{"id":24,"position_byte_offset":771888,"vertex_count":132,"native_vertex_count":443,"index_byte_offset":773472,"index_count":780},{"id":25,"position_byte_offset":776592,"vertex_count":82,"native_vertex_count":272,"index_byte_offset":777576,"index_count":480},{"id":26,"position_byte_offset":779496,"vertex_count":188,"native_vertex_count":577,"index_byte_offset":781752,"index_count":1128},{"id":27,"position_byte_offset":786264,"vertex_count":82,"native_vertex_count":275,"index_byte_offset":787248,"index_count":480},{"id":28,"position_byte_offset":789168,"vertex_count":46,"native_vertex_count":145,"index_byte_offset":789720,"index_count":264},{"id":29,"position_byte_offset":790776,"vertex_count":82,"native_vertex_count":285,"index_byte_offset":791760,"index_count":480},{"id":30,"position_byte_offset":793680,"vertex_count":46,"native_vertex_count":139,"index_byte_offset":794232,"index_count":264},{"id":31,"position_byte_offset":795288,"vertex_count":13871,"native_vertex_count":48138,"index_byte_offset":961740,"index_count":83442},{"id":32,"position_byte_offset":1295508,"vertex_count":967,"native_vertex_count":3545,"index_byte_offset":1307112,"index_count":4467},{"id":33,"position_byte_offset":1324980,"vertex_count":19,"native_vertex_count":51,"index_byte_offset":1325208,"index_count":51},{"id":34,"position_byte_offset":1325412,"vertex_count":53,"native_vertex_count":153,"index_byte_offset":1326048,"index_count":153},{"id":35,"position_byte_offset":1326660,"vertex_count":84,"native_vertex_count":252,"index_byte_offset":1327668,"index_count":252},{"id":36,"position_byte_offset":1328676,"vertex_count":101,"native_vertex_count":297,"index_byte_offset":1329888,"index_count":297},{"id":37,"position_byte_offset":1331076,"vertex_count":115,"native_vertex_count":345,"index_byte_offset":1332456,"index_count":345},{"id":38,"position_byte_offset":1333836,"vertex_count":955,"native_vertex_count":3510,"index_byte_offset":1345296,"index_count":4410},{"id":39,"position_byte_offset":1362936,"vertex_count":74,"native_vertex_count":222,"index_byte_offset":1363824,"index_count":222},{"id":40,"position_byte_offset":1364712,"vertex_count":19,"native_vertex_count":51,"index_byte_offset":1364940,"index_count":51},{"id":41,"position_byte_offset":1365144,"vertex_count":51,"native_vertex_count":147,"index_byte_offset":1365756,"index_count":147},{"id":42,"position_byte_offset":1366344,"vertex_count":83,"native_vertex_count":249,"index_byte_offset":1367340,"index_count":249},{"id":43,"position_byte_offset":1368336,"vertex_count":101,"native_vertex_count":297,"index_byte_offset":1369548,"index_count":297},{"id":44,"position_byte_offset":1370736,"vertex_count":114,"native_vertex_count":342,"index_byte_offset":1372104,"index_count":342},{"id":45,"position_byte_offset":1373472,"vertex_count":10646,"native_vertex_count":19376,"index_byte_offset":1501224,"index_count":64206},{"id":46,"position_byte_offset":1758048,"vertex_count":1030,"native_vertex_count":3918,"index_byte_offset":1770408,"index_count":6324},{"id":47,"position_byte_offset":1795704,"vertex_count":1007,"native_vertex_count":4620,"index_byte_offset":1807788,"index_count":6342},{"id":48,"position_byte_offset":1833156,"vertex_count":977,"native_vertex_count":3604,"index_byte_offset":1844880,"index_count":5982},{"id":49,"position_byte_offset":1868808,"vertex_count":1410,"native_vertex_count":5240,"index_byte_offset":1885728,"index_count":8754},{"id":50,"position_byte_offset":1920744,"vertex_count":1150,"native_vertex_count":4912,"index_byte_offset":1934544,"index_count":6984},{"id":51,"position_byte_offset":1962480,"vertex_count":853,"native_vertex_count":4252,"index_byte_offset":1972716,"index_count":5106},{"id":52,"position_byte_offset":1993140,"vertex_count":1135,"native_vertex_count":3948,"index_byte_offset":2006760,"index_count":6990},{"id":53,"position_byte_offset":2034720,"vertex_count":1807,"native_vertex_count":3884,"index_byte_offset":2056404,"index_count":10938},{"id":54,"position_byte_offset":2100156,"vertex_count":1125,"native_vertex_count":4069,"index_byte_offset":2113656,"index_count":6774},{"id":55,"position_byte_offset":2140752,"vertex_count":114,"native_vertex_count":302,"index_byte_offset":2142120,"index_count":672},{"id":56,"position_byte_offset":2144808,"vertex_count":114,"native_vertex_count":298,"index_byte_offset":2146176,"index_count":672},{"id":57,"position_byte_offset":2148864,"vertex_count":114,"native_vertex_count":303,"index_byte_offset":2150232,"index_count":672},{"id":58,"position_byte_offset":2152920,"vertex_count":1893,"native_vertex_count":6247,"index_byte_offset":2175636,"index_count":11418},{"id":59,"position_byte_offset":2221308,"vertex_count":1462,"native_vertex_count":3907,"index_byte_offset":2238852,"index_count":8868},{"id":60,"position_byte_offset":2274324,"vertex_count":2308,"native_vertex_count":4618,"index_byte_offset":2302020,"index_count":13932},{"id":61,"position_byte_offset":2357748,"vertex_count":2002,"native_vertex_count":3448,"index_byte_offset":2381772,"index_count":12006},{"id":62,"position_byte_offset":2429796,"vertex_count":962,"native_vertex_count":1699,"index_byte_offset":2441340,"index_count":5784},{"id":63,"position_byte_offset":2464476,"vertex_count":1147,"native_vertex_count":4242,"index_byte_offset":2478240,"index_count":6966},{"id":64,"position_byte_offset":2506104,"vertex_count":858,"native_vertex_count":3556,"index_byte_offset":2516400,"index_count":5136},{"id":65,"position_byte_offset":2536944,"vertex_count":1180,"native_vertex_count":3157,"index_byte_offset":2551104,"index_count":7200},{"id":66,"position_byte_offset":2579904,"vertex_count":530,"native_vertex_count":782,"index_byte_offset":2586264,"index_count":3168},{"id":67,"position_byte_offset":2598936,"vertex_count":2738,"native_vertex_count":4097,"index_byte_offset":2631792,"index_count":16428},{"id":68,"position_byte_offset":2697504,"vertex_count":579,"native_vertex_count":2714,"index_byte_offset":2704452,"index_count":3570},{"id":69,"position_byte_offset":2718732,"vertex_count":2062,"native_vertex_count":7479,"index_byte_offset":2743476,"index_count":12348},{"id":70,"position_byte_offset":2792868,"vertex_count":3438,"native_vertex_count":11360,"index_byte_offset":2834124,"index_count":21048},{"id":71,"position_byte_offset":2918316,"vertex_count":853,"native_vertex_count":3822,"index_byte_offset":2928552,"index_count":5106},{"id":72,"position_byte_offset":2948976,"vertex_count":5268,"native_vertex_count":5346,"index_byte_offset":3012192,"index_count":32100},{"id":73,"position_byte_offset":3140592,"vertex_count":9288,"native_vertex_count":9316,"index_byte_offset":3252048,"index_count":56280},{"id":74,"position_byte_offset":3477168,"vertex_count":35879,"native_vertex_count":35879,"index_byte_offset":3907716,"index_count":215748},{"id":75,"position_byte_offset":4770708,"vertex_count":416,"native_vertex_count":416,"index_byte_offset":4775700,"index_count":2472},{"id":76,"position_byte_offset":4785588,"vertex_count":26759,"native_vertex_count":26799,"index_byte_offset":5106696,"index_count":162210},{"id":77,"position_byte_offset":5755536,"vertex_count":7277,"native_vertex_count":7280,"index_byte_offset":5842860,"index_count":43824},{"id":78,"position_byte_offset":6018156,"vertex_count":11378,"native_vertex_count":11378,"index_byte_offset":6154692,"index_count":68868},{"id":79,"position_byte_offset":6430164,"vertex_count":6637,"native_vertex_count":6637,"index_byte_offset":6509808,"index_count":40266},{"id":80,"position_byte_offset":6670872,"vertex_count":913,"native_vertex_count":913,"index_byte_offset":6681828,"index_count":5514},{"id":81,"position_byte_offset":6703884,"vertex_count":913,"native_vertex_count":913,"index_byte_offset":6714840,"index_count":5508}],"geoms":[{"geom_id":0,"name":"asset_table","body_id":0,"type":"plane","group":0,"size":[2.0,2.0,0.1],"position":[0.0,0.0,0.0],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.8799999952316284,0.8600000143051147,0.8100000023841858,1.0],"mesh_id":null,"collision":true},{"geom_id":1,"name":"unnamed_1","body_id":1,"type":"mesh","group":2,"size":[0.04005430873547189,0.0518946189530412,0.05322922765807294],"position":[-0.010742240249316597,1.8614716608737522e-06,0.03952594401690165],"quaternion_wxyz":[0.5367264434937438,0.4609018334827974,0.4602605132796053,0.5363343030819022],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":72,"collision":false},{"geom_id":2,"name":"unnamed_2","body_id":1,"type":"capsule","group":3,"size":[0.0357690988458784,0.024065028045884927,0.0],"position":[-0.010742240249316597,1.8614716608737522e-06,0.03952594401690165],"quaternion_wxyz":[0.5367264434937438,0.4609018334827974,0.4602605132796053,0.5363343030819022],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":3,"name":"unnamed_3","body_id":2,"type":"mesh","group":2,"size":[0.03725009884744519,0.037513186691238945,0.04246671988668233],"position":[0.0010146434605729359,-0.0001882178325713574,-0.005633981292723288],"quaternion_wxyz":[0.5191402605461083,0.4840993250814063,0.4995135887316418,0.49661595625622507],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":73,"collision":false},{"geom_id":4,"name":"unnamed_4","body_id":2,"type":"capsule","group":3,"size":[0.027164503297033106,0.018294298700001498,0.0],"position":[0.0010146434605729359,-0.0001882178325713574,-0.005633981292723288],"quaternion_wxyz":[0.5191402605461083,0.4840993250814063,0.4995135887316418,0.49661595625622507],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":5,"name":"unnamed_5","body_id":3,"type":"mesh","group":2,"size":[0.05909321496115791,0.04517927881079196,0.184290798884557],"position":[0.15304400816439112,-0.003503491808980195,-2.738976113831874e-05],"quaternion_wxyz":[0.49011814968388806,0.4913395467813046,0.5084564732002705,0.509746666472601],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":0,"collision":false},{"geom_id":6,"name":"unnamed_6","body_id":3,"type":"mesh","group":2,"size":[0.00271711664874536,0.029751643776387594,0.04341013935730474],"position":[0.27948545709559147,0.024769301942656172,-0.04656198017251689],"quaternion_wxyz":[-0.25009505253270853,0.6631228043038169,0.2526230505960187,0.6587125362542213],"rgba":[0.14000000059604645,0.14000000059604645,0.14000000059604645,1.0],"mesh_id":1,"collision":false},{"geom_id":7,"name":"unnamed_7","body_id":3,"type":"mesh","group":2,"size":[0.003136751821072282,0.029746308220009343,0.043158328023761856],"position":[0.2793017340086949,0.024585403960636108,0.04656675557396001],"quaternion_wxyz":[-0.2521699751847445,0.6587328955041599,0.24944642499900355,0.6635192213125793],"rgba":[0.14000000059604645,0.14000000059604645,0.14000000059604645,1.0],"mesh_id":2,"collision":false},{"geom_id":8,"name":"unnamed_8","body_id":3,"type":"mesh","group":2,"size":[0.0029099314378550757,0.028458174413305,0.03739759804297333],"position":[0.004710809963368593,-0.0004168965498290116,-0.04670562582435116],"quaternion_wxyz":[0.031292595672695746,0.7029288583424248,-0.030998101900458857,0.7098950001542855],"rgba":[0.0860000029206276,0.0860000029206276,0.0860000029206276,1.0],"mesh_id":3,"collision":false},{"geom_id":9,"name":"unnamed_9","body_id":3,"type":"mesh","group":2,"size":[0.003298678557749073,0.02845978069681312,0.037121069233510474],"position":[0.0049871723097605946,-0.00044369508034975633,0.0467131565893143],"quaternion_wxyz":[0.03107012938628124,0.7101854684211063,-0.03138179811536879,0.7026282304679077],"rgba":[0.0860000029206276,0.0860000029206276,0.0860000029206276,1.0],"mesh_id":4,"collision":false},{"geom_id":10,"name":"unnamed_10","body_id":3,"type":"mesh","group":2,"size":[5.0010159611736856e-05,0.00022595145308979564,0.00023383379231170875],"position":[0.2779316449986617,0.04183130496050511,-0.04724997095763687],"quaternion_wxyz":[-0.0027035390834398683,0.7071016128368159,0.0027035390834398683,0.7071016128368159],"rgba":[0.8199999928474426,0.15000000596046448,0.15000000596046448,1.0],"mesh_id":5,"collision":false},{"geom_id":11,"name":"unnamed_11","body_id":3,"type":"mesh","group":2,"size":[5.0010159611716e-05,0.0002260359453726628,0.00023393046624420506],"position":[0.2750867701937339,0.0173919327007046,-0.04724997095763682],"quaternion_wxyz":[0.35594891717283,0.6109831162671284,-0.35594891717283,0.6109831162671284],"rgba":[0.0860000029206276,0.0860000029206276,0.0860000029206276,1.0],"mesh_id":6,"collision":false},{"geom_id":12,"name":"unnamed_12","body_id":3,"type":"mesh","group":2,"size":[5.001015961170969e-05,0.010513795654981355,0.01050240445951586],"position":[0.2835940359462099,0.02872595209816299,-0.04724997095763684],"quaternion_wxyz":[0.06534246777998709,0.7040812182585354,-0.06534246777998709,0.7040812182585354],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":7,"collision":false},{"geom_id":13,"name":"unnamed_13","body_id":3,"type":"mesh","group":2,"size":[5.0010159611736883e-05,0.0012844798024076057,0.0014087430841135179],"position":[0.27598687527788296,0.04063465019275356,-0.0472499709576368],"quaternion_wxyz":[0.34131948407165513,0.6192745835193468,-0.34131948407165513,0.6192745835193468],"rgba":[0.8199999928474426,0.15000000596046448,0.15000000596046448,1.0],"mesh_id":8,"collision":false},{"geom_id":14,"name":"unnamed_14","body_id":3,"type":"mesh","group":2,"size":[5.001015961173684e-05,0.0012834172860180565,0.0014077950663972975],"position":[0.27709549040241616,0.016305853036851375,-0.0472499709576368],"quaternion_wxyz":[0.6053936674567503,0.36537447557713587,-0.6053936674567503,0.36537447557713587],"rgba":[0.8199999928474426,0.15000000596046448,0.15000000596046448,1.0],"mesh_id":9,"collision":false},{"geom_id":15,"name":"unnamed_15","body_id":3,"type":"mesh","group":2,"size":[5.001015961175069e-05,0.00022595631031726307,0.0002338485353819776],"position":[0.2976744092226731,0.027147881842084973,-0.047249970957636785],"quaternion_wxyz":[0.6129729464061634,0.3525112295716948,-0.6129729464061634,0.3525112295716948],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":10,"collision":false},{"geom_id":16,"name":"unnamed_16","body_id":3,"type":"mesh","group":2,"size":[5.0010159611743877e-05,0.0012844210153858632,0.0014083568772211938],"position":[0.2976105149534505,0.029430436057308815,-0.047249970957636875],"quaternion_wxyz":[-0.013964394522153183,0.7069688788664121,0.013964394522153183,0.7069688788664121],"rgba":[0.8199999928474426,0.15000000596046448,0.15000000596046448,1.0],"mesh_id":11,"collision":false},{"geom_id":17,"name":"unnamed_17","body_id":3,"type":"mesh","group":2,"size":[5.0010159611723006e-05,0.0012834834338485376,0.001407714366983561],"position":[0.29007681337266844,0.016305880523245084,0.04724997095763681],"quaternion_wxyz":[0.36537200397257175,0.6053951591424137,-0.36537200397257175,0.6053951591424137],"rgba":[0.8199999928474426,0.15000000596046448,0.15000000596046448,1.0],"mesh_id":12,"collision":false},{"geom_id":18,"name":"unnamed_18","body_id":3,"type":"mesh","group":2,"size":[5.001015961172986e-05,0.00022603463356377649,0.00023390015954197422],"position":[0.2920855679211757,0.017391934089131263,0.047249970957636805],"quaternion_wxyz":[0.6114287456409518,0.3551828951454922,-0.6114287456409518,0.3551828951454922],"rgba":[0.8199999928474426,0.15000000596046448,0.15000000596046448,1.0],"mesh_id":13,"collision":false},{"geom_id":19,"name":"unnamed_19","body_id":3,"type":"mesh","group":2,"size":[5.001015961175075e-05,0.0012841630917903339,0.0014082273330747088],"position":[0.2695617982815075,0.029430404511218894,0.04724997095763688],"quaternion_wxyz":[0.013882575863649611,0.706970490252169,-0.013882575863649611,0.706970490252169],"rgba":[0.8199999928474426,0.15000000596046448,0.15000000596046448,1.0],"mesh_id":14,"collision":false},{"geom_id":20,"name":"unnamed_20","body_id":3,"type":"mesh","group":2,"size":[5.001015961172293e-05,0.00022597817305581203,0.00023382886083029783],"position":[0.2694979594710702,0.027147874828448392,0.04724997095763681],"quaternion_wxyz":[0.3531318565393772,0.612615615126691,-0.3531318565393772,0.612615615126691],"rgba":[0.8199999928474426,0.15000000596046448,0.15000000596046448,1.0],"mesh_id":15,"collision":false},{"geom_id":21,"name":"unnamed_21","body_id":3,"type":"mesh","group":2,"size":[5.0010159611709114e-05,0.001284302250019242,0.0014087860061871844],"position":[0.29118561977195967,0.0406347052287932,0.04724997095763684],"quaternion_wxyz":[0.6192655898496522,0.34133580126931307,-0.6192655898496522,0.34133580126931307],"rgba":[0.8199999928474426,0.15000000596046448,0.15000000596046448,1.0],"mesh_id":16,"collision":false},{"geom_id":22,"name":"unnamed_22","body_id":3,"type":"mesh","group":2,"size":[5.001015961171607e-05,0.00022596549618228955,0.0002338718056796956],"position":[0.28924072130923273,0.04183130921471268,0.04724997095763685],"quaternion_wxyz":[0.0032801837332774226,0.7070991729557304,-0.0032801837332774226,0.7070991729557304],"rgba":[0.8199999928474426,0.15000000596046448,0.15000000596046448,1.0],"mesh_id":17,"collision":false},{"geom_id":23,"name":"unnamed_23","body_id":3,"type":"mesh","group":2,"size":[5.001015961171603e-05,0.0003994547313336594,0.0003997745504252404],"position":[0.11898319339874688,-0.001822195406506574,-0.020449990406632437],"quaternion_wxyz":[0.12700121025337288,0.6956081458653144,-0.12700121025337288,0.6956081458653144],"rgba":[0.8199999928474426,0.15000000596046448,0.15000000596046448,1.0],"mesh_id":18,"collision":false},{"geom_id":24,"name":"unnamed_24","body_id":3,"type":"mesh","group":2,"size":[5.0010159611719455e-05,0.0022701850522971762,0.002489334239423587],"position":[0.11533262852045809,-0.0015390998177268237,-0.02044999040663244],"quaternion_wxyz":[0.5123108298656667,0.4873783064543942,-0.5123108298656667,0.4873783064543942],"rgba":[0.8199999928474426,0.15000000596046448,0.15000000596046448,1.0],"mesh_id":19,"collision":false},{"geom_id":25,"name":"unnamed_25","body_id":3,"type":"mesh","group":2,"size":[5.0010159611726475e-05,0.000912011102782025,0.0014322678694243176],"position":[0.14909572960162823,-0.010791937679921409,-0.020449990406632448],"quaternion_wxyz":[-0.22748718944583507,0.6695144349736135,0.22748718944583507,0.6695144349736135],"rgba":[0.8199999928474426,0.15000000596046448,0.15000000596046448,1.0],"mesh_id":20,"collision":false},{"geom_id":26,"name":"unnamed_26","body_id":3,"type":"mesh","group":2,"size":[5.0010159611726373e-05,0.0014881441021308889,0.004297686414363374],"position":[0.15338718222405878,-0.01033693009752017,-0.0204499904066324],"quaternion_wxyz":[0.4014837291527188,0.5820745787488297,-0.4014837291527188,0.5820745787488297],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":21,"collision":false},{"geom_id":27,"name":"unnamed_27","body_id":3,"type":"mesh","group":2,"size":[5.00101596117057e-05,0.002269437031065367,0.0024881059013514874],"position":[0.15772894138348834,-0.005258910052782741,0.02044999040663242],"quaternion_wxyz":[0.5301882016542112,0.46786800577371696,-0.5301882016542112,0.46786800577371696],"rgba":[0.8199999928474426,0.15000000596046448,0.15000000596046448,1.0],"mesh_id":22,"collision":false},{"geom_id":28,"name":"unnamed_28","body_id":3,"type":"mesh","group":2,"size":[5.0010159611729884e-05,0.0009120873129515142,0.0014322659130748356],"position":[0.12287041956052364,-0.008490910789997627,0.02044999040663245],"quaternion_wxyz":[0.28510780427191784,0.6470807831664042,-0.28510780427191784,0.6470807831664042],"rgba":[0.8199999928474426,0.15000000596046448,0.15000000596046448,1.0],"mesh_id":23,"collision":false},{"geom_id":29,"name":"unnamed_29","body_id":3,"type":"mesh","group":2,"size":[5.0010159611702175e-05,0.0014890175826543514,0.0042983592591153115],"position":[0.11872438771019998,-0.007295069475836838,0.020449990406632423],"quaternion_wxyz":[0.6149244744342097,0.34909581885466967,-0.6149244744342097,0.34909581885466967],"rgba":[0.8199999928474426,0.15000000596046448,0.15000000596046448,1.0],"mesh_id":24,"collision":false},{"geom_id":30,"name":"unnamed_30","body_id":3,"type":"mesh","group":2,"size":[9.998492896561146e-05,0.018486817346499644,0.018501483062673758],"position":[0.2835783337592689,0.02872440894940236,-0.047099975869059604],"quaternion_wxyz":[0.4993818965641743,0.5006173402749546,-0.4993818965641743,0.5006173402749546],"rgba":[0.0860000029206276,0.0860000029206276,0.0860000029206276,1.0],"mesh_id":25,"collision":false},{"geom_id":31,"name":"unnamed_31","body_id":3,"type":"mesh","group":2,"size":[5.001015961172359e-05,0.010512554027774571,0.010499614797866355],"position":[0.2835783306948905,0.028725955475470792,0.047249970957636854],"quaternion_wxyz":[-0.06711006452402157,0.7039149375028093,0.06711006452402157,0.7039149375028093],"rgba":[0.8199999928474426,0.15000000596046448,0.15000000596046448,1.0],"mesh_id":26,"collision":false},{"geom_id":32,"name":"unnamed_32","body_id":3,"type":"mesh","group":2,"size":[9.998492896556983e-05,0.018486817346499332,0.018501483062673758],"position":[0.2835783337592686,0.02872440894940236,0.04709997586905956],"quaternion_wxyz":[0.49938189656418697,0.500617340274942,-0.49938189656418697,0.500617340274942],"rgba":[0.14000000059604645,0.14000000059604645,0.14000000059604645,1.0],"mesh_id":27,"collision":false},{"geom_id":33,"name":"unnamed_33","body_id":3,"type":"mesh","group":2,"size":[0.00010001473128796677,0.00973893545008223,0.05971105000699287],"position":[0.13635698782344807,-0.005350880553659557,-0.020299965515732758],"quaternion_wxyz":[0.02877291766953295,0.7065211385434864,-0.02877291766953295,0.7065211385434864],"rgba":[0.14000000059604645,0.14000000059604645,0.14000000059604645,1.0],"mesh_id":28,"collision":false},{"geom_id":34,"name":"unnamed_34","body_id":3,"type":"mesh","group":2,"size":[5.001015961170557e-05,0.00039977027355869043,0.0003995440565921929],"position":[0.15408486795357235,-0.004902091273301572,0.020449990406632427],"quaternion_wxyz":[0.5268774971694512,0.471593154081414,-0.5268774971694512,0.471593154081414],"rgba":[0.14000000059604645,0.14000000059604645,0.14000000059604645,1.0],"mesh_id":29,"collision":false},{"geom_id":35,"name":"unnamed_35","body_id":3,"type":"mesh","group":2,"size":[0.0001000147312879704,0.009738935450082229,0.0597110500069929],"position":[0.13635698782344804,-0.005350880553659558,0.020299965515732755],"quaternion_wxyz":[0.02877291766953295,0.7065211385434864,-0.02877291766953295,0.7065211385434864],"rgba":[0.14000000059604645,0.14000000059604645,0.14000000059604645,1.0],"mesh_id":30,"collision":false},{"geom_id":36,"name":"unnamed_36","body_id":3,"type":"mesh","group":2,"size":[0.04370143853579772,0.04816692552136174,0.16806725143085952],"position":[0.1450904413978625,0.000378966144523555,0.0010422775888613268],"quaternion_wxyz":[0.4901174054768742,0.4777507174427363,0.524283595671605,0.5066220407179538],"rgba":[0.8500000238418579,0.8500000238418579,0.8500000238418579,1.0],"mesh_id":31,"collision":false},{"geom_id":37,"name":"unnamed_37","body_id":3,"type":"capsule","group":3,"size":[0.03545454257081303,0.13666174927205552,0.0],"position":[0.15217916448752086,-0.00040772963711819914,0.00031376087423877805],"quaternion_wxyz":[0.4867179957763477,0.4838160685884429,0.5169370136693945,0.5116675954774245],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":38,"name":"unnamed_38","body_id":4,"type":"mesh","group":2,"size":[0.00018848561111495655,0.005813600989085939,0.033216755141342924],"position":[-0.09376580769171221,0.040397545209756545,-0.019205983652113432],"quaternion_wxyz":[0.06143336631922253,0.7316259545530819,-0.06710604009443814,0.6756080102469388],"rgba":[0.14000000059604645,0.14000000059604645,0.14000000059604645,1.0],"mesh_id":32,"collision":false},{"geom_id":39,"name":"unnamed_39","body_id":4,"type":"mesh","group":2,"size":[3.3037144051127127e-08,0.0007553718316663799,0.0008764041308490105],"position":[-0.08914411717449765,0.041897643226041136,-0.01973400075704936],"quaternion_wxyz":[0.37061637999185876,0.6338363760350851,-0.3513959556919067,0.5808750550848394],"rgba":[0.8199999928474426,0.15000000596046448,0.15000000596046448,1.0],"mesh_id":33,"collision":false},{"geom_id":40,"name":"unnamed_40","body_id":4,"type":"mesh","group":2,"size":[3.2449035119030783e-08,0.0008375801334788261,0.0029249240814045482],"position":[-0.08935337578469942,0.037928450636712734,-0.019776882485979787],"quaternion_wxyz":[0.5399889470876057,0.49749703042705506,-0.5061149666987127,0.45250003560557334],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":34,"collision":false},{"geom_id":41,"name":"unnamed_41","body_id":4,"type":"mesh","group":2,"size":[3.097317623386778e-08,0.002900479306756542,0.004123176590620293],"position":[-0.0919810167932075,0.03924029583566786,-0.019551182259362757],"quaternion_wxyz":[0.4885045379152787,0.5481393397080895,-0.45921358375948784,0.5000294643231841],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":35,"collision":false},{"geom_id":42,"name":"unnamed_42","body_id":4,"type":"mesh","group":2,"size":[3.18666138661386e-08,0.002447395975929258,0.003567675699927624],"position":[-0.09753588071370119,0.04075963539531817,-0.01909277553898563],"quaternion_wxyz":[0.5285543717716896,0.5096312350367662,-0.49570987368025876,0.46387282900795057],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":36,"collision":false},{"geom_id":43,"name":"unnamed_43","body_id":4,"type":"mesh","group":2,"size":[3.7628053117844886e-08,0.0027620047199078883,0.0036118752291231225],"position":[-0.10254046363263859,0.04136470378746594,-0.01869119030441654],"quaternion_wxyz":[0.5678217939740838,0.46548128657398913,-0.5314028141567032,0.42251228531702656],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":37,"collision":false},{"geom_id":44,"name":"unnamed_44","body_id":4,"type":"mesh","group":2,"size":[0.00018843775291974696,0.00581381089377406,0.033218678480184484],"position":[-0.09376393739666918,0.04039724109407403,0.019206174103880563],"quaternion_wxyz":[0.06710367043023063,0.6756079004034908,-0.061431108484691584,0.7316264629150067],"rgba":[0.14000000059604645,0.14000000059604645,0.14000000059604645,1.0],"mesh_id":38,"collision":false},{"geom_id":45,"name":"unnamed_45","body_id":4,"type":"mesh","group":2,"size":[3.219310361786763e-08,0.00248040260596676,0.003576712942064361],"position":[-0.10333801192044996,0.041987161328519186,0.0186193386778227],"quaternion_wxyz":[0.5976378074928222,0.3220797210297904,-0.6410686987056347,0.35794500680469366],"rgba":[1.0,1.0,1.0,1.0],"mesh_id":39,"collision":false},{"geom_id":46,"name":"unnamed_46","body_id":4,"type":"mesh","group":2,"size":[2.3205951160557868e-08,0.000747467761276459,0.0008213947875281678],"position":[-0.09843598869686519,0.04372292270279494,0.018977902909480055],"quaternion_wxyz":[-0.14708089844441374,0.6627807810091019,0.16975561010017012,0.7143331705004832],"rgba":[0.8199999928474426,0.15000000596046448,0.15000000596046448,1.0],"mesh_id":40,"collision":false},{"geom_id":47,"name":"unnamed_47","body_id":4,"type":"mesh","group":2,"size":[3.702564508962104e-08,0.000763196953286618,0.002720455635876856],"position":[-0.09959217249661416,0.04009352316962993,0.018941435747121056],"quaternion_wxyz":[0.5536042022224128,0.3929748378088519,-0.5923060559991632,0.4338971078003534],"rgba":[1.0,1.0,1.0,1.0],"mesh_id":41,"collision":false},{"geom_id":48,"name":"unnamed_48","body_id":4,"type":"mesh","group":2,"size":[3.505447723221897e-08,0.0024078873093847154,0.0039384161150361075],"position":[-0.09650387251053558,0.04039389789279284,0.019179186558678955],"quaternion_wxyz":[0.6114853781366225,0.2949430399307881,-0.656482361481327,0.32882388080156344],"rgba":[1.0,1.0,1.0,1.0],"mesh_id":42,"collision":false},{"geom_id":49,"name":"unnamed_49","body_id":4,"type":"mesh","group":2,"size":[3.647999291181229e-08,0.0029720211562134216,0.003964324630072272],"position":[-0.09088560823694662,0.04001566408708353,0.019625515000108285],"quaternion_wxyz":[0.5918663660848831,0.33256627746767164,-0.6346573662757344,0.36919358502108646],"rgba":[1.0,1.0,1.0,1.0],"mesh_id":43,"collision":false},{"geom_id":50,"name":"unnamed_50","body_id":4,"type":"mesh","group":2,"size":[3.6846855884302975e-08,0.002648064682166382,0.0036126093723760364],"position":[-0.08632008128584218,0.038384592827134786,0.020007988778493396],"quaternion_wxyz":[0.5484927120807359,0.4000756453585752,-0.5866655549424539,0.44149603557597616],"rgba":[1.0,1.0,1.0,1.0],"mesh_id":44,"collision":false},{"geom_id":51,"name":"unnamed_51","body_id":4,"type":"mesh","group":2,"size":[0.029565248428736562,0.040056421994876724,0.08217396044515426],"position":[-0.0916482804182938,0.0398087714687191,-2.1362728013101683e-05],"quaternion_wxyz":[0.5430921691601506,0.5435181184959477,0.4525193662898446,0.45262034178347293],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":45,"collision":false},{"geom_id":52,"name":"unnamed_52","body_id":4,"type":"mesh","group":2,"size":[0.013544499441305506,0.030267838740014288,0.056211903439956794],"position":[-0.02112641209161606,0.014166511476011941,-0.02556456418497642],"quaternion_wxyz":[0.16784761177877613,0.7630616658540977,-0.23252327086876207,0.5792210302023107],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":46,"collision":false},{"geom_id":53,"name":"unnamed_53","body_id":4,"type":"mesh","group":2,"size":[0.010006679671837588,0.010026531522481973,0.06183580242123513],"position":[-0.10058924391144596,0.04153715256283763,-1.3572668119667872e-05],"quaternion_wxyz":[0.5448132612372412,0.544695844591328,0.4507756278428538,0.45087279870032637],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":47,"collision":false},{"geom_id":54,"name":"unnamed_54","body_id":4,"type":"mesh","group":2,"size":[0.015284639405255408,0.03050124646219469,0.05622258860014183],"position":[-0.02099686195766406,0.014153467330443112,0.02521406765690703],"quaternion_wxyz":[0.23168849431170727,0.5829955170436059,-0.16569663413980645,0.7609082034945972],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":48,"collision":false},{"geom_id":55,"name":"unnamed_55","body_id":4,"type":"mesh","group":2,"size":[0.015688972116030632,0.029219822279084245,0.02842628040944696],"position":[-0.15901801053585182,0.052667832902069535,-0.0007400810984158475],"quaternion_wxyz":[0.7027596814910085,0.7050222651026141,-0.055428550735037704,-0.07746038693197294],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":49,"collision":false},{"geom_id":56,"name":"unnamed_56","body_id":4,"type":"mesh","group":2,"size":[0.003808696550754982,0.02850007356777583,0.029446999842264038],"position":[-0.16424600920216786,0.05440598592608635,0.0005997722831973261],"quaternion_wxyz":[0.4251720614528539,0.900333111740014,-0.08437578464942551,-0.03885528315775308],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":50,"collision":false},{"geom_id":57,"name":"unnamed_57","body_id":4,"type":"mesh","group":2,"size":[0.01994023864397993,0.02839294471673141,0.028398058061788085],"position":[-0.1876264404201223,0.058119251198921834,-2.0377599594965217e-06],"quaternion_wxyz":[0.8852111773361604,0.4556118566969756,-0.042928283092247,-0.08352347015669646],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":51,"collision":false},{"geom_id":58,"name":"unnamed_58","body_id":4,"type":"mesh","group":2,"size":[0.0033014104778734746,0.030001334505451095,0.03070580468709309],"position":[-0.0006029771488305068,0.00043789424693094393,0.023983298978984848],"quaternion_wxyz":[0.21643699772349576,0.6719487619202448,-0.21555226338440978,0.6746681474029669],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":52,"collision":false},{"geom_id":59,"name":"unnamed_59","body_id":4,"type":"mesh","group":2,"size":[0.0034862799261965766,0.02997673114397027,0.03000086965593868],"position":[-3.613769477796337e-07,9.37560563261538e-07,0.02973610830611428],"quaternion_wxyz":[0.25731067528654017,0.6586304225049062,-0.25730867850453687,0.6586269254295992],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":53,"collision":false},{"geom_id":60,"name":"unnamed_60","body_id":4,"type":"mesh","group":2,"size":[0.006507892316292044,0.02074097999705577,0.020722708530080205],"position":[-2.5153380770439003e-07,-1.6287403374281585e-06,0.027256724831133675],"quaternion_wxyz":[0.5485304756885556,0.4462165949261271,-0.5485652965617127,0.4461851443757212],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":54,"collision":false},{"geom_id":61,"name":"unnamed_61","body_id":4,"type":"mesh","group":2,"size":[0.0024904259643542875,0.0024904038872338484,0.005750000406620927],"position":[0.012717978743641162,0.004957265162580884,0.01999997913408476],"quaternion_wxyz":[0.538463641814834,0.0,0.0,0.8426487444027361],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":55,"collision":false},{"geom_id":62,"name":"unnamed_62","body_id":4,"type":"mesh","group":2,"size":[0.0024890188696426157,0.0024890220600648143,0.005750000390425107],"position":[-0.0020658525026922936,-0.013492734338651042,0.019999979150280574],"quaternion_wxyz":[0.9473374520747989,0.0,0.0,0.32023702455591874],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":56,"collision":false},{"geom_id":63,"name":"unnamed_63","body_id":4,"type":"mesh","group":2,"size":[0.0024934459280848316,0.0024934453854688794,0.005750000369773807],"position":[-0.010652125979650002,0.008535445291770378,0.019999979170931874],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":57,"collision":false},{"geom_id":64,"name":"unnamed_64","body_id":4,"type":"mesh","group":2,"size":[0.007854416601798019,0.02855850144784075,0.03026182800251069],"position":[0.00014702381635630895,0.00020385007373930174,-0.02658057772180041],"quaternion_wxyz":[0.6287969003894753,0.3225877564452059,-0.6299781805870686,0.3219923748110302],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":58,"collision":false},{"geom_id":65,"name":"unnamed_65","body_id":4,"type":"mesh","group":2,"size":[0.026223882842245864,0.03012845313299037,0.030014164384068984],"position":[8.311725283488525e-05,-5.870530467267555e-05,-0.002792586342033716],"quaternion_wxyz":[0.6302588432594121,0.3264598343993721,-0.6270059996823436,0.3210315301953842],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":59,"collision":false},{"geom_id":66,"name":"unnamed_66","body_id":4,"type":"capsule","group":3,"size":[0.024637079366057864,0.10242798087832758,0.0],"position":[-0.07675044741424053,0.02843004026579222,0.0005351391697876015],"quaternion_wxyz":[0.5695186075854833,0.5727353857173172,0.4100285922464654,0.42367356195721384],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":67,"name":"unnamed_67","body_id":5,"type":"mesh","group":2,"size":[0.010351119754262764,0.02644979636623629,0.029484491009463286],"position":[-0.001003232075853119,0.002335630620619759,-0.031011309732836966],"quaternion_wxyz":[-0.013066390485985308,0.7126064874673461,0.012926770085687036,0.7013231509612925],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":60,"collision":false},{"geom_id":68,"name":"unnamed_68","body_id":5,"type":"mesh","group":2,"size":[0.005204323600722765,0.030501707641765623,0.03524578386189126],"position":[2.735569651412533e-07,-0.030461462223071622,-0.007586149085460567],"quaternion_wxyz":[0.7066478865691157,0.025470854076821297,-0.025918282189322673,0.7066316173568483],"rgba":[0.14000000059604645,0.14000000059604645,0.14000000059604645,1.0],"mesh_id":61,"collision":false},{"geom_id":69,"name":"unnamed_69","body_id":5,"type":"mesh","group":2,"size":[0.005167404308308222,0.00731838898889287,0.01897143233159944],"position":[0.025664919333960763,2.637876909261607e-06,-0.025956403285173176],"quaternion_wxyz":[0.5070756334286316,0.5071374301520294,-0.49275796031972885,0.49282402687297117],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":62,"collision":false},{"geom_id":70,"name":"unnamed_70","body_id":5,"type":"mesh","group":2,"size":[0.0038087284486521024,0.028500136429120772,0.029446973270126055],"position":[0.000943768393903151,-0.02072670019283884,1.7688987322093152e-05],"quaternion_wxyz":[0.5039979033910376,0.4945504685169099,0.4959672029711755,0.5053933923629147],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":63,"collision":false},{"geom_id":71,"name":"unnamed_71","body_id":5,"type":"mesh","group":2,"size":[0.019938825678839874,0.028490946036377744,0.028497990779561357],"position":[1.906543859723306e-06,0.0029351904988101944,-4.984145583829952e-07],"quaternion_wxyz":[0.6998465042598643,-0.10075860696116987,-0.10079405845149407,0.6999308047081301],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":64,"collision":false},{"geom_id":72,"name":"unnamed_72","body_id":5,"type":"capsule","group":3,"size":[0.023893642247112656,0.016908004271389922,0.0],"position":[0.0007618522519668986,-0.006910408424169896,-0.008241803197133812],"quaternion_wxyz":[0.9553644091660282,0.28717057151376396,-0.06123995224151679,0.032581847780027096],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":73,"name":"unnamed_73","body_id":6,"type":"mesh","group":2,"size":[0.004613900754274745,0.02770976035891332,0.03489622518589673],"position":[-3.453156869452776e-08,0.01188529359281611,-0.024308700847445658],"quaternion_wxyz":[0.49729173794299947,0.5026897846850553,-0.5027572246368457,0.4972314157637095],"rgba":[0.0,0.0,0.0,1.0],"mesh_id":65,"collision":false},{"geom_id":74,"name":"unnamed_74","body_id":6,"type":"mesh","group":2,"size":[0.002410007010482261,0.006315564718728135,0.007921021722195644],"position":[6.181750869366345e-07,0.0352248002227117,0.027922476545799515],"quaternion_wxyz":[0.015923653153890247,0.7069218072067178,0.01594957306016489,0.706932533474748],"rgba":[0.0,0.0,0.0,1.0],"mesh_id":66,"collision":false},{"geom_id":75,"name":"unnamed_75","body_id":6,"type":"mesh","group":2,"size":[0.004781242563195022,0.030001918524236643,0.034795374055146606],"position":[1.135431789241799e-06,0.009467175791594472,-0.027664802294040777],"quaternion_wxyz":[0.484092030463549,0.5154308647080401,-0.5156955116290505,0.4837810135109225],"rgba":[0.14000000059604645,0.14000000059604645,0.14000000059604645,1.0],"mesh_id":67,"collision":false},{"geom_id":76,"name":"unnamed_76","body_id":6,"type":"mesh","group":2,"size":[0.004827335919956339,0.018258100476111427,0.02398900606560605],"position":[-0.0018924253975873804,0.03897784868786336,0.002612373662217604],"quaternion_wxyz":[0.7045745036678209,0.024783453198933755,0.050347766072616214,0.7074076983467729],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":68,"collision":false},{"geom_id":77,"name":"unnamed_77","body_id":6,"type":"mesh","group":2,"size":[0.008598785647305297,0.008846593660734222,0.0244671111570275],"position":[0.012346024670946754,0.03380394681516876,0.0073681393296736505],"quaternion_wxyz":[0.3848426052815663,0.6382797857687669,0.6100019218657936,0.2690589889951919],"rgba":[0.9800000190734863,0.9800000190734863,0.9800000190734863,1.0],"mesh_id":69,"collision":false},{"geom_id":78,"name":"unnamed_78","body_id":6,"type":"mesh","group":2,"size":[0.020568090547499102,0.02914027429539416,0.028717800179986597],"position":[-0.00012143381479150356,0.04118878422117679,0.0020946544463245386],"quaternion_wxyz":[0.4996417932654556,0.4944633707866639,0.5050193461149125,0.5008188429187135],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":70,"collision":false},{"geom_id":79,"name":"unnamed_79","body_id":6,"type":"mesh","group":2,"size":[0.019940220564243927,0.02839270682772745,0.02839786328014428],"position":[1.5837371995663395e-07,0.0714355207252869,0.0014137509466365398],"quaternion_wxyz":[0.7010482668847001,-0.09228846233157777,-0.09240396366337286,0.7010532609707562],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":71,"collision":false},{"geom_id":80,"name":"unnamed_80","body_id":6,"type":"capsule","group":3,"size":[0.022425347134982433,0.03375594422914002,0.0],"position":[0.00016545570262998743,0.043532899125477496,-0.004636006678573162],"quaternion_wxyz":[0.3519212770575744,0.5443290091926117,-0.638336234898934,0.41519175777056466],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":81,"name":"unnamed_81","body_id":7,"type":"mesh","group":2,"size":[0.03936359393440306,0.033911311167376355,0.072501815409833],"position":[-0.0003164993412691688,-5.150371361380908e-08,0.033286418074748664],"quaternion_wxyz":[0.0075971194155991986,-0.007273308419877803,0.7070736568452146,0.7070616851143566],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":79,"collision":false},{"geom_id":82,"name":"unnamed_82","body_id":7,"type":"capsule","group":3,"size":[0.026413616588917953,0.02962728534974203,0.0],"position":[-0.0003164993412691688,-5.150371361380908e-08,0.033286418074748664],"quaternion_wxyz":[0.0075971194155991986,-0.007273308419877803,0.7070736568452146,0.7070616851143566],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":83,"name":"unnamed_83","body_id":8,"type":"mesh","group":2,"size":[0.012241380481488436,0.028561247834869744,0.05476655149217905],"position":[-0.00019652905424166764,-0.04866103845314674,-0.010052251371111322],"quaternion_wxyz":[0.4564150942311783,0.540800379281663,-0.5495028458966887,0.4441473110108809],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":80,"collision":false},{"geom_id":84,"name":"unnamed_84","body_id":8,"type":"box","group":3,"size":[0.012,0.015,0.0025],"position":[0.0,-0.015,-0.0025],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[1.0,0.0,0.0,0.20000000298023224],"mesh_id":null,"collision":true},{"geom_id":85,"name":"unnamed_85","body_id":8,"type":"box","group":3,"size":[0.015,0.015,0.0025],"position":[0.0,-0.045,-0.0025],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.0,0.0,1.0,0.20000000298023224],"mesh_id":null,"collision":true},{"geom_id":86,"name":"unnamed_86","body_id":9,"type":"mesh","group":2,"size":[0.012241316419549522,0.028560507717506622,0.05476734553734031],"position":[0.00019559298687313559,0.04866177697559019,-0.010052170991233081],"quaternion_wxyz":[0.5494964782030206,0.4441392997048039,-0.4564255018391489,0.5408046451086449],"rgba":[0.5899999737739563,0.5899999737739563,0.5899999737739563,1.0],"mesh_id":81,"collision":false},{"geom_id":87,"name":"unnamed_87","body_id":9,"type":"box","group":3,"size":[0.012,0.015,0.0025],"position":[0.0,0.015,-0.0025],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[1.0,0.0,0.0,0.20000000298023224],"mesh_id":null,"collision":true},{"geom_id":88,"name":"unnamed_88","body_id":9,"type":"box","group":3,"size":[0.015,0.015,0.0025],"position":[0.0,0.045,-0.0025],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.0,0.0,1.0,0.20000000298023224],"mesh_id":null,"collision":true},{"geom_id":89,"name":"shoe_trainer_left_sole","body_id":10,"type":"box","group":0,"size":[0.14,0.05,0.01],"position":[0.0,0.0,0.01],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.1599999964237213,0.17000000178813934,0.18000000715255737,1.0],"mesh_id":null,"collision":true},{"geom_id":90,"name":"shoe_trainer_left_upper","body_id":10,"type":"ellipsoid","group":0,"size":[0.122,0.047,0.035],"position":[-0.005,0.003,0.052],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.20000000298023224,0.3799999952316284,0.5799999833106995,1.0],"mesh_id":null,"collision":true},{"geom_id":91,"name":"shoe_trainer_left_toe","body_id":10,"type":"ellipsoid","group":0,"size":[0.04,0.047,0.026],"position":[0.095,0.003,0.045],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.7799999713897705,0.8199999928474426,0.8299999833106995,1.0],"mesh_id":null,"collision":true},{"geom_id":92,"name":"shoe_trainer_right_sole","body_id":11,"type":"box","group":0,"size":[0.14,0.05,0.01],"position":[0.0,0.0,0.01],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.1599999964237213,0.17000000178813934,0.18000000715255737,1.0],"mesh_id":null,"collision":true},{"geom_id":93,"name":"shoe_trainer_right_upper","body_id":11,"type":"ellipsoid","group":0,"size":[0.122,0.047,0.035],"position":[-0.005,-0.003,0.052],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.20000000298023224,0.3799999952316284,0.5799999833106995,1.0],"mesh_id":null,"collision":true},{"geom_id":94,"name":"shoe_trainer_right_toe","body_id":11,"type":"ellipsoid","group":0,"size":[0.04,0.047,0.026],"position":[0.095,-0.003,0.045],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.7799999713897705,0.8199999928474426,0.8299999833106995,1.0],"mesh_id":null,"collision":true},{"geom_id":95,"name":"shoe_ankle_boot_left_sole","body_id":12,"type":"box","group":0,"size":[0.145,0.054,0.012],"position":[0.0,0.0,0.012],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.1599999964237213,0.17000000178813934,0.18000000715255737,1.0],"mesh_id":null,"collision":true},{"geom_id":96,"name":"shoe_ankle_boot_left_upper","body_id":12,"type":"ellipsoid","group":0,"size":[0.13,0.05,0.04],"position":[0.01,0.004,0.064],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.3700000047683716,0.23999999463558197,0.1599999964237213,1.0],"mesh_id":null,"collision":true},{"geom_id":97,"name":"shoe_ankle_boot_left_ankle","body_id":12,"type":"ellipsoid","group":0,"size":[0.047,0.049,0.055],"position":[-0.085,0.004,0.135],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.3700000047683716,0.23999999463558197,0.1599999964237213,1.0],"mesh_id":null,"collision":true},{"geom_id":98,"name":"shoe_ankle_boot_right_sole","body_id":13,"type":"box","group":0,"size":[0.145,0.054,0.012],"position":[0.0,0.0,0.012],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.1599999964237213,0.17000000178813934,0.18000000715255737,1.0],"mesh_id":null,"collision":true},{"geom_id":99,"name":"shoe_ankle_boot_right_upper","body_id":13,"type":"ellipsoid","group":0,"size":[0.13,0.05,0.04],"position":[0.01,-0.004,0.064],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.3700000047683716,0.23999999463558197,0.1599999964237213,1.0],"mesh_id":null,"collision":true},{"geom_id":100,"name":"shoe_ankle_boot_right_ankle","body_id":13,"type":"ellipsoid","group":0,"size":[0.047,0.049,0.055],"position":[-0.085,-0.004,0.135],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.3700000047683716,0.23999999463558197,0.1599999964237213,1.0],"mesh_id":null,"collision":true},{"geom_id":101,"name":"shoe_slipper_left_sole","body_id":14,"type":"box","group":0,"size":[0.135,0.051,0.009],"position":[0.0,0.0,0.009],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.1599999964237213,0.17000000178813934,0.18000000715255737,1.0],"mesh_id":null,"collision":true},{"geom_id":102,"name":"shoe_slipper_left_upper","body_id":14,"type":"ellipsoid","group":0,"size":[0.09,0.049,0.017],"position":[0.045,0.002,0.038],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.5199999809265137,0.3100000023841858,0.3700000047683716,1.0],"mesh_id":null,"collision":true},{"geom_id":103,"name":"shoe_slipper_right_sole","body_id":15,"type":"box","group":0,"size":[0.135,0.051,0.009],"position":[0.0,0.0,0.009],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.1599999964237213,0.17000000178813934,0.18000000715255737,1.0],"mesh_id":null,"collision":true},{"geom_id":104,"name":"shoe_slipper_right_upper","body_id":15,"type":"ellipsoid","group":0,"size":[0.09,0.049,0.017],"position":[0.045,-0.002,0.038],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.5199999809265137,0.3100000023841858,0.3700000047683716,1.0],"mesh_id":null,"collision":true}],"bodies":[{"id":0,"name":"world"},{"id":1,"name":"base_link"},{"id":2,"name":"link1"},{"id":3,"name":"link2"},{"id":4,"name":"link3"},{"id":5,"name":"link4"},{"id":6,"name":"link5"},{"id":7,"name":"link6"},{"id":8,"name":"link7"},{"id":9,"name":"link8"},{"id":10,"name":"shoe_trainer_left"},{"id":11,"name":"shoe_trainer_right"},{"id":12,"name":"shoe_ankle_boot_left"},{"id":13,"name":"shoe_ankle_boot_right"},{"id":14,"name":"shoe_slipper_left"},{"id":15,"name":"shoe_slipper_right"}],"joints":[{"name":"joint1","range":[-2.618,2.618]},{"name":"joint2","range":[0.0,3.14]},{"name":"joint3","range":[-2.697,0.0]},{"name":"joint4","range":[-1.832,1.832]},{"name":"joint5","range":[-1.22,1.22]},{"name":"joint6","range":[-3.14,3.14]},{"name":"joint7","range":[0.0,0.035]},{"name":"joint8","range":[-0.035,0.0]},{"name":"shoe_trainer_left_free","range":[0.0,0.0]},{"name":"shoe_trainer_right_free","range":[0.0,0.0]},{"name":"shoe_ankle_boot_left_free","range":[0.0,0.0]},{"name":"shoe_ankle_boot_right_free","range":[0.0,0.0]},{"name":"shoe_slipper_left_free","range":[0.0,0.0]},{"name":"shoe_slipper_right_free","range":[0.0,0.0]}],"source":{"robot":"piper","assets":{"profile":"piper","repository":"https://github.com/google-deepmind/mujoco_menagerie","commit":"0059d4335f8156206f63a35662313385f7ad6d74","files_verified":90,"bytes_verified":34562302,"lock_sha256":"4b2ee2ca675aceb2f826983cb3082a3e08e9aa0ff419b23078abcff08ebcc6fe","simulation_asset_license":"MIT"},"mujoco":"3.15.0","compiled_model_sha256":"59a8166ca34155a0f45477ee55dca30a34f1c787876922b7004108fdae8629c5","scene_sha256":"e7a0861dd038762ab9e42cf52ee1849d134fb37eaafe1c43dcf04e6131d94d4f"},"scope":"Recorded native MuJoCo scene settling with held arm commands. The browser displays saved poses and does not run physics. Shoes are authored rigid proxies with untested physical properties. No learned shoe skill, calibrated deformation, hardware or real-time qualification.","geometry_binary":{"href":"geometry.bin.gz","compression":"gzip","bytes":6736872,"compressed_bytes":3574720,"sha256":"2e9a97f9a4c776895f0f6888475f9bb161e659e426d2c5bf339022f25b267def"}} diff --git a/asset-library/v01/previews/piper/motion.bin.gz b/asset-library/v01/previews/piper/motion.bin.gz new file mode 100644 index 0000000000000000000000000000000000000000..28b59676880d52e0dc553b9c415783169bea616c --- /dev/null +++ b/asset-library/v01/previews/piper/motion.bin.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7dac62907bf79874eceb0246e5c5ca25308549363cdad866daa7f0a97f480d18 +size 5517 diff --git a/asset-library/v01/previews/piper/motion.json b/asset-library/v01/previews/piper/motion.json new file mode 100644 index 0000000000000000000000000000000000000000..2e197344a27388ab10c061936bab80eca9689fbb --- /dev/null +++ b/asset-library/v01/previews/piper/motion.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-preview-motion/v1","source":{"robot":"piper","assets":{"profile":"piper","repository":"https://github.com/google-deepmind/mujoco_menagerie","commit":"0059d4335f8156206f63a35662313385f7ad6d74","files_verified":90,"bytes_verified":34562302,"lock_sha256":"4b2ee2ca675aceb2f826983cb3082a3e08e9aa0ff419b23078abcff08ebcc6fe","simulation_asset_license":"MIT"},"mujoco":"3.15.0","compiled_model_sha256":"59a8166ca34155a0f45477ee55dca30a34f1c787876922b7004108fdae8629c5","scene_sha256":"e7a0861dd038762ab9e42cf52ee1849d134fb37eaafe1c43dcf04e6131d94d4f"},"scope":"Recorded native MuJoCo scene settling with held arm commands. The browser displays saved poses and does not run physics. Shoes are authored rigid proxies with untested physical properties. No learned shoe skill, calibrated deformation, hardware or real-time qualification.","body_count":16,"frame_count":101,"frame_stride_floats":112,"duration_seconds":2.0,"timestep_seconds":0.002,"rows":[{"t_seconds":0.0,"contact_count":0,"joint_position":[0.0,1.57,-1.3485,0.0,0.0,0.0,0.0,0.0]},{"t_seconds":0.02,"contact_count":0,"joint_position":[3.464525499289178e-21,1.57,-1.3485,-1.2360781511556304e-17,-2.8984846205690145e-18,1.2687213061932884e-17,1.0237079002377005e-19,9.907388308000508e-21]},{"t_seconds":0.04,"contact_count":0,"joint_position":[4.8768264047269506e-17,1.5700000000000025,-1.3485000000000098,-4.585681032850001e-16,1.8726359635642826e-14,-9.651723395677912e-16,1.0932469877824415e-16,3.966767003495036e-18]},{"t_seconds":0.06,"contact_count":0,"joint_position":[-1.496020627513788e-14,1.5699999999992311,-1.3484999999968257,1.3442054627744297e-13,-6.008827552264005e-12,3.1607062755255734e-13,-5.560021742652183e-15,-2.7433220906226126e-14]},{"t_seconds":0.08,"contact_count":0,"joint_position":[-4.006770493651948e-14,1.5699999999978835,-1.3484999999908953,3.733493775505188e-13,-1.7076054175451158e-11,8.799462973828165e-13,-2.845284568231621e-15,-6.780496504949315e-14]},{"t_seconds":0.1,"contact_count":0,"joint_position":[-6.11385969575356e-14,1.5699999999967473,-1.348499999985595,5.777427658017549e-13,-2.6877462490319028e-11,1.3607245830131624e-12,2.3134732573344945e-15,-9.12283874794838e-14]},{"t_seconds":0.12,"contact_count":0,"joint_position":[-8.215039482905765e-14,1.5699999999956267,-1.3484999999802416,7.797375791806878e-13,-3.677386645957421e-11,1.836015980167085e-12,4.763864390459016e-15,-1.0429438928931924e-13]},{"t_seconds":0.14,"contact_count":24,"joint_position":[-9.732446789366641e-14,1.5699999999948244,-1.3484999999761267,9.254084003728053e-13,-4.4344888768315115e-11,2.1819661575603513e-12,8.289029404207415e-15,-1.0464816012438936e-13]},{"t_seconds":0.16,"contact_count":24,"joint_position":[-1.1598139475239227e-13,1.5699999999938485,-1.3484999999712903,1.0994993727983996e-12,-5.333198089605893e-11,2.600192634742177e-12,6.3409535866172745e-15,-1.0487856404224563e-13]},{"t_seconds":0.18,"contact_count":24,"joint_position":[-1.28642867983824e-13,1.5699999999931893,-1.348499999967715,1.2167033421664647e-12,-5.99602077486102e-11,2.8911867521520308e-12,7.275518649178672e-15,-9.84681817607119e-14]},{"t_seconds":0.2,"contact_count":24,"joint_position":[-1.2231394238822644e-13,1.569999999993547,-1.3484999999684355,1.1524946663757553e-12,-5.853491105106324e-11,2.7624099278623936e-12,1.2758238402714594e-14,-6.847676472632233e-14]},{"t_seconds":0.22,"contact_count":24,"joint_position":[-1.1198109417429358e-13,1.5699999999941243,-1.3484999999703051,1.0450299095675193e-12,-5.505465261124884e-11,2.538520220621551e-12,1.3417796972653386e-14,-3.596938267716466e-14]},{"t_seconds":0.24,"contact_count":24,"joint_position":[-8.062761001814679e-14,1.5699999999958518,-1.3484999999772969,7.334250760856715e-13,-4.2048056752603516e-11,1.832328331929218e-12,1.8146090291485658e-14,8.877156663522931e-15]},{"t_seconds":0.26,"contact_count":24,"joint_position":[-5.3504534735793434e-14,1.5699999999974983,-1.3484999999843599,4.3052731149154167e-13,-2.9067993101888e-11,1.1580054547997446e-12,1.950097938840433e-14,-9.457539809066917e-15]},{"t_seconds":0.28,"contact_count":24,"joint_position":[-3.2728449987412706e-14,1.5699999999987455,-1.3484999999899976,1.948105920384888e-13,-1.8831519982813393e-11,6.486027593652905e-13,1.9880489591070946e-14,-1.98324814456648e-14]},{"t_seconds":0.3,"contact_count":24,"joint_position":[-7.654624166473676e-15,1.5700000000001706,-1.3484999999964467,-7.127720020820131e-14,-7.0266381385059435e-12,6.722962232235257e-14,2.2541312572171216e-14,-1.2588151488474886e-14]},{"t_seconds":0.32,"contact_count":24,"joint_position":[1.0875904628416512e-14,1.5700000000012169,-1.3485000000014327,-2.706467963686946e-13,2.0333912501705535e-12,-3.595457642194943e-13,1.9589659327611028e-14,-2.9688720780374526e-15]},{"t_seconds":0.34,"contact_count":24,"joint_position":[2.993014122924932e-14,1.5700000000022467,-1.3485000000063767,-4.648765247845859e-13,1.1069682702606942e-11,-7.805463631158635e-13,2.4268564621791787e-14,6.408060217509273e-15]},{"t_seconds":0.36,"contact_count":24,"joint_position":[4.6898247547100087e-14,1.5700000000031782,-1.3485000000109582,-6.393506658077695e-13,1.94648737862718e-11,-1.1645831655558989e-12,2.857635011509873e-14,1.6655882499761366e-15]},{"t_seconds":0.38,"contact_count":24,"joint_position":[4.302258850072351e-14,1.5700000000030119,-1.3485000000109613,-6.181775006162242e-13,1.926668847769668e-11,-1.0975302889614387e-12,2.1256990251489338e-14,-2.877789912465798e-14]},{"t_seconds":0.4,"contact_count":24,"joint_position":[3.751501170826639e-14,1.5700000000027279,-1.3485000000102223,-5.705976852387259e-13,1.7802835340401877e-11,-9.765515231995497e-13,1.924464719384257e-14,-5.115595457883921e-14]},{"t_seconds":0.42,"contact_count":24,"joint_position":[9.189123262710944e-15,1.5700000000012027,-1.348500000004027,-3.0146909244494614e-13,6.177560166184219e-12,-3.3961657264507785e-13,1.3119574738138722e-14,-9.308512237977263e-14]},{"t_seconds":0.44,"contact_count":24,"joint_position":[-2.1428539837372684e-14,1.5699999999995384,-1.3484999999968554,-2.576224046913423e-15,-7.126249786039824e-12,3.5747961521069887e-13,1.2469323740886326e-14,-1.2727589763991181e-13]},{"t_seconds":0.46,"contact_count":24,"joint_position":[-4.3481035155290694e-14,1.569999999998334,-1.3484999999913352,2.1989430992385594e-13,-1.723462230209961e-11,8.637217187386941e-13,1.6958576512341273e-14,-1.3943009571541597e-13]},{"t_seconds":0.48,"contact_count":24,"joint_position":[-6.530306944750842e-14,1.5699999999971586,-1.3484999999858498,4.3784655751502874e-13,-2.7295344055389655e-11,1.3552578943215085e-12,1.745637693822321e-14,-1.41072616461661e-13]},{"t_seconds":0.5,"contact_count":24,"joint_position":[-8.505168264064019e-14,1.5699999999960998,-1.348499999980771,6.349429580401538e-13,-3.6615061962703206e-11,1.7991327917781087e-12,1.6957415891195034e-14,-1.3610178042148945e-13]},{"t_seconds":0.52,"contact_count":24,"joint_position":[-1.0210611484401449e-13,1.5699999999951897,-1.3484999999762746,8.048086630682735e-13,-4.4879633785726e-11,2.1821253398055606e-12,1.5494746612293753e-14,-1.2641303322050042e-13]},{"t_seconds":0.54,"contact_count":24,"joint_position":[-1.1925619895510286e-13,1.5699999999942749,-1.348499999971735,9.736298267084618e-13,-5.3271673606075574e-11,2.5685068011782817e-12,1.2565003275701262e-14,-1.17656760093667e-13]},{"t_seconds":0.56,"contact_count":24,"joint_position":[-1.3116238373777642e-13,1.569999999993636,-1.348499999968304,1.092086983997803e-12,-5.960530762488858e-11,2.8444993713555423e-12,1.2127083599162571e-14,-1.0529404705267614e-13]},{"t_seconds":0.58,"contact_count":24,"joint_position":[-1.2453389484196035e-13,1.56999999999399,-1.3484999999691045,1.0324761455901568e-12,-5.8022554880455456e-11,2.70955281838374e-12,1.528482914681812e-14,-7.124621626214085e-14]},{"t_seconds":0.6,"contact_count":24,"joint_position":[-1.1100278553463125e-13,1.569999999994715,-1.3484999999716571,9.037347529323351e-13,-5.323589736396885e-11,2.4177516692334728e-12,1.658423063400443e-14,-3.383967889409305e-14]},{"t_seconds":0.62,"contact_count":24,"joint_position":[-7.93088850288083e-14,1.5699999999964542,-1.3484999999788059,5.928379000132058e-13,-3.993631901811266e-11,1.7010472775636542e-12,2.005674245827068e-14,7.155303715971755e-15]},{"t_seconds":0.64,"contact_count":24,"joint_position":[-5.384092838615058e-14,1.5699999999979897,-1.3484999999855063,3.1268362855029217e-13,-2.7637276942183303e-11,1.0657668354854117e-12,2.046701090589056e-14,-1.2662881965615088e-14]},{"t_seconds":0.66,"contact_count":24,"joint_position":[-3.104569569152249e-14,1.5699999999993188,-1.3484999999915364,6.650933437244015e-14,-1.663352590940958e-11,5.168860995315001e-13,2.1829569810818194e-14,-2.006731293632714e-14]},{"t_seconds":0.68,"contact_count":24,"joint_position":[-7.654496525940357e-15,1.570000000000633,-1.3484999999976028,-1.7725586431572324e-13,-5.5411445804826995e-12,-2.424221539108307e-14,2.26834420057891e-14,-1.2892770472698419e-14]},{"t_seconds":0.7,"contact_count":24,"joint_position":[1.0108269542065659e-14,1.5700000000016159,-1.348500000002382,-3.62506096378242e-13,3.14969951882581e-12,-4.3022158363860924e-13,1.915087441174151e-14,-3.593566352088106e-15]},{"t_seconds":0.72,"contact_count":24,"joint_position":[3.204898699394468e-14,1.5700000000027723,-1.348500000007888,-5.756836188522803e-13,1.3277188457919869e-11,-9.082843628207551e-13,2.664935015761009e-14,9.146784904525454e-15]},{"t_seconds":0.74,"contact_count":24,"joint_position":[4.7088217444123424e-14,1.5700000000035974,-1.3485000000120866,-7.291073996443053e-13,2.0965231853841496e-11,-1.2535951322651793e-12,2.81694817263478e-14,-4.4156170033866534e-16]},{"t_seconds":0.76,"contact_count":24,"joint_position":[5.839453782661067e-14,1.570000000004226,-1.3485000000154928,-8.454515122290738e-13,2.7199256786999866e-11,-1.5208024962049919e-12,2.556577051993418e-14,-1.0707029475969174e-14]},{"t_seconds":0.78,"contact_count":24,"joint_position":[5.30422083441048e-14,1.5700000000039331,-1.3485000000149068,-7.952930510784595e-13,2.599898125209264e-11,-1.4058608033165737e-12,2.076852837863568e-14,-3.3133342898050814e-14]},{"t_seconds":0.8,"contact_count":24,"joint_position":[3.551947902086779e-14,1.5700000000029826,-1.348500000011411,-6.263760452906074e-13,1.939217180219051e-11,-1.0166909399746228e-12,1.2373437803335905e-14,-6.091390810664418e-14]},{"t_seconds":0.82,"contact_count":24,"joint_position":[5.0947705512563064e-15,1.5700000000013092,-1.3485000000044798,-3.255915918401111e-13,6.4952738455585214e-12,-3.237004863953593e-13,9.19010160558883e-15,-1.0103805666317242e-13]},{"t_seconds":0.84,"contact_count":24,"joint_position":[-1.7150954662370063e-14,1.5700000000000667,-1.3484999999989886,-9.481060004080128e-14,-3.552032000385381e-12,1.9212789570347015e-13,1.4375917212654605e-14,-1.2090664600684756e-13]},{"t_seconds":0.86,"contact_count":24,"joint_position":[-4.31031181157312e-14,1.5699999999986491,-1.348499999992651,1.6748602199724368e-13,-1.5198681700747114e-11,7.777595245890628e-13,1.3658653679139132e-14,-1.3274514360998523e-13]},{"t_seconds":0.88,"contact_count":24,"joint_position":[-6.183258246470314e-14,1.569999999997622,-1.3484999999878051,3.6238409480473667e-13,-2.4028667132186486e-11,1.2021407221055777e-12,1.5610691287803243e-14,-1.3050316587055782e-13]},{"t_seconds":0.9,"contact_count":24,"joint_position":[-8.04480549753077e-14,1.569999999996611,-1.348499999982994,5.531375214624307e-13,-3.2839783260511826e-11,1.6191447991335475e-12,1.4379124898174034e-14,-1.243234391903314e-13]},{"t_seconds":0.92,"contact_count":24,"joint_position":[-9.721954139892913e-14,1.5699999999957002,-1.3484999999785485,7.246890970704515e-13,-4.1000385494482815e-11,1.9973332514677878e-12,1.2987743866201153e-14,-1.1611419811355872e-13]},{"t_seconds":0.94,"contact_count":24,"joint_position":[-1.1159087880485195e-13,1.5699999999949197,-1.3484999999746234,8.712922713879652e-13,-4.8223998174965137e-11,2.3237056991680974e-12,1.1328115815200577e-14,-1.0610166473058586e-13]},{"t_seconds":0.96,"contact_count":24,"joint_position":[-1.0454320418137377e-13,1.5699999999952854,-1.3484999999755722,8.127857867091617e-13,-4.6321840511024683e-11,2.175574521851897e-12,1.438093925442922e-14,-7.077315951204261e-14]},{"t_seconds":0.98,"contact_count":24,"joint_position":[-8.924072378663961e-14,1.5699999999960939,-1.34849999997856,6.72481325847443e-13,-4.067120552640577e-11,1.8416061170083484e-12,1.6608549420284467e-14,-3.091282423104963e-14]},{"t_seconds":1.0,"contact_count":24,"joint_position":[-5.4014164008620246e-14,1.5699999999979553,-1.3484999999863125,3.4367100017339063e-13,-2.619528648172777e-11,1.0661889501614789e-12,2.948133538506167e-14,2.308755166041417e-14]},{"t_seconds":1.02,"contact_count":24,"joint_position":[-2.934345574804083e-14,1.5699999999993142,-1.3484999999923788,9.668786562760592e-14,-1.506312321282219e-11,4.966659653605202e-13,4.1340853829036217e-14,1.855925773432782e-14]},{"t_seconds":1.04,"contact_count":24,"joint_position":[-6.065659923984182e-15,1.5700000000006276,-1.3484999999984062,-1.440637643231937e-13,-4.0180034233932384e-12,-5.1817128187740887e-14,4.3595697380873806e-14,1.589715566244594e-15]},{"t_seconds":1.06,"contact_count":24,"joint_position":[1.5201964913952738e-14,1.5700000000018128,-1.3485000000040102,-3.625788528504044e-13,6.2409116813518735e-12,-5.474206880899562e-13,4.198271035973554e-14,-6.263394962038564e-15]},{"t_seconds":1.08,"contact_count":24,"joint_position":[3.4049902606135965e-14,1.5700000000028398,-1.3485000000090082,-5.525881113516467e-13,1.5397350939584837e-11,-9.777139688149177e-13,3.8230383767291926e-14,-4.420167482556579e-15]},{"t_seconds":1.1,"contact_count":24,"joint_position":[5.3177144612298976e-14,1.570000000003867,-1.3485000000140424,-7.410601977398108e-13,2.4668074951743447e-11,-1.4092629534438585e-12,3.467260432753737e-14,3.1616518502308874e-15]},{"t_seconds":1.12,"contact_count":24,"joint_position":[6.646699293709254e-14,1.570000000004607,-1.3485000000179308,-8.773671262569817e-13,3.1810921270541025e-11,-1.7256570342795012e-12,2.995523634718493e-14,-5.511240958397419e-15]},{"t_seconds":1.14,"contact_count":24,"joint_position":[7.530124486009336e-14,1.5700000000050973,-1.3485000000208034,-9.672188363895584e-13,3.7077136304410147e-11,-1.942588957971249e-12,2.4619769965191835e-14,-1.3447549325637216e-14]},{"t_seconds":1.16,"contact_count":24,"joint_position":[6.99149310451863e-14,1.5700000000047971,-1.3485000000201837,-9.135899465782863e-13,3.5864005681755706e-11,-1.8285312513771988e-12,2.041977253828519e-14,-3.353552633494828e-14]},{"t_seconds":1.18,"contact_count":24,"joint_position":[4.874461431877694e-14,1.5700000000036491,-1.34850000001587,-7.083695544823935e-13,2.7757373328988033e-11,-1.3625042536856837e-12,1.0869459569819333e-14,-6.40945607186731e-14]},{"t_seconds":1.2,"contact_count":24,"joint_position":[1.9614120833160835e-14,1.5700000000020382,-1.3485000000091623,-4.166789368169708e-13,1.5339802668293596e-11,-6.985600162212407e-13,1.0127045236667955e-14,-1.0158925906234826e-13]},{"t_seconds":1.22,"contact_count":24,"joint_position":[-5.240837069565915e-15,1.5700000000006602,-1.3485000000031246,-1.6168950746188653e-13,4.2870356358076585e-12,-1.3088167902948828e-13,1.331901967389961e-14,-1.221959708934722e-13]},{"t_seconds":1.24,"contact_count":24,"joint_position":[-2.992722941959401e-14,1.5699999999993068,-1.3484999999970397,9.054024880341938e-14,-6.842829593669671e-12,4.2439272262866724e-13,1.4187883365800537e-14,-1.318057175221691e-13]},{"t_seconds":1.26,"contact_count":24,"joint_position":[-4.833916531632639e-14,1.5699999999982968,-1.3484999999922695,2.8301071963230574e-13,-1.5504311337731904e-11,8.381951820382779e-13,1.642670970897288e-14,-1.2811946858143773e-13]},{"t_seconds":1.28,"contact_count":24,"joint_position":[-7.030331936519287e-14,1.5699999999971108,-1.3484999999867484,5.044758811414703e-13,-2.5641622645013613e-11,1.3243849259969827e-12,1.3021960616194636e-14,-1.2475128224110872e-13]},{"t_seconds":1.3,"contact_count":24,"joint_position":[-8.582918706305407e-14,1.5699999999962653,-1.3484999999825658,6.6502159913941e-13,-3.3278624204767476e-11,1.6731452343700438e-12,1.2854421685428277e-14,-1.1488653600408539e-13]},{"t_seconds":1.32,"contact_count":24,"joint_position":[-9.757177787479416e-14,1.5699999999956216,-1.3484999999791931,7.877626725646547e-13,-3.942768281184132e-11,1.941028834774835e-12,1.3399241049257828e-14,-1.0200285154598747e-13]},{"t_seconds":1.34,"contact_count":24,"joint_position":[-9.179341597331744e-14,1.569999999995923,-1.348499999979915,7.397736785402878e-13,-3.795092363572532e-11,1.8161692758821816e-12,1.471485838760956e-14,-6.719729740645115e-14]},{"t_seconds":1.36,"contact_count":24,"joint_position":[-7.332042955653144e-14,1.5699999999969,-1.3484999999836202,5.699028469906993e-13,-3.092895349334403e-11,1.4095518222924699e-12,1.8369759945706014e-14,-2.3864268436973318e-14]},{"t_seconds":1.38,"contact_count":24,"joint_position":[-4.249521055666623e-14,1.5699999999986196,-1.3484999999908496,2.646608545141888e-13,-1.745472832333672e-11,6.909005623877905e-13,2.0974010213641455e-14,4.8424988704886476e-15]},{"t_seconds":1.4,"contact_count":24,"joint_position":[-2.1600673697662838e-14,1.5699999999998961,-1.3484999999965979,3.1288981575198363e-14,-6.910852684259804e-12,1.5399718135675728e-13,1.999286793652871e-14,-1.7818609030246326e-14]},{"t_seconds":1.42,"contact_count":24,"joint_position":[3.971183316393984e-15,1.570000000001353,-1.3485000000032124,-2.344814420261466e-13,5.269956832472932e-12,-4.54657070998768e-13,2.396125746539951e-14,-1.8438252779991948e-14]},{"t_seconds":1.44,"contact_count":24,"joint_position":[2.2767353070942855e-14,1.5700000000024086,-1.3485000000082927,-4.311181263841155e-13,1.4554596703610506e-11,-8.978598444753608e-13,2.2027237200372037e-14,-1.2406042406611909e-14]},{"t_seconds":1.46,"contact_count":24,"joint_position":[4.184892329396499e-14,1.570000000003447,-1.3485000000133347,-6.235931519977257e-13,2.3815146235154783e-11,-1.3334896668616555e-12,2.025570305787485e-14,-2.3244110275405343e-16]},{"t_seconds":1.48,"contact_count":24,"joint_position":[5.827590194236556e-14,1.5700000000043834,-1.3485000000179999,-7.96472050076249e-13,3.240337795242484e-11,-1.7292128437670716e-12,1.9111451206437973e-14,-1.0352528700965787e-14]},{"t_seconds":1.5,"contact_count":24,"joint_position":[7.276477670690169e-14,1.570000000005186,-1.3485000000221277,-9.438700618760517e-13,4.0025270447858195e-11,-2.0716814710488526e-12,1.9128250243257682e-14,-1.3304382484124765e-14]},{"t_seconds":1.52,"contact_count":24,"joint_position":[7.721604359233173e-14,1.5700000000054335,-1.348500000023999,-9.919796009993824e-13,4.341143444757839e-11,-2.189552936993021e-12,1.2660473709857208e-14,-1.7443238397992898e-14]},{"t_seconds":1.54,"contact_count":24,"joint_position":[7.245594516483403e-14,1.5700000000051562,-1.3485000000234337,-9.422256571199794e-13,4.232961682961567e-11,-2.08466120264529e-12,1.050880835739118e-14,-3.159487867984653e-14]},{"t_seconds":1.56,"contact_count":24,"joint_position":[4.703624649229851e-14,1.570000000003772,-1.3485000000181036,-6.964768127409726e-13,3.232614415769262e-11,-1.5202813329147273e-12,3.157941371377697e-16,-6.402875912939227e-14]},{"t_seconds":1.58,"contact_count":24,"joint_position":[2.0284487506651205e-14,1.5700000000022754,-1.3485000000118013,-4.2414775929609547e-13,2.0710848267993714e-11,-9.035647407481953e-13,2.9784913718473625e-15,-9.719918860657412e-14]},{"t_seconds":1.6,"contact_count":24,"joint_position":[-5.347182307610243e-15,1.5700000000008483,-1.348500000005527,-1.605770474727293e-13,9.226321455341397e-12,-3.1642501370529424e-13,6.51836318782252e-15,-1.1710926528771932e-13]},{"t_seconds":1.62,"contact_count":24,"joint_position":[-2.856619969780557e-14,1.569999999999564,-1.3484999999996836,7.916301710997057e-14,-1.4304423294734003e-12,2.1154139292276794e-13,9.399881193160364e-15,-1.248526261080885e-13]},{"t_seconds":1.64,"contact_count":24,"joint_position":[-4.8886347985967214e-14,1.5699999999984475,-1.3484999999944616,2.891604663507129e-13,-1.0944662065885383e-11,6.692957147841109e-13,1.0532870164640076e-14,-1.230544672203761e-13]},{"t_seconds":1.66,"contact_count":24,"joint_position":[-6.926848032584513e-14,1.5699999999973346,-1.3484999999892038,4.972810390539995e-13,-2.0569933121081192e-11,1.1260757738472115e-12,9.32260223157238e-15,-1.1893415544811949e-13]},{"t_seconds":1.68,"contact_count":24,"joint_position":[-8.407106660088612e-14,1.5699999999965193,-1.3484999999851244,6.515588980969124e-13,-2.800661251255348e-11,1.462947512388824e-12,1.012161531948607e-14,-1.088158699872135e-13]},{"t_seconds":1.7,"contact_count":24,"joint_position":[-9.401711557647686e-14,1.5699999999959635,-1.348499999982089,7.577285536259977e-13,-3.351365189059507e-11,1.6965003562999807e-12,1.2209207933218985e-14,-9.45344874942909e-14]},{"t_seconds":1.72,"contact_count":24,"joint_position":[-8.897159037424949e-14,1.5699999999962215,-1.348499999982641,7.161058883654779e-13,-3.236600790561289e-11,1.5892910288961982e-12,1.2507420489087704e-14,-6.096586746131038e-14]},{"t_seconds":1.74,"contact_count":24,"joint_position":[-6.752201113624454e-14,1.5699999999973515,-1.3484999999869876,5.182703498584142e-13,-2.4139195831198675e-11,1.120083803260089e-12,1.7332559021254005e-14,-1.4989620119921663e-14]},{"t_seconds":1.76,"contact_count":24,"joint_position":[-3.906610911857711e-14,1.5699999999989591,-1.3484999999937937,2.311108343689034e-13,-1.148485533810017e-11,4.47114604526565e-13,1.8751950193118667e-14,3.0343349363500187e-15]},{"t_seconds":1.78,"contact_count":24,"joint_position":[-1.617039458006618e-14,1.570000000000329,-1.3484999999999132,-1.892304001406314e-14,-2.2982182530602287e-13,-1.275425119848644e-13,1.9829332090164728e-14,-1.6666209902268654e-14]},{"t_seconds":1.8,"contact_count":24,"joint_position":[7.504385516305392e-15,1.5700000000016752,-1.3485000000060834,-2.6666339116469914e-13,1.1106267401354187e-11,-6.89992481875582e-13,2.2349428857082858e-14,-1.7143116174406788e-14]},{"t_seconds":1.82,"contact_count":24,"joint_position":[2.5362332913706693e-14,1.5700000000026708,-1.348500000010906,-4.535957410657805e-13,1.9910245047211186e-11,-1.107666526930734e-12,2.005961005864271e-14,-1.1339849198136053e-14]},{"t_seconds":1.84,"contact_count":24,"joint_position":[4.7159502635452336e-14,1.5700000000038494,-1.3485000000165006,-6.708481786599647e-13,3.023086155557722e-11,-1.5999925073320384e-12,2.017951759231762e-14,2.1443249726206413e-15]},{"t_seconds":1.86,"contact_count":24,"joint_position":[6.330669078457261e-14,1.57000000000468,-1.3485000000207235,-8.260873889325598e-13,3.7986691540312566e-11,-1.9516098305851028e-12,2.771364967722382e-14,6.124442483175703e-15]},{"t_seconds":1.88,"contact_count":24,"joint_position":[7.853232728168394e-14,1.570000000005503,-1.3485000000249168,-9.775138092653384e-13,4.5740886346111693e-11,-2.301472913082775e-12,2.964201681507272e-14,-3.18526595147758e-15]},{"t_seconds":1.9,"contact_count":24,"joint_position":[7.98256004664653e-14,1.570000000005579,-1.3485000000260567,-9.957965750981058e-13,4.775328846453175e-11,-2.3482810269726856e-12,2.1910160473875812e-14,-2.014792718657293e-14]},{"t_seconds":1.92,"contact_count":24,"joint_position":[7.537730358043616e-14,1.570000000005314,-1.3485000000255036,-9.485032835346439e-13,4.6708782605927455e-11,-2.2472858715430675e-12,2.0246059082655446e-14,-3.879510354203938e-14]},{"t_seconds":1.94,"contact_count":24,"joint_position":[4.804205985333291e-14,1.5700000000038243,-1.3485000000196703,-6.844515433544976e-13,3.5776463586507126e-11,-1.6368837372466227e-12,9.789775579186905e-15,-7.623562543253209e-14]},{"t_seconds":1.96,"contact_count":24,"joint_position":[2.2357020599932987e-14,1.570000000002384,-1.3485000000135419,-4.2190464623008226e-13,2.4507752705073722e-11,-1.0423112022543468e-12,1.2797088803731632e-14,-1.0776082507950855e-13]},{"t_seconds":1.98,"contact_count":24,"joint_position":[-6.673747183649901e-15,1.5700000000007819,-1.348500000006518,-1.286717617805723e-13,1.1603410283164874e-11,-3.8183887853391805e-13,1.2808320068781692e-14,-1.2952811754443975e-13]},{"t_seconds":2.0,"contact_count":24,"joint_position":[-2.7933751823492824e-14,1.5699999999996024,-1.3485000000010676,9.254292516652798e-14,1.6960422451046088e-12,1.0365091184761037e-13,1.6002837321031134e-14,-1.3345587620258198e-13]}],"motion_binary":{"href":"motion.bin.gz","compression":"gzip","bytes":45248,"compressed_bytes":5517,"sha256":"6b6ad61e63c3f2c96ad8fcf5fde106ee5b82dc8fc91605dda03d810be338859a"}} diff --git a/asset-library/v01/previews/piper/preview-integrity.json b/asset-library/v01/previews/piper/preview-integrity.json new file mode 100644 index 0000000000000000000000000000000000000000..b7e5d7bcc8b0a7e36d9200a24e064e770d357b61 --- /dev/null +++ b/asset-library/v01/previews/piper/preview-integrity.json @@ -0,0 +1,70 @@ +{ + "schema": "dvidia.asset-preview-integrity/v1", + "scope": "Artifact consistency only, not authenticity or physical qualification", + "files": { + "scene.json": { + "bytes": 290, + "sha256": "e7a0861dd038762ab9e42cf52ee1849d134fb37eaafe1c43dcf04e6131d94d4f" + }, + "catalog.json": { + "bytes": 25194, + "sha256": "82e44bf83ca4c64051b5dc99ca0d301cb416dfee6dc043e86582d6fd4fa490ba" + }, + "model.json": { + "bytes": 53226, + "sha256": "a125a01e184c1e7bfab9fdfd7e0af9830b9f484633b415e5180048b357e32b90" + }, + "motion.json": { + "bytes": 24477, + "sha256": "a0f265dd67cff10d81709e9fb5a36c7c3ee7ce17bcd3a8e84d4dfff5ba0549d9" + }, + "geometry.bin.gz": { + "bytes": 3574720, + "sha256": "51365a5a661d8062e28c66abc6bdb843ee410811f84b49d62c5878c265b3631f" + }, + "motion.bin.gz": { + "bytes": 5517, + "sha256": "7dac62907bf79874eceb0246e5c5ca25308549363cdad866daa7f0a97f480d18" + }, + "index.html": { + "bytes": 9636, + "sha256": "41a97a426a2b72520e39a469eaa78f4b281c7fef9cf9607301af9c398594251f" + }, + "asset_library.bundle.js": { + "bytes": 529697, + "sha256": "fe7a98bf9b991a33d030114b9e447bd687230a9dbc381631fd316da408857ee9" + }, + "reference_replay.third-party.txt": { + "bytes": 1199, + "sha256": "ea4da6cf7a8a54649702f0eb8d057c8ced12f8fed2329c5e96d92a3316922813" + }, + "LICENSE": { + "bytes": 1076, + "sha256": "ab47d245880a661fdca3c6a4cb91671031302deee50d64f8d2d6df86832962e1" + }, + "licenses/agilex_piper/LICENSE": { + "bytes": 1065, + "sha256": "e32d78fd3761052ab0b2bb42fef8a7a9ad3f298d315d305333c349d2aff1f134" + }, + "licenses/agilex_piper/README.md": { + "bytes": 1681, + "sha256": "ab0d218758ec6c298417407962f49179e369236e8f316dbaa7671756d6f8eb77" + }, + "scenes/trainer.json": { + "bytes": 222, + "sha256": "5b1c7dda306e489c2de3266e26ccd049803755c6d011f24e1f98457694876a89" + }, + "scenes/ankle-boot.json": { + "bytes": 228, + "sha256": "3fb24e5e438a7672e3d54dbb2396c1170c72c86e9ac8b659740341de77d5c96c" + }, + "scenes/slipper.json": { + "bytes": 222, + "sha256": "d8ea8e04c7392b822d5b67fd335fd032f9d42e721f6861c4bcaebc920d55bda8" + }, + "README.md": { + "bytes": 897, + "sha256": "195849dd9df960ae7e42a29433c46c810132f52154ccc0ef3df79649d5aa89af" + } + } +} diff --git a/asset-library/v01/previews/piper/reference_replay.third-party.txt b/asset-library/v01/previews/piper/reference_replay.third-party.txt new file mode 100644 index 0000000000000000000000000000000000000000..90689e3bf3feb75cb7e7fb0e72cd389e508c35a5 --- /dev/null +++ b/asset-library/v01/previews/piper/reference_replay.third-party.txt @@ -0,0 +1,26 @@ +DVIDIA self-hosted reference replay + +Three.js 0.180.0 and OrbitControls +https://github.com/mrdoob/three.js/tree/r180 + +The MIT License + +Copyright © 2010-2025 three.js authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/asset-library/v01/previews/piper/scene.json b/asset-library/v01/previews/piper/scene.json new file mode 100644 index 0000000000000000000000000000000000000000..721e2c22b9e48586e81c92293bca6a301e72d4cd --- /dev/null +++ b/asset-library/v01/previews/piper/scene.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-scene/v1","catalog_version":"0.1.0","catalog_sha256":"592f363389a96fef7f9223737aa72a2f1a74f400238924bf6790ec5bfd3302b7","robot":"piper","shoe_ids":["trainer-left","trainer-right","ankle-boot-left","ankle-boot-right","slipper-left","slipper-right"],"timestep":0.002} diff --git a/asset-library/v01/previews/piper/scenes/ankle-boot.json b/asset-library/v01/previews/piper/scenes/ankle-boot.json new file mode 100644 index 0000000000000000000000000000000000000000..e442c9251d1088ed2f425896954a477873677093 --- /dev/null +++ b/asset-library/v01/previews/piper/scenes/ankle-boot.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-scene/v1","catalog_version":"0.1.0","catalog_sha256":"592f363389a96fef7f9223737aa72a2f1a74f400238924bf6790ec5bfd3302b7","robot":"piper","shoe_ids":["ankle-boot-left","ankle-boot-right"],"timestep":0.002} diff --git a/asset-library/v01/previews/piper/scenes/slipper.json b/asset-library/v01/previews/piper/scenes/slipper.json new file mode 100644 index 0000000000000000000000000000000000000000..5aa52578dec3368497c46b7d7d2e9d3653353d71 --- /dev/null +++ b/asset-library/v01/previews/piper/scenes/slipper.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-scene/v1","catalog_version":"0.1.0","catalog_sha256":"592f363389a96fef7f9223737aa72a2f1a74f400238924bf6790ec5bfd3302b7","robot":"piper","shoe_ids":["slipper-left","slipper-right"],"timestep":0.002} diff --git a/asset-library/v01/previews/piper/scenes/trainer.json b/asset-library/v01/previews/piper/scenes/trainer.json new file mode 100644 index 0000000000000000000000000000000000000000..16881dcd4027f46b20b3f0af64e24992cfdefc1e --- /dev/null +++ b/asset-library/v01/previews/piper/scenes/trainer.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-scene/v1","catalog_version":"0.1.0","catalog_sha256":"592f363389a96fef7f9223737aa72a2f1a74f400238924bf6790ec5bfd3302b7","robot":"piper","shoe_ids":["trainer-left","trainer-right"],"timestep":0.002} diff --git a/asset-library/v01/previews/so101/LICENSE b/asset-library/v01/previews/so101/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a7056f2889009b6b736691291d2e65e63bab2fdc --- /dev/null +++ b/asset-library/v01/previews/so101/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 DVIDIA contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/asset-library/v01/previews/so101/README.md b/asset-library/v01/previews/so101/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7fd10d088e8f3f8d2bd46a8d7a54966e2aad5550 --- /dev/null +++ b/asset-library/v01/previews/so101/README.md @@ -0,0 +1,5 @@ +# DVIDIA asset library preview + +Recorded native MuJoCo scene settling with held arm commands. The browser displays saved poses and does not run physics. Shoes are authored rigid proxies with untested physical properties. No learned shoe skill, calibrated deformation, hardware or real-time qualification. + +Serve this directory with `python -m http.server 8000` and open http://localhost:8000. Everything is local; JavaScript, WebGL2 and DecompressionStream are required. The pair selector filters recorded objects visually; use a downloaded scene descriptor with dvidia-assets scene --config to compile and simulate only that pair. geometry.bin.gz and motion.bin.gz decode to bounded little-endian Float32 positions and wxyz quaternions. MIT applies to DVIDIA code and synthetic shoes. Robot model licenses and original READMEs remain under licenses/. Three.js/OrbitControls notices are included. diff --git a/asset-library/v01/previews/so101/asset_library.bundle.js b/asset-library/v01/previews/so101/asset_library.bundle.js new file mode 100644 index 0000000000000000000000000000000000000000..ae7d8edbc18ded9f1785e00e287bee9f3f73081c --- /dev/null +++ b/asset-library/v01/previews/so101/asset_library.bundle.js @@ -0,0 +1,3834 @@ +/* DVIDIA asset library. MIT; bundled Three.js r180, MIT. See reference_replay.third-party.txt. */ +(()=>{var Hn={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Gn={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Bl=0,uo=1,zl=2;var fo=1,kl=2,un=3,Sn=0,De=1,Ve=2,Tn=0,ni=1,po=2,mo=3,go=4,Vl=5,On=100,Hl=101,Gl=102,Wl=103,Xl=104,ql=200,Yl=201,Zl=202,Jl=203,sr=204,rr=205,$l=206,Kl=207,jl=208,Ql=209,tc=210,ec=211,nc=212,ic=213,sc=214,Ir=0,Pr=1,Dr=2,ii=3,Lr=4,Ur=5,Nr=6,Fr=7,_o=0,rc=1,ac=2,wn=0,oc=1,lc=2,cc=3,Or=4,hc=5,uc=6,dc=7;var xo=300,li=301,ci=302,Br=303,zr=304,Rs=306,ar=1e3,Fn=1001,or=1002,Ye=1003,fc=1004;var Cs=1005;var tn=1006,kr=1007;var Wn=1008;var sn=1009,yo=1010,vo=1011,ki=1012,Vr=1013,Xn=1014,dn=1015,Vi=1016,Hr=1017,Gr=1018,Hi=1020,Mo=35902,So=35899,bo=1021,Eo=1022,Je=1023,Pi=1026,Gi=1027,To=1028,Wr=1029,wo=1030,Xr=1031;var qr=1033,Is=33776,Ps=33777,Ds=33778,Ls=33779,Yr=35840,Zr=35841,Jr=35842,$r=35843,Kr=36196,jr=37492,Qr=37496,ta=37808,ea=37809,na=37810,ia=37811,sa=37812,ra=37813,aa=37814,oa=37815,la=37816,ca=37817,ha=37818,ua=37819,da=37820,fa=37821,pa=36492,ma=36494,ga=36495,_a=36283,xa=36284,ya=36285,va=36286;var rs=2300,lr=2301,ir=2302,io=2400,so=2401,ro=2402;var pc=3200,mc=3201;var Ao=0,gc=1,An="",Ce="srgb",bn="srgb-linear",as="linear",Yt="srgb";var ei=7680;var ao=519,_c=512,xc=513,yc=514,Ro=515,vc=516,Mc=517,Sc=518,bc=519,oo=35044;var Co="300 es",Qe=2e3,os=2001;var ln=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){let n=this._listeners;return n===void 0?!1:n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){let n=this._listeners;if(n===void 0)return;let s=n[t];if(s!==void 0){let r=s.indexOf(e);r!==-1&&s.splice(r,1)}}dispatchEvent(t){let e=this._listeners;if(e===void 0)return;let n=e[t.type];if(n!==void 0){t.target=this;let s=n.slice(0);for(let r=0,a=s.length;r>8&255]+Se[i>>16&255]+Se[i>>24&255]+"-"+Se[t&255]+Se[t>>8&255]+"-"+Se[t>>16&15|64]+Se[t>>24&255]+"-"+Se[e&63|128]+Se[e>>8&255]+"-"+Se[e>>16&255]+Se[e>>24&255]+Se[n&255]+Se[n>>8&255]+Se[n>>16&255]+Se[n>>24&255]).toLowerCase()}function zt(i,t,e){return Math.max(t,Math.min(e,i))}function Io(i,t){return(i%t+t)%t}function yh(i,t,e,n,s){return n+(i-t)*(s-n)/(e-t)}function vh(i,t,e){return i!==t?(e-i)/(t-i):0}function ss(i,t,e){return(1-e)*i+e*t}function Mh(i,t,e,n){return ss(i,t,1-Math.exp(-e*n))}function Sh(i,t=1){return t-Math.abs(Io(i,t*2)-t)}function bh(i,t,e){return i<=t?0:i>=e?1:(i=(i-t)/(e-t),i*i*(3-2*i))}function Eh(i,t,e){return i<=t?0:i>=e?1:(i=(i-t)/(e-t),i*i*i*(i*(i*6-15)+10))}function Th(i,t){return i+Math.floor(Math.random()*(t-i+1))}function wh(i,t){return i+Math.random()*(t-i)}function Ah(i){return i*(.5-Math.random())}function Rh(i){i!==void 0&&(pl=i);let t=pl+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Ch(i){return i*is}function Ih(i){return i*Di}function Ph(i){return(i&i-1)===0&&i!==0}function Dh(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function Lh(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function Uh(i,t,e,n,s){let r=Math.cos,a=Math.sin,o=r(e/2),c=a(e/2),l=r((t+n)/2),h=a((t+n)/2),d=r((t-n)/2),f=a((t-n)/2),p=r((n-t)/2),_=a((n-t)/2);switch(s){case"XYX":i.set(o*h,c*d,c*f,o*l);break;case"YZY":i.set(c*f,o*h,c*d,o*l);break;case"ZXZ":i.set(c*d,c*f,o*h,o*l);break;case"XZX":i.set(o*h,c*_,c*p,o*l);break;case"YXY":i.set(c*p,o*h,c*_,o*l);break;case"ZYZ":i.set(c*_,c*p,o*h,o*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function Ci(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function Re(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}var Po={DEG2RAD:is,RAD2DEG:Di,generateUUID:Wi,clamp:zt,euclideanModulo:Io,mapLinear:yh,inverseLerp:vh,lerp:ss,damp:Mh,pingpong:Sh,smoothstep:bh,smootherstep:Eh,randInt:Th,randFloat:wh,randFloatSpread:Ah,seededRandom:Rh,degToRad:Ch,radToDeg:Ih,isPowerOfTwo:Ph,ceilPowerOfTwo:Dh,floorPowerOfTwo:Lh,setQuaternionFromProperEuler:Uh,normalize:Re,denormalize:Ci},Pt=class i{constructor(t=0,e=0){i.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,n=this.y,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6],this.y=s[1]*e+s[4]*n+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=zt(this.x,t.x,e.x),this.y=zt(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=zt(this.x,t,e),this.y=zt(this.y,t,e),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(zt(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(zt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let n=Math.cos(e),s=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*n-a*s+t.x,this.y=r*s+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Ze=class{constructor(t=0,e=0,n=0,s=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=s}static slerpFlat(t,e,n,s,r,a,o){let c=n[s+0],l=n[s+1],h=n[s+2],d=n[s+3],f=r[a+0],p=r[a+1],_=r[a+2],y=r[a+3];if(o===0){t[e+0]=c,t[e+1]=l,t[e+2]=h,t[e+3]=d;return}if(o===1){t[e+0]=f,t[e+1]=p,t[e+2]=_,t[e+3]=y;return}if(d!==y||c!==f||l!==p||h!==_){let m=1-o,u=c*f+l*p+h*_+d*y,T=u>=0?1:-1,E=1-u*u;if(E>Number.EPSILON){let R=Math.sqrt(E),A=Math.atan2(R,u*T);m=Math.sin(m*A)/R,o=Math.sin(o*A)/R}let S=o*T;if(c=c*m+f*S,l=l*m+p*S,h=h*m+_*S,d=d*m+y*S,m===1-o){let R=1/Math.sqrt(c*c+l*l+h*h+d*d);c*=R,l*=R,h*=R,d*=R}}t[e]=c,t[e+1]=l,t[e+2]=h,t[e+3]=d}static multiplyQuaternionsFlat(t,e,n,s,r,a){let o=n[s],c=n[s+1],l=n[s+2],h=n[s+3],d=r[a],f=r[a+1],p=r[a+2],_=r[a+3];return t[e]=o*_+h*d+c*p-l*f,t[e+1]=c*_+h*f+l*d-o*p,t[e+2]=l*_+h*p+o*f-c*d,t[e+3]=h*_-o*d-c*f-l*p,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,s){return this._x=t,this._y=e,this._z=n,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let n=t._x,s=t._y,r=t._z,a=t._order,o=Math.cos,c=Math.sin,l=o(n/2),h=o(s/2),d=o(r/2),f=c(n/2),p=c(s/2),_=c(r/2);switch(a){case"XYZ":this._x=f*h*d+l*p*_,this._y=l*p*d-f*h*_,this._z=l*h*_+f*p*d,this._w=l*h*d-f*p*_;break;case"YXZ":this._x=f*h*d+l*p*_,this._y=l*p*d-f*h*_,this._z=l*h*_-f*p*d,this._w=l*h*d+f*p*_;break;case"ZXY":this._x=f*h*d-l*p*_,this._y=l*p*d+f*h*_,this._z=l*h*_+f*p*d,this._w=l*h*d-f*p*_;break;case"ZYX":this._x=f*h*d-l*p*_,this._y=l*p*d+f*h*_,this._z=l*h*_-f*p*d,this._w=l*h*d+f*p*_;break;case"YZX":this._x=f*h*d+l*p*_,this._y=l*p*d+f*h*_,this._z=l*h*_-f*p*d,this._w=l*h*d-f*p*_;break;case"XZY":this._x=f*h*d-l*p*_,this._y=l*p*d-f*h*_,this._z=l*h*_+f*p*d,this._w=l*h*d+f*p*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let n=e/2,s=Math.sin(n);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,n=e[0],s=e[4],r=e[8],a=e[1],o=e[5],c=e[9],l=e[2],h=e[6],d=e[10],f=n+o+d;if(f>0){let p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(h-c)*p,this._y=(r-l)*p,this._z=(a-s)*p}else if(n>o&&n>d){let p=2*Math.sqrt(1+n-o-d);this._w=(h-c)/p,this._x=.25*p,this._y=(s+a)/p,this._z=(r+l)/p}else if(o>d){let p=2*Math.sqrt(1+o-n-d);this._w=(r-l)/p,this._x=(s+a)/p,this._y=.25*p,this._z=(c+h)/p}else{let p=2*Math.sqrt(1+d-n-o);this._w=(a-s)/p,this._x=(r+l)/p,this._y=(c+h)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<1e-8?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(zt(this.dot(t),-1,1)))}rotateTowards(t,e){let n=this.angleTo(t);if(n===0)return this;let s=Math.min(1,e/n);return this.slerp(t,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let n=t._x,s=t._y,r=t._z,a=t._w,o=e._x,c=e._y,l=e._z,h=e._w;return this._x=n*h+a*o+s*l-r*c,this._y=s*h+a*c+r*o-n*l,this._z=r*h+a*l+n*c-s*o,this._w=a*h-n*o-s*c-r*l,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);let n=this._x,s=this._y,r=this._z,a=this._w,o=a*t._w+n*t._x+s*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=n,this._y=s,this._z=r,this;let c=1-o*o;if(c<=Number.EPSILON){let p=1-e;return this._w=p*a+e*this._w,this._x=p*n+e*this._x,this._y=p*s+e*this._y,this._z=p*r+e*this._z,this.normalize(),this}let l=Math.sqrt(c),h=Math.atan2(l,o),d=Math.sin((1-e)*h)/l,f=Math.sin(e*h)/l;return this._w=a*d+this._w*f,this._x=n*d+this._x*f,this._y=s*d+this._y*f,this._z=r*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),s=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(s*Math.sin(t),s*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},L=class i{constructor(t=0,e=0,n=0){i.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(ml.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(ml.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,n=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*s,this.y=r[1]*e+r[4]*n+r[7]*s,this.z=r[2]*e+r[5]*n+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,n=this.y,s=this.z,r=t.elements,a=1/(r[3]*e+r[7]*n+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*s+r[12])*a,this.y=(r[1]*e+r[5]*n+r[9]*s+r[13])*a,this.z=(r[2]*e+r[6]*n+r[10]*s+r[14])*a,this}applyQuaternion(t){let e=this.x,n=this.y,s=this.z,r=t.x,a=t.y,o=t.z,c=t.w,l=2*(a*s-o*n),h=2*(o*e-r*s),d=2*(r*n-a*e);return this.x=e+c*l+a*d-o*h,this.y=n+c*h+o*l-r*d,this.z=s+c*d+r*h-a*l,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,n=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*s,this.y=r[1]*e+r[5]*n+r[9]*s,this.z=r[2]*e+r[6]*n+r[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=zt(this.x,t.x,e.x),this.y=zt(this.y,t.y,e.y),this.z=zt(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=zt(this.x,t,e),this.y=zt(this.y,t,e),this.z=zt(this.z,t,e),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(zt(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let n=t.x,s=t.y,r=t.z,a=e.x,o=e.y,c=e.z;return this.x=s*c-r*o,this.y=r*a-n*c,this.z=n*o-s*a,this}projectOnVector(t){let e=t.lengthSq();if(e===0)return this.set(0,0,0);let n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return Ua.copy(this).projectOnVector(t),this.sub(Ua)}reflect(t){return this.sub(Ua.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(zt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y,s=this.z-t.z;return e*e+n*n+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){let s=Math.sin(e)*t;return this.x=s*Math.sin(n),this.y=Math.cos(e)*t,this.z=s*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},Ua=new L,ml=new Ze,Ut=class i{constructor(t,e,n,s,r,a,o,c,l){i.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,s,r,a,o,c,l)}set(t,e,n,s,r,a,o,c,l){let h=this.elements;return h[0]=t,h[1]=s,h[2]=o,h[3]=e,h[4]=r,h[5]=c,h[6]=n,h[7]=a,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,s=e.elements,r=this.elements,a=n[0],o=n[3],c=n[6],l=n[1],h=n[4],d=n[7],f=n[2],p=n[5],_=n[8],y=s[0],m=s[3],u=s[6],T=s[1],E=s[4],S=s[7],R=s[2],A=s[5],P=s[8];return r[0]=a*y+o*T+c*R,r[3]=a*m+o*E+c*A,r[6]=a*u+o*S+c*P,r[1]=l*y+h*T+d*R,r[4]=l*m+h*E+d*A,r[7]=l*u+h*S+d*P,r[2]=f*y+p*T+_*R,r[5]=f*m+p*E+_*A,r[8]=f*u+p*S+_*P,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],c=t[6],l=t[7],h=t[8];return e*a*h-e*o*l-n*r*h+n*o*c+s*r*l-s*a*c}invert(){let t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],c=t[6],l=t[7],h=t[8],d=h*a-o*l,f=o*c-h*r,p=l*r-a*c,_=e*d+n*f+s*p;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);let y=1/_;return t[0]=d*y,t[1]=(s*l-h*n)*y,t[2]=(o*n-s*a)*y,t[3]=f*y,t[4]=(h*e-s*c)*y,t[5]=(s*r-o*e)*y,t[6]=p*y,t[7]=(n*c-l*e)*y,t[8]=(a*e-n*r)*y,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,s,r,a,o){let c=Math.cos(r),l=Math.sin(r);return this.set(n*c,n*l,-n*(c*a+l*o)+a+t,-s*l,s*c,-s*(-l*a+c*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(Na.makeScale(t,e)),this}rotate(t){return this.premultiply(Na.makeRotation(-t)),this}translate(t,e){return this.premultiply(Na.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,n=t.elements;for(let s=0;s<9;s++)if(e[s]!==n[s])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}},Na=new Ut;function Do(i){for(let t=i.length-1;t>=0;--t)if(i[t]>=65535)return!0;return!1}function ls(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function Ec(){let i=ls("canvas");return i.style.display="block",i}var gl={};function Li(i){i in gl||(gl[i]=!0,console.warn(i))}function Tc(i,t,e){return new Promise(function(n,s){function r(){switch(i.clientWaitSync(t,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:s();break;case i.TIMEOUT_EXPIRED:setTimeout(r,e);break;default:n()}}setTimeout(r,e)})}var _l=new Ut().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),xl=new Ut().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Nh(){let i={enabled:!0,workingColorSpace:bn,spaces:{},convert:function(s,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===Yt&&(s.r=Mn(s.r),s.g=Mn(s.g),s.b=Mn(s.b)),this.spaces[r].primaries!==this.spaces[a].primaries&&(s.applyMatrix3(this.spaces[r].toXYZ),s.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Yt&&(s.r=Ii(s.r),s.g=Ii(s.g),s.b=Ii(s.b))),s},workingToColorSpace:function(s,r){return this.convert(s,this.workingColorSpace,r)},colorSpaceToWorking:function(s,r){return this.convert(s,r,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===An?as:this.spaces[s].transfer},getToneMappingMode:function(s){return this.spaces[s].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(s,r=this.workingColorSpace){return s.fromArray(this.spaces[r].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,r,a){return s.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(s,r){return Li("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),i.workingToColorSpace(s,r)},toWorkingColorSpace:function(s,r){return Li("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),i.colorSpaceToWorking(s,r)}},t=[.64,.33,.3,.6,.15,.06],e=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[bn]:{primaries:t,whitePoint:n,transfer:as,toXYZ:_l,fromXYZ:xl,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:Ce},outputColorSpaceConfig:{drawingBufferColorSpace:Ce}},[Ce]:{primaries:t,whitePoint:n,transfer:Yt,toXYZ:_l,fromXYZ:xl,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:Ce}}}),i}var Gt=Nh();function Mn(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function Ii(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}var _i,cr=class{static getDataURL(t,e="image/png"){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let n;if(t instanceof HTMLCanvasElement)n=t;else{_i===void 0&&(_i=ls("canvas")),_i.width=t.width,_i.height=t.height;let s=_i.getContext("2d");t instanceof ImageData?s.putImageData(t,0,0):s.drawImage(t,0,0,t.width,t.height),n=_i}return n.toDataURL(e)}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let e=ls("canvas");e.width=t.width,e.height=t.height;let n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);let s=n.getImageData(0,0,t.width,t.height),r=s.data;for(let a=0;a1),this.pmremVersion=0}get width(){return this.source.getSize(Oa).x}get height(){return this.source.getSize(Oa).y}get depth(){return this.source.getSize(Oa).z}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(let e in t){let n=t[e];if(n===void 0){console.warn(`THREE.Texture.setValues(): parameter '${e}' has value of undefined.`);continue}let s=this[e];if(s===void 0){console.warn(`THREE.Texture.setValues(): property '${e}' does not exist.`);continue}s&&n&&s.isVector2&&n.isVector2||s&&n&&s.isVector3&&n.isVector3||s&&n&&s.isMatrix3&&n.isMatrix3?s.copy(n):this[e]=n}}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==xo)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case ar:t.x=t.x-Math.floor(t.x);break;case Fn:t.x=t.x<0?0:1;break;case or:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case ar:t.y=t.y-Math.floor(t.y);break;case Fn:t.y=t.y<0?0:1;break;case or:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}};ze.DEFAULT_IMAGE=null;ze.DEFAULT_MAPPING=xo;ze.DEFAULT_ANISOTROPY=1;var le=class i{constructor(t=0,e=0,n=0,s=1){i.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=s}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,s){return this.x=t,this.y=e,this.z=n,this.w=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,n=this.y,s=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*s+a[12]*r,this.y=a[1]*e+a[5]*n+a[9]*s+a[13]*r,this.z=a[2]*e+a[6]*n+a[10]*s+a[14]*r,this.w=a[3]*e+a[7]*n+a[11]*s+a[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,s,r,c=t.elements,l=c[0],h=c[4],d=c[8],f=c[1],p=c[5],_=c[9],y=c[2],m=c[6],u=c[10];if(Math.abs(h-f)<.01&&Math.abs(d-y)<.01&&Math.abs(_-m)<.01){if(Math.abs(h+f)<.1&&Math.abs(d+y)<.1&&Math.abs(_+m)<.1&&Math.abs(l+p+u-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let E=(l+1)/2,S=(p+1)/2,R=(u+1)/2,A=(h+f)/4,P=(d+y)/4,N=(_+m)/4;return E>S&&E>R?E<.01?(n=0,s=.707106781,r=.707106781):(n=Math.sqrt(E),s=A/n,r=P/n):S>R?S<.01?(n=.707106781,s=0,r=.707106781):(s=Math.sqrt(S),n=A/s,r=N/s):R<.01?(n=.707106781,s=.707106781,r=0):(r=Math.sqrt(R),n=P/r,s=N/r),this.set(n,s,r,e),this}let T=Math.sqrt((m-_)*(m-_)+(d-y)*(d-y)+(f-h)*(f-h));return Math.abs(T)<.001&&(T=1),this.x=(m-_)/T,this.y=(d-y)/T,this.z=(f-h)/T,this.w=Math.acos((l+p+u-1)/2),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=zt(this.x,t.x,e.x),this.y=zt(this.y,t.y,e.y),this.z=zt(this.z,t.z,e.z),this.w=zt(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=zt(this.x,t,e),this.y=zt(this.y,t,e),this.z=zt(this.z,t,e),this.w=zt(this.w,t,e),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(zt(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},hr=class extends ln{constructor(t=1,e=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:tn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=n.depth,this.scissor=new le(0,0,t,e),this.scissorTest=!1,this.viewport=new le(0,0,t,e);let s={width:t,height:e,depth:n.depth},r=new ze(s);this.textures=[];let a=n.count;for(let o=0;o1;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,n=t.textures.length;e=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,$e),$e.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(ji),Bs.subVectors(this.max,ji),xi.subVectors(t.a,ji),yi.subVectors(t.b,ji),vi.subVectors(t.c,ji),Cn.subVectors(yi,xi),In.subVectors(vi,yi),Kn.subVectors(xi,vi);let e=[0,-Cn.z,Cn.y,0,-In.z,In.y,0,-Kn.z,Kn.y,Cn.z,0,-Cn.x,In.z,0,-In.x,Kn.z,0,-Kn.x,-Cn.y,Cn.x,0,-In.y,In.x,0,-Kn.y,Kn.x,0];return!Ba(e,xi,yi,vi,Bs)||(e=[1,0,0,0,1,0,0,0,1],!Ba(e,xi,yi,vi,Bs))?!1:(zs.crossVectors(Cn,In),e=[zs.x,zs.y,zs.z],Ba(e,xi,yi,vi,Bs))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,$e).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize($e).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(mn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),mn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),mn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),mn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),mn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),mn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),mn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),mn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(mn),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}},mn=[new L,new L,new L,new L,new L,new L,new L,new L],$e=new L,Os=new hn,xi=new L,yi=new L,vi=new L,Cn=new L,In=new L,Kn=new L,ji=new L,Bs=new L,zs=new L,jn=new L;function Ba(i,t,e,n,s){for(let r=0,a=i.length-3;r<=a;r+=3){jn.fromArray(i,r);let o=s.x*Math.abs(jn.x)+s.y*Math.abs(jn.y)+s.z*Math.abs(jn.z),c=t.dot(jn),l=e.dot(jn),h=n.dot(jn);if(Math.max(-Math.max(c,l,h),Math.min(c,l,h))>o)return!1}return!0}var Bh=new hn,Qi=new L,za=new L,si=class{constructor(t=new L,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let n=this.center;e!==void 0?n.copy(e):Bh.setFromPoints(t).getCenter(n);let s=0;for(let r=0,a=t.length;rthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Qi.subVectors(t,this.center);let e=Qi.lengthSq();if(e>this.radius*this.radius){let n=Math.sqrt(e),s=(n-this.radius)*.5;this.center.addScaledVector(Qi,s/n),this.radius+=s}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(za.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Qi.copy(t.center).add(za)),this.expandByPoint(Qi.copy(t.center).sub(za))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}},gn=new L,ka=new L,ks=new L,Pn=new L,Va=new L,Vs=new L,Ha=new L,ri=class{constructor(t=new L,e=new L(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,gn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=gn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(gn.copy(this.origin).addScaledVector(this.direction,e),gn.distanceToSquared(t))}distanceSqToSegment(t,e,n,s){ka.copy(t).add(e).multiplyScalar(.5),ks.copy(e).sub(t).normalize(),Pn.copy(this.origin).sub(ka);let r=t.distanceTo(e)*.5,a=-this.direction.dot(ks),o=Pn.dot(this.direction),c=-Pn.dot(ks),l=Pn.lengthSq(),h=Math.abs(1-a*a),d,f,p,_;if(h>0)if(d=a*c-o,f=a*o-c,_=r*h,d>=0)if(f>=-_)if(f<=_){let y=1/h;d*=y,f*=y,p=d*(d+a*f+2*o)+f*(a*d+f+2*c)+l}else f=r,d=Math.max(0,-(a*f+o)),p=-d*d+f*(f+2*c)+l;else f=-r,d=Math.max(0,-(a*f+o)),p=-d*d+f*(f+2*c)+l;else f<=-_?(d=Math.max(0,-(-a*r+o)),f=d>0?-r:Math.min(Math.max(-r,-c),r),p=-d*d+f*(f+2*c)+l):f<=_?(d=0,f=Math.min(Math.max(-r,-c),r),p=f*(f+2*c)+l):(d=Math.max(0,-(a*r+o)),f=d>0?r:Math.min(Math.max(-r,-c),r),p=-d*d+f*(f+2*c)+l);else f=a>0?-r:r,d=Math.max(0,-(a*f+o)),p=-d*d+f*(f+2*c)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,d),s&&s.copy(ka).addScaledVector(ks,f),p}intersectSphere(t,e){gn.subVectors(t.center,this.origin);let n=gn.dot(this.direction),s=gn.dot(gn)-n*n,r=t.radius*t.radius;if(s>r)return null;let a=Math.sqrt(r-s),o=n-a,c=n+a;return c<0?null:o<0?this.at(c,e):this.at(o,e)}intersectsSphere(t){return t.radius<0?!1:this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){let n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,s,r,a,o,c,l=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,f=this.origin;return l>=0?(n=(t.min.x-f.x)*l,s=(t.max.x-f.x)*l):(n=(t.max.x-f.x)*l,s=(t.min.x-f.x)*l),h>=0?(r=(t.min.y-f.y)*h,a=(t.max.y-f.y)*h):(r=(t.max.y-f.y)*h,a=(t.min.y-f.y)*h),n>a||r>s||((r>n||isNaN(n))&&(n=r),(a=0?(o=(t.min.z-f.z)*d,c=(t.max.z-f.z)*d):(o=(t.max.z-f.z)*d,c=(t.min.z-f.z)*d),n>c||o>s)||((o>n||n!==n)&&(n=o),(c=0?n:s,e)}intersectsBox(t){return this.intersectBox(t,gn)!==null}intersectTriangle(t,e,n,s,r){Va.subVectors(e,t),Vs.subVectors(n,t),Ha.crossVectors(Va,Vs);let a=this.direction.dot(Ha),o;if(a>0){if(s)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Pn.subVectors(this.origin,t);let c=o*this.direction.dot(Vs.crossVectors(Pn,Vs));if(c<0)return null;let l=o*this.direction.dot(Va.cross(Pn));if(l<0||c+l>a)return null;let h=-o*Pn.dot(Ha);return h<0?null:this.at(h/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},he=class i{constructor(t,e,n,s,r,a,o,c,l,h,d,f,p,_,y,m){i.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,s,r,a,o,c,l,h,d,f,p,_,y,m)}set(t,e,n,s,r,a,o,c,l,h,d,f,p,_,y,m){let u=this.elements;return u[0]=t,u[4]=e,u[8]=n,u[12]=s,u[1]=r,u[5]=a,u[9]=o,u[13]=c,u[2]=l,u[6]=h,u[10]=d,u[14]=f,u[3]=p,u[7]=_,u[11]=y,u[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new i().fromArray(this.elements)}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){let e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){let e=this.elements,n=t.elements,s=1/Mi.setFromMatrixColumn(t,0).length(),r=1/Mi.setFromMatrixColumn(t,1).length(),a=1/Mi.setFromMatrixColumn(t,2).length();return e[0]=n[0]*s,e[1]=n[1]*s,e[2]=n[2]*s,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,n=t.x,s=t.y,r=t.z,a=Math.cos(n),o=Math.sin(n),c=Math.cos(s),l=Math.sin(s),h=Math.cos(r),d=Math.sin(r);if(t.order==="XYZ"){let f=a*h,p=a*d,_=o*h,y=o*d;e[0]=c*h,e[4]=-c*d,e[8]=l,e[1]=p+_*l,e[5]=f-y*l,e[9]=-o*c,e[2]=y-f*l,e[6]=_+p*l,e[10]=a*c}else if(t.order==="YXZ"){let f=c*h,p=c*d,_=l*h,y=l*d;e[0]=f+y*o,e[4]=_*o-p,e[8]=a*l,e[1]=a*d,e[5]=a*h,e[9]=-o,e[2]=p*o-_,e[6]=y+f*o,e[10]=a*c}else if(t.order==="ZXY"){let f=c*h,p=c*d,_=l*h,y=l*d;e[0]=f-y*o,e[4]=-a*d,e[8]=_+p*o,e[1]=p+_*o,e[5]=a*h,e[9]=y-f*o,e[2]=-a*l,e[6]=o,e[10]=a*c}else if(t.order==="ZYX"){let f=a*h,p=a*d,_=o*h,y=o*d;e[0]=c*h,e[4]=_*l-p,e[8]=f*l+y,e[1]=c*d,e[5]=y*l+f,e[9]=p*l-_,e[2]=-l,e[6]=o*c,e[10]=a*c}else if(t.order==="YZX"){let f=a*c,p=a*l,_=o*c,y=o*l;e[0]=c*h,e[4]=y-f*d,e[8]=_*d+p,e[1]=d,e[5]=a*h,e[9]=-o*h,e[2]=-l*h,e[6]=p*d+_,e[10]=f-y*d}else if(t.order==="XZY"){let f=a*c,p=a*l,_=o*c,y=o*l;e[0]=c*h,e[4]=-d,e[8]=l*h,e[1]=f*d+y,e[5]=a*h,e[9]=p*d-_,e[2]=_*d-p,e[6]=o*h,e[10]=y*d+f}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(zh,t,kh)}lookAt(t,e,n){let s=this.elements;return Oe.subVectors(t,e),Oe.lengthSq()===0&&(Oe.z=1),Oe.normalize(),Dn.crossVectors(n,Oe),Dn.lengthSq()===0&&(Math.abs(n.z)===1?Oe.x+=1e-4:Oe.z+=1e-4,Oe.normalize(),Dn.crossVectors(n,Oe)),Dn.normalize(),Hs.crossVectors(Oe,Dn),s[0]=Dn.x,s[4]=Hs.x,s[8]=Oe.x,s[1]=Dn.y,s[5]=Hs.y,s[9]=Oe.y,s[2]=Dn.z,s[6]=Hs.z,s[10]=Oe.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,s=e.elements,r=this.elements,a=n[0],o=n[4],c=n[8],l=n[12],h=n[1],d=n[5],f=n[9],p=n[13],_=n[2],y=n[6],m=n[10],u=n[14],T=n[3],E=n[7],S=n[11],R=n[15],A=s[0],P=s[4],N=s[8],M=s[12],v=s[1],C=s[5],F=s[9],k=s[13],H=s[2],q=s[6],W=s[10],et=s[14],V=s[3],rt=s[7],ct=s[11],St=s[15];return r[0]=a*A+o*v+c*H+l*V,r[4]=a*P+o*C+c*q+l*rt,r[8]=a*N+o*F+c*W+l*ct,r[12]=a*M+o*k+c*et+l*St,r[1]=h*A+d*v+f*H+p*V,r[5]=h*P+d*C+f*q+p*rt,r[9]=h*N+d*F+f*W+p*ct,r[13]=h*M+d*k+f*et+p*St,r[2]=_*A+y*v+m*H+u*V,r[6]=_*P+y*C+m*q+u*rt,r[10]=_*N+y*F+m*W+u*ct,r[14]=_*M+y*k+m*et+u*St,r[3]=T*A+E*v+S*H+R*V,r[7]=T*P+E*C+S*q+R*rt,r[11]=T*N+E*F+S*W+R*ct,r[15]=T*M+E*k+S*et+R*St,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[4],s=t[8],r=t[12],a=t[1],o=t[5],c=t[9],l=t[13],h=t[2],d=t[6],f=t[10],p=t[14],_=t[3],y=t[7],m=t[11],u=t[15];return _*(+r*c*d-s*l*d-r*o*f+n*l*f+s*o*p-n*c*p)+y*(+e*c*p-e*l*f+r*a*f-s*a*p+s*l*h-r*c*h)+m*(+e*l*d-e*o*p-r*a*d+n*a*p+r*o*h-n*l*h)+u*(-s*o*h-e*c*d+e*o*f+s*a*d-n*a*f+n*c*h)}transpose(){let t=this.elements,e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){let s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=n),this}invert(){let t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],c=t[6],l=t[7],h=t[8],d=t[9],f=t[10],p=t[11],_=t[12],y=t[13],m=t[14],u=t[15],T=d*m*l-y*f*l+y*c*p-o*m*p-d*c*u+o*f*u,E=_*f*l-h*m*l-_*c*p+a*m*p+h*c*u-a*f*u,S=h*y*l-_*d*l+_*o*p-a*y*p-h*o*u+a*d*u,R=_*d*c-h*y*c-_*o*f+a*y*f+h*o*m-a*d*m,A=e*T+n*E+s*S+r*R;if(A===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let P=1/A;return t[0]=T*P,t[1]=(y*f*r-d*m*r-y*s*p+n*m*p+d*s*u-n*f*u)*P,t[2]=(o*m*r-y*c*r+y*s*l-n*m*l-o*s*u+n*c*u)*P,t[3]=(d*c*r-o*f*r-d*s*l+n*f*l+o*s*p-n*c*p)*P,t[4]=E*P,t[5]=(h*m*r-_*f*r+_*s*p-e*m*p-h*s*u+e*f*u)*P,t[6]=(_*c*r-a*m*r-_*s*l+e*m*l+a*s*u-e*c*u)*P,t[7]=(a*f*r-h*c*r+h*s*l-e*f*l-a*s*p+e*c*p)*P,t[8]=S*P,t[9]=(_*d*r-h*y*r-_*n*p+e*y*p+h*n*u-e*d*u)*P,t[10]=(a*y*r-_*o*r+_*n*l-e*y*l-a*n*u+e*o*u)*P,t[11]=(h*o*r-a*d*r-h*n*l+e*d*l+a*n*p-e*o*p)*P,t[12]=R*P,t[13]=(h*y*s-_*d*s+_*n*f-e*y*f-h*n*m+e*d*m)*P,t[14]=(_*o*s-a*y*s-_*n*c+e*y*c+a*n*m-e*o*m)*P,t[15]=(a*d*s-h*o*s+h*n*c-e*d*c-a*n*f+e*o*f)*P,this}scale(t){let e=this.elements,n=t.x,s=t.y,r=t.z;return e[0]*=n,e[4]*=s,e[8]*=r,e[1]*=n,e[5]*=s,e[9]*=r,e[2]*=n,e[6]*=s,e[10]*=r,e[3]*=n,e[7]*=s,e[11]*=r,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,s))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let n=Math.cos(e),s=Math.sin(e),r=1-n,a=t.x,o=t.y,c=t.z,l=r*a,h=r*o;return this.set(l*a+n,l*o-s*c,l*c+s*o,0,l*o+s*c,h*o+n,h*c-s*a,0,l*c-s*o,h*c+s*a,r*c*c+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,s,r,a){return this.set(1,n,r,0,t,1,a,0,e,s,1,0,0,0,0,1),this}compose(t,e,n){let s=this.elements,r=e._x,a=e._y,o=e._z,c=e._w,l=r+r,h=a+a,d=o+o,f=r*l,p=r*h,_=r*d,y=a*h,m=a*d,u=o*d,T=c*l,E=c*h,S=c*d,R=n.x,A=n.y,P=n.z;return s[0]=(1-(y+u))*R,s[1]=(p+S)*R,s[2]=(_-E)*R,s[3]=0,s[4]=(p-S)*A,s[5]=(1-(f+u))*A,s[6]=(m+T)*A,s[7]=0,s[8]=(_+E)*P,s[9]=(m-T)*P,s[10]=(1-(f+y))*P,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,n){let s=this.elements,r=Mi.set(s[0],s[1],s[2]).length(),a=Mi.set(s[4],s[5],s[6]).length(),o=Mi.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),t.x=s[12],t.y=s[13],t.z=s[14],Ke.copy(this);let l=1/r,h=1/a,d=1/o;return Ke.elements[0]*=l,Ke.elements[1]*=l,Ke.elements[2]*=l,Ke.elements[4]*=h,Ke.elements[5]*=h,Ke.elements[6]*=h,Ke.elements[8]*=d,Ke.elements[9]*=d,Ke.elements[10]*=d,e.setFromRotationMatrix(Ke),n.x=r,n.y=a,n.z=o,this}makePerspective(t,e,n,s,r,a,o=Qe,c=!1){let l=this.elements,h=2*r/(e-t),d=2*r/(n-s),f=(e+t)/(e-t),p=(n+s)/(n-s),_,y;if(c)_=r/(a-r),y=a*r/(a-r);else if(o===Qe)_=-(a+r)/(a-r),y=-2*a*r/(a-r);else if(o===os)_=-a/(a-r),y=-a*r/(a-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=h,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=d,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=_,l[14]=y,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,s,r,a,o=Qe,c=!1){let l=this.elements,h=2/(e-t),d=2/(n-s),f=-(e+t)/(e-t),p=-(n+s)/(n-s),_,y;if(c)_=1/(a-r),y=a/(a-r);else if(o===Qe)_=-2/(a-r),y=-(a+r)/(a-r);else if(o===os)_=-1/(a-r),y=-r/(a-r);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=h,l[4]=0,l[8]=0,l[12]=f,l[1]=0,l[5]=d,l[9]=0,l[13]=p,l[2]=0,l[6]=0,l[10]=_,l[14]=y,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){let e=this.elements,n=t.elements;for(let s=0;s<16;s++)if(e[s]!==n[s])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}},Mi=new L,Ke=new he,zh=new L(0,0,0),kh=new L(1,1,1),Dn=new L,Hs=new L,Oe=new L,yl=new he,vl=new Ze,en=class i{constructor(t=0,e=0,n=0,s=i.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,s=this._order){return this._x=t,this._y=e,this._z=n,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){let s=t.elements,r=s[0],a=s[4],o=s[8],c=s[1],l=s[5],h=s[9],d=s[2],f=s[6],p=s[10];switch(e){case"XYZ":this._y=Math.asin(zt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(f,l),this._z=0);break;case"YXZ":this._x=Math.asin(-zt(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,p),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-d,r),this._z=0);break;case"ZXY":this._x=Math.asin(zt(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,p),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(c,r));break;case"ZYX":this._y=Math.asin(-zt(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(c,r)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(zt(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-d,r)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-zt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,l),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return yl.makeRotationFromQuaternion(t),this.setFromRotationMatrix(yl,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return vl.setFromEuler(this),this.setFromQuaternion(vl,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};en.DEFAULT_ORDER="XYZ";var hs=class{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let e=0;e1){for(let n=0;n0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),s.instanceInfo=this._instanceInfo.map(o=>({...o})),s.availableInstanceIds=this._availableInstanceIds.slice(),s.availableGeometryIds=this._availableGeometryIds.slice(),s.nextIndexStart=this._nextIndexStart,s.nextVertexStart=this._nextVertexStart,s.geometryCount=this._geometryCount,s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.matricesTexture=this._matricesTexture.toJSON(t),s.indirectTexture=this._indirectTexture.toJSON(t),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(s.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(s.boundingBox=this.boundingBox.toJSON()));function r(o,c){return o[c.uuid]===void 0&&(o[c.uuid]=c.toJSON(t)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(t.geometries,this.geometry);let o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){let c=o.shapes;if(Array.isArray(c))for(let l=0,h=c.length;l0){s.children=[];for(let o=0;o0){s.animations=[];for(let o=0;o0&&(n.geometries=o),c.length>0&&(n.materials=c),l.length>0&&(n.textures=l),h.length>0&&(n.images=h),d.length>0&&(n.shapes=d),f.length>0&&(n.skeletons=f),p.length>0&&(n.animations=p),_.length>0&&(n.nodes=_)}return n.object=s,n;function a(o){let c=[];for(let l in o){let h=o[l];delete h.metadata,c.push(h)}return c}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(t,e,n,s,r){je.subVectors(s,e),xn.subVectors(n,e),Wa.subVectors(t,e);let a=je.dot(je),o=je.dot(xn),c=je.dot(Wa),l=xn.dot(xn),h=xn.dot(Wa),d=a*l-o*o;if(d===0)return r.set(0,0,0),null;let f=1/d,p=(l*c-o*h)*f,_=(a*h-o*c)*f;return r.set(1-p-_,_,p)}static containsPoint(t,e,n,s){return this.getBarycoord(t,e,n,s,yn)===null?!1:yn.x>=0&&yn.y>=0&&yn.x+yn.y<=1}static getInterpolation(t,e,n,s,r,a,o,c){return this.getBarycoord(t,e,n,s,yn)===null?(c.x=0,c.y=0,"z"in c&&(c.z=0),"w"in c&&(c.w=0),null):(c.setScalar(0),c.addScaledVector(r,yn.x),c.addScaledVector(a,yn.y),c.addScaledVector(o,yn.z),c)}static getInterpolatedAttribute(t,e,n,s,r,a){return Za.setScalar(0),Ja.setScalar(0),$a.setScalar(0),Za.fromBufferAttribute(t,e),Ja.fromBufferAttribute(t,n),$a.fromBufferAttribute(t,s),a.setScalar(0),a.addScaledVector(Za,r.x),a.addScaledVector(Ja,r.y),a.addScaledVector($a,r.z),a}static isFrontFacing(t,e,n,s){return je.subVectors(n,e),xn.subVectors(t,e),je.cross(xn).dot(s)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,s){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,n,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,s),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return je.subVectors(this.c,this.b),xn.subVectors(this.a,this.b),je.cross(xn).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return i.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return i.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,s,r){return i.getInterpolation(t,this.a,this.b,this.c,e,n,s,r)}containsPoint(t){return i.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return i.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let n=this.a,s=this.b,r=this.c,a,o;Ei.subVectors(s,n),Ti.subVectors(r,n),Xa.subVectors(t,n);let c=Ei.dot(Xa),l=Ti.dot(Xa);if(c<=0&&l<=0)return e.copy(n);qa.subVectors(t,s);let h=Ei.dot(qa),d=Ti.dot(qa);if(h>=0&&d<=h)return e.copy(s);let f=c*d-h*l;if(f<=0&&c>=0&&h<=0)return a=c/(c-h),e.copy(n).addScaledVector(Ei,a);Ya.subVectors(t,r);let p=Ei.dot(Ya),_=Ti.dot(Ya);if(_>=0&&p<=_)return e.copy(r);let y=p*l-c*_;if(y<=0&&l>=0&&_<=0)return o=l/(l-_),e.copy(n).addScaledVector(Ti,o);let m=h*_-p*d;if(m<=0&&d-h>=0&&p-_>=0)return wl.subVectors(r,s),o=(d-h)/(d-h+(p-_)),e.copy(s).addScaledVector(wl,o);let u=1/(m+y+f);return a=y*u,o=f*u,e.copy(n).addScaledVector(Ei,a).addScaledVector(Ti,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},wc={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ln={h:0,s:0,l:0},Ws={h:0,s:0,l:0};function Ka(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+(t-i)*6*e:e<1/2?t:e<2/3?i+(t-i)*6*(2/3-e):i}var Ot=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){let s=t;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Ce){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Gt.colorSpaceToWorking(this,e),this}setRGB(t,e,n,s=Gt.workingColorSpace){return this.r=t,this.g=e,this.b=n,Gt.colorSpaceToWorking(this,s),this}setHSL(t,e,n,s=Gt.workingColorSpace){if(t=Io(t,1),e=zt(e,0,1),n=zt(n,0,1),e===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+e):n+e-n*e,a=2*n-r;this.r=Ka(a,r,t+1/3),this.g=Ka(a,r,t),this.b=Ka(a,r,t-1/3)}return Gt.colorSpaceToWorking(this,s),this}setStyle(t,e=Ce){function n(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(t)){let r,a=s[1],o=s[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(t)){let r=s[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(r,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Ce){let n=wc[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Mn(t.r),this.g=Mn(t.g),this.b=Mn(t.b),this}copyLinearToSRGB(t){return this.r=Ii(t.r),this.g=Ii(t.g),this.b=Ii(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Ce){return Gt.workingToColorSpace(be.copy(this),t),Math.round(zt(be.r*255,0,255))*65536+Math.round(zt(be.g*255,0,255))*256+Math.round(zt(be.b*255,0,255))}getHexString(t=Ce){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Gt.workingColorSpace){Gt.workingToColorSpace(be.copy(this),e);let n=be.r,s=be.g,r=be.b,a=Math.max(n,s,r),o=Math.min(n,s,r),c,l,h=(o+a)/2;if(o===a)c=0,l=0;else{let d=a-o;switch(l=h<=.5?d/(a+o):d/(2-a-o),a){case n:c=(s-r)/d+(s0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(let e in t){let n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}let s=this[e];if(s===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(n):s&&s.isVector3&&n&&n.isVector3?s.copy(n):this[e]=n}}toJSON(t){let e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});let n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(t).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(t).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==ni&&(n.blending=this.blending),this.side!==Sn&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==sr&&(n.blendSrc=this.blendSrc),this.blendDst!==rr&&(n.blendDst=this.blendDst),this.blendEquation!==On&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==ii&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==ao&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ei&&(n.stencilFail=this.stencilFail),this.stencilZFail!==ei&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==ei&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function s(r){let a=[];for(let o in r){let c=r[o];delete c.metadata,a.push(c)}return a}if(e){let r=s(t.textures),a=s(t.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,n=null;if(e!==null){let s=e.length;n=new Array(s);for(let r=0;r!==s;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}},us=class extends En{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ot(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new en,this.combine=_o,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}};var de=new L,Xs=new Pt,qh=0,Te=class{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:qh++}),this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=oo,this.updateRanges=[],this.gpuType=dn,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let s=0,r=this.itemSize;se.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new hn);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new L(-1/0,-1/0,-1/0),new L(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,s=e.length;n0&&(t.userData=this.userData),this.parameters!==void 0){let c=this.parameters;for(let l in c)c[l]!==void 0&&(t[l]=c[l]);return t}t.data={attributes:{}};let e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let n=this.attributes;for(let c in n){let l=n[c];t.data.attributes[c]=l.toJSON(t.data)}let s={},r=!1;for(let c in this.morphAttributes){let l=this.morphAttributes[c],h=[];for(let d=0,f=l.length;d0&&(s[c]=h,r=!0)}r&&(t.data.morphAttributes=s,t.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(t.data.boundingSphere=o.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let n=t.index;n!==null&&this.setIndex(n.clone());let s=t.attributes;for(let l in s){let h=s[l];this.setAttribute(l,h.clone(e))}let r=t.morphAttributes;for(let l in r){let h=[],d=r[l];for(let f=0,p=d.length;f0){let s=e[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r(t.far-t.near)**2))&&(Al.copy(r).invert(),Qn.copy(t.ray).applyMatrix4(Al),!(n.boundingBox!==null&&Qn.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,Qn)))}_computeIntersections(t,e,n){let s,r=this.geometry,a=this.material,o=r.index,c=r.attributes.position,l=r.attributes.uv,h=r.attributes.uv1,d=r.attributes.normal,f=r.groups,p=r.drawRange;if(o!==null)if(Array.isArray(a))for(let _=0,y=f.length;_e.far?null:{distance:l,point:Ks.clone(),object:i}}function js(i,t,e,n,s,r,a,o,c,l){i.getVertexPosition(o,Ys),i.getVertexPosition(c,Zs),i.getVertexPosition(l,Js);let h=Zh(i,t,e,n,Ys,Zs,Js,Cl);if(h){let d=new L;Nn.getBarycoord(Cl,Ys,Zs,Js,d),s&&(h.uv=Nn.getInterpolatedAttribute(s,o,c,l,d,new Pt)),r&&(h.uv1=Nn.getInterpolatedAttribute(r,o,c,l,d,new Pt)),a&&(h.normal=Nn.getInterpolatedAttribute(a,o,c,l,d,new L),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));let f={a:o,b:c,c:l,normal:new L,materialIndex:0};Nn.getNormal(Ys,Zs,Js,f.normal),h.face=f,h.barycoord=d}return h}var Bn=class i extends Ie{constructor(t=1,e=1,n=1,s=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:s,heightSegments:r,depthSegments:a};let o=this;s=Math.floor(s),r=Math.floor(r),a=Math.floor(a);let c=[],l=[],h=[],d=[],f=0,p=0;_("z","y","x",-1,-1,n,e,t,a,r,0),_("z","y","x",1,-1,n,e,-t,a,r,1),_("x","z","y",1,1,t,n,e,s,a,2),_("x","z","y",1,-1,t,n,-e,s,a,3),_("x","y","z",1,-1,t,e,n,s,r,4),_("x","y","z",-1,-1,t,e,-n,s,r,5),this.setIndex(c),this.setAttribute("position",new oe(l,3)),this.setAttribute("normal",new oe(h,3)),this.setAttribute("uv",new oe(d,2));function _(y,m,u,T,E,S,R,A,P,N,M){let v=S/P,C=R/N,F=S/2,k=R/2,H=A/2,q=P+1,W=N+1,et=0,V=0,rt=new L;for(let ct=0;ct0?1:-1,h.push(rt.x,rt.y,rt.z),d.push(kt/P),d.push(1-ct/N),et+=1}}for(let ct=0;ct0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;let n={};for(let s in this.extensions)this.extensions[s]===!0&&(n[s]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}},ps=class extends ve{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new he,this.projectionMatrix=new he,this.projectionMatrixInverse=new he,this.coordinateSystem=Qe,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},Un=new L,Il=new Pt,Pl=new Pt,Ee=class extends ps{constructor(t=50,e=1,n=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=s,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){let e=.5*this.getFilmHeight()/t;this.fov=Di*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(is*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Di*2*Math.atan(Math.tan(is*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){Un.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Un.x,Un.y).multiplyScalar(-t/Un.z),Un.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Un.x,Un.y).multiplyScalar(-t/Un.z)}getViewSize(t,e){return this.getViewBounds(t,Il,Pl),e.subVectors(Pl,Il)}setViewOffset(t,e,n,s,r,a){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(is*.5*this.fov)/this.zoom,n=2*e,s=this.aspect*n,r=-.5*s,a=this.view;if(this.view!==null&&this.view.enabled){let c=a.fullWidth,l=a.fullHeight;r+=a.offsetX*s/c,e-=a.offsetY*n/l,s*=a.width/c,n*=a.height/l}let o=this.filmOffset;o!==0&&(r+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,e,e-n,t,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}},Ai=-90,Ri=1,dr=class extends ve{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let s=new Ee(Ai,Ri,t,e);s.layers=this.layers,this.add(s);let r=new Ee(Ai,Ri,t,e);r.layers=this.layers,this.add(r);let a=new Ee(Ai,Ri,t,e);a.layers=this.layers,this.add(a);let o=new Ee(Ai,Ri,t,e);o.layers=this.layers,this.add(o);let c=new Ee(Ai,Ri,t,e);c.layers=this.layers,this.add(c);let l=new Ee(Ai,Ri,t,e);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[n,s,r,a,o,c]=e;for(let l of e)this.remove(l);if(t===Qe)n.up.set(0,1,0),n.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else if(t===os)n.up.set(0,-1,0),n.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(let l of e)this.add(l),l.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:s}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());let[r,a,o,c,l,h]=this.children,d=t.getRenderTarget(),f=t.getActiveCubeFace(),p=t.getActiveMipmapLevel(),_=t.xr.enabled;t.xr.enabled=!1;let y=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,s),t.render(e,r),t.setRenderTarget(n,1,s),t.render(e,a),t.setRenderTarget(n,2,s),t.render(e,o),t.setRenderTarget(n,3,s),t.render(e,c),t.setRenderTarget(n,4,s),t.render(e,l),n.texture.generateMipmaps=y,t.setRenderTarget(n,5,s),t.render(e,h),t.setRenderTarget(d,f,p),t.xr.enabled=_,n.texture.needsPMREMUpdate=!0}},ms=class extends ze{constructor(t=[],e=li,n,s,r,a,o,c,l,h){super(t,e,n,s,r,a,o,c,l,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}},fr=class extends cn{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;let n={width:t,height:t,depth:1},s=[n,n,n,n,n,n];this.texture=new ms(s),this._setTextureOptions(e),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},s=new Bn(5,5,5),r=new nn({name:"CubemapFromEquirect",uniforms:hi(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:De,blending:Tn});r.uniforms.tEquirect.value=e;let a=new Pe(s,r),o=e.minFilter;return e.minFilter===Wn&&(e.minFilter=tn),new dr(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(t,e=!0,n=!0,s=!0){let r=t.getRenderTarget();for(let a=0;a<6;a++)t.setRenderTarget(this,a),t.clear(e,n,s);t.setRenderTarget(r)}},vn=class extends ve{constructor(){super(),this.isGroup=!0,this.type="Group"}},jh={type:"move"},Ni=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new vn,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new vn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new L,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new L),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new vn,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new L,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new L),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let e=this._hand;if(e)for(let n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let s=null,r=null,a=null,o=this._targetRay,c=this._grip,l=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(l&&t.hand){a=!0;for(let y of t.hand.values()){let m=e.getJointPose(y,n),u=this._getHandJoint(l,y);m!==null&&(u.matrix.fromArray(m.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,u.jointRadius=m.radius),u.visible=m!==null}let h=l.joints["index-finger-tip"],d=l.joints["thumb-tip"],f=h.position.distanceTo(d.position),p=.02,_=.005;l.inputState.pinching&&f>p+_?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&f<=p-_&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else c!==null&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1));o!==null&&(s=e.getPose(t.targetRaySpace,n),s===null&&r!==null&&(s=r),s!==null&&(o.matrix.fromArray(s.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,s.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(s.linearVelocity)):o.hasLinearVelocity=!1,s.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(s.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(jh)))}return o!==null&&(o.visible=s!==null),c!==null&&(c.visible=r!==null),l!==null&&(l.visible=a!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){let n=new vn;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}};var gs=class extends ve{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new en,this.environmentIntensity=1,this.environmentRotation=new en,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}};var to=new L,Qh=new L,tu=new Ut,qe=class{constructor(t=new L(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,s){return this.normal.set(t,e,n),this.constant=s,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){let s=to.subVectors(n,e).cross(Qh.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(s,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){let n=t.delta(to),s=this.normal.dot(n);if(s===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;let r=-(t.start.dot(this.normal)+this.constant)/s;return r<0||r>1?null:e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){let e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let n=e||tu.getNormalMatrix(t),s=this.coplanarPoint(to).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-s.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}},ti=new si,eu=new Pt(.5,.5),Qs=new L,Fi=class{constructor(t=new qe,e=new qe,n=new qe,s=new qe,r=new qe,a=new qe){this.planes=[t,e,n,s,r,a]}set(t,e,n,s,r,a){let o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(s),o[4].copy(r),o[5].copy(a),this}copy(t){let e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=Qe,n=!1){let s=this.planes,r=t.elements,a=r[0],o=r[1],c=r[2],l=r[3],h=r[4],d=r[5],f=r[6],p=r[7],_=r[8],y=r[9],m=r[10],u=r[11],T=r[12],E=r[13],S=r[14],R=r[15];if(s[0].setComponents(l-a,p-h,u-_,R-T).normalize(),s[1].setComponents(l+a,p+h,u+_,R+T).normalize(),s[2].setComponents(l+o,p+d,u+y,R+E).normalize(),s[3].setComponents(l-o,p-d,u-y,R-E).normalize(),n)s[4].setComponents(c,f,m,S).normalize(),s[5].setComponents(l-c,p-f,u-m,R-S).normalize();else if(s[4].setComponents(l-c,p-f,u-m,R-S).normalize(),e===Qe)s[5].setComponents(l+c,p+f,u+m,R+S).normalize();else if(e===os)s[5].setComponents(c,f,m,S).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),ti.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{let e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),ti.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(ti)}intersectsSprite(t){ti.center.set(0,0,0);let e=eu.distanceTo(t.center);return ti.radius=.7071067811865476+e,ti.applyMatrix4(t.matrixWorld),this.intersectsSphere(ti)}intersectsSphere(t){let e=this.planes,n=t.center,s=-t.radius;for(let r=0;r<6;r++)if(e[r].distanceToPoint(n)0?t.max.x:t.min.x,Qs.y=s.normal.y>0?t.max.y:t.min.y,Qs.z=s.normal.z>0?t.max.z:t.min.z,s.distanceToPoint(Qs)<0)return!1}return!0}containsPoint(t){let e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};var _s=class extends En{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ot(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}},pr=new L,mr=new L,Dl=new he,ns=new ri,tr=new si,eo=new L,Ll=new L,gr=class extends ve{constructor(t=new Ie,e=new _s){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){let t=this.geometry;if(t.index===null){let e=t.attributes.position,n=[0];for(let s=1,r=e.count;s0){let s=e[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;rn)return;eo.applyMatrix4(i.matrixWorld);let l=t.ray.origin.distanceTo(eo);if(!(lt.far))return{distance:l,point:Ll.clone().applyMatrix4(i.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:i}}var Ul=new L,Nl=new L,_r=class extends gr{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let t=this.geometry;if(t.index===null){let e=t.attributes.position,n=[];for(let s=0,r=e.count;s0){let M=(T-1)*y;for(let v=0;v0&&E(!0),e>0&&E(!1)),this.setIndex(h),this.setAttribute("position",new oe(d,3)),this.setAttribute("normal",new oe(f,3)),this.setAttribute("uv",new oe(p,2));function T(){let S=new L,R=new L,A=0,P=(e-t)/n;for(let N=0;N<=r;N++){let M=[],v=N/r,C=v*(e-t)+t;for(let F=0;F<=s;F++){let k=F/s,H=k*c+o,q=Math.sin(H),W=Math.cos(H);R.x=C*q,R.y=-v*n+m,R.z=C*W,d.push(R.x,R.y,R.z),S.set(q,P,W).normalize(),f.push(S.x,S.y,S.z),p.push(k,1-v),M.push(_++)}y.push(M)}for(let N=0;N0||M!==0)&&(h.push(v,C,k),A+=3),(e>0||M!==r-1)&&(h.push(C,F,k),A+=3)}l.addGroup(u,A,0),u+=A}function E(S){let R=_,A=new Pt,P=new L,N=0,M=S===!0?t:e,v=S===!0?1:-1;for(let F=1;F<=s;F++)d.push(0,m*v,0),f.push(0,v,0),p.push(.5,.5),_++;let C=_;for(let F=0;F<=s;F++){let H=F/s*c+o,q=Math.cos(H),W=Math.sin(H);P.x=M*W,P.y=m*v,P.z=M*q,d.push(P.x,P.y,P.z),f.push(0,v,0),A.x=q*.5+.5,A.y=W*.5*v+.5,p.push(A.x,A.y),_++}for(let F=0;F0)&&p.push(E,S,A),(u!==n-1||c=r)){let o=e[1];t=r)break t}a=n,n=0;break e}break n}for(;n>>1;te;)--a;if(++a,r!==0||a!==s){r>=a&&(a=Math.max(a,1),r=a-1);let o=this.getValueSize();this.times=n.slice(r,a),this.values=this.values.slice(r*o,a*o)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let n=this.times,s=this.values,r=n.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let a=null;for(let o=0;o!==r;o++){let c=n[o];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,c),t=!1;break}if(a!==null&&a>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,c,a),t=!1;break}a=c}if(s!==void 0&&nu(s))for(let o=0,c=s.length;o!==c;++o){let l=s[o];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,l),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),n=this.getValueSize(),s=this.getInterpolation()===ir,r=t.length-1,a=1;for(let o=1;o0){t[a]=t[r];for(let o=r*n,c=a*n,l=0;l!==n;++l)e[c+l]=e[o+l];++a}return a!==t.length?(this.times=t.slice(0,a),this.values=e.slice(0,a*n)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),n=this.constructor,s=new n(this.name,t,e);return s.createInterpolant=this.createInterpolant,s}};ke.prototype.ValueTypeName="";ke.prototype.TimeBufferType=Float32Array;ke.prototype.ValueBufferType=Float32Array;ke.prototype.DefaultInterpolation=lr;var zn=class extends ke{constructor(t,e,n){super(t,e,n)}};zn.prototype.ValueTypeName="bool";zn.prototype.ValueBufferType=Array;zn.prototype.DefaultInterpolation=rs;zn.prototype.InterpolantFactoryMethodLinear=void 0;zn.prototype.InterpolantFactoryMethodSmooth=void 0;var br=class extends ke{constructor(t,e,n,s){super(t,e,n,s)}};br.prototype.ValueTypeName="color";var Er=class extends ke{constructor(t,e,n,s){super(t,e,n,s)}};Er.prototype.ValueTypeName="number";var Tr=class extends oi{constructor(t,e,n,s){super(t,e,n,s)}interpolate_(t,e,n,s){let r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=(n-e)/(s-e),l=t*o;for(let h=l+o;l!==h;l+=4)Ze.slerpFlat(r,0,a,l-o,a,l,c);return r}},Ss=class extends ke{constructor(t,e,n,s){super(t,e,n,s)}InterpolantFactoryMethodLinear(t){return new Tr(this.times,this.values,this.getValueSize(),t)}};Ss.prototype.ValueTypeName="quaternion";Ss.prototype.InterpolantFactoryMethodSmooth=void 0;var kn=class extends ke{constructor(t,e,n){super(t,e,n)}};kn.prototype.ValueTypeName="string";kn.prototype.ValueBufferType=Array;kn.prototype.DefaultInterpolation=rs;kn.prototype.InterpolantFactoryMethodLinear=void 0;kn.prototype.InterpolantFactoryMethodSmooth=void 0;var wr=class extends ke{constructor(t,e,n,s){super(t,e,n,s)}};wr.prototype.ValueTypeName="vector";var Ar=class{constructor(t,e,n){let s=this,r=!1,a=0,o=0,c,l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.abortController=new AbortController,this.itemStart=function(h){o++,r===!1&&s.onStart!==void 0&&s.onStart(h,a,o),r=!0},this.itemEnd=function(h){a++,s.onProgress!==void 0&&s.onProgress(h,a,o),a===o&&(r=!1,s.onLoad!==void 0&&s.onLoad())},this.itemError=function(h){s.onError!==void 0&&s.onError(h)},this.resolveURL=function(h){return c?c(h):h},this.setURLModifier=function(h){return c=h,this},this.addHandler=function(h,d){return l.push(h,d),this},this.removeHandler=function(h){let d=l.indexOf(h);return d!==-1&&l.splice(d,2),this},this.getHandler=function(h){for(let d=0,f=l.length;dp.start-_.start);let f=0;for(let p=1;p 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,Iu=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,Pu=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,Du=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,Lu=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,Uu=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,Nu=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec3 vColor; +#endif`,Fu=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif +#ifdef USE_BATCHING_COLOR + vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); + vColor.xyz *= batchingColor.xyz; +#endif`,Ou=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,Bu=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,zu=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,ku=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,Vu=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,Hu=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE + emissiveColor = sRGBTransferEOTF( emissiveColor ); + #endif + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,Gu=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,Wu="gl_FragColor = linearToOutputTexel( gl_FragColor );",Xu=`vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferEOTF( in vec4 value ) { + return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +}`,qu=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,Yu=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,Zu=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,Ju=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,$u=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,Ku=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,ju=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,Qu=`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,td=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,ed=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,nd=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,id=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,sd=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,rd=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,ad=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,od=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,ld=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,cd=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,hd=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,ud=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,dd=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,fd=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,pd=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,md=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,gd=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,_d=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,xd=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER + varying float vFragDepth; + varying float vIsPerspective; +#endif`,yd=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,vd=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,Md=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,Sd=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,bd=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,Ed=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,Td=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,wd=`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,Ad=`#if defined( USE_MORPHCOLORS ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,Rd=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,Cd=`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } +#endif`,Id=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,Pd=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,Dd=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,Ld=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Ud=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Nd=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,Fd=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,Od=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,Bd=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,zd=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,kd=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,Vd=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Hd=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; +const float Inv255 = 1. / 255.; +const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); +const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); +const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); +const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); +vec4 packDepthToRGBA( const in float v ) { + if( v <= 0.0 ) + return vec4( 0., 0., 0., 0. ); + if( v >= 1.0 ) + return vec4( 1., 1., 1., 1. ); + float vuf; + float af = modf( v * PackFactors.a, vuf ); + float bf = modf( vuf * ShiftRight8, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); +} +vec3 packDepthToRGB( const in float v ) { + if( v <= 0.0 ) + return vec3( 0., 0., 0. ); + if( v >= 1.0 ) + return vec3( 1., 1., 1. ); + float vuf; + float bf = modf( v * PackFactors.b, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec3( vuf * Inv255, gf * PackUpscale, bf ); +} +vec2 packDepthToRG( const in float v ) { + if( v <= 0.0 ) + return vec2( 0., 0. ); + if( v >= 1.0 ) + return vec2( 1., 1. ); + float vuf; + float gf = modf( v * 256., vuf ); + return vec2( vuf * Inv255, gf ); +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors4 ); +} +float unpackRGBToDepth( const in vec3 v ) { + return dot( v, UnpackFactors3 ); +} +float unpackRGToDepth( const in vec2 v ) { + return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; +} +vec4 pack2HalfToRGBA( const in vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( const in vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,Gd=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,Wd=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,Xd=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,qd=`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,Yd=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,Zd=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,Jd=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + float depth = unpackRGBAToDepth( texture2D( depths, uv ) ); + #ifdef USE_REVERSED_DEPTH_BUFFER + return step( depth, compare ); + #else + return step( compare, depth ); + #endif + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow( sampler2D shadow, vec2 uv, float compare ) { + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + #ifdef USE_REVERSED_DEPTH_BUFFER + float hard_shadow = step( distribution.x, compare ); + #else + float hard_shadow = step( compare, distribution.x ); + #endif + if ( hard_shadow != 1.0 ) { + float distance = compare - distribution.x; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + + float lightToPositionLength = length( lightToPosition ); + if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { + float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + shadow = ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } +#endif`,$d=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,Kd=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,jd=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,Qd=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,tf=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,ef=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,nf=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,sf=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,rf=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,af=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,of=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 CineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,lf=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,cf=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + #else + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,hf=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,uf=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,df=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,ff=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`,pf=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,mf=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,gf=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,_f=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,xf=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,yf=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,vf=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,Mf=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + #ifdef USE_REVERSED_DEPTH_BUFFER + float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ]; + #else + float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5; + #endif + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #elif DEPTH_PACKING == 3202 + gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); + #elif DEPTH_PACKING == 3203 + gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); + #endif +}`,Sf=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,bf=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,Ef=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,Tf=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,wf=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,Af=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,Rf=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,Cf=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,If=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,Pf=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,Df=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,Lf=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,Uf=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,Nf=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,Ff=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,Of=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,Bf=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,zf=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,kf=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,Vf=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,Hf=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,Gf=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,Wf=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,Xf=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,qf=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix[ 3 ]; + vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,Yf=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,Bt={alphahash_fragment:pu,alphahash_pars_fragment:mu,alphamap_fragment:gu,alphamap_pars_fragment:_u,alphatest_fragment:xu,alphatest_pars_fragment:yu,aomap_fragment:vu,aomap_pars_fragment:Mu,batching_pars_vertex:Su,batching_vertex:bu,begin_vertex:Eu,beginnormal_vertex:Tu,bsdfs:wu,iridescence_fragment:Au,bumpmap_pars_fragment:Ru,clipping_planes_fragment:Cu,clipping_planes_pars_fragment:Iu,clipping_planes_pars_vertex:Pu,clipping_planes_vertex:Du,color_fragment:Lu,color_pars_fragment:Uu,color_pars_vertex:Nu,color_vertex:Fu,common:Ou,cube_uv_reflection_fragment:Bu,defaultnormal_vertex:zu,displacementmap_pars_vertex:ku,displacementmap_vertex:Vu,emissivemap_fragment:Hu,emissivemap_pars_fragment:Gu,colorspace_fragment:Wu,colorspace_pars_fragment:Xu,envmap_fragment:qu,envmap_common_pars_fragment:Yu,envmap_pars_fragment:Zu,envmap_pars_vertex:Ju,envmap_physical_pars_fragment:ad,envmap_vertex:$u,fog_vertex:Ku,fog_pars_vertex:ju,fog_fragment:Qu,fog_pars_fragment:td,gradientmap_pars_fragment:ed,lightmap_pars_fragment:nd,lights_lambert_fragment:id,lights_lambert_pars_fragment:sd,lights_pars_begin:rd,lights_toon_fragment:od,lights_toon_pars_fragment:ld,lights_phong_fragment:cd,lights_phong_pars_fragment:hd,lights_physical_fragment:ud,lights_physical_pars_fragment:dd,lights_fragment_begin:fd,lights_fragment_maps:pd,lights_fragment_end:md,logdepthbuf_fragment:gd,logdepthbuf_pars_fragment:_d,logdepthbuf_pars_vertex:xd,logdepthbuf_vertex:yd,map_fragment:vd,map_pars_fragment:Md,map_particle_fragment:Sd,map_particle_pars_fragment:bd,metalnessmap_fragment:Ed,metalnessmap_pars_fragment:Td,morphinstance_vertex:wd,morphcolor_vertex:Ad,morphnormal_vertex:Rd,morphtarget_pars_vertex:Cd,morphtarget_vertex:Id,normal_fragment_begin:Pd,normal_fragment_maps:Dd,normal_pars_fragment:Ld,normal_pars_vertex:Ud,normal_vertex:Nd,normalmap_pars_fragment:Fd,clearcoat_normal_fragment_begin:Od,clearcoat_normal_fragment_maps:Bd,clearcoat_pars_fragment:zd,iridescence_pars_fragment:kd,opaque_fragment:Vd,packing:Hd,premultiplied_alpha_fragment:Gd,project_vertex:Wd,dithering_fragment:Xd,dithering_pars_fragment:qd,roughnessmap_fragment:Yd,roughnessmap_pars_fragment:Zd,shadowmap_pars_fragment:Jd,shadowmap_pars_vertex:$d,shadowmap_vertex:Kd,shadowmask_pars_fragment:jd,skinbase_vertex:Qd,skinning_pars_vertex:tf,skinning_vertex:ef,skinnormal_vertex:nf,specularmap_fragment:sf,specularmap_pars_fragment:rf,tonemapping_fragment:af,tonemapping_pars_fragment:of,transmission_fragment:lf,transmission_pars_fragment:cf,uv_pars_fragment:hf,uv_pars_vertex:uf,uv_vertex:df,worldpos_vertex:ff,background_vert:pf,background_frag:mf,backgroundCube_vert:gf,backgroundCube_frag:_f,cube_vert:xf,cube_frag:yf,depth_vert:vf,depth_frag:Mf,distanceRGBA_vert:Sf,distanceRGBA_frag:bf,equirect_vert:Ef,equirect_frag:Tf,linedashed_vert:wf,linedashed_frag:Af,meshbasic_vert:Rf,meshbasic_frag:Cf,meshlambert_vert:If,meshlambert_frag:Pf,meshmatcap_vert:Df,meshmatcap_frag:Lf,meshnormal_vert:Uf,meshnormal_frag:Nf,meshphong_vert:Ff,meshphong_frag:Of,meshphysical_vert:Bf,meshphysical_frag:zf,meshtoon_vert:kf,meshtoon_frag:Vf,points_vert:Hf,points_frag:Gf,shadow_vert:Wf,shadow_frag:Xf,sprite_vert:qf,sprite_frag:Yf},st={common:{diffuse:{value:new Ot(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ut},alphaMap:{value:null},alphaMapTransform:{value:new Ut},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ut}},envmap:{envMap:{value:null},envMapRotation:{value:new Ut},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ut}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ut}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ut},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ut},normalScale:{value:new Pt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ut},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ut}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ut}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ut}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ot(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ot(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ut},alphaTest:{value:0},uvTransform:{value:new Ut}},sprite:{diffuse:{value:new Ot(16777215)},opacity:{value:1},center:{value:new Pt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ut},alphaMap:{value:null},alphaMapTransform:{value:new Ut},alphaTest:{value:0}}},fn={basic:{uniforms:we([st.common,st.specularmap,st.envmap,st.aomap,st.lightmap,st.fog]),vertexShader:Bt.meshbasic_vert,fragmentShader:Bt.meshbasic_frag},lambert:{uniforms:we([st.common,st.specularmap,st.envmap,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.fog,st.lights,{emissive:{value:new Ot(0)}}]),vertexShader:Bt.meshlambert_vert,fragmentShader:Bt.meshlambert_frag},phong:{uniforms:we([st.common,st.specularmap,st.envmap,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.fog,st.lights,{emissive:{value:new Ot(0)},specular:{value:new Ot(1118481)},shininess:{value:30}}]),vertexShader:Bt.meshphong_vert,fragmentShader:Bt.meshphong_frag},standard:{uniforms:we([st.common,st.envmap,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.roughnessmap,st.metalnessmap,st.fog,st.lights,{emissive:{value:new Ot(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Bt.meshphysical_vert,fragmentShader:Bt.meshphysical_frag},toon:{uniforms:we([st.common,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.gradientmap,st.fog,st.lights,{emissive:{value:new Ot(0)}}]),vertexShader:Bt.meshtoon_vert,fragmentShader:Bt.meshtoon_frag},matcap:{uniforms:we([st.common,st.bumpmap,st.normalmap,st.displacementmap,st.fog,{matcap:{value:null}}]),vertexShader:Bt.meshmatcap_vert,fragmentShader:Bt.meshmatcap_frag},points:{uniforms:we([st.points,st.fog]),vertexShader:Bt.points_vert,fragmentShader:Bt.points_frag},dashed:{uniforms:we([st.common,st.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Bt.linedashed_vert,fragmentShader:Bt.linedashed_frag},depth:{uniforms:we([st.common,st.displacementmap]),vertexShader:Bt.depth_vert,fragmentShader:Bt.depth_frag},normal:{uniforms:we([st.common,st.bumpmap,st.normalmap,st.displacementmap,{opacity:{value:1}}]),vertexShader:Bt.meshnormal_vert,fragmentShader:Bt.meshnormal_frag},sprite:{uniforms:we([st.sprite,st.fog]),vertexShader:Bt.sprite_vert,fragmentShader:Bt.sprite_frag},background:{uniforms:{uvTransform:{value:new Ut},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Bt.background_vert,fragmentShader:Bt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Ut}},vertexShader:Bt.backgroundCube_vert,fragmentShader:Bt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Bt.cube_vert,fragmentShader:Bt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Bt.equirect_vert,fragmentShader:Bt.equirect_frag},distanceRGBA:{uniforms:we([st.common,st.displacementmap,{referencePosition:{value:new L},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Bt.distanceRGBA_vert,fragmentShader:Bt.distanceRGBA_frag},shadow:{uniforms:we([st.lights,st.fog,{color:{value:new Ot(0)},opacity:{value:1}}]),vertexShader:Bt.shadow_vert,fragmentShader:Bt.shadow_frag}};fn.physical={uniforms:we([fn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ut},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ut},clearcoatNormalScale:{value:new Pt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ut},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ut},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ut},sheen:{value:0},sheenColor:{value:new Ot(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ut},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ut},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ut},transmissionSamplerSize:{value:new Pt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ut},attenuationDistance:{value:0},attenuationColor:{value:new Ot(0)},specularColor:{value:new Ot(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ut},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ut},anisotropyVector:{value:new Pt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ut}}]),vertexShader:Bt.meshphysical_vert,fragmentShader:Bt.meshphysical_frag};var Ma={r:0,b:0,g:0},ui=new en,Zf=new he;function Jf(i,t,e,n,s,r,a){let o=new Ot(0),c=r===!0?0:1,l,h,d=null,f=0,p=null;function _(E){let S=E.isScene===!0?E.background:null;return S&&S.isTexture&&(S=(E.backgroundBlurriness>0?e:t).get(S)),S}function y(E){let S=!1,R=_(E);R===null?u(o,c):R&&R.isColor&&(u(R,1),S=!0);let A=i.xr.getEnvironmentBlendMode();A==="additive"?n.buffers.color.setClear(0,0,0,1,a):A==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(i.autoClear||S)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil))}function m(E,S){let R=_(S);R&&(R.isCubeTexture||R.mapping===Rs)?(h===void 0&&(h=new Pe(new Bn(1,1,1),new nn({name:"BackgroundCubeMaterial",uniforms:hi(fn.backgroundCube.uniforms),vertexShader:fn.backgroundCube.vertexShader,fragmentShader:fn.backgroundCube.fragmentShader,side:De,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(A,P,N){this.matrixWorld.copyPosition(N.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(h)),ui.copy(S.backgroundRotation),ui.x*=-1,ui.y*=-1,ui.z*=-1,R.isCubeTexture&&R.isRenderTargetTexture===!1&&(ui.y*=-1,ui.z*=-1),h.material.uniforms.envMap.value=R,h.material.uniforms.flipEnvMap.value=R.isCubeTexture&&R.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=S.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(Zf.makeRotationFromEuler(ui)),h.material.toneMapped=Gt.getTransfer(R.colorSpace)!==Yt,(d!==R||f!==R.version||p!==i.toneMapping)&&(h.material.needsUpdate=!0,d=R,f=R.version,p=i.toneMapping),h.layers.enableAll(),E.unshift(h,h.geometry,h.material,0,0,null)):R&&R.isTexture&&(l===void 0&&(l=new Pe(new ai(2,2),new nn({name:"BackgroundMaterial",uniforms:hi(fn.background.uniforms),vertexShader:fn.background.vertexShader,fragmentShader:fn.background.fragmentShader,side:Sn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(l)),l.material.uniforms.t2D.value=R,l.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,l.material.toneMapped=Gt.getTransfer(R.colorSpace)!==Yt,R.matrixAutoUpdate===!0&&R.updateMatrix(),l.material.uniforms.uvTransform.value.copy(R.matrix),(d!==R||f!==R.version||p!==i.toneMapping)&&(l.material.needsUpdate=!0,d=R,f=R.version,p=i.toneMapping),l.layers.enableAll(),E.unshift(l,l.geometry,l.material,0,0,null))}function u(E,S){E.getRGB(Ma,Lo(i)),n.buffers.color.setClear(Ma.r,Ma.g,Ma.b,S,a)}function T(){h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0),l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}return{getClearColor:function(){return o},setClearColor:function(E,S=1){o.set(E),c=S,u(o,c)},getClearAlpha:function(){return c},setClearAlpha:function(E){c=E,u(o,c)},render:y,addToRenderList:m,dispose:T}}function $f(i,t){let e=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},s=f(null),r=s,a=!1;function o(v,C,F,k,H){let q=!1,W=d(k,F,C);r!==W&&(r=W,l(r.object)),q=p(v,k,F,H),q&&_(v,k,F,H),H!==null&&t.update(H,i.ELEMENT_ARRAY_BUFFER),(q||a)&&(a=!1,S(v,C,F,k),H!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t.get(H).buffer))}function c(){return i.createVertexArray()}function l(v){return i.bindVertexArray(v)}function h(v){return i.deleteVertexArray(v)}function d(v,C,F){let k=F.wireframe===!0,H=n[v.id];H===void 0&&(H={},n[v.id]=H);let q=H[C.id];q===void 0&&(q={},H[C.id]=q);let W=q[k];return W===void 0&&(W=f(c()),q[k]=W),W}function f(v){let C=[],F=[],k=[];for(let H=0;H=0){let ct=H[V],St=q[V];if(St===void 0&&(V==="instanceMatrix"&&v.instanceMatrix&&(St=v.instanceMatrix),V==="instanceColor"&&v.instanceColor&&(St=v.instanceColor)),ct===void 0||ct.attribute!==St||St&&ct.data!==St.data)return!0;W++}return r.attributesNum!==W||r.index!==k}function _(v,C,F,k){let H={},q=C.attributes,W=0,et=F.getAttributes();for(let V in et)if(et[V].location>=0){let ct=q[V];ct===void 0&&(V==="instanceMatrix"&&v.instanceMatrix&&(ct=v.instanceMatrix),V==="instanceColor"&&v.instanceColor&&(ct=v.instanceColor));let St={};St.attribute=ct,ct&&ct.data&&(St.data=ct.data),H[V]=St,W++}r.attributes=H,r.attributesNum=W,r.index=k}function y(){let v=r.newAttributes;for(let C=0,F=v.length;C=0){let rt=H[et];if(rt===void 0&&(et==="instanceMatrix"&&v.instanceMatrix&&(rt=v.instanceMatrix),et==="instanceColor"&&v.instanceColor&&(rt=v.instanceColor)),rt!==void 0){let ct=rt.normalized,St=rt.itemSize,kt=t.get(rt);if(kt===void 0)continue;let jt=kt.buffer,ne=kt.type,Xt=kt.bytesPerElement,Y=ne===i.INT||ne===i.UNSIGNED_INT||rt.gpuType===Vr;if(rt.isInterleavedBufferAttribute){let $=rt.data,dt=$.stride,It=rt.offset;if($.isInstancedInterleavedBuffer){for(let Mt=0;Mt0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let l=e.precision!==void 0?e.precision:"highp",h=c(l);h!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",h,"instead."),l=h);let d=e.logarithmicDepthBuffer===!0,f=e.reversedDepthBuffer===!0&&t.has("EXT_clip_control"),p=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),_=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),y=i.getParameter(i.MAX_TEXTURE_SIZE),m=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),u=i.getParameter(i.MAX_VERTEX_ATTRIBS),T=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),E=i.getParameter(i.MAX_VARYING_VECTORS),S=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),R=_>0,A=i.getParameter(i.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:c,textureFormatReadable:a,textureTypeReadable:o,precision:l,logarithmicDepthBuffer:d,reversedDepthBuffer:f,maxTextures:p,maxVertexTextures:_,maxTextureSize:y,maxCubemapSize:m,maxAttributes:u,maxVertexUniforms:T,maxVaryings:E,maxFragmentUniforms:S,vertexTextures:R,maxSamples:A}}function Qf(i){let t=this,e=null,n=0,s=!1,r=!1,a=new qe,o=new Ut,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){let p=d.length!==0||f||n!==0||s;return s=f,n=d.length,p},this.beginShadows=function(){r=!0,h(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(d,f){e=h(d,f,0)},this.setState=function(d,f,p){let _=d.clippingPlanes,y=d.clipIntersection,m=d.clipShadows,u=i.get(d);if(!s||_===null||_.length===0||r&&!m)r?h(null):l();else{let T=r?0:n,E=T*4,S=u.clippingState||null;c.value=S,S=h(_,f,E,p);for(let R=0;R!==E;++R)S[R]=e[R];u.clippingState=S,this.numIntersection=y?this.numPlanes:0,this.numPlanes+=T}};function l(){c.value!==e&&(c.value=e,c.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(d,f,p,_){let y=d!==null?d.length:0,m=null;if(y!==0){if(m=c.value,_!==!0||m===null){let u=p+y*4,T=f.matrixWorldInverse;o.getNormalMatrix(T),(m===null||m.length0){let l=new fr(c.height);return l.fromEquirectangularTexture(i,a),t.set(a,l),a.addEventListener("dispose",s),e(l.texture,a.mapping)}else return null}}return a}function s(a){let o=a.target;o.removeEventListener("dispose",s);let c=t.get(o);c!==void 0&&(t.delete(o),c.dispose())}function r(){t=new WeakMap}return{get:n,dispose:r}}var qi=4,Cc=[.125,.215,.35,.446,.526,.582],pi=20,Oo=new Ts,Ic=new Ot,Bo=null,zo=0,ko=0,Vo=!1,fi=(1+Math.sqrt(5))/2,Xi=1/fi,Pc=[new L(-fi,Xi,0),new L(fi,Xi,0),new L(-Xi,0,fi),new L(Xi,0,fi),new L(0,fi,-Xi),new L(0,fi,Xi),new L(-1,1,-1),new L(1,1,-1),new L(-1,1,1),new L(1,1,1)],ep=new L,Ea=class{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,s=100,r={}){let{size:a=256,position:o=ep}=r;Bo=this._renderer.getRenderTarget(),zo=this._renderer.getActiveCubeFace(),ko=this._renderer.getActiveMipmapLevel(),Vo=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let c=this._allocateTargets();return c.depthBuffer=!0,this._sceneToCubeUV(t,n,s,c,o),e>0&&this._blur(c,0,0,e),this._applyPMREM(c),this._cleanup(c),c}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Uc(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Lc(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?R:0,R,R),d.setRenderTarget(s),u&&d.render(m,c),d.render(t,c)}m.geometry.dispose(),m.material.dispose(),d.toneMapping=p,d.autoClear=f,t.background=T}_textureToCubeUV(t,e){let n=this._renderer,s=t.mapping===li||t.mapping===ci;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=Uc()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Lc());let r=s?this._cubemapMaterial:this._equirectMaterial,a=new Pe(this._lodPlanes[0],r),o=r.uniforms;o.envMap.value=t;let c=this._cubeSize;Sa(e,0,0,3*c,2*c),n.setRenderTarget(e),n.render(a,Oo)}_applyPMREM(t){let e=this._renderer,n=e.autoClear;e.autoClear=!1;let s=this._lodPlanes.length;for(let r=1;rpi&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${pi}`);let u=[],T=0;for(let P=0;PE-qi?s-E+qi:0),A=4*(this._cubeSize-S);Sa(e,R,A,3*S,2*S),c.setRenderTarget(e),c.render(d,Oo)}};function np(i){let t=[],e=[],n=[],s=i,r=i-qi+1+Cc.length;for(let a=0;ai-qi?c=Cc[a-i+qi-1]:a===0&&(c=0),n.push(c);let l=1/(o-2),h=-l,d=1+l,f=[h,h,d,h,d,d,h,h,d,d,h,d],p=6,_=6,y=3,m=2,u=1,T=new Float32Array(y*_*p),E=new Float32Array(m*_*p),S=new Float32Array(u*_*p);for(let A=0;A2?0:-1,M=[P,N,0,P+2/3,N,0,P+2/3,N+1,0,P,N,0,P+2/3,N+1,0,P,N+1,0];T.set(M,y*_*A),E.set(f,m*_*A);let v=[A,A,A,A,A,A];S.set(v,u*_*A)}let R=new Ie;R.setAttribute("position",new Te(T,y)),R.setAttribute("uv",new Te(E,m)),R.setAttribute("faceIndex",new Te(S,u)),t.push(R),s>qi&&s--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function Dc(i,t,e){let n=new cn(i,t,e);return n.texture.mapping=Rs,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Sa(i,t,e,n,s){i.viewport.set(t,e,n,s),i.scissor.set(t,e,n,s)}function ip(i,t,e){let n=new Float32Array(pi),s=new L(0,1,0);return new nn({name:"SphericalGaussianBlur",defines:{n:pi,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:Ko(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:Tn,depthTest:!1,depthWrite:!1})}function Lc(){return new nn({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Ko(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:Tn,depthTest:!1,depthWrite:!1})}function Uc(){return new nn({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ko(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:Tn,depthTest:!1,depthWrite:!1})}function Ko(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function sp(i){let t=new WeakMap,e=null;function n(o){if(o&&o.isTexture){let c=o.mapping,l=c===Br||c===zr,h=c===li||c===ci;if(l||h){let d=t.get(o),f=d!==void 0?d.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==f)return e===null&&(e=new Ea(i)),d=l?e.fromEquirectangular(o,d):e.fromCubemap(o,d),d.texture.pmremVersion=o.pmremVersion,t.set(o,d),d.texture;if(d!==void 0)return d.texture;{let p=o.image;return l&&p&&p.height>0||h&&p&&s(p)?(e===null&&(e=new Ea(i)),d=l?e.fromEquirectangular(o):e.fromCubemap(o),d.texture.pmremVersion=o.pmremVersion,t.set(o,d),o.addEventListener("dispose",r),d.texture):null}}}return o}function s(o){let c=0,l=6;for(let h=0;ht.maxTextureSize&&(R=Math.ceil(S/t.maxTextureSize),S=t.maxTextureSize);let A=new Float32Array(S*R*4*d),P=new cs(A,S,R,d);P.type=dn,P.needsUpdate=!0;let N=E*4;for(let v=0;v0)return i;let s=t*e,r=Fc[s];if(r===void 0&&(r=new Float32Array(s),Fc[s]=r),t!==0){n.toArray(r,0);for(let a=1,o=0;a!==t;++a)o+=e,i[a].toArray(r,o)}return r}function fe(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e":" "} ${o}: ${e[a]}`)}return n.join(` +`)}var Gc=new Ut;function em(i){Gt._getMatrix(Gc,Gt.workingColorSpace,i);let t=`mat3( ${Gc.elements.map(e=>e.toFixed(4))} )`;switch(Gt.getTransfer(i)){case as:return[t,"LinearTransferOETF"];case Yt:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",i),[t,"LinearTransferOETF"]}}function Wc(i,t,e){let n=i.getShaderParameter(t,i.COMPILE_STATUS),r=(i.getShaderInfoLog(t)||"").trim();if(n&&r==="")return"";let a=/ERROR: 0:(\d+)/.exec(r);if(a){let o=parseInt(a[1]);return e.toUpperCase()+` + +`+r+` + +`+tm(i.getShaderSource(t),o)}else return r}function nm(i,t){let e=em(t);return[`vec4 ${i}( vec4 value ) {`,` return ${e[1]}( vec4( value.rgb * ${e[0]}, value.a ) );`,"}"].join(` +`)}function im(i,t){let e;switch(t){case oc:e="Linear";break;case lc:e="Reinhard";break;case cc:e="Cineon";break;case Or:e="ACESFilmic";break;case uc:e="AgX";break;case dc:e="Neutral";break;case hc:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+i+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}var ba=new L;function sm(){Gt.getLuminanceCoefficients(ba);let i=ba.x.toFixed(4),t=ba.y.toFixed(4),e=ba.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${i}, ${t}, ${e} );`," return dot( weights, rgb );","}"].join(` +`)}function rm(i){return[i.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",i.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Us).join(` +`)}function am(i){let t=[];for(let e in i){let n=i[e];n!==!1&&t.push("#define "+e+" "+n)}return t.join(` +`)}function om(i,t){let e={},n=i.getProgramParameter(t,i.ACTIVE_ATTRIBUTES);for(let s=0;s/gm;function qo(i){return i.replace(lm,hm)}var cm=new Map;function hm(i,t){let e=Bt[t];if(e===void 0){let n=cm.get(t);if(n!==void 0)e=Bt[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,n);else throw new Error("Can not resolve #include <"+t+">")}return qo(e)}var um=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Yc(i){return i.replace(um,dm)}function dm(i,t,e,n){let s="";for(let r=parseInt(t);r0&&(m+=` +`),u=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_].filter(Us).join(` +`),u.length>0&&(u+=` +`)):(m=[Zc(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.batchingColor?"#define USE_BATCHING_COLOR":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+h:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+c:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",e.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(Us).join(` +`),u=[Zc(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+l:"",e.envMap?"#define "+h:"",e.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor||e.batchingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+c:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",e.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",e.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==wn?"#define TONE_MAPPING":"",e.toneMapping!==wn?Bt.tonemapping_pars_fragment:"",e.toneMapping!==wn?im("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",Bt.colorspace_pars_fragment,nm("linearToOutputTexel",e.outputColorSpace),sm(),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",` +`].filter(Us).join(` +`)),a=qo(a),a=Xc(a,e),a=qc(a,e),o=qo(o),o=Xc(o,e),o=qc(o,e),a=Yc(a),o=Yc(o),e.isRawShaderMaterial!==!0&&(T=`#version 300 es +`,m=[p,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+m,u=["#define varying in",e.glslVersion===Co?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===Co?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`)+` +`+u);let E=T+m+a,S=T+u+o,R=Hc(s,s.VERTEX_SHADER,E),A=Hc(s,s.FRAGMENT_SHADER,S);s.attachShader(y,R),s.attachShader(y,A),e.index0AttributeName!==void 0?s.bindAttribLocation(y,0,e.index0AttributeName):e.morphTargets===!0&&s.bindAttribLocation(y,0,"position"),s.linkProgram(y);function P(C){if(i.debug.checkShaderErrors){let F=s.getProgramInfoLog(y)||"",k=s.getShaderInfoLog(R)||"",H=s.getShaderInfoLog(A)||"",q=F.trim(),W=k.trim(),et=H.trim(),V=!0,rt=!0;if(s.getProgramParameter(y,s.LINK_STATUS)===!1)if(V=!1,typeof i.debug.onShaderError=="function")i.debug.onShaderError(s,y,R,A);else{let ct=Wc(s,R,"vertex"),St=Wc(s,A,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(y,s.VALIDATE_STATUS)+` + +Material Name: `+C.name+` +Material Type: `+C.type+` + +Program Info Log: `+q+` +`+ct+` +`+St)}else q!==""?console.warn("THREE.WebGLProgram: Program Info Log:",q):(W===""||et==="")&&(rt=!1);rt&&(C.diagnostics={runnable:V,programLog:q,vertexShader:{log:W,prefix:m},fragmentShader:{log:et,prefix:u}})}s.deleteShader(R),s.deleteShader(A),N=new Yi(s,y),M=om(s,y)}let N;this.getUniforms=function(){return N===void 0&&P(this),N};let M;this.getAttributes=function(){return M===void 0&&P(this),M};let v=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return v===!1&&(v=s.getProgramParameter(y,jp)),v},this.destroy=function(){n.releaseStatesOfProgram(this),s.deleteProgram(y),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=Qp++,this.cacheKey=t,this.usedTimes=1,this.program=y,this.vertexShader=R,this.fragmentShader=A,this}var ym=0,Yo=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){let e=t.vertexShader,n=t.fragmentShader,s=this._getShaderStage(e),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(t);return a.has(s)===!1&&(a.add(s),s.usedTimes++),a.has(r)===!1&&(a.add(r),r.usedTimes++),this}remove(t){let e=this.materialCache.get(t);for(let n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){let e=this.materialCache,n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){let e=this.shaderCache,n=e.get(t);return n===void 0&&(n=new Zo(t),e.set(t,n)),n}},Zo=class{constructor(t){this.id=ym++,this.code=t,this.usedTimes=0}};function vm(i,t,e,n,s,r,a){let o=new hs,c=new Yo,l=new Set,h=[],d=s.logarithmicDepthBuffer,f=s.vertexTextures,p=s.precision,_={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function y(M){return l.add(M),M===0?"uv":`uv${M}`}function m(M,v,C,F,k){let H=F.fog,q=k.geometry,W=M.isMeshStandardMaterial?F.environment:null,et=(M.isMeshStandardMaterial?e:t).get(M.envMap||W),V=et&&et.mapping===Rs?et.image.height:null,rt=_[M.type];M.precision!==null&&(p=s.getMaxPrecision(M.precision),p!==M.precision&&console.warn("THREE.WebGLProgram.getParameters:",M.precision,"not supported, using",p,"instead."));let ct=q.morphAttributes.position||q.morphAttributes.normal||q.morphAttributes.color,St=ct!==void 0?ct.length:0,kt=0;q.morphAttributes.position!==void 0&&(kt=1),q.morphAttributes.normal!==void 0&&(kt=2),q.morphAttributes.color!==void 0&&(kt=3);let jt,ne,Xt,Y;if(rt){let qt=fn[rt];jt=qt.vertexShader,ne=qt.fragmentShader}else jt=M.vertexShader,ne=M.fragmentShader,c.update(M),Xt=c.getVertexShaderID(M),Y=c.getFragmentShaderID(M);let $=i.getRenderTarget(),dt=i.state.buffers.depth.getReversed(),It=k.isInstancedMesh===!0,Mt=k.isBatchedMesh===!0,Ht=!!M.map,Me=!!M.matcap,w=!!et,ie=!!M.aoMap,Lt=!!M.lightMap,Rt=!!M.bumpMap,mt=!!M.normalMap,se=!!M.displacementMap,gt=!!M.emissiveMap,Ft=!!M.metalnessMap,_e=!!M.roughnessMap,ue=M.anisotropy>0,b=M.clearcoat>0,g=M.dispersion>0,O=M.iridescence>0,X=M.sheen>0,J=M.transmission>0,G=ue&&!!M.anisotropyMap,vt=b&&!!M.clearcoatMap,nt=b&&!!M.clearcoatNormalMap,_t=b&&!!M.clearcoatRoughnessMap,xt=O&&!!M.iridescenceMap,Q=O&&!!M.iridescenceThicknessMap,lt=X&&!!M.sheenColorMap,At=X&&!!M.sheenRoughnessMap,yt=!!M.specularMap,at=!!M.specularColorMap,Nt=!!M.specularIntensityMap,I=J&&!!M.transmissionMap,tt=J&&!!M.thicknessMap,it=!!M.gradientMap,ut=!!M.alphaMap,K=M.alphaTest>0,Z=!!M.alphaHash,pt=!!M.extensions,Dt=wn;M.toneMapped&&($===null||$.isXRRenderTarget===!0)&&(Dt=i.toneMapping);let Qt={shaderID:rt,shaderType:M.type,shaderName:M.name,vertexShader:jt,fragmentShader:ne,defines:M.defines,customVertexShaderID:Xt,customFragmentShaderID:Y,isRawShaderMaterial:M.isRawShaderMaterial===!0,glslVersion:M.glslVersion,precision:p,batching:Mt,batchingColor:Mt&&k._colorsTexture!==null,instancing:It,instancingColor:It&&k.instanceColor!==null,instancingMorph:It&&k.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:$===null?i.outputColorSpace:$.isXRRenderTarget===!0?$.texture.colorSpace:bn,alphaToCoverage:!!M.alphaToCoverage,map:Ht,matcap:Me,envMap:w,envMapMode:w&&et.mapping,envMapCubeUVHeight:V,aoMap:ie,lightMap:Lt,bumpMap:Rt,normalMap:mt,displacementMap:f&&se,emissiveMap:gt,normalMapObjectSpace:mt&&M.normalMapType===gc,normalMapTangentSpace:mt&&M.normalMapType===Ao,metalnessMap:Ft,roughnessMap:_e,anisotropy:ue,anisotropyMap:G,clearcoat:b,clearcoatMap:vt,clearcoatNormalMap:nt,clearcoatRoughnessMap:_t,dispersion:g,iridescence:O,iridescenceMap:xt,iridescenceThicknessMap:Q,sheen:X,sheenColorMap:lt,sheenRoughnessMap:At,specularMap:yt,specularColorMap:at,specularIntensityMap:Nt,transmission:J,transmissionMap:I,thicknessMap:tt,gradientMap:it,opaque:M.transparent===!1&&M.blending===ni&&M.alphaToCoverage===!1,alphaMap:ut,alphaTest:K,alphaHash:Z,combine:M.combine,mapUv:Ht&&y(M.map.channel),aoMapUv:ie&&y(M.aoMap.channel),lightMapUv:Lt&&y(M.lightMap.channel),bumpMapUv:Rt&&y(M.bumpMap.channel),normalMapUv:mt&&y(M.normalMap.channel),displacementMapUv:se&&y(M.displacementMap.channel),emissiveMapUv:gt&&y(M.emissiveMap.channel),metalnessMapUv:Ft&&y(M.metalnessMap.channel),roughnessMapUv:_e&&y(M.roughnessMap.channel),anisotropyMapUv:G&&y(M.anisotropyMap.channel),clearcoatMapUv:vt&&y(M.clearcoatMap.channel),clearcoatNormalMapUv:nt&&y(M.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:_t&&y(M.clearcoatRoughnessMap.channel),iridescenceMapUv:xt&&y(M.iridescenceMap.channel),iridescenceThicknessMapUv:Q&&y(M.iridescenceThicknessMap.channel),sheenColorMapUv:lt&&y(M.sheenColorMap.channel),sheenRoughnessMapUv:At&&y(M.sheenRoughnessMap.channel),specularMapUv:yt&&y(M.specularMap.channel),specularColorMapUv:at&&y(M.specularColorMap.channel),specularIntensityMapUv:Nt&&y(M.specularIntensityMap.channel),transmissionMapUv:I&&y(M.transmissionMap.channel),thicknessMapUv:tt&&y(M.thicknessMap.channel),alphaMapUv:ut&&y(M.alphaMap.channel),vertexTangents:!!q.attributes.tangent&&(mt||ue),vertexColors:M.vertexColors,vertexAlphas:M.vertexColors===!0&&!!q.attributes.color&&q.attributes.color.itemSize===4,pointsUvs:k.isPoints===!0&&!!q.attributes.uv&&(Ht||ut),fog:!!H,useFog:M.fog===!0,fogExp2:!!H&&H.isFogExp2,flatShading:M.flatShading===!0&&M.wireframe===!1,sizeAttenuation:M.sizeAttenuation===!0,logarithmicDepthBuffer:d,reversedDepthBuffer:dt,skinning:k.isSkinnedMesh===!0,morphTargets:q.morphAttributes.position!==void 0,morphNormals:q.morphAttributes.normal!==void 0,morphColors:q.morphAttributes.color!==void 0,morphTargetsCount:St,morphTextureStride:kt,numDirLights:v.directional.length,numPointLights:v.point.length,numSpotLights:v.spot.length,numSpotLightMaps:v.spotLightMap.length,numRectAreaLights:v.rectArea.length,numHemiLights:v.hemi.length,numDirLightShadows:v.directionalShadowMap.length,numPointLightShadows:v.pointShadowMap.length,numSpotLightShadows:v.spotShadowMap.length,numSpotLightShadowsWithMaps:v.numSpotLightShadowsWithMaps,numLightProbes:v.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:M.dithering,shadowMapEnabled:i.shadowMap.enabled&&C.length>0,shadowMapType:i.shadowMap.type,toneMapping:Dt,decodeVideoTexture:Ht&&M.map.isVideoTexture===!0&&Gt.getTransfer(M.map.colorSpace)===Yt,decodeVideoTextureEmissive:gt&&M.emissiveMap.isVideoTexture===!0&&Gt.getTransfer(M.emissiveMap.colorSpace)===Yt,premultipliedAlpha:M.premultipliedAlpha,doubleSided:M.side===Ve,flipSided:M.side===De,useDepthPacking:M.depthPacking>=0,depthPacking:M.depthPacking||0,index0AttributeName:M.index0AttributeName,extensionClipCullDistance:pt&&M.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(pt&&M.extensions.multiDraw===!0||Mt)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:M.customProgramCacheKey()};return Qt.vertexUv1s=l.has(1),Qt.vertexUv2s=l.has(2),Qt.vertexUv3s=l.has(3),l.clear(),Qt}function u(M){let v=[];if(M.shaderID?v.push(M.shaderID):(v.push(M.customVertexShaderID),v.push(M.customFragmentShaderID)),M.defines!==void 0)for(let C in M.defines)v.push(C),v.push(M.defines[C]);return M.isRawShaderMaterial===!1&&(T(v,M),E(v,M),v.push(i.outputColorSpace)),v.push(M.customProgramCacheKey),v.join()}function T(M,v){M.push(v.precision),M.push(v.outputColorSpace),M.push(v.envMapMode),M.push(v.envMapCubeUVHeight),M.push(v.mapUv),M.push(v.alphaMapUv),M.push(v.lightMapUv),M.push(v.aoMapUv),M.push(v.bumpMapUv),M.push(v.normalMapUv),M.push(v.displacementMapUv),M.push(v.emissiveMapUv),M.push(v.metalnessMapUv),M.push(v.roughnessMapUv),M.push(v.anisotropyMapUv),M.push(v.clearcoatMapUv),M.push(v.clearcoatNormalMapUv),M.push(v.clearcoatRoughnessMapUv),M.push(v.iridescenceMapUv),M.push(v.iridescenceThicknessMapUv),M.push(v.sheenColorMapUv),M.push(v.sheenRoughnessMapUv),M.push(v.specularMapUv),M.push(v.specularColorMapUv),M.push(v.specularIntensityMapUv),M.push(v.transmissionMapUv),M.push(v.thicknessMapUv),M.push(v.combine),M.push(v.fogExp2),M.push(v.sizeAttenuation),M.push(v.morphTargetsCount),M.push(v.morphAttributeCount),M.push(v.numDirLights),M.push(v.numPointLights),M.push(v.numSpotLights),M.push(v.numSpotLightMaps),M.push(v.numHemiLights),M.push(v.numRectAreaLights),M.push(v.numDirLightShadows),M.push(v.numPointLightShadows),M.push(v.numSpotLightShadows),M.push(v.numSpotLightShadowsWithMaps),M.push(v.numLightProbes),M.push(v.shadowMapType),M.push(v.toneMapping),M.push(v.numClippingPlanes),M.push(v.numClipIntersection),M.push(v.depthPacking)}function E(M,v){o.disableAll(),v.supportsVertexTextures&&o.enable(0),v.instancing&&o.enable(1),v.instancingColor&&o.enable(2),v.instancingMorph&&o.enable(3),v.matcap&&o.enable(4),v.envMap&&o.enable(5),v.normalMapObjectSpace&&o.enable(6),v.normalMapTangentSpace&&o.enable(7),v.clearcoat&&o.enable(8),v.iridescence&&o.enable(9),v.alphaTest&&o.enable(10),v.vertexColors&&o.enable(11),v.vertexAlphas&&o.enable(12),v.vertexUv1s&&o.enable(13),v.vertexUv2s&&o.enable(14),v.vertexUv3s&&o.enable(15),v.vertexTangents&&o.enable(16),v.anisotropy&&o.enable(17),v.alphaHash&&o.enable(18),v.batching&&o.enable(19),v.dispersion&&o.enable(20),v.batchingColor&&o.enable(21),v.gradientMap&&o.enable(22),M.push(o.mask),o.disableAll(),v.fog&&o.enable(0),v.useFog&&o.enable(1),v.flatShading&&o.enable(2),v.logarithmicDepthBuffer&&o.enable(3),v.reversedDepthBuffer&&o.enable(4),v.skinning&&o.enable(5),v.morphTargets&&o.enable(6),v.morphNormals&&o.enable(7),v.morphColors&&o.enable(8),v.premultipliedAlpha&&o.enable(9),v.shadowMapEnabled&&o.enable(10),v.doubleSided&&o.enable(11),v.flipSided&&o.enable(12),v.useDepthPacking&&o.enable(13),v.dithering&&o.enable(14),v.transmission&&o.enable(15),v.sheen&&o.enable(16),v.opaque&&o.enable(17),v.pointsUvs&&o.enable(18),v.decodeVideoTexture&&o.enable(19),v.decodeVideoTextureEmissive&&o.enable(20),v.alphaToCoverage&&o.enable(21),M.push(o.mask)}function S(M){let v=_[M.type],C;if(v){let F=fn[v];C=Ac.clone(F.uniforms)}else C=M.uniforms;return C}function R(M,v){let C;for(let F=0,k=h.length;F0?n.push(u):p.transparent===!0?s.push(u):e.push(u)}function c(d,f,p,_,y,m){let u=a(d,f,p,_,y,m);p.transmission>0?n.unshift(u):p.transparent===!0?s.unshift(u):e.unshift(u)}function l(d,f){e.length>1&&e.sort(d||Sm),n.length>1&&n.sort(f||Jc),s.length>1&&s.sort(f||Jc)}function h(){for(let d=t,f=i.length;d=r.length?(a=new $c,r.push(a)):a=r[s],a}function e(){i=new WeakMap}return{get:t,dispose:e}}function Em(){let i={};return{get:function(t){if(i[t.id]!==void 0)return i[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new L,color:new Ot};break;case"SpotLight":e={position:new L,direction:new L,color:new Ot,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new L,color:new Ot,distance:0,decay:0};break;case"HemisphereLight":e={direction:new L,skyColor:new Ot,groundColor:new Ot};break;case"RectAreaLight":e={color:new Ot,position:new L,halfWidth:new L,halfHeight:new L};break}return i[t.id]=e,e}}}function Tm(){let i={};return{get:function(t){if(i[t.id]!==void 0)return i[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Pt};break;case"SpotLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Pt};break;case"PointLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Pt,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[t.id]=e,e}}}var wm=0;function Am(i,t){return(t.castShadow?2:0)-(i.castShadow?2:0)+(t.map?1:0)-(i.map?1:0)}function Rm(i){let t=new Em,e=Tm(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let l=0;l<9;l++)n.probe.push(new L);let s=new L,r=new he,a=new he;function o(l){let h=0,d=0,f=0;for(let M=0;M<9;M++)n.probe[M].set(0,0,0);let p=0,_=0,y=0,m=0,u=0,T=0,E=0,S=0,R=0,A=0,P=0;l.sort(Am);for(let M=0,v=l.length;M0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=st.LTC_FLOAT_1,n.rectAreaLTC2=st.LTC_FLOAT_2):(n.rectAreaLTC1=st.LTC_HALF_1,n.rectAreaLTC2=st.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=d,n.ambient[2]=f;let N=n.hash;(N.directionalLength!==p||N.pointLength!==_||N.spotLength!==y||N.rectAreaLength!==m||N.hemiLength!==u||N.numDirectionalShadows!==T||N.numPointShadows!==E||N.numSpotShadows!==S||N.numSpotMaps!==R||N.numLightProbes!==P)&&(n.directional.length=p,n.spot.length=y,n.rectArea.length=m,n.point.length=_,n.hemi.length=u,n.directionalShadow.length=T,n.directionalShadowMap.length=T,n.pointShadow.length=E,n.pointShadowMap.length=E,n.spotShadow.length=S,n.spotShadowMap.length=S,n.directionalShadowMatrix.length=T,n.pointShadowMatrix.length=E,n.spotLightMatrix.length=S+R-A,n.spotLightMap.length=R,n.numSpotLightShadowsWithMaps=A,n.numLightProbes=P,N.directionalLength=p,N.pointLength=_,N.spotLength=y,N.rectAreaLength=m,N.hemiLength=u,N.numDirectionalShadows=T,N.numPointShadows=E,N.numSpotShadows=S,N.numSpotMaps=R,N.numLightProbes=P,n.version=wm++)}function c(l,h){let d=0,f=0,p=0,_=0,y=0,m=h.matrixWorldInverse;for(let u=0,T=l.length;u=a.length?(o=new Kc(i),a.push(o)):o=a[r],o}function n(){t=new WeakMap}return{get:e,dispose:n}}var Im=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,Pm=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function Dm(i,t,e){let n=new Fi,s=new Pt,r=new Pt,a=new le,o=new xr({depthPacking:mc}),c=new yr,l={},h=e.maxTextureSize,d={[Sn]:De,[De]:Sn,[Ve]:Ve},f=new nn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Pt},radius:{value:4}},vertexShader:Im,fragmentShader:Pm}),p=f.clone();p.defines.HORIZONTAL_PASS=1;let _=new Ie;_.setAttribute("position",new Te(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let y=new Pe(_,f),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=fo;let u=this.type;this.render=function(A,P,N){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||A.length===0)return;let M=i.getRenderTarget(),v=i.getActiveCubeFace(),C=i.getActiveMipmapLevel(),F=i.state;F.setBlending(Tn),F.buffers.depth.getReversed()===!0?F.buffers.color.setClear(0,0,0,0):F.buffers.color.setClear(1,1,1,1),F.buffers.depth.setTest(!0),F.setScissorTest(!1);let k=u!==un&&this.type===un,H=u===un&&this.type!==un;for(let q=0,W=A.length;qh||s.y>h)&&(s.x>h&&(r.x=Math.floor(h/rt.x),s.x=r.x*rt.x,V.mapSize.x=r.x),s.y>h&&(r.y=Math.floor(h/rt.y),s.y=r.y*rt.y,V.mapSize.y=r.y)),V.map===null||k===!0||H===!0){let St=this.type!==un?{minFilter:Ye,magFilter:Ye}:{};V.map!==null&&V.map.dispose(),V.map=new cn(s.x,s.y,St),V.map.texture.name=et.name+".shadowMap",V.camera.updateProjectionMatrix()}i.setRenderTarget(V.map),i.clear();let ct=V.getViewportCount();for(let St=0;St0||P.map&&P.alphaTest>0||P.alphaToCoverage===!0){let F=v.uuid,k=P.uuid,H=l[F];H===void 0&&(H={},l[F]=H);let q=H[k];q===void 0&&(q=v.clone(),H[k]=q,P.addEventListener("dispose",R)),v=q}if(v.visible=P.visible,v.wireframe=P.wireframe,M===un?v.side=P.shadowSide!==null?P.shadowSide:P.side:v.side=P.shadowSide!==null?P.shadowSide:d[P.side],v.alphaMap=P.alphaMap,v.alphaTest=P.alphaToCoverage===!0?.5:P.alphaTest,v.map=P.map,v.clipShadows=P.clipShadows,v.clippingPlanes=P.clippingPlanes,v.clipIntersection=P.clipIntersection,v.displacementMap=P.displacementMap,v.displacementScale=P.displacementScale,v.displacementBias=P.displacementBias,v.wireframeLinewidth=P.wireframeLinewidth,v.linewidth=P.linewidth,N.isPointLight===!0&&v.isMeshDistanceMaterial===!0){let F=i.properties.get(v);F.light=N}return v}function S(A,P,N,M,v){if(A.visible===!1)return;if(A.layers.test(P.layers)&&(A.isMesh||A.isLine||A.isPoints)&&(A.castShadow||A.receiveShadow&&v===un)&&(!A.frustumCulled||n.intersectsObject(A))){A.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,A.matrixWorld);let k=t.update(A),H=A.material;if(Array.isArray(H)){let q=k.groups;for(let W=0,et=q.length;W=1):V.indexOf("OpenGL ES")!==-1&&(et=parseFloat(/^OpenGL ES (\d)/.exec(V)[1]),W=et>=2);let rt=null,ct={},St=i.getParameter(i.SCISSOR_BOX),kt=i.getParameter(i.VIEWPORT),jt=new le().fromArray(St),ne=new le().fromArray(kt);function Xt(I,tt,it,ut){let K=new Uint8Array(4),Z=i.createTexture();i.bindTexture(I,Z),i.texParameteri(I,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(I,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let pt=0;pt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),l=new Pt,h=new WeakMap,d,f=new WeakMap,p=!1;try{p=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(b,g){return p?new OffscreenCanvas(b,g):ls("canvas")}function y(b,g,O){let X=1,J=ue(b);if((J.width>O||J.height>O)&&(X=O/Math.max(J.width,J.height)),X<1)if(typeof HTMLImageElement<"u"&&b instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&b instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&b instanceof ImageBitmap||typeof VideoFrame<"u"&&b instanceof VideoFrame){let G=Math.floor(X*J.width),vt=Math.floor(X*J.height);d===void 0&&(d=_(G,vt));let nt=g?_(G,vt):d;return nt.width=G,nt.height=vt,nt.getContext("2d").drawImage(b,0,0,G,vt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+J.width+"x"+J.height+") to ("+G+"x"+vt+")."),nt}else return"data"in b&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+J.width+"x"+J.height+")."),b;return b}function m(b){return b.generateMipmaps}function u(b){i.generateMipmap(b)}function T(b){return b.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:b.isWebGL3DRenderTarget?i.TEXTURE_3D:b.isWebGLArrayRenderTarget||b.isCompressedArrayTexture?i.TEXTURE_2D_ARRAY:i.TEXTURE_2D}function E(b,g,O,X,J=!1){if(b!==null){if(i[b]!==void 0)return i[b];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+b+"'")}let G=g;if(g===i.RED&&(O===i.FLOAT&&(G=i.R32F),O===i.HALF_FLOAT&&(G=i.R16F),O===i.UNSIGNED_BYTE&&(G=i.R8)),g===i.RED_INTEGER&&(O===i.UNSIGNED_BYTE&&(G=i.R8UI),O===i.UNSIGNED_SHORT&&(G=i.R16UI),O===i.UNSIGNED_INT&&(G=i.R32UI),O===i.BYTE&&(G=i.R8I),O===i.SHORT&&(G=i.R16I),O===i.INT&&(G=i.R32I)),g===i.RG&&(O===i.FLOAT&&(G=i.RG32F),O===i.HALF_FLOAT&&(G=i.RG16F),O===i.UNSIGNED_BYTE&&(G=i.RG8)),g===i.RG_INTEGER&&(O===i.UNSIGNED_BYTE&&(G=i.RG8UI),O===i.UNSIGNED_SHORT&&(G=i.RG16UI),O===i.UNSIGNED_INT&&(G=i.RG32UI),O===i.BYTE&&(G=i.RG8I),O===i.SHORT&&(G=i.RG16I),O===i.INT&&(G=i.RG32I)),g===i.RGB_INTEGER&&(O===i.UNSIGNED_BYTE&&(G=i.RGB8UI),O===i.UNSIGNED_SHORT&&(G=i.RGB16UI),O===i.UNSIGNED_INT&&(G=i.RGB32UI),O===i.BYTE&&(G=i.RGB8I),O===i.SHORT&&(G=i.RGB16I),O===i.INT&&(G=i.RGB32I)),g===i.RGBA_INTEGER&&(O===i.UNSIGNED_BYTE&&(G=i.RGBA8UI),O===i.UNSIGNED_SHORT&&(G=i.RGBA16UI),O===i.UNSIGNED_INT&&(G=i.RGBA32UI),O===i.BYTE&&(G=i.RGBA8I),O===i.SHORT&&(G=i.RGBA16I),O===i.INT&&(G=i.RGBA32I)),g===i.RGB&&(O===i.UNSIGNED_INT_5_9_9_9_REV&&(G=i.RGB9_E5),O===i.UNSIGNED_INT_10F_11F_11F_REV&&(G=i.R11F_G11F_B10F)),g===i.RGBA){let vt=J?as:Gt.getTransfer(X);O===i.FLOAT&&(G=i.RGBA32F),O===i.HALF_FLOAT&&(G=i.RGBA16F),O===i.UNSIGNED_BYTE&&(G=vt===Yt?i.SRGB8_ALPHA8:i.RGBA8),O===i.UNSIGNED_SHORT_4_4_4_4&&(G=i.RGBA4),O===i.UNSIGNED_SHORT_5_5_5_1&&(G=i.RGB5_A1)}return(G===i.R16F||G===i.R32F||G===i.RG16F||G===i.RG32F||G===i.RGBA16F||G===i.RGBA32F)&&t.get("EXT_color_buffer_float"),G}function S(b,g){let O;return b?g===null||g===Xn||g===Hi?O=i.DEPTH24_STENCIL8:g===dn?O=i.DEPTH32F_STENCIL8:g===ki&&(O=i.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):g===null||g===Xn||g===Hi?O=i.DEPTH_COMPONENT24:g===dn?O=i.DEPTH_COMPONENT32F:g===ki&&(O=i.DEPTH_COMPONENT16),O}function R(b,g){return m(b)===!0||b.isFramebufferTexture&&b.minFilter!==Ye&&b.minFilter!==tn?Math.log2(Math.max(g.width,g.height))+1:b.mipmaps!==void 0&&b.mipmaps.length>0?b.mipmaps.length:b.isCompressedTexture&&Array.isArray(b.image)?g.mipmaps.length:1}function A(b){let g=b.target;g.removeEventListener("dispose",A),N(g),g.isVideoTexture&&h.delete(g)}function P(b){let g=b.target;g.removeEventListener("dispose",P),v(g)}function N(b){let g=n.get(b);if(g.__webglInit===void 0)return;let O=b.source,X=f.get(O);if(X){let J=X[g.__cacheKey];J.usedTimes--,J.usedTimes===0&&M(b),Object.keys(X).length===0&&f.delete(O)}n.remove(b)}function M(b){let g=n.get(b);i.deleteTexture(g.__webglTexture);let O=b.source,X=f.get(O);delete X[g.__cacheKey],a.memory.textures--}function v(b){let g=n.get(b);if(b.depthTexture&&(b.depthTexture.dispose(),n.remove(b.depthTexture)),b.isWebGLCubeRenderTarget)for(let X=0;X<6;X++){if(Array.isArray(g.__webglFramebuffer[X]))for(let J=0;J=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+b+" texture units while this GPU supports only "+s.maxTextures),C+=1,b}function H(b){let g=[];return g.push(b.wrapS),g.push(b.wrapT),g.push(b.wrapR||0),g.push(b.magFilter),g.push(b.minFilter),g.push(b.anisotropy),g.push(b.internalFormat),g.push(b.format),g.push(b.type),g.push(b.generateMipmaps),g.push(b.premultiplyAlpha),g.push(b.flipY),g.push(b.unpackAlignment),g.push(b.colorSpace),g.join()}function q(b,g){let O=n.get(b);if(b.isVideoTexture&&Ft(b),b.isRenderTargetTexture===!1&&b.isExternalTexture!==!0&&b.version>0&&O.__version!==b.version){let X=b.image;if(X===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(X.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Y(O,b,g);return}}else b.isExternalTexture&&(O.__webglTexture=b.sourceTexture?b.sourceTexture:null);e.bindTexture(i.TEXTURE_2D,O.__webglTexture,i.TEXTURE0+g)}function W(b,g){let O=n.get(b);if(b.isRenderTargetTexture===!1&&b.version>0&&O.__version!==b.version){Y(O,b,g);return}e.bindTexture(i.TEXTURE_2D_ARRAY,O.__webglTexture,i.TEXTURE0+g)}function et(b,g){let O=n.get(b);if(b.isRenderTargetTexture===!1&&b.version>0&&O.__version!==b.version){Y(O,b,g);return}e.bindTexture(i.TEXTURE_3D,O.__webglTexture,i.TEXTURE0+g)}function V(b,g){let O=n.get(b);if(b.version>0&&O.__version!==b.version){$(O,b,g);return}e.bindTexture(i.TEXTURE_CUBE_MAP,O.__webglTexture,i.TEXTURE0+g)}let rt={[ar]:i.REPEAT,[Fn]:i.CLAMP_TO_EDGE,[or]:i.MIRRORED_REPEAT},ct={[Ye]:i.NEAREST,[fc]:i.NEAREST_MIPMAP_NEAREST,[Cs]:i.NEAREST_MIPMAP_LINEAR,[tn]:i.LINEAR,[kr]:i.LINEAR_MIPMAP_NEAREST,[Wn]:i.LINEAR_MIPMAP_LINEAR},St={[_c]:i.NEVER,[bc]:i.ALWAYS,[xc]:i.LESS,[Ro]:i.LEQUAL,[yc]:i.EQUAL,[Sc]:i.GEQUAL,[vc]:i.GREATER,[Mc]:i.NOTEQUAL};function kt(b,g){if(g.type===dn&&t.has("OES_texture_float_linear")===!1&&(g.magFilter===tn||g.magFilter===kr||g.magFilter===Cs||g.magFilter===Wn||g.minFilter===tn||g.minFilter===kr||g.minFilter===Cs||g.minFilter===Wn)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(b,i.TEXTURE_WRAP_S,rt[g.wrapS]),i.texParameteri(b,i.TEXTURE_WRAP_T,rt[g.wrapT]),(b===i.TEXTURE_3D||b===i.TEXTURE_2D_ARRAY)&&i.texParameteri(b,i.TEXTURE_WRAP_R,rt[g.wrapR]),i.texParameteri(b,i.TEXTURE_MAG_FILTER,ct[g.magFilter]),i.texParameteri(b,i.TEXTURE_MIN_FILTER,ct[g.minFilter]),g.compareFunction&&(i.texParameteri(b,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(b,i.TEXTURE_COMPARE_FUNC,St[g.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(g.magFilter===Ye||g.minFilter!==Cs&&g.minFilter!==Wn||g.type===dn&&t.has("OES_texture_float_linear")===!1)return;if(g.anisotropy>1||n.get(g).__currentAnisotropy){let O=t.get("EXT_texture_filter_anisotropic");i.texParameterf(b,O.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(g.anisotropy,s.getMaxAnisotropy())),n.get(g).__currentAnisotropy=g.anisotropy}}}function jt(b,g){let O=!1;b.__webglInit===void 0&&(b.__webglInit=!0,g.addEventListener("dispose",A));let X=g.source,J=f.get(X);J===void 0&&(J={},f.set(X,J));let G=H(g);if(G!==b.__cacheKey){J[G]===void 0&&(J[G]={texture:i.createTexture(),usedTimes:0},a.memory.textures++,O=!0),J[G].usedTimes++;let vt=J[b.__cacheKey];vt!==void 0&&(J[b.__cacheKey].usedTimes--,vt.usedTimes===0&&M(g)),b.__cacheKey=G,b.__webglTexture=J[G].texture}return O}function ne(b,g,O){return Math.floor(Math.floor(b/O)/g)}function Xt(b,g,O,X){let G=b.updateRanges;if(G.length===0)e.texSubImage2D(i.TEXTURE_2D,0,0,0,g.width,g.height,O,X,g.data);else{G.sort((Q,lt)=>Q.start-lt.start);let vt=0;for(let Q=1;Q0){I&&tt&&e.texStorage2D(i.TEXTURE_2D,ut,yt,Nt[0].width,Nt[0].height);for(let K=0,Z=Nt.length;K0){let pt=Fo(at.width,at.height,g.format,g.type);for(let Dt of g.layerUpdates){let Qt=at.data.subarray(Dt*pt/at.data.BYTES_PER_ELEMENT,(Dt+1)*pt/at.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,K,0,0,Dt,at.width,at.height,1,lt,Qt)}g.clearLayerUpdates()}else e.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,K,0,0,0,at.width,at.height,Q.depth,lt,at.data)}else e.compressedTexImage3D(i.TEXTURE_2D_ARRAY,K,yt,at.width,at.height,Q.depth,0,at.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else I?it&&e.texSubImage3D(i.TEXTURE_2D_ARRAY,K,0,0,0,at.width,at.height,Q.depth,lt,At,at.data):e.texImage3D(i.TEXTURE_2D_ARRAY,K,yt,at.width,at.height,Q.depth,0,lt,At,at.data)}else{I&&tt&&e.texStorage2D(i.TEXTURE_2D,ut,yt,Nt[0].width,Nt[0].height);for(let K=0,Z=Nt.length;K0){let K=Fo(Q.width,Q.height,g.format,g.type);for(let Z of g.layerUpdates){let pt=Q.data.subarray(Z*K/Q.data.BYTES_PER_ELEMENT,(Z+1)*K/Q.data.BYTES_PER_ELEMENT);e.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,Z,Q.width,Q.height,1,lt,At,pt)}g.clearLayerUpdates()}else e.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,Q.width,Q.height,Q.depth,lt,At,Q.data)}else e.texImage3D(i.TEXTURE_2D_ARRAY,0,yt,Q.width,Q.height,Q.depth,0,lt,At,Q.data);else if(g.isData3DTexture)I?(tt&&e.texStorage3D(i.TEXTURE_3D,ut,yt,Q.width,Q.height,Q.depth),it&&e.texSubImage3D(i.TEXTURE_3D,0,0,0,0,Q.width,Q.height,Q.depth,lt,At,Q.data)):e.texImage3D(i.TEXTURE_3D,0,yt,Q.width,Q.height,Q.depth,0,lt,At,Q.data);else if(g.isFramebufferTexture){if(tt)if(I)e.texStorage2D(i.TEXTURE_2D,ut,yt,Q.width,Q.height);else{let K=Q.width,Z=Q.height;for(let pt=0;pt>=1,Z>>=1}}else if(Nt.length>0){if(I&&tt){let K=ue(Nt[0]);e.texStorage2D(i.TEXTURE_2D,ut,yt,K.width,K.height)}for(let K=0,Z=Nt.length;K0&&ut++;let Z=ue(lt[0]);e.texStorage2D(i.TEXTURE_CUBE_MAP,ut,Nt,Z.width,Z.height)}for(let Z=0;Z<6;Z++)if(Q){I?it&&e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Z,0,0,0,lt[Z].width,lt[Z].height,yt,at,lt[Z].data):e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Z,0,Nt,lt[Z].width,lt[Z].height,0,yt,at,lt[Z].data);for(let pt=0;pt>G),At=Math.max(1,g.height>>G);J===i.TEXTURE_3D||J===i.TEXTURE_2D_ARRAY?e.texImage3D(J,G,_t,lt,At,g.depth,0,vt,nt,null):e.texImage2D(J,G,_t,lt,At,0,vt,nt,null)}e.bindFramebuffer(i.FRAMEBUFFER,b),gt(g)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,X,J,Q.__webglTexture,0,se(g)):(J===i.TEXTURE_2D||J>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&J<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,X,J,Q.__webglTexture,G),e.bindFramebuffer(i.FRAMEBUFFER,null)}function It(b,g,O){if(i.bindRenderbuffer(i.RENDERBUFFER,b),g.depthBuffer){let X=g.depthTexture,J=X&&X.isDepthTexture?X.type:null,G=S(g.stencilBuffer,J),vt=g.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,nt=se(g);gt(g)?o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,nt,G,g.width,g.height):O?i.renderbufferStorageMultisample(i.RENDERBUFFER,nt,G,g.width,g.height):i.renderbufferStorage(i.RENDERBUFFER,G,g.width,g.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,vt,i.RENDERBUFFER,b)}else{let X=g.textures;for(let J=0;J{delete g.__boundDepthTexture,delete g.__depthDisposeCallback,X.removeEventListener("dispose",J)};X.addEventListener("dispose",J),g.__depthDisposeCallback=J}g.__boundDepthTexture=X}if(b.depthTexture&&!g.__autoAllocateDepthBuffer){if(O)throw new Error("target.depthTexture not supported in Cube render targets");let X=b.texture.mipmaps;X&&X.length>0?Mt(g.__webglFramebuffer[0],b):Mt(g.__webglFramebuffer,b)}else if(O){g.__webglDepthbuffer=[];for(let X=0;X<6;X++)if(e.bindFramebuffer(i.FRAMEBUFFER,g.__webglFramebuffer[X]),g.__webglDepthbuffer[X]===void 0)g.__webglDepthbuffer[X]=i.createRenderbuffer(),It(g.__webglDepthbuffer[X],b,!1);else{let J=b.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,G=g.__webglDepthbuffer[X];i.bindRenderbuffer(i.RENDERBUFFER,G),i.framebufferRenderbuffer(i.FRAMEBUFFER,J,i.RENDERBUFFER,G)}}else{let X=b.texture.mipmaps;if(X&&X.length>0?e.bindFramebuffer(i.FRAMEBUFFER,g.__webglFramebuffer[0]):e.bindFramebuffer(i.FRAMEBUFFER,g.__webglFramebuffer),g.__webglDepthbuffer===void 0)g.__webglDepthbuffer=i.createRenderbuffer(),It(g.__webglDepthbuffer,b,!1);else{let J=b.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,G=g.__webglDepthbuffer;i.bindRenderbuffer(i.RENDERBUFFER,G),i.framebufferRenderbuffer(i.FRAMEBUFFER,J,i.RENDERBUFFER,G)}}e.bindFramebuffer(i.FRAMEBUFFER,null)}function Me(b,g,O){let X=n.get(b);g!==void 0&&dt(X.__webglFramebuffer,b,b.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),O!==void 0&&Ht(b)}function w(b){let g=b.texture,O=n.get(b),X=n.get(g);b.addEventListener("dispose",P);let J=b.textures,G=b.isWebGLCubeRenderTarget===!0,vt=J.length>1;if(vt||(X.__webglTexture===void 0&&(X.__webglTexture=i.createTexture()),X.__version=g.version,a.memory.textures++),G){O.__webglFramebuffer=[];for(let nt=0;nt<6;nt++)if(g.mipmaps&&g.mipmaps.length>0){O.__webglFramebuffer[nt]=[];for(let _t=0;_t0){O.__webglFramebuffer=[];for(let nt=0;nt0&>(b)===!1){O.__webglMultisampledFramebuffer=i.createFramebuffer(),O.__webglColorRenderbuffer=[],e.bindFramebuffer(i.FRAMEBUFFER,O.__webglMultisampledFramebuffer);for(let nt=0;nt0)for(let _t=0;_t0)for(let _t=0;_t0){if(gt(b)===!1){let g=b.textures,O=b.width,X=b.height,J=i.COLOR_BUFFER_BIT,G=b.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,vt=n.get(b),nt=g.length>1;if(nt)for(let xt=0;xt0?e.bindFramebuffer(i.DRAW_FRAMEBUFFER,vt.__webglFramebuffer[0]):e.bindFramebuffer(i.DRAW_FRAMEBUFFER,vt.__webglFramebuffer);for(let xt=0;xt0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&g.__useRenderToTexture!==!1}function Ft(b){let g=a.render.frame;h.get(b)!==g&&(h.set(b,g),b.update())}function _e(b,g){let O=b.colorSpace,X=b.format,J=b.type;return b.isCompressedTexture===!0||b.isVideoTexture===!0||O!==bn&&O!==An&&(Gt.getTransfer(O)===Yt?(X!==Je||J!==sn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",O)),g}function ue(b){return typeof HTMLImageElement<"u"&&b instanceof HTMLImageElement?(l.width=b.naturalWidth||b.width,l.height=b.naturalHeight||b.height):typeof VideoFrame<"u"&&b instanceof VideoFrame?(l.width=b.displayWidth,l.height=b.displayHeight):(l.width=b.width,l.height=b.height),l}this.allocateTextureUnit=k,this.resetTextureUnits=F,this.setTexture2D=q,this.setTexture2DArray=W,this.setTexture3D=et,this.setTextureCube=V,this.rebindTextures=Me,this.setupRenderTarget=w,this.updateRenderTargetMipmap=ie,this.updateMultisampleRenderTarget=mt,this.setupDepthRenderbuffer=Ht,this.setupFrameBufferTexture=dt,this.useMultisampledRTT=gt}function Fm(i,t){function e(n,s=An){let r,a=Gt.getTransfer(s);if(n===sn)return i.UNSIGNED_BYTE;if(n===Hr)return i.UNSIGNED_SHORT_4_4_4_4;if(n===Gr)return i.UNSIGNED_SHORT_5_5_5_1;if(n===Mo)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===So)return i.UNSIGNED_INT_10F_11F_11F_REV;if(n===yo)return i.BYTE;if(n===vo)return i.SHORT;if(n===ki)return i.UNSIGNED_SHORT;if(n===Vr)return i.INT;if(n===Xn)return i.UNSIGNED_INT;if(n===dn)return i.FLOAT;if(n===Vi)return i.HALF_FLOAT;if(n===bo)return i.ALPHA;if(n===Eo)return i.RGB;if(n===Je)return i.RGBA;if(n===Pi)return i.DEPTH_COMPONENT;if(n===Gi)return i.DEPTH_STENCIL;if(n===To)return i.RED;if(n===Wr)return i.RED_INTEGER;if(n===wo)return i.RG;if(n===Xr)return i.RG_INTEGER;if(n===qr)return i.RGBA_INTEGER;if(n===Is||n===Ps||n===Ds||n===Ls)if(a===Yt)if(r=t.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(n===Is)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Ps)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Ds)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Ls)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=t.get("WEBGL_compressed_texture_s3tc"),r!==null){if(n===Is)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Ps)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Ds)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Ls)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Yr||n===Zr||n===Jr||n===$r)if(r=t.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(n===Yr)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Zr)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Jr)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===$r)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Kr||n===jr||n===Qr)if(r=t.get("WEBGL_compressed_texture_etc"),r!==null){if(n===Kr||n===jr)return a===Yt?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===Qr)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===ta||n===ea||n===na||n===ia||n===sa||n===ra||n===aa||n===oa||n===la||n===ca||n===ha||n===ua||n===da||n===fa)if(r=t.get("WEBGL_compressed_texture_astc"),r!==null){if(n===ta)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===ea)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===na)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===ia)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===sa)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===ra)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===aa)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===oa)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===la)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===ca)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===ha)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===ua)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===da)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===fa)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===pa||n===ma||n===ga)if(r=t.get("EXT_texture_compression_bptc"),r!==null){if(n===pa)return a===Yt?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===ma)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===ga)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===_a||n===xa||n===ya||n===va)if(r=t.get("EXT_texture_compression_rgtc"),r!==null){if(n===_a)return r.COMPRESSED_RED_RGTC1_EXT;if(n===xa)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===ya)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===va)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Hi?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:e}}var Om=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,Bm=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`,Jo=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e){if(this.texture===null){let n=new ys(t.texture);(t.depthNear!==e.depthNear||t.depthFar!==e.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=n}}getMesh(t){if(this.texture!==null&&this.mesh===null){let e=t.cameras[0].viewport,n=new nn({vertexShader:Om,fragmentShader:Bm,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new Pe(new ai(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},$o=class extends ln{constructor(t,e){super();let n=this,s=null,r=1,a=null,o="local-floor",c=1,l=null,h=null,d=null,f=null,p=null,_=null,y=typeof XRWebGLBinding<"u",m=new Jo,u={},T=e.getContextAttributes(),E=null,S=null,R=[],A=[],P=new Pt,N=null,M=new Ee;M.viewport=new le;let v=new Ee;v.viewport=new le;let C=[M,v],F=new Cr,k=null,H=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let $=R[Y];return $===void 0&&($=new Ni,R[Y]=$),$.getTargetRaySpace()},this.getControllerGrip=function(Y){let $=R[Y];return $===void 0&&($=new Ni,R[Y]=$),$.getGripSpace()},this.getHand=function(Y){let $=R[Y];return $===void 0&&($=new Ni,R[Y]=$),$.getHandSpace()};function q(Y){let $=A.indexOf(Y.inputSource);if($===-1)return;let dt=R[$];dt!==void 0&&(dt.update(Y.inputSource,Y.frame,l||a),dt.dispatchEvent({type:Y.type,data:Y.inputSource}))}function W(){s.removeEventListener("select",q),s.removeEventListener("selectstart",q),s.removeEventListener("selectend",q),s.removeEventListener("squeeze",q),s.removeEventListener("squeezestart",q),s.removeEventListener("squeezeend",q),s.removeEventListener("end",W),s.removeEventListener("inputsourceschange",et);for(let Y=0;Y=0&&(A[It]=null,R[It].disconnect(dt))}for(let $=0;$=A.length){A.push(dt),It=Ht;break}else if(A[Ht]===null){A[Ht]=dt,It=Ht;break}if(It===-1)break}let Mt=R[It];Mt&&Mt.connect(dt)}}let V=new L,rt=new L;function ct(Y,$,dt){V.setFromMatrixPosition($.matrixWorld),rt.setFromMatrixPosition(dt.matrixWorld);let It=V.distanceTo(rt),Mt=$.projectionMatrix.elements,Ht=dt.projectionMatrix.elements,Me=Mt[14]/(Mt[10]-1),w=Mt[14]/(Mt[10]+1),ie=(Mt[9]+1)/Mt[5],Lt=(Mt[9]-1)/Mt[5],Rt=(Mt[8]-1)/Mt[0],mt=(Ht[8]+1)/Ht[0],se=Me*Rt,gt=Me*mt,Ft=It/(-Rt+mt),_e=Ft*-Rt;if($.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX(_e),Y.translateZ(Ft),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert(),Mt[10]===-1)Y.projectionMatrix.copy($.projectionMatrix),Y.projectionMatrixInverse.copy($.projectionMatrixInverse);else{let ue=Me+Ft,b=w+Ft,g=se-_e,O=gt+(It-_e),X=ie*w/b*ue,J=Lt*w/b*ue;Y.projectionMatrix.makePerspective(g,O,X,J,ue,b),Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert()}}function St(Y,$){$===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices($.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(s===null)return;let $=Y.near,dt=Y.far;m.texture!==null&&(m.depthNear>0&&($=m.depthNear),m.depthFar>0&&(dt=m.depthFar)),F.near=v.near=M.near=$,F.far=v.far=M.far=dt,(k!==F.near||H!==F.far)&&(s.updateRenderState({depthNear:F.near,depthFar:F.far}),k=F.near,H=F.far),F.layers.mask=Y.layers.mask|6,M.layers.mask=F.layers.mask&3,v.layers.mask=F.layers.mask&5;let It=Y.parent,Mt=F.cameras;St(F,It);for(let Ht=0;Ht0&&(m.alphaTest.value=u.alphaTest);let T=t.get(u),E=T.envMap,S=T.envMapRotation;E&&(m.envMap.value=E,di.copy(S),di.x*=-1,di.y*=-1,di.z*=-1,E.isCubeTexture&&E.isRenderTargetTexture===!1&&(di.y*=-1,di.z*=-1),m.envMapRotation.value.setFromMatrix4(zm.makeRotationFromEuler(di)),m.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=u.reflectivity,m.ior.value=u.ior,m.refractionRatio.value=u.refractionRatio),u.lightMap&&(m.lightMap.value=u.lightMap,m.lightMapIntensity.value=u.lightMapIntensity,e(u.lightMap,m.lightMapTransform)),u.aoMap&&(m.aoMap.value=u.aoMap,m.aoMapIntensity.value=u.aoMapIntensity,e(u.aoMap,m.aoMapTransform))}function a(m,u){m.diffuse.value.copy(u.color),m.opacity.value=u.opacity,u.map&&(m.map.value=u.map,e(u.map,m.mapTransform))}function o(m,u){m.dashSize.value=u.dashSize,m.totalSize.value=u.dashSize+u.gapSize,m.scale.value=u.scale}function c(m,u,T,E){m.diffuse.value.copy(u.color),m.opacity.value=u.opacity,m.size.value=u.size*T,m.scale.value=E*.5,u.map&&(m.map.value=u.map,e(u.map,m.uvTransform)),u.alphaMap&&(m.alphaMap.value=u.alphaMap,e(u.alphaMap,m.alphaMapTransform)),u.alphaTest>0&&(m.alphaTest.value=u.alphaTest)}function l(m,u){m.diffuse.value.copy(u.color),m.opacity.value=u.opacity,m.rotation.value=u.rotation,u.map&&(m.map.value=u.map,e(u.map,m.mapTransform)),u.alphaMap&&(m.alphaMap.value=u.alphaMap,e(u.alphaMap,m.alphaMapTransform)),u.alphaTest>0&&(m.alphaTest.value=u.alphaTest)}function h(m,u){m.specular.value.copy(u.specular),m.shininess.value=Math.max(u.shininess,1e-4)}function d(m,u){u.gradientMap&&(m.gradientMap.value=u.gradientMap)}function f(m,u){m.metalness.value=u.metalness,u.metalnessMap&&(m.metalnessMap.value=u.metalnessMap,e(u.metalnessMap,m.metalnessMapTransform)),m.roughness.value=u.roughness,u.roughnessMap&&(m.roughnessMap.value=u.roughnessMap,e(u.roughnessMap,m.roughnessMapTransform)),u.envMap&&(m.envMapIntensity.value=u.envMapIntensity)}function p(m,u,T){m.ior.value=u.ior,u.sheen>0&&(m.sheenColor.value.copy(u.sheenColor).multiplyScalar(u.sheen),m.sheenRoughness.value=u.sheenRoughness,u.sheenColorMap&&(m.sheenColorMap.value=u.sheenColorMap,e(u.sheenColorMap,m.sheenColorMapTransform)),u.sheenRoughnessMap&&(m.sheenRoughnessMap.value=u.sheenRoughnessMap,e(u.sheenRoughnessMap,m.sheenRoughnessMapTransform))),u.clearcoat>0&&(m.clearcoat.value=u.clearcoat,m.clearcoatRoughness.value=u.clearcoatRoughness,u.clearcoatMap&&(m.clearcoatMap.value=u.clearcoatMap,e(u.clearcoatMap,m.clearcoatMapTransform)),u.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=u.clearcoatRoughnessMap,e(u.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),u.clearcoatNormalMap&&(m.clearcoatNormalMap.value=u.clearcoatNormalMap,e(u.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(u.clearcoatNormalScale),u.side===De&&m.clearcoatNormalScale.value.negate())),u.dispersion>0&&(m.dispersion.value=u.dispersion),u.iridescence>0&&(m.iridescence.value=u.iridescence,m.iridescenceIOR.value=u.iridescenceIOR,m.iridescenceThicknessMinimum.value=u.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=u.iridescenceThicknessRange[1],u.iridescenceMap&&(m.iridescenceMap.value=u.iridescenceMap,e(u.iridescenceMap,m.iridescenceMapTransform)),u.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=u.iridescenceThicknessMap,e(u.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),u.transmission>0&&(m.transmission.value=u.transmission,m.transmissionSamplerMap.value=T.texture,m.transmissionSamplerSize.value.set(T.width,T.height),u.transmissionMap&&(m.transmissionMap.value=u.transmissionMap,e(u.transmissionMap,m.transmissionMapTransform)),m.thickness.value=u.thickness,u.thicknessMap&&(m.thicknessMap.value=u.thicknessMap,e(u.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=u.attenuationDistance,m.attenuationColor.value.copy(u.attenuationColor)),u.anisotropy>0&&(m.anisotropyVector.value.set(u.anisotropy*Math.cos(u.anisotropyRotation),u.anisotropy*Math.sin(u.anisotropyRotation)),u.anisotropyMap&&(m.anisotropyMap.value=u.anisotropyMap,e(u.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=u.specularIntensity,m.specularColor.value.copy(u.specularColor),u.specularColorMap&&(m.specularColorMap.value=u.specularColorMap,e(u.specularColorMap,m.specularColorMapTransform)),u.specularIntensityMap&&(m.specularIntensityMap.value=u.specularIntensityMap,e(u.specularIntensityMap,m.specularIntensityMapTransform))}function _(m,u){u.matcap&&(m.matcap.value=u.matcap)}function y(m,u){let T=t.get(u).light;m.referencePosition.value.setFromMatrixPosition(T.matrixWorld),m.nearDistance.value=T.shadow.camera.near,m.farDistance.value=T.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:s}}function Vm(i,t,e,n){let s={},r={},a=[],o=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function c(T,E){let S=E.program;n.uniformBlockBinding(T,S)}function l(T,E){let S=s[T.id];S===void 0&&(_(T),S=h(T),s[T.id]=S,T.addEventListener("dispose",m));let R=E.program;n.updateUBOMapping(T,R);let A=t.render.frame;r[T.id]!==A&&(f(T),r[T.id]=A)}function h(T){let E=d();T.__bindingPointIndex=E;let S=i.createBuffer(),R=T.__size,A=T.usage;return i.bindBuffer(i.UNIFORM_BUFFER,S),i.bufferData(i.UNIFORM_BUFFER,R,A),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,E,S),S}function d(){for(let T=0;T0&&(S+=R-A),T.__size=S,T.__cache={},this}function y(T){let E={boundary:0,storage:0};return typeof T=="number"||typeof T=="boolean"?(E.boundary=4,E.storage=4):T.isVector2?(E.boundary=8,E.storage=8):T.isVector3||T.isColor?(E.boundary=16,E.storage=12):T.isVector4?(E.boundary=16,E.storage=16):T.isMatrix3?(E.boundary=48,E.storage=48):T.isMatrix4?(E.boundary=64,E.storage=64):T.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",T),E}function m(T){let E=T.target;E.removeEventListener("dispose",m);let S=a.indexOf(E.__bindingPointIndex);a.splice(S,1),i.deleteBuffer(s[E.id]),delete s[E.id],delete r[E.id]}function u(){for(let T in s)i.deleteBuffer(s[T]);a=[],s={},r={}}return{bind:c,update:l,dispose:u}}var Ta=class{constructor(t={}){let{canvas:e=Ec(),context:n=null,depth:s=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:l=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:d=!1,reversedDepthBuffer:f=!1}=t;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=n.getContextAttributes().alpha}else p=a;let _=new Uint32Array(4),y=new Int32Array(4),m=null,u=null,T=[],E=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=wn,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let S=this,R=!1;this._outputColorSpace=Ce;let A=0,P=0,N=null,M=-1,v=null,C=new le,F=new le,k=null,H=new Ot(0),q=0,W=e.width,et=e.height,V=1,rt=null,ct=null,St=new le(0,0,W,et),kt=new le(0,0,W,et),jt=!1,ne=new Fi,Xt=!1,Y=!1,$=new he,dt=new L,It=new le,Mt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},Ht=!1;function Me(){return N===null?V:1}let w=n;function ie(x,D){return e.getContext(x,D)}try{let x={alpha:!0,depth:s,stencil:r,antialias:o,premultipliedAlpha:c,preserveDrawingBuffer:l,powerPreference:h,failIfMajorPerformanceCaveat:d};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${"180"}`),e.addEventListener("webglcontextlost",it,!1),e.addEventListener("webglcontextrestored",ut,!1),e.addEventListener("webglcontextcreationerror",K,!1),w===null){let D="webgl2";if(w=ie(D,x),w===null)throw ie(D)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(x){throw console.error("THREE.WebGLRenderer: "+x.message),x}let Lt,Rt,mt,se,gt,Ft,_e,ue,b,g,O,X,J,G,vt,nt,_t,xt,Q,lt,At,yt,at,Nt;function I(){Lt=new rp(w),Lt.init(),yt=new Fm(w,Lt),Rt=new jf(w,Lt,t,yt),mt=new Um(w,Lt),Rt.reversedDepthBuffer&&f&&mt.buffers.depth.setReversed(!0),se=new lp(w),gt=new Mm,Ft=new Nm(w,Lt,mt,gt,Rt,yt,se),_e=new tp(S),ue=new sp(S),b=new fu(w),at=new $f(w,b),g=new ap(w,b,se,at),O=new hp(w,g,b,se),Q=new cp(w,Rt,Ft),nt=new Qf(gt),X=new vm(S,_e,ue,Lt,Rt,at,nt),J=new km(S,gt),G=new bm,vt=new Cm(Lt),xt=new Jf(S,_e,ue,mt,O,p,c),_t=new Dm(S,O,Rt),Nt=new Vm(w,se,Rt,mt),lt=new Kf(w,Lt,se),At=new op(w,Lt,se),se.programs=X.programs,S.capabilities=Rt,S.extensions=Lt,S.properties=gt,S.renderLists=G,S.shadowMap=_t,S.state=mt,S.info=se}I();let tt=new $o(S,w);this.xr=tt,this.getContext=function(){return w},this.getContextAttributes=function(){return w.getContextAttributes()},this.forceContextLoss=function(){let x=Lt.get("WEBGL_lose_context");x&&x.loseContext()},this.forceContextRestore=function(){let x=Lt.get("WEBGL_lose_context");x&&x.restoreContext()},this.getPixelRatio=function(){return V},this.setPixelRatio=function(x){x!==void 0&&(V=x,this.setSize(W,et,!1))},this.getSize=function(x){return x.set(W,et)},this.setSize=function(x,D,B=!0){if(tt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}W=x,et=D,e.width=Math.floor(x*V),e.height=Math.floor(D*V),B===!0&&(e.style.width=x+"px",e.style.height=D+"px"),this.setViewport(0,0,x,D)},this.getDrawingBufferSize=function(x){return x.set(W*V,et*V).floor()},this.setDrawingBufferSize=function(x,D,B){W=x,et=D,V=B,e.width=Math.floor(x*B),e.height=Math.floor(D*B),this.setViewport(0,0,x,D)},this.getCurrentViewport=function(x){return x.copy(C)},this.getViewport=function(x){return x.copy(St)},this.setViewport=function(x,D,B,z){x.isVector4?St.set(x.x,x.y,x.z,x.w):St.set(x,D,B,z),mt.viewport(C.copy(St).multiplyScalar(V).round())},this.getScissor=function(x){return x.copy(kt)},this.setScissor=function(x,D,B,z){x.isVector4?kt.set(x.x,x.y,x.z,x.w):kt.set(x,D,B,z),mt.scissor(F.copy(kt).multiplyScalar(V).round())},this.getScissorTest=function(){return jt},this.setScissorTest=function(x){mt.setScissorTest(jt=x)},this.setOpaqueSort=function(x){rt=x},this.setTransparentSort=function(x){ct=x},this.getClearColor=function(x){return x.copy(xt.getClearColor())},this.setClearColor=function(){xt.setClearColor(...arguments)},this.getClearAlpha=function(){return xt.getClearAlpha()},this.setClearAlpha=function(){xt.setClearAlpha(...arguments)},this.clear=function(x=!0,D=!0,B=!0){let z=0;if(x){let U=!1;if(N!==null){let j=N.texture.format;U=j===qr||j===Xr||j===Wr}if(U){let j=N.texture.type,ot=j===sn||j===Xn||j===ki||j===Hi||j===Hr||j===Gr,ft=xt.getClearColor(),ht=xt.getClearAlpha(),wt=ft.r,Ct=ft.g,bt=ft.b;ot?(_[0]=wt,_[1]=Ct,_[2]=bt,_[3]=ht,w.clearBufferuiv(w.COLOR,0,_)):(y[0]=wt,y[1]=Ct,y[2]=bt,y[3]=ht,w.clearBufferiv(w.COLOR,0,y))}else z|=w.COLOR_BUFFER_BIT}D&&(z|=w.DEPTH_BUFFER_BIT),B&&(z|=w.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),w.clear(z)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",it,!1),e.removeEventListener("webglcontextrestored",ut,!1),e.removeEventListener("webglcontextcreationerror",K,!1),xt.dispose(),G.dispose(),vt.dispose(),gt.dispose(),_e.dispose(),ue.dispose(),O.dispose(),at.dispose(),Nt.dispose(),X.dispose(),tt.dispose(),tt.removeEventListener("sessionstart",on),tt.removeEventListener("sessionend",ll),Jn.stop()};function it(x){x.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),R=!0}function ut(){console.log("THREE.WebGLRenderer: Context Restored."),R=!1;let x=se.autoReset,D=_t.enabled,B=_t.autoUpdate,z=_t.needsUpdate,U=_t.type;I(),se.autoReset=x,_t.enabled=D,_t.autoUpdate=B,_t.needsUpdate=z,_t.type=U}function K(x){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",x.statusMessage)}function Z(x){let D=x.target;D.removeEventListener("dispose",Z),pt(D)}function pt(x){Dt(x),gt.remove(x)}function Dt(x){let D=gt.get(x).programs;D!==void 0&&(D.forEach(function(B){X.releaseProgram(B)}),x.isShaderMaterial&&X.releaseShaderCache(x))}this.renderBufferDirect=function(x,D,B,z,U,j){D===null&&(D=Mt);let ot=U.isMesh&&U.matrixWorld.determinant()<0,ft=fh(x,D,B,z,U);mt.setMaterial(z,ot);let ht=B.index,wt=1;if(z.wireframe===!0){if(ht=g.getWireframeAttribute(B),ht===void 0)return;wt=2}let Ct=B.drawRange,bt=B.attributes.position,Vt=Ct.start*wt,Jt=(Ct.start+Ct.count)*wt;j!==null&&(Vt=Math.max(Vt,j.start*wt),Jt=Math.min(Jt,(j.start+j.count)*wt)),ht!==null?(Vt=Math.max(Vt,0),Jt=Math.min(Jt,ht.count)):bt!=null&&(Vt=Math.max(Vt,0),Jt=Math.min(Jt,bt.count));let ce=Jt-Vt;if(ce<0||ce===1/0)return;at.setup(U,z,ft,B,ht);let te,Kt=lt;if(ht!==null&&(te=b.get(ht),Kt=At,Kt.setIndex(te)),U.isMesh)z.wireframe===!0?(mt.setLineWidth(z.wireframeLinewidth*Me()),Kt.setMode(w.LINES)):Kt.setMode(w.TRIANGLES);else if(U.isLine){let Tt=z.linewidth;Tt===void 0&&(Tt=1),mt.setLineWidth(Tt*Me()),U.isLineSegments?Kt.setMode(w.LINES):U.isLineLoop?Kt.setMode(w.LINE_LOOP):Kt.setMode(w.LINE_STRIP)}else U.isPoints?Kt.setMode(w.POINTS):U.isSprite&&Kt.setMode(w.TRIANGLES);if(U.isBatchedMesh)if(U._multiDrawInstances!==null)Li("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Kt.renderMultiDrawInstances(U._multiDrawStarts,U._multiDrawCounts,U._multiDrawCount,U._multiDrawInstances);else if(Lt.get("WEBGL_multi_draw"))Kt.renderMultiDraw(U._multiDrawStarts,U._multiDrawCounts,U._multiDrawCount);else{let Tt=U._multiDrawStarts,re=U._multiDrawCounts,Wt=U._multiDrawCount,Ne=ht?b.get(ht).bytesPerElement:1,gi=gt.get(z).currentProgram.getUniforms();for(let Fe=0;Fe{function j(){if(z.forEach(function(ot){gt.get(ot).currentProgram.isReady()&&z.delete(ot)}),z.size===0){U(x);return}setTimeout(j,10)}Lt.get("KHR_parallel_shader_compile")!==null?j():setTimeout(j,10)})};let qt=null;function pn(x){qt&&qt(x)}function on(){Jn.stop()}function ll(){Jn.start()}let Jn=new jc;Jn.setAnimationLoop(pn),typeof self<"u"&&Jn.setContext(self),this.setAnimationLoop=function(x){qt=x,tt.setAnimationLoop(x),x===null?Jn.stop():Jn.start()},tt.addEventListener("sessionstart",on),tt.addEventListener("sessionend",ll),this.render=function(x,D){if(D!==void 0&&D.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(R===!0)return;if(x.matrixWorldAutoUpdate===!0&&x.updateMatrixWorld(),D.parent===null&&D.matrixWorldAutoUpdate===!0&&D.updateMatrixWorld(),tt.enabled===!0&&tt.isPresenting===!0&&(tt.cameraAutoUpdate===!0&&tt.updateCamera(D),D=tt.getCamera()),x.isScene===!0&&x.onBeforeRender(S,x,D,N),u=vt.get(x,E.length),u.init(D),E.push(u),$.multiplyMatrices(D.projectionMatrix,D.matrixWorldInverse),ne.setFromProjectionMatrix($,Qe,D.reversedDepth),Y=this.localClippingEnabled,Xt=nt.init(this.clippingPlanes,Y),m=G.get(x,T.length),m.init(),T.push(m),tt.enabled===!0&&tt.isPresenting===!0){let j=S.xr.getDepthSensingMesh();j!==null&&Da(j,D,-1/0,S.sortObjects)}Da(x,D,0,S.sortObjects),m.finish(),S.sortObjects===!0&&m.sort(rt,ct),Ht=tt.enabled===!1||tt.isPresenting===!1||tt.hasDepthSensing()===!1,Ht&&xt.addToRenderList(m,x),this.info.render.frame++,Xt===!0&&nt.beginShadows();let B=u.state.shadowsArray;_t.render(B,x,D),Xt===!0&&nt.endShadows(),this.info.autoReset===!0&&this.info.reset();let z=m.opaque,U=m.transmissive;if(u.setupLights(),D.isArrayCamera){let j=D.cameras;if(U.length>0)for(let ot=0,ft=j.length;ot0&&hl(z,U,x,D),Ht&&xt.render(x),cl(m,x,D);N!==null&&P===0&&(Ft.updateMultisampleRenderTarget(N),Ft.updateRenderTargetMipmap(N)),x.isScene===!0&&x.onAfterRender(S,x,D),at.resetDefaultState(),M=-1,v=null,E.pop(),E.length>0?(u=E[E.length-1],Xt===!0&&nt.setGlobalState(S.clippingPlanes,u.state.camera)):u=null,T.pop(),T.length>0?m=T[T.length-1]:m=null};function Da(x,D,B,z){if(x.visible===!1)return;if(x.layers.test(D.layers)){if(x.isGroup)B=x.renderOrder;else if(x.isLOD)x.autoUpdate===!0&&x.update(D);else if(x.isLight)u.pushLight(x),x.castShadow&&u.pushShadow(x);else if(x.isSprite){if(!x.frustumCulled||ne.intersectsSprite(x)){z&&It.setFromMatrixPosition(x.matrixWorld).applyMatrix4($);let ot=O.update(x),ft=x.material;ft.visible&&m.push(x,ot,ft,B,It.z,null)}}else if((x.isMesh||x.isLine||x.isPoints)&&(!x.frustumCulled||ne.intersectsObject(x))){let ot=O.update(x),ft=x.material;if(z&&(x.boundingSphere!==void 0?(x.boundingSphere===null&&x.computeBoundingSphere(),It.copy(x.boundingSphere.center)):(ot.boundingSphere===null&&ot.computeBoundingSphere(),It.copy(ot.boundingSphere.center)),It.applyMatrix4(x.matrixWorld).applyMatrix4($)),Array.isArray(ft)){let ht=ot.groups;for(let wt=0,Ct=ht.length;wt0&&Ns(U,D,B),j.length>0&&Ns(j,D,B),ot.length>0&&Ns(ot,D,B),mt.buffers.depth.setTest(!0),mt.buffers.depth.setMask(!0),mt.buffers.color.setMask(!0),mt.setPolygonOffset(!1)}function hl(x,D,B,z){if((B.isScene===!0?B.overrideMaterial:null)!==null)return;u.state.transmissionRenderTarget[z.id]===void 0&&(u.state.transmissionRenderTarget[z.id]=new cn(1,1,{generateMipmaps:!0,type:Lt.has("EXT_color_buffer_half_float")||Lt.has("EXT_color_buffer_float")?Vi:sn,minFilter:Wn,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Gt.workingColorSpace}));let j=u.state.transmissionRenderTarget[z.id],ot=z.viewport||C;j.setSize(ot.z*S.transmissionResolutionScale,ot.w*S.transmissionResolutionScale);let ft=S.getRenderTarget(),ht=S.getActiveCubeFace(),wt=S.getActiveMipmapLevel();S.setRenderTarget(j),S.getClearColor(H),q=S.getClearAlpha(),q<1&&S.setClearColor(16777215,.5),S.clear(),Ht&&xt.render(B);let Ct=S.toneMapping;S.toneMapping=wn;let bt=z.viewport;if(z.viewport!==void 0&&(z.viewport=void 0),u.setupLightsView(z),Xt===!0&&nt.setGlobalState(S.clippingPlanes,z),Ns(x,B,z),Ft.updateMultisampleRenderTarget(j),Ft.updateRenderTargetMipmap(j),Lt.has("WEBGL_multisampled_render_to_texture")===!1){let Vt=!1;for(let Jt=0,ce=D.length;Jt0),bt=!!B.morphAttributes.position,Vt=!!B.morphAttributes.normal,Jt=!!B.morphAttributes.color,ce=wn;z.toneMapped&&(N===null||N.isXRRenderTarget===!0)&&(ce=S.toneMapping);let te=B.morphAttributes.position||B.morphAttributes.normal||B.morphAttributes.color,Kt=te!==void 0?te.length:0,Tt=gt.get(z),re=u.state.lights;if(Xt===!0&&(Y===!0||x!==v)){let Ae=x===v&&z.id===M;nt.setState(z,x,Ae)}let Wt=!1;z.version===Tt.__version?(Tt.needsLights&&Tt.lightsStateVersion!==re.state.version||Tt.outputColorSpace!==ft||U.isBatchedMesh&&Tt.batching===!1||!U.isBatchedMesh&&Tt.batching===!0||U.isBatchedMesh&&Tt.batchingColor===!0&&U.colorTexture===null||U.isBatchedMesh&&Tt.batchingColor===!1&&U.colorTexture!==null||U.isInstancedMesh&&Tt.instancing===!1||!U.isInstancedMesh&&Tt.instancing===!0||U.isSkinnedMesh&&Tt.skinning===!1||!U.isSkinnedMesh&&Tt.skinning===!0||U.isInstancedMesh&&Tt.instancingColor===!0&&U.instanceColor===null||U.isInstancedMesh&&Tt.instancingColor===!1&&U.instanceColor!==null||U.isInstancedMesh&&Tt.instancingMorph===!0&&U.morphTexture===null||U.isInstancedMesh&&Tt.instancingMorph===!1&&U.morphTexture!==null||Tt.envMap!==ht||z.fog===!0&&Tt.fog!==j||Tt.numClippingPlanes!==void 0&&(Tt.numClippingPlanes!==nt.numPlanes||Tt.numIntersection!==nt.numIntersection)||Tt.vertexAlphas!==wt||Tt.vertexTangents!==Ct||Tt.morphTargets!==bt||Tt.morphNormals!==Vt||Tt.morphColors!==Jt||Tt.toneMapping!==ce||Tt.morphTargetsCount!==Kt)&&(Wt=!0):(Wt=!0,Tt.__version=z.version);let Ne=Tt.currentProgram;Wt===!0&&(Ne=Fs(z,D,U));let gi=!1,Fe=!1,Ki=!1,ae=Ne.getUniforms(),Ge=Tt.uniforms;if(mt.useProgram(Ne.program)&&(gi=!0,Fe=!0,Ki=!0),z.id!==M&&(M=z.id,Fe=!0),gi||v!==x){mt.buffers.depth.getReversed()&&x.reversedDepth!==!0&&(x._reversedDepth=!0,x.updateProjectionMatrix()),ae.setValue(w,"projectionMatrix",x.projectionMatrix),ae.setValue(w,"viewMatrix",x.matrixWorldInverse);let Le=ae.map.cameraPosition;Le!==void 0&&Le.setValue(w,dt.setFromMatrixPosition(x.matrixWorld)),Rt.logarithmicDepthBuffer&&ae.setValue(w,"logDepthBufFC",2/(Math.log(x.far+1)/Math.LN2)),(z.isMeshPhongMaterial||z.isMeshToonMaterial||z.isMeshLambertMaterial||z.isMeshBasicMaterial||z.isMeshStandardMaterial||z.isShaderMaterial)&&ae.setValue(w,"isOrthographic",x.isOrthographicCamera===!0),v!==x&&(v=x,Fe=!0,Ki=!0)}if(U.isSkinnedMesh){ae.setOptional(w,U,"bindMatrix"),ae.setOptional(w,U,"bindMatrixInverse");let Ae=U.skeleton;Ae&&(Ae.boneTexture===null&&Ae.computeBoneTexture(),ae.setValue(w,"boneTexture",Ae.boneTexture,Ft))}U.isBatchedMesh&&(ae.setOptional(w,U,"batchingTexture"),ae.setValue(w,"batchingTexture",U._matricesTexture,Ft),ae.setOptional(w,U,"batchingIdTexture"),ae.setValue(w,"batchingIdTexture",U._indirectTexture,Ft),ae.setOptional(w,U,"batchingColorTexture"),U._colorsTexture!==null&&ae.setValue(w,"batchingColorTexture",U._colorsTexture,Ft));let We=B.morphAttributes;if((We.position!==void 0||We.normal!==void 0||We.color!==void 0)&&Q.update(U,B,Ne),(Fe||Tt.receiveShadow!==U.receiveShadow)&&(Tt.receiveShadow=U.receiveShadow,ae.setValue(w,"receiveShadow",U.receiveShadow)),z.isMeshGouraudMaterial&&z.envMap!==null&&(Ge.envMap.value=ht,Ge.flipEnvMap.value=ht.isCubeTexture&&ht.isRenderTargetTexture===!1?-1:1),z.isMeshStandardMaterial&&z.envMap===null&&D.environment!==null&&(Ge.envMapIntensity.value=D.environmentIntensity),Fe&&(ae.setValue(w,"toneMappingExposure",S.toneMappingExposure),Tt.needsLights&&ph(Ge,Ki),j&&z.fog===!0&&J.refreshFogUniforms(Ge,j),J.refreshMaterialUniforms(Ge,z,V,et,u.state.transmissionRenderTarget[x.id]),Yi.upload(w,dl(Tt),Ge,Ft)),z.isShaderMaterial&&z.uniformsNeedUpdate===!0&&(Yi.upload(w,dl(Tt),Ge,Ft),z.uniformsNeedUpdate=!1),z.isSpriteMaterial&&ae.setValue(w,"center",U.center),ae.setValue(w,"modelViewMatrix",U.modelViewMatrix),ae.setValue(w,"normalMatrix",U.normalMatrix),ae.setValue(w,"modelMatrix",U.matrixWorld),z.isShaderMaterial||z.isRawShaderMaterial){let Ae=z.uniformsGroups;for(let Le=0,La=Ae.length;Le0&&Ft.useMultisampledRTT(x)===!1?U=gt.get(x).__webglMultisampledFramebuffer:Array.isArray(Ct)?U=Ct[B]:U=Ct,C.copy(x.viewport),F.copy(x.scissor),k=x.scissorTest}else C.copy(St).multiplyScalar(V).floor(),F.copy(kt).multiplyScalar(V).floor(),k=jt;if(B!==0&&(U=gh),mt.bindFramebuffer(w.FRAMEBUFFER,U)&&z&&mt.drawBuffers(x,U),mt.viewport(C),mt.scissor(F),mt.setScissorTest(k),j){let ht=gt.get(x.texture);w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_CUBE_MAP_POSITIVE_X+D,ht.__webglTexture,B)}else if(ot){let ht=D;for(let wt=0;wt=0&&D<=x.width-z&&B>=0&&B<=x.height-U&&(x.textures.length>1&&w.readBuffer(w.COLOR_ATTACHMENT0+ft),w.readPixels(D,B,z,U,yt.convert(Ct),yt.convert(bt),j))}finally{let wt=N!==null?gt.get(N).__webglFramebuffer:null;mt.bindFramebuffer(w.FRAMEBUFFER,wt)}}},this.readRenderTargetPixelsAsync=async function(x,D,B,z,U,j,ot,ft=0){if(!(x&&x.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let ht=gt.get(x).__webglFramebuffer;if(x.isWebGLCubeRenderTarget&&ot!==void 0&&(ht=ht[ot]),ht)if(D>=0&&D<=x.width-z&&B>=0&&B<=x.height-U){mt.bindFramebuffer(w.FRAMEBUFFER,ht);let wt=x.textures[ft],Ct=wt.format,bt=wt.type;if(!Rt.textureFormatReadable(Ct))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Rt.textureTypeReadable(bt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");let Vt=w.createBuffer();w.bindBuffer(w.PIXEL_PACK_BUFFER,Vt),w.bufferData(w.PIXEL_PACK_BUFFER,j.byteLength,w.STREAM_READ),x.textures.length>1&&w.readBuffer(w.COLOR_ATTACHMENT0+ft),w.readPixels(D,B,z,U,yt.convert(Ct),yt.convert(bt),0);let Jt=N!==null?gt.get(N).__webglFramebuffer:null;mt.bindFramebuffer(w.FRAMEBUFFER,Jt);let ce=w.fenceSync(w.SYNC_GPU_COMMANDS_COMPLETE,0);return w.flush(),await Tc(w,ce,4),w.bindBuffer(w.PIXEL_PACK_BUFFER,Vt),w.getBufferSubData(w.PIXEL_PACK_BUFFER,0,j),w.deleteBuffer(Vt),w.deleteSync(ce),j}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(x,D=null,B=0){let z=Math.pow(2,-B),U=Math.floor(x.image.width*z),j=Math.floor(x.image.height*z),ot=D!==null?D.x:0,ft=D!==null?D.y:0;Ft.setTexture2D(x,0),w.copyTexSubImage2D(w.TEXTURE_2D,B,0,0,ot,ft,U,j),mt.unbindTexture()};let _h=w.createFramebuffer(),xh=w.createFramebuffer();this.copyTextureToTexture=function(x,D,B=null,z=null,U=0,j=null){j===null&&(U!==0?(Li("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),j=U,U=0):j=0);let ot,ft,ht,wt,Ct,bt,Vt,Jt,ce,te=x.isCompressedTexture?x.mipmaps[j]:x.image;if(B!==null)ot=B.max.x-B.min.x,ft=B.max.y-B.min.y,ht=B.isBox3?B.max.z-B.min.z:1,wt=B.min.x,Ct=B.min.y,bt=B.isBox3?B.min.z:0;else{let We=Math.pow(2,-U);ot=Math.floor(te.width*We),ft=Math.floor(te.height*We),x.isDataArrayTexture?ht=te.depth:x.isData3DTexture?ht=Math.floor(te.depth*We):ht=1,wt=0,Ct=0,bt=0}z!==null?(Vt=z.x,Jt=z.y,ce=z.z):(Vt=0,Jt=0,ce=0);let Kt=yt.convert(D.format),Tt=yt.convert(D.type),re;D.isData3DTexture?(Ft.setTexture3D(D,0),re=w.TEXTURE_3D):D.isDataArrayTexture||D.isCompressedArrayTexture?(Ft.setTexture2DArray(D,0),re=w.TEXTURE_2D_ARRAY):(Ft.setTexture2D(D,0),re=w.TEXTURE_2D),w.pixelStorei(w.UNPACK_FLIP_Y_WEBGL,D.flipY),w.pixelStorei(w.UNPACK_PREMULTIPLY_ALPHA_WEBGL,D.premultiplyAlpha),w.pixelStorei(w.UNPACK_ALIGNMENT,D.unpackAlignment);let Wt=w.getParameter(w.UNPACK_ROW_LENGTH),Ne=w.getParameter(w.UNPACK_IMAGE_HEIGHT),gi=w.getParameter(w.UNPACK_SKIP_PIXELS),Fe=w.getParameter(w.UNPACK_SKIP_ROWS),Ki=w.getParameter(w.UNPACK_SKIP_IMAGES);w.pixelStorei(w.UNPACK_ROW_LENGTH,te.width),w.pixelStorei(w.UNPACK_IMAGE_HEIGHT,te.height),w.pixelStorei(w.UNPACK_SKIP_PIXELS,wt),w.pixelStorei(w.UNPACK_SKIP_ROWS,Ct),w.pixelStorei(w.UNPACK_SKIP_IMAGES,bt);let ae=x.isDataArrayTexture||x.isData3DTexture,Ge=D.isDataArrayTexture||D.isData3DTexture;if(x.isDepthTexture){let We=gt.get(x),Ae=gt.get(D),Le=gt.get(We.__renderTarget),La=gt.get(Ae.__renderTarget);mt.bindFramebuffer(w.READ_FRAMEBUFFER,Le.__webglFramebuffer),mt.bindFramebuffer(w.DRAW_FRAMEBUFFER,La.__webglFramebuffer);for(let $n=0;$nMath.PI&&(n-=Ue),s<-Math.PI?s+=Ue:s>Math.PI&&(s-=Ue),n<=s?this._spherical.theta=Math.max(n,Math.min(s,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+s)/2?Math.max(n,this._spherical.theta):Math.min(s,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{let a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=a!=this._spherical.radius}if(me.setFromSpherical(this._spherical),me.applyQuaternion(this._quatInverse),e.copy(this.target).add(me),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){let o=me.length();a=this._clampDistance(o*this._scale);let c=o-a;this.object.position.addScaledVector(this._dollyDirection,c),this.object.updateMatrixWorld(),r=!!c}else if(this.object.isOrthographicCamera){let o=new L(this._mouse.x,this._mouse.y,0);o.unproject(this.object);let c=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=c!==this.object.zoom;let l=new L(this._mouse.x,this._mouse.y,0);l.unproject(this.object),this.object.position.sub(l).add(o),this.object.updateMatrixWorld(),a=me.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(Aa.origin.copy(this.object.position),Aa.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Aa.direction))jo||8*(1-this._lastQuaternion.dot(this.object.quaternion))>jo||this._lastTargetPosition.distanceToSquared(this.target)>jo?(this.dispatchEvent(ih),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?Ue/60*this.autoRotateSpeed*t:Ue/60/60*this.autoRotateSpeed}_getZoomScale(t){let e=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){me.setFromMatrixColumn(e,0),me.multiplyScalar(-t),this._panOffset.add(me)}_panUp(t,e){this.screenSpacePanning===!0?me.setFromMatrixColumn(e,1):(me.setFromMatrixColumn(e,0),me.crossVectors(this.object.up,me)),me.multiplyScalar(t),this._panOffset.add(me)}_pan(t,e){let n=this.domElement;if(this.object.isPerspectiveCamera){let s=this.object.position;me.copy(s).sub(this.target);let r=me.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*r/n.clientHeight,this.object.matrix),this._panUp(2*e*r/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;let n=this.domElement.getBoundingClientRect(),s=t-n.left,r=e-n.top,a=n.width,o=n.height;this._mouse.x=s/a*2-1,this._mouse.y=-(r/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let e=this.domElement;this._rotateLeft(Ue*this._rotateDelta.x/e.clientHeight),this._rotateUp(Ue*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(Ue*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-Ue*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(Ue*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-Ue*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{let e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._rotateStart.set(n,s)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{let e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panStart.set(n,s)}}_handleTouchStartDolly(t){let e=this._getSecondPointerPosition(t),n=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(n*n+s*s);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{let n=this._getSecondPointerPosition(t),s=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._rotateEnd.set(s,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let e=this.domElement;this._rotateLeft(Ue*this._rotateDelta.x/e.clientHeight),this._rotateUp(Ue*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{let e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panEnd.set(n,s)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){let e=this._getSecondPointerPosition(t),n=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(n*n+s*s);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);let a=(t.pageX+e.x)*.5,o=(t.pageY+e.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;edocument.getElementById(i),ah=64*1024*1024,Zt=(i,t)=>{if(!i)throw new Error(t)},ye,ge,Ca,Rn,qn,Yn,mi,He,rn,Ji,Ia=[],al=[],an=!1,ol=0,$i=100,el=!1,ng=0,nl=new L,oh=new L,hh=2;function ig(i){return Zt(typeof i=="string"&&/^[a-zA-Z0-9_.-]+(?:\/[a-zA-Z0-9_.-]+)*$/.test(i)&&!i.split("/").some(t=>t==="."||t===".."),"Invalid local asset path."),i}async function il(i,t){Zt(i,"Missing response body.");let e=i.getReader(),n=[],s=0;try{for(;;){let{done:o,value:c}=await e.read();if(o)break;if(s+=c.byteLength,s>t)throw await e.cancel(),new Error("Asset exceeds byte limit.");n.push(c)}}finally{e.releaseLock()}let r=new Uint8Array(s),a=0;for(let o of n)r.set(o,a),a+=o.length;return r.buffer}async function uh(i){let t=new URL(ig(i),location.href);Zt(t.origin===location.origin,"Unexpected asset origin.");let e=location.protocol==="https:"&&location.host==="dvidia-robot-simulation-lab.static.hf.space",n=await fetch(t,{credentials:"omit",referrerPolicy:"no-referrer",redirect:e?"follow":"error"}),s=new URL(n.url);return Zt(!s.username&&!s.password&&(s.origin===location.origin||e&&s.protocol==="https:"&&s.host==="us.aws.cdn.hf.co"),"Unexpected asset redirect."),Zt(n.ok,"Could not load "+i+" (HTTP "+n.status+")."),n}async function sg(i){return JSON.parse(new TextDecoder().decode(await il((await uh(i)).body,4*1024*1024)))}async function lh(i,t){Zt(i.href===t&&i.compression==="gzip"&&Number.isInteger(i.bytes)&&i.bytes>=0&&i.bytes<=ah&&Number.isInteger(i.compressed_bytes)&&i.compressed_bytes>=0&&i.compressed_bytes<=ah,"Invalid binary layout."),Zt(typeof DecompressionStream=="function","This browser needs DecompressionStream support.");let e=await il((await uh(t)).body,i.compressed_bytes);Zt(e.byteLength===i.compressed_bytes,"Compressed asset length mismatch.");let n=await il(new Blob([e]).stream().pipeThrough(new DecompressionStream("gzip")),i.bytes);if(Zt(n.byteLength===i.bytes,"Decoded asset length mismatch."),globalThis.crypto?.subtle){let s=[...new Uint8Array(await crypto.subtle.digest("SHA-256",n))].map(r=>r.toString(16).padStart(2,"0")).join("");Zt(s===i.sha256,"Decoded asset digest mismatch.")}return n}function rg(i,t){Zt(Array.isArray(i)&&i.length===t&&i.every(Number.isFinite),"Invalid native vector.")}function ag(i,t){Zt(ye.schema==="dvidia.asset-preview-model/v1"&&ge.schema==="dvidia.asset-preview-motion/v1"&&Rn.schema==="dvidia.asset-scene/v1"&&Ca.schema==="dvidia.asset-catalog/v1","Unsupported asset preview."),Zt(Number.isInteger(ge.body_count)&&ge.body_count>0&&ge.body_count<=128&&ye.bodies.length===ge.body_count&&ge.frame_count===101&&ge.frame_stride_floats===ge.body_count*7&&t.byteLength===101*ge.body_count*28,"Invalid body pose layout."),ye.bodies.forEach((r,a)=>Zt(r.id===a&&typeof r.name=="string","Invalid native body identity.")),Zt(Array.isArray(ye.meshes)&&ye.meshes.length<=128&&Array.isArray(ye.geoms)&&ye.geoms.length<=512,"Invalid native geometry inventory.");let e=new Set,n=new DataView(i);for(let r of ye.meshes){Zt(Number.isInteger(r.id)&&!e.has(r.id),"Invalid mesh identity."),e.add(r.id);let{vertex_count:a,index_count:o,position_byte_offset:c,index_byte_offset:l}=r;Zt([a,o,c,l].every(Number.isInteger)&&a>0&&o>=0&&o%3===0&&c>=0&&l>=0&&c%4===0&&l%4===0&&c+a*12<=i.byteLength&&l+o*4<=i.byteLength,"Invalid native mesh range.");for(let h=0;h=0&&r.body_ids.getFloat32(r+c*4,!0));Zt(a.every(Number.isFinite)&&Math.abs(Math.hypot(...a.slice(3))-1)<.001,"Invalid native body pose.")}Zt(Array.isArray(ge.rows)&&ge.rows.length===101,"Invalid recorded frames."),ge.rows.forEach((r,a)=>Zt(Number.isFinite(r.t_seconds)&&Math.abs(r.t_seconds-a*.02)<1e-8&&Number.isInteger(r.contact_count)&&r.contact_count>=0,"Invalid frame timestamp."))}function ch(i,t){t.set(i[1],i[2],i[3],i[0])}function og(i,t){switch(i.type){case"mesh":return t.get(i.mesh_id);case"box":return new Bn(...i.size.map(e=>e*2));case"sphere":return new Oi(i.size[0],24,16);case"ellipsoid":{let e=new Oi(1,32,20);return e.scale(...i.size),e}case"capsule":{let e=new vs(i.size[0],2*i.size[1],6,20);return e.rotateX(Math.PI/2),e}case"cylinder":{let e=new Ms(i.size[0],i.size[0],i.size[1]*2,28);return e.rotateX(Math.PI/2),e}case"plane":return new ai(Math.max(4,i.size[0]*2),Math.max(4,i.size[1]*2))}}function Zn(){!el&&Yn&&(el=!0,requestAnimationFrame(lg))}function Pa(i){Zt(Number.isInteger(i)&&i>=0&&i{let s=(i*Ji.length+n)*28;e.position.set(qn.getFloat32(s,!0),qn.getFloat32(s+4,!0),qn.getFloat32(s+8,!0)),e.quaternion.set(qn.getFloat32(s+16,!0),qn.getFloat32(s+20,!0),qn.getFloat32(s+24,!0),qn.getFloat32(s+12,!0))}),Et("clock").textContent=t.t_seconds.toFixed(2)+" / 2.00 s",Et("contacts").textContent=String(t.contact_count),Et("status").textContent="Recorded frame "+(i+1)+"/101 · Native physics step 2 ms · "+Ji.length+" body poses · Browser physics: none.",Zn()}function lg(i){if(el=!1,an){let t=Math.min(ge.frame_count-1,Math.max($i,0,Math.floor((i-ol)/20)));t!==$i&&Pa(t),t===ge.frame_count-1&&(an=!1,Et("play").textContent="Play settling",Et("play").setAttribute("aria-pressed","false"))}Yn.render(mi,He),Et("canvas").dataset.renderCount=String(++ng),an&&Zn()}function sl(i){let t=Math.max(1,1/He.aspect),e=hh*t,n={home:[1.35,-1.75,1.15],top:[0,0,2.3],front:[0,-2.3,.3]};He.position.copy(nl).add(new L(...n[i]).multiplyScalar(e)),rn.target.copy(nl),rn.update(),Zn()}function cg(i){Zt(Et("canvas").getContext("webgl2"),"WebGL2 is unavailable."),Yn=new Ta({canvas:Et("canvas"),antialias:!0,alpha:!0,powerPreference:"low-power"}),Yn.setPixelRatio(Math.min(devicePixelRatio||1,2)),Yn.outputColorSpace=Ce,Yn.toneMapping=Or,Yn.toneMappingExposure=1.25,mi=new gs,He=new Ee(38,1,.005,30),He.up.set(0,0,1),rn=new Ra(He,Et("canvas")),rn.minDistance=.2,rn.maxDistance=10,rn.addEventListener("change",Zn),mi.add(new Es(16120831,12634548,2.6));let t=new zi(16777215,3);t.position.set(2,-2,4),mi.add(t);let e=new zi(14543359,.9);e.position.set(-2,2,2),mi.add(e);let n=new ws(4,40,11057053,13752777);n.rotation.x=Math.PI/2,n.position.z=5e-4,n.material.transparent=!0,n.material.opacity=.35,mi.add(n),Ji=ye.bodies.map(()=>{let o=new vn;return mi.add(o),o});let s=new Map,r=new DataView(i);for(let o of ye.meshes){let c=new Float32Array(o.vertex_count*3),l=new Uint32Array(o.index_count);for(let d=0;d0&&o.group<=2){let h=new Pe(c,new Bi({color:new Ot().setRGB(...l.slice(0,3),bn),metalness:o.type==="mesh"?.16:0,roughness:.6,transparent:l[3]<1,opacity:l[3],side:Ve}));h.position.fromArray(o.position),ch(o.quaternion_wxyz,h.quaternion),h.userData.body=o.body_id,h.userData.plane=o.type==="plane",Ji[o.body_id].add(h),Ia.push(h)}if(o.collision){let h=new Pe(c,new Bi({color:11891781,transparent:!0,opacity:.52,roughness:.8,depthWrite:!1,side:Ve}));h.position.fromArray(o.position),ch(o.quaternion_wxyz,h.quaternion),h.visible=!1,h.userData.body=o.body_id,Ji[o.body_id].add(h),al.push(h)}}Pa(100);let a=new hn;for(let o of Ia)o.userData.plane||(o.updateWorldMatrix(!0,!1),a.expandByObject(o));a.getCenter(nl),a.getSize(oh),hh=Math.max(.55,oh.length()*.59),new ResizeObserver(()=>{let o=Et("stage").getBoundingClientRect(),c=He.aspect;He.aspect=o.width/o.height,He.position.sub(rn.target).multiplyScalar(Math.max(1,1/He.aspect)/Math.max(1,1/c)).add(rn.target),He.updateProjectionMatrix(),Yn.setSize(o.width,o.height,!1),Zn()}).observe(Et("stage")),sl("home"),Et("canvas").addEventListener("webglcontextlost",o=>{o.preventDefault(),dh(new Error("WebGL context was lost. Reload to reopen the preview."))})}function rl(){let i=Et("pair").value,t=i==="all"?Rn.shoe_ids:Rn.shoe_ids.filter(r=>r===i+"-left"||r===i+"-right"),e=new Set(t.map(r=>"shoe_"+r.replaceAll("-","_"))),n=Et("collision").getAttribute("aria-pressed")==="true";for(let r of Ia)r.visible=!n&&(!ye.bodies[r.userData.body].name.startsWith("shoe_")||e.has(ye.bodies[r.userData.body].name));for(let r of al)r.visible=n&&(!ye.bodies[r.userData.body].name.startsWith("shoe_")||e.has(ye.bodies[r.userData.body].name));let s=Ca.shoes.find(r=>t.includes(r.id));Et("family").textContent=i==="all"?t.length+" instances":s.family.replaceAll("-"," "),Et("dimensions").textContent=i==="all"?"Varies by family":s.properties.dimensions_m.value.map(r=>r.toFixed(3)).join(" × "),Et("mass").textContent=i==="all"?"Varies by family":String(s.properties.mass_kg.value),Et("descriptor").href=i==="all"?"scene.json":"scenes/"+i+".json",Et("descriptor").download=Rn.robot+"-"+i+".scene.json",Et("command").textContent="dvidia-assets scene --robot "+Rn.robot+" --assets ./robot-assets --pair "+i+` --output ./shoe-scene +python -m http.server 8000 --directory ./shoe-scene`,Et("stage").dataset.selectedShoes=String(t.length),Zn()}function tl(){an=!an,Et("play").textContent=an?"Pause settling":"Play settling",Et("play").setAttribute("aria-pressed",String(an)),an&&($i===100&&Pa(0),ol=performance.now()-$i*20,Zn())}function hg(){document.querySelectorAll("[data-camera]").forEach(i=>i.addEventListener("click",()=>sl(i.dataset.camera))),Et("pair").addEventListener("change",rl),Et("play").addEventListener("click",tl),Et("timeline").addEventListener("input",()=>{Pa(Number(Et("timeline").value)),an&&(ol=performance.now()-$i*20)}),Et("collision").addEventListener("click",()=>{let i=Et("collision").getAttribute("aria-pressed")!=="true";Et("collision").setAttribute("aria-pressed",String(i)),Et("mode-label").textContent=i?"Native collision shapes":"Visual geometry",rl()}),Et("copy").addEventListener("click",async()=>{try{Zt(navigator.clipboard,"Clipboard unavailable; select the command text instead."),await navigator.clipboard.writeText(Et("command").textContent),Et("copy").textContent="Copied"}catch{let i=document.createRange();i.selectNodeContents(Et("command"));let t=window.getSelection();t.removeAllRanges(),t.addRange(i),Et("copy").textContent="Command selected"}}),Et("canvas").addEventListener("keydown",i=>{let t=i.key;if(["h","H","Home"].includes(t)){i.preventDefault(),sl("home");return}if(t===" "){i.preventDefault(),tl();return}if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","+","=","-","_"].includes(t))return;i.preventDefault();let e=He.position.clone().sub(rn.target),n=new Vn().setFromVector3(e.applyAxisAngle(new L(1,0,0),-Math.PI/2));t==="ArrowLeft"&&(n.theta-=.1),t==="ArrowRight"&&(n.theta+=.1),t==="ArrowUp"&&(n.phi=Math.max(.01,n.phi-.1)),t==="ArrowDown"&&(n.phi=Math.min(Math.PI-.01,n.phi+.1)),["+","="].includes(t)&&(n.radius=Math.max(.2,n.radius*.9)),["-","_"].includes(t)&&(n.radius=Math.min(10,n.radius/.9)),e.setFromSpherical(n).applyAxisAngle(new L(1,0,0),Math.PI/2),He.position.copy(rn.target).add(e),rn.update(),Zn()}),document.addEventListener("visibilitychange",()=>{document.hidden&&an&&tl()})}function dh(i){an=!1,Et("loading").hidden=!1,Et("loading").textContent="The 3D preview could not open. "+i.message+" Serve all exported files together over HTTP. The scene descriptor and catalog remain downloadable.",Et("stage").dataset.ready="error",document.querySelectorAll("button,select,input").forEach(t=>t.disabled=!0)}async function ug(){Zt(location.protocol!=="file:","Start a local HTTP server to open the exported files."),[ye,ge,Ca,Rn]=await Promise.all(["model.json","motion.json","catalog.json","scene.json"].map(sg));let[i,t]=await Promise.all([lh(ye.geometry_binary,"geometry.bin.gz"),lh(ge.motion_binary,"motion.bin.gz")]);ag(i,t),qn=new DataView(t),cg(i);let e=Ca.robots.find(s=>s.id===Rn.robot);Zt(e,"Robot missing from catalog."),Et("robot-name").textContent=e.name,Et("axes").textContent=e.arm_axes+" arm axes + "+e.gripper_command_axes+" gripper command",Et("subtitle").textContent=e.name+" · Pinned native geometry, synthetic shoe assets and a portable scene descriptor.";for(let s of[...Et("pair").options])s.value!=="all"&&!Rn.shoe_ids.some(r=>r===s.value+"-left"||r===s.value+"-right")&&s.remove();Rn.shoe_ids.length!==6&&(Et("pair").options[0].textContent="All loaded shoes");let n=new URLSearchParams(location.search).get("pair");[...Et("pair").options].some(s=>s.value===n)&&(Et("pair").value=n),hg(),rl(),document.querySelectorAll("button,select,input").forEach(s=>s.disabled=!1),Et("loading").hidden=!0,Et("stage").dataset.ready="true",Et("stage").dataset.visualGeoms=String(Ia.length),Et("stage").dataset.collisionGeoms=String(al.length),/\/previews\/(ur5e|piper|so101)\/(?:index\.html)?$/.test(location.pathname)&&(Et("robot-links").hidden=!1)}ug().catch(dh);})(); diff --git a/asset-library/v01/previews/so101/catalog.json b/asset-library/v01/previews/so101/catalog.json new file mode 100644 index 0000000000000000000000000000000000000000..f3ea25306b566c6f084f7acef8f46e36d6e4506f --- /dev/null +++ b/asset-library/v01/previews/so101/catalog.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-catalog/v1","version":"0.1.0","license":"MIT","license_scope":"Original DVIDIA catalog and procedural shoes only; robot simulation assets retain their individual licenses.","scope":"Reusable native scene assets with synthetic rigid shoes. Scene loading and gravity/contact checks do not demonstrate shoe manipulation, learning or physical robot transfer.","units":{"length":"m","mass":"kg","time":"s","angle":"rad","quaternion":"wxyz"},"world_frame":"right-handed; robot base reference at world origin, +z up","robots":[{"id":"ur5e","name":"UR5e + Robotiq 2F-85","version":"0.1.0","immutable_id":"dvidia/robots/ur5e-2f85@0.1.0","arm_axes":6,"gripper_command_axes":1,"gripper_mechanical_joints":8,"native_command_units":["rad","rad","rad","rad","rad","rad","native_0_255"],"gripper_command":"Native coupled gripper servo input [0,255]; not a measured gap or calibrated force.","licenses":{"universal_robots_ur5e":"BSD-3-Clause","robotiq_2f85":"BSD-2-Clause"},"source":{"repository":"https://github.com/google-deepmind/mujoco_menagerie","commit":"0059d4335f8156206f63a35662313385f7ad6d74","verification":"Packaged SHA256 allowlist; assets are read from verified bytes, without network access.","model_urls":["https://github.com/google-deepmind/mujoco_menagerie/tree/0059d4335f8156206f63a35662313385f7ad6d74/universal_robots_ur5e","https://github.com/google-deepmind/mujoco_menagerie/tree/0059d4335f8156206f63a35662313385f7ad6d74/robotiq_2f85"],"home_scope":"Authored scene initialization: UR5e and PiPER use the upstream home arm pose, zero gripper coordinates; SO101 uses its zero reference pose."},"home_joint_positions":{"shoulder_pan_joint":-1.5708,"shoulder_lift_joint":-1.5708,"elbow_joint":1.5708,"wrist_1_joint":-1.5708,"wrist_2_joint":-1.5708,"wrist_3_joint":0},"expected_dimensions":{"nq":14,"nv":14,"nu":7,"neq":3},"compatibility":{"scene_loading":true,"shoe_grasp_qualified":false,"physical_robot_ready":false,"scope":"Pinned native arm and gripper can share a rigid-shoe scene. This does not establish reachability, graspability, a shoe manipulation skill, or hardware compatibility."},"openness_scope":"These licenses cover pinned simulation assets; SDK and physical hardware design licenses are separate."},{"id":"piper","name":"AgileX PiPER","version":"0.1.0","immutable_id":"dvidia/robots/piper@0.1.0","arm_axes":6,"gripper_command_axes":1,"gripper_mechanical_joints":2,"native_command_units":["rad","rad","rad","rad","rad","rad","m"],"gripper_command":"single-finger slide target in metres, native range [0,0.035]; not total jaw gap","licenses":{"agilex_piper":"MIT"},"source":{"repository":"https://github.com/google-deepmind/mujoco_menagerie","commit":"0059d4335f8156206f63a35662313385f7ad6d74","verification":"Packaged SHA256 allowlist; assets are read from verified bytes, without network access.","model_urls":["https://github.com/google-deepmind/mujoco_menagerie/tree/0059d4335f8156206f63a35662313385f7ad6d74/agilex_piper"],"home_scope":"Authored scene initialization: UR5e and PiPER use the upstream home arm pose, zero gripper coordinates; SO101 uses its zero reference pose."},"home_joint_positions":{"joint1":0,"joint2":1.57,"joint3":-1.3485,"joint4":0,"joint5":0,"joint6":0,"joint7":0,"joint8":0},"expected_dimensions":{"nq":8,"nv":8,"nu":7,"neq":1},"compatibility":{"scene_loading":true,"shoe_grasp_qualified":false,"physical_robot_ready":false,"scope":"Pinned native arm and gripper can share a rigid-shoe scene. This does not establish reachability, graspability, a shoe manipulation skill, or hardware compatibility."},"openness_scope":"These licenses cover pinned simulation assets; SDK and physical hardware design licenses are separate."},{"id":"so101","name":"The Robot Studio SO101","version":"0.1.0","immutable_id":"dvidia/robots/so101@0.1.0","arm_axes":5,"gripper_command_axes":1,"gripper_mechanical_joints":1,"native_command_units":["rad","rad","rad","rad","rad","rad"],"gripper_command":"moving-jaw hinge angle target in radians; not linear jaw gap","licenses":{"robotstudio_so101":"Apache-2.0"},"source":{"repository":"https://github.com/google-deepmind/mujoco_menagerie","commit":"0059d4335f8156206f63a35662313385f7ad6d74","verification":"Packaged SHA256 allowlist; assets are read from verified bytes, without network access.","model_urls":["https://github.com/google-deepmind/mujoco_menagerie/tree/0059d4335f8156206f63a35662313385f7ad6d74/robotstudio_so101"],"home_scope":"Authored scene initialization: UR5e and PiPER use the upstream home arm pose, zero gripper coordinates; SO101 uses its zero reference pose."},"home_joint_positions":{"shoulder_pan":0,"shoulder_lift":0,"elbow_flex":0,"wrist_flex":0,"wrist_roll":0,"gripper":0},"expected_dimensions":{"nq":6,"nv":6,"nu":6,"neq":0},"compatibility":{"scene_loading":true,"shoe_grasp_qualified":false,"physical_robot_ready":false,"scope":"Pinned native arm and gripper can share a rigid-shoe scene. This does not establish reachability, graspability, a shoe manipulation skill, or hardware compatibility."},"openness_scope":"These licenses cover pinned simulation assets; SDK and physical hardware design licenses are separate."}],"shoes":[{"id":"trainer-left","name":"Trainer / left","version":"0.1.0","immutable_id":"dvidia/shoes/trainer-left@0.1.0","family":"trainer","pair_id":"dvidia/shoes/trainer-pair@0.1.0","side":"left","license":"MIT","source":{"kind":"original_procedural","author":"DVIDIA","scope":"New primitive geometry; no redistributed scans, videos, photographs or model weights."},"properties":{"dimensions_m":{"value":[0.28,0.1,0.087],"units":"m; length x, width y, maximum height z","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_kg":{"value":0.3,"units":"kg","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"sliding_friction":{"value":0.8,"units":"dimensionless","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"torsional_friction":{"value":0.005,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"rolling_friction":{"value":0.0001,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_distribution":{"value":"Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.","units":"model assumption","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"deformation":{"value":"Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.","units":"model class","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"contact_solver":{"value":{"condim":4,"priority":1,"solref":[0.02,1],"solimp":[0.9,0.95,0.001,0.5,2]},"units":"MuJoCo solver parameters; no calibrated stiffness or damping","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."}},"frame":{"origin":"sole bottom center","axes":"right-handed; +x toward toe, +y lateral, +z up","sole_bottom_z_m":0,"initial_bottom_z_m":0.08},"geometry":[{"name":"sole","type":"box","size_m":[0.14,0.05,0.01],"position_m":[0,0,0.01],"mass_fraction":0.35,"rgba":[0.16,0.17,0.18,1]},{"name":"upper","type":"ellipsoid","size_m":[0.122,0.047,0.035],"position_m":[-0.005,0.003,0.052],"mass_fraction":0.55,"rgba":[0.2,0.38,0.58,1]},{"name":"toe","type":"ellipsoid","size_m":[0.04,0.047,0.026],"position_m":[0.095,0.003,0.045],"mass_fraction":0.1,"rgba":[0.78,0.82,0.83,1]}],"fidelity":{"geometry":"authored coarse proxy","native_contact":"available for numerical testing","measured_contact":"untested","deformation":"unsupported","shoe_grasp_qualified":false,"physical_robot_ready":false}},{"id":"trainer-right","name":"Trainer / right","version":"0.1.0","immutable_id":"dvidia/shoes/trainer-right@0.1.0","family":"trainer","pair_id":"dvidia/shoes/trainer-pair@0.1.0","side":"right","license":"MIT","source":{"kind":"original_procedural","author":"DVIDIA","scope":"New primitive geometry; no redistributed scans, videos, photographs or model weights."},"properties":{"dimensions_m":{"value":[0.28,0.1,0.087],"units":"m; length x, width y, maximum height z","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_kg":{"value":0.3,"units":"kg","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"sliding_friction":{"value":0.8,"units":"dimensionless","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"torsional_friction":{"value":0.005,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"rolling_friction":{"value":0.0001,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_distribution":{"value":"Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.","units":"model assumption","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"deformation":{"value":"Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.","units":"model class","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"contact_solver":{"value":{"condim":4,"priority":1,"solref":[0.02,1],"solimp":[0.9,0.95,0.001,0.5,2]},"units":"MuJoCo solver parameters; no calibrated stiffness or damping","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."}},"frame":{"origin":"sole bottom center","axes":"right-handed; +x toward toe, +y lateral, +z up","sole_bottom_z_m":0,"initial_bottom_z_m":0.08},"geometry":[{"name":"sole","type":"box","size_m":[0.14,0.05,0.01],"position_m":[0,0,0.01],"mass_fraction":0.35,"rgba":[0.16,0.17,0.18,1]},{"name":"upper","type":"ellipsoid","size_m":[0.122,0.047,0.035],"position_m":[-0.005,-0.003,0.052],"mass_fraction":0.55,"rgba":[0.2,0.38,0.58,1]},{"name":"toe","type":"ellipsoid","size_m":[0.04,0.047,0.026],"position_m":[0.095,-0.003,0.045],"mass_fraction":0.1,"rgba":[0.78,0.82,0.83,1]}],"fidelity":{"geometry":"authored coarse proxy","native_contact":"available for numerical testing","measured_contact":"untested","deformation":"unsupported","shoe_grasp_qualified":false,"physical_robot_ready":false}},{"id":"ankle-boot-left","name":"Ankle Boot / left","version":"0.1.0","immutable_id":"dvidia/shoes/ankle-boot-left@0.1.0","family":"ankle-boot","pair_id":"dvidia/shoes/ankle-boot-pair@0.1.0","side":"left","license":"MIT","source":{"kind":"original_procedural","author":"DVIDIA","scope":"New primitive geometry; no redistributed scans, videos, photographs or model weights."},"properties":{"dimensions_m":{"value":[0.29,0.108,0.19],"units":"m; length x, width y, maximum height z","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_kg":{"value":0.5,"units":"kg","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"sliding_friction":{"value":0.9,"units":"dimensionless","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"torsional_friction":{"value":0.005,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"rolling_friction":{"value":0.0001,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_distribution":{"value":"Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.","units":"model assumption","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"deformation":{"value":"Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.","units":"model class","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"contact_solver":{"value":{"condim":4,"priority":1,"solref":[0.02,1],"solimp":[0.9,0.95,0.001,0.5,2]},"units":"MuJoCo solver parameters; no calibrated stiffness or damping","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."}},"frame":{"origin":"sole bottom center","axes":"right-handed; +x toward toe, +y lateral, +z up","sole_bottom_z_m":0,"initial_bottom_z_m":0.08},"geometry":[{"name":"sole","type":"box","size_m":[0.145,0.054,0.012],"position_m":[0,0,0.012],"mass_fraction":0.35,"rgba":[0.16,0.17,0.18,1]},{"name":"upper","type":"ellipsoid","size_m":[0.13,0.05,0.04],"position_m":[0.01,0.004,0.064],"mass_fraction":0.3,"rgba":[0.37,0.24,0.16,1]},{"name":"ankle","type":"ellipsoid","size_m":[0.047,0.049,0.055],"position_m":[-0.085,0.004,0.135],"mass_fraction":0.35,"rgba":[0.37,0.24,0.16,1]}],"fidelity":{"geometry":"authored coarse proxy","native_contact":"available for numerical testing","measured_contact":"untested","deformation":"unsupported","shoe_grasp_qualified":false,"physical_robot_ready":false}},{"id":"ankle-boot-right","name":"Ankle Boot / right","version":"0.1.0","immutable_id":"dvidia/shoes/ankle-boot-right@0.1.0","family":"ankle-boot","pair_id":"dvidia/shoes/ankle-boot-pair@0.1.0","side":"right","license":"MIT","source":{"kind":"original_procedural","author":"DVIDIA","scope":"New primitive geometry; no redistributed scans, videos, photographs or model weights."},"properties":{"dimensions_m":{"value":[0.29,0.108,0.19],"units":"m; length x, width y, maximum height z","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_kg":{"value":0.5,"units":"kg","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"sliding_friction":{"value":0.9,"units":"dimensionless","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"torsional_friction":{"value":0.005,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"rolling_friction":{"value":0.0001,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_distribution":{"value":"Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.","units":"model assumption","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"deformation":{"value":"Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.","units":"model class","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"contact_solver":{"value":{"condim":4,"priority":1,"solref":[0.02,1],"solimp":[0.9,0.95,0.001,0.5,2]},"units":"MuJoCo solver parameters; no calibrated stiffness or damping","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."}},"frame":{"origin":"sole bottom center","axes":"right-handed; +x toward toe, +y lateral, +z up","sole_bottom_z_m":0,"initial_bottom_z_m":0.08},"geometry":[{"name":"sole","type":"box","size_m":[0.145,0.054,0.012],"position_m":[0,0,0.012],"mass_fraction":0.35,"rgba":[0.16,0.17,0.18,1]},{"name":"upper","type":"ellipsoid","size_m":[0.13,0.05,0.04],"position_m":[0.01,-0.004,0.064],"mass_fraction":0.3,"rgba":[0.37,0.24,0.16,1]},{"name":"ankle","type":"ellipsoid","size_m":[0.047,0.049,0.055],"position_m":[-0.085,-0.004,0.135],"mass_fraction":0.35,"rgba":[0.37,0.24,0.16,1]}],"fidelity":{"geometry":"authored coarse proxy","native_contact":"available for numerical testing","measured_contact":"untested","deformation":"unsupported","shoe_grasp_qualified":false,"physical_robot_ready":false}},{"id":"slipper-left","name":"Slipper / left","version":"0.1.0","immutable_id":"dvidia/shoes/slipper-left@0.1.0","family":"slipper","pair_id":"dvidia/shoes/slipper-pair@0.1.0","side":"left","license":"MIT","source":{"kind":"original_procedural","author":"DVIDIA","scope":"New primitive geometry; no redistributed scans, videos, photographs or model weights."},"properties":{"dimensions_m":{"value":[0.27,0.102,0.055],"units":"m; length x, width y, maximum height z","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_kg":{"value":0.15,"units":"kg","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"sliding_friction":{"value":0.65,"units":"dimensionless","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"torsional_friction":{"value":0.005,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"rolling_friction":{"value":0.0001,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_distribution":{"value":"Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.","units":"model assumption","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"deformation":{"value":"Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.","units":"model class","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"contact_solver":{"value":{"condim":4,"priority":1,"solref":[0.02,1],"solimp":[0.9,0.95,0.001,0.5,2]},"units":"MuJoCo solver parameters; no calibrated stiffness or damping","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."}},"frame":{"origin":"sole bottom center","axes":"right-handed; +x toward toe, +y lateral, +z up","sole_bottom_z_m":0,"initial_bottom_z_m":0.08},"geometry":[{"name":"sole","type":"box","size_m":[0.135,0.051,0.009],"position_m":[0,0,0.009],"mass_fraction":0.35,"rgba":[0.16,0.17,0.18,1]},{"name":"upper","type":"ellipsoid","size_m":[0.09,0.049,0.017],"position_m":[0.045,0.002,0.038],"mass_fraction":0.65,"rgba":[0.52,0.31,0.37,1]}],"fidelity":{"geometry":"authored coarse proxy","native_contact":"available for numerical testing","measured_contact":"untested","deformation":"unsupported","shoe_grasp_qualified":false,"physical_robot_ready":false}},{"id":"slipper-right","name":"Slipper / right","version":"0.1.0","immutable_id":"dvidia/shoes/slipper-right@0.1.0","family":"slipper","pair_id":"dvidia/shoes/slipper-pair@0.1.0","side":"right","license":"MIT","source":{"kind":"original_procedural","author":"DVIDIA","scope":"New primitive geometry; no redistributed scans, videos, photographs or model weights."},"properties":{"dimensions_m":{"value":[0.27,0.102,0.055],"units":"m; length x, width y, maximum height z","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_kg":{"value":0.15,"units":"kg","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"sliding_friction":{"value":0.65,"units":"dimensionless","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"torsional_friction":{"value":0.005,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"rolling_friction":{"value":0.0001,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_distribution":{"value":"Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.","units":"model assumption","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"deformation":{"value":"Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.","units":"model class","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"contact_solver":{"value":{"condim":4,"priority":1,"solref":[0.02,1],"solimp":[0.9,0.95,0.001,0.5,2]},"units":"MuJoCo solver parameters; no calibrated stiffness or damping","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."}},"frame":{"origin":"sole bottom center","axes":"right-handed; +x toward toe, +y lateral, +z up","sole_bottom_z_m":0,"initial_bottom_z_m":0.08},"geometry":[{"name":"sole","type":"box","size_m":[0.135,0.051,0.009],"position_m":[0,0,0.009],"mass_fraction":0.35,"rgba":[0.16,0.17,0.18,1]},{"name":"upper","type":"ellipsoid","size_m":[0.09,0.049,0.017],"position_m":[0.045,-0.002,0.038],"mass_fraction":0.65,"rgba":[0.52,0.31,0.37,1]}],"fidelity":{"geometry":"authored coarse proxy","native_contact":"available for numerical testing","measured_contact":"untested","deformation":"unsupported","shoe_grasp_qualified":false,"physical_robot_ready":false}}],"environment":{"id":"open-support-plane","version":"0.1.0","license":"MIT","geometry":"Infinite collision plane at z=0; displayed with 2 m half extents. Not a finite tabletop or rack.","name":"asset_table","gravity_m_s2":[0,0,-9.81],"property_evidence":"untested authored environment","default_layout":"Three columns x=.40,.76,1.12 m; two rows y=.38,.56 m; sole bottoms begin z=.08 m. Layout separates loading tests from reachability claims."},"limitations":["All shoe physical properties are untested synthetic assumptions.","Left/right labels identify mirrored procedural instances, not scanned real shoes.","Arm command interfaces differ; installing a scene does not install a learned controller.","No deformation, real-world calibration, graspability claim or closed-loop sensor stack."],"catalog_sha256":"592f363389a96fef7f9223737aa72a2f1a74f400238924bf6790ec5bfd3302b7"} diff --git a/asset-library/v01/previews/so101/geometry.bin.gz b/asset-library/v01/previews/so101/geometry.bin.gz new file mode 100644 index 0000000000000000000000000000000000000000..810cf15861109df4009b99c6623a925046673c2c --- /dev/null +++ b/asset-library/v01/previews/so101/geometry.bin.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:494d7ce4ae7df05e51e0e9f7ed5c2dcb0a489817d72f8c83944e1d50e078396e +size 3182925 diff --git a/asset-library/v01/previews/so101/index.html b/asset-library/v01/previews/so101/index.html new file mode 100644 index 0000000000000000000000000000000000000000..843d8afcbe1c31af867095f8ee47af0f07813da9 --- /dev/null +++ b/asset-library/v01/previews/so101/index.html @@ -0,0 +1,4 @@ + +DVIDIA · Asset library
DVIDIA RESEARCHResearch footprints ↗

A scene you can take with you.

Loading a reusable arm and shoe scene from the local asset library.

Recorded native 3D sceneVisual geometry
Drag to orbit · Scroll or pinch to zoom · Arrow keys orbit · + / − zoom · H home
Opening local geometry and recorded body poses…
2.00 / 2.00 s
Browser physics: none. Native body poses were recorded locally.

Geometry you can inspect. Assumptions you can see.

The arm uses its pinned upstream meshes and joint mechanism. Each shoe combines original boxes and ellipsoids for a lightweight collision model. The left and right instances have persistent identities.

Shoe mass, friction, size and shape are authored assumptions. These rigid proxies do not reproduce real shoe deformation, laces, fabric, insole compression or calibrated grasp forces.

What this preview measures.

A two-second native settling run under gravity, with arm commands held at initialization. Use the timeline to inspect initial and settled states, and collision mode to see the surfaces used by the engine.

It does not demonstrate a learned shoe-organizing policy, grasp success, physical transfer or a real-time guarantee. The browser replays Float32 body poses; the simulation used native precision.

diff --git a/asset-library/v01/previews/so101/licenses/robotstudio_so101/LICENSE b/asset-library/v01/previews/so101/licenses/robotstudio_so101/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64 --- /dev/null +++ b/asset-library/v01/previews/so101/licenses/robotstudio_so101/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/asset-library/v01/previews/so101/licenses/robotstudio_so101/README.md b/asset-library/v01/previews/so101/licenses/robotstudio_so101/README.md new file mode 100644 index 0000000000000000000000000000000000000000..65129dba053c84d2ad384b1922cea46b119e9036 --- /dev/null +++ b/asset-library/v01/previews/so101/licenses/robotstudio_so101/README.md @@ -0,0 +1,32 @@ +# The Robot Studio SO101 Description (MJCF) + +> [!IMPORTANT] +> Requires MuJoCo 3.1.3 or later. + +## Changelog + +See [CHANGELOG.md](./CHANGELOG.md) for a full history of changes. + +## Overview + +This package contains a robot description (MJCF) of the [The Robot Studio SO101 robot](https://github.com/TheRobotStudio/SO-ARM100/tree/main/Simulation/SO101) developed by [I2 +RT Robotics]. It is derived from the [publicly available +MJCF](https://github.com/TheRobotStudio/SO-ARM100/blob/608122e9ac330a753735f2e18aee73338e9ac407/Simulation/SO101/so101_new_calib.xml#L1). + +

+ +

+ +## MJCF derivation steps + +1. Copied `so101_new_calib.xml` (commit SHA aec17bbc256d1a7342d53aaa4950595d4c30b40d). +2. Rounded floats and reformatted the XML for readability. +3. Switched to implicitfast. +4. Use default `forcerange` for actuators rather than 3.35 N/m. +5. Added primitive collision geometries for the gripper and arm. +6. Add default collision solver parameters for the gripper that work well for manipulation. +7. Add a camera mount. + +## License + +This model is released under the [Apache License 2.0](LICENSE). diff --git a/asset-library/v01/previews/so101/model.json b/asset-library/v01/previews/so101/model.json new file mode 100644 index 0000000000000000000000000000000000000000..03b0312eef0a8b9e73a4207ac08f65adf3f2b4d6 --- /dev/null +++ b/asset-library/v01/previews/so101/model.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-preview-model/v1","meshes":[{"id":0,"position_byte_offset":0,"vertex_count":621,"native_vertex_count":621,"index_byte_offset":7452,"index_count":3762},{"id":1,"position_byte_offset":22500,"vertex_count":9526,"native_vertex_count":9526,"index_byte_offset":136812,"index_count":57240},{"id":2,"position_byte_offset":365772,"vertex_count":11253,"native_vertex_count":11253,"index_byte_offset":500808,"index_count":67758},{"id":3,"position_byte_offset":771840,"vertex_count":14354,"native_vertex_count":14354,"index_byte_offset":944088,"index_count":86388},{"id":4,"position_byte_offset":1289640,"vertex_count":14103,"native_vertex_count":14103,"index_byte_offset":1458876,"index_count":84810},{"id":5,"position_byte_offset":1798116,"vertex_count":18766,"native_vertex_count":18766,"index_byte_offset":2023308,"index_count":112620},{"id":6,"position_byte_offset":2473788,"vertex_count":12976,"native_vertex_count":12976,"index_byte_offset":2629500,"index_count":78204},{"id":7,"position_byte_offset":2942316,"vertex_count":26967,"native_vertex_count":26967,"index_byte_offset":3265920,"index_count":161982},{"id":8,"position_byte_offset":3913848,"vertex_count":19720,"native_vertex_count":19720,"index_byte_offset":4150488,"index_count":118548},{"id":9,"position_byte_offset":4624680,"vertex_count":8800,"native_vertex_count":8800,"index_byte_offset":4730280,"index_count":53016},{"id":10,"position_byte_offset":4942344,"vertex_count":10481,"native_vertex_count":10481,"index_byte_offset":5068116,"index_count":63126},{"id":11,"position_byte_offset":5320620,"vertex_count":8652,"native_vertex_count":8652,"index_byte_offset":5424444,"index_count":51948},{"id":12,"position_byte_offset":5632236,"vertex_count":4577,"native_vertex_count":4577,"index_byte_offset":5687160,"index_count":28290},{"id":13,"position_byte_offset":5800320,"vertex_count":6877,"native_vertex_count":6877,"index_byte_offset":5882844,"index_count":41418},{"id":14,"position_byte_offset":6048516,"vertex_count":1216,"native_vertex_count":1216,"index_byte_offset":6063108,"index_count":7368},{"id":15,"position_byte_offset":6092580,"vertex_count":739,"native_vertex_count":739,"index_byte_offset":6101448,"index_count":4422},{"id":16,"position_byte_offset":6119136,"vertex_count":508,"native_vertex_count":508,"index_byte_offset":6125232,"index_count":3036},{"id":17,"position_byte_offset":6137376,"vertex_count":3428,"native_vertex_count":3428,"index_byte_offset":6178512,"index_count":20556}],"geoms":[{"geom_id":0,"name":"asset_table","body_id":0,"type":"plane","group":0,"size":[2.0,2.0,0.1],"position":[0.0,0.0,0.0],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.8799999952316284,0.8600000143051147,0.8100000023841858,1.0],"mesh_id":null,"collision":true},{"geom_id":1,"name":"unnamed_1","body_id":1,"type":"mesh","group":2,"size":[0.018024582725669536,0.025196170470444097,0.047919810865706805],"position":[0.006159362265631864,-9.287913934133229e-06,0.04883086620430609],"quaternion_wxyz":[-0.0029858282381069468,0.7404456697839014,0.0027056103391584416,0.6721041396991214],"rgba":[1.0,0.8199999928474426,0.11999999731779099,1.0],"mesh_id":5,"collision":false},{"geom_id":2,"name":"unnamed_2","body_id":1,"type":"mesh","group":2,"size":[0.04801897384955278,0.05981081679248648,0.05548180799104964],"position":[0.012815677353550416,-3.59711549737883e-06,0.016697767496321594],"quaternion_wxyz":[-0.6394743739043376,0.6399597239894438,0.30108474722058176,0.30144991587680336],"rgba":[1.0,0.8199999928474426,0.11999999731779099,1.0],"mesh_id":12,"collision":false},{"geom_id":3,"name":"unnamed_3","body_id":1,"type":"mesh","group":2,"size":[0.012400003604192156,0.019828796638968253,0.02413292057345267],"position":[0.02740716124416508,-3.2480543682692735e-09,0.04381764319472497],"quaternion_wxyz":[0.5063098304272834,0.49360951734412173,0.49360951734412173,0.5063098304272834],"rgba":[0.10000000149011612,0.10000000149011612,0.10000000149011612,1.0],"mesh_id":1,"collision":false},{"geom_id":4,"name":"unnamed_4","body_id":1,"type":"mesh","group":2,"size":[0.005205447308749576,0.02102039326100242,0.025499999523162942],"position":[-0.028587654949819557,-0.00019900000000000034,0.04742030568514122],"quaternion_wxyz":[-0.7071067809214835,0.7071067809214836,1.9361279421648003e-05,1.936127942151758e-05],"rgba":[1.0,0.8199999928474426,0.11999999731779099,1.0],"mesh_id":0,"collision":false},{"geom_id":5,"name":"unnamed_5","body_id":2,"type":"mesh","group":2,"size":[0.012400003604192156,0.019828796638968253,0.02413292057345267],"position":[-0.030399003248054366,0.0003043568052750323,-0.042771861244165085],"quaternion_wxyz":[0.012700313083161663,0.9999193477714051,0.0,0.0],"rgba":[0.10000000149011612,0.10000000149011612,0.10000000149011612,1.0],"mesh_id":1,"collision":false},{"geom_id":6,"name":"unnamed_6","body_id":2,"type":"box","group":3,"size":[0.023,0.015,0.01],"position":[-0.030399,0.000422,-0.0387],"quaternion_wxyz":[0.5,0.5,0.5,-0.5],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":7,"name":"unnamed_7","body_id":2,"type":"mesh","group":2,"size":[0.014371194482562825,0.02025441601165439,0.029084809898397984],"position":[-0.032873697937927035,-0.0003015369192916066,-0.02391173655566203],"quaternion_wxyz":[0.5011042839632729,0.5015216559056273,-0.5026376386946005,0.4946978162665062],"rgba":[1.0,0.8199999928474426,0.11999999731779099,1.0],"mesh_id":2,"collision":false},{"geom_id":8,"name":"unnamed_8","body_id":2,"type":"box","group":3,"size":[0.038,0.025,0.02],"position":[-0.025,0.0,0.0],"quaternion_wxyz":[0.5,0.5,-0.5,0.5],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":9,"name":"unnamed_9","body_id":2,"type":"mesh","group":2,"size":[0.02332979678228463,0.04159483071647776,0.0498452127674805],"position":[-0.026894029026240256,-2.0637103465734413e-05,0.0066907592931000764],"quaternion_wxyz":[0.6966047433627883,0.12361665557776648,0.1283125701647886,0.6949795956184186],"rgba":[1.0,0.8199999928474426,0.11999999731779099,1.0],"mesh_id":9,"collision":false},{"geom_id":10,"name":"unnamed_10","body_id":3,"type":"mesh","group":2,"size":[0.012400003604192156,0.019828796638968253,0.02413292057345267],"position":[-0.11256999675194564,-0.01657186124416508,0.018582356805275032],"quaternion_wxyz":[-6.555804525744434e-18,-2.310398156743925e-17,0.7160302289530861,-0.6980692739444944],"rgba":[0.10000000149011612,0.10000000149011612,0.10000000149011612,1.0],"mesh_id":1,"collision":false},{"geom_id":11,"name":"unnamed_11","body_id":3,"type":"box","group":3,"size":[0.01,0.07,0.03],"position":[-0.06,0.0,0.02],"quaternion_wxyz":[0.0,-0.7071067811865475,0.7071067811865475,0.0],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":12,"name":"unnamed_12","body_id":3,"type":"mesh","group":2,"size":[0.014213921038720587,0.03561999262454201,0.0730251164782814],"position":[-0.06094069326194158,0.000649047782088465,0.018323402581102332],"quaternion_wxyz":[-0.4950041356155936,0.4973142749814022,-0.5042152905166446,0.5034047660008789],"rgba":[1.0,0.8199999928474426,0.11999999731779099,1.0],"mesh_id":6,"collision":false},{"geom_id":13,"name":"unnamed_13","body_id":3,"type":"box","group":3,"size":[0.01,0.02,0.015],"position":[-0.12,-0.014,0.0182],"quaternion_wxyz":[0.0,1.0,0.0,0.0],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":14,"name":"unnamed_14","body_id":4,"type":"mesh","group":2,"size":[0.014381600792773027,0.036596081449491016,0.06741925235676786],"position":[-0.05235733321954828,-0.00071271595637145,0.017412905327696356],"quaternion_wxyz":[-0.4961424751361911,0.5166960169734155,-0.5030285424132384,0.4835598783265186],"rgba":[1.0,0.8199999928474426,0.11999999731779099,1.0],"mesh_id":8,"collision":false},{"geom_id":15,"name":"unnamed_15","body_id":4,"type":"box","group":3,"size":[0.07,0.01,0.03],"position":[-0.05,0.0,0.0182],"quaternion_wxyz":[0.0,1.0,0.0,0.0],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":16,"name":"unnamed_16","body_id":4,"type":"mesh","group":2,"size":[0.01436271605011393,0.019123246312827902,0.0300704922359716],"position":[-0.10462395896354529,0.0027442818370172553,0.01809181867023388],"quaternion_wxyz":[-0.0034026086375416875,-0.999981543293358,0.00384488971507797,0.0032484073286452634],"rgba":[1.0,0.8199999928474426,0.11999999731779099,1.0],"mesh_id":10,"collision":false},{"geom_id":17,"name":"unnamed_17","body_id":4,"type":"box","group":3,"size":[0.023,0.013,0.018],"position":[-0.125,0.005,0.018],"quaternion_wxyz":[0.0,-1.0,0.0,0.0],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":18,"name":"unnamed_18","body_id":4,"type":"mesh","group":2,"size":[0.012400003604192156,0.019828796638968253,0.02413292057345267],"position":[-0.12347186124416508,0.005199996751945632,0.018582356805275032],"quaternion_wxyz":[-0.49360951734412173,0.5063098304272834,0.5063098304272834,-0.49360951734412173],"rgba":[0.10000000149011612,0.10000000149011612,0.10000000149011612,1.0],"mesh_id":1,"collision":false},{"geom_id":19,"name":"unnamed_19","body_id":5,"type":"mesh","group":2,"size":[0.012400001937263936,0.021935884623074095,0.025344306975875405],"position":[-1.5811261444211094e-09,-0.043592423459359854,0.030396472285620604],"quaternion_wxyz":[0.0907356921065805,0.9958750093148954,0.0,0.0],"rgba":[0.10000000149011612,0.10000000149011612,0.10000000149011612,1.0],"mesh_id":11,"collision":false},{"geom_id":20,"name":"unnamed_20","body_id":5,"type":"box","group":3,"size":[0.029,0.015,0.018],"position":[0.0,-0.0424,0.0256],"quaternion_wxyz":[0.5,0.5,0.5,-0.5],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":21,"name":"unnamed_21","body_id":5,"type":"mesh","group":2,"size":[0.019639914915166173,0.04159852764367797,0.04961799998470053],"position":[-0.00015997421276397014,-0.028996144281636486,0.022491596494427515],"quaternion_wxyz":[0.425412280150272,-0.904940529325816,0.010205743086574876,0.0016950188527452004],"rgba":[1.0,0.8199999928474426,0.11999999731779099,1.0],"mesh_id":7,"collision":false},{"geom_id":22,"name":"unnamed_22","body_id":5,"type":"box","group":3,"size":[0.027,0.01,0.03],"position":[0.0,-0.02,0.0191],"quaternion_wxyz":[0.5,-0.5,-0.5,-0.5],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":23,"name":"unnamed_23","body_id":6,"type":"mesh","group":2,"size":[0.012400003604192156,0.019828796638968253,0.02413292057345267],"position":[0.008771861244165083,0.0002176431947249677,-0.023399996751945634],"quaternion_wxyz":[0.7070497514487902,-0.008980477504295863,0.7070497514487902,0.008980477504295847],"rgba":[0.10000000149011612,0.10000000149011612,0.10000000149011612,1.0],"mesh_id":1,"collision":false},{"geom_id":24,"name":"unnamed_24","body_id":6,"type":"mesh","group":2,"size":[0.029864171530215203,0.03260693243044622,0.07181142698296765],"position":[-0.00984467806085039,0.00018572458446001412,-0.028197633030830036],"quaternion_wxyz":[0.11789534437175672,0.7433230577375992,-0.6442245991374941,-0.13618438044514275],"rgba":[1.0,0.8199999928474426,0.11999999731779099,1.0],"mesh_id":3,"collision":false},{"geom_id":25,"name":"unnamed_25","body_id":6,"type":"box","group":3,"size":[0.01,0.01,0.018],"position":[0.0,-0.000218,0.00095],"quaternion_wxyz":[0.0,1.0,0.0,0.0],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":26,"name":"fixed_jaw_box1","body_id":6,"type":"box","group":3,"size":[0.0325,0.015,0.015],"position":[-0.0025,0.0,-0.022],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":null,"collision":true},{"geom_id":27,"name":"fixed_jaw_box2","body_id":6,"type":"box","group":3,"size":[0.01,0.015,0.005],"position":[-0.024,0.0,-0.04],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":null,"collision":true},{"geom_id":28,"name":"fixed_jaw_sph_tip1","body_id":6,"type":"sphere","group":3,"size":[0.00075,0.0,0.0],"position":[-0.0081,0.0,-0.101],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":null,"collision":true},{"geom_id":29,"name":"fixed_jaw_sph_tip2","body_id":6,"type":"sphere","group":3,"size":[0.00075,0.0,0.0],"position":[-0.0081,0.0035,-0.0975],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":null,"collision":true},{"geom_id":30,"name":"fixed_jaw_sph_tip3","body_id":6,"type":"sphere","group":3,"size":[0.00075,0.0,0.0],"position":[-0.0081,-0.0035,-0.0975],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":null,"collision":true},{"geom_id":31,"name":"unnamed_31","body_id":6,"type":"mesh","group":4,"size":[0.010133822268282078,0.01613541133690598,0.04783577927411815],"position":[-0.021703257223497686,-0.0002134879383735706,-0.05838272145112063],"quaternion_wxyz":[-4.679538453184953e-06,0.9926696248297043,-0.00037158699181256776,0.12085891709618599],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":15,"collision":true},{"geom_id":32,"name":"fixed_jaw_box3","body_id":6,"type":"capsule","group":3,"size":[0.0011,0.002,0.0],"position":[-0.009,0.0,-0.103],"quaternion_wxyz":[0.7073882691671998,0.706825181105366,0.0,0.0],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":null,"collision":true},{"geom_id":33,"name":"fixed_jaw_box4","body_id":6,"type":"box","group":3,"size":[0.001,0.004,0.004],"position":[-0.009,0.0,-0.0982],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":null,"collision":true},{"geom_id":34,"name":"fixed_jaw_box5","body_id":6,"type":"box","group":3,"size":[0.001,0.005,0.006],"position":[-0.0108,0.0,-0.0905],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":null,"collision":true},{"geom_id":35,"name":"fixed_jaw_box6","body_id":6,"type":"box","group":3,"size":[0.001,0.009,0.008],"position":[-0.0125,0.0,-0.0727],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":null,"collision":true},{"geom_id":36,"name":"fixed_jaw_box7","body_id":6,"type":"box","group":3,"size":[0.001,0.01,0.008],"position":[-0.0143,0.0,-0.053],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":null,"collision":true},{"geom_id":37,"name":"unnamed_37","body_id":7,"type":"mesh","group":2,"size":[0.008171475996632935,0.020381324251601222,0.03308388728101171],"position":[-0.0009316021647151765,0.05015953175138088,-0.035438154829049204],"quaternion_wxyz":[-0.37099122377781163,0.6039181447183081,-0.5980153656299437,-0.374200492824804],"rgba":[1.0,0.8199999928474426,0.11999999731779099,1.0],"mesh_id":14,"collision":false},{"geom_id":38,"name":"wrist_camera_pcb","body_id":7,"type":"box","group":2,"size":[0.019,0.019,0.0005],"position":[-0.00101,0.05958,-0.04515],"quaternion_wxyz":[0.9582796540567949,-0.28579189682785777,-0.001555999438277302,0.004546998358513426],"rgba":[0.10000000149011612,0.10000000149011612,0.10000000149011612,1.0],"mesh_id":null,"collision":false},{"geom_id":39,"name":"wrist_camera_lens","body_id":7,"type":"cylinder","group":1,"size":[0.007,0.00475,0.0],"position":[-0.00298,0.05669,-0.04954],"quaternion_wxyz":[0.9582796540567949,-0.28579189682785777,-0.001555999438277302,0.004546998358513426],"rgba":[0.10000000149011612,0.10000000149011612,0.10000000149011612,1.0],"mesh_id":null,"collision":false},{"geom_id":40,"name":"camera_box1","body_id":7,"type":"box","group":3,"size":[0.015,0.015,0.003],"position":[-0.0025,0.03,-0.03],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":null,"collision":true},{"geom_id":41,"name":"camera_box2","body_id":7,"type":"box","group":3,"size":[0.021,0.021,0.003],"position":[-0.001,0.06,-0.04],"quaternion_wxyz":[0.962425197628238,-0.27154693695611287,0.0,0.0],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":null,"collision":true},{"geom_id":42,"name":"unnamed_42","body_id":8,"type":"mesh","group":2,"size":[0.010456722770396694,0.02407062262589546,0.057874871674660766],"position":[-0.0014113050401981264,-0.02470880590726685,0.018874880105638096],"quaternion_wxyz":[0.7071223453682164,0.706091530600258,-0.02643576001723448,-0.02671871418781755],"rgba":[1.0,0.8199999928474426,0.11999999731779099,1.0],"mesh_id":4,"collision":false},{"geom_id":43,"name":"unnamed_43","body_id":8,"type":"mesh","group":4,"size":[0.008216675738104348,0.01235780976510682,0.02272290962174511],"position":[-0.0013277515274955586,-0.03981939099219668,0.018765325451677382],"quaternion_wxyz":[0.7111518796297168,0.7022712603195472,-0.021690561963490538,-0.024649554763214745],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":16,"collision":true},{"geom_id":44,"name":"unnamed_44","body_id":8,"type":"mesh","group":4,"size":[0.004712194905936345,0.007213935215470417,0.013993767416774524],"position":[-0.005229554878032948,-0.06959220135322133,0.018898422558152723],"quaternion_wxyz":[0.6914040836725398,0.6910490860309149,-0.1489234728947105,-0.14910852758227097],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":17,"collision":true},{"geom_id":45,"name":"moving_jaw_box1","body_id":8,"type":"box","group":3,"size":[0.01,0.01,0.015],"position":[-0.0,-0.013,0.019],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":null,"collision":true},{"geom_id":46,"name":"moving_jaw_sph_tip1","body_id":8,"type":"sphere","group":3,"size":[0.00075,0.0,0.0],"position":[-0.012,-0.078,0.0192],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":null,"collision":true},{"geom_id":47,"name":"moving_jaw_sph_tip2","body_id":8,"type":"sphere","group":3,"size":[0.00075,0.0,0.0],"position":[-0.012,-0.0745,0.0225],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":null,"collision":true},{"geom_id":48,"name":"moving_jaw_sph_tip3","body_id":8,"type":"sphere","group":3,"size":[0.00075,0.0,0.0],"position":[-0.012,-0.0745,0.0155],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":null,"collision":true},{"geom_id":49,"name":"moving_jaw_box2","body_id":8,"type":"box","group":3,"size":[0.001,0.004,0.004],"position":[-0.0113,-0.076,0.01875],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":null,"collision":true},{"geom_id":50,"name":"moving_jaw_box3","body_id":8,"type":"box","group":3,"size":[0.001,0.005,0.006],"position":[-0.0093,-0.067,0.01875],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[1.0,0.0,0.0,1.0],"mesh_id":null,"collision":true},{"geom_id":51,"name":"shoe_trainer_left_sole","body_id":9,"type":"box","group":0,"size":[0.14,0.05,0.01],"position":[0.0,0.0,0.01],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.1599999964237213,0.17000000178813934,0.18000000715255737,1.0],"mesh_id":null,"collision":true},{"geom_id":52,"name":"shoe_trainer_left_upper","body_id":9,"type":"ellipsoid","group":0,"size":[0.122,0.047,0.035],"position":[-0.005,0.003,0.052],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.20000000298023224,0.3799999952316284,0.5799999833106995,1.0],"mesh_id":null,"collision":true},{"geom_id":53,"name":"shoe_trainer_left_toe","body_id":9,"type":"ellipsoid","group":0,"size":[0.04,0.047,0.026],"position":[0.095,0.003,0.045],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.7799999713897705,0.8199999928474426,0.8299999833106995,1.0],"mesh_id":null,"collision":true},{"geom_id":54,"name":"shoe_trainer_right_sole","body_id":10,"type":"box","group":0,"size":[0.14,0.05,0.01],"position":[0.0,0.0,0.01],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.1599999964237213,0.17000000178813934,0.18000000715255737,1.0],"mesh_id":null,"collision":true},{"geom_id":55,"name":"shoe_trainer_right_upper","body_id":10,"type":"ellipsoid","group":0,"size":[0.122,0.047,0.035],"position":[-0.005,-0.003,0.052],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.20000000298023224,0.3799999952316284,0.5799999833106995,1.0],"mesh_id":null,"collision":true},{"geom_id":56,"name":"shoe_trainer_right_toe","body_id":10,"type":"ellipsoid","group":0,"size":[0.04,0.047,0.026],"position":[0.095,-0.003,0.045],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.7799999713897705,0.8199999928474426,0.8299999833106995,1.0],"mesh_id":null,"collision":true},{"geom_id":57,"name":"shoe_ankle_boot_left_sole","body_id":11,"type":"box","group":0,"size":[0.145,0.054,0.012],"position":[0.0,0.0,0.012],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.1599999964237213,0.17000000178813934,0.18000000715255737,1.0],"mesh_id":null,"collision":true},{"geom_id":58,"name":"shoe_ankle_boot_left_upper","body_id":11,"type":"ellipsoid","group":0,"size":[0.13,0.05,0.04],"position":[0.01,0.004,0.064],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.3700000047683716,0.23999999463558197,0.1599999964237213,1.0],"mesh_id":null,"collision":true},{"geom_id":59,"name":"shoe_ankle_boot_left_ankle","body_id":11,"type":"ellipsoid","group":0,"size":[0.047,0.049,0.055],"position":[-0.085,0.004,0.135],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.3700000047683716,0.23999999463558197,0.1599999964237213,1.0],"mesh_id":null,"collision":true},{"geom_id":60,"name":"shoe_ankle_boot_right_sole","body_id":12,"type":"box","group":0,"size":[0.145,0.054,0.012],"position":[0.0,0.0,0.012],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.1599999964237213,0.17000000178813934,0.18000000715255737,1.0],"mesh_id":null,"collision":true},{"geom_id":61,"name":"shoe_ankle_boot_right_upper","body_id":12,"type":"ellipsoid","group":0,"size":[0.13,0.05,0.04],"position":[0.01,-0.004,0.064],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.3700000047683716,0.23999999463558197,0.1599999964237213,1.0],"mesh_id":null,"collision":true},{"geom_id":62,"name":"shoe_ankle_boot_right_ankle","body_id":12,"type":"ellipsoid","group":0,"size":[0.047,0.049,0.055],"position":[-0.085,-0.004,0.135],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.3700000047683716,0.23999999463558197,0.1599999964237213,1.0],"mesh_id":null,"collision":true},{"geom_id":63,"name":"shoe_slipper_left_sole","body_id":13,"type":"box","group":0,"size":[0.135,0.051,0.009],"position":[0.0,0.0,0.009],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.1599999964237213,0.17000000178813934,0.18000000715255737,1.0],"mesh_id":null,"collision":true},{"geom_id":64,"name":"shoe_slipper_left_upper","body_id":13,"type":"ellipsoid","group":0,"size":[0.09,0.049,0.017],"position":[0.045,0.002,0.038],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.5199999809265137,0.3100000023841858,0.3700000047683716,1.0],"mesh_id":null,"collision":true},{"geom_id":65,"name":"shoe_slipper_right_sole","body_id":14,"type":"box","group":0,"size":[0.135,0.051,0.009],"position":[0.0,0.0,0.009],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.1599999964237213,0.17000000178813934,0.18000000715255737,1.0],"mesh_id":null,"collision":true},{"geom_id":66,"name":"shoe_slipper_right_upper","body_id":14,"type":"ellipsoid","group":0,"size":[0.09,0.049,0.017],"position":[0.045,-0.002,0.038],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.5199999809265137,0.3100000023841858,0.3700000047683716,1.0],"mesh_id":null,"collision":true}],"bodies":[{"id":0,"name":"world"},{"id":1,"name":"base"},{"id":2,"name":"shoulder"},{"id":3,"name":"upper_arm"},{"id":4,"name":"lower_arm"},{"id":5,"name":"wrist"},{"id":6,"name":"gripper"},{"id":7,"name":"camera_mount"},{"id":8,"name":"moving_jaw_so101_v1"},{"id":9,"name":"shoe_trainer_left"},{"id":10,"name":"shoe_trainer_right"},{"id":11,"name":"shoe_ankle_boot_left"},{"id":12,"name":"shoe_ankle_boot_right"},{"id":13,"name":"shoe_slipper_left"},{"id":14,"name":"shoe_slipper_right"}],"joints":[{"name":"shoulder_pan","range":[-1.91986,1.91986]},{"name":"shoulder_lift","range":[-1.7453293,1.7453293]},{"name":"elbow_flex","range":[-1.69,1.69]},{"name":"wrist_flex","range":[-1.658063,1.658063]},{"name":"wrist_roll","range":[-2.7438473,2.8412063]},{"name":"gripper","range":[-0.174533,1.7453292]},{"name":"shoe_trainer_left_free","range":[0.0,0.0]},{"name":"shoe_trainer_right_free","range":[0.0,0.0]},{"name":"shoe_ankle_boot_left_free","range":[0.0,0.0]},{"name":"shoe_ankle_boot_right_free","range":[0.0,0.0]},{"name":"shoe_slipper_left_free","range":[0.0,0.0]},{"name":"shoe_slipper_right_free","range":[0.0,0.0]}],"source":{"robot":"so101","assets":{"profile":"so101","repository":"https://github.com/google-deepmind/mujoco_menagerie","commit":"0059d4335f8156206f63a35662313385f7ad6d74","files_verified":26,"bytes_verified":19194361,"lock_sha256":"4b2ee2ca675aceb2f826983cb3082a3e08e9aa0ff419b23078abcff08ebcc6fe","simulation_asset_license":"Apache-2.0"},"mujoco":"3.15.0","compiled_model_sha256":"324c34e8cc0885d88de8ffa400875f45a339389dc6d97071ba3b711e3dc1915e","scene_sha256":"24962e06594959eb2a432219425bd17b3fa74e428440c8e83c6edc5e984ae716"},"scope":"Recorded native MuJoCo scene settling with held arm commands. The browser displays saved poses and does not run physics. Shoes are authored rigid proxies with untested physical properties. No learned shoe skill, calibrated deformation, hardware or real-time qualification.","geometry_binary":{"href":"geometry.bin.gz","compression":"gzip","bytes":6260736,"compressed_bytes":3182925,"sha256":"4d874429e3707301eb0a925d638513f53fff4ecdd3b1816d1134d1daf88aa720"}} diff --git a/asset-library/v01/previews/so101/motion.bin.gz b/asset-library/v01/previews/so101/motion.bin.gz new file mode 100644 index 0000000000000000000000000000000000000000..35eb8888e2e067a8e81a33d53a7ad7c9efe28ee4 --- /dev/null +++ b/asset-library/v01/previews/so101/motion.bin.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b1ab54e527faad6324a0ef3f8be958d61aa62041d85c8171a7a5d3356f37f29 +size 6523 diff --git a/asset-library/v01/previews/so101/motion.json b/asset-library/v01/previews/so101/motion.json new file mode 100644 index 0000000000000000000000000000000000000000..496c3905307762fe4129f8c2ec98fd49620bf34d --- /dev/null +++ b/asset-library/v01/previews/so101/motion.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-preview-motion/v1","source":{"robot":"so101","assets":{"profile":"so101","repository":"https://github.com/google-deepmind/mujoco_menagerie","commit":"0059d4335f8156206f63a35662313385f7ad6d74","files_verified":26,"bytes_verified":19194361,"lock_sha256":"4b2ee2ca675aceb2f826983cb3082a3e08e9aa0ff419b23078abcff08ebcc6fe","simulation_asset_license":"Apache-2.0"},"mujoco":"3.15.0","compiled_model_sha256":"324c34e8cc0885d88de8ffa400875f45a339389dc6d97071ba3b711e3dc1915e","scene_sha256":"24962e06594959eb2a432219425bd17b3fa74e428440c8e83c6edc5e984ae716"},"scope":"Recorded native MuJoCo scene settling with held arm commands. The browser displays saved poses and does not run physics. Shoes are authored rigid proxies with untested physical properties. No learned shoe skill, calibrated deformation, hardware or real-time qualification.","body_count":15,"frame_count":101,"frame_stride_floats":105,"duration_seconds":2.0,"timestep_seconds":0.002,"rows":[{"t_seconds":0.0,"contact_count":0,"joint_position":[0.0,0.0,0.0,0.0,0.0,0.0]},{"t_seconds":0.02,"contact_count":0,"joint_position":[1.0403550698102027e-08,0.0007676432010182379,0.0006358776366478749,0.00011703282776323732,2.467543179825256e-06,-1.2877400746246828e-06]},{"t_seconds":0.04,"contact_count":0,"joint_position":[-7.90692079583654e-09,0.0006204490380951628,0.0005311778160384745,0.00015829459320328073,5.014883934360119e-06,-2.6125456116091106e-06]},{"t_seconds":0.06,"contact_count":0,"joint_position":[-2.0717954128365262e-09,0.00048176159350905764,0.0004208105195709063,0.00015048595521051405,6.316925294634339e-06,-3.2887585193954773e-06]},{"t_seconds":0.08,"contact_count":0,"joint_position":[2.542501708868529e-09,0.0005454807899364291,0.00043890416891490365,0.00013920482730587174,6.7645273661297855e-06,-3.5208010994513065e-06]},{"t_seconds":0.1,"contact_count":0,"joint_position":[-1.8330993075116756e-10,0.0005679214772421337,0.000462900941648933,0.0001329400745742093,6.848285129997643e-06,-3.563952028893704e-06]},{"t_seconds":0.12,"contact_count":0,"joint_position":[-8.168679303458314e-10,0.0005734304008832954,0.0004756564987399547,0.0001305816651238598,6.833835371857796e-06,-3.5561104307013027e-06]},{"t_seconds":0.14,"contact_count":24,"joint_position":[-5.04484024132685e-10,0.0005744845332367101,0.00048124486750592596,0.0001300049083941833,6.812141077330066e-06,-3.5446490873866394e-06]},{"t_seconds":0.16,"contact_count":24,"joint_position":[-1.6880754743103919e-10,0.0005745247460632131,0.0004833549400212359,0.00012999062252686875,6.800607781817799e-06,-3.5385889386611022e-06]},{"t_seconds":0.18,"contact_count":24,"joint_position":[-8.568610520106432e-13,0.0005744136468171425,0.00048403605862172344,0.00013007011902832426,6.796594740251118e-06,-3.53649551201794e-06]},{"t_seconds":0.2,"contact_count":24,"joint_position":[4.926003574317835e-11,0.0005743261559366404,0.0004842103160637594,0.00013012451668241773,6.795808779167637e-06,-3.5360957937788335e-06]},{"t_seconds":0.22,"contact_count":24,"joint_position":[4.851679200016367e-11,0.0005742760932930145,0.0004842339136958085,0.00013014804348601333,6.795927030982658e-06,-3.5361656218547632e-06]},{"t_seconds":0.24,"contact_count":24,"joint_position":[3.4312981054299455e-11,0.0005742504888280704,0.0004842249347154808,0.00013015516916852786,6.796126180367197e-06,-3.536273685898822e-06]},{"t_seconds":0.26,"contact_count":24,"joint_position":[2.0995673986187398e-11,0.0005742380204617698,0.0004842150049201419,0.00013015625948868063,6.796236912622234e-06,-3.5363330229337302e-06]},{"t_seconds":0.28,"contact_count":24,"joint_position":[1.1864510215968967e-11,0.0005742320743403621,0.00048420922813810014,0.00013015589382714616,6.796277809179157e-06,-3.5363547494146046e-06]},{"t_seconds":0.3,"contact_count":24,"joint_position":[6.405073201627008e-12,0.0005742292580286329,0.0004842065641962056,0.00013015549096339452,6.796287168293351e-06,-3.5363596404685857e-06]},{"t_seconds":0.32,"contact_count":24,"joint_position":[3.3741978196376085e-12,0.0005742279246892883,0.0004842055122944643,0.00013015528355759607,6.796286902194129e-06,-3.536359443538703e-06]},{"t_seconds":0.34,"contact_count":24,"joint_position":[1.7592887957525742e-12,0.0005742272925033089,0.00048420515302978034,0.0001301552090291374,6.796285275396002e-06,-3.5363585545509623e-06]},{"t_seconds":0.36,"contact_count":24,"joint_position":[9.160519812529513e-13,0.0005742269924827439,0.0004842050509827715,0.0001301551915865396,6.796284255365859e-06,-3.5363580049753596e-06]},{"t_seconds":0.38,"contact_count":24,"joint_position":[4.785934886780149e-13,0.0005742268501899188,0.0004842050307167946,0.00013015519134287277,6.796283840844029e-06,-3.5363577836923037e-06]},{"t_seconds":0.4,"contact_count":24,"joint_position":[2.512395818733725e-13,0.0005742267828538427,0.0004842050310828379,0.000130155193747097,6.79628372705161e-06,-3.5363577238520908e-06]},{"t_seconds":0.42,"contact_count":24,"joint_position":[1.3065110785150046e-13,0.0005742267505777044,0.0004842050341452663,0.00013015519533665873,6.796283714310401e-06,-3.536357717760637e-06]},{"t_seconds":0.44,"contact_count":24,"joint_position":[5.735849711646425e-14,0.000574226733282279,0.0004842050360174056,0.00013015519611341082,6.796283718206621e-06,-3.5363577204318056e-06]},{"t_seconds":0.46,"contact_count":24,"joint_position":[7.240786207079155e-15,0.0005742267242100542,0.0004842050367297306,0.00013015519644617662,6.796283723802882e-06,-3.5363577240273317e-06]},{"t_seconds":0.48,"contact_count":24,"joint_position":[-2.8109156361795192e-14,0.0005742267198450476,0.00048420503677850367,0.00013015519655893391,6.796283728553992e-06,-3.536357727126286e-06]},{"t_seconds":0.5,"contact_count":24,"joint_position":[-5.4892120810629304e-14,0.0005742267179518145,0.0004842050364971888,0.0001301551966028807,6.7962837326440156e-06,-3.5363577298415654e-06]},{"t_seconds":0.52,"contact_count":24,"joint_position":[-7.658984566313927e-14,0.0005742267175219896,0.0004842050359991278,0.0001301551965987913,6.796283735331716e-06,-3.5363577317510745e-06]},{"t_seconds":0.54,"contact_count":24,"joint_position":[-9.37082076739923e-14,0.0005742267177377188,0.00048420503550281144,0.00013015519659496336,6.796283737629186e-06,-3.53635773337555e-06]},{"t_seconds":0.56,"contact_count":24,"joint_position":[-1.0865295184791752e-13,0.0005742267185073099,0.00048420503492637877,0.00013015519658052184,6.796283739460496e-06,-3.536357734722001e-06]},{"t_seconds":0.58,"contact_count":24,"joint_position":[-1.1917092847974973e-13,0.0005742267191072938,0.0004842050345388958,0.00013015519657068425,6.796283740506488e-06,-3.5363577355044016e-06]},{"t_seconds":0.6,"contact_count":24,"joint_position":[-1.261998448281126e-13,0.0005742267194972468,0.0004842050343024142,0.00013015519656550936,6.796283741035703e-06,-3.536357735909353e-06]},{"t_seconds":0.62,"contact_count":24,"joint_position":[-1.2080697127971936e-13,0.0005742267194808724,0.0004842050346634206,0.00013015519657125327,6.796283742284479e-06,-3.5363577363575404e-06]},{"t_seconds":0.64,"contact_count":24,"joint_position":[-1.1165473235911118e-13,0.0005742267193482246,0.00048420503514036255,0.0001301551965842919,6.796283743726301e-06,-3.5363577368849645e-06]},{"t_seconds":0.66,"contact_count":24,"joint_position":[-1.098687884114402e-13,0.0005742267197487146,0.00048420503513214196,0.00013015519657820997,6.796283744579153e-06,-3.5363577373563705e-06]},{"t_seconds":0.68,"contact_count":24,"joint_position":[-1.1093436030754133e-13,0.0005742267202416461,0.00048420503498773827,0.00013015519656861663,6.796283745056003e-06,-3.5363577376900193e-06]},{"t_seconds":0.7,"contact_count":24,"joint_position":[-1.0508775498779082e-13,0.0005742267203413905,0.0004842050352378447,0.00013015519656603834,6.7962837457053305e-06,-3.536357737876573e-06]},{"t_seconds":0.72,"contact_count":24,"joint_position":[-9.256085032741673e-14,0.0005742267201488126,0.00048420503580897154,0.00013015519657570205,6.796283746942696e-06,-3.5363577382338255e-06]},{"t_seconds":0.74,"contact_count":24,"joint_position":[-8.818271275780605e-14,0.0005742267203703767,0.0004842050358956857,0.0001301551965687543,6.796283747412107e-06,-3.536357738442815e-06]},{"t_seconds":0.76,"contact_count":24,"joint_position":[-8.938281384534525e-14,0.0005742267208784828,0.0004842050356984761,0.00013015519655267915,6.796283747496675e-06,-3.536357738581692e-06]},{"t_seconds":0.78,"contact_count":24,"joint_position":[-8.72463493894283e-14,0.0005742267210916875,0.0004842050357347922,0.00013015519654336724,6.796283747588726e-06,-3.5363577385800523e-06]},{"t_seconds":0.8,"contact_count":24,"joint_position":[-7.436781336177642e-14,0.0005742267208333676,0.0004842050363297574,0.0001301551965496529,6.796283748554308e-06,-3.5363577387569988e-06]},{"t_seconds":0.82,"contact_count":24,"joint_position":[-6.8412472045626e-14,0.0005742267208584344,0.0004842050365218473,0.0001301551965454816,6.7962837488664134e-06,-3.536357738819223e-06]},{"t_seconds":0.84,"contact_count":24,"joint_position":[-7.062615611572838e-14,0.000574226721366991,0.0004842050362654874,0.00013015519652415425,6.796283748605182e-06,-3.536357738790869e-06]},{"t_seconds":0.86,"contact_count":24,"joint_position":[-7.259055246104867e-14,0.0005742267217128356,0.000484205036089169,0.00013015519651275305,6.796283748461992e-06,-3.536357738790327e-06]},{"t_seconds":0.88,"contact_count":24,"joint_position":[-5.972336618124461e-14,0.0005742267213813821,0.0004842050367054854,0.00013015519651416626,6.7962837490619095e-06,-3.5363577387296807e-06]},{"t_seconds":0.9,"contact_count":24,"joint_position":[-5.189423564566856e-14,0.0005742267212063164,0.00048420503703108976,0.0001301551965146553,6.796283749369255e-06,-3.5363577387141584e-06]},{"t_seconds":0.92,"contact_count":24,"joint_position":[-5.523256306963226e-14,0.0005742267217219586,0.00048420503671513135,0.00013015519648955693,6.796283748850379e-06,-3.536357738572567e-06]},{"t_seconds":0.94,"contact_count":24,"joint_position":[-5.779350119173741e-14,0.0005742267220635427,0.00048420503651221917,0.00013015519647614632,6.7962837485718145e-06,-3.5363577385079114e-06]},{"t_seconds":0.96,"contact_count":24,"joint_position":[-4.8412950825897626e-14,0.0005742267218207247,0.0004842050369653457,0.00013015519647445784,6.796283748867117e-06,-3.5363577383697603e-06]},{"t_seconds":0.98,"contact_count":24,"joint_position":[-4.033126569414838e-14,0.0005742267215953756,0.00048420503732101745,0.0001301551964748441,6.79628374911933e-06,-3.536357738299611e-06]},{"t_seconds":1.0,"contact_count":24,"joint_position":[-4.2687142499944754e-14,0.0005742267219723344,0.0004842050370764649,0.00013015519645310922,6.796283748570154e-06,-3.536357738107975e-06]},{"t_seconds":1.02,"contact_count":24,"joint_position":[-4.5878122717373194e-14,0.0005742267223163258,0.0004842050368437145,0.00013015519643792175,6.796283748173445e-06,-3.5363577379924736e-06]},{"t_seconds":1.04,"contact_count":24,"joint_position":[-3.9842519204549144e-14,0.0005742267221786639,0.0004842050371351354,0.00013015519643386287,6.796283748248634e-06,-3.536357737826048e-06]},{"t_seconds":1.06,"contact_count":24,"joint_position":[-3.1486742383510503e-14,0.0005742267219068679,0.000484205037522353,0.00013015519643458026,6.7962837484727015e-06,-3.536357737716186e-06]},{"t_seconds":1.08,"contact_count":24,"joint_position":[-3.240206357083374e-14,0.0005742267221421344,0.00048420503737296304,0.00013015519641746694,6.796283747995223e-06,-3.5363577375184744e-06]},{"t_seconds":1.1,"contact_count":24,"joint_position":[-3.623429099281916e-14,0.0005742267224942648,0.0004842050371075202,0.00013015519640067094,6.79628374749361e-06,-3.5363577373627766e-06]},{"t_seconds":1.12,"contact_count":24,"joint_position":[-3.347097718079527e-14,0.0005742267224767636,0.000484205037234534,0.0001301551963944149,6.796283747393913e-06,-3.5363577371968742e-06]},{"t_seconds":1.14,"contact_count":24,"joint_position":[-2.4799951711654544e-14,0.0005742267221608026,0.0004842050376558298,0.00013015519639585869,6.79628374761426e-06,-3.5363577370598654e-06]},{"t_seconds":1.16,"contact_count":24,"joint_position":[-2.3881882467391797e-14,0.0005742267222496047,0.00048420503762265876,0.00013015519638421097,6.796283747279618e-06,-3.5363577368831353e-06]},{"t_seconds":1.18,"contact_count":24,"joint_position":[-2.8362990298623617e-14,0.0005742267226148136,0.0004842050373217353,0.00013015519636591592,6.796283746682688e-06,-3.5363577366957094e-06]},{"t_seconds":1.2,"contact_count":24,"joint_position":[-2.886156259686889e-14,0.0005742267227316306,0.00048420503727826725,0.0001301551963573235,6.796283746429762e-06,-3.536357736547629e-06]},{"t_seconds":1.22,"contact_count":24,"joint_position":[-1.9826373207262524e-14,0.0005742267223724037,0.00048420503773683083,0.00013015519635978693,6.796283746664588e-06,-3.536357736391702e-06]},{"t_seconds":1.24,"contact_count":24,"joint_position":[-1.6731071438274712e-14,0.00057422672230835,0.00048420503783931396,0.00013015519635418613,6.796283746522944e-06,-3.536357736251248e-06]},{"t_seconds":1.26,"contact_count":24,"joint_position":[-2.1869775333963812e-14,0.0005742267226910425,0.00048420503750003837,0.0001301551963344626,6.796283745837767e-06,-3.53635773603916e-06]},{"t_seconds":1.28,"contact_count":24,"joint_position":[-2.5663197901399423e-14,0.0005742267229568684,0.0004842050372781362,0.0001301551963237205,6.796283745469142e-06,-3.5363577359375903e-06]},{"t_seconds":1.3,"contact_count":24,"joint_position":[-1.621972725865744e-14,0.0005742267225532643,0.000484205037776671,0.00013015519632688337,6.7962837456995775e-06,-3.53635773574872e-06]},{"t_seconds":1.32,"contact_count":24,"joint_position":[-1.063896586937334e-14,0.0005742267223283044,0.0004842050380332809,0.0001301551963276574,6.796283745781401e-06,-3.5363577356483366e-06]},{"t_seconds":1.34,"contact_count":24,"joint_position":[-1.6444803052079565e-14,0.0005742267227327149,0.00048420503765279573,0.00013015519630664823,6.796283745019324e-06,-3.53635773542132e-06]},{"t_seconds":1.36,"contact_count":24,"joint_position":[-2.0532515214792408e-14,0.0005742267230045438,0.0004842050374151869,0.00013015519629542833,6.796283744619622e-06,-3.5363577353122636e-06]},{"t_seconds":1.38,"contact_count":24,"joint_position":[-1.3710751436426267e-14,0.000574226722712217,0.0004842050377836462,0.00013015519629728446,6.796283744764571e-06,-3.5363577351517365e-06]},{"t_seconds":1.4,"contact_count":24,"joint_position":[-7.64765430702708e-15,0.0005742267224508734,0.00048420503807631064,0.00013015519629920933,6.796283744883076e-06,-3.5363577350486614e-06]},{"t_seconds":1.42,"contact_count":24,"joint_position":[-1.1843965186828532e-14,0.0005742267227470813,0.0004842050377879358,0.00013015519628251418,6.796283744263009e-06,-3.5363577348572324e-06]},{"t_seconds":1.44,"contact_count":24,"joint_position":[-1.6280897079340456e-14,0.0005742267230295862,0.0004842050375301274,0.0001301551962707253,6.796283743830087e-06,-3.536357734742824e-06]},{"t_seconds":1.46,"contact_count":24,"joint_position":[-1.2090514805471715e-14,0.0005742267228560396,0.0004842050377637665,0.00013015519627088888,6.796283743884194e-06,-3.5363577346108034e-06]},{"t_seconds":1.48,"contact_count":24,"joint_position":[-5.55387045396229e-15,0.0005742267225601027,0.0004842050380925566,0.00013015519627405974,6.79628374404559e-06,-3.5363577345080935e-06]},{"t_seconds":1.5,"contact_count":24,"joint_position":[-7.8741845245265e-15,0.0005742267227394914,0.00048420503791158693,0.00013015519626192478,6.796283743587918e-06,-3.5363577343532804e-06]},{"t_seconds":1.52,"contact_count":24,"joint_position":[-1.2705078755361376e-14,0.000574226723036564,0.00048420503762962026,0.000130155196249472,6.79628374311911e-06,-3.5363577342350782e-06]},{"t_seconds":1.54,"contact_count":24,"joint_position":[-1.1197316491515619e-14,0.0005742267229899876,0.0004842050377213082,0.000130155196247456,6.796283743069418e-06,-3.5363577341290475e-06]},{"t_seconds":1.56,"contact_count":24,"joint_position":[-4.1788998499934905e-15,0.000574226722660066,0.00048420503808748686,0.00013015519625199246,6.796283743280791e-06,-3.5363577340293958e-06]},{"t_seconds":1.58,"contact_count":24,"joint_position":[-4.382877792533129e-15,0.0005742267227139002,0.00048420503802851066,0.00013015519624464672,6.79628374300243e-06,-3.5363577339103974e-06]},{"t_seconds":1.6,"contact_count":24,"joint_position":[-9.646394093305529e-15,0.0005742267230289179,0.00048420503771870194,0.00013015519623142674,6.796283742494389e-06,-3.5363577337894775e-06]},{"t_seconds":1.62,"contact_count":24,"joint_position":[-1.3672998590597421e-14,0.0005742267232609542,0.0004842050375044473,0.0001301551962236839,6.7962837421997305e-06,-3.5363577337300836e-06]},{"t_seconds":1.64,"contact_count":24,"joint_position":[-2.7139453121462522e-14,0.0005742267240009103,0.0004842050367819331,0.00013015519620005606,6.796283741268953e-06,-3.5363577335865805e-06]},{"t_seconds":1.66,"contact_count":24,"joint_position":[-2.6294064755257915e-14,0.0005742267239802167,0.0004842050368821804,0.00013015519619804833,6.796283741228308e-06,-3.5363577334590267e-06]},{"t_seconds":1.68,"contact_count":24,"joint_position":[-2.324271786653569e-14,0.000574226723840009,0.0004842050370705497,0.00013015519619966187,6.796283741316219e-06,-3.5363577333812678e-06]},{"t_seconds":1.7,"contact_count":24,"joint_position":[-3.210581720214571e-14,0.0005742267243376695,0.0004842050365830228,0.00013015519618179348,6.796283740611113e-06,-3.5363577332458666e-06]},{"t_seconds":1.72,"contact_count":24,"joint_position":[-3.005166127755978e-14,0.0005742267242528273,0.00048420503672561195,0.00013015519618128377,6.796283740615742e-06,-3.536357733135419e-06]},{"t_seconds":1.74,"contact_count":24,"joint_position":[-2.5316100432539333e-14,0.0005742267240268333,0.0004842050369798833,0.00013015519618407822,6.796283740745323e-06,-3.53635773305707e-06]},{"t_seconds":1.76,"contact_count":24,"joint_position":[-3.087370755936473e-14,0.0005742267243493491,0.00048420503664941666,0.0001301551961706548,6.796283740210735e-06,-3.5363577329421223e-06]},{"t_seconds":1.78,"contact_count":24,"joint_position":[-2.8659582319684286e-14,0.0005742267242544508,0.0004842050367823263,0.00013015519617014,6.7962837402092726e-06,-3.5363577328433565e-06]},{"t_seconds":1.8,"contact_count":24,"joint_position":[-2.2718805851789877e-14,0.0005742267239632579,0.00048420503709433344,0.00013015519617488405,6.796283740412405e-06,-3.536357732776483e-06]},{"t_seconds":1.82,"contact_count":24,"joint_position":[-1.0674833504044226e-14,0.000574226723352894,0.0004842050377244704,0.00013015519618742532,6.796283740925891e-06,-3.536357732709874e-06]},{"t_seconds":1.84,"contact_count":24,"joint_position":[1.4378099541482621e-15,0.0005742267227440732,0.0004842050383132962,0.0001301551961987138,6.796283741380701e-06,-3.5363577326584535e-06]},{"t_seconds":1.86,"contact_count":24,"joint_position":[-1.3818043623579933e-15,0.0005742267229274709,0.0004842050380648129,0.00013015519618709908,6.7962837409083034e-06,-3.5363577325649376e-06]},{"t_seconds":1.88,"contact_count":24,"joint_position":[-5.297484983219055e-15,0.0005742267231540513,0.00048420503781342446,0.00013015519617805147,6.796283740546716e-06,-3.5363577325067613e-06]},{"t_seconds":1.9,"contact_count":24,"joint_position":[-4.438955365605934e-15,0.0005742267231196521,0.00048420503785904915,0.00013015519617801523,6.796283740552351e-06,-3.5363577324718195e-06]},{"t_seconds":1.92,"contact_count":24,"joint_position":[5.072174625170049e-15,0.0005742267226340432,0.0004842050383607063,0.00013015519618858322,6.796283740981688e-06,-3.5363577324265668e-06]},{"t_seconds":1.94,"contact_count":24,"joint_position":[4.529454983103067e-15,0.0005742267226845097,0.00048420503827712456,0.00013015519618283987,6.796283740747821e-06,-3.5363577323589253e-06]},{"t_seconds":1.96,"contact_count":24,"joint_position":[3.5770842512889074e-16,0.0005742267229185025,0.00048420503802782777,0.00013015519617415474,6.7962837403998465e-06,-3.5363577323036644e-06]},{"t_seconds":1.98,"contact_count":24,"joint_position":[-2.27176981570365e-15,0.0005742267230628901,0.000484205037887985,0.00013015519616977537,6.796283740228053e-06,-3.536357732277114e-06]},{"t_seconds":2.0,"contact_count":24,"joint_position":[-3.61092318607827e-15,0.0005742267231349301,0.0004842050378280965,0.00013015519616807827,6.796283740163967e-06,-3.5363577322648694e-06]}],"motion_binary":{"href":"motion.bin.gz","compression":"gzip","bytes":42420,"compressed_bytes":6523,"sha256":"c27470b8d83ab88242d74cfe411cd85e12c7ae7f7ec9d2e3b2d85ba5891b8b2e"}} diff --git a/asset-library/v01/previews/so101/preview-integrity.json b/asset-library/v01/previews/so101/preview-integrity.json new file mode 100644 index 0000000000000000000000000000000000000000..5e6f806317afc5ffc6d41a215af061b86af5c3ab --- /dev/null +++ b/asset-library/v01/previews/so101/preview-integrity.json @@ -0,0 +1,70 @@ +{ + "schema": "dvidia.asset-preview-integrity/v1", + "scope": "Artifact consistency only, not authenticity or physical qualification", + "files": { + "scene.json": { + "bytes": 290, + "sha256": "24962e06594959eb2a432219425bd17b3fa74e428440c8e83c6edc5e984ae716" + }, + "catalog.json": { + "bytes": 25194, + "sha256": "82e44bf83ca4c64051b5dc99ca0d301cb416dfee6dc043e86582d6fd4fa490ba" + }, + "model.json": { + "bytes": 24776, + "sha256": "4cea6af308e91674c20c6cdf485f91b21bb71510b5d5b616abf622b24a6c2e30" + }, + "motion.json": { + "bytes": 20481, + "sha256": "5da18345066879ab48336df4735d863c497be2780b239c25b566003fab752407" + }, + "geometry.bin.gz": { + "bytes": 3182925, + "sha256": "494d7ce4ae7df05e51e0e9f7ed5c2dcb0a489817d72f8c83944e1d50e078396e" + }, + "motion.bin.gz": { + "bytes": 6523, + "sha256": "9b1ab54e527faad6324a0ef3f8be958d61aa62041d85c8171a7a5d3356f37f29" + }, + "index.html": { + "bytes": 9636, + "sha256": "41a97a426a2b72520e39a469eaa78f4b281c7fef9cf9607301af9c398594251f" + }, + "asset_library.bundle.js": { + "bytes": 529697, + "sha256": "fe7a98bf9b991a33d030114b9e447bd687230a9dbc381631fd316da408857ee9" + }, + "reference_replay.third-party.txt": { + "bytes": 1199, + "sha256": "ea4da6cf7a8a54649702f0eb8d057c8ced12f8fed2329c5e96d92a3316922813" + }, + "LICENSE": { + "bytes": 1076, + "sha256": "ab47d245880a661fdca3c6a4cb91671031302deee50d64f8d2d6df86832962e1" + }, + "licenses/robotstudio_so101/LICENSE": { + "bytes": 11357, + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + "licenses/robotstudio_so101/README.md": { + "bytes": 1142, + "sha256": "e2344e7c14290bed85c7907247aecb8bf6cb4392e3de0d7c45680efe9bb9b5a9" + }, + "scenes/trainer.json": { + "bytes": 222, + "sha256": "17ff0e251d0b53f0d9bb1cf3aa66ed59eea0a38f0f84956193d8837c3ad68e65" + }, + "scenes/ankle-boot.json": { + "bytes": 228, + "sha256": "f4a1f20229b52a54beb7eaf2e1e2f5b767ea9a5aea4945c15b637a67746dceca" + }, + "scenes/slipper.json": { + "bytes": 222, + "sha256": "1d78d4aac6129177b7053b102cd851dddc177483f15596554ef38e9d69e4d2a2" + }, + "README.md": { + "bytes": 897, + "sha256": "195849dd9df960ae7e42a29433c46c810132f52154ccc0ef3df79649d5aa89af" + } + } +} diff --git a/asset-library/v01/previews/so101/reference_replay.third-party.txt b/asset-library/v01/previews/so101/reference_replay.third-party.txt new file mode 100644 index 0000000000000000000000000000000000000000..90689e3bf3feb75cb7e7fb0e72cd389e508c35a5 --- /dev/null +++ b/asset-library/v01/previews/so101/reference_replay.third-party.txt @@ -0,0 +1,26 @@ +DVIDIA self-hosted reference replay + +Three.js 0.180.0 and OrbitControls +https://github.com/mrdoob/three.js/tree/r180 + +The MIT License + +Copyright © 2010-2025 three.js authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/asset-library/v01/previews/so101/scene.json b/asset-library/v01/previews/so101/scene.json new file mode 100644 index 0000000000000000000000000000000000000000..5f1cee1564bcd374fbd46b472b62ac4a3aa17fa4 --- /dev/null +++ b/asset-library/v01/previews/so101/scene.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-scene/v1","catalog_version":"0.1.0","catalog_sha256":"592f363389a96fef7f9223737aa72a2f1a74f400238924bf6790ec5bfd3302b7","robot":"so101","shoe_ids":["trainer-left","trainer-right","ankle-boot-left","ankle-boot-right","slipper-left","slipper-right"],"timestep":0.002} diff --git a/asset-library/v01/previews/so101/scenes/ankle-boot.json b/asset-library/v01/previews/so101/scenes/ankle-boot.json new file mode 100644 index 0000000000000000000000000000000000000000..15e137928f842fd650e23bc28da4b9eb7d5b1def --- /dev/null +++ b/asset-library/v01/previews/so101/scenes/ankle-boot.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-scene/v1","catalog_version":"0.1.0","catalog_sha256":"592f363389a96fef7f9223737aa72a2f1a74f400238924bf6790ec5bfd3302b7","robot":"so101","shoe_ids":["ankle-boot-left","ankle-boot-right"],"timestep":0.002} diff --git a/asset-library/v01/previews/so101/scenes/slipper.json b/asset-library/v01/previews/so101/scenes/slipper.json new file mode 100644 index 0000000000000000000000000000000000000000..72b6643f5060df9fefe0018d186da3a19000a045 --- /dev/null +++ b/asset-library/v01/previews/so101/scenes/slipper.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-scene/v1","catalog_version":"0.1.0","catalog_sha256":"592f363389a96fef7f9223737aa72a2f1a74f400238924bf6790ec5bfd3302b7","robot":"so101","shoe_ids":["slipper-left","slipper-right"],"timestep":0.002} diff --git a/asset-library/v01/previews/so101/scenes/trainer.json b/asset-library/v01/previews/so101/scenes/trainer.json new file mode 100644 index 0000000000000000000000000000000000000000..56fe0c3c52cc41fc39522a1e52c5c05e0411a08d --- /dev/null +++ b/asset-library/v01/previews/so101/scenes/trainer.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-scene/v1","catalog_version":"0.1.0","catalog_sha256":"592f363389a96fef7f9223737aa72a2f1a74f400238924bf6790ec5bfd3302b7","robot":"so101","shoe_ids":["trainer-left","trainer-right"],"timestep":0.002} diff --git a/asset-library/v01/previews/ur5e/LICENSE b/asset-library/v01/previews/ur5e/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a7056f2889009b6b736691291d2e65e63bab2fdc --- /dev/null +++ b/asset-library/v01/previews/ur5e/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 DVIDIA contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/asset-library/v01/previews/ur5e/README.md b/asset-library/v01/previews/ur5e/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7fd10d088e8f3f8d2bd46a8d7a54966e2aad5550 --- /dev/null +++ b/asset-library/v01/previews/ur5e/README.md @@ -0,0 +1,5 @@ +# DVIDIA asset library preview + +Recorded native MuJoCo scene settling with held arm commands. The browser displays saved poses and does not run physics. Shoes are authored rigid proxies with untested physical properties. No learned shoe skill, calibrated deformation, hardware or real-time qualification. + +Serve this directory with `python -m http.server 8000` and open http://localhost:8000. Everything is local; JavaScript, WebGL2 and DecompressionStream are required. The pair selector filters recorded objects visually; use a downloaded scene descriptor with dvidia-assets scene --config to compile and simulate only that pair. geometry.bin.gz and motion.bin.gz decode to bounded little-endian Float32 positions and wxyz quaternions. MIT applies to DVIDIA code and synthetic shoes. Robot model licenses and original READMEs remain under licenses/. Three.js/OrbitControls notices are included. diff --git a/asset-library/v01/previews/ur5e/asset_library.bundle.js b/asset-library/v01/previews/ur5e/asset_library.bundle.js new file mode 100644 index 0000000000000000000000000000000000000000..ae7d8edbc18ded9f1785e00e287bee9f3f73081c --- /dev/null +++ b/asset-library/v01/previews/ur5e/asset_library.bundle.js @@ -0,0 +1,3834 @@ +/* DVIDIA asset library. MIT; bundled Three.js r180, MIT. See reference_replay.third-party.txt. */ +(()=>{var Hn={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Gn={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Bl=0,uo=1,zl=2;var fo=1,kl=2,un=3,Sn=0,De=1,Ve=2,Tn=0,ni=1,po=2,mo=3,go=4,Vl=5,On=100,Hl=101,Gl=102,Wl=103,Xl=104,ql=200,Yl=201,Zl=202,Jl=203,sr=204,rr=205,$l=206,Kl=207,jl=208,Ql=209,tc=210,ec=211,nc=212,ic=213,sc=214,Ir=0,Pr=1,Dr=2,ii=3,Lr=4,Ur=5,Nr=6,Fr=7,_o=0,rc=1,ac=2,wn=0,oc=1,lc=2,cc=3,Or=4,hc=5,uc=6,dc=7;var xo=300,li=301,ci=302,Br=303,zr=304,Rs=306,ar=1e3,Fn=1001,or=1002,Ye=1003,fc=1004;var Cs=1005;var tn=1006,kr=1007;var Wn=1008;var sn=1009,yo=1010,vo=1011,ki=1012,Vr=1013,Xn=1014,dn=1015,Vi=1016,Hr=1017,Gr=1018,Hi=1020,Mo=35902,So=35899,bo=1021,Eo=1022,Je=1023,Pi=1026,Gi=1027,To=1028,Wr=1029,wo=1030,Xr=1031;var qr=1033,Is=33776,Ps=33777,Ds=33778,Ls=33779,Yr=35840,Zr=35841,Jr=35842,$r=35843,Kr=36196,jr=37492,Qr=37496,ta=37808,ea=37809,na=37810,ia=37811,sa=37812,ra=37813,aa=37814,oa=37815,la=37816,ca=37817,ha=37818,ua=37819,da=37820,fa=37821,pa=36492,ma=36494,ga=36495,_a=36283,xa=36284,ya=36285,va=36286;var rs=2300,lr=2301,ir=2302,io=2400,so=2401,ro=2402;var pc=3200,mc=3201;var Ao=0,gc=1,An="",Ce="srgb",bn="srgb-linear",as="linear",Yt="srgb";var ei=7680;var ao=519,_c=512,xc=513,yc=514,Ro=515,vc=516,Mc=517,Sc=518,bc=519,oo=35044;var Co="300 es",Qe=2e3,os=2001;var ln=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){let n=this._listeners;return n===void 0?!1:n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){let n=this._listeners;if(n===void 0)return;let s=n[t];if(s!==void 0){let r=s.indexOf(e);r!==-1&&s.splice(r,1)}}dispatchEvent(t){let e=this._listeners;if(e===void 0)return;let n=e[t.type];if(n!==void 0){t.target=this;let s=n.slice(0);for(let r=0,a=s.length;r>8&255]+Se[i>>16&255]+Se[i>>24&255]+"-"+Se[t&255]+Se[t>>8&255]+"-"+Se[t>>16&15|64]+Se[t>>24&255]+"-"+Se[e&63|128]+Se[e>>8&255]+"-"+Se[e>>16&255]+Se[e>>24&255]+Se[n&255]+Se[n>>8&255]+Se[n>>16&255]+Se[n>>24&255]).toLowerCase()}function zt(i,t,e){return Math.max(t,Math.min(e,i))}function Io(i,t){return(i%t+t)%t}function yh(i,t,e,n,s){return n+(i-t)*(s-n)/(e-t)}function vh(i,t,e){return i!==t?(e-i)/(t-i):0}function ss(i,t,e){return(1-e)*i+e*t}function Mh(i,t,e,n){return ss(i,t,1-Math.exp(-e*n))}function Sh(i,t=1){return t-Math.abs(Io(i,t*2)-t)}function bh(i,t,e){return i<=t?0:i>=e?1:(i=(i-t)/(e-t),i*i*(3-2*i))}function Eh(i,t,e){return i<=t?0:i>=e?1:(i=(i-t)/(e-t),i*i*i*(i*(i*6-15)+10))}function Th(i,t){return i+Math.floor(Math.random()*(t-i+1))}function wh(i,t){return i+Math.random()*(t-i)}function Ah(i){return i*(.5-Math.random())}function Rh(i){i!==void 0&&(pl=i);let t=pl+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Ch(i){return i*is}function Ih(i){return i*Di}function Ph(i){return(i&i-1)===0&&i!==0}function Dh(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function Lh(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function Uh(i,t,e,n,s){let r=Math.cos,a=Math.sin,o=r(e/2),c=a(e/2),l=r((t+n)/2),h=a((t+n)/2),d=r((t-n)/2),f=a((t-n)/2),p=r((n-t)/2),_=a((n-t)/2);switch(s){case"XYX":i.set(o*h,c*d,c*f,o*l);break;case"YZY":i.set(c*f,o*h,c*d,o*l);break;case"ZXZ":i.set(c*d,c*f,o*h,o*l);break;case"XZX":i.set(o*h,c*_,c*p,o*l);break;case"YXY":i.set(c*p,o*h,c*_,o*l);break;case"ZYZ":i.set(c*_,c*p,o*h,o*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function Ci(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function Re(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}var Po={DEG2RAD:is,RAD2DEG:Di,generateUUID:Wi,clamp:zt,euclideanModulo:Io,mapLinear:yh,inverseLerp:vh,lerp:ss,damp:Mh,pingpong:Sh,smoothstep:bh,smootherstep:Eh,randInt:Th,randFloat:wh,randFloatSpread:Ah,seededRandom:Rh,degToRad:Ch,radToDeg:Ih,isPowerOfTwo:Ph,ceilPowerOfTwo:Dh,floorPowerOfTwo:Lh,setQuaternionFromProperEuler:Uh,normalize:Re,denormalize:Ci},Pt=class i{constructor(t=0,e=0){i.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,n=this.y,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6],this.y=s[1]*e+s[4]*n+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=zt(this.x,t.x,e.x),this.y=zt(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=zt(this.x,t,e),this.y=zt(this.y,t,e),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(zt(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(zt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let n=Math.cos(e),s=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*n-a*s+t.x,this.y=r*s+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Ze=class{constructor(t=0,e=0,n=0,s=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=s}static slerpFlat(t,e,n,s,r,a,o){let c=n[s+0],l=n[s+1],h=n[s+2],d=n[s+3],f=r[a+0],p=r[a+1],_=r[a+2],y=r[a+3];if(o===0){t[e+0]=c,t[e+1]=l,t[e+2]=h,t[e+3]=d;return}if(o===1){t[e+0]=f,t[e+1]=p,t[e+2]=_,t[e+3]=y;return}if(d!==y||c!==f||l!==p||h!==_){let m=1-o,u=c*f+l*p+h*_+d*y,T=u>=0?1:-1,E=1-u*u;if(E>Number.EPSILON){let R=Math.sqrt(E),A=Math.atan2(R,u*T);m=Math.sin(m*A)/R,o=Math.sin(o*A)/R}let S=o*T;if(c=c*m+f*S,l=l*m+p*S,h=h*m+_*S,d=d*m+y*S,m===1-o){let R=1/Math.sqrt(c*c+l*l+h*h+d*d);c*=R,l*=R,h*=R,d*=R}}t[e]=c,t[e+1]=l,t[e+2]=h,t[e+3]=d}static multiplyQuaternionsFlat(t,e,n,s,r,a){let o=n[s],c=n[s+1],l=n[s+2],h=n[s+3],d=r[a],f=r[a+1],p=r[a+2],_=r[a+3];return t[e]=o*_+h*d+c*p-l*f,t[e+1]=c*_+h*f+l*d-o*p,t[e+2]=l*_+h*p+o*f-c*d,t[e+3]=h*_-o*d-c*f-l*p,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,s){return this._x=t,this._y=e,this._z=n,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let n=t._x,s=t._y,r=t._z,a=t._order,o=Math.cos,c=Math.sin,l=o(n/2),h=o(s/2),d=o(r/2),f=c(n/2),p=c(s/2),_=c(r/2);switch(a){case"XYZ":this._x=f*h*d+l*p*_,this._y=l*p*d-f*h*_,this._z=l*h*_+f*p*d,this._w=l*h*d-f*p*_;break;case"YXZ":this._x=f*h*d+l*p*_,this._y=l*p*d-f*h*_,this._z=l*h*_-f*p*d,this._w=l*h*d+f*p*_;break;case"ZXY":this._x=f*h*d-l*p*_,this._y=l*p*d+f*h*_,this._z=l*h*_+f*p*d,this._w=l*h*d-f*p*_;break;case"ZYX":this._x=f*h*d-l*p*_,this._y=l*p*d+f*h*_,this._z=l*h*_-f*p*d,this._w=l*h*d+f*p*_;break;case"YZX":this._x=f*h*d+l*p*_,this._y=l*p*d+f*h*_,this._z=l*h*_-f*p*d,this._w=l*h*d-f*p*_;break;case"XZY":this._x=f*h*d-l*p*_,this._y=l*p*d-f*h*_,this._z=l*h*_+f*p*d,this._w=l*h*d+f*p*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let n=e/2,s=Math.sin(n);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,n=e[0],s=e[4],r=e[8],a=e[1],o=e[5],c=e[9],l=e[2],h=e[6],d=e[10],f=n+o+d;if(f>0){let p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(h-c)*p,this._y=(r-l)*p,this._z=(a-s)*p}else if(n>o&&n>d){let p=2*Math.sqrt(1+n-o-d);this._w=(h-c)/p,this._x=.25*p,this._y=(s+a)/p,this._z=(r+l)/p}else if(o>d){let p=2*Math.sqrt(1+o-n-d);this._w=(r-l)/p,this._x=(s+a)/p,this._y=.25*p,this._z=(c+h)/p}else{let p=2*Math.sqrt(1+d-n-o);this._w=(a-s)/p,this._x=(r+l)/p,this._y=(c+h)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<1e-8?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(zt(this.dot(t),-1,1)))}rotateTowards(t,e){let n=this.angleTo(t);if(n===0)return this;let s=Math.min(1,e/n);return this.slerp(t,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let n=t._x,s=t._y,r=t._z,a=t._w,o=e._x,c=e._y,l=e._z,h=e._w;return this._x=n*h+a*o+s*l-r*c,this._y=s*h+a*c+r*o-n*l,this._z=r*h+a*l+n*c-s*o,this._w=a*h-n*o-s*c-r*l,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);let n=this._x,s=this._y,r=this._z,a=this._w,o=a*t._w+n*t._x+s*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=n,this._y=s,this._z=r,this;let c=1-o*o;if(c<=Number.EPSILON){let p=1-e;return this._w=p*a+e*this._w,this._x=p*n+e*this._x,this._y=p*s+e*this._y,this._z=p*r+e*this._z,this.normalize(),this}let l=Math.sqrt(c),h=Math.atan2(l,o),d=Math.sin((1-e)*h)/l,f=Math.sin(e*h)/l;return this._w=a*d+this._w*f,this._x=n*d+this._x*f,this._y=s*d+this._y*f,this._z=r*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),s=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(s*Math.sin(t),s*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},L=class i{constructor(t=0,e=0,n=0){i.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(ml.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(ml.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,n=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*s,this.y=r[1]*e+r[4]*n+r[7]*s,this.z=r[2]*e+r[5]*n+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,n=this.y,s=this.z,r=t.elements,a=1/(r[3]*e+r[7]*n+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*s+r[12])*a,this.y=(r[1]*e+r[5]*n+r[9]*s+r[13])*a,this.z=(r[2]*e+r[6]*n+r[10]*s+r[14])*a,this}applyQuaternion(t){let e=this.x,n=this.y,s=this.z,r=t.x,a=t.y,o=t.z,c=t.w,l=2*(a*s-o*n),h=2*(o*e-r*s),d=2*(r*n-a*e);return this.x=e+c*l+a*d-o*h,this.y=n+c*h+o*l-r*d,this.z=s+c*d+r*h-a*l,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,n=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*s,this.y=r[1]*e+r[5]*n+r[9]*s,this.z=r[2]*e+r[6]*n+r[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=zt(this.x,t.x,e.x),this.y=zt(this.y,t.y,e.y),this.z=zt(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=zt(this.x,t,e),this.y=zt(this.y,t,e),this.z=zt(this.z,t,e),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(zt(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let n=t.x,s=t.y,r=t.z,a=e.x,o=e.y,c=e.z;return this.x=s*c-r*o,this.y=r*a-n*c,this.z=n*o-s*a,this}projectOnVector(t){let e=t.lengthSq();if(e===0)return this.set(0,0,0);let n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return Ua.copy(this).projectOnVector(t),this.sub(Ua)}reflect(t){return this.sub(Ua.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(zt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y,s=this.z-t.z;return e*e+n*n+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){let s=Math.sin(e)*t;return this.x=s*Math.sin(n),this.y=Math.cos(e)*t,this.z=s*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},Ua=new L,ml=new Ze,Ut=class i{constructor(t,e,n,s,r,a,o,c,l){i.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,s,r,a,o,c,l)}set(t,e,n,s,r,a,o,c,l){let h=this.elements;return h[0]=t,h[1]=s,h[2]=o,h[3]=e,h[4]=r,h[5]=c,h[6]=n,h[7]=a,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,s=e.elements,r=this.elements,a=n[0],o=n[3],c=n[6],l=n[1],h=n[4],d=n[7],f=n[2],p=n[5],_=n[8],y=s[0],m=s[3],u=s[6],T=s[1],E=s[4],S=s[7],R=s[2],A=s[5],P=s[8];return r[0]=a*y+o*T+c*R,r[3]=a*m+o*E+c*A,r[6]=a*u+o*S+c*P,r[1]=l*y+h*T+d*R,r[4]=l*m+h*E+d*A,r[7]=l*u+h*S+d*P,r[2]=f*y+p*T+_*R,r[5]=f*m+p*E+_*A,r[8]=f*u+p*S+_*P,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],c=t[6],l=t[7],h=t[8];return e*a*h-e*o*l-n*r*h+n*o*c+s*r*l-s*a*c}invert(){let t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],c=t[6],l=t[7],h=t[8],d=h*a-o*l,f=o*c-h*r,p=l*r-a*c,_=e*d+n*f+s*p;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);let y=1/_;return t[0]=d*y,t[1]=(s*l-h*n)*y,t[2]=(o*n-s*a)*y,t[3]=f*y,t[4]=(h*e-s*c)*y,t[5]=(s*r-o*e)*y,t[6]=p*y,t[7]=(n*c-l*e)*y,t[8]=(a*e-n*r)*y,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,s,r,a,o){let c=Math.cos(r),l=Math.sin(r);return this.set(n*c,n*l,-n*(c*a+l*o)+a+t,-s*l,s*c,-s*(-l*a+c*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(Na.makeScale(t,e)),this}rotate(t){return this.premultiply(Na.makeRotation(-t)),this}translate(t,e){return this.premultiply(Na.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,n=t.elements;for(let s=0;s<9;s++)if(e[s]!==n[s])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}},Na=new Ut;function Do(i){for(let t=i.length-1;t>=0;--t)if(i[t]>=65535)return!0;return!1}function ls(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function Ec(){let i=ls("canvas");return i.style.display="block",i}var gl={};function Li(i){i in gl||(gl[i]=!0,console.warn(i))}function Tc(i,t,e){return new Promise(function(n,s){function r(){switch(i.clientWaitSync(t,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:s();break;case i.TIMEOUT_EXPIRED:setTimeout(r,e);break;default:n()}}setTimeout(r,e)})}var _l=new Ut().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),xl=new Ut().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Nh(){let i={enabled:!0,workingColorSpace:bn,spaces:{},convert:function(s,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===Yt&&(s.r=Mn(s.r),s.g=Mn(s.g),s.b=Mn(s.b)),this.spaces[r].primaries!==this.spaces[a].primaries&&(s.applyMatrix3(this.spaces[r].toXYZ),s.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Yt&&(s.r=Ii(s.r),s.g=Ii(s.g),s.b=Ii(s.b))),s},workingToColorSpace:function(s,r){return this.convert(s,this.workingColorSpace,r)},colorSpaceToWorking:function(s,r){return this.convert(s,r,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===An?as:this.spaces[s].transfer},getToneMappingMode:function(s){return this.spaces[s].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(s,r=this.workingColorSpace){return s.fromArray(this.spaces[r].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,r,a){return s.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(s,r){return Li("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),i.workingToColorSpace(s,r)},toWorkingColorSpace:function(s,r){return Li("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),i.colorSpaceToWorking(s,r)}},t=[.64,.33,.3,.6,.15,.06],e=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[bn]:{primaries:t,whitePoint:n,transfer:as,toXYZ:_l,fromXYZ:xl,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:Ce},outputColorSpaceConfig:{drawingBufferColorSpace:Ce}},[Ce]:{primaries:t,whitePoint:n,transfer:Yt,toXYZ:_l,fromXYZ:xl,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:Ce}}}),i}var Gt=Nh();function Mn(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function Ii(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}var _i,cr=class{static getDataURL(t,e="image/png"){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let n;if(t instanceof HTMLCanvasElement)n=t;else{_i===void 0&&(_i=ls("canvas")),_i.width=t.width,_i.height=t.height;let s=_i.getContext("2d");t instanceof ImageData?s.putImageData(t,0,0):s.drawImage(t,0,0,t.width,t.height),n=_i}return n.toDataURL(e)}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let e=ls("canvas");e.width=t.width,e.height=t.height;let n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);let s=n.getImageData(0,0,t.width,t.height),r=s.data;for(let a=0;a1),this.pmremVersion=0}get width(){return this.source.getSize(Oa).x}get height(){return this.source.getSize(Oa).y}get depth(){return this.source.getSize(Oa).z}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(let e in t){let n=t[e];if(n===void 0){console.warn(`THREE.Texture.setValues(): parameter '${e}' has value of undefined.`);continue}let s=this[e];if(s===void 0){console.warn(`THREE.Texture.setValues(): property '${e}' does not exist.`);continue}s&&n&&s.isVector2&&n.isVector2||s&&n&&s.isVector3&&n.isVector3||s&&n&&s.isMatrix3&&n.isMatrix3?s.copy(n):this[e]=n}}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==xo)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case ar:t.x=t.x-Math.floor(t.x);break;case Fn:t.x=t.x<0?0:1;break;case or:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case ar:t.y=t.y-Math.floor(t.y);break;case Fn:t.y=t.y<0?0:1;break;case or:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}};ze.DEFAULT_IMAGE=null;ze.DEFAULT_MAPPING=xo;ze.DEFAULT_ANISOTROPY=1;var le=class i{constructor(t=0,e=0,n=0,s=1){i.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=s}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,s){return this.x=t,this.y=e,this.z=n,this.w=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,n=this.y,s=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*s+a[12]*r,this.y=a[1]*e+a[5]*n+a[9]*s+a[13]*r,this.z=a[2]*e+a[6]*n+a[10]*s+a[14]*r,this.w=a[3]*e+a[7]*n+a[11]*s+a[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,s,r,c=t.elements,l=c[0],h=c[4],d=c[8],f=c[1],p=c[5],_=c[9],y=c[2],m=c[6],u=c[10];if(Math.abs(h-f)<.01&&Math.abs(d-y)<.01&&Math.abs(_-m)<.01){if(Math.abs(h+f)<.1&&Math.abs(d+y)<.1&&Math.abs(_+m)<.1&&Math.abs(l+p+u-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let E=(l+1)/2,S=(p+1)/2,R=(u+1)/2,A=(h+f)/4,P=(d+y)/4,N=(_+m)/4;return E>S&&E>R?E<.01?(n=0,s=.707106781,r=.707106781):(n=Math.sqrt(E),s=A/n,r=P/n):S>R?S<.01?(n=.707106781,s=0,r=.707106781):(s=Math.sqrt(S),n=A/s,r=N/s):R<.01?(n=.707106781,s=.707106781,r=0):(r=Math.sqrt(R),n=P/r,s=N/r),this.set(n,s,r,e),this}let T=Math.sqrt((m-_)*(m-_)+(d-y)*(d-y)+(f-h)*(f-h));return Math.abs(T)<.001&&(T=1),this.x=(m-_)/T,this.y=(d-y)/T,this.z=(f-h)/T,this.w=Math.acos((l+p+u-1)/2),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=zt(this.x,t.x,e.x),this.y=zt(this.y,t.y,e.y),this.z=zt(this.z,t.z,e.z),this.w=zt(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=zt(this.x,t,e),this.y=zt(this.y,t,e),this.z=zt(this.z,t,e),this.w=zt(this.w,t,e),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(zt(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},hr=class extends ln{constructor(t=1,e=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:tn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=n.depth,this.scissor=new le(0,0,t,e),this.scissorTest=!1,this.viewport=new le(0,0,t,e);let s={width:t,height:e,depth:n.depth},r=new ze(s);this.textures=[];let a=n.count;for(let o=0;o1;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,n=t.textures.length;e=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,$e),$e.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(ji),Bs.subVectors(this.max,ji),xi.subVectors(t.a,ji),yi.subVectors(t.b,ji),vi.subVectors(t.c,ji),Cn.subVectors(yi,xi),In.subVectors(vi,yi),Kn.subVectors(xi,vi);let e=[0,-Cn.z,Cn.y,0,-In.z,In.y,0,-Kn.z,Kn.y,Cn.z,0,-Cn.x,In.z,0,-In.x,Kn.z,0,-Kn.x,-Cn.y,Cn.x,0,-In.y,In.x,0,-Kn.y,Kn.x,0];return!Ba(e,xi,yi,vi,Bs)||(e=[1,0,0,0,1,0,0,0,1],!Ba(e,xi,yi,vi,Bs))?!1:(zs.crossVectors(Cn,In),e=[zs.x,zs.y,zs.z],Ba(e,xi,yi,vi,Bs))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,$e).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize($e).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(mn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),mn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),mn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),mn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),mn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),mn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),mn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),mn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(mn),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}},mn=[new L,new L,new L,new L,new L,new L,new L,new L],$e=new L,Os=new hn,xi=new L,yi=new L,vi=new L,Cn=new L,In=new L,Kn=new L,ji=new L,Bs=new L,zs=new L,jn=new L;function Ba(i,t,e,n,s){for(let r=0,a=i.length-3;r<=a;r+=3){jn.fromArray(i,r);let o=s.x*Math.abs(jn.x)+s.y*Math.abs(jn.y)+s.z*Math.abs(jn.z),c=t.dot(jn),l=e.dot(jn),h=n.dot(jn);if(Math.max(-Math.max(c,l,h),Math.min(c,l,h))>o)return!1}return!0}var Bh=new hn,Qi=new L,za=new L,si=class{constructor(t=new L,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let n=this.center;e!==void 0?n.copy(e):Bh.setFromPoints(t).getCenter(n);let s=0;for(let r=0,a=t.length;rthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Qi.subVectors(t,this.center);let e=Qi.lengthSq();if(e>this.radius*this.radius){let n=Math.sqrt(e),s=(n-this.radius)*.5;this.center.addScaledVector(Qi,s/n),this.radius+=s}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(za.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Qi.copy(t.center).add(za)),this.expandByPoint(Qi.copy(t.center).sub(za))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}},gn=new L,ka=new L,ks=new L,Pn=new L,Va=new L,Vs=new L,Ha=new L,ri=class{constructor(t=new L,e=new L(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,gn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=gn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(gn.copy(this.origin).addScaledVector(this.direction,e),gn.distanceToSquared(t))}distanceSqToSegment(t,e,n,s){ka.copy(t).add(e).multiplyScalar(.5),ks.copy(e).sub(t).normalize(),Pn.copy(this.origin).sub(ka);let r=t.distanceTo(e)*.5,a=-this.direction.dot(ks),o=Pn.dot(this.direction),c=-Pn.dot(ks),l=Pn.lengthSq(),h=Math.abs(1-a*a),d,f,p,_;if(h>0)if(d=a*c-o,f=a*o-c,_=r*h,d>=0)if(f>=-_)if(f<=_){let y=1/h;d*=y,f*=y,p=d*(d+a*f+2*o)+f*(a*d+f+2*c)+l}else f=r,d=Math.max(0,-(a*f+o)),p=-d*d+f*(f+2*c)+l;else f=-r,d=Math.max(0,-(a*f+o)),p=-d*d+f*(f+2*c)+l;else f<=-_?(d=Math.max(0,-(-a*r+o)),f=d>0?-r:Math.min(Math.max(-r,-c),r),p=-d*d+f*(f+2*c)+l):f<=_?(d=0,f=Math.min(Math.max(-r,-c),r),p=f*(f+2*c)+l):(d=Math.max(0,-(a*r+o)),f=d>0?r:Math.min(Math.max(-r,-c),r),p=-d*d+f*(f+2*c)+l);else f=a>0?-r:r,d=Math.max(0,-(a*f+o)),p=-d*d+f*(f+2*c)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,d),s&&s.copy(ka).addScaledVector(ks,f),p}intersectSphere(t,e){gn.subVectors(t.center,this.origin);let n=gn.dot(this.direction),s=gn.dot(gn)-n*n,r=t.radius*t.radius;if(s>r)return null;let a=Math.sqrt(r-s),o=n-a,c=n+a;return c<0?null:o<0?this.at(c,e):this.at(o,e)}intersectsSphere(t){return t.radius<0?!1:this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){let n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,s,r,a,o,c,l=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,f=this.origin;return l>=0?(n=(t.min.x-f.x)*l,s=(t.max.x-f.x)*l):(n=(t.max.x-f.x)*l,s=(t.min.x-f.x)*l),h>=0?(r=(t.min.y-f.y)*h,a=(t.max.y-f.y)*h):(r=(t.max.y-f.y)*h,a=(t.min.y-f.y)*h),n>a||r>s||((r>n||isNaN(n))&&(n=r),(a=0?(o=(t.min.z-f.z)*d,c=(t.max.z-f.z)*d):(o=(t.max.z-f.z)*d,c=(t.min.z-f.z)*d),n>c||o>s)||((o>n||n!==n)&&(n=o),(c=0?n:s,e)}intersectsBox(t){return this.intersectBox(t,gn)!==null}intersectTriangle(t,e,n,s,r){Va.subVectors(e,t),Vs.subVectors(n,t),Ha.crossVectors(Va,Vs);let a=this.direction.dot(Ha),o;if(a>0){if(s)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Pn.subVectors(this.origin,t);let c=o*this.direction.dot(Vs.crossVectors(Pn,Vs));if(c<0)return null;let l=o*this.direction.dot(Va.cross(Pn));if(l<0||c+l>a)return null;let h=-o*Pn.dot(Ha);return h<0?null:this.at(h/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},he=class i{constructor(t,e,n,s,r,a,o,c,l,h,d,f,p,_,y,m){i.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,s,r,a,o,c,l,h,d,f,p,_,y,m)}set(t,e,n,s,r,a,o,c,l,h,d,f,p,_,y,m){let u=this.elements;return u[0]=t,u[4]=e,u[8]=n,u[12]=s,u[1]=r,u[5]=a,u[9]=o,u[13]=c,u[2]=l,u[6]=h,u[10]=d,u[14]=f,u[3]=p,u[7]=_,u[11]=y,u[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new i().fromArray(this.elements)}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){let e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){let e=this.elements,n=t.elements,s=1/Mi.setFromMatrixColumn(t,0).length(),r=1/Mi.setFromMatrixColumn(t,1).length(),a=1/Mi.setFromMatrixColumn(t,2).length();return e[0]=n[0]*s,e[1]=n[1]*s,e[2]=n[2]*s,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,n=t.x,s=t.y,r=t.z,a=Math.cos(n),o=Math.sin(n),c=Math.cos(s),l=Math.sin(s),h=Math.cos(r),d=Math.sin(r);if(t.order==="XYZ"){let f=a*h,p=a*d,_=o*h,y=o*d;e[0]=c*h,e[4]=-c*d,e[8]=l,e[1]=p+_*l,e[5]=f-y*l,e[9]=-o*c,e[2]=y-f*l,e[6]=_+p*l,e[10]=a*c}else if(t.order==="YXZ"){let f=c*h,p=c*d,_=l*h,y=l*d;e[0]=f+y*o,e[4]=_*o-p,e[8]=a*l,e[1]=a*d,e[5]=a*h,e[9]=-o,e[2]=p*o-_,e[6]=y+f*o,e[10]=a*c}else if(t.order==="ZXY"){let f=c*h,p=c*d,_=l*h,y=l*d;e[0]=f-y*o,e[4]=-a*d,e[8]=_+p*o,e[1]=p+_*o,e[5]=a*h,e[9]=y-f*o,e[2]=-a*l,e[6]=o,e[10]=a*c}else if(t.order==="ZYX"){let f=a*h,p=a*d,_=o*h,y=o*d;e[0]=c*h,e[4]=_*l-p,e[8]=f*l+y,e[1]=c*d,e[5]=y*l+f,e[9]=p*l-_,e[2]=-l,e[6]=o*c,e[10]=a*c}else if(t.order==="YZX"){let f=a*c,p=a*l,_=o*c,y=o*l;e[0]=c*h,e[4]=y-f*d,e[8]=_*d+p,e[1]=d,e[5]=a*h,e[9]=-o*h,e[2]=-l*h,e[6]=p*d+_,e[10]=f-y*d}else if(t.order==="XZY"){let f=a*c,p=a*l,_=o*c,y=o*l;e[0]=c*h,e[4]=-d,e[8]=l*h,e[1]=f*d+y,e[5]=a*h,e[9]=p*d-_,e[2]=_*d-p,e[6]=o*h,e[10]=y*d+f}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(zh,t,kh)}lookAt(t,e,n){let s=this.elements;return Oe.subVectors(t,e),Oe.lengthSq()===0&&(Oe.z=1),Oe.normalize(),Dn.crossVectors(n,Oe),Dn.lengthSq()===0&&(Math.abs(n.z)===1?Oe.x+=1e-4:Oe.z+=1e-4,Oe.normalize(),Dn.crossVectors(n,Oe)),Dn.normalize(),Hs.crossVectors(Oe,Dn),s[0]=Dn.x,s[4]=Hs.x,s[8]=Oe.x,s[1]=Dn.y,s[5]=Hs.y,s[9]=Oe.y,s[2]=Dn.z,s[6]=Hs.z,s[10]=Oe.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,s=e.elements,r=this.elements,a=n[0],o=n[4],c=n[8],l=n[12],h=n[1],d=n[5],f=n[9],p=n[13],_=n[2],y=n[6],m=n[10],u=n[14],T=n[3],E=n[7],S=n[11],R=n[15],A=s[0],P=s[4],N=s[8],M=s[12],v=s[1],C=s[5],F=s[9],k=s[13],H=s[2],q=s[6],W=s[10],et=s[14],V=s[3],rt=s[7],ct=s[11],St=s[15];return r[0]=a*A+o*v+c*H+l*V,r[4]=a*P+o*C+c*q+l*rt,r[8]=a*N+o*F+c*W+l*ct,r[12]=a*M+o*k+c*et+l*St,r[1]=h*A+d*v+f*H+p*V,r[5]=h*P+d*C+f*q+p*rt,r[9]=h*N+d*F+f*W+p*ct,r[13]=h*M+d*k+f*et+p*St,r[2]=_*A+y*v+m*H+u*V,r[6]=_*P+y*C+m*q+u*rt,r[10]=_*N+y*F+m*W+u*ct,r[14]=_*M+y*k+m*et+u*St,r[3]=T*A+E*v+S*H+R*V,r[7]=T*P+E*C+S*q+R*rt,r[11]=T*N+E*F+S*W+R*ct,r[15]=T*M+E*k+S*et+R*St,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[4],s=t[8],r=t[12],a=t[1],o=t[5],c=t[9],l=t[13],h=t[2],d=t[6],f=t[10],p=t[14],_=t[3],y=t[7],m=t[11],u=t[15];return _*(+r*c*d-s*l*d-r*o*f+n*l*f+s*o*p-n*c*p)+y*(+e*c*p-e*l*f+r*a*f-s*a*p+s*l*h-r*c*h)+m*(+e*l*d-e*o*p-r*a*d+n*a*p+r*o*h-n*l*h)+u*(-s*o*h-e*c*d+e*o*f+s*a*d-n*a*f+n*c*h)}transpose(){let t=this.elements,e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){let s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=n),this}invert(){let t=this.elements,e=t[0],n=t[1],s=t[2],r=t[3],a=t[4],o=t[5],c=t[6],l=t[7],h=t[8],d=t[9],f=t[10],p=t[11],_=t[12],y=t[13],m=t[14],u=t[15],T=d*m*l-y*f*l+y*c*p-o*m*p-d*c*u+o*f*u,E=_*f*l-h*m*l-_*c*p+a*m*p+h*c*u-a*f*u,S=h*y*l-_*d*l+_*o*p-a*y*p-h*o*u+a*d*u,R=_*d*c-h*y*c-_*o*f+a*y*f+h*o*m-a*d*m,A=e*T+n*E+s*S+r*R;if(A===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let P=1/A;return t[0]=T*P,t[1]=(y*f*r-d*m*r-y*s*p+n*m*p+d*s*u-n*f*u)*P,t[2]=(o*m*r-y*c*r+y*s*l-n*m*l-o*s*u+n*c*u)*P,t[3]=(d*c*r-o*f*r-d*s*l+n*f*l+o*s*p-n*c*p)*P,t[4]=E*P,t[5]=(h*m*r-_*f*r+_*s*p-e*m*p-h*s*u+e*f*u)*P,t[6]=(_*c*r-a*m*r-_*s*l+e*m*l+a*s*u-e*c*u)*P,t[7]=(a*f*r-h*c*r+h*s*l-e*f*l-a*s*p+e*c*p)*P,t[8]=S*P,t[9]=(_*d*r-h*y*r-_*n*p+e*y*p+h*n*u-e*d*u)*P,t[10]=(a*y*r-_*o*r+_*n*l-e*y*l-a*n*u+e*o*u)*P,t[11]=(h*o*r-a*d*r-h*n*l+e*d*l+a*n*p-e*o*p)*P,t[12]=R*P,t[13]=(h*y*s-_*d*s+_*n*f-e*y*f-h*n*m+e*d*m)*P,t[14]=(_*o*s-a*y*s-_*n*c+e*y*c+a*n*m-e*o*m)*P,t[15]=(a*d*s-h*o*s+h*n*c-e*d*c-a*n*f+e*o*f)*P,this}scale(t){let e=this.elements,n=t.x,s=t.y,r=t.z;return e[0]*=n,e[4]*=s,e[8]*=r,e[1]*=n,e[5]*=s,e[9]*=r,e[2]*=n,e[6]*=s,e[10]*=r,e[3]*=n,e[7]*=s,e[11]*=r,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,s))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let n=Math.cos(e),s=Math.sin(e),r=1-n,a=t.x,o=t.y,c=t.z,l=r*a,h=r*o;return this.set(l*a+n,l*o-s*c,l*c+s*o,0,l*o+s*c,h*o+n,h*c-s*a,0,l*c-s*o,h*c+s*a,r*c*c+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,s,r,a){return this.set(1,n,r,0,t,1,a,0,e,s,1,0,0,0,0,1),this}compose(t,e,n){let s=this.elements,r=e._x,a=e._y,o=e._z,c=e._w,l=r+r,h=a+a,d=o+o,f=r*l,p=r*h,_=r*d,y=a*h,m=a*d,u=o*d,T=c*l,E=c*h,S=c*d,R=n.x,A=n.y,P=n.z;return s[0]=(1-(y+u))*R,s[1]=(p+S)*R,s[2]=(_-E)*R,s[3]=0,s[4]=(p-S)*A,s[5]=(1-(f+u))*A,s[6]=(m+T)*A,s[7]=0,s[8]=(_+E)*P,s[9]=(m-T)*P,s[10]=(1-(f+y))*P,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,n){let s=this.elements,r=Mi.set(s[0],s[1],s[2]).length(),a=Mi.set(s[4],s[5],s[6]).length(),o=Mi.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),t.x=s[12],t.y=s[13],t.z=s[14],Ke.copy(this);let l=1/r,h=1/a,d=1/o;return Ke.elements[0]*=l,Ke.elements[1]*=l,Ke.elements[2]*=l,Ke.elements[4]*=h,Ke.elements[5]*=h,Ke.elements[6]*=h,Ke.elements[8]*=d,Ke.elements[9]*=d,Ke.elements[10]*=d,e.setFromRotationMatrix(Ke),n.x=r,n.y=a,n.z=o,this}makePerspective(t,e,n,s,r,a,o=Qe,c=!1){let l=this.elements,h=2*r/(e-t),d=2*r/(n-s),f=(e+t)/(e-t),p=(n+s)/(n-s),_,y;if(c)_=r/(a-r),y=a*r/(a-r);else if(o===Qe)_=-(a+r)/(a-r),y=-2*a*r/(a-r);else if(o===os)_=-a/(a-r),y=-a*r/(a-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=h,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=d,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=_,l[14]=y,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,s,r,a,o=Qe,c=!1){let l=this.elements,h=2/(e-t),d=2/(n-s),f=-(e+t)/(e-t),p=-(n+s)/(n-s),_,y;if(c)_=1/(a-r),y=a/(a-r);else if(o===Qe)_=-2/(a-r),y=-(a+r)/(a-r);else if(o===os)_=-1/(a-r),y=-r/(a-r);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=h,l[4]=0,l[8]=0,l[12]=f,l[1]=0,l[5]=d,l[9]=0,l[13]=p,l[2]=0,l[6]=0,l[10]=_,l[14]=y,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){let e=this.elements,n=t.elements;for(let s=0;s<16;s++)if(e[s]!==n[s])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}},Mi=new L,Ke=new he,zh=new L(0,0,0),kh=new L(1,1,1),Dn=new L,Hs=new L,Oe=new L,yl=new he,vl=new Ze,en=class i{constructor(t=0,e=0,n=0,s=i.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,s=this._order){return this._x=t,this._y=e,this._z=n,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){let s=t.elements,r=s[0],a=s[4],o=s[8],c=s[1],l=s[5],h=s[9],d=s[2],f=s[6],p=s[10];switch(e){case"XYZ":this._y=Math.asin(zt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(f,l),this._z=0);break;case"YXZ":this._x=Math.asin(-zt(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,p),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-d,r),this._z=0);break;case"ZXY":this._x=Math.asin(zt(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,p),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(c,r));break;case"ZYX":this._y=Math.asin(-zt(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(c,r)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(zt(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-d,r)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-zt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,l),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return yl.makeRotationFromQuaternion(t),this.setFromRotationMatrix(yl,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return vl.setFromEuler(this),this.setFromQuaternion(vl,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};en.DEFAULT_ORDER="XYZ";var hs=class{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let e=0;e1){for(let n=0;n0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),s.instanceInfo=this._instanceInfo.map(o=>({...o})),s.availableInstanceIds=this._availableInstanceIds.slice(),s.availableGeometryIds=this._availableGeometryIds.slice(),s.nextIndexStart=this._nextIndexStart,s.nextVertexStart=this._nextVertexStart,s.geometryCount=this._geometryCount,s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.matricesTexture=this._matricesTexture.toJSON(t),s.indirectTexture=this._indirectTexture.toJSON(t),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(s.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(s.boundingBox=this.boundingBox.toJSON()));function r(o,c){return o[c.uuid]===void 0&&(o[c.uuid]=c.toJSON(t)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(t.geometries,this.geometry);let o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){let c=o.shapes;if(Array.isArray(c))for(let l=0,h=c.length;l0){s.children=[];for(let o=0;o0){s.animations=[];for(let o=0;o0&&(n.geometries=o),c.length>0&&(n.materials=c),l.length>0&&(n.textures=l),h.length>0&&(n.images=h),d.length>0&&(n.shapes=d),f.length>0&&(n.skeletons=f),p.length>0&&(n.animations=p),_.length>0&&(n.nodes=_)}return n.object=s,n;function a(o){let c=[];for(let l in o){let h=o[l];delete h.metadata,c.push(h)}return c}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(t,e,n,s,r){je.subVectors(s,e),xn.subVectors(n,e),Wa.subVectors(t,e);let a=je.dot(je),o=je.dot(xn),c=je.dot(Wa),l=xn.dot(xn),h=xn.dot(Wa),d=a*l-o*o;if(d===0)return r.set(0,0,0),null;let f=1/d,p=(l*c-o*h)*f,_=(a*h-o*c)*f;return r.set(1-p-_,_,p)}static containsPoint(t,e,n,s){return this.getBarycoord(t,e,n,s,yn)===null?!1:yn.x>=0&&yn.y>=0&&yn.x+yn.y<=1}static getInterpolation(t,e,n,s,r,a,o,c){return this.getBarycoord(t,e,n,s,yn)===null?(c.x=0,c.y=0,"z"in c&&(c.z=0),"w"in c&&(c.w=0),null):(c.setScalar(0),c.addScaledVector(r,yn.x),c.addScaledVector(a,yn.y),c.addScaledVector(o,yn.z),c)}static getInterpolatedAttribute(t,e,n,s,r,a){return Za.setScalar(0),Ja.setScalar(0),$a.setScalar(0),Za.fromBufferAttribute(t,e),Ja.fromBufferAttribute(t,n),$a.fromBufferAttribute(t,s),a.setScalar(0),a.addScaledVector(Za,r.x),a.addScaledVector(Ja,r.y),a.addScaledVector($a,r.z),a}static isFrontFacing(t,e,n,s){return je.subVectors(n,e),xn.subVectors(t,e),je.cross(xn).dot(s)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,s){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,n,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,s),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return je.subVectors(this.c,this.b),xn.subVectors(this.a,this.b),je.cross(xn).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return i.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return i.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,s,r){return i.getInterpolation(t,this.a,this.b,this.c,e,n,s,r)}containsPoint(t){return i.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return i.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let n=this.a,s=this.b,r=this.c,a,o;Ei.subVectors(s,n),Ti.subVectors(r,n),Xa.subVectors(t,n);let c=Ei.dot(Xa),l=Ti.dot(Xa);if(c<=0&&l<=0)return e.copy(n);qa.subVectors(t,s);let h=Ei.dot(qa),d=Ti.dot(qa);if(h>=0&&d<=h)return e.copy(s);let f=c*d-h*l;if(f<=0&&c>=0&&h<=0)return a=c/(c-h),e.copy(n).addScaledVector(Ei,a);Ya.subVectors(t,r);let p=Ei.dot(Ya),_=Ti.dot(Ya);if(_>=0&&p<=_)return e.copy(r);let y=p*l-c*_;if(y<=0&&l>=0&&_<=0)return o=l/(l-_),e.copy(n).addScaledVector(Ti,o);let m=h*_-p*d;if(m<=0&&d-h>=0&&p-_>=0)return wl.subVectors(r,s),o=(d-h)/(d-h+(p-_)),e.copy(s).addScaledVector(wl,o);let u=1/(m+y+f);return a=y*u,o=f*u,e.copy(n).addScaledVector(Ei,a).addScaledVector(Ti,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},wc={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ln={h:0,s:0,l:0},Ws={h:0,s:0,l:0};function Ka(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+(t-i)*6*e:e<1/2?t:e<2/3?i+(t-i)*6*(2/3-e):i}var Ot=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){let s=t;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Ce){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Gt.colorSpaceToWorking(this,e),this}setRGB(t,e,n,s=Gt.workingColorSpace){return this.r=t,this.g=e,this.b=n,Gt.colorSpaceToWorking(this,s),this}setHSL(t,e,n,s=Gt.workingColorSpace){if(t=Io(t,1),e=zt(e,0,1),n=zt(n,0,1),e===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+e):n+e-n*e,a=2*n-r;this.r=Ka(a,r,t+1/3),this.g=Ka(a,r,t),this.b=Ka(a,r,t-1/3)}return Gt.colorSpaceToWorking(this,s),this}setStyle(t,e=Ce){function n(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(t)){let r,a=s[1],o=s[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(t)){let r=s[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(r,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Ce){let n=wc[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Mn(t.r),this.g=Mn(t.g),this.b=Mn(t.b),this}copyLinearToSRGB(t){return this.r=Ii(t.r),this.g=Ii(t.g),this.b=Ii(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Ce){return Gt.workingToColorSpace(be.copy(this),t),Math.round(zt(be.r*255,0,255))*65536+Math.round(zt(be.g*255,0,255))*256+Math.round(zt(be.b*255,0,255))}getHexString(t=Ce){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Gt.workingColorSpace){Gt.workingToColorSpace(be.copy(this),e);let n=be.r,s=be.g,r=be.b,a=Math.max(n,s,r),o=Math.min(n,s,r),c,l,h=(o+a)/2;if(o===a)c=0,l=0;else{let d=a-o;switch(l=h<=.5?d/(a+o):d/(2-a-o),a){case n:c=(s-r)/d+(s0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(let e in t){let n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}let s=this[e];if(s===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(n):s&&s.isVector3&&n&&n.isVector3?s.copy(n):this[e]=n}}toJSON(t){let e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});let n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(t).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(t).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==ni&&(n.blending=this.blending),this.side!==Sn&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==sr&&(n.blendSrc=this.blendSrc),this.blendDst!==rr&&(n.blendDst=this.blendDst),this.blendEquation!==On&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==ii&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==ao&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ei&&(n.stencilFail=this.stencilFail),this.stencilZFail!==ei&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==ei&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function s(r){let a=[];for(let o in r){let c=r[o];delete c.metadata,a.push(c)}return a}if(e){let r=s(t.textures),a=s(t.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,n=null;if(e!==null){let s=e.length;n=new Array(s);for(let r=0;r!==s;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}},us=class extends En{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ot(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new en,this.combine=_o,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}};var de=new L,Xs=new Pt,qh=0,Te=class{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:qh++}),this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=oo,this.updateRanges=[],this.gpuType=dn,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let s=0,r=this.itemSize;se.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new hn);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new L(-1/0,-1/0,-1/0),new L(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,s=e.length;n0&&(t.userData=this.userData),this.parameters!==void 0){let c=this.parameters;for(let l in c)c[l]!==void 0&&(t[l]=c[l]);return t}t.data={attributes:{}};let e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let n=this.attributes;for(let c in n){let l=n[c];t.data.attributes[c]=l.toJSON(t.data)}let s={},r=!1;for(let c in this.morphAttributes){let l=this.morphAttributes[c],h=[];for(let d=0,f=l.length;d0&&(s[c]=h,r=!0)}r&&(t.data.morphAttributes=s,t.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(t.data.boundingSphere=o.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let n=t.index;n!==null&&this.setIndex(n.clone());let s=t.attributes;for(let l in s){let h=s[l];this.setAttribute(l,h.clone(e))}let r=t.morphAttributes;for(let l in r){let h=[],d=r[l];for(let f=0,p=d.length;f0){let s=e[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r(t.far-t.near)**2))&&(Al.copy(r).invert(),Qn.copy(t.ray).applyMatrix4(Al),!(n.boundingBox!==null&&Qn.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,Qn)))}_computeIntersections(t,e,n){let s,r=this.geometry,a=this.material,o=r.index,c=r.attributes.position,l=r.attributes.uv,h=r.attributes.uv1,d=r.attributes.normal,f=r.groups,p=r.drawRange;if(o!==null)if(Array.isArray(a))for(let _=0,y=f.length;_e.far?null:{distance:l,point:Ks.clone(),object:i}}function js(i,t,e,n,s,r,a,o,c,l){i.getVertexPosition(o,Ys),i.getVertexPosition(c,Zs),i.getVertexPosition(l,Js);let h=Zh(i,t,e,n,Ys,Zs,Js,Cl);if(h){let d=new L;Nn.getBarycoord(Cl,Ys,Zs,Js,d),s&&(h.uv=Nn.getInterpolatedAttribute(s,o,c,l,d,new Pt)),r&&(h.uv1=Nn.getInterpolatedAttribute(r,o,c,l,d,new Pt)),a&&(h.normal=Nn.getInterpolatedAttribute(a,o,c,l,d,new L),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));let f={a:o,b:c,c:l,normal:new L,materialIndex:0};Nn.getNormal(Ys,Zs,Js,f.normal),h.face=f,h.barycoord=d}return h}var Bn=class i extends Ie{constructor(t=1,e=1,n=1,s=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:s,heightSegments:r,depthSegments:a};let o=this;s=Math.floor(s),r=Math.floor(r),a=Math.floor(a);let c=[],l=[],h=[],d=[],f=0,p=0;_("z","y","x",-1,-1,n,e,t,a,r,0),_("z","y","x",1,-1,n,e,-t,a,r,1),_("x","z","y",1,1,t,n,e,s,a,2),_("x","z","y",1,-1,t,n,-e,s,a,3),_("x","y","z",1,-1,t,e,n,s,r,4),_("x","y","z",-1,-1,t,e,-n,s,r,5),this.setIndex(c),this.setAttribute("position",new oe(l,3)),this.setAttribute("normal",new oe(h,3)),this.setAttribute("uv",new oe(d,2));function _(y,m,u,T,E,S,R,A,P,N,M){let v=S/P,C=R/N,F=S/2,k=R/2,H=A/2,q=P+1,W=N+1,et=0,V=0,rt=new L;for(let ct=0;ct0?1:-1,h.push(rt.x,rt.y,rt.z),d.push(kt/P),d.push(1-ct/N),et+=1}}for(let ct=0;ct0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;let n={};for(let s in this.extensions)this.extensions[s]===!0&&(n[s]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}},ps=class extends ve{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new he,this.projectionMatrix=new he,this.projectionMatrixInverse=new he,this.coordinateSystem=Qe,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},Un=new L,Il=new Pt,Pl=new Pt,Ee=class extends ps{constructor(t=50,e=1,n=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=s,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){let e=.5*this.getFilmHeight()/t;this.fov=Di*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(is*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Di*2*Math.atan(Math.tan(is*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){Un.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Un.x,Un.y).multiplyScalar(-t/Un.z),Un.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Un.x,Un.y).multiplyScalar(-t/Un.z)}getViewSize(t,e){return this.getViewBounds(t,Il,Pl),e.subVectors(Pl,Il)}setViewOffset(t,e,n,s,r,a){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(is*.5*this.fov)/this.zoom,n=2*e,s=this.aspect*n,r=-.5*s,a=this.view;if(this.view!==null&&this.view.enabled){let c=a.fullWidth,l=a.fullHeight;r+=a.offsetX*s/c,e-=a.offsetY*n/l,s*=a.width/c,n*=a.height/l}let o=this.filmOffset;o!==0&&(r+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,e,e-n,t,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}},Ai=-90,Ri=1,dr=class extends ve{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let s=new Ee(Ai,Ri,t,e);s.layers=this.layers,this.add(s);let r=new Ee(Ai,Ri,t,e);r.layers=this.layers,this.add(r);let a=new Ee(Ai,Ri,t,e);a.layers=this.layers,this.add(a);let o=new Ee(Ai,Ri,t,e);o.layers=this.layers,this.add(o);let c=new Ee(Ai,Ri,t,e);c.layers=this.layers,this.add(c);let l=new Ee(Ai,Ri,t,e);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[n,s,r,a,o,c]=e;for(let l of e)this.remove(l);if(t===Qe)n.up.set(0,1,0),n.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else if(t===os)n.up.set(0,-1,0),n.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(let l of e)this.add(l),l.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:s}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());let[r,a,o,c,l,h]=this.children,d=t.getRenderTarget(),f=t.getActiveCubeFace(),p=t.getActiveMipmapLevel(),_=t.xr.enabled;t.xr.enabled=!1;let y=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,s),t.render(e,r),t.setRenderTarget(n,1,s),t.render(e,a),t.setRenderTarget(n,2,s),t.render(e,o),t.setRenderTarget(n,3,s),t.render(e,c),t.setRenderTarget(n,4,s),t.render(e,l),n.texture.generateMipmaps=y,t.setRenderTarget(n,5,s),t.render(e,h),t.setRenderTarget(d,f,p),t.xr.enabled=_,n.texture.needsPMREMUpdate=!0}},ms=class extends ze{constructor(t=[],e=li,n,s,r,a,o,c,l,h){super(t,e,n,s,r,a,o,c,l,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}},fr=class extends cn{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;let n={width:t,height:t,depth:1},s=[n,n,n,n,n,n];this.texture=new ms(s),this._setTextureOptions(e),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},s=new Bn(5,5,5),r=new nn({name:"CubemapFromEquirect",uniforms:hi(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:De,blending:Tn});r.uniforms.tEquirect.value=e;let a=new Pe(s,r),o=e.minFilter;return e.minFilter===Wn&&(e.minFilter=tn),new dr(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(t,e=!0,n=!0,s=!0){let r=t.getRenderTarget();for(let a=0;a<6;a++)t.setRenderTarget(this,a),t.clear(e,n,s);t.setRenderTarget(r)}},vn=class extends ve{constructor(){super(),this.isGroup=!0,this.type="Group"}},jh={type:"move"},Ni=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new vn,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new vn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new L,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new L),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new vn,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new L,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new L),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let e=this._hand;if(e)for(let n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let s=null,r=null,a=null,o=this._targetRay,c=this._grip,l=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(l&&t.hand){a=!0;for(let y of t.hand.values()){let m=e.getJointPose(y,n),u=this._getHandJoint(l,y);m!==null&&(u.matrix.fromArray(m.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,u.jointRadius=m.radius),u.visible=m!==null}let h=l.joints["index-finger-tip"],d=l.joints["thumb-tip"],f=h.position.distanceTo(d.position),p=.02,_=.005;l.inputState.pinching&&f>p+_?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&f<=p-_&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else c!==null&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1));o!==null&&(s=e.getPose(t.targetRaySpace,n),s===null&&r!==null&&(s=r),s!==null&&(o.matrix.fromArray(s.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,s.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(s.linearVelocity)):o.hasLinearVelocity=!1,s.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(s.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(jh)))}return o!==null&&(o.visible=s!==null),c!==null&&(c.visible=r!==null),l!==null&&(l.visible=a!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){let n=new vn;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}};var gs=class extends ve{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new en,this.environmentIntensity=1,this.environmentRotation=new en,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}};var to=new L,Qh=new L,tu=new Ut,qe=class{constructor(t=new L(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,s){return this.normal.set(t,e,n),this.constant=s,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){let s=to.subVectors(n,e).cross(Qh.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(s,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){let n=t.delta(to),s=this.normal.dot(n);if(s===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;let r=-(t.start.dot(this.normal)+this.constant)/s;return r<0||r>1?null:e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){let e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let n=e||tu.getNormalMatrix(t),s=this.coplanarPoint(to).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-s.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}},ti=new si,eu=new Pt(.5,.5),Qs=new L,Fi=class{constructor(t=new qe,e=new qe,n=new qe,s=new qe,r=new qe,a=new qe){this.planes=[t,e,n,s,r,a]}set(t,e,n,s,r,a){let o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(s),o[4].copy(r),o[5].copy(a),this}copy(t){let e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=Qe,n=!1){let s=this.planes,r=t.elements,a=r[0],o=r[1],c=r[2],l=r[3],h=r[4],d=r[5],f=r[6],p=r[7],_=r[8],y=r[9],m=r[10],u=r[11],T=r[12],E=r[13],S=r[14],R=r[15];if(s[0].setComponents(l-a,p-h,u-_,R-T).normalize(),s[1].setComponents(l+a,p+h,u+_,R+T).normalize(),s[2].setComponents(l+o,p+d,u+y,R+E).normalize(),s[3].setComponents(l-o,p-d,u-y,R-E).normalize(),n)s[4].setComponents(c,f,m,S).normalize(),s[5].setComponents(l-c,p-f,u-m,R-S).normalize();else if(s[4].setComponents(l-c,p-f,u-m,R-S).normalize(),e===Qe)s[5].setComponents(l+c,p+f,u+m,R+S).normalize();else if(e===os)s[5].setComponents(c,f,m,S).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),ti.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{let e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),ti.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(ti)}intersectsSprite(t){ti.center.set(0,0,0);let e=eu.distanceTo(t.center);return ti.radius=.7071067811865476+e,ti.applyMatrix4(t.matrixWorld),this.intersectsSphere(ti)}intersectsSphere(t){let e=this.planes,n=t.center,s=-t.radius;for(let r=0;r<6;r++)if(e[r].distanceToPoint(n)0?t.max.x:t.min.x,Qs.y=s.normal.y>0?t.max.y:t.min.y,Qs.z=s.normal.z>0?t.max.z:t.min.z,s.distanceToPoint(Qs)<0)return!1}return!0}containsPoint(t){let e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};var _s=class extends En{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ot(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}},pr=new L,mr=new L,Dl=new he,ns=new ri,tr=new si,eo=new L,Ll=new L,gr=class extends ve{constructor(t=new Ie,e=new _s){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){let t=this.geometry;if(t.index===null){let e=t.attributes.position,n=[0];for(let s=1,r=e.count;s0){let s=e[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;rn)return;eo.applyMatrix4(i.matrixWorld);let l=t.ray.origin.distanceTo(eo);if(!(lt.far))return{distance:l,point:Ll.clone().applyMatrix4(i.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:i}}var Ul=new L,Nl=new L,_r=class extends gr{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let t=this.geometry;if(t.index===null){let e=t.attributes.position,n=[];for(let s=0,r=e.count;s0){let M=(T-1)*y;for(let v=0;v0&&E(!0),e>0&&E(!1)),this.setIndex(h),this.setAttribute("position",new oe(d,3)),this.setAttribute("normal",new oe(f,3)),this.setAttribute("uv",new oe(p,2));function T(){let S=new L,R=new L,A=0,P=(e-t)/n;for(let N=0;N<=r;N++){let M=[],v=N/r,C=v*(e-t)+t;for(let F=0;F<=s;F++){let k=F/s,H=k*c+o,q=Math.sin(H),W=Math.cos(H);R.x=C*q,R.y=-v*n+m,R.z=C*W,d.push(R.x,R.y,R.z),S.set(q,P,W).normalize(),f.push(S.x,S.y,S.z),p.push(k,1-v),M.push(_++)}y.push(M)}for(let N=0;N0||M!==0)&&(h.push(v,C,k),A+=3),(e>0||M!==r-1)&&(h.push(C,F,k),A+=3)}l.addGroup(u,A,0),u+=A}function E(S){let R=_,A=new Pt,P=new L,N=0,M=S===!0?t:e,v=S===!0?1:-1;for(let F=1;F<=s;F++)d.push(0,m*v,0),f.push(0,v,0),p.push(.5,.5),_++;let C=_;for(let F=0;F<=s;F++){let H=F/s*c+o,q=Math.cos(H),W=Math.sin(H);P.x=M*W,P.y=m*v,P.z=M*q,d.push(P.x,P.y,P.z),f.push(0,v,0),A.x=q*.5+.5,A.y=W*.5*v+.5,p.push(A.x,A.y),_++}for(let F=0;F0)&&p.push(E,S,A),(u!==n-1||c=r)){let o=e[1];t=r)break t}a=n,n=0;break e}break n}for(;n>>1;te;)--a;if(++a,r!==0||a!==s){r>=a&&(a=Math.max(a,1),r=a-1);let o=this.getValueSize();this.times=n.slice(r,a),this.values=this.values.slice(r*o,a*o)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let n=this.times,s=this.values,r=n.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let a=null;for(let o=0;o!==r;o++){let c=n[o];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,c),t=!1;break}if(a!==null&&a>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,c,a),t=!1;break}a=c}if(s!==void 0&&nu(s))for(let o=0,c=s.length;o!==c;++o){let l=s[o];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,l),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),n=this.getValueSize(),s=this.getInterpolation()===ir,r=t.length-1,a=1;for(let o=1;o0){t[a]=t[r];for(let o=r*n,c=a*n,l=0;l!==n;++l)e[c+l]=e[o+l];++a}return a!==t.length?(this.times=t.slice(0,a),this.values=e.slice(0,a*n)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),n=this.constructor,s=new n(this.name,t,e);return s.createInterpolant=this.createInterpolant,s}};ke.prototype.ValueTypeName="";ke.prototype.TimeBufferType=Float32Array;ke.prototype.ValueBufferType=Float32Array;ke.prototype.DefaultInterpolation=lr;var zn=class extends ke{constructor(t,e,n){super(t,e,n)}};zn.prototype.ValueTypeName="bool";zn.prototype.ValueBufferType=Array;zn.prototype.DefaultInterpolation=rs;zn.prototype.InterpolantFactoryMethodLinear=void 0;zn.prototype.InterpolantFactoryMethodSmooth=void 0;var br=class extends ke{constructor(t,e,n,s){super(t,e,n,s)}};br.prototype.ValueTypeName="color";var Er=class extends ke{constructor(t,e,n,s){super(t,e,n,s)}};Er.prototype.ValueTypeName="number";var Tr=class extends oi{constructor(t,e,n,s){super(t,e,n,s)}interpolate_(t,e,n,s){let r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=(n-e)/(s-e),l=t*o;for(let h=l+o;l!==h;l+=4)Ze.slerpFlat(r,0,a,l-o,a,l,c);return r}},Ss=class extends ke{constructor(t,e,n,s){super(t,e,n,s)}InterpolantFactoryMethodLinear(t){return new Tr(this.times,this.values,this.getValueSize(),t)}};Ss.prototype.ValueTypeName="quaternion";Ss.prototype.InterpolantFactoryMethodSmooth=void 0;var kn=class extends ke{constructor(t,e,n){super(t,e,n)}};kn.prototype.ValueTypeName="string";kn.prototype.ValueBufferType=Array;kn.prototype.DefaultInterpolation=rs;kn.prototype.InterpolantFactoryMethodLinear=void 0;kn.prototype.InterpolantFactoryMethodSmooth=void 0;var wr=class extends ke{constructor(t,e,n,s){super(t,e,n,s)}};wr.prototype.ValueTypeName="vector";var Ar=class{constructor(t,e,n){let s=this,r=!1,a=0,o=0,c,l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.abortController=new AbortController,this.itemStart=function(h){o++,r===!1&&s.onStart!==void 0&&s.onStart(h,a,o),r=!0},this.itemEnd=function(h){a++,s.onProgress!==void 0&&s.onProgress(h,a,o),a===o&&(r=!1,s.onLoad!==void 0&&s.onLoad())},this.itemError=function(h){s.onError!==void 0&&s.onError(h)},this.resolveURL=function(h){return c?c(h):h},this.setURLModifier=function(h){return c=h,this},this.addHandler=function(h,d){return l.push(h,d),this},this.removeHandler=function(h){let d=l.indexOf(h);return d!==-1&&l.splice(d,2),this},this.getHandler=function(h){for(let d=0,f=l.length;dp.start-_.start);let f=0;for(let p=1;p 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,Iu=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,Pu=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,Du=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,Lu=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,Uu=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,Nu=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec3 vColor; +#endif`,Fu=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif +#ifdef USE_BATCHING_COLOR + vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); + vColor.xyz *= batchingColor.xyz; +#endif`,Ou=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,Bu=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,zu=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,ku=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,Vu=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,Hu=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE + emissiveColor = sRGBTransferEOTF( emissiveColor ); + #endif + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,Gu=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,Wu="gl_FragColor = linearToOutputTexel( gl_FragColor );",Xu=`vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferEOTF( in vec4 value ) { + return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +}`,qu=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,Yu=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,Zu=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,Ju=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,$u=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,Ku=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,ju=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,Qu=`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,td=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,ed=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,nd=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,id=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,sd=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,rd=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,ad=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,od=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,ld=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,cd=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,hd=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,ud=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,dd=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,fd=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,pd=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,md=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,gd=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,_d=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,xd=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER + varying float vFragDepth; + varying float vIsPerspective; +#endif`,yd=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,vd=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,Md=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,Sd=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,bd=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,Ed=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,Td=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,wd=`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,Ad=`#if defined( USE_MORPHCOLORS ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,Rd=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,Cd=`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } +#endif`,Id=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,Pd=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,Dd=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,Ld=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Ud=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Nd=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,Fd=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,Od=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,Bd=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,zd=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,kd=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,Vd=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Hd=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; +const float Inv255 = 1. / 255.; +const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); +const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); +const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); +const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); +vec4 packDepthToRGBA( const in float v ) { + if( v <= 0.0 ) + return vec4( 0., 0., 0., 0. ); + if( v >= 1.0 ) + return vec4( 1., 1., 1., 1. ); + float vuf; + float af = modf( v * PackFactors.a, vuf ); + float bf = modf( vuf * ShiftRight8, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); +} +vec3 packDepthToRGB( const in float v ) { + if( v <= 0.0 ) + return vec3( 0., 0., 0. ); + if( v >= 1.0 ) + return vec3( 1., 1., 1. ); + float vuf; + float bf = modf( v * PackFactors.b, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec3( vuf * Inv255, gf * PackUpscale, bf ); +} +vec2 packDepthToRG( const in float v ) { + if( v <= 0.0 ) + return vec2( 0., 0. ); + if( v >= 1.0 ) + return vec2( 1., 1. ); + float vuf; + float gf = modf( v * 256., vuf ); + return vec2( vuf * Inv255, gf ); +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors4 ); +} +float unpackRGBToDepth( const in vec3 v ) { + return dot( v, UnpackFactors3 ); +} +float unpackRGToDepth( const in vec2 v ) { + return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; +} +vec4 pack2HalfToRGBA( const in vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( const in vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,Gd=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,Wd=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,Xd=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,qd=`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,Yd=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,Zd=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,Jd=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + float depth = unpackRGBAToDepth( texture2D( depths, uv ) ); + #ifdef USE_REVERSED_DEPTH_BUFFER + return step( depth, compare ); + #else + return step( compare, depth ); + #endif + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow( sampler2D shadow, vec2 uv, float compare ) { + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + #ifdef USE_REVERSED_DEPTH_BUFFER + float hard_shadow = step( distribution.x, compare ); + #else + float hard_shadow = step( compare, distribution.x ); + #endif + if ( hard_shadow != 1.0 ) { + float distance = compare - distribution.x; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + + float lightToPositionLength = length( lightToPosition ); + if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { + float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + shadow = ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } +#endif`,$d=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,Kd=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,jd=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,Qd=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,tf=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,ef=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,nf=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,sf=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,rf=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,af=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,of=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 CineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,lf=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,cf=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + #else + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,hf=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,uf=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,df=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,ff=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`,pf=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,mf=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,gf=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,_f=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,xf=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,yf=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,vf=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,Mf=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + #ifdef USE_REVERSED_DEPTH_BUFFER + float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ]; + #else + float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5; + #endif + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #elif DEPTH_PACKING == 3202 + gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); + #elif DEPTH_PACKING == 3203 + gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); + #endif +}`,Sf=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,bf=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,Ef=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,Tf=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,wf=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,Af=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,Rf=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,Cf=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,If=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,Pf=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,Df=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,Lf=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,Uf=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,Nf=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,Ff=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,Of=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,Bf=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,zf=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,kf=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,Vf=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,Hf=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,Gf=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,Wf=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,Xf=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,qf=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix[ 3 ]; + vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,Yf=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,Bt={alphahash_fragment:pu,alphahash_pars_fragment:mu,alphamap_fragment:gu,alphamap_pars_fragment:_u,alphatest_fragment:xu,alphatest_pars_fragment:yu,aomap_fragment:vu,aomap_pars_fragment:Mu,batching_pars_vertex:Su,batching_vertex:bu,begin_vertex:Eu,beginnormal_vertex:Tu,bsdfs:wu,iridescence_fragment:Au,bumpmap_pars_fragment:Ru,clipping_planes_fragment:Cu,clipping_planes_pars_fragment:Iu,clipping_planes_pars_vertex:Pu,clipping_planes_vertex:Du,color_fragment:Lu,color_pars_fragment:Uu,color_pars_vertex:Nu,color_vertex:Fu,common:Ou,cube_uv_reflection_fragment:Bu,defaultnormal_vertex:zu,displacementmap_pars_vertex:ku,displacementmap_vertex:Vu,emissivemap_fragment:Hu,emissivemap_pars_fragment:Gu,colorspace_fragment:Wu,colorspace_pars_fragment:Xu,envmap_fragment:qu,envmap_common_pars_fragment:Yu,envmap_pars_fragment:Zu,envmap_pars_vertex:Ju,envmap_physical_pars_fragment:ad,envmap_vertex:$u,fog_vertex:Ku,fog_pars_vertex:ju,fog_fragment:Qu,fog_pars_fragment:td,gradientmap_pars_fragment:ed,lightmap_pars_fragment:nd,lights_lambert_fragment:id,lights_lambert_pars_fragment:sd,lights_pars_begin:rd,lights_toon_fragment:od,lights_toon_pars_fragment:ld,lights_phong_fragment:cd,lights_phong_pars_fragment:hd,lights_physical_fragment:ud,lights_physical_pars_fragment:dd,lights_fragment_begin:fd,lights_fragment_maps:pd,lights_fragment_end:md,logdepthbuf_fragment:gd,logdepthbuf_pars_fragment:_d,logdepthbuf_pars_vertex:xd,logdepthbuf_vertex:yd,map_fragment:vd,map_pars_fragment:Md,map_particle_fragment:Sd,map_particle_pars_fragment:bd,metalnessmap_fragment:Ed,metalnessmap_pars_fragment:Td,morphinstance_vertex:wd,morphcolor_vertex:Ad,morphnormal_vertex:Rd,morphtarget_pars_vertex:Cd,morphtarget_vertex:Id,normal_fragment_begin:Pd,normal_fragment_maps:Dd,normal_pars_fragment:Ld,normal_pars_vertex:Ud,normal_vertex:Nd,normalmap_pars_fragment:Fd,clearcoat_normal_fragment_begin:Od,clearcoat_normal_fragment_maps:Bd,clearcoat_pars_fragment:zd,iridescence_pars_fragment:kd,opaque_fragment:Vd,packing:Hd,premultiplied_alpha_fragment:Gd,project_vertex:Wd,dithering_fragment:Xd,dithering_pars_fragment:qd,roughnessmap_fragment:Yd,roughnessmap_pars_fragment:Zd,shadowmap_pars_fragment:Jd,shadowmap_pars_vertex:$d,shadowmap_vertex:Kd,shadowmask_pars_fragment:jd,skinbase_vertex:Qd,skinning_pars_vertex:tf,skinning_vertex:ef,skinnormal_vertex:nf,specularmap_fragment:sf,specularmap_pars_fragment:rf,tonemapping_fragment:af,tonemapping_pars_fragment:of,transmission_fragment:lf,transmission_pars_fragment:cf,uv_pars_fragment:hf,uv_pars_vertex:uf,uv_vertex:df,worldpos_vertex:ff,background_vert:pf,background_frag:mf,backgroundCube_vert:gf,backgroundCube_frag:_f,cube_vert:xf,cube_frag:yf,depth_vert:vf,depth_frag:Mf,distanceRGBA_vert:Sf,distanceRGBA_frag:bf,equirect_vert:Ef,equirect_frag:Tf,linedashed_vert:wf,linedashed_frag:Af,meshbasic_vert:Rf,meshbasic_frag:Cf,meshlambert_vert:If,meshlambert_frag:Pf,meshmatcap_vert:Df,meshmatcap_frag:Lf,meshnormal_vert:Uf,meshnormal_frag:Nf,meshphong_vert:Ff,meshphong_frag:Of,meshphysical_vert:Bf,meshphysical_frag:zf,meshtoon_vert:kf,meshtoon_frag:Vf,points_vert:Hf,points_frag:Gf,shadow_vert:Wf,shadow_frag:Xf,sprite_vert:qf,sprite_frag:Yf},st={common:{diffuse:{value:new Ot(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ut},alphaMap:{value:null},alphaMapTransform:{value:new Ut},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ut}},envmap:{envMap:{value:null},envMapRotation:{value:new Ut},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ut}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ut}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ut},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ut},normalScale:{value:new Pt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ut},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ut}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ut}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ut}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ot(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ot(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ut},alphaTest:{value:0},uvTransform:{value:new Ut}},sprite:{diffuse:{value:new Ot(16777215)},opacity:{value:1},center:{value:new Pt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ut},alphaMap:{value:null},alphaMapTransform:{value:new Ut},alphaTest:{value:0}}},fn={basic:{uniforms:we([st.common,st.specularmap,st.envmap,st.aomap,st.lightmap,st.fog]),vertexShader:Bt.meshbasic_vert,fragmentShader:Bt.meshbasic_frag},lambert:{uniforms:we([st.common,st.specularmap,st.envmap,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.fog,st.lights,{emissive:{value:new Ot(0)}}]),vertexShader:Bt.meshlambert_vert,fragmentShader:Bt.meshlambert_frag},phong:{uniforms:we([st.common,st.specularmap,st.envmap,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.fog,st.lights,{emissive:{value:new Ot(0)},specular:{value:new Ot(1118481)},shininess:{value:30}}]),vertexShader:Bt.meshphong_vert,fragmentShader:Bt.meshphong_frag},standard:{uniforms:we([st.common,st.envmap,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.roughnessmap,st.metalnessmap,st.fog,st.lights,{emissive:{value:new Ot(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Bt.meshphysical_vert,fragmentShader:Bt.meshphysical_frag},toon:{uniforms:we([st.common,st.aomap,st.lightmap,st.emissivemap,st.bumpmap,st.normalmap,st.displacementmap,st.gradientmap,st.fog,st.lights,{emissive:{value:new Ot(0)}}]),vertexShader:Bt.meshtoon_vert,fragmentShader:Bt.meshtoon_frag},matcap:{uniforms:we([st.common,st.bumpmap,st.normalmap,st.displacementmap,st.fog,{matcap:{value:null}}]),vertexShader:Bt.meshmatcap_vert,fragmentShader:Bt.meshmatcap_frag},points:{uniforms:we([st.points,st.fog]),vertexShader:Bt.points_vert,fragmentShader:Bt.points_frag},dashed:{uniforms:we([st.common,st.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Bt.linedashed_vert,fragmentShader:Bt.linedashed_frag},depth:{uniforms:we([st.common,st.displacementmap]),vertexShader:Bt.depth_vert,fragmentShader:Bt.depth_frag},normal:{uniforms:we([st.common,st.bumpmap,st.normalmap,st.displacementmap,{opacity:{value:1}}]),vertexShader:Bt.meshnormal_vert,fragmentShader:Bt.meshnormal_frag},sprite:{uniforms:we([st.sprite,st.fog]),vertexShader:Bt.sprite_vert,fragmentShader:Bt.sprite_frag},background:{uniforms:{uvTransform:{value:new Ut},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Bt.background_vert,fragmentShader:Bt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Ut}},vertexShader:Bt.backgroundCube_vert,fragmentShader:Bt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Bt.cube_vert,fragmentShader:Bt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Bt.equirect_vert,fragmentShader:Bt.equirect_frag},distanceRGBA:{uniforms:we([st.common,st.displacementmap,{referencePosition:{value:new L},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Bt.distanceRGBA_vert,fragmentShader:Bt.distanceRGBA_frag},shadow:{uniforms:we([st.lights,st.fog,{color:{value:new Ot(0)},opacity:{value:1}}]),vertexShader:Bt.shadow_vert,fragmentShader:Bt.shadow_frag}};fn.physical={uniforms:we([fn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ut},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ut},clearcoatNormalScale:{value:new Pt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ut},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ut},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ut},sheen:{value:0},sheenColor:{value:new Ot(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ut},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ut},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ut},transmissionSamplerSize:{value:new Pt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ut},attenuationDistance:{value:0},attenuationColor:{value:new Ot(0)},specularColor:{value:new Ot(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ut},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ut},anisotropyVector:{value:new Pt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ut}}]),vertexShader:Bt.meshphysical_vert,fragmentShader:Bt.meshphysical_frag};var Ma={r:0,b:0,g:0},ui=new en,Zf=new he;function Jf(i,t,e,n,s,r,a){let o=new Ot(0),c=r===!0?0:1,l,h,d=null,f=0,p=null;function _(E){let S=E.isScene===!0?E.background:null;return S&&S.isTexture&&(S=(E.backgroundBlurriness>0?e:t).get(S)),S}function y(E){let S=!1,R=_(E);R===null?u(o,c):R&&R.isColor&&(u(R,1),S=!0);let A=i.xr.getEnvironmentBlendMode();A==="additive"?n.buffers.color.setClear(0,0,0,1,a):A==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(i.autoClear||S)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil))}function m(E,S){let R=_(S);R&&(R.isCubeTexture||R.mapping===Rs)?(h===void 0&&(h=new Pe(new Bn(1,1,1),new nn({name:"BackgroundCubeMaterial",uniforms:hi(fn.backgroundCube.uniforms),vertexShader:fn.backgroundCube.vertexShader,fragmentShader:fn.backgroundCube.fragmentShader,side:De,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(A,P,N){this.matrixWorld.copyPosition(N.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(h)),ui.copy(S.backgroundRotation),ui.x*=-1,ui.y*=-1,ui.z*=-1,R.isCubeTexture&&R.isRenderTargetTexture===!1&&(ui.y*=-1,ui.z*=-1),h.material.uniforms.envMap.value=R,h.material.uniforms.flipEnvMap.value=R.isCubeTexture&&R.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=S.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(Zf.makeRotationFromEuler(ui)),h.material.toneMapped=Gt.getTransfer(R.colorSpace)!==Yt,(d!==R||f!==R.version||p!==i.toneMapping)&&(h.material.needsUpdate=!0,d=R,f=R.version,p=i.toneMapping),h.layers.enableAll(),E.unshift(h,h.geometry,h.material,0,0,null)):R&&R.isTexture&&(l===void 0&&(l=new Pe(new ai(2,2),new nn({name:"BackgroundMaterial",uniforms:hi(fn.background.uniforms),vertexShader:fn.background.vertexShader,fragmentShader:fn.background.fragmentShader,side:Sn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(l)),l.material.uniforms.t2D.value=R,l.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,l.material.toneMapped=Gt.getTransfer(R.colorSpace)!==Yt,R.matrixAutoUpdate===!0&&R.updateMatrix(),l.material.uniforms.uvTransform.value.copy(R.matrix),(d!==R||f!==R.version||p!==i.toneMapping)&&(l.material.needsUpdate=!0,d=R,f=R.version,p=i.toneMapping),l.layers.enableAll(),E.unshift(l,l.geometry,l.material,0,0,null))}function u(E,S){E.getRGB(Ma,Lo(i)),n.buffers.color.setClear(Ma.r,Ma.g,Ma.b,S,a)}function T(){h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0),l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}return{getClearColor:function(){return o},setClearColor:function(E,S=1){o.set(E),c=S,u(o,c)},getClearAlpha:function(){return c},setClearAlpha:function(E){c=E,u(o,c)},render:y,addToRenderList:m,dispose:T}}function $f(i,t){let e=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},s=f(null),r=s,a=!1;function o(v,C,F,k,H){let q=!1,W=d(k,F,C);r!==W&&(r=W,l(r.object)),q=p(v,k,F,H),q&&_(v,k,F,H),H!==null&&t.update(H,i.ELEMENT_ARRAY_BUFFER),(q||a)&&(a=!1,S(v,C,F,k),H!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t.get(H).buffer))}function c(){return i.createVertexArray()}function l(v){return i.bindVertexArray(v)}function h(v){return i.deleteVertexArray(v)}function d(v,C,F){let k=F.wireframe===!0,H=n[v.id];H===void 0&&(H={},n[v.id]=H);let q=H[C.id];q===void 0&&(q={},H[C.id]=q);let W=q[k];return W===void 0&&(W=f(c()),q[k]=W),W}function f(v){let C=[],F=[],k=[];for(let H=0;H=0){let ct=H[V],St=q[V];if(St===void 0&&(V==="instanceMatrix"&&v.instanceMatrix&&(St=v.instanceMatrix),V==="instanceColor"&&v.instanceColor&&(St=v.instanceColor)),ct===void 0||ct.attribute!==St||St&&ct.data!==St.data)return!0;W++}return r.attributesNum!==W||r.index!==k}function _(v,C,F,k){let H={},q=C.attributes,W=0,et=F.getAttributes();for(let V in et)if(et[V].location>=0){let ct=q[V];ct===void 0&&(V==="instanceMatrix"&&v.instanceMatrix&&(ct=v.instanceMatrix),V==="instanceColor"&&v.instanceColor&&(ct=v.instanceColor));let St={};St.attribute=ct,ct&&ct.data&&(St.data=ct.data),H[V]=St,W++}r.attributes=H,r.attributesNum=W,r.index=k}function y(){let v=r.newAttributes;for(let C=0,F=v.length;C=0){let rt=H[et];if(rt===void 0&&(et==="instanceMatrix"&&v.instanceMatrix&&(rt=v.instanceMatrix),et==="instanceColor"&&v.instanceColor&&(rt=v.instanceColor)),rt!==void 0){let ct=rt.normalized,St=rt.itemSize,kt=t.get(rt);if(kt===void 0)continue;let jt=kt.buffer,ne=kt.type,Xt=kt.bytesPerElement,Y=ne===i.INT||ne===i.UNSIGNED_INT||rt.gpuType===Vr;if(rt.isInterleavedBufferAttribute){let $=rt.data,dt=$.stride,It=rt.offset;if($.isInstancedInterleavedBuffer){for(let Mt=0;Mt0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let l=e.precision!==void 0?e.precision:"highp",h=c(l);h!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",h,"instead."),l=h);let d=e.logarithmicDepthBuffer===!0,f=e.reversedDepthBuffer===!0&&t.has("EXT_clip_control"),p=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),_=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),y=i.getParameter(i.MAX_TEXTURE_SIZE),m=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),u=i.getParameter(i.MAX_VERTEX_ATTRIBS),T=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),E=i.getParameter(i.MAX_VARYING_VECTORS),S=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),R=_>0,A=i.getParameter(i.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:c,textureFormatReadable:a,textureTypeReadable:o,precision:l,logarithmicDepthBuffer:d,reversedDepthBuffer:f,maxTextures:p,maxVertexTextures:_,maxTextureSize:y,maxCubemapSize:m,maxAttributes:u,maxVertexUniforms:T,maxVaryings:E,maxFragmentUniforms:S,vertexTextures:R,maxSamples:A}}function Qf(i){let t=this,e=null,n=0,s=!1,r=!1,a=new qe,o=new Ut,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){let p=d.length!==0||f||n!==0||s;return s=f,n=d.length,p},this.beginShadows=function(){r=!0,h(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(d,f){e=h(d,f,0)},this.setState=function(d,f,p){let _=d.clippingPlanes,y=d.clipIntersection,m=d.clipShadows,u=i.get(d);if(!s||_===null||_.length===0||r&&!m)r?h(null):l();else{let T=r?0:n,E=T*4,S=u.clippingState||null;c.value=S,S=h(_,f,E,p);for(let R=0;R!==E;++R)S[R]=e[R];u.clippingState=S,this.numIntersection=y?this.numPlanes:0,this.numPlanes+=T}};function l(){c.value!==e&&(c.value=e,c.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(d,f,p,_){let y=d!==null?d.length:0,m=null;if(y!==0){if(m=c.value,_!==!0||m===null){let u=p+y*4,T=f.matrixWorldInverse;o.getNormalMatrix(T),(m===null||m.length0){let l=new fr(c.height);return l.fromEquirectangularTexture(i,a),t.set(a,l),a.addEventListener("dispose",s),e(l.texture,a.mapping)}else return null}}return a}function s(a){let o=a.target;o.removeEventListener("dispose",s);let c=t.get(o);c!==void 0&&(t.delete(o),c.dispose())}function r(){t=new WeakMap}return{get:n,dispose:r}}var qi=4,Cc=[.125,.215,.35,.446,.526,.582],pi=20,Oo=new Ts,Ic=new Ot,Bo=null,zo=0,ko=0,Vo=!1,fi=(1+Math.sqrt(5))/2,Xi=1/fi,Pc=[new L(-fi,Xi,0),new L(fi,Xi,0),new L(-Xi,0,fi),new L(Xi,0,fi),new L(0,fi,-Xi),new L(0,fi,Xi),new L(-1,1,-1),new L(1,1,-1),new L(-1,1,1),new L(1,1,1)],ep=new L,Ea=class{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,s=100,r={}){let{size:a=256,position:o=ep}=r;Bo=this._renderer.getRenderTarget(),zo=this._renderer.getActiveCubeFace(),ko=this._renderer.getActiveMipmapLevel(),Vo=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let c=this._allocateTargets();return c.depthBuffer=!0,this._sceneToCubeUV(t,n,s,c,o),e>0&&this._blur(c,0,0,e),this._applyPMREM(c),this._cleanup(c),c}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Uc(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Lc(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?R:0,R,R),d.setRenderTarget(s),u&&d.render(m,c),d.render(t,c)}m.geometry.dispose(),m.material.dispose(),d.toneMapping=p,d.autoClear=f,t.background=T}_textureToCubeUV(t,e){let n=this._renderer,s=t.mapping===li||t.mapping===ci;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=Uc()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Lc());let r=s?this._cubemapMaterial:this._equirectMaterial,a=new Pe(this._lodPlanes[0],r),o=r.uniforms;o.envMap.value=t;let c=this._cubeSize;Sa(e,0,0,3*c,2*c),n.setRenderTarget(e),n.render(a,Oo)}_applyPMREM(t){let e=this._renderer,n=e.autoClear;e.autoClear=!1;let s=this._lodPlanes.length;for(let r=1;rpi&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${pi}`);let u=[],T=0;for(let P=0;PE-qi?s-E+qi:0),A=4*(this._cubeSize-S);Sa(e,R,A,3*S,2*S),c.setRenderTarget(e),c.render(d,Oo)}};function np(i){let t=[],e=[],n=[],s=i,r=i-qi+1+Cc.length;for(let a=0;ai-qi?c=Cc[a-i+qi-1]:a===0&&(c=0),n.push(c);let l=1/(o-2),h=-l,d=1+l,f=[h,h,d,h,d,d,h,h,d,d,h,d],p=6,_=6,y=3,m=2,u=1,T=new Float32Array(y*_*p),E=new Float32Array(m*_*p),S=new Float32Array(u*_*p);for(let A=0;A2?0:-1,M=[P,N,0,P+2/3,N,0,P+2/3,N+1,0,P,N,0,P+2/3,N+1,0,P,N+1,0];T.set(M,y*_*A),E.set(f,m*_*A);let v=[A,A,A,A,A,A];S.set(v,u*_*A)}let R=new Ie;R.setAttribute("position",new Te(T,y)),R.setAttribute("uv",new Te(E,m)),R.setAttribute("faceIndex",new Te(S,u)),t.push(R),s>qi&&s--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function Dc(i,t,e){let n=new cn(i,t,e);return n.texture.mapping=Rs,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Sa(i,t,e,n,s){i.viewport.set(t,e,n,s),i.scissor.set(t,e,n,s)}function ip(i,t,e){let n=new Float32Array(pi),s=new L(0,1,0);return new nn({name:"SphericalGaussianBlur",defines:{n:pi,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:Ko(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:Tn,depthTest:!1,depthWrite:!1})}function Lc(){return new nn({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Ko(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:Tn,depthTest:!1,depthWrite:!1})}function Uc(){return new nn({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ko(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:Tn,depthTest:!1,depthWrite:!1})}function Ko(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function sp(i){let t=new WeakMap,e=null;function n(o){if(o&&o.isTexture){let c=o.mapping,l=c===Br||c===zr,h=c===li||c===ci;if(l||h){let d=t.get(o),f=d!==void 0?d.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==f)return e===null&&(e=new Ea(i)),d=l?e.fromEquirectangular(o,d):e.fromCubemap(o,d),d.texture.pmremVersion=o.pmremVersion,t.set(o,d),d.texture;if(d!==void 0)return d.texture;{let p=o.image;return l&&p&&p.height>0||h&&p&&s(p)?(e===null&&(e=new Ea(i)),d=l?e.fromEquirectangular(o):e.fromCubemap(o),d.texture.pmremVersion=o.pmremVersion,t.set(o,d),o.addEventListener("dispose",r),d.texture):null}}}return o}function s(o){let c=0,l=6;for(let h=0;ht.maxTextureSize&&(R=Math.ceil(S/t.maxTextureSize),S=t.maxTextureSize);let A=new Float32Array(S*R*4*d),P=new cs(A,S,R,d);P.type=dn,P.needsUpdate=!0;let N=E*4;for(let v=0;v0)return i;let s=t*e,r=Fc[s];if(r===void 0&&(r=new Float32Array(s),Fc[s]=r),t!==0){n.toArray(r,0);for(let a=1,o=0;a!==t;++a)o+=e,i[a].toArray(r,o)}return r}function fe(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e":" "} ${o}: ${e[a]}`)}return n.join(` +`)}var Gc=new Ut;function em(i){Gt._getMatrix(Gc,Gt.workingColorSpace,i);let t=`mat3( ${Gc.elements.map(e=>e.toFixed(4))} )`;switch(Gt.getTransfer(i)){case as:return[t,"LinearTransferOETF"];case Yt:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",i),[t,"LinearTransferOETF"]}}function Wc(i,t,e){let n=i.getShaderParameter(t,i.COMPILE_STATUS),r=(i.getShaderInfoLog(t)||"").trim();if(n&&r==="")return"";let a=/ERROR: 0:(\d+)/.exec(r);if(a){let o=parseInt(a[1]);return e.toUpperCase()+` + +`+r+` + +`+tm(i.getShaderSource(t),o)}else return r}function nm(i,t){let e=em(t);return[`vec4 ${i}( vec4 value ) {`,` return ${e[1]}( vec4( value.rgb * ${e[0]}, value.a ) );`,"}"].join(` +`)}function im(i,t){let e;switch(t){case oc:e="Linear";break;case lc:e="Reinhard";break;case cc:e="Cineon";break;case Or:e="ACESFilmic";break;case uc:e="AgX";break;case dc:e="Neutral";break;case hc:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+i+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}var ba=new L;function sm(){Gt.getLuminanceCoefficients(ba);let i=ba.x.toFixed(4),t=ba.y.toFixed(4),e=ba.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${i}, ${t}, ${e} );`," return dot( weights, rgb );","}"].join(` +`)}function rm(i){return[i.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",i.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Us).join(` +`)}function am(i){let t=[];for(let e in i){let n=i[e];n!==!1&&t.push("#define "+e+" "+n)}return t.join(` +`)}function om(i,t){let e={},n=i.getProgramParameter(t,i.ACTIVE_ATTRIBUTES);for(let s=0;s/gm;function qo(i){return i.replace(lm,hm)}var cm=new Map;function hm(i,t){let e=Bt[t];if(e===void 0){let n=cm.get(t);if(n!==void 0)e=Bt[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,n);else throw new Error("Can not resolve #include <"+t+">")}return qo(e)}var um=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Yc(i){return i.replace(um,dm)}function dm(i,t,e,n){let s="";for(let r=parseInt(t);r0&&(m+=` +`),u=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_].filter(Us).join(` +`),u.length>0&&(u+=` +`)):(m=[Zc(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.batchingColor?"#define USE_BATCHING_COLOR":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+h:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+c:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",e.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(Us).join(` +`),u=[Zc(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+l:"",e.envMap?"#define "+h:"",e.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor||e.batchingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+c:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",e.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",e.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==wn?"#define TONE_MAPPING":"",e.toneMapping!==wn?Bt.tonemapping_pars_fragment:"",e.toneMapping!==wn?im("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",Bt.colorspace_pars_fragment,nm("linearToOutputTexel",e.outputColorSpace),sm(),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",` +`].filter(Us).join(` +`)),a=qo(a),a=Xc(a,e),a=qc(a,e),o=qo(o),o=Xc(o,e),o=qc(o,e),a=Yc(a),o=Yc(o),e.isRawShaderMaterial!==!0&&(T=`#version 300 es +`,m=[p,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+m,u=["#define varying in",e.glslVersion===Co?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===Co?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`)+` +`+u);let E=T+m+a,S=T+u+o,R=Hc(s,s.VERTEX_SHADER,E),A=Hc(s,s.FRAGMENT_SHADER,S);s.attachShader(y,R),s.attachShader(y,A),e.index0AttributeName!==void 0?s.bindAttribLocation(y,0,e.index0AttributeName):e.morphTargets===!0&&s.bindAttribLocation(y,0,"position"),s.linkProgram(y);function P(C){if(i.debug.checkShaderErrors){let F=s.getProgramInfoLog(y)||"",k=s.getShaderInfoLog(R)||"",H=s.getShaderInfoLog(A)||"",q=F.trim(),W=k.trim(),et=H.trim(),V=!0,rt=!0;if(s.getProgramParameter(y,s.LINK_STATUS)===!1)if(V=!1,typeof i.debug.onShaderError=="function")i.debug.onShaderError(s,y,R,A);else{let ct=Wc(s,R,"vertex"),St=Wc(s,A,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(y,s.VALIDATE_STATUS)+` + +Material Name: `+C.name+` +Material Type: `+C.type+` + +Program Info Log: `+q+` +`+ct+` +`+St)}else q!==""?console.warn("THREE.WebGLProgram: Program Info Log:",q):(W===""||et==="")&&(rt=!1);rt&&(C.diagnostics={runnable:V,programLog:q,vertexShader:{log:W,prefix:m},fragmentShader:{log:et,prefix:u}})}s.deleteShader(R),s.deleteShader(A),N=new Yi(s,y),M=om(s,y)}let N;this.getUniforms=function(){return N===void 0&&P(this),N};let M;this.getAttributes=function(){return M===void 0&&P(this),M};let v=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return v===!1&&(v=s.getProgramParameter(y,jp)),v},this.destroy=function(){n.releaseStatesOfProgram(this),s.deleteProgram(y),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=Qp++,this.cacheKey=t,this.usedTimes=1,this.program=y,this.vertexShader=R,this.fragmentShader=A,this}var ym=0,Yo=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){let e=t.vertexShader,n=t.fragmentShader,s=this._getShaderStage(e),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(t);return a.has(s)===!1&&(a.add(s),s.usedTimes++),a.has(r)===!1&&(a.add(r),r.usedTimes++),this}remove(t){let e=this.materialCache.get(t);for(let n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){let e=this.materialCache,n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){let e=this.shaderCache,n=e.get(t);return n===void 0&&(n=new Zo(t),e.set(t,n)),n}},Zo=class{constructor(t){this.id=ym++,this.code=t,this.usedTimes=0}};function vm(i,t,e,n,s,r,a){let o=new hs,c=new Yo,l=new Set,h=[],d=s.logarithmicDepthBuffer,f=s.vertexTextures,p=s.precision,_={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function y(M){return l.add(M),M===0?"uv":`uv${M}`}function m(M,v,C,F,k){let H=F.fog,q=k.geometry,W=M.isMeshStandardMaterial?F.environment:null,et=(M.isMeshStandardMaterial?e:t).get(M.envMap||W),V=et&&et.mapping===Rs?et.image.height:null,rt=_[M.type];M.precision!==null&&(p=s.getMaxPrecision(M.precision),p!==M.precision&&console.warn("THREE.WebGLProgram.getParameters:",M.precision,"not supported, using",p,"instead."));let ct=q.morphAttributes.position||q.morphAttributes.normal||q.morphAttributes.color,St=ct!==void 0?ct.length:0,kt=0;q.morphAttributes.position!==void 0&&(kt=1),q.morphAttributes.normal!==void 0&&(kt=2),q.morphAttributes.color!==void 0&&(kt=3);let jt,ne,Xt,Y;if(rt){let qt=fn[rt];jt=qt.vertexShader,ne=qt.fragmentShader}else jt=M.vertexShader,ne=M.fragmentShader,c.update(M),Xt=c.getVertexShaderID(M),Y=c.getFragmentShaderID(M);let $=i.getRenderTarget(),dt=i.state.buffers.depth.getReversed(),It=k.isInstancedMesh===!0,Mt=k.isBatchedMesh===!0,Ht=!!M.map,Me=!!M.matcap,w=!!et,ie=!!M.aoMap,Lt=!!M.lightMap,Rt=!!M.bumpMap,mt=!!M.normalMap,se=!!M.displacementMap,gt=!!M.emissiveMap,Ft=!!M.metalnessMap,_e=!!M.roughnessMap,ue=M.anisotropy>0,b=M.clearcoat>0,g=M.dispersion>0,O=M.iridescence>0,X=M.sheen>0,J=M.transmission>0,G=ue&&!!M.anisotropyMap,vt=b&&!!M.clearcoatMap,nt=b&&!!M.clearcoatNormalMap,_t=b&&!!M.clearcoatRoughnessMap,xt=O&&!!M.iridescenceMap,Q=O&&!!M.iridescenceThicknessMap,lt=X&&!!M.sheenColorMap,At=X&&!!M.sheenRoughnessMap,yt=!!M.specularMap,at=!!M.specularColorMap,Nt=!!M.specularIntensityMap,I=J&&!!M.transmissionMap,tt=J&&!!M.thicknessMap,it=!!M.gradientMap,ut=!!M.alphaMap,K=M.alphaTest>0,Z=!!M.alphaHash,pt=!!M.extensions,Dt=wn;M.toneMapped&&($===null||$.isXRRenderTarget===!0)&&(Dt=i.toneMapping);let Qt={shaderID:rt,shaderType:M.type,shaderName:M.name,vertexShader:jt,fragmentShader:ne,defines:M.defines,customVertexShaderID:Xt,customFragmentShaderID:Y,isRawShaderMaterial:M.isRawShaderMaterial===!0,glslVersion:M.glslVersion,precision:p,batching:Mt,batchingColor:Mt&&k._colorsTexture!==null,instancing:It,instancingColor:It&&k.instanceColor!==null,instancingMorph:It&&k.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:$===null?i.outputColorSpace:$.isXRRenderTarget===!0?$.texture.colorSpace:bn,alphaToCoverage:!!M.alphaToCoverage,map:Ht,matcap:Me,envMap:w,envMapMode:w&&et.mapping,envMapCubeUVHeight:V,aoMap:ie,lightMap:Lt,bumpMap:Rt,normalMap:mt,displacementMap:f&&se,emissiveMap:gt,normalMapObjectSpace:mt&&M.normalMapType===gc,normalMapTangentSpace:mt&&M.normalMapType===Ao,metalnessMap:Ft,roughnessMap:_e,anisotropy:ue,anisotropyMap:G,clearcoat:b,clearcoatMap:vt,clearcoatNormalMap:nt,clearcoatRoughnessMap:_t,dispersion:g,iridescence:O,iridescenceMap:xt,iridescenceThicknessMap:Q,sheen:X,sheenColorMap:lt,sheenRoughnessMap:At,specularMap:yt,specularColorMap:at,specularIntensityMap:Nt,transmission:J,transmissionMap:I,thicknessMap:tt,gradientMap:it,opaque:M.transparent===!1&&M.blending===ni&&M.alphaToCoverage===!1,alphaMap:ut,alphaTest:K,alphaHash:Z,combine:M.combine,mapUv:Ht&&y(M.map.channel),aoMapUv:ie&&y(M.aoMap.channel),lightMapUv:Lt&&y(M.lightMap.channel),bumpMapUv:Rt&&y(M.bumpMap.channel),normalMapUv:mt&&y(M.normalMap.channel),displacementMapUv:se&&y(M.displacementMap.channel),emissiveMapUv:gt&&y(M.emissiveMap.channel),metalnessMapUv:Ft&&y(M.metalnessMap.channel),roughnessMapUv:_e&&y(M.roughnessMap.channel),anisotropyMapUv:G&&y(M.anisotropyMap.channel),clearcoatMapUv:vt&&y(M.clearcoatMap.channel),clearcoatNormalMapUv:nt&&y(M.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:_t&&y(M.clearcoatRoughnessMap.channel),iridescenceMapUv:xt&&y(M.iridescenceMap.channel),iridescenceThicknessMapUv:Q&&y(M.iridescenceThicknessMap.channel),sheenColorMapUv:lt&&y(M.sheenColorMap.channel),sheenRoughnessMapUv:At&&y(M.sheenRoughnessMap.channel),specularMapUv:yt&&y(M.specularMap.channel),specularColorMapUv:at&&y(M.specularColorMap.channel),specularIntensityMapUv:Nt&&y(M.specularIntensityMap.channel),transmissionMapUv:I&&y(M.transmissionMap.channel),thicknessMapUv:tt&&y(M.thicknessMap.channel),alphaMapUv:ut&&y(M.alphaMap.channel),vertexTangents:!!q.attributes.tangent&&(mt||ue),vertexColors:M.vertexColors,vertexAlphas:M.vertexColors===!0&&!!q.attributes.color&&q.attributes.color.itemSize===4,pointsUvs:k.isPoints===!0&&!!q.attributes.uv&&(Ht||ut),fog:!!H,useFog:M.fog===!0,fogExp2:!!H&&H.isFogExp2,flatShading:M.flatShading===!0&&M.wireframe===!1,sizeAttenuation:M.sizeAttenuation===!0,logarithmicDepthBuffer:d,reversedDepthBuffer:dt,skinning:k.isSkinnedMesh===!0,morphTargets:q.morphAttributes.position!==void 0,morphNormals:q.morphAttributes.normal!==void 0,morphColors:q.morphAttributes.color!==void 0,morphTargetsCount:St,morphTextureStride:kt,numDirLights:v.directional.length,numPointLights:v.point.length,numSpotLights:v.spot.length,numSpotLightMaps:v.spotLightMap.length,numRectAreaLights:v.rectArea.length,numHemiLights:v.hemi.length,numDirLightShadows:v.directionalShadowMap.length,numPointLightShadows:v.pointShadowMap.length,numSpotLightShadows:v.spotShadowMap.length,numSpotLightShadowsWithMaps:v.numSpotLightShadowsWithMaps,numLightProbes:v.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:M.dithering,shadowMapEnabled:i.shadowMap.enabled&&C.length>0,shadowMapType:i.shadowMap.type,toneMapping:Dt,decodeVideoTexture:Ht&&M.map.isVideoTexture===!0&&Gt.getTransfer(M.map.colorSpace)===Yt,decodeVideoTextureEmissive:gt&&M.emissiveMap.isVideoTexture===!0&&Gt.getTransfer(M.emissiveMap.colorSpace)===Yt,premultipliedAlpha:M.premultipliedAlpha,doubleSided:M.side===Ve,flipSided:M.side===De,useDepthPacking:M.depthPacking>=0,depthPacking:M.depthPacking||0,index0AttributeName:M.index0AttributeName,extensionClipCullDistance:pt&&M.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(pt&&M.extensions.multiDraw===!0||Mt)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:M.customProgramCacheKey()};return Qt.vertexUv1s=l.has(1),Qt.vertexUv2s=l.has(2),Qt.vertexUv3s=l.has(3),l.clear(),Qt}function u(M){let v=[];if(M.shaderID?v.push(M.shaderID):(v.push(M.customVertexShaderID),v.push(M.customFragmentShaderID)),M.defines!==void 0)for(let C in M.defines)v.push(C),v.push(M.defines[C]);return M.isRawShaderMaterial===!1&&(T(v,M),E(v,M),v.push(i.outputColorSpace)),v.push(M.customProgramCacheKey),v.join()}function T(M,v){M.push(v.precision),M.push(v.outputColorSpace),M.push(v.envMapMode),M.push(v.envMapCubeUVHeight),M.push(v.mapUv),M.push(v.alphaMapUv),M.push(v.lightMapUv),M.push(v.aoMapUv),M.push(v.bumpMapUv),M.push(v.normalMapUv),M.push(v.displacementMapUv),M.push(v.emissiveMapUv),M.push(v.metalnessMapUv),M.push(v.roughnessMapUv),M.push(v.anisotropyMapUv),M.push(v.clearcoatMapUv),M.push(v.clearcoatNormalMapUv),M.push(v.clearcoatRoughnessMapUv),M.push(v.iridescenceMapUv),M.push(v.iridescenceThicknessMapUv),M.push(v.sheenColorMapUv),M.push(v.sheenRoughnessMapUv),M.push(v.specularMapUv),M.push(v.specularColorMapUv),M.push(v.specularIntensityMapUv),M.push(v.transmissionMapUv),M.push(v.thicknessMapUv),M.push(v.combine),M.push(v.fogExp2),M.push(v.sizeAttenuation),M.push(v.morphTargetsCount),M.push(v.morphAttributeCount),M.push(v.numDirLights),M.push(v.numPointLights),M.push(v.numSpotLights),M.push(v.numSpotLightMaps),M.push(v.numHemiLights),M.push(v.numRectAreaLights),M.push(v.numDirLightShadows),M.push(v.numPointLightShadows),M.push(v.numSpotLightShadows),M.push(v.numSpotLightShadowsWithMaps),M.push(v.numLightProbes),M.push(v.shadowMapType),M.push(v.toneMapping),M.push(v.numClippingPlanes),M.push(v.numClipIntersection),M.push(v.depthPacking)}function E(M,v){o.disableAll(),v.supportsVertexTextures&&o.enable(0),v.instancing&&o.enable(1),v.instancingColor&&o.enable(2),v.instancingMorph&&o.enable(3),v.matcap&&o.enable(4),v.envMap&&o.enable(5),v.normalMapObjectSpace&&o.enable(6),v.normalMapTangentSpace&&o.enable(7),v.clearcoat&&o.enable(8),v.iridescence&&o.enable(9),v.alphaTest&&o.enable(10),v.vertexColors&&o.enable(11),v.vertexAlphas&&o.enable(12),v.vertexUv1s&&o.enable(13),v.vertexUv2s&&o.enable(14),v.vertexUv3s&&o.enable(15),v.vertexTangents&&o.enable(16),v.anisotropy&&o.enable(17),v.alphaHash&&o.enable(18),v.batching&&o.enable(19),v.dispersion&&o.enable(20),v.batchingColor&&o.enable(21),v.gradientMap&&o.enable(22),M.push(o.mask),o.disableAll(),v.fog&&o.enable(0),v.useFog&&o.enable(1),v.flatShading&&o.enable(2),v.logarithmicDepthBuffer&&o.enable(3),v.reversedDepthBuffer&&o.enable(4),v.skinning&&o.enable(5),v.morphTargets&&o.enable(6),v.morphNormals&&o.enable(7),v.morphColors&&o.enable(8),v.premultipliedAlpha&&o.enable(9),v.shadowMapEnabled&&o.enable(10),v.doubleSided&&o.enable(11),v.flipSided&&o.enable(12),v.useDepthPacking&&o.enable(13),v.dithering&&o.enable(14),v.transmission&&o.enable(15),v.sheen&&o.enable(16),v.opaque&&o.enable(17),v.pointsUvs&&o.enable(18),v.decodeVideoTexture&&o.enable(19),v.decodeVideoTextureEmissive&&o.enable(20),v.alphaToCoverage&&o.enable(21),M.push(o.mask)}function S(M){let v=_[M.type],C;if(v){let F=fn[v];C=Ac.clone(F.uniforms)}else C=M.uniforms;return C}function R(M,v){let C;for(let F=0,k=h.length;F0?n.push(u):p.transparent===!0?s.push(u):e.push(u)}function c(d,f,p,_,y,m){let u=a(d,f,p,_,y,m);p.transmission>0?n.unshift(u):p.transparent===!0?s.unshift(u):e.unshift(u)}function l(d,f){e.length>1&&e.sort(d||Sm),n.length>1&&n.sort(f||Jc),s.length>1&&s.sort(f||Jc)}function h(){for(let d=t,f=i.length;d=r.length?(a=new $c,r.push(a)):a=r[s],a}function e(){i=new WeakMap}return{get:t,dispose:e}}function Em(){let i={};return{get:function(t){if(i[t.id]!==void 0)return i[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new L,color:new Ot};break;case"SpotLight":e={position:new L,direction:new L,color:new Ot,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new L,color:new Ot,distance:0,decay:0};break;case"HemisphereLight":e={direction:new L,skyColor:new Ot,groundColor:new Ot};break;case"RectAreaLight":e={color:new Ot,position:new L,halfWidth:new L,halfHeight:new L};break}return i[t.id]=e,e}}}function Tm(){let i={};return{get:function(t){if(i[t.id]!==void 0)return i[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Pt};break;case"SpotLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Pt};break;case"PointLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Pt,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[t.id]=e,e}}}var wm=0;function Am(i,t){return(t.castShadow?2:0)-(i.castShadow?2:0)+(t.map?1:0)-(i.map?1:0)}function Rm(i){let t=new Em,e=Tm(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let l=0;l<9;l++)n.probe.push(new L);let s=new L,r=new he,a=new he;function o(l){let h=0,d=0,f=0;for(let M=0;M<9;M++)n.probe[M].set(0,0,0);let p=0,_=0,y=0,m=0,u=0,T=0,E=0,S=0,R=0,A=0,P=0;l.sort(Am);for(let M=0,v=l.length;M0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=st.LTC_FLOAT_1,n.rectAreaLTC2=st.LTC_FLOAT_2):(n.rectAreaLTC1=st.LTC_HALF_1,n.rectAreaLTC2=st.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=d,n.ambient[2]=f;let N=n.hash;(N.directionalLength!==p||N.pointLength!==_||N.spotLength!==y||N.rectAreaLength!==m||N.hemiLength!==u||N.numDirectionalShadows!==T||N.numPointShadows!==E||N.numSpotShadows!==S||N.numSpotMaps!==R||N.numLightProbes!==P)&&(n.directional.length=p,n.spot.length=y,n.rectArea.length=m,n.point.length=_,n.hemi.length=u,n.directionalShadow.length=T,n.directionalShadowMap.length=T,n.pointShadow.length=E,n.pointShadowMap.length=E,n.spotShadow.length=S,n.spotShadowMap.length=S,n.directionalShadowMatrix.length=T,n.pointShadowMatrix.length=E,n.spotLightMatrix.length=S+R-A,n.spotLightMap.length=R,n.numSpotLightShadowsWithMaps=A,n.numLightProbes=P,N.directionalLength=p,N.pointLength=_,N.spotLength=y,N.rectAreaLength=m,N.hemiLength=u,N.numDirectionalShadows=T,N.numPointShadows=E,N.numSpotShadows=S,N.numSpotMaps=R,N.numLightProbes=P,n.version=wm++)}function c(l,h){let d=0,f=0,p=0,_=0,y=0,m=h.matrixWorldInverse;for(let u=0,T=l.length;u=a.length?(o=new Kc(i),a.push(o)):o=a[r],o}function n(){t=new WeakMap}return{get:e,dispose:n}}var Im=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,Pm=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function Dm(i,t,e){let n=new Fi,s=new Pt,r=new Pt,a=new le,o=new xr({depthPacking:mc}),c=new yr,l={},h=e.maxTextureSize,d={[Sn]:De,[De]:Sn,[Ve]:Ve},f=new nn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Pt},radius:{value:4}},vertexShader:Im,fragmentShader:Pm}),p=f.clone();p.defines.HORIZONTAL_PASS=1;let _=new Ie;_.setAttribute("position",new Te(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let y=new Pe(_,f),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=fo;let u=this.type;this.render=function(A,P,N){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||A.length===0)return;let M=i.getRenderTarget(),v=i.getActiveCubeFace(),C=i.getActiveMipmapLevel(),F=i.state;F.setBlending(Tn),F.buffers.depth.getReversed()===!0?F.buffers.color.setClear(0,0,0,0):F.buffers.color.setClear(1,1,1,1),F.buffers.depth.setTest(!0),F.setScissorTest(!1);let k=u!==un&&this.type===un,H=u===un&&this.type!==un;for(let q=0,W=A.length;qh||s.y>h)&&(s.x>h&&(r.x=Math.floor(h/rt.x),s.x=r.x*rt.x,V.mapSize.x=r.x),s.y>h&&(r.y=Math.floor(h/rt.y),s.y=r.y*rt.y,V.mapSize.y=r.y)),V.map===null||k===!0||H===!0){let St=this.type!==un?{minFilter:Ye,magFilter:Ye}:{};V.map!==null&&V.map.dispose(),V.map=new cn(s.x,s.y,St),V.map.texture.name=et.name+".shadowMap",V.camera.updateProjectionMatrix()}i.setRenderTarget(V.map),i.clear();let ct=V.getViewportCount();for(let St=0;St0||P.map&&P.alphaTest>0||P.alphaToCoverage===!0){let F=v.uuid,k=P.uuid,H=l[F];H===void 0&&(H={},l[F]=H);let q=H[k];q===void 0&&(q=v.clone(),H[k]=q,P.addEventListener("dispose",R)),v=q}if(v.visible=P.visible,v.wireframe=P.wireframe,M===un?v.side=P.shadowSide!==null?P.shadowSide:P.side:v.side=P.shadowSide!==null?P.shadowSide:d[P.side],v.alphaMap=P.alphaMap,v.alphaTest=P.alphaToCoverage===!0?.5:P.alphaTest,v.map=P.map,v.clipShadows=P.clipShadows,v.clippingPlanes=P.clippingPlanes,v.clipIntersection=P.clipIntersection,v.displacementMap=P.displacementMap,v.displacementScale=P.displacementScale,v.displacementBias=P.displacementBias,v.wireframeLinewidth=P.wireframeLinewidth,v.linewidth=P.linewidth,N.isPointLight===!0&&v.isMeshDistanceMaterial===!0){let F=i.properties.get(v);F.light=N}return v}function S(A,P,N,M,v){if(A.visible===!1)return;if(A.layers.test(P.layers)&&(A.isMesh||A.isLine||A.isPoints)&&(A.castShadow||A.receiveShadow&&v===un)&&(!A.frustumCulled||n.intersectsObject(A))){A.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,A.matrixWorld);let k=t.update(A),H=A.material;if(Array.isArray(H)){let q=k.groups;for(let W=0,et=q.length;W=1):V.indexOf("OpenGL ES")!==-1&&(et=parseFloat(/^OpenGL ES (\d)/.exec(V)[1]),W=et>=2);let rt=null,ct={},St=i.getParameter(i.SCISSOR_BOX),kt=i.getParameter(i.VIEWPORT),jt=new le().fromArray(St),ne=new le().fromArray(kt);function Xt(I,tt,it,ut){let K=new Uint8Array(4),Z=i.createTexture();i.bindTexture(I,Z),i.texParameteri(I,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(I,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let pt=0;pt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),l=new Pt,h=new WeakMap,d,f=new WeakMap,p=!1;try{p=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(b,g){return p?new OffscreenCanvas(b,g):ls("canvas")}function y(b,g,O){let X=1,J=ue(b);if((J.width>O||J.height>O)&&(X=O/Math.max(J.width,J.height)),X<1)if(typeof HTMLImageElement<"u"&&b instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&b instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&b instanceof ImageBitmap||typeof VideoFrame<"u"&&b instanceof VideoFrame){let G=Math.floor(X*J.width),vt=Math.floor(X*J.height);d===void 0&&(d=_(G,vt));let nt=g?_(G,vt):d;return nt.width=G,nt.height=vt,nt.getContext("2d").drawImage(b,0,0,G,vt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+J.width+"x"+J.height+") to ("+G+"x"+vt+")."),nt}else return"data"in b&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+J.width+"x"+J.height+")."),b;return b}function m(b){return b.generateMipmaps}function u(b){i.generateMipmap(b)}function T(b){return b.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:b.isWebGL3DRenderTarget?i.TEXTURE_3D:b.isWebGLArrayRenderTarget||b.isCompressedArrayTexture?i.TEXTURE_2D_ARRAY:i.TEXTURE_2D}function E(b,g,O,X,J=!1){if(b!==null){if(i[b]!==void 0)return i[b];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+b+"'")}let G=g;if(g===i.RED&&(O===i.FLOAT&&(G=i.R32F),O===i.HALF_FLOAT&&(G=i.R16F),O===i.UNSIGNED_BYTE&&(G=i.R8)),g===i.RED_INTEGER&&(O===i.UNSIGNED_BYTE&&(G=i.R8UI),O===i.UNSIGNED_SHORT&&(G=i.R16UI),O===i.UNSIGNED_INT&&(G=i.R32UI),O===i.BYTE&&(G=i.R8I),O===i.SHORT&&(G=i.R16I),O===i.INT&&(G=i.R32I)),g===i.RG&&(O===i.FLOAT&&(G=i.RG32F),O===i.HALF_FLOAT&&(G=i.RG16F),O===i.UNSIGNED_BYTE&&(G=i.RG8)),g===i.RG_INTEGER&&(O===i.UNSIGNED_BYTE&&(G=i.RG8UI),O===i.UNSIGNED_SHORT&&(G=i.RG16UI),O===i.UNSIGNED_INT&&(G=i.RG32UI),O===i.BYTE&&(G=i.RG8I),O===i.SHORT&&(G=i.RG16I),O===i.INT&&(G=i.RG32I)),g===i.RGB_INTEGER&&(O===i.UNSIGNED_BYTE&&(G=i.RGB8UI),O===i.UNSIGNED_SHORT&&(G=i.RGB16UI),O===i.UNSIGNED_INT&&(G=i.RGB32UI),O===i.BYTE&&(G=i.RGB8I),O===i.SHORT&&(G=i.RGB16I),O===i.INT&&(G=i.RGB32I)),g===i.RGBA_INTEGER&&(O===i.UNSIGNED_BYTE&&(G=i.RGBA8UI),O===i.UNSIGNED_SHORT&&(G=i.RGBA16UI),O===i.UNSIGNED_INT&&(G=i.RGBA32UI),O===i.BYTE&&(G=i.RGBA8I),O===i.SHORT&&(G=i.RGBA16I),O===i.INT&&(G=i.RGBA32I)),g===i.RGB&&(O===i.UNSIGNED_INT_5_9_9_9_REV&&(G=i.RGB9_E5),O===i.UNSIGNED_INT_10F_11F_11F_REV&&(G=i.R11F_G11F_B10F)),g===i.RGBA){let vt=J?as:Gt.getTransfer(X);O===i.FLOAT&&(G=i.RGBA32F),O===i.HALF_FLOAT&&(G=i.RGBA16F),O===i.UNSIGNED_BYTE&&(G=vt===Yt?i.SRGB8_ALPHA8:i.RGBA8),O===i.UNSIGNED_SHORT_4_4_4_4&&(G=i.RGBA4),O===i.UNSIGNED_SHORT_5_5_5_1&&(G=i.RGB5_A1)}return(G===i.R16F||G===i.R32F||G===i.RG16F||G===i.RG32F||G===i.RGBA16F||G===i.RGBA32F)&&t.get("EXT_color_buffer_float"),G}function S(b,g){let O;return b?g===null||g===Xn||g===Hi?O=i.DEPTH24_STENCIL8:g===dn?O=i.DEPTH32F_STENCIL8:g===ki&&(O=i.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):g===null||g===Xn||g===Hi?O=i.DEPTH_COMPONENT24:g===dn?O=i.DEPTH_COMPONENT32F:g===ki&&(O=i.DEPTH_COMPONENT16),O}function R(b,g){return m(b)===!0||b.isFramebufferTexture&&b.minFilter!==Ye&&b.minFilter!==tn?Math.log2(Math.max(g.width,g.height))+1:b.mipmaps!==void 0&&b.mipmaps.length>0?b.mipmaps.length:b.isCompressedTexture&&Array.isArray(b.image)?g.mipmaps.length:1}function A(b){let g=b.target;g.removeEventListener("dispose",A),N(g),g.isVideoTexture&&h.delete(g)}function P(b){let g=b.target;g.removeEventListener("dispose",P),v(g)}function N(b){let g=n.get(b);if(g.__webglInit===void 0)return;let O=b.source,X=f.get(O);if(X){let J=X[g.__cacheKey];J.usedTimes--,J.usedTimes===0&&M(b),Object.keys(X).length===0&&f.delete(O)}n.remove(b)}function M(b){let g=n.get(b);i.deleteTexture(g.__webglTexture);let O=b.source,X=f.get(O);delete X[g.__cacheKey],a.memory.textures--}function v(b){let g=n.get(b);if(b.depthTexture&&(b.depthTexture.dispose(),n.remove(b.depthTexture)),b.isWebGLCubeRenderTarget)for(let X=0;X<6;X++){if(Array.isArray(g.__webglFramebuffer[X]))for(let J=0;J=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+b+" texture units while this GPU supports only "+s.maxTextures),C+=1,b}function H(b){let g=[];return g.push(b.wrapS),g.push(b.wrapT),g.push(b.wrapR||0),g.push(b.magFilter),g.push(b.minFilter),g.push(b.anisotropy),g.push(b.internalFormat),g.push(b.format),g.push(b.type),g.push(b.generateMipmaps),g.push(b.premultiplyAlpha),g.push(b.flipY),g.push(b.unpackAlignment),g.push(b.colorSpace),g.join()}function q(b,g){let O=n.get(b);if(b.isVideoTexture&&Ft(b),b.isRenderTargetTexture===!1&&b.isExternalTexture!==!0&&b.version>0&&O.__version!==b.version){let X=b.image;if(X===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(X.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Y(O,b,g);return}}else b.isExternalTexture&&(O.__webglTexture=b.sourceTexture?b.sourceTexture:null);e.bindTexture(i.TEXTURE_2D,O.__webglTexture,i.TEXTURE0+g)}function W(b,g){let O=n.get(b);if(b.isRenderTargetTexture===!1&&b.version>0&&O.__version!==b.version){Y(O,b,g);return}e.bindTexture(i.TEXTURE_2D_ARRAY,O.__webglTexture,i.TEXTURE0+g)}function et(b,g){let O=n.get(b);if(b.isRenderTargetTexture===!1&&b.version>0&&O.__version!==b.version){Y(O,b,g);return}e.bindTexture(i.TEXTURE_3D,O.__webglTexture,i.TEXTURE0+g)}function V(b,g){let O=n.get(b);if(b.version>0&&O.__version!==b.version){$(O,b,g);return}e.bindTexture(i.TEXTURE_CUBE_MAP,O.__webglTexture,i.TEXTURE0+g)}let rt={[ar]:i.REPEAT,[Fn]:i.CLAMP_TO_EDGE,[or]:i.MIRRORED_REPEAT},ct={[Ye]:i.NEAREST,[fc]:i.NEAREST_MIPMAP_NEAREST,[Cs]:i.NEAREST_MIPMAP_LINEAR,[tn]:i.LINEAR,[kr]:i.LINEAR_MIPMAP_NEAREST,[Wn]:i.LINEAR_MIPMAP_LINEAR},St={[_c]:i.NEVER,[bc]:i.ALWAYS,[xc]:i.LESS,[Ro]:i.LEQUAL,[yc]:i.EQUAL,[Sc]:i.GEQUAL,[vc]:i.GREATER,[Mc]:i.NOTEQUAL};function kt(b,g){if(g.type===dn&&t.has("OES_texture_float_linear")===!1&&(g.magFilter===tn||g.magFilter===kr||g.magFilter===Cs||g.magFilter===Wn||g.minFilter===tn||g.minFilter===kr||g.minFilter===Cs||g.minFilter===Wn)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(b,i.TEXTURE_WRAP_S,rt[g.wrapS]),i.texParameteri(b,i.TEXTURE_WRAP_T,rt[g.wrapT]),(b===i.TEXTURE_3D||b===i.TEXTURE_2D_ARRAY)&&i.texParameteri(b,i.TEXTURE_WRAP_R,rt[g.wrapR]),i.texParameteri(b,i.TEXTURE_MAG_FILTER,ct[g.magFilter]),i.texParameteri(b,i.TEXTURE_MIN_FILTER,ct[g.minFilter]),g.compareFunction&&(i.texParameteri(b,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(b,i.TEXTURE_COMPARE_FUNC,St[g.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(g.magFilter===Ye||g.minFilter!==Cs&&g.minFilter!==Wn||g.type===dn&&t.has("OES_texture_float_linear")===!1)return;if(g.anisotropy>1||n.get(g).__currentAnisotropy){let O=t.get("EXT_texture_filter_anisotropic");i.texParameterf(b,O.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(g.anisotropy,s.getMaxAnisotropy())),n.get(g).__currentAnisotropy=g.anisotropy}}}function jt(b,g){let O=!1;b.__webglInit===void 0&&(b.__webglInit=!0,g.addEventListener("dispose",A));let X=g.source,J=f.get(X);J===void 0&&(J={},f.set(X,J));let G=H(g);if(G!==b.__cacheKey){J[G]===void 0&&(J[G]={texture:i.createTexture(),usedTimes:0},a.memory.textures++,O=!0),J[G].usedTimes++;let vt=J[b.__cacheKey];vt!==void 0&&(J[b.__cacheKey].usedTimes--,vt.usedTimes===0&&M(g)),b.__cacheKey=G,b.__webglTexture=J[G].texture}return O}function ne(b,g,O){return Math.floor(Math.floor(b/O)/g)}function Xt(b,g,O,X){let G=b.updateRanges;if(G.length===0)e.texSubImage2D(i.TEXTURE_2D,0,0,0,g.width,g.height,O,X,g.data);else{G.sort((Q,lt)=>Q.start-lt.start);let vt=0;for(let Q=1;Q0){I&&tt&&e.texStorage2D(i.TEXTURE_2D,ut,yt,Nt[0].width,Nt[0].height);for(let K=0,Z=Nt.length;K0){let pt=Fo(at.width,at.height,g.format,g.type);for(let Dt of g.layerUpdates){let Qt=at.data.subarray(Dt*pt/at.data.BYTES_PER_ELEMENT,(Dt+1)*pt/at.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,K,0,0,Dt,at.width,at.height,1,lt,Qt)}g.clearLayerUpdates()}else e.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,K,0,0,0,at.width,at.height,Q.depth,lt,at.data)}else e.compressedTexImage3D(i.TEXTURE_2D_ARRAY,K,yt,at.width,at.height,Q.depth,0,at.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else I?it&&e.texSubImage3D(i.TEXTURE_2D_ARRAY,K,0,0,0,at.width,at.height,Q.depth,lt,At,at.data):e.texImage3D(i.TEXTURE_2D_ARRAY,K,yt,at.width,at.height,Q.depth,0,lt,At,at.data)}else{I&&tt&&e.texStorage2D(i.TEXTURE_2D,ut,yt,Nt[0].width,Nt[0].height);for(let K=0,Z=Nt.length;K0){let K=Fo(Q.width,Q.height,g.format,g.type);for(let Z of g.layerUpdates){let pt=Q.data.subarray(Z*K/Q.data.BYTES_PER_ELEMENT,(Z+1)*K/Q.data.BYTES_PER_ELEMENT);e.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,Z,Q.width,Q.height,1,lt,At,pt)}g.clearLayerUpdates()}else e.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,Q.width,Q.height,Q.depth,lt,At,Q.data)}else e.texImage3D(i.TEXTURE_2D_ARRAY,0,yt,Q.width,Q.height,Q.depth,0,lt,At,Q.data);else if(g.isData3DTexture)I?(tt&&e.texStorage3D(i.TEXTURE_3D,ut,yt,Q.width,Q.height,Q.depth),it&&e.texSubImage3D(i.TEXTURE_3D,0,0,0,0,Q.width,Q.height,Q.depth,lt,At,Q.data)):e.texImage3D(i.TEXTURE_3D,0,yt,Q.width,Q.height,Q.depth,0,lt,At,Q.data);else if(g.isFramebufferTexture){if(tt)if(I)e.texStorage2D(i.TEXTURE_2D,ut,yt,Q.width,Q.height);else{let K=Q.width,Z=Q.height;for(let pt=0;pt>=1,Z>>=1}}else if(Nt.length>0){if(I&&tt){let K=ue(Nt[0]);e.texStorage2D(i.TEXTURE_2D,ut,yt,K.width,K.height)}for(let K=0,Z=Nt.length;K0&&ut++;let Z=ue(lt[0]);e.texStorage2D(i.TEXTURE_CUBE_MAP,ut,Nt,Z.width,Z.height)}for(let Z=0;Z<6;Z++)if(Q){I?it&&e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Z,0,0,0,lt[Z].width,lt[Z].height,yt,at,lt[Z].data):e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Z,0,Nt,lt[Z].width,lt[Z].height,0,yt,at,lt[Z].data);for(let pt=0;pt>G),At=Math.max(1,g.height>>G);J===i.TEXTURE_3D||J===i.TEXTURE_2D_ARRAY?e.texImage3D(J,G,_t,lt,At,g.depth,0,vt,nt,null):e.texImage2D(J,G,_t,lt,At,0,vt,nt,null)}e.bindFramebuffer(i.FRAMEBUFFER,b),gt(g)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,X,J,Q.__webglTexture,0,se(g)):(J===i.TEXTURE_2D||J>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&J<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,X,J,Q.__webglTexture,G),e.bindFramebuffer(i.FRAMEBUFFER,null)}function It(b,g,O){if(i.bindRenderbuffer(i.RENDERBUFFER,b),g.depthBuffer){let X=g.depthTexture,J=X&&X.isDepthTexture?X.type:null,G=S(g.stencilBuffer,J),vt=g.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,nt=se(g);gt(g)?o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,nt,G,g.width,g.height):O?i.renderbufferStorageMultisample(i.RENDERBUFFER,nt,G,g.width,g.height):i.renderbufferStorage(i.RENDERBUFFER,G,g.width,g.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,vt,i.RENDERBUFFER,b)}else{let X=g.textures;for(let J=0;J{delete g.__boundDepthTexture,delete g.__depthDisposeCallback,X.removeEventListener("dispose",J)};X.addEventListener("dispose",J),g.__depthDisposeCallback=J}g.__boundDepthTexture=X}if(b.depthTexture&&!g.__autoAllocateDepthBuffer){if(O)throw new Error("target.depthTexture not supported in Cube render targets");let X=b.texture.mipmaps;X&&X.length>0?Mt(g.__webglFramebuffer[0],b):Mt(g.__webglFramebuffer,b)}else if(O){g.__webglDepthbuffer=[];for(let X=0;X<6;X++)if(e.bindFramebuffer(i.FRAMEBUFFER,g.__webglFramebuffer[X]),g.__webglDepthbuffer[X]===void 0)g.__webglDepthbuffer[X]=i.createRenderbuffer(),It(g.__webglDepthbuffer[X],b,!1);else{let J=b.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,G=g.__webglDepthbuffer[X];i.bindRenderbuffer(i.RENDERBUFFER,G),i.framebufferRenderbuffer(i.FRAMEBUFFER,J,i.RENDERBUFFER,G)}}else{let X=b.texture.mipmaps;if(X&&X.length>0?e.bindFramebuffer(i.FRAMEBUFFER,g.__webglFramebuffer[0]):e.bindFramebuffer(i.FRAMEBUFFER,g.__webglFramebuffer),g.__webglDepthbuffer===void 0)g.__webglDepthbuffer=i.createRenderbuffer(),It(g.__webglDepthbuffer,b,!1);else{let J=b.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,G=g.__webglDepthbuffer;i.bindRenderbuffer(i.RENDERBUFFER,G),i.framebufferRenderbuffer(i.FRAMEBUFFER,J,i.RENDERBUFFER,G)}}e.bindFramebuffer(i.FRAMEBUFFER,null)}function Me(b,g,O){let X=n.get(b);g!==void 0&&dt(X.__webglFramebuffer,b,b.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),O!==void 0&&Ht(b)}function w(b){let g=b.texture,O=n.get(b),X=n.get(g);b.addEventListener("dispose",P);let J=b.textures,G=b.isWebGLCubeRenderTarget===!0,vt=J.length>1;if(vt||(X.__webglTexture===void 0&&(X.__webglTexture=i.createTexture()),X.__version=g.version,a.memory.textures++),G){O.__webglFramebuffer=[];for(let nt=0;nt<6;nt++)if(g.mipmaps&&g.mipmaps.length>0){O.__webglFramebuffer[nt]=[];for(let _t=0;_t0){O.__webglFramebuffer=[];for(let nt=0;nt0&>(b)===!1){O.__webglMultisampledFramebuffer=i.createFramebuffer(),O.__webglColorRenderbuffer=[],e.bindFramebuffer(i.FRAMEBUFFER,O.__webglMultisampledFramebuffer);for(let nt=0;nt0)for(let _t=0;_t0)for(let _t=0;_t0){if(gt(b)===!1){let g=b.textures,O=b.width,X=b.height,J=i.COLOR_BUFFER_BIT,G=b.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,vt=n.get(b),nt=g.length>1;if(nt)for(let xt=0;xt0?e.bindFramebuffer(i.DRAW_FRAMEBUFFER,vt.__webglFramebuffer[0]):e.bindFramebuffer(i.DRAW_FRAMEBUFFER,vt.__webglFramebuffer);for(let xt=0;xt0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&g.__useRenderToTexture!==!1}function Ft(b){let g=a.render.frame;h.get(b)!==g&&(h.set(b,g),b.update())}function _e(b,g){let O=b.colorSpace,X=b.format,J=b.type;return b.isCompressedTexture===!0||b.isVideoTexture===!0||O!==bn&&O!==An&&(Gt.getTransfer(O)===Yt?(X!==Je||J!==sn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",O)),g}function ue(b){return typeof HTMLImageElement<"u"&&b instanceof HTMLImageElement?(l.width=b.naturalWidth||b.width,l.height=b.naturalHeight||b.height):typeof VideoFrame<"u"&&b instanceof VideoFrame?(l.width=b.displayWidth,l.height=b.displayHeight):(l.width=b.width,l.height=b.height),l}this.allocateTextureUnit=k,this.resetTextureUnits=F,this.setTexture2D=q,this.setTexture2DArray=W,this.setTexture3D=et,this.setTextureCube=V,this.rebindTextures=Me,this.setupRenderTarget=w,this.updateRenderTargetMipmap=ie,this.updateMultisampleRenderTarget=mt,this.setupDepthRenderbuffer=Ht,this.setupFrameBufferTexture=dt,this.useMultisampledRTT=gt}function Fm(i,t){function e(n,s=An){let r,a=Gt.getTransfer(s);if(n===sn)return i.UNSIGNED_BYTE;if(n===Hr)return i.UNSIGNED_SHORT_4_4_4_4;if(n===Gr)return i.UNSIGNED_SHORT_5_5_5_1;if(n===Mo)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===So)return i.UNSIGNED_INT_10F_11F_11F_REV;if(n===yo)return i.BYTE;if(n===vo)return i.SHORT;if(n===ki)return i.UNSIGNED_SHORT;if(n===Vr)return i.INT;if(n===Xn)return i.UNSIGNED_INT;if(n===dn)return i.FLOAT;if(n===Vi)return i.HALF_FLOAT;if(n===bo)return i.ALPHA;if(n===Eo)return i.RGB;if(n===Je)return i.RGBA;if(n===Pi)return i.DEPTH_COMPONENT;if(n===Gi)return i.DEPTH_STENCIL;if(n===To)return i.RED;if(n===Wr)return i.RED_INTEGER;if(n===wo)return i.RG;if(n===Xr)return i.RG_INTEGER;if(n===qr)return i.RGBA_INTEGER;if(n===Is||n===Ps||n===Ds||n===Ls)if(a===Yt)if(r=t.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(n===Is)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Ps)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Ds)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Ls)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=t.get("WEBGL_compressed_texture_s3tc"),r!==null){if(n===Is)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Ps)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Ds)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Ls)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Yr||n===Zr||n===Jr||n===$r)if(r=t.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(n===Yr)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Zr)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Jr)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===$r)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Kr||n===jr||n===Qr)if(r=t.get("WEBGL_compressed_texture_etc"),r!==null){if(n===Kr||n===jr)return a===Yt?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===Qr)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===ta||n===ea||n===na||n===ia||n===sa||n===ra||n===aa||n===oa||n===la||n===ca||n===ha||n===ua||n===da||n===fa)if(r=t.get("WEBGL_compressed_texture_astc"),r!==null){if(n===ta)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===ea)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===na)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===ia)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===sa)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===ra)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===aa)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===oa)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===la)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===ca)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===ha)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===ua)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===da)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===fa)return a===Yt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===pa||n===ma||n===ga)if(r=t.get("EXT_texture_compression_bptc"),r!==null){if(n===pa)return a===Yt?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===ma)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===ga)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===_a||n===xa||n===ya||n===va)if(r=t.get("EXT_texture_compression_rgtc"),r!==null){if(n===_a)return r.COMPRESSED_RED_RGTC1_EXT;if(n===xa)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===ya)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===va)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Hi?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:e}}var Om=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,Bm=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`,Jo=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e){if(this.texture===null){let n=new ys(t.texture);(t.depthNear!==e.depthNear||t.depthFar!==e.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=n}}getMesh(t){if(this.texture!==null&&this.mesh===null){let e=t.cameras[0].viewport,n=new nn({vertexShader:Om,fragmentShader:Bm,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new Pe(new ai(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},$o=class extends ln{constructor(t,e){super();let n=this,s=null,r=1,a=null,o="local-floor",c=1,l=null,h=null,d=null,f=null,p=null,_=null,y=typeof XRWebGLBinding<"u",m=new Jo,u={},T=e.getContextAttributes(),E=null,S=null,R=[],A=[],P=new Pt,N=null,M=new Ee;M.viewport=new le;let v=new Ee;v.viewport=new le;let C=[M,v],F=new Cr,k=null,H=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let $=R[Y];return $===void 0&&($=new Ni,R[Y]=$),$.getTargetRaySpace()},this.getControllerGrip=function(Y){let $=R[Y];return $===void 0&&($=new Ni,R[Y]=$),$.getGripSpace()},this.getHand=function(Y){let $=R[Y];return $===void 0&&($=new Ni,R[Y]=$),$.getHandSpace()};function q(Y){let $=A.indexOf(Y.inputSource);if($===-1)return;let dt=R[$];dt!==void 0&&(dt.update(Y.inputSource,Y.frame,l||a),dt.dispatchEvent({type:Y.type,data:Y.inputSource}))}function W(){s.removeEventListener("select",q),s.removeEventListener("selectstart",q),s.removeEventListener("selectend",q),s.removeEventListener("squeeze",q),s.removeEventListener("squeezestart",q),s.removeEventListener("squeezeend",q),s.removeEventListener("end",W),s.removeEventListener("inputsourceschange",et);for(let Y=0;Y=0&&(A[It]=null,R[It].disconnect(dt))}for(let $=0;$=A.length){A.push(dt),It=Ht;break}else if(A[Ht]===null){A[Ht]=dt,It=Ht;break}if(It===-1)break}let Mt=R[It];Mt&&Mt.connect(dt)}}let V=new L,rt=new L;function ct(Y,$,dt){V.setFromMatrixPosition($.matrixWorld),rt.setFromMatrixPosition(dt.matrixWorld);let It=V.distanceTo(rt),Mt=$.projectionMatrix.elements,Ht=dt.projectionMatrix.elements,Me=Mt[14]/(Mt[10]-1),w=Mt[14]/(Mt[10]+1),ie=(Mt[9]+1)/Mt[5],Lt=(Mt[9]-1)/Mt[5],Rt=(Mt[8]-1)/Mt[0],mt=(Ht[8]+1)/Ht[0],se=Me*Rt,gt=Me*mt,Ft=It/(-Rt+mt),_e=Ft*-Rt;if($.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX(_e),Y.translateZ(Ft),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert(),Mt[10]===-1)Y.projectionMatrix.copy($.projectionMatrix),Y.projectionMatrixInverse.copy($.projectionMatrixInverse);else{let ue=Me+Ft,b=w+Ft,g=se-_e,O=gt+(It-_e),X=ie*w/b*ue,J=Lt*w/b*ue;Y.projectionMatrix.makePerspective(g,O,X,J,ue,b),Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert()}}function St(Y,$){$===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices($.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(s===null)return;let $=Y.near,dt=Y.far;m.texture!==null&&(m.depthNear>0&&($=m.depthNear),m.depthFar>0&&(dt=m.depthFar)),F.near=v.near=M.near=$,F.far=v.far=M.far=dt,(k!==F.near||H!==F.far)&&(s.updateRenderState({depthNear:F.near,depthFar:F.far}),k=F.near,H=F.far),F.layers.mask=Y.layers.mask|6,M.layers.mask=F.layers.mask&3,v.layers.mask=F.layers.mask&5;let It=Y.parent,Mt=F.cameras;St(F,It);for(let Ht=0;Ht0&&(m.alphaTest.value=u.alphaTest);let T=t.get(u),E=T.envMap,S=T.envMapRotation;E&&(m.envMap.value=E,di.copy(S),di.x*=-1,di.y*=-1,di.z*=-1,E.isCubeTexture&&E.isRenderTargetTexture===!1&&(di.y*=-1,di.z*=-1),m.envMapRotation.value.setFromMatrix4(zm.makeRotationFromEuler(di)),m.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=u.reflectivity,m.ior.value=u.ior,m.refractionRatio.value=u.refractionRatio),u.lightMap&&(m.lightMap.value=u.lightMap,m.lightMapIntensity.value=u.lightMapIntensity,e(u.lightMap,m.lightMapTransform)),u.aoMap&&(m.aoMap.value=u.aoMap,m.aoMapIntensity.value=u.aoMapIntensity,e(u.aoMap,m.aoMapTransform))}function a(m,u){m.diffuse.value.copy(u.color),m.opacity.value=u.opacity,u.map&&(m.map.value=u.map,e(u.map,m.mapTransform))}function o(m,u){m.dashSize.value=u.dashSize,m.totalSize.value=u.dashSize+u.gapSize,m.scale.value=u.scale}function c(m,u,T,E){m.diffuse.value.copy(u.color),m.opacity.value=u.opacity,m.size.value=u.size*T,m.scale.value=E*.5,u.map&&(m.map.value=u.map,e(u.map,m.uvTransform)),u.alphaMap&&(m.alphaMap.value=u.alphaMap,e(u.alphaMap,m.alphaMapTransform)),u.alphaTest>0&&(m.alphaTest.value=u.alphaTest)}function l(m,u){m.diffuse.value.copy(u.color),m.opacity.value=u.opacity,m.rotation.value=u.rotation,u.map&&(m.map.value=u.map,e(u.map,m.mapTransform)),u.alphaMap&&(m.alphaMap.value=u.alphaMap,e(u.alphaMap,m.alphaMapTransform)),u.alphaTest>0&&(m.alphaTest.value=u.alphaTest)}function h(m,u){m.specular.value.copy(u.specular),m.shininess.value=Math.max(u.shininess,1e-4)}function d(m,u){u.gradientMap&&(m.gradientMap.value=u.gradientMap)}function f(m,u){m.metalness.value=u.metalness,u.metalnessMap&&(m.metalnessMap.value=u.metalnessMap,e(u.metalnessMap,m.metalnessMapTransform)),m.roughness.value=u.roughness,u.roughnessMap&&(m.roughnessMap.value=u.roughnessMap,e(u.roughnessMap,m.roughnessMapTransform)),u.envMap&&(m.envMapIntensity.value=u.envMapIntensity)}function p(m,u,T){m.ior.value=u.ior,u.sheen>0&&(m.sheenColor.value.copy(u.sheenColor).multiplyScalar(u.sheen),m.sheenRoughness.value=u.sheenRoughness,u.sheenColorMap&&(m.sheenColorMap.value=u.sheenColorMap,e(u.sheenColorMap,m.sheenColorMapTransform)),u.sheenRoughnessMap&&(m.sheenRoughnessMap.value=u.sheenRoughnessMap,e(u.sheenRoughnessMap,m.sheenRoughnessMapTransform))),u.clearcoat>0&&(m.clearcoat.value=u.clearcoat,m.clearcoatRoughness.value=u.clearcoatRoughness,u.clearcoatMap&&(m.clearcoatMap.value=u.clearcoatMap,e(u.clearcoatMap,m.clearcoatMapTransform)),u.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=u.clearcoatRoughnessMap,e(u.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),u.clearcoatNormalMap&&(m.clearcoatNormalMap.value=u.clearcoatNormalMap,e(u.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(u.clearcoatNormalScale),u.side===De&&m.clearcoatNormalScale.value.negate())),u.dispersion>0&&(m.dispersion.value=u.dispersion),u.iridescence>0&&(m.iridescence.value=u.iridescence,m.iridescenceIOR.value=u.iridescenceIOR,m.iridescenceThicknessMinimum.value=u.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=u.iridescenceThicknessRange[1],u.iridescenceMap&&(m.iridescenceMap.value=u.iridescenceMap,e(u.iridescenceMap,m.iridescenceMapTransform)),u.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=u.iridescenceThicknessMap,e(u.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),u.transmission>0&&(m.transmission.value=u.transmission,m.transmissionSamplerMap.value=T.texture,m.transmissionSamplerSize.value.set(T.width,T.height),u.transmissionMap&&(m.transmissionMap.value=u.transmissionMap,e(u.transmissionMap,m.transmissionMapTransform)),m.thickness.value=u.thickness,u.thicknessMap&&(m.thicknessMap.value=u.thicknessMap,e(u.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=u.attenuationDistance,m.attenuationColor.value.copy(u.attenuationColor)),u.anisotropy>0&&(m.anisotropyVector.value.set(u.anisotropy*Math.cos(u.anisotropyRotation),u.anisotropy*Math.sin(u.anisotropyRotation)),u.anisotropyMap&&(m.anisotropyMap.value=u.anisotropyMap,e(u.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=u.specularIntensity,m.specularColor.value.copy(u.specularColor),u.specularColorMap&&(m.specularColorMap.value=u.specularColorMap,e(u.specularColorMap,m.specularColorMapTransform)),u.specularIntensityMap&&(m.specularIntensityMap.value=u.specularIntensityMap,e(u.specularIntensityMap,m.specularIntensityMapTransform))}function _(m,u){u.matcap&&(m.matcap.value=u.matcap)}function y(m,u){let T=t.get(u).light;m.referencePosition.value.setFromMatrixPosition(T.matrixWorld),m.nearDistance.value=T.shadow.camera.near,m.farDistance.value=T.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:s}}function Vm(i,t,e,n){let s={},r={},a=[],o=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function c(T,E){let S=E.program;n.uniformBlockBinding(T,S)}function l(T,E){let S=s[T.id];S===void 0&&(_(T),S=h(T),s[T.id]=S,T.addEventListener("dispose",m));let R=E.program;n.updateUBOMapping(T,R);let A=t.render.frame;r[T.id]!==A&&(f(T),r[T.id]=A)}function h(T){let E=d();T.__bindingPointIndex=E;let S=i.createBuffer(),R=T.__size,A=T.usage;return i.bindBuffer(i.UNIFORM_BUFFER,S),i.bufferData(i.UNIFORM_BUFFER,R,A),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,E,S),S}function d(){for(let T=0;T0&&(S+=R-A),T.__size=S,T.__cache={},this}function y(T){let E={boundary:0,storage:0};return typeof T=="number"||typeof T=="boolean"?(E.boundary=4,E.storage=4):T.isVector2?(E.boundary=8,E.storage=8):T.isVector3||T.isColor?(E.boundary=16,E.storage=12):T.isVector4?(E.boundary=16,E.storage=16):T.isMatrix3?(E.boundary=48,E.storage=48):T.isMatrix4?(E.boundary=64,E.storage=64):T.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",T),E}function m(T){let E=T.target;E.removeEventListener("dispose",m);let S=a.indexOf(E.__bindingPointIndex);a.splice(S,1),i.deleteBuffer(s[E.id]),delete s[E.id],delete r[E.id]}function u(){for(let T in s)i.deleteBuffer(s[T]);a=[],s={},r={}}return{bind:c,update:l,dispose:u}}var Ta=class{constructor(t={}){let{canvas:e=Ec(),context:n=null,depth:s=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:l=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:d=!1,reversedDepthBuffer:f=!1}=t;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=n.getContextAttributes().alpha}else p=a;let _=new Uint32Array(4),y=new Int32Array(4),m=null,u=null,T=[],E=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=wn,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let S=this,R=!1;this._outputColorSpace=Ce;let A=0,P=0,N=null,M=-1,v=null,C=new le,F=new le,k=null,H=new Ot(0),q=0,W=e.width,et=e.height,V=1,rt=null,ct=null,St=new le(0,0,W,et),kt=new le(0,0,W,et),jt=!1,ne=new Fi,Xt=!1,Y=!1,$=new he,dt=new L,It=new le,Mt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},Ht=!1;function Me(){return N===null?V:1}let w=n;function ie(x,D){return e.getContext(x,D)}try{let x={alpha:!0,depth:s,stencil:r,antialias:o,premultipliedAlpha:c,preserveDrawingBuffer:l,powerPreference:h,failIfMajorPerformanceCaveat:d};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${"180"}`),e.addEventListener("webglcontextlost",it,!1),e.addEventListener("webglcontextrestored",ut,!1),e.addEventListener("webglcontextcreationerror",K,!1),w===null){let D="webgl2";if(w=ie(D,x),w===null)throw ie(D)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(x){throw console.error("THREE.WebGLRenderer: "+x.message),x}let Lt,Rt,mt,se,gt,Ft,_e,ue,b,g,O,X,J,G,vt,nt,_t,xt,Q,lt,At,yt,at,Nt;function I(){Lt=new rp(w),Lt.init(),yt=new Fm(w,Lt),Rt=new jf(w,Lt,t,yt),mt=new Um(w,Lt),Rt.reversedDepthBuffer&&f&&mt.buffers.depth.setReversed(!0),se=new lp(w),gt=new Mm,Ft=new Nm(w,Lt,mt,gt,Rt,yt,se),_e=new tp(S),ue=new sp(S),b=new fu(w),at=new $f(w,b),g=new ap(w,b,se,at),O=new hp(w,g,b,se),Q=new cp(w,Rt,Ft),nt=new Qf(gt),X=new vm(S,_e,ue,Lt,Rt,at,nt),J=new km(S,gt),G=new bm,vt=new Cm(Lt),xt=new Jf(S,_e,ue,mt,O,p,c),_t=new Dm(S,O,Rt),Nt=new Vm(w,se,Rt,mt),lt=new Kf(w,Lt,se),At=new op(w,Lt,se),se.programs=X.programs,S.capabilities=Rt,S.extensions=Lt,S.properties=gt,S.renderLists=G,S.shadowMap=_t,S.state=mt,S.info=se}I();let tt=new $o(S,w);this.xr=tt,this.getContext=function(){return w},this.getContextAttributes=function(){return w.getContextAttributes()},this.forceContextLoss=function(){let x=Lt.get("WEBGL_lose_context");x&&x.loseContext()},this.forceContextRestore=function(){let x=Lt.get("WEBGL_lose_context");x&&x.restoreContext()},this.getPixelRatio=function(){return V},this.setPixelRatio=function(x){x!==void 0&&(V=x,this.setSize(W,et,!1))},this.getSize=function(x){return x.set(W,et)},this.setSize=function(x,D,B=!0){if(tt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}W=x,et=D,e.width=Math.floor(x*V),e.height=Math.floor(D*V),B===!0&&(e.style.width=x+"px",e.style.height=D+"px"),this.setViewport(0,0,x,D)},this.getDrawingBufferSize=function(x){return x.set(W*V,et*V).floor()},this.setDrawingBufferSize=function(x,D,B){W=x,et=D,V=B,e.width=Math.floor(x*B),e.height=Math.floor(D*B),this.setViewport(0,0,x,D)},this.getCurrentViewport=function(x){return x.copy(C)},this.getViewport=function(x){return x.copy(St)},this.setViewport=function(x,D,B,z){x.isVector4?St.set(x.x,x.y,x.z,x.w):St.set(x,D,B,z),mt.viewport(C.copy(St).multiplyScalar(V).round())},this.getScissor=function(x){return x.copy(kt)},this.setScissor=function(x,D,B,z){x.isVector4?kt.set(x.x,x.y,x.z,x.w):kt.set(x,D,B,z),mt.scissor(F.copy(kt).multiplyScalar(V).round())},this.getScissorTest=function(){return jt},this.setScissorTest=function(x){mt.setScissorTest(jt=x)},this.setOpaqueSort=function(x){rt=x},this.setTransparentSort=function(x){ct=x},this.getClearColor=function(x){return x.copy(xt.getClearColor())},this.setClearColor=function(){xt.setClearColor(...arguments)},this.getClearAlpha=function(){return xt.getClearAlpha()},this.setClearAlpha=function(){xt.setClearAlpha(...arguments)},this.clear=function(x=!0,D=!0,B=!0){let z=0;if(x){let U=!1;if(N!==null){let j=N.texture.format;U=j===qr||j===Xr||j===Wr}if(U){let j=N.texture.type,ot=j===sn||j===Xn||j===ki||j===Hi||j===Hr||j===Gr,ft=xt.getClearColor(),ht=xt.getClearAlpha(),wt=ft.r,Ct=ft.g,bt=ft.b;ot?(_[0]=wt,_[1]=Ct,_[2]=bt,_[3]=ht,w.clearBufferuiv(w.COLOR,0,_)):(y[0]=wt,y[1]=Ct,y[2]=bt,y[3]=ht,w.clearBufferiv(w.COLOR,0,y))}else z|=w.COLOR_BUFFER_BIT}D&&(z|=w.DEPTH_BUFFER_BIT),B&&(z|=w.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),w.clear(z)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",it,!1),e.removeEventListener("webglcontextrestored",ut,!1),e.removeEventListener("webglcontextcreationerror",K,!1),xt.dispose(),G.dispose(),vt.dispose(),gt.dispose(),_e.dispose(),ue.dispose(),O.dispose(),at.dispose(),Nt.dispose(),X.dispose(),tt.dispose(),tt.removeEventListener("sessionstart",on),tt.removeEventListener("sessionend",ll),Jn.stop()};function it(x){x.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),R=!0}function ut(){console.log("THREE.WebGLRenderer: Context Restored."),R=!1;let x=se.autoReset,D=_t.enabled,B=_t.autoUpdate,z=_t.needsUpdate,U=_t.type;I(),se.autoReset=x,_t.enabled=D,_t.autoUpdate=B,_t.needsUpdate=z,_t.type=U}function K(x){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",x.statusMessage)}function Z(x){let D=x.target;D.removeEventListener("dispose",Z),pt(D)}function pt(x){Dt(x),gt.remove(x)}function Dt(x){let D=gt.get(x).programs;D!==void 0&&(D.forEach(function(B){X.releaseProgram(B)}),x.isShaderMaterial&&X.releaseShaderCache(x))}this.renderBufferDirect=function(x,D,B,z,U,j){D===null&&(D=Mt);let ot=U.isMesh&&U.matrixWorld.determinant()<0,ft=fh(x,D,B,z,U);mt.setMaterial(z,ot);let ht=B.index,wt=1;if(z.wireframe===!0){if(ht=g.getWireframeAttribute(B),ht===void 0)return;wt=2}let Ct=B.drawRange,bt=B.attributes.position,Vt=Ct.start*wt,Jt=(Ct.start+Ct.count)*wt;j!==null&&(Vt=Math.max(Vt,j.start*wt),Jt=Math.min(Jt,(j.start+j.count)*wt)),ht!==null?(Vt=Math.max(Vt,0),Jt=Math.min(Jt,ht.count)):bt!=null&&(Vt=Math.max(Vt,0),Jt=Math.min(Jt,bt.count));let ce=Jt-Vt;if(ce<0||ce===1/0)return;at.setup(U,z,ft,B,ht);let te,Kt=lt;if(ht!==null&&(te=b.get(ht),Kt=At,Kt.setIndex(te)),U.isMesh)z.wireframe===!0?(mt.setLineWidth(z.wireframeLinewidth*Me()),Kt.setMode(w.LINES)):Kt.setMode(w.TRIANGLES);else if(U.isLine){let Tt=z.linewidth;Tt===void 0&&(Tt=1),mt.setLineWidth(Tt*Me()),U.isLineSegments?Kt.setMode(w.LINES):U.isLineLoop?Kt.setMode(w.LINE_LOOP):Kt.setMode(w.LINE_STRIP)}else U.isPoints?Kt.setMode(w.POINTS):U.isSprite&&Kt.setMode(w.TRIANGLES);if(U.isBatchedMesh)if(U._multiDrawInstances!==null)Li("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Kt.renderMultiDrawInstances(U._multiDrawStarts,U._multiDrawCounts,U._multiDrawCount,U._multiDrawInstances);else if(Lt.get("WEBGL_multi_draw"))Kt.renderMultiDraw(U._multiDrawStarts,U._multiDrawCounts,U._multiDrawCount);else{let Tt=U._multiDrawStarts,re=U._multiDrawCounts,Wt=U._multiDrawCount,Ne=ht?b.get(ht).bytesPerElement:1,gi=gt.get(z).currentProgram.getUniforms();for(let Fe=0;Fe{function j(){if(z.forEach(function(ot){gt.get(ot).currentProgram.isReady()&&z.delete(ot)}),z.size===0){U(x);return}setTimeout(j,10)}Lt.get("KHR_parallel_shader_compile")!==null?j():setTimeout(j,10)})};let qt=null;function pn(x){qt&&qt(x)}function on(){Jn.stop()}function ll(){Jn.start()}let Jn=new jc;Jn.setAnimationLoop(pn),typeof self<"u"&&Jn.setContext(self),this.setAnimationLoop=function(x){qt=x,tt.setAnimationLoop(x),x===null?Jn.stop():Jn.start()},tt.addEventListener("sessionstart",on),tt.addEventListener("sessionend",ll),this.render=function(x,D){if(D!==void 0&&D.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(R===!0)return;if(x.matrixWorldAutoUpdate===!0&&x.updateMatrixWorld(),D.parent===null&&D.matrixWorldAutoUpdate===!0&&D.updateMatrixWorld(),tt.enabled===!0&&tt.isPresenting===!0&&(tt.cameraAutoUpdate===!0&&tt.updateCamera(D),D=tt.getCamera()),x.isScene===!0&&x.onBeforeRender(S,x,D,N),u=vt.get(x,E.length),u.init(D),E.push(u),$.multiplyMatrices(D.projectionMatrix,D.matrixWorldInverse),ne.setFromProjectionMatrix($,Qe,D.reversedDepth),Y=this.localClippingEnabled,Xt=nt.init(this.clippingPlanes,Y),m=G.get(x,T.length),m.init(),T.push(m),tt.enabled===!0&&tt.isPresenting===!0){let j=S.xr.getDepthSensingMesh();j!==null&&Da(j,D,-1/0,S.sortObjects)}Da(x,D,0,S.sortObjects),m.finish(),S.sortObjects===!0&&m.sort(rt,ct),Ht=tt.enabled===!1||tt.isPresenting===!1||tt.hasDepthSensing()===!1,Ht&&xt.addToRenderList(m,x),this.info.render.frame++,Xt===!0&&nt.beginShadows();let B=u.state.shadowsArray;_t.render(B,x,D),Xt===!0&&nt.endShadows(),this.info.autoReset===!0&&this.info.reset();let z=m.opaque,U=m.transmissive;if(u.setupLights(),D.isArrayCamera){let j=D.cameras;if(U.length>0)for(let ot=0,ft=j.length;ot0&&hl(z,U,x,D),Ht&&xt.render(x),cl(m,x,D);N!==null&&P===0&&(Ft.updateMultisampleRenderTarget(N),Ft.updateRenderTargetMipmap(N)),x.isScene===!0&&x.onAfterRender(S,x,D),at.resetDefaultState(),M=-1,v=null,E.pop(),E.length>0?(u=E[E.length-1],Xt===!0&&nt.setGlobalState(S.clippingPlanes,u.state.camera)):u=null,T.pop(),T.length>0?m=T[T.length-1]:m=null};function Da(x,D,B,z){if(x.visible===!1)return;if(x.layers.test(D.layers)){if(x.isGroup)B=x.renderOrder;else if(x.isLOD)x.autoUpdate===!0&&x.update(D);else if(x.isLight)u.pushLight(x),x.castShadow&&u.pushShadow(x);else if(x.isSprite){if(!x.frustumCulled||ne.intersectsSprite(x)){z&&It.setFromMatrixPosition(x.matrixWorld).applyMatrix4($);let ot=O.update(x),ft=x.material;ft.visible&&m.push(x,ot,ft,B,It.z,null)}}else if((x.isMesh||x.isLine||x.isPoints)&&(!x.frustumCulled||ne.intersectsObject(x))){let ot=O.update(x),ft=x.material;if(z&&(x.boundingSphere!==void 0?(x.boundingSphere===null&&x.computeBoundingSphere(),It.copy(x.boundingSphere.center)):(ot.boundingSphere===null&&ot.computeBoundingSphere(),It.copy(ot.boundingSphere.center)),It.applyMatrix4(x.matrixWorld).applyMatrix4($)),Array.isArray(ft)){let ht=ot.groups;for(let wt=0,Ct=ht.length;wt0&&Ns(U,D,B),j.length>0&&Ns(j,D,B),ot.length>0&&Ns(ot,D,B),mt.buffers.depth.setTest(!0),mt.buffers.depth.setMask(!0),mt.buffers.color.setMask(!0),mt.setPolygonOffset(!1)}function hl(x,D,B,z){if((B.isScene===!0?B.overrideMaterial:null)!==null)return;u.state.transmissionRenderTarget[z.id]===void 0&&(u.state.transmissionRenderTarget[z.id]=new cn(1,1,{generateMipmaps:!0,type:Lt.has("EXT_color_buffer_half_float")||Lt.has("EXT_color_buffer_float")?Vi:sn,minFilter:Wn,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Gt.workingColorSpace}));let j=u.state.transmissionRenderTarget[z.id],ot=z.viewport||C;j.setSize(ot.z*S.transmissionResolutionScale,ot.w*S.transmissionResolutionScale);let ft=S.getRenderTarget(),ht=S.getActiveCubeFace(),wt=S.getActiveMipmapLevel();S.setRenderTarget(j),S.getClearColor(H),q=S.getClearAlpha(),q<1&&S.setClearColor(16777215,.5),S.clear(),Ht&&xt.render(B);let Ct=S.toneMapping;S.toneMapping=wn;let bt=z.viewport;if(z.viewport!==void 0&&(z.viewport=void 0),u.setupLightsView(z),Xt===!0&&nt.setGlobalState(S.clippingPlanes,z),Ns(x,B,z),Ft.updateMultisampleRenderTarget(j),Ft.updateRenderTargetMipmap(j),Lt.has("WEBGL_multisampled_render_to_texture")===!1){let Vt=!1;for(let Jt=0,ce=D.length;Jt0),bt=!!B.morphAttributes.position,Vt=!!B.morphAttributes.normal,Jt=!!B.morphAttributes.color,ce=wn;z.toneMapped&&(N===null||N.isXRRenderTarget===!0)&&(ce=S.toneMapping);let te=B.morphAttributes.position||B.morphAttributes.normal||B.morphAttributes.color,Kt=te!==void 0?te.length:0,Tt=gt.get(z),re=u.state.lights;if(Xt===!0&&(Y===!0||x!==v)){let Ae=x===v&&z.id===M;nt.setState(z,x,Ae)}let Wt=!1;z.version===Tt.__version?(Tt.needsLights&&Tt.lightsStateVersion!==re.state.version||Tt.outputColorSpace!==ft||U.isBatchedMesh&&Tt.batching===!1||!U.isBatchedMesh&&Tt.batching===!0||U.isBatchedMesh&&Tt.batchingColor===!0&&U.colorTexture===null||U.isBatchedMesh&&Tt.batchingColor===!1&&U.colorTexture!==null||U.isInstancedMesh&&Tt.instancing===!1||!U.isInstancedMesh&&Tt.instancing===!0||U.isSkinnedMesh&&Tt.skinning===!1||!U.isSkinnedMesh&&Tt.skinning===!0||U.isInstancedMesh&&Tt.instancingColor===!0&&U.instanceColor===null||U.isInstancedMesh&&Tt.instancingColor===!1&&U.instanceColor!==null||U.isInstancedMesh&&Tt.instancingMorph===!0&&U.morphTexture===null||U.isInstancedMesh&&Tt.instancingMorph===!1&&U.morphTexture!==null||Tt.envMap!==ht||z.fog===!0&&Tt.fog!==j||Tt.numClippingPlanes!==void 0&&(Tt.numClippingPlanes!==nt.numPlanes||Tt.numIntersection!==nt.numIntersection)||Tt.vertexAlphas!==wt||Tt.vertexTangents!==Ct||Tt.morphTargets!==bt||Tt.morphNormals!==Vt||Tt.morphColors!==Jt||Tt.toneMapping!==ce||Tt.morphTargetsCount!==Kt)&&(Wt=!0):(Wt=!0,Tt.__version=z.version);let Ne=Tt.currentProgram;Wt===!0&&(Ne=Fs(z,D,U));let gi=!1,Fe=!1,Ki=!1,ae=Ne.getUniforms(),Ge=Tt.uniforms;if(mt.useProgram(Ne.program)&&(gi=!0,Fe=!0,Ki=!0),z.id!==M&&(M=z.id,Fe=!0),gi||v!==x){mt.buffers.depth.getReversed()&&x.reversedDepth!==!0&&(x._reversedDepth=!0,x.updateProjectionMatrix()),ae.setValue(w,"projectionMatrix",x.projectionMatrix),ae.setValue(w,"viewMatrix",x.matrixWorldInverse);let Le=ae.map.cameraPosition;Le!==void 0&&Le.setValue(w,dt.setFromMatrixPosition(x.matrixWorld)),Rt.logarithmicDepthBuffer&&ae.setValue(w,"logDepthBufFC",2/(Math.log(x.far+1)/Math.LN2)),(z.isMeshPhongMaterial||z.isMeshToonMaterial||z.isMeshLambertMaterial||z.isMeshBasicMaterial||z.isMeshStandardMaterial||z.isShaderMaterial)&&ae.setValue(w,"isOrthographic",x.isOrthographicCamera===!0),v!==x&&(v=x,Fe=!0,Ki=!0)}if(U.isSkinnedMesh){ae.setOptional(w,U,"bindMatrix"),ae.setOptional(w,U,"bindMatrixInverse");let Ae=U.skeleton;Ae&&(Ae.boneTexture===null&&Ae.computeBoneTexture(),ae.setValue(w,"boneTexture",Ae.boneTexture,Ft))}U.isBatchedMesh&&(ae.setOptional(w,U,"batchingTexture"),ae.setValue(w,"batchingTexture",U._matricesTexture,Ft),ae.setOptional(w,U,"batchingIdTexture"),ae.setValue(w,"batchingIdTexture",U._indirectTexture,Ft),ae.setOptional(w,U,"batchingColorTexture"),U._colorsTexture!==null&&ae.setValue(w,"batchingColorTexture",U._colorsTexture,Ft));let We=B.morphAttributes;if((We.position!==void 0||We.normal!==void 0||We.color!==void 0)&&Q.update(U,B,Ne),(Fe||Tt.receiveShadow!==U.receiveShadow)&&(Tt.receiveShadow=U.receiveShadow,ae.setValue(w,"receiveShadow",U.receiveShadow)),z.isMeshGouraudMaterial&&z.envMap!==null&&(Ge.envMap.value=ht,Ge.flipEnvMap.value=ht.isCubeTexture&&ht.isRenderTargetTexture===!1?-1:1),z.isMeshStandardMaterial&&z.envMap===null&&D.environment!==null&&(Ge.envMapIntensity.value=D.environmentIntensity),Fe&&(ae.setValue(w,"toneMappingExposure",S.toneMappingExposure),Tt.needsLights&&ph(Ge,Ki),j&&z.fog===!0&&J.refreshFogUniforms(Ge,j),J.refreshMaterialUniforms(Ge,z,V,et,u.state.transmissionRenderTarget[x.id]),Yi.upload(w,dl(Tt),Ge,Ft)),z.isShaderMaterial&&z.uniformsNeedUpdate===!0&&(Yi.upload(w,dl(Tt),Ge,Ft),z.uniformsNeedUpdate=!1),z.isSpriteMaterial&&ae.setValue(w,"center",U.center),ae.setValue(w,"modelViewMatrix",U.modelViewMatrix),ae.setValue(w,"normalMatrix",U.normalMatrix),ae.setValue(w,"modelMatrix",U.matrixWorld),z.isShaderMaterial||z.isRawShaderMaterial){let Ae=z.uniformsGroups;for(let Le=0,La=Ae.length;Le0&&Ft.useMultisampledRTT(x)===!1?U=gt.get(x).__webglMultisampledFramebuffer:Array.isArray(Ct)?U=Ct[B]:U=Ct,C.copy(x.viewport),F.copy(x.scissor),k=x.scissorTest}else C.copy(St).multiplyScalar(V).floor(),F.copy(kt).multiplyScalar(V).floor(),k=jt;if(B!==0&&(U=gh),mt.bindFramebuffer(w.FRAMEBUFFER,U)&&z&&mt.drawBuffers(x,U),mt.viewport(C),mt.scissor(F),mt.setScissorTest(k),j){let ht=gt.get(x.texture);w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_CUBE_MAP_POSITIVE_X+D,ht.__webglTexture,B)}else if(ot){let ht=D;for(let wt=0;wt=0&&D<=x.width-z&&B>=0&&B<=x.height-U&&(x.textures.length>1&&w.readBuffer(w.COLOR_ATTACHMENT0+ft),w.readPixels(D,B,z,U,yt.convert(Ct),yt.convert(bt),j))}finally{let wt=N!==null?gt.get(N).__webglFramebuffer:null;mt.bindFramebuffer(w.FRAMEBUFFER,wt)}}},this.readRenderTargetPixelsAsync=async function(x,D,B,z,U,j,ot,ft=0){if(!(x&&x.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let ht=gt.get(x).__webglFramebuffer;if(x.isWebGLCubeRenderTarget&&ot!==void 0&&(ht=ht[ot]),ht)if(D>=0&&D<=x.width-z&&B>=0&&B<=x.height-U){mt.bindFramebuffer(w.FRAMEBUFFER,ht);let wt=x.textures[ft],Ct=wt.format,bt=wt.type;if(!Rt.textureFormatReadable(Ct))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Rt.textureTypeReadable(bt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");let Vt=w.createBuffer();w.bindBuffer(w.PIXEL_PACK_BUFFER,Vt),w.bufferData(w.PIXEL_PACK_BUFFER,j.byteLength,w.STREAM_READ),x.textures.length>1&&w.readBuffer(w.COLOR_ATTACHMENT0+ft),w.readPixels(D,B,z,U,yt.convert(Ct),yt.convert(bt),0);let Jt=N!==null?gt.get(N).__webglFramebuffer:null;mt.bindFramebuffer(w.FRAMEBUFFER,Jt);let ce=w.fenceSync(w.SYNC_GPU_COMMANDS_COMPLETE,0);return w.flush(),await Tc(w,ce,4),w.bindBuffer(w.PIXEL_PACK_BUFFER,Vt),w.getBufferSubData(w.PIXEL_PACK_BUFFER,0,j),w.deleteBuffer(Vt),w.deleteSync(ce),j}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(x,D=null,B=0){let z=Math.pow(2,-B),U=Math.floor(x.image.width*z),j=Math.floor(x.image.height*z),ot=D!==null?D.x:0,ft=D!==null?D.y:0;Ft.setTexture2D(x,0),w.copyTexSubImage2D(w.TEXTURE_2D,B,0,0,ot,ft,U,j),mt.unbindTexture()};let _h=w.createFramebuffer(),xh=w.createFramebuffer();this.copyTextureToTexture=function(x,D,B=null,z=null,U=0,j=null){j===null&&(U!==0?(Li("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),j=U,U=0):j=0);let ot,ft,ht,wt,Ct,bt,Vt,Jt,ce,te=x.isCompressedTexture?x.mipmaps[j]:x.image;if(B!==null)ot=B.max.x-B.min.x,ft=B.max.y-B.min.y,ht=B.isBox3?B.max.z-B.min.z:1,wt=B.min.x,Ct=B.min.y,bt=B.isBox3?B.min.z:0;else{let We=Math.pow(2,-U);ot=Math.floor(te.width*We),ft=Math.floor(te.height*We),x.isDataArrayTexture?ht=te.depth:x.isData3DTexture?ht=Math.floor(te.depth*We):ht=1,wt=0,Ct=0,bt=0}z!==null?(Vt=z.x,Jt=z.y,ce=z.z):(Vt=0,Jt=0,ce=0);let Kt=yt.convert(D.format),Tt=yt.convert(D.type),re;D.isData3DTexture?(Ft.setTexture3D(D,0),re=w.TEXTURE_3D):D.isDataArrayTexture||D.isCompressedArrayTexture?(Ft.setTexture2DArray(D,0),re=w.TEXTURE_2D_ARRAY):(Ft.setTexture2D(D,0),re=w.TEXTURE_2D),w.pixelStorei(w.UNPACK_FLIP_Y_WEBGL,D.flipY),w.pixelStorei(w.UNPACK_PREMULTIPLY_ALPHA_WEBGL,D.premultiplyAlpha),w.pixelStorei(w.UNPACK_ALIGNMENT,D.unpackAlignment);let Wt=w.getParameter(w.UNPACK_ROW_LENGTH),Ne=w.getParameter(w.UNPACK_IMAGE_HEIGHT),gi=w.getParameter(w.UNPACK_SKIP_PIXELS),Fe=w.getParameter(w.UNPACK_SKIP_ROWS),Ki=w.getParameter(w.UNPACK_SKIP_IMAGES);w.pixelStorei(w.UNPACK_ROW_LENGTH,te.width),w.pixelStorei(w.UNPACK_IMAGE_HEIGHT,te.height),w.pixelStorei(w.UNPACK_SKIP_PIXELS,wt),w.pixelStorei(w.UNPACK_SKIP_ROWS,Ct),w.pixelStorei(w.UNPACK_SKIP_IMAGES,bt);let ae=x.isDataArrayTexture||x.isData3DTexture,Ge=D.isDataArrayTexture||D.isData3DTexture;if(x.isDepthTexture){let We=gt.get(x),Ae=gt.get(D),Le=gt.get(We.__renderTarget),La=gt.get(Ae.__renderTarget);mt.bindFramebuffer(w.READ_FRAMEBUFFER,Le.__webglFramebuffer),mt.bindFramebuffer(w.DRAW_FRAMEBUFFER,La.__webglFramebuffer);for(let $n=0;$nMath.PI&&(n-=Ue),s<-Math.PI?s+=Ue:s>Math.PI&&(s-=Ue),n<=s?this._spherical.theta=Math.max(n,Math.min(s,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+s)/2?Math.max(n,this._spherical.theta):Math.min(s,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{let a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=a!=this._spherical.radius}if(me.setFromSpherical(this._spherical),me.applyQuaternion(this._quatInverse),e.copy(this.target).add(me),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){let o=me.length();a=this._clampDistance(o*this._scale);let c=o-a;this.object.position.addScaledVector(this._dollyDirection,c),this.object.updateMatrixWorld(),r=!!c}else if(this.object.isOrthographicCamera){let o=new L(this._mouse.x,this._mouse.y,0);o.unproject(this.object);let c=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=c!==this.object.zoom;let l=new L(this._mouse.x,this._mouse.y,0);l.unproject(this.object),this.object.position.sub(l).add(o),this.object.updateMatrixWorld(),a=me.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(Aa.origin.copy(this.object.position),Aa.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Aa.direction))jo||8*(1-this._lastQuaternion.dot(this.object.quaternion))>jo||this._lastTargetPosition.distanceToSquared(this.target)>jo?(this.dispatchEvent(ih),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?Ue/60*this.autoRotateSpeed*t:Ue/60/60*this.autoRotateSpeed}_getZoomScale(t){let e=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){me.setFromMatrixColumn(e,0),me.multiplyScalar(-t),this._panOffset.add(me)}_panUp(t,e){this.screenSpacePanning===!0?me.setFromMatrixColumn(e,1):(me.setFromMatrixColumn(e,0),me.crossVectors(this.object.up,me)),me.multiplyScalar(t),this._panOffset.add(me)}_pan(t,e){let n=this.domElement;if(this.object.isPerspectiveCamera){let s=this.object.position;me.copy(s).sub(this.target);let r=me.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*r/n.clientHeight,this.object.matrix),this._panUp(2*e*r/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;let n=this.domElement.getBoundingClientRect(),s=t-n.left,r=e-n.top,a=n.width,o=n.height;this._mouse.x=s/a*2-1,this._mouse.y=-(r/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let e=this.domElement;this._rotateLeft(Ue*this._rotateDelta.x/e.clientHeight),this._rotateUp(Ue*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(Ue*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-Ue*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(Ue*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-Ue*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{let e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._rotateStart.set(n,s)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{let e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panStart.set(n,s)}}_handleTouchStartDolly(t){let e=this._getSecondPointerPosition(t),n=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(n*n+s*s);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{let n=this._getSecondPointerPosition(t),s=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._rotateEnd.set(s,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let e=this.domElement;this._rotateLeft(Ue*this._rotateDelta.x/e.clientHeight),this._rotateUp(Ue*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{let e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),s=.5*(t.pageY+e.y);this._panEnd.set(n,s)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){let e=this._getSecondPointerPosition(t),n=t.pageX-e.x,s=t.pageY-e.y,r=Math.sqrt(n*n+s*s);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);let a=(t.pageX+e.x)*.5,o=(t.pageY+e.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;edocument.getElementById(i),ah=64*1024*1024,Zt=(i,t)=>{if(!i)throw new Error(t)},ye,ge,Ca,Rn,qn,Yn,mi,He,rn,Ji,Ia=[],al=[],an=!1,ol=0,$i=100,el=!1,ng=0,nl=new L,oh=new L,hh=2;function ig(i){return Zt(typeof i=="string"&&/^[a-zA-Z0-9_.-]+(?:\/[a-zA-Z0-9_.-]+)*$/.test(i)&&!i.split("/").some(t=>t==="."||t===".."),"Invalid local asset path."),i}async function il(i,t){Zt(i,"Missing response body.");let e=i.getReader(),n=[],s=0;try{for(;;){let{done:o,value:c}=await e.read();if(o)break;if(s+=c.byteLength,s>t)throw await e.cancel(),new Error("Asset exceeds byte limit.");n.push(c)}}finally{e.releaseLock()}let r=new Uint8Array(s),a=0;for(let o of n)r.set(o,a),a+=o.length;return r.buffer}async function uh(i){let t=new URL(ig(i),location.href);Zt(t.origin===location.origin,"Unexpected asset origin.");let e=location.protocol==="https:"&&location.host==="dvidia-robot-simulation-lab.static.hf.space",n=await fetch(t,{credentials:"omit",referrerPolicy:"no-referrer",redirect:e?"follow":"error"}),s=new URL(n.url);return Zt(!s.username&&!s.password&&(s.origin===location.origin||e&&s.protocol==="https:"&&s.host==="us.aws.cdn.hf.co"),"Unexpected asset redirect."),Zt(n.ok,"Could not load "+i+" (HTTP "+n.status+")."),n}async function sg(i){return JSON.parse(new TextDecoder().decode(await il((await uh(i)).body,4*1024*1024)))}async function lh(i,t){Zt(i.href===t&&i.compression==="gzip"&&Number.isInteger(i.bytes)&&i.bytes>=0&&i.bytes<=ah&&Number.isInteger(i.compressed_bytes)&&i.compressed_bytes>=0&&i.compressed_bytes<=ah,"Invalid binary layout."),Zt(typeof DecompressionStream=="function","This browser needs DecompressionStream support.");let e=await il((await uh(t)).body,i.compressed_bytes);Zt(e.byteLength===i.compressed_bytes,"Compressed asset length mismatch.");let n=await il(new Blob([e]).stream().pipeThrough(new DecompressionStream("gzip")),i.bytes);if(Zt(n.byteLength===i.bytes,"Decoded asset length mismatch."),globalThis.crypto?.subtle){let s=[...new Uint8Array(await crypto.subtle.digest("SHA-256",n))].map(r=>r.toString(16).padStart(2,"0")).join("");Zt(s===i.sha256,"Decoded asset digest mismatch.")}return n}function rg(i,t){Zt(Array.isArray(i)&&i.length===t&&i.every(Number.isFinite),"Invalid native vector.")}function ag(i,t){Zt(ye.schema==="dvidia.asset-preview-model/v1"&&ge.schema==="dvidia.asset-preview-motion/v1"&&Rn.schema==="dvidia.asset-scene/v1"&&Ca.schema==="dvidia.asset-catalog/v1","Unsupported asset preview."),Zt(Number.isInteger(ge.body_count)&&ge.body_count>0&&ge.body_count<=128&&ye.bodies.length===ge.body_count&&ge.frame_count===101&&ge.frame_stride_floats===ge.body_count*7&&t.byteLength===101*ge.body_count*28,"Invalid body pose layout."),ye.bodies.forEach((r,a)=>Zt(r.id===a&&typeof r.name=="string","Invalid native body identity.")),Zt(Array.isArray(ye.meshes)&&ye.meshes.length<=128&&Array.isArray(ye.geoms)&&ye.geoms.length<=512,"Invalid native geometry inventory.");let e=new Set,n=new DataView(i);for(let r of ye.meshes){Zt(Number.isInteger(r.id)&&!e.has(r.id),"Invalid mesh identity."),e.add(r.id);let{vertex_count:a,index_count:o,position_byte_offset:c,index_byte_offset:l}=r;Zt([a,o,c,l].every(Number.isInteger)&&a>0&&o>=0&&o%3===0&&c>=0&&l>=0&&c%4===0&&l%4===0&&c+a*12<=i.byteLength&&l+o*4<=i.byteLength,"Invalid native mesh range.");for(let h=0;h=0&&r.body_ids.getFloat32(r+c*4,!0));Zt(a.every(Number.isFinite)&&Math.abs(Math.hypot(...a.slice(3))-1)<.001,"Invalid native body pose.")}Zt(Array.isArray(ge.rows)&&ge.rows.length===101,"Invalid recorded frames."),ge.rows.forEach((r,a)=>Zt(Number.isFinite(r.t_seconds)&&Math.abs(r.t_seconds-a*.02)<1e-8&&Number.isInteger(r.contact_count)&&r.contact_count>=0,"Invalid frame timestamp."))}function ch(i,t){t.set(i[1],i[2],i[3],i[0])}function og(i,t){switch(i.type){case"mesh":return t.get(i.mesh_id);case"box":return new Bn(...i.size.map(e=>e*2));case"sphere":return new Oi(i.size[0],24,16);case"ellipsoid":{let e=new Oi(1,32,20);return e.scale(...i.size),e}case"capsule":{let e=new vs(i.size[0],2*i.size[1],6,20);return e.rotateX(Math.PI/2),e}case"cylinder":{let e=new Ms(i.size[0],i.size[0],i.size[1]*2,28);return e.rotateX(Math.PI/2),e}case"plane":return new ai(Math.max(4,i.size[0]*2),Math.max(4,i.size[1]*2))}}function Zn(){!el&&Yn&&(el=!0,requestAnimationFrame(lg))}function Pa(i){Zt(Number.isInteger(i)&&i>=0&&i{let s=(i*Ji.length+n)*28;e.position.set(qn.getFloat32(s,!0),qn.getFloat32(s+4,!0),qn.getFloat32(s+8,!0)),e.quaternion.set(qn.getFloat32(s+16,!0),qn.getFloat32(s+20,!0),qn.getFloat32(s+24,!0),qn.getFloat32(s+12,!0))}),Et("clock").textContent=t.t_seconds.toFixed(2)+" / 2.00 s",Et("contacts").textContent=String(t.contact_count),Et("status").textContent="Recorded frame "+(i+1)+"/101 · Native physics step 2 ms · "+Ji.length+" body poses · Browser physics: none.",Zn()}function lg(i){if(el=!1,an){let t=Math.min(ge.frame_count-1,Math.max($i,0,Math.floor((i-ol)/20)));t!==$i&&Pa(t),t===ge.frame_count-1&&(an=!1,Et("play").textContent="Play settling",Et("play").setAttribute("aria-pressed","false"))}Yn.render(mi,He),Et("canvas").dataset.renderCount=String(++ng),an&&Zn()}function sl(i){let t=Math.max(1,1/He.aspect),e=hh*t,n={home:[1.35,-1.75,1.15],top:[0,0,2.3],front:[0,-2.3,.3]};He.position.copy(nl).add(new L(...n[i]).multiplyScalar(e)),rn.target.copy(nl),rn.update(),Zn()}function cg(i){Zt(Et("canvas").getContext("webgl2"),"WebGL2 is unavailable."),Yn=new Ta({canvas:Et("canvas"),antialias:!0,alpha:!0,powerPreference:"low-power"}),Yn.setPixelRatio(Math.min(devicePixelRatio||1,2)),Yn.outputColorSpace=Ce,Yn.toneMapping=Or,Yn.toneMappingExposure=1.25,mi=new gs,He=new Ee(38,1,.005,30),He.up.set(0,0,1),rn=new Ra(He,Et("canvas")),rn.minDistance=.2,rn.maxDistance=10,rn.addEventListener("change",Zn),mi.add(new Es(16120831,12634548,2.6));let t=new zi(16777215,3);t.position.set(2,-2,4),mi.add(t);let e=new zi(14543359,.9);e.position.set(-2,2,2),mi.add(e);let n=new ws(4,40,11057053,13752777);n.rotation.x=Math.PI/2,n.position.z=5e-4,n.material.transparent=!0,n.material.opacity=.35,mi.add(n),Ji=ye.bodies.map(()=>{let o=new vn;return mi.add(o),o});let s=new Map,r=new DataView(i);for(let o of ye.meshes){let c=new Float32Array(o.vertex_count*3),l=new Uint32Array(o.index_count);for(let d=0;d0&&o.group<=2){let h=new Pe(c,new Bi({color:new Ot().setRGB(...l.slice(0,3),bn),metalness:o.type==="mesh"?.16:0,roughness:.6,transparent:l[3]<1,opacity:l[3],side:Ve}));h.position.fromArray(o.position),ch(o.quaternion_wxyz,h.quaternion),h.userData.body=o.body_id,h.userData.plane=o.type==="plane",Ji[o.body_id].add(h),Ia.push(h)}if(o.collision){let h=new Pe(c,new Bi({color:11891781,transparent:!0,opacity:.52,roughness:.8,depthWrite:!1,side:Ve}));h.position.fromArray(o.position),ch(o.quaternion_wxyz,h.quaternion),h.visible=!1,h.userData.body=o.body_id,Ji[o.body_id].add(h),al.push(h)}}Pa(100);let a=new hn;for(let o of Ia)o.userData.plane||(o.updateWorldMatrix(!0,!1),a.expandByObject(o));a.getCenter(nl),a.getSize(oh),hh=Math.max(.55,oh.length()*.59),new ResizeObserver(()=>{let o=Et("stage").getBoundingClientRect(),c=He.aspect;He.aspect=o.width/o.height,He.position.sub(rn.target).multiplyScalar(Math.max(1,1/He.aspect)/Math.max(1,1/c)).add(rn.target),He.updateProjectionMatrix(),Yn.setSize(o.width,o.height,!1),Zn()}).observe(Et("stage")),sl("home"),Et("canvas").addEventListener("webglcontextlost",o=>{o.preventDefault(),dh(new Error("WebGL context was lost. Reload to reopen the preview."))})}function rl(){let i=Et("pair").value,t=i==="all"?Rn.shoe_ids:Rn.shoe_ids.filter(r=>r===i+"-left"||r===i+"-right"),e=new Set(t.map(r=>"shoe_"+r.replaceAll("-","_"))),n=Et("collision").getAttribute("aria-pressed")==="true";for(let r of Ia)r.visible=!n&&(!ye.bodies[r.userData.body].name.startsWith("shoe_")||e.has(ye.bodies[r.userData.body].name));for(let r of al)r.visible=n&&(!ye.bodies[r.userData.body].name.startsWith("shoe_")||e.has(ye.bodies[r.userData.body].name));let s=Ca.shoes.find(r=>t.includes(r.id));Et("family").textContent=i==="all"?t.length+" instances":s.family.replaceAll("-"," "),Et("dimensions").textContent=i==="all"?"Varies by family":s.properties.dimensions_m.value.map(r=>r.toFixed(3)).join(" × "),Et("mass").textContent=i==="all"?"Varies by family":String(s.properties.mass_kg.value),Et("descriptor").href=i==="all"?"scene.json":"scenes/"+i+".json",Et("descriptor").download=Rn.robot+"-"+i+".scene.json",Et("command").textContent="dvidia-assets scene --robot "+Rn.robot+" --assets ./robot-assets --pair "+i+` --output ./shoe-scene +python -m http.server 8000 --directory ./shoe-scene`,Et("stage").dataset.selectedShoes=String(t.length),Zn()}function tl(){an=!an,Et("play").textContent=an?"Pause settling":"Play settling",Et("play").setAttribute("aria-pressed",String(an)),an&&($i===100&&Pa(0),ol=performance.now()-$i*20,Zn())}function hg(){document.querySelectorAll("[data-camera]").forEach(i=>i.addEventListener("click",()=>sl(i.dataset.camera))),Et("pair").addEventListener("change",rl),Et("play").addEventListener("click",tl),Et("timeline").addEventListener("input",()=>{Pa(Number(Et("timeline").value)),an&&(ol=performance.now()-$i*20)}),Et("collision").addEventListener("click",()=>{let i=Et("collision").getAttribute("aria-pressed")!=="true";Et("collision").setAttribute("aria-pressed",String(i)),Et("mode-label").textContent=i?"Native collision shapes":"Visual geometry",rl()}),Et("copy").addEventListener("click",async()=>{try{Zt(navigator.clipboard,"Clipboard unavailable; select the command text instead."),await navigator.clipboard.writeText(Et("command").textContent),Et("copy").textContent="Copied"}catch{let i=document.createRange();i.selectNodeContents(Et("command"));let t=window.getSelection();t.removeAllRanges(),t.addRange(i),Et("copy").textContent="Command selected"}}),Et("canvas").addEventListener("keydown",i=>{let t=i.key;if(["h","H","Home"].includes(t)){i.preventDefault(),sl("home");return}if(t===" "){i.preventDefault(),tl();return}if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","+","=","-","_"].includes(t))return;i.preventDefault();let e=He.position.clone().sub(rn.target),n=new Vn().setFromVector3(e.applyAxisAngle(new L(1,0,0),-Math.PI/2));t==="ArrowLeft"&&(n.theta-=.1),t==="ArrowRight"&&(n.theta+=.1),t==="ArrowUp"&&(n.phi=Math.max(.01,n.phi-.1)),t==="ArrowDown"&&(n.phi=Math.min(Math.PI-.01,n.phi+.1)),["+","="].includes(t)&&(n.radius=Math.max(.2,n.radius*.9)),["-","_"].includes(t)&&(n.radius=Math.min(10,n.radius/.9)),e.setFromSpherical(n).applyAxisAngle(new L(1,0,0),Math.PI/2),He.position.copy(rn.target).add(e),rn.update(),Zn()}),document.addEventListener("visibilitychange",()=>{document.hidden&&an&&tl()})}function dh(i){an=!1,Et("loading").hidden=!1,Et("loading").textContent="The 3D preview could not open. "+i.message+" Serve all exported files together over HTTP. The scene descriptor and catalog remain downloadable.",Et("stage").dataset.ready="error",document.querySelectorAll("button,select,input").forEach(t=>t.disabled=!0)}async function ug(){Zt(location.protocol!=="file:","Start a local HTTP server to open the exported files."),[ye,ge,Ca,Rn]=await Promise.all(["model.json","motion.json","catalog.json","scene.json"].map(sg));let[i,t]=await Promise.all([lh(ye.geometry_binary,"geometry.bin.gz"),lh(ge.motion_binary,"motion.bin.gz")]);ag(i,t),qn=new DataView(t),cg(i);let e=Ca.robots.find(s=>s.id===Rn.robot);Zt(e,"Robot missing from catalog."),Et("robot-name").textContent=e.name,Et("axes").textContent=e.arm_axes+" arm axes + "+e.gripper_command_axes+" gripper command",Et("subtitle").textContent=e.name+" · Pinned native geometry, synthetic shoe assets and a portable scene descriptor.";for(let s of[...Et("pair").options])s.value!=="all"&&!Rn.shoe_ids.some(r=>r===s.value+"-left"||r===s.value+"-right")&&s.remove();Rn.shoe_ids.length!==6&&(Et("pair").options[0].textContent="All loaded shoes");let n=new URLSearchParams(location.search).get("pair");[...Et("pair").options].some(s=>s.value===n)&&(Et("pair").value=n),hg(),rl(),document.querySelectorAll("button,select,input").forEach(s=>s.disabled=!1),Et("loading").hidden=!0,Et("stage").dataset.ready="true",Et("stage").dataset.visualGeoms=String(Ia.length),Et("stage").dataset.collisionGeoms=String(al.length),/\/previews\/(ur5e|piper|so101)\/(?:index\.html)?$/.test(location.pathname)&&(Et("robot-links").hidden=!1)}ug().catch(dh);})(); diff --git a/asset-library/v01/previews/ur5e/catalog.json b/asset-library/v01/previews/ur5e/catalog.json new file mode 100644 index 0000000000000000000000000000000000000000..f3ea25306b566c6f084f7acef8f46e36d6e4506f --- /dev/null +++ b/asset-library/v01/previews/ur5e/catalog.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-catalog/v1","version":"0.1.0","license":"MIT","license_scope":"Original DVIDIA catalog and procedural shoes only; robot simulation assets retain their individual licenses.","scope":"Reusable native scene assets with synthetic rigid shoes. Scene loading and gravity/contact checks do not demonstrate shoe manipulation, learning or physical robot transfer.","units":{"length":"m","mass":"kg","time":"s","angle":"rad","quaternion":"wxyz"},"world_frame":"right-handed; robot base reference at world origin, +z up","robots":[{"id":"ur5e","name":"UR5e + Robotiq 2F-85","version":"0.1.0","immutable_id":"dvidia/robots/ur5e-2f85@0.1.0","arm_axes":6,"gripper_command_axes":1,"gripper_mechanical_joints":8,"native_command_units":["rad","rad","rad","rad","rad","rad","native_0_255"],"gripper_command":"Native coupled gripper servo input [0,255]; not a measured gap or calibrated force.","licenses":{"universal_robots_ur5e":"BSD-3-Clause","robotiq_2f85":"BSD-2-Clause"},"source":{"repository":"https://github.com/google-deepmind/mujoco_menagerie","commit":"0059d4335f8156206f63a35662313385f7ad6d74","verification":"Packaged SHA256 allowlist; assets are read from verified bytes, without network access.","model_urls":["https://github.com/google-deepmind/mujoco_menagerie/tree/0059d4335f8156206f63a35662313385f7ad6d74/universal_robots_ur5e","https://github.com/google-deepmind/mujoco_menagerie/tree/0059d4335f8156206f63a35662313385f7ad6d74/robotiq_2f85"],"home_scope":"Authored scene initialization: UR5e and PiPER use the upstream home arm pose, zero gripper coordinates; SO101 uses its zero reference pose."},"home_joint_positions":{"shoulder_pan_joint":-1.5708,"shoulder_lift_joint":-1.5708,"elbow_joint":1.5708,"wrist_1_joint":-1.5708,"wrist_2_joint":-1.5708,"wrist_3_joint":0},"expected_dimensions":{"nq":14,"nv":14,"nu":7,"neq":3},"compatibility":{"scene_loading":true,"shoe_grasp_qualified":false,"physical_robot_ready":false,"scope":"Pinned native arm and gripper can share a rigid-shoe scene. This does not establish reachability, graspability, a shoe manipulation skill, or hardware compatibility."},"openness_scope":"These licenses cover pinned simulation assets; SDK and physical hardware design licenses are separate."},{"id":"piper","name":"AgileX PiPER","version":"0.1.0","immutable_id":"dvidia/robots/piper@0.1.0","arm_axes":6,"gripper_command_axes":1,"gripper_mechanical_joints":2,"native_command_units":["rad","rad","rad","rad","rad","rad","m"],"gripper_command":"single-finger slide target in metres, native range [0,0.035]; not total jaw gap","licenses":{"agilex_piper":"MIT"},"source":{"repository":"https://github.com/google-deepmind/mujoco_menagerie","commit":"0059d4335f8156206f63a35662313385f7ad6d74","verification":"Packaged SHA256 allowlist; assets are read from verified bytes, without network access.","model_urls":["https://github.com/google-deepmind/mujoco_menagerie/tree/0059d4335f8156206f63a35662313385f7ad6d74/agilex_piper"],"home_scope":"Authored scene initialization: UR5e and PiPER use the upstream home arm pose, zero gripper coordinates; SO101 uses its zero reference pose."},"home_joint_positions":{"joint1":0,"joint2":1.57,"joint3":-1.3485,"joint4":0,"joint5":0,"joint6":0,"joint7":0,"joint8":0},"expected_dimensions":{"nq":8,"nv":8,"nu":7,"neq":1},"compatibility":{"scene_loading":true,"shoe_grasp_qualified":false,"physical_robot_ready":false,"scope":"Pinned native arm and gripper can share a rigid-shoe scene. This does not establish reachability, graspability, a shoe manipulation skill, or hardware compatibility."},"openness_scope":"These licenses cover pinned simulation assets; SDK and physical hardware design licenses are separate."},{"id":"so101","name":"The Robot Studio SO101","version":"0.1.0","immutable_id":"dvidia/robots/so101@0.1.0","arm_axes":5,"gripper_command_axes":1,"gripper_mechanical_joints":1,"native_command_units":["rad","rad","rad","rad","rad","rad"],"gripper_command":"moving-jaw hinge angle target in radians; not linear jaw gap","licenses":{"robotstudio_so101":"Apache-2.0"},"source":{"repository":"https://github.com/google-deepmind/mujoco_menagerie","commit":"0059d4335f8156206f63a35662313385f7ad6d74","verification":"Packaged SHA256 allowlist; assets are read from verified bytes, without network access.","model_urls":["https://github.com/google-deepmind/mujoco_menagerie/tree/0059d4335f8156206f63a35662313385f7ad6d74/robotstudio_so101"],"home_scope":"Authored scene initialization: UR5e and PiPER use the upstream home arm pose, zero gripper coordinates; SO101 uses its zero reference pose."},"home_joint_positions":{"shoulder_pan":0,"shoulder_lift":0,"elbow_flex":0,"wrist_flex":0,"wrist_roll":0,"gripper":0},"expected_dimensions":{"nq":6,"nv":6,"nu":6,"neq":0},"compatibility":{"scene_loading":true,"shoe_grasp_qualified":false,"physical_robot_ready":false,"scope":"Pinned native arm and gripper can share a rigid-shoe scene. This does not establish reachability, graspability, a shoe manipulation skill, or hardware compatibility."},"openness_scope":"These licenses cover pinned simulation assets; SDK and physical hardware design licenses are separate."}],"shoes":[{"id":"trainer-left","name":"Trainer / left","version":"0.1.0","immutable_id":"dvidia/shoes/trainer-left@0.1.0","family":"trainer","pair_id":"dvidia/shoes/trainer-pair@0.1.0","side":"left","license":"MIT","source":{"kind":"original_procedural","author":"DVIDIA","scope":"New primitive geometry; no redistributed scans, videos, photographs or model weights."},"properties":{"dimensions_m":{"value":[0.28,0.1,0.087],"units":"m; length x, width y, maximum height z","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_kg":{"value":0.3,"units":"kg","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"sliding_friction":{"value":0.8,"units":"dimensionless","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"torsional_friction":{"value":0.005,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"rolling_friction":{"value":0.0001,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_distribution":{"value":"Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.","units":"model assumption","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"deformation":{"value":"Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.","units":"model class","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"contact_solver":{"value":{"condim":4,"priority":1,"solref":[0.02,1],"solimp":[0.9,0.95,0.001,0.5,2]},"units":"MuJoCo solver parameters; no calibrated stiffness or damping","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."}},"frame":{"origin":"sole bottom center","axes":"right-handed; +x toward toe, +y lateral, +z up","sole_bottom_z_m":0,"initial_bottom_z_m":0.08},"geometry":[{"name":"sole","type":"box","size_m":[0.14,0.05,0.01],"position_m":[0,0,0.01],"mass_fraction":0.35,"rgba":[0.16,0.17,0.18,1]},{"name":"upper","type":"ellipsoid","size_m":[0.122,0.047,0.035],"position_m":[-0.005,0.003,0.052],"mass_fraction":0.55,"rgba":[0.2,0.38,0.58,1]},{"name":"toe","type":"ellipsoid","size_m":[0.04,0.047,0.026],"position_m":[0.095,0.003,0.045],"mass_fraction":0.1,"rgba":[0.78,0.82,0.83,1]}],"fidelity":{"geometry":"authored coarse proxy","native_contact":"available for numerical testing","measured_contact":"untested","deformation":"unsupported","shoe_grasp_qualified":false,"physical_robot_ready":false}},{"id":"trainer-right","name":"Trainer / right","version":"0.1.0","immutable_id":"dvidia/shoes/trainer-right@0.1.0","family":"trainer","pair_id":"dvidia/shoes/trainer-pair@0.1.0","side":"right","license":"MIT","source":{"kind":"original_procedural","author":"DVIDIA","scope":"New primitive geometry; no redistributed scans, videos, photographs or model weights."},"properties":{"dimensions_m":{"value":[0.28,0.1,0.087],"units":"m; length x, width y, maximum height z","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_kg":{"value":0.3,"units":"kg","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"sliding_friction":{"value":0.8,"units":"dimensionless","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"torsional_friction":{"value":0.005,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"rolling_friction":{"value":0.0001,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_distribution":{"value":"Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.","units":"model assumption","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"deformation":{"value":"Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.","units":"model class","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"contact_solver":{"value":{"condim":4,"priority":1,"solref":[0.02,1],"solimp":[0.9,0.95,0.001,0.5,2]},"units":"MuJoCo solver parameters; no calibrated stiffness or damping","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."}},"frame":{"origin":"sole bottom center","axes":"right-handed; +x toward toe, +y lateral, +z up","sole_bottom_z_m":0,"initial_bottom_z_m":0.08},"geometry":[{"name":"sole","type":"box","size_m":[0.14,0.05,0.01],"position_m":[0,0,0.01],"mass_fraction":0.35,"rgba":[0.16,0.17,0.18,1]},{"name":"upper","type":"ellipsoid","size_m":[0.122,0.047,0.035],"position_m":[-0.005,-0.003,0.052],"mass_fraction":0.55,"rgba":[0.2,0.38,0.58,1]},{"name":"toe","type":"ellipsoid","size_m":[0.04,0.047,0.026],"position_m":[0.095,-0.003,0.045],"mass_fraction":0.1,"rgba":[0.78,0.82,0.83,1]}],"fidelity":{"geometry":"authored coarse proxy","native_contact":"available for numerical testing","measured_contact":"untested","deformation":"unsupported","shoe_grasp_qualified":false,"physical_robot_ready":false}},{"id":"ankle-boot-left","name":"Ankle Boot / left","version":"0.1.0","immutable_id":"dvidia/shoes/ankle-boot-left@0.1.0","family":"ankle-boot","pair_id":"dvidia/shoes/ankle-boot-pair@0.1.0","side":"left","license":"MIT","source":{"kind":"original_procedural","author":"DVIDIA","scope":"New primitive geometry; no redistributed scans, videos, photographs or model weights."},"properties":{"dimensions_m":{"value":[0.29,0.108,0.19],"units":"m; length x, width y, maximum height z","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_kg":{"value":0.5,"units":"kg","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"sliding_friction":{"value":0.9,"units":"dimensionless","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"torsional_friction":{"value":0.005,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"rolling_friction":{"value":0.0001,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_distribution":{"value":"Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.","units":"model assumption","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"deformation":{"value":"Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.","units":"model class","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"contact_solver":{"value":{"condim":4,"priority":1,"solref":[0.02,1],"solimp":[0.9,0.95,0.001,0.5,2]},"units":"MuJoCo solver parameters; no calibrated stiffness or damping","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."}},"frame":{"origin":"sole bottom center","axes":"right-handed; +x toward toe, +y lateral, +z up","sole_bottom_z_m":0,"initial_bottom_z_m":0.08},"geometry":[{"name":"sole","type":"box","size_m":[0.145,0.054,0.012],"position_m":[0,0,0.012],"mass_fraction":0.35,"rgba":[0.16,0.17,0.18,1]},{"name":"upper","type":"ellipsoid","size_m":[0.13,0.05,0.04],"position_m":[0.01,0.004,0.064],"mass_fraction":0.3,"rgba":[0.37,0.24,0.16,1]},{"name":"ankle","type":"ellipsoid","size_m":[0.047,0.049,0.055],"position_m":[-0.085,0.004,0.135],"mass_fraction":0.35,"rgba":[0.37,0.24,0.16,1]}],"fidelity":{"geometry":"authored coarse proxy","native_contact":"available for numerical testing","measured_contact":"untested","deformation":"unsupported","shoe_grasp_qualified":false,"physical_robot_ready":false}},{"id":"ankle-boot-right","name":"Ankle Boot / right","version":"0.1.0","immutable_id":"dvidia/shoes/ankle-boot-right@0.1.0","family":"ankle-boot","pair_id":"dvidia/shoes/ankle-boot-pair@0.1.0","side":"right","license":"MIT","source":{"kind":"original_procedural","author":"DVIDIA","scope":"New primitive geometry; no redistributed scans, videos, photographs or model weights."},"properties":{"dimensions_m":{"value":[0.29,0.108,0.19],"units":"m; length x, width y, maximum height z","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_kg":{"value":0.5,"units":"kg","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"sliding_friction":{"value":0.9,"units":"dimensionless","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"torsional_friction":{"value":0.005,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"rolling_friction":{"value":0.0001,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_distribution":{"value":"Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.","units":"model assumption","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"deformation":{"value":"Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.","units":"model class","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"contact_solver":{"value":{"condim":4,"priority":1,"solref":[0.02,1],"solimp":[0.9,0.95,0.001,0.5,2]},"units":"MuJoCo solver parameters; no calibrated stiffness or damping","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."}},"frame":{"origin":"sole bottom center","axes":"right-handed; +x toward toe, +y lateral, +z up","sole_bottom_z_m":0,"initial_bottom_z_m":0.08},"geometry":[{"name":"sole","type":"box","size_m":[0.145,0.054,0.012],"position_m":[0,0,0.012],"mass_fraction":0.35,"rgba":[0.16,0.17,0.18,1]},{"name":"upper","type":"ellipsoid","size_m":[0.13,0.05,0.04],"position_m":[0.01,-0.004,0.064],"mass_fraction":0.3,"rgba":[0.37,0.24,0.16,1]},{"name":"ankle","type":"ellipsoid","size_m":[0.047,0.049,0.055],"position_m":[-0.085,-0.004,0.135],"mass_fraction":0.35,"rgba":[0.37,0.24,0.16,1]}],"fidelity":{"geometry":"authored coarse proxy","native_contact":"available for numerical testing","measured_contact":"untested","deformation":"unsupported","shoe_grasp_qualified":false,"physical_robot_ready":false}},{"id":"slipper-left","name":"Slipper / left","version":"0.1.0","immutable_id":"dvidia/shoes/slipper-left@0.1.0","family":"slipper","pair_id":"dvidia/shoes/slipper-pair@0.1.0","side":"left","license":"MIT","source":{"kind":"original_procedural","author":"DVIDIA","scope":"New primitive geometry; no redistributed scans, videos, photographs or model weights."},"properties":{"dimensions_m":{"value":[0.27,0.102,0.055],"units":"m; length x, width y, maximum height z","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_kg":{"value":0.15,"units":"kg","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"sliding_friction":{"value":0.65,"units":"dimensionless","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"torsional_friction":{"value":0.005,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"rolling_friction":{"value":0.0001,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_distribution":{"value":"Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.","units":"model assumption","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"deformation":{"value":"Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.","units":"model class","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"contact_solver":{"value":{"condim":4,"priority":1,"solref":[0.02,1],"solimp":[0.9,0.95,0.001,0.5,2]},"units":"MuJoCo solver parameters; no calibrated stiffness or damping","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."}},"frame":{"origin":"sole bottom center","axes":"right-handed; +x toward toe, +y lateral, +z up","sole_bottom_z_m":0,"initial_bottom_z_m":0.08},"geometry":[{"name":"sole","type":"box","size_m":[0.135,0.051,0.009],"position_m":[0,0,0.009],"mass_fraction":0.35,"rgba":[0.16,0.17,0.18,1]},{"name":"upper","type":"ellipsoid","size_m":[0.09,0.049,0.017],"position_m":[0.045,0.002,0.038],"mass_fraction":0.65,"rgba":[0.52,0.31,0.37,1]}],"fidelity":{"geometry":"authored coarse proxy","native_contact":"available for numerical testing","measured_contact":"untested","deformation":"unsupported","shoe_grasp_qualified":false,"physical_robot_ready":false}},{"id":"slipper-right","name":"Slipper / right","version":"0.1.0","immutable_id":"dvidia/shoes/slipper-right@0.1.0","family":"slipper","pair_id":"dvidia/shoes/slipper-pair@0.1.0","side":"right","license":"MIT","source":{"kind":"original_procedural","author":"DVIDIA","scope":"New primitive geometry; no redistributed scans, videos, photographs or model weights."},"properties":{"dimensions_m":{"value":[0.27,0.102,0.055],"units":"m; length x, width y, maximum height z","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_kg":{"value":0.15,"units":"kg","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"sliding_friction":{"value":0.65,"units":"dimensionless","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"torsional_friction":{"value":0.005,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"rolling_friction":{"value":0.0001,"units":"m","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"mass_distribution":{"value":"Component mass fractions; overlapping solid primitives, inertia inferred by MuJoCo.","units":"model assumption","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"deformation":{"value":"Rigid-body proxy; no flexibility, crushing, cloth, laces, shell failure or deformation.","units":"model class","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."},"contact_solver":{"value":{"condim":4,"priority":1,"solref":[0.02,1],"solimp":[0.9,0.95,0.001,0.5,2]},"units":"MuJoCo solver parameters; no calibrated stiffness or damping","evidence":"untested","source":"Authored synthetic proxy for numerical scene tests; no real shoe, scan, measurement, material fit or calibration supports this value."}},"frame":{"origin":"sole bottom center","axes":"right-handed; +x toward toe, +y lateral, +z up","sole_bottom_z_m":0,"initial_bottom_z_m":0.08},"geometry":[{"name":"sole","type":"box","size_m":[0.135,0.051,0.009],"position_m":[0,0,0.009],"mass_fraction":0.35,"rgba":[0.16,0.17,0.18,1]},{"name":"upper","type":"ellipsoid","size_m":[0.09,0.049,0.017],"position_m":[0.045,-0.002,0.038],"mass_fraction":0.65,"rgba":[0.52,0.31,0.37,1]}],"fidelity":{"geometry":"authored coarse proxy","native_contact":"available for numerical testing","measured_contact":"untested","deformation":"unsupported","shoe_grasp_qualified":false,"physical_robot_ready":false}}],"environment":{"id":"open-support-plane","version":"0.1.0","license":"MIT","geometry":"Infinite collision plane at z=0; displayed with 2 m half extents. Not a finite tabletop or rack.","name":"asset_table","gravity_m_s2":[0,0,-9.81],"property_evidence":"untested authored environment","default_layout":"Three columns x=.40,.76,1.12 m; two rows y=.38,.56 m; sole bottoms begin z=.08 m. Layout separates loading tests from reachability claims."},"limitations":["All shoe physical properties are untested synthetic assumptions.","Left/right labels identify mirrored procedural instances, not scanned real shoes.","Arm command interfaces differ; installing a scene does not install a learned controller.","No deformation, real-world calibration, graspability claim or closed-loop sensor stack."],"catalog_sha256":"592f363389a96fef7f9223737aa72a2f1a74f400238924bf6790ec5bfd3302b7"} diff --git a/asset-library/v01/previews/ur5e/geometry.bin.gz b/asset-library/v01/previews/ur5e/geometry.bin.gz new file mode 100644 index 0000000000000000000000000000000000000000..eb1e795217c2e671c687bdd575174b74c60dc8b1 --- /dev/null +++ b/asset-library/v01/previews/ur5e/geometry.bin.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc162219dac340db4c663b34b3e54b0e5574679a7f737fa90853129d8a68978f +size 1831265 diff --git a/asset-library/v01/previews/ur5e/index.html b/asset-library/v01/previews/ur5e/index.html new file mode 100644 index 0000000000000000000000000000000000000000..843d8afcbe1c31af867095f8ee47af0f07813da9 --- /dev/null +++ b/asset-library/v01/previews/ur5e/index.html @@ -0,0 +1,4 @@ + +DVIDIA · Asset library
DVIDIA RESEARCHResearch footprints ↗

A scene you can take with you.

Loading a reusable arm and shoe scene from the local asset library.

Recorded native 3D sceneVisual geometry
Drag to orbit · Scroll or pinch to zoom · Arrow keys orbit · + / − zoom · H home
Opening local geometry and recorded body poses…
2.00 / 2.00 s
Browser physics: none. Native body poses were recorded locally.

Geometry you can inspect. Assumptions you can see.

The arm uses its pinned upstream meshes and joint mechanism. Each shoe combines original boxes and ellipsoids for a lightweight collision model. The left and right instances have persistent identities.

Shoe mass, friction, size and shape are authored assumptions. These rigid proxies do not reproduce real shoe deformation, laces, fabric, insole compression or calibrated grasp forces.

What this preview measures.

A two-second native settling run under gravity, with arm commands held at initialization. Use the timeline to inspect initial and settled states, and collision mode to see the surfaces used by the engine.

It does not demonstrate a learned shoe-organizing policy, grasp success, physical transfer or a real-time guarantee. The browser replays Float32 body poses; the simulation used native precision.

diff --git a/asset-library/v01/previews/ur5e/licenses/robotiq_2f85/LICENSE b/asset-library/v01/previews/ur5e/licenses/robotiq_2f85/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..78c0f73570702ddd1fa0a7140d3bb7308ddd9774 --- /dev/null +++ b/asset-library/v01/previews/ur5e/licenses/robotiq_2f85/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2013, ROS-Industrial +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/asset-library/v01/previews/ur5e/licenses/robotiq_2f85/README.md b/asset-library/v01/previews/ur5e/licenses/robotiq_2f85/README.md new file mode 100644 index 0000000000000000000000000000000000000000..45fa0f6068685edd3b6cf89bbfd48b926c2631c6 --- /dev/null +++ b/asset-library/v01/previews/ur5e/licenses/robotiq_2f85/README.md @@ -0,0 +1,38 @@ +# Robotiq 2F-85 Description (MJCF) + +> [!IMPORTANT] +> Requires MuJoCo 2.2.2 or later. + +## Changelog + +See [CHANGELOG.md](./CHANGELOG.md) for a full history of changes. + +## Overview + +This package contains a simplified robot description (MJCF) of the [Robotiq 85mm +2-Finger Adaptive +Gripper](https://robotiq.com/products/2f85-140-adaptive-robot-gripper) developed +by [Robotiq](https://robotiq.com/). It is derived from the [publicly available +URDF +description](https://github.com/ros-industrial/robotiq/tree/kinetic-devel/robotiq_2f_85_gripper_visualization). + +

+ +

+ +## URDF → MJCF derivation steps + +1. Added ` ` to the URDF's + `` clause in order to preserve visual geometries. +2. Loaded the URDF into MuJoCo and saved a corresponding MJCF. +3. Manually edited the MJCF to extract common properties into the `` section. +4. Added `` clauses to prevent collisions between the linkage bodies. +5. Broke up collision pads into two pads for more contacts. +6. Increased pad friction and priority. +7. Added `impratio=10` for better noslip. +8. Added `scene.xml` which includes the robot, with a textured groundplane, skybox, and haze. +9. Added hanging box to `scene.xml`. + +## License + +This model is released under a [BSD-2-Clause License](LICENSE). diff --git a/asset-library/v01/previews/ur5e/licenses/universal_robots_ur5e/LICENSE b/asset-library/v01/previews/ur5e/licenses/universal_robots_ur5e/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..f24e07cb6524f2a5e42a466c27c655a9ceb674a6 --- /dev/null +++ b/asset-library/v01/previews/ur5e/licenses/universal_robots_ur5e/LICENSE @@ -0,0 +1,26 @@ +Copyright 2018 ROS Industrial Consortium + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors +may be used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/asset-library/v01/previews/ur5e/licenses/universal_robots_ur5e/README.md b/asset-library/v01/previews/ur5e/licenses/universal_robots_ur5e/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d73bd4ef1b74ad3ead04535a7d7a48a9fb0161fc --- /dev/null +++ b/asset-library/v01/previews/ur5e/licenses/universal_robots_ur5e/README.md @@ -0,0 +1,41 @@ +# Universal Robots UR5e Description (MJCF) + +> [!IMPORTANT] +> Requires MuJoCo 2.3.3 or later. + +## Changelog + +See [CHANGELOG.md](./CHANGELOG.md) for a full history of changes. + +## Overview + +This package contains a simplified robot description (MJCF) of the +[UR5e](https://www.universal-robots.com/products/ur5-robot/) developed by +[Universal Robots](https://www.universal-robots.com/). It is derived from the +[publicly available URDF +description](https://github.com/ros-industrial/universal_robot/tree/kinetic-devel/ur_e_description). + +

+ +

+ +### URDF → MJCF derivation steps + +1. Converted the DAE [mesh + files](https://github.com/ros-industrial/universal_robot/tree/kinetic-devel/ur_e_description/meshes/ur5e/visual) + to OBJ format using [Blender](https://www.blender.org/). +2. Processed `.obj` files with [`obj2mjcf`](https://github.com/kevinzakka/obj2mjcf). +3. Added ` ` to the URDF's + `` clause in order to preserve visual geometries. +4. Loaded the URDF into MuJoCo and saved a corresponding MJCF. +5. Added a tracking light to the base. +6. Manually edited the MJCF to extract common properties into the `` section. +7. Added position-controlled actuators. Max joint torque values were taken from + [here](https://www.universal-robots.com/articles/ur/robot-care-maintenance/max-joint-torques/). +8. Added home joint configuration as a `keyframe`. +9. Manually designed collision geometries. +10. Added `scene.xml` which includes the robot, with a textured ground plane, skybox and haze. + +## License + +This model is released under a [BSD-3-Clause License](LICENSE). diff --git a/asset-library/v01/previews/ur5e/model.json b/asset-library/v01/previews/ur5e/model.json new file mode 100644 index 0000000000000000000000000000000000000000..4d759ba4915248f5a37c4cc3c415f2c95da4d60b --- /dev/null +++ b/asset-library/v01/previews/ur5e/model.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-preview-model/v1","meshes":[{"id":0,"position_byte_offset":0,"vertex_count":1158,"native_vertex_count":6532,"index_byte_offset":13896,"index_count":6720},{"id":1,"position_byte_offset":40776,"vertex_count":1337,"native_vertex_count":7523,"index_byte_offset":56820,"index_count":7794},{"id":2,"position_byte_offset":87996,"vertex_count":5872,"native_vertex_count":34136,"index_byte_offset":158460,"index_count":34305},{"id":3,"position_byte_offset":295680,"vertex_count":1172,"native_vertex_count":6703,"index_byte_offset":309744,"index_count":6804},{"id":4,"position_byte_offset":336960,"vertex_count":5016,"native_vertex_count":28142,"index_byte_offset":397152,"index_count":28761},{"id":5,"position_byte_offset":512196,"vertex_count":382,"native_vertex_count":1860,"index_byte_offset":516780,"index_count":1860},{"id":6,"position_byte_offset":524220,"vertex_count":2339,"native_vertex_count":12727,"index_byte_offset":552288,"index_count":12765},{"id":7,"position_byte_offset":603348,"vertex_count":7704,"native_vertex_count":42255,"index_byte_offset":695796,"index_count":43467},{"id":8,"position_byte_offset":869664,"vertex_count":10676,"native_vertex_count":61912,"index_byte_offset":997776,"index_count":62268},{"id":9,"position_byte_offset":1246848,"vertex_count":3350,"native_vertex_count":19489,"index_byte_offset":1287048,"index_count":19620},{"id":10,"position_byte_offset":1365528,"vertex_count":201,"native_vertex_count":918,"index_byte_offset":1367940,"index_count":963},{"id":11,"position_byte_offset":1371792,"vertex_count":1988,"native_vertex_count":10952,"index_byte_offset":1395648,"index_count":11088},{"id":12,"position_byte_offset":1440000,"vertex_count":2412,"native_vertex_count":12730,"index_byte_offset":1468944,"index_count":13497},{"id":13,"position_byte_offset":1522932,"vertex_count":599,"native_vertex_count":3305,"index_byte_offset":1530120,"index_count":3447},{"id":14,"position_byte_offset":1543908,"vertex_count":4998,"native_vertex_count":28349,"index_byte_offset":1603884,"index_count":28539},{"id":15,"position_byte_offset":1718040,"vertex_count":3602,"native_vertex_count":19166,"index_byte_offset":1761264,"index_count":19878},{"id":16,"position_byte_offset":1840776,"vertex_count":1755,"native_vertex_count":9961,"index_byte_offset":1861836,"index_count":10353},{"id":17,"position_byte_offset":1903248,"vertex_count":4319,"native_vertex_count":24787,"index_byte_offset":1955076,"index_count":24930},{"id":18,"position_byte_offset":2054796,"vertex_count":4496,"native_vertex_count":24681,"index_byte_offset":2108748,"index_count":25557},{"id":19,"position_byte_offset":2210976,"vertex_count":485,"native_vertex_count":2490,"index_byte_offset":2216796,"index_count":2733},{"id":20,"position_byte_offset":2227728,"vertex_count":10899,"native_vertex_count":10899,"index_byte_offset":2358516,"index_count":65502},{"id":21,"position_byte_offset":2620524,"vertex_count":17120,"native_vertex_count":17120,"index_byte_offset":2825964,"index_count":102744},{"id":22,"position_byte_offset":3236940,"vertex_count":672,"native_vertex_count":672,"index_byte_offset":3245004,"index_count":4020},{"id":23,"position_byte_offset":3261084,"vertex_count":888,"native_vertex_count":888,"index_byte_offset":3271740,"index_count":5340},{"id":24,"position_byte_offset":3293100,"vertex_count":1104,"native_vertex_count":1104,"index_byte_offset":3306348,"index_count":6624},{"id":25,"position_byte_offset":3332844,"vertex_count":152,"native_vertex_count":152,"index_byte_offset":3334668,"index_count":900},{"id":26,"position_byte_offset":3338268,"vertex_count":152,"native_vertex_count":152,"index_byte_offset":3340092,"index_count":900},{"id":27,"position_byte_offset":3343692,"vertex_count":840,"native_vertex_count":840,"index_byte_offset":3353772,"index_count":5088}],"geoms":[{"geom_id":0,"name":"asset_table","body_id":0,"type":"plane","group":0,"size":[2.0,2.0,0.1],"position":[0.0,0.0,0.0],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.8799999952316284,0.8600000143051147,0.8100000023841858,1.0],"mesh_id":null,"collision":true},{"geom_id":1,"name":"unnamed_1","body_id":1,"type":"mesh","group":2,"size":[0.008698514572873945,0.05799508674525803,0.05798762806902526],"position":[6.729318621182383e-07,-3.6596373548359835e-07,0.09357351429819695],"quaternion_wxyz":[0.42479222398855343,0.5652842282594949,-0.42479784533233494,0.5652893934268842],"rgba":[0.032999999821186066,0.032999999821186066,0.032999999821186066,1.0],"mesh_id":0,"collision":false},{"geom_id":2,"name":"unnamed_2","body_id":1,"type":"mesh","group":2,"size":[0.05375376193556502,0.07548711787276217,0.07548669363053974],"position":[1.5039457078262143e-07,5.030274644779793e-07,0.031134092061250857],"quaternion_wxyz":[-0.2274578661892894,0.6695281114903777,0.2274429279016968,0.669525758713025],"rgba":[0.27799999713897705,0.27799999713897705,0.27799999713897705,1.0],"mesh_id":1,"collision":false},{"geom_id":3,"name":"unnamed_3","body_id":2,"type":"mesh","group":2,"size":[0.02133722275935881,0.061093659141003606,0.069404246006668],"position":[0.00015791980711449345,-0.008422927154951226,0.04825544244212042],"quaternion_wxyz":[0.4574122929521009,0.5398883636786332,-0.606985634525088,0.3617498977206329],"rgba":[0.49000000953674316,0.6779999732971191,0.800000011920929,1.0],"mesh_id":2,"collision":false},{"geom_id":4,"name":"unnamed_4","body_id":2,"type":"mesh","group":2,"size":[0.008687692237218003,0.05801955632258374,0.057988073907848194],"position":[1.0217402531717394e-06,0.06888462521467517,-0.0005032840688908085],"quaternion_wxyz":[0.7045513161309811,0.060021050925738895,0.060010633502450735,0.7045591815103311],"rgba":[0.032999999821186066,0.032999999821186066,0.032999999821186066,1.0],"mesh_id":3,"collision":false},{"geom_id":5,"name":"unnamed_5","body_id":2,"type":"mesh","group":2,"size":[0.0728359224161342,0.09820385439645193,0.060668028123757635],"position":[-4.987106654918202e-05,0.0005636150374333535,-0.018757717823843445],"quaternion_wxyz":[0.6390851615889156,0.30097737759067794,0.6553344631656304,0.2674313291350241],"rgba":[0.27799999713897705,0.27799999713897705,0.27799999713897705,1.0],"mesh_id":4,"collision":false},{"geom_id":6,"name":"unnamed_6","body_id":2,"type":"capsule","group":3,"size":[0.06,0.06,0.0],"position":[0.0,0.0,-0.04],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":7,"name":"unnamed_7","body_id":3,"type":"mesh","group":2,"size":[0.057928147175093585,0.058052661390998746,0.13905726414923616],"position":[-3.5760986999952535e-06,-0.00019999979744521681,0.2121351784520986],"quaternion_wxyz":[0.9842755040889569,-0.00016280459531085883,2.8458622464535605e-05,-0.17664004284193335],"rgba":[0.8199999928474426,0.8199999928474426,0.8199999928474426,1.0],"mesh_id":5,"collision":false},{"geom_id":8,"name":"unnamed_8","body_id":3,"type":"mesh","group":2,"size":[0.05801518721978192,0.09260157134845562,0.24919043009114472],"position":[-7.532369564792804e-07,-0.02455902448126744,0.2981274565454926],"quaternion_wxyz":[0.9960792487624223,0.08846508089662901,1.8366790991150207e-05,-0.00024353542301136535],"rgba":[0.032999999821186066,0.032999999821186066,0.032999999821186066,1.0],"mesh_id":6,"collision":false},{"geom_id":9,"name":"unnamed_9","body_id":3,"type":"mesh","group":2,"size":[0.0843135822990357,0.05840828682976745,0.27260754653109665],"position":[1.2475330963948406e-05,-0.020613766332852907,0.21354779205990887],"quaternion_wxyz":[0.7064585575383384,0.0033099842566664747,-0.0033342259668105168,0.7077388172357615],"rgba":[0.27799999713897705,0.27799999713897705,0.27799999713897705,1.0],"mesh_id":7,"collision":false},{"geom_id":10,"name":"unnamed_10","body_id":3,"type":"mesh","group":2,"size":[0.03683482894888451,0.06011245348335062,0.27283014075752837],"position":[-1.6738822332805903e-05,0.04530972332900901,0.2122404611046166],"quaternion_wxyz":[0.7069376172326716,0.00011442554455713959,-0.00012226721667299014,0.7072758848560556],"rgba":[0.49000000953674316,0.6779999732971191,0.800000011920929,1.0],"mesh_id":8,"collision":false},{"geom_id":11,"name":"unnamed_11","body_id":3,"type":"capsule","group":3,"size":[0.06,0.06,0.0],"position":[0.0,-0.04,0.0],"quaternion_wxyz":[0.7071067811865475,0.7071067811865475,0.0,0.0],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":12,"name":"unnamed_12","body_id":3,"type":"capsule","group":3,"size":[0.05,0.2,0.0],"position":[0.0,0.0,0.2],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":13,"name":"unnamed_13","body_id":4,"type":"mesh","group":2,"size":[0.02192778131193176,0.039499314804346854,0.043106555739528464],"position":[2.620736338300274e-05,-0.03986927887408663,0.39588938552993125],"quaternion_wxyz":[0.7046946476341628,-0.05718502410401358,0.16114429131863592,0.6885984635398213],"rgba":[0.49000000953674316,0.6779999732971191,0.800000011920929,1.0],"mesh_id":9,"collision":false},{"geom_id":14,"name":"unnamed_14","body_id":4,"type":"mesh","group":2,"size":[0.0479085177976082,0.047938483620781826,0.1347690630303675],"position":[-2.363686724338377e-05,-0.00043409137198602846,0.204343083020783],"quaternion_wxyz":[0.7858980279889758,0.00030249769226333177,-0.00011293631882693252,0.6183560344523003],"rgba":[0.8199999928474426,0.8199999928474426,0.8199999928474426,1.0],"mesh_id":10,"collision":false},{"geom_id":15,"name":"unnamed_15","body_id":4,"type":"mesh","group":2,"size":[0.04802480060806252,0.06743996514895238,0.19940558648280035],"position":[-9.661385899159827e-06,0.01697650902876461,0.25503902118262073],"quaternion_wxyz":[0.9973225432823116,-0.0730861685385928,0.00014621560127752595,0.0024769437312933125],"rgba":[0.032999999821186066,0.032999999821186066,0.032999999821186066,1.0],"mesh_id":11,"collision":false},{"geom_id":16,"name":"unnamed_16","body_id":4,"type":"mesh","group":2,"size":[0.05821124313901896,0.05806407066688865,0.26624897376356654],"position":[2.9751427778339384e-06,0.011960668345023871,0.163616824759711],"quaternion_wxyz":[0.7067976200998364,-0.007178142665528071,0.00719366064233815,0.7073428092061479],"rgba":[0.27799999713897705,0.27799999713897705,0.27799999713897705,1.0],"mesh_id":12,"collision":false},{"geom_id":17,"name":"unnamed_17","body_id":4,"type":"capsule","group":3,"size":[0.055,0.06,0.0],"position":[0.0,0.08,0.0],"quaternion_wxyz":[0.7071067811865475,0.7071067811865475,0.0,0.0],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":18,"name":"unnamed_18","body_id":4,"type":"capsule","group":3,"size":[0.038,0.19,0.0],"position":[0.0,0.0,0.2],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":19,"name":"unnamed_19","body_id":5,"type":"mesh","group":2,"size":[0.004619818403426377,0.03752030093928872,0.03752984353890271],"position":[-2.3247520088853097e-05,0.12628514044400524,0.04897505972393637],"quaternion_wxyz":[-0.1409072497397645,0.6929777298871733,0.14077960708107307,0.6928983439735579],"rgba":[0.032999999821186066,0.032999999821186066,0.032999999821186066,1.0],"mesh_id":13,"collision":false},{"geom_id":20,"name":"unnamed_20","body_id":5,"type":"mesh","group":2,"size":[0.021926080750828175,0.03940043348501516,0.04321562382857428],"position":[-3.664458369525661e-05,0.13040179162514767,-0.039703488567445454],"quaternion_wxyz":[0.3947796699519458,0.5868228989261335,-0.5545021904004319,0.4385375905548885],"rgba":[0.49000000953674316,0.6779999732971191,0.800000011920929,1.0],"mesh_id":14,"collision":false},{"geom_id":21,"name":"unnamed_21","body_id":5,"type":"mesh","group":2,"size":[0.05181102596161155,0.03786914305510418,0.07677606579938251],"position":[-2.099061493782027e-06,0.11289621711604998,0.012388333942626797],"quaternion_wxyz":[0.3482385686186157,0.615089580847849,-0.6155129988075977,0.34862365834486375],"rgba":[0.27799999713897705,0.27799999713897705,0.27799999713897705,1.0],"mesh_id":15,"collision":false},{"geom_id":22,"name":"unnamed_22","body_id":5,"type":"capsule","group":3,"size":[0.04,0.07,0.0],"position":[0.0,0.05,0.0],"quaternion_wxyz":[0.7071067811865475,0.7071067811865475,0.0,0.0],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":23,"name":"unnamed_23","body_id":6,"type":"mesh","group":2,"size":[0.004612289373462366,0.03749644853530802,0.037496695743409345],"position":[-3.8001937811615942e-06,0.04853645611151084,0.0994358043319549],"quaternion_wxyz":[0.7043314411097775,0.062668394319743,0.06266853557478877,0.7043170792097281],"rgba":[0.032999999821186066,0.032999999821186066,0.032999999821186066,1.0],"mesh_id":16,"collision":false},{"geom_id":24,"name":"unnamed_24","body_id":6,"type":"mesh","group":2,"size":[0.021851727091864004,0.03942526438345557,0.04317592997971218],"position":[3.1696401635936616e-05,-0.040206055715980675,0.10359119935436582],"quaternion_wxyz":[0.7035030213844489,-0.07002301081381658,0.14760870156120887,0.6916588379272943],"rgba":[0.49000000953674316,0.6779999732971191,0.800000011920929,1.0],"mesh_id":17,"collision":false},{"geom_id":25,"name":"unnamed_25","body_id":6,"type":"mesh","group":2,"size":[0.04791247421810119,0.03787157489663186,0.06891537429076883],"position":[9.000191078908761e-07,0.01605665586031421,0.09663180277604577],"quaternion_wxyz":[0.27613705855704046,0.6509364336722868,-0.6508583175371169,0.2764299815545111],"rgba":[0.27799999713897705,0.27799999713897705,0.27799999713897705,1.0],"mesh_id":18,"collision":false},{"geom_id":26,"name":"unnamed_26","body_id":6,"type":"capsule","group":3,"size":[0.04,0.06,0.0],"position":[0.0,0.0,0.04],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":27,"name":"unnamed_27","body_id":6,"type":"capsule","group":3,"size":[0.04,0.04,0.0],"position":[0.0,0.02,0.1],"quaternion_wxyz":[0.7071067811865475,0.7071067811865475,0.0,0.0],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":28,"name":"unnamed_28","body_id":7,"type":"mesh","group":2,"size":[0.026344491625435333,0.03757563304432659,0.043297032293509896],"position":[1.3730314416337317e-05,0.07930911124904107,-0.0005378684357207324],"quaternion_wxyz":[0.7029557182886083,0.07806375542900122,0.0814425260300059,0.7022296085807839],"rgba":[0.8199999928474426,0.8199999928474426,0.8199999928474426,1.0],"mesh_id":19,"collision":false},{"geom_id":29,"name":"unnamed_29","body_id":7,"type":"cylinder","group":3,"size":[0.04,0.02,0.0],"position":[0.0,0.08,0.0],"quaternion_wxyz":[0.7071067811865475,0.7071067811865475,0.0,0.0],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":null,"collision":true},{"geom_id":30,"name":"unnamed_30","body_id":8,"type":"mesh","group":2,"size":[0.0070648573650106405,0.037586067154285425,0.037880066286881973],"position":[-0.00036058359582141595,8.53627480093744e-05,-5.919914145050638e-05],"quaternion_wxyz":[-0.0005129174394464319,0.7060997624936066,0.0005329903636924318,0.7081119814291023],"rgba":[0.14900000393390656,0.14900000393390656,0.14900000393390656,1.0],"mesh_id":20,"collision":false},{"geom_id":31,"name":"unnamed_31","body_id":8,"type":"mesh","group":3,"size":[0.0070648573650106405,0.037586067154285425,0.037880066286881973],"position":[-0.00036058359582141595,8.53627480093744e-05,-5.919914145050638e-05],"quaternion_wxyz":[-0.0005129174394464319,0.7060997624936066,0.0005329903636924318,0.7081119814291023],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":20,"collision":true},{"geom_id":32,"name":"unnamed_32","body_id":9,"type":"mesh","group":2,"size":[0.03750010308597934,0.04242573588049587,0.054579734780572216],"position":[9.195807492673847e-08,-2.7039432501498238e-05,0.035467480567269984],"quaternion_wxyz":[0.9999988317813585,-0.0015284877675648015,-2.020828445767252e-07,1.2689455449779228e-05],"rgba":[0.14900000393390656,0.14900000393390656,0.14900000393390656,1.0],"mesh_id":21,"collision":false},{"geom_id":33,"name":"unnamed_33","body_id":9,"type":"mesh","group":3,"size":[0.03750010308597934,0.04242573588049587,0.054579734780572216],"position":[9.195807492673847e-08,-2.7039432501498238e-05,0.035467480567269984],"quaternion_wxyz":[0.9999988317813585,-0.0015284877675648015,-2.020828445767252e-07,1.2689455449779228e-05],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":21,"collision":true},{"geom_id":34,"name":"unnamed_34","body_id":10,"type":"mesh","group":2,"size":[0.012000000001753717,0.012127116362424849,0.02528523319402839],"position":[2.96931e-12,0.0177547,0.00107314],"quaternion_wxyz":[0.68130118919396,0.7320032032736576,0.0,0.0],"rgba":[0.4627000093460083,0.4627000093460083,0.4627000093460083,1.0],"mesh_id":22,"collision":false},{"geom_id":35,"name":"unnamed_35","body_id":10,"type":"mesh","group":3,"size":[0.012000000001753717,0.012127116362424849,0.02528523319402839],"position":[2.96931e-12,0.0177547,0.00107314],"quaternion_wxyz":[0.68130118919396,0.7320032032736576,0.0,0.0],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":22,"collision":true},{"geom_id":36,"name":"unnamed_36","body_id":11,"type":"mesh","group":2,"size":[0.006000612152119913,0.013500000001853299,0.030107897104210076],"position":[0.0,0.00301209,0.0232175],"quaternion_wxyz":[0.7056355419945858,-0.04559037040875177,0.04559037040875177,0.7056355419945858],"rgba":[0.14900000393390656,0.14900000393390656,0.14900000393390656,1.0],"mesh_id":23,"collision":false},{"geom_id":37,"name":"unnamed_37","body_id":11,"type":"mesh","group":3,"size":[0.006000612152119913,0.013500000001853299,0.030107897104210076],"position":[0.0,0.00301209,0.0232175],"quaternion_wxyz":[0.7056355419945858,-0.04559037040875177,0.04559037040875177,0.7056355419945858],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":23,"collision":true},{"geom_id":38,"name":"unnamed_38","body_id":12,"type":"mesh","group":2,"size":[0.006000676660756088,0.01950000859210647,0.03518381933564344],"position":[-8.65005e-09,0.0181624,0.0212658],"quaternion_wxyz":[0.6634031727648035,-0.24473706373492393,0.24473706373492393,0.6634031727648035],"rgba":[0.14900000393390656,0.14900000393390656,0.14900000393390656,1.0],"mesh_id":27,"collision":false},{"geom_id":39,"name":"unnamed_39","body_id":12,"type":"mesh","group":3,"size":[0.006000676660756088,0.01950000859210647,0.03518381933564344],"position":[-8.65005e-09,0.0181624,0.0212658],"quaternion_wxyz":[0.6634031727648035,-0.24473706373492393,0.24473706373492393,0.6634031727648035],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":27,"collision":true},{"geom_id":40,"name":"unnamed_40","body_id":13,"type":"mesh","group":2,"size":[0.00750035671768447,0.014429873448581933,0.032840405568440756],"position":[-8.22050233384949e-08,-0.011045964668534759,0.012478640431123103],"quaternion_wxyz":[0.9860582696507035,0.16640038705757434,5.751814660390417e-06,2.7324700256379845e-06],"rgba":[0.14900000393390656,0.14900000393390656,0.14900000393390656,1.0],"mesh_id":24,"collision":false},{"geom_id":41,"name":"unnamed_41","body_id":13,"type":"mesh","group":3,"size":[0.00750035671768447,0.014429873448581933,0.032840405568440756],"position":[-8.22050233384949e-08,-0.011045964668534759,0.012478640431123103],"quaternion_wxyz":[0.9860582696507035,0.16640038705757434,5.751814660390417e-06,2.7324700256379845e-06],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":24,"collision":true},{"geom_id":42,"name":"gripper/right_pad1","body_id":14,"type":"box","group":3,"size":[0.011,0.004,0.009375],"position":[0.0,-0.0026,0.028125],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.550000011920929,0.550000011920929,0.550000011920929,1.0],"mesh_id":null,"collision":true},{"geom_id":43,"name":"gripper/right_pad2","body_id":14,"type":"box","group":3,"size":[0.011,0.004,0.009375],"position":[0.0,-0.0026,0.009375],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.44999998807907104,0.44999998807907104,0.44999998807907104,1.0],"mesh_id":null,"collision":true},{"geom_id":44,"name":"unnamed_44","body_id":14,"type":"mesh","group":2,"size":[0.002500000000000005,0.011000000000000013,0.01898262472521744],"position":[4.181023413011691e-20,-0.0024999999999999988,0.01851737527478258],"quaternion_wxyz":[0.7071067811865475,0.0,0.0,0.7071067811865475],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":25,"collision":false},{"geom_id":45,"name":"unnamed_45","body_id":15,"type":"mesh","group":2,"size":[0.000799999952316292,0.011000000000000013,0.018982624725217456],"position":[-4.444917978695051e-19,-0.005799999952316277,0.018517375274782567],"quaternion_wxyz":[0.707106781186548,0.0,0.0,0.707106781186548],"rgba":[0.14900000393390656,0.14900000393390656,0.14900000393390656,1.0],"mesh_id":26,"collision":false},{"geom_id":46,"name":"unnamed_46","body_id":16,"type":"mesh","group":2,"size":[0.012000000001753717,0.012127116362424849,0.02528523319402839],"position":[0.0,0.0177547,0.00107314],"quaternion_wxyz":[0.68130118919396,0.7320032032736576,0.0,0.0],"rgba":[0.4627000093460083,0.4627000093460083,0.4627000093460083,1.0],"mesh_id":22,"collision":false},{"geom_id":47,"name":"unnamed_47","body_id":16,"type":"mesh","group":3,"size":[0.012000000001753717,0.012127116362424849,0.02528523319402839],"position":[0.0,0.0177547,0.00107314],"quaternion_wxyz":[0.68130118919396,0.7320032032736576,0.0,0.0],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":22,"collision":true},{"geom_id":48,"name":"unnamed_48","body_id":17,"type":"mesh","group":2,"size":[0.006000612152119913,0.013500000001853299,0.030107897104210076],"position":[0.0,0.00301209,0.0232175],"quaternion_wxyz":[0.7056355419945858,-0.04559037040875177,0.04559037040875177,0.7056355419945858],"rgba":[0.14900000393390656,0.14900000393390656,0.14900000393390656,1.0],"mesh_id":23,"collision":false},{"geom_id":49,"name":"unnamed_49","body_id":17,"type":"mesh","group":3,"size":[0.006000612152119913,0.013500000001853299,0.030107897104210076],"position":[0.0,0.00301209,0.0232175],"quaternion_wxyz":[0.7056355419945858,-0.04559037040875177,0.04559037040875177,0.7056355419945858],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":23,"collision":true},{"geom_id":50,"name":"unnamed_50","body_id":18,"type":"mesh","group":2,"size":[0.006000676660756088,0.01950000859210647,0.03518381933564344],"position":[-8.65005e-09,0.0181624,0.0212658],"quaternion_wxyz":[0.6634031727648035,-0.24473706373492393,0.24473706373492393,0.6634031727648035],"rgba":[0.14900000393390656,0.14900000393390656,0.14900000393390656,1.0],"mesh_id":27,"collision":false},{"geom_id":51,"name":"unnamed_51","body_id":18,"type":"mesh","group":3,"size":[0.006000676660756088,0.01950000859210647,0.03518381933564344],"position":[-8.65005e-09,0.0181624,0.0212658],"quaternion_wxyz":[0.6634031727648035,-0.24473706373492393,0.24473706373492393,0.6634031727648035],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":27,"collision":true},{"geom_id":52,"name":"unnamed_52","body_id":19,"type":"mesh","group":2,"size":[0.00750035671768447,0.014429873448581933,0.032840405568440756],"position":[-8.22050233384949e-08,-0.011045964668534759,0.012478640431123103],"quaternion_wxyz":[0.9860582696507035,0.16640038705757434,5.751814660390417e-06,2.7324700256379845e-06],"rgba":[0.14900000393390656,0.14900000393390656,0.14900000393390656,1.0],"mesh_id":24,"collision":false},{"geom_id":53,"name":"unnamed_53","body_id":19,"type":"mesh","group":3,"size":[0.00750035671768447,0.014429873448581933,0.032840405568440756],"position":[-8.22050233384949e-08,-0.011045964668534759,0.012478640431123103],"quaternion_wxyz":[0.9860582696507035,0.16640038705757434,5.751814660390417e-06,2.7324700256379845e-06],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":24,"collision":true},{"geom_id":54,"name":"gripper/left_pad1","body_id":20,"type":"box","group":3,"size":[0.011,0.004,0.009375],"position":[0.0,-0.0026,0.028125],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.550000011920929,0.550000011920929,0.550000011920929,1.0],"mesh_id":null,"collision":true},{"geom_id":55,"name":"gripper/left_pad2","body_id":20,"type":"box","group":3,"size":[0.011,0.004,0.009375],"position":[0.0,-0.0026,0.009375],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.44999998807907104,0.44999998807907104,0.44999998807907104,1.0],"mesh_id":null,"collision":true},{"geom_id":56,"name":"unnamed_56","body_id":20,"type":"mesh","group":2,"size":[0.002500000000000005,0.011000000000000013,0.01898262472521744],"position":[4.181023413011691e-20,-0.0024999999999999988,0.01851737527478258],"quaternion_wxyz":[0.7071067811865475,0.0,0.0,0.7071067811865475],"rgba":[0.5,0.5,0.5,1.0],"mesh_id":25,"collision":false},{"geom_id":57,"name":"unnamed_57","body_id":21,"type":"mesh","group":2,"size":[0.000799999952316292,0.011000000000000013,0.018982624725217456],"position":[-4.444917978695051e-19,-0.005799999952316277,0.018517375274782567],"quaternion_wxyz":[0.707106781186548,0.0,0.0,0.707106781186548],"rgba":[0.14900000393390656,0.14900000393390656,0.14900000393390656,1.0],"mesh_id":26,"collision":false},{"geom_id":58,"name":"shoe_trainer_left_sole","body_id":22,"type":"box","group":0,"size":[0.14,0.05,0.01],"position":[0.0,0.0,0.01],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.1599999964237213,0.17000000178813934,0.18000000715255737,1.0],"mesh_id":null,"collision":true},{"geom_id":59,"name":"shoe_trainer_left_upper","body_id":22,"type":"ellipsoid","group":0,"size":[0.122,0.047,0.035],"position":[-0.005,0.003,0.052],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.20000000298023224,0.3799999952316284,0.5799999833106995,1.0],"mesh_id":null,"collision":true},{"geom_id":60,"name":"shoe_trainer_left_toe","body_id":22,"type":"ellipsoid","group":0,"size":[0.04,0.047,0.026],"position":[0.095,0.003,0.045],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.7799999713897705,0.8199999928474426,0.8299999833106995,1.0],"mesh_id":null,"collision":true},{"geom_id":61,"name":"shoe_trainer_right_sole","body_id":23,"type":"box","group":0,"size":[0.14,0.05,0.01],"position":[0.0,0.0,0.01],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.1599999964237213,0.17000000178813934,0.18000000715255737,1.0],"mesh_id":null,"collision":true},{"geom_id":62,"name":"shoe_trainer_right_upper","body_id":23,"type":"ellipsoid","group":0,"size":[0.122,0.047,0.035],"position":[-0.005,-0.003,0.052],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.20000000298023224,0.3799999952316284,0.5799999833106995,1.0],"mesh_id":null,"collision":true},{"geom_id":63,"name":"shoe_trainer_right_toe","body_id":23,"type":"ellipsoid","group":0,"size":[0.04,0.047,0.026],"position":[0.095,-0.003,0.045],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.7799999713897705,0.8199999928474426,0.8299999833106995,1.0],"mesh_id":null,"collision":true},{"geom_id":64,"name":"shoe_ankle_boot_left_sole","body_id":24,"type":"box","group":0,"size":[0.145,0.054,0.012],"position":[0.0,0.0,0.012],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.1599999964237213,0.17000000178813934,0.18000000715255737,1.0],"mesh_id":null,"collision":true},{"geom_id":65,"name":"shoe_ankle_boot_left_upper","body_id":24,"type":"ellipsoid","group":0,"size":[0.13,0.05,0.04],"position":[0.01,0.004,0.064],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.3700000047683716,0.23999999463558197,0.1599999964237213,1.0],"mesh_id":null,"collision":true},{"geom_id":66,"name":"shoe_ankle_boot_left_ankle","body_id":24,"type":"ellipsoid","group":0,"size":[0.047,0.049,0.055],"position":[-0.085,0.004,0.135],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.3700000047683716,0.23999999463558197,0.1599999964237213,1.0],"mesh_id":null,"collision":true},{"geom_id":67,"name":"shoe_ankle_boot_right_sole","body_id":25,"type":"box","group":0,"size":[0.145,0.054,0.012],"position":[0.0,0.0,0.012],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.1599999964237213,0.17000000178813934,0.18000000715255737,1.0],"mesh_id":null,"collision":true},{"geom_id":68,"name":"shoe_ankle_boot_right_upper","body_id":25,"type":"ellipsoid","group":0,"size":[0.13,0.05,0.04],"position":[0.01,-0.004,0.064],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.3700000047683716,0.23999999463558197,0.1599999964237213,1.0],"mesh_id":null,"collision":true},{"geom_id":69,"name":"shoe_ankle_boot_right_ankle","body_id":25,"type":"ellipsoid","group":0,"size":[0.047,0.049,0.055],"position":[-0.085,-0.004,0.135],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.3700000047683716,0.23999999463558197,0.1599999964237213,1.0],"mesh_id":null,"collision":true},{"geom_id":70,"name":"shoe_slipper_left_sole","body_id":26,"type":"box","group":0,"size":[0.135,0.051,0.009],"position":[0.0,0.0,0.009],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.1599999964237213,0.17000000178813934,0.18000000715255737,1.0],"mesh_id":null,"collision":true},{"geom_id":71,"name":"shoe_slipper_left_upper","body_id":26,"type":"ellipsoid","group":0,"size":[0.09,0.049,0.017],"position":[0.045,0.002,0.038],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.5199999809265137,0.3100000023841858,0.3700000047683716,1.0],"mesh_id":null,"collision":true},{"geom_id":72,"name":"shoe_slipper_right_sole","body_id":27,"type":"box","group":0,"size":[0.135,0.051,0.009],"position":[0.0,0.0,0.009],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.1599999964237213,0.17000000178813934,0.18000000715255737,1.0],"mesh_id":null,"collision":true},{"geom_id":73,"name":"shoe_slipper_right_upper","body_id":27,"type":"ellipsoid","group":0,"size":[0.09,0.049,0.017],"position":[0.045,-0.002,0.038],"quaternion_wxyz":[1.0,0.0,0.0,0.0],"rgba":[0.5199999809265137,0.3100000023841858,0.3700000047683716,1.0],"mesh_id":null,"collision":true}],"bodies":[{"id":0,"name":"world"},{"id":1,"name":"base"},{"id":2,"name":"shoulder_link"},{"id":3,"name":"upper_arm_link"},{"id":4,"name":"forearm_link"},{"id":5,"name":"wrist_1_link"},{"id":6,"name":"wrist_2_link"},{"id":7,"name":"wrist_3_link"},{"id":8,"name":"gripper/base_mount"},{"id":9,"name":"gripper/base"},{"id":10,"name":"gripper/right_driver"},{"id":11,"name":"gripper/right_coupler"},{"id":12,"name":"gripper/right_spring_link"},{"id":13,"name":"gripper/right_follower"},{"id":14,"name":"gripper/right_pad"},{"id":15,"name":"gripper/right_silicone_pad"},{"id":16,"name":"gripper/left_driver"},{"id":17,"name":"gripper/left_coupler"},{"id":18,"name":"gripper/left_spring_link"},{"id":19,"name":"gripper/left_follower"},{"id":20,"name":"gripper/left_pad"},{"id":21,"name":"gripper/left_silicone_pad"},{"id":22,"name":"shoe_trainer_left"},{"id":23,"name":"shoe_trainer_right"},{"id":24,"name":"shoe_ankle_boot_left"},{"id":25,"name":"shoe_ankle_boot_right"},{"id":26,"name":"shoe_slipper_left"},{"id":27,"name":"shoe_slipper_right"}],"joints":[{"name":"shoulder_pan_joint","range":[-6.28319,6.28319]},{"name":"shoulder_lift_joint","range":[-6.28319,6.28319]},{"name":"elbow_joint","range":[-3.1415,3.1415]},{"name":"wrist_1_joint","range":[-6.28319,6.28319]},{"name":"wrist_2_joint","range":[-6.28319,6.28319]},{"name":"wrist_3_joint","range":[-6.28319,6.28319]},{"name":"gripper/right_driver_joint","range":[0.0,0.8]},{"name":"gripper/right_coupler_joint","range":[-1.57,0.0]},{"name":"gripper/right_spring_link_joint","range":[-0.29670597283,0.8]},{"name":"gripper/right_follower_joint","range":[-0.872664,0.872664]},{"name":"gripper/left_driver_joint","range":[0.0,0.8]},{"name":"gripper/left_coupler_joint","range":[-1.57,0.0]},{"name":"gripper/left_spring_link_joint","range":[-0.29670597283,0.8]},{"name":"gripper/left_follower_joint","range":[-0.872664,0.872664]},{"name":"shoe_trainer_left_free","range":[0.0,0.0]},{"name":"shoe_trainer_right_free","range":[0.0,0.0]},{"name":"shoe_ankle_boot_left_free","range":[0.0,0.0]},{"name":"shoe_ankle_boot_right_free","range":[0.0,0.0]},{"name":"shoe_slipper_left_free","range":[0.0,0.0]},{"name":"shoe_slipper_right_free","range":[0.0,0.0]}],"source":{"robot":"ur5e","assets":{"commit":"0059d4335f8156206f63a35662313385f7ad6d74","files_verified":36,"bytes_verified":34193501,"lock_sha256":"941eb6f9fd474635a590b82c66b59a9d5124d8e0d9ddc203006f5b921d8d2861","licenses":{"universal_robots_ur5e":"BSD-3-Clause","robotiq_2f85":"BSD-2-Clause"}},"mujoco":"3.15.0","compiled_model_sha256":"2b5f35144323260256048a0f79ac4200adc57b8ddd7f342f36665e099cb1c3c6","scene_sha256":"5d94197873f27b62431cf1b512c9622d72882c6bc22b4b11a190bdaf3fb04b13"},"scope":"Recorded native MuJoCo scene settling with held arm commands. The browser displays saved poses and does not run physics. Shoes are authored rigid proxies with untested physical properties. No learned shoe skill, calibrated deformation, hardware or real-time qualification.","geometry_binary":{"href":"geometry.bin.gz","compression":"gzip","bytes":3374124,"compressed_bytes":1831265,"sha256":"8349bbefd55572e69151d8d21a5e6ae1fd2f80153f2782db26d72729a9bdf9ec"}} diff --git a/asset-library/v01/previews/ur5e/motion.bin.gz b/asset-library/v01/previews/ur5e/motion.bin.gz new file mode 100644 index 0000000000000000000000000000000000000000..209b7a095b4c862de350517752c8edd20686218a --- /dev/null +++ b/asset-library/v01/previews/ur5e/motion.bin.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:057273906b6c4feb3872570b7d4ba845d453bc67cb08a70b012a7375ead9ab75 +size 35893 diff --git a/asset-library/v01/previews/ur5e/motion.json b/asset-library/v01/previews/ur5e/motion.json new file mode 100644 index 0000000000000000000000000000000000000000..a65ef763a0b75577d7cf8013d8b76d2aaaf2d9f3 --- /dev/null +++ b/asset-library/v01/previews/ur5e/motion.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-preview-motion/v1","source":{"robot":"ur5e","assets":{"commit":"0059d4335f8156206f63a35662313385f7ad6d74","files_verified":36,"bytes_verified":34193501,"lock_sha256":"941eb6f9fd474635a590b82c66b59a9d5124d8e0d9ddc203006f5b921d8d2861","licenses":{"universal_robots_ur5e":"BSD-3-Clause","robotiq_2f85":"BSD-2-Clause"}},"mujoco":"3.15.0","compiled_model_sha256":"2b5f35144323260256048a0f79ac4200adc57b8ddd7f342f36665e099cb1c3c6","scene_sha256":"5d94197873f27b62431cf1b512c9622d72882c6bc22b4b11a190bdaf3fb04b13"},"scope":"Recorded native MuJoCo scene settling with held arm commands. The browser displays saved poses and does not run physics. Shoes are authored rigid proxies with untested physical properties. No learned shoe skill, calibrated deformation, hardware or real-time qualification.","body_count":28,"frame_count":101,"frame_stride_floats":196,"duration_seconds":2.0,"timestep_seconds":0.002,"rows":[{"t_seconds":0.0,"contact_count":0,"joint_position":[-1.5708,-1.5708,1.5708,-1.5708,-1.5708,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]},{"t_seconds":0.02,"contact_count":0,"joint_position":[-1.5707590842734582,-1.5701601515215224,1.5715884896148007,-1.5704703244163718,-1.5708008989678015,2.2112260154850436e-09,0.0005056545921775282,0.00015396296945916773,0.0007789167212357015,-0.00110175429963838,0.000505573771393777,0.0001537688846018477,0.0007818734100872235,-0.0011104382448459196]},{"t_seconds":0.04,"contact_count":0,"joint_position":[-1.5707582555960604,-1.5692204903885834,1.572517391535101,-1.570037551907332,-1.5707998344355523,-7.505606877778585e-09,0.0009454423193011116,0.00015762091530769712,0.0012118971259140923,-0.0015414547701325487,0.000945438380851034,0.00015765855001768068,0.0012164781497517312,-0.001550210105869654]},{"t_seconds":0.06,"contact_count":0,"joint_position":[-1.5707659337084825,-1.568334203444588,1.5733728792092685,-1.569638664149404,-1.5707999067058631,-6.340247168663545e-09,0.0013054542954960367,0.0001572686410278697,0.0015690758212524238,-0.0018825827541235846,0.0013054583565845113,0.000157290861153195,0.0015735798615136114,-0.0018913588439276726]},{"t_seconds":0.08,"contact_count":0,"joint_position":[-1.5707733703856688,-1.5675307912623464,1.5741461437908377,-1.5692788754221605,-1.5708000946939844,-3.933858832613544e-09,0.0016005501136004748,0.00015712554471441432,0.0018631917747647037,-0.00216308114465696,0.001600552938923823,0.0001571426750731261,0.0018676527595271142,-0.0021718760191144137]},{"t_seconds":0.1,"contact_count":0,"joint_position":[-1.570779757582699,-1.5668057196807392,1.5748436264305972,-1.568955126115431,-1.5708002711830573,-1.483156795787702e-09,0.0018422797882567403,0.000156989930944716,0.0021042777976758398,-0.002392786781947714,0.001842282329062611,0.00015700479997891623,0.002108723426665396,-0.002401568799110992]},{"t_seconds":0.12,"contact_count":0,"joint_position":[-1.57078515017677,-1.5661516746420001,1.5754726020628222,-1.5686638903154955,-1.5708004258293335,8.833200617693503e-10,0.0020402706313675852,0.00015687486419230248,0.002301772402773157,-0.002580911800404639,0.0020402729210305293,0.0001568883024124376,0.0023062093544044065,-0.002589679199664579]},{"t_seconds":0.14,"contact_count":24,"joint_position":[-1.5707896751218857,-1.5655617270917266,1.5760397827951356,-1.5684019154292659,-1.5708005602491584,3.150522987782772e-09,0.0022024261889008905,0.00015677935672731323,0.0024635347208693697,-0.002734979790122685,0.0022024282449812456,0.00015679159849249697,0.0024679648101024586,-0.0027437347210714194]},{"t_seconds":0.16,"contact_count":24,"joint_position":[-1.5707934512469914,-1.5650295942143408,1.5765512372526758,-1.5681662663675426,-1.5708006769540945,5.316085488674576e-09,0.0023352237337026633,0.0001567002048897131,0.0025960200473671186,-0.0028611475152622856,0.0023352255794032916,0.00015671136791506682,0.002600444188151168,-0.002869892116083907]},{"t_seconds":0.18,"contact_count":24,"joint_position":[-1.5707965829099404,-1.5645496066905238,1.5770124396909708,-1.5679543012093176,-1.5708007782464941,7.3797530539715485e-09,0.002443970726772944,0.00015663457056180953,0.0027045199173757356,-0.0029644593292826706,0.002443972382913418,0.00015664474971177237,0.002708938806989006,-0.0029731954090776985]},{"t_seconds":0.2,"contact_count":24,"joint_position":[-1.5707991610491467,-1.5641166514858968,1.5774283268878007,-1.5677636426639092,-1.5708008661436785,9.342175238504452e-09,0.0025330158954895987,0.0001565800944752221,0.0027933703712451088,-0.0030490483687437113,0.0025330173806787895,0.0001565893741580978,0.0027977845990483936,-0.0030577774246816096]},{"t_seconds":0.22,"contact_count":24,"joint_position":[-1.5708012647859368,-1.56372611743797,1.5778033507563425,-1.5675921516912932,-1.570800942403692,1.1204674705360834e-08,0.002605922331566338,0.00015653483216432145,0.0028661242383604146,-0.003118301093663391,0.002605923662449426,0.00015654328865364312,0.0028705343125429977,-0.0031270243609895698]},{"t_seconds":0.24,"contact_count":24,"joint_position":[-1.5708029628976576,-1.5633738459250723,1.57814152593209,-1.5674379036806672,-1.5708010085572872,1.2969126797487288e-08,0.0026656093550461017,0.00015649718271434476,0.00292569252235531,-0.003174992102661649,0.0026656105465281566,0.00015650488520961342,0.0029300988839857426,-0.0031837106003562805]},{"t_seconds":0.26,"contact_count":24,"joint_position":[-1.5708043151149849,-1.5630560863754772,1.57844647270541,-1.567299166997019,-1.5708010659368368,1.4637860134502809e-08,0.00271446876927163,0.00015646582782151506,0.0029744602890695144,-0.00322139461347014,0.0027144698347195107,0.00015647283924963415,0.0029788633227138903,-0.003230109182287977]},{"t_seconds":0.28,"contact_count":24,"joint_position":[-1.5708053732591114,-1.562769456162712,1.578721455743229,-1.5671743836673098,-1.570801115701679,1.6213568696245826e-08,0.0027544601280273546,0.00015643968148196122,0.0030143816380848822,-0.003259371002897104,0.0027544610794456173,0.00015644605917381784,0.003018781680461156,-0.003268082336698691]},{"t_seconds":0.3,"contact_count":24,"joint_position":[-1.5708061822382375,-1.562510904454361,1.5789694190111543,-1.567062151994471,-1.5708011588602617,1.7699233947189534e-08,0.00278718880316066,0.00015641784865284654,0.003047057530296676,-0.003290447004200704,0.0027871896513447254,0.0001564236449270385,0.003051454877439331,-0.003299155675733568]},{"t_seconds":0.32,"contact_count":24,"joint_position":[-1.570806780920857,-1.5622776796226552,1.5791930172682873,-1.5669612109076816,-1.5708011962894788,1.9098056294461284e-08,0.002813969957360789,0.00015639959130724394,0.003073799565429327,-0.0033158725106575923,0.00281397071203057,0.00015640485397588685,0.0030781944786321376,-0.0033245789927704803]},{"t_seconds":0.34,"contact_count":24,"joint_position":[-1.5708072029011448,-1.5620672998641172,1.5793946444706957,-1.5668704258762076,-1.5708012287515576,2.041339519434388e-08,0.0028358809664081673,0.00015638430055762168,0.003095682245351366,-0.0033366714022420724,0.002835881636324995,0.00015638907336788395,0.0031000749561200833,-0.0033453760853507106]},{"t_seconds":0.36,"contact_count":24,"joint_position":[-1.5708074771697984,-1.5618775267107854,1.5795764593866755,-1.566788776231164,-1.5708012569088003,2.1648717201499854e-08,0.002853804375969715,0.0001563714737610024,0.0031135858014687593,-0.0033536823763704237,0.0028538049690389703,0.00015637579678276452,0.0031179765156562544,-0.0033623855828517814]},{"t_seconds":0.38,"contact_count":24,"joint_position":[-1.5708076287020036,-1.5617063411472272,1.5797404086972497,-1.5667153437549366,-1.5708012813364565,2.2807551252758e-08,0.0028684631016620147,0.0001563606957136885,0.003128231289415244,-0.0033675924063301128,0.0028684636250233667,0.0001563646056808333,0.0031326201906854774,-0.0033762944023715247]},{"t_seconds":0.4,"contact_count":24,"joint_position":[-1.5708076789727141,-1.5615519220760148,1.579888247828591,-1.5666493024119112,-1.5708013025339609,2.3893450491656445e-08,0.0028804492726776493,0.00015635162320053644,0.0031402093468684417,-0.0033789641580106128,0.0028804497327846157,0.00015635515381305095,0.0031445965996086214,-0.0033876651633938572]},{"t_seconds":0.42,"contact_count":24,"joint_position":[-1.570807646408162,-1.5614126268999298,1.5800215597388911,-1.5665899091066766,-1.570801320934739,2.4909959967989377e-08,0.0028902478665136537,0.00015634397229878852,0.0031500037584121865,-0.0033882584555431526,0.002890248269204044,0.00015634715449256017,0.003154389510189798,-0.0033969586517030017]},{"t_seconds":0.44,"contact_count":24,"joint_position":[-1.570807546781409,-1.5612869740121824,1.5801417718603956,-1.5665364953671745,-1.5708013369147673,2.5860589582136943e-08,0.002898256075202436,0.0001563375079437552,0.003158010764892551,-0.0033958526895895578,0.0028982564257606456,0.00015634037013054116,0.0031623951485350867,-0.003404552226261617]},{"t_seconds":0.46,"contact_count":24,"joint_position":[-1.5708073935587836,-1.56117362700663,1.5802501713776578,-1.5664884598604523,-1.570801350800042,2.6748791685266194e-08,0.002904799173695047,0.0001563320353491115,0.0031645548855178977,-0.0034020559007410787,0.002904799476907519,0.00015633460363296677,0.0031689380208808544,-0.003410754901462066]},{"t_seconds":0.48,"contact_count":24,"joint_position":[-1.5708071982031913,-1.5610713804385996,1.58034791900531,-1.5664452616578621,-1.5708013628730917,2.757794279015983e-08,0.002910143521936199,0.0001563273929528449,0.003169901882289343,-0.0034071211383242175,0.002910143782140697,0.00015632969132438885,0.0031742838777658005,-0.003415819704958409]},{"t_seconds":0.5,"contact_count":24,"joint_position":[-1.5708069704395708,-1.5609791469836902,1.580436061412646,-1.566406414174817,-1.5708013733786585,2.8351328891918486e-08,0.0029145072181658697,0.00015632344661390882,0.003174269382696434,-0.00341125558653476,0.002914507439295473,0.0001563254971261248,0.003178650336513136,-0.0034199538030234705]},{"t_seconds":0.52,"contact_count":24,"joint_position":[-1.5708067184871082,-1.5608959458570124,1.580515542427856,-1.5663714797176829,-1.5708013825286509,2.9072133941885758e-08,0.0029180688275585757,0.0001563200848364301,0.003177835583496178,-0.003414628861028233,0.002918069013181027,0.00015632190776462303,0.003182215584827893,-0.0034233267964869094]},{"t_seconds":0.54,"contact_count":24,"joint_position":[-1.570806449262265,-1.56082089236891,1.580587213141735,-1.566340064577096,-1.5708013905064604,2.9743431061541757e-08,0.0029209745337484814,0.00015631721483953408,0.0031807463820571025,-0.0034173798063590675,0.0029209746871013335,0.00015631882882586985,0.003185125511990089,-0.0034260775176343755]},{"t_seconds":0.56,"contact_count":24,"joint_position":[-1.570806168556187,-1.5607531885054402,1.5806518410189179,-1.5663118146130484,-1.5708013974707224,3.0368176123224203e-08,0.002923343998045694,0.00015631475931980526,0.003183121219206623,-0.0034196220649804427,0.0029233441220678936,0.00015631618150562828,0.0031874995515785284,-0.0034283195987673057]},{"t_seconds":0.58,"contact_count":24,"joint_position":[-1.5708058811896186,-1.560692114432915,1.580710118114103,-1.5662864112825468,-1.5708014035585933,3.0949203363557986e-08,0.002925275159732342,0.0001563126537843147,0.0031850578662686643,-0.003421448639668777,0.0029252752570925796,0.00015631389993101214,0.003189435468400026,-0.0034301460342666206]},{"t_seconds":0.6,"contact_count":24,"joint_position":[-1.5708055911480776,-1.5606370208357132,1.5807626684811522,-1.5662635680655412,-1.5708014088886,3.148922273136824e-08,0.002926848168690452,0.00015631084435247596,0.00318663634696323,-0.0034229356311851504,0.0029268482418126377,0.00015631192895178026,0.003191013280299426,-0.003431632917944681]},{"t_seconds":0.62,"contact_count":24,"joint_position":[-1.5708053016997108,-1.5605873220055373,1.58081005485434,-1.5662430272492645,-1.5708014135631234,3.199081870497747e-08,0.002928128607084106,0.000156309285943246,0.003187922150419514,-0.003424145300134862,0.002928128658170338,0.00015631022231856262,0.003192298471096426,-0.0034328425046616312]},{"t_seconds":0.64,"contact_count":24,"joint_position":[-1.5708050154979551,-1.5605424896083266,1.5808527846732305,-1.5662245570350886,-1.570801417670557,3.245645034414083e-08,0.0029291701285202466,0.00015630794077870373,0.00318896886334225,-0.0034251285751330154,0.002929170159571519,0.00015630874117832924,0.003193344622686769,-0.0034338257182776814]},{"t_seconds":0.66,"contact_count":24,"joint_position":[-1.5708047346708753,-1.560502047062308,1.5808913155156565,-1.5662079489355998,-1.5708014212871837,3.2888452370294424e-08,0.002930016619925271,0.0001563067771496469,0.0031898203262594343,-0.003425927107290176,0.0029300166327601187,0.00015630745283164336,0.003194195571233174,-0.0034346242059814544]},{"t_seconds":0.68,"contact_count":24,"joint_position":[-1.5708044608988245,-1.560465564467207,1.5809260599969315,-1.56619301543282,-1.5708014244788084,3.328903709329228e-08,0.0029307039723705046,0.00015630576839437181,0.0031905123998198395,-0.003426574953009089,0.002930703968641935,0.00015630632970565478,0.0031948871734151342,-0.003435272020929346]},{"t_seconds":0.7,"contact_count":24,"joint_position":[-1.5708041954818743,-1.5604326540305338,1.5809573901877343,-1.5661795878714075,-1.5708014273021744,3.3660297026425235e-08,0.0029312615315076483,0.00015630489205543368,0.0031910744116023437,-0.0034270999522532175,0.0029312615127183445,0.00015630534850360705,0.003195448753197157,-0.003435797000407572]},{"t_seconds":0.72,"contact_count":24,"joint_position":[-1.5708039393982836,-1.5604029659421819,1.5809856415979378,-1.5661675145632905,-1.5708014298061925,3.400420805136697e-08,0.0029317132855150676,0.00015630412918110604,0.0031915303411623685,-0.003427524857321236,0.0029317132530312312,0.00015630448950118995,0.0031959042868380115,-0.0034362218945078937]},{"t_seconds":0.74,"contact_count":24,"joint_position":[-1.5708036933551288,-1.5603761846533613,1.5810111167690282,-1.5661566590825415,-1.5708014320330108,3.432263301363802e-08,0.0029320788379975544,0.00015630346374730924,0.003191899790619801,-0.003427868257244375,0.0029320787930614085,0.00015630373596310025,0.0031962733734477076,-0.003436565290444666]},{"t_seconds":0.76,"contact_count":24,"joint_position":[-1.570803457832076,-1.560352025520213,1.5810340885135625,-1.5661468987314213,-1.5708014340189393,3.461732564523551e-08,0.002932374204713933,0.0001563028821782357,0.0031921987795538787,-0.0034281453347434214,0.0029323741484550475,0.00015630307365890775,0.0031965720298546513,-0.0034368423694434783]},{"t_seconds":0.78,"contact_count":24,"joint_position":[-1.570803233119158,-1.5603302317763363,1.581054802836338,-1.566138123160427,-1.5708014357952518,3.4889934725873396e-08,0.0029326124659845897,0.0001563023729487851,0.003192440395958614,-0.0034283684860282678,0.002932612399430151,0.0001563024904607649,0.0031968133415349697,-0.003437065526486478]},{"t_seconds":0.8,"contact_count":24,"joint_position":[-1.5708030193493194,-1.5603105718019883,1.5810734815685468,-1.5661302331269065,-1.5708014373888817,3.514200840732121e-08,0.0029328043008768983,0.00015630192625430177,0.0031926353292905905,-0.003428547828234662,0.002932804224961039,0.00015630197600935875,0.003197007995640703,-0.0034372448777048566]},{"t_seconds":0.82,"contact_count":24,"joint_position":[-1.5708028165263943,-1.5602928366608606,1.5810903247431076,-1.5661231393783326,-1.5708014388230223,3.537499863641595e-08,0.0029329584245509875,0.0001563015337355282,0.0031927923069206654,-0.0034286916148590224,0.0029329583401232337,0.00015630152143517867,0.0031971647174317166,-0.0034373886757765007]},{"t_seconds":0.84,"contact_count":24,"joint_position":[-1.5708026245491005,-1.560276837878205,1.5811055127366087,-1.5661167616477443,-1.5708014401176476,3.559026562269786e-08,0.0029330819462864786,0.00015630118825037963,0.003192918451473625,-0.0034288065757880513,0.002933081854119455,0.0001563011191269022,0.0031972906275973914,-0.0034375036499198664]},{"t_seconds":0.86,"contact_count":24,"joint_position":[-1.5708024432315684,-1.56026240543665,1.5811192082007879,-1.56611102775009,-1.570801441289962,3.5789082305512704e-08,0.0029331806625416657,0.0001563008836833081,0.0031930195733547084,-0.003428898195618575,0.0029331805633380304,0.00015630076253684658,0.0031973915347663843,-0.0034375952841891994]},{"t_seconds":0.88,"contact_count":24,"joint_position":[-1.5708022723208543,-1.5602493859683746,1.581131557804229,-1.566105872769355,-1.5708014423547898,3.597263878297552e-08,0.0029332592968060885,0.00015630061478587426,0.0031931004101976605,-0.003428970941415425,0.002933259191204892,0.00015630044601971295,0.003197472174945694,-0.0034376680452124155]},{"t_seconds":0.9,"contact_count":24,"joint_position":[-1.5708021115118274,-1.5602376411243855,1.5811426938029225,-1.5661012383273607,-1.5708014433249073,3.6142046671841866e-08,0.002933321695879218,0.00015630037704419806,0.0031931648228453228,-0.003429028449063027,0.0029333215844616575,0.00015630016469633624,0.0031975364074825264,-0.003437725568523588]},{"t_seconds":0.92,"contact_count":24,"joint_position":[-1.5708019604597898,-1.5602270461035521,1.5811527354565005,-1.5660970719260399,-1.570801444211336,3.629834337371699e-08,0.0029333709904673473,0.0001563001665671132,0.003193215955721976,-0.0034290736757275424,0.0029333708737620113,0.00015629991434032165,0.003197587375431271,-0.003437770811012808]},{"t_seconds":0.94,"contact_count":24,"joint_position":[-1.5708018187911192,-1.5602174883257387,1.5811617903053152,-1.5660933263558103,-1.5708014450235883,3.6442496227432994e-08,0.002933409726563953,0.00015629997999342087,0.0031932563680590192,-0.003429109024557997,0.0029334096050515506,0.00015629969128179712,0.0031976276367630062,-0.0034378061756081216]},{"t_seconds":0.96,"contact_count":24,"joint_position":[-1.570801686112211,-1.5602088662349092,1.5811699553220298,-1.5660899591634125,-1.5708014457698827,3.657540653237265e-08,0.002933439972908919,0.0001562998144130606,0.0031932881412435944,-0.0034291364466665824,0.002933439847026631,0.0001562994923274353,0.003197659271709289,-0.0034378336132478357]},{"t_seconds":0.98,"contact_count":24,"joint_position":[-1.5708015620169424,-1.5602010882194794,1.5811773179500495,-1.5660869321732418,-1.57080144645733,3.669791343085125e-08,0.0029334634088643294,0.00015629966730118508,0.003193312966626139,-0.0034291575245056606,0.0029334632790097306,0.00015629931469227012,0.003197683970559486,-0.0034378547062564302]},{"t_seconds":1.0,"contact_count":24,"joint_position":[-1.570801446092874,-1.5601940716384184,1.5811839570399189,-1.5660842110568,-1.5708014470920901,3.681079764141515e-08,0.002933481396260039,0.00015629953646282,0.003193332217325863,-0.003429173540030891,0.002933481262794677,0.00015629915594216726,0.0031977031054578166,-0.0034378707364893742]},{"t_seconds":1.02,"contact_count":24,"joint_position":[-1.5708013379263517,-1.5601877419427463,1.5811899436937038,-1.5660817649454386,-1.5708014476795094,3.691478503686844e-08,0.0029334950381185738,0.0001562994199854857,0.003193347006938173,-0.0034291855303893444,0.0029334949013712333,0.00015629901394542111,0.003197717789106684,-0.0034378827410192067]},{"t_seconds":1.04,"contact_count":24,"joint_position":[-1.570801237106674,-1.5601820318830786,1.581195342026401,-1.5660795660820406,-1.5708014482242372,3.701055006401056e-08,0.0029335052266424846,0.00015629931620002936,0.003193358237522678,-0.003429194333425408,0.002933505086912121,0.0001562988868312093,0.0031977289227428938,-0.003437891557645404]},{"t_seconds":1.06,"contact_count":24,"joint_position":[-1.570801143229457,-1.5601768807947847,1.5812002098525326,-1.5660775895077335,-1.570801448730325,3.7098719003349334e-08,0.0029335126824157408,0.00015629922364623715,0.0031933666388171684,-0.0034292006248340654,0.0029335125399742226,0.00015629877295479368,0.003197737235351001,-0.003437897862023564]},{"t_seconds":1.08,"contact_count":24,"joint_position":[-1.570801055899314,-1.560172233953163,1.5812045993052684,-1.5660758127801113,-1.570801449201314,3.7179873069137425e-08,0.002933517986416957,0.00015629914104502593,0.0031933728002717355,-0.003429204948507238,0.0029335178415114535,0.00015629867086724714,0.0031977433156890867,-0.003437902198030706]},{"t_seconds":1.1,"contact_count":24,"joint_position":[-1.570800974731947,-1.5601680419917696,1.581208557394716,-1.566074215719801,-1.5708014496403078,3.7254551350958974e-08,0.00293352160615306,0.0001562990672733534,0.0031933771972121818,-0.0034292077412793258,0.0029335214590083284,0.00015629857929020386,0.0031977476384483067,-0.0034379050024957204]},{"t_seconds":1.12,"contact_count":24,"joint_position":[-1.57080089935575,-1.5601642603777155,1.5812121265113472,-1.566072780182525,-1.5708014500500342,3.732325359970918e-08,0.0029335239169842515,0.00015629900134389615,0.0031933802121953663,-0.003429209353128946,0.0029335237678046223,0.00015629849709348104,0.0031977505856016653,-0.0034379066253938354]},{"t_seconds":1.14,"contact_count":24,"joint_position":[-1.5708008294129892,-1.5601608489383507,1.5812153448799564,-1.5660714898540964,-1.570801450432901,3.738644286120399e-08,0.002933525219517376,0.00015629894238703462,0.003193382152439606,-0.0034292100636361977,0.002933525068488617,0.00015629842327664342,0.00319775246383271,-0.0034379073463164252]},{"t_seconds":1.16,"contact_count":24,"joint_position":[-1.570800764560631,-1.560157771434304,1.5812182469690106,-1.5660703300660455,-1.5708014507910388,3.744454796167576e-08,0.0029335257537853555,0.0001562988896355884,0.003193383264037598,-0.003429210095402061,0.0029335256010763664,0.00015629835695292444,0.003197753518744734,-0.0034379073878765365]},{"t_seconds":1.18,"contact_count":24,"joint_position":[-1.570800704470882,-1.5601549951743354,1.5812208638597751,-1.5660692876297961,-1.5708014511263437,3.7497965849983906e-08,0.0029335257107999213,0.00015629884241204252,0.003193383743548389,-0.003429209624967544,0.002933525556564231,0.0001562982973347622,0.0031977539464455194,-0.0034379069266386687]},{"t_seconds":1.2,"contact_count":24,"joint_position":[-1.570800648831476,-1.5601524906679078,1.5812232235791666,-1.5660683506875375,-1.5708014514405066,3.754706380124241e-08,0.0029335252419585172,0.00015629880011701136,0.003193383747438017,-0.003429208791709583,0.002933525086335688,0.00015629824372192898,0.003197753902988833,-0.0034379061019951056]},{"t_seconds":1.22,"contact_count":24,"joint_position":[-1.570800597345765,-1.5601502313117814,1.5812253513998973,-1.566067508578105,-1.5708014517350446,3.7592181487709956e-08,0.002933524466698475,0.00015629876221947496,0.003193383399770215,-0.0034292077050641005,0.00293352430981537,0.0001562981954913679,0.0031977535120602998,-0.003437905023407658]},{"t_seconds":1.24,"contact_count":24,"joint_position":[-1.570800549732643,-1.5601481931073011,1.581227270111126,-1.56606675171636,-1.5708014520113232,3.763363292225838e-08,0.002933523478720386,0.00015629872824857603,0.0031933827984629752,-0.0034292064504017556,0.0029335233206923238,0.00015629815208769153,0.0031977528712301847,-0.0034379037762689024]},{"t_seconds":1.26,"contact_count":24,"joint_position":[-1.570800505726334,-1.5601463544053675,1.5812290002625133,-1.566066071484719,-1.5708014522705782,3.767170828017233e-08,0.002933522351043429,0.00015629869778638878,0.0031933820203758363,-0.0034292050937942916,0.002933522191975205,0.0001562981130155086,0.0031977520570400674,-0.0034379024266793772]},{"t_seconds":1.28,"contact_count":24,"joint_position":[-1.5708004650760778,-1.5601446956763823,1.5812305603842938,-1.5660654601356028,-1.5708014525139316,3.770667560497317e-08,0.0029335211401080043,0.0001562986704610436,0.003193381125442683,-0.003429203685880496,0.002933520980094884,0.00015629807783234468,0.0031977511291329283,-0.003437901025301209]},{"t_seconds":1.3,"contact_count":24,"joint_position":[-1.5708004275457277,-1.5601431993027233,1.5812319671857225,-1.5660649107037112,-1.5708014527424072,3.773878240436561e-08,0.0029335198891019985,0.00015629864594213065,0.0031933801600286444,-0.0034292022649905483,0.002933519728230547,0.00015629804614279618,0.0031977501336056748,-0.003437899610495685]},{"t_seconds":1.32,"contact_count":24,"joint_position":[-1.5708003929132839,-1.56014184939154,1.581233235734021,-1.5660644169271307,-1.570801452956943,3.7768257141229016e-08,0.002933518630653352,0.00015629862393508806,0.003193379159645361,-0.003429200859690884,0.0029335184690022437,0.00015629801759305272,0.003197749105726689,-0.003437898210847671]},{"t_seconds":1.34,"contact_count":24,"joint_position":[-1.5708003609703822,-1.560140631605879,1.5812343796157386,-1.5660639731763926,-1.5708014531584014,3.7795310626089235e-08,0.0029335173890076183,0.00015629860417759587,0.003193378151158947,-0.00342919949081015,0.0029335172266483417,0.0001562979918663204,0.0031977480721364923,-0.0034378968472138977]},{"t_seconds":1.36,"contact_count":24,"joint_position":[-1.5708003315217427,-1.560139533012348,1.5812354110822573,-1.5660635743906741,-1.5708014533475783,3.782013731583797e-08,0.002933516181785592,0.00015629858643542287,0.0031933771545655494,-0.0034291981730999012,0.002933516018783119,0.00015629796867895802,0.003197747052626723,-0.0034378955343727672]},{"t_seconds":1.38,"contact_count":24,"joint_position":[-1.5708003043846002,-1.560138541943697,1.581236341180998,-1.5660632160204333,-1.5708014535252122,3.784291652431049e-08,0.00293351502139975,0.00015629857049958892,0.003193376184431987,-0.0034291969165564677,0.002933514857813108,0.00015629794777642194,0.0031977460615767177,-0.0034378942823424484]},{"t_seconds":1.4,"contact_count":24,"joint_position":[-1.5708002793881213,-1.5601376478748523,1.5812371798737337,-1.5660628939758179,-1.570801453691989,3.78638135498976e-08,0.002933513916193419,0.00015629855618333065,0.003193375251054022,-0.003429195727484113,0.002933513752076243,0.00015629792893037756,0.003197745109109202,-0.0034378930974482908]},{"t_seconds":1.42,"contact_count":24,"joint_position":[-1.5708002563728134,-1.5601368413110905,1.5812379361432758,-1.5660626045802772,-1.5708014538485475,3.788298072479487e-08,0.0029335128713548517,0.00015629854331989783,0.003193374361389841,-0.0034291946093435314,0.002933512706755871,0.00015629791193604974,0.0031977442020245965,-0.0034378919831756652]},{"t_seconds":1.44,"contact_count":24,"joint_position":[-1.5708002351899382,-1.5601361136871643,1.5812386180896767,-1.5660623445288513,-1.5708014539954855,3.790055839107789e-08,0.002933511889648326,0.00015629853175979839,0.0031933735198042584,-0.003429193563440546,0.0029335117246118126,0.0001562978966092397,0.0031977433445451215,-0.003437890940849085]},{"t_seconds":1.46,"contact_count":24,"joint_position":[-1.5708002157009295,-1.5601354572763015,1.5812392330169787,-1.566062110850661,-1.5708014541333626,3.791667580772199e-08,0.002933510971998076,0.0001562985213695023,0.003193372728672305,-0.003429192589457309,0.002933510806564255,0.00015629788278473036,0.003197742538912369,-0.0034378899701708377]},{"t_seconds":1.48,"contact_count":24,"joint_position":[-1.570800197776825,-1.5601348651081168,1.581239787511439,-1.5660619008751813,-1.5708014542627042,3.793145199312995e-08,0.0029335101179517745,0.0001562985120293797,0.0031933719888534704,-0.003429191685884318,0.002933509952157185,0.00015629787031377733,0.00319774178586567,-0.003437889069649648]},{"t_seconds":1.5,"contact_count":24,"joint_position":[-1.5708001812977093,-1.5601343308945599,1.5812402875120664,-1.5660617122019167,-1.5708014543840048,3.794499650731523e-08,0.0029335093260479117,0.00015629850363225973,0.0031933713000739826,-0.00342919085035762,0.002933509159925745,0.0001562978590627343,0.0031977410850206646,-0.0034378882369409856]},{"t_seconds":1.52,"contact_count":24,"joint_position":[-1.570800166152176,-1.560133848963116,1.5812407383742269,-1.5660615426731317,-1.5708014544977298,3.795741017736797e-08,0.0029335085941049515,0.00015629849608204597,0.0031933706612257786,-0.0034291900799270415,0.0029335084276853537,0.00015629784891114855,0.0031977404351681313,-0.003437887469110574]},{"t_seconds":1.54,"contact_count":24,"joint_position":[-1.5708001522368094,-1.5601334141965426,1.5812411449269987,-1.566061390349335,-1.5708014546043172,3.79687857703972e-08,0.002933507919448048,0.00015629848929267943,0.003193370070604135,-0.0034291893712600297,0.0029335077527584117,0.0001562978397509951,0.003197739834512126,-0.003437886762839305]},{"t_seconds":1.56,"contact_count":24,"joint_position":[-1.5708001394556832,-1.5601330219785114,1.5812415115248923,-1.5660612534872342,-1.5708014547041822,3.79792086170244e-08,0.0029335072990850043,0.00015629848318688043,0.0031933695260956624,-0.0034291887207936636,0.0029335071321501967,0.00015629783148467266,0.003197739280853912,-0.0034378861145813646]},{"t_seconds":1.58,"contact_count":24,"joint_position":[-1.5708001277198846,-1.5601326681445697,1.5812418420944854,-1.5660611305199148,-1.5708014547977158,3.7988757188893365e-08,0.002933506729842275,0.00015629847769547627,0.0031933690253200015,-0.003429188124866602,0.0029335065626848863,0.0001562978240245103,0.003197738771736154,-0.003437885520691385]},{"t_seconds":1.6,"contact_count":24,"joint_position":[-1.5708001169470573,-1.5601323489379035,1.5812421401764776,-1.56606102003902,-1.5708014548852873,3.799750363351069e-08,0.002933506208468353,0.00015629847275613903,0.00319336856574202,-0.0034291875798084072,0.002933506041108905,0.0001562978172913897,0.003197738304553531,-0.0034378849775058284]},{"t_seconds":1.62,"contact_count":24,"joint_position":[-1.5708001070609698,-1.5601320609694322,1.5812424089636108,-1.566060920778727,-1.570801454967247,3.8005514269025155e-08,0.0029335057317118936,0.00015629846831303166,0.003193368144758754,-0.0034291870820018174,0.002933505564169021,0.0001562978112140949,0.003197737876637906,-0.0034378844814244463]},{"t_seconds":1.64,"contact_count":24,"joint_position":[-1.5708000979911019,-1.5601318011818073,1.5812426513348632,-1.5660608316013447,-1.570801455043926,3.8012850042005545e-08,0.0029335052963793723,0.0001562984643162812,0.0031933677597622916,-0.003429186627938013,0.0029335051286699916,0.0001562978057285743,0.0031977374853229285,-0.0034378840289473957]},{"t_seconds":1.66,"contact_count":24,"joint_position":[-1.5708000896722571,-1.560131566816941,1.5812428698862853,-1.5660607514843585,-1.5708014551156368,3.801956695071495e-08,0.0029335048993762514,0.00015629846072067705,0.0031933674081863,-0.0034291862142472947,0.0029335047315157308,0.0001562978007767983,0.0031977371279885824,-0.0034378836167155277]},{"t_seconds":1.68,"contact_count":24,"joint_position":[-1.5708000820441932,-1.5601313553867109,1.581243066958802,-1.5660606795087881,-1.5708014551826759,3.802571643620089e-08,0.002933504537736315,0.00015629845748580106,0.003193367087542235,-0.003429185837725373,0.002933504369738602,0.0001562977963066447,0.0031977368020970976,-0.003437883241537149]},{"t_seconds":1.7,"contact_count":24,"joint_position":[-1.5708000750512783,-1.5601311646465295,1.5812432446632847,-1.566060614848719,-1.5708014552453233,3.803134574380661e-08,0.0029335042086407136,0.00015629845457530776,0.0031933667954428292,-0.0034291854953472007,0.0029335040405184874,0.00015629779227129258,0.0031977365052159694,-0.0034378829003914356]},{"t_seconds":1.72,"contact_count":24,"joint_position":[-1.5708000686421613,-1.5601309925715083,1.5812434049031612,-1.566060556761892,-1.5708014553038445,3.803649825681554e-08,0.002933503909429339,0.00015629845195661599,0.003193366529616905,-0.003429185184266394,0.002933503741194095,0.00015629778862813503,0.003197736235033732,-0.0034378825904433194]},{"t_seconds":1.74,"contact_count":24,"joint_position":[-1.570800062769469,-1.5601308373349505,1.5812435493947983,-1.56606050458124,-1.5708014553584893,3.804121380464044e-08,0.002933503637606613,0.00015629844960044002,0.003193366287921171,-0.003429184901831042,0.0029335034692688,0.00015629778533899854,0.0031977359893688145,-0.0034378823090467176]},{"t_seconds":1.76,"contact_count":24,"joint_position":[-1.5708000573895158,-1.5601306972889504,1.5812436796858882,-1.566060457707284,-1.5708014554094958,3.80455289471348e-08,0.002933503390842758,0.00015629844748027132,0.003193366068343144,-0.0034291846455700987,0.002933503222411854,0.0001562977823693681,0.0031977357661755437,-0.0034378820537413245]},{"t_seconds":1.78,"contact_count":24,"joint_position":[-1.5708000524620371,-1.5601305709468918,1.5812437971720235,-1.5660604156012952,-1.5708014554570875,3.804947723697952e-08,0.0029335031669719485,0.00015629844557242916,0.0031933658690040194,-0.0034291844131918436,0.0029335029984565685,0.00015629777968818664,0.003197735563543083,-0.0034378818222403386]},{"t_seconds":1.8,"contact_count":24,"joint_position":[-1.5708000479499364,-1.5601304569676604,1.5812439031116425,-1.5660603777791455,-1.5708014555014762,3.8053089461508954e-08,0.0029335029639877366,0.00015629844385575207,0.0031933656881556207,-0.0034291842025852095,0.0029335027953956896,0.0001562977772673767,0.0031977353796956228,-0.003437881612436856]},{"t_seconds":1.82,"contact_count":24,"joint_position":[-1.5708000438190493,-1.5601303541414016,1.5812439986395117,-1.5660603438057845,-1.5708014555428613,3.805639386583951e-08,0.0029335027800370243,0.00015629844231087307,0.0031933655241787994,-0.003429184011799115,0.0029335026113754075,0.00015629777508150005,0.00319773521298726,-0.003437881422388708]},{"t_seconds":1.84,"contact_count":24,"joint_position":[-1.570800040037927,-1.560130261376672,1.5812440847788765,-1.5660603132902715,-1.5708014555814322,3.805941635844068e-08,0.002933502613413107,0.00015629844092062778,0.003193365375578104,-0.0034291838390413396,0.0029335024446883605,0.0001562977731078287,0.003197735061899334,-0.0034378812503082015]},{"t_seconds":1.86,"contact_count":24,"joint_position":[-1.5708000365776282,-1.5601301776888494,1.581244162452422,-1.5660602858813077,-1.5708014556173666,3.8062180700475176e-08,0.0029335024625474805,0.00015629843966956502,0.003193365240974831,-0.0034291836826712985,0.0029335022937654488,0.0001562977713256658,0.003197734925030757,-0.003437881094556318]},{"t_seconds":1.88,"contact_count":24,"joint_position":[-1.570800033411532,-1.560130102189676,1.581244232492156,-1.5660602612632246,-1.5708014556508325,3.806470868036748e-08,0.002933502326001681,0.00015629843854362692,0.0031933651191026753,-0.0034291835411791763,0.002933502157167681,0.000156297769716476,0.0031977348010959407,-0.003437880953633867]},{"t_seconds":1.9,"contact_count":24,"joint_position":[-1.5708000305151582,-1.5601300340778288,1.5812442956483184,-1.566060239152377,-1.5708014556819878,3.806702027433496e-08,0.0029335022024588515,0.00015629843753048355,0.0031933650088002085,-0.0034291834131937164,0.002933502033577681,0.0001562977682633415,0.003197734688915638,-0.0034378808261698733]},{"t_seconds":1.92,"contact_count":24,"joint_position":[-1.5708000278660044,-1.560129972630407,1.5812443525974185,-1.5660602192938957,-1.5708014557109817,3.8069133794461465e-08,0.002933502090715267,0.00015629843661856783,0.0031933649090027205,-0.003429183297456475,0.0029335019217913132,0.00015629776695118722,0.0031977345874093428,-0.003437880710909466]},{"t_seconds":1.94,"contact_count":24,"joint_position":[-1.5708000254433925,-1.560129917195259,1.5812444039494808,-1.5660602014587774,-1.5708014557379548,3.807106602475768e-08,0.002933501989672291,0.0001562984357979408,0.003193364818738423,-0.003429183192823255,0.002933501820709515,0.0001562977657663061,0.003197734495589206,-0.0034378806067118877]},{"t_seconds":1.96,"contact_count":24,"joint_position":[-1.5708000232283263,-1.5601298671840562,1.5812444502545782,-1.5660601854412597,-1.5708014557630392,3.807283234632391e-08,0.0029335018983282462,0.00015629843505936822,0.0031933647371196103,-0.0034291830982488675,0.0029335017293302445,0.00015629776469625156,0.003197734412554287,-0.0034378805125381703]},{"t_seconds":1.98,"contact_count":24,"joint_position":[-1.5708000212033613,-1.5601298220660464,1.581244492008723,-1.5660601710564688,-1.5708014557863594,3.8074446852771176e-08,0.002933501815771053,0.0001562984343947081,0.0031933646633378805,-0.0034291830127849603,0.0029335016467410984,0.00015629776373003054,0.003197734337483269,-0.0034378804274411293]},{"t_seconds":2.0,"contact_count":24,"joint_position":[-1.570800019352482,-1.5601297813624195,1.5812445296591824,-1.566060158138301,-1.5708014558080312,3.807592245607478e-08,0.0029335017411708424,0.00015629843379651688,0.003193364596655075,-0.0034291829355693696,0.0029335015721119015,0.00015629776285750512,0.0031977342696276594,-0.0034378803505609222]}],"motion_binary":{"href":"motion.bin.gz","compression":"gzip","bytes":79184,"compressed_bytes":35893,"sha256":"48ae836c5e0d1bec6cc354d03c107cc67f791ce33faffa5096e367c85661d20a"}} diff --git a/asset-library/v01/previews/ur5e/preview-integrity.json b/asset-library/v01/previews/ur5e/preview-integrity.json new file mode 100644 index 0000000000000000000000000000000000000000..209ca8a515e8461156dc6a504ab579d5835ccb0e --- /dev/null +++ b/asset-library/v01/previews/ur5e/preview-integrity.json @@ -0,0 +1,78 @@ +{ + "schema": "dvidia.asset-preview-integrity/v1", + "scope": "Artifact consistency only, not authenticity or physical qualification", + "files": { + "scene.json": { + "bytes": 289, + "sha256": "5d94197873f27b62431cf1b512c9622d72882c6bc22b4b11a190bdaf3fb04b13" + }, + "catalog.json": { + "bytes": 25194, + "sha256": "82e44bf83ca4c64051b5dc99ca0d301cb416dfee6dc043e86582d6fd4fa490ba" + }, + "model.json": { + "bytes": 32333, + "sha256": "6a5343662febdb5a384451cc3beaac4b14f6c380c7f7bf8d7d4dd0a27e4456ef" + }, + "motion.json": { + "bytes": 36560, + "sha256": "af3fede2c17b482325e0c4211bac4cead2fee6221b05cc4bbf0599011cd3aad6" + }, + "geometry.bin.gz": { + "bytes": 1831265, + "sha256": "cc162219dac340db4c663b34b3e54b0e5574679a7f737fa90853129d8a68978f" + }, + "motion.bin.gz": { + "bytes": 35893, + "sha256": "057273906b6c4feb3872570b7d4ba845d453bc67cb08a70b012a7375ead9ab75" + }, + "index.html": { + "bytes": 9636, + "sha256": "41a97a426a2b72520e39a469eaa78f4b281c7fef9cf9607301af9c398594251f" + }, + "asset_library.bundle.js": { + "bytes": 529697, + "sha256": "fe7a98bf9b991a33d030114b9e447bd687230a9dbc381631fd316da408857ee9" + }, + "reference_replay.third-party.txt": { + "bytes": 1199, + "sha256": "ea4da6cf7a8a54649702f0eb8d057c8ced12f8fed2329c5e96d92a3316922813" + }, + "LICENSE": { + "bytes": 1076, + "sha256": "ab47d245880a661fdca3c6a4cb91671031302deee50d64f8d2d6df86832962e1" + }, + "licenses/universal_robots_ur5e/LICENSE": { + "bytes": 1470, + "sha256": "5ec71ccf66c8d03261448f2441a586765b97f2248c860a1ae19689fb1c45cee6" + }, + "licenses/universal_robots_ur5e/README.md": { + "bytes": 1689, + "sha256": "435600d4f00cfdbd7edec4b60f0cd7fbb539f39abaefcd8bb3994beed3b1156a" + }, + "licenses/robotiq_2f85/LICENSE": { + "bytes": 1297, + "sha256": "3d5edd18d1e22a17666e9bb84270171ed5ac90b192d24e0177fd171708ea2316" + }, + "licenses/robotiq_2f85/README.md": { + "bytes": 1367, + "sha256": "a10f34027d417f8f7b9102b74b42976031f0246f3090444728ab322bc4632aaf" + }, + "scenes/trainer.json": { + "bytes": 221, + "sha256": "03e3e4ae0042df9387485642381fd090e80b446fda818136a2f3be78ceb2c9b4" + }, + "scenes/ankle-boot.json": { + "bytes": 227, + "sha256": "750f72fed16daac3c65263d90d633675b8a7832ddd1f163b2c4a7982037faaf1" + }, + "scenes/slipper.json": { + "bytes": 221, + "sha256": "21fff791ad71ebf89cb298af41b91c7b4520618c2aa978550f6765d90cc1b079" + }, + "README.md": { + "bytes": 897, + "sha256": "195849dd9df960ae7e42a29433c46c810132f52154ccc0ef3df79649d5aa89af" + } + } +} diff --git a/asset-library/v01/previews/ur5e/reference_replay.third-party.txt b/asset-library/v01/previews/ur5e/reference_replay.third-party.txt new file mode 100644 index 0000000000000000000000000000000000000000..90689e3bf3feb75cb7e7fb0e72cd389e508c35a5 --- /dev/null +++ b/asset-library/v01/previews/ur5e/reference_replay.third-party.txt @@ -0,0 +1,26 @@ +DVIDIA self-hosted reference replay + +Three.js 0.180.0 and OrbitControls +https://github.com/mrdoob/three.js/tree/r180 + +The MIT License + +Copyright © 2010-2025 three.js authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/asset-library/v01/previews/ur5e/scene.json b/asset-library/v01/previews/ur5e/scene.json new file mode 100644 index 0000000000000000000000000000000000000000..ba68cebbad2a6ec8d89c60c66b1785cb8856651e --- /dev/null +++ b/asset-library/v01/previews/ur5e/scene.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-scene/v1","catalog_version":"0.1.0","catalog_sha256":"592f363389a96fef7f9223737aa72a2f1a74f400238924bf6790ec5bfd3302b7","robot":"ur5e","shoe_ids":["trainer-left","trainer-right","ankle-boot-left","ankle-boot-right","slipper-left","slipper-right"],"timestep":0.002} diff --git a/asset-library/v01/previews/ur5e/scenes/ankle-boot.json b/asset-library/v01/previews/ur5e/scenes/ankle-boot.json new file mode 100644 index 0000000000000000000000000000000000000000..6df900af99d9be86fa6df87be4aed605633403d1 --- /dev/null +++ b/asset-library/v01/previews/ur5e/scenes/ankle-boot.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-scene/v1","catalog_version":"0.1.0","catalog_sha256":"592f363389a96fef7f9223737aa72a2f1a74f400238924bf6790ec5bfd3302b7","robot":"ur5e","shoe_ids":["ankle-boot-left","ankle-boot-right"],"timestep":0.002} diff --git a/asset-library/v01/previews/ur5e/scenes/slipper.json b/asset-library/v01/previews/ur5e/scenes/slipper.json new file mode 100644 index 0000000000000000000000000000000000000000..ee99606c5676805d6f999049b46c2a034bb6f76c --- /dev/null +++ b/asset-library/v01/previews/ur5e/scenes/slipper.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-scene/v1","catalog_version":"0.1.0","catalog_sha256":"592f363389a96fef7f9223737aa72a2f1a74f400238924bf6790ec5bfd3302b7","robot":"ur5e","shoe_ids":["slipper-left","slipper-right"],"timestep":0.002} diff --git a/asset-library/v01/previews/ur5e/scenes/trainer.json b/asset-library/v01/previews/ur5e/scenes/trainer.json new file mode 100644 index 0000000000000000000000000000000000000000..f032508c8a2f7420ac8b2da95b999a8412332826 --- /dev/null +++ b/asset-library/v01/previews/ur5e/scenes/trainer.json @@ -0,0 +1 @@ +{"schema":"dvidia.asset-scene/v1","catalog_version":"0.1.0","catalog_sha256":"592f363389a96fef7f9223737aa72a2f1a74f400238924bf6790ec5bfd3302b7","robot":"ur5e","shoe_ids":["trainer-left","trainer-right"],"timestep":0.002} diff --git a/asset-library/v01/provenance.json b/asset-library/v01/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..e287f548f058b09e545be2659d40a389612be7cd --- /dev/null +++ b/asset-library/v01/provenance.json @@ -0,0 +1,13 @@ +{ + "schema": "dvidia.asset-library-release/v0.1", + "source_commit": "45bef6315c9632b33915e1ce993babd2926b8f7d", + "benchmark_source_commit": "441ee2871620104246ab9caeb89825f12a14b889", + "robots": [ + "ur5e", + "piper", + "so101" + ], + "physical_robot_ready": false, + "learned_policy": false, + "scope": "Original synthetic rigid shoe scene assets. Native gravity/support tests and recorded previews; no shoe skill or measured physical calibration." +} diff --git a/index.html b/index.html index cbb5d7cedaaabc48bf03e8d56e9c090a40968fa4..155c3d614870d1ad88c97fefebb3be586351cee1 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@
DVIDIA · ROBOT SIMULATION LAB

See the motion. Inspect the evidence.

A native six-joint arm, an articulated gripper and a free rigid object. Recorded task attempts make the simulator's behavior visible, and the complete receipts make its limits checkable.

This is recorded simulation from an authored controller with privileged simulator state. The browser does not run physics or connect to hardware. Learned skills, shoe manipulation and physical transfer remain future stages.

Frozen confirmation cohort: 18 planned attempts across 6 synthetic scenes. Counts are descriptive, with no population or physical reliability claim.
nominal / placement: 4/4 completed, 4 numerically valid
nominal / replay_open_jaw: 0/4 completed, 4 numerically valid
nominal / hold: 0/4 completed, 4 numerically valid
low_friction / placement: 2/2 completed, 2 numerically valid
low_friction / replay_open_jaw: 0/2 completed, 2 numerically valid
low_friction / hold: 0/2 completed, 2 numerically valid
-

Native grasp, carry and release.

Use orbit, zoom, recorded motion selection and the timeline inside the viewer. Replay is an excerpt; the full benchmark includes every matched control and invalid attempt. The native meshes, binary poses, complete receipts and license notices are served locally by this Space.

+

The shoe asset library is runnable.

Choose one of three robot profiles, inspect six original rigid shoe proxies, download a reusable scene and run CPU simulation locally. Synthetic properties are labelled as assumptions; gravity/support benchmarks retain every attempt and matched control.

Open the asset library →

Native grasp, carry and release.

Use orbit, zoom, recorded motion selection and the timeline inside the viewer. Replay is an excerpt; the full benchmark includes every matched control and invalid attempt. The native meshes, binary poses, complete receipts and license notices are served locally by this Space.

Hardware profiles and the next experiments.

A native mechanics benchmark establishes model structure and recorded motion. A native task benchmark adds measured contact outcomes. Neither establishes hardware reliability or a learned motor policy. Upcoming profiles have no verified implementation claim.

Run it on your own machine.

The native task is a local CPU workload. Fetch the pinned dependencies and assets once, then simulate offline. WebGL2 supports viewing; no hosted inference or paid GPU server is requested by this static Space. Minimum RAM and arbitrary-dataset speed guarantees remain unmeasured.

diff --git a/provenance.json b/provenance.json index 24cc8d7b1cd2d689f87c7276347e467958cbfeb6..aa73e5501687558504675fbfcb2609f07a2fdf71 100644 --- a/provenance.json +++ b/provenance.json @@ -7283,5 +7283,14 @@ "decoded_bytes": 340992724 } }, - "profile_gallery": "UR5e replay and explicitly supplied PiPER pilot have authored contact-task evidence; separate PiPER/SO-101 numerical bundles remain unloaded mechanics evidence; all remaining profiles stay upcoming" + "profile_gallery": "UR5e replay and explicitly supplied PiPER pilot have authored contact-task evidence; separate PiPER/SO-101 numerical bundles remain unloaded mechanics evidence; all remaining profiles stay upcoming", + "asset_library": { + "path": "asset-library/v01", + "source_commit": "45bef6315c9632b33915e1ce993babd2926b8f7d", + "benchmark_source_commit": "441ee2871620104246ab9caeb89825f12a14b889", + "integrity": { + "bytes": 9618, + "sha256": "066dc8ca9a63fae3b541468ad13e3fe1e582000c6a02c0874eae381e64f3c00f" + } + } }