├── static ├── .gitkeep ├── assets │ ├── image1.jpg │ └── lenna.png ├── draco │ ├── draco_decoder.wasm │ ├── gltf │ │ ├── draco_decoder.wasm │ │ └── draco_wasm_wrapper.js │ ├── README.md │ └── draco_wasm_wrapper.js └── basis │ ├── basis_transcoder.wasm │ └── README.md ├── src ├── Experience │ ├── shaders │ │ ├── flowField │ │ │ ├── vertex.glsl │ │ │ └── fragment.glsl │ │ ├── particles │ │ │ ├── fragment.glsl │ │ │ └── vertex.glsl │ │ └── partials │ │ │ ├── perlin3d.glsl │ │ │ └── perlin4d.glsl │ ├── assets.js │ ├── World.js │ ├── Utils │ │ ├── Time.js │ │ ├── Sizes.js │ │ ├── Stats.js │ │ ├── Loader.js │ │ └── EventEmitter.js │ ├── Camera.js │ ├── Resources.js │ ├── Experience.js │ ├── Picture │ │ ├── Picture.js │ │ └── FlowField.js │ └── Renderer.js ├── script.js ├── style.css └── index.html ├── bundler ├── webpack.prod.js ├── webpack.dev.js └── webpack.common.js ├── readme.md ├── package.json └── .gitignore /static/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/assets/image1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunosimon/flow-field-gallery/HEAD/static/assets/image1.jpg -------------------------------------------------------------------------------- /static/assets/lenna.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunosimon/flow-field-gallery/HEAD/static/assets/lenna.png -------------------------------------------------------------------------------- /static/draco/draco_decoder.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunosimon/flow-field-gallery/HEAD/static/draco/draco_decoder.wasm -------------------------------------------------------------------------------- /static/basis/basis_transcoder.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunosimon/flow-field-gallery/HEAD/static/basis/basis_transcoder.wasm -------------------------------------------------------------------------------- /static/draco/gltf/draco_decoder.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunosimon/flow-field-gallery/HEAD/static/draco/gltf/draco_decoder.wasm -------------------------------------------------------------------------------- /src/Experience/shaders/flowField/vertex.glsl: -------------------------------------------------------------------------------- 1 | varying vec2 vUv; 2 | 3 | void main() 4 | { 5 | gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 6 | 7 | vUv = uv; 8 | } -------------------------------------------------------------------------------- /src/script.js: -------------------------------------------------------------------------------- 1 | import './style.css' 2 | import Experience from './Experience/Experience.js' 3 | 4 | const experience = new Experience({ 5 | targetElement: document.querySelector('.experience') 6 | }) 7 | 8 | -------------------------------------------------------------------------------- /src/Experience/shaders/particles/fragment.glsl: -------------------------------------------------------------------------------- 1 | uniform sampler2D uTexture; 2 | 3 | varying vec2 vUv; 4 | 5 | void main() 6 | { 7 | vec3 color = texture2D(uTexture, vUv).rgb; 8 | gl_FragColor = vec4(color, 1.0); 9 | } -------------------------------------------------------------------------------- /src/Experience/assets.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | name: 'base', 4 | data: {}, 5 | items: 6 | [ 7 | { name: 'imageTexture', source: '/assets/image1.jpg', type: 'texture' }, 8 | ] 9 | } 10 | ] -------------------------------------------------------------------------------- /src/style.css: -------------------------------------------------------------------------------- 1 | * 2 | { 3 | margin: 0; 4 | padding: 0; 5 | box-sizing: border-box; 6 | } 7 | 8 | html, 9 | body 10 | { 11 | overflow: hidden; 12 | } 13 | 14 | .experience 15 | { 16 | position: fixed; 17 | width: 100vw; 18 | height: 100vh; 19 | } -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Three.js - Template - Complex 7 | 8 | 9 |
10 | 11 | -------------------------------------------------------------------------------- /bundler/webpack.prod.js: -------------------------------------------------------------------------------- 1 | const { merge } = require('webpack-merge') 2 | const commonConfiguration = require('./webpack.common.js') 3 | const { CleanWebpackPlugin } = require('clean-webpack-plugin') 4 | 5 | module.exports = merge( 6 | commonConfiguration, 7 | { 8 | mode: 'production', 9 | plugins: 10 | [ 11 | new CleanWebpackPlugin() 12 | ] 13 | } 14 | ) 15 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Flow Field Gallery 2 | 3 | - [GitHub](https://github.com/brunosimon/flow-field-gallery) 4 | - [Live](https://flow-field-gallery.vercel.app) 5 | 6 | ## Setup 7 | Download [Node.js](https://nodejs.org/en/download/). 8 | Run this followed commands: 9 | 10 | ``` bash 11 | # Install dependencies (only the first time) 12 | npm install 13 | 14 | # Run the local server at localhost:8080 15 | npm run dev 16 | 17 | # Build for production in the dist/ directory 18 | npm run build 19 | ``` 20 | -------------------------------------------------------------------------------- /src/Experience/shaders/particles/vertex.glsl: -------------------------------------------------------------------------------- 1 | uniform sampler2D uFBOTexture; 2 | uniform sampler2D uMaskTexture; 3 | uniform float uSize; 4 | 5 | attribute vec2 aFboUv; 6 | attribute float aSize; 7 | attribute vec2 aUv; 8 | 9 | varying vec2 vUv; 10 | 11 | void main() 12 | { 13 | vec4 fboColor = texture2D(uFBOTexture, aFboUv); 14 | 15 | vec4 modelPosition = modelMatrix * vec4(fboColor.xyz, 1.0); // fboColor.xyz 16 | vec4 viewPosition = viewMatrix * modelPosition; 17 | gl_Position = projectionMatrix * viewPosition; 18 | 19 | float lifeSize = min((1.0 - fboColor.a) * 10.0, fboColor.a * 2.0); 20 | lifeSize = clamp(lifeSize, 0.0, 1.0); 21 | 22 | gl_PointSize = uSize * lifeSize * aSize; 23 | gl_PointSize *= (1.0 / - viewPosition.z); 24 | 25 | vUv = aUv; 26 | } -------------------------------------------------------------------------------- /src/Experience/World.js: -------------------------------------------------------------------------------- 1 | import * as THREE from 'three' 2 | import Experience from './Experience.js' 3 | import Picture from './Picture/Picture.js' 4 | 5 | export default class World 6 | { 7 | constructor(_options) 8 | { 9 | this.experience = new Experience() 10 | this.config = this.experience.config 11 | this.scene = this.experience.scene 12 | this.resources = this.experience.resources 13 | 14 | this.resources.on('groupEnd', (_group) => 15 | { 16 | if(_group.name === 'base') 17 | { 18 | this.setPicture() 19 | } 20 | }) 21 | } 22 | 23 | setPicture() 24 | { 25 | this.picture = new Picture() 26 | } 27 | 28 | resize() 29 | { 30 | } 31 | 32 | update() 33 | { 34 | if(this.picture) 35 | this.picture.update() 36 | } 37 | 38 | destroy() 39 | { 40 | } 41 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "repository": "#", 3 | "license": "UNLICENSED", 4 | "scripts": { 5 | "build": "webpack --config ./bundler/webpack.prod.js", 6 | "dev": "webpack serve --config ./bundler/webpack.dev.js" 7 | }, 8 | "dependencies": { 9 | "@babel/core": "^7.15.5", 10 | "@babel/preset-env": "^7.15.6", 11 | "babel-loader": "^8.2.2", 12 | "clean-webpack-plugin": "^4.0.0", 13 | "copy-webpack-plugin": "^9.0.1", 14 | "css-loader": "^6.3.0", 15 | "file-loader": "^6.2.0", 16 | "glslify-loader": "^2.0.0", 17 | "html-loader": "^2.1.2", 18 | "html-webpack-plugin": "^5.3.2", 19 | "mini-css-extract-plugin": "^2.3.0", 20 | "portfinder-sync": "0.0.2", 21 | "raw-loader": "^4.0.2", 22 | "stats.js": "^0.17.0", 23 | "style-loader": "^3.3.0", 24 | "three": "^0.133.1", 25 | "tweakpane": "^3.0.5", 26 | "webpack": "^5.53.0", 27 | "webpack-cli": "^4.8.0", 28 | "webpack-dev-server": "^4.2.1", 29 | "webpack-merge": "^5.8.0" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Experience/Utils/Time.js: -------------------------------------------------------------------------------- 1 | import EventEmitter from './EventEmitter.js' 2 | 3 | export default class Time extends EventEmitter 4 | { 5 | /** 6 | * Constructor 7 | */ 8 | constructor() 9 | { 10 | super() 11 | 12 | this.start = Date.now() 13 | this.current = this.start 14 | this.elapsed = 0 15 | this.delta = 16 16 | this.playing = true 17 | 18 | this.tick = this.tick.bind(this) 19 | this.tick() 20 | } 21 | 22 | play() 23 | { 24 | this.playing = true 25 | } 26 | 27 | pause() 28 | { 29 | this.playing = false 30 | } 31 | 32 | /** 33 | * Tick 34 | */ 35 | tick() 36 | { 37 | this.ticker = window.requestAnimationFrame(this.tick) 38 | 39 | const current = Date.now() 40 | 41 | this.delta = current - this.current 42 | this.elapsed += this.playing ? this.delta : 0 43 | this.current = current 44 | 45 | if(this.delta > 60) 46 | { 47 | this.delta = 60 48 | } 49 | 50 | if(this.playing) 51 | { 52 | this.trigger('tick') 53 | } 54 | } 55 | 56 | /** 57 | * Stop 58 | */ 59 | stop() 60 | { 61 | window.cancelAnimationFrame(this.ticker) 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/Experience/Utils/Sizes.js: -------------------------------------------------------------------------------- 1 | import EventEmitter from './EventEmitter.js' 2 | 3 | export default class Sizes extends EventEmitter 4 | { 5 | /** 6 | * Constructor 7 | */ 8 | constructor() 9 | { 10 | super() 11 | 12 | // Viewport size 13 | this.viewport = {} 14 | this.$sizeViewport = document.createElement('div') 15 | this.$sizeViewport.style.width = '100vw' 16 | this.$sizeViewport.style.height = '100vh' 17 | this.$sizeViewport.style.position = 'absolute' 18 | this.$sizeViewport.style.top = 0 19 | this.$sizeViewport.style.left = 0 20 | this.$sizeViewport.style.pointerEvents = 'none' 21 | 22 | // Resize event 23 | this.resize = this.resize.bind(this) 24 | window.addEventListener('resize', this.resize) 25 | 26 | this.resize() 27 | } 28 | 29 | /** 30 | * Resize 31 | */ 32 | resize() 33 | { 34 | document.body.appendChild(this.$sizeViewport) 35 | this.viewport.width = this.$sizeViewport.offsetWidth 36 | this.viewport.height = this.$sizeViewport.offsetHeight 37 | document.body.removeChild(this.$sizeViewport) 38 | 39 | this.width = window.innerWidth 40 | this.height = window.innerHeight 41 | 42 | this.trigger('resize') 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Experience/shaders/flowField/fragment.glsl: -------------------------------------------------------------------------------- 1 | uniform float uTime; 2 | uniform float uDelta; 3 | uniform sampler2D uBaseTexture; 4 | uniform sampler2D uTexture; 5 | 6 | uniform float uDecaySpeed; 7 | 8 | uniform float uPerlinFrequency; 9 | uniform float uPerlinMultiplier; 10 | uniform float uTimeFrequency; 11 | uniform float uSeed; 12 | 13 | varying vec2 vUv; 14 | 15 | #pragma glslify: perlin3d = require('../partials/perlin3d.glsl') 16 | 17 | void main() 18 | { 19 | vec4 color = texture2D(uTexture, vUv); 20 | color.a -= uDecaySpeed * uDelta; 21 | 22 | // Reset to base position 23 | if(color.a <= 0.0) 24 | { 25 | color.rgb = texture2D(uBaseTexture, vUv).rgb; 26 | color.a = 1.0; 27 | // color = texture2D(uBaseTexture, vUv); 28 | } 29 | else 30 | { 31 | vec4 baseColor = color; 32 | 33 | float time = uTime * uTimeFrequency; 34 | float perlinMultiplier = uPerlinMultiplier * uDelta * 0.1; 35 | 36 | color.r += perlin3d(uSeed + vec3(baseColor.gb * uPerlinFrequency , time)) * perlinMultiplier; 37 | color.g += perlin3d(uSeed + vec3(baseColor.rb * uPerlinFrequency + 123.45 , time)) * perlinMultiplier; 38 | color.b += perlin3d(uSeed + vec3(baseColor.rg * uPerlinFrequency + 12345.67, time)) * perlinMultiplier; 39 | } 40 | 41 | gl_FragColor = color; 42 | } -------------------------------------------------------------------------------- /static/draco/README.md: -------------------------------------------------------------------------------- 1 | # Draco 3D Data Compression 2 | 3 | Draco is an open-source library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics. 4 | 5 | [Website](https://google.github.io/draco/) | [GitHub](https://github.com/google/draco) 6 | 7 | ## Contents 8 | 9 | This folder contains three utilities: 10 | 11 | * `draco_decoder.js` — Emscripten-compiled decoder, compatible with any modern browser. 12 | * `draco_decoder.wasm` — WebAssembly decoder, compatible with newer browsers and devices. 13 | * `draco_wasm_wrapper.js` — JavaScript wrapper for the WASM decoder. 14 | 15 | Each file is provided in two variations: 16 | 17 | * **Default:** Latest stable builds, tracking the project's [master branch](https://github.com/google/draco). 18 | * **glTF:** Builds targeted by the [glTF mesh compression extension](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression), tracking the [corresponding Draco branch](https://github.com/google/draco/tree/gltf_2.0_draco_extension). 19 | 20 | Either variation may be used with `THREE.DRACOLoader`: 21 | 22 | ```js 23 | var dracoLoader = new THREE.DRACOLoader(); 24 | dracoLoader.setDecoderPath('path/to/decoders/'); 25 | dracoLoader.setDecoderConfig({type: 'js'}); // (Optional) Override detection of WASM support. 26 | ``` 27 | 28 | Further [documentation on GitHub](https://github.com/google/draco/tree/master/javascript/example#static-loading-javascript-decoder). 29 | 30 | ## License 31 | 32 | [Apache License 2.0](https://github.com/google/draco/blob/master/LICENSE) 33 | -------------------------------------------------------------------------------- /static/basis/README.md: -------------------------------------------------------------------------------- 1 | # Basis Universal GPU Texture Compression 2 | 3 | Basis Universal is a "[supercompressed](http://gamma.cs.unc.edu/GST/gst.pdf)" 4 | GPU texture and texture video compression system that outputs a highly 5 | compressed intermediate file format (.basis) that can be quickly transcoded to 6 | a wide variety of GPU texture compression formats. 7 | 8 | [GitHub](https://github.com/BinomialLLC/basis_universal) 9 | 10 | ## Transcoders 11 | 12 | Basis Universal texture data may be used in two different file formats: 13 | `.basis` and `.ktx2`, where `ktx2` is a standardized wrapper around basis texture data. 14 | 15 | For further documentation about the Basis compressor and transcoder, refer to 16 | the [Basis GitHub repository](https://github.com/BinomialLLC/basis_universal). 17 | 18 | The folder contains two files required for transcoding `.basis` or `.ktx2` textures: 19 | 20 | * `basis_transcoder.js` — JavaScript wrapper for the WebAssembly transcoder. 21 | * `basis_transcoder.wasm` — WebAssembly transcoder. 22 | 23 | Both are dependencies of `THREE.KTX2Loader` and `THREE.BasisTextureLoader`: 24 | 25 | ```js 26 | var ktx2Loader = new THREE.KTX2Loader(); 27 | ktx2Loader.setTranscoderPath( 'examples/js/libs/basis/' ); 28 | ktx2Loader.detectSupport( renderer ); 29 | ktx2Loader.load( 'diffuse.ktx2', function ( texture ) { 30 | 31 | var material = new THREE.MeshStandardMaterial( { map: texture } ); 32 | 33 | }, function () { 34 | 35 | console.log( 'onProgress' ); 36 | 37 | }, function ( e ) { 38 | 39 | console.error( e ); 40 | 41 | } ); 42 | ``` 43 | 44 | ## License 45 | 46 | [Apache License 2.0](https://github.com/BinomialLLC/basis_universal/blob/master/LICENSE) 47 | -------------------------------------------------------------------------------- /bundler/webpack.dev.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const { merge } = require('webpack-merge') 3 | const commonConfiguration = require('./webpack.common.js') 4 | const ip = require('internal-ip') 5 | const portFinderSync = require('portfinder-sync') 6 | 7 | const infoColor = (_message) => 8 | { 9 | return `\u001b[1m\u001b[34m${_message}\u001b[39m\u001b[22m` 10 | } 11 | 12 | module.exports = merge( 13 | commonConfiguration, 14 | { 15 | stats: 'errors-warnings', 16 | mode: 'development', 17 | devServer: 18 | { 19 | host: 'local-ip', 20 | port: portFinderSync.getPort(8080), 21 | open: true, 22 | https: false, 23 | allowedHosts: 'all', 24 | hot: false, 25 | watchFiles: ['src/**', 'static/**'], 26 | static: 27 | { 28 | watch: true, 29 | directory: path.join(__dirname, '../static') 30 | }, 31 | client: 32 | { 33 | logging: 'none', 34 | overlay: true, 35 | progress: false 36 | }, 37 | onAfterSetupMiddleware: function(devServer) 38 | { 39 | const port = devServer.options.port 40 | const https = devServer.options.https ? 's' : '' 41 | const localIp = ip.v4.sync() 42 | const domain1 = `http${https}://${localIp}:${port}` 43 | const domain2 = `http${https}://localhost:${port}` 44 | 45 | console.log(`Project running at:\n - ${infoColor(domain1)}\n - ${infoColor(domain2)}`) 46 | } 47 | } 48 | } 49 | ) 50 | -------------------------------------------------------------------------------- /bundler/webpack.common.js: -------------------------------------------------------------------------------- 1 | const CopyWebpackPlugin = require('copy-webpack-plugin') 2 | const HtmlWebpackPlugin = require('html-webpack-plugin') 3 | const MiniCSSExtractPlugin = require('mini-css-extract-plugin') 4 | const path = require('path') 5 | 6 | module.exports = { 7 | entry: path.resolve(__dirname, '../src/script.js'), 8 | output: 9 | { 10 | filename: 'bundle.[contenthash].js', 11 | path: path.resolve(__dirname, '../dist') 12 | }, 13 | devtool: 'source-map', 14 | plugins: 15 | [ 16 | new CopyWebpackPlugin({ 17 | patterns: [ 18 | { from: path.resolve(__dirname, '../static') } 19 | ] 20 | }), 21 | new HtmlWebpackPlugin({ 22 | template: path.resolve(__dirname, '../src/index.html'), 23 | minify: true 24 | }), 25 | new MiniCSSExtractPlugin() 26 | ], 27 | module: 28 | { 29 | rules: 30 | [ 31 | // HTML 32 | { 33 | test: /\.(html)$/, 34 | use: 35 | [ 36 | 'html-loader' 37 | ] 38 | }, 39 | 40 | // JS 41 | { 42 | test: /\.js$/, 43 | exclude: /node_modules/, 44 | use: 45 | [ 46 | 'babel-loader' 47 | ] 48 | }, 49 | 50 | // CSS 51 | { 52 | test: /\.css$/, 53 | use: 54 | [ 55 | MiniCSSExtractPlugin.loader, 56 | 'css-loader' 57 | ] 58 | }, 59 | 60 | // Images 61 | { 62 | test: /\.(jpg|png|gif|svg)$/, 63 | type: 'asset/resource', 64 | generator: 65 | { 66 | filename: 'assets/images/[hash][ext]' 67 | } 68 | }, 69 | 70 | // Fonts 71 | { 72 | test: /\.(ttf|eot|woff|woff2)$/, 73 | type: 'asset/resource', 74 | generator: 75 | { 76 | filename: 'assets/fonts/[hash][ext]' 77 | } 78 | }, 79 | 80 | // Shaders 81 | { 82 | test: /\.(glsl|vs|fs|vert|frag)$/, 83 | exclude: /node_modules/, 84 | use: 85 | [ 86 | 'raw-loader', 87 | 'glslify-loader' 88 | ] 89 | } 90 | ] 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/Experience/shaders/partials/perlin3d.glsl: -------------------------------------------------------------------------------- 1 | // Classic Perlin 3D Noise 2 | // by Stefan Gustavson 3 | // 4 | vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);} 5 | vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;} 6 | vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);} 7 | 8 | float perlin3d(vec3 P) 9 | { 10 | vec3 Pi0 = floor(P); // Integer part for indexing 11 | vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1 12 | Pi0 = mod(Pi0, 289.0); 13 | Pi1 = mod(Pi1, 289.0); 14 | vec3 Pf0 = fract(P); // Fractional part for interpolation 15 | vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0 16 | vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); 17 | vec4 iy = vec4(Pi0.yy, Pi1.yy); 18 | vec4 iz0 = Pi0.zzzz; 19 | vec4 iz1 = Pi1.zzzz; 20 | 21 | vec4 ixy = permute(permute(ix) + iy); 22 | vec4 ixy0 = permute(ixy + iz0); 23 | vec4 ixy1 = permute(ixy + iz1); 24 | 25 | vec4 gx0 = ixy0 / 7.0; 26 | vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5; 27 | gx0 = fract(gx0); 28 | vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); 29 | vec4 sz0 = step(gz0, vec4(0.0)); 30 | gx0 -= sz0 * (step(0.0, gx0) - 0.5); 31 | gy0 -= sz0 * (step(0.0, gy0) - 0.5); 32 | 33 | vec4 gx1 = ixy1 / 7.0; 34 | vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5; 35 | gx1 = fract(gx1); 36 | vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); 37 | vec4 sz1 = step(gz1, vec4(0.0)); 38 | gx1 -= sz1 * (step(0.0, gx1) - 0.5); 39 | gy1 -= sz1 * (step(0.0, gy1) - 0.5); 40 | 41 | vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); 42 | vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); 43 | vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); 44 | vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); 45 | vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); 46 | vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); 47 | vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); 48 | vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); 49 | 50 | vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); 51 | g000 *= norm0.x; 52 | g010 *= norm0.y; 53 | g100 *= norm0.z; 54 | g110 *= norm0.w; 55 | vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); 56 | g001 *= norm1.x; 57 | g011 *= norm1.y; 58 | g101 *= norm1.z; 59 | g111 *= norm1.w; 60 | 61 | float n000 = dot(g000, Pf0); 62 | float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); 63 | float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); 64 | float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); 65 | float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); 66 | float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); 67 | float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); 68 | float n111 = dot(g111, Pf1); 69 | 70 | vec3 fade_xyz = fade(Pf0); 71 | vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); 72 | vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); 73 | float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); 74 | return 2.2 * n_xyz; 75 | } 76 | 77 | #pragma glslify: export(perlin3d) -------------------------------------------------------------------------------- /src/Experience/Camera.js: -------------------------------------------------------------------------------- 1 | import * as THREE from 'three' 2 | import Experience from './Experience.js' 3 | import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js' 4 | 5 | export default class Camera 6 | { 7 | constructor(_options) 8 | { 9 | // Options 10 | this.experience = new Experience() 11 | this.config = this.experience.config 12 | this.debug = this.experience.debug 13 | this.time = this.experience.time 14 | this.sizes = this.experience.sizes 15 | this.targetElement = this.experience.targetElement 16 | this.scene = this.experience.scene 17 | 18 | // Set up 19 | this.mode = 'debug' // defaultCamera \ debugCamera 20 | 21 | this.setInstance() 22 | this.setModes() 23 | } 24 | 25 | setInstance() 26 | { 27 | // Set up 28 | this.instance = new THREE.PerspectiveCamera(25, this.config.width / this.config.height, 0.1, 150) 29 | this.instance.rotation.reorder('YXZ') 30 | 31 | this.scene.add(this.instance) 32 | } 33 | 34 | setModes() 35 | { 36 | this.modes = {} 37 | 38 | // Default 39 | this.modes.default = {} 40 | this.modes.default.instance = this.instance.clone() 41 | this.modes.default.instance.rotation.reorder('YXZ') 42 | 43 | // Debug 44 | this.modes.debug = {} 45 | this.modes.debug.instance = this.instance.clone() 46 | this.modes.debug.instance.rotation.reorder('YXZ') 47 | this.modes.debug.instance.position.set(5, 5, 5) 48 | 49 | this.modes.debug.orbitControls = new OrbitControls(this.modes.debug.instance, this.targetElement) 50 | this.modes.debug.orbitControls.enabled = this.modes.debug.active 51 | this.modes.debug.orbitControls.screenSpacePanning = true 52 | this.modes.debug.orbitControls.enableKeys = false 53 | this.modes.debug.orbitControls.zoomSpeed = 0.25 54 | this.modes.debug.orbitControls.enableDamping = true 55 | this.modes.debug.orbitControls.update() 56 | } 57 | 58 | 59 | resize() 60 | { 61 | this.instance.aspect = this.config.width / this.config.height 62 | this.instance.updateProjectionMatrix() 63 | 64 | this.modes.default.instance.aspect = this.config.width / this.config.height 65 | this.modes.default.instance.updateProjectionMatrix() 66 | 67 | this.modes.debug.instance.aspect = this.config.width / this.config.height 68 | this.modes.debug.instance.updateProjectionMatrix() 69 | } 70 | 71 | update() 72 | { 73 | // Update debug orbit controls 74 | this.modes.debug.orbitControls.update() 75 | 76 | // Apply coordinates 77 | this.instance.position.copy(this.modes[this.mode].instance.position) 78 | this.instance.quaternion.copy(this.modes[this.mode].instance.quaternion) 79 | this.instance.updateMatrixWorld() // To be used in projection 80 | } 81 | 82 | destroy() 83 | { 84 | this.modes.debug.orbitControls.destroy() 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/Experience/Resources.js: -------------------------------------------------------------------------------- 1 | import * as THREE from 'three' 2 | import EventEmitter from './Utils/EventEmitter.js' 3 | import Loader from './Utils/Loader.js' 4 | 5 | export default class Resources extends EventEmitter 6 | { 7 | constructor(_assets) 8 | { 9 | super() 10 | 11 | // Items (will contain every resources) 12 | this.items = {} 13 | 14 | // Loader 15 | this.loader = new Loader({ renderer: this.renderer }) 16 | 17 | this.groups = {} 18 | this.groups.assets = [..._assets] 19 | this.groups.loaded = [] 20 | this.groups.current = null 21 | this.loadNextGroup() 22 | 23 | // Loader file end event 24 | this.loader.on('fileEnd', (_resource, _data) => 25 | { 26 | let data = _data 27 | 28 | // Convert to texture 29 | if(_resource.type === 'texture') 30 | { 31 | if(!(data instanceof THREE.Texture)) 32 | { 33 | data = new THREE.Texture(_data) 34 | } 35 | data.needsUpdate = true 36 | } 37 | 38 | this.items[_resource.name] = data 39 | 40 | // Progress and event 41 | this.groups.current.loaded++ 42 | this.trigger('progress', [this.groups.current, _resource, data]) 43 | }) 44 | 45 | // Loader all end event 46 | this.loader.on('end', () => 47 | { 48 | this.groups.loaded.push(this.groups.current) 49 | 50 | // Trigger 51 | this.trigger('groupEnd', [this.groups.current]) 52 | 53 | if(this.groups.assets.length > 0) 54 | { 55 | this.loadNextGroup() 56 | } 57 | else 58 | { 59 | this.trigger('end') 60 | } 61 | }) 62 | } 63 | 64 | loadNextGroup() 65 | { 66 | this.groups.current = this.groups.assets.shift() 67 | this.groups.current.toLoad = this.groups.current.items.length 68 | this.groups.current.loaded = 0 69 | 70 | this.loader.load(this.groups.current.items) 71 | } 72 | 73 | createInstancedMeshes(_children, _groups) 74 | { 75 | // Groups 76 | const groups = [] 77 | 78 | for(const _group of _groups) 79 | { 80 | groups.push({ 81 | name: _group.name, 82 | regex: _group.regex, 83 | meshesGroups: [], 84 | instancedMeshes: [] 85 | }) 86 | } 87 | 88 | // Result 89 | const result = {} 90 | 91 | for(const _group of groups) 92 | { 93 | result[_group.name] = _group.instancedMeshes 94 | } 95 | 96 | return result 97 | } 98 | 99 | destroy() 100 | { 101 | for(const _itemKey in this.items) 102 | { 103 | const item = this.items[_itemKey] 104 | if(item instanceof THREE.Texture) 105 | { 106 | item.dispose() 107 | } 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.toptal.com/developers/gitignore/api/macos,node 3 | # Edit at https://www.toptal.com/developers/gitignore?templates=macos,node 4 | 5 | ### macOS ### 6 | # General 7 | .DS_Store 8 | .AppleDouble 9 | .LSOverride 10 | 11 | # Icon must end with two \r 12 | Icon 13 | 14 | 15 | # Thumbnails 16 | ._* 17 | 18 | # Files that might appear in the root of a volume 19 | .DocumentRevisions-V100 20 | .fseventsd 21 | .Spotlight-V100 22 | .TemporaryItems 23 | .Trashes 24 | .VolumeIcon.icns 25 | .com.apple.timemachine.donotpresent 26 | 27 | # Directories potentially created on remote AFP share 28 | .AppleDB 29 | .AppleDesktop 30 | Network Trash Folder 31 | Temporary Items 32 | .apdisk 33 | 34 | ### Node ### 35 | # Logs 36 | logs 37 | *.log 38 | npm-debug.log* 39 | yarn-debug.log* 40 | yarn-error.log* 41 | lerna-debug.log* 42 | .pnpm-debug.log* 43 | 44 | # Diagnostic reports (https://nodejs.org/api/report.html) 45 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 46 | 47 | # Runtime data 48 | pids 49 | *.pid 50 | *.seed 51 | *.pid.lock 52 | 53 | # Directory for instrumented libs generated by jscoverage/JSCover 54 | lib-cov 55 | 56 | # Coverage directory used by tools like istanbul 57 | coverage 58 | *.lcov 59 | 60 | # nyc test coverage 61 | .nyc_output 62 | 63 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 64 | .grunt 65 | 66 | # Bower dependency directory (https://bower.io/) 67 | bower_components 68 | 69 | # node-waf configuration 70 | .lock-wscript 71 | 72 | # Compiled binary addons (https://nodejs.org/api/addons.html) 73 | build/Release 74 | 75 | # Dependency directories 76 | node_modules/ 77 | jspm_packages/ 78 | 79 | # Snowpack dependency directory (https://snowpack.dev/) 80 | web_modules/ 81 | 82 | # TypeScript cache 83 | *.tsbuildinfo 84 | 85 | # Optional npm cache directory 86 | .npm 87 | 88 | # Optional eslint cache 89 | .eslintcache 90 | 91 | # Microbundle cache 92 | .rpt2_cache/ 93 | .rts2_cache_cjs/ 94 | .rts2_cache_es/ 95 | .rts2_cache_umd/ 96 | 97 | # Optional REPL history 98 | .node_repl_history 99 | 100 | # Output of 'npm pack' 101 | *.tgz 102 | 103 | # Yarn Integrity file 104 | .yarn-integrity 105 | 106 | # dotenv environment variables file 107 | .env 108 | .env.test 109 | .env.production 110 | 111 | # parcel-bundler cache (https://parceljs.org/) 112 | .cache 113 | .parcel-cache 114 | 115 | # Next.js build output 116 | .next 117 | out 118 | 119 | # Nuxt.js build / generate output 120 | .nuxt 121 | dist 122 | 123 | # Gatsby files 124 | .cache/ 125 | # Comment in the public line in if your project uses Gatsby and not Next.js 126 | # https://nextjs.org/blog/next-9-1#public-directory-support 127 | # public 128 | 129 | # vuepress build output 130 | .vuepress/dist 131 | 132 | # Serverless directories 133 | .serverless/ 134 | 135 | # FuseBox cache 136 | .fusebox/ 137 | 138 | # DynamoDB Local files 139 | .dynamodb/ 140 | 141 | # TernJS port file 142 | .tern-port 143 | 144 | # Stores VSCode versions used for testing VSCode extensions 145 | .vscode-test 146 | 147 | # yarn v2 148 | .yarn/cache 149 | .yarn/unplugged 150 | .yarn/build-state.yml 151 | .yarn/install-state.gz 152 | .pnp.* 153 | 154 | # End of https://www.toptal.com/developers/gitignore/api/macos,node -------------------------------------------------------------------------------- /src/Experience/Utils/Stats.js: -------------------------------------------------------------------------------- 1 | import StatsJs from 'stats.js' 2 | 3 | export default class Stats 4 | { 5 | constructor(_active) 6 | { 7 | this.instance = new StatsJs() 8 | this.instance.showPanel(3) 9 | 10 | this.active = false 11 | this.max = 40 12 | this.ignoreMaxed = true 13 | 14 | if(_active) 15 | { 16 | this.activate() 17 | } 18 | } 19 | 20 | activate() 21 | { 22 | this.active = true 23 | 24 | document.body.appendChild(this.instance.dom) 25 | } 26 | 27 | deactivate() 28 | { 29 | this.active = false 30 | 31 | document.body.removeChild(this.instance.dom) 32 | } 33 | 34 | setRenderPanel(_context) 35 | { 36 | this.render = {} 37 | this.render.context = _context 38 | this.render.extension = this.render.context.getExtension('EXT_disjoint_timer_query_webgl2') 39 | this.render.panel = this.instance.addPanel(new StatsJs.Panel('Render (ms)', '#f8f', '#212')) 40 | 41 | const webGL2 = typeof WebGL2RenderingContext !== 'undefined' && _context instanceof WebGL2RenderingContext 42 | 43 | if(!webGL2 || !this.render.extension) 44 | { 45 | this.deactivate() 46 | } 47 | } 48 | 49 | beforeRender() 50 | { 51 | if(!this.active) 52 | { 53 | return 54 | } 55 | 56 | // Setup 57 | this.queryCreated = false 58 | let queryResultAvailable = false 59 | 60 | // Test if query result available 61 | if(this.render.query) 62 | { 63 | queryResultAvailable = this.render.context.getQueryParameter(this.render.query, this.render.context.QUERY_RESULT_AVAILABLE) 64 | const disjoint = this.render.context.getParameter(this.render.extension.GPU_DISJOINT_EXT) 65 | 66 | if(queryResultAvailable && !disjoint) 67 | { 68 | const elapsedNanos = this.render.context.getQueryParameter(this.render.query, this.render.context.QUERY_RESULT) 69 | const panelValue = Math.min(elapsedNanos / 1000 / 1000, this.max) 70 | 71 | if(panelValue === this.max && this.ignoreMaxed) 72 | { 73 | 74 | } 75 | else 76 | { 77 | this.render.panel.update(panelValue, this.max) 78 | } 79 | } 80 | } 81 | 82 | // If query result available or no query yet 83 | if(queryResultAvailable || !this.render.query) 84 | { 85 | // Create new query 86 | this.queryCreated = true 87 | this.render.query = this.render.context.createQuery() 88 | this.render.context.beginQuery(this.render.extension.TIME_ELAPSED_EXT, this.render.query) 89 | } 90 | 91 | } 92 | 93 | afterRender() 94 | { 95 | if(!this.active) 96 | { 97 | return 98 | } 99 | 100 | // End the query (result will be available "later") 101 | if(this.queryCreated) 102 | { 103 | this.render.context.endQuery(this.render.extension.TIME_ELAPSED_EXT) 104 | } 105 | } 106 | 107 | update() 108 | { 109 | if(!this.active) 110 | { 111 | return 112 | } 113 | 114 | this.instance.update() 115 | } 116 | 117 | destroy() 118 | { 119 | this.deactivate() 120 | } 121 | } -------------------------------------------------------------------------------- /src/Experience/Experience.js: -------------------------------------------------------------------------------- 1 | import * as THREE from 'three' 2 | import { Pane } from 'tweakpane' 3 | 4 | import Time from './Utils/Time.js' 5 | import Sizes from './Utils/Sizes.js' 6 | import Stats from './Utils/Stats.js' 7 | 8 | import Resources from './Resources.js' 9 | import Renderer from './Renderer.js' 10 | import Camera from './Camera.js' 11 | import World from './World.js' 12 | 13 | import assets from './assets.js' 14 | 15 | export default class Experience 16 | { 17 | static instance 18 | 19 | constructor(_options = {}) 20 | { 21 | if(Experience.instance) 22 | { 23 | return Experience.instance 24 | } 25 | Experience.instance = this 26 | 27 | // Options 28 | this.targetElement = _options.targetElement 29 | 30 | if(!this.targetElement) 31 | { 32 | console.warn('Missing \'targetElement\' property') 33 | return 34 | } 35 | 36 | this.time = new Time() 37 | this.sizes = new Sizes() 38 | this.setConfig() 39 | this.setStats() 40 | this.setDebug() 41 | this.setScene() 42 | this.setCamera() 43 | this.setRenderer() 44 | this.setResources() 45 | this.setWorld() 46 | 47 | this.sizes.on('resize', () => 48 | { 49 | this.resize() 50 | }) 51 | 52 | this.update() 53 | } 54 | 55 | setConfig() 56 | { 57 | this.config = {} 58 | 59 | // Debug 60 | this.config.debug = window.location.hash === '#debug' 61 | 62 | // Pixel ratio 63 | this.config.pixelRatio = Math.min(Math.max(window.devicePixelRatio, 1), 2) 64 | 65 | // Width and height 66 | const boundings = this.targetElement.getBoundingClientRect() 67 | this.config.width = boundings.width 68 | this.config.height = boundings.height || window.innerHeight 69 | } 70 | 71 | setStats() 72 | { 73 | if(this.config.debug) 74 | { 75 | this.stats = new Stats(true) 76 | } 77 | } 78 | 79 | setDebug() 80 | { 81 | if(this.config.debug) 82 | { 83 | this.debug = new Pane() 84 | this.debug.containerElem_.style.width = '320px' 85 | } 86 | } 87 | 88 | setScene() 89 | { 90 | this.scene = new THREE.Scene() 91 | } 92 | 93 | setCamera() 94 | { 95 | this.camera = new Camera() 96 | } 97 | 98 | setRenderer() 99 | { 100 | this.renderer = new Renderer({ rendererInstance: this.rendererInstance }) 101 | 102 | this.targetElement.appendChild(this.renderer.instance.domElement) 103 | } 104 | 105 | setResources() 106 | { 107 | this.resources = new Resources(assets) 108 | } 109 | 110 | setWorld() 111 | { 112 | this.world = new World() 113 | } 114 | 115 | update() 116 | { 117 | if(this.stats) 118 | this.stats.update() 119 | 120 | this.camera.update() 121 | 122 | if(this.world) 123 | this.world.update() 124 | 125 | if(this.renderer) 126 | this.renderer.update() 127 | 128 | window.requestAnimationFrame(() => 129 | { 130 | this.update() 131 | }) 132 | } 133 | 134 | resize() 135 | { 136 | // Config 137 | const boundings = this.targetElement.getBoundingClientRect() 138 | this.config.width = boundings.width 139 | this.config.height = boundings.height 140 | 141 | this.config.pixelRatio = Math.min(Math.max(window.devicePixelRatio, 1), 2) 142 | 143 | if(this.camera) 144 | this.camera.resize() 145 | 146 | if(this.renderer) 147 | this.renderer.resize() 148 | 149 | if(this.world) 150 | this.world.resize() 151 | } 152 | 153 | destroy() 154 | { 155 | 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /src/Experience/Picture/Picture.js: -------------------------------------------------------------------------------- 1 | import * as THREE from 'three' 2 | 3 | import Experience from '../Experience.js' 4 | import FlowField from './FlowField.js' 5 | import vertexShader from '../shaders/particles/vertex.glsl' 6 | import fragmentShader from '../shaders/particles/fragment.glsl' 7 | 8 | export default class Picture 9 | { 10 | constructor(_options) 11 | { 12 | this.experience = new Experience() 13 | this.config = this.experience.config 14 | this.resources = this.experience.resources 15 | this.scene = this.experience.scene 16 | this.debug = this.experience.debug 17 | 18 | this.width = 640 19 | this.height = 427 20 | this.ratio = this.width / this.height 21 | this.count = this.width * this.height 22 | 23 | if(this.debug) 24 | { 25 | this.debugFolder = this.debug.addFolder({ 26 | title: 'particles' 27 | }) 28 | } 29 | 30 | this.setPositions() 31 | this.setFlowfield() 32 | this.setGeometry() 33 | this.setMaterial() 34 | this.setPoints() 35 | } 36 | 37 | reset() 38 | { 39 | this.flowField.dispose() 40 | this.geometry.dispose() 41 | 42 | this.setPositions() 43 | this.setFlowfield() 44 | this.setGeometry() 45 | 46 | this.points.geometry = this.geometry 47 | } 48 | 49 | setPositions() 50 | { 51 | this.positions = new Float32Array(this.count * 3) 52 | 53 | for(let j = 0; j < this.height; j++) 54 | { 55 | for(let i = 0; i < this.width; i++) 56 | { 57 | this.positions[(j * this.width + i) * 3 + 0] = (i / this.width - 0.5) * this.ratio 58 | this.positions[(j * this.width + i) * 3 + 1] = j / this.height - 0.5 59 | this.positions[(j * this.width + i) * 3 + 2] = 0 60 | } 61 | } 62 | } 63 | 64 | setFlowfield() 65 | { 66 | this.flowField = new FlowField({ positions: this.positions, debugFolder: this.debugFolder }) 67 | } 68 | 69 | setGeometry() 70 | { 71 | const size = new Float32Array(this.count) 72 | const uv = new Float32Array(this.count * 2) 73 | 74 | for(let i = 0; i < this.count; i++) 75 | { 76 | size[i] = 0.2 + Math.random() * 0.8 77 | } 78 | 79 | for(let j = 0; j < this.height; j++) 80 | { 81 | for(let i = 0; i < this.width; i++) 82 | { 83 | uv[(j * this.width * 2) + (i * 2) + 0] = i / this.width 84 | uv[(j * this.width * 2) + (i * 2) + 1] = j / this.height 85 | } 86 | } 87 | 88 | this.geometry = new THREE.BufferGeometry() 89 | this.geometry.setAttribute('position', new THREE.BufferAttribute(this.positions, 3)) 90 | this.geometry.setAttribute('aSize', new THREE.BufferAttribute(size, 1)) 91 | this.geometry.setAttribute('aFboUv', this.flowField.fboUv.attribute) 92 | this.geometry.setAttribute('aUv', new THREE.BufferAttribute(uv, 2)) 93 | } 94 | 95 | setMaterial() 96 | { 97 | this.material = new THREE.ShaderMaterial({ 98 | uniforms: 99 | { 100 | uSize: { value: 50 * this.config.pixelRatio }, 101 | uTexture: { value: this.resources.items.imageTexture }, 102 | uFBOTexture: { value: this.flowField.texture } 103 | }, 104 | vertexShader: vertexShader, 105 | fragmentShader: fragmentShader 106 | }) 107 | 108 | 109 | if(this.debug) 110 | { 111 | this.debugFolder 112 | .addInput( 113 | this.material.uniforms.uSize, 114 | 'value', 115 | { label: 'uSize', min: 1, max: 100, step: 1 } 116 | ) 117 | } 118 | } 119 | 120 | setPoints() 121 | { 122 | this.points = new THREE.Points(this.geometry, this.material) 123 | this.scene.add(this.points) 124 | } 125 | 126 | update() 127 | { 128 | this.flowField.update() 129 | this.material.uniforms.uFBOTexture.value = this.flowField.texture 130 | } 131 | } -------------------------------------------------------------------------------- /src/Experience/Renderer.js: -------------------------------------------------------------------------------- 1 | import * as THREE from 'three' 2 | import Experience from './Experience.js' 3 | import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js' 4 | import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js' 5 | 6 | export default class Renderer 7 | { 8 | constructor(_options = {}) 9 | { 10 | this.experience = new Experience() 11 | this.config = this.experience.config 12 | this.debug = this.experience.debug 13 | this.stats = this.experience.stats 14 | this.time = this.experience.time 15 | this.sizes = this.experience.sizes 16 | this.scene = this.experience.scene 17 | this.camera = this.experience.camera 18 | 19 | this.usePostprocess = false 20 | 21 | this.setInstance() 22 | this.setPostProcess() 23 | } 24 | 25 | setInstance() 26 | { 27 | this.clearColor = '#eeeeee' 28 | 29 | // Renderer 30 | this.instance = new THREE.WebGLRenderer({ 31 | alpha: false, 32 | antialias: true 33 | }) 34 | this.instance.domElement.style.position = 'absolute' 35 | this.instance.domElement.style.top = 0 36 | this.instance.domElement.style.left = 0 37 | this.instance.domElement.style.width = '100%' 38 | this.instance.domElement.style.height = '100%' 39 | 40 | // this.instance.setClearColor(0x414141, 1) 41 | this.instance.setClearColor(this.clearColor, 1) 42 | this.instance.setSize(this.config.width, this.config.height) 43 | this.instance.setPixelRatio(this.config.pixelRatio) 44 | 45 | // this.instance.physicallyCorrectLights = true 46 | // this.instance.gammaOutPut = true 47 | // this.instance.outputEncoding = THREE.sRGBEncoding 48 | // this.instance.shadowMap.type = THREE.PCFSoftShadowMap 49 | // this.instance.shadowMap.enabled = false 50 | // this.instance.toneMapping = THREE.ReinhardToneMapping 51 | // this.instance.toneMapping = THREE.ReinhardToneMapping 52 | // this.instance.toneMappingExposure = 1.3 53 | 54 | this.context = this.instance.getContext() 55 | 56 | // Add stats panel 57 | if(this.stats) 58 | { 59 | this.stats.setRenderPanel(this.context) 60 | } 61 | } 62 | 63 | setPostProcess() 64 | { 65 | this.postProcess = {} 66 | 67 | /** 68 | * Render pass 69 | */ 70 | this.postProcess.renderPass = new RenderPass(this.scene, this.camera.instance) 71 | 72 | /** 73 | * Effect composer 74 | */ 75 | const RenderTargetClass = this.config.pixelRatio >= 2 ? THREE.WebGLRenderTarget : THREE.WebGLMultisampleRenderTarget 76 | // const RenderTargetClass = THREE.WebGLRenderTarget 77 | this.renderTarget = new RenderTargetClass( 78 | this.config.width, 79 | this.config.height, 80 | { 81 | generateMipmaps: false, 82 | minFilter: THREE.LinearFilter, 83 | magFilter: THREE.LinearFilter, 84 | format: THREE.RGBFormat, 85 | encoding: THREE.sRGBEncoding 86 | } 87 | ) 88 | this.postProcess.composer = new EffectComposer(this.instance, this.renderTarget) 89 | this.postProcess.composer.setSize(this.config.width, this.config.height) 90 | this.postProcess.composer.setPixelRatio(this.config.pixelRatio) 91 | 92 | this.postProcess.composer.addPass(this.postProcess.renderPass) 93 | } 94 | 95 | resize() 96 | { 97 | // Instance 98 | this.instance.setSize(this.config.width, this.config.height) 99 | this.instance.setPixelRatio(this.config.pixelRatio) 100 | 101 | // Post process 102 | this.postProcess.composer.setSize(this.config.width, this.config.height) 103 | this.postProcess.composer.setPixelRatio(this.config.pixelRatio) 104 | } 105 | 106 | update() 107 | { 108 | if(this.stats) 109 | { 110 | this.stats.beforeRender() 111 | } 112 | 113 | if(this.usePostprocess) 114 | { 115 | this.postProcess.composer.render() 116 | } 117 | else 118 | { 119 | this.instance.render(this.scene, this.camera.instance) 120 | } 121 | 122 | if(this.stats) 123 | { 124 | this.stats.afterRender() 125 | } 126 | } 127 | 128 | destroy() 129 | { 130 | this.instance.renderLists.dispose() 131 | this.instance.dispose() 132 | this.renderTarget.dispose() 133 | this.postProcess.composer.renderTarget1.dispose() 134 | this.postProcess.composer.renderTarget2.dispose() 135 | } 136 | } -------------------------------------------------------------------------------- /src/Experience/Utils/Loader.js: -------------------------------------------------------------------------------- 1 | import EventEmitter from './EventEmitter.js' 2 | import Experience from '../Experience.js' 3 | import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js' 4 | import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader.js' 5 | import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js' 6 | import { RGBELoader } from 'three/examples/jsm/loaders/RGBELoader.js' 7 | import { BasisTextureLoader } from 'three/examples/jsm/loaders/BasisTextureLoader.js' 8 | 9 | export default class Resources extends EventEmitter 10 | { 11 | /** 12 | * Constructor 13 | */ 14 | constructor() 15 | { 16 | super() 17 | 18 | this.experience = new Experience() 19 | this.renderer = this.experience.renderer.instance 20 | 21 | this.setLoaders() 22 | 23 | this.toLoad = 0 24 | this.loaded = 0 25 | this.items = {} 26 | } 27 | 28 | /** 29 | * Set loaders 30 | */ 31 | setLoaders() 32 | { 33 | this.loaders = [] 34 | 35 | // Images 36 | this.loaders.push({ 37 | extensions: ['jpg', 'png'], 38 | action: (_resource) => 39 | { 40 | const image = new Image() 41 | 42 | image.addEventListener('load', () => 43 | { 44 | this.fileLoadEnd(_resource, image) 45 | }) 46 | 47 | image.addEventListener('error', () => 48 | { 49 | this.fileLoadEnd(_resource, image) 50 | }) 51 | 52 | image.src = _resource.source 53 | } 54 | }) 55 | 56 | // Basis images 57 | const basisLoader = new BasisTextureLoader() 58 | basisLoader.setTranscoderPath('basis/') 59 | basisLoader.detectSupport(this.renderer) 60 | 61 | this.loaders.push({ 62 | extensions: ['basis'], 63 | action: (_resource) => 64 | { 65 | basisLoader.load(_resource.source, (_data) => 66 | { 67 | this.fileLoadEnd(_resource, _data) 68 | }) 69 | } 70 | }) 71 | 72 | // Draco 73 | const dracoLoader = new DRACOLoader() 74 | dracoLoader.setDecoderPath('draco/') 75 | dracoLoader.setDecoderConfig({ type: 'js' }) 76 | 77 | this.loaders.push({ 78 | extensions: ['drc'], 79 | action: (_resource) => 80 | { 81 | dracoLoader.load(_resource.source, (_data) => 82 | { 83 | this.fileLoadEnd(_resource, _data) 84 | 85 | DRACOLoader.releaseDecoderModule() 86 | }) 87 | } 88 | }) 89 | 90 | // GLTF 91 | const gltfLoader = new GLTFLoader() 92 | gltfLoader.setDRACOLoader(dracoLoader) 93 | 94 | this.loaders.push({ 95 | extensions: ['glb', 'gltf'], 96 | action: (_resource) => 97 | { 98 | gltfLoader.load(_resource.source, (_data) => 99 | { 100 | this.fileLoadEnd(_resource, _data) 101 | }) 102 | } 103 | }) 104 | 105 | // FBX 106 | const fbxLoader = new FBXLoader() 107 | 108 | this.loaders.push({ 109 | extensions: ['fbx'], 110 | action: (_resource) => 111 | { 112 | fbxLoader.load(_resource.source, (_data) => 113 | { 114 | this.fileLoadEnd(_resource, _data) 115 | }) 116 | } 117 | }) 118 | 119 | // RGBE | HDR 120 | const rgbeLoader = new RGBELoader() 121 | 122 | this.loaders.push({ 123 | extensions: ['hdr'], 124 | action: (_resource) => 125 | { 126 | rgbeLoader.load(_resource.source, (_data) => 127 | { 128 | this.fileLoadEnd(_resource, _data) 129 | }) 130 | } 131 | }) 132 | } 133 | 134 | /** 135 | * Load 136 | */ 137 | load(_resources = []) 138 | { 139 | for(const _resource of _resources) 140 | { 141 | this.toLoad++ 142 | const extensionMatch = _resource.source.match(/\.([a-z]+)$/) 143 | 144 | if(typeof extensionMatch[1] !== 'undefined') 145 | { 146 | const extension = extensionMatch[1] 147 | const loader = this.loaders.find((_loader) => _loader.extensions.find((_extension) => _extension === extension)) 148 | 149 | if(loader) 150 | { 151 | loader.action(_resource) 152 | } 153 | else 154 | { 155 | console.warn(`Cannot found loader for ${_resource}`) 156 | } 157 | } 158 | else 159 | { 160 | console.warn(`Cannot found extension of ${_resource}`) 161 | } 162 | } 163 | } 164 | 165 | /** 166 | * File load end 167 | */ 168 | fileLoadEnd(_resource, _data) 169 | { 170 | this.loaded++ 171 | this.items[_resource.name] = _data 172 | 173 | this.trigger('fileEnd', [_resource, _data]) 174 | 175 | if(this.loaded === this.toLoad) 176 | { 177 | this.trigger('end') 178 | } 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /src/Experience/shaders/partials/perlin4d.glsl: -------------------------------------------------------------------------------- 1 | // Classic Perlin 3D Noise 2 | // by Stefan Gustavson 3 | // 4 | vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);} 5 | vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;} 6 | vec4 fade(vec4 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);} 7 | 8 | float perlin4d(vec4 P){ 9 | vec4 Pi0 = floor(P); // Integer part for indexing 10 | vec4 Pi1 = Pi0 + 1.0; // Integer part + 1 11 | Pi0 = mod(Pi0, 289.0); 12 | Pi1 = mod(Pi1, 289.0); 13 | vec4 Pf0 = fract(P); // Fractional part for interpolation 14 | vec4 Pf1 = Pf0 - 1.0; // Fractional part - 1.0 15 | vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); 16 | vec4 iy = vec4(Pi0.yy, Pi1.yy); 17 | vec4 iz0 = vec4(Pi0.zzzz); 18 | vec4 iz1 = vec4(Pi1.zzzz); 19 | vec4 iw0 = vec4(Pi0.wwww); 20 | vec4 iw1 = vec4(Pi1.wwww); 21 | 22 | vec4 ixy = permute(permute(ix) + iy); 23 | vec4 ixy0 = permute(ixy + iz0); 24 | vec4 ixy1 = permute(ixy + iz1); 25 | vec4 ixy00 = permute(ixy0 + iw0); 26 | vec4 ixy01 = permute(ixy0 + iw1); 27 | vec4 ixy10 = permute(ixy1 + iw0); 28 | vec4 ixy11 = permute(ixy1 + iw1); 29 | 30 | vec4 gx00 = ixy00 / 7.0; 31 | vec4 gy00 = floor(gx00) / 7.0; 32 | vec4 gz00 = floor(gy00) / 6.0; 33 | gx00 = fract(gx00) - 0.5; 34 | gy00 = fract(gy00) - 0.5; 35 | gz00 = fract(gz00) - 0.5; 36 | vec4 gw00 = vec4(0.75) - abs(gx00) - abs(gy00) - abs(gz00); 37 | vec4 sw00 = step(gw00, vec4(0.0)); 38 | gx00 -= sw00 * (step(0.0, gx00) - 0.5); 39 | gy00 -= sw00 * (step(0.0, gy00) - 0.5); 40 | 41 | vec4 gx01 = ixy01 / 7.0; 42 | vec4 gy01 = floor(gx01) / 7.0; 43 | vec4 gz01 = floor(gy01) / 6.0; 44 | gx01 = fract(gx01) - 0.5; 45 | gy01 = fract(gy01) - 0.5; 46 | gz01 = fract(gz01) - 0.5; 47 | vec4 gw01 = vec4(0.75) - abs(gx01) - abs(gy01) - abs(gz01); 48 | vec4 sw01 = step(gw01, vec4(0.0)); 49 | gx01 -= sw01 * (step(0.0, gx01) - 0.5); 50 | gy01 -= sw01 * (step(0.0, gy01) - 0.5); 51 | 52 | vec4 gx10 = ixy10 / 7.0; 53 | vec4 gy10 = floor(gx10) / 7.0; 54 | vec4 gz10 = floor(gy10) / 6.0; 55 | gx10 = fract(gx10) - 0.5; 56 | gy10 = fract(gy10) - 0.5; 57 | gz10 = fract(gz10) - 0.5; 58 | vec4 gw10 = vec4(0.75) - abs(gx10) - abs(gy10) - abs(gz10); 59 | vec4 sw10 = step(gw10, vec4(0.0)); 60 | gx10 -= sw10 * (step(0.0, gx10) - 0.5); 61 | gy10 -= sw10 * (step(0.0, gy10) - 0.5); 62 | 63 | vec4 gx11 = ixy11 / 7.0; 64 | vec4 gy11 = floor(gx11) / 7.0; 65 | vec4 gz11 = floor(gy11) / 6.0; 66 | gx11 = fract(gx11) - 0.5; 67 | gy11 = fract(gy11) - 0.5; 68 | gz11 = fract(gz11) - 0.5; 69 | vec4 gw11 = vec4(0.75) - abs(gx11) - abs(gy11) - abs(gz11); 70 | vec4 sw11 = step(gw11, vec4(0.0)); 71 | gx11 -= sw11 * (step(0.0, gx11) - 0.5); 72 | gy11 -= sw11 * (step(0.0, gy11) - 0.5); 73 | 74 | vec4 g0000 = vec4(gx00.x,gy00.x,gz00.x,gw00.x); 75 | vec4 g1000 = vec4(gx00.y,gy00.y,gz00.y,gw00.y); 76 | vec4 g0100 = vec4(gx00.z,gy00.z,gz00.z,gw00.z); 77 | vec4 g1100 = vec4(gx00.w,gy00.w,gz00.w,gw00.w); 78 | vec4 g0010 = vec4(gx10.x,gy10.x,gz10.x,gw10.x); 79 | vec4 g1010 = vec4(gx10.y,gy10.y,gz10.y,gw10.y); 80 | vec4 g0110 = vec4(gx10.z,gy10.z,gz10.z,gw10.z); 81 | vec4 g1110 = vec4(gx10.w,gy10.w,gz10.w,gw10.w); 82 | vec4 g0001 = vec4(gx01.x,gy01.x,gz01.x,gw01.x); 83 | vec4 g1001 = vec4(gx01.y,gy01.y,gz01.y,gw01.y); 84 | vec4 g0101 = vec4(gx01.z,gy01.z,gz01.z,gw01.z); 85 | vec4 g1101 = vec4(gx01.w,gy01.w,gz01.w,gw01.w); 86 | vec4 g0011 = vec4(gx11.x,gy11.x,gz11.x,gw11.x); 87 | vec4 g1011 = vec4(gx11.y,gy11.y,gz11.y,gw11.y); 88 | vec4 g0111 = vec4(gx11.z,gy11.z,gz11.z,gw11.z); 89 | vec4 g1111 = vec4(gx11.w,gy11.w,gz11.w,gw11.w); 90 | 91 | vec4 norm00 = taylorInvSqrt(vec4(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100))); 92 | g0000 *= norm00.x; 93 | g0100 *= norm00.y; 94 | g1000 *= norm00.z; 95 | g1100 *= norm00.w; 96 | 97 | vec4 norm01 = taylorInvSqrt(vec4(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101))); 98 | g0001 *= norm01.x; 99 | g0101 *= norm01.y; 100 | g1001 *= norm01.z; 101 | g1101 *= norm01.w; 102 | 103 | vec4 norm10 = taylorInvSqrt(vec4(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110))); 104 | g0010 *= norm10.x; 105 | g0110 *= norm10.y; 106 | g1010 *= norm10.z; 107 | g1110 *= norm10.w; 108 | 109 | vec4 norm11 = taylorInvSqrt(vec4(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111))); 110 | g0011 *= norm11.x; 111 | g0111 *= norm11.y; 112 | g1011 *= norm11.z; 113 | g1111 *= norm11.w; 114 | 115 | float n0000 = dot(g0000, Pf0); 116 | float n1000 = dot(g1000, vec4(Pf1.x, Pf0.yzw)); 117 | float n0100 = dot(g0100, vec4(Pf0.x, Pf1.y, Pf0.zw)); 118 | float n1100 = dot(g1100, vec4(Pf1.xy, Pf0.zw)); 119 | float n0010 = dot(g0010, vec4(Pf0.xy, Pf1.z, Pf0.w)); 120 | float n1010 = dot(g1010, vec4(Pf1.x, Pf0.y, Pf1.z, Pf0.w)); 121 | float n0110 = dot(g0110, vec4(Pf0.x, Pf1.yz, Pf0.w)); 122 | float n1110 = dot(g1110, vec4(Pf1.xyz, Pf0.w)); 123 | float n0001 = dot(g0001, vec4(Pf0.xyz, Pf1.w)); 124 | float n1001 = dot(g1001, vec4(Pf1.x, Pf0.yz, Pf1.w)); 125 | float n0101 = dot(g0101, vec4(Pf0.x, Pf1.y, Pf0.z, Pf1.w)); 126 | float n1101 = dot(g1101, vec4(Pf1.xy, Pf0.z, Pf1.w)); 127 | float n0011 = dot(g0011, vec4(Pf0.xy, Pf1.zw)); 128 | float n1011 = dot(g1011, vec4(Pf1.x, Pf0.y, Pf1.zw)); 129 | float n0111 = dot(g0111, vec4(Pf0.x, Pf1.yzw)); 130 | float n1111 = dot(g1111, Pf1); 131 | 132 | vec4 fade_xyzw = fade(Pf0); 133 | vec4 n_0w = mix(vec4(n0000, n1000, n0100, n1100), vec4(n0001, n1001, n0101, n1101), fade_xyzw.w); 134 | vec4 n_1w = mix(vec4(n0010, n1010, n0110, n1110), vec4(n0011, n1011, n0111, n1111), fade_xyzw.w); 135 | vec4 n_zw = mix(n_0w, n_1w, fade_xyzw.z); 136 | vec2 n_yzw = mix(n_zw.xy, n_zw.zw, fade_xyzw.y); 137 | float n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x); 138 | return 2.2 * n_xyzw; 139 | } 140 | 141 | 142 | #pragma glslify: export(perlin4d) -------------------------------------------------------------------------------- /src/Experience/Utils/EventEmitter.js: -------------------------------------------------------------------------------- 1 | export default class 2 | { 3 | /** 4 | * Constructor 5 | */ 6 | constructor() 7 | { 8 | this.callbacks = {} 9 | this.callbacks.base = {} 10 | } 11 | 12 | /** 13 | * On 14 | */ 15 | on(_names, callback) 16 | { 17 | const that = this 18 | 19 | // Errors 20 | if(typeof _names === 'undefined' || _names === '') 21 | { 22 | console.warn('wrong names') 23 | return false 24 | } 25 | 26 | if(typeof callback === 'undefined') 27 | { 28 | console.warn('wrong callback') 29 | return false 30 | } 31 | 32 | // Resolve names 33 | const names = this.resolveNames(_names) 34 | 35 | // Each name 36 | names.forEach(function(_name) 37 | { 38 | // Resolve name 39 | const name = that.resolveName(_name) 40 | 41 | // Create namespace if not exist 42 | if(!(that.callbacks[ name.namespace ] instanceof Object)) 43 | that.callbacks[ name.namespace ] = {} 44 | 45 | // Create callback if not exist 46 | if(!(that.callbacks[ name.namespace ][ name.value ] instanceof Array)) 47 | that.callbacks[ name.namespace ][ name.value ] = [] 48 | 49 | // Add callback 50 | that.callbacks[ name.namespace ][ name.value ].push(callback) 51 | }) 52 | 53 | return this 54 | } 55 | 56 | /** 57 | * Off 58 | */ 59 | off(_names) 60 | { 61 | const that = this 62 | 63 | // Errors 64 | if(typeof _names === 'undefined' || _names === '') 65 | { 66 | console.warn('wrong name') 67 | return false 68 | } 69 | 70 | // Resolve names 71 | const names = this.resolveNames(_names) 72 | 73 | // Each name 74 | names.forEach(function(_name) 75 | { 76 | // Resolve name 77 | const name = that.resolveName(_name) 78 | 79 | // Remove namespace 80 | if(name.namespace !== 'base' && name.value === '') 81 | { 82 | delete that.callbacks[ name.namespace ] 83 | } 84 | 85 | // Remove specific callback in namespace 86 | else 87 | { 88 | // Default 89 | if(name.namespace === 'base') 90 | { 91 | // Try to remove from each namespace 92 | for(const namespace in that.callbacks) 93 | { 94 | if(that.callbacks[ namespace ] instanceof Object && that.callbacks[ namespace ][ name.value ] instanceof Array) 95 | { 96 | delete that.callbacks[ namespace ][ name.value ] 97 | 98 | // Remove namespace if empty 99 | if(Object.keys(that.callbacks[ namespace ]).length === 0) 100 | delete that.callbacks[ namespace ] 101 | } 102 | } 103 | } 104 | 105 | // Specified namespace 106 | else if(that.callbacks[ name.namespace ] instanceof Object && that.callbacks[ name.namespace ][ name.value ] instanceof Array) 107 | { 108 | delete that.callbacks[ name.namespace ][ name.value ] 109 | 110 | // Remove namespace if empty 111 | if(Object.keys(that.callbacks[ name.namespace ]).length === 0) 112 | delete that.callbacks[ name.namespace ] 113 | } 114 | } 115 | }) 116 | 117 | return this 118 | } 119 | 120 | /** 121 | * Trigger 122 | */ 123 | trigger(_name, _args) 124 | { 125 | // Errors 126 | if(typeof _name === 'undefined' || _name === '') 127 | { 128 | console.warn('wrong name') 129 | return false 130 | } 131 | 132 | const that = this 133 | let finalResult = null 134 | let result = null 135 | 136 | // Default args 137 | const args = !(_args instanceof Array) ? [] : _args 138 | 139 | // Resolve names (should on have one event) 140 | let name = this.resolveNames(_name) 141 | 142 | // Resolve name 143 | name = this.resolveName(name[ 0 ]) 144 | 145 | // Default namespace 146 | if(name.namespace === 'base') 147 | { 148 | // Try to find callback in each namespace 149 | for(const namespace in that.callbacks) 150 | { 151 | if(that.callbacks[ namespace ] instanceof Object && that.callbacks[ namespace ][ name.value ] instanceof Array) 152 | { 153 | that.callbacks[ namespace ][ name.value ].forEach(function(callback) 154 | { 155 | result = callback.apply(that, args) 156 | 157 | if(typeof finalResult === 'undefined') 158 | { 159 | finalResult = result 160 | } 161 | }) 162 | } 163 | } 164 | } 165 | 166 | // Specified namespace 167 | else if(this.callbacks[ name.namespace ] instanceof Object) 168 | { 169 | if(name.value === '') 170 | { 171 | console.warn('wrong name') 172 | return this 173 | } 174 | 175 | that.callbacks[ name.namespace ][ name.value ].forEach(function(callback) 176 | { 177 | result = callback.apply(that, args) 178 | 179 | if(typeof finalResult === 'undefined') 180 | finalResult = result 181 | }) 182 | } 183 | 184 | return finalResult 185 | } 186 | 187 | /** 188 | * Resolve names 189 | */ 190 | resolveNames(_names) 191 | { 192 | let names = _names 193 | names = names.replace(/[^a-zA-Z0-9 ,/.]/g, '') 194 | names = names.replace(/[,/]+/g, ' ') 195 | names = names.split(' ') 196 | 197 | return names 198 | } 199 | 200 | /** 201 | * Resolve name 202 | */ 203 | resolveName(name) 204 | { 205 | const newName = {} 206 | const parts = name.split('.') 207 | 208 | newName.original = name 209 | newName.value = parts[ 0 ] 210 | newName.namespace = 'base' // Base namespace 211 | 212 | // Specified namespace 213 | if(parts.length > 1 && parts[ 1 ] !== '') 214 | { 215 | newName.namespace = parts[ 1 ] 216 | } 217 | 218 | return newName 219 | } 220 | } 221 | -------------------------------------------------------------------------------- /src/Experience/Picture/FlowField.js: -------------------------------------------------------------------------------- 1 | import * as THREE from 'three' 2 | 3 | import Experience from '../Experience.js' 4 | import vertexShader from '../shaders/flowField/vertex.glsl' 5 | import fragmentShader from '../shaders/flowField/fragment.glsl' 6 | 7 | export default class FlowField 8 | { 9 | constructor(_options) 10 | { 11 | this.experience = new Experience() 12 | this.renderer = this.experience.renderer 13 | this.time = this.experience.time 14 | this.scene = this.experience.scene 15 | 16 | this.positions = _options.positions 17 | this.debug = _options.debugFolder 18 | 19 | this.count = this.positions.length / 3 20 | this.width = 640 21 | this.height = 427 22 | this.texture = null 23 | this.seed = Math.random() * 1000 24 | 25 | if(this.debug) 26 | { 27 | this.debugFolder = this.debug.addFolder({ 28 | title: 'flowField' 29 | }) 30 | } 31 | 32 | this.setBaseTexture() 33 | this.setRenderTargets() 34 | this.setEnvironment() 35 | this.setPlane() 36 | this.setDebugPlane() 37 | this.setFboUv() 38 | 39 | this.render() 40 | } 41 | 42 | setBaseTexture() 43 | { 44 | const size = this.width * this.height 45 | const data = new Float32Array(size * 4) 46 | 47 | for(let i = 0; i < size; i++) 48 | { 49 | data[i * 4 + 0] = this.positions[i * 3 + 0] 50 | data[i * 4 + 1] = this.positions[i * 3 + 1] 51 | data[i * 4 + 2] = this.positions[i * 3 + 2] 52 | data[i * 4 + 3] = Math.random() 53 | } 54 | 55 | this.baseTexture = new THREE.DataTexture( 56 | data, 57 | this.width, 58 | this.height, 59 | THREE.RGBAFormat, 60 | THREE.FloatType 61 | ) 62 | this.baseTexture.minFilter = THREE.NearestFilter 63 | this.baseTexture.magFilter = THREE.NearestFilter 64 | this.baseTexture.generateMipmaps = false 65 | } 66 | 67 | setRenderTargets() 68 | { 69 | this.renderTargets = {} 70 | this.renderTargets.a = new THREE.WebGLRenderTarget( 71 | this.width, 72 | this.height, 73 | { 74 | minFilter: THREE.NearestFilter, 75 | magFilter: THREE.NearestFilter, 76 | generateMipmaps: false, 77 | format: THREE.RGBAFormat, 78 | type: THREE.FloatType, 79 | encoding: THREE.LinearEncoding, 80 | depthBuffer: false, 81 | stencilBuffer: false 82 | } 83 | ) 84 | this.renderTargets.b = this.renderTargets.a.clone() 85 | this.renderTargets.primary = this.renderTargets.a 86 | this.renderTargets.secondary = this.renderTargets.b 87 | } 88 | 89 | setEnvironment() 90 | { 91 | this.environment = {} 92 | 93 | this.environment.scene = new THREE.Scene() 94 | this.environment.camera = new THREE.OrthographicCamera(-0.5, 0.5, 0.5, -0.5, 0.1, 10) 95 | this.environment.camera.position.z = 1 96 | } 97 | 98 | setPlane() 99 | { 100 | this.plane = {} 101 | 102 | // Geometry 103 | this.plane.geometry = new THREE.PlaneGeometry(1, 1, 1, 1) 104 | 105 | // Material 106 | this.plane.material = new THREE.ShaderMaterial({ 107 | // precision: 'highp', 108 | uniforms: 109 | { 110 | uTime: { value: 0 }, 111 | uDelta: { value: 16 }, 112 | 113 | uBaseTexture: { value: this.baseTexture }, 114 | uTexture: { value: this.baseTexture }, 115 | 116 | uDecaySpeed: { value: 0.00049 }, 117 | 118 | uPerlinFrequency: { value: 4 }, 119 | uPerlinMultiplier: { value: 0.004 }, 120 | uTimeFrequency: { value: 0.0004 }, 121 | uSeed: { value: this.seed } 122 | }, 123 | vertexShader: vertexShader, 124 | fragmentShader: fragmentShader 125 | }) 126 | 127 | // Mesh 128 | this.plane.mesh = new THREE.Mesh(this.plane.geometry, this.plane.material) 129 | this.environment.scene.add(this.plane.mesh) 130 | 131 | // Debug 132 | if(this.debug) 133 | { 134 | this.debugFolder 135 | .addInput( 136 | this.plane.material.uniforms.uDecaySpeed, 137 | 'value', 138 | { label: 'uDecaySpeed', min: 0, max: 0.005, step: 0.00001 } 139 | ) 140 | 141 | this.debugFolder 142 | .addInput( 143 | this.plane.material.uniforms.uPerlinFrequency, 144 | 'value', 145 | { label: 'uPerlinFrequency', min: 0, max: 5, step: 0.001 } 146 | ) 147 | 148 | this.debugFolder 149 | .addInput( 150 | this.plane.material.uniforms.uPerlinMultiplier, 151 | 'value', 152 | { label: 'uPerlinMultiplier', min: 0, max: 0.1, step: 0.001 } 153 | ) 154 | 155 | this.debugFolder 156 | .addInput( 157 | this.plane.material.uniforms.uTimeFrequency, 158 | 'value', 159 | { label: 'uTimeFrequency', min: 0, max: 0.005, step: 0.0001 } 160 | ) 161 | } 162 | } 163 | 164 | setDebugPlane() 165 | { 166 | this.debugPlane = {} 167 | 168 | // Geometry 169 | this.debugPlane.geometry = new THREE.PlaneGeometry(1, this.height / this.width, 1, 1) 170 | 171 | // Material 172 | this.debugPlane.material = new THREE.MeshBasicMaterial({ transparent: true }) 173 | 174 | // Mesh 175 | this.debugPlane.mesh = new THREE.Mesh(this.debugPlane.geometry, this.debugPlane.material) 176 | this.debugPlane.mesh.visible = false 177 | this.scene.add(this.debugPlane.mesh) 178 | 179 | // Debug 180 | if(this.debug) 181 | { 182 | this.debugFolder 183 | .addInput( 184 | this.debugPlane.mesh, 185 | 'visible', 186 | { label: 'debugPlaneVisible' } 187 | ) 188 | } 189 | } 190 | 191 | setFboUv() 192 | { 193 | this.fboUv = {} 194 | 195 | this.fboUv.data = new Float32Array(this.count * 2) 196 | 197 | const halfExtentX = 1 / this.width / 2 198 | const halfExtentY = 1 / this.height / 2 199 | 200 | for(let i = 0; i < this.count; i++) 201 | { 202 | const x = (i % this.width) / this.width + halfExtentX 203 | const y = Math.floor(i / this.width) / this.height + halfExtentY 204 | 205 | this.fboUv.data[i * 2 + 0] = x 206 | this.fboUv.data[i * 2 + 1] = y 207 | } 208 | 209 | this.fboUv.attribute = new THREE.BufferAttribute(this.fboUv.data, 2) 210 | } 211 | 212 | render() 213 | { 214 | // Render 215 | this.renderer.instance.setRenderTarget(this.renderTargets.primary) 216 | this.renderer.instance.render(this.environment.scene, this.environment.camera) 217 | this.renderer.instance.setRenderTarget(null) 218 | 219 | // Swap 220 | const temp = this.renderTargets.primary 221 | this.renderTargets.primary = this.renderTargets.secondary 222 | this.renderTargets.secondary = temp 223 | 224 | // Update texture 225 | this.texture = this.renderTargets.secondary.texture 226 | 227 | // Update debug plane 228 | this.debugPlane.material.map = this.texture 229 | } 230 | 231 | update() 232 | { 233 | // Update material 234 | this.plane.material.uniforms.uDelta.value = this.time.delta 235 | this.plane.material.uniforms.uTime.value = this.time.elapsed 236 | this.plane.material.uniforms.uTexture.value = this.renderTargets.secondary.texture 237 | 238 | this.render() 239 | } 240 | 241 | dispose() 242 | { 243 | this.baseTexture.dispose() 244 | this.renderTargets.a.dispose() 245 | this.renderTargets.b.dispose() 246 | this.plane.geometry.dispose() 247 | this.plane.material.dispose() 248 | 249 | this.debugPlane.geometry.dispose() 250 | this.scene.remove(this.debugPlane.mesh) 251 | 252 | if(this.debug) 253 | { 254 | this.debugFolder.dispose() 255 | } 256 | } 257 | } -------------------------------------------------------------------------------- /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=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 13664},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