├── .editorconfig ├── .gitignore ├── .parcelrc ├── README.md ├── package.json ├── src ├── index.html └── js │ ├── index.js │ ├── tools │ ├── index.js │ └── pubsub.js │ └── webgl │ ├── SceneManager.js │ ├── VFX │ ├── SpeedPass │ │ ├── SpeedPass.js │ │ ├── fragmentShader.glsl │ │ └── vertexShader.glsl │ └── VFX.js │ ├── sceneSubjects │ ├── Floor │ │ ├── Floor.js │ │ ├── fragment.glsl │ │ └── vertex.glsl │ └── Guy.js │ ├── shaders │ ├── fragmentShader.glsl │ └── vertexShader.glsl │ └── tools │ ├── GLTFLoader.js │ ├── LoadingManager.js │ └── index.js └── static ├── code_icon.svg ├── draco ├── draco_decoder.wasm └── draco_wasm_wrapper.js ├── grid.png └── grid.webp /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = false 9 | insert_final_newline = false -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/node,linux,macos,windows,webstorm,sublimetext,visualstudio,visualstudiocode 3 | 4 | ### Linux ### 5 | *~ 6 | 7 | # temporary files which can be created if a process still has a handle open of a deleted file 8 | .fuse_hidden* 9 | 10 | # KDE directory preferences 11 | .directory 12 | 13 | # Linux trash folder which might appear on any partition or disk 14 | .Trash-* 15 | 16 | # .nfs files are created when an open file is removed but is still being accessed 17 | .nfs* 18 | 19 | ### macOS ### 20 | # General 21 | .DS_Store 22 | .AppleDouble 23 | .LSOverride 24 | 25 | # Icon must end with two \r 26 | Icon 27 | 28 | # Thumbnails 29 | ._* 30 | 31 | # Files that might appear in the root of a volume 32 | .DocumentRevisions-V100 33 | .fseventsd 34 | .Spotlight-V100 35 | .TemporaryItems 36 | .Trashes 37 | .VolumeIcon.icns 38 | .com.apple.timemachine.donotpresent 39 | 40 | # Directories potentially created on remote AFP share 41 | .AppleDB 42 | .AppleDesktop 43 | Network Trash Folder 44 | Temporary Items 45 | .apdisk 46 | 47 | ### Node ### 48 | # Logs 49 | logs 50 | *.log 51 | npm-debug.log* 52 | yarn-debug.log* 53 | yarn-error.log* 54 | 55 | # Locks 56 | *.lock 57 | 58 | # Runtime data 59 | pids 60 | *.pid 61 | *.seed 62 | *.pid.lock 63 | 64 | # Directory for instrumented libs generated by jscoverage/JSCover 65 | lib-cov 66 | 67 | # Coverage directory used by tools like istanbul 68 | coverage 69 | 70 | # nyc test coverage 71 | .nyc_output 72 | 73 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 74 | .grunt 75 | 76 | # Bower dependency directory (https://bower.io/) 77 | bower_components 78 | 79 | # node-waf configuration 80 | .lock-wscript 81 | 82 | # Compiled binary addons (https://nodejs.org/api/addons.html) 83 | build/Release 84 | 85 | # Dependency directories 86 | node_modules/ 87 | jspm_packages/ 88 | 89 | # TypeScript v1 declaration files 90 | typings/ 91 | 92 | # Optional npm cache directory 93 | .npm 94 | 95 | # Optional eslint cache 96 | .eslintcache 97 | 98 | # Optional REPL history 99 | .node_repl_history 100 | 101 | # Output of 'npm pack' 102 | *.tgz 103 | 104 | # Yarn Integrity file 105 | .yarn-integrity 106 | 107 | # dotenv environment variables file 108 | .env 109 | 110 | # parcel-bundler strcture (https://parceljs.org/) 111 | .cache 112 | .cache/**/* 113 | .parcel-cache 114 | .parcel-cache/**/* 115 | build 116 | dist 117 | 118 | # next.js build output 119 | .next 120 | 121 | # nuxt.js build output 122 | .nuxt 123 | 124 | # vuepress build output 125 | .vuepress/dist 126 | 127 | # Serverless directories 128 | .serverless 129 | 130 | ### SublimeText ### 131 | # Cache files for Sublime Text 132 | *.tmlanguage.cache 133 | *.tmPreferences.cache 134 | *.stTheme.cache 135 | 136 | # Workspace files are user-specific 137 | *.sublime-workspace 138 | 139 | # Project files should be checked into the repository, unless a significant 140 | # proportion of contributors will probably not be using Sublime Text 141 | # *.sublime-project 142 | 143 | # SFTP configuration file 144 | sftp-config.json 145 | 146 | # Package control specific files 147 | Package Control.last-run 148 | Package Control.ca-list 149 | Package Control.ca-bundle 150 | Package Control.system-ca-bundle 151 | Package Control.cache/ 152 | Package Control.ca-certs/ 153 | Package Control.merged-ca-bundle 154 | Package Control.user-ca-bundle 155 | oscrypto-ca-bundle.crt 156 | bh_unicode_properties.cache 157 | 158 | # Sublime-github package stores a github token in this file 159 | # https://packagecontrol.io/packages/sublime-github 160 | GitHub.sublime-settings 161 | 162 | ### VisualStudioCode ### 163 | .vscode/* 164 | !.vscode/settings.json 165 | !.vscode/tasks.json 166 | !.vscode/launch.json 167 | !.vscode/extensions.json 168 | 169 | ### WebStorm ### 170 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm 171 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 172 | 173 | # User-specific stuff 174 | .idea/**/workspace.xml 175 | .idea/**/tasks.xml 176 | .idea/**/usage.statistics.xml 177 | .idea/**/dictionaries 178 | .idea/**/shelf 179 | 180 | # Generated files 181 | .idea/**/contentModel.xml 182 | 183 | # Sensitive or high-churn files 184 | .idea/**/dataSources/ 185 | .idea/**/dataSources.ids 186 | .idea/**/dataSources.local.xml 187 | .idea/**/sqlDataSources.xml 188 | .idea/**/dynamic.xml 189 | .idea/**/uiDesigner.xml 190 | .idea/**/dbnavigator.xml 191 | 192 | # Gradle 193 | .idea/**/gradle.xml 194 | .idea/**/libraries 195 | 196 | # Gradle and Maven with auto-import 197 | # When using Gradle or Maven with auto-import, you should exclude module files, 198 | # since they will be recreated, and may cause churn. Uncomment if using 199 | # auto-import. 200 | # .idea/modules.xml 201 | # .idea/*.iml 202 | # .idea/modules 203 | 204 | # CMake 205 | cmake-build-*/ 206 | 207 | # Mongo Explorer plugin 208 | .idea/**/mongoSettings.xml 209 | 210 | # File-based project format 211 | *.iws 212 | 213 | # IntelliJ 214 | out/ 215 | 216 | # mpeltonen/sbt-idea plugin 217 | .idea_modules/ 218 | 219 | # JIRA plugin 220 | atlassian-ide-plugin.xml 221 | 222 | # Cursive Clojure plugin 223 | .idea/replstate.xml 224 | 225 | # Crashlytics plugin (for Android Studio and IntelliJ) 226 | com_crashlytics_export_strings.xml 227 | crashlytics.properties 228 | crashlytics-build.properties 229 | fabric.properties 230 | 231 | # Editor-based Rest Client 232 | .idea/httpRequests 233 | 234 | # Android studio 3.1+ serialized cache file 235 | .idea/caches/build_file_checksums.ser 236 | 237 | ### WebStorm Patch ### 238 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 239 | 240 | # *.iml 241 | # modules.xml 242 | # .idea/misc.xml 243 | # *.ipr 244 | 245 | # Sonarlint plugin 246 | .idea/sonarlint 247 | 248 | ### Windows ### 249 | # Windows thumbnail cache files 250 | Thumbs.db 251 | ehthumbs.db 252 | ehthumbs_vista.db 253 | 254 | # Dump file 255 | *.stackdump 256 | 257 | # Folder config file 258 | [Dd]esktop.ini 259 | 260 | # Recycle Bin used on file shares 261 | $RECYCLE.BIN/ 262 | 263 | # Windows Installer files 264 | *.cab 265 | *.msi 266 | *.msix 267 | *.msm 268 | *.msp 269 | 270 | # Windows shortcuts 271 | *.lnk 272 | 273 | ### VisualStudio ### 274 | ## Ignore Visual Studio temporary files, build results, and 275 | ## files generated by popular Visual Studio add-ons. 276 | ## 277 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 278 | 279 | # User-specific files 280 | *.suo 281 | *.user 282 | *.userosscache 283 | *.sln.docstates 284 | 285 | # User-specific files (MonoDevelop/Xamarin Studio) 286 | *.userprefs 287 | 288 | # Build results 289 | [Dd]ebug/ 290 | [Dd]ebugPublic/ 291 | [Rr]elease/ 292 | [Rr]eleases/ 293 | x64/ 294 | x86/ 295 | bld/ 296 | [Bb]in/ 297 | [Oo]bj/ 298 | [Ll]og/ 299 | 300 | # Visual Studio 2015/2017 cache/options directory 301 | .vs/ 302 | # Uncomment if you have tasks that create the project's static files in wwwroot 303 | #wwwroot/ 304 | 305 | # Visual Studio 2017 auto generated files 306 | Generated\ Files/ 307 | 308 | # MSTest test Results 309 | [Tt]est[Rr]esult*/ 310 | [Bb]uild[Ll]og.* 311 | 312 | # NUNIT 313 | *.VisualState.xml 314 | TestResult.xml 315 | 316 | # Build Results of an ATL Project 317 | [Dd]ebugPS/ 318 | [Rr]eleasePS/ 319 | dlldata.c 320 | 321 | # Benchmark Results 322 | BenchmarkDotNet.Artifacts/ 323 | 324 | # .NET Core 325 | project.lock.json 326 | project.fragment.lock.json 327 | artifacts/ 328 | 329 | # StyleCop 330 | StyleCopReport.xml 331 | 332 | # Files built by Visual Studio 333 | *_i.c 334 | *_p.c 335 | *_h.h 336 | *.ilk 337 | *.meta 338 | *.obj 339 | *.iobj 340 | *.pch 341 | *.pdb 342 | *.ipdb 343 | *.pgc 344 | *.pgd 345 | *.rsp 346 | *.sbr 347 | *.tlb 348 | *.tli 349 | *.tlh 350 | *.tmp 351 | *.tmp_proj 352 | *_wpftmp.csproj 353 | *.vspscc 354 | *.vssscc 355 | .builds 356 | *.pidb 357 | *.svclog 358 | *.scc 359 | 360 | # Chutzpah Test files 361 | _Chutzpah* 362 | 363 | # Visual C++ cache files 364 | ipch/ 365 | *.aps 366 | *.ncb 367 | *.opendb 368 | *.opensdf 369 | *.sdf 370 | *.cachefile 371 | *.VC.db 372 | *.VC.VC.opendb 373 | 374 | # Visual Studio profiler 375 | *.psess 376 | *.vsp 377 | *.vspx 378 | *.sap 379 | 380 | # Visual Studio Trace Files 381 | *.e2e 382 | 383 | # TFS 2012 Local Workspace 384 | $tf/ 385 | 386 | # Guidance Automation Toolkit 387 | *.gpState 388 | 389 | # ReSharper is a .NET coding add-in 390 | _ReSharper*/ 391 | *.[Rr]e[Ss]harper 392 | *.DotSettings.user 393 | 394 | # JustCode is a .NET coding add-in 395 | .JustCode 396 | 397 | # TeamCity is a build add-in 398 | _TeamCity* 399 | 400 | # DotCover is a Code Coverage Tool 401 | *.dotCover 402 | 403 | # AxoCover is a Code Coverage Tool 404 | .axoCover/* 405 | !.axoCover/settings.json 406 | 407 | # Visual Studio code coverage results 408 | *.coverage 409 | *.coveragexml 410 | 411 | # NCrunch 412 | _NCrunch_* 413 | .*crunch*.local.xml 414 | nCrunchTemp_* 415 | 416 | # MightyMoose 417 | *.mm.* 418 | AutoTest.Net/ 419 | 420 | # Web workbench (sass) 421 | .sass-cache/ 422 | 423 | # Installshield output folder 424 | [Ee]xpress/ 425 | 426 | # DocProject is a documentation generator add-in 427 | DocProject/buildhelp/ 428 | DocProject/Help/*.HxT 429 | DocProject/Help/*.HxC 430 | DocProject/Help/*.hhc 431 | DocProject/Help/*.hhk 432 | DocProject/Help/*.hhp 433 | DocProject/Help/Html2 434 | DocProject/Help/html 435 | 436 | # Click-Once directory 437 | publish/ 438 | 439 | # Publish Web Output 440 | *.[Pp]ublish.xml 441 | *.azurePubxml 442 | # Note: Comment the next line if you want to checkin your web deploy settings, 443 | # but database connection strings (with potential passwords) will be unencrypted 444 | *.pubxml 445 | *.publishproj 446 | 447 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 448 | # checkin your Azure Web App publish settings, but sensitive information contained 449 | # in these scripts will be unencrypted 450 | PublishScripts/ 451 | 452 | # NuGet Packages 453 | *.nupkg 454 | # The packages folder can be ignored because of Package Restore 455 | **/[Pp]ackages/* 456 | # except build/, which is used as an MSBuild target. 457 | !**/[Pp]ackages/build/ 458 | # Uncomment if necessary however generally it will be regenerated when needed 459 | #!**/[Pp]ackages/repositories.config 460 | # NuGet v3's project.json files produces more ignorable files 461 | *.nuget.props 462 | *.nuget.targets 463 | 464 | # Microsoft Azure Build Output 465 | csx/ 466 | *.build.csdef 467 | 468 | # Microsoft Azure Emulator 469 | ecf/ 470 | rcf/ 471 | 472 | # Windows Store app package directories and files 473 | AppPackages/ 474 | BundleArtifacts/ 475 | Package.StoreAssociation.xml 476 | _pkginfo.txt 477 | *.appx 478 | 479 | # Visual Studio cache files 480 | # files ending in .cache can be ignored 481 | *.[Cc]ache 482 | # but keep track of directories ending in .cache 483 | !*.[Cc]ache/ 484 | 485 | # Others 486 | ClientBin/ 487 | ~$* 488 | *.dbmdl 489 | *.dbproj.schemaview 490 | *.jfm 491 | *.pfx 492 | *.publishsettings 493 | orleans.codegen.cs 494 | 495 | # Including strong name files can present a security risk 496 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 497 | #*.snk 498 | 499 | # Since there are multiple workflows, uncomment next line to ignore bower_components 500 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 501 | #bower_components/ 502 | 503 | # RIA/Silverlight projects 504 | Generated_Code/ 505 | 506 | # Backup & report files from converting an old project file 507 | # to a newer Visual Studio version. Backup files are not needed, 508 | # because we have git ;-) 509 | _UpgradeReport_Files/ 510 | Backup*/ 511 | UpgradeLog*.XML 512 | UpgradeLog*.htm 513 | ServiceFabricBackup/ 514 | *.rptproj.bak 515 | 516 | # SQL Server files 517 | *.mdf 518 | *.ldf 519 | *.ndf 520 | 521 | # Business Intelligence projects 522 | *.rdl.data 523 | *.bim.layout 524 | *.bim_*.settings 525 | *.rptproj.rsuser 526 | 527 | # Microsoft Fakes 528 | FakesAssemblies/ 529 | 530 | # GhostDoc plugin setting file 531 | *.GhostDoc.xml 532 | 533 | # Node.js Tools for Visual Studio 534 | .ntvs_analysis.dat 535 | 536 | # Visual Studio 6 build log 537 | *.plg 538 | 539 | # Visual Studio 6 workspace options file 540 | *.opt 541 | 542 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 543 | *.vbw 544 | 545 | # Visual Studio LightSwitch build output 546 | **/*.HTMLClient/GeneratedArtifacts 547 | **/*.DesktopClient/GeneratedArtifacts 548 | **/*.DesktopClient/ModelManifest.xml 549 | **/*.Server/GeneratedArtifacts 550 | **/*.Server/ModelManifest.xml 551 | _Pvt_Extensions 552 | 553 | # Paket dependency manager 554 | .paket/paket.exe 555 | paket-files/ 556 | 557 | # FAKE - F# Make 558 | .fake/ 559 | 560 | # JetBrains Rider 561 | .idea/ 562 | *.sln.iml 563 | 564 | # CodeRush personal settings 565 | .cr/personal 566 | 567 | # Python Tools for Visual Studio (PTVS) 568 | __pycache__/ 569 | *.pyc 570 | 571 | # Cake - Uncomment if you are using it 572 | # tools/** 573 | # !tools/packages.config 574 | 575 | # Tabs Studio 576 | *.tss 577 | 578 | # Telerik's JustMock configuration file 579 | *.jmconfig 580 | 581 | # BizTalk build output 582 | *.btp.cs 583 | *.btm.cs 584 | *.odx.cs 585 | *.xsd.cs 586 | 587 | # OpenCover UI analysis results 588 | OpenCover/ 589 | 590 | # Azure Stream Analytics local run output 591 | ASALocalRun/ 592 | 593 | # MSBuild Binary and Structured Log 594 | *.binlog 595 | 596 | # NVidia Nsight GPU debugger configuration file 597 | *.nvuser 598 | 599 | # MFractors (Xamarin productivity tool) working folder 600 | .mfractor/ 601 | 602 | # Local History for Visual Studio 603 | .localhistory/ 604 | 605 | # public folder files generated 606 | public/*.html 607 | public/*.js 608 | public/*.css 609 | 610 | 611 | # End of https://www.gitignore.io/api/node,linux,macos,windows,webstorm,sublimetext,visualstudio,visualstudiocode -------------------------------------------------------------------------------- /.parcelrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["@parcel/config-default"], 3 | "reporters": ["...", "parcel-reporter-static-files-copy"] 4 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![JavaScript Style Guide](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/standard) 2 | 3 | ## Inspiration 4 | - [Blender example](https://twitter.com/minatop/status/1694281501356269610?s=20) 5 | 6 | ## References 7 | - [Post Process Action Lines - Shader Graph Basics - Episode 58](https://www.youtube.com/watch?v=joAUbu2_HYg) 8 | - [Building a Vaporwave scene with Three.js](https://blog.maximeheckel.com/posts/vaporwave-3d-scene-with-threejs/) -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "threejs-boilerplate", 3 | "version": "2.0.0", 4 | "author": "TheFrost ", 5 | "license": "MIT", 6 | "source": "src/index.html", 7 | "browserslist": "> 0.5%, last 2 versions, not dead", 8 | "scripts": { 9 | "start": "rm -rf .cache/; parcel --open", 10 | "build": "parcel build" 11 | }, 12 | "dependencies": { 13 | "cannon-es": "^0.18.0", 14 | "cannon-es-debugger": "^0.1.4", 15 | "gsap": "^3.12.2", 16 | "stats.js": "^0.17.0", 17 | "three": "latest", 18 | "tweakpane": "^4.0.0" 19 | }, 20 | "devDependencies": { 21 | "@babel/core": "^7.15.5", 22 | "@babel/eslint-parser": "^7.15.4", 23 | "@babel/preset-env": "^7.15.6", 24 | "@parcel/transformer-glsl": "latest", 25 | "parcel": "latest", 26 | "parcel-reporter-static-files-copy": "^1.3.0", 27 | "standard": "^14.3.1" 28 | }, 29 | "standard": { 30 | "parser": "@babel/eslint-parser" 31 | }, 32 | "resolutions": { 33 | "htmlnano": "2.0.3" 34 | } 35 | } -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ThreeJS - Speed up effect 9 | 10 | 63 | 64 | 65 | 66 |
67 | Press and hold Space Bar / Touch screen to Speed up 68 |
69 | 70 | 71 | 72 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /src/js/index.js: -------------------------------------------------------------------------------- 1 | import SceneManager from './webgl/SceneManager' 2 | 3 | const canvas = document.getElementById('canvas') 4 | const sceneManager = new SceneManager(canvas, true) 5 | 6 | const resizeCanvas = () => { 7 | canvas.style.width = '100%' 8 | canvas.style.height = '100%' 9 | 10 | canvas.width = canvas.offsetWidth 11 | canvas.height = canvas.offsetHeight 12 | 13 | sceneManager.resizeHandler() 14 | } 15 | 16 | const bindEvents = () => { 17 | window.onresize = resizeCanvas 18 | resizeCanvas() 19 | 20 | window.addEventListener('keydown', (e) => sceneManager.keydownHandler(e)) 21 | window.addEventListener('keyup', (e) => sceneManager.keyupHandler(e)) 22 | window.addEventListener('touchstart', () => sceneManager.speedUp()) 23 | window.addEventListener('touchend', () => sceneManager.speedDown()) 24 | } 25 | 26 | const render = () => { 27 | window.requestAnimationFrame(render) 28 | sceneManager.update() 29 | } 30 | 31 | bindEvents() 32 | render() 33 | -------------------------------------------------------------------------------- /src/js/tools/index.js: -------------------------------------------------------------------------------- 1 | import PubSub from './pubsub' 2 | 3 | export const pubsub = new PubSub() 4 | -------------------------------------------------------------------------------- /src/js/tools/pubsub.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Code base from article: 3 | * https://joshbedo.github.io/JS-Design-Patterns/ 4 | */ 5 | 6 | export default class PubSub { 7 | static handlers = [] 8 | 9 | suscribe (event, handler, context = null, isOnceType = false) { 10 | if (context === null) { context = handler } 11 | PubSub.handlers.push({ 12 | event, 13 | handler: handler.bind(context), 14 | isOnceType 15 | }) 16 | } 17 | 18 | publish (eventEmited, ...args) { 19 | PubSub.handlers = PubSub.handlers.filter(handlerItem => { 20 | const { event, handler, isOnceType } = handlerItem 21 | 22 | if (eventEmited === event) { 23 | handler(...args) 24 | 25 | return !isOnceType 26 | } 27 | 28 | return true 29 | }) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/js/webgl/SceneManager.js: -------------------------------------------------------------------------------- 1 | import * as THREE from 'three' 2 | import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls' 3 | import Stats from 'stats.js' 4 | 5 | // subjects 6 | import { gsap } from 'gsap' 7 | import Floor from './sceneSubjects/Floor/Floor' 8 | import VFX from './VFX/VFX' 9 | import Guy from './sceneSubjects/Guy' 10 | 11 | export default class SceneManager { 12 | clock = new THREE.Clock() 13 | isSpeedupActive = false 14 | 15 | buildVFX = () => { 16 | return new VFX({ 17 | renderer: this.renderer, 18 | scene: this.scene, 19 | camera: this.camera 20 | }) 21 | } 22 | 23 | buildScene = () => { 24 | const scene = new THREE.Scene() 25 | 26 | return scene 27 | } 28 | 29 | buildRender = ({ width, height }) => { 30 | const { canvas } = this 31 | 32 | const renderer = new THREE.WebGLRenderer({ 33 | canvas, 34 | antialias: true, 35 | alpha: true 36 | }) 37 | renderer.setPixelRatio( 38 | Math.min(window.devicePixelRatio, 2) 39 | ) 40 | renderer.setSize(width, height) 41 | 42 | return renderer 43 | } 44 | 45 | buildCamera = ({ width, height }) => { 46 | const aspectRatio = width / height 47 | const fieldOfView = 40 48 | const nearPlane = 0.1 49 | const farPlane = 1000 50 | const camera = new THREE.PerspectiveCamera( 51 | fieldOfView, 52 | aspectRatio, 53 | nearPlane, 54 | farPlane 55 | ) 56 | camera.position.z = 5 57 | camera.position.y = 0.5 58 | 59 | return camera 60 | } 61 | 62 | buildHelpers = () => { 63 | const gridHelper = new THREE.GridHelper(20, 20) 64 | this.scene.add(gridHelper) 65 | const axesHelper = new THREE.AxesHelper(5) 66 | this.scene.add(axesHelper) 67 | } 68 | 69 | buildStats = () => { 70 | this.stats = new Stats() 71 | document.body.appendChild(this.stats.dom) 72 | } 73 | 74 | buildOrbitControls = (camera, domElement) => { 75 | const controls = new OrbitControls(camera, domElement) 76 | controls.enableDamping = true 77 | 78 | return controls 79 | } 80 | 81 | createSceneSubjects = scene => { 82 | const sceneSubjects = [ 83 | new Floor(scene), 84 | new Guy(scene) 85 | ] 86 | 87 | return sceneSubjects 88 | } 89 | 90 | constructor (canvas, debugMode = false) { 91 | this.debugMode = debugMode 92 | this.canvas = canvas 93 | this.screenDimentions = { 94 | width: this.canvas.width, 95 | height: this.canvas.height 96 | } 97 | 98 | this.scene = this.buildScene() 99 | this.renderer = this.buildRender(this.screenDimentions) 100 | this.camera = this.buildCamera(this.screenDimentions) 101 | // this.buildHelpers() 102 | this.sceneSubjects = this.createSceneSubjects(this.scene) 103 | // this.orbitControls = this.buildOrbitControls(this.camera, this.renderer.domElement) 104 | this.VFX = this.buildVFX() 105 | if (debugMode) { 106 | this.buildStats() 107 | } 108 | } 109 | 110 | update () { 111 | if (this.debugMode) this.stats.begin() 112 | 113 | const delta = this.clock.getDelta() 114 | const elapsed = this.clock.getElapsedTime() 115 | 116 | this.sceneSubjects.map(s => s.update ? s.update(delta, elapsed) : null) 117 | 118 | this.renderer.render( 119 | this.scene, 120 | this.camera 121 | ) 122 | 123 | this.orbitControls?.update() 124 | 125 | this.VFX.update(delta, elapsed) 126 | 127 | if (this.debugMode) this.stats.end() 128 | } 129 | 130 | resizeHandler () { 131 | const { width, height } = this.canvas 132 | 133 | this.screenDimentions = { width, height } 134 | 135 | this.camera.aspect = width / height 136 | this.camera.updateProjectionMatrix() 137 | 138 | this.renderer.setPixelRatio( 139 | Math.min(window.devicePixelRatio, 2) 140 | ) 141 | this.renderer.setSize(width, height) 142 | } 143 | 144 | keydownHandler ({ code }) { 145 | if (code === 'Space') this.speedUp() 146 | } 147 | 148 | keyupHandler ({ code }) { 149 | if (code === 'Space') this.speedDown() 150 | } 151 | 152 | speedUp () { 153 | if (this.isSpeedupActive) return 154 | 155 | this.isSpeedupActive = true 156 | 157 | gsap.to(this.camera, { 158 | fov: 125, 159 | duration: 1, 160 | ease: 'expo.inOut', 161 | onUpdate: () => this.camera.updateProjectionMatrix() 162 | }) 163 | 164 | this.sceneSubjects.map(s => s.speedUp?.()) 165 | this.VFX.speedUp() 166 | } 167 | 168 | speedDown () { 169 | gsap.to(this.camera, { 170 | fov: 40, 171 | duration: 1, 172 | ease: 'expo.out', 173 | onUpdate: () => this.camera.updateProjectionMatrix() 174 | }) 175 | 176 | this.sceneSubjects.map(s => s.speedDown?.()) 177 | this.VFX.speedDown() 178 | 179 | this.isSpeedupActive = false 180 | } 181 | } 182 | -------------------------------------------------------------------------------- /src/js/webgl/VFX/SpeedPass/SpeedPass.js: -------------------------------------------------------------------------------- 1 | import vertexShader from './vertexShader.glsl' 2 | import fragmentShader from './fragmentShader.glsl' 3 | 4 | const SpeedPass = { 5 | uniforms: { 6 | tDiffuse: { value: null }, 7 | time: { value: 0 }, 8 | uLineDensity: { value: 0 }, 9 | uLineFalloff: { value: 1 }, 10 | uSpeed: { value: 1 }, 11 | uCenterMaskSize: { value: 0 }, 12 | uCenterMaskEdge: { value: 1 }, 13 | }, 14 | vertexShader, 15 | fragmentShader 16 | } 17 | 18 | export { SpeedPass } -------------------------------------------------------------------------------- /src/js/webgl/VFX/SpeedPass/fragmentShader.glsl: -------------------------------------------------------------------------------- 1 | #define TWO_PI 6.28318530718 2 | 3 | uniform sampler2D tDiffuse; 4 | uniform float time; 5 | uniform float uLineDensity; 6 | uniform float uLineFalloff; 7 | uniform float uSpeed; 8 | uniform float uCenterMaskSize; 9 | uniform float uCenterMaskEdge; 10 | 11 | varying vec2 vUv; 12 | 13 | mat2 rotate2d(in float radians){ 14 | float c = cos(radians); 15 | float s = sin(radians); 16 | return mat2(c, -s, s, c); 17 | } 18 | vec2 rotate(in vec2 st, in float radians, in vec2 center) { 19 | return rotate2d(radians) * (st - center) + center; 20 | } 21 | 22 | // inverse Lerp 23 | float invLerp (float a, float b, float t) { 24 | return (t - a) / (b - a); 25 | } 26 | 27 | // 2D Random 28 | float random (in vec2 st) { 29 | return fract(sin(dot(st.xy, 30 | vec2(12.9898,78.233))) 31 | * 43758.5453123); 32 | } 33 | 34 | float noise (in vec2 st) { 35 | vec2 i = floor(st); 36 | vec2 f = fract(st); 37 | 38 | // Four corners in 2D of a tile 39 | float a = random(i); 40 | float b = random(i + vec2(1.0, 0.0)); 41 | float c = random(i + vec2(0.0, 1.0)); 42 | float d = random(i + vec2(1.0, 1.0)); 43 | 44 | // Smooth Interpolation 45 | 46 | // Cubic Hermine Curve. Same as SmoothStep() 47 | vec2 u = f*f*(3.0-2.0*f); 48 | // u = smoothstep(0.,1.,f); 49 | 50 | // Mix 4 coorners percentages 51 | return mix(a, b, u.x) + 52 | (c - a)* u.y * (1.0 - u.x) + 53 | (d - b) * u.x * u.y; 54 | } 55 | 56 | void main() { 57 | vec4 color = texture2D(tDiffuse, vUv); 58 | 59 | // polar coords 60 | vec2 toCenter = vec2(0.5) - vUv; 61 | float angle = atan(toCenter.x, toCenter.y) * 0.5; 62 | vec2 st = vec2(angle); 63 | st = rotate(st, time * uSpeed, vec2(0.5)); 64 | 65 | float n = noise(st * 100.); 66 | 67 | float distanceToCenter = length(toCenter); 68 | 69 | float mask = invLerp(uCenterMaskSize, uCenterMaskSize + uCenterMaskEdge, distanceToCenter); 70 | mask *= uLineDensity; 71 | float maskInverted = 1. - mask; 72 | float maskLineFalloff = maskInverted + uLineFalloff; 73 | 74 | float lines = smoothstep(maskInverted, maskLineFalloff, n); 75 | 76 | gl_FragColor = color + lines; 77 | } -------------------------------------------------------------------------------- /src/js/webgl/VFX/SpeedPass/vertexShader.glsl: -------------------------------------------------------------------------------- 1 | varying vec2 vUv; 2 | 3 | void main() { 4 | gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 5 | 6 | vUv = uv; 7 | } -------------------------------------------------------------------------------- /src/js/webgl/VFX/VFX.js: -------------------------------------------------------------------------------- 1 | import * as THREE from 'three' 2 | import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer' 3 | import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass' 4 | import { SpeedPass } from './SpeedPass/SpeedPass' 5 | import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass' 6 | import { SMAAPass } from 'three/examples/jsm/postprocessing/SMAAPass' 7 | import { pane } from '../tools' 8 | import { gsap } from 'gsap' 9 | 10 | export default class VFX { 11 | constructor ({ renderer, scene, camera }) { 12 | const rt = new THREE.WebGLRenderTarget(800, 600, { 13 | samples: 2 14 | }) 15 | 16 | this.composer = new EffectComposer(renderer, rt) 17 | 18 | const renderPass = new RenderPass(scene, camera) 19 | this.composer.addPass(renderPass) 20 | 21 | this.shaderPass = new ShaderPass(SpeedPass) 22 | this.composer.addPass(this.shaderPass) 23 | 24 | if (renderer.getPixelRatio() === 1 && !renderer.capabilities.isWebGL2) { 25 | const smaaPass = new SMAAPass() 26 | this.composer.addPass(smaaPass) 27 | } 28 | 29 | this.debug() 30 | } 31 | 32 | debug () { 33 | const tweaks = pane.addFolder({ 34 | title: 'VFX Speed', 35 | expanded: false 36 | }) 37 | 38 | tweaks.addBinding(this.shaderPass.uniforms.uLineDensity, 'value', { 39 | min: 0, max: 1, step: 0.1, label: 'Line Density' 40 | }) 41 | tweaks.addBinding(this.shaderPass.uniforms.uLineFalloff, 'value', { 42 | min: 0, max: 1, step: 0.1, label: 'Line Falloff' 43 | }) 44 | tweaks.addBinding(this.shaderPass.uniforms.uSpeed, 'value', { 45 | min: 0, max: 10, step: 0.1, label: 'Speed' 46 | }) 47 | tweaks.addBinding(this.shaderPass.uniforms.uCenterMaskSize, 'value', { 48 | min: 0, max: 1, step: 0.01, label: 'Center Mask Size' 49 | }) 50 | tweaks.addBinding(this.shaderPass.uniforms.uCenterMaskEdge, 'value', { 51 | min: 0, max: 1, step: 0.01, label: 'Center Mask Edge' 52 | }) 53 | } 54 | 55 | speedUp () { 56 | gsap.to(this.shaderPass.uniforms.uLineDensity, { 57 | value: 1, 58 | duration: 1, 59 | ease: 'expo.inOut' 60 | }) 61 | } 62 | 63 | speedDown () { 64 | gsap.to(this.shaderPass.uniforms.uLineDensity, { 65 | value: 0, 66 | duration: 1, 67 | ease: 'expo.out' 68 | }) 69 | } 70 | 71 | update (delta, elapsed) { 72 | this.composer.render() 73 | this.shaderPass.uniforms.time.value = elapsed 74 | } 75 | } -------------------------------------------------------------------------------- /src/js/webgl/sceneSubjects/Floor/Floor.js: -------------------------------------------------------------------------------- 1 | import { gsap } from 'gsap' 2 | import * as THREE from 'three' 3 | import { pane } from '../../tools/' 4 | 5 | import fragmentShader from './fragment.glsl' 6 | import vertexShader from './vertex.glsl' 7 | 8 | export default class Floor { 9 | MAX_VELOCITY = 1 10 | MIN_VELOCITY = 0.1 11 | WIDTH = 10 12 | HEIGHT = 20 13 | QUALITY = 100 14 | 15 | acceleration = 0 16 | velocity = this.MIN_VELOCITY 17 | 18 | constructor (scene) { 19 | const geometry = new THREE.PlaneGeometry(this.WIDTH, this.HEIGHT, this.QUALITY, this.QUALITY) 20 | this.material = new THREE.ShaderMaterial({ 21 | uniforms: { 22 | tMap: { value: this.texture }, 23 | uTime: { value: 0 }, 24 | uAcceleration: { value: this.acceleration }, 25 | uTopColor: { value: new THREE.Color('#7fbf7f') }, 26 | uBottomColor: { value: new THREE.Color('#e5dcd3') }, 27 | uNoiseAmplitude: { value: 2 }, 28 | uNoiseFrequency: { value: 1 }, 29 | uPathSize: { value: 0.1 } 30 | }, 31 | fragmentShader, 32 | vertexShader, 33 | // wireframe: true 34 | }) 35 | 36 | const mesh = new THREE.Mesh(geometry, this.material) 37 | mesh.rotation.x = -(Math.PI / 2) 38 | 39 | scene.add(mesh) 40 | 41 | this.debug() 42 | } 43 | 44 | update (delta, elapsed) { 45 | this.acceleration += this.velocity 46 | this.material.uniforms.uAcceleration.value = this.acceleration; 47 | } 48 | 49 | speedUp () { 50 | gsap.to(this, { 51 | velocity: this.MAX_VELOCITY, 52 | duration: 1, 53 | ease: 'expo.inOut' 54 | }) 55 | } 56 | 57 | speedDown () { 58 | gsap.to(this, { 59 | velocity: this.MIN_VELOCITY, 60 | duration: 1, 61 | ease: 'expo.out' 62 | }) 63 | } 64 | 65 | debug () { 66 | const tweaks = pane.addFolder({ 67 | title: 'Terrain', 68 | expanded: false 69 | }) 70 | 71 | tweaks.addBinding(this.material.uniforms.uNoiseAmplitude, 'value', { 72 | min: 0.1, max: 5, step: 0.1, label: 'Mountains Amplitude' 73 | }) 74 | tweaks.addBinding(this.material.uniforms.uNoiseFrequency, 'value', { 75 | min: 0.1, max: 5, step: 0.1, label: 'Mountains Frequency' 76 | }) 77 | tweaks.addBinding(this.material.uniforms.uPathSize, 'value', { 78 | min: 0.1, max: 9, step: 0.1, label: 'Path Size' 79 | }) 80 | } 81 | } -------------------------------------------------------------------------------- /src/js/webgl/sceneSubjects/Floor/fragment.glsl: -------------------------------------------------------------------------------- 1 | uniform sampler2D tMap; 2 | uniform float uTime; 3 | uniform vec3 uTopColor; 4 | uniform vec3 uBottomColor; 5 | 6 | varying vec2 vUv; 7 | varying vec3 vPosition; 8 | 9 | 10 | void main() { 11 | vec4 color = vec4(mix(uTopColor, uBottomColor, 1. - vPosition.z), 1.0); 12 | 13 | gl_FragColor = color; 14 | } -------------------------------------------------------------------------------- /src/js/webgl/sceneSubjects/Floor/vertex.glsl: -------------------------------------------------------------------------------- 1 | uniform float uTime; 2 | uniform float uAcceleration; 3 | uniform float uNoiseAmplitude; 4 | uniform float uNoiseFrequency; 5 | uniform float uPathSize; 6 | 7 | varying vec2 vUv; 8 | varying vec3 vPosition; 9 | 10 | // 2D Random 11 | float random (in vec2 st) { 12 | return fract(sin(dot(st.xy, 13 | vec2(12.9898,78.233))) 14 | * 43758.5453123); 15 | } 16 | 17 | // 2D Noise based on Morgan McGuire @morgan3d 18 | // https://www.shadertoy.com/view/4dS3Wd 19 | float noise (in vec2 st) { 20 | vec2 i = floor(st); 21 | vec2 f = fract(st); 22 | 23 | // Four corners in 2D of a tile 24 | float a = random(i); 25 | float b = random(i + vec2(1.0, 0.0)); 26 | float c = random(i + vec2(0.0, 1.0)); 27 | float d = random(i + vec2(1.0, 1.0)); 28 | 29 | // Smooth Interpolation 30 | 31 | // Cubic Hermine Curve. Same as SmoothStep() 32 | vec2 u = f*f*(3.0-2.0*f); 33 | // u = smoothstep(0.,1.,f); 34 | 35 | // Mix 4 coorners percentages 36 | return mix(a, b, u.x) + 37 | (c - a)* u.y * (1.0 - u.x) + 38 | (d - b) * u.x * u.y; 39 | } 40 | 41 | void main() { 42 | vUv = uv; 43 | vec3 pos = position; 44 | 45 | float pathArea = uPathSize / 2.; 46 | float path = smoothstep(pathArea, pathArea + 2., abs(pos.x)); 47 | 48 | // Noise 49 | vec2 offset = vec2(0, uAcceleration); 50 | float n = noise((pos.xy * uNoiseFrequency) + offset) * uNoiseAmplitude; 51 | pos.z += n * path; 52 | 53 | vPosition = pos; 54 | 55 | gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0); 56 | } -------------------------------------------------------------------------------- /src/js/webgl/sceneSubjects/Guy.js: -------------------------------------------------------------------------------- 1 | import { gsap } from 'gsap' 2 | import * as THREE from 'three' 3 | 4 | export default class Guy { 5 | MIN_POSITION = 4 6 | MAX_POSITION = 4.75 7 | oscilation = 1 8 | rotationVelocity = 0.01 9 | 10 | constructor (scene) { 11 | const geometry = new THREE.CapsuleGeometry(1, 1, 1, 6) 12 | const material = new THREE.MeshNormalMaterial({ 13 | // wireframe: true, 14 | flatShading: true 15 | }) 16 | this.mesh = new THREE.Mesh(geometry, material) 17 | 18 | const scale = 0.1 19 | this.mesh.scale.set(scale, scale, scale) 20 | this.mesh.rotation.x = Math.PI * 0.65 21 | this.mesh.position.set(0, 0.2, this.MIN_POSITION) 22 | 23 | scene.add(this.mesh) 24 | } 25 | 26 | update (delta, elapsed) { 27 | this.mesh.position.y += (Math.sin(elapsed * 5) * 0.001) * this.oscilation 28 | this.mesh.position.x = (Math.sin(elapsed) * 0.1) * this.oscilation 29 | this.mesh.rotation.y += this.rotationVelocity 30 | } 31 | 32 | speedUp () { 33 | gsap.to(this.mesh.position, { 34 | z: this.MAX_POSITION, 35 | duration: 1, 36 | ease: 'expo.out' 37 | }) 38 | 39 | gsap.to(this.mesh.rotation, { 40 | x: Math.PI * 0.5, 41 | duration: 1, 42 | ease: 'expo.out' 43 | }) 44 | 45 | gsap.to(this, { 46 | oscilation: 0.5, 47 | duration: 1, 48 | ease: 'expo.out' 49 | }) 50 | 51 | gsap.to(this, { 52 | rotationVelocity: 0.1, 53 | duration: 1, 54 | ease: 'expo.out' 55 | }) 56 | } 57 | 58 | speedDown () { 59 | gsap.to(this.mesh.position, { 60 | z: this.MIN_POSITION, 61 | duration: 1, 62 | ease: 'expo.out' 63 | }) 64 | 65 | gsap.to(this.mesh.rotation, { 66 | x: Math.PI * 0.65, 67 | duration: 1, 68 | ease: 'expo.out' 69 | }) 70 | 71 | gsap.to(this, { 72 | oscilation: 1, 73 | duration: 1, 74 | ease: 'expo.out' 75 | }) 76 | 77 | gsap.to(this, { 78 | rotationVelocity: 0.01, 79 | duration: 1, 80 | ease: 'expo.out' 81 | }) 82 | } 83 | } -------------------------------------------------------------------------------- /src/js/webgl/shaders/fragmentShader.glsl: -------------------------------------------------------------------------------- 1 | varying vec2 vUv; 2 | varying vec3 vPosition; 3 | 4 | uniform float uTime; 5 | 6 | void main() { 7 | vec3 color = vec3(0.0); 8 | 9 | color += 0.5 + 0.5 * cos(uTime + vUv.xyx + vec3(0.0,2.0,4.0)); 10 | 11 | gl_FragColor.rgb = color; 12 | gl_FragColor.a = 1.0; 13 | } -------------------------------------------------------------------------------- /src/js/webgl/shaders/vertexShader.glsl: -------------------------------------------------------------------------------- 1 | varying vec2 vUv; 2 | varying vec3 vPosition; 3 | 4 | void main() { 5 | vUv = uv; 6 | vPosition = position; 7 | 8 | gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 9 | } -------------------------------------------------------------------------------- /src/js/webgl/tools/GLTFLoader.js: -------------------------------------------------------------------------------- 1 | import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader' 2 | import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader' 3 | 4 | export const gltfLoader = new GLTFLoader() 5 | const dracoLoader = new DRACOLoader() 6 | dracoLoader.setDecoderPath('./draco/') 7 | gltfLoader.setDRACOLoader(dracoLoader) 8 | -------------------------------------------------------------------------------- /src/js/webgl/tools/LoadingManager.js: -------------------------------------------------------------------------------- 1 | import * as THREE from 'three' 2 | import { pubsub } from '../../tools' 3 | 4 | export default class LoadingManager { 5 | constructor () { 6 | this.manager = new THREE.LoadingManager() 7 | 8 | this.bindEvents() 9 | } 10 | 11 | bindEvents () { 12 | this.manager.onLoad = () => this.onLoadHandler() 13 | this.manager.onProgress = (_, loaded, total) => this.onProgressHandler(loaded, total) 14 | } 15 | 16 | onLoadHandler () { 17 | window.setTimeout(() => { 18 | pubsub.publish('loadermanager:complete') 19 | }, 1000) 20 | } 21 | 22 | onProgressHandler (loaded, total) { 23 | const progress = Math.floor(loaded / total * 100) 24 | pubsub.publish('loadermanager:progress', progress) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/js/webgl/tools/index.js: -------------------------------------------------------------------------------- 1 | import { Pane } from 'tweakpane' 2 | 3 | export const pane = new Pane() 4 | -------------------------------------------------------------------------------- /static/code_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /static/draco/draco_decoder.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheFrost/threejs-speedup-effect/2900518a52f8bfb8fccc9d3b42aaaa13777a7387/static/draco/draco_decoder.wasm -------------------------------------------------------------------------------- /static/draco/draco_wasm_wrapper.js: -------------------------------------------------------------------------------- 1 | var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(f){var m=0;return function(){return m=d);)++b;if(16k?d+=String.fromCharCode(k):(k-=65536,d+=String.fromCharCode(55296|k>>10,56320|k&1023))}}else d+=String.fromCharCode(k)}return d}function X(a,c){return a?h(ca,a,c):""}function e(a,c){0=d&&(d=65536+((d&1023)<<10)|a.charCodeAt(++b)&1023);127>=d?++c:c=2047>=d?c+2:65535>=d?c+3:c+4}c=Array(c+1);b=0;d=c.length;if(0=e){var f=a.charCodeAt(++k);e=65536+((e&1023)<<10)|f&1023}if(127>=e){if(b>=d)break;c[b++]=e}else{if(2047>=e){if(b+1>=d)break;c[b++]=192|e>>6}else{if(65535>=e){if(b+2>=d)break;c[b++]=224|e>>12}else{if(b+3>=d)break;c[b++]=240|e>>18;c[b++]=128|e>>12&63}c[b++]=128|e>>6&63}c[b++]=128| 18 | e&63}}c[b]=0}a=n.alloc(c,T);n.copy(c,T,a)}return a}function x(){throw"cannot construct a Status, no constructor in IDL";}function A(){this.ptr=Oa();u(A)[this.ptr]=this}function B(){this.ptr=Pa();u(B)[this.ptr]=this}function C(){this.ptr=Qa();u(C)[this.ptr]=this}function D(){this.ptr=Ra();u(D)[this.ptr]=this}function E(){this.ptr=Sa();u(E)[this.ptr]=this}function q(){this.ptr=Ta();u(q)[this.ptr]=this}function J(){this.ptr=Ua();u(J)[this.ptr]=this}function w(){this.ptr=Va();u(w)[this.ptr]=this}function F(){this.ptr= 19 | Wa();u(F)[this.ptr]=this}function r(){this.ptr=Xa();u(r)[this.ptr]=this}function G(){this.ptr=Ya();u(G)[this.ptr]=this}function H(){this.ptr=Za();u(H)[this.ptr]=this}function O(){this.ptr=$a();u(O)[this.ptr]=this}function K(){this.ptr=ab();u(K)[this.ptr]=this}function g(){this.ptr=bb();u(g)[this.ptr]=this}function y(){this.ptr=cb();u(y)[this.ptr]=this}function Q(){throw"cannot construct a VoidPtr, no constructor in IDL";}function I(){this.ptr=db();u(I)[this.ptr]=this}function L(){this.ptr=eb();u(L)[this.ptr]= 20 | this}m=m||{};var a="undefined"!==typeof m?m:{},Ga=!1,Ha=!1;a.onRuntimeInitialized=function(){Ga=!0;if(Ha&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.onModuleParsed=function(){Ha=!0;if(Ga&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.isVersionSupported=function(a){if("string"!==typeof a)return!1;a=a.split(".");return 2>a.length||3=a[1]?!0:0!=a[0]||10>2]},getStr:function(){return X(R.get())}, 26 | get64:function(){var a=R.get();R.get();return a},getZero:function(){R.get()}},Ka={__cxa_allocate_exception:function(a){return ib(a)},__cxa_throw:function(a,c,b){"uncaught_exception"in ta?ta.uncaught_exceptions++:ta.uncaught_exceptions=1;throw a;},abort:function(){z()},emscripten_get_sbrk_ptr:function(){return 18416},emscripten_memcpy_big:function(a,c,b){ca.set(ca.subarray(c,c+b),a)},emscripten_resize_heap:function(a){if(2147418112= 27 | c?e(2*c,65536):Math.min(e((3*c+2147483648)/4,65536),2147418112);a:{try{ia.grow(c-ka.byteLength+65535>>16);l(ia.buffer);var b=1;break a}catch(d){}b=void 0}return b?!0:!1},environ_get:function(a,c){var b=0;ba().forEach(function(d,e){var f=c+b;e=P[a+4*e>>2]=f;for(f=0;f>0]=d.charCodeAt(f);T[e>>0]=0;b+=d.length+1});return 0},environ_sizes_get:function(a,c){var b=ba();P[a>>2]=b.length;var d=0;b.forEach(function(a){d+=a.length+1});P[c>>2]=d;return 0},fd_close:function(a){return 0},fd_seek:function(a, 28 | c,b,d,e){return 0},fd_write:function(a,c,b,d){try{for(var e=0,f=0;f>2],k=P[c+(8*f+4)>>2],h=0;h>2]=e;return 0}catch(ua){return"undefined"!==typeof FS&&ua instanceof FS.ErrnoError||z(ua),ua.errno}},memory:ia,setTempRet0:function(a){},table:gb},La=function(){function e(c,b){a.asm=c.exports;aa--;a.monitorRunDependencies&&a.monitorRunDependencies(aa);0==aa&&(null!==sa&&(clearInterval(sa),sa=null),ja&&(c=ja,ja=null,c()))}function c(a){e(a.instance)} 29 | function b(a){return Ma().then(function(a){return WebAssembly.instantiate(a,d)}).then(a,function(a){Y("failed to asynchronously prepare wasm: "+a);z(a)})}var d={env:Ka,wasi_unstable:Ka};aa++;a.monitorRunDependencies&&a.monitorRunDependencies(aa);if(a.instantiateWasm)try{return a.instantiateWasm(d,e)}catch(Na){return Y("Module.instantiateWasm callback failed with error: "+Na),!1}(function(){if(da||"function"!==typeof WebAssembly.instantiateStreaming||va(U)||"function"!==typeof fetch)return b(c);fetch(U, 30 | {credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,d).then(c,function(a){Y("wasm streaming compile failed: "+a);Y("falling back to ArrayBuffer instantiation");b(c)})})})();return{}}();a.asm=La;var hb=a.___wasm_call_ctors=function(){return a.asm.__wasm_call_ctors.apply(null,arguments)},jb=a._emscripten_bind_Status_code_0=function(){return a.asm.emscripten_bind_Status_code_0.apply(null,arguments)},kb=a._emscripten_bind_Status_ok_0=function(){return a.asm.emscripten_bind_Status_ok_0.apply(null, 31 | arguments)},lb=a._emscripten_bind_Status_error_msg_0=function(){return a.asm.emscripten_bind_Status_error_msg_0.apply(null,arguments)},mb=a._emscripten_bind_Status___destroy___0=function(){return a.asm.emscripten_bind_Status___destroy___0.apply(null,arguments)},Oa=a._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=function(){return a.asm.emscripten_bind_DracoUInt16Array_DracoUInt16Array_0.apply(null,arguments)},nb=a._emscripten_bind_DracoUInt16Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt16Array_GetValue_1.apply(null, 32 | arguments)},ob=a._emscripten_bind_DracoUInt16Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt16Array_size_0.apply(null,arguments)},pb=a._emscripten_bind_DracoUInt16Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt16Array___destroy___0.apply(null,arguments)},Pa=a._emscripten_bind_PointCloud_PointCloud_0=function(){return a.asm.emscripten_bind_PointCloud_PointCloud_0.apply(null,arguments)},qb=a._emscripten_bind_PointCloud_num_attributes_0=function(){return a.asm.emscripten_bind_PointCloud_num_attributes_0.apply(null, 33 | arguments)},rb=a._emscripten_bind_PointCloud_num_points_0=function(){return a.asm.emscripten_bind_PointCloud_num_points_0.apply(null,arguments)},sb=a._emscripten_bind_PointCloud___destroy___0=function(){return a.asm.emscripten_bind_PointCloud___destroy___0.apply(null,arguments)},Qa=a._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=function(){return a.asm.emscripten_bind_DracoUInt8Array_DracoUInt8Array_0.apply(null,arguments)},tb=a._emscripten_bind_DracoUInt8Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt8Array_GetValue_1.apply(null, 34 | arguments)},ub=a._emscripten_bind_DracoUInt8Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt8Array_size_0.apply(null,arguments)},vb=a._emscripten_bind_DracoUInt8Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt8Array___destroy___0.apply(null,arguments)},Ra=a._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=function(){return a.asm.emscripten_bind_DracoUInt32Array_DracoUInt32Array_0.apply(null,arguments)},wb=a._emscripten_bind_DracoUInt32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt32Array_GetValue_1.apply(null, 35 | arguments)},xb=a._emscripten_bind_DracoUInt32Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt32Array_size_0.apply(null,arguments)},yb=a._emscripten_bind_DracoUInt32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt32Array___destroy___0.apply(null,arguments)},Sa=a._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0.apply(null,arguments)},zb=a._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1= 36 | function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1.apply(null,arguments)},Ab=a._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_quantization_bits_0.apply(null,arguments)},Bb=a._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform___destroy___0.apply(null,arguments)},Ta=a._emscripten_bind_PointAttribute_PointAttribute_0= 37 | function(){return a.asm.emscripten_bind_PointAttribute_PointAttribute_0.apply(null,arguments)},Cb=a._emscripten_bind_PointAttribute_size_0=function(){return a.asm.emscripten_bind_PointAttribute_size_0.apply(null,arguments)},Db=a._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return a.asm.emscripten_bind_PointAttribute_GetAttributeTransformData_0.apply(null,arguments)},Eb=a._emscripten_bind_PointAttribute_attribute_type_0=function(){return a.asm.emscripten_bind_PointAttribute_attribute_type_0.apply(null, 38 | arguments)},Fb=a._emscripten_bind_PointAttribute_data_type_0=function(){return a.asm.emscripten_bind_PointAttribute_data_type_0.apply(null,arguments)},Gb=a._emscripten_bind_PointAttribute_num_components_0=function(){return a.asm.emscripten_bind_PointAttribute_num_components_0.apply(null,arguments)},Hb=a._emscripten_bind_PointAttribute_normalized_0=function(){return a.asm.emscripten_bind_PointAttribute_normalized_0.apply(null,arguments)},Ib=a._emscripten_bind_PointAttribute_byte_stride_0=function(){return a.asm.emscripten_bind_PointAttribute_byte_stride_0.apply(null, 39 | arguments)},Jb=a._emscripten_bind_PointAttribute_byte_offset_0=function(){return a.asm.emscripten_bind_PointAttribute_byte_offset_0.apply(null,arguments)},Kb=a._emscripten_bind_PointAttribute_unique_id_0=function(){return a.asm.emscripten_bind_PointAttribute_unique_id_0.apply(null,arguments)},Lb=a._emscripten_bind_PointAttribute___destroy___0=function(){return a.asm.emscripten_bind_PointAttribute___destroy___0.apply(null,arguments)},Ua=a._emscripten_bind_AttributeTransformData_AttributeTransformData_0= 40 | function(){return a.asm.emscripten_bind_AttributeTransformData_AttributeTransformData_0.apply(null,arguments)},Mb=a._emscripten_bind_AttributeTransformData_transform_type_0=function(){return a.asm.emscripten_bind_AttributeTransformData_transform_type_0.apply(null,arguments)},Nb=a._emscripten_bind_AttributeTransformData___destroy___0=function(){return a.asm.emscripten_bind_AttributeTransformData___destroy___0.apply(null,arguments)},Va=a._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0= 41 | function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0.apply(null,arguments)},Ob=a._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1.apply(null,arguments)},Pb=a._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_quantization_bits_0.apply(null,arguments)}, 42 | Qb=a._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_min_value_1.apply(null,arguments)},Rb=a._emscripten_bind_AttributeQuantizationTransform_range_0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_range_0.apply(null,arguments)},Sb=a._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform___destroy___0.apply(null,arguments)}, 43 | Wa=a._emscripten_bind_DracoInt8Array_DracoInt8Array_0=function(){return a.asm.emscripten_bind_DracoInt8Array_DracoInt8Array_0.apply(null,arguments)},Tb=a._emscripten_bind_DracoInt8Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoInt8Array_GetValue_1.apply(null,arguments)},Ub=a._emscripten_bind_DracoInt8Array_size_0=function(){return a.asm.emscripten_bind_DracoInt8Array_size_0.apply(null,arguments)},Vb=a._emscripten_bind_DracoInt8Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt8Array___destroy___0.apply(null, 44 | arguments)},Xa=a._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return a.asm.emscripten_bind_MetadataQuerier_MetadataQuerier_0.apply(null,arguments)},Wb=a._emscripten_bind_MetadataQuerier_HasEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_HasEntry_2.apply(null,arguments)},Xb=a._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetIntEntry_2.apply(null,arguments)},Yb=a._emscripten_bind_MetadataQuerier_GetIntEntryArray_3= 45 | function(){return a.asm.emscripten_bind_MetadataQuerier_GetIntEntryArray_3.apply(null,arguments)},Zb=a._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetDoubleEntry_2.apply(null,arguments)},$b=a._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetStringEntry_2.apply(null,arguments)},ac=a._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return a.asm.emscripten_bind_MetadataQuerier_NumEntries_1.apply(null, 46 | arguments)},bc=a._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetEntryName_2.apply(null,arguments)},cc=a._emscripten_bind_MetadataQuerier___destroy___0=function(){return a.asm.emscripten_bind_MetadataQuerier___destroy___0.apply(null,arguments)},Ya=a._emscripten_bind_DracoInt16Array_DracoInt16Array_0=function(){return a.asm.emscripten_bind_DracoInt16Array_DracoInt16Array_0.apply(null,arguments)},dc=a._emscripten_bind_DracoInt16Array_GetValue_1= 47 | function(){return a.asm.emscripten_bind_DracoInt16Array_GetValue_1.apply(null,arguments)},ec=a._emscripten_bind_DracoInt16Array_size_0=function(){return a.asm.emscripten_bind_DracoInt16Array_size_0.apply(null,arguments)},fc=a._emscripten_bind_DracoInt16Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt16Array___destroy___0.apply(null,arguments)},Za=a._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=function(){return a.asm.emscripten_bind_DracoFloat32Array_DracoFloat32Array_0.apply(null, 48 | arguments)},gc=a._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoFloat32Array_GetValue_1.apply(null,arguments)},hc=a._emscripten_bind_DracoFloat32Array_size_0=function(){return a.asm.emscripten_bind_DracoFloat32Array_size_0.apply(null,arguments)},ic=a._emscripten_bind_DracoFloat32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoFloat32Array___destroy___0.apply(null,arguments)},$a=a._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return a.asm.emscripten_bind_GeometryAttribute_GeometryAttribute_0.apply(null, 49 | arguments)},jc=a._emscripten_bind_GeometryAttribute___destroy___0=function(){return a.asm.emscripten_bind_GeometryAttribute___destroy___0.apply(null,arguments)},ab=a._emscripten_bind_DecoderBuffer_DecoderBuffer_0=function(){return a.asm.emscripten_bind_DecoderBuffer_DecoderBuffer_0.apply(null,arguments)},kc=a._emscripten_bind_DecoderBuffer_Init_2=function(){return a.asm.emscripten_bind_DecoderBuffer_Init_2.apply(null,arguments)},lc=a._emscripten_bind_DecoderBuffer___destroy___0=function(){return a.asm.emscripten_bind_DecoderBuffer___destroy___0.apply(null, 50 | arguments)},bb=a._emscripten_bind_Decoder_Decoder_0=function(){return a.asm.emscripten_bind_Decoder_Decoder_0.apply(null,arguments)},mc=a._emscripten_bind_Decoder_GetEncodedGeometryType_1=function(){return a.asm.emscripten_bind_Decoder_GetEncodedGeometryType_1.apply(null,arguments)},nc=a._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=function(){return a.asm.emscripten_bind_Decoder_DecodeBufferToPointCloud_2.apply(null,arguments)},oc=a._emscripten_bind_Decoder_DecodeBufferToMesh_2=function(){return a.asm.emscripten_bind_Decoder_DecodeBufferToMesh_2.apply(null, 51 | arguments)},pc=a._emscripten_bind_Decoder_GetAttributeId_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeId_2.apply(null,arguments)},qc=a._emscripten_bind_Decoder_GetAttributeIdByName_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIdByName_2.apply(null,arguments)},rc=a._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3.apply(null,arguments)},sc=a._emscripten_bind_Decoder_GetAttribute_2= 52 | function(){return a.asm.emscripten_bind_Decoder_GetAttribute_2.apply(null,arguments)},tc=a._emscripten_bind_Decoder_GetAttributeByUniqueId_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeByUniqueId_2.apply(null,arguments)},uc=a._emscripten_bind_Decoder_GetMetadata_1=function(){return a.asm.emscripten_bind_Decoder_GetMetadata_1.apply(null,arguments)},vc=a._emscripten_bind_Decoder_GetAttributeMetadata_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeMetadata_2.apply(null, 53 | arguments)},wc=a._emscripten_bind_Decoder_GetFaceFromMesh_3=function(){return a.asm.emscripten_bind_Decoder_GetFaceFromMesh_3.apply(null,arguments)},xc=a._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=function(){return a.asm.emscripten_bind_Decoder_GetTriangleStripsFromMesh_2.apply(null,arguments)},yc=a._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=function(){return a.asm.emscripten_bind_Decoder_GetTrianglesUInt16Array_3.apply(null,arguments)},zc=a._emscripten_bind_Decoder_GetTrianglesUInt32Array_3= 54 | function(){return a.asm.emscripten_bind_Decoder_GetTrianglesUInt32Array_3.apply(null,arguments)},Ac=a._emscripten_bind_Decoder_GetAttributeFloat_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeFloat_3.apply(null,arguments)},Bc=a._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3.apply(null,arguments)},Cc=a._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIntForAllPoints_3.apply(null, 55 | arguments)},Dc=a._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3.apply(null,arguments)},Ec=a._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3.apply(null,arguments)},Fc=a._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3.apply(null,arguments)}, 56 | Gc=a._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3.apply(null,arguments)},Hc=a._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3.apply(null,arguments)},Ic=a._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3.apply(null,arguments)},Jc= 57 | a._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=function(){return a.asm.emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5.apply(null,arguments)},Kc=a._emscripten_bind_Decoder_SkipAttributeTransform_1=function(){return a.asm.emscripten_bind_Decoder_SkipAttributeTransform_1.apply(null,arguments)},Lc=a._emscripten_bind_Decoder___destroy___0=function(){return a.asm.emscripten_bind_Decoder___destroy___0.apply(null,arguments)},cb=a._emscripten_bind_Mesh_Mesh_0=function(){return a.asm.emscripten_bind_Mesh_Mesh_0.apply(null, 58 | arguments)},Mc=a._emscripten_bind_Mesh_num_faces_0=function(){return a.asm.emscripten_bind_Mesh_num_faces_0.apply(null,arguments)},Nc=a._emscripten_bind_Mesh_num_attributes_0=function(){return a.asm.emscripten_bind_Mesh_num_attributes_0.apply(null,arguments)},Oc=a._emscripten_bind_Mesh_num_points_0=function(){return a.asm.emscripten_bind_Mesh_num_points_0.apply(null,arguments)},Pc=a._emscripten_bind_Mesh___destroy___0=function(){return a.asm.emscripten_bind_Mesh___destroy___0.apply(null,arguments)}, 59 | Qc=a._emscripten_bind_VoidPtr___destroy___0=function(){return a.asm.emscripten_bind_VoidPtr___destroy___0.apply(null,arguments)},db=a._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return a.asm.emscripten_bind_DracoInt32Array_DracoInt32Array_0.apply(null,arguments)},Rc=a._emscripten_bind_DracoInt32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoInt32Array_GetValue_1.apply(null,arguments)},Sc=a._emscripten_bind_DracoInt32Array_size_0=function(){return a.asm.emscripten_bind_DracoInt32Array_size_0.apply(null, 60 | arguments)},Tc=a._emscripten_bind_DracoInt32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt32Array___destroy___0.apply(null,arguments)},eb=a._emscripten_bind_Metadata_Metadata_0=function(){return a.asm.emscripten_bind_Metadata_Metadata_0.apply(null,arguments)},Uc=a._emscripten_bind_Metadata___destroy___0=function(){return a.asm.emscripten_bind_Metadata___destroy___0.apply(null,arguments)},Vc=a._emscripten_enum_draco_StatusCode_OK=function(){return a.asm.emscripten_enum_draco_StatusCode_OK.apply(null, 61 | arguments)},Wc=a._emscripten_enum_draco_StatusCode_DRACO_ERROR=function(){return a.asm.emscripten_enum_draco_StatusCode_DRACO_ERROR.apply(null,arguments)},Xc=a._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return a.asm.emscripten_enum_draco_StatusCode_IO_ERROR.apply(null,arguments)},Yc=a._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return a.asm.emscripten_enum_draco_StatusCode_INVALID_PARAMETER.apply(null,arguments)},Zc=a._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION= 62 | function(){return a.asm.emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION.apply(null,arguments)},$c=a._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return a.asm.emscripten_enum_draco_StatusCode_UNKNOWN_VERSION.apply(null,arguments)},ad=a._emscripten_enum_draco_DataType_DT_INVALID=function(){return a.asm.emscripten_enum_draco_DataType_DT_INVALID.apply(null,arguments)},bd=a._emscripten_enum_draco_DataType_DT_INT8=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT8.apply(null, 63 | arguments)},cd=a._emscripten_enum_draco_DataType_DT_UINT8=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT8.apply(null,arguments)},dd=a._emscripten_enum_draco_DataType_DT_INT16=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT16.apply(null,arguments)},ed=a._emscripten_enum_draco_DataType_DT_UINT16=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT16.apply(null,arguments)},fd=a._emscripten_enum_draco_DataType_DT_INT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT32.apply(null, 64 | arguments)},gd=a._emscripten_enum_draco_DataType_DT_UINT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT32.apply(null,arguments)},hd=a._emscripten_enum_draco_DataType_DT_INT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT64.apply(null,arguments)},id=a._emscripten_enum_draco_DataType_DT_UINT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT64.apply(null,arguments)},jd=a._emscripten_enum_draco_DataType_DT_FLOAT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_FLOAT32.apply(null, 65 | arguments)},kd=a._emscripten_enum_draco_DataType_DT_FLOAT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_FLOAT64.apply(null,arguments)},ld=a._emscripten_enum_draco_DataType_DT_BOOL=function(){return a.asm.emscripten_enum_draco_DataType_DT_BOOL.apply(null,arguments)},md=a._emscripten_enum_draco_DataType_DT_TYPES_COUNT=function(){return a.asm.emscripten_enum_draco_DataType_DT_TYPES_COUNT.apply(null,arguments)},nd=a._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE.apply(null, 66 | arguments)},od=a._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD.apply(null,arguments)},pd=a._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH.apply(null,arguments)},qd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM.apply(null, 67 | arguments)},rd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM.apply(null,arguments)},sd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM.apply(null,arguments)},td=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM.apply(null, 68 | arguments)},ud=a._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_INVALID.apply(null,arguments)},vd=a._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_POSITION.apply(null,arguments)},wd=a._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_NORMAL.apply(null,arguments)},xd=a._emscripten_enum_draco_GeometryAttribute_Type_COLOR= 69 | function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_COLOR.apply(null,arguments)},yd=a._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD.apply(null,arguments)},zd=a._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_GENERIC.apply(null,arguments)};a._setThrew=function(){return a.asm.setThrew.apply(null,arguments)};var ta=a.__ZSt18uncaught_exceptionv= 70 | function(){return a.asm._ZSt18uncaught_exceptionv.apply(null,arguments)};a._free=function(){return a.asm.free.apply(null,arguments)};var ib=a._malloc=function(){return a.asm.malloc.apply(null,arguments)};a.stackSave=function(){return a.asm.stackSave.apply(null,arguments)};a.stackAlloc=function(){return a.asm.stackAlloc.apply(null,arguments)};a.stackRestore=function(){return a.asm.stackRestore.apply(null,arguments)};a.__growWasmMemory=function(){return a.asm.__growWasmMemory.apply(null,arguments)}; 71 | a.dynCall_ii=function(){return a.asm.dynCall_ii.apply(null,arguments)};a.dynCall_vi=function(){return a.asm.dynCall_vi.apply(null,arguments)};a.dynCall_iii=function(){return a.asm.dynCall_iii.apply(null,arguments)};a.dynCall_vii=function(){return a.asm.dynCall_vii.apply(null,arguments)};a.dynCall_iiii=function(){return a.asm.dynCall_iiii.apply(null,arguments)};a.dynCall_v=function(){return a.asm.dynCall_v.apply(null,arguments)};a.dynCall_viii=function(){return a.asm.dynCall_viii.apply(null,arguments)}; 72 | a.dynCall_viiii=function(){return a.asm.dynCall_viiii.apply(null,arguments)};a.dynCall_iiiiiii=function(){return a.asm.dynCall_iiiiiii.apply(null,arguments)};a.dynCall_iidiiii=function(){return a.asm.dynCall_iidiiii.apply(null,arguments)};a.dynCall_jiji=function(){return a.asm.dynCall_jiji.apply(null,arguments)};a.dynCall_viiiiii=function(){return a.asm.dynCall_viiiiii.apply(null,arguments)};a.dynCall_viiiii=function(){return a.asm.dynCall_viiiii.apply(null,arguments)};a.asm=La;var fa;a.then=function(e){if(fa)e(a); 73 | else{var c=a.onRuntimeInitialized;a.onRuntimeInitialized=function(){c&&c();e(a)}}return a};ja=function c(){fa||ma();fa||(ja=c)};a.run=ma;if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0=n.size?(t(0>=1;break;case 4:d>>=2;break;case 8:d>>=3}for(var c=0;c