diff --git a/.github/renovate.json b/.github/renovate.json index 59306918fe3901..f676c0a3ab7973 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -1,7 +1,8 @@ { "extends": [ "config:base", - ":disableDependencyDashboard" + ":disableDependencyDashboard", + "helpers:pinGitHubActionDigests" ], "timezone": "Asia/Tokyo", "schedule": ["after 1am and before 7am every monday"], diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9146c9936daa21..91a7c6a27741db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,9 +21,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Git checkout - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 - name: Install Node - uses: actions/setup-node@v3 + uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3 with: node-version: 18 cache: 'npm' @@ -38,9 +38,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Git checkout - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 - name: Install Node - uses: actions/setup-node@v3 + uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3 with: node-version: 18 cache: 'npm' @@ -63,9 +63,9 @@ jobs: CI: ${{ matrix.CI }} steps: - name: Git checkout - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 - name: Install Node - uses: actions/setup-node@v3 + uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3 with: node-version: 18 cache: 'npm' @@ -77,7 +77,7 @@ jobs: - name: === E2E testing === run: npm run test-e2e - name: Upload output screenshots - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 if: always() with: name: Output screenshots @@ -89,9 +89,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Git checkout - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 - name: Install Node - uses: actions/setup-node@v3 + uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3 with: node-version: 18 cache: 'npm' diff --git a/.github/workflows/codeql-code-scanning.yml b/.github/workflows/codeql-code-scanning.yml index dfd9bf36c79bc4..454e782e262133 100644 --- a/.github/workflows/codeql-code-scanning.yml +++ b/.github/workflows/codeql-code-scanning.yml @@ -26,20 +26,20 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@a09933a12a80f87b87005513f0abb1494c27a716 # v2 with: languages: ${{ matrix.language }} config-file: ./.github/codeql-config.yml queries: security-and-quality - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@a09933a12a80f87b87005513f0abb1494c27a716 # v2 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@a09933a12a80f87b87005513f0abb1494c27a716 # v2 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/read-size.yml b/.github/workflows/read-size.yml index 16173259cd0efe..916cb78bac1a17 100644 --- a/.github/workflows/read-size.yml +++ b/.github/workflows/read-size.yml @@ -20,9 +20,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Git checkout - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 - name: Install Node - uses: actions/setup-node@v3 + uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3 with: node-version: 18 cache: 'npm' @@ -46,7 +46,7 @@ jobs: # write the output in a json file to upload it as artifact node -pe "JSON.stringify({ filesize: $FILESIZE, gzip: $FILESIZE_GZIP, treeshaken: $TREESHAKEN, treeshakenGzip: $TREESHAKEN_GZIP, pr: $PR })" > sizes.json - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 with: name: sizes path: sizes.json diff --git a/.github/workflows/report-size.yml b/.github/workflows/report-size.yml index a1a6782b96f7ca..2acece76fae873 100644 --- a/.github/workflows/report-size.yml +++ b/.github/workflows/report-size.yml @@ -29,7 +29,7 @@ jobs: # Using actions/download-artifact doesn't work here # https://github.com/actions/download-artifact/issues/60 - name: Download artifact - uses: actions/github-script@v6 + uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6 id: download-artifact with: result-encoding: string @@ -56,9 +56,9 @@ jobs: # This runs on the base branch of the PR, meaning "dev" - name: Git checkout - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 - name: Install Node - uses: actions/setup-node@v3 + uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3 with: node-version: 18 cache: 'npm' @@ -126,14 +126,14 @@ jobs: echo "TREESHAKEN_DIFF=$TREESHAKEN_DIFF" >> $GITHUB_OUTPUT - name: Find existing comment - uses: peter-evans/find-comment@v2 + uses: peter-evans/find-comment@a54c31d7fa095754bfef525c0c8e5e5674c4b4b1 # v2 id: find-comment with: issue-number: ${{ fromJSON(steps.download-artifact.outputs.result).pr }} comment-author: 'github-actions[bot]' body-includes: Bundle size - name: Comment on PR - uses: peter-evans/create-or-update-comment@v3 + uses: peter-evans/create-or-update-comment@c6c9a1a66007646a28c153e2a8580a5bad27bcfa # v3 with: issue-number: ${{ fromJSON(steps.download-artifact.outputs.result).pr }} comment-id: ${{ steps.find-comment.outputs.comment-id }} diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000000000..17fe01433fd036 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,19 @@ +# Security Policy + +If you have discovered a security vulnerability in this project, please report it +privately. **Do not disclose it as a public issue.** This gives us time to work with you +to fix the issue before public exposure, reducing the chance that the exploit will be +used before a patch is released. + +You may submit the report in the following ways: + +- send an email to hello@mrdoob.com; and/or +- send us a [private vulnerability report](https://github.com/mrdoob/three.js/security/advisories/new) + +Please provide the following information in your report: + +- A description of the vulnerability and its impact +- How to reproduce the issue + +This project is maintained by volunteers on a reasonable-effort basis. As such, +we ask that you give us 90 days to work on a fix before public exposure. diff --git a/build/three.cjs b/build/three.cjs index 81031f23d5751c..8ffc27e616ef52 100644 --- a/build/three.cjs +++ b/build/three.cjs @@ -5,7 +5,7 @@ */ 'use strict'; -const REVISION = '153dev'; +const REVISION = '156'; const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 }; const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }; @@ -129,6 +129,8 @@ const RGBA_ASTC_10x10_Format = 37819; const RGBA_ASTC_12x10_Format = 37820; const RGBA_ASTC_12x12_Format = 37821; const RGBA_BPTC_Format = 36492; +const RGB_BPTC_SIGNED_Format = 36494; +const RGB_BPTC_UNSIGNED_Format = 36495; const RED_RGTC1_Format = 36283; const SIGNED_RED_RGTC1_Format = 36284; const RED_GREEN_RGTC2_Format = 36285; @@ -161,6 +163,7 @@ const NoColorSpace = ''; const SRGBColorSpace = 'srgb'; const LinearSRGBColorSpace = 'srgb-linear'; const DisplayP3ColorSpace = 'display-p3'; +const LinearDisplayP3ColorSpace = 'display-p3-linear'; const ZeroStencilOp = 0; const KeepStencilOp = 7680; @@ -204,6 +207,9 @@ const GLSL3 = '300 es'; const _SRGBAFormat = 1035; // fallback for WebGL 1 +const WebGLCoordinateSystem = 2000; +const WebGPUCoordinateSystem = 2001; + /** * https://github.com/mrdoob/eventdispatcher.js/ */ @@ -918,8 +924,8 @@ class Vector2 { roundToZero() { - this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); - this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); + this.x = Math.trunc( this.x ); + this.y = Math.trunc( this.y ); return this; @@ -1527,6 +1533,14 @@ function createElementNS( name ) { } +function createCanvasElement() { + + const canvas = createElementNS( 'canvas' ); + canvas.style.display = 'block'; + return canvas; + +} + const _cache = {}; function warnOnce( message ) { @@ -1918,7 +1932,7 @@ function serializeImage( image ) { } -let textureId = 0; +let _textureId = 0; class Texture extends EventDispatcher { @@ -1928,7 +1942,7 @@ class Texture extends EventDispatcher { this.isTexture = true; - Object.defineProperty( this, 'id', { value: textureId ++ } ); + Object.defineProperty( this, 'id', { value: _textureId ++ } ); this.uuid = generateUUID(); @@ -2738,10 +2752,10 @@ class Vector4 { roundToZero() { - this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); - this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); - this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z ); - this.w = ( this.w < 0 ) ? Math.ceil( this.w ) : Math.floor( this.w ); + this.x = Math.trunc( this.x ); + this.y = Math.trunc( this.y ); + this.z = Math.trunc( this.z ); + this.w = Math.trunc( this.w ); return this; @@ -2882,13 +2896,13 @@ class Vector4 { * Texture parameters for an auto-generated target texture * depthBuffer/stencilBuffer: Booleans to indicate if we should generate these buffers */ -class WebGLRenderTarget extends EventDispatcher { +class RenderTarget extends EventDispatcher { constructor( width = 1, height = 1, options = {} ) { super(); - this.isWebGLRenderTarget = true; + this.isRenderTarget = true; this.width = width; this.height = height; @@ -2991,6 +3005,18 @@ class WebGLRenderTarget extends EventDispatcher { } +class WebGLRenderTarget extends RenderTarget { + + constructor( width = 1, height = 1, options = {} ) { + + super( width, height, options ); + + this.isWebGLRenderTarget = true; + + } + +} + class DataArrayTexture extends Texture { constructor( data = null, width = 1, height = 1, depth = 1 ) { @@ -3125,8 +3151,6 @@ class WebGLMultipleRenderTargets extends WebGLRenderTarget { this.viewport.set( 0, 0, width, height ); this.scissor.set( 0, 0, width, height ); - return this; - } copy( source ) { @@ -4239,9 +4263,9 @@ class Vector3 { roundToZero() { - this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); - this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); - this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z ); + this.x = Math.trunc( this.x ); + this.y = Math.trunc( this.y ); + this.z = Math.trunc( this.z ); return this; @@ -6580,7 +6604,7 @@ class Matrix4 { } - makePerspective( left, right, top, bottom, near, far ) { + makePerspective( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) { const te = this.elements; const x = 2 * near / ( right - left ); @@ -6588,19 +6612,35 @@ class Matrix4 { const a = ( right + left ) / ( right - left ); const b = ( top + bottom ) / ( top - bottom ); - const c = - ( far + near ) / ( far - near ); - const d = - 2 * far * near / ( far - near ); - te[ 0 ] = x; te[ 4 ] = 0; te[ 8 ] = a; te[ 12 ] = 0; - te[ 1 ] = 0; te[ 5 ] = y; te[ 9 ] = b; te[ 13 ] = 0; - te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = c; te[ 14 ] = d; + let c, d; + + if ( coordinateSystem === WebGLCoordinateSystem ) { + + c = - ( far + near ) / ( far - near ); + d = ( - 2 * far * near ) / ( far - near ); + + } else if ( coordinateSystem === WebGPUCoordinateSystem ) { + + c = - far / ( far - near ); + d = ( - far * near ) / ( far - near ); + + } else { + + throw new Error( 'THREE.Matrix4.makePerspective(): Invalid coordinate system: ' + coordinateSystem ); + + } + + te[ 0 ] = x; te[ 4 ] = 0; te[ 8 ] = a; te[ 12 ] = 0; + te[ 1 ] = 0; te[ 5 ] = y; te[ 9 ] = b; te[ 13 ] = 0; + te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = c; te[ 14 ] = d; te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = - 1; te[ 15 ] = 0; return this; } - makeOrthographic( left, right, top, bottom, near, far ) { + makeOrthographic( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) { const te = this.elements; const w = 1.0 / ( right - left ); @@ -6609,12 +6649,29 @@ class Matrix4 { const x = ( right + left ) * w; const y = ( top + bottom ) * h; - const z = ( far + near ) * p; - te[ 0 ] = 2 * w; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = - x; - te[ 1 ] = 0; te[ 5 ] = 2 * h; te[ 9 ] = 0; te[ 13 ] = - y; - te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = - 2 * p; te[ 14 ] = - z; - te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = 0; te[ 15 ] = 1; + let z, zInv; + + if ( coordinateSystem === WebGLCoordinateSystem ) { + + z = ( far + near ) * p; + zInv = - 2 * p; + + } else if ( coordinateSystem === WebGPUCoordinateSystem ) { + + z = near * p; + zInv = - 1 * p; + + } else { + + throw new Error( 'THREE.Matrix4.makeOrthographic(): Invalid coordinate system: ' + coordinateSystem ); + + } + + te[ 0 ] = 2 * w; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = - x; + te[ 1 ] = 0; te[ 5 ] = 2 * h; te[ 9 ] = 0; te[ 13 ] = - y; + te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = zInv; te[ 14 ] = - z; + te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = 0; te[ 15 ] = 1; return this; @@ -7438,20 +7495,7 @@ class Object3D extends EventDispatcher { clear() { - for ( let i = 0; i < this.children.length; i ++ ) { - - const object = this.children[ i ]; - - object.parent = null; - - object.dispatchEvent( _removedEvent ); - - } - - this.children.length = 0; - - return this; - + return this.remove( ... this.children ); } @@ -7991,7 +8035,7 @@ class Object3D extends EventDispatcher { this.frustumCulled = source.frustumCulled; this.renderOrder = source.renderOrder; - this.animations = source.animations; + this.animations = source.animations.slice(); this.userData = JSON.parse( JSON.stringify( source.userData ) ); @@ -8342,7 +8386,7 @@ class Triangle { } -let materialId = 0; +let _materialId = 0; class Material extends EventDispatcher { @@ -8352,7 +8396,7 @@ class Material extends EventDispatcher { this.isMaterial = true; - Object.defineProperty( this, 'id', { value: materialId ++ } ); + Object.defineProperty( this, 'id', { value: _materialId ++ } ); this.uuid = generateUUID(); @@ -8365,6 +8409,7 @@ class Material extends EventDispatcher { this.opacity = 1; this.transparent = false; + this.alphaHash = false; this.blendSrc = SrcAlphaFactor; this.blendDst = OneMinusSrcAlphaFactor; @@ -8693,6 +8738,7 @@ class Material extends EventDispatcher { if ( this.dithering === true ) data.dithering = true; if ( this.alphaTest > 0 ) data.alphaTest = this.alphaTest; + if ( this.alphaHash === true ) data.alphaHash = this.alphaHash; if ( this.alphaToCoverage === true ) data.alphaToCoverage = this.alphaToCoverage; if ( this.premultipliedAlpha === true ) data.premultipliedAlpha = this.premultipliedAlpha; if ( this.forceSinglePass === true ) data.forceSinglePass = this.forceSinglePass; @@ -8814,6 +8860,7 @@ class Material extends EventDispatcher { this.dithering = source.dithering; this.alphaTest = source.alphaTest; + this.alphaHash = source.alphaHash; this.alphaToCoverage = source.alphaToCoverage; this.premultipliedAlpha = source.premultipliedAlpha; this.forceSinglePass = source.forceSinglePass; @@ -9733,6 +9780,7 @@ class BufferAttribute { this.usage = StaticDrawUsage; this.updateRange = { offset: 0, count: - 1 }; + this.gpuType = FloatType; this.version = 0; @@ -9763,6 +9811,7 @@ class BufferAttribute { this.normalized = source.normalized; this.usage = source.usage; + this.gpuType = source.gpuType; return this; @@ -9878,6 +9927,26 @@ class BufferAttribute { } + getComponent( index, component ) { + + let value = this.array[ index * this.itemSize + component ]; + + if ( this.normalized ) value = denormalize( value, this.array ); + + return value; + + } + + setComponent( index, component, value ) { + + if ( this.normalized ) value = normalize( value, this.array ); + + this.array[ index * this.itemSize + component ] = value; + + return this; + + } + getX( index ) { let x = this.array[ index * this.itemSize ]; @@ -10049,30 +10118,6 @@ class BufferAttribute { } - copyColorsArray() { // @deprecated, r144 - - console.error( 'THREE.BufferAttribute: copyColorsArray() was removed in r144.' ); - - } - - copyVector2sArray() { // @deprecated, r144 - - console.error( 'THREE.BufferAttribute: copyVector2sArray() was removed in r144.' ); - - } - - copyVector3sArray() { // @deprecated, r144 - - console.error( 'THREE.BufferAttribute: copyVector3sArray() was removed in r144.' ); - - } - - copyVector4sArray() { // @deprecated, r144 - - console.error( 'THREE.BufferAttribute: copyVector4sArray() was removed in r144.' ); - - } - } // @@ -10083,18 +10128,6 @@ class Int8BufferAttribute extends BufferAttribute { super( new Int8Array( array ), itemSize, normalized ); - this.gpuType = FloatType; - - } - - copy( source ) { - - super.copy( source ); - - this.gpuType = source.gpuType; - - return this; - } } @@ -10105,18 +10138,6 @@ class Uint8BufferAttribute extends BufferAttribute { super( new Uint8Array( array ), itemSize, normalized ); - this.gpuType = FloatType; - - } - - copy( source ) { - - super.copy( source ); - - this.gpuType = source.gpuType; - - return this; - } } @@ -10137,18 +10158,6 @@ class Int16BufferAttribute extends BufferAttribute { super( new Int16Array( array ), itemSize, normalized ); - this.gpuType = FloatType; - - } - - copy( source ) { - - super.copy( source ); - - this.gpuType = source.gpuType; - - return this; - } } @@ -10159,18 +10168,6 @@ class Uint16BufferAttribute extends BufferAttribute { super( new Uint16Array( array ), itemSize, normalized ); - this.gpuType = FloatType; - - } - - copy( source ) { - - super.copy( source ); - - this.gpuType = source.gpuType; - - return this; - } } @@ -10368,7 +10365,7 @@ class Float64BufferAttribute extends BufferAttribute { } -let _id$1 = 0; +let _id$2 = 0; const _m1 = /*@__PURE__*/ new Matrix4(); const _obj = /*@__PURE__*/ new Object3D(); @@ -10385,7 +10382,7 @@ class BufferGeometry extends EventDispatcher { this.isBufferGeometry = true; - Object.defineProperty( this, 'id', { value: _id$1 ++ } ); + Object.defineProperty( this, 'id', { value: _id$2 ++ } ); this.uuid = generateUUID(); @@ -11084,13 +11081,6 @@ class BufferGeometry extends EventDispatcher { } - merge() { // @deprecated, r144 - - console.error( 'THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeGeometries() instead.' ); - return this; - - } - normalizeNormals() { const normals = this.attributes.normal; @@ -11497,7 +11487,7 @@ class Mesh extends Object3D { } - this.material = source.material; + this.material = Array.isArray( source.material ) ? source.material.slice() : source.material; this.geometry = source.geometry; return this; @@ -12333,6 +12323,8 @@ class Camera extends Object3D { this.projectionMatrix = new Matrix4(); this.projectionMatrixInverse = new Matrix4(); + this.coordinateSystem = WebGLCoordinateSystem; + } copy( source, recursive ) { @@ -12344,6 +12336,8 @@ class Camera extends Object3D { this.projectionMatrix.copy( source.projectionMatrix ); this.projectionMatrixInverse.copy( source.projectionMatrixInverse ); + this.coordinateSystem = source.coordinateSystem; + return this; } @@ -12581,7 +12575,7 @@ class PerspectiveCamera extends Camera { const skew = this.filmOffset; if ( skew !== 0 ) left += near * skew / this.getFilmWidth(); - this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far ); + this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far, this.coordinateSystem ); this.projectionMatrixInverse.copy( this.projectionMatrix ).invert(); @@ -12623,59 +12617,120 @@ class CubeCamera extends Object3D { this.type = 'CubeCamera'; this.renderTarget = renderTarget; + this.coordinateSystem = null; const cameraPX = new PerspectiveCamera( fov, aspect, near, far ); cameraPX.layers = this.layers; - cameraPX.up.set( 0, 1, 0 ); - cameraPX.lookAt( 1, 0, 0 ); this.add( cameraPX ); const cameraNX = new PerspectiveCamera( fov, aspect, near, far ); cameraNX.layers = this.layers; - cameraNX.up.set( 0, 1, 0 ); - cameraNX.lookAt( - 1, 0, 0 ); this.add( cameraNX ); const cameraPY = new PerspectiveCamera( fov, aspect, near, far ); cameraPY.layers = this.layers; - cameraPY.up.set( 0, 0, - 1 ); - cameraPY.lookAt( 0, 1, 0 ); this.add( cameraPY ); const cameraNY = new PerspectiveCamera( fov, aspect, near, far ); cameraNY.layers = this.layers; - cameraNY.up.set( 0, 0, 1 ); - cameraNY.lookAt( 0, - 1, 0 ); this.add( cameraNY ); const cameraPZ = new PerspectiveCamera( fov, aspect, near, far ); cameraPZ.layers = this.layers; - cameraPZ.up.set( 0, 1, 0 ); - cameraPZ.lookAt( 0, 0, 1 ); this.add( cameraPZ ); const cameraNZ = new PerspectiveCamera( fov, aspect, near, far ); cameraNZ.layers = this.layers; - cameraNZ.up.set( 0, 1, 0 ); - cameraNZ.lookAt( 0, 0, - 1 ); this.add( cameraNZ ); } + updateCoordinateSystem() { + + const coordinateSystem = this.coordinateSystem; + + const cameras = this.children.concat(); + + const [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = cameras; + + for ( const camera of cameras ) this.remove( camera ); + + if ( coordinateSystem === WebGLCoordinateSystem ) { + + cameraPX.up.set( 0, 1, 0 ); + cameraPX.lookAt( 1, 0, 0 ); + + cameraNX.up.set( 0, 1, 0 ); + cameraNX.lookAt( - 1, 0, 0 ); + + cameraPY.up.set( 0, 0, - 1 ); + cameraPY.lookAt( 0, 1, 0 ); + + cameraNY.up.set( 0, 0, 1 ); + cameraNY.lookAt( 0, - 1, 0 ); + + cameraPZ.up.set( 0, 1, 0 ); + cameraPZ.lookAt( 0, 0, 1 ); + + cameraNZ.up.set( 0, 1, 0 ); + cameraNZ.lookAt( 0, 0, - 1 ); + + } else if ( coordinateSystem === WebGPUCoordinateSystem ) { + + cameraPX.up.set( 0, - 1, 0 ); + cameraPX.lookAt( - 1, 0, 0 ); + + cameraNX.up.set( 0, - 1, 0 ); + cameraNX.lookAt( 1, 0, 0 ); + + cameraPY.up.set( 0, 0, 1 ); + cameraPY.lookAt( 0, 1, 0 ); + + cameraNY.up.set( 0, 0, - 1 ); + cameraNY.lookAt( 0, - 1, 0 ); + + cameraPZ.up.set( 0, - 1, 0 ); + cameraPZ.lookAt( 0, 0, 1 ); + + cameraNZ.up.set( 0, - 1, 0 ); + cameraNZ.lookAt( 0, 0, - 1 ); + + } else { + + throw new Error( 'THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: ' + coordinateSystem ); + + } + + for ( const camera of cameras ) { + + this.add( camera ); + + camera.updateMatrixWorld(); + + } + + } + update( renderer, scene ) { if ( this.parent === null ) this.updateMatrixWorld(); const renderTarget = this.renderTarget; + if ( this.coordinateSystem !== renderer.coordinateSystem ) { + + this.coordinateSystem = renderer.coordinateSystem; + + this.updateCoordinateSystem(); + + } + const [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = this.children; const currentRenderTarget = renderer.getRenderTarget(); - const currentToneMapping = renderer.toneMapping; const currentXrEnabled = renderer.xr.enabled; - renderer.toneMapping = NoToneMapping; renderer.xr.enabled = false; const generateMipmaps = renderTarget.texture.generateMipmaps; @@ -12704,7 +12759,6 @@ class CubeCamera extends Object3D { renderer.setRenderTarget( currentRenderTarget ); - renderer.toneMapping = currentToneMapping; renderer.xr.enabled = currentXrEnabled; renderTarget.texture.needsPMREMUpdate = true; @@ -13127,7 +13181,7 @@ class Frustum { } - setFromProjectionMatrix( m ) { + setFromProjectionMatrix( m, coordinateSystem = WebGLCoordinateSystem ) { const planes = this.planes; const me = m.elements; @@ -13141,7 +13195,20 @@ class Frustum { planes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize(); planes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize(); planes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize(); - planes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize(); + + if ( coordinateSystem === WebGLCoordinateSystem ) { + + planes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize(); + + } else if ( coordinateSystem === WebGPUCoordinateSystem ) { + + planes[ 5 ].setComponents( me2, me6, me10, me14 ).normalize(); + + } else { + + throw new Error( 'THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: ' + coordinateSystem ); + + } return this; @@ -13592,6 +13659,10 @@ class PlaneGeometry extends BufferGeometry { } +var alphahash_fragment = "#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif"; + +var alphahash_pars_fragment = "#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif"; + var alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif"; var alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif"; @@ -13604,13 +13675,13 @@ var aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( var aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif"; -var begin_vertex = "vec3 transformed = vec3( position );"; +var begin_vertex = "vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif"; var beginnormal_vertex = "vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif"; var bsdfs = "float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated"; -var iridescence_fragment = "#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\t return vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat R21 = R12;\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif"; +var iridescence_fragment = "#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif"; var bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif"; @@ -13630,7 +13701,7 @@ var color_pars_vertex = "#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\ var color_vertex = "#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif"; -var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated"; +var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated"; var cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif"; @@ -13644,9 +13715,9 @@ var emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = textu var emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif"; -var encodings_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );"; +var colorspace_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );"; -var encodings_pars_fragment = "vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}"; +var colorspace_pars_fragment = "vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}"; var envmap_fragment = "#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif"; @@ -13706,7 +13777,7 @@ var logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_ var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif"; -var map_fragment = "#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, vMapUv );\n#endif"; +var map_fragment = "#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif"; var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif"; @@ -13726,7 +13797,7 @@ var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\tuniform float morphTar var morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif"; -var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal, vNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;"; +var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;"; var normal_fragment_maps = "#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif"; @@ -13746,7 +13817,7 @@ var clearcoat_pars_fragment = "#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clea var iridescence_pars_fragment = "#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif"; -var output_fragment = "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );"; +var opaque_fragment = "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );"; var packing = "vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}"; @@ -13790,53 +13861,53 @@ var transmission_fragment = "#ifdef USE_TRANSMISSION\n\tmaterial.transmission = var transmission_pars_fragment = "#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif"; -var uv_pars_fragment = "#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif"; +var uv_pars_fragment = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif"; -var uv_pars_vertex = "#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif"; +var uv_pars_vertex = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif"; -var uv_vertex = "#ifdef USE_UV\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif"; +var uv_vertex = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif"; var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif"; const vertex$h = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}"; -const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}"; +const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}"; const vertex$g = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}"; -const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}"; +const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}"; const vertex$f = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}"; -const fragment$f = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}"; +const fragment$f = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}"; const vertex$e = "#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}"; -const fragment$e = "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}"; +const fragment$e = "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}"; const vertex$d = "#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}"; -const fragment$d = "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}"; +const fragment$d = "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}"; const vertex$c = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}"; -const fragment$c = "uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}"; +const fragment$c = "uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}"; const vertex$b = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; -const fragment$b = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; +const fragment$b = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$a = "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; -const fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; +const fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$9 = "#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}"; -const fragment$9 = "#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; +const fragment$9 = "#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$8 = "#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}"; -const fragment$8 = "#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; +const fragment$8 = "#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$7 = "#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}"; @@ -13844,29 +13915,31 @@ const fragment$7 = "#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SH const vertex$6 = "#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}"; -const fragment$6 = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; +const fragment$6 = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$5 = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}"; -const fragment$5 = "#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; +const fragment$5 = "#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$4 = "#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}"; -const fragment$4 = "#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; +const fragment$4 = "#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$3 = "uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}"; -const fragment$3 = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; +const fragment$3 = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$2 = "#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; -const fragment$2 = "uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}"; +const fragment$2 = "uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}"; const vertex$1 = "uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"; -const fragment$1 = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"; +const fragment$1 = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"; const ShaderChunk = { + alphahash_fragment: alphahash_fragment, + alphahash_pars_fragment: alphahash_pars_fragment, alphamap_fragment: alphamap_fragment, alphamap_pars_fragment: alphamap_pars_fragment, alphatest_fragment: alphatest_fragment, @@ -13893,8 +13966,8 @@ const ShaderChunk = { displacementmap_vertex: displacementmap_vertex, emissivemap_fragment: emissivemap_fragment, emissivemap_pars_fragment: emissivemap_pars_fragment, - encodings_fragment: encodings_fragment, - encodings_pars_fragment: encodings_pars_fragment, + colorspace_fragment: colorspace_fragment, + colorspace_pars_fragment: colorspace_pars_fragment, envmap_fragment: envmap_fragment, envmap_common_pars_fragment: envmap_common_pars_fragment, envmap_pars_fragment: envmap_pars_fragment, @@ -13944,7 +14017,7 @@ const ShaderChunk = { clearcoat_normal_fragment_maps: clearcoat_normal_fragment_maps, clearcoat_pars_fragment: clearcoat_pars_fragment, iridescence_pars_fragment: iridescence_pars_fragment, - output_fragment: output_fragment, + opaque_fragment: opaque_fragment, packing: packing, premultiplied_alpha_fragment: premultiplied_alpha_fragment, project_vertex: project_vertex, @@ -14618,24 +14691,15 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha, } - const xr = renderer.xr; - const environmentBlendMode = xr.getEnvironmentBlendMode(); + const environmentBlendMode = renderer.xr.getEnvironmentBlendMode(); - switch ( environmentBlendMode ) { + if ( environmentBlendMode === 'additive' ) { - case 'opaque': - forceClear = true; - break; + state.buffers.color.setClear( 0, 0, 0, 1, premultipliedAlpha ); - case 'additive': - state.buffers.color.setClear( 0, 0, 0, 1, premultipliedAlpha ); - forceClear = true; - break; + } else if ( environmentBlendMode === 'alpha-blend' ) { - case 'alpha-blend': - state.buffers.color.setClear( 0, 0, 0, 0, premultipliedAlpha ); - forceClear = true; - break; + state.buffers.color.setClear( 0, 0, 0, 0, premultipliedAlpha ); } @@ -15989,7 +16053,7 @@ class OrthographicCamera extends Camera { } - this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far ); + this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far, this.coordinateSystem ); this.projectionMatrixInverse.copy( this.projectionMatrix ).invert(); @@ -17236,7 +17300,7 @@ function WebGLGeometries( gl, attributes, info, bindingStates ) { } - } else { + } else if ( geometryPosition !== undefined ) { const array = geometryPosition.array; version = geometryPosition.version; @@ -17251,6 +17315,10 @@ function WebGLGeometries( gl, attributes, info, bindingStates ) { } + } else { + + return; + } const attribute = new ( arrayNeedsUint32( indices ) ? Uint32BufferAttribute : Uint16BufferAttribute )( indices, 1 ); @@ -17771,11 +17839,31 @@ function WebGLObjects( gl, geometries, attributes, info ) { } - attributes.update( object.instanceMatrix, gl.ARRAY_BUFFER ); + if ( updateMap.get( object ) !== frame ) { + + attributes.update( object.instanceMatrix, gl.ARRAY_BUFFER ); - if ( object.instanceColor !== null ) { + if ( object.instanceColor !== null ) { - attributes.update( object.instanceColor, gl.ARRAY_BUFFER ); + attributes.update( object.instanceColor, gl.ARRAY_BUFFER ); + + } + + updateMap.set( object, frame ); + + } + + } + + if ( object.isSkinnedMesh ) { + + const skeleton = object.skeleton; + + if ( updateMap.get( skeleton ) !== frame ) { + + skeleton.update(); + + updateMap.set( skeleton, frame ); } @@ -19172,13 +19260,30 @@ function resolveIncludes( string ) { } +const shaderChunkMap = new Map( [ + [ 'encodings_fragment', 'colorspace_fragment' ], // @deprecated, r154 + [ 'encodings_pars_fragment', 'colorspace_pars_fragment' ], // @deprecated, r154 + [ 'output_fragment', 'opaque_fragment' ], // @deprecated, r154 +] ); + function includeReplacer( match, include ) { - const string = ShaderChunk[ include ]; + let string = ShaderChunk[ include ]; if ( string === undefined ) { - throw new Error( 'Can not resolve #include <' + include + '>' ); + const newInclude = shaderChunkMap.get( include ); + + if ( newInclude !== undefined ) { + + string = ShaderChunk[ newInclude ]; + console.warn( 'THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.', include, newInclude ); + + } else { + + throw new Error( 'Can not resolve #include <' + include + '>' ); + + } } @@ -19454,6 +19559,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) { parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '', parameters.metalnessMap ? '#define USE_METALNESSMAP' : '', parameters.alphaMap ? '#define USE_ALPHAMAP' : '', + parameters.alphaHash ? '#define USE_ALPHAHASH' : '', parameters.transmission ? '#define USE_TRANSMISSION' : '', parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '', @@ -19497,7 +19603,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) { // - parameters.vertexTangents ? '#define USE_TANGENT' : '', + parameters.vertexTangents && parameters.flatShading === false ? '#define USE_TANGENT' : '', parameters.vertexColors ? '#define USE_COLOR' : '', parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '', parameters.vertexUv1s ? '#define USE_UV1' : '', @@ -19675,6 +19781,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) { parameters.alphaMap ? '#define USE_ALPHAMAP' : '', parameters.alphaTest ? '#define USE_ALPHATEST' : '', + parameters.alphaHash ? '#define USE_ALPHAHASH' : '', parameters.sheen ? '#define USE_SHEEN' : '', parameters.sheenColorMap ? '#define USE_SHEEN_COLORMAP' : '', @@ -19684,7 +19791,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) { parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '', parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '', - parameters.vertexTangents ? '#define USE_TANGENT' : '', + parameters.vertexTangents && parameters.flatShading === false ? '#define USE_TANGENT' : '', parameters.vertexColors || parameters.instancingColor ? '#define USE_COLOR' : '', parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '', parameters.vertexUv1s ? '#define USE_UV1' : '', @@ -19707,6 +19814,8 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) { parameters.useLegacyLights ? '#define LEGACY_LIGHTS' : '', + parameters.decodeVideoTexture ? '#define DECODE_VIDEO_TEXTURE' : '', + parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', ( parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ) ? '#define USE_LOGDEPTHBUF_EXT' : '', @@ -19721,7 +19830,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) { parameters.dithering ? '#define DITHERING' : '', parameters.opaque ? '#define OPAQUE' : '', - ShaderChunk[ 'encodings_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below + ShaderChunk[ 'colorspace_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below getTexelEncodingFunction( 'linearToOutputTexel', parameters.outputColorSpace ), parameters.useDepthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '', @@ -19941,7 +20050,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) { } -let _id = 0; +let _id$1 = 0; class WebGLShaderCache { @@ -20055,7 +20164,7 @@ class WebGLShaderStage { constructor( code ) { - this.id = _id ++; + this.id = _id$1 ++; this.code = code; this.usedTimes = 0; @@ -20211,12 +20320,26 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities const HAS_ALPHATEST = material.alphaTest > 0; + const HAS_ALPHAHASH = !! material.alphaHash; + const HAS_EXTENSIONS = !! material.extensions; const HAS_ATTRIBUTE_UV1 = !! geometry.attributes.uv1; const HAS_ATTRIBUTE_UV2 = !! geometry.attributes.uv2; const HAS_ATTRIBUTE_UV3 = !! geometry.attributes.uv3; + let toneMapping = NoToneMapping; + + if ( material.toneMapped ) { + + if ( currentRenderTarget === null || currentRenderTarget.isXRRenderTarget === true ) { + + toneMapping = renderer.toneMapping; + + } + + } + const parameters = { isWebGL2: IS_WEBGL2, @@ -20291,6 +20414,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities alphaMap: HAS_ALPHAMAP, alphaTest: HAS_ALPHATEST, + alphaHash: HAS_ALPHAHASH, combine: material.combine, @@ -20376,8 +20500,10 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities shadowMapEnabled: renderer.shadowMap.enabled && shadows.length > 0, shadowMapType: renderer.shadowMap.type, - toneMapping: material.toneMapped ? renderer.toneMapping : NoToneMapping, - useLegacyLights: renderer.useLegacyLights, + toneMapping: toneMapping, + useLegacyLights: renderer._useLegacyLights, + + decodeVideoTexture: HAS_MAP && ( material.map.isVideoTexture === true ) && ( material.map.colorSpace === SRGBColorSpace ), premultipliedAlpha: material.premultipliedAlpha, @@ -20580,6 +20706,8 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities _programLayers.enable( 17 ); if ( parameters.pointsUvs ) _programLayers.enable( 18 ); + if ( parameters.decodeVideoTexture ) + _programLayers.enable( 19 ); array.push( _programLayers.mask ); @@ -23549,6 +23677,17 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, } + if ( glFormat === _gl.RED_INTEGER ) { + + if ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.R8UI; + if ( glType === _gl.UNSIGNED_SHORT ) internalFormat = _gl.R16UI; + if ( glType === _gl.UNSIGNED_INT ) internalFormat = _gl.R32UI; + if ( glType === _gl.BYTE ) internalFormat = _gl.R8I; + if ( glType === _gl.SHORT ) internalFormat = _gl.R16I; + if ( glType === _gl.INT ) internalFormat = _gl.R32I; + + } + if ( glFormat === _gl.RG ) { if ( glType === _gl.FLOAT ) internalFormat = _gl.RG32F; @@ -23725,14 +23864,32 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, for ( let i = 0; i < 6; i ++ ) { - _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ] ); + if ( Array.isArray( renderTargetProperties.__webglFramebuffer[ i ] ) ) { + + for ( let level = 0; level < renderTargetProperties.__webglFramebuffer[ i ].length; level ++ ) _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ][ level ] ); + + } else { + + _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ] ); + + } + if ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer[ i ] ); } } else { - _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer ); + if ( Array.isArray( renderTargetProperties.__webglFramebuffer ) ) { + + for ( let level = 0; level < renderTargetProperties.__webglFramebuffer.length; level ++ ) _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ level ] ); + + } else { + + _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer ); + + } + if ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer ); if ( renderTargetProperties.__webglMultisampledFramebuffer ) _gl.deleteFramebuffer( renderTargetProperties.__webglMultisampledFramebuffer ); @@ -24111,7 +24268,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, glFormat = utils.convert( texture.format, texture.colorSpace ); let glType = utils.convert( texture.type ), - glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace ); + glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace, texture.isVideoTexture ); setTextureParameters( textureType, texture, supportsMips ); @@ -24707,7 +24864,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, // Render targets // Setup storage for target texture and bind it to correct framebuffer - function setupFrameBufferTexture( framebuffer, renderTarget, texture, attachment, textureTarget ) { + function setupFrameBufferTexture( framebuffer, renderTarget, texture, attachment, textureTarget, level ) { const glFormat = utils.convert( texture.format, texture.colorSpace ); const glType = utils.convert( texture.type ); @@ -24716,13 +24873,16 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, if ( ! renderTargetProperties.__hasExternalTextures ) { + const width = Math.max( 1, renderTarget.width >> level ); + const height = Math.max( 1, renderTarget.height >> level ); + if ( textureTarget === _gl.TEXTURE_3D || textureTarget === _gl.TEXTURE_2D_ARRAY ) { - state.texImage3D( textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, renderTarget.depth, 0, glFormat, glType, null ); + state.texImage3D( textureTarget, level, glInternalFormat, width, height, renderTarget.depth, 0, glFormat, glType, null ); } else { - state.texImage2D( textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null ); + state.texImage2D( textureTarget, level, glInternalFormat, width, height, 0, glFormat, glType, null ); } @@ -24736,7 +24896,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, } else if ( textureTarget === _gl.TEXTURE_2D || ( textureTarget >= _gl.TEXTURE_CUBE_MAP_POSITIVE_X && textureTarget <= _gl.TEXTURE_CUBE_MAP_NEGATIVE_Z ) ) { // see #24753 - _gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( texture ).__webglTexture, 0 ); + _gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( texture ).__webglTexture, level ); } @@ -24957,7 +25117,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, if ( colorTexture !== undefined ) { - setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, renderTarget.texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D ); + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, renderTarget.texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D, 0 ); } @@ -25004,13 +25164,41 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, for ( let i = 0; i < 6; i ++ ) { - renderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer(); + if ( isWebGL2 && texture.mipmaps && texture.mipmaps.length > 0 ) { + + renderTargetProperties.__webglFramebuffer[ i ] = []; + + for ( let level = 0; level < texture.mipmaps.length; level ++ ) { + + renderTargetProperties.__webglFramebuffer[ i ][ level ] = _gl.createFramebuffer(); + + } + + } else { + + renderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer(); + + } } } else { - renderTargetProperties.__webglFramebuffer = _gl.createFramebuffer(); + if ( isWebGL2 && texture.mipmaps && texture.mipmaps.length > 0 ) { + + renderTargetProperties.__webglFramebuffer = []; + + for ( let level = 0; level < texture.mipmaps.length; level ++ ) { + + renderTargetProperties.__webglFramebuffer[ level ] = _gl.createFramebuffer(); + + } + + } else { + + renderTargetProperties.__webglFramebuffer = _gl.createFramebuffer(); + + } if ( isMultipleRenderTargets ) { @@ -25090,7 +25278,19 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, for ( let i = 0; i < 6; i ++ ) { - setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i ); + if ( isWebGL2 && texture.mipmaps && texture.mipmaps.length > 0 ) { + + for ( let level = 0; level < texture.mipmaps.length; level ++ ) { + + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ][ level ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, level ); + + } + + } else { + + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0 ); + + } } @@ -25113,7 +25313,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, state.bindTexture( _gl.TEXTURE_2D, attachmentProperties.__webglTexture ); setTextureParameters( _gl.TEXTURE_2D, attachment, supportsMips ); - setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, attachment, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D ); + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, attachment, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D, 0 ); if ( textureNeedsGenerateMipmaps( attachment, supportsMips ) ) { @@ -25145,7 +25345,20 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, state.bindTexture( glTextureType, textureProperties.__webglTexture ); setTextureParameters( glTextureType, texture, supportsMips ); - setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType ); + + if ( isWebGL2 && texture.mipmaps && texture.mipmaps.length > 0 ) { + + for ( let level = 0; level < texture.mipmaps.length; level ++ ) { + + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ level ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType, level ); + + } + + } else { + + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType, 0 ); + + } if ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) { @@ -25334,13 +25547,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, const format = texture.format; const type = texture.type; - if ( texture.isCompressedTexture === true || texture.format === _SRGBAFormat ) return image; + if ( texture.isCompressedTexture === true || texture.isVideoTexture === true || texture.format === _SRGBAFormat ) return image; if ( colorSpace !== LinearSRGBColorSpace && colorSpace !== NoColorSpace ) { // sRGB - if ( colorSpace === SRGBColorSpace ) { + if ( colorSpace === SRGBColorSpace || colorSpace === DisplayP3ColorSpace ) { if ( isWebGL2 === false ) { @@ -25406,6 +25619,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, } +const LinearTransferFunction = 0; +const SRGBTransferFunction = 1; + function WebGLUtils( gl, extensions, capabilities ) { const isWebGL2 = capabilities.isWebGL2; @@ -25414,6 +25630,8 @@ function WebGLUtils( gl, extensions, capabilities ) { let extension; + const transferFunction = ( colorSpace === SRGBColorSpace || colorSpace === DisplayP3ColorSpace ) ? SRGBTransferFunction : LinearTransferFunction; + if ( p === UnsignedByteType ) return gl.UNSIGNED_BYTE; if ( p === UnsignedShort4444Type ) return gl.UNSIGNED_SHORT_4_4_4_4; if ( p === UnsignedShort5551Type ) return gl.UNSIGNED_SHORT_5_5_5_1; @@ -25480,7 +25698,7 @@ function WebGLUtils( gl, extensions, capabilities ) { if ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) { - if ( colorSpace === SRGBColorSpace ) { + if ( transferFunction === SRGBTransferFunction ) { extension = extensions.get( 'WEBGL_compressed_texture_s3tc_srgb' ); @@ -25565,8 +25783,8 @@ function WebGLUtils( gl, extensions, capabilities ) { if ( extension !== null ) { - if ( p === RGB_ETC2_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2; - if ( p === RGBA_ETC2_EAC_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : extension.COMPRESSED_RGBA8_ETC2_EAC; + if ( p === RGB_ETC2_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2; + if ( p === RGBA_ETC2_EAC_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : extension.COMPRESSED_RGBA8_ETC2_EAC; } else { @@ -25588,20 +25806,20 @@ function WebGLUtils( gl, extensions, capabilities ) { if ( extension !== null ) { - if ( p === RGBA_ASTC_4x4_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : extension.COMPRESSED_RGBA_ASTC_4x4_KHR; - if ( p === RGBA_ASTC_5x4_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : extension.COMPRESSED_RGBA_ASTC_5x4_KHR; - if ( p === RGBA_ASTC_5x5_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : extension.COMPRESSED_RGBA_ASTC_5x5_KHR; - if ( p === RGBA_ASTC_6x5_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : extension.COMPRESSED_RGBA_ASTC_6x5_KHR; - if ( p === RGBA_ASTC_6x6_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : extension.COMPRESSED_RGBA_ASTC_6x6_KHR; - if ( p === RGBA_ASTC_8x5_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : extension.COMPRESSED_RGBA_ASTC_8x5_KHR; - if ( p === RGBA_ASTC_8x6_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : extension.COMPRESSED_RGBA_ASTC_8x6_KHR; - if ( p === RGBA_ASTC_8x8_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : extension.COMPRESSED_RGBA_ASTC_8x8_KHR; - if ( p === RGBA_ASTC_10x5_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : extension.COMPRESSED_RGBA_ASTC_10x5_KHR; - if ( p === RGBA_ASTC_10x6_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : extension.COMPRESSED_RGBA_ASTC_10x6_KHR; - if ( p === RGBA_ASTC_10x8_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : extension.COMPRESSED_RGBA_ASTC_10x8_KHR; - if ( p === RGBA_ASTC_10x10_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : extension.COMPRESSED_RGBA_ASTC_10x10_KHR; - if ( p === RGBA_ASTC_12x10_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : extension.COMPRESSED_RGBA_ASTC_12x10_KHR; - if ( p === RGBA_ASTC_12x12_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : extension.COMPRESSED_RGBA_ASTC_12x12_KHR; + if ( p === RGBA_ASTC_4x4_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : extension.COMPRESSED_RGBA_ASTC_4x4_KHR; + if ( p === RGBA_ASTC_5x4_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : extension.COMPRESSED_RGBA_ASTC_5x4_KHR; + if ( p === RGBA_ASTC_5x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : extension.COMPRESSED_RGBA_ASTC_5x5_KHR; + if ( p === RGBA_ASTC_6x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : extension.COMPRESSED_RGBA_ASTC_6x5_KHR; + if ( p === RGBA_ASTC_6x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : extension.COMPRESSED_RGBA_ASTC_6x6_KHR; + if ( p === RGBA_ASTC_8x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : extension.COMPRESSED_RGBA_ASTC_8x5_KHR; + if ( p === RGBA_ASTC_8x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : extension.COMPRESSED_RGBA_ASTC_8x6_KHR; + if ( p === RGBA_ASTC_8x8_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : extension.COMPRESSED_RGBA_ASTC_8x8_KHR; + if ( p === RGBA_ASTC_10x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : extension.COMPRESSED_RGBA_ASTC_10x5_KHR; + if ( p === RGBA_ASTC_10x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : extension.COMPRESSED_RGBA_ASTC_10x6_KHR; + if ( p === RGBA_ASTC_10x8_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : extension.COMPRESSED_RGBA_ASTC_10x8_KHR; + if ( p === RGBA_ASTC_10x10_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : extension.COMPRESSED_RGBA_ASTC_10x10_KHR; + if ( p === RGBA_ASTC_12x10_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : extension.COMPRESSED_RGBA_ASTC_12x10_KHR; + if ( p === RGBA_ASTC_12x12_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : extension.COMPRESSED_RGBA_ASTC_12x12_KHR; } else { @@ -25613,13 +25831,15 @@ function WebGLUtils( gl, extensions, capabilities ) { // BPTC - if ( p === RGBA_BPTC_Format ) { + if ( p === RGBA_BPTC_Format || p === RGB_BPTC_SIGNED_Format || p === RGB_BPTC_UNSIGNED_Format ) { extension = extensions.get( 'EXT_texture_compression_bptc' ); if ( extension !== null ) { - if ( p === RGBA_BPTC_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : extension.COMPRESSED_RGBA_BPTC_UNORM_EXT; + if ( p === RGBA_BPTC_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : extension.COMPRESSED_RGBA_BPTC_UNORM_EXT; + if ( p === RGB_BPTC_SIGNED_Format ) return extension.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT; + if ( p === RGB_BPTC_UNSIGNED_Format ) return extension.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT; } else { @@ -26132,8 +26352,6 @@ class WebXRManager extends EventDispatcher { // - let userCamera = null; - const cameraL = new PerspectiveCamera(); cameraL.layers.enable( 1 ); cameraL.viewport = new Vector4(); @@ -26153,19 +26371,11 @@ class WebXRManager extends EventDispatcher { // - this.cameraAutoUpdate = true; // @deprecated, r153 + this.cameraAutoUpdate = true; this.enabled = false; this.isPresenting = false; - this.getCamera = function () {}; // @deprecated, r153 - - this.setUserCamera = function ( value ) { - - userCamera = value; - - }; - this.getController = function ( index ) { let controller = controllers[ index ]; @@ -26602,15 +26812,9 @@ class WebXRManager extends EventDispatcher { } - this.updateCameraXR = function ( camera ) { - - if ( session === null ) return camera; + this.updateCamera = function ( camera ) { - if ( userCamera ) { - - camera = userCamera; - - } + if ( session === null ) return; cameraXR.near = cameraR.near = cameraL.near = camera.near; cameraXR.far = cameraR.far = cameraL.far = camera.far; @@ -26656,19 +26860,11 @@ class WebXRManager extends EventDispatcher { // update user camera and its children - if ( userCamera ) { - - updateUserCamera( cameraXR, parent ); - - } - - return cameraXR; + updateUserCamera( camera, cameraXR, parent ); }; - function updateUserCamera( cameraXR, parent ) { - - const camera = userCamera; + function updateUserCamera( camera, cameraXR, parent ) { if ( parent === null ) { @@ -26685,14 +26881,6 @@ class WebXRManager extends EventDispatcher { camera.matrix.decompose( camera.position, camera.quaternion, camera.scale ); camera.updateMatrixWorld( true ); - const children = camera.children; - - for ( let i = 0, l = children.length; i < l; i ++ ) { - - children[ i ].updateMatrixWorld( true ); - - } - camera.projectionMatrix.copy( cameraXR.projectionMatrix ); camera.projectionMatrixInverse.copy( cameraXR.projectionMatrixInverse ); @@ -26705,6 +26893,12 @@ class WebXRManager extends EventDispatcher { } + this.getCamera = function () { + + return cameraXR; + + }; + this.getFoveation = function () { if ( glProjLayer === null && glBaseLayer === null ) { @@ -27102,7 +27296,7 @@ function WebGLMaterials( renderer, properties ) { uniforms.lightMap.value = material.lightMap; // artist-friendly light intensity scaling factor - const scaleFactor = ( renderer.useLegacyLights === true ) ? Math.PI : 1; + const scaleFactor = ( renderer._useLegacyLights === true ) ? Math.PI : 1; uniforms.lightMapIntensity.value = material.lightMapIntensity * scaleFactor; @@ -27849,14 +28043,6 @@ function WebGLUniformsGroups( gl, info, capabilities, state ) { } -function createCanvasElement() { - - const canvas = createElementNS( 'canvas' ); - canvas.style.display = 'block'; - return canvas; - -} - class WebGLRenderer { constructor( parameters = {} ) { @@ -27941,7 +28127,7 @@ class WebGLRenderer { // physical lights - this.useLegacyLights = true; + this._useLegacyLights = false; // tone mapping @@ -28078,7 +28264,7 @@ class WebGLRenderer { } - if ( _gl instanceof WebGLRenderingContext ) { // @deprecated, r153 + if ( typeof WebGLRenderingContext !== 'undefined' && _gl instanceof WebGLRenderingContext ) { // @deprecated, r153 console.warn( 'THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163.' ); @@ -28396,15 +28582,13 @@ class WebGLRenderer { const g = clearColor.g; const b = clearColor.b; - const __webglFramebuffer = properties.get( _currentRenderTarget ).__webglFramebuffer; - if ( isUnsignedType ) { uintClearColor[ 0 ] = r; uintClearColor[ 1 ] = g; uintClearColor[ 2 ] = b; uintClearColor[ 3 ] = a; - _gl.clearBufferuiv( _gl.COLOR, __webglFramebuffer, uintClearColor ); + _gl.clearBufferuiv( _gl.COLOR, 0, uintClearColor ); } else { @@ -28412,7 +28596,7 @@ class WebGLRenderer { intClearColor[ 1 ] = g; intClearColor[ 2 ] = b; intClearColor[ 3 ] = a; - _gl.clearBufferiv( _gl.COLOR, __webglFramebuffer, intClearColor ); + _gl.clearBufferiv( _gl.COLOR, 0, intClearColor ); } @@ -28586,6 +28770,9 @@ class WebGLRenderer { if ( material.wireframe === true ) { index = geometries.getWireframeAttribute( geometry ); + + if ( index === undefined ) return; + rangeFactor = 2; } @@ -28750,7 +28937,7 @@ class WebGLRenderer { } ); - currentRenderState.setupLights( _this.useLegacyLights ); + currentRenderState.setupLights( _this._useLegacyLights ); scene.traverse( function ( object ) { @@ -28845,7 +29032,9 @@ class WebGLRenderer { if ( xr.enabled === true && xr.isPresenting === true ) { - camera = xr.updateCameraXR( camera ); // use XR camera for rendering + if ( xr.cameraAutoUpdate === true ) xr.updateCamera( camera ); + + camera = xr.getCamera(); // use XR camera for rendering } @@ -28880,6 +29069,8 @@ class WebGLRenderer { // + this.info.render.frame ++; + if ( _clippingEnabled === true ) clipping.beginShadows(); const shadowsArray = currentRenderState.state.shadowsArray; @@ -28892,7 +29083,6 @@ class WebGLRenderer { if ( this.info.autoReset === true ) this.info.reset(); - this.info.render.frame ++; // @@ -28900,7 +29090,7 @@ class WebGLRenderer { // render scene - currentRenderState.setupLights( _this.useLegacyLights ); + currentRenderState.setupLights( _this._useLegacyLights ); if ( camera.isArrayCamera ) { @@ -29022,19 +29212,6 @@ class WebGLRenderer { if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) { - if ( object.isSkinnedMesh ) { - - // update skeleton only once in a frame - - if ( object.skeleton.frame !== info.render.frame ) { - - object.skeleton.update(); - object.skeleton.frame = info.render.frame; - - } - - } - const geometry = objects.update( object ); const material = object.material; @@ -29135,7 +29312,7 @@ class WebGLRenderer { generateMipmaps: true, type: extensions.has( 'EXT_color_buffer_half_float' ) ? HalfFloatType : UnsignedByteType, minFilter: LinearMipmapLinearFilter, - samples: ( isWebGL2 && antialias === true ) ? 4 : 0 + samples: ( isWebGL2 ) ? 4 : 0 } ); // debug @@ -29402,6 +29579,7 @@ class WebGLRenderer { materialProperties.outputColorSpace = parameters.outputColorSpace; materialProperties.instancing = parameters.instancing; + materialProperties.instancingColor = parameters.instancingColor; materialProperties.skinning = parameters.skinning; materialProperties.morphTargets = parameters.morphTargets; materialProperties.morphNormals = parameters.morphNormals; @@ -29430,7 +29608,18 @@ class WebGLRenderer { const morphTargets = !! geometry.morphAttributes.position; const morphNormals = !! geometry.morphAttributes.normal; const morphColors = !! geometry.morphAttributes.color; - const toneMapping = material.toneMapped ? _this.toneMapping : NoToneMapping; + + let toneMapping = NoToneMapping; + + if ( material.toneMapped ) { + + if ( _currentRenderTarget === null || _currentRenderTarget.isXRRenderTarget === true ) { + + toneMapping = _this.toneMapping; + + } + + } const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color; const morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0; @@ -29485,6 +29674,14 @@ class WebGLRenderer { needsProgramChange = true; + } else if ( object.isInstancedMesh && materialProperties.instancingColor === true && object.instanceColor === null ) { + + needsProgramChange = true; + + } else if ( object.isInstancedMesh && materialProperties.instancingColor === false && object.instanceColor !== null ) { + + needsProgramChange = true; + } else if ( materialProperties.envMap !== envMap ) { needsProgramChange = true; @@ -29571,48 +29768,28 @@ class WebGLRenderer { if ( refreshProgram || _currentCamera !== camera ) { - p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix ); - - if ( capabilities.logarithmicDepthBuffer ) { + // common camera uniforms - p_uniforms.setValue( _gl, 'logDepthBufFC', - 2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) ); - - } - - if ( _currentCamera !== camera ) { + p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix ); + p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse ); - _currentCamera = camera; + const uCamPos = p_uniforms.map.cameraPosition; - // lighting uniforms depend on the camera so enforce an update - // now, in case this material supports lights - or later, when - // the next material that does gets activated: + if ( uCamPos !== undefined ) { - refreshMaterial = true; // set to true on material change - refreshLights = true; // remains set until update done + uCamPos.setValue( _gl, _vector3.setFromMatrixPosition( camera.matrixWorld ) ); } - // load material specific uniforms - // (shader material also gets them for the sake of genericity) - - if ( material.isShaderMaterial || - material.isMeshPhongMaterial || - material.isMeshToonMaterial || - material.isMeshStandardMaterial || - material.envMap ) { - - const uCamPos = p_uniforms.map.cameraPosition; - - if ( uCamPos !== undefined ) { - - uCamPos.setValue( _gl, - _vector3.setFromMatrixPosition( camera.matrixWorld ) ); + if ( capabilities.logarithmicDepthBuffer ) { - } + p_uniforms.setValue( _gl, 'logDepthBufFC', + 2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) ); } + // consider moving isOrthographic to UniformLib and WebGLMaterials, see https://github.com/mrdoob/three.js/pull/26467#issuecomment-1645185067 + if ( material.isMeshPhongMaterial || material.isMeshToonMaterial || material.isMeshLambertMaterial || @@ -29624,16 +29801,16 @@ class WebGLRenderer { } - if ( material.isMeshPhongMaterial || - material.isMeshToonMaterial || - material.isMeshLambertMaterial || - material.isMeshBasicMaterial || - material.isMeshStandardMaterial || - material.isShaderMaterial || - material.isShadowMaterial || - object.isSkinnedMesh ) { + if ( _currentCamera !== camera ) { - p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse ); + _currentCamera = camera; + + // lighting uniforms depend on the camera so enforce an update + // now, in case this material supports lights - or later, when + // the next material that does gets activated: + + refreshMaterial = true; // set to true on material change + refreshLights = true; // remains set until update done } @@ -29900,7 +30077,16 @@ class WebGLRenderer { if ( renderTarget.isWebGLCubeRenderTarget ) { - framebuffer = __webglFramebuffer[ activeCubeFace ]; + if ( Array.isArray( __webglFramebuffer[ activeCubeFace ] ) ) { + + framebuffer = __webglFramebuffer[ activeCubeFace ][ activeMipmapLevel ]; + + } else { + + framebuffer = __webglFramebuffer[ activeCubeFace ]; + + } + isCube = true; } else if ( ( capabilities.isWebGL2 && renderTarget.samples > 0 ) && textures.useMultisampledRTT( renderTarget ) === false ) { @@ -29909,7 +30095,15 @@ class WebGLRenderer { } else { - framebuffer = __webglFramebuffer; + if ( Array.isArray( __webglFramebuffer ) ) { + + framebuffer = __webglFramebuffer[ activeMipmapLevel ]; + + } else { + + framebuffer = __webglFramebuffer; + + } } @@ -30200,16 +30394,22 @@ class WebGLRenderer { } + get coordinateSystem() { + + return WebGLCoordinateSystem; + + } + get physicallyCorrectLights() { // @deprecated, r150 - console.warn( 'THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' ); + console.warn( 'THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' ); return ! this.useLegacyLights; } set physicallyCorrectLights( value ) { // @deprecated, r150 - console.warn( 'THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' ); + console.warn( 'THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' ); this.useLegacyLights = ! value; } @@ -30228,6 +30428,20 @@ class WebGLRenderer { } + get useLegacyLights() { // @deprecated, r155 + + console.warn( 'THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733.' ); + return this._useLegacyLights; + + } + + set useLegacyLights( value ) { // @deprecated, r155 + + console.warn( 'THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733.' ); + this._useLegacyLights = value; + + } + } class WebGL1Renderer extends WebGLRenderer {} @@ -30357,20 +30571,6 @@ class Scene extends Object3D { } - get autoUpdate() { // @deprecated, r144 - - console.warn( 'THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.' ); - return this.matrixWorldAutoUpdate; - - } - - set autoUpdate( value ) { // @deprecated, r144 - - console.warn( 'THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.' ); - this.matrixWorldAutoUpdate = value; - - } - } class InterleavedBuffer { @@ -31573,8 +31773,6 @@ class Skeleton { this.boneTexture = null; this.boneTextureSize = 0; - this.frame = - 1; - this.init(); } @@ -32143,7 +32341,7 @@ class Line extends Object3D { super.copy( source, recursive ); - this.material = source.material; + this.material = Array.isArray( source.material ) ? source.material.slice() : source.material; this.geometry = source.geometry; return this; @@ -32464,7 +32662,7 @@ class Points extends Object3D { super.copy( source, recursive ); - this.material = source.material; + this.material = Array.isArray( source.material ) ? source.material.slice() : source.material; this.geometry = source.geometry; return this; @@ -32704,6 +32902,21 @@ class CompressedArrayTexture extends CompressedTexture { } +class CompressedCubeTexture extends CompressedTexture { + + constructor( images, format, type ) { + + super( undefined, images[ 0 ].width, images[ 0 ].height, format, type, CubeReflectionMapping ); + + this.isCompressedCubeTexture = true; + this.isCubeTexture = true; + + this.image = images; + + } + +} + class CanvasTexture extends Texture { constructor( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) { @@ -34814,7 +35027,7 @@ class CapsuleGeometry extends LatheGeometry { this.parameters = { radius: radius, - height: length, + length: length, capSegments: capSegments, radialSegments: radialSegments, }; @@ -41633,6 +41846,8 @@ class Loader { } +Loader.DEFAULT_MATERIAL_NAME = '__DEFAULT'; + const loading = {}; class HttpError extends Error { @@ -42195,6 +42410,7 @@ class CubeTextureLoader extends Loader { load( urls, onLoad, onProgress, onError ) { const texture = new CubeTexture(); + texture.colorSpace = SRGBColorSpace; const loader = new ImageLoader( this.manager ); loader.setCrossOrigin( this.crossOrigin ); @@ -42261,9 +42477,26 @@ class DataTextureLoader extends Loader { loader.setWithCredentials( scope.withCredentials ); loader.load( url, function ( buffer ) { - const texData = scope.parse( buffer ); + let texData; + + try { + + texData = scope.parse( buffer ); + + } catch ( error ) { + + if ( onError !== undefined ) { - if ( ! texData ) return; + onError( error ); + + } else { + + console.error( error ); + return; + + } + + } if ( texData.image !== undefined ) { @@ -43349,6 +43582,7 @@ class MaterialLoader extends Loader { if ( json.opacity !== undefined ) material.opacity = json.opacity; if ( json.transparent !== undefined ) material.transparent = json.transparent; if ( json.alphaTest !== undefined ) material.alphaTest = json.alphaTest; + if ( json.alphaHash !== undefined ) material.alphaHash = json.alphaHash; if ( json.depthTest !== undefined ) material.depthTest = json.depthTest; if ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite; if ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite; @@ -45669,6 +45903,12 @@ class Audio extends Object3D { disconnect() { + if ( this._connected === false ) { + + return; + + } + if ( this.filters.length > 0 ) { this.source.disconnect( this.filters[ 0 ] ); @@ -45869,6 +46109,14 @@ class PositionalAudio extends Audio { } + connect() { + + super.connect(); + + this.panner.connect( this.gain ); + + } + disconnect() { super.disconnect(); @@ -46776,7 +47024,7 @@ class PropertyBinding { // ensure there is a value node if ( ! targetObject ) { - console.error( 'THREE.PropertyBinding: Trying to update node for track: ' + this.path + ' but it wasn\'t found.' ); + console.warn( 'THREE.PropertyBinding: No target node found for track: ' + this.path + '.' ); return; } @@ -48909,7 +49157,7 @@ class Uniform { } -let id = 0; +let _id = 0; class UniformsGroup extends EventDispatcher { @@ -48919,7 +49167,7 @@ class UniformsGroup extends EventDispatcher { this.isUniformsGroup = true; - Object.defineProperty( this, 'id', { value: id ++ } ); + Object.defineProperty( this, 'id', { value: _id ++ } ); this.name = ''; @@ -51165,216 +51413,6 @@ class ShapePath { } -class BoxBufferGeometry extends BoxGeometry { // @deprecated, r144 - - constructor( width, height, depth, widthSegments, heightSegments, depthSegments ) { - - console.warn( 'THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry.' ); - super( width, height, depth, widthSegments, heightSegments, depthSegments ); - - - } - -} - -class CapsuleBufferGeometry extends CapsuleGeometry { // @deprecated, r144 - - constructor( radius, length, capSegments, radialSegments ) { - - console.warn( 'THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry.' ); - super( radius, length, capSegments, radialSegments ); - - } - -} - -class CircleBufferGeometry extends CircleGeometry { // @deprecated, r144 - - constructor( radius, segments, thetaStart, thetaLength ) { - - console.warn( 'THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry.' ); - super( radius, segments, thetaStart, thetaLength ); - - } - -} - -class ConeBufferGeometry extends ConeGeometry { // @deprecated, r144 - - constructor( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { - - console.warn( 'THREE.ConeBufferGeometry has been renamed to THREE.ConeGeometry.' ); - super( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); - - } - -} - -class CylinderBufferGeometry extends CylinderGeometry { // @deprecated, r144 - - constructor( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { - - console.warn( 'THREE.CylinderBufferGeometry has been renamed to THREE.CylinderGeometry.' ); - super( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); - - } - -} - -class DodecahedronBufferGeometry extends DodecahedronGeometry { // @deprecated, r144 - - constructor( radius, detail ) { - - console.warn( 'THREE.DodecahedronBufferGeometry has been renamed to THREE.DodecahedronGeometry.' ); - super( radius, detail ); - - } - -} - -class ExtrudeBufferGeometry extends ExtrudeGeometry { // @deprecated, r144 - - constructor( shapes, options ) { - - console.warn( 'THREE.ExtrudeBufferGeometry has been renamed to THREE.ExtrudeGeometry.' ); - super( shapes, options ); - - } - -} - -class IcosahedronBufferGeometry extends IcosahedronGeometry { // @deprecated, r144 - - constructor( radius, detail ) { - - console.warn( 'THREE.IcosahedronBufferGeometry has been renamed to THREE.IcosahedronGeometry.' ); - super( radius, detail ); - - } - -} - -class LatheBufferGeometry extends LatheGeometry { // @deprecated, r144 - - constructor( points, segments, phiStart, phiLength ) { - - console.warn( 'THREE.LatheBufferGeometry has been renamed to THREE.LatheGeometry.' ); - super( points, segments, phiStart, phiLength ); - - } - -} - -class OctahedronBufferGeometry extends OctahedronGeometry { // @deprecated, r144 - - constructor( radius, detail ) { - - console.warn( 'THREE.OctahedronBufferGeometry has been renamed to THREE.OctahedronGeometry.' ); - super( radius, detail ); - - } - -} - -class PlaneBufferGeometry extends PlaneGeometry { // @deprecated, r144 - - constructor( width, height, widthSegments, heightSegments ) { - - console.warn( 'THREE.PlaneBufferGeometry has been renamed to THREE.PlaneGeometry.' ); - super( width, height, widthSegments, heightSegments ); - - } - -} - -class PolyhedronBufferGeometry extends PolyhedronGeometry { // @deprecated, r144 - - constructor( vertices, indices, radius, detail ) { - - console.warn( 'THREE.PolyhedronBufferGeometry has been renamed to THREE.PolyhedronGeometry.' ); - super( vertices, indices, radius, detail ); - - } - -} - -class RingBufferGeometry extends RingGeometry { // @deprecated, r144 - - constructor( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) { - - console.warn( 'THREE.RingBufferGeometry has been renamed to THREE.RingGeometry.' ); - super( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ); - - } - -} - -class ShapeBufferGeometry extends ShapeGeometry { // @deprecated, r144 - - constructor( shapes, curveSegments ) { - - console.warn( 'THREE.ShapeBufferGeometry has been renamed to THREE.ShapeGeometry.' ); - super( shapes, curveSegments ); - - } - -} - -class SphereBufferGeometry extends SphereGeometry { // @deprecated, r144 - - constructor( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) { - - console.warn( 'THREE.SphereBufferGeometry has been renamed to THREE.SphereGeometry.' ); - super( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ); - - } - -} - -class TetrahedronBufferGeometry extends TetrahedronGeometry { // @deprecated, r144 - - constructor( radius, detail ) { - - console.warn( 'THREE.TetrahedronBufferGeometry has been renamed to THREE.TetrahedronGeometry.' ); - super( radius, detail ); - - } - -} - -class TorusBufferGeometry extends TorusGeometry { // @deprecated, r144 - - constructor( radius, tube, radialSegments, tubularSegments, arc ) { - - console.warn( 'THREE.TorusBufferGeometry has been renamed to THREE.TorusGeometry.' ); - super( radius, tube, radialSegments, tubularSegments, arc ); - - } - -} - -class TorusKnotBufferGeometry extends TorusKnotGeometry { // @deprecated, r144 - - constructor( radius, tube, tubularSegments, radialSegments, p, q ) { - - console.warn( 'THREE.TorusKnotBufferGeometry has been renamed to THREE.TorusKnotGeometry.' ); - super( radius, tube, tubularSegments, radialSegments, p, q ); - - } - -} - -class TubeBufferGeometry extends TubeGeometry { // @deprecated, r144 - - constructor( path, tubularSegments, radius, radialSegments, closed ) { - - console.warn( 'THREE.TubeBufferGeometry has been renamed to THREE.TubeGeometry.' ); - super( path, tubularSegments, radius, radialSegments, closed ); - - } - -} - if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) { __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: { @@ -51431,7 +51469,6 @@ exports.BooleanKeyframeTrack = BooleanKeyframeTrack; exports.Box2 = Box2; exports.Box3 = Box3; exports.Box3Helper = Box3Helper; -exports.BoxBufferGeometry = BoxBufferGeometry; exports.BoxGeometry = BoxGeometry; exports.BoxHelper = BoxHelper; exports.BufferAttribute = BufferAttribute; @@ -51442,11 +51479,9 @@ exports.Cache = Cache; exports.Camera = Camera; exports.CameraHelper = CameraHelper; exports.CanvasTexture = CanvasTexture; -exports.CapsuleBufferGeometry = CapsuleBufferGeometry; exports.CapsuleGeometry = CapsuleGeometry; exports.CatmullRomCurve3 = CatmullRomCurve3; exports.CineonToneMapping = CineonToneMapping; -exports.CircleBufferGeometry = CircleBufferGeometry; exports.CircleGeometry = CircleGeometry; exports.ClampToEdgeWrapping = ClampToEdgeWrapping; exports.Clock = Clock; @@ -51454,9 +51489,9 @@ exports.Color = Color; exports.ColorKeyframeTrack = ColorKeyframeTrack; exports.ColorManagement = ColorManagement; exports.CompressedArrayTexture = CompressedArrayTexture; +exports.CompressedCubeTexture = CompressedCubeTexture; exports.CompressedTexture = CompressedTexture; exports.CompressedTextureLoader = CompressedTextureLoader; -exports.ConeBufferGeometry = ConeBufferGeometry; exports.ConeGeometry = ConeGeometry; exports.CubeCamera = CubeCamera; exports.CubeReflectionMapping = CubeReflectionMapping; @@ -51475,7 +51510,6 @@ exports.Curve = Curve; exports.CurvePath = CurvePath; exports.CustomBlending = CustomBlending; exports.CustomToneMapping = CustomToneMapping; -exports.CylinderBufferGeometry = CylinderBufferGeometry; exports.CylinderGeometry = CylinderGeometry; exports.Cylindrical = Cylindrical; exports.Data3DTexture = Data3DTexture; @@ -51493,7 +51527,6 @@ exports.DirectionalLight = DirectionalLight; exports.DirectionalLightHelper = DirectionalLightHelper; exports.DiscreteInterpolant = DiscreteInterpolant; exports.DisplayP3ColorSpace = DisplayP3ColorSpace; -exports.DodecahedronBufferGeometry = DodecahedronBufferGeometry; exports.DodecahedronGeometry = DodecahedronGeometry; exports.DoubleSide = DoubleSide; exports.DstAlphaFactor = DstAlphaFactor; @@ -51510,7 +51543,6 @@ exports.EquirectangularReflectionMapping = EquirectangularReflectionMapping; exports.EquirectangularRefractionMapping = EquirectangularRefractionMapping; exports.Euler = Euler; exports.EventDispatcher = EventDispatcher; -exports.ExtrudeBufferGeometry = ExtrudeBufferGeometry; exports.ExtrudeGeometry = ExtrudeGeometry; exports.FileLoader = FileLoader; exports.Float16BufferAttribute = Float16BufferAttribute; @@ -51537,7 +51569,6 @@ exports.HalfFloatType = HalfFloatType; exports.HemisphereLight = HemisphereLight; exports.HemisphereLightHelper = HemisphereLightHelper; exports.HemisphereLightProbe = HemisphereLightProbe; -exports.IcosahedronBufferGeometry = IcosahedronBufferGeometry; exports.IcosahedronGeometry = IcosahedronGeometry; exports.ImageBitmapLoader = ImageBitmapLoader; exports.ImageLoader = ImageLoader; @@ -51562,7 +51593,6 @@ exports.InvertStencilOp = InvertStencilOp; exports.KeepStencilOp = KeepStencilOp; exports.KeyframeTrack = KeyframeTrack; exports.LOD = LOD; -exports.LatheBufferGeometry = LatheBufferGeometry; exports.LatheGeometry = LatheGeometry; exports.Layers = Layers; exports.LessCompare = LessCompare; @@ -51581,6 +51611,7 @@ exports.LineCurve3 = LineCurve3; exports.LineDashedMaterial = LineDashedMaterial; exports.LineLoop = LineLoop; exports.LineSegments = LineSegments; +exports.LinearDisplayP3ColorSpace = LinearDisplayP3ColorSpace; exports.LinearEncoding = LinearEncoding; exports.LinearFilter = LinearFilter; exports.LinearInterpolant = LinearInterpolant; @@ -51641,7 +51672,6 @@ exports.NumberKeyframeTrack = NumberKeyframeTrack; exports.Object3D = Object3D; exports.ObjectLoader = ObjectLoader; exports.ObjectSpaceNormalMap = ObjectSpaceNormalMap; -exports.OctahedronBufferGeometry = OctahedronBufferGeometry; exports.OctahedronGeometry = OctahedronGeometry; exports.OneFactor = OneFactor; exports.OneMinusDstAlphaFactor = OneMinusDstAlphaFactor; @@ -51655,7 +51685,6 @@ exports.PMREMGenerator = PMREMGenerator; exports.Path = Path; exports.PerspectiveCamera = PerspectiveCamera; exports.Plane = Plane; -exports.PlaneBufferGeometry = PlaneBufferGeometry; exports.PlaneGeometry = PlaneGeometry; exports.PlaneHelper = PlaneHelper; exports.PointLight = PointLight; @@ -51663,7 +51692,6 @@ exports.PointLightHelper = PointLightHelper; exports.Points = Points; exports.PointsMaterial = PointsMaterial; exports.PolarGridHelper = PolarGridHelper; -exports.PolyhedronBufferGeometry = PolyhedronBufferGeometry; exports.PolyhedronGeometry = PolyhedronGeometry; exports.PositionalAudio = PositionalAudio; exports.PropertyBinding = PropertyBinding; @@ -51700,6 +51728,8 @@ exports.RGBA_PVRTC_4BPPV1_Format = RGBA_PVRTC_4BPPV1_Format; exports.RGBA_S3TC_DXT1_Format = RGBA_S3TC_DXT1_Format; exports.RGBA_S3TC_DXT3_Format = RGBA_S3TC_DXT3_Format; exports.RGBA_S3TC_DXT5_Format = RGBA_S3TC_DXT5_Format; +exports.RGB_BPTC_SIGNED_Format = RGB_BPTC_SIGNED_Format; +exports.RGB_BPTC_UNSIGNED_Format = RGB_BPTC_UNSIGNED_Format; exports.RGB_ETC1_Format = RGB_ETC1_Format; exports.RGB_ETC2_Format = RGB_ETC2_Format; exports.RGB_PVRTC_2BPPV1_Format = RGB_PVRTC_2BPPV1_Format; @@ -51714,10 +51744,10 @@ exports.RectAreaLight = RectAreaLight; exports.RedFormat = RedFormat; exports.RedIntegerFormat = RedIntegerFormat; exports.ReinhardToneMapping = ReinhardToneMapping; +exports.RenderTarget = RenderTarget; exports.RepeatWrapping = RepeatWrapping; exports.ReplaceStencilOp = ReplaceStencilOp; exports.ReverseSubtractEquation = ReverseSubtractEquation; -exports.RingBufferGeometry = RingBufferGeometry; exports.RingGeometry = RingGeometry; exports.SIGNED_RED_GREEN_RGTC2_Format = SIGNED_RED_GREEN_RGTC2_Format; exports.SIGNED_RED_RGTC1_Format = SIGNED_RED_RGTC1_Format; @@ -51728,7 +51758,6 @@ exports.ShaderLib = ShaderLib; exports.ShaderMaterial = ShaderMaterial; exports.ShadowMaterial = ShadowMaterial; exports.Shape = Shape; -exports.ShapeBufferGeometry = ShapeBufferGeometry; exports.ShapeGeometry = ShapeGeometry; exports.ShapePath = ShapePath; exports.ShapeUtils = ShapeUtils; @@ -51738,7 +51767,6 @@ exports.SkeletonHelper = SkeletonHelper; exports.SkinnedMesh = SkinnedMesh; exports.Source = Source; exports.Sphere = Sphere; -exports.SphereBufferGeometry = SphereBufferGeometry; exports.SphereGeometry = SphereGeometry; exports.Spherical = Spherical; exports.SphericalHarmonics3 = SphericalHarmonics3; @@ -51762,19 +51790,15 @@ exports.SubtractEquation = SubtractEquation; exports.SubtractiveBlending = SubtractiveBlending; exports.TOUCH = TOUCH; exports.TangentSpaceNormalMap = TangentSpaceNormalMap; -exports.TetrahedronBufferGeometry = TetrahedronBufferGeometry; exports.TetrahedronGeometry = TetrahedronGeometry; exports.Texture = Texture; exports.TextureLoader = TextureLoader; -exports.TorusBufferGeometry = TorusBufferGeometry; exports.TorusGeometry = TorusGeometry; -exports.TorusKnotBufferGeometry = TorusKnotBufferGeometry; exports.TorusKnotGeometry = TorusKnotGeometry; exports.Triangle = Triangle; exports.TriangleFanDrawMode = TriangleFanDrawMode; exports.TriangleStripDrawMode = TriangleStripDrawMode; exports.TrianglesDrawMode = TrianglesDrawMode; -exports.TubeBufferGeometry = TubeBufferGeometry; exports.TubeGeometry = TubeGeometry; exports.TwoPassDoubleSide = TwoPassDoubleSide; exports.UVMapping = UVMapping; @@ -51801,11 +51825,13 @@ exports.VideoTexture = VideoTexture; exports.WebGL1Renderer = WebGL1Renderer; exports.WebGL3DRenderTarget = WebGL3DRenderTarget; exports.WebGLArrayRenderTarget = WebGLArrayRenderTarget; +exports.WebGLCoordinateSystem = WebGLCoordinateSystem; exports.WebGLCubeRenderTarget = WebGLCubeRenderTarget; exports.WebGLMultipleRenderTargets = WebGLMultipleRenderTargets; exports.WebGLRenderTarget = WebGLRenderTarget; exports.WebGLRenderer = WebGLRenderer; exports.WebGLUtils = WebGLUtils; +exports.WebGPUCoordinateSystem = WebGPUCoordinateSystem; exports.WireframeGeometry = WireframeGeometry; exports.WrapAroundEnding = WrapAroundEnding; exports.ZeroCurvatureEnding = ZeroCurvatureEnding; @@ -51813,4 +51839,5 @@ exports.ZeroFactor = ZeroFactor; exports.ZeroSlopeEnding = ZeroSlopeEnding; exports.ZeroStencilOp = ZeroStencilOp; exports._SRGBAFormat = _SRGBAFormat; +exports.createCanvasElement = createCanvasElement; exports.sRGBEncoding = sRGBEncoding; diff --git a/build/three.js b/build/three.js index 11f807fc5755bf..707a8c3ed6a739 100644 --- a/build/three.js +++ b/build/three.js @@ -10,7 +10,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.THREE = {})); })(this, (function (exports) { 'use strict'; - const REVISION = '153dev'; + const REVISION = '156'; const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 }; const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }; @@ -134,6 +134,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated const RGBA_ASTC_12x10_Format = 37820; const RGBA_ASTC_12x12_Format = 37821; const RGBA_BPTC_Format = 36492; + const RGB_BPTC_SIGNED_Format = 36494; + const RGB_BPTC_UNSIGNED_Format = 36495; const RED_RGTC1_Format = 36283; const SIGNED_RED_RGTC1_Format = 36284; const RED_GREEN_RGTC2_Format = 36285; @@ -166,6 +168,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated const SRGBColorSpace = 'srgb'; const LinearSRGBColorSpace = 'srgb-linear'; const DisplayP3ColorSpace = 'display-p3'; + const LinearDisplayP3ColorSpace = 'display-p3-linear'; const ZeroStencilOp = 0; const KeepStencilOp = 7680; @@ -209,6 +212,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated const _SRGBAFormat = 1035; // fallback for WebGL 1 + const WebGLCoordinateSystem = 2000; + const WebGPUCoordinateSystem = 2001; + /** * https://github.com/mrdoob/eventdispatcher.js/ */ @@ -923,8 +929,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated roundToZero() { - this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); - this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); + this.x = Math.trunc( this.x ); + this.y = Math.trunc( this.y ); return this; @@ -1532,6 +1538,14 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } + function createCanvasElement() { + + const canvas = createElementNS( 'canvas' ); + canvas.style.display = 'block'; + return canvas; + + } + const _cache = {}; function warnOnce( message ) { @@ -1923,7 +1937,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } - let textureId = 0; + let _textureId = 0; class Texture extends EventDispatcher { @@ -1933,7 +1947,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated this.isTexture = true; - Object.defineProperty( this, 'id', { value: textureId ++ } ); + Object.defineProperty( this, 'id', { value: _textureId ++ } ); this.uuid = generateUUID(); @@ -2743,10 +2757,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated roundToZero() { - this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); - this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); - this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z ); - this.w = ( this.w < 0 ) ? Math.ceil( this.w ) : Math.floor( this.w ); + this.x = Math.trunc( this.x ); + this.y = Math.trunc( this.y ); + this.z = Math.trunc( this.z ); + this.w = Math.trunc( this.w ); return this; @@ -2887,13 +2901,13 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated * Texture parameters for an auto-generated target texture * depthBuffer/stencilBuffer: Booleans to indicate if we should generate these buffers */ - class WebGLRenderTarget extends EventDispatcher { + class RenderTarget extends EventDispatcher { constructor( width = 1, height = 1, options = {} ) { super(); - this.isWebGLRenderTarget = true; + this.isRenderTarget = true; this.width = width; this.height = height; @@ -2996,6 +3010,18 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } + class WebGLRenderTarget extends RenderTarget { + + constructor( width = 1, height = 1, options = {} ) { + + super( width, height, options ); + + this.isWebGLRenderTarget = true; + + } + + } + class DataArrayTexture extends Texture { constructor( data = null, width = 1, height = 1, depth = 1 ) { @@ -3130,8 +3156,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated this.viewport.set( 0, 0, width, height ); this.scissor.set( 0, 0, width, height ); - return this; - } copy( source ) { @@ -4244,9 +4268,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated roundToZero() { - this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); - this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); - this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z ); + this.x = Math.trunc( this.x ); + this.y = Math.trunc( this.y ); + this.z = Math.trunc( this.z ); return this; @@ -6585,7 +6609,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } - makePerspective( left, right, top, bottom, near, far ) { + makePerspective( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) { const te = this.elements; const x = 2 * near / ( right - left ); @@ -6593,19 +6617,35 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated const a = ( right + left ) / ( right - left ); const b = ( top + bottom ) / ( top - bottom ); - const c = - ( far + near ) / ( far - near ); - const d = - 2 * far * near / ( far - near ); - te[ 0 ] = x; te[ 4 ] = 0; te[ 8 ] = a; te[ 12 ] = 0; - te[ 1 ] = 0; te[ 5 ] = y; te[ 9 ] = b; te[ 13 ] = 0; - te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = c; te[ 14 ] = d; + let c, d; + + if ( coordinateSystem === WebGLCoordinateSystem ) { + + c = - ( far + near ) / ( far - near ); + d = ( - 2 * far * near ) / ( far - near ); + + } else if ( coordinateSystem === WebGPUCoordinateSystem ) { + + c = - far / ( far - near ); + d = ( - far * near ) / ( far - near ); + + } else { + + throw new Error( 'THREE.Matrix4.makePerspective(): Invalid coordinate system: ' + coordinateSystem ); + + } + + te[ 0 ] = x; te[ 4 ] = 0; te[ 8 ] = a; te[ 12 ] = 0; + te[ 1 ] = 0; te[ 5 ] = y; te[ 9 ] = b; te[ 13 ] = 0; + te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = c; te[ 14 ] = d; te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = - 1; te[ 15 ] = 0; return this; } - makeOrthographic( left, right, top, bottom, near, far ) { + makeOrthographic( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) { const te = this.elements; const w = 1.0 / ( right - left ); @@ -6614,12 +6654,29 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated const x = ( right + left ) * w; const y = ( top + bottom ) * h; - const z = ( far + near ) * p; - te[ 0 ] = 2 * w; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = - x; - te[ 1 ] = 0; te[ 5 ] = 2 * h; te[ 9 ] = 0; te[ 13 ] = - y; - te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = - 2 * p; te[ 14 ] = - z; - te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = 0; te[ 15 ] = 1; + let z, zInv; + + if ( coordinateSystem === WebGLCoordinateSystem ) { + + z = ( far + near ) * p; + zInv = - 2 * p; + + } else if ( coordinateSystem === WebGPUCoordinateSystem ) { + + z = near * p; + zInv = - 1 * p; + + } else { + + throw new Error( 'THREE.Matrix4.makeOrthographic(): Invalid coordinate system: ' + coordinateSystem ); + + } + + te[ 0 ] = 2 * w; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = - x; + te[ 1 ] = 0; te[ 5 ] = 2 * h; te[ 9 ] = 0; te[ 13 ] = - y; + te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = zInv; te[ 14 ] = - z; + te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = 0; te[ 15 ] = 1; return this; @@ -7443,20 +7500,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated clear() { - for ( let i = 0; i < this.children.length; i ++ ) { - - const object = this.children[ i ]; - - object.parent = null; - - object.dispatchEvent( _removedEvent ); - - } - - this.children.length = 0; - - return this; - + return this.remove( ... this.children ); } @@ -7996,7 +8040,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated this.frustumCulled = source.frustumCulled; this.renderOrder = source.renderOrder; - this.animations = source.animations; + this.animations = source.animations.slice(); this.userData = JSON.parse( JSON.stringify( source.userData ) ); @@ -8347,7 +8391,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } - let materialId = 0; + let _materialId = 0; class Material extends EventDispatcher { @@ -8357,7 +8401,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated this.isMaterial = true; - Object.defineProperty( this, 'id', { value: materialId ++ } ); + Object.defineProperty( this, 'id', { value: _materialId ++ } ); this.uuid = generateUUID(); @@ -8370,6 +8414,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated this.opacity = 1; this.transparent = false; + this.alphaHash = false; this.blendSrc = SrcAlphaFactor; this.blendDst = OneMinusSrcAlphaFactor; @@ -8698,6 +8743,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated if ( this.dithering === true ) data.dithering = true; if ( this.alphaTest > 0 ) data.alphaTest = this.alphaTest; + if ( this.alphaHash === true ) data.alphaHash = this.alphaHash; if ( this.alphaToCoverage === true ) data.alphaToCoverage = this.alphaToCoverage; if ( this.premultipliedAlpha === true ) data.premultipliedAlpha = this.premultipliedAlpha; if ( this.forceSinglePass === true ) data.forceSinglePass = this.forceSinglePass; @@ -8819,6 +8865,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated this.dithering = source.dithering; this.alphaTest = source.alphaTest; + this.alphaHash = source.alphaHash; this.alphaToCoverage = source.alphaToCoverage; this.premultipliedAlpha = source.premultipliedAlpha; this.forceSinglePass = source.forceSinglePass; @@ -9738,6 +9785,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated this.usage = StaticDrawUsage; this.updateRange = { offset: 0, count: - 1 }; + this.gpuType = FloatType; this.version = 0; @@ -9768,6 +9816,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated this.normalized = source.normalized; this.usage = source.usage; + this.gpuType = source.gpuType; return this; @@ -9883,6 +9932,26 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } + getComponent( index, component ) { + + let value = this.array[ index * this.itemSize + component ]; + + if ( this.normalized ) value = denormalize( value, this.array ); + + return value; + + } + + setComponent( index, component, value ) { + + if ( this.normalized ) value = normalize( value, this.array ); + + this.array[ index * this.itemSize + component ] = value; + + return this; + + } + getX( index ) { let x = this.array[ index * this.itemSize ]; @@ -10054,30 +10123,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } - copyColorsArray() { // @deprecated, r144 - - console.error( 'THREE.BufferAttribute: copyColorsArray() was removed in r144.' ); - - } - - copyVector2sArray() { // @deprecated, r144 - - console.error( 'THREE.BufferAttribute: copyVector2sArray() was removed in r144.' ); - - } - - copyVector3sArray() { // @deprecated, r144 - - console.error( 'THREE.BufferAttribute: copyVector3sArray() was removed in r144.' ); - - } - - copyVector4sArray() { // @deprecated, r144 - - console.error( 'THREE.BufferAttribute: copyVector4sArray() was removed in r144.' ); - - } - } // @@ -10088,18 +10133,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated super( new Int8Array( array ), itemSize, normalized ); - this.gpuType = FloatType; - - } - - copy( source ) { - - super.copy( source ); - - this.gpuType = source.gpuType; - - return this; - } } @@ -10110,18 +10143,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated super( new Uint8Array( array ), itemSize, normalized ); - this.gpuType = FloatType; - - } - - copy( source ) { - - super.copy( source ); - - this.gpuType = source.gpuType; - - return this; - } } @@ -10142,18 +10163,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated super( new Int16Array( array ), itemSize, normalized ); - this.gpuType = FloatType; - - } - - copy( source ) { - - super.copy( source ); - - this.gpuType = source.gpuType; - - return this; - } } @@ -10164,18 +10173,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated super( new Uint16Array( array ), itemSize, normalized ); - this.gpuType = FloatType; - - } - - copy( source ) { - - super.copy( source ); - - this.gpuType = source.gpuType; - - return this; - } } @@ -10373,7 +10370,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } - let _id$1 = 0; + let _id$2 = 0; const _m1 = /*@__PURE__*/ new Matrix4(); const _obj = /*@__PURE__*/ new Object3D(); @@ -10390,7 +10387,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated this.isBufferGeometry = true; - Object.defineProperty( this, 'id', { value: _id$1 ++ } ); + Object.defineProperty( this, 'id', { value: _id$2 ++ } ); this.uuid = generateUUID(); @@ -11089,13 +11086,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } - merge() { // @deprecated, r144 - - console.error( 'THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeGeometries() instead.' ); - return this; - - } - normalizeNormals() { const normals = this.attributes.normal; @@ -11502,7 +11492,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } - this.material = source.material; + this.material = Array.isArray( source.material ) ? source.material.slice() : source.material; this.geometry = source.geometry; return this; @@ -12338,6 +12328,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated this.projectionMatrix = new Matrix4(); this.projectionMatrixInverse = new Matrix4(); + this.coordinateSystem = WebGLCoordinateSystem; + } copy( source, recursive ) { @@ -12349,6 +12341,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated this.projectionMatrix.copy( source.projectionMatrix ); this.projectionMatrixInverse.copy( source.projectionMatrixInverse ); + this.coordinateSystem = source.coordinateSystem; + return this; } @@ -12586,7 +12580,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated const skew = this.filmOffset; if ( skew !== 0 ) left += near * skew / this.getFilmWidth(); - this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far ); + this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far, this.coordinateSystem ); this.projectionMatrixInverse.copy( this.projectionMatrix ).invert(); @@ -12628,59 +12622,120 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated this.type = 'CubeCamera'; this.renderTarget = renderTarget; + this.coordinateSystem = null; const cameraPX = new PerspectiveCamera( fov, aspect, near, far ); cameraPX.layers = this.layers; - cameraPX.up.set( 0, 1, 0 ); - cameraPX.lookAt( 1, 0, 0 ); this.add( cameraPX ); const cameraNX = new PerspectiveCamera( fov, aspect, near, far ); cameraNX.layers = this.layers; - cameraNX.up.set( 0, 1, 0 ); - cameraNX.lookAt( - 1, 0, 0 ); this.add( cameraNX ); const cameraPY = new PerspectiveCamera( fov, aspect, near, far ); cameraPY.layers = this.layers; - cameraPY.up.set( 0, 0, - 1 ); - cameraPY.lookAt( 0, 1, 0 ); this.add( cameraPY ); const cameraNY = new PerspectiveCamera( fov, aspect, near, far ); cameraNY.layers = this.layers; - cameraNY.up.set( 0, 0, 1 ); - cameraNY.lookAt( 0, - 1, 0 ); this.add( cameraNY ); const cameraPZ = new PerspectiveCamera( fov, aspect, near, far ); cameraPZ.layers = this.layers; - cameraPZ.up.set( 0, 1, 0 ); - cameraPZ.lookAt( 0, 0, 1 ); this.add( cameraPZ ); const cameraNZ = new PerspectiveCamera( fov, aspect, near, far ); cameraNZ.layers = this.layers; - cameraNZ.up.set( 0, 1, 0 ); - cameraNZ.lookAt( 0, 0, - 1 ); this.add( cameraNZ ); } + updateCoordinateSystem() { + + const coordinateSystem = this.coordinateSystem; + + const cameras = this.children.concat(); + + const [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = cameras; + + for ( const camera of cameras ) this.remove( camera ); + + if ( coordinateSystem === WebGLCoordinateSystem ) { + + cameraPX.up.set( 0, 1, 0 ); + cameraPX.lookAt( 1, 0, 0 ); + + cameraNX.up.set( 0, 1, 0 ); + cameraNX.lookAt( - 1, 0, 0 ); + + cameraPY.up.set( 0, 0, - 1 ); + cameraPY.lookAt( 0, 1, 0 ); + + cameraNY.up.set( 0, 0, 1 ); + cameraNY.lookAt( 0, - 1, 0 ); + + cameraPZ.up.set( 0, 1, 0 ); + cameraPZ.lookAt( 0, 0, 1 ); + + cameraNZ.up.set( 0, 1, 0 ); + cameraNZ.lookAt( 0, 0, - 1 ); + + } else if ( coordinateSystem === WebGPUCoordinateSystem ) { + + cameraPX.up.set( 0, - 1, 0 ); + cameraPX.lookAt( - 1, 0, 0 ); + + cameraNX.up.set( 0, - 1, 0 ); + cameraNX.lookAt( 1, 0, 0 ); + + cameraPY.up.set( 0, 0, 1 ); + cameraPY.lookAt( 0, 1, 0 ); + + cameraNY.up.set( 0, 0, - 1 ); + cameraNY.lookAt( 0, - 1, 0 ); + + cameraPZ.up.set( 0, - 1, 0 ); + cameraPZ.lookAt( 0, 0, 1 ); + + cameraNZ.up.set( 0, - 1, 0 ); + cameraNZ.lookAt( 0, 0, - 1 ); + + } else { + + throw new Error( 'THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: ' + coordinateSystem ); + + } + + for ( const camera of cameras ) { + + this.add( camera ); + + camera.updateMatrixWorld(); + + } + + } + update( renderer, scene ) { if ( this.parent === null ) this.updateMatrixWorld(); const renderTarget = this.renderTarget; + if ( this.coordinateSystem !== renderer.coordinateSystem ) { + + this.coordinateSystem = renderer.coordinateSystem; + + this.updateCoordinateSystem(); + + } + const [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = this.children; const currentRenderTarget = renderer.getRenderTarget(); - const currentToneMapping = renderer.toneMapping; const currentXrEnabled = renderer.xr.enabled; - renderer.toneMapping = NoToneMapping; renderer.xr.enabled = false; const generateMipmaps = renderTarget.texture.generateMipmaps; @@ -12709,7 +12764,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated renderer.setRenderTarget( currentRenderTarget ); - renderer.toneMapping = currentToneMapping; renderer.xr.enabled = currentXrEnabled; renderTarget.texture.needsPMREMUpdate = true; @@ -13132,7 +13186,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } - setFromProjectionMatrix( m ) { + setFromProjectionMatrix( m, coordinateSystem = WebGLCoordinateSystem ) { const planes = this.planes; const me = m.elements; @@ -13146,7 +13200,20 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated planes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize(); planes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize(); planes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize(); - planes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize(); + + if ( coordinateSystem === WebGLCoordinateSystem ) { + + planes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize(); + + } else if ( coordinateSystem === WebGPUCoordinateSystem ) { + + planes[ 5 ].setComponents( me2, me6, me10, me14 ).normalize(); + + } else { + + throw new Error( 'THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: ' + coordinateSystem ); + + } return this; @@ -13597,6 +13664,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } + var alphahash_fragment = "#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif"; + + var alphahash_pars_fragment = "#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif"; + var alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif"; var alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif"; @@ -13609,13 +13680,13 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated var aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif"; - var begin_vertex = "vec3 transformed = vec3( position );"; + var begin_vertex = "vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif"; var beginnormal_vertex = "vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif"; var bsdfs = "float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated"; - var iridescence_fragment = "#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\t return vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat R21 = R12;\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif"; + var iridescence_fragment = "#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif"; var bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif"; @@ -13635,7 +13706,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated var color_vertex = "#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif"; - var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated"; + var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated"; var cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif"; @@ -13649,9 +13720,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated var emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif"; - var encodings_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );"; + var colorspace_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );"; - var encodings_pars_fragment = "vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}"; + var colorspace_pars_fragment = "vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}"; var envmap_fragment = "#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif"; @@ -13711,7 +13782,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif"; - var map_fragment = "#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, vMapUv );\n#endif"; + var map_fragment = "#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif"; var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif"; @@ -13731,7 +13802,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated var morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif"; - var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal, vNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;"; + var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;"; var normal_fragment_maps = "#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif"; @@ -13751,7 +13822,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated var iridescence_pars_fragment = "#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif"; - var output_fragment = "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );"; + var opaque_fragment = "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );"; var packing = "vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}"; @@ -13795,53 +13866,53 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated var transmission_pars_fragment = "#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif"; - var uv_pars_fragment = "#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif"; + var uv_pars_fragment = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif"; - var uv_pars_vertex = "#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif"; + var uv_pars_vertex = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif"; - var uv_vertex = "#ifdef USE_UV\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif"; + var uv_vertex = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif"; var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif"; const vertex$h = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}"; - const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}"; + const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}"; const vertex$g = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}"; - const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}"; + const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}"; const vertex$f = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}"; - const fragment$f = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}"; + const fragment$f = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}"; const vertex$e = "#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}"; - const fragment$e = "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}"; + const fragment$e = "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}"; const vertex$d = "#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}"; - const fragment$d = "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}"; + const fragment$d = "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}"; const vertex$c = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}"; - const fragment$c = "uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}"; + const fragment$c = "uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}"; const vertex$b = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; - const fragment$b = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + const fragment$b = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$a = "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; - const fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + const fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$9 = "#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}"; - const fragment$9 = "#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + const fragment$9 = "#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$8 = "#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}"; - const fragment$8 = "#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + const fragment$8 = "#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$7 = "#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}"; @@ -13849,29 +13920,31 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated const vertex$6 = "#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}"; - const fragment$6 = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + const fragment$6 = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$5 = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}"; - const fragment$5 = "#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + const fragment$5 = "#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$4 = "#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}"; - const fragment$4 = "#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + const fragment$4 = "#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$3 = "uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}"; - const fragment$3 = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + const fragment$3 = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$2 = "#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; - const fragment$2 = "uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}"; + const fragment$2 = "uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}"; const vertex$1 = "uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"; - const fragment$1 = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"; + const fragment$1 = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"; const ShaderChunk = { + alphahash_fragment: alphahash_fragment, + alphahash_pars_fragment: alphahash_pars_fragment, alphamap_fragment: alphamap_fragment, alphamap_pars_fragment: alphamap_pars_fragment, alphatest_fragment: alphatest_fragment, @@ -13898,8 +13971,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated displacementmap_vertex: displacementmap_vertex, emissivemap_fragment: emissivemap_fragment, emissivemap_pars_fragment: emissivemap_pars_fragment, - encodings_fragment: encodings_fragment, - encodings_pars_fragment: encodings_pars_fragment, + colorspace_fragment: colorspace_fragment, + colorspace_pars_fragment: colorspace_pars_fragment, envmap_fragment: envmap_fragment, envmap_common_pars_fragment: envmap_common_pars_fragment, envmap_pars_fragment: envmap_pars_fragment, @@ -13949,7 +14022,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated clearcoat_normal_fragment_maps: clearcoat_normal_fragment_maps, clearcoat_pars_fragment: clearcoat_pars_fragment, iridescence_pars_fragment: iridescence_pars_fragment, - output_fragment: output_fragment, + opaque_fragment: opaque_fragment, packing: packing, premultiplied_alpha_fragment: premultiplied_alpha_fragment, project_vertex: project_vertex, @@ -14623,24 +14696,15 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } - const xr = renderer.xr; - const environmentBlendMode = xr.getEnvironmentBlendMode(); + const environmentBlendMode = renderer.xr.getEnvironmentBlendMode(); - switch ( environmentBlendMode ) { + if ( environmentBlendMode === 'additive' ) { - case 'opaque': - forceClear = true; - break; + state.buffers.color.setClear( 0, 0, 0, 1, premultipliedAlpha ); - case 'additive': - state.buffers.color.setClear( 0, 0, 0, 1, premultipliedAlpha ); - forceClear = true; - break; + } else if ( environmentBlendMode === 'alpha-blend' ) { - case 'alpha-blend': - state.buffers.color.setClear( 0, 0, 0, 0, premultipliedAlpha ); - forceClear = true; - break; + state.buffers.color.setClear( 0, 0, 0, 0, premultipliedAlpha ); } @@ -15994,7 +16058,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } - this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far ); + this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far, this.coordinateSystem ); this.projectionMatrixInverse.copy( this.projectionMatrix ).invert(); @@ -17241,7 +17305,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } - } else { + } else if ( geometryPosition !== undefined ) { const array = geometryPosition.array; version = geometryPosition.version; @@ -17256,6 +17320,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } + } else { + + return; + } const attribute = new ( arrayNeedsUint32( indices ) ? Uint32BufferAttribute : Uint16BufferAttribute )( indices, 1 ); @@ -17776,11 +17844,31 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } - attributes.update( object.instanceMatrix, gl.ARRAY_BUFFER ); + if ( updateMap.get( object ) !== frame ) { + + attributes.update( object.instanceMatrix, gl.ARRAY_BUFFER ); - if ( object.instanceColor !== null ) { + if ( object.instanceColor !== null ) { - attributes.update( object.instanceColor, gl.ARRAY_BUFFER ); + attributes.update( object.instanceColor, gl.ARRAY_BUFFER ); + + } + + updateMap.set( object, frame ); + + } + + } + + if ( object.isSkinnedMesh ) { + + const skeleton = object.skeleton; + + if ( updateMap.get( skeleton ) !== frame ) { + + skeleton.update(); + + updateMap.set( skeleton, frame ); } @@ -19177,13 +19265,30 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } + const shaderChunkMap = new Map( [ + [ 'encodings_fragment', 'colorspace_fragment' ], // @deprecated, r154 + [ 'encodings_pars_fragment', 'colorspace_pars_fragment' ], // @deprecated, r154 + [ 'output_fragment', 'opaque_fragment' ], // @deprecated, r154 + ] ); + function includeReplacer( match, include ) { - const string = ShaderChunk[ include ]; + let string = ShaderChunk[ include ]; if ( string === undefined ) { - throw new Error( 'Can not resolve #include <' + include + '>' ); + const newInclude = shaderChunkMap.get( include ); + + if ( newInclude !== undefined ) { + + string = ShaderChunk[ newInclude ]; + console.warn( 'THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.', include, newInclude ); + + } else { + + throw new Error( 'Can not resolve #include <' + include + '>' ); + + } } @@ -19459,6 +19564,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '', parameters.metalnessMap ? '#define USE_METALNESSMAP' : '', parameters.alphaMap ? '#define USE_ALPHAMAP' : '', + parameters.alphaHash ? '#define USE_ALPHAHASH' : '', parameters.transmission ? '#define USE_TRANSMISSION' : '', parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '', @@ -19502,7 +19608,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated // - parameters.vertexTangents ? '#define USE_TANGENT' : '', + parameters.vertexTangents && parameters.flatShading === false ? '#define USE_TANGENT' : '', parameters.vertexColors ? '#define USE_COLOR' : '', parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '', parameters.vertexUv1s ? '#define USE_UV1' : '', @@ -19680,6 +19786,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated parameters.alphaMap ? '#define USE_ALPHAMAP' : '', parameters.alphaTest ? '#define USE_ALPHATEST' : '', + parameters.alphaHash ? '#define USE_ALPHAHASH' : '', parameters.sheen ? '#define USE_SHEEN' : '', parameters.sheenColorMap ? '#define USE_SHEEN_COLORMAP' : '', @@ -19689,7 +19796,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '', parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '', - parameters.vertexTangents ? '#define USE_TANGENT' : '', + parameters.vertexTangents && parameters.flatShading === false ? '#define USE_TANGENT' : '', parameters.vertexColors || parameters.instancingColor ? '#define USE_COLOR' : '', parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '', parameters.vertexUv1s ? '#define USE_UV1' : '', @@ -19712,6 +19819,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated parameters.useLegacyLights ? '#define LEGACY_LIGHTS' : '', + parameters.decodeVideoTexture ? '#define DECODE_VIDEO_TEXTURE' : '', + parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', ( parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ) ? '#define USE_LOGDEPTHBUF_EXT' : '', @@ -19726,7 +19835,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated parameters.dithering ? '#define DITHERING' : '', parameters.opaque ? '#define OPAQUE' : '', - ShaderChunk[ 'encodings_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below + ShaderChunk[ 'colorspace_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below getTexelEncodingFunction( 'linearToOutputTexel', parameters.outputColorSpace ), parameters.useDepthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '', @@ -19946,7 +20055,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } - let _id = 0; + let _id$1 = 0; class WebGLShaderCache { @@ -20060,7 +20169,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated constructor( code ) { - this.id = _id ++; + this.id = _id$1 ++; this.code = code; this.usedTimes = 0; @@ -20216,12 +20325,26 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated const HAS_ALPHATEST = material.alphaTest > 0; + const HAS_ALPHAHASH = !! material.alphaHash; + const HAS_EXTENSIONS = !! material.extensions; const HAS_ATTRIBUTE_UV1 = !! geometry.attributes.uv1; const HAS_ATTRIBUTE_UV2 = !! geometry.attributes.uv2; const HAS_ATTRIBUTE_UV3 = !! geometry.attributes.uv3; + let toneMapping = NoToneMapping; + + if ( material.toneMapped ) { + + if ( currentRenderTarget === null || currentRenderTarget.isXRRenderTarget === true ) { + + toneMapping = renderer.toneMapping; + + } + + } + const parameters = { isWebGL2: IS_WEBGL2, @@ -20296,6 +20419,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated alphaMap: HAS_ALPHAMAP, alphaTest: HAS_ALPHATEST, + alphaHash: HAS_ALPHAHASH, combine: material.combine, @@ -20381,8 +20505,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated shadowMapEnabled: renderer.shadowMap.enabled && shadows.length > 0, shadowMapType: renderer.shadowMap.type, - toneMapping: material.toneMapped ? renderer.toneMapping : NoToneMapping, - useLegacyLights: renderer.useLegacyLights, + toneMapping: toneMapping, + useLegacyLights: renderer._useLegacyLights, + + decodeVideoTexture: HAS_MAP && ( material.map.isVideoTexture === true ) && ( material.map.colorSpace === SRGBColorSpace ), premultipliedAlpha: material.premultipliedAlpha, @@ -20585,6 +20711,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated _programLayers.enable( 17 ); if ( parameters.pointsUvs ) _programLayers.enable( 18 ); + if ( parameters.decodeVideoTexture ) + _programLayers.enable( 19 ); array.push( _programLayers.mask ); @@ -23554,6 +23682,17 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } + if ( glFormat === _gl.RED_INTEGER ) { + + if ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.R8UI; + if ( glType === _gl.UNSIGNED_SHORT ) internalFormat = _gl.R16UI; + if ( glType === _gl.UNSIGNED_INT ) internalFormat = _gl.R32UI; + if ( glType === _gl.BYTE ) internalFormat = _gl.R8I; + if ( glType === _gl.SHORT ) internalFormat = _gl.R16I; + if ( glType === _gl.INT ) internalFormat = _gl.R32I; + + } + if ( glFormat === _gl.RG ) { if ( glType === _gl.FLOAT ) internalFormat = _gl.RG32F; @@ -23730,14 +23869,32 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated for ( let i = 0; i < 6; i ++ ) { - _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ] ); + if ( Array.isArray( renderTargetProperties.__webglFramebuffer[ i ] ) ) { + + for ( let level = 0; level < renderTargetProperties.__webglFramebuffer[ i ].length; level ++ ) _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ][ level ] ); + + } else { + + _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ] ); + + } + if ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer[ i ] ); } } else { - _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer ); + if ( Array.isArray( renderTargetProperties.__webglFramebuffer ) ) { + + for ( let level = 0; level < renderTargetProperties.__webglFramebuffer.length; level ++ ) _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ level ] ); + + } else { + + _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer ); + + } + if ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer ); if ( renderTargetProperties.__webglMultisampledFramebuffer ) _gl.deleteFramebuffer( renderTargetProperties.__webglMultisampledFramebuffer ); @@ -24116,7 +24273,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated glFormat = utils.convert( texture.format, texture.colorSpace ); let glType = utils.convert( texture.type ), - glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace ); + glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace, texture.isVideoTexture ); setTextureParameters( textureType, texture, supportsMips ); @@ -24712,7 +24869,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated // Render targets // Setup storage for target texture and bind it to correct framebuffer - function setupFrameBufferTexture( framebuffer, renderTarget, texture, attachment, textureTarget ) { + function setupFrameBufferTexture( framebuffer, renderTarget, texture, attachment, textureTarget, level ) { const glFormat = utils.convert( texture.format, texture.colorSpace ); const glType = utils.convert( texture.type ); @@ -24721,13 +24878,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated if ( ! renderTargetProperties.__hasExternalTextures ) { + const width = Math.max( 1, renderTarget.width >> level ); + const height = Math.max( 1, renderTarget.height >> level ); + if ( textureTarget === _gl.TEXTURE_3D || textureTarget === _gl.TEXTURE_2D_ARRAY ) { - state.texImage3D( textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, renderTarget.depth, 0, glFormat, glType, null ); + state.texImage3D( textureTarget, level, glInternalFormat, width, height, renderTarget.depth, 0, glFormat, glType, null ); } else { - state.texImage2D( textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null ); + state.texImage2D( textureTarget, level, glInternalFormat, width, height, 0, glFormat, glType, null ); } @@ -24741,7 +24901,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } else if ( textureTarget === _gl.TEXTURE_2D || ( textureTarget >= _gl.TEXTURE_CUBE_MAP_POSITIVE_X && textureTarget <= _gl.TEXTURE_CUBE_MAP_NEGATIVE_Z ) ) { // see #24753 - _gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( texture ).__webglTexture, 0 ); + _gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( texture ).__webglTexture, level ); } @@ -24962,7 +25122,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated if ( colorTexture !== undefined ) { - setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, renderTarget.texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D ); + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, renderTarget.texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D, 0 ); } @@ -25009,13 +25169,41 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated for ( let i = 0; i < 6; i ++ ) { - renderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer(); + if ( isWebGL2 && texture.mipmaps && texture.mipmaps.length > 0 ) { + + renderTargetProperties.__webglFramebuffer[ i ] = []; + + for ( let level = 0; level < texture.mipmaps.length; level ++ ) { + + renderTargetProperties.__webglFramebuffer[ i ][ level ] = _gl.createFramebuffer(); + + } + + } else { + + renderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer(); + + } } } else { - renderTargetProperties.__webglFramebuffer = _gl.createFramebuffer(); + if ( isWebGL2 && texture.mipmaps && texture.mipmaps.length > 0 ) { + + renderTargetProperties.__webglFramebuffer = []; + + for ( let level = 0; level < texture.mipmaps.length; level ++ ) { + + renderTargetProperties.__webglFramebuffer[ level ] = _gl.createFramebuffer(); + + } + + } else { + + renderTargetProperties.__webglFramebuffer = _gl.createFramebuffer(); + + } if ( isMultipleRenderTargets ) { @@ -25095,7 +25283,19 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated for ( let i = 0; i < 6; i ++ ) { - setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i ); + if ( isWebGL2 && texture.mipmaps && texture.mipmaps.length > 0 ) { + + for ( let level = 0; level < texture.mipmaps.length; level ++ ) { + + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ][ level ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, level ); + + } + + } else { + + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0 ); + + } } @@ -25118,7 +25318,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated state.bindTexture( _gl.TEXTURE_2D, attachmentProperties.__webglTexture ); setTextureParameters( _gl.TEXTURE_2D, attachment, supportsMips ); - setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, attachment, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D ); + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, attachment, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D, 0 ); if ( textureNeedsGenerateMipmaps( attachment, supportsMips ) ) { @@ -25150,7 +25350,20 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated state.bindTexture( glTextureType, textureProperties.__webglTexture ); setTextureParameters( glTextureType, texture, supportsMips ); - setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType ); + + if ( isWebGL2 && texture.mipmaps && texture.mipmaps.length > 0 ) { + + for ( let level = 0; level < texture.mipmaps.length; level ++ ) { + + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ level ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType, level ); + + } + + } else { + + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType, 0 ); + + } if ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) { @@ -25339,13 +25552,13 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated const format = texture.format; const type = texture.type; - if ( texture.isCompressedTexture === true || texture.format === _SRGBAFormat ) return image; + if ( texture.isCompressedTexture === true || texture.isVideoTexture === true || texture.format === _SRGBAFormat ) return image; if ( colorSpace !== LinearSRGBColorSpace && colorSpace !== NoColorSpace ) { // sRGB - if ( colorSpace === SRGBColorSpace ) { + if ( colorSpace === SRGBColorSpace || colorSpace === DisplayP3ColorSpace ) { if ( isWebGL2 === false ) { @@ -25411,6 +25624,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } + const LinearTransferFunction = 0; + const SRGBTransferFunction = 1; + function WebGLUtils( gl, extensions, capabilities ) { const isWebGL2 = capabilities.isWebGL2; @@ -25419,6 +25635,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated let extension; + const transferFunction = ( colorSpace === SRGBColorSpace || colorSpace === DisplayP3ColorSpace ) ? SRGBTransferFunction : LinearTransferFunction; + if ( p === UnsignedByteType ) return gl.UNSIGNED_BYTE; if ( p === UnsignedShort4444Type ) return gl.UNSIGNED_SHORT_4_4_4_4; if ( p === UnsignedShort5551Type ) return gl.UNSIGNED_SHORT_5_5_5_1; @@ -25485,7 +25703,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated if ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) { - if ( colorSpace === SRGBColorSpace ) { + if ( transferFunction === SRGBTransferFunction ) { extension = extensions.get( 'WEBGL_compressed_texture_s3tc_srgb' ); @@ -25570,8 +25788,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated if ( extension !== null ) { - if ( p === RGB_ETC2_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2; - if ( p === RGBA_ETC2_EAC_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : extension.COMPRESSED_RGBA8_ETC2_EAC; + if ( p === RGB_ETC2_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2; + if ( p === RGBA_ETC2_EAC_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : extension.COMPRESSED_RGBA8_ETC2_EAC; } else { @@ -25593,20 +25811,20 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated if ( extension !== null ) { - if ( p === RGBA_ASTC_4x4_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : extension.COMPRESSED_RGBA_ASTC_4x4_KHR; - if ( p === RGBA_ASTC_5x4_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : extension.COMPRESSED_RGBA_ASTC_5x4_KHR; - if ( p === RGBA_ASTC_5x5_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : extension.COMPRESSED_RGBA_ASTC_5x5_KHR; - if ( p === RGBA_ASTC_6x5_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : extension.COMPRESSED_RGBA_ASTC_6x5_KHR; - if ( p === RGBA_ASTC_6x6_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : extension.COMPRESSED_RGBA_ASTC_6x6_KHR; - if ( p === RGBA_ASTC_8x5_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : extension.COMPRESSED_RGBA_ASTC_8x5_KHR; - if ( p === RGBA_ASTC_8x6_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : extension.COMPRESSED_RGBA_ASTC_8x6_KHR; - if ( p === RGBA_ASTC_8x8_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : extension.COMPRESSED_RGBA_ASTC_8x8_KHR; - if ( p === RGBA_ASTC_10x5_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : extension.COMPRESSED_RGBA_ASTC_10x5_KHR; - if ( p === RGBA_ASTC_10x6_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : extension.COMPRESSED_RGBA_ASTC_10x6_KHR; - if ( p === RGBA_ASTC_10x8_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : extension.COMPRESSED_RGBA_ASTC_10x8_KHR; - if ( p === RGBA_ASTC_10x10_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : extension.COMPRESSED_RGBA_ASTC_10x10_KHR; - if ( p === RGBA_ASTC_12x10_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : extension.COMPRESSED_RGBA_ASTC_12x10_KHR; - if ( p === RGBA_ASTC_12x12_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : extension.COMPRESSED_RGBA_ASTC_12x12_KHR; + if ( p === RGBA_ASTC_4x4_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : extension.COMPRESSED_RGBA_ASTC_4x4_KHR; + if ( p === RGBA_ASTC_5x4_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : extension.COMPRESSED_RGBA_ASTC_5x4_KHR; + if ( p === RGBA_ASTC_5x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : extension.COMPRESSED_RGBA_ASTC_5x5_KHR; + if ( p === RGBA_ASTC_6x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : extension.COMPRESSED_RGBA_ASTC_6x5_KHR; + if ( p === RGBA_ASTC_6x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : extension.COMPRESSED_RGBA_ASTC_6x6_KHR; + if ( p === RGBA_ASTC_8x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : extension.COMPRESSED_RGBA_ASTC_8x5_KHR; + if ( p === RGBA_ASTC_8x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : extension.COMPRESSED_RGBA_ASTC_8x6_KHR; + if ( p === RGBA_ASTC_8x8_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : extension.COMPRESSED_RGBA_ASTC_8x8_KHR; + if ( p === RGBA_ASTC_10x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : extension.COMPRESSED_RGBA_ASTC_10x5_KHR; + if ( p === RGBA_ASTC_10x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : extension.COMPRESSED_RGBA_ASTC_10x6_KHR; + if ( p === RGBA_ASTC_10x8_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : extension.COMPRESSED_RGBA_ASTC_10x8_KHR; + if ( p === RGBA_ASTC_10x10_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : extension.COMPRESSED_RGBA_ASTC_10x10_KHR; + if ( p === RGBA_ASTC_12x10_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : extension.COMPRESSED_RGBA_ASTC_12x10_KHR; + if ( p === RGBA_ASTC_12x12_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : extension.COMPRESSED_RGBA_ASTC_12x12_KHR; } else { @@ -25618,13 +25836,15 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated // BPTC - if ( p === RGBA_BPTC_Format ) { + if ( p === RGBA_BPTC_Format || p === RGB_BPTC_SIGNED_Format || p === RGB_BPTC_UNSIGNED_Format ) { extension = extensions.get( 'EXT_texture_compression_bptc' ); if ( extension !== null ) { - if ( p === RGBA_BPTC_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : extension.COMPRESSED_RGBA_BPTC_UNORM_EXT; + if ( p === RGBA_BPTC_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : extension.COMPRESSED_RGBA_BPTC_UNORM_EXT; + if ( p === RGB_BPTC_SIGNED_Format ) return extension.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT; + if ( p === RGB_BPTC_UNSIGNED_Format ) return extension.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT; } else { @@ -26137,8 +26357,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated // - let userCamera = null; - const cameraL = new PerspectiveCamera(); cameraL.layers.enable( 1 ); cameraL.viewport = new Vector4(); @@ -26158,19 +26376,11 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated // - this.cameraAutoUpdate = true; // @deprecated, r153 + this.cameraAutoUpdate = true; this.enabled = false; this.isPresenting = false; - this.getCamera = function () {}; // @deprecated, r153 - - this.setUserCamera = function ( value ) { - - userCamera = value; - - }; - this.getController = function ( index ) { let controller = controllers[ index ]; @@ -26607,15 +26817,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } - this.updateCameraXR = function ( camera ) { - - if ( session === null ) return camera; + this.updateCamera = function ( camera ) { - if ( userCamera ) { - - camera = userCamera; - - } + if ( session === null ) return; cameraXR.near = cameraR.near = cameraL.near = camera.near; cameraXR.far = cameraR.far = cameraL.far = camera.far; @@ -26661,19 +26865,11 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated // update user camera and its children - if ( userCamera ) { - - updateUserCamera( cameraXR, parent ); - - } - - return cameraXR; + updateUserCamera( camera, cameraXR, parent ); }; - function updateUserCamera( cameraXR, parent ) { - - const camera = userCamera; + function updateUserCamera( camera, cameraXR, parent ) { if ( parent === null ) { @@ -26690,14 +26886,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated camera.matrix.decompose( camera.position, camera.quaternion, camera.scale ); camera.updateMatrixWorld( true ); - const children = camera.children; - - for ( let i = 0, l = children.length; i < l; i ++ ) { - - children[ i ].updateMatrixWorld( true ); - - } - camera.projectionMatrix.copy( cameraXR.projectionMatrix ); camera.projectionMatrixInverse.copy( cameraXR.projectionMatrixInverse ); @@ -26710,6 +26898,12 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } + this.getCamera = function () { + + return cameraXR; + + }; + this.getFoveation = function () { if ( glProjLayer === null && glBaseLayer === null ) { @@ -27107,7 +27301,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated uniforms.lightMap.value = material.lightMap; // artist-friendly light intensity scaling factor - const scaleFactor = ( renderer.useLegacyLights === true ) ? Math.PI : 1; + const scaleFactor = ( renderer._useLegacyLights === true ) ? Math.PI : 1; uniforms.lightMapIntensity.value = material.lightMapIntensity * scaleFactor; @@ -27854,14 +28048,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } - function createCanvasElement() { - - const canvas = createElementNS( 'canvas' ); - canvas.style.display = 'block'; - return canvas; - - } - class WebGLRenderer { constructor( parameters = {} ) { @@ -27946,7 +28132,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated // physical lights - this.useLegacyLights = true; + this._useLegacyLights = false; // tone mapping @@ -28083,7 +28269,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } - if ( _gl instanceof WebGLRenderingContext ) { // @deprecated, r153 + if ( typeof WebGLRenderingContext !== 'undefined' && _gl instanceof WebGLRenderingContext ) { // @deprecated, r153 console.warn( 'THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163.' ); @@ -28401,15 +28587,13 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated const g = clearColor.g; const b = clearColor.b; - const __webglFramebuffer = properties.get( _currentRenderTarget ).__webglFramebuffer; - if ( isUnsignedType ) { uintClearColor[ 0 ] = r; uintClearColor[ 1 ] = g; uintClearColor[ 2 ] = b; uintClearColor[ 3 ] = a; - _gl.clearBufferuiv( _gl.COLOR, __webglFramebuffer, uintClearColor ); + _gl.clearBufferuiv( _gl.COLOR, 0, uintClearColor ); } else { @@ -28417,7 +28601,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated intClearColor[ 1 ] = g; intClearColor[ 2 ] = b; intClearColor[ 3 ] = a; - _gl.clearBufferiv( _gl.COLOR, __webglFramebuffer, intClearColor ); + _gl.clearBufferiv( _gl.COLOR, 0, intClearColor ); } @@ -28591,6 +28775,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated if ( material.wireframe === true ) { index = geometries.getWireframeAttribute( geometry ); + + if ( index === undefined ) return; + rangeFactor = 2; } @@ -28755,7 +28942,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } ); - currentRenderState.setupLights( _this.useLegacyLights ); + currentRenderState.setupLights( _this._useLegacyLights ); scene.traverse( function ( object ) { @@ -28850,7 +29037,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated if ( xr.enabled === true && xr.isPresenting === true ) { - camera = xr.updateCameraXR( camera ); // use XR camera for rendering + if ( xr.cameraAutoUpdate === true ) xr.updateCamera( camera ); + + camera = xr.getCamera(); // use XR camera for rendering } @@ -28885,6 +29074,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated // + this.info.render.frame ++; + if ( _clippingEnabled === true ) clipping.beginShadows(); const shadowsArray = currentRenderState.state.shadowsArray; @@ -28897,7 +29088,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated if ( this.info.autoReset === true ) this.info.reset(); - this.info.render.frame ++; // @@ -28905,7 +29095,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated // render scene - currentRenderState.setupLights( _this.useLegacyLights ); + currentRenderState.setupLights( _this._useLegacyLights ); if ( camera.isArrayCamera ) { @@ -29027,19 +29217,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) { - if ( object.isSkinnedMesh ) { - - // update skeleton only once in a frame - - if ( object.skeleton.frame !== info.render.frame ) { - - object.skeleton.update(); - object.skeleton.frame = info.render.frame; - - } - - } - const geometry = objects.update( object ); const material = object.material; @@ -29140,7 +29317,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated generateMipmaps: true, type: extensions.has( 'EXT_color_buffer_half_float' ) ? HalfFloatType : UnsignedByteType, minFilter: LinearMipmapLinearFilter, - samples: ( isWebGL2 && antialias === true ) ? 4 : 0 + samples: ( isWebGL2 ) ? 4 : 0 } ); // debug @@ -29407,6 +29584,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated materialProperties.outputColorSpace = parameters.outputColorSpace; materialProperties.instancing = parameters.instancing; + materialProperties.instancingColor = parameters.instancingColor; materialProperties.skinning = parameters.skinning; materialProperties.morphTargets = parameters.morphTargets; materialProperties.morphNormals = parameters.morphNormals; @@ -29435,7 +29613,18 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated const morphTargets = !! geometry.morphAttributes.position; const morphNormals = !! geometry.morphAttributes.normal; const morphColors = !! geometry.morphAttributes.color; - const toneMapping = material.toneMapped ? _this.toneMapping : NoToneMapping; + + let toneMapping = NoToneMapping; + + if ( material.toneMapped ) { + + if ( _currentRenderTarget === null || _currentRenderTarget.isXRRenderTarget === true ) { + + toneMapping = _this.toneMapping; + + } + + } const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color; const morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0; @@ -29490,6 +29679,14 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated needsProgramChange = true; + } else if ( object.isInstancedMesh && materialProperties.instancingColor === true && object.instanceColor === null ) { + + needsProgramChange = true; + + } else if ( object.isInstancedMesh && materialProperties.instancingColor === false && object.instanceColor !== null ) { + + needsProgramChange = true; + } else if ( materialProperties.envMap !== envMap ) { needsProgramChange = true; @@ -29576,48 +29773,28 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated if ( refreshProgram || _currentCamera !== camera ) { - p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix ); - - if ( capabilities.logarithmicDepthBuffer ) { + // common camera uniforms - p_uniforms.setValue( _gl, 'logDepthBufFC', - 2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) ); - - } - - if ( _currentCamera !== camera ) { + p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix ); + p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse ); - _currentCamera = camera; + const uCamPos = p_uniforms.map.cameraPosition; - // lighting uniforms depend on the camera so enforce an update - // now, in case this material supports lights - or later, when - // the next material that does gets activated: + if ( uCamPos !== undefined ) { - refreshMaterial = true; // set to true on material change - refreshLights = true; // remains set until update done + uCamPos.setValue( _gl, _vector3.setFromMatrixPosition( camera.matrixWorld ) ); } - // load material specific uniforms - // (shader material also gets them for the sake of genericity) - - if ( material.isShaderMaterial || - material.isMeshPhongMaterial || - material.isMeshToonMaterial || - material.isMeshStandardMaterial || - material.envMap ) { - - const uCamPos = p_uniforms.map.cameraPosition; - - if ( uCamPos !== undefined ) { - - uCamPos.setValue( _gl, - _vector3.setFromMatrixPosition( camera.matrixWorld ) ); + if ( capabilities.logarithmicDepthBuffer ) { - } + p_uniforms.setValue( _gl, 'logDepthBufFC', + 2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) ); } + // consider moving isOrthographic to UniformLib and WebGLMaterials, see https://github.com/mrdoob/three.js/pull/26467#issuecomment-1645185067 + if ( material.isMeshPhongMaterial || material.isMeshToonMaterial || material.isMeshLambertMaterial || @@ -29629,16 +29806,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } - if ( material.isMeshPhongMaterial || - material.isMeshToonMaterial || - material.isMeshLambertMaterial || - material.isMeshBasicMaterial || - material.isMeshStandardMaterial || - material.isShaderMaterial || - material.isShadowMaterial || - object.isSkinnedMesh ) { + if ( _currentCamera !== camera ) { - p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse ); + _currentCamera = camera; + + // lighting uniforms depend on the camera so enforce an update + // now, in case this material supports lights - or later, when + // the next material that does gets activated: + + refreshMaterial = true; // set to true on material change + refreshLights = true; // remains set until update done } @@ -29905,7 +30082,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated if ( renderTarget.isWebGLCubeRenderTarget ) { - framebuffer = __webglFramebuffer[ activeCubeFace ]; + if ( Array.isArray( __webglFramebuffer[ activeCubeFace ] ) ) { + + framebuffer = __webglFramebuffer[ activeCubeFace ][ activeMipmapLevel ]; + + } else { + + framebuffer = __webglFramebuffer[ activeCubeFace ]; + + } + isCube = true; } else if ( ( capabilities.isWebGL2 && renderTarget.samples > 0 ) && textures.useMultisampledRTT( renderTarget ) === false ) { @@ -29914,7 +30100,15 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } else { - framebuffer = __webglFramebuffer; + if ( Array.isArray( __webglFramebuffer ) ) { + + framebuffer = __webglFramebuffer[ activeMipmapLevel ]; + + } else { + + framebuffer = __webglFramebuffer; + + } } @@ -30205,16 +30399,22 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } + get coordinateSystem() { + + return WebGLCoordinateSystem; + + } + get physicallyCorrectLights() { // @deprecated, r150 - console.warn( 'THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' ); + console.warn( 'THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' ); return ! this.useLegacyLights; } set physicallyCorrectLights( value ) { // @deprecated, r150 - console.warn( 'THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' ); + console.warn( 'THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' ); this.useLegacyLights = ! value; } @@ -30233,6 +30433,20 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } + get useLegacyLights() { // @deprecated, r155 + + console.warn( 'THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733.' ); + return this._useLegacyLights; + + } + + set useLegacyLights( value ) { // @deprecated, r155 + + console.warn( 'THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733.' ); + this._useLegacyLights = value; + + } + } class WebGL1Renderer extends WebGLRenderer {} @@ -30362,20 +30576,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } - get autoUpdate() { // @deprecated, r144 - - console.warn( 'THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.' ); - return this.matrixWorldAutoUpdate; - - } - - set autoUpdate( value ) { // @deprecated, r144 - - console.warn( 'THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.' ); - this.matrixWorldAutoUpdate = value; - - } - } class InterleavedBuffer { @@ -31578,8 +31778,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated this.boneTexture = null; this.boneTextureSize = 0; - this.frame = - 1; - this.init(); } @@ -32148,7 +32346,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated super.copy( source, recursive ); - this.material = source.material; + this.material = Array.isArray( source.material ) ? source.material.slice() : source.material; this.geometry = source.geometry; return this; @@ -32469,7 +32667,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated super.copy( source, recursive ); - this.material = source.material; + this.material = Array.isArray( source.material ) ? source.material.slice() : source.material; this.geometry = source.geometry; return this; @@ -32709,6 +32907,21 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } + class CompressedCubeTexture extends CompressedTexture { + + constructor( images, format, type ) { + + super( undefined, images[ 0 ].width, images[ 0 ].height, format, type, CubeReflectionMapping ); + + this.isCompressedCubeTexture = true; + this.isCubeTexture = true; + + this.image = images; + + } + + } + class CanvasTexture extends Texture { constructor( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) { @@ -34819,7 +35032,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated this.parameters = { radius: radius, - height: length, + length: length, capSegments: capSegments, radialSegments: radialSegments, }; @@ -41638,6 +41851,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } + Loader.DEFAULT_MATERIAL_NAME = '__DEFAULT'; + const loading = {}; class HttpError extends Error { @@ -42200,6 +42415,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated load( urls, onLoad, onProgress, onError ) { const texture = new CubeTexture(); + texture.colorSpace = SRGBColorSpace; const loader = new ImageLoader( this.manager ); loader.setCrossOrigin( this.crossOrigin ); @@ -42266,9 +42482,26 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated loader.setWithCredentials( scope.withCredentials ); loader.load( url, function ( buffer ) { - const texData = scope.parse( buffer ); + let texData; + + try { + + texData = scope.parse( buffer ); + + } catch ( error ) { + + if ( onError !== undefined ) { - if ( ! texData ) return; + onError( error ); + + } else { + + console.error( error ); + return; + + } + + } if ( texData.image !== undefined ) { @@ -43354,6 +43587,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated if ( json.opacity !== undefined ) material.opacity = json.opacity; if ( json.transparent !== undefined ) material.transparent = json.transparent; if ( json.alphaTest !== undefined ) material.alphaTest = json.alphaTest; + if ( json.alphaHash !== undefined ) material.alphaHash = json.alphaHash; if ( json.depthTest !== undefined ) material.depthTest = json.depthTest; if ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite; if ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite; @@ -45674,6 +45908,12 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated disconnect() { + if ( this._connected === false ) { + + return; + + } + if ( this.filters.length > 0 ) { this.source.disconnect( this.filters[ 0 ] ); @@ -45874,6 +46114,14 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } + connect() { + + super.connect(); + + this.panner.connect( this.gain ); + + } + disconnect() { super.disconnect(); @@ -46781,7 +47029,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated // ensure there is a value node if ( ! targetObject ) { - console.error( 'THREE.PropertyBinding: Trying to update node for track: ' + this.path + ' but it wasn\'t found.' ); + console.warn( 'THREE.PropertyBinding: No target node found for track: ' + this.path + '.' ); return; } @@ -48914,7 +49162,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } - let id = 0; + let _id = 0; class UniformsGroup extends EventDispatcher { @@ -48924,7 +49172,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated this.isUniformsGroup = true; - Object.defineProperty( this, 'id', { value: id ++ } ); + Object.defineProperty( this, 'id', { value: _id ++ } ); this.name = ''; @@ -51170,216 +51418,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated } - class BoxBufferGeometry extends BoxGeometry { // @deprecated, r144 - - constructor( width, height, depth, widthSegments, heightSegments, depthSegments ) { - - console.warn( 'THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry.' ); - super( width, height, depth, widthSegments, heightSegments, depthSegments ); - - - } - - } - - class CapsuleBufferGeometry extends CapsuleGeometry { // @deprecated, r144 - - constructor( radius, length, capSegments, radialSegments ) { - - console.warn( 'THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry.' ); - super( radius, length, capSegments, radialSegments ); - - } - - } - - class CircleBufferGeometry extends CircleGeometry { // @deprecated, r144 - - constructor( radius, segments, thetaStart, thetaLength ) { - - console.warn( 'THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry.' ); - super( radius, segments, thetaStart, thetaLength ); - - } - - } - - class ConeBufferGeometry extends ConeGeometry { // @deprecated, r144 - - constructor( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { - - console.warn( 'THREE.ConeBufferGeometry has been renamed to THREE.ConeGeometry.' ); - super( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); - - } - - } - - class CylinderBufferGeometry extends CylinderGeometry { // @deprecated, r144 - - constructor( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { - - console.warn( 'THREE.CylinderBufferGeometry has been renamed to THREE.CylinderGeometry.' ); - super( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); - - } - - } - - class DodecahedronBufferGeometry extends DodecahedronGeometry { // @deprecated, r144 - - constructor( radius, detail ) { - - console.warn( 'THREE.DodecahedronBufferGeometry has been renamed to THREE.DodecahedronGeometry.' ); - super( radius, detail ); - - } - - } - - class ExtrudeBufferGeometry extends ExtrudeGeometry { // @deprecated, r144 - - constructor( shapes, options ) { - - console.warn( 'THREE.ExtrudeBufferGeometry has been renamed to THREE.ExtrudeGeometry.' ); - super( shapes, options ); - - } - - } - - class IcosahedronBufferGeometry extends IcosahedronGeometry { // @deprecated, r144 - - constructor( radius, detail ) { - - console.warn( 'THREE.IcosahedronBufferGeometry has been renamed to THREE.IcosahedronGeometry.' ); - super( radius, detail ); - - } - - } - - class LatheBufferGeometry extends LatheGeometry { // @deprecated, r144 - - constructor( points, segments, phiStart, phiLength ) { - - console.warn( 'THREE.LatheBufferGeometry has been renamed to THREE.LatheGeometry.' ); - super( points, segments, phiStart, phiLength ); - - } - - } - - class OctahedronBufferGeometry extends OctahedronGeometry { // @deprecated, r144 - - constructor( radius, detail ) { - - console.warn( 'THREE.OctahedronBufferGeometry has been renamed to THREE.OctahedronGeometry.' ); - super( radius, detail ); - - } - - } - - class PlaneBufferGeometry extends PlaneGeometry { // @deprecated, r144 - - constructor( width, height, widthSegments, heightSegments ) { - - console.warn( 'THREE.PlaneBufferGeometry has been renamed to THREE.PlaneGeometry.' ); - super( width, height, widthSegments, heightSegments ); - - } - - } - - class PolyhedronBufferGeometry extends PolyhedronGeometry { // @deprecated, r144 - - constructor( vertices, indices, radius, detail ) { - - console.warn( 'THREE.PolyhedronBufferGeometry has been renamed to THREE.PolyhedronGeometry.' ); - super( vertices, indices, radius, detail ); - - } - - } - - class RingBufferGeometry extends RingGeometry { // @deprecated, r144 - - constructor( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) { - - console.warn( 'THREE.RingBufferGeometry has been renamed to THREE.RingGeometry.' ); - super( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ); - - } - - } - - class ShapeBufferGeometry extends ShapeGeometry { // @deprecated, r144 - - constructor( shapes, curveSegments ) { - - console.warn( 'THREE.ShapeBufferGeometry has been renamed to THREE.ShapeGeometry.' ); - super( shapes, curveSegments ); - - } - - } - - class SphereBufferGeometry extends SphereGeometry { // @deprecated, r144 - - constructor( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) { - - console.warn( 'THREE.SphereBufferGeometry has been renamed to THREE.SphereGeometry.' ); - super( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ); - - } - - } - - class TetrahedronBufferGeometry extends TetrahedronGeometry { // @deprecated, r144 - - constructor( radius, detail ) { - - console.warn( 'THREE.TetrahedronBufferGeometry has been renamed to THREE.TetrahedronGeometry.' ); - super( radius, detail ); - - } - - } - - class TorusBufferGeometry extends TorusGeometry { // @deprecated, r144 - - constructor( radius, tube, radialSegments, tubularSegments, arc ) { - - console.warn( 'THREE.TorusBufferGeometry has been renamed to THREE.TorusGeometry.' ); - super( radius, tube, radialSegments, tubularSegments, arc ); - - } - - } - - class TorusKnotBufferGeometry extends TorusKnotGeometry { // @deprecated, r144 - - constructor( radius, tube, tubularSegments, radialSegments, p, q ) { - - console.warn( 'THREE.TorusKnotBufferGeometry has been renamed to THREE.TorusKnotGeometry.' ); - super( radius, tube, tubularSegments, radialSegments, p, q ); - - } - - } - - class TubeBufferGeometry extends TubeGeometry { // @deprecated, r144 - - constructor( path, tubularSegments, radius, radialSegments, closed ) { - - console.warn( 'THREE.TubeBufferGeometry has been renamed to THREE.TubeGeometry.' ); - super( path, tubularSegments, radius, radialSegments, closed ); - - } - - } - if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) { __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: { @@ -51436,7 +51474,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated exports.Box2 = Box2; exports.Box3 = Box3; exports.Box3Helper = Box3Helper; - exports.BoxBufferGeometry = BoxBufferGeometry; exports.BoxGeometry = BoxGeometry; exports.BoxHelper = BoxHelper; exports.BufferAttribute = BufferAttribute; @@ -51447,11 +51484,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated exports.Camera = Camera; exports.CameraHelper = CameraHelper; exports.CanvasTexture = CanvasTexture; - exports.CapsuleBufferGeometry = CapsuleBufferGeometry; exports.CapsuleGeometry = CapsuleGeometry; exports.CatmullRomCurve3 = CatmullRomCurve3; exports.CineonToneMapping = CineonToneMapping; - exports.CircleBufferGeometry = CircleBufferGeometry; exports.CircleGeometry = CircleGeometry; exports.ClampToEdgeWrapping = ClampToEdgeWrapping; exports.Clock = Clock; @@ -51459,9 +51494,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated exports.ColorKeyframeTrack = ColorKeyframeTrack; exports.ColorManagement = ColorManagement; exports.CompressedArrayTexture = CompressedArrayTexture; + exports.CompressedCubeTexture = CompressedCubeTexture; exports.CompressedTexture = CompressedTexture; exports.CompressedTextureLoader = CompressedTextureLoader; - exports.ConeBufferGeometry = ConeBufferGeometry; exports.ConeGeometry = ConeGeometry; exports.CubeCamera = CubeCamera; exports.CubeReflectionMapping = CubeReflectionMapping; @@ -51480,7 +51515,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated exports.CurvePath = CurvePath; exports.CustomBlending = CustomBlending; exports.CustomToneMapping = CustomToneMapping; - exports.CylinderBufferGeometry = CylinderBufferGeometry; exports.CylinderGeometry = CylinderGeometry; exports.Cylindrical = Cylindrical; exports.Data3DTexture = Data3DTexture; @@ -51498,7 +51532,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated exports.DirectionalLightHelper = DirectionalLightHelper; exports.DiscreteInterpolant = DiscreteInterpolant; exports.DisplayP3ColorSpace = DisplayP3ColorSpace; - exports.DodecahedronBufferGeometry = DodecahedronBufferGeometry; exports.DodecahedronGeometry = DodecahedronGeometry; exports.DoubleSide = DoubleSide; exports.DstAlphaFactor = DstAlphaFactor; @@ -51515,7 +51548,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated exports.EquirectangularRefractionMapping = EquirectangularRefractionMapping; exports.Euler = Euler; exports.EventDispatcher = EventDispatcher; - exports.ExtrudeBufferGeometry = ExtrudeBufferGeometry; exports.ExtrudeGeometry = ExtrudeGeometry; exports.FileLoader = FileLoader; exports.Float16BufferAttribute = Float16BufferAttribute; @@ -51542,7 +51574,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated exports.HemisphereLight = HemisphereLight; exports.HemisphereLightHelper = HemisphereLightHelper; exports.HemisphereLightProbe = HemisphereLightProbe; - exports.IcosahedronBufferGeometry = IcosahedronBufferGeometry; exports.IcosahedronGeometry = IcosahedronGeometry; exports.ImageBitmapLoader = ImageBitmapLoader; exports.ImageLoader = ImageLoader; @@ -51567,7 +51598,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated exports.KeepStencilOp = KeepStencilOp; exports.KeyframeTrack = KeyframeTrack; exports.LOD = LOD; - exports.LatheBufferGeometry = LatheBufferGeometry; exports.LatheGeometry = LatheGeometry; exports.Layers = Layers; exports.LessCompare = LessCompare; @@ -51586,6 +51616,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated exports.LineDashedMaterial = LineDashedMaterial; exports.LineLoop = LineLoop; exports.LineSegments = LineSegments; + exports.LinearDisplayP3ColorSpace = LinearDisplayP3ColorSpace; exports.LinearEncoding = LinearEncoding; exports.LinearFilter = LinearFilter; exports.LinearInterpolant = LinearInterpolant; @@ -51646,7 +51677,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated exports.Object3D = Object3D; exports.ObjectLoader = ObjectLoader; exports.ObjectSpaceNormalMap = ObjectSpaceNormalMap; - exports.OctahedronBufferGeometry = OctahedronBufferGeometry; exports.OctahedronGeometry = OctahedronGeometry; exports.OneFactor = OneFactor; exports.OneMinusDstAlphaFactor = OneMinusDstAlphaFactor; @@ -51660,7 +51690,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated exports.Path = Path; exports.PerspectiveCamera = PerspectiveCamera; exports.Plane = Plane; - exports.PlaneBufferGeometry = PlaneBufferGeometry; exports.PlaneGeometry = PlaneGeometry; exports.PlaneHelper = PlaneHelper; exports.PointLight = PointLight; @@ -51668,7 +51697,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated exports.Points = Points; exports.PointsMaterial = PointsMaterial; exports.PolarGridHelper = PolarGridHelper; - exports.PolyhedronBufferGeometry = PolyhedronBufferGeometry; exports.PolyhedronGeometry = PolyhedronGeometry; exports.PositionalAudio = PositionalAudio; exports.PropertyBinding = PropertyBinding; @@ -51705,6 +51733,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated exports.RGBA_S3TC_DXT1_Format = RGBA_S3TC_DXT1_Format; exports.RGBA_S3TC_DXT3_Format = RGBA_S3TC_DXT3_Format; exports.RGBA_S3TC_DXT5_Format = RGBA_S3TC_DXT5_Format; + exports.RGB_BPTC_SIGNED_Format = RGB_BPTC_SIGNED_Format; + exports.RGB_BPTC_UNSIGNED_Format = RGB_BPTC_UNSIGNED_Format; exports.RGB_ETC1_Format = RGB_ETC1_Format; exports.RGB_ETC2_Format = RGB_ETC2_Format; exports.RGB_PVRTC_2BPPV1_Format = RGB_PVRTC_2BPPV1_Format; @@ -51719,10 +51749,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated exports.RedFormat = RedFormat; exports.RedIntegerFormat = RedIntegerFormat; exports.ReinhardToneMapping = ReinhardToneMapping; + exports.RenderTarget = RenderTarget; exports.RepeatWrapping = RepeatWrapping; exports.ReplaceStencilOp = ReplaceStencilOp; exports.ReverseSubtractEquation = ReverseSubtractEquation; - exports.RingBufferGeometry = RingBufferGeometry; exports.RingGeometry = RingGeometry; exports.SIGNED_RED_GREEN_RGTC2_Format = SIGNED_RED_GREEN_RGTC2_Format; exports.SIGNED_RED_RGTC1_Format = SIGNED_RED_RGTC1_Format; @@ -51733,7 +51763,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated exports.ShaderMaterial = ShaderMaterial; exports.ShadowMaterial = ShadowMaterial; exports.Shape = Shape; - exports.ShapeBufferGeometry = ShapeBufferGeometry; exports.ShapeGeometry = ShapeGeometry; exports.ShapePath = ShapePath; exports.ShapeUtils = ShapeUtils; @@ -51743,7 +51772,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated exports.SkinnedMesh = SkinnedMesh; exports.Source = Source; exports.Sphere = Sphere; - exports.SphereBufferGeometry = SphereBufferGeometry; exports.SphereGeometry = SphereGeometry; exports.Spherical = Spherical; exports.SphericalHarmonics3 = SphericalHarmonics3; @@ -51767,19 +51795,15 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated exports.SubtractiveBlending = SubtractiveBlending; exports.TOUCH = TOUCH; exports.TangentSpaceNormalMap = TangentSpaceNormalMap; - exports.TetrahedronBufferGeometry = TetrahedronBufferGeometry; exports.TetrahedronGeometry = TetrahedronGeometry; exports.Texture = Texture; exports.TextureLoader = TextureLoader; - exports.TorusBufferGeometry = TorusBufferGeometry; exports.TorusGeometry = TorusGeometry; - exports.TorusKnotBufferGeometry = TorusKnotBufferGeometry; exports.TorusKnotGeometry = TorusKnotGeometry; exports.Triangle = Triangle; exports.TriangleFanDrawMode = TriangleFanDrawMode; exports.TriangleStripDrawMode = TriangleStripDrawMode; exports.TrianglesDrawMode = TrianglesDrawMode; - exports.TubeBufferGeometry = TubeBufferGeometry; exports.TubeGeometry = TubeGeometry; exports.TwoPassDoubleSide = TwoPassDoubleSide; exports.UVMapping = UVMapping; @@ -51806,11 +51830,13 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated exports.WebGL1Renderer = WebGL1Renderer; exports.WebGL3DRenderTarget = WebGL3DRenderTarget; exports.WebGLArrayRenderTarget = WebGLArrayRenderTarget; + exports.WebGLCoordinateSystem = WebGLCoordinateSystem; exports.WebGLCubeRenderTarget = WebGLCubeRenderTarget; exports.WebGLMultipleRenderTargets = WebGLMultipleRenderTargets; exports.WebGLRenderTarget = WebGLRenderTarget; exports.WebGLRenderer = WebGLRenderer; exports.WebGLUtils = WebGLUtils; + exports.WebGPUCoordinateSystem = WebGPUCoordinateSystem; exports.WireframeGeometry = WireframeGeometry; exports.WrapAroundEnding = WrapAroundEnding; exports.ZeroCurvatureEnding = ZeroCurvatureEnding; @@ -51818,6 +51844,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated exports.ZeroSlopeEnding = ZeroSlopeEnding; exports.ZeroStencilOp = ZeroStencilOp; exports._SRGBAFormat = _SRGBAFormat; + exports.createCanvasElement = createCanvasElement; exports.sRGBEncoding = sRGBEncoding; })); diff --git a/build/three.min.js b/build/three.min.js index 5ca84a89c6830a..0fd229fbe9e7d5 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -4,4 +4,4 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated * Copyright 2010-2023 Three.js Authors * SPDX-License-Identifier: MIT */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).THREE={})}(this,(function(t){"use strict";const e="153dev",n=0,i=1,r=2,s=1,a=2,o=3,l=0,c=1,h=2,u=0,d=1,p=2,m=3,f=4,g=5,v=100,_=101,y=102,x=103,M=104,S=200,b=201,T=202,E=203,w=204,A=205,R=206,C=207,L=208,P=209,I=210,U=0,D=1,N=2,O=3,F=4,B=5,z=6,G=7,H=0,k=1,V=2,W=0,X=1,j=2,q=3,Y=4,Z=5,J=300,K=301,$=302,Q=303,tt=304,et=306,nt=1e3,it=1001,rt=1002,st=1003,at=1004,ot=1005,lt=1006,ct=1007,ht=1008,ut=1009,dt=1010,pt=1011,mt=1012,ft=1013,gt=1014,vt=1015,_t=1016,yt=1017,xt=1018,Mt=1020,St=1021,bt=1023,Tt=1024,Et=1025,wt=1026,At=1027,Rt=1028,Ct=1029,Lt=1030,Pt=1031,It=1033,Ut=33776,Dt=33777,Nt=33778,Ot=33779,Ft=35840,Bt=35841,zt=35842,Gt=35843,Ht=36196,kt=37492,Vt=37496,Wt=37808,Xt=37809,jt=37810,qt=37811,Yt=37812,Zt=37813,Jt=37814,Kt=37815,$t=37816,Qt=37817,te=37818,ee=37819,ne=37820,ie=37821,re=36492,se=36283,ae=36284,oe=36285,le=36286,ce=2300,he=2301,ue=2302,de=2400,pe=2401,me=2402,fe=2500,ge=2501,ve=3e3,_e=3001,ye=3201,xe=0,Me=1,Se="",be="srgb",Te="srgb-linear",Ee="display-p3",we=7680,Ae=512,Re=513,Ce=514,Le=515,Pe=516,Ie=517,Ue=518,De=519,Ne=35044,Oe="300 es",Fe=1035;class Be{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,i=n.length;e>8&255]+ze[t>>16&255]+ze[t>>24&255]+"-"+ze[255&e]+ze[e>>8&255]+"-"+ze[e>>16&15|64]+ze[e>>24&255]+"-"+ze[63&n|128]+ze[n>>8&255]+"-"+ze[n>>16&255]+ze[n>>24&255]+ze[255&i]+ze[i>>8&255]+ze[i>>16&255]+ze[i>>24&255]).toLowerCase()}function We(t,e,n){return Math.max(e,Math.min(n,t))}function Xe(t,e){return(t%e+e)%e}function je(t,e,n){return(1-n)*t+n*e}function qe(t){return 0==(t&t-1)&&0!==t}function Ye(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function Ze(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function Je(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Ke(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const $e={DEG2RAD:He,RAD2DEG:ke,generateUUID:Ve,clamp:We,euclideanModulo:Xe,mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},inverseLerp:function(t,e,n){return t!==e?(n-t)/(e-t):0},lerp:je,damp:function(t,e,n,i){return je(t,e,1-Math.exp(-n*i))},pingpong:function(t,e=1){return e-Math.abs(Xe(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(Ge=t);let e=Ge+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*He},radToDeg:function(t){return t*ke},isPowerOfTwo:qe,ceilPowerOfTwo:Ye,floorPowerOfTwo:Ze,setQuaternionFromProperEuler:function(t,e,n,i,r){const s=Math.cos,a=Math.sin,o=s(n/2),l=a(n/2),c=s((e+i)/2),h=a((e+i)/2),u=s((e-i)/2),d=a((e-i)/2),p=s((i-e)/2),m=a((i-e)/2);switch(r){case"XYX":t.set(o*h,l*u,l*d,o*c);break;case"YZY":t.set(l*d,o*h,l*u,o*c);break;case"ZXZ":t.set(l*u,l*d,o*h,o*c);break;case"XZX":t.set(o*h,l*m,l*p,o*c);break;case"YXY":t.set(l*p,o*h,l*m,o*c);break;case"ZYZ":t.set(l*m,l*p,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:Ke,denormalize:Je};class Qe{constructor(t=0,e=0){Qe.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(We(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,s=this.y-t.y;return this.x=r*n-s*i+t.x,this.y=r*i+s*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class tn{constructor(t,e,n,i,r,s,a,o,l){tn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,n,i,r,s,a,o,l)}set(t,e,n,i,r,s,a,o,l){const c=this.elements;return c[0]=t,c[1]=i,c[2]=a,c[3]=e,c[4]=r,c[5]=o,c[6]=n,c[7]=s,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[3],o=n[6],l=n[1],c=n[4],h=n[7],u=n[2],d=n[5],p=n[8],m=i[0],f=i[3],g=i[6],v=i[1],_=i[4],y=i[7],x=i[2],M=i[5],S=i[8];return r[0]=s*m+a*v+o*x,r[3]=s*f+a*_+o*M,r[6]=s*g+a*y+o*S,r[1]=l*m+c*v+h*x,r[4]=l*f+c*_+h*M,r[7]=l*g+c*y+h*S,r[2]=u*m+d*v+p*x,r[5]=u*f+d*_+p*M,r[8]=u*g+d*y+p*S,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8];return e*s*c-e*a*l-n*r*c+n*a*o+i*r*l-i*s*o}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8],h=c*s-a*l,u=a*o-c*r,d=l*r-s*o,p=e*h+n*u+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const m=1/p;return t[0]=h*m,t[1]=(i*l-c*n)*m,t[2]=(a*n-i*s)*m,t[3]=u*m,t[4]=(c*e-i*o)*m,t[5]=(i*r-a*e)*m,t[6]=d*m,t[7]=(n*o-l*e)*m,t[8]=(s*e-n*r)*m,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,s,a){const o=Math.cos(r),l=Math.sin(r);return this.set(n*o,n*l,-n*(o*s+l*a)+s+t,-i*l,i*o,-i*(-l*s+o*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(en.makeScale(t,e)),this}rotate(t){return this.premultiply(en.makeRotation(-t)),this}translate(t,e){return this.premultiply(en.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}const en=new tn;function nn(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const rn={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function sn(t,e){return new rn[t](e)}function an(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}const on={};function ln(t){t in on||(on[t]=!0,console.warn(t))}function cn(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function hn(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const un=(new tn).fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),dn=(new tn).fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);const pn={[Te]:t=>t,[be]:t=>t.convertSRGBToLinear(),[Ee]:function(t){return t.convertSRGBToLinear().applyMatrix3(dn)}},mn={[Te]:t=>t,[be]:t=>t.convertLinearToSRGB(),[Ee]:function(t){return t.applyMatrix3(un).convertLinearToSRGB()}},fn={enabled:!0,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(t){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!t},get workingColorSpace(){return Te},set workingColorSpace(t){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(t,e,n){if(!1===this.enabled||e===n||!e||!n)return t;const i=pn[e],r=mn[n];if(void 0===i||void 0===r)throw new Error(`Unsupported color space conversion, "${e}" to "${n}".`);return r(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)}};let gn;class vn{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===gn&&(gn=an("canvas")),gn.width=t.width,gn.height=t.height;const n=gn.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=gn}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=an("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const i=n.getImageData(0,0,t.width,t.height),r=i.data;for(let t=0;t0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==J)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case nt:t.x=t.x-Math.floor(t.x);break;case it:t.x=t.x<0?0:1;break;case rt:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case nt:t.y=t.y-Math.floor(t.y);break;case it:t.y=t.y<0?0:1;break;case rt:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return ln("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===be?_e:ve}set encoding(t){ln("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===_e?be:Se}}Sn.DEFAULT_IMAGE=null,Sn.DEFAULT_MAPPING=J,Sn.DEFAULT_ANISOTROPY=1;class bn{constructor(t=0,e=0,n=0,i=1){bn.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i+s[12]*r,this.y=s[1]*e+s[5]*n+s[9]*i+s[13]*r,this.z=s[2]*e+s[6]*n+s[10]*i+s[14]*r,this.w=s[3]*e+s[7]*n+s[11]*i+s[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,r;const s=.01,a=.1,o=t.elements,l=o[0],c=o[4],h=o[8],u=o[1],d=o[5],p=o[9],m=o[2],f=o[6],g=o[10];if(Math.abs(c-u)o&&t>v?tv?o=0?1:-1,i=1-e*e;if(i>Number.EPSILON){const r=Math.sqrt(i),s=Math.atan2(r,e*n);t=Math.sin(t*s)/r,a=Math.sin(a*s)/r}const r=a*n;if(o=o*t+u*r,l=l*t+d*r,c=c*t+p*r,h=h*t+m*r,t===1-a){const t=1/Math.sqrt(o*o+l*l+c*c+h*h);o*=t,l*=t,c*=t,h*=t}}t[e]=o,t[e+1]=l,t[e+2]=c,t[e+3]=h}static multiplyQuaternionsFlat(t,e,n,i,r,s){const a=n[i],o=n[i+1],l=n[i+2],c=n[i+3],h=r[s],u=r[s+1],d=r[s+2],p=r[s+3];return t[e]=a*p+c*h+o*d-l*u,t[e+1]=o*p+c*u+l*h-a*d,t[e+2]=l*p+c*d+a*u-o*h,t[e+3]=c*p-a*h-o*u-l*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){const n=t._x,i=t._y,r=t._z,s=t._order,a=Math.cos,o=Math.sin,l=a(n/2),c=a(i/2),h=a(r/2),u=o(n/2),d=o(i/2),p=o(r/2);switch(s){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],r=e[8],s=e[1],a=e[5],o=e[9],l=e[2],c=e[6],h=e[10],u=n+a+h;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(c-o)*t,this._y=(r-l)*t,this._z=(s-i)*t}else if(n>a&&n>h){const t=2*Math.sqrt(1+n-a-h);this._w=(c-o)/t,this._x=.25*t,this._y=(i+s)/t,this._z=(r+l)/t}else if(a>h){const t=2*Math.sqrt(1+a-n-h);this._w=(r-l)/t,this._x=(i+s)/t,this._y=.25*t,this._z=(o+c)/t}else{const t=2*Math.sqrt(1+h-n-a);this._w=(s-i)/t,this._x=(r+l)/t,this._y=(o+c)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return nMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(We(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,s=t._w,a=e._x,o=e._y,l=e._z,c=e._w;return this._x=n*c+s*a+i*l-r*o,this._y=i*c+s*o+r*a-n*l,this._z=r*c+s*l+n*o-i*a,this._w=s*c-n*a-i*o-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,i=this._y,r=this._z,s=this._w;let a=s*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=s,this._x=n,this._y=i,this._z=r,this;const o=1-a*a;if(o<=Number.EPSILON){const t=1-e;return this._w=t*s+e*this._w,this._x=t*n+e*this._x,this._y=t*i+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(o),c=Math.atan2(l,a),h=Math.sin((1-e)*c)/l,u=Math.sin(e*c)/l;return this._w=s*h+this._w*u,this._x=n*h+this._x*u,this._y=i*h+this._y*u,this._z=r*h+this._z*u,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=Math.random(),e=Math.sqrt(1-t),n=Math.sqrt(t),i=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(e*Math.cos(i),n*Math.sin(r),n*Math.cos(r),e*Math.sin(i))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Rn{constructor(t=0,e=0,n=0){Rn.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(Ln.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Ln.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.elements,s=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*s,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*s,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*s,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,a=t.z,o=t.w,l=o*e+s*i-a*n,c=o*n+a*e-r*i,h=o*i+r*n-s*e,u=-r*e-s*n-a*i;return this.x=l*o+u*-r+c*-a-h*-s,this.y=c*o+u*-s+h*-r-l*-a,this.z=h*o+u*-a+l*-s-c*-r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=i*o-r*a,this.y=r*s-n*o,this.z=n*a-i*s,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return Cn.copy(this).projectOnVector(t),this.sub(Cn)}reflect(t){return this.sub(Cn.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(We(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=2*(Math.random()-.5),e=Math.random()*Math.PI*2,n=Math.sqrt(1-t**2);return this.x=n*Math.cos(e),this.y=n*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Cn=new Rn,Ln=new An;class Pn{constructor(t=new Rn(1/0,1/0,1/0),e=new Rn(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Un),Un.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Hn),kn.subVectors(this.max,Hn),Nn.subVectors(t.a,Hn),On.subVectors(t.b,Hn),Fn.subVectors(t.c,Hn),Bn.subVectors(On,Nn),zn.subVectors(Fn,On),Gn.subVectors(Nn,Fn);let e=[0,-Bn.z,Bn.y,0,-zn.z,zn.y,0,-Gn.z,Gn.y,Bn.z,0,-Bn.x,zn.z,0,-zn.x,Gn.z,0,-Gn.x,-Bn.y,Bn.x,0,-zn.y,zn.x,0,-Gn.y,Gn.x,0];return!!Xn(e,Nn,On,Fn,kn)&&(e=[1,0,0,0,1,0,0,0,1],!!Xn(e,Nn,On,Fn,kn)&&(Vn.crossVectors(Bn,zn),e=[Vn.x,Vn.y,Vn.z],Xn(e,Nn,On,Fn,kn)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Un).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(Un).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(In[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),In[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),In[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),In[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),In[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),In[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),In[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),In[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(In)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const In=[new Rn,new Rn,new Rn,new Rn,new Rn,new Rn,new Rn,new Rn],Un=new Rn,Dn=new Pn,Nn=new Rn,On=new Rn,Fn=new Rn,Bn=new Rn,zn=new Rn,Gn=new Rn,Hn=new Rn,kn=new Rn,Vn=new Rn,Wn=new Rn;function Xn(t,e,n,i,r){for(let s=0,a=t.length-3;s<=a;s+=3){Wn.fromArray(t,s);const a=r.x*Math.abs(Wn.x)+r.y*Math.abs(Wn.y)+r.z*Math.abs(Wn.z),o=e.dot(Wn),l=n.dot(Wn),c=i.dot(Wn);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>a)return!1}return!0}const jn=new Pn,qn=new Rn,Yn=new Rn;class Zn{constructor(t=new Rn,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):jn.setFromPoints(t).getCenter(n);let i=0;for(let e=0,r=t.length;ethis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;qn.subVectors(t,this.center);const e=qn.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),n=.5*(t-this.radius);this.center.addScaledVector(qn,n/t),this.radius+=n}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(Yn.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(qn.copy(t.center).add(Yn)),this.expandByPoint(qn.copy(t.center).sub(Yn))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Jn=new Rn,Kn=new Rn,$n=new Rn,Qn=new Rn,ti=new Rn,ei=new Rn,ni=new Rn;class ii{constructor(t=new Rn,e=new Rn(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Jn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Jn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Jn.copy(this.origin).addScaledVector(this.direction,e),Jn.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){Kn.copy(t).add(e).multiplyScalar(.5),$n.copy(e).sub(t).normalize(),Qn.copy(this.origin).sub(Kn);const r=.5*t.distanceTo(e),s=-this.direction.dot($n),a=Qn.dot(this.direction),o=-Qn.dot($n),l=Qn.lengthSq(),c=Math.abs(1-s*s);let h,u,d,p;if(c>0)if(h=s*o-a,u=s*a-o,p=r*c,h>=0)if(u>=-p)if(u<=p){const t=1/c;h*=t,u*=t,d=h*(h+s*u+2*a)+u*(s*h+u+2*o)+l}else u=r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;else u=-r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;else u<=-p?(h=Math.max(0,-(-s*r+a)),u=h>0?-r:Math.min(Math.max(-r,-o),r),d=-h*h+u*(u+2*o)+l):u<=p?(h=0,u=Math.min(Math.max(-r,-o),r),d=u*(u+2*o)+l):(h=Math.max(0,-(s*r+a)),u=h>0?r:Math.min(Math.max(-r,-o),r),d=-h*h+u*(u+2*o)+l);else u=s>0?-r:r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(Kn).addScaledVector($n,u),d}intersectSphere(t,e){Jn.subVectors(t.center,this.origin);const n=Jn.dot(this.direction),i=Jn.dot(Jn)-n*n,r=t.radius*t.radius;if(i>r)return null;const s=Math.sqrt(r-i),a=n-s,o=n+s;return o<0?null:a<0?this.at(o,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,r,s,a,o;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(n=(t.min.x-u.x)*l,i=(t.max.x-u.x)*l):(n=(t.max.x-u.x)*l,i=(t.min.x-u.x)*l),c>=0?(r=(t.min.y-u.y)*c,s=(t.max.y-u.y)*c):(r=(t.max.y-u.y)*c,s=(t.min.y-u.y)*c),n>s||r>i?null:((r>n||isNaN(n))&&(n=r),(s=0?(a=(t.min.z-u.z)*h,o=(t.max.z-u.z)*h):(a=(t.max.z-u.z)*h,o=(t.min.z-u.z)*h),n>o||a>i?null:((a>n||n!=n)&&(n=a),(o=0?n:i,e)))}intersectsBox(t){return null!==this.intersectBox(t,Jn)}intersectTriangle(t,e,n,i,r){ti.subVectors(e,t),ei.subVectors(n,t),ni.crossVectors(ti,ei);let s,a=this.direction.dot(ni);if(a>0){if(i)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}Qn.subVectors(this.origin,t);const o=s*this.direction.dot(ei.crossVectors(Qn,ei));if(o<0)return null;const l=s*this.direction.dot(ti.cross(Qn));if(l<0)return null;if(o+l>a)return null;const c=-s*Qn.dot(ni);return c<0?null:this.at(c/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class ri{constructor(t,e,n,i,r,s,a,o,l,c,h,u,d,p,m,f){ri.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,n,i,r,s,a,o,l,c,h,u,d,p,m,f)}set(t,e,n,i,r,s,a,o,l,c,h,u,d,p,m,f){const g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=r,g[5]=s,g[9]=a,g[13]=o,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=m,g[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new ri).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,i=1/si.setFromMatrixColumn(t,0).length(),r=1/si.setFromMatrixColumn(t,1).length(),s=1/si.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*s,e[9]=n[9]*s,e[10]=n[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,i=t.y,r=t.z,s=Math.cos(n),a=Math.sin(n),o=Math.cos(i),l=Math.sin(i),c=Math.cos(r),h=Math.sin(r);if("XYZ"===t.order){const t=s*c,n=s*h,i=a*c,r=a*h;e[0]=o*c,e[4]=-o*h,e[8]=l,e[1]=n+i*l,e[5]=t-r*l,e[9]=-a*o,e[2]=r-t*l,e[6]=i+n*l,e[10]=s*o}else if("YXZ"===t.order){const t=o*c,n=o*h,i=l*c,r=l*h;e[0]=t+r*a,e[4]=i*a-n,e[8]=s*l,e[1]=s*h,e[5]=s*c,e[9]=-a,e[2]=n*a-i,e[6]=r+t*a,e[10]=s*o}else if("ZXY"===t.order){const t=o*c,n=o*h,i=l*c,r=l*h;e[0]=t-r*a,e[4]=-s*h,e[8]=i+n*a,e[1]=n+i*a,e[5]=s*c,e[9]=r-t*a,e[2]=-s*l,e[6]=a,e[10]=s*o}else if("ZYX"===t.order){const t=s*c,n=s*h,i=a*c,r=a*h;e[0]=o*c,e[4]=i*l-n,e[8]=t*l+r,e[1]=o*h,e[5]=r*l+t,e[9]=n*l-i,e[2]=-l,e[6]=a*o,e[10]=s*o}else if("YZX"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*c,e[4]=r-t*h,e[8]=i*h+n,e[1]=h,e[5]=s*c,e[9]=-a*c,e[2]=-l*c,e[6]=n*h+i,e[10]=t-r*h}else if("XZY"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*c,e[4]=-h,e[8]=l*c,e[1]=t*h+r,e[5]=s*c,e[9]=n*h-i,e[2]=i*h-n,e[6]=a*c,e[10]=r*h+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(oi,t,li)}lookAt(t,e,n){const i=this.elements;return ui.subVectors(t,e),0===ui.lengthSq()&&(ui.z=1),ui.normalize(),ci.crossVectors(n,ui),0===ci.lengthSq()&&(1===Math.abs(n.z)?ui.x+=1e-4:ui.z+=1e-4,ui.normalize(),ci.crossVectors(n,ui)),ci.normalize(),hi.crossVectors(ui,ci),i[0]=ci.x,i[4]=hi.x,i[8]=ui.x,i[1]=ci.y,i[5]=hi.y,i[9]=ui.y,i[2]=ci.z,i[6]=hi.z,i[10]=ui.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[4],o=n[8],l=n[12],c=n[1],h=n[5],u=n[9],d=n[13],p=n[2],m=n[6],f=n[10],g=n[14],v=n[3],_=n[7],y=n[11],x=n[15],M=i[0],S=i[4],b=i[8],T=i[12],E=i[1],w=i[5],A=i[9],R=i[13],C=i[2],L=i[6],P=i[10],I=i[14],U=i[3],D=i[7],N=i[11],O=i[15];return r[0]=s*M+a*E+o*C+l*U,r[4]=s*S+a*w+o*L+l*D,r[8]=s*b+a*A+o*P+l*N,r[12]=s*T+a*R+o*I+l*O,r[1]=c*M+h*E+u*C+d*U,r[5]=c*S+h*w+u*L+d*D,r[9]=c*b+h*A+u*P+d*N,r[13]=c*T+h*R+u*I+d*O,r[2]=p*M+m*E+f*C+g*U,r[6]=p*S+m*w+f*L+g*D,r[10]=p*b+m*A+f*P+g*N,r[14]=p*T+m*R+f*I+g*O,r[3]=v*M+_*E+y*C+x*U,r[7]=v*S+_*w+y*L+x*D,r[11]=v*b+_*A+y*P+x*N,r[15]=v*T+_*R+y*I+x*O,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],s=t[1],a=t[5],o=t[9],l=t[13],c=t[2],h=t[6],u=t[10],d=t[14];return t[3]*(+r*o*h-i*l*h-r*a*u+n*l*u+i*a*d-n*o*d)+t[7]*(+e*o*d-e*l*u+r*s*u-i*s*d+i*l*c-r*o*c)+t[11]*(+e*l*h-e*a*d-r*s*h+n*s*d+r*a*c-n*l*c)+t[15]*(-i*a*c-e*o*h+e*a*u+i*s*h-n*s*u+n*o*c)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8],h=t[9],u=t[10],d=t[11],p=t[12],m=t[13],f=t[14],g=t[15],v=h*f*l-m*u*l+m*o*d-a*f*d-h*o*g+a*u*g,_=p*u*l-c*f*l-p*o*d+s*f*d+c*o*g-s*u*g,y=c*m*l-p*h*l+p*a*d-s*m*d-c*a*g+s*h*g,x=p*h*o-c*m*o-p*a*u+s*m*u+c*a*f-s*h*f,M=e*v+n*_+i*y+r*x;if(0===M)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/M;return t[0]=v*S,t[1]=(m*u*r-h*f*r-m*i*d+n*f*d+h*i*g-n*u*g)*S,t[2]=(a*f*r-m*o*r+m*i*l-n*f*l-a*i*g+n*o*g)*S,t[3]=(h*o*r-a*u*r-h*i*l+n*u*l+a*i*d-n*o*d)*S,t[4]=_*S,t[5]=(c*f*r-p*u*r+p*i*d-e*f*d-c*i*g+e*u*g)*S,t[6]=(p*o*r-s*f*r-p*i*l+e*f*l+s*i*g-e*o*g)*S,t[7]=(s*u*r-c*o*r+c*i*l-e*u*l-s*i*d+e*o*d)*S,t[8]=y*S,t[9]=(p*h*r-c*m*r-p*n*d+e*m*d+c*n*g-e*h*g)*S,t[10]=(s*m*r-p*a*r+p*n*l-e*m*l-s*n*g+e*a*g)*S,t[11]=(c*a*r-s*h*r-c*n*l+e*h*l+s*n*d-e*a*d)*S,t[12]=x*S,t[13]=(c*m*i-p*h*i+p*n*u-e*m*u-c*n*f+e*h*f)*S,t[14]=(p*a*i-s*m*i-p*n*o+e*m*o+s*n*f-e*a*f)*S,t[15]=(s*h*i-c*a*i+c*n*o-e*h*o-s*n*u+e*a*u)*S,this}scale(t){const e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,s=t.x,a=t.y,o=t.z,l=r*s,c=r*a;return this.set(l*s+n,l*a-i*o,l*o+i*a,0,l*a+i*o,c*a+n,c*o-i*s,0,l*o-i*a,c*o+i*s,r*o*o+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,r,s){return this.set(1,n,r,0,t,1,s,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){const i=this.elements,r=e._x,s=e._y,a=e._z,o=e._w,l=r+r,c=s+s,h=a+a,u=r*l,d=r*c,p=r*h,m=s*c,f=s*h,g=a*h,v=o*l,_=o*c,y=o*h,x=n.x,M=n.y,S=n.z;return i[0]=(1-(m+g))*x,i[1]=(d+y)*x,i[2]=(p-_)*x,i[3]=0,i[4]=(d-y)*M,i[5]=(1-(u+g))*M,i[6]=(f+v)*M,i[7]=0,i[8]=(p+_)*S,i[9]=(f-v)*S,i[10]=(1-(u+m))*S,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.elements;let r=si.set(i[0],i[1],i[2]).length();const s=si.set(i[4],i[5],i[6]).length(),a=si.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],ai.copy(this);const o=1/r,l=1/s,c=1/a;return ai.elements[0]*=o,ai.elements[1]*=o,ai.elements[2]*=o,ai.elements[4]*=l,ai.elements[5]*=l,ai.elements[6]*=l,ai.elements[8]*=c,ai.elements[9]*=c,ai.elements[10]*=c,e.setFromRotationMatrix(ai),n.x=r,n.y=s,n.z=a,this}makePerspective(t,e,n,i,r,s){const a=this.elements,o=2*r/(e-t),l=2*r/(n-i),c=(e+t)/(e-t),h=(n+i)/(n-i),u=-(s+r)/(s-r),d=-2*s*r/(s-r);return a[0]=o,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=l,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=u,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,n,i,r,s){const a=this.elements,o=1/(e-t),l=1/(n-i),c=1/(s-r),h=(e+t)*o,u=(n+i)*l,d=(s+r)*c;return a[0]=2*o,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-u,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<16;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const si=new Rn,ai=new ri,oi=new Rn(0,0,0),li=new Rn(1,1,1),ci=new Rn,hi=new Rn,ui=new Rn,di=new ri,pi=new An;class mi{constructor(t=0,e=0,n=0,i=mi.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const i=t.elements,r=i[0],s=i[4],a=i[8],o=i[1],l=i[5],c=i[9],h=i[2],u=i[6],d=i[10];switch(e){case"XYZ":this._y=Math.asin(We(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-We(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(We(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-We(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(We(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-We(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return di.makeRotationFromQuaternion(t),this.setFromRotationMatrix(di,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return pi.setFromEuler(this),this.setFromQuaternion(pi,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}mi.DEFAULT_ORDER="XYZ";class fi{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let t=0;t1){for(let t=0;t0&&(n=n.concat(r))}return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Mi,t,Si),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Mi,bi,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,i=e.length;n0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const n=e.shapes;if(Array.isArray(n))for(let e=0,i=n.length;e0){i.children=[];for(let e=0;e0){i.animations=[];for(let e=0;e0&&(n.geometries=e),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),a.length>0&&(n.images=a),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),h.length>0&&(n.nodes=h)}return n.object=i,n;function s(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(t,e,n,i,r){Li.subVectors(i,e),Pi.subVectors(n,e),Ii.subVectors(t,e);const s=Li.dot(Li),a=Li.dot(Pi),o=Li.dot(Ii),l=Pi.dot(Pi),c=Pi.dot(Ii),h=s*l-a*a;if(0===h)return r.set(-2,-1,-1);const u=1/h,d=(l*o-a*c)*u,p=(s*c-a*o)*u;return r.set(1-d-p,p,d)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,Ui),Ui.x>=0&&Ui.y>=0&&Ui.x+Ui.y<=1}static getUV(t,e,n,i,r,s,a,o){return!1===Gi&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Gi=!0),this.getInterpolation(t,e,n,i,r,s,a,o)}static getInterpolation(t,e,n,i,r,s,a,o){return this.getBarycoord(t,e,n,i,Ui),o.setScalar(0),o.addScaledVector(r,Ui.x),o.addScaledVector(s,Ui.y),o.addScaledVector(a,Ui.z),o}static isFrontFacing(t,e,n,i){return Li.subVectors(n,e),Pi.subVectors(t,e),Li.cross(Pi).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Li.subVectors(this.c,this.b),Pi.subVectors(this.a,this.b),.5*Li.cross(Pi).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Hi.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Hi.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,i,r){return!1===Gi&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Gi=!0),Hi.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}getInterpolation(t,e,n,i,r){return Hi.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}containsPoint(t){return Hi.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Hi.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,i=this.b,r=this.c;let s,a;Di.subVectors(i,n),Ni.subVectors(r,n),Fi.subVectors(t,n);const o=Di.dot(Fi),l=Ni.dot(Fi);if(o<=0&&l<=0)return e.copy(n);Bi.subVectors(t,i);const c=Di.dot(Bi),h=Ni.dot(Bi);if(c>=0&&h<=c)return e.copy(i);const u=o*h-c*l;if(u<=0&&o>=0&&c<=0)return s=o/(o-c),e.copy(n).addScaledVector(Di,s);zi.subVectors(t,r);const d=Di.dot(zi),p=Ni.dot(zi);if(p>=0&&d<=p)return e.copy(r);const m=d*l-o*p;if(m<=0&&l>=0&&p<=0)return a=l/(l-p),e.copy(n).addScaledVector(Ni,a);const f=c*p-d*h;if(f<=0&&h-c>=0&&d-p>=0)return Oi.subVectors(r,i),a=(h-c)/(h-c+(d-p)),e.copy(i).addScaledVector(Oi,a);const g=1/(f+m+u);return s=m*g,a=u*g,e.copy(n).addScaledVector(Di,s).addScaledVector(Ni,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let ki=0;class Vi extends Be{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:ki++}),this.uuid=Ve(),this.name="",this.type="Material",this.blending=d,this.side=l,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=w,this.blendDst=A,this.blendEquation=v,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=O,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=we,this.stencilZFail=we,this.stencilZPass=we,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n:console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`)}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function i(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==d&&(n.blending=this.blending),this.side!==l&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.forceSinglePass&&(n.forceSinglePass=this.forceSinglePass),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),e){const e=i(t.textures),r=i(t.images);e.length>0&&(n.textures=e),r.length>0&&(n.images=r)}return n}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let i=0;i!==t;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}const Wi={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Xi={h:0,s:0,l:0},ji={h:0,s:0,l:0};function qi(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}class Yi{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(void 0===e&&void 0===n){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=be){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,fn.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=fn.workingColorSpace){return this.r=t,this.g=e,this.b=n,fn.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=fn.workingColorSpace){if(t=Xe(t,1),e=We(e,0,1),n=We(n,0,1),0===e)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=qi(r,i,t+1/3),this.g=qi(r,i,t),this.b=qi(r,i,t-1/3)}return fn.toWorkingColorSpace(this,i),this}setStyle(t,e=be){function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const s=i[1],a=i[2];switch(s){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const n=i[1],r=n.length;if(3===r)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,e);if(6===r)return this.setHex(parseInt(n,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=be){const n=Wi[t.toLowerCase()];return void 0!==n?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=cn(t.r),this.g=cn(t.g),this.b=cn(t.b),this}copyLinearToSRGB(t){return this.r=hn(t.r),this.g=hn(t.g),this.b=hn(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=be){return fn.fromWorkingColorSpace(Zi.copy(this),t),65536*Math.round(We(255*Zi.r,0,255))+256*Math.round(We(255*Zi.g,0,255))+Math.round(We(255*Zi.b,0,255))}getHexString(t=be){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=fn.workingColorSpace){fn.fromWorkingColorSpace(Zi.copy(this),e);const n=Zi.r,i=Zi.g,r=Zi.b,s=Math.max(n,i,r),a=Math.min(n,i,r);let o,l;const c=(a+s)/2;if(a===s)o=0,l=0;else{const t=s-a;switch(l=c<=.5?t/(s+a):t/(2-s-a),s){case n:o=(i-r)/t+(i>-e-14,i[256|t]=1024>>-e-14|32768,r[t]=-e-1,r[256|t]=-e-1):e<=15?(i[t]=e+15<<10,i[256|t]=e+15<<10|32768,r[t]=13,r[256|t]=13):e<128?(i[t]=31744,i[256|t]=64512,r[t]=24,r[256|t]=24):(i[t]=31744,i[256|t]=64512,r[t]=13,r[256|t]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,n=0;for(;0==(8388608&e);)e<<=1,n-=8388608;e&=-8388609,n+=947912704,s[t]=e|n}for(let t=1024;t<2048;++t)s[t]=939524096+(t-1024<<13);for(let t=1;t<31;++t)a[t]=t<<23;a[31]=1199570944,a[32]=2147483648;for(let t=33;t<63;++t)a[t]=2147483648+(t-32<<23);a[63]=3347054592;for(let t=1;t<64;++t)32!==t&&(o[t]=1024);return{floatView:e,uint32View:n,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:o}}function Qi(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=We(t,-65504,65504),Ki.floatView[0]=t;const e=Ki.uint32View[0],n=e>>23&511;return Ki.baseTable[n]+((8388607&e)>>Ki.shiftTable[n])}function tr(t){const e=t>>10;return Ki.uint32View[0]=Ki.mantissaTable[Ki.offsetTable[e]+(1023&t)]+Ki.exponentTable[e],Ki.floatView[0]}const er={toHalfFloat:Qi,fromHalfFloat:tr},nr=new Rn,ir=new Qe;class rr{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=n,this.usage=Ne,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const i=n[e];t.data.attributes[e]=i.toJSON(t.data)}const i={};let r=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],s=[];for(let e=0,i=n.length;e0&&(i[e]=s,r=!0)}r&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return null!==a&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const i=t.attributes;for(const t in i){const n=i[t];this.setAttribute(t,n.clone(e))}const r=t.morphAttributes;for(const t in r){const n=[],i=r[t];for(let t=0,r=i.length;t0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t(t.far-t.near)**2)return}gr.copy(r).invert(),vr.copy(t.ray).applyMatrix4(gr),null!==n.boundingBox&&!1===vr.intersectsBox(n.boundingBox)||this._computeIntersections(t,e,vr)}}_computeIntersections(t,e,n){let i;const r=this.geometry,s=this.material,a=r.index,o=r.attributes.position,l=r.attributes.uv,c=r.attributes.uv1,h=r.attributes.normal,u=r.groups,d=r.drawRange;if(null!==a)if(Array.isArray(s))for(let r=0,o=u.length;rn.far?null:{distance:u,point:Ir.clone(),object:t}}(t,e,n,i,xr,Mr,Sr,Pr);if(d){r&&(Er.fromBufferAttribute(r,o),wr.fromBufferAttribute(r,h),Ar.fromBufferAttribute(r,u),d.uv=Hi.getInterpolation(Pr,xr,Mr,Sr,Er,wr,Ar,new Qe)),s&&(Er.fromBufferAttribute(s,o),wr.fromBufferAttribute(s,h),Ar.fromBufferAttribute(s,u),d.uv1=Hi.getInterpolation(Pr,xr,Mr,Sr,Er,wr,Ar,new Qe),d.uv2=d.uv1),a&&(Rr.fromBufferAttribute(a,o),Cr.fromBufferAttribute(a,h),Lr.fromBufferAttribute(a,u),d.normal=Hi.getInterpolation(Pr,xr,Mr,Sr,Rr,Cr,Lr,new Rn),d.normal.dot(i.direction)>0&&d.normal.multiplyScalar(-1));const t={a:o,b:h,c:u,normal:new Rn,materialIndex:0};Hi.getNormal(xr,Mr,Sr,t.normal),d.face=t}return d}class Nr extends fr{constructor(t=1,e=1,n=1,i=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:s};const a=this;i=Math.floor(i),r=Math.floor(r),s=Math.floor(s);const o=[],l=[],c=[],h=[];let u=0,d=0;function p(t,e,n,i,r,s,p,m,f,g,v){const _=s/f,y=p/g,x=s/2,M=p/2,S=m/2,b=f+1,T=g+1;let E=0,w=0;const A=new Rn;for(let s=0;s0?1:-1,c.push(A.x,A.y,A.z),h.push(o/f),h.push(1-s/g),E+=1}}for(let t=0;t0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const t in this.extensions)!0===this.extensions[t]&&(n[t]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class Hr extends Ci{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ri,this.projectionMatrix=new ri,this.projectionMatrixInverse=new ri}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}class kr extends Hr{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*ke*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*He*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*ke*Math.atan(Math.tan(.5*He*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,n,i,r,s){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*He*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,a=s.fullHeight;r+=s.offsetX*i/t,e-=s.offsetY*n/a,i*=s.width/t,n*=s.height/a}const a=this.filmOffset;0!==a&&(r+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const Vr=-90;class Wr extends Ci{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n;const i=new kr(Vr,1,t,e);i.layers=this.layers,i.up.set(0,1,0),i.lookAt(1,0,0),this.add(i);const r=new kr(Vr,1,t,e);r.layers=this.layers,r.up.set(0,1,0),r.lookAt(-1,0,0),this.add(r);const s=new kr(Vr,1,t,e);s.layers=this.layers,s.up.set(0,0,-1),s.lookAt(0,1,0),this.add(s);const a=new kr(Vr,1,t,e);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(0,-1,0),this.add(a);const o=new kr(Vr,1,t,e);o.layers=this.layers,o.up.set(0,1,0),o.lookAt(0,0,1),this.add(o);const l=new kr(Vr,1,t,e);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,-1),this.add(l)}update(t,e){null===this.parent&&this.updateMatrixWorld();const n=this.renderTarget,[i,r,s,a,o,l]=this.children,c=t.getRenderTarget(),h=t.toneMapping,u=t.xr.enabled;t.toneMapping=W,t.xr.enabled=!1;const d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,i),t.setRenderTarget(n,1),t.render(e,r),t.setRenderTarget(n,2),t.render(e,s),t.setRenderTarget(n,3),t.render(e,a),t.setRenderTarget(n,4),t.render(e,o),n.texture.generateMipmaps=d,t.setRenderTarget(n,5),t.render(e,l),t.setRenderTarget(c),t.toneMapping=h,t.xr.enabled=u,n.texture.needsPMREMUpdate=!0}}class Xr extends Sn{constructor(t,e,n,i,r,s,a,o,l,c){super(t=void 0!==t?t:[],e=void 0!==e?e:K,n,i,r,s,a,o,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class jr extends Tn{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];void 0!==e.encoding&&(ln("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),e.colorSpace=e.encoding===_e?be:Se),this.texture=new Xr(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:lt}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},i=new Nr(5,5,5),r=new Gr({name:"CubemapFromEquirect",uniforms:Or(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:c,blending:u});r.uniforms.tEquirect.value=e;const s=new Ur(i,r),a=e.minFilter;e.minFilter===ht&&(e.minFilter=lt);return new Wr(1,10,this).update(t,s),e.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(t,e,n,i){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,n,i);t.setRenderTarget(r)}}const qr=new Rn,Yr=new Rn,Zr=new tn;class Jr{constructor(t=new Rn(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const i=qr.subVectors(n,e).cross(Yr.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta(qr),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||Zr.getNormalMatrix(t),i=this.coplanarPoint(qr).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Kr=new Zn,$r=new Rn;class Qr{constructor(t=new Jr,e=new Jr,n=new Jr,i=new Jr,r=new Jr,s=new Jr){this.planes=[t,e,n,i,r,s]}set(t,e,n,i,r,s){const a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[5].copy(s),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t){const e=this.planes,n=t.elements,i=n[0],r=n[1],s=n[2],a=n[3],o=n[4],l=n[5],c=n[6],h=n[7],u=n[8],d=n[9],p=n[10],m=n[11],f=n[12],g=n[13],v=n[14],_=n[15];return e[0].setComponents(a-i,h-o,m-u,_-f).normalize(),e[1].setComponents(a+i,h+o,m+u,_+f).normalize(),e[2].setComponents(a+r,h+l,m+d,_+g).normalize(),e[3].setComponents(a-r,h-l,m-d,_-g).normalize(),e[4].setComponents(a-s,h-c,m-p,_-v).normalize(),e[5].setComponents(a+s,h+c,m+p,_+v).normalize(),this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),Kr.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),Kr.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Kr)}intersectsSprite(t){return Kr.center.set(0,0,0),Kr.radius=.7071067811865476,Kr.applyMatrix4(t.matrixWorld),this.intersectsSphere(Kr)}intersectsSphere(t){const e=this.planes,n=t.center,i=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(n)0?t.max.x:t.min.x,$r.y=i.normal.y>0?t.max.y:t.min.y,$r.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint($r)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function ts(){let t=null,e=!1,n=null,i=null;function r(e,s){n(e,s),i=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==n&&(i=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function es(t,e){const n=e.isWebGL2,i=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),i.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const n=i.get(e);n&&(t.deleteBuffer(n.buffer),i.delete(e))},update:function(e,r){if(e.isGLBufferAttribute){const t=i.get(e);return void((!t||t.version 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tanisotropyV /= material.anisotropy;\n\tmaterial.anisotropy = saturate( material.anisotropy );\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x - tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x + tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometry.viewDir, geometry.normal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, vMapUv );\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal, vNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},rs={common:{diffuse:{value:new Yi(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new tn},alphaMap:{value:null},alphaMapTransform:{value:new tn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new tn}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new tn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new tn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new tn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new tn},normalScale:{value:new Qe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new tn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new tn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new tn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new tn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Yi(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Yi(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new tn},alphaTest:{value:0},uvTransform:{value:new tn}},sprite:{diffuse:{value:new Yi(16777215)},opacity:{value:1},center:{value:new Qe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new tn},alphaMap:{value:null},alphaMapTransform:{value:new tn},alphaTest:{value:0}}},ss={basic:{uniforms:Fr([rs.common,rs.specularmap,rs.envmap,rs.aomap,rs.lightmap,rs.fog]),vertexShader:is.meshbasic_vert,fragmentShader:is.meshbasic_frag},lambert:{uniforms:Fr([rs.common,rs.specularmap,rs.envmap,rs.aomap,rs.lightmap,rs.emissivemap,rs.bumpmap,rs.normalmap,rs.displacementmap,rs.fog,rs.lights,{emissive:{value:new Yi(0)}}]),vertexShader:is.meshlambert_vert,fragmentShader:is.meshlambert_frag},phong:{uniforms:Fr([rs.common,rs.specularmap,rs.envmap,rs.aomap,rs.lightmap,rs.emissivemap,rs.bumpmap,rs.normalmap,rs.displacementmap,rs.fog,rs.lights,{emissive:{value:new Yi(0)},specular:{value:new Yi(1118481)},shininess:{value:30}}]),vertexShader:is.meshphong_vert,fragmentShader:is.meshphong_frag},standard:{uniforms:Fr([rs.common,rs.envmap,rs.aomap,rs.lightmap,rs.emissivemap,rs.bumpmap,rs.normalmap,rs.displacementmap,rs.roughnessmap,rs.metalnessmap,rs.fog,rs.lights,{emissive:{value:new Yi(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:is.meshphysical_vert,fragmentShader:is.meshphysical_frag},toon:{uniforms:Fr([rs.common,rs.aomap,rs.lightmap,rs.emissivemap,rs.bumpmap,rs.normalmap,rs.displacementmap,rs.gradientmap,rs.fog,rs.lights,{emissive:{value:new Yi(0)}}]),vertexShader:is.meshtoon_vert,fragmentShader:is.meshtoon_frag},matcap:{uniforms:Fr([rs.common,rs.bumpmap,rs.normalmap,rs.displacementmap,rs.fog,{matcap:{value:null}}]),vertexShader:is.meshmatcap_vert,fragmentShader:is.meshmatcap_frag},points:{uniforms:Fr([rs.points,rs.fog]),vertexShader:is.points_vert,fragmentShader:is.points_frag},dashed:{uniforms:Fr([rs.common,rs.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:is.linedashed_vert,fragmentShader:is.linedashed_frag},depth:{uniforms:Fr([rs.common,rs.displacementmap]),vertexShader:is.depth_vert,fragmentShader:is.depth_frag},normal:{uniforms:Fr([rs.common,rs.bumpmap,rs.normalmap,rs.displacementmap,{opacity:{value:1}}]),vertexShader:is.meshnormal_vert,fragmentShader:is.meshnormal_frag},sprite:{uniforms:Fr([rs.sprite,rs.fog]),vertexShader:is.sprite_vert,fragmentShader:is.sprite_frag},background:{uniforms:{uvTransform:{value:new tn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:is.background_vert,fragmentShader:is.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:is.backgroundCube_vert,fragmentShader:is.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:is.cube_vert,fragmentShader:is.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:is.equirect_vert,fragmentShader:is.equirect_frag},distanceRGBA:{uniforms:Fr([rs.common,rs.displacementmap,{referencePosition:{value:new Rn},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:is.distanceRGBA_vert,fragmentShader:is.distanceRGBA_frag},shadow:{uniforms:Fr([rs.lights,rs.fog,{color:{value:new Yi(0)},opacity:{value:1}}]),vertexShader:is.shadow_vert,fragmentShader:is.shadow_frag}};ss.physical={uniforms:Fr([ss.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new tn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new tn},clearcoatNormalScale:{value:new Qe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new tn},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new tn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new tn},sheen:{value:0},sheenColor:{value:new Yi(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new tn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new tn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new tn},transmissionSamplerSize:{value:new Qe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new tn},attenuationDistance:{value:0},attenuationColor:{value:new Yi(0)},specularColor:{value:new Yi(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new tn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new tn},anisotropyVector:{value:new Qe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new tn}}]),vertexShader:is.meshphysical_vert,fragmentShader:is.meshphysical_frag};const as={r:0,b:0,g:0};function os(t,e,n,i,r,s,a){const o=new Yi(0);let h,u,d=!0===s?0:1,p=null,m=0,f=null;function g(e,n){e.getRGB(as,Br(t)),i.buffers.color.setClear(as.r,as.g,as.b,n,a)}return{getClearColor:function(){return o},setClearColor:function(t,e=1){o.set(t),d=e,g(o,d)},getClearAlpha:function(){return d},setClearAlpha:function(t){d=t,g(o,d)},render:function(s,v){let _=!1,y=!0===v.isScene?v.background:null;if(y&&y.isTexture){y=(v.backgroundBlurriness>0?n:e).get(y)}switch(null===y?g(o,d):y&&y.isColor&&(g(y,1),_=!0),t.xr.getEnvironmentBlendMode()){case"opaque":_=!0;break;case"additive":i.buffers.color.setClear(0,0,0,1,a),_=!0;break;case"alpha-blend":i.buffers.color.setClear(0,0,0,0,a),_=!0}(t.autoClear||_)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),y&&(y.isCubeTexture||y.mapping===et)?(void 0===u&&(u=new Ur(new Nr(1,1,1),new Gr({name:"BackgroundCubeMaterial",uniforms:Or(ss.backgroundCube.uniforms),vertexShader:ss.backgroundCube.vertexShader,fragmentShader:ss.backgroundCube.fragmentShader,side:c,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),u.material.uniforms.envMap.value=y,u.material.uniforms.flipEnvMap.value=y.isCubeTexture&&!1===y.isRenderTargetTexture?-1:1,u.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.toneMapped=y.colorSpace!==be,p===y&&m===y.version&&f===t.toneMapping||(u.material.needsUpdate=!0,p=y,m=y.version,f=t.toneMapping),u.layers.enableAll(),s.unshift(u,u.geometry,u.material,0,0,null)):y&&y.isTexture&&(void 0===h&&(h=new Ur(new ns(2,2),new Gr({name:"BackgroundMaterial",uniforms:Or(ss.background.uniforms),vertexShader:ss.background.vertexShader,fragmentShader:ss.background.fragmentShader,side:l,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(h)),h.material.uniforms.t2D.value=y,h.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,h.material.toneMapped=y.colorSpace!==be,!0===y.matrixAutoUpdate&&y.updateMatrix(),h.material.uniforms.uvTransform.value.copy(y.matrix),p===y&&m===y.version&&f===t.toneMapping||(h.material.needsUpdate=!0,p=y,m=y.version,f=t.toneMapping),h.layers.enableAll(),s.unshift(h,h.geometry,h.material,0,0,null))}}}function ls(t,e,n,i){const r=t.getParameter(t.MAX_VERTEX_ATTRIBS),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),a=i.isWebGL2||null!==s,o={},l=p(null);let c=l,h=!1;function u(e){return i.isWebGL2?t.bindVertexArray(e):s.bindVertexArrayOES(e)}function d(e){return i.isWebGL2?t.deleteVertexArray(e):s.deleteVertexArrayOES(e)}function p(t){const e=[],n=[],i=[];for(let t=0;t=0){const n=r[e];let i=s[e];if(void 0===i&&("instanceMatrix"===e&&t.instanceMatrix&&(i=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(i=t.instanceColor)),void 0===n)return!0;if(n.attribute!==i)return!0;if(i&&n.data!==i.data)return!0;a++}}return c.attributesNum!==a||c.index!==i}(r,y,d,x),M&&function(t,e,n,i){const r={},s=e.attributes;let a=0;const o=n.getAttributes();for(const e in o){if(o[e].location>=0){let n=s[e];void 0===n&&("instanceMatrix"===e&&t.instanceMatrix&&(n=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(n=t.instanceColor));const i={};i.attribute=n,n&&n.data&&(i.data=n.data),r[e]=i,a++}}c.attributes=r,c.attributesNum=a,c.index=i}(r,y,d,x)}else{const t=!0===l.wireframe;c.geometry===y.id&&c.program===d.id&&c.wireframe===t||(c.geometry=y.id,c.program=d.id,c.wireframe=t,M=!0)}null!==x&&n.update(x,t.ELEMENT_ARRAY_BUFFER),(M||h)&&(h=!1,function(r,s,a,o){if(!1===i.isWebGL2&&(r.isInstancedMesh||o.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;m();const l=o.attributes,c=a.getAttributes(),h=s.defaultAttributeValues;for(const e in c){const s=c[e];if(s.location>=0){let a=l[e];if(void 0===a&&("instanceMatrix"===e&&r.instanceMatrix&&(a=r.instanceMatrix),"instanceColor"===e&&r.instanceColor&&(a=r.instanceColor)),void 0!==a){const e=a.normalized,l=a.itemSize,c=n.get(a);if(void 0===c)continue;const h=c.buffer,u=c.type,d=c.bytesPerElement,p=!0===i.isWebGL2&&(u===t.INT||u===t.UNSIGNED_INT||a.gpuType===ft);if(a.isInterleavedBufferAttribute){const n=a.data,i=n.stride,c=a.offset;if(n.isInstancedInterleavedBuffer){for(let t=0;t0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===t.constructor.name;let a=void 0!==n.precision?n.precision:"highp";const o=r(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);const l=s||e.has("WEBGL_draw_buffers"),c=!0===n.logarithmicDepthBuffer,h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=t.getParameter(t.MAX_TEXTURE_SIZE),p=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),m=t.getParameter(t.MAX_VERTEX_ATTRIBS),f=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),g=t.getParameter(t.MAX_VARYING_VECTORS),v=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),_=u>0,y=s||e.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===e.has("EXT_texture_filter_anisotropic")){const n=e.get("EXT_texture_filter_anisotropic");i=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:r,precision:a,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:f,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:_,floatFragmentTextures:y,floatVertexTextures:_&&y,maxSamples:s?t.getParameter(t.MAX_SAMPLES):0}}function us(t){const e=this;let n=null,i=0,r=!1,s=!1;const a=new Jr,o=new tn,l={value:null,needsUpdate:!1};function c(t,n,i,r){const s=null!==t?t.length:0;let c=null;if(0!==s){if(c=l.value,!0!==r||null===c){const e=i+4*s,r=n.matrixWorldInverse;o.getNormalMatrix(r),(null===c||c.length0);e.numPlanes=i,e.numIntersection=0}();else{const t=s?0:i,e=4*t;let r=m.clippingState||null;l.value=r,r=c(u,o,e,h);for(let t=0;t!==e;++t)r[t]=n[t];m.clippingState=r,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=t}}}function ds(t){let e=new WeakMap;function n(t,e){return e===Q?t.mapping=K:e===tt&&(t.mapping=$),t}function i(t){const n=t.target;n.removeEventListener("dispose",i);const r=e.get(n);void 0!==r&&(e.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture&&!1===r.isRenderTargetTexture){const s=r.mapping;if(s===Q||s===tt){if(e.has(r)){return n(e.get(r).texture,r.mapping)}{const s=r.image;if(s&&s.height>0){const a=new jr(s.height/2);return a.fromEquirectangularTexture(t,r),e.set(r,a),r.addEventListener("dispose",i),n(a.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}class ps extends Hr{constructor(t=-1,e=1,n=1,i=-1,r=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=r,this.far=s,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,r,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=n-t,s=n+t,a=i+e,o=i-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,s=r+t*this.view.width,a-=e*this.view.offsetY,o=a-e*this.view.height}this.projectionMatrix.makeOrthographic(r,s,a,o,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}const ms=4,fs=[.125,.215,.35,.446,.526,.582],gs=20,vs=new ps,_s=new Yi;let ys=null;const xs=(1+Math.sqrt(5))/2,Ms=1/xs,Ss=[new Rn(1,1,1),new Rn(-1,1,1),new Rn(1,1,-1),new Rn(-1,1,-1),new Rn(0,xs,Ms),new Rn(0,xs,-Ms),new Rn(Ms,0,xs),new Rn(-Ms,0,xs),new Rn(xs,Ms,0),new Rn(-xs,Ms,0)];class bs{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){ys=this._renderer.getRenderTarget(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,n,i,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=As(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=ws(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;tt-ms?o=fs[a-t+ms-1]:0===a&&(o=0),i.push(o);const l=1/(s-2),c=-l,h=1+l,u=[c,c,h,c,h,h,c,c,h,h,c,h],d=6,p=6,m=3,f=2,g=1,v=new Float32Array(m*p*d),_=new Float32Array(f*p*d),y=new Float32Array(g*p*d);for(let t=0;t2?0:-1,i=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];v.set(i,m*p*t),_.set(u,f*p*t);const r=[t,t,t,t,t,t];y.set(r,g*p*t)}const x=new fr;x.setAttribute("position",new rr(v,m)),x.setAttribute("uv",new rr(_,f)),x.setAttribute("faceIndex",new rr(y,g)),e.push(x),r>ms&&r--}return{lodPlanes:e,sizeLods:n,sigmas:i}}(i)),this._blurMaterial=function(t,e,n){const i=new Float32Array(gs),r=new Rn(0,1,0),s=new Gr({name:"SphericalGaussianBlur",defines:{n:gs,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:Rs(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:u,depthTest:!1,depthWrite:!1});return s}(i,t,e)}return i}_compileMaterial(t){const e=new Ur(this._lodPlanes[0],t);this._renderer.compile(e,vs)}_sceneToCubeUV(t,e,n,i){const r=new kr(90,1,e,n),s=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],o=this._renderer,l=o.autoClear,h=o.toneMapping;o.getClearColor(_s),o.toneMapping=W,o.autoClear=!1;const u=new Ji({name:"PMREM.Background",side:c,depthWrite:!1,depthTest:!1}),d=new Ur(new Nr,u);let p=!1;const m=t.background;m?m.isColor&&(u.color.copy(m),t.background=null,p=!0):(u.color.copy(_s),p=!0);for(let e=0;e<6;e++){const n=e%3;0===n?(r.up.set(0,s[e],0),r.lookAt(a[e],0,0)):1===n?(r.up.set(0,0,s[e]),r.lookAt(0,a[e],0)):(r.up.set(0,s[e],0),r.lookAt(0,0,a[e]));const l=this._cubeSize;Es(i,n*l,e>2?l:0,l,l),o.setRenderTarget(i),p&&o.render(d,r),o.render(t,r)}d.geometry.dispose(),d.material.dispose(),o.toneMapping=h,o.autoClear=l,t.background=m}_textureToCubeUV(t,e){const n=this._renderer,i=t.mapping===K||t.mapping===$;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=As()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=ws());const r=i?this._cubemapMaterial:this._equirectMaterial,s=new Ur(this._lodPlanes[0],r);r.uniforms.envMap.value=t;const a=this._cubeSize;Es(e,0,0,3*a,2*a),n.setRenderTarget(e),n.render(s,vs)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;for(let e=1;egs&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${gs}`);const f=[];let g=0;for(let t=0;tv-ms?i-v+ms:0),4*(this._cubeSize-_),3*_,2*_),o.setRenderTarget(e),o.render(c,vs)}}function Ts(t,e,n){const i=new Tn(t,e,n);return i.texture.mapping=et,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Es(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function ws(){return new Gr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Rs(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:u,depthTest:!1,depthWrite:!1})}function As(){return new Gr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Rs(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:u,depthTest:!1,depthWrite:!1})}function Rs(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function Cs(t){let e=new WeakMap,n=null;function i(t){const n=t.target;n.removeEventListener("dispose",i);const r=e.get(n);void 0!==r&&(e.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){const s=r.mapping,a=s===Q||s===tt,o=s===K||s===$;if(a||o){if(r.isRenderTargetTexture&&!0===r.needsPMREMUpdate){r.needsPMREMUpdate=!1;let i=e.get(r);return null===n&&(n=new bs(t)),i=a?n.fromEquirectangular(r,i):n.fromCubemap(r,i),e.set(r,i),i.texture}if(e.has(r))return e.get(r).texture;{const s=r.image;if(a&&s&&s.height>0||o&&s&&function(t){let e=0;const n=6;for(let i=0;ie.maxTextureSize&&(E=Math.ceil(T/e.maxTextureSize),T=e.maxTextureSize);const w=new Float32Array(T*E*4*p),A=new En(w,T,E,p);A.type=vt,A.needsUpdate=!0;const R=4*b;for(let L=0;L0)return t;const r=e*n;let s=ks[r];if(void 0===s&&(s=new Float32Array(r),ks[r]=s),0!==e){i.toArray(s,0);for(let i=1,r=0;i!==e;++i)r+=n,t[i].toArray(s,r)}return s}function Ys(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n":" "} ${r}: ${n[t]}`)}return i.join("\n")}(t.getShaderSource(e),i)}return r}function Xa(t,e){const n=function(t){switch(t){case Te:return["Linear","( value )"];case be:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),["Linear","( value )"]}}(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function ja(t,e){let n;switch(e){case X:n="Linear";break;case j:n="Reinhard";break;case q:n="OptimizedCineon";break;case Y:n="ACESFilmic";break;case Z:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function qa(t){return""!==t}function Ya(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Za(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Ja=/^[ \t]*#include +<([\w\d./]+)>/gm;function Ka(t){return t.replace(Ja,$a)}function $a(t,e){const n=is[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Ka(n)}const Qa=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function to(t){return t.replace(Qa,eo)}function eo(t,e,n,i){let r="";for(let t=parseInt(e);t0&&(y+="\n"),x=[g,"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v].filter(qa).join("\n"),x.length>0&&(x+="\n")):(y=[no(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+p:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+u:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(qa).join("\n"),x=[g,no(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+d:"",n.envMap?"#define "+p:"",n.envMap?"#define "+m:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+u:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==W?"#define TONE_MAPPING":"",n.toneMapping!==W?is.tonemapping_pars_fragment:"",n.toneMapping!==W?ja("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",is.encodings_pars_fragment,Xa("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(qa).join("\n")),c=Ka(c),c=Ya(c,n),c=Za(c,n),h=Ka(h),h=Ya(h,n),h=Za(h,n),c=to(c),h=to(h),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(M="#version 300 es\n",y=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+y,x=["#define varying in",n.glslVersion===Oe?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===Oe?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+x);const S=M+y+c,b=M+x+h,T=ka(r,r.VERTEX_SHADER,S),E=ka(r,r.FRAGMENT_SHADER,b);if(r.attachShader(_,T),r.attachShader(_,E),void 0!==n.index0AttributeName?r.bindAttribLocation(_,0,n.index0AttributeName):!0===n.morphTargets&&r.bindAttribLocation(_,0,"position"),r.linkProgram(_),t.debug.checkShaderErrors){const e=r.getProgramInfoLog(_).trim(),n=r.getShaderInfoLog(T).trim(),i=r.getShaderInfoLog(E).trim();let s=!0,a=!0;if(!1===r.getProgramParameter(_,r.LINK_STATUS))if(s=!1,"function"==typeof t.debug.onShaderError)t.debug.onShaderError(r,_,T,E);else{const t=Wa(r,T,"vertex"),n=Wa(r,E,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(_,r.VALIDATE_STATUS)+"\n\nProgram Info Log: "+e+"\n"+t+"\n"+n)}else""!==e?console.warn("THREE.WebGLProgram: Program Info Log:",e):""!==n&&""!==i||(a=!1);a&&(this.diagnostics={runnable:s,programLog:e,vertexShader:{log:n,prefix:y},fragmentShader:{log:i,prefix:x}})}let w,A;return r.deleteShader(T),r.deleteShader(E),this.getUniforms=function(){return void 0===w&&(w=new Ha(r,_)),w},this.getAttributes=function(){return void 0===A&&(A=function(t,e){const n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let r=0;r0,Z=s.clearcoat>0,J=s.iridescence>0,K=s.sheen>0,$=s.transmission>0,Q=Y&&!!s.anisotropyMap,tt=Z&&!!s.clearcoatMap,nt=Z&&!!s.clearcoatNormalMap,it=Z&&!!s.clearcoatRoughnessMap,rt=J&&!!s.iridescenceMap,st=J&&!!s.iridescenceThicknessMap,at=K&&!!s.sheenColorMap,ot=K&&!!s.sheenRoughnessMap,lt=!!s.specularMap,ct=!!s.specularColorMap,ht=!!s.specularIntensityMap,ut=$&&!!s.transmissionMap,dt=$&&!!s.thicknessMap,pt=!!s.gradientMap,mt=!!s.alphaMap,ft=s.alphaTest>0,gt=!!s.extensions,vt=!!S.attributes.uv1,_t=!!S.attributes.uv2,yt=!!S.attributes.uv3;return{isWebGL2:p,shaderID:w,shaderType:s.type,shaderName:s.name,vertexShader:C,fragmentShader:L,defines:s.defines,customVertexShaderID:P,customFragmentShaderID:I,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:g,instancing:N,instancingColor:N&&null!==x.instanceColor,supportsVertexTextures:f,outputColorSpace:null===D?t.outputColorSpace:!0===D.isXRRenderTarget?D.texture.colorSpace:Te,map:O,matcap:F,envMap:B,envMapMode:B&&T.mapping,envMapCubeUVHeight:E,aoMap:z,lightMap:G,bumpMap:H,normalMap:k,displacementMap:f&&V,emissiveMap:X,normalMapObjectSpace:k&&s.normalMapType===Me,normalMapTangentSpace:k&&s.normalMapType===xe,metalnessMap:j,roughnessMap:q,anisotropy:Y,anisotropyMap:Q,clearcoat:Z,clearcoatMap:tt,clearcoatNormalMap:nt,clearcoatRoughnessMap:it,iridescence:J,iridescenceMap:rt,iridescenceThicknessMap:st,sheen:K,sheenColorMap:at,sheenRoughnessMap:ot,specularMap:lt,specularColorMap:ct,specularIntensityMap:ht,transmission:$,transmissionMap:ut,thicknessMap:dt,gradientMap:pt,opaque:!1===s.transparent&&s.blending===d,alphaMap:mt,alphaTest:ft,combine:s.combine,mapUv:O&&_(s.map.channel),aoMapUv:z&&_(s.aoMap.channel),lightMapUv:G&&_(s.lightMap.channel),bumpMapUv:H&&_(s.bumpMap.channel),normalMapUv:k&&_(s.normalMap.channel),displacementMapUv:V&&_(s.displacementMap.channel),emissiveMapUv:X&&_(s.emissiveMap.channel),metalnessMapUv:j&&_(s.metalnessMap.channel),roughnessMapUv:q&&_(s.roughnessMap.channel),anisotropyMapUv:Q&&_(s.anisotropyMap.channel),clearcoatMapUv:tt&&_(s.clearcoatMap.channel),clearcoatNormalMapUv:nt&&_(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:it&&_(s.clearcoatRoughnessMap.channel),iridescenceMapUv:rt&&_(s.iridescenceMap.channel),iridescenceThicknessMapUv:st&&_(s.iridescenceThicknessMap.channel),sheenColorMapUv:at&&_(s.sheenColorMap.channel),sheenRoughnessMapUv:ot&&_(s.sheenRoughnessMap.channel),specularMapUv:lt&&_(s.specularMap.channel),specularColorMapUv:ct&&_(s.specularColorMap.channel),specularIntensityMapUv:ht&&_(s.specularIntensityMap.channel),transmissionMapUv:ut&&_(s.transmissionMap.channel),thicknessMapUv:dt&&_(s.thicknessMap.channel),alphaMapUv:mt&&_(s.alphaMap.channel),vertexTangents:!!S.attributes.tangent&&(k||Y),vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!S.attributes.color&&4===S.attributes.color.itemSize,vertexUv1s:vt,vertexUv2s:_t,vertexUv3s:yt,pointsUvs:!0===x.isPoints&&!!S.attributes.uv&&(O||mt),fog:!!M,useFog:!0===s.fog,fogExp2:M&&M.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:m,skinning:!0===x.isSkinnedMesh,morphTargets:void 0!==S.morphAttributes.position,morphNormals:void 0!==S.morphAttributes.normal,morphColors:void 0!==S.morphAttributes.color,morphTargetsCount:R,morphTextureStride:U,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&u.length>0,shadowMapType:t.shadowMap.type,toneMapping:s.toneMapped?t.toneMapping:W,useLegacyLights:t.useLegacyLights,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===h,flipSided:s.side===c,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:gt&&!0===s.extensions.derivatives,extensionFragDepth:gt&&!0===s.extensions.fragDepth,extensionDrawBuffers:gt&&!0===s.extensions.drawBuffers,extensionShaderTextureLOD:gt&&!0===s.extensions.shaderTextureLOD,rendererExtensionFragDepth:p||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:p||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:p||i.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.customVertexShaderID),n.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(!function(t,e){t.push(e.precision),t.push(e.outputColorSpace),t.push(e.envMapMode),t.push(e.envMapCubeUVHeight),t.push(e.mapUv),t.push(e.alphaMapUv),t.push(e.lightMapUv),t.push(e.aoMapUv),t.push(e.bumpMapUv),t.push(e.normalMapUv),t.push(e.displacementMapUv),t.push(e.emissiveMapUv),t.push(e.metalnessMapUv),t.push(e.roughnessMapUv),t.push(e.anisotropyMapUv),t.push(e.clearcoatMapUv),t.push(e.clearcoatNormalMapUv),t.push(e.clearcoatRoughnessMapUv),t.push(e.iridescenceMapUv),t.push(e.iridescenceThicknessMapUv),t.push(e.sheenColorMapUv),t.push(e.sheenRoughnessMapUv),t.push(e.specularMapUv),t.push(e.specularColorMapUv),t.push(e.specularIntensityMapUv),t.push(e.transmissionMapUv),t.push(e.thicknessMapUv),t.push(e.combine),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numSpotLightMaps),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.numSpotLightShadowsWithMaps),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}(n,e),function(t,e){o.disableAll(),e.isWebGL2&&o.enable(0);e.supportsVertexTextures&&o.enable(1);e.instancing&&o.enable(2);e.instancingColor&&o.enable(3);e.matcap&&o.enable(4);e.envMap&&o.enable(5);e.normalMapObjectSpace&&o.enable(6);e.normalMapTangentSpace&&o.enable(7);e.clearcoat&&o.enable(8);e.iridescence&&o.enable(9);e.alphaTest&&o.enable(10);e.vertexColors&&o.enable(11);e.vertexAlphas&&o.enable(12);e.vertexUv1s&&o.enable(13);e.vertexUv2s&&o.enable(14);e.vertexUv3s&&o.enable(15);e.vertexTangents&&o.enable(16);e.anisotropy&&o.enable(17);t.push(o.mask),o.disableAll(),e.fog&&o.enable(0);e.useFog&&o.enable(1);e.flatShading&&o.enable(2);e.logarithmicDepthBuffer&&o.enable(3);e.skinning&&o.enable(4);e.morphTargets&&o.enable(5);e.morphNormals&&o.enable(6);e.morphColors&&o.enable(7);e.premultipliedAlpha&&o.enable(8);e.shadowMapEnabled&&o.enable(9);e.useLegacyLights&&o.enable(10);e.doubleSided&&o.enable(11);e.flipSided&&o.enable(12);e.useDepthPacking&&o.enable(13);e.dithering&&o.enable(14);e.transmission&&o.enable(15);e.sheen&&o.enable(16);e.opaque&&o.enable(17);e.pointsUvs&&o.enable(18);t.push(o.mask)}(n,e),n.push(t.outputColorSpace)),n.push(e.customProgramCacheKey),n.join()},getUniforms:function(t){const e=v[t.type];let n;if(e){const t=ss[e];n=zr.clone(t.uniforms)}else n=t.uniforms;return n},acquireProgram:function(e,n){let i;for(let t=0,e=u.length;t0?i.push(h):!0===a.transparent?r.push(h):n.push(h)},unshift:function(t,e,a,o,l,c){const h=s(t,e,a,o,l,c);a.transmission>0?i.unshift(h):!0===a.transparent?r.unshift(h):n.unshift(h)},finish:function(){for(let n=e,i=t.length;n1&&n.sort(t||co),i.length>1&&i.sort(e||ho),r.length>1&&r.sort(e||ho)}}}function po(){let t=new WeakMap;return{get:function(e,n){const i=t.get(e);let r;return void 0===i?(r=new uo,t.set(e,[r])):n>=i.length?(r=new uo,i.push(r)):r=i[n],r},dispose:function(){t=new WeakMap}}}function mo(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new Rn,color:new Yi};break;case"SpotLight":n={position:new Rn,direction:new Rn,color:new Yi,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Rn,color:new Yi,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Rn,skyColor:new Yi,groundColor:new Yi};break;case"RectAreaLight":n={color:new Yi,position:new Rn,halfWidth:new Rn,halfHeight:new Rn}}return t[e.id]=n,n}}}let fo=0;function go(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function vo(t,e){const n=new mo,i=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Qe};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Qe,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let t=0;t<9;t++)r.probe.push(new Rn);const s=new Rn,a=new ri,o=new ri;return{setup:function(s,a){let o=0,l=0,c=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let h=0,u=0,d=0,p=0,m=0,f=0,g=0,v=0,_=0,y=0;s.sort(go);const x=!0===a?Math.PI:1;for(let t=0,e=s.length;t0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=rs.LTC_FLOAT_1,r.rectAreaLTC2=rs.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=rs.LTC_HALF_1,r.rectAreaLTC2=rs.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=o,r.ambient[1]=l,r.ambient[2]=c;const M=r.hash;M.directionalLength===h&&M.pointLength===u&&M.spotLength===d&&M.rectAreaLength===p&&M.hemiLength===m&&M.numDirectionalShadows===f&&M.numPointShadows===g&&M.numSpotShadows===v&&M.numSpotMaps===_||(r.directional.length=h,r.spot.length=d,r.rectArea.length=p,r.point.length=u,r.hemi.length=m,r.directionalShadow.length=f,r.directionalShadowMap.length=f,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=v,r.spotShadowMap.length=v,r.directionalShadowMatrix.length=f,r.pointShadowMatrix.length=g,r.spotLightMatrix.length=v+_-y,r.spotLightMap.length=_,r.numSpotLightShadowsWithMaps=y,M.directionalLength=h,M.pointLength=u,M.spotLength=d,M.rectAreaLength=p,M.hemiLength=m,M.numDirectionalShadows=f,M.numPointShadows=g,M.numSpotShadows=v,M.numSpotMaps=_,r.version=fo++)},setupView:function(t,e){let n=0,i=0,l=0,c=0,h=0;const u=e.matrixWorldInverse;for(let e=0,d=t.length;e=s.length?(a=new _o(t,e),s.push(a)):a=s[r],a},dispose:function(){n=new WeakMap}}}class xo extends Vi{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class Mo extends Vi{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}function So(t,e,n){let i=new Qr;const r=new Qe,a=new Qe,d=new bn,p=new xo({depthPacking:ye}),m=new Mo,f={},g=n.maxTextureSize,v={[l]:c,[c]:l,[h]:h},_=new Gr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Qe},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),y=_.clone();y.defines.HORIZONTAL_PASS=1;const x=new fr;x.setAttribute("position",new rr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const M=new Ur(x,_),S=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=s;let b=this.type;function T(n,i){const s=e.update(M);_.defines.VSM_SAMPLES!==n.blurSamples&&(_.defines.VSM_SAMPLES=n.blurSamples,y.defines.VSM_SAMPLES=n.blurSamples,_.needsUpdate=!0,y.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new Tn(r.x,r.y)),_.uniforms.shadow_pass.value=n.map.texture,_.uniforms.resolution.value=n.mapSize,_.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(i,null,s,_,M,null),y.uniforms.shadow_pass.value=n.mapPass.texture,y.uniforms.resolution.value=n.mapSize,y.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(i,null,s,y,M,null)}function E(e,n,i,r){let s=null;const a=!0===i.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(void 0!==a)s=a;else if(s=!0===i.isPointLight?m:p,t.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const t=s.uuid,e=n.uuid;let i=f[t];void 0===i&&(i={},f[t]=i);let r=i[e];void 0===r&&(r=s.clone(),i[e]=r),s=r}if(s.visible=n.visible,s.wireframe=n.wireframe,s.side=r===o?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:v[n.side],s.alphaMap=n.alphaMap,s.alphaTest=n.alphaTest,s.map=n.map,s.clipShadows=n.clipShadows,s.clippingPlanes=n.clippingPlanes,s.clipIntersection=n.clipIntersection,s.displacementMap=n.displacementMap,s.displacementScale=n.displacementScale,s.displacementBias=n.displacementBias,s.wireframeLinewidth=n.wireframeLinewidth,s.linewidth=n.linewidth,!0===i.isPointLight&&!0===s.isMeshDistanceMaterial){t.properties.get(s).light=i}return s}function w(n,r,s,a,l){if(!1===n.visible)return;if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&l===o)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const i=e.update(n),r=n.material;if(Array.isArray(r)){const e=i.groups;for(let o=0,c=e.length;og||r.y>g)&&(r.x>g&&(a.x=Math.floor(g/u.x),r.x=a.x*u.x,h.mapSize.x=a.x),r.y>g&&(a.y=Math.floor(g/u.y),r.y=a.y*u.y,h.mapSize.y=a.y)),null===h.map||!0===m||!0===f){const t=this.type!==o?{minFilter:st,magFilter:st}:{};null!==h.map&&h.map.dispose(),h.map=new Tn(r.x,r.y,t),h.map.texture.name=c.name+".shadowMap",h.camera.updateProjectionMatrix()}t.setRenderTarget(h.map),t.clear();const v=h.getViewportCount();for(let t=0;t=1):-1!==dt.indexOf("OpenGL ES")&&(ut=parseFloat(/^OpenGL ES (\d)/.exec(dt)[1]),ht=ut>=2);let pt=null,mt={};const ft=t.getParameter(t.SCISSOR_BOX),gt=t.getParameter(t.VIEWPORT),vt=(new bn).fromArray(ft),_t=(new bn).fromArray(gt);function yt(e,n,i,r){const s=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let o=0;oi||t.height>i)&&(r=i/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const i=e?Ze:Math.floor,s=i(r*t.width),a=i(r*t.height);void 0===f&&(f=_(s,a));const o=n?_(s,a):f;o.width=s,o.height=a;return o.getContext("2d").drawImage(t,0,0,s,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+a+")."),o}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function x(t){return qe(t.width)&&qe(t.height)}function M(t,e){return t.generateMipmaps&&e&&t.minFilter!==st&&t.minFilter!==lt}function S(e){t.generateMipmap(e)}function b(n,i,r,s,a=!1){if(!1===o)return i;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let l=i;return i===t.RED&&(r===t.FLOAT&&(l=t.R32F),r===t.HALF_FLOAT&&(l=t.R16F),r===t.UNSIGNED_BYTE&&(l=t.R8)),i===t.RG&&(r===t.FLOAT&&(l=t.RG32F),r===t.HALF_FLOAT&&(l=t.RG16F),r===t.UNSIGNED_BYTE&&(l=t.RG8)),i===t.RGBA&&(r===t.FLOAT&&(l=t.RGBA32F),r===t.HALF_FLOAT&&(l=t.RGBA16F),r===t.UNSIGNED_BYTE&&(l=s===be&&!1===a?t.SRGB8_ALPHA8:t.RGBA8),r===t.UNSIGNED_SHORT_4_4_4_4&&(l=t.RGBA4),r===t.UNSIGNED_SHORT_5_5_5_1&&(l=t.RGB5_A1)),l!==t.R16F&&l!==t.R32F&&l!==t.RG16F&&l!==t.RG32F&&l!==t.RGBA16F&&l!==t.RGBA32F||e.get("EXT_color_buffer_float"),l}function T(t,e,n){return!0===M(t,n)||t.isFramebufferTexture&&t.minFilter!==st&&t.minFilter!==lt?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function E(e){return e===st||e===at||e===ot?t.NEAREST:t.LINEAR}function w(t){const e=t.target;e.removeEventListener("dispose",w),function(t){const e=i.get(t);if(void 0===e.__webglInit)return;const n=t.source,r=g.get(n);if(r){const i=r[e.__cacheKey];i.usedTimes--,0===i.usedTimes&&R(t),0===Object.keys(r).length&&g.delete(n)}i.remove(t)}(e),e.isVideoTexture&&m.delete(e)}function A(e){const n=e.target;n.removeEventListener("dispose",A),function(e){const n=e.texture,r=i.get(e),s=i.get(n);void 0!==s.__webglTexture&&(t.deleteTexture(s.__webglTexture),a.memory.textures--);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(r.__webglFramebuffer[e]),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer[e]);else{if(t.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&t.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer)for(let e=0;e0&&s.__version!==e.version){const t=e.image;if(null===t)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==t.complete)return void O(s,e,r);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(t.TEXTURE_2D,s.__webglTexture,t.TEXTURE0+r)}const P={[nt]:t.REPEAT,[it]:t.CLAMP_TO_EDGE,[rt]:t.MIRRORED_REPEAT},I={[st]:t.NEAREST,[at]:t.NEAREST_MIPMAP_NEAREST,[ot]:t.NEAREST_MIPMAP_LINEAR,[lt]:t.LINEAR,[ct]:t.LINEAR_MIPMAP_NEAREST,[ht]:t.LINEAR_MIPMAP_LINEAR},U={[Ae]:t.NEVER,[De]:t.ALWAYS,[Re]:t.LESS,[Le]:t.LEQUAL,[Ce]:t.EQUAL,[Ue]:t.GEQUAL,[Pe]:t.GREATER,[Ie]:t.NOTEQUAL};function D(n,s,a){if(a?(t.texParameteri(n,t.TEXTURE_WRAP_S,P[s.wrapS]),t.texParameteri(n,t.TEXTURE_WRAP_T,P[s.wrapT]),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,P[s.wrapR]),t.texParameteri(n,t.TEXTURE_MAG_FILTER,I[s.magFilter]),t.texParameteri(n,t.TEXTURE_MIN_FILTER,I[s.minFilter])):(t.texParameteri(n,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(n,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),s.wrapS===it&&s.wrapT===it||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,t.TEXTURE_MAG_FILTER,E(s.magFilter)),t.texParameteri(n,t.TEXTURE_MIN_FILTER,E(s.minFilter)),s.minFilter!==st&&s.minFilter!==lt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),s.compareFunction&&(t.texParameteri(n,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(n,t.TEXTURE_COMPARE_FUNC,U[s.compareFunction])),!0===e.has("EXT_texture_filter_anisotropic")){const a=e.get("EXT_texture_filter_anisotropic");if(s.magFilter===st)return;if(s.minFilter!==ot&&s.minFilter!==ht)return;if(s.type===vt&&!1===e.has("OES_texture_float_linear"))return;if(!1===o&&s.type===_t&&!1===e.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||i.get(s).__currentAnisotropy)&&(t.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),i.get(s).__currentAnisotropy=s.anisotropy)}}function N(e,n){let i=!1;void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",w));const r=n.source;let s=g.get(r);void 0===s&&(s={},g.set(r,s));const o=function(t){const e=[];return e.push(t.wrapS),e.push(t.wrapT),e.push(t.wrapR||0),e.push(t.magFilter),e.push(t.minFilter),e.push(t.anisotropy),e.push(t.internalFormat),e.push(t.format),e.push(t.type),e.push(t.generateMipmaps),e.push(t.premultiplyAlpha),e.push(t.flipY),e.push(t.unpackAlignment),e.push(t.colorSpace),e.join()}(n);if(o!==e.__cacheKey){void 0===s[o]&&(s[o]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,i=!0),s[o].usedTimes++;const r=s[e.__cacheKey];void 0!==r&&(s[e.__cacheKey].usedTimes--,0===r.usedTimes&&R(n)),e.__cacheKey=o,e.__webglTexture=s[o].texture}return i}function O(e,r,a){let l=t.TEXTURE_2D;(r.isDataArrayTexture||r.isCompressedArrayTexture)&&(l=t.TEXTURE_2D_ARRAY),r.isData3DTexture&&(l=t.TEXTURE_3D);const c=N(e,r),u=r.source;n.bindTexture(l,e.__webglTexture,t.TEXTURE0+a);const d=i.get(u);if(u.version!==d.__version||!0===c){n.activeTexture(t.TEXTURE0+a),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,r.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,r.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE);const e=function(t){return!o&&(t.wrapS!==it||t.wrapT!==it||t.minFilter!==st&&t.minFilter!==lt)}(r)&&!1===x(r.image);let i=y(r.image,e,!1,h);i=k(r,i);const p=x(i)||o,m=s.convert(r.format,r.colorSpace);let f,g=s.convert(r.type),v=b(r.internalFormat,m,g,r.colorSpace);D(l,r,p);const _=r.mipmaps,E=o&&!0!==r.isVideoTexture,w=void 0===d.__version||!0===c,A=T(r,i,p);if(r.isDepthTexture)v=t.DEPTH_COMPONENT,o?v=r.type===vt?t.DEPTH_COMPONENT32F:r.type===gt?t.DEPTH_COMPONENT24:r.type===Mt?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT16:r.type===vt&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===wt&&v===t.DEPTH_COMPONENT&&r.type!==mt&&r.type!==gt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=gt,g=s.convert(r.type)),r.format===At&&v===t.DEPTH_COMPONENT&&(v=t.DEPTH_STENCIL,r.type!==Mt&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=Mt,g=s.convert(r.type))),w&&(E?n.texStorage2D(t.TEXTURE_2D,1,v,i.width,i.height):n.texImage2D(t.TEXTURE_2D,0,v,i.width,i.height,0,m,g,null));else if(r.isDataTexture)if(_.length>0&&p){E&&w&&n.texStorage2D(t.TEXTURE_2D,A,v,_[0].width,_[0].height);for(let e=0,i=_.length;e>=1,r>>=1}}else if(_.length>0&&p){E&&w&&n.texStorage2D(t.TEXTURE_2D,A,v,_[0].width,_[0].height);for(let e=0,i=_.length;e=t.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,o,l,i.get(a).__webglTexture,0),n.bindFramebuffer(t.FRAMEBUFFER,null)}function B(e,n,i){if(t.bindRenderbuffer(t.RENDERBUFFER,e),n.depthBuffer&&!n.stencilBuffer){let r=t.DEPTH_COMPONENT16;if(i||H(n)){const e=n.depthTexture;e&&e.isDepthTexture&&(e.type===vt?r=t.DEPTH_COMPONENT32F:e.type===gt&&(r=t.DEPTH_COMPONENT24));const i=G(n);H(n)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,i,r,n.width,n.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,i,r,n.width,n.height)}else t.renderbufferStorage(t.RENDERBUFFER,r,n.width,n.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)}else if(n.depthBuffer&&n.stencilBuffer){const r=G(n);i&&!1===H(n)?t.renderbufferStorageMultisample(t.RENDERBUFFER,r,t.DEPTH24_STENCIL8,n.width,n.height):H(n)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,r,t.DEPTH24_STENCIL8,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)}else{const e=!0===n.isWebGLMultipleRenderTargets?n.texture:[n.texture];for(let r=0;r0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function k(t,n){const i=t.colorSpace,r=t.format,s=t.type;return!0===t.isCompressedTexture||t.format===Fe||i!==Te&&i!==Se&&(i===be?!1===o?!0===e.has("EXT_sRGB")&&r===bt?(t.format=Fe,t.minFilter=lt,t.generateMipmaps=!1):n=vn.sRGBToLinear(n):r===bt&&s===ut||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",i)),n}this.allocateTextureUnit=function(){const t=C;return t>=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),C+=1,t},this.resetTextureUnits=function(){C=0},this.setTexture2D=L,this.setTexture2DArray=function(e,r){const s=i.get(e);e.version>0&&s.__version!==e.version?O(s,e,r):n.bindTexture(t.TEXTURE_2D_ARRAY,s.__webglTexture,t.TEXTURE0+r)},this.setTexture3D=function(e,r){const s=i.get(e);e.version>0&&s.__version!==e.version?O(s,e,r):n.bindTexture(t.TEXTURE_3D,s.__webglTexture,t.TEXTURE0+r)},this.setTextureCube=function(e,r){const a=i.get(e);e.version>0&&a.__version!==e.version?function(e,r,a){if(6!==r.image.length)return;const l=N(e,r),h=r.source;n.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+a);const u=i.get(h);if(h.version!==u.__version||!0===l){n.activeTexture(t.TEXTURE0+a),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,r.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,r.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE);const e=r.isCompressedTexture||r.image[0].isCompressedTexture,i=r.image[0]&&r.image[0].isDataTexture,d=[];for(let t=0;t<6;t++)d[t]=e||i?i?r.image[t].image:r.image[t]:y(r.image[t],!1,!0,c),d[t]=k(r,d[t]);const p=d[0],m=x(p)||o,f=s.convert(r.format,r.colorSpace),g=s.convert(r.type),v=b(r.internalFormat,f,g,r.colorSpace),_=o&&!0!==r.isVideoTexture,E=void 0===u.__version||!0===l;let w,A=T(r,p,m);if(D(t.TEXTURE_CUBE_MAP,r,m),e){_&&E&&n.texStorage2D(t.TEXTURE_CUBE_MAP,A,v,p.width,p.height);for(let e=0;e<6;e++){w=d[e].mipmaps;for(let i=0;i0&&A++,n.texStorage2D(t.TEXTURE_CUBE_MAP,A,v,d[0].width,d[0].height));for(let e=0;e<6;e++)if(i){_?n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,d[e].width,d[e].height,f,g,d[e].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,v,d[e].width,d[e].height,0,f,g,d[e].data);for(let i=0;i0&&!1===H(e)){const i=d?l:[l];c.__webglMultisampledFramebuffer=t.createFramebuffer(),c.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,c.__webglMultisampledFramebuffer);for(let n=0;n0&&!1===H(e)){const r=e.isWebGLMultipleRenderTargets?e.texture:[e.texture],s=e.width,a=e.height;let o=t.COLOR_BUFFER_BIT;const l=[],c=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,h=i.get(e),u=!0===e.isWebGLMultipleRenderTargets;if(u)for(let e=0;eo+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&a<=o-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==o&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1));null!==a&&(i=e.getPose(t.targetRaySpace,n),null===i&&null!==r&&(i=r),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Ro)))}return null!==a&&(a.visible=null!==i),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==s),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){const n=new Ao;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}class Lo extends Sn{constructor(t,e,n,i,r,s,a,o,l,c){if((c=void 0!==c?c:wt)!==wt&&c!==At)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===wt&&(n=gt),void 0===n&&c===At&&(n=Mt),super(null,i,r,s,a,o,c,n,l),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=void 0!==a?a:st,this.minFilter=void 0!==o?o:st,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return null!==this.compareFunction&&(e.compareFunction=this.compareFunction),e}}class Po extends Be{constructor(t,e){super();const n=this;let i=null,r=1,s=null,a="local-floor",o=1,l=null,c=null,h=null,u=null,d=null,p=null;const m=e.getContextAttributes();let f=null,g=null;const v=[],_=[];let y=null;const x=new kr;x.layers.enable(1),x.viewport=new bn;const M=new kr;M.layers.enable(2),M.viewport=new bn;const S=[x,M],b=new wo;b.layers.enable(1),b.layers.enable(2);let T=null,E=null;function w(t){const e=_.indexOf(t.inputSource);if(-1===e)return;const n=v[e];void 0!==n&&(n.update(t.inputSource,t.frame,l||s),n.dispatchEvent({type:t.type,data:t.inputSource}))}function A(){i.removeEventListener("select",w),i.removeEventListener("selectstart",w),i.removeEventListener("selectend",w),i.removeEventListener("squeeze",w),i.removeEventListener("squeezestart",w),i.removeEventListener("squeezeend",w),i.removeEventListener("end",A),i.removeEventListener("inputsourceschange",R);for(let t=0;t=0&&(_[i]=null,v[i].disconnect(n))}for(let e=0;e=_.length){_.push(n),i=t;break}if(null===_[t]){_[t]=n,i=t;break}}if(-1===i)break}const r=v[i];r&&r.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getCamera=function(){},this.setUserCamera=function(t){y=t},this.getController=function(t){let e=v[t];return void 0===e&&(e=new Co,v[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=v[t];return void 0===e&&(e=new Co,v[t]=e),e.getGripSpace()},this.getHand=function(t){let e=v[t];return void 0===e&&(e=new Co,v[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){r=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){a=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||s},this.setReferenceSpace=function(t){l=t},this.getBaseLayer=function(){return null!==u?u:d},this.getBinding=function(){return h},this.getFrame=function(){return p},this.getSession=function(){return i},this.setSession=async function(c){if(i=c,null!==i){if(f=t.getRenderTarget(),i.addEventListener("select",w),i.addEventListener("selectstart",w),i.addEventListener("selectend",w),i.addEventListener("squeeze",w),i.addEventListener("squeezestart",w),i.addEventListener("squeezeend",w),i.addEventListener("end",A),i.addEventListener("inputsourceschange",R),!0!==m.xrCompatible&&await e.makeXRCompatible(),void 0===i.renderState.layers||!1===t.capabilities.isWebGL2){const n={antialias:void 0!==i.renderState.layers||m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:r};d=new XRWebGLLayer(i,e,n),i.updateRenderState({baseLayer:d}),g=new Tn(d.framebufferWidth,d.framebufferHeight,{format:bt,type:ut,colorSpace:t.outputColorSpace,stencilBuffer:m.stencil})}else{let n=null,s=null,a=null;m.depth&&(a=m.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,n=m.stencil?At:wt,s=m.stencil?Mt:gt);const o={colorFormat:e.RGBA8,depthFormat:a,scaleFactor:r};h=new XRWebGLBinding(i,e),u=h.createProjectionLayer(o),i.updateRenderState({layers:[u]}),g=new Tn(u.textureWidth,u.textureHeight,{format:bt,type:ut,depthTexture:new Lo(u.textureWidth,u.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:m.stencil,colorSpace:t.outputColorSpace,samples:m.antialias?4:0});t.properties.get(g).__ignoreDepthValues=u.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(o),l=null,s=await i.requestReferenceSpace(a),U.setContext(i),U.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode};const C=new Rn,L=new Rn;function P(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCameraXR=function(t){if(null===i)return t;y&&(t=y),b.near=M.near=x.near=t.near,b.far=M.far=x.far=t.far,T===b.near&&E===b.far||(i.updateRenderState({depthNear:b.near,depthFar:b.far}),T=b.near,E=b.far);const e=t.parent,n=b.cameras;P(b,e);for(let t=0;t0&&(i.alphaTest.value=r.alphaTest);const s=e.get(r).envMap;if(s&&(i.envMap.value=s,i.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,i.reflectivity.value=r.reflectivity,i.ior.value=r.ior,i.refractionRatio.value=r.refractionRatio),r.lightMap){i.lightMap.value=r.lightMap;const e=!0===t.useLegacyLights?Math.PI:1;i.lightMapIntensity.value=r.lightMapIntensity*e,n(r.lightMap,i.lightMapTransform)}r.aoMap&&(i.aoMap.value=r.aoMap,i.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,i.aoMapTransform))}return{refreshFogUniforms:function(e,n){n.color.getRGB(e.fogColor.value,Br(t)),n.isFog?(e.fogNear.value=n.near,e.fogFar.value=n.far):n.isFogExp2&&(e.fogDensity.value=n.density)},refreshMaterialUniforms:function(t,r,s,a,o){r.isMeshBasicMaterial||r.isMeshLambertMaterial?i(t,r):r.isMeshToonMaterial?(i(t,r),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,r)):r.isMeshPhongMaterial?(i(t,r),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,r)):r.isMeshStandardMaterial?(i(t,r),function(t,i){t.metalness.value=i.metalness,i.metalnessMap&&(t.metalnessMap.value=i.metalnessMap,n(i.metalnessMap,t.metalnessMapTransform));t.roughness.value=i.roughness,i.roughnessMap&&(t.roughnessMap.value=i.roughnessMap,n(i.roughnessMap,t.roughnessMapTransform));const r=e.get(i).envMap;r&&(t.envMapIntensity.value=i.envMapIntensity)}(t,r),r.isMeshPhysicalMaterial&&function(t,e,i){t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap,n(e.sheenColorMap,t.sheenColorMapTransform)),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap,n(e.sheenRoughnessMap,t.sheenRoughnessMapTransform)));e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap,n(e.clearcoatMap,t.clearcoatMapTransform)),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap,n(e.clearcoatRoughnessMap,t.clearcoatRoughnessMapTransform)),e.clearcoatNormalMap&&(t.clearcoatNormalMap.value=e.clearcoatNormalMap,n(e.clearcoatNormalMap,t.clearcoatNormalMapTransform),t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),e.side===c&&t.clearcoatNormalScale.value.negate()));e.iridescence>0&&(t.iridescence.value=e.iridescence,t.iridescenceIOR.value=e.iridescenceIOR,t.iridescenceThicknessMinimum.value=e.iridescenceThicknessRange[0],t.iridescenceThicknessMaximum.value=e.iridescenceThicknessRange[1],e.iridescenceMap&&(t.iridescenceMap.value=e.iridescenceMap,n(e.iridescenceMap,t.iridescenceMapTransform)),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap,n(e.iridescenceThicknessMap,t.iridescenceThicknessMapTransform)));e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=i.texture,t.transmissionSamplerSize.value.set(i.width,i.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap,n(e.transmissionMap,t.transmissionMapTransform)),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap,n(e.thicknessMap,t.thicknessMapTransform)),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor));e.anisotropy>0&&(t.anisotropyVector.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation)),e.anisotropyMap&&(t.anisotropyMap.value=e.anisotropyMap,n(e.anisotropyMap,t.anisotropyMapTransform)));t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap,n(e.specularColorMap,t.specularColorMapTransform));e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap,n(e.specularIntensityMap,t.specularIntensityMapTransform))}(t,r,o)):r.isMeshMatcapMaterial?(i(t,r),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,r)):r.isMeshDepthMaterial?i(t,r):r.isMeshDistanceMaterial?(i(t,r),function(t,n){const i=e.get(n).light;t.referencePosition.value.setFromMatrixPosition(i.matrixWorld),t.nearDistance.value=i.shadow.camera.near,t.farDistance.value=i.shadow.camera.far}(t,r)):r.isMeshNormalMaterial?i(t,r):r.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform))}(t,r),r.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,r)):r.isPointsMaterial?function(t,e,i,r){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*r,e.map&&(t.map.value=e.map,n(e.map,t.uvTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,r,s,a):r.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,r):r.isShadowMaterial?(t.color.value.copy(r.color),t.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function Uo(t,e,n,i){let r={},s={},a=[];const o=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(t,e,n){const i=t.value;if(void 0===n[e]){if("number"==typeof i)n[e]=i;else{const t=Array.isArray(i)?i:[i],r=[];for(let e=0;e0){r=n%i;0!==r&&i-r-a.boundary<0&&(n+=i-r,s.__offset=n)}n+=a.storage}r=n%i,r>0&&(n+=i-r);t.__size=n,t.__cache={}}(n),d=function(e){const n=function(){for(let t=0;t0),u=!!n.morphAttributes.position,d=!!n.morphAttributes.normal,p=!!n.morphAttributes.color,m=i.toneMapped?S.toneMapping:W,f=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,g=void 0!==f?f.length:0,v=nt.get(i),_=y.state.lights;if(!0===V&&(!0===X||t!==R)){const e=t===R&&i.id===A;St.setState(i,t,e)}let x=!1;i.version===v.__version?v.needsLights&&v.lightsStateVersion!==_.state.version||v.outputColorSpace!==o||r.isInstancedMesh&&!1===v.instancing?x=!0:r.isInstancedMesh||!0!==v.instancing?r.isSkinnedMesh&&!1===v.skinning?x=!0:r.isSkinnedMesh||!0!==v.skinning?v.envMap!==l||!0===i.fog&&v.fog!==s?x=!0:void 0===v.numClippingPlanes||v.numClippingPlanes===St.numPlanes&&v.numIntersection===St.numIntersection?(v.vertexAlphas!==c||v.vertexTangents!==h||v.morphTargets!==u||v.morphNormals!==d||v.morphColors!==p||v.toneMapping!==m||!0===Q.isWebGL2&&v.morphTargetsCount!==g)&&(x=!0):x=!0:x=!0:x=!0:(x=!0,v.__version=i.version);let M=v.currentProgram;!0===x&&(M=Kt(i,e,r));let b=!1,T=!1,E=!1;const C=M.getUniforms(),L=v.uniforms;tt.useProgram(M.program)&&(b=!0,T=!0,E=!0);i.id!==A&&(A=i.id,T=!0);if(b||R!==t){if(C.setValue(Nt,"projectionMatrix",t.projectionMatrix),Q.logarithmicDepthBuffer&&C.setValue(Nt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),R!==t&&(R=t,T=!0,E=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshStandardMaterial||i.envMap){const e=C.map.cameraPosition;void 0!==e&&e.setValue(Nt,Z.setFromMatrixPosition(t.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&C.setValue(Nt,"isOrthographic",!0===t.isOrthographicCamera),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.isShadowMaterial||r.isSkinnedMesh)&&C.setValue(Nt,"viewMatrix",t.matrixWorldInverse)}if(r.isSkinnedMesh){C.setOptional(Nt,r,"bindMatrix"),C.setOptional(Nt,r,"bindMatrixInverse");const t=r.skeleton;t&&(Q.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),C.setValue(Nt,"boneTexture",t.boneTexture,it),C.setValue(Nt,"boneTextureSize",t.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const P=n.morphAttributes;(void 0!==P.position||void 0!==P.normal||void 0!==P.color&&!0===Q.isWebGL2)&&wt.update(r,n,M);(T||v.receiveShadow!==r.receiveShadow)&&(v.receiveShadow=r.receiveShadow,C.setValue(Nt,"receiveShadow",r.receiveShadow));i.isMeshGouraudMaterial&&null!==i.envMap&&(L.envMap.value=l,L.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);T&&(C.setValue(Nt,"toneMappingExposure",S.toneMappingExposure),v.needsLights&&(U=E,(I=L).ambientLightColor.needsUpdate=U,I.lightProbe.needsUpdate=U,I.directionalLights.needsUpdate=U,I.directionalLightShadows.needsUpdate=U,I.pointLights.needsUpdate=U,I.pointLightShadows.needsUpdate=U,I.spotLights.needsUpdate=U,I.spotLightShadows.needsUpdate=U,I.rectAreaLights.needsUpdate=U,I.hemisphereLights.needsUpdate=U),s&&!0===i.fog&&dt.refreshFogUniforms(L,s),dt.refreshMaterialUniforms(L,i,O,N,j),Ha.upload(Nt,v.uniformsList,L,it));var I,U;i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(Ha.upload(Nt,v.uniformsList,L,it),i.uniformsNeedUpdate=!1);i.isSpriteMaterial&&C.setValue(Nt,"center",r.center);if(C.setValue(Nt,"modelViewMatrix",r.modelViewMatrix),C.setValue(Nt,"normalMatrix",r.normalMatrix),C.setValue(Nt,"modelMatrix",r.matrixWorld),i.isShaderMaterial||i.isRawShaderMaterial){const t=i.uniformsGroups;for(let e=0,n=t.length;e0&&function(t,e,n,i){const r=Q.isWebGL2;null===j&&(j=new Tn(1,1,{generateMipmaps:!0,type:$.has("EXT_color_buffer_half_float")?_t:ut,minFilter:ht,samples:r&&!0===o?4:0}));S.getDrawingBufferSize(Y),r?j.setSize(Y.x,Y.y):j.setSize(Ze(Y.x),Ze(Y.y));const s=S.getRenderTarget();S.setRenderTarget(j),S.getClearColor(I),U=S.getClearAlpha(),U<1&&S.setClearColor(16777215,.5);S.clear();const a=S.toneMapping;S.toneMapping=W,Zt(t,n,i),it.updateMultisampleRenderTarget(j),it.updateRenderTargetMipmap(j);let l=!1;for(let t=0,r=e.length;t0&&Zt(r,e,n),s.length>0&&Zt(s,e,n),a.length>0&&Zt(a,e,n),tt.buffers.depth.setTest(!0),tt.buffers.depth.setMask(!0),tt.buffers.color.setMask(!0),tt.setPolygonOffset(!1)}function Zt(t,e,n){const i=!0===e.isScene?e.overrideMaterial:null;for(let r=0,s=t.length;r0?M[M.length-1]:null,x.pop(),_=x.length>0?x[x.length-1]:null},this.getActiveCubeFace=function(){return T},this.getActiveMipmapLevel=function(){return E},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(t,e,n){nt.get(t.texture).__webglTexture=e,nt.get(t.depthTexture).__webglTexture=n;const i=nt.get(t);i.__hasExternalTextures=!0,i.__hasExternalTextures&&(i.__autoAllocateDepthBuffer=void 0===n,i.__autoAllocateDepthBuffer||!0===$.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(t,e){const n=nt.get(t);n.__webglFramebuffer=e,n.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,n=0){w=t,T=e,E=n;let i=!0,r=null,s=!1,a=!1;if(t){const n=nt.get(t);void 0!==n.__useDefaultFramebuffer?(tt.bindFramebuffer(Nt.FRAMEBUFFER,null),i=!1):void 0===n.__webglFramebuffer?it.setupRenderTarget(t):n.__hasExternalTextures&&it.rebindTextures(t,nt.get(t.texture).__webglTexture,nt.get(t.depthTexture).__webglTexture);const o=t.texture;(o.isData3DTexture||o.isDataArrayTexture||o.isCompressedArrayTexture)&&(a=!0);const l=nt.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=l[e],s=!0):r=Q.isWebGL2&&t.samples>0&&!1===it.useMultisampledRTT(t)?nt.get(t).__webglMultisampledFramebuffer:l,C.copy(t.viewport),L.copy(t.scissor),P=t.scissorTest}else C.copy(z).multiplyScalar(O).floor(),L.copy(G).multiplyScalar(O).floor(),P=H;if(tt.bindFramebuffer(Nt.FRAMEBUFFER,r)&&Q.drawBuffers&&i&&tt.drawBuffers(t,r),tt.viewport(C),tt.scissor(L),tt.setScissorTest(P),s){const i=nt.get(t.texture);Nt.framebufferTexture2D(Nt.FRAMEBUFFER,Nt.COLOR_ATTACHMENT0,Nt.TEXTURE_CUBE_MAP_POSITIVE_X+e,i.__webglTexture,n)}else if(a){const i=nt.get(t.texture),r=e||0;Nt.framebufferTextureLayer(Nt.FRAMEBUFFER,Nt.COLOR_ATTACHMENT0,i.__webglTexture,n||0,r)}A=-1},this.readRenderTargetPixels=function(t,e,n,i,r,s,a){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=nt.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){tt.bindFramebuffer(Nt.FRAMEBUFFER,o);try{const a=t.texture,o=a.format,l=a.type;if(o!==bt&&Lt.convert(o)!==Nt.getParameter(Nt.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===_t&&($.has("EXT_color_buffer_half_float")||Q.isWebGL2&&$.has("EXT_color_buffer_float"));if(!(l===ut||Lt.convert(l)===Nt.getParameter(Nt.IMPLEMENTATION_COLOR_READ_TYPE)||l===vt&&(Q.isWebGL2||$.has("OES_texture_float")||$.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&Nt.readPixels(e,n,i,r,Lt.convert(o),Lt.convert(l),s)}finally{const t=null!==w?nt.get(w).__webglFramebuffer:null;tt.bindFramebuffer(Nt.FRAMEBUFFER,t)}}},this.copyFramebufferToTexture=function(t,e,n=0){const i=Math.pow(2,-n),r=Math.floor(e.image.width*i),s=Math.floor(e.image.height*i);it.setTexture2D(e,0),Nt.copyTexSubImage2D(Nt.TEXTURE_2D,n,0,0,t.x,t.y,r,s),tt.unbindTexture()},this.copyTextureToTexture=function(t,e,n,i=0){const r=e.image.width,s=e.image.height,a=Lt.convert(n.format),o=Lt.convert(n.type);it.setTexture2D(n,0),Nt.pixelStorei(Nt.UNPACK_FLIP_Y_WEBGL,n.flipY),Nt.pixelStorei(Nt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),Nt.pixelStorei(Nt.UNPACK_ALIGNMENT,n.unpackAlignment),e.isDataTexture?Nt.texSubImage2D(Nt.TEXTURE_2D,i,t.x,t.y,r,s,a,o,e.image.data):e.isCompressedTexture?Nt.compressedTexSubImage2D(Nt.TEXTURE_2D,i,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data):Nt.texSubImage2D(Nt.TEXTURE_2D,i,t.x,t.y,a,o,e.image),0===i&&n.generateMipmaps&&Nt.generateMipmap(Nt.TEXTURE_2D),tt.unbindTexture()},this.copyTextureToTexture3D=function(t,e,n,i,r=0){if(S.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=t.max.x-t.min.x+1,a=t.max.y-t.min.y+1,o=t.max.z-t.min.z+1,l=Lt.convert(i.format),c=Lt.convert(i.type);let h;if(i.isData3DTexture)it.setTexture3D(i,0),h=Nt.TEXTURE_3D;else{if(!i.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");it.setTexture2DArray(i,0),h=Nt.TEXTURE_2D_ARRAY}Nt.pixelStorei(Nt.UNPACK_FLIP_Y_WEBGL,i.flipY),Nt.pixelStorei(Nt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),Nt.pixelStorei(Nt.UNPACK_ALIGNMENT,i.unpackAlignment);const u=Nt.getParameter(Nt.UNPACK_ROW_LENGTH),d=Nt.getParameter(Nt.UNPACK_IMAGE_HEIGHT),p=Nt.getParameter(Nt.UNPACK_SKIP_PIXELS),m=Nt.getParameter(Nt.UNPACK_SKIP_ROWS),f=Nt.getParameter(Nt.UNPACK_SKIP_IMAGES),g=n.isCompressedTexture?n.mipmaps[0]:n.image;Nt.pixelStorei(Nt.UNPACK_ROW_LENGTH,g.width),Nt.pixelStorei(Nt.UNPACK_IMAGE_HEIGHT,g.height),Nt.pixelStorei(Nt.UNPACK_SKIP_PIXELS,t.min.x),Nt.pixelStorei(Nt.UNPACK_SKIP_ROWS,t.min.y),Nt.pixelStorei(Nt.UNPACK_SKIP_IMAGES,t.min.z),n.isDataTexture||n.isData3DTexture?Nt.texSubImage3D(h,r,e.x,e.y,e.z,s,a,o,l,c,g.data):n.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Nt.compressedTexSubImage3D(h,r,e.x,e.y,e.z,s,a,o,l,g.data)):Nt.texSubImage3D(h,r,e.x,e.y,e.z,s,a,o,l,c,g),Nt.pixelStorei(Nt.UNPACK_ROW_LENGTH,u),Nt.pixelStorei(Nt.UNPACK_IMAGE_HEIGHT,d),Nt.pixelStorei(Nt.UNPACK_SKIP_PIXELS,p),Nt.pixelStorei(Nt.UNPACK_SKIP_ROWS,m),Nt.pixelStorei(Nt.UNPACK_SKIP_IMAGES,f),0===r&&i.generateMipmaps&&Nt.generateMipmap(h),tt.unbindTexture()},this.initTexture=function(t){t.isCubeTexture?it.setTextureCube(t,0):t.isData3DTexture?it.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?it.setTexture2DArray(t,0):it.setTexture2D(t,0),tt.unbindTexture()},this.resetState=function(){T=0,E=0,w=null,tt.reset(),Ut.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(t){console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!t}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===be?_e:ve}set outputEncoding(t){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=t===_e?be:Te}}class Oo extends No{}Oo.prototype.isWebGL1Renderer=!0;class Fo{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new Yi(t),this.density=e}clone(){return new Fo(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Bo{constructor(t,e=1,n=1e3){this.isFog=!0,this.name="",this.color=new Yi(t),this.near=e,this.far=n}clone(){return new Bo(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class zo extends Ci{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(t){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=t}}class Go{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=Ne,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Ve()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let i=0,r=this.stride;it.far||e.push({distance:o,point:Xo.clone(),uv:Hi.getInterpolation(Xo,Ko,$o,Qo,tl,el,nl,new Qe),face:null,object:this})}copy(t,e){return super.copy(t,e),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function rl(t,e,n,i,r,s){Yo.subVectors(t,n).addScalar(.5).multiply(i),void 0!==r?(Zo.x=s*Yo.x-r*Yo.y,Zo.y=r*Yo.x+s*Yo.y):Zo.copy(Yo),t.copy(e),t.x+=Zo.x,t.y+=Zo.y,t.applyMatrix4(Jo)}const sl=new Rn,al=new Rn;class ol extends Ci{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let t=0,n=e.length;t0){let n,i;for(n=1,i=e.length;n0){sl.setFromMatrixPosition(this.matrixWorld);const n=t.ray.origin.distanceTo(sl);this.getObjectForDistance(n).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){sl.setFromMatrixPosition(t.matrixWorld),al.setFromMatrixPosition(this.matrixWorld);const n=sl.distanceTo(al)/t.zoom;let i,r;for(e[0].object.visible=!0,i=1,r=e.length;i=t))break;e[i-1].object.visible=!1,e[i].object.visible=!0}for(this._currentLevel=i-1;io)continue;u.applyMatrix4(this.matrixWorld);const s=t.ray.origin.distanceTo(u);st.far||e.push({distance:s,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else{for(let n=Math.max(0,s.start),i=Math.min(m.count,s.start+s.count)-1;no)continue;u.applyMatrix4(this.matrixWorld);const i=t.ray.origin.distanceTo(u);it.far||e.push({distance:i,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;tr.far)return;s.push({distance:l,distanceToRay:Math.sqrt(o),point:n,index:e,face:null,object:a})}}class Jl extends Sn{constructor(t,e,n,i,r,s,a,o,l,c,h,u){super(null,s,a,o,l,c,i,r,h,u),this.isCompressedTexture=!0,this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class Kl{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,i=this.getPoint(0),r=0;e.push(0);for(let s=1;s<=t;s++)n=this.getPoint(s/t),r+=n.distanceTo(i),e.push(r),i=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let i=0;const r=n.length;let s;s=e||t*n[r-1];let a,o=0,l=r-1;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),a=n[i]-s,a<0)o=i+1;else{if(!(a>0)){l=i;break}l=i-1}if(i=l,n[i]===s)return i/(r-1);const c=n[i];return(i+(s-c)/(n[i+1]-c))/(r-1)}getTangent(t,e){const n=1e-4;let i=t-n,r=t+n;i<0&&(i=0),r>1&&(r=1);const s=this.getPoint(i),a=this.getPoint(r),o=e||(s.isVector2?new Qe:new Rn);return o.copy(a).sub(s).normalize(),o}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new Rn,i=[],r=[],s=[],a=new Rn,o=new ri;for(let e=0;e<=t;e++){const n=e/t;i[e]=this.getTangentAt(n,new Rn)}r[0]=new Rn,s[0]=new Rn;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),h=Math.abs(i[0].y),u=Math.abs(i[0].z);c<=l&&(l=c,n.set(1,0,0)),h<=l&&(l=h,n.set(0,1,0)),u<=l&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],a),s[0].crossVectors(i[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),s[e]=s[e-1].clone(),a.crossVectors(i[e-1],i[e]),a.length()>Number.EPSILON){a.normalize();const t=Math.acos(We(i[e-1].dot(i[e]),-1,1));r[e].applyMatrix4(o.makeRotationAxis(a,t))}s[e].crossVectors(i[e],r[e])}if(!0===e){let e=Math.acos(We(r[0].dot(r[t]),-1,1));e/=t,i[0].dot(a.crossVectors(r[0],r[t]))>0&&(e=-e);for(let n=1;n<=t;n++)r[n].applyMatrix4(o.makeRotationAxis(i[n],e*n)),s[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class $l extends Kl{constructor(t=0,e=0,n=1,i=1,r=0,s=2*Math.PI,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=a,this.aRotation=o}getPoint(t,e){const n=e||new Qe,i=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)i;)r-=i;r0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===c&&l===r-1&&(l=r-2,c=1),this.closed||l>0?a=i[(l-1)%r]:(ec.subVectors(i[0],i[1]).add(i[0]),a=ec);const h=i[l%r],u=i[(l+1)%r];if(this.closed||l+2i.length-2?i.length-1:s+1],h=i[s>i.length-3?i.length-1:s+2];return n.set(ac(a,o.x,l.x,c.x,h.x),ac(a,o.y,l.y,c.y,h.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e=n){const t=i[r]-n,s=this.curves[r],a=s.getLength(),o=0===a?0:1-t/a;return s.getPointAt(o,e)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,i=this.curves.length;n1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class yc extends fr{constructor(t=[new Qe(0,-.5),new Qe(.5,0),new Qe(0,.5)],e=12,n=0,i=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},e=Math.floor(e),i=We(i,0,2*Math.PI);const r=[],s=[],a=[],o=[],l=[],c=1/e,h=new Rn,u=new Qe,d=new Rn,p=new Rn,m=new Rn;let f=0,g=0;for(let e=0;e<=t.length-1;e++)switch(e){case 0:f=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-f,d.z=0*g,m.copy(d),d.normalize(),o.push(d.x,d.y,d.z);break;case t.length-1:o.push(m.x,m.y,m.z);break;default:f=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-f,d.z=0*g,p.copy(d),d.x+=m.x,d.y+=m.y,d.z+=m.z,d.normalize(),o.push(d.x,d.y,d.z),m.copy(p)}for(let r=0;r<=e;r++){const d=n+r*c*i,p=Math.sin(d),m=Math.cos(d);for(let n=0;n<=t.length-1;n++){h.x=t[n].x*p,h.y=t[n].y,h.z=t[n].x*m,s.push(h.x,h.y,h.z),u.x=r/e,u.y=n/(t.length-1),a.push(u.x,u.y);const i=o[3*n+0]*p,c=o[3*n+1],d=o[3*n+0]*m;l.push(i,c,d)}}for(let n=0;n0&&v(!0),e>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new or(h,3)),this.setAttribute("normal",new or(u,3)),this.setAttribute("uv",new or(d,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Sc(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class bc extends Sc{constructor(t=1,e=1,n=32,i=1,r=!1,s=0,a=2*Math.PI){super(0,t,e,n,i,r,s,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:s,thetaLength:a}}static fromJSON(t){return new bc(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Tc extends fr{constructor(t=[],e=[],n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i};const r=[],s=[];function a(t,e,n,i){const r=i+1,s=[];for(let i=0;i<=r;i++){s[i]=[];const a=t.clone().lerp(n,i/r),o=e.clone().lerp(n,i/r),l=r-i;for(let t=0;t<=l;t++)s[i][t]=0===t&&i===r?a:a.clone().lerp(o,t/l)}for(let t=0;t.9&&a<.1&&(e<.2&&(s[t+0]+=1),n<.2&&(s[t+2]+=1),i<.2&&(s[t+4]+=1))}}()}(),this.setAttribute("position",new or(r,3)),this.setAttribute("normal",new or(r.slice(),3)),this.setAttribute("uv",new or(s,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Tc(t.vertices,t.indices,t.radius,t.details)}}class Ec extends Tc{constructor(t=1,e=0){const n=(1+Math.sqrt(5))/2,i=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Ec(t.radius,t.detail)}}const wc=new Rn,Ac=new Rn,Rc=new Rn,Cc=new Hi;class Lc extends fr{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},null!==t){const n=4,i=Math.pow(10,n),r=Math.cos(He*e),s=t.getIndex(),a=t.getAttribute("position"),o=s?s.count:a.count,l=[0,0,0],c=["a","b","c"],h=new Array(3),u={},d=[];for(let t=0;t80*n){o=c=t[0],l=h=t[1];for(let e=n;ec&&(c=u),d>h&&(h=d);p=Math.max(c-o,h-l),p=0!==p?32767/p:0}return Nc(s,a,n,o,l,p,0),a};function Uc(t,e,n,i,r){let s,a;if(r===function(t,e,n,i){let r=0;for(let s=e,a=n-i;s0)for(s=e;s=e;s-=i)a=th(s,t[s],t[s+1],a);return a&&Yc(a,a.next)&&(eh(a),a=a.next),a}function Dc(t,e){if(!t)return t;e||(e=t);let n,i=t;do{if(n=!1,i.steiner||!Yc(i,i.next)&&0!==qc(i.prev,i,i.next))i=i.next;else{if(eh(i),i=e=i.prev,i===i.next)break;n=!0}}while(n||i!==e);return e}function Nc(t,e,n,i,r,s,a){if(!t)return;!a&&s&&function(t,e,n,i){let r=t;do{0===r.z&&(r.z=Vc(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,n,i,r,s,a,o,l,c=1;do{for(n=t,t=null,s=null,a=0;n;){for(a++,i=n,o=0,e=0;e0||l>0&&i;)0!==o&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,o--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;n=i}s.nextZ=null,c*=2}while(a>1)}(r)}(t,i,r,s);let o,l,c=t;for(;t.prev!==t.next;)if(o=t.prev,l=t.next,s?Fc(t,i,r,s):Oc(t))e.push(o.i/n|0),e.push(t.i/n|0),e.push(l.i/n|0),eh(t),t=l.next,c=l.next;else if((t=l)===c){a?1===a?Nc(t=Bc(Dc(t),e,n),e,n,i,r,s,2):2===a&&zc(t,e,n,i,r,s):Nc(Dc(t),e,n,i,r,s,1);break}}function Oc(t){const e=t.prev,n=t,i=t.next;if(qc(e,n,i)>=0)return!1;const r=e.x,s=n.x,a=i.x,o=e.y,l=n.y,c=i.y,h=rs?r>a?r:a:s>a?s:a,p=o>l?o>c?o:c:l>c?l:c;let m=i.next;for(;m!==e;){if(m.x>=h&&m.x<=d&&m.y>=u&&m.y<=p&&Xc(r,o,s,l,a,c,m.x,m.y)&&qc(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Fc(t,e,n,i){const r=t.prev,s=t,a=t.next;if(qc(r,s,a)>=0)return!1;const o=r.x,l=s.x,c=a.x,h=r.y,u=s.y,d=a.y,p=ol?o>c?o:c:l>c?l:c,g=h>u?h>d?h:d:u>d?u:d,v=Vc(p,m,e,n,i),_=Vc(f,g,e,n,i);let y=t.prevZ,x=t.nextZ;for(;y&&y.z>=v&&x&&x.z<=_;){if(y.x>=p&&y.x<=f&&y.y>=m&&y.y<=g&&y!==r&&y!==a&&Xc(o,h,l,u,c,d,y.x,y.y)&&qc(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,x.x>=p&&x.x<=f&&x.y>=m&&x.y<=g&&x!==r&&x!==a&&Xc(o,h,l,u,c,d,x.x,x.y)&&qc(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;y&&y.z>=v;){if(y.x>=p&&y.x<=f&&y.y>=m&&y.y<=g&&y!==r&&y!==a&&Xc(o,h,l,u,c,d,y.x,y.y)&&qc(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;x&&x.z<=_;){if(x.x>=p&&x.x<=f&&x.y>=m&&x.y<=g&&x!==r&&x!==a&&Xc(o,h,l,u,c,d,x.x,x.y)&&qc(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Bc(t,e,n){let i=t;do{const r=i.prev,s=i.next.next;!Yc(r,s)&&Zc(r,i,i.next,s)&&$c(r,s)&&$c(s,r)&&(e.push(r.i/n|0),e.push(i.i/n|0),e.push(s.i/n|0),eh(i),eh(i.next),i=t=s),i=i.next}while(i!==t);return Dc(i)}function zc(t,e,n,i,r,s){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&jc(a,t)){let o=Qc(a,t);return a=Dc(a,a.next),o=Dc(o,o.next),Nc(a,e,n,i,r,s,0),void Nc(o,e,n,i,r,s,0)}t=t.next}a=a.next}while(a!==t)}function Gc(t,e){return t.x-e.x}function Hc(t,e){const n=function(t,e){let n,i=e,r=-1/0;const s=t.x,a=t.y;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){const t=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=s&&t>r&&(r=t,n=i.x=i.x&&i.x>=l&&s!==i.x&&Xc(an.x||i.x===n.x&&kc(n,i)))&&(n=i,u=h)),i=i.next}while(i!==o);return n}(t,e);if(!n)return e;const i=Qc(n,t);return Dc(i,i.next),Dc(n,n.next)}function kc(t,e){return qc(t.prev,t,e.prev)<0&&qc(e.next,t,t.next)<0}function Vc(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Wc(t){let e=t,n=t;do{(e.x=(t-a)*(s-o)&&(t-a)*(i-o)>=(n-a)*(e-o)&&(n-a)*(s-o)>=(r-a)*(i-o)}function jc(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Zc(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&($c(t,e)&&$c(e,t)&&function(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(qc(t.prev,t,e.prev)||qc(t,e.prev,e))||Yc(t,e)&&qc(t.prev,t,t.next)>0&&qc(e.prev,e,e.next)>0)}function qc(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Yc(t,e){return t.x===e.x&&t.y===e.y}function Zc(t,e,n,i){const r=Kc(qc(t,e,n)),s=Kc(qc(t,e,i)),a=Kc(qc(n,i,t)),o=Kc(qc(n,i,e));return r!==s&&a!==o||(!(0!==r||!Jc(t,n,e))||(!(0!==s||!Jc(t,i,e))||(!(0!==a||!Jc(n,t,i))||!(0!==o||!Jc(n,e,i)))))}function Jc(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Kc(t){return t>0?1:t<0?-1:0}function $c(t,e){return qc(t.prev,t,t.next)<0?qc(t,e,t.next)>=0&&qc(t,t.prev,e)>=0:qc(t,e,t.prev)<0||qc(t,t.next,e)<0}function Qc(t,e){const n=new nh(t.i,t.x,t.y),i=new nh(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function th(t,e,n,i){const r=new nh(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function eh(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function nh(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class ih{static area(t){const e=t.length;let n=0;for(let i=e-1,r=0;r2&&t[e-1].equals(t[0])&&t.pop()}function sh(t,e){for(let n=0;nNumber.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),p=e.x-o/u,m=e.y+a/u,f=((n.x-c/d-p)*c-(n.y+l/d-m)*l)/(a*c-o*l);i=p+a*f-t.x,r=m+o*f-t.y;const g=i*i+r*r;if(g<=2)return new Qe(i,r);s=Math.sqrt(g/2)}else{let t=!1;a>Number.EPSILON?l>Number.EPSILON&&(t=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(o)===Math.sign(c)&&(t=!0),t?(i=-o,r=a,s=Math.sqrt(h)):(i=a,r=o,s=Math.sqrt(h/2))}return new Qe(i/s,r/s)}const P=[];for(let t=0,e=w.length,n=e-1,i=t+1;t=0;t--){const e=t/p,n=h*Math.cos(e*Math.PI/2),i=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=w.length;t=0;){const i=n;let r=n-1;r<0&&(r=t.length-1);for(let t=0,n=o+2*p;t0)&&d.push(e,r,l),(t!==n-1||o0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class Th extends Vi{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Yi(16777215),this.specular=new Yi(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Yi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xe,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=H,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Eh extends Vi{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Yi(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Yi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xe,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class wh extends Vi{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xe,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class Ah extends Vi{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Yi(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Yi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xe,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=H,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Rh extends Vi{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Yi(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xe,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Ch extends Il{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}function Lh(t,e,n){return Ih(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)}function Ph(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)}function Ih(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Uh(t){const e=t.length,n=new Array(e);for(let t=0;t!==e;++t)n[t]=t;return n.sort((function(e,n){return t[e]-t[n]})),n}function Dh(t,e,n){const i=t.length,r=new t.constructor(i);for(let s=0,a=0;a!==i;++s){const i=n[s]*e;for(let n=0;n!==e;++n)r[a++]=t[i+n]}return r}function Nh(t,e,n,i){let r=1,s=t[0];for(;void 0!==s&&void 0===s[i];)s=t[r++];if(void 0===s)return;let a=s[i];if(void 0!==a)if(Array.isArray(a))do{a=s[i],void 0!==a&&(e.push(s.time),n.push.apply(n,a)),s=t[r++]}while(void 0!==s);else if(void 0!==a.toArray)do{a=s[i],void 0!==a&&(e.push(s.time),a.toArray(n,n.length)),s=t[r++]}while(void 0!==s);else do{a=s[i],void 0!==a&&(e.push(s.time),n.push(a)),s=t[r++]}while(void 0!==s)}const Oh={arraySlice:Lh,convertArray:Ph,isTypedArray:Ih,getKeyframeOrder:Uh,sortedArray:Dh,flattenJSON:Nh,subclip:function(t,e,n,i,r=30){const s=t.clone();s.name=e;const a=[];for(let t=0;t=i)){l.push(e.times[t]);for(let n=0;ns.tracks[t].times[0]&&(o=s.tracks[t].times[0]);for(let t=0;t=i.times[u]){const t=u*l+o,e=t+l-o;d=Lh(i.values,t,e)}else{const t=i.createInterpolant(),e=o,n=l-o;t.evaluate(s),d=Lh(t.resultBuffer,e,n)}if("quaternion"===r){(new An).fromArray(d).normalize().conjugate().toArray(d)}const p=a.times.length;for(let t=0;t=r)break t;{const a=e[1];t=r)break e}s=n,n=0}}for(;n>>1;te;)--s;if(++s,0!==r||s!==i){r>=s&&(s=Math.max(s,1),r=s-1);const t=this.getValueSize();this.times=Lh(n,r,s),this.values=Lh(this.values,r*t,s*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==r;e++){const i=n[e];if("number"==typeof i&&isNaN(i)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,i),t=!1;break}if(null!==s&&s>i){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,i,s),t=!1;break}s=i}if(void 0!==i&&Ih(i))for(let e=0,n=i.length;e!==n;++e){const n=i[e];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,n),t=!1;break}}return t}optimize(){const t=Lh(this.times),e=Lh(this.values),n=this.getValueSize(),i=this.getInterpolation()===ue,r=t.length-1;let s=1;for(let a=1;a0){t[s]=t[r];for(let t=r*n,i=s*n,a=0;a!==n;++a)e[i+a]=e[t+a];++s}return s!==t.length?(this.times=Lh(t,0,s),this.values=Lh(e,0,s*n)):(this.times=t,this.values=e),this}clone(){const t=Lh(this.times,0),e=Lh(this.values,0),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}Hh.prototype.TimeBufferType=Float32Array,Hh.prototype.ValueBufferType=Float32Array,Hh.prototype.DefaultInterpolation=he;class kh extends Hh{}kh.prototype.ValueTypeName="bool",kh.prototype.ValueBufferType=Array,kh.prototype.DefaultInterpolation=ce,kh.prototype.InterpolantFactoryMethodLinear=void 0,kh.prototype.InterpolantFactoryMethodSmooth=void 0;class Vh extends Hh{}Vh.prototype.ValueTypeName="color";class Wh extends Hh{}Wh.prototype.ValueTypeName="number";class Xh extends Fh{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){const r=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=(n-e)/(i-e);let l=t*a;for(let t=l+a;l!==t;l+=4)An.slerpFlat(r,0,s,l-a,s,l,o);return r}}class jh extends Hh{InterpolantFactoryMethodLinear(t){return new Xh(this.times,this.values,this.getValueSize(),t)}}jh.prototype.ValueTypeName="quaternion",jh.prototype.DefaultInterpolation=he,jh.prototype.InterpolantFactoryMethodSmooth=void 0;class qh extends Hh{}qh.prototype.ValueTypeName="string",qh.prototype.ValueBufferType=Array,qh.prototype.DefaultInterpolation=ce,qh.prototype.InterpolantFactoryMethodLinear=void 0,qh.prototype.InterpolantFactoryMethodSmooth=void 0;class Yh extends Hh{}Yh.prototype.ValueTypeName="vector";class Zh{constructor(t,e=-1,n,i=2500){this.name=t,this.tracks=n,this.duration=e,this.blendMode=i,this.uuid=Ve(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],n=t.tracks,i=1/(t.fps||1);for(let t=0,r=n.length;t!==r;++t)e.push(Jh(n[t]).scale(i));const r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(t){const e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,i=n.length;t!==i;++t)e.push(Hh.toJSON(n[t]));return i}static CreateFromMorphTargetSequence(t,e,n,i){const r=e.length,s=[];for(let t=0;t1){const t=s[1];let e=i[t];e||(i[t]=e=[]),e.push(n)}}const s=[];for(const t in i)s.push(this.CreateFromMorphTargetSequence(t,i[t],e,n));return s}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(t,e,n,i,r){if(0!==n.length){const s=[],a=[];Nh(n,s,a,i),0!==s.length&&r.push(new t(e,s,a))}},i=[],r=t.name||"default",s=t.fps||30,a=t.blendMode;let o=t.length||-1;const l=t.hierarchy||[];for(let t=0;t{e&&e(r),this.manager.itemEnd(t)}),0),r;if(void 0!==eu[t])return void eu[t].push({onLoad:e,onProgress:n,onError:i});eu[t]=[],eu[t].push({onLoad:e,onProgress:n,onError:i});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,o=this.responseType;fetch(s).then((e=>{if(200===e.status||0===e.status){if(0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const n=eu[t],i=e.body.getReader(),r=e.headers.get("Content-Length")||e.headers.get("X-File-Size"),s=r?parseInt(r):0,a=0!==s;let o=0;const l=new ReadableStream({start(t){!function e(){i.read().then((({done:i,value:r})=>{if(i)t.close();else{o+=r.byteLength;const i=new ProgressEvent("progress",{lengthComputable:a,loaded:o,total:s});for(let t=0,e=n.length;t{switch(o){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then((t=>(new DOMParser).parseFromString(t,a)));case"json":return t.json();default:if(void 0===a)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(a),n=e&&e[1]?e[1].toLowerCase():void 0,i=new TextDecoder(n);return t.arrayBuffer().then((t=>i.decode(t)))}}})).then((e=>{Kh.add(t,e);const n=eu[t];delete eu[t];for(let t=0,i=n.length;t{const n=eu[t];if(void 0===n)throw this.manager.itemError(t),e;delete eu[t];for(let t=0,i=n.length;t{this.manager.itemEnd(t)})),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class ru extends tu{constructor(t){super(t)}load(t,e,n,i){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,s=Kh.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout((function(){e&&e(s),r.manager.itemEnd(t)}),0),s;const a=an("img");function o(){c(),Kh.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){c(),i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)}function c(){a.removeEventListener("load",o,!1),a.removeEventListener("error",l,!1)}return a.addEventListener("load",o,!1),a.addEventListener("error",l,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(t),a.src=t,a}}class su extends Ci{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new Yi(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}class au extends su{constructor(t,e,n){super(t,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Ci.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Yi(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}}const ou=new ri,lu=new Rn,cu=new Rn;class hu{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Qe(512,512),this.map=null,this.mapPass=null,this.matrix=new ri,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Qr,this._frameExtents=new Qe(1,1),this._viewportCount=1,this._viewports=[new bn(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;lu.setFromMatrixPosition(t.matrixWorld),e.position.copy(lu),cu.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(cu),e.updateMatrixWorld(),ou.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ou),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(ou)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class uu extends hu{constructor(){super(new kr(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(t){const e=this.camera,n=2*ke*t.angle*this.focus,i=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;n===e.fov&&i===e.aspect&&r===e.far||(e.fov=n,e.aspect=i,e.far=r,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}class du extends su{constructor(t,e,n=0,i=Math.PI/3,r=0,s=2){super(t,e),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Ci.DEFAULT_UP),this.updateMatrix(),this.target=new Ci,this.distance=n,this.angle=i,this.penumbra=r,this.decay=s,this.map=null,this.shadow=new uu}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}const pu=new ri,mu=new Rn,fu=new Rn;class gu extends hu{constructor(){super(new kr(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Qe(4,2),this._viewportCount=6,this._viewports=[new bn(2,1,1,1),new bn(0,1,1,1),new bn(3,1,1,1),new bn(1,1,1,1),new bn(3,0,1,1),new bn(1,0,1,1)],this._cubeDirections=[new Rn(1,0,0),new Rn(-1,0,0),new Rn(0,0,1),new Rn(0,0,-1),new Rn(0,1,0),new Rn(0,-1,0)],this._cubeUps=[new Rn(0,1,0),new Rn(0,1,0),new Rn(0,1,0),new Rn(0,1,0),new Rn(0,0,1),new Rn(0,0,-1)]}updateMatrices(t,e=0){const n=this.camera,i=this.matrix,r=t.distance||n.far;r!==n.far&&(n.far=r,n.updateProjectionMatrix()),mu.setFromMatrixPosition(t.matrixWorld),n.position.copy(mu),fu.copy(n.position),fu.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(fu),n.updateMatrixWorld(),i.makeTranslation(-mu.x,-mu.y,-mu.z),pu.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(pu)}}class vu extends su{constructor(t,e,n=0,i=2){super(t,e),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new gu}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}class _u extends hu{constructor(){super(new ps(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class yu extends su{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Ci.DEFAULT_UP),this.updateMatrix(),this.target=new Ci,this.shadow=new _u}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}class xu extends su{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}}class Mu extends su{constructor(t,e,n=10,i=10){super(t,e),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(t){this.intensity=t/(this.width*this.height*Math.PI)}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){const e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}}class Su{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new Rn)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){const n=t.x,i=t.y,r=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.282095),e.addScaledVector(s[1],.488603*i),e.addScaledVector(s[2],.488603*r),e.addScaledVector(s[3],.488603*n),e.addScaledVector(s[4],n*i*1.092548),e.addScaledVector(s[5],i*r*1.092548),e.addScaledVector(s[6],.315392*(3*r*r-1)),e.addScaledVector(s[7],n*r*1.092548),e.addScaledVector(s[8],.546274*(n*n-i*i)),e}getIrradianceAt(t,e){const n=t.x,i=t.y,r=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.886227),e.addScaledVector(s[1],1.023328*i),e.addScaledVector(s[2],1.023328*r),e.addScaledVector(s[3],1.023328*n),e.addScaledVector(s[4],.858086*n*i),e.addScaledVector(s[5],.858086*i*r),e.addScaledVector(s[6],.743125*r*r-.247708),e.addScaledVector(s[7],.858086*n*r),e.addScaledVector(s[8],.429043*(n*n-i*i)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(t.coefficients[n],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].fromArray(t,e+3*i);return this}toArray(t=[],e=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].toArray(t,e+3*i);return t}static getBasisAt(t,e){const n=t.x,i=t.y,r=t.z;e[0]=.282095,e[1]=.488603*i,e[2]=.488603*r,e[3]=.488603*n,e[4]=1.092548*n*i,e[5]=1.092548*i*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*n*r,e[8]=.546274*(n*n-i*i)}}class bu extends su{constructor(t=new Su,e=1){super(void 0,e),this.isLightProbe=!0,this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}fromJSON(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this}toJSON(t){const e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}}class Tu extends tu{constructor(t){super(t),this.textures={}}load(t,e,n,i){const r=this,s=new iu(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(t,(function(n){try{e(r.parse(JSON.parse(n)))}catch(e){i?i(e):console.error(e),r.manager.itemError(t)}}),n,i)}parse(t){const e=this.textures;function n(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}const i=Tu.createMaterialFromType(t.type);if(void 0!==t.uuid&&(i.uuid=t.uuid),void 0!==t.name&&(i.name=t.name),void 0!==t.color&&void 0!==i.color&&i.color.setHex(t.color),void 0!==t.roughness&&(i.roughness=t.roughness),void 0!==t.metalness&&(i.metalness=t.metalness),void 0!==t.sheen&&(i.sheen=t.sheen),void 0!==t.sheenColor&&(i.sheenColor=(new Yi).setHex(t.sheenColor)),void 0!==t.sheenRoughness&&(i.sheenRoughness=t.sheenRoughness),void 0!==t.emissive&&void 0!==i.emissive&&i.emissive.setHex(t.emissive),void 0!==t.specular&&void 0!==i.specular&&i.specular.setHex(t.specular),void 0!==t.specularIntensity&&(i.specularIntensity=t.specularIntensity),void 0!==t.specularColor&&void 0!==i.specularColor&&i.specularColor.setHex(t.specularColor),void 0!==t.shininess&&(i.shininess=t.shininess),void 0!==t.clearcoat&&(i.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(i.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.iridescence&&(i.iridescence=t.iridescence),void 0!==t.iridescenceIOR&&(i.iridescenceIOR=t.iridescenceIOR),void 0!==t.iridescenceThicknessRange&&(i.iridescenceThicknessRange=t.iridescenceThicknessRange),void 0!==t.transmission&&(i.transmission=t.transmission),void 0!==t.thickness&&(i.thickness=t.thickness),void 0!==t.attenuationDistance&&(i.attenuationDistance=t.attenuationDistance),void 0!==t.attenuationColor&&void 0!==i.attenuationColor&&i.attenuationColor.setHex(t.attenuationColor),void 0!==t.anisotropy&&(i.anisotropy=t.anisotropy),void 0!==t.anisotropyRotation&&(i.anisotropyRotation=t.anisotropyRotation),void 0!==t.fog&&(i.fog=t.fog),void 0!==t.flatShading&&(i.flatShading=t.flatShading),void 0!==t.blending&&(i.blending=t.blending),void 0!==t.combine&&(i.combine=t.combine),void 0!==t.side&&(i.side=t.side),void 0!==t.shadowSide&&(i.shadowSide=t.shadowSide),void 0!==t.opacity&&(i.opacity=t.opacity),void 0!==t.transparent&&(i.transparent=t.transparent),void 0!==t.alphaTest&&(i.alphaTest=t.alphaTest),void 0!==t.depthTest&&(i.depthTest=t.depthTest),void 0!==t.depthWrite&&(i.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(i.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(i.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(i.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(i.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(i.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(i.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(i.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(i.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(i.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(i.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(i.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(i.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(i.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(i.rotation=t.rotation),1!==t.linewidth&&(i.linewidth=t.linewidth),void 0!==t.dashSize&&(i.dashSize=t.dashSize),void 0!==t.gapSize&&(i.gapSize=t.gapSize),void 0!==t.scale&&(i.scale=t.scale),void 0!==t.polygonOffset&&(i.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(i.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(i.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.dithering&&(i.dithering=t.dithering),void 0!==t.alphaToCoverage&&(i.alphaToCoverage=t.alphaToCoverage),void 0!==t.premultipliedAlpha&&(i.premultipliedAlpha=t.premultipliedAlpha),void 0!==t.forceSinglePass&&(i.forceSinglePass=t.forceSinglePass),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.toneMapped&&(i.toneMapped=t.toneMapped),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?i.vertexColors=t.vertexColors>0:i.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const e in t.uniforms){const r=t.uniforms[e];switch(i.uniforms[e]={},r.type){case"t":i.uniforms[e].value=n(r.value);break;case"c":i.uniforms[e].value=(new Yi).setHex(r.value);break;case"v2":i.uniforms[e].value=(new Qe).fromArray(r.value);break;case"v3":i.uniforms[e].value=(new Rn).fromArray(r.value);break;case"v4":i.uniforms[e].value=(new bn).fromArray(r.value);break;case"m3":i.uniforms[e].value=(new tn).fromArray(r.value);break;case"m4":i.uniforms[e].value=(new ri).fromArray(r.value);break;default:i.uniforms[e].value=r.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.glslVersion&&(i.glslVersion=t.glslVersion),void 0!==t.extensions)for(const e in t.extensions)i.extensions[e]=t.extensions[e];if(void 0!==t.lights&&(i.lights=t.lights),void 0!==t.clipping&&(i.clipping=t.clipping),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=n(t.map)),void 0!==t.matcap&&(i.matcap=n(t.matcap)),void 0!==t.alphaMap&&(i.alphaMap=n(t.alphaMap)),void 0!==t.bumpMap&&(i.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),i.normalScale=(new Qe).fromArray(e)}return void 0!==t.displacementMap&&(i.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=n(t.specularMap)),void 0!==t.specularIntensityMap&&(i.specularIntensityMap=n(t.specularIntensityMap)),void 0!==t.specularColorMap&&(i.specularColorMap=n(t.specularColorMap)),void 0!==t.envMap&&(i.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(i.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(i.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(i.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=n(t.gradientMap)),void 0!==t.clearcoatMap&&(i.clearcoatMap=n(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=n(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(i.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(i.clearcoatNormalScale=(new Qe).fromArray(t.clearcoatNormalScale)),void 0!==t.iridescenceMap&&(i.iridescenceMap=n(t.iridescenceMap)),void 0!==t.iridescenceThicknessMap&&(i.iridescenceThicknessMap=n(t.iridescenceThicknessMap)),void 0!==t.transmissionMap&&(i.transmissionMap=n(t.transmissionMap)),void 0!==t.thicknessMap&&(i.thicknessMap=n(t.thicknessMap)),void 0!==t.anisotropyMap&&(i.anisotropyMap=n(t.anisotropyMap)),void 0!==t.sheenColorMap&&(i.sheenColorMap=n(t.sheenColorMap)),void 0!==t.sheenRoughnessMap&&(i.sheenRoughnessMap=n(t.sheenRoughnessMap)),i}setTextures(t){return this.textures=t,this}static createMaterialFromType(t){return new{ShadowMaterial:xh,SpriteMaterial:Vo,RawShaderMaterial:Mh,ShaderMaterial:Gr,PointsMaterial:Vl,MeshPhysicalMaterial:bh,MeshStandardMaterial:Sh,MeshPhongMaterial:Th,MeshToonMaterial:Eh,MeshNormalMaterial:wh,MeshLambertMaterial:Ah,MeshDepthMaterial:xo,MeshDistanceMaterial:Mo,MeshBasicMaterial:Ji,MeshMatcapMaterial:Rh,LineDashedMaterial:Ch,LineBasicMaterial:Il,Material:Vi}[t]}}class Eu{static decodeText(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let n=0,i=t.length;n0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(n,i,this._addIndex*e,1,e);for(let t=e,r=e+e;t!==r;++t)if(n[t]!==n[t+e]){a.setValue(n,i);break}}saveOriginalState(){const t=this.binding,e=this.buffer,n=this.valueSize,i=n*this._origIndex;t.getValue(e,i);for(let t=n,r=i;t!==r;++t)e[t]=e[i+t%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let n=t;n=.5)for(let i=0;i!==r;++i)t[e+i]=t[n+i]}_slerp(t,e,n,i){An.slerpFlat(t,e,t,e,t,n,i)}_slerpAdditive(t,e,n,i,r){const s=this._workIndex*r;An.multiplyQuaternionsFlat(t,s,t,e,t,n),An.slerpFlat(t,e,t,e,t,s,i)}_lerp(t,e,n,i,r){const s=1-i;for(let a=0;a!==r;++a){const r=e+a;t[r]=t[r]*s+t[n+a]*i}}_lerpAdditive(t,e,n,i,r){for(let s=0;s!==r;++s){const r=e+s;t[r]=t[r]+t[n+s]*i}}}const Yu="\\[\\]\\.:\\/",Zu=new RegExp("["+Yu+"]","g"),Ju="[^"+Yu+"]",Ku="[^"+Yu.replace("\\.","")+"]",$u=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",Ju)+/(WCOD+)?/.source.replace("WCOD",Ku)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Ju)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Ju)+"$"),Qu=["material","materials","bones","map"];class td{constructor(t,e,n){this.path=e,this.parsedPath=n||td.parseTrackName(e),this.node=td.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new td.Composite(t,e,n):new td(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(Zu,"")}static parseTrackName(t){const e=$u.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const t=n.nodeName.substring(i+1);-1!==Qu.indexOf(t)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=t)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){const n=function(t){for(let i=0;i0){const t=this._interpolants,e=this._propertyBindings;if(this.blendMode===ge)for(let n=0,i=t.length;n!==i;++n)t[n].evaluate(s),e[n].accumulateAdditive(a);else for(let n=0,r=t.length;n!==r;++n)t[n].evaluate(s),e[n].accumulate(i,a)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const n=this._weightInterpolant;if(null!==n){const i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,n=this.loop;let i=this.time+t,r=this._loopCount;const s=2202===n;if(0===t)return-1===r?i:s&&1==(1&r)?e-i:i;if(2200===n){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(i>=e)i=e;else{if(!(i<0)){this.time=i;break t}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),i>=e||i<0){const n=Math.floor(i/e);i-=e*n,r+=Math.abs(n);const a=this.repetitions-r;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=t>0?e:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===a){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=i;if(s&&1==(1&r))return e-i}return i}_setEndings(t,e,n){const i=this._interpolantSettings;n?(i.endingStart=pe,i.endingEnd=pe):(i.endingStart=t?this.zeroSlopeAtStart?pe:de:me,i.endingEnd=e?this.zeroSlopeAtEnd?pe:de:me)}_scheduleFading(t,e,n){const i=this._mixer,r=i.time;let s=this._weightInterpolant;null===s&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const a=s.parameterPositions,o=s.sampleValues;return a[0]=r,o[0]=e,a[1]=r+t,o[1]=n,this}}const nd=new Float32Array(1);class id{constructor(t){this.value=t}clone(){return new id(void 0===this.value.clone?this.value:this.value.clone())}}let rd=0;function sd(t,e){return t.distance-e.distance}function ad(t,e,n,i){if(t.layers.test(e.layers)&&t.raycast(e,n),!0===i){const i=t.children;for(let t=0,r=i.length;t=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,n=this._nActiveActions,i=this.time+=t,r=Math.sign(t),s=this._accuIndex^=1;for(let a=0;a!==n;++a){e[a]._update(i,t,r,s)}const a=this._bindings,o=this._nActiveBindings;for(let t=0;t!==o;++t)a[t].apply(s);return this}setTime(t){this.time=0;for(let t=0;t=r){const s=r++,c=t[s];e[c.uuid]=l,t[l]=c,e[o]=s,t[s]=a;for(let t=0,e=i;t!==e;++t){const e=n[t],i=e[s],r=e[l];e[l]=i,e[s]=r}}}this.nCachedObjects_=r}uncache(){const t=this._objects,e=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_,s=t.length;for(let a=0,o=arguments.length;a!==o;++a){const o=arguments[a].uuid,l=e[o];if(void 0!==l)if(delete e[o],l0&&(e[a.uuid]=l),t[l]=a,t.pop();for(let t=0,e=i;t!==e;++t){const e=n[t];e[l]=e[r],e.pop()}}}this.nCachedObjects_=r}subscribe_(t,e){const n=this._bindingsIndicesByPath;let i=n[t];const r=this._bindings;if(void 0!==i)return r[i];const s=this._paths,a=this._parsedPaths,o=this._objects,l=o.length,c=this.nCachedObjects_,h=new Array(l);i=r.length,n[t]=i,s.push(t),a.push(e),r.push(h);for(let n=c,i=o.length;n!==i;++n){const i=o[n];h[n]=new td(i,t,e)}return h}unsubscribe_(t){const e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){const i=this._paths,r=this._parsedPaths,s=this._bindings,a=s.length-1,o=s[a];e[t[a]]=n,s[n]=o,s.pop(),r[n]=r[a],r.pop(),i[n]=i[a],i.pop()}}},t.AnimationUtils=Oh,t.ArcCurve=Ql,t.ArrayCamera=wo,t.ArrowHelper=class extends Ci{constructor(t=new Rn(0,0,1),e=new Rn(0,0,0),n=1,i=16776960,r=.2*n,s=.2*r){super(),this.type="ArrowHelper",void 0===wd&&(wd=new fr,wd.setAttribute("position",new or([0,0,0,0,1,0],3)),Ad=new Sc(0,.5,1,5,1),Ad.translate(0,-.5,0)),this.position.copy(e),this.line=new Bl(wd,new Il({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Ur(Ad,new Ji({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,r,s)}setDirection(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{Ed.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(Ed,e)}}setLength(t,e=.2*t,n=.2*e){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},t.Audio=ku,t.AudioAnalyser=class{constructor(t,e=2048){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=e,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let t=0;const e=this.getFrequencyData();for(let n=0;nthis.max.x||t.ythis.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,od).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},t.Box3=Pn,t.Box3Helper=class extends Hl{constructor(t,e=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new fr;i.setIndex(new rr(n,1)),i.setAttribute("position",new or([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(i,new Il({color:e,toneMapped:!1})),this.box=t,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(t){const e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(t))}dispose(){this.geometry.dispose(),this.material.dispose()}},t.BoxBufferGeometry=class extends Nr{constructor(t,e,n,i,r,s){console.warn("THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry."),super(t,e,n,i,r,s)}},t.BoxGeometry=Nr,t.BoxHelper=class extends Hl{constructor(t,e=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),r=new fr;r.setIndex(new rr(n,1)),r.setAttribute("position",new rr(i,3)),super(r,new Il({color:e,toneMapped:!1})),this.object=t,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Td.setFromObject(this.object),Td.isEmpty())return;const e=Td.min,n=Td.max,i=this.geometry.attributes.position,r=i.array;r[0]=n.x,r[1]=n.y,r[2]=n.z,r[3]=e.x,r[4]=n.y,r[5]=n.z,r[6]=e.x,r[7]=e.y,r[8]=n.z,r[9]=n.x,r[10]=e.y,r[11]=n.z,r[12]=n.x,r[13]=n.y,r[14]=e.z,r[15]=e.x,r[16]=n.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=n.x,r[22]=e.y,r[23]=e.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(t){return this.object=t,this.update(),this}copy(t,e){return super.copy(t,e),this.object=t.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}},t.BufferAttribute=rr,t.BufferGeometry=fr,t.BufferGeometryLoader=Au,t.ByteType=dt,t.Cache=Kh,t.Camera=Hr,t.CameraHelper=class extends Hl{constructor(t){const e=new fr,n=new Il({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],r=[],s={};function a(t,e){o(t),o(e)}function o(t){i.push(0,0,0),r.push(0,0,0),void 0===s[t]&&(s[t]=[]),s[t].push(i.length/3-1)}a("n1","n2"),a("n2","n4"),a("n4","n3"),a("n3","n1"),a("f1","f2"),a("f2","f4"),a("f4","f3"),a("f3","f1"),a("n1","f1"),a("n2","f2"),a("n3","f3"),a("n4","f4"),a("p","n1"),a("p","n2"),a("p","n3"),a("p","n4"),a("u1","u2"),a("u2","u3"),a("u3","u1"),a("c","t"),a("p","c"),a("cn1","cn2"),a("cn3","cn4"),a("cf1","cf2"),a("cf3","cf4"),e.setAttribute("position",new or(i,3)),e.setAttribute("color",new or(r,3)),super(e,n),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update();const l=new Yi(16755200),c=new Yi(16711680),h=new Yi(43775),u=new Yi(16777215),d=new Yi(3355443);this.setColors(l,c,h,u,d)}setColors(t,e,n,i,r){const s=this.geometry.getAttribute("color");s.setXYZ(0,t.r,t.g,t.b),s.setXYZ(1,t.r,t.g,t.b),s.setXYZ(2,t.r,t.g,t.b),s.setXYZ(3,t.r,t.g,t.b),s.setXYZ(4,t.r,t.g,t.b),s.setXYZ(5,t.r,t.g,t.b),s.setXYZ(6,t.r,t.g,t.b),s.setXYZ(7,t.r,t.g,t.b),s.setXYZ(8,t.r,t.g,t.b),s.setXYZ(9,t.r,t.g,t.b),s.setXYZ(10,t.r,t.g,t.b),s.setXYZ(11,t.r,t.g,t.b),s.setXYZ(12,t.r,t.g,t.b),s.setXYZ(13,t.r,t.g,t.b),s.setXYZ(14,t.r,t.g,t.b),s.setXYZ(15,t.r,t.g,t.b),s.setXYZ(16,t.r,t.g,t.b),s.setXYZ(17,t.r,t.g,t.b),s.setXYZ(18,t.r,t.g,t.b),s.setXYZ(19,t.r,t.g,t.b),s.setXYZ(20,t.r,t.g,t.b),s.setXYZ(21,t.r,t.g,t.b),s.setXYZ(22,t.r,t.g,t.b),s.setXYZ(23,t.r,t.g,t.b),s.setXYZ(24,e.r,e.g,e.b),s.setXYZ(25,e.r,e.g,e.b),s.setXYZ(26,e.r,e.g,e.b),s.setXYZ(27,e.r,e.g,e.b),s.setXYZ(28,e.r,e.g,e.b),s.setXYZ(29,e.r,e.g,e.b),s.setXYZ(30,e.r,e.g,e.b),s.setXYZ(31,e.r,e.g,e.b),s.setXYZ(32,n.r,n.g,n.b),s.setXYZ(33,n.r,n.g,n.b),s.setXYZ(34,n.r,n.g,n.b),s.setXYZ(35,n.r,n.g,n.b),s.setXYZ(36,n.r,n.g,n.b),s.setXYZ(37,n.r,n.g,n.b),s.setXYZ(38,i.r,i.g,i.b),s.setXYZ(39,i.r,i.g,i.b),s.setXYZ(40,r.r,r.g,r.b),s.setXYZ(41,r.r,r.g,r.b),s.setXYZ(42,r.r,r.g,r.b),s.setXYZ(43,r.r,r.g,r.b),s.setXYZ(44,r.r,r.g,r.b),s.setXYZ(45,r.r,r.g,r.b),s.setXYZ(46,r.r,r.g,r.b),s.setXYZ(47,r.r,r.g,r.b),s.setXYZ(48,r.r,r.g,r.b),s.setXYZ(49,r.r,r.g,r.b),s.needsUpdate=!0}update(){const t=this.geometry,e=this.pointMap;Sd.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),bd("c",e,t,Sd,0,0,-1),bd("t",e,t,Sd,0,0,1),bd("n1",e,t,Sd,-1,-1,-1),bd("n2",e,t,Sd,1,-1,-1),bd("n3",e,t,Sd,-1,1,-1),bd("n4",e,t,Sd,1,1,-1),bd("f1",e,t,Sd,-1,-1,1),bd("f2",e,t,Sd,1,-1,1),bd("f3",e,t,Sd,-1,1,1),bd("f4",e,t,Sd,1,1,1),bd("u1",e,t,Sd,.7,1.1,-1),bd("u2",e,t,Sd,-.7,1.1,-1),bd("u3",e,t,Sd,0,2,-1),bd("cf1",e,t,Sd,-1,0,1),bd("cf2",e,t,Sd,1,0,1),bd("cf3",e,t,Sd,0,-1,1),bd("cf4",e,t,Sd,0,1,1),bd("cn1",e,t,Sd,-1,0,-1),bd("cn2",e,t,Sd,1,0,-1),bd("cn3",e,t,Sd,0,-1,-1),bd("cn4",e,t,Sd,0,1,-1),t.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}},t.CanvasTexture=class extends Sn{constructor(t,e,n,i,r,s,a,o,l){super(t,e,n,i,r,s,a,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}},t.CapsuleBufferGeometry=class extends xc{constructor(t,e,n,i){console.warn("THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry."),super(t,e,n,i)}},t.CapsuleGeometry=xc,t.CatmullRomCurve3=sc,t.CineonToneMapping=q,t.CircleBufferGeometry=class extends Mc{constructor(t,e,n,i){console.warn("THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry."),super(t,e,n,i)}},t.CircleGeometry=Mc,t.ClampToEdgeWrapping=it,t.Clock=Ou,t.Color=Yi,t.ColorKeyframeTrack=Vh,t.ColorManagement=fn,t.CompressedArrayTexture=class extends Jl{constructor(t,e,n,i,r,s){super(t,e,n,r,s),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=it}},t.CompressedTexture=Jl,t.CompressedTextureLoader=class extends tu{constructor(t){super(t)}load(t,e,n,i){const r=this,s=[],a=new Jl,o=new iu(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(r.withCredentials);let l=0;function c(c){o.load(t[c],(function(t){const n=r.parse(t,!0);s[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},l+=1,6===l&&(1===n.mipmapCount&&(a.minFilter=lt),a.image=s,a.format=n.format,a.needsUpdate=!0,e&&e(a))}),n,i)}if(Array.isArray(t))for(let e=0,n=t.length;e0){const n=new $h(e);r=new ru(n),r.setCrossOrigin(this.crossOrigin);for(let e=0,n=t.length;e0){i=new ru(this.manager),i.setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e1)for(let n=0;nNumber.EPSILON){if(l<0&&(n=e[s],o=-o,a=e[r],l=-l),t.ya.y)continue;if(t.y===n.y){if(t.x===n.x)return!0}else{const e=l*(t.x-n.x)-o*(t.y-n.y);if(0===e)return!0;if(e<0)continue;i=!i}}else{if(t.y!==n.y)continue;if(a.x<=t.x&&t.x<=n.x||n.x<=t.x&&t.x<=a.x)return!0}}return i}const n=ih.isClockWise,i=this.subPaths;if(0===i.length)return[];let r,s,a;const o=[];if(1===i.length)return s=i[0],a=new Pc,a.curves=s.curves,o.push(a),o;let l=!n(i[0].getPoints());l=t?!l:l;const c=[],h=[];let u,d,p=[],m=0;h[m]=void 0,p[m]=[];for(let e=0,a=i.length;e1){let t=!1,n=0;for(let t=0,e=h.length;t0&&!1===t&&(p=c)}for(let t=0,e=h.length;t=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}},t.WebGL1Renderer=Oo,t.WebGL3DRenderTarget=class extends Tn{constructor(t=1,e=1,n=1){super(t,e),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new wn(null,t,e,n),this.texture.isRenderTargetTexture=!0}},t.WebGLArrayRenderTarget=class extends Tn{constructor(t=1,e=1,n=1){super(t,e),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new En(null,t,e,n),this.texture.isRenderTargetTexture=!0}},t.WebGLCubeRenderTarget=jr,t.WebGLMultipleRenderTargets=class extends Tn{constructor(t=1,e=1,n=1,i={}){super(t,e,i),this.isWebGLMultipleRenderTargets=!0;const r=this.texture;this.texture=[];for(let t=0;t>8&255]+Wt[t>>16&255]+Wt[t>>24&255]+"-"+Wt[255&e]+Wt[e>>8&255]+"-"+Wt[e>>16&15|64]+Wt[e>>24&255]+"-"+Wt[63&n|128]+Wt[n>>8&255]+"-"+Wt[n>>16&255]+Wt[n>>24&255]+Wt[255&i]+Wt[i>>8&255]+Wt[i>>16&255]+Wt[i>>24&255]).toLowerCase()}function Zt(t,e,n){return Math.max(e,Math.min(n,t))}function Jt(t,e){return(t%e+e)%e}function Kt(t,e,n){return(1-n)*t+n*e}function $t(t){return 0==(t&t-1)&&0!==t}function Qt(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function te(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function ee(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function ne(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const ie={DEG2RAD:jt,RAD2DEG:qt,generateUUID:Yt,clamp:Zt,euclideanModulo:Jt,mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},inverseLerp:function(t,e,n){return t!==e?(n-t)/(e-t):0},lerp:Kt,damp:function(t,e,n,i){return Kt(t,e,1-Math.exp(-n*i))},pingpong:function(t,e=1){return e-Math.abs(Jt(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(Xt=t);let e=Xt+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*jt},radToDeg:function(t){return t*qt},isPowerOfTwo:$t,ceilPowerOfTwo:Qt,floorPowerOfTwo:te,setQuaternionFromProperEuler:function(t,e,n,i,r){const s=Math.cos,a=Math.sin,o=s(n/2),l=a(n/2),c=s((e+i)/2),h=a((e+i)/2),u=s((e-i)/2),d=a((e-i)/2),p=s((i-e)/2),m=a((i-e)/2);switch(r){case"XYX":t.set(o*h,l*u,l*d,o*c);break;case"YZY":t.set(l*d,o*h,l*u,o*c);break;case"ZXZ":t.set(l*u,l*d,o*h,o*c);break;case"XZX":t.set(o*h,l*m,l*p,o*c);break;case"YXY":t.set(l*p,o*h,l*m,o*c);break;case"ZYZ":t.set(l*m,l*p,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:ne,denormalize:ee};class re{constructor(t=0,e=0){re.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Zt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,s=this.y-t.y;return this.x=r*n-s*i+t.x,this.y=r*i+s*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class se{constructor(t,e,n,i,r,s,a,o,l){se.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,n,i,r,s,a,o,l)}set(t,e,n,i,r,s,a,o,l){const c=this.elements;return c[0]=t,c[1]=i,c[2]=a,c[3]=e,c[4]=r,c[5]=o,c[6]=n,c[7]=s,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[3],o=n[6],l=n[1],c=n[4],h=n[7],u=n[2],d=n[5],p=n[8],m=i[0],f=i[3],g=i[6],_=i[1],v=i[4],y=i[7],x=i[2],M=i[5],S=i[8];return r[0]=s*m+a*_+o*x,r[3]=s*f+a*v+o*M,r[6]=s*g+a*y+o*S,r[1]=l*m+c*_+h*x,r[4]=l*f+c*v+h*M,r[7]=l*g+c*y+h*S,r[2]=u*m+d*_+p*x,r[5]=u*f+d*v+p*M,r[8]=u*g+d*y+p*S,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8];return e*s*c-e*a*l-n*r*c+n*a*o+i*r*l-i*s*o}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8],h=c*s-a*l,u=a*o-c*r,d=l*r-s*o,p=e*h+n*u+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const m=1/p;return t[0]=h*m,t[1]=(i*l-c*n)*m,t[2]=(a*n-i*s)*m,t[3]=u*m,t[4]=(c*e-i*o)*m,t[5]=(i*r-a*e)*m,t[6]=d*m,t[7]=(n*o-l*e)*m,t[8]=(s*e-n*r)*m,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,s,a){const o=Math.cos(r),l=Math.sin(r);return this.set(n*o,n*l,-n*(o*s+l*a)+s+t,-i*l,i*o,-i*(-l*s+o*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(ae.makeScale(t,e)),this}rotate(t){return this.premultiply(ae.makeRotation(-t)),this}translate(t,e){return this.premultiply(ae.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}const ae=new se;function oe(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const le={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function ce(t,e){return new le[t](e)}function he(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function ue(){const t=he("canvas");return t.style.display="block",t}const de={};function pe(t){t in de||(de[t]=!0,console.warn(t))}function me(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function fe(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const ge=(new se).fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),_e=(new se).fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);const ve={[Nt]:t=>t,[Dt]:t=>t.convertSRGBToLinear(),[Ot]:function(t){return t.convertSRGBToLinear().applyMatrix3(_e)}},ye={[Nt]:t=>t,[Dt]:t=>t.convertLinearToSRGB(),[Ot]:function(t){return t.applyMatrix3(ge).convertLinearToSRGB()}},xe={enabled:!0,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(t){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!t},get workingColorSpace(){return Nt},set workingColorSpace(t){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(t,e,n){if(!1===this.enabled||e===n||!e||!n)return t;const i=ve[e],r=ye[n];if(void 0===i||void 0===r)throw new Error(`Unsupported color space conversion, "${e}" to "${n}".`);return r(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)}};let Me;class Se{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===Me&&(Me=he("canvas")),Me.width=t.width,Me.height=t.height;const n=Me.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Me}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=he("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const i=n.getImageData(0,0,t.width,t.height),r=i.data;for(let t=0;t0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==_)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case b:t.x=t.x-Math.floor(t.x);break;case T:t.x=t.x<0?0:1;break;case E:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case b:t.y=t.y-Math.floor(t.y);break;case T:t.y=t.y<0?0:1;break;case E:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return pe("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Dt?It:Pt}set encoding(t){pe("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===It?Dt:Ut}}Ae.DEFAULT_IMAGE=null,Ae.DEFAULT_MAPPING=_,Ae.DEFAULT_ANISOTROPY=1;class Re{constructor(t=0,e=0,n=0,i=1){Re.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i+s[12]*r,this.y=s[1]*e+s[5]*n+s[9]*i+s[13]*r,this.z=s[2]*e+s[6]*n+s[10]*i+s[14]*r,this.w=s[3]*e+s[7]*n+s[11]*i+s[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,r;const s=.01,a=.1,o=t.elements,l=o[0],c=o[4],h=o[8],u=o[1],d=o[5],p=o[9],m=o[2],f=o[6],g=o[10];if(Math.abs(c-u)o&&t>_?t_?o=0?1:-1,i=1-e*e;if(i>Number.EPSILON){const r=Math.sqrt(i),s=Math.atan2(r,e*n);t=Math.sin(t*s)/r,a=Math.sin(a*s)/r}const r=a*n;if(o=o*t+u*r,l=l*t+d*r,c=c*t+p*r,h=h*t+m*r,t===1-a){const t=1/Math.sqrt(o*o+l*l+c*c+h*h);o*=t,l*=t,c*=t,h*=t}}t[e]=o,t[e+1]=l,t[e+2]=c,t[e+3]=h}static multiplyQuaternionsFlat(t,e,n,i,r,s){const a=n[i],o=n[i+1],l=n[i+2],c=n[i+3],h=r[s],u=r[s+1],d=r[s+2],p=r[s+3];return t[e]=a*p+c*h+o*d-l*u,t[e+1]=o*p+c*u+l*h-a*d,t[e+2]=l*p+c*d+a*u-o*h,t[e+3]=c*p-a*h-o*u-l*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){const n=t._x,i=t._y,r=t._z,s=t._order,a=Math.cos,o=Math.sin,l=a(n/2),c=a(i/2),h=a(r/2),u=o(n/2),d=o(i/2),p=o(r/2);switch(s){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],r=e[8],s=e[1],a=e[5],o=e[9],l=e[2],c=e[6],h=e[10],u=n+a+h;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(c-o)*t,this._y=(r-l)*t,this._z=(s-i)*t}else if(n>a&&n>h){const t=2*Math.sqrt(1+n-a-h);this._w=(c-o)/t,this._x=.25*t,this._y=(i+s)/t,this._z=(r+l)/t}else if(a>h){const t=2*Math.sqrt(1+a-n-h);this._w=(r-l)/t,this._x=(i+s)/t,this._y=.25*t,this._z=(o+c)/t}else{const t=2*Math.sqrt(1+h-n-a);this._w=(s-i)/t,this._x=(r+l)/t,this._y=(o+c)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return nMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Zt(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,s=t._w,a=e._x,o=e._y,l=e._z,c=e._w;return this._x=n*c+s*a+i*l-r*o,this._y=i*c+s*o+r*a-n*l,this._z=r*c+s*l+n*o-i*a,this._w=s*c-n*a-i*o-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,i=this._y,r=this._z,s=this._w;let a=s*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=s,this._x=n,this._y=i,this._z=r,this;const o=1-a*a;if(o<=Number.EPSILON){const t=1-e;return this._w=t*s+e*this._w,this._x=t*n+e*this._x,this._y=t*i+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(o),c=Math.atan2(l,a),h=Math.sin((1-e)*c)/l,u=Math.sin(e*c)/l;return this._w=s*h+this._w*u,this._x=n*h+this._x*u,this._y=i*h+this._y*u,this._z=r*h+this._z*u,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=Math.random(),e=Math.sqrt(1-t),n=Math.sqrt(t),i=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(e*Math.cos(i),n*Math.sin(r),n*Math.cos(r),e*Math.sin(i))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class De{constructor(t=0,e=0,n=0){De.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(Oe.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Oe.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.elements,s=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*s,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*s,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*s,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,a=t.z,o=t.w,l=o*e+s*i-a*n,c=o*n+a*e-r*i,h=o*i+r*n-s*e,u=-r*e-s*n-a*i;return this.x=l*o+u*-r+c*-a-h*-s,this.y=c*o+u*-s+h*-r-l*-a,this.z=h*o+u*-a+l*-s-c*-r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=i*o-r*a,this.y=r*s-n*o,this.z=n*a-i*s,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return Ne.copy(this).projectOnVector(t),this.sub(Ne)}reflect(t){return this.sub(Ne.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Zt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=2*(Math.random()-.5),e=Math.random()*Math.PI*2,n=Math.sqrt(1-t**2);return this.x=n*Math.cos(e),this.y=n*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Ne=new De,Oe=new Ue;class Fe{constructor(t=new De(1/0,1/0,1/0),e=new De(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,ze),ze.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(qe),Ye.subVectors(this.max,qe),Ge.subVectors(t.a,qe),ke.subVectors(t.b,qe),Ve.subVectors(t.c,qe),We.subVectors(ke,Ge),Xe.subVectors(Ve,ke),je.subVectors(Ge,Ve);let e=[0,-We.z,We.y,0,-Xe.z,Xe.y,0,-je.z,je.y,We.z,0,-We.x,Xe.z,0,-Xe.x,je.z,0,-je.x,-We.y,We.x,0,-Xe.y,Xe.x,0,-je.y,je.x,0];return!!Ke(e,Ge,ke,Ve,Ye)&&(e=[1,0,0,0,1,0,0,0,1],!!Ke(e,Ge,ke,Ve,Ye)&&(Ze.crossVectors(We,Xe),e=[Ze.x,Ze.y,Ze.z],Ke(e,Ge,ke,Ve,Ye)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,ze).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(ze).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(Be[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Be[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Be[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Be[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Be[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Be[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Be[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Be[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Be)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const Be=[new De,new De,new De,new De,new De,new De,new De,new De],ze=new De,He=new Fe,Ge=new De,ke=new De,Ve=new De,We=new De,Xe=new De,je=new De,qe=new De,Ye=new De,Ze=new De,Je=new De;function Ke(t,e,n,i,r){for(let s=0,a=t.length-3;s<=a;s+=3){Je.fromArray(t,s);const a=r.x*Math.abs(Je.x)+r.y*Math.abs(Je.y)+r.z*Math.abs(Je.z),o=e.dot(Je),l=n.dot(Je),c=i.dot(Je);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>a)return!1}return!0}const $e=new Fe,Qe=new De,tn=new De;class en{constructor(t=new De,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):$e.setFromPoints(t).getCenter(n);let i=0;for(let e=0,r=t.length;ethis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Qe.subVectors(t,this.center);const e=Qe.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),n=.5*(t-this.radius);this.center.addScaledVector(Qe,n/t),this.radius+=n}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(tn.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Qe.copy(t.center).add(tn)),this.expandByPoint(Qe.copy(t.center).sub(tn))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const nn=new De,rn=new De,sn=new De,an=new De,on=new De,ln=new De,cn=new De;class hn{constructor(t=new De,e=new De(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,nn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=nn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(nn.copy(this.origin).addScaledVector(this.direction,e),nn.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){rn.copy(t).add(e).multiplyScalar(.5),sn.copy(e).sub(t).normalize(),an.copy(this.origin).sub(rn);const r=.5*t.distanceTo(e),s=-this.direction.dot(sn),a=an.dot(this.direction),o=-an.dot(sn),l=an.lengthSq(),c=Math.abs(1-s*s);let h,u,d,p;if(c>0)if(h=s*o-a,u=s*a-o,p=r*c,h>=0)if(u>=-p)if(u<=p){const t=1/c;h*=t,u*=t,d=h*(h+s*u+2*a)+u*(s*h+u+2*o)+l}else u=r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;else u=-r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;else u<=-p?(h=Math.max(0,-(-s*r+a)),u=h>0?-r:Math.min(Math.max(-r,-o),r),d=-h*h+u*(u+2*o)+l):u<=p?(h=0,u=Math.min(Math.max(-r,-o),r),d=u*(u+2*o)+l):(h=Math.max(0,-(s*r+a)),u=h>0?r:Math.min(Math.max(-r,-o),r),d=-h*h+u*(u+2*o)+l);else u=s>0?-r:r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(rn).addScaledVector(sn,u),d}intersectSphere(t,e){nn.subVectors(t.center,this.origin);const n=nn.dot(this.direction),i=nn.dot(nn)-n*n,r=t.radius*t.radius;if(i>r)return null;const s=Math.sqrt(r-i),a=n-s,o=n+s;return o<0?null:a<0?this.at(o,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,r,s,a,o;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(n=(t.min.x-u.x)*l,i=(t.max.x-u.x)*l):(n=(t.max.x-u.x)*l,i=(t.min.x-u.x)*l),c>=0?(r=(t.min.y-u.y)*c,s=(t.max.y-u.y)*c):(r=(t.max.y-u.y)*c,s=(t.min.y-u.y)*c),n>s||r>i?null:((r>n||isNaN(n))&&(n=r),(s=0?(a=(t.min.z-u.z)*h,o=(t.max.z-u.z)*h):(a=(t.max.z-u.z)*h,o=(t.min.z-u.z)*h),n>o||a>i?null:((a>n||n!=n)&&(n=a),(o=0?n:i,e)))}intersectsBox(t){return null!==this.intersectBox(t,nn)}intersectTriangle(t,e,n,i,r){on.subVectors(e,t),ln.subVectors(n,t),cn.crossVectors(on,ln);let s,a=this.direction.dot(cn);if(a>0){if(i)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}an.subVectors(this.origin,t);const o=s*this.direction.dot(ln.crossVectors(an,ln));if(o<0)return null;const l=s*this.direction.dot(on.cross(an));if(l<0)return null;if(o+l>a)return null;const c=-s*an.dot(cn);return c<0?null:this.at(c/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class un{constructor(t,e,n,i,r,s,a,o,l,c,h,u,d,p,m,f){un.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,n,i,r,s,a,o,l,c,h,u,d,p,m,f)}set(t,e,n,i,r,s,a,o,l,c,h,u,d,p,m,f){const g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=r,g[5]=s,g[9]=a,g[13]=o,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=m,g[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new un).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,i=1/dn.setFromMatrixColumn(t,0).length(),r=1/dn.setFromMatrixColumn(t,1).length(),s=1/dn.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*s,e[9]=n[9]*s,e[10]=n[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,i=t.y,r=t.z,s=Math.cos(n),a=Math.sin(n),o=Math.cos(i),l=Math.sin(i),c=Math.cos(r),h=Math.sin(r);if("XYZ"===t.order){const t=s*c,n=s*h,i=a*c,r=a*h;e[0]=o*c,e[4]=-o*h,e[8]=l,e[1]=n+i*l,e[5]=t-r*l,e[9]=-a*o,e[2]=r-t*l,e[6]=i+n*l,e[10]=s*o}else if("YXZ"===t.order){const t=o*c,n=o*h,i=l*c,r=l*h;e[0]=t+r*a,e[4]=i*a-n,e[8]=s*l,e[1]=s*h,e[5]=s*c,e[9]=-a,e[2]=n*a-i,e[6]=r+t*a,e[10]=s*o}else if("ZXY"===t.order){const t=o*c,n=o*h,i=l*c,r=l*h;e[0]=t-r*a,e[4]=-s*h,e[8]=i+n*a,e[1]=n+i*a,e[5]=s*c,e[9]=r-t*a,e[2]=-s*l,e[6]=a,e[10]=s*o}else if("ZYX"===t.order){const t=s*c,n=s*h,i=a*c,r=a*h;e[0]=o*c,e[4]=i*l-n,e[8]=t*l+r,e[1]=o*h,e[5]=r*l+t,e[9]=n*l-i,e[2]=-l,e[6]=a*o,e[10]=s*o}else if("YZX"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*c,e[4]=r-t*h,e[8]=i*h+n,e[1]=h,e[5]=s*c,e[9]=-a*c,e[2]=-l*c,e[6]=n*h+i,e[10]=t-r*h}else if("XZY"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*c,e[4]=-h,e[8]=l*c,e[1]=t*h+r,e[5]=s*c,e[9]=n*h-i,e[2]=i*h-n,e[6]=a*c,e[10]=r*h+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(mn,t,fn)}lookAt(t,e,n){const i=this.elements;return vn.subVectors(t,e),0===vn.lengthSq()&&(vn.z=1),vn.normalize(),gn.crossVectors(n,vn),0===gn.lengthSq()&&(1===Math.abs(n.z)?vn.x+=1e-4:vn.z+=1e-4,vn.normalize(),gn.crossVectors(n,vn)),gn.normalize(),_n.crossVectors(vn,gn),i[0]=gn.x,i[4]=_n.x,i[8]=vn.x,i[1]=gn.y,i[5]=_n.y,i[9]=vn.y,i[2]=gn.z,i[6]=_n.z,i[10]=vn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[4],o=n[8],l=n[12],c=n[1],h=n[5],u=n[9],d=n[13],p=n[2],m=n[6],f=n[10],g=n[14],_=n[3],v=n[7],y=n[11],x=n[15],M=i[0],S=i[4],b=i[8],T=i[12],E=i[1],w=i[5],A=i[9],R=i[13],C=i[2],L=i[6],P=i[10],I=i[14],U=i[3],D=i[7],N=i[11],O=i[15];return r[0]=s*M+a*E+o*C+l*U,r[4]=s*S+a*w+o*L+l*D,r[8]=s*b+a*A+o*P+l*N,r[12]=s*T+a*R+o*I+l*O,r[1]=c*M+h*E+u*C+d*U,r[5]=c*S+h*w+u*L+d*D,r[9]=c*b+h*A+u*P+d*N,r[13]=c*T+h*R+u*I+d*O,r[2]=p*M+m*E+f*C+g*U,r[6]=p*S+m*w+f*L+g*D,r[10]=p*b+m*A+f*P+g*N,r[14]=p*T+m*R+f*I+g*O,r[3]=_*M+v*E+y*C+x*U,r[7]=_*S+v*w+y*L+x*D,r[11]=_*b+v*A+y*P+x*N,r[15]=_*T+v*R+y*I+x*O,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],s=t[1],a=t[5],o=t[9],l=t[13],c=t[2],h=t[6],u=t[10],d=t[14];return t[3]*(+r*o*h-i*l*h-r*a*u+n*l*u+i*a*d-n*o*d)+t[7]*(+e*o*d-e*l*u+r*s*u-i*s*d+i*l*c-r*o*c)+t[11]*(+e*l*h-e*a*d-r*s*h+n*s*d+r*a*c-n*l*c)+t[15]*(-i*a*c-e*o*h+e*a*u+i*s*h-n*s*u+n*o*c)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8],h=t[9],u=t[10],d=t[11],p=t[12],m=t[13],f=t[14],g=t[15],_=h*f*l-m*u*l+m*o*d-a*f*d-h*o*g+a*u*g,v=p*u*l-c*f*l-p*o*d+s*f*d+c*o*g-s*u*g,y=c*m*l-p*h*l+p*a*d-s*m*d-c*a*g+s*h*g,x=p*h*o-c*m*o-p*a*u+s*m*u+c*a*f-s*h*f,M=e*_+n*v+i*y+r*x;if(0===M)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/M;return t[0]=_*S,t[1]=(m*u*r-h*f*r-m*i*d+n*f*d+h*i*g-n*u*g)*S,t[2]=(a*f*r-m*o*r+m*i*l-n*f*l-a*i*g+n*o*g)*S,t[3]=(h*o*r-a*u*r-h*i*l+n*u*l+a*i*d-n*o*d)*S,t[4]=v*S,t[5]=(c*f*r-p*u*r+p*i*d-e*f*d-c*i*g+e*u*g)*S,t[6]=(p*o*r-s*f*r-p*i*l+e*f*l+s*i*g-e*o*g)*S,t[7]=(s*u*r-c*o*r+c*i*l-e*u*l-s*i*d+e*o*d)*S,t[8]=y*S,t[9]=(p*h*r-c*m*r-p*n*d+e*m*d+c*n*g-e*h*g)*S,t[10]=(s*m*r-p*a*r+p*n*l-e*m*l-s*n*g+e*a*g)*S,t[11]=(c*a*r-s*h*r-c*n*l+e*h*l+s*n*d-e*a*d)*S,t[12]=x*S,t[13]=(c*m*i-p*h*i+p*n*u-e*m*u-c*n*f+e*h*f)*S,t[14]=(p*a*i-s*m*i-p*n*o+e*m*o+s*n*f-e*a*f)*S,t[15]=(s*h*i-c*a*i+c*n*o-e*h*o-s*n*u+e*a*u)*S,this}scale(t){const e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,s=t.x,a=t.y,o=t.z,l=r*s,c=r*a;return this.set(l*s+n,l*a-i*o,l*o+i*a,0,l*a+i*o,c*a+n,c*o-i*s,0,l*o-i*a,c*o+i*s,r*o*o+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,r,s){return this.set(1,n,r,0,t,1,s,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){const i=this.elements,r=e._x,s=e._y,a=e._z,o=e._w,l=r+r,c=s+s,h=a+a,u=r*l,d=r*c,p=r*h,m=s*c,f=s*h,g=a*h,_=o*l,v=o*c,y=o*h,x=n.x,M=n.y,S=n.z;return i[0]=(1-(m+g))*x,i[1]=(d+y)*x,i[2]=(p-v)*x,i[3]=0,i[4]=(d-y)*M,i[5]=(1-(u+g))*M,i[6]=(f+_)*M,i[7]=0,i[8]=(p+v)*S,i[9]=(f-_)*S,i[10]=(1-(u+m))*S,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.elements;let r=dn.set(i[0],i[1],i[2]).length();const s=dn.set(i[4],i[5],i[6]).length(),a=dn.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],pn.copy(this);const o=1/r,l=1/s,c=1/a;return pn.elements[0]*=o,pn.elements[1]*=o,pn.elements[2]*=o,pn.elements[4]*=l,pn.elements[5]*=l,pn.elements[6]*=l,pn.elements[8]*=c,pn.elements[9]*=c,pn.elements[10]*=c,e.setFromRotationMatrix(pn),n.x=r,n.y=s,n.z=a,this}makePerspective(t,e,n,i,r,s,a=2e3){const o=this.elements,l=2*r/(e-t),c=2*r/(n-i),h=(e+t)/(e-t),u=(n+i)/(n-i);let d,p;if(a===Gt)d=-(s+r)/(s-r),p=-2*s*r/(s-r);else{if(a!==kt)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);d=-s/(s-r),p=-s*r/(s-r)}return o[0]=l,o[4]=0,o[8]=h,o[12]=0,o[1]=0,o[5]=c,o[9]=u,o[13]=0,o[2]=0,o[6]=0,o[10]=d,o[14]=p,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(t,e,n,i,r,s,a=2e3){const o=this.elements,l=1/(e-t),c=1/(n-i),h=1/(s-r),u=(e+t)*l,d=(n+i)*c;let p,m;if(a===Gt)p=(s+r)*h,m=-2*h;else{if(a!==kt)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);p=r*h,m=-1*h}return o[0]=2*l,o[4]=0,o[8]=0,o[12]=-u,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-d,o[2]=0,o[6]=0,o[10]=m,o[14]=-p,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<16;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const dn=new De,pn=new un,mn=new De(0,0,0),fn=new De(1,1,1),gn=new De,_n=new De,vn=new De,yn=new un,xn=new Ue;class Mn{constructor(t=0,e=0,n=0,i=Mn.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const i=t.elements,r=i[0],s=i[4],a=i[8],o=i[1],l=i[5],c=i[9],h=i[2],u=i[6],d=i[10];switch(e){case"XYZ":this._y=Math.asin(Zt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Zt(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(Zt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-Zt(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(Zt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-Zt(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return yn.makeRotationFromQuaternion(t),this.setFromRotationMatrix(yn,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return xn.setFromEuler(this),this.setFromQuaternion(xn,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Mn.DEFAULT_ORDER="XYZ";class Sn{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let t=0;t1){for(let t=0;t0&&(n=n.concat(r))}return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Rn,t,Cn),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Rn,Ln,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,i=e.length;n0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const n=e.shapes;if(Array.isArray(n))for(let e=0,i=n.length;e0){i.children=[];for(let e=0;e0){i.animations=[];for(let e=0;e0&&(n.geometries=e),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),a.length>0&&(n.images=a),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),h.length>0&&(n.nodes=h)}return n.object=i,n;function s(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(t,e,n,i,r){Fn.subVectors(i,e),Bn.subVectors(n,e),zn.subVectors(t,e);const s=Fn.dot(Fn),a=Fn.dot(Bn),o=Fn.dot(zn),l=Bn.dot(Bn),c=Bn.dot(zn),h=s*l-a*a;if(0===h)return r.set(-2,-1,-1);const u=1/h,d=(l*o-a*c)*u,p=(s*c-a*o)*u;return r.set(1-d-p,p,d)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,Hn),Hn.x>=0&&Hn.y>=0&&Hn.x+Hn.y<=1}static getUV(t,e,n,i,r,s,a,o){return!1===qn&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),qn=!0),this.getInterpolation(t,e,n,i,r,s,a,o)}static getInterpolation(t,e,n,i,r,s,a,o){return this.getBarycoord(t,e,n,i,Hn),o.setScalar(0),o.addScaledVector(r,Hn.x),o.addScaledVector(s,Hn.y),o.addScaledVector(a,Hn.z),o}static isFrontFacing(t,e,n,i){return Fn.subVectors(n,e),Bn.subVectors(t,e),Fn.cross(Bn).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Fn.subVectors(this.c,this.b),Bn.subVectors(this.a,this.b),.5*Fn.cross(Bn).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Yn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Yn.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,i,r){return!1===qn&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),qn=!0),Yn.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}getInterpolation(t,e,n,i,r){return Yn.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}containsPoint(t){return Yn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Yn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,i=this.b,r=this.c;let s,a;Gn.subVectors(i,n),kn.subVectors(r,n),Wn.subVectors(t,n);const o=Gn.dot(Wn),l=kn.dot(Wn);if(o<=0&&l<=0)return e.copy(n);Xn.subVectors(t,i);const c=Gn.dot(Xn),h=kn.dot(Xn);if(c>=0&&h<=c)return e.copy(i);const u=o*h-c*l;if(u<=0&&o>=0&&c<=0)return s=o/(o-c),e.copy(n).addScaledVector(Gn,s);jn.subVectors(t,r);const d=Gn.dot(jn),p=kn.dot(jn);if(p>=0&&d<=p)return e.copy(r);const m=d*l-o*p;if(m<=0&&l>=0&&p<=0)return a=l/(l-p),e.copy(n).addScaledVector(kn,a);const f=c*p-d*h;if(f<=0&&h-c>=0&&d-p>=0)return Vn.subVectors(r,i),a=(h-c)/(h-c+(d-p)),e.copy(i).addScaledVector(Vn,a);const g=1/(f+m+u);return s=m*g,a=u*g,e.copy(n).addScaledVector(Gn,s).addScaledVector(kn,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let Zn=0;class Jn extends Vt{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Zn++}),this.uuid=Yt(),this.name="",this.type="Material",this.blending=1,this.side=s,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=o,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ft,this.stencilZFail=Ft,this.stencilZPass=Ft,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n:console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`)}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function i(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),this.side!==s&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=this.alphaHash),!0===this.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.forceSinglePass&&(n.forceSinglePass=this.forceSinglePass),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),e){const e=i(t.textures),r=i(t.images);e.length>0&&(n.textures=e),r.length>0&&(n.images=r)}return n}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let i=0;i!==t;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}const Kn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},$n={h:0,s:0,l:0},Qn={h:0,s:0,l:0};function ti(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}class ei{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(void 0===e&&void 0===n){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Dt){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,xe.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=xe.workingColorSpace){return this.r=t,this.g=e,this.b=n,xe.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=xe.workingColorSpace){if(t=Jt(t,1),e=Zt(e,0,1),n=Zt(n,0,1),0===e)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=ti(r,i,t+1/3),this.g=ti(r,i,t),this.b=ti(r,i,t-1/3)}return xe.toWorkingColorSpace(this,i),this}setStyle(t,e=Dt){function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const s=i[1],a=i[2];switch(s){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const n=i[1],r=n.length;if(3===r)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,e);if(6===r)return this.setHex(parseInt(n,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Dt){const n=Kn[t.toLowerCase()];return void 0!==n?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=me(t.r),this.g=me(t.g),this.b=me(t.b),this}copyLinearToSRGB(t){return this.r=fe(t.r),this.g=fe(t.g),this.b=fe(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Dt){return xe.fromWorkingColorSpace(ni.copy(this),t),65536*Math.round(Zt(255*ni.r,0,255))+256*Math.round(Zt(255*ni.g,0,255))+Math.round(Zt(255*ni.b,0,255))}getHexString(t=Dt){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=xe.workingColorSpace){xe.fromWorkingColorSpace(ni.copy(this),e);const n=ni.r,i=ni.g,r=ni.b,s=Math.max(n,i,r),a=Math.min(n,i,r);let o,l;const c=(a+s)/2;if(a===s)o=0,l=0;else{const t=s-a;switch(l=c<=.5?t/(s+a):t/(2-s-a),s){case n:o=(i-r)/t+(i>-e-14,i[256|t]=1024>>-e-14|32768,r[t]=-e-1,r[256|t]=-e-1):e<=15?(i[t]=e+15<<10,i[256|t]=e+15<<10|32768,r[t]=13,r[256|t]=13):e<128?(i[t]=31744,i[256|t]=64512,r[t]=24,r[256|t]=24):(i[t]=31744,i[256|t]=64512,r[t]=13,r[256|t]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,n=0;for(;0==(8388608&e);)e<<=1,n-=8388608;e&=-8388609,n+=947912704,s[t]=e|n}for(let t=1024;t<2048;++t)s[t]=939524096+(t-1024<<13);for(let t=1;t<31;++t)a[t]=t<<23;a[31]=1199570944,a[32]=2147483648;for(let t=33;t<63;++t)a[t]=2147483648+(t-32<<23);a[63]=3347054592;for(let t=1;t<64;++t)32!==t&&(o[t]=1024);return{floatView:e,uint32View:n,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:o}}function ai(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=Zt(t,-65504,65504),ri.floatView[0]=t;const e=ri.uint32View[0],n=e>>23&511;return ri.baseTable[n]+((8388607&e)>>ri.shiftTable[n])}function oi(t){const e=t>>10;return ri.uint32View[0]=ri.mantissaTable[ri.offsetTable[e]+(1023&t)]+ri.exponentTable[e],ri.floatView[0]}const li={toHalfFloat:ai,fromHalfFloat:oi},ci=new De,hi=new re;class ui{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=n,this.usage=Bt,this.updateRange={offset:0,count:-1},this.gpuType=O,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const i=n[e];t.data.attributes[e]=i.toJSON(t.data)}const i={};let r=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],s=[];for(let e=0,i=n.length;e0&&(i[e]=s,r=!0)}r&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return null!==a&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const i=t.attributes;for(const t in i){const n=i[t];this.setAttribute(t,n.clone(e))}const r=t.morphAttributes;for(const t in r){const n=[],i=r[t];for(let t=0,r=i.length;t0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t(t.far-t.near)**2)return}bi.copy(r).invert(),Ti.copy(t.ray).applyMatrix4(bi),null!==n.boundingBox&&!1===Ti.intersectsBox(n.boundingBox)||this._computeIntersections(t,e,Ti)}}_computeIntersections(t,e,n){let i;const r=this.geometry,s=this.material,a=r.index,o=r.attributes.position,l=r.attributes.uv,c=r.attributes.uv1,h=r.attributes.normal,u=r.groups,d=r.drawRange;if(null!==a)if(Array.isArray(s))for(let r=0,o=u.length;rn.far?null:{distance:u,point:zi.clone(),object:t}}(t,e,n,i,Ai,Ri,Ci,Bi);if(d){r&&(Ii.fromBufferAttribute(r,c),Ui.fromBufferAttribute(r,h),Di.fromBufferAttribute(r,u),d.uv=Yn.getInterpolation(Bi,Ai,Ri,Ci,Ii,Ui,Di,new re)),o&&(Ii.fromBufferAttribute(o,c),Ui.fromBufferAttribute(o,h),Di.fromBufferAttribute(o,u),d.uv1=Yn.getInterpolation(Bi,Ai,Ri,Ci,Ii,Ui,Di,new re),d.uv2=d.uv1),l&&(Ni.fromBufferAttribute(l,c),Oi.fromBufferAttribute(l,h),Fi.fromBufferAttribute(l,u),d.normal=Yn.getInterpolation(Bi,Ai,Ri,Ci,Ni,Oi,Fi,new De),d.normal.dot(i.direction)>0&&d.normal.multiplyScalar(-1));const t={a:c,b:h,c:u,normal:new De,materialIndex:0};Yn.getNormal(Ai,Ri,Ci,t.normal),d.face=t}return d}class ki extends Si{constructor(t=1,e=1,n=1,i=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:s};const a=this;i=Math.floor(i),r=Math.floor(r),s=Math.floor(s);const o=[],l=[],c=[],h=[];let u=0,d=0;function p(t,e,n,i,r,s,p,m,f,g,_){const v=s/f,y=p/g,x=s/2,M=p/2,S=m/2,b=f+1,T=g+1;let E=0,w=0;const A=new De;for(let s=0;s0?1:-1,c.push(A.x,A.y,A.z),h.push(o/f),h.push(1-s/g),E+=1}}for(let t=0;t0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const t in this.extensions)!0===this.extensions[t]&&(n[t]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class Yi extends On{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new un,this.projectionMatrix=new un,this.projectionMatrixInverse=new un,this.coordinateSystem=Gt}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}class Zi extends Yi{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*qt*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*jt*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*qt*Math.atan(Math.tan(.5*jt*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,n,i,r,s){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*jt*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,a=s.fullHeight;r+=s.offsetX*i/t,e-=s.offsetY*n/a,i*=s.width/t,n*=s.height/a}const a=this.filmOffset;0!==a&&(r+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const Ji=-90;class Ki extends On{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null;const i=new Zi(Ji,1,t,e);i.layers=this.layers,this.add(i);const r=new Zi(Ji,1,t,e);r.layers=this.layers,this.add(r);const s=new Zi(Ji,1,t,e);s.layers=this.layers,this.add(s);const a=new Zi(Ji,1,t,e);a.layers=this.layers,this.add(a);const o=new Zi(Ji,1,t,e);o.layers=this.layers,this.add(o);const l=new Zi(Ji,1,t,e);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,i,r,s,a,o]=e;for(const t of e)this.remove(t);if(t===Gt)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else{if(t!==kt)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1)}for(const t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();const n=this.renderTarget;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[i,r,s,a,o,l]=this.children,c=t.getRenderTarget(),h=t.xr.enabled;t.xr.enabled=!1;const u=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,i),t.setRenderTarget(n,1),t.render(e,r),t.setRenderTarget(n,2),t.render(e,s),t.setRenderTarget(n,3),t.render(e,a),t.setRenderTarget(n,4),t.render(e,o),n.texture.generateMipmaps=u,t.setRenderTarget(n,5),t.render(e,l),t.setRenderTarget(c),t.xr.enabled=h,n.texture.needsPMREMUpdate=!0}}class $i extends Ae{constructor(t,e,n,i,r,s,a,o,l,c){super(t=void 0!==t?t:[],e=void 0!==e?e:v,n,i,r,s,a,o,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class Qi extends Le{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];void 0!==e.encoding&&(pe("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),e.colorSpace=e.encoding===It?Dt:Ut),this.texture=new $i(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:C}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},i=new ki(5,5,5),r=new qi({name:"CubemapFromEquirect",uniforms:Vi(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:a,blending:0});r.uniforms.tEquirect.value=e;const s=new Hi(i,r),o=e.minFilter;e.minFilter===P&&(e.minFilter=C);return new Ki(1,10,this).update(t,s),e.minFilter=o,s.geometry.dispose(),s.material.dispose(),this}clear(t,e,n,i){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,n,i);t.setRenderTarget(r)}}const tr=new De,er=new De,nr=new se;class ir{constructor(t=new De(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const i=tr.subVectors(n,e).cross(er.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta(tr),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||nr.getNormalMatrix(t),i=this.coplanarPoint(tr).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const rr=new en,sr=new De;class ar{constructor(t=new ir,e=new ir,n=new ir,i=new ir,r=new ir,s=new ir){this.planes=[t,e,n,i,r,s]}set(t,e,n,i,r,s){const a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[5].copy(s),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=2e3){const n=this.planes,i=t.elements,r=i[0],s=i[1],a=i[2],o=i[3],l=i[4],c=i[5],h=i[6],u=i[7],d=i[8],p=i[9],m=i[10],f=i[11],g=i[12],_=i[13],v=i[14],y=i[15];if(n[0].setComponents(o-r,u-l,f-d,y-g).normalize(),n[1].setComponents(o+r,u+l,f+d,y+g).normalize(),n[2].setComponents(o+s,u+c,f+p,y+_).normalize(),n[3].setComponents(o-s,u-c,f-p,y-_).normalize(),n[4].setComponents(o-a,u-h,f-m,y-v).normalize(),e===Gt)n[5].setComponents(o+a,u+h,f+m,y+v).normalize();else{if(e!==kt)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);n[5].setComponents(a,h,m,v).normalize()}return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),rr.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),rr.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(rr)}intersectsSprite(t){return rr.center.set(0,0,0),rr.radius=.7071067811865476,rr.applyMatrix4(t.matrixWorld),this.intersectsSphere(rr)}intersectsSphere(t){const e=this.planes,n=t.center,i=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(n)0?t.max.x:t.min.x,sr.y=i.normal.y>0?t.max.y:t.min.y,sr.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(sr)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function or(){let t=null,e=!1,n=null,i=null;function r(e,s){n(e,s),i=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==n&&(i=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function lr(t,e){const n=e.isWebGL2,i=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),i.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const n=i.get(e);n&&(t.deleteBuffer(n.buffer),i.delete(e))},update:function(e,r){if(e.isGLBufferAttribute){const t=i.get(e);return void((!t||t.version 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tanisotropyV /= material.anisotropy;\n\tmaterial.anisotropy = saturate( material.anisotropy );\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x - tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x + tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometry.viewDir, geometry.normal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},ur={common:{diffuse:{value:new ei(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new se},alphaMap:{value:null},alphaMapTransform:{value:new se},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new se}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new se}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new se}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new se},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new se},normalScale:{value:new re(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new se},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new se}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new se}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new se}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ei(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ei(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new se},alphaTest:{value:0},uvTransform:{value:new se}},sprite:{diffuse:{value:new ei(16777215)},opacity:{value:1},center:{value:new re(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new se},alphaMap:{value:null},alphaMapTransform:{value:new se},alphaTest:{value:0}}},dr={basic:{uniforms:Wi([ur.common,ur.specularmap,ur.envmap,ur.aomap,ur.lightmap,ur.fog]),vertexShader:hr.meshbasic_vert,fragmentShader:hr.meshbasic_frag},lambert:{uniforms:Wi([ur.common,ur.specularmap,ur.envmap,ur.aomap,ur.lightmap,ur.emissivemap,ur.bumpmap,ur.normalmap,ur.displacementmap,ur.fog,ur.lights,{emissive:{value:new ei(0)}}]),vertexShader:hr.meshlambert_vert,fragmentShader:hr.meshlambert_frag},phong:{uniforms:Wi([ur.common,ur.specularmap,ur.envmap,ur.aomap,ur.lightmap,ur.emissivemap,ur.bumpmap,ur.normalmap,ur.displacementmap,ur.fog,ur.lights,{emissive:{value:new ei(0)},specular:{value:new ei(1118481)},shininess:{value:30}}]),vertexShader:hr.meshphong_vert,fragmentShader:hr.meshphong_frag},standard:{uniforms:Wi([ur.common,ur.envmap,ur.aomap,ur.lightmap,ur.emissivemap,ur.bumpmap,ur.normalmap,ur.displacementmap,ur.roughnessmap,ur.metalnessmap,ur.fog,ur.lights,{emissive:{value:new ei(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:hr.meshphysical_vert,fragmentShader:hr.meshphysical_frag},toon:{uniforms:Wi([ur.common,ur.aomap,ur.lightmap,ur.emissivemap,ur.bumpmap,ur.normalmap,ur.displacementmap,ur.gradientmap,ur.fog,ur.lights,{emissive:{value:new ei(0)}}]),vertexShader:hr.meshtoon_vert,fragmentShader:hr.meshtoon_frag},matcap:{uniforms:Wi([ur.common,ur.bumpmap,ur.normalmap,ur.displacementmap,ur.fog,{matcap:{value:null}}]),vertexShader:hr.meshmatcap_vert,fragmentShader:hr.meshmatcap_frag},points:{uniforms:Wi([ur.points,ur.fog]),vertexShader:hr.points_vert,fragmentShader:hr.points_frag},dashed:{uniforms:Wi([ur.common,ur.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:hr.linedashed_vert,fragmentShader:hr.linedashed_frag},depth:{uniforms:Wi([ur.common,ur.displacementmap]),vertexShader:hr.depth_vert,fragmentShader:hr.depth_frag},normal:{uniforms:Wi([ur.common,ur.bumpmap,ur.normalmap,ur.displacementmap,{opacity:{value:1}}]),vertexShader:hr.meshnormal_vert,fragmentShader:hr.meshnormal_frag},sprite:{uniforms:Wi([ur.sprite,ur.fog]),vertexShader:hr.sprite_vert,fragmentShader:hr.sprite_frag},background:{uniforms:{uvTransform:{value:new se},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:hr.background_vert,fragmentShader:hr.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:hr.backgroundCube_vert,fragmentShader:hr.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:hr.cube_vert,fragmentShader:hr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:hr.equirect_vert,fragmentShader:hr.equirect_frag},distanceRGBA:{uniforms:Wi([ur.common,ur.displacementmap,{referencePosition:{value:new De},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:hr.distanceRGBA_vert,fragmentShader:hr.distanceRGBA_frag},shadow:{uniforms:Wi([ur.lights,ur.fog,{color:{value:new ei(0)},opacity:{value:1}}]),vertexShader:hr.shadow_vert,fragmentShader:hr.shadow_frag}};dr.physical={uniforms:Wi([dr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new se},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new se},clearcoatNormalScale:{value:new re(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new se},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new se},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new se},sheen:{value:0},sheenColor:{value:new ei(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new se},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new se},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new se},transmissionSamplerSize:{value:new re},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new se},attenuationDistance:{value:0},attenuationColor:{value:new ei(0)},specularColor:{value:new ei(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new se},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new se},anisotropyVector:{value:new re},anisotropyMap:{value:null},anisotropyMapTransform:{value:new se}}]),vertexShader:hr.meshphysical_vert,fragmentShader:hr.meshphysical_frag};const pr={r:0,b:0,g:0};function mr(t,e,n,i,r,o,l){const c=new ei(0);let h,u,d=!0===o?0:1,p=null,m=0,f=null;function g(e,n){e.getRGB(pr,Xi(t)),i.buffers.color.setClear(pr.r,pr.g,pr.b,n,l)}return{getClearColor:function(){return c},setClearColor:function(t,e=1){c.set(t),d=e,g(c,d)},getClearAlpha:function(){return d},setClearAlpha:function(t){d=t,g(c,d)},render:function(o,_){let v=!1,y=!0===_.isScene?_.background:null;if(y&&y.isTexture){y=(_.backgroundBlurriness>0?n:e).get(y)}null===y?g(c,d):y&&y.isColor&&(g(y,1),v=!0);const x=t.xr.getEnvironmentBlendMode();"additive"===x?i.buffers.color.setClear(0,0,0,1,l):"alpha-blend"===x&&i.buffers.color.setClear(0,0,0,0,l),(t.autoClear||v)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),y&&(y.isCubeTexture||y.mapping===S)?(void 0===u&&(u=new Hi(new ki(1,1,1),new qi({name:"BackgroundCubeMaterial",uniforms:Vi(dr.backgroundCube.uniforms),vertexShader:dr.backgroundCube.vertexShader,fragmentShader:dr.backgroundCube.fragmentShader,side:a,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),u.material.uniforms.envMap.value=y,u.material.uniforms.flipEnvMap.value=y.isCubeTexture&&!1===y.isRenderTargetTexture?-1:1,u.material.uniforms.backgroundBlurriness.value=_.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,u.material.toneMapped=y.colorSpace!==Dt,p===y&&m===y.version&&f===t.toneMapping||(u.material.needsUpdate=!0,p=y,m=y.version,f=t.toneMapping),u.layers.enableAll(),o.unshift(u,u.geometry,u.material,0,0,null)):y&&y.isTexture&&(void 0===h&&(h=new Hi(new cr(2,2),new qi({name:"BackgroundMaterial",uniforms:Vi(dr.background.uniforms),vertexShader:dr.background.vertexShader,fragmentShader:dr.background.fragmentShader,side:s,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(h)),h.material.uniforms.t2D.value=y,h.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,h.material.toneMapped=y.colorSpace!==Dt,!0===y.matrixAutoUpdate&&y.updateMatrix(),h.material.uniforms.uvTransform.value.copy(y.matrix),p===y&&m===y.version&&f===t.toneMapping||(h.material.needsUpdate=!0,p=y,m=y.version,f=t.toneMapping),h.layers.enableAll(),o.unshift(h,h.geometry,h.material,0,0,null))}}}function fr(t,e,n,i){const r=t.getParameter(t.MAX_VERTEX_ATTRIBS),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),a=i.isWebGL2||null!==s,o={},l=p(null);let c=l,h=!1;function u(e){return i.isWebGL2?t.bindVertexArray(e):s.bindVertexArrayOES(e)}function d(e){return i.isWebGL2?t.deleteVertexArray(e):s.deleteVertexArrayOES(e)}function p(t){const e=[],n=[],i=[];for(let t=0;t=0){const n=r[e];let i=s[e];if(void 0===i&&("instanceMatrix"===e&&t.instanceMatrix&&(i=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(i=t.instanceColor)),void 0===n)return!0;if(n.attribute!==i)return!0;if(i&&n.data!==i.data)return!0;a++}}return c.attributesNum!==a||c.index!==i}(r,y,d,x),M&&function(t,e,n,i){const r={},s=e.attributes;let a=0;const o=n.getAttributes();for(const e in o){if(o[e].location>=0){let n=s[e];void 0===n&&("instanceMatrix"===e&&t.instanceMatrix&&(n=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(n=t.instanceColor));const i={};i.attribute=n,n&&n.data&&(i.data=n.data),r[e]=i,a++}}c.attributes=r,c.attributesNum=a,c.index=i}(r,y,d,x)}else{const t=!0===l.wireframe;c.geometry===y.id&&c.program===d.id&&c.wireframe===t||(c.geometry=y.id,c.program=d.id,c.wireframe=t,M=!0)}null!==x&&n.update(x,t.ELEMENT_ARRAY_BUFFER),(M||h)&&(h=!1,function(r,s,a,o){if(!1===i.isWebGL2&&(r.isInstancedMesh||o.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;m();const l=o.attributes,c=a.getAttributes(),h=s.defaultAttributeValues;for(const e in c){const s=c[e];if(s.location>=0){let a=l[e];if(void 0===a&&("instanceMatrix"===e&&r.instanceMatrix&&(a=r.instanceMatrix),"instanceColor"===e&&r.instanceColor&&(a=r.instanceColor)),void 0!==a){const e=a.normalized,l=a.itemSize,c=n.get(a);if(void 0===c)continue;const h=c.buffer,u=c.type,d=c.bytesPerElement,p=!0===i.isWebGL2&&(u===t.INT||u===t.UNSIGNED_INT||a.gpuType===D);if(a.isInterleavedBufferAttribute){const n=a.data,i=n.stride,c=a.offset;if(n.isInstancedInterleavedBuffer){for(let t=0;t0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===t.constructor.name;let a=void 0!==n.precision?n.precision:"highp";const o=r(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);const l=s||e.has("WEBGL_draw_buffers"),c=!0===n.logarithmicDepthBuffer,h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=t.getParameter(t.MAX_TEXTURE_SIZE),p=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),m=t.getParameter(t.MAX_VERTEX_ATTRIBS),f=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),g=t.getParameter(t.MAX_VARYING_VECTORS),_=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),v=u>0,y=s||e.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===e.has("EXT_texture_filter_anisotropic")){const n=e.get("EXT_texture_filter_anisotropic");i=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:r,precision:a,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:f,maxVaryings:g,maxFragmentUniforms:_,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:s?t.getParameter(t.MAX_SAMPLES):0}}function vr(t){const e=this;let n=null,i=0,r=!1,s=!1;const a=new ir,o=new se,l={value:null,needsUpdate:!1};function c(t,n,i,r){const s=null!==t?t.length:0;let c=null;if(0!==s){if(c=l.value,!0!==r||null===c){const e=i+4*s,r=n.matrixWorldInverse;o.getNormalMatrix(r),(null===c||c.length0);e.numPlanes=i,e.numIntersection=0}();else{const t=s?0:i,e=4*t;let r=m.clippingState||null;l.value=r,r=c(u,o,e,h);for(let t=0;t!==e;++t)r[t]=n[t];m.clippingState=r,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=t}}}function yr(t){let e=new WeakMap;function n(t,e){return e===x?t.mapping=v:e===M&&(t.mapping=y),t}function i(t){const n=t.target;n.removeEventListener("dispose",i);const r=e.get(n);void 0!==r&&(e.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture&&!1===r.isRenderTargetTexture){const s=r.mapping;if(s===x||s===M){if(e.has(r)){return n(e.get(r).texture,r.mapping)}{const s=r.image;if(s&&s.height>0){const a=new Qi(s.height/2);return a.fromEquirectangularTexture(t,r),e.set(r,a),r.addEventListener("dispose",i),n(a.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}class xr extends Yi{constructor(t=-1,e=1,n=1,i=-1,r=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=r,this.far=s,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,r,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=n-t,s=n+t,a=i+e,o=i-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,s=r+t*this.view.width,a-=e*this.view.offsetY,o=a-e*this.view.height}this.projectionMatrix.makeOrthographic(r,s,a,o,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}const Mr=[.125,.215,.35,.446,.526,.582],Sr=20,br=new xr,Tr=new ei;let Er=null;const wr=(1+Math.sqrt(5))/2,Ar=1/wr,Rr=[new De(1,1,1),new De(-1,1,1),new De(1,1,-1),new De(-1,1,-1),new De(0,wr,Ar),new De(0,wr,-Ar),new De(Ar,0,wr),new De(-Ar,0,wr),new De(wr,Ar,0),new De(-wr,Ar,0)];class Cr{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){Er=this._renderer.getRenderTarget(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,n,i,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=Ur(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Ir(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;tt-4?o=Mr[a-t+4-1]:0===a&&(o=0),i.push(o);const l=1/(s-2),c=-l,h=1+l,u=[c,c,h,c,h,h,c,c,h,h,c,h],d=6,p=6,m=3,f=2,g=1,_=new Float32Array(m*p*d),v=new Float32Array(f*p*d),y=new Float32Array(g*p*d);for(let t=0;t2?0:-1,i=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];_.set(i,m*p*t),v.set(u,f*p*t);const r=[t,t,t,t,t,t];y.set(r,g*p*t)}const x=new Si;x.setAttribute("position",new ui(_,m)),x.setAttribute("uv",new ui(v,f)),x.setAttribute("faceIndex",new ui(y,g)),e.push(x),r>4&&r--}return{lodPlanes:e,sizeLods:n,sigmas:i}}(i)),this._blurMaterial=function(t,e,n){const i=new Float32Array(Sr),r=new De(0,1,0),s=new qi({name:"SphericalGaussianBlur",defines:{n:Sr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:Dr(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1});return s}(i,t,e)}return i}_compileMaterial(t){const e=new Hi(this._lodPlanes[0],t);this._renderer.compile(e,br)}_sceneToCubeUV(t,e,n,i){const r=new Zi(90,1,e,n),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],l=this._renderer,c=l.autoClear,h=l.toneMapping;l.getClearColor(Tr),l.toneMapping=u,l.autoClear=!1;const d=new ii({name:"PMREM.Background",side:a,depthWrite:!1,depthTest:!1}),p=new Hi(new ki,d);let m=!1;const f=t.background;f?f.isColor&&(d.color.copy(f),t.background=null,m=!0):(d.color.copy(Tr),m=!0);for(let e=0;e<6;e++){const n=e%3;0===n?(r.up.set(0,s[e],0),r.lookAt(o[e],0,0)):1===n?(r.up.set(0,0,s[e]),r.lookAt(0,o[e],0)):(r.up.set(0,s[e],0),r.lookAt(0,0,o[e]));const a=this._cubeSize;Pr(i,n*a,e>2?a:0,a,a),l.setRenderTarget(i),m&&l.render(p,r),l.render(t,r)}p.geometry.dispose(),p.material.dispose(),l.toneMapping=h,l.autoClear=c,t.background=f}_textureToCubeUV(t,e){const n=this._renderer,i=t.mapping===v||t.mapping===y;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=Ur()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Ir());const r=i?this._cubemapMaterial:this._equirectMaterial,s=new Hi(this._lodPlanes[0],r);r.uniforms.envMap.value=t;const a=this._cubeSize;Pr(e,0,0,3*a,2*a),n.setRenderTarget(e),n.render(s,br)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;for(let e=1;eSr&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to 20`);const f=[];let g=0;for(let t=0;t_-4?i-_+4:0),4*(this._cubeSize-v),3*v,2*v),o.setRenderTarget(e),o.render(c,br)}}function Lr(t,e,n){const i=new Le(t,e,n);return i.texture.mapping=S,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Pr(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function Ir(){return new qi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Dr(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Ur(){return new qi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Dr(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Dr(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function Nr(t){let e=new WeakMap,n=null;function i(t){const n=t.target;n.removeEventListener("dispose",i);const r=e.get(n);void 0!==r&&(e.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){const s=r.mapping,a=s===x||s===M,o=s===v||s===y;if(a||o){if(r.isRenderTargetTexture&&!0===r.needsPMREMUpdate){r.needsPMREMUpdate=!1;let i=e.get(r);return null===n&&(n=new Cr(t)),i=a?n.fromEquirectangular(r,i):n.fromCubemap(r,i),e.set(r,i),i.texture}if(e.has(r))return e.get(r).texture;{const s=r.image;if(a&&s&&s.height>0||o&&s&&function(t){let e=0;const n=6;for(let i=0;ie.maxTextureSize&&(E=Math.ceil(T/e.maxTextureSize),T=e.maxTextureSize);const w=new Float32Array(T*E*4*p),A=new Pe(w,T,E,p);A.type=O,A.needsUpdate=!0;const R=4*b;for(let L=0;L0)return t;const r=e*n;let s=Yr[r];if(void 0===s&&(s=new Float32Array(r),Yr[r]=s),0!==e){i.toArray(s,0);for(let i=1,r=0;i!==e;++i)r+=n,t[i].toArray(s,r)}return s}function ts(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n":" "} ${r}: ${n[t]}`)}return i.join("\n")}(t.getShaderSource(e),i)}return r}function Ks(t,e){const n=function(t){switch(t){case Nt:return["Linear","( value )"];case Dt:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),["Linear","( value )"]}}(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function $s(t,e){let n;switch(e){case d:n="Linear";break;case p:n="Reinhard";break;case m:n="OptimizedCineon";break;case f:n="ACESFilmic";break;case g:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Qs(t){return""!==t}function ta(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function ea(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const na=/^[ \t]*#include +<([\w\d./]+)>/gm;function ia(t){return t.replace(na,sa)}const ra=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function sa(t,e){let n=hr[e];if(void 0===n){const t=ra.get(e);if(void 0===t)throw new Error("Can not resolve #include <"+e+">");n=hr[t],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,t)}return ia(n)}const aa=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function oa(t){return t.replace(aa,la)}function la(t,e,n,i){let r="";for(let t=parseInt(e);t0&&(w+="\n"),A=[b,"#define SHADER_TYPE "+s.shaderType,"#define SHADER_NAME "+s.shaderName,T].filter(Qs).join("\n"),A.length>0&&(A+="\n")):(w=[ca(s),"#define SHADER_TYPE "+s.shaderType,"#define SHADER_NAME "+s.shaderName,T,s.instancing?"#define USE_INSTANCING":"",s.instancingColor?"#define USE_INSTANCING_COLOR":"",s.useFog&&s.fog?"#define USE_FOG":"",s.useFog&&s.fogExp2?"#define FOG_EXP2":"",s.map?"#define USE_MAP":"",s.envMap?"#define USE_ENVMAP":"",s.envMap?"#define "+_:"",s.lightMap?"#define USE_LIGHTMAP":"",s.aoMap?"#define USE_AOMAP":"",s.bumpMap?"#define USE_BUMPMAP":"",s.normalMap?"#define USE_NORMALMAP":"",s.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",s.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",s.displacementMap?"#define USE_DISPLACEMENTMAP":"",s.emissiveMap?"#define USE_EMISSIVEMAP":"",s.anisotropyMap?"#define USE_ANISOTROPYMAP":"",s.clearcoatMap?"#define USE_CLEARCOATMAP":"",s.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",s.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",s.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",s.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",s.specularMap?"#define USE_SPECULARMAP":"",s.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",s.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",s.roughnessMap?"#define USE_ROUGHNESSMAP":"",s.metalnessMap?"#define USE_METALNESSMAP":"",s.alphaMap?"#define USE_ALPHAMAP":"",s.alphaHash?"#define USE_ALPHAHASH":"",s.transmission?"#define USE_TRANSMISSION":"",s.transmissionMap?"#define USE_TRANSMISSIONMAP":"",s.thicknessMap?"#define USE_THICKNESSMAP":"",s.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",s.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",s.mapUv?"#define MAP_UV "+s.mapUv:"",s.alphaMapUv?"#define ALPHAMAP_UV "+s.alphaMapUv:"",s.lightMapUv?"#define LIGHTMAP_UV "+s.lightMapUv:"",s.aoMapUv?"#define AOMAP_UV "+s.aoMapUv:"",s.emissiveMapUv?"#define EMISSIVEMAP_UV "+s.emissiveMapUv:"",s.bumpMapUv?"#define BUMPMAP_UV "+s.bumpMapUv:"",s.normalMapUv?"#define NORMALMAP_UV "+s.normalMapUv:"",s.displacementMapUv?"#define DISPLACEMENTMAP_UV "+s.displacementMapUv:"",s.metalnessMapUv?"#define METALNESSMAP_UV "+s.metalnessMapUv:"",s.roughnessMapUv?"#define ROUGHNESSMAP_UV "+s.roughnessMapUv:"",s.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+s.anisotropyMapUv:"",s.clearcoatMapUv?"#define CLEARCOATMAP_UV "+s.clearcoatMapUv:"",s.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+s.clearcoatNormalMapUv:"",s.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+s.clearcoatRoughnessMapUv:"",s.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+s.iridescenceMapUv:"",s.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+s.iridescenceThicknessMapUv:"",s.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+s.sheenColorMapUv:"",s.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+s.sheenRoughnessMapUv:"",s.specularMapUv?"#define SPECULARMAP_UV "+s.specularMapUv:"",s.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+s.specularColorMapUv:"",s.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+s.specularIntensityMapUv:"",s.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+s.transmissionMapUv:"",s.thicknessMapUv?"#define THICKNESSMAP_UV "+s.thicknessMapUv:"",s.vertexTangents&&!1===s.flatShading?"#define USE_TANGENT":"",s.vertexColors?"#define USE_COLOR":"",s.vertexAlphas?"#define USE_COLOR_ALPHA":"",s.vertexUv1s?"#define USE_UV1":"",s.vertexUv2s?"#define USE_UV2":"",s.vertexUv3s?"#define USE_UV3":"",s.pointsUvs?"#define USE_POINTS_UV":"",s.flatShading?"#define FLAT_SHADED":"",s.skinning?"#define USE_SKINNING":"",s.morphTargets?"#define USE_MORPHTARGETS":"",s.morphNormals&&!1===s.flatShading?"#define USE_MORPHNORMALS":"",s.morphColors&&s.isWebGL2?"#define USE_MORPHCOLORS":"",s.morphTargetsCount>0&&s.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",s.morphTargetsCount>0&&s.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+s.morphTextureStride:"",s.morphTargetsCount>0&&s.isWebGL2?"#define MORPHTARGETS_COUNT "+s.morphTargetsCount:"",s.doubleSided?"#define DOUBLE_SIDED":"",s.flipSided?"#define FLIP_SIDED":"",s.shadowMapEnabled?"#define USE_SHADOWMAP":"",s.shadowMapEnabled?"#define "+f:"",s.sizeAttenuation?"#define USE_SIZEATTENUATION":"",s.useLegacyLights?"#define LEGACY_LIGHTS":"",s.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",s.logarithmicDepthBuffer&&s.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Qs).join("\n"),A=[b,ca(s),"#define SHADER_TYPE "+s.shaderType,"#define SHADER_NAME "+s.shaderName,T,s.useFog&&s.fog?"#define USE_FOG":"",s.useFog&&s.fogExp2?"#define FOG_EXP2":"",s.map?"#define USE_MAP":"",s.matcap?"#define USE_MATCAP":"",s.envMap?"#define USE_ENVMAP":"",s.envMap?"#define "+g:"",s.envMap?"#define "+_:"",s.envMap?"#define "+x:"",M?"#define CUBEUV_TEXEL_WIDTH "+M.texelWidth:"",M?"#define CUBEUV_TEXEL_HEIGHT "+M.texelHeight:"",M?"#define CUBEUV_MAX_MIP "+M.maxMip+".0":"",s.lightMap?"#define USE_LIGHTMAP":"",s.aoMap?"#define USE_AOMAP":"",s.bumpMap?"#define USE_BUMPMAP":"",s.normalMap?"#define USE_NORMALMAP":"",s.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",s.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",s.emissiveMap?"#define USE_EMISSIVEMAP":"",s.anisotropy?"#define USE_ANISOTROPY":"",s.anisotropyMap?"#define USE_ANISOTROPYMAP":"",s.clearcoat?"#define USE_CLEARCOAT":"",s.clearcoatMap?"#define USE_CLEARCOATMAP":"",s.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",s.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",s.iridescence?"#define USE_IRIDESCENCE":"",s.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",s.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",s.specularMap?"#define USE_SPECULARMAP":"",s.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",s.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",s.roughnessMap?"#define USE_ROUGHNESSMAP":"",s.metalnessMap?"#define USE_METALNESSMAP":"",s.alphaMap?"#define USE_ALPHAMAP":"",s.alphaTest?"#define USE_ALPHATEST":"",s.alphaHash?"#define USE_ALPHAHASH":"",s.sheen?"#define USE_SHEEN":"",s.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",s.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",s.transmission?"#define USE_TRANSMISSION":"",s.transmissionMap?"#define USE_TRANSMISSIONMAP":"",s.thicknessMap?"#define USE_THICKNESSMAP":"",s.vertexTangents&&!1===s.flatShading?"#define USE_TANGENT":"",s.vertexColors||s.instancingColor?"#define USE_COLOR":"",s.vertexAlphas?"#define USE_COLOR_ALPHA":"",s.vertexUv1s?"#define USE_UV1":"",s.vertexUv2s?"#define USE_UV2":"",s.vertexUv3s?"#define USE_UV3":"",s.pointsUvs?"#define USE_POINTS_UV":"",s.gradientMap?"#define USE_GRADIENTMAP":"",s.flatShading?"#define FLAT_SHADED":"",s.doubleSided?"#define DOUBLE_SIDED":"",s.flipSided?"#define FLIP_SIDED":"",s.shadowMapEnabled?"#define USE_SHADOWMAP":"",s.shadowMapEnabled?"#define "+f:"",s.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",s.useLegacyLights?"#define LEGACY_LIGHTS":"",s.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",s.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",s.logarithmicDepthBuffer&&s.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",s.toneMapping!==u?"#define TONE_MAPPING":"",s.toneMapping!==u?hr.tonemapping_pars_fragment:"",s.toneMapping!==u?$s("toneMapping",s.toneMapping):"",s.dithering?"#define DITHERING":"",s.opaque?"#define OPAQUE":"",hr.colorspace_pars_fragment,Ks("linearToOutputTexel",s.outputColorSpace),s.useDepthPacking?"#define DEPTH_PACKING "+s.depthPacking:"","\n"].filter(Qs).join("\n")),p=ia(p),p=ta(p,s),p=ea(p,s),m=ia(m),m=ta(m,s),m=ea(m,s),p=oa(p),m=oa(m),s.isWebGL2&&!0!==s.isRawShaderMaterial&&(R="#version 300 es\n",w=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+w,A=["#define varying in",s.glslVersion===zt?"":"layout(location = 0) out highp vec4 pc_fragColor;",s.glslVersion===zt?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+A);const C=R+w+p,L=R+A+m,P=Ys(o,o.VERTEX_SHADER,C),I=Ys(o,o.FRAGMENT_SHADER,L);if(o.attachShader(E,P),o.attachShader(E,I),void 0!==s.index0AttributeName?o.bindAttribLocation(E,0,s.index0AttributeName):!0===s.morphTargets&&o.bindAttribLocation(E,0,"position"),o.linkProgram(E),t.debug.checkShaderErrors){const e=o.getProgramInfoLog(E).trim(),n=o.getShaderInfoLog(P).trim(),i=o.getShaderInfoLog(I).trim();let r=!0,s=!0;if(!1===o.getProgramParameter(E,o.LINK_STATUS))if(r=!1,"function"==typeof t.debug.onShaderError)t.debug.onShaderError(o,E,P,I);else{const t=Js(o,P,"vertex"),n=Js(o,I,"fragment");console.error("THREE.WebGLProgram: Shader Error "+o.getError()+" - VALIDATE_STATUS "+o.getProgramParameter(E,o.VALIDATE_STATUS)+"\n\nProgram Info Log: "+e+"\n"+t+"\n"+n)}else""!==e?console.warn("THREE.WebGLProgram: Program Info Log:",e):""!==n&&""!==i||(s=!1);s&&(this.diagnostics={runnable:r,programLog:e,vertexShader:{log:n,prefix:w},fragmentShader:{log:i,prefix:A}})}let U,D;return o.deleteShader(P),o.deleteShader(I),this.getUniforms=function(){return void 0===U&&(U=new qs(o,E)),U},this.getAttributes=function(){return void 0===D&&(D=function(t,e){const n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let r=0;r0,Y=s.clearcoat>0,Z=s.iridescence>0,J=s.sheen>0,K=s.transmission>0,$=q&&!!s.anisotropyMap,Q=Y&&!!s.clearcoatMap,tt=Y&&!!s.clearcoatNormalMap,et=Y&&!!s.clearcoatRoughnessMap,nt=Z&&!!s.iridescenceMap,it=Z&&!!s.iridescenceThicknessMap,rt=J&&!!s.sheenColorMap,st=J&&!!s.sheenRoughnessMap,at=!!s.specularMap,ot=!!s.specularColorMap,lt=!!s.specularIntensityMap,ct=K&&!!s.transmissionMap,ht=K&&!!s.thicknessMap,ut=!!s.gradientMap,dt=!!s.alphaMap,pt=s.alphaTest>0,mt=!!s.alphaHash,ft=!!s.extensions,gt=!!M.attributes.uv1,_t=!!M.attributes.uv2,vt=!!M.attributes.uv3;let yt=u;return s.toneMapped&&(null!==D&&!0!==D.isXRRenderTarget||(yt=t.toneMapping)),{isWebGL2:d,shaderID:w,shaderType:s.type,shaderName:s.name,vertexShader:C,fragmentShader:L,defines:s.defines,customVertexShaderID:P,customFragmentShaderID:I,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:f,instancing:N,instancingColor:N&&null!==y.instanceColor,supportsVertexTextures:m,outputColorSpace:null===D?t.outputColorSpace:!0===D.isXRRenderTarget?D.texture.colorSpace:Nt,map:O,matcap:F,envMap:B,envMapMode:B&&T.mapping,envMapCubeUVHeight:E,aoMap:z,lightMap:H,bumpMap:G,normalMap:k,displacementMap:m&&V,emissiveMap:W,normalMapObjectSpace:k&&1===s.normalMapType,normalMapTangentSpace:k&&0===s.normalMapType,metalnessMap:X,roughnessMap:j,anisotropy:q,anisotropyMap:$,clearcoat:Y,clearcoatMap:Q,clearcoatNormalMap:tt,clearcoatRoughnessMap:et,iridescence:Z,iridescenceMap:nt,iridescenceThicknessMap:it,sheen:J,sheenColorMap:rt,sheenRoughnessMap:st,specularMap:at,specularColorMap:ot,specularIntensityMap:lt,transmission:K,transmissionMap:ct,thicknessMap:ht,gradientMap:ut,opaque:!1===s.transparent&&1===s.blending,alphaMap:dt,alphaTest:pt,alphaHash:mt,combine:s.combine,mapUv:O&&_(s.map.channel),aoMapUv:z&&_(s.aoMap.channel),lightMapUv:H&&_(s.lightMap.channel),bumpMapUv:G&&_(s.bumpMap.channel),normalMapUv:k&&_(s.normalMap.channel),displacementMapUv:V&&_(s.displacementMap.channel),emissiveMapUv:W&&_(s.emissiveMap.channel),metalnessMapUv:X&&_(s.metalnessMap.channel),roughnessMapUv:j&&_(s.roughnessMap.channel),anisotropyMapUv:$&&_(s.anisotropyMap.channel),clearcoatMapUv:Q&&_(s.clearcoatMap.channel),clearcoatNormalMapUv:tt&&_(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:et&&_(s.clearcoatRoughnessMap.channel),iridescenceMapUv:nt&&_(s.iridescenceMap.channel),iridescenceThicknessMapUv:it&&_(s.iridescenceThicknessMap.channel),sheenColorMapUv:rt&&_(s.sheenColorMap.channel),sheenRoughnessMapUv:st&&_(s.sheenRoughnessMap.channel),specularMapUv:at&&_(s.specularMap.channel),specularColorMapUv:ot&&_(s.specularColorMap.channel),specularIntensityMapUv:lt&&_(s.specularIntensityMap.channel),transmissionMapUv:ct&&_(s.transmissionMap.channel),thicknessMapUv:ht&&_(s.thicknessMap.channel),alphaMapUv:dt&&_(s.alphaMap.channel),vertexTangents:!!M.attributes.tangent&&(k||q),vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!M.attributes.color&&4===M.attributes.color.itemSize,vertexUv1s:gt,vertexUv2s:_t,vertexUv3s:vt,pointsUvs:!0===y.isPoints&&!!M.attributes.uv&&(O||dt),fog:!!x,useFog:!0===s.fog,fogExp2:x&&x.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:p,skinning:!0===y.isSkinnedMesh,morphTargets:void 0!==M.morphAttributes.position,morphNormals:void 0!==M.morphAttributes.normal,morphColors:void 0!==M.morphAttributes.color,morphTargetsCount:R,morphTextureStride:U,numDirLights:l.directional.length,numPointLights:l.point.length,numSpotLights:l.spot.length,numSpotLightMaps:l.spotLightMap.length,numRectAreaLights:l.rectArea.length,numHemiLights:l.hemi.length,numDirLightShadows:l.directionalShadowMap.length,numPointLightShadows:l.pointShadowMap.length,numSpotLightShadows:l.spotShadowMap.length,numSpotLightShadowsWithMaps:l.numSpotLightShadowsWithMaps,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&h.length>0,shadowMapType:t.shadowMap.type,toneMapping:yt,useLegacyLights:t._useLegacyLights,decodeVideoTexture:O&&!0===s.map.isVideoTexture&&s.map.colorSpace===Dt,premultipliedAlpha:s.premultipliedAlpha,doubleSided:2===s.side,flipSided:s.side===a,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:ft&&!0===s.extensions.derivatives,extensionFragDepth:ft&&!0===s.extensions.fragDepth,extensionDrawBuffers:ft&&!0===s.extensions.drawBuffers,extensionShaderTextureLOD:ft&&!0===s.extensions.shaderTextureLOD,rendererExtensionFragDepth:d||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:d||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:d||i.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.customVertexShaderID),n.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(!function(t,e){t.push(e.precision),t.push(e.outputColorSpace),t.push(e.envMapMode),t.push(e.envMapCubeUVHeight),t.push(e.mapUv),t.push(e.alphaMapUv),t.push(e.lightMapUv),t.push(e.aoMapUv),t.push(e.bumpMapUv),t.push(e.normalMapUv),t.push(e.displacementMapUv),t.push(e.emissiveMapUv),t.push(e.metalnessMapUv),t.push(e.roughnessMapUv),t.push(e.anisotropyMapUv),t.push(e.clearcoatMapUv),t.push(e.clearcoatNormalMapUv),t.push(e.clearcoatRoughnessMapUv),t.push(e.iridescenceMapUv),t.push(e.iridescenceThicknessMapUv),t.push(e.sheenColorMapUv),t.push(e.sheenRoughnessMapUv),t.push(e.specularMapUv),t.push(e.specularColorMapUv),t.push(e.specularIntensityMapUv),t.push(e.transmissionMapUv),t.push(e.thicknessMapUv),t.push(e.combine),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numSpotLightMaps),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.numSpotLightShadowsWithMaps),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}(n,e),function(t,e){l.disableAll(),e.isWebGL2&&l.enable(0);e.supportsVertexTextures&&l.enable(1);e.instancing&&l.enable(2);e.instancingColor&&l.enable(3);e.matcap&&l.enable(4);e.envMap&&l.enable(5);e.normalMapObjectSpace&&l.enable(6);e.normalMapTangentSpace&&l.enable(7);e.clearcoat&&l.enable(8);e.iridescence&&l.enable(9);e.alphaTest&&l.enable(10);e.vertexColors&&l.enable(11);e.vertexAlphas&&l.enable(12);e.vertexUv1s&&l.enable(13);e.vertexUv2s&&l.enable(14);e.vertexUv3s&&l.enable(15);e.vertexTangents&&l.enable(16);e.anisotropy&&l.enable(17);t.push(l.mask),l.disableAll(),e.fog&&l.enable(0);e.useFog&&l.enable(1);e.flatShading&&l.enable(2);e.logarithmicDepthBuffer&&l.enable(3);e.skinning&&l.enable(4);e.morphTargets&&l.enable(5);e.morphNormals&&l.enable(6);e.morphColors&&l.enable(7);e.premultipliedAlpha&&l.enable(8);e.shadowMapEnabled&&l.enable(9);e.useLegacyLights&&l.enable(10);e.doubleSided&&l.enable(11);e.flipSided&&l.enable(12);e.useDepthPacking&&l.enable(13);e.dithering&&l.enable(14);e.transmission&&l.enable(15);e.sheen&&l.enable(16);e.opaque&&l.enable(17);e.pointsUvs&&l.enable(18);e.decodeVideoTexture&&l.enable(19);t.push(l.mask)}(n,e),n.push(t.outputColorSpace)),n.push(e.customProgramCacheKey),n.join()},getUniforms:function(t){const e=g[t.type];let n;if(e){const t=dr[e];n=ji.clone(t.uniforms)}else n=t.uniforms;return n},acquireProgram:function(e,n){let i;for(let t=0,e=h.length;t0?i.push(h):!0===a.transparent?r.push(h):n.push(h)},unshift:function(t,e,a,o,l,c){const h=s(t,e,a,o,l,c);a.transmission>0?i.unshift(h):!0===a.transparent?r.unshift(h):n.unshift(h)},finish:function(){for(let n=e,i=t.length;n1&&n.sort(t||ga),i.length>1&&i.sort(e||_a),r.length>1&&r.sort(e||_a)}}}function ya(){let t=new WeakMap;return{get:function(e,n){const i=t.get(e);let r;return void 0===i?(r=new va,t.set(e,[r])):n>=i.length?(r=new va,i.push(r)):r=i[n],r},dispose:function(){t=new WeakMap}}}function xa(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new De,color:new ei};break;case"SpotLight":n={position:new De,direction:new De,color:new ei,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new De,color:new ei,distance:0,decay:0};break;case"HemisphereLight":n={direction:new De,skyColor:new ei,groundColor:new ei};break;case"RectAreaLight":n={color:new ei,position:new De,halfWidth:new De,halfHeight:new De}}return t[e.id]=n,n}}}let Ma=0;function Sa(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function ba(t,e){const n=new xa,i=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new re};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new re,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let t=0;t<9;t++)r.probe.push(new De);const s=new De,a=new un,o=new un;return{setup:function(s,a){let o=0,l=0,c=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let h=0,u=0,d=0,p=0,m=0,f=0,g=0,_=0,v=0,y=0;s.sort(Sa);const x=!0===a?Math.PI:1;for(let t=0,e=s.length;t0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=ur.LTC_FLOAT_1,r.rectAreaLTC2=ur.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=ur.LTC_HALF_1,r.rectAreaLTC2=ur.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=o,r.ambient[1]=l,r.ambient[2]=c;const M=r.hash;M.directionalLength===h&&M.pointLength===u&&M.spotLength===d&&M.rectAreaLength===p&&M.hemiLength===m&&M.numDirectionalShadows===f&&M.numPointShadows===g&&M.numSpotShadows===_&&M.numSpotMaps===v||(r.directional.length=h,r.spot.length=d,r.rectArea.length=p,r.point.length=u,r.hemi.length=m,r.directionalShadow.length=f,r.directionalShadowMap.length=f,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=_,r.spotShadowMap.length=_,r.directionalShadowMatrix.length=f,r.pointShadowMatrix.length=g,r.spotLightMatrix.length=_+v-y,r.spotLightMap.length=v,r.numSpotLightShadowsWithMaps=y,M.directionalLength=h,M.pointLength=u,M.spotLength=d,M.rectAreaLength=p,M.hemiLength=m,M.numDirectionalShadows=f,M.numPointShadows=g,M.numSpotShadows=_,M.numSpotMaps=v,r.version=Ma++)},setupView:function(t,e){let n=0,i=0,l=0,c=0,h=0;const u=e.matrixWorldInverse;for(let e=0,d=t.length;e=s.length?(a=new Ta(t,e),s.push(a)):a=s[r],a},dispose:function(){n=new WeakMap}}}class wa extends Jn{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class Aa extends Jn{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}function Ra(t,e,i){let o=new ar;const l=new re,c=new re,h=new Re,u=new wa({depthPacking:3201}),d=new Aa,p={},m=i.maxTextureSize,f={[s]:a,[a]:s,2:2},g=new qi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new re},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),_=g.clone();_.defines.HORIZONTAL_PASS=1;const v=new Si;v.setAttribute("position",new ui(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const y=new Hi(v,g),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=n;let M=this.type;function S(n,i){const r=e.update(y);g.defines.VSM_SAMPLES!==n.blurSamples&&(g.defines.VSM_SAMPLES=n.blurSamples,_.defines.VSM_SAMPLES=n.blurSamples,g.needsUpdate=!0,_.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new Le(l.x,l.y)),g.uniforms.shadow_pass.value=n.map.texture,g.uniforms.resolution.value=n.mapSize,g.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(i,null,r,g,y,null),_.uniforms.shadow_pass.value=n.mapPass.texture,_.uniforms.resolution.value=n.mapSize,_.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(i,null,r,_,y,null)}function b(e,n,i,s){let a=null;const o=!0===i.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(void 0!==o)a=o;else if(a=!0===i.isPointLight?d:u,t.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const t=a.uuid,e=n.uuid;let i=p[t];void 0===i&&(i={},p[t]=i);let r=i[e];void 0===r&&(r=a.clone(),i[e]=r),a=r}if(a.visible=n.visible,a.wireframe=n.wireframe,a.side=s===r?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:f[n.side],a.alphaMap=n.alphaMap,a.alphaTest=n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,!0===i.isPointLight&&!0===a.isMeshDistanceMaterial){t.properties.get(a).light=i}return a}function T(n,i,s,a,l){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&l===r)&&(!n.frustumCulled||o.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const i=e.update(n),r=n.material;if(Array.isArray(r)){const e=i.groups;for(let o=0,c=e.length;om||l.y>m)&&(l.x>m&&(c.x=Math.floor(m/g.x),l.x=c.x*g.x,u.mapSize.x=c.x),l.y>m&&(c.y=Math.floor(m/g.y),l.y=c.y*g.y,u.mapSize.y=c.y)),null===u.map||!0===p||!0===f){const t=this.type!==r?{minFilter:w,magFilter:w}:{};null!==u.map&&u.map.dispose(),u.map=new Le(l.x,l.y,t),u.map.texture.name=a.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const _=u.getViewportCount();for(let t=0;t<_;t++){const e=u.getViewport(t);h.set(c.x*e.x,c.y*e.y,c.x*e.z,c.y*e.w),d.viewport(h),u.updateMatrices(a,t),o=u.getFrustum(),T(n,i,u.camera,a,this.type)}!0!==u.isPointLightShadow&&this.type===r&&S(u,i),u.needsUpdate=!1}M=this.type,x.needsUpdate=!1,t.setRenderTarget(s,a,u)}}function Ca(t,e,n){const i=n.isWebGL2;const r=new function(){let e=!1;const n=new Re;let i=null;const r=new Re(0,0,0,0);return{setMask:function(n){i===n||e||(t.colorMask(n,n,n,n),i=n)},setLocked:function(t){e=t},setClear:function(e,i,s,a,o){!0===o&&(e*=a,i*=a,s*=a),n.set(e,i,s,a),!1===r.equals(n)&&(t.clearColor(e,i,s,a),r.copy(n))},reset:function(){e=!1,i=null,r.set(-1,0,0,0)}}},s=new function(){let e=!1,n=null,i=null,r=null;return{setTest:function(e){e?k(t.DEPTH_TEST):V(t.DEPTH_TEST)},setMask:function(i){n===i||e||(t.depthMask(i),n=i)},setFunc:function(e){if(i!==e){switch(e){case 0:t.depthFunc(t.NEVER);break;case 1:t.depthFunc(t.ALWAYS);break;case 2:t.depthFunc(t.LESS);break;case 3:default:t.depthFunc(t.LEQUAL);break;case 4:t.depthFunc(t.EQUAL);break;case 5:t.depthFunc(t.GEQUAL);break;case 6:t.depthFunc(t.GREATER);break;case 7:t.depthFunc(t.NOTEQUAL)}i=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=!1,n=null,i=null,r=null}}},l=new function(){let e=!1,n=null,i=null,r=null,s=null,a=null,o=null,l=null,c=null;return{setTest:function(n){e||(n?k(t.STENCIL_TEST):V(t.STENCIL_TEST))},setMask:function(i){n===i||e||(t.stencilMask(i),n=i)},setFunc:function(e,n,a){i===e&&r===n&&s===a||(t.stencilFunc(e,n,a),i=e,r=n,s=a)},setOp:function(e,n,i){a===e&&o===n&&l===i||(t.stencilOp(e,n,i),a=e,o=n,l=i)},setLocked:function(t){e=t},setClear:function(e){c!==e&&(t.clearStencil(e),c=e)},reset:function(){e=!1,n=null,i=null,r=null,s=null,a=null,o=null,l=null,c=null}}},c=new WeakMap,h=new WeakMap;let u={},d={},p=new WeakMap,m=[],f=null,g=!1,_=null,v=null,y=null,x=null,M=null,S=null,b=null,T=!1,E=null,w=null,A=null,R=null,C=null;const L=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let P=!1,I=0;const U=t.getParameter(t.VERSION);-1!==U.indexOf("WebGL")?(I=parseFloat(/^WebGL (\d)/.exec(U)[1]),P=I>=1):-1!==U.indexOf("OpenGL ES")&&(I=parseFloat(/^OpenGL ES (\d)/.exec(U)[1]),P=I>=2);let D=null,N={};const O=t.getParameter(t.SCISSOR_BOX),F=t.getParameter(t.VIEWPORT),B=(new Re).fromArray(O),z=(new Re).fromArray(F);function H(e,n,r,s){const a=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let o=0;oi||t.height>i)&&(r=i/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const i=e?te:Math.floor,s=i(r*t.width),a=i(r*t.height);void 0===f&&(f=v(s,a));const o=n?v(s,a):f;o.width=s,o.height=a;return o.getContext("2d").drawImage(t,0,0,s,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+a+")."),o}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function x(t){return $t(t.width)&&$t(t.height)}function M(t,e){return t.generateMipmaps&&e&&t.minFilter!==w&&t.minFilter!==C}function S(e){t.generateMipmap(e)}function D(n,i,r,s,a=!1){if(!1===o)return i;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let l=i;return i===t.RED&&(r===t.FLOAT&&(l=t.R32F),r===t.HALF_FLOAT&&(l=t.R16F),r===t.UNSIGNED_BYTE&&(l=t.R8)),i===t.RED_INTEGER&&(r===t.UNSIGNED_BYTE&&(l=t.R8UI),r===t.UNSIGNED_SHORT&&(l=t.R16UI),r===t.UNSIGNED_INT&&(l=t.R32UI),r===t.BYTE&&(l=t.R8I),r===t.SHORT&&(l=t.R16I),r===t.INT&&(l=t.R32I)),i===t.RG&&(r===t.FLOAT&&(l=t.RG32F),r===t.HALF_FLOAT&&(l=t.RG16F),r===t.UNSIGNED_BYTE&&(l=t.RG8)),i===t.RGBA&&(r===t.FLOAT&&(l=t.RGBA32F),r===t.HALF_FLOAT&&(l=t.RGBA16F),r===t.UNSIGNED_BYTE&&(l=s===Dt&&!1===a?t.SRGB8_ALPHA8:t.RGBA8),r===t.UNSIGNED_SHORT_4_4_4_4&&(l=t.RGBA4),r===t.UNSIGNED_SHORT_5_5_5_1&&(l=t.RGB5_A1)),l!==t.R16F&&l!==t.R32F&&l!==t.RG16F&&l!==t.RG32F&&l!==t.RGBA16F&&l!==t.RGBA32F||e.get("EXT_color_buffer_float"),l}function B(t,e,n){return!0===M(t,n)||t.isFramebufferTexture&&t.minFilter!==w&&t.minFilter!==C?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function z(e){return e===w||e===A||e===R?t.NEAREST:t.LINEAR}function W(t){const e=t.target;e.removeEventListener("dispose",W),function(t){const e=i.get(t);if(void 0===e.__webglInit)return;const n=t.source,r=g.get(n);if(r){const i=r[e.__cacheKey];i.usedTimes--,0===i.usedTimes&&j(t),0===Object.keys(r).length&&g.delete(n)}i.remove(t)}(e),e.isVideoTexture&&m.delete(e)}function X(e){const n=e.target;n.removeEventListener("dispose",X),function(e){const n=e.texture,r=i.get(e),s=i.get(n);void 0!==s.__webglTexture&&(t.deleteTexture(s.__webglTexture),a.memory.textures--);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++){if(Array.isArray(r.__webglFramebuffer[e]))for(let n=0;n0&&s.__version!==e.version){const t=e.image;if(null===t)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==t.complete)return void tt(s,e,r);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(t.TEXTURE_2D,s.__webglTexture,t.TEXTURE0+r)}const Z={[b]:t.REPEAT,[T]:t.CLAMP_TO_EDGE,[E]:t.MIRRORED_REPEAT},J={[w]:t.NEAREST,[A]:t.NEAREST_MIPMAP_NEAREST,[R]:t.NEAREST_MIPMAP_LINEAR,[C]:t.LINEAR,[L]:t.LINEAR_MIPMAP_NEAREST,[P]:t.LINEAR_MIPMAP_LINEAR},K={512:t.NEVER,519:t.ALWAYS,513:t.LESS,515:t.LEQUAL,514:t.EQUAL,518:t.GEQUAL,516:t.GREATER,517:t.NOTEQUAL};function $(n,s,a){if(a?(t.texParameteri(n,t.TEXTURE_WRAP_S,Z[s.wrapS]),t.texParameteri(n,t.TEXTURE_WRAP_T,Z[s.wrapT]),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,Z[s.wrapR]),t.texParameteri(n,t.TEXTURE_MAG_FILTER,J[s.magFilter]),t.texParameteri(n,t.TEXTURE_MIN_FILTER,J[s.minFilter])):(t.texParameteri(n,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(n,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),s.wrapS===T&&s.wrapT===T||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,t.TEXTURE_MAG_FILTER,z(s.magFilter)),t.texParameteri(n,t.TEXTURE_MIN_FILTER,z(s.minFilter)),s.minFilter!==w&&s.minFilter!==C&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),s.compareFunction&&(t.texParameteri(n,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(n,t.TEXTURE_COMPARE_FUNC,K[s.compareFunction])),!0===e.has("EXT_texture_filter_anisotropic")){const a=e.get("EXT_texture_filter_anisotropic");if(s.magFilter===w)return;if(s.minFilter!==R&&s.minFilter!==P)return;if(s.type===O&&!1===e.has("OES_texture_float_linear"))return;if(!1===o&&s.type===F&&!1===e.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||i.get(s).__currentAnisotropy)&&(t.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),i.get(s).__currentAnisotropy=s.anisotropy)}}function Q(e,n){let i=!1;void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",W));const r=n.source;let s=g.get(r);void 0===s&&(s={},g.set(r,s));const o=function(t){const e=[];return e.push(t.wrapS),e.push(t.wrapT),e.push(t.wrapR||0),e.push(t.magFilter),e.push(t.minFilter),e.push(t.anisotropy),e.push(t.internalFormat),e.push(t.format),e.push(t.type),e.push(t.generateMipmaps),e.push(t.premultiplyAlpha),e.push(t.flipY),e.push(t.unpackAlignment),e.push(t.colorSpace),e.join()}(n);if(o!==e.__cacheKey){void 0===s[o]&&(s[o]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,i=!0),s[o].usedTimes++;const r=s[e.__cacheKey];void 0!==r&&(s[e.__cacheKey].usedTimes--,0===r.usedTimes&&j(n)),e.__cacheKey=o,e.__webglTexture=s[o].texture}return i}function tt(e,r,a){let l=t.TEXTURE_2D;(r.isDataArrayTexture||r.isCompressedArrayTexture)&&(l=t.TEXTURE_2D_ARRAY),r.isData3DTexture&&(l=t.TEXTURE_3D);const c=Q(e,r),u=r.source;n.bindTexture(l,e.__webglTexture,t.TEXTURE0+a);const d=i.get(u);if(u.version!==d.__version||!0===c){n.activeTexture(t.TEXTURE0+a),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,r.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,r.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE);const e=function(t){return!o&&(t.wrapS!==T||t.wrapT!==T||t.minFilter!==w&&t.minFilter!==C)}(r)&&!1===x(r.image);let i=y(r.image,e,!1,h);i=at(r,i);const p=x(i)||o,m=s.convert(r.format,r.colorSpace);let f,g=s.convert(r.type),_=D(r.internalFormat,m,g,r.colorSpace,r.isVideoTexture);$(l,r,p);const v=r.mipmaps,b=o&&!0!==r.isVideoTexture,E=void 0===d.__version||!0===c,A=B(r,i,p);if(r.isDepthTexture)_=t.DEPTH_COMPONENT,o?_=r.type===O?t.DEPTH_COMPONENT32F:r.type===N?t.DEPTH_COMPONENT24:r.type===H?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT16:r.type===O&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===k&&_===t.DEPTH_COMPONENT&&r.type!==U&&r.type!==N&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=N,g=s.convert(r.type)),r.format===V&&_===t.DEPTH_COMPONENT&&(_=t.DEPTH_STENCIL,r.type!==H&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=H,g=s.convert(r.type))),E&&(b?n.texStorage2D(t.TEXTURE_2D,1,_,i.width,i.height):n.texImage2D(t.TEXTURE_2D,0,_,i.width,i.height,0,m,g,null));else if(r.isDataTexture)if(v.length>0&&p){b&&E&&n.texStorage2D(t.TEXTURE_2D,A,_,v[0].width,v[0].height);for(let e=0,i=v.length;e>=1,r>>=1}}else if(v.length>0&&p){b&&E&&n.texStorage2D(t.TEXTURE_2D,A,_,v[0].width,v[0].height);for(let e=0,i=v.length;e>c),i=Math.max(1,r.height>>c);l===t.TEXTURE_3D||l===t.TEXTURE_2D_ARRAY?n.texImage3D(l,c,p,e,i,r.depth,0,h,u,null):n.texImage2D(l,c,p,e,i,0,h,u,null)}n.bindFramebuffer(t.FRAMEBUFFER,e),st(r)?d.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,o,l,i.get(a).__webglTexture,0,rt(r)):(l===t.TEXTURE_2D||l>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,o,l,i.get(a).__webglTexture,c),n.bindFramebuffer(t.FRAMEBUFFER,null)}function nt(e,n,i){if(t.bindRenderbuffer(t.RENDERBUFFER,e),n.depthBuffer&&!n.stencilBuffer){let r=t.DEPTH_COMPONENT16;if(i||st(n)){const e=n.depthTexture;e&&e.isDepthTexture&&(e.type===O?r=t.DEPTH_COMPONENT32F:e.type===N&&(r=t.DEPTH_COMPONENT24));const i=rt(n);st(n)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,i,r,n.width,n.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,i,r,n.width,n.height)}else t.renderbufferStorage(t.RENDERBUFFER,r,n.width,n.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)}else if(n.depthBuffer&&n.stencilBuffer){const r=rt(n);i&&!1===st(n)?t.renderbufferStorageMultisample(t.RENDERBUFFER,r,t.DEPTH24_STENCIL8,n.width,n.height):st(n)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,r,t.DEPTH24_STENCIL8,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)}else{const e=!0===n.isWebGLMultipleRenderTargets?n.texture:[n.texture];for(let r=0;r0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function at(t,n){const i=t.colorSpace,r=t.format,s=t.type;return!0===t.isCompressedTexture||!0===t.isVideoTexture||t.format===Ht||i!==Nt&&i!==Ut&&(i===Dt||i===Ot?!1===o?!0===e.has("EXT_sRGB")&&r===G?(t.format=Ht,t.minFilter=C,t.generateMipmaps=!1):n=Se.sRGBToLinear(n):r===G&&s===I||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",i)),n}this.allocateTextureUnit=function(){const t=q;return t>=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),q+=1,t},this.resetTextureUnits=function(){q=0},this.setTexture2D=Y,this.setTexture2DArray=function(e,r){const s=i.get(e);e.version>0&&s.__version!==e.version?tt(s,e,r):n.bindTexture(t.TEXTURE_2D_ARRAY,s.__webglTexture,t.TEXTURE0+r)},this.setTexture3D=function(e,r){const s=i.get(e);e.version>0&&s.__version!==e.version?tt(s,e,r):n.bindTexture(t.TEXTURE_3D,s.__webglTexture,t.TEXTURE0+r)},this.setTextureCube=function(e,r){const a=i.get(e);e.version>0&&a.__version!==e.version?function(e,r,a){if(6!==r.image.length)return;const l=Q(e,r),h=r.source;n.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+a);const u=i.get(h);if(h.version!==u.__version||!0===l){n.activeTexture(t.TEXTURE0+a),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,r.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,r.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE);const e=r.isCompressedTexture||r.image[0].isCompressedTexture,i=r.image[0]&&r.image[0].isDataTexture,d=[];for(let t=0;t<6;t++)d[t]=e||i?i?r.image[t].image:r.image[t]:y(r.image[t],!1,!0,c),d[t]=at(r,d[t]);const p=d[0],m=x(p)||o,f=s.convert(r.format,r.colorSpace),g=s.convert(r.type),_=D(r.internalFormat,f,g,r.colorSpace),v=o&&!0!==r.isVideoTexture,b=void 0===u.__version||!0===l;let T,E=B(r,p,m);if($(t.TEXTURE_CUBE_MAP,r,m),e){v&&b&&n.texStorage2D(t.TEXTURE_CUBE_MAP,E,_,p.width,p.height);for(let e=0;e<6;e++){T=d[e].mipmaps;for(let i=0;i0&&E++,n.texStorage2D(t.TEXTURE_CUBE_MAP,E,_,d[0].width,d[0].height));for(let e=0;e<6;e++)if(i){v?n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,d[e].width,d[e].height,f,g,d[e].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,_,d[e].width,d[e].height,0,f,g,d[e].data);for(let i=0;i0){c.__webglFramebuffer[e]=[];for(let n=0;n0){c.__webglFramebuffer=[];for(let e=0;e0&&!1===st(e)){const i=d?l:[l];c.__webglMultisampledFramebuffer=t.createFramebuffer(),c.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,c.__webglMultisampledFramebuffer);for(let n=0;n0)for(let i=0;i0)for(let n=0;n0&&!1===st(e)){const r=e.isWebGLMultipleRenderTargets?e.texture:[e.texture],s=e.width,a=e.height;let o=t.COLOR_BUFFER_BIT;const l=[],c=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,h=i.get(e),u=!0===e.isWebGLMultipleRenderTargets;if(u)for(let e=0;eo+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&a<=o-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==o&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1));null!==a&&(i=e.getPose(t.targetRaySpace,n),null===i&&null!==r&&(i=r),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Da)))}return null!==a&&(a.visible=null!==i),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==s),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){const n=new Ua;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}class Oa extends Ae{constructor(t,e,n,i,r,s,a,o,l,c){if((c=void 0!==c?c:k)!==k&&c!==V)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===k&&(n=N),void 0===n&&c===V&&(n=H),super(null,i,r,s,a,o,c,n,l),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=void 0!==a?a:w,this.minFilter=void 0!==o?o:w,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return null!==this.compareFunction&&(e.compareFunction=this.compareFunction),e}}class Fa extends Vt{constructor(t,e){super();const n=this;let i=null,r=1,s=null,a="local-floor",o=1,l=null,c=null,h=null,u=null,d=null,p=null;const m=e.getContextAttributes();let f=null,g=null;const _=[],v=[],y=new Zi;y.layers.enable(1),y.viewport=new Re;const x=new Zi;x.layers.enable(2),x.viewport=new Re;const M=[y,x],S=new Ia;S.layers.enable(1),S.layers.enable(2);let b=null,T=null;function E(t){const e=v.indexOf(t.inputSource);if(-1===e)return;const n=_[e];void 0!==n&&(n.update(t.inputSource,t.frame,l||s),n.dispatchEvent({type:t.type,data:t.inputSource}))}function w(){i.removeEventListener("select",E),i.removeEventListener("selectstart",E),i.removeEventListener("selectend",E),i.removeEventListener("squeeze",E),i.removeEventListener("squeezestart",E),i.removeEventListener("squeezeend",E),i.removeEventListener("end",w),i.removeEventListener("inputsourceschange",A);for(let t=0;t<_.length;t++){const e=v[t];null!==e&&(v[t]=null,_[t].disconnect(e))}b=null,T=null,t.setRenderTarget(f),d=null,u=null,h=null,i=null,g=null,U.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function A(t){for(let e=0;e=0&&(v[i]=null,_[i].disconnect(n))}for(let e=0;e=v.length){v.push(n),i=t;break}if(null===v[t]){v[t]=n,i=t;break}}if(-1===i)break}const r=_[i];r&&r.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=_[t];return void 0===e&&(e=new Na,_[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=_[t];return void 0===e&&(e=new Na,_[t]=e),e.getGripSpace()},this.getHand=function(t){let e=_[t];return void 0===e&&(e=new Na,_[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){r=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){a=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||s},this.setReferenceSpace=function(t){l=t},this.getBaseLayer=function(){return null!==u?u:d},this.getBinding=function(){return h},this.getFrame=function(){return p},this.getSession=function(){return i},this.setSession=async function(c){if(i=c,null!==i){if(f=t.getRenderTarget(),i.addEventListener("select",E),i.addEventListener("selectstart",E),i.addEventListener("selectend",E),i.addEventListener("squeeze",E),i.addEventListener("squeezestart",E),i.addEventListener("squeezeend",E),i.addEventListener("end",w),i.addEventListener("inputsourceschange",A),!0!==m.xrCompatible&&await e.makeXRCompatible(),void 0===i.renderState.layers||!1===t.capabilities.isWebGL2){const n={antialias:void 0!==i.renderState.layers||m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:r};d=new XRWebGLLayer(i,e,n),i.updateRenderState({baseLayer:d}),g=new Le(d.framebufferWidth,d.framebufferHeight,{format:G,type:I,colorSpace:t.outputColorSpace,stencilBuffer:m.stencil})}else{let n=null,s=null,a=null;m.depth&&(a=m.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,n=m.stencil?V:k,s=m.stencil?H:N);const o={colorFormat:e.RGBA8,depthFormat:a,scaleFactor:r};h=new XRWebGLBinding(i,e),u=h.createProjectionLayer(o),i.updateRenderState({layers:[u]}),g=new Le(u.textureWidth,u.textureHeight,{format:G,type:I,depthTexture:new Oa(u.textureWidth,u.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:m.stencil,colorSpace:t.outputColorSpace,samples:m.antialias?4:0});t.properties.get(g).__ignoreDepthValues=u.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(o),l=null,s=await i.requestReferenceSpace(a),U.setContext(i),U.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode};const R=new De,C=new De;function L(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCamera=function(t){if(null===i)return;S.near=x.near=y.near=t.near,S.far=x.far=y.far=t.far,b===S.near&&T===S.far||(i.updateRenderState({depthNear:S.near,depthFar:S.far}),b=S.near,T=S.far);const e=t.parent,n=S.cameras;L(S,e);for(let t=0;t0&&(i.alphaTest.value=r.alphaTest);const s=e.get(r).envMap;if(s&&(i.envMap.value=s,i.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,i.reflectivity.value=r.reflectivity,i.ior.value=r.ior,i.refractionRatio.value=r.refractionRatio),r.lightMap){i.lightMap.value=r.lightMap;const e=!0===t._useLegacyLights?Math.PI:1;i.lightMapIntensity.value=r.lightMapIntensity*e,n(r.lightMap,i.lightMapTransform)}r.aoMap&&(i.aoMap.value=r.aoMap,i.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,i.aoMapTransform))}return{refreshFogUniforms:function(e,n){n.color.getRGB(e.fogColor.value,Xi(t)),n.isFog?(e.fogNear.value=n.near,e.fogFar.value=n.far):n.isFogExp2&&(e.fogDensity.value=n.density)},refreshMaterialUniforms:function(t,r,s,o,l){r.isMeshBasicMaterial||r.isMeshLambertMaterial?i(t,r):r.isMeshToonMaterial?(i(t,r),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,r)):r.isMeshPhongMaterial?(i(t,r),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,r)):r.isMeshStandardMaterial?(i(t,r),function(t,i){t.metalness.value=i.metalness,i.metalnessMap&&(t.metalnessMap.value=i.metalnessMap,n(i.metalnessMap,t.metalnessMapTransform));t.roughness.value=i.roughness,i.roughnessMap&&(t.roughnessMap.value=i.roughnessMap,n(i.roughnessMap,t.roughnessMapTransform));const r=e.get(i).envMap;r&&(t.envMapIntensity.value=i.envMapIntensity)}(t,r),r.isMeshPhysicalMaterial&&function(t,e,i){t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap,n(e.sheenColorMap,t.sheenColorMapTransform)),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap,n(e.sheenRoughnessMap,t.sheenRoughnessMapTransform)));e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap,n(e.clearcoatMap,t.clearcoatMapTransform)),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap,n(e.clearcoatRoughnessMap,t.clearcoatRoughnessMapTransform)),e.clearcoatNormalMap&&(t.clearcoatNormalMap.value=e.clearcoatNormalMap,n(e.clearcoatNormalMap,t.clearcoatNormalMapTransform),t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),e.side===a&&t.clearcoatNormalScale.value.negate()));e.iridescence>0&&(t.iridescence.value=e.iridescence,t.iridescenceIOR.value=e.iridescenceIOR,t.iridescenceThicknessMinimum.value=e.iridescenceThicknessRange[0],t.iridescenceThicknessMaximum.value=e.iridescenceThicknessRange[1],e.iridescenceMap&&(t.iridescenceMap.value=e.iridescenceMap,n(e.iridescenceMap,t.iridescenceMapTransform)),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap,n(e.iridescenceThicknessMap,t.iridescenceThicknessMapTransform)));e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=i.texture,t.transmissionSamplerSize.value.set(i.width,i.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap,n(e.transmissionMap,t.transmissionMapTransform)),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap,n(e.thicknessMap,t.thicknessMapTransform)),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor));e.anisotropy>0&&(t.anisotropyVector.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation)),e.anisotropyMap&&(t.anisotropyMap.value=e.anisotropyMap,n(e.anisotropyMap,t.anisotropyMapTransform)));t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap,n(e.specularColorMap,t.specularColorMapTransform));e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap,n(e.specularIntensityMap,t.specularIntensityMapTransform))}(t,r,l)):r.isMeshMatcapMaterial?(i(t,r),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,r)):r.isMeshDepthMaterial?i(t,r):r.isMeshDistanceMaterial?(i(t,r),function(t,n){const i=e.get(n).light;t.referencePosition.value.setFromMatrixPosition(i.matrixWorld),t.nearDistance.value=i.shadow.camera.near,t.farDistance.value=i.shadow.camera.far}(t,r)):r.isMeshNormalMaterial?i(t,r):r.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform))}(t,r),r.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,r)):r.isPointsMaterial?function(t,e,i,r){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*r,e.map&&(t.map.value=e.map,n(e.map,t.uvTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,r,s,o):r.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,r):r.isShadowMaterial?(t.color.value.copy(r.color),t.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function za(t,e,n,i){let r={},s={},a=[];const o=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(t,e,n){const i=t.value;if(void 0===n[e]){if("number"==typeof i)n[e]=i;else{const t=Array.isArray(i)?i:[i],r=[];for(let e=0;e0){r=n%i;0!==r&&i-r-a.boundary<0&&(n+=i-r,s.__offset=n)}n+=a.storage}r=n%i,r>0&&(n+=i-r);t.__size=n,t.__cache={}}(n),d=function(e){const n=function(){for(let t=0;t0),d=!!n.morphAttributes.position,p=!!n.morphAttributes.normal,m=!!n.morphAttributes.color;let f=u;i.toneMapped&&(null!==w&&!0!==w.isXRRenderTarget||(f=S.toneMapping));const g=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,_=void 0!==g?g.length:0,v=mt.get(i),x=y.state.lights;if(!0===nt&&(!0===it||t!==R)){const e=t===R&&i.id===A;Et.setState(i,t,e)}let M=!1;i.version===v.__version?v.needsLights&&v.lightsStateVersion!==x.state.version||v.outputColorSpace!==o||r.isInstancedMesh&&!1===v.instancing?M=!0:r.isInstancedMesh||!0!==v.instancing?r.isSkinnedMesh&&!1===v.skinning?M=!0:r.isSkinnedMesh||!0!==v.skinning?r.isInstancedMesh&&!0===v.instancingColor&&null===r.instanceColor||r.isInstancedMesh&&!1===v.instancingColor&&null!==r.instanceColor||v.envMap!==l||!0===i.fog&&v.fog!==s?M=!0:void 0===v.numClippingPlanes||v.numClippingPlanes===Et.numPlanes&&v.numIntersection===Et.numIntersection?(v.vertexAlphas!==c||v.vertexTangents!==h||v.morphTargets!==d||v.morphNormals!==p||v.morphColors!==m||v.toneMapping!==f||!0===ut.isWebGL2&&v.morphTargetsCount!==_)&&(M=!0):M=!0:M=!0:M=!0:(M=!0,v.__version=i.version);let b=v.currentProgram;!0===M&&(b=$t(i,e,r));let T=!1,E=!1,C=!1;const L=b.getUniforms(),P=v.uniforms;dt.useProgram(b.program)&&(T=!0,E=!0,C=!0);i.id!==A&&(A=i.id,E=!0);if(T||R!==t){L.setValue(Ot,"projectionMatrix",t.projectionMatrix),L.setValue(Ot,"viewMatrix",t.matrixWorldInverse);const e=L.map.cameraPosition;void 0!==e&&e.setValue(Ot,ot.setFromMatrixPosition(t.matrixWorld)),ut.logarithmicDepthBuffer&&L.setValue(Ot,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&L.setValue(Ot,"isOrthographic",!0===t.isOrthographicCamera),R!==t&&(R=t,E=!0,C=!0)}if(r.isSkinnedMesh){L.setOptional(Ot,r,"bindMatrix"),L.setOptional(Ot,r,"bindMatrixInverse");const t=r.skeleton;t&&(ut.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),L.setValue(Ot,"boneTexture",t.boneTexture,ft),L.setValue(Ot,"boneTextureSize",t.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const I=n.morphAttributes;(void 0!==I.position||void 0!==I.normal||void 0!==I.color&&!0===ut.isWebGL2)&&Rt.update(r,n,b);(E||v.receiveShadow!==r.receiveShadow)&&(v.receiveShadow=r.receiveShadow,L.setValue(Ot,"receiveShadow",r.receiveShadow));i.isMeshGouraudMaterial&&null!==i.envMap&&(P.envMap.value=l,P.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);E&&(L.setValue(Ot,"toneMappingExposure",S.toneMappingExposure),v.needsLights&&(D=C,(U=P).ambientLightColor.needsUpdate=D,U.lightProbe.needsUpdate=D,U.directionalLights.needsUpdate=D,U.directionalLightShadows.needsUpdate=D,U.pointLights.needsUpdate=D,U.pointLightShadows.needsUpdate=D,U.spotLights.needsUpdate=D,U.spotLightShadows.needsUpdate=D,U.rectAreaLights.needsUpdate=D,U.hemisphereLights.needsUpdate=D),s&&!0===i.fog&&St.refreshFogUniforms(P,s),St.refreshMaterialUniforms(P,i,Z,Y,rt),qs.upload(Ot,v.uniformsList,P,ft));var U,D;i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(qs.upload(Ot,v.uniformsList,P,ft),i.uniformsNeedUpdate=!1);i.isSpriteMaterial&&L.setValue(Ot,"center",r.center);if(L.setValue(Ot,"modelViewMatrix",r.modelViewMatrix),L.setValue(Ot,"normalMatrix",r.normalMatrix),L.setValue(Ot,"modelMatrix",r.matrixWorld),i.isShaderMaterial||i.isRawShaderMaterial){const t=i.uniformsGroups;for(let e=0,n=t.length;e0&&function(t,e,n,i){const r=ut.isWebGL2;null===rt&&(rt=new Le(1,1,{generateMipmaps:!0,type:ht.has("EXT_color_buffer_half_float")?F:I,minFilter:P,samples:r?4:0}));S.getDrawingBufferSize(at),r?rt.setSize(at.x,at.y):rt.setSize(te(at.x),te(at.y));const s=S.getRenderTarget();S.setRenderTarget(rt),S.getClearColor(k),V=S.getClearAlpha(),V<1&&S.setClearColor(16777215,.5);S.clear();const o=S.toneMapping;S.toneMapping=u,Jt(t,n,i),ft.updateMultisampleRenderTarget(rt),ft.updateRenderTargetMipmap(rt);let l=!1;for(let t=0,r=e.length;t0&&Jt(r,e,n),s.length>0&&Jt(s,e,n),o.length>0&&Jt(o,e,n),dt.buffers.depth.setTest(!0),dt.buffers.depth.setMask(!0),dt.buffers.color.setMask(!0),dt.setPolygonOffset(!1)}function Jt(t,e,n){const i=!0===e.isScene?e.overrideMaterial:null;for(let r=0,s=t.length;r0?M[M.length-1]:null,x.pop(),v=x.length>0?x[x.length-1]:null},this.getActiveCubeFace=function(){return T},this.getActiveMipmapLevel=function(){return E},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(t,e,n){mt.get(t.texture).__webglTexture=e,mt.get(t.depthTexture).__webglTexture=n;const i=mt.get(t);i.__hasExternalTextures=!0,i.__hasExternalTextures&&(i.__autoAllocateDepthBuffer=void 0===n,i.__autoAllocateDepthBuffer||!0===ht.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(t,e){const n=mt.get(t);n.__webglFramebuffer=e,n.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,n=0){w=t,T=e,E=n;let i=!0,r=null,s=!1,a=!1;if(t){const o=mt.get(t);void 0!==o.__useDefaultFramebuffer?(dt.bindFramebuffer(Ot.FRAMEBUFFER,null),i=!1):void 0===o.__webglFramebuffer?ft.setupRenderTarget(t):o.__hasExternalTextures&&ft.rebindTextures(t,mt.get(t.texture).__webglTexture,mt.get(t.depthTexture).__webglTexture);const l=t.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(a=!0);const c=mt.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=Array.isArray(c[e])?c[e][n]:c[e],s=!0):r=ut.isWebGL2&&t.samples>0&&!1===ft.useMultisampledRTT(t)?mt.get(t).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,C.copy(t.viewport),L.copy(t.scissor),D=t.scissorTest}else C.copy($).multiplyScalar(Z).floor(),L.copy(Q).multiplyScalar(Z).floor(),D=tt;if(dt.bindFramebuffer(Ot.FRAMEBUFFER,r)&&ut.drawBuffers&&i&&dt.drawBuffers(t,r),dt.viewport(C),dt.scissor(L),dt.setScissorTest(D),s){const i=mt.get(t.texture);Ot.framebufferTexture2D(Ot.FRAMEBUFFER,Ot.COLOR_ATTACHMENT0,Ot.TEXTURE_CUBE_MAP_POSITIVE_X+e,i.__webglTexture,n)}else if(a){const i=mt.get(t.texture),r=e||0;Ot.framebufferTextureLayer(Ot.FRAMEBUFFER,Ot.COLOR_ATTACHMENT0,i.__webglTexture,n||0,r)}A=-1},this.readRenderTargetPixels=function(t,e,n,i,r,s,a){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=mt.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){dt.bindFramebuffer(Ot.FRAMEBUFFER,o);try{const a=t.texture,o=a.format,l=a.type;if(o!==G&&Pt.convert(o)!==Ot.getParameter(Ot.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===F&&(ht.has("EXT_color_buffer_half_float")||ut.isWebGL2&&ht.has("EXT_color_buffer_float"));if(!(l===I||Pt.convert(l)===Ot.getParameter(Ot.IMPLEMENTATION_COLOR_READ_TYPE)||l===O&&(ut.isWebGL2||ht.has("OES_texture_float")||ht.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&Ot.readPixels(e,n,i,r,Pt.convert(o),Pt.convert(l),s)}finally{const t=null!==w?mt.get(w).__webglFramebuffer:null;dt.bindFramebuffer(Ot.FRAMEBUFFER,t)}}},this.copyFramebufferToTexture=function(t,e,n=0){const i=Math.pow(2,-n),r=Math.floor(e.image.width*i),s=Math.floor(e.image.height*i);ft.setTexture2D(e,0),Ot.copyTexSubImage2D(Ot.TEXTURE_2D,n,0,0,t.x,t.y,r,s),dt.unbindTexture()},this.copyTextureToTexture=function(t,e,n,i=0){const r=e.image.width,s=e.image.height,a=Pt.convert(n.format),o=Pt.convert(n.type);ft.setTexture2D(n,0),Ot.pixelStorei(Ot.UNPACK_FLIP_Y_WEBGL,n.flipY),Ot.pixelStorei(Ot.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),Ot.pixelStorei(Ot.UNPACK_ALIGNMENT,n.unpackAlignment),e.isDataTexture?Ot.texSubImage2D(Ot.TEXTURE_2D,i,t.x,t.y,r,s,a,o,e.image.data):e.isCompressedTexture?Ot.compressedTexSubImage2D(Ot.TEXTURE_2D,i,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data):Ot.texSubImage2D(Ot.TEXTURE_2D,i,t.x,t.y,a,o,e.image),0===i&&n.generateMipmaps&&Ot.generateMipmap(Ot.TEXTURE_2D),dt.unbindTexture()},this.copyTextureToTexture3D=function(t,e,n,i,r=0){if(S.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=t.max.x-t.min.x+1,a=t.max.y-t.min.y+1,o=t.max.z-t.min.z+1,l=Pt.convert(i.format),c=Pt.convert(i.type);let h;if(i.isData3DTexture)ft.setTexture3D(i,0),h=Ot.TEXTURE_3D;else{if(!i.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");ft.setTexture2DArray(i,0),h=Ot.TEXTURE_2D_ARRAY}Ot.pixelStorei(Ot.UNPACK_FLIP_Y_WEBGL,i.flipY),Ot.pixelStorei(Ot.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),Ot.pixelStorei(Ot.UNPACK_ALIGNMENT,i.unpackAlignment);const u=Ot.getParameter(Ot.UNPACK_ROW_LENGTH),d=Ot.getParameter(Ot.UNPACK_IMAGE_HEIGHT),p=Ot.getParameter(Ot.UNPACK_SKIP_PIXELS),m=Ot.getParameter(Ot.UNPACK_SKIP_ROWS),f=Ot.getParameter(Ot.UNPACK_SKIP_IMAGES),g=n.isCompressedTexture?n.mipmaps[0]:n.image;Ot.pixelStorei(Ot.UNPACK_ROW_LENGTH,g.width),Ot.pixelStorei(Ot.UNPACK_IMAGE_HEIGHT,g.height),Ot.pixelStorei(Ot.UNPACK_SKIP_PIXELS,t.min.x),Ot.pixelStorei(Ot.UNPACK_SKIP_ROWS,t.min.y),Ot.pixelStorei(Ot.UNPACK_SKIP_IMAGES,t.min.z),n.isDataTexture||n.isData3DTexture?Ot.texSubImage3D(h,r,e.x,e.y,e.z,s,a,o,l,c,g.data):n.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Ot.compressedTexSubImage3D(h,r,e.x,e.y,e.z,s,a,o,l,g.data)):Ot.texSubImage3D(h,r,e.x,e.y,e.z,s,a,o,l,c,g),Ot.pixelStorei(Ot.UNPACK_ROW_LENGTH,u),Ot.pixelStorei(Ot.UNPACK_IMAGE_HEIGHT,d),Ot.pixelStorei(Ot.UNPACK_SKIP_PIXELS,p),Ot.pixelStorei(Ot.UNPACK_SKIP_ROWS,m),Ot.pixelStorei(Ot.UNPACK_SKIP_IMAGES,f),0===r&&i.generateMipmaps&&Ot.generateMipmap(h),dt.unbindTexture()},this.initTexture=function(t){t.isCubeTexture?ft.setTextureCube(t,0):t.isData3DTexture?ft.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?ft.setTexture2DArray(t,0):ft.setTexture2D(t,0),dt.unbindTexture()},this.resetState=function(){T=0,E=0,w=null,dt.reset(),It.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Gt}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(t){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!t}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Dt?It:Pt}set outputEncoding(t){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=t===It?Dt:Nt}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}}class Ga extends Ha{}Ga.prototype.isWebGL1Renderer=!0;class ka{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new ei(t),this.density=e}clone(){return new ka(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Va{constructor(t,e=1,n=1e3){this.isFog=!0,this.name="",this.color=new ei(t),this.near=e,this.far=n}clone(){return new Va(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class Wa extends On{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e}}class Xa{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=Bt,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Yt()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let i=0,r=this.stride;it.far||e.push({distance:o,point:Ja.clone(),uv:Yn.getInterpolation(Ja,no,io,ro,so,ao,oo,new re),face:null,object:this})}copy(t,e){return super.copy(t,e),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function co(t,e,n,i,r,s){Qa.subVectors(t,n).addScalar(.5).multiply(i),void 0!==r?(to.x=s*Qa.x-r*Qa.y,to.y=r*Qa.x+s*Qa.y):to.copy(Qa),t.copy(e),t.x+=to.x,t.y+=to.y,t.applyMatrix4(eo)}const ho=new De,uo=new De;class po extends On{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let t=0,n=e.length;t0){let n,i;for(n=1,i=e.length;n0){ho.setFromMatrixPosition(this.matrixWorld);const n=t.ray.origin.distanceTo(ho);this.getObjectForDistance(n).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){ho.setFromMatrixPosition(t.matrixWorld),uo.setFromMatrixPosition(this.matrixWorld);const n=ho.distanceTo(uo)/t.zoom;let i,r;for(e[0].object.visible=!0,i=1,r=e.length;i=t))break;e[i-1].object.visible=!1,e[i].object.visible=!0}for(this._currentLevel=i-1;io)continue;u.applyMatrix4(this.matrixWorld);const s=t.ray.origin.distanceTo(u);st.far||e.push({distance:s,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else{for(let n=Math.max(0,s.start),i=Math.min(m.count,s.start+s.count)-1;no)continue;u.applyMatrix4(this.matrixWorld);const i=t.ray.origin.distanceTo(u);it.far||e.push({distance:i,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;tr.far)return;s.push({distance:l,distanceToRay:Math.sqrt(o),point:n,index:e,face:null,object:a})}}class nl extends Ae{constructor(t,e,n,i,r,s,a,o,l,c,h,u){super(null,s,a,o,l,c,i,r,h,u),this.isCompressedTexture=!0,this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class il{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,i=this.getPoint(0),r=0;e.push(0);for(let s=1;s<=t;s++)n=this.getPoint(s/t),r+=n.distanceTo(i),e.push(r),i=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let i=0;const r=n.length;let s;s=e||t*n[r-1];let a,o=0,l=r-1;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),a=n[i]-s,a<0)o=i+1;else{if(!(a>0)){l=i;break}l=i-1}if(i=l,n[i]===s)return i/(r-1);const c=n[i];return(i+(s-c)/(n[i+1]-c))/(r-1)}getTangent(t,e){const n=1e-4;let i=t-n,r=t+n;i<0&&(i=0),r>1&&(r=1);const s=this.getPoint(i),a=this.getPoint(r),o=e||(s.isVector2?new re:new De);return o.copy(a).sub(s).normalize(),o}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new De,i=[],r=[],s=[],a=new De,o=new un;for(let e=0;e<=t;e++){const n=e/t;i[e]=this.getTangentAt(n,new De)}r[0]=new De,s[0]=new De;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),h=Math.abs(i[0].y),u=Math.abs(i[0].z);c<=l&&(l=c,n.set(1,0,0)),h<=l&&(l=h,n.set(0,1,0)),u<=l&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],a),s[0].crossVectors(i[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),s[e]=s[e-1].clone(),a.crossVectors(i[e-1],i[e]),a.length()>Number.EPSILON){a.normalize();const t=Math.acos(Zt(i[e-1].dot(i[e]),-1,1));r[e].applyMatrix4(o.makeRotationAxis(a,t))}s[e].crossVectors(i[e],r[e])}if(!0===e){let e=Math.acos(Zt(r[0].dot(r[t]),-1,1));e/=t,i[0].dot(a.crossVectors(r[0],r[t]))>0&&(e=-e);for(let n=1;n<=t;n++)r[n].applyMatrix4(o.makeRotationAxis(i[n],e*n)),s[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class rl extends il{constructor(t=0,e=0,n=1,i=1,r=0,s=2*Math.PI,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=a,this.aRotation=o}getPoint(t,e){const n=e||new re,i=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)i;)r-=i;r0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===c&&l===r-1&&(l=r-2,c=1),this.closed||l>0?a=i[(l-1)%r]:(ol.subVectors(i[0],i[1]).add(i[0]),a=ol);const h=i[l%r],u=i[(l+1)%r];if(this.closed||l+2i.length-2?i.length-1:s+1],h=i[s>i.length-3?i.length-1:s+2];return n.set(dl(a,o.x,l.x,c.x,h.x),dl(a,o.y,l.y,c.y,h.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e=n){const t=i[r]-n,s=this.curves[r],a=s.getLength(),o=0===a?0:1-t/a;return s.getPointAt(o,e)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,i=this.curves.length;n1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class El extends Si{constructor(t=[new re(0,-.5),new re(.5,0),new re(0,.5)],e=12,n=0,i=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},e=Math.floor(e),i=Zt(i,0,2*Math.PI);const r=[],s=[],a=[],o=[],l=[],c=1/e,h=new De,u=new re,d=new De,p=new De,m=new De;let f=0,g=0;for(let e=0;e<=t.length-1;e++)switch(e){case 0:f=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-f,d.z=0*g,m.copy(d),d.normalize(),o.push(d.x,d.y,d.z);break;case t.length-1:o.push(m.x,m.y,m.z);break;default:f=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-f,d.z=0*g,p.copy(d),d.x+=m.x,d.y+=m.y,d.z+=m.z,d.normalize(),o.push(d.x,d.y,d.z),m.copy(p)}for(let r=0;r<=e;r++){const d=n+r*c*i,p=Math.sin(d),m=Math.cos(d);for(let n=0;n<=t.length-1;n++){h.x=t[n].x*p,h.y=t[n].y,h.z=t[n].x*m,s.push(h.x,h.y,h.z),u.x=r/e,u.y=n/(t.length-1),a.push(u.x,u.y);const i=o[3*n+0]*p,c=o[3*n+1],d=o[3*n+0]*m;l.push(i,c,d)}}for(let n=0;n0&&_(!0),e>0&&_(!1)),this.setIndex(c),this.setAttribute("position",new mi(h,3)),this.setAttribute("normal",new mi(u,3)),this.setAttribute("uv",new mi(d,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Rl(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Cl extends Rl{constructor(t=1,e=1,n=32,i=1,r=!1,s=0,a=2*Math.PI){super(0,t,e,n,i,r,s,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:s,thetaLength:a}}static fromJSON(t){return new Cl(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Ll extends Si{constructor(t=[],e=[],n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i};const r=[],s=[];function a(t,e,n,i){const r=i+1,s=[];for(let i=0;i<=r;i++){s[i]=[];const a=t.clone().lerp(n,i/r),o=e.clone().lerp(n,i/r),l=r-i;for(let t=0;t<=l;t++)s[i][t]=0===t&&i===r?a:a.clone().lerp(o,t/l)}for(let t=0;t.9&&a<.1&&(e<.2&&(s[t+0]+=1),n<.2&&(s[t+2]+=1),i<.2&&(s[t+4]+=1))}}()}(),this.setAttribute("position",new mi(r,3)),this.setAttribute("normal",new mi(r.slice(),3)),this.setAttribute("uv",new mi(s,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Ll(t.vertices,t.indices,t.radius,t.details)}}class Pl extends Ll{constructor(t=1,e=0){const n=(1+Math.sqrt(5))/2,i=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Pl(t.radius,t.detail)}}const Il=new De,Ul=new De,Dl=new De,Nl=new Yn;class Ol extends Si{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},null!==t){const n=4,i=Math.pow(10,n),r=Math.cos(jt*e),s=t.getIndex(),a=t.getAttribute("position"),o=s?s.count:a.count,l=[0,0,0],c=["a","b","c"],h=new Array(3),u={},d=[];for(let t=0;t80*n){o=c=t[0],l=h=t[1];for(let e=n;ec&&(c=u),d>h&&(h=d);p=Math.max(c-o,h-l),p=0!==p?32767/p:0}return Gl(s,a,n,o,l,p,0),a};function zl(t,e,n,i,r){let s,a;if(r===function(t,e,n,i){let r=0;for(let s=e,a=n-i;s0)for(s=e;s=e;s-=i)a=ac(s,t[s],t[s+1],a);return a&&tc(a,a.next)&&(oc(a),a=a.next),a}function Hl(t,e){if(!t)return t;e||(e=t);let n,i=t;do{if(n=!1,i.steiner||!tc(i,i.next)&&0!==Ql(i.prev,i,i.next))i=i.next;else{if(oc(i),i=e=i.prev,i===i.next)break;n=!0}}while(n||i!==e);return e}function Gl(t,e,n,i,r,s,a){if(!t)return;!a&&s&&function(t,e,n,i){let r=t;do{0===r.z&&(r.z=Zl(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,n,i,r,s,a,o,l,c=1;do{for(n=t,t=null,s=null,a=0;n;){for(a++,i=n,o=0,e=0;e0||l>0&&i;)0!==o&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,o--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;n=i}s.nextZ=null,c*=2}while(a>1)}(r)}(t,i,r,s);let o,l,c=t;for(;t.prev!==t.next;)if(o=t.prev,l=t.next,s?Vl(t,i,r,s):kl(t))e.push(o.i/n|0),e.push(t.i/n|0),e.push(l.i/n|0),oc(t),t=l.next,c=l.next;else if((t=l)===c){a?1===a?Gl(t=Wl(Hl(t),e,n),e,n,i,r,s,2):2===a&&Xl(t,e,n,i,r,s):Gl(Hl(t),e,n,i,r,s,1);break}}function kl(t){const e=t.prev,n=t,i=t.next;if(Ql(e,n,i)>=0)return!1;const r=e.x,s=n.x,a=i.x,o=e.y,l=n.y,c=i.y,h=rs?r>a?r:a:s>a?s:a,p=o>l?o>c?o:c:l>c?l:c;let m=i.next;for(;m!==e;){if(m.x>=h&&m.x<=d&&m.y>=u&&m.y<=p&&Kl(r,o,s,l,a,c,m.x,m.y)&&Ql(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Vl(t,e,n,i){const r=t.prev,s=t,a=t.next;if(Ql(r,s,a)>=0)return!1;const o=r.x,l=s.x,c=a.x,h=r.y,u=s.y,d=a.y,p=ol?o>c?o:c:l>c?l:c,g=h>u?h>d?h:d:u>d?u:d,_=Zl(p,m,e,n,i),v=Zl(f,g,e,n,i);let y=t.prevZ,x=t.nextZ;for(;y&&y.z>=_&&x&&x.z<=v;){if(y.x>=p&&y.x<=f&&y.y>=m&&y.y<=g&&y!==r&&y!==a&&Kl(o,h,l,u,c,d,y.x,y.y)&&Ql(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,x.x>=p&&x.x<=f&&x.y>=m&&x.y<=g&&x!==r&&x!==a&&Kl(o,h,l,u,c,d,x.x,x.y)&&Ql(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;y&&y.z>=_;){if(y.x>=p&&y.x<=f&&y.y>=m&&y.y<=g&&y!==r&&y!==a&&Kl(o,h,l,u,c,d,y.x,y.y)&&Ql(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;x&&x.z<=v;){if(x.x>=p&&x.x<=f&&x.y>=m&&x.y<=g&&x!==r&&x!==a&&Kl(o,h,l,u,c,d,x.x,x.y)&&Ql(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Wl(t,e,n){let i=t;do{const r=i.prev,s=i.next.next;!tc(r,s)&&ec(r,i,i.next,s)&&rc(r,s)&&rc(s,r)&&(e.push(r.i/n|0),e.push(i.i/n|0),e.push(s.i/n|0),oc(i),oc(i.next),i=t=s),i=i.next}while(i!==t);return Hl(i)}function Xl(t,e,n,i,r,s){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&$l(a,t)){let o=sc(a,t);return a=Hl(a,a.next),o=Hl(o,o.next),Gl(a,e,n,i,r,s,0),void Gl(o,e,n,i,r,s,0)}t=t.next}a=a.next}while(a!==t)}function jl(t,e){return t.x-e.x}function ql(t,e){const n=function(t,e){let n,i=e,r=-1/0;const s=t.x,a=t.y;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){const t=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=s&&t>r&&(r=t,n=i.x=i.x&&i.x>=l&&s!==i.x&&Kl(an.x||i.x===n.x&&Yl(n,i)))&&(n=i,u=h)),i=i.next}while(i!==o);return n}(t,e);if(!n)return e;const i=sc(n,t);return Hl(i,i.next),Hl(n,n.next)}function Yl(t,e){return Ql(t.prev,t,e.prev)<0&&Ql(e.next,t,t.next)<0}function Zl(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Jl(t){let e=t,n=t;do{(e.x=(t-a)*(s-o)&&(t-a)*(i-o)>=(n-a)*(e-o)&&(n-a)*(s-o)>=(r-a)*(i-o)}function $l(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&ec(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(rc(t,e)&&rc(e,t)&&function(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(Ql(t.prev,t,e.prev)||Ql(t,e.prev,e))||tc(t,e)&&Ql(t.prev,t,t.next)>0&&Ql(e.prev,e,e.next)>0)}function Ql(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function tc(t,e){return t.x===e.x&&t.y===e.y}function ec(t,e,n,i){const r=ic(Ql(t,e,n)),s=ic(Ql(t,e,i)),a=ic(Ql(n,i,t)),o=ic(Ql(n,i,e));return r!==s&&a!==o||(!(0!==r||!nc(t,n,e))||(!(0!==s||!nc(t,i,e))||(!(0!==a||!nc(n,t,i))||!(0!==o||!nc(n,e,i)))))}function nc(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function ic(t){return t>0?1:t<0?-1:0}function rc(t,e){return Ql(t.prev,t,t.next)<0?Ql(t,e,t.next)>=0&&Ql(t,t.prev,e)>=0:Ql(t,e,t.prev)<0||Ql(t,t.next,e)<0}function sc(t,e){const n=new lc(t.i,t.x,t.y),i=new lc(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function ac(t,e,n,i){const r=new lc(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function oc(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function lc(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class cc{static area(t){const e=t.length;let n=0;for(let i=e-1,r=0;r2&&t[e-1].equals(t[0])&&t.pop()}function uc(t,e){for(let n=0;nNumber.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),p=e.x-o/u,m=e.y+a/u,f=((n.x-c/d-p)*c-(n.y+l/d-m)*l)/(a*c-o*l);i=p+a*f-t.x,r=m+o*f-t.y;const g=i*i+r*r;if(g<=2)return new re(i,r);s=Math.sqrt(g/2)}else{let t=!1;a>Number.EPSILON?l>Number.EPSILON&&(t=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(o)===Math.sign(c)&&(t=!0),t?(i=-o,r=a,s=Math.sqrt(h)):(i=a,r=o,s=Math.sqrt(h/2))}return new re(i/s,r/s)}const P=[];for(let t=0,e=w.length,n=e-1,i=t+1;t=0;t--){const e=t/p,n=h*Math.cos(e*Math.PI/2),i=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=w.length;t=0;){const i=n;let r=n-1;r<0&&(r=t.length-1);for(let t=0,n=o+2*p;t0)&&d.push(e,r,l),(t!==n-1||o0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class Lc extends Jn{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ei(16777215),this.specular=new ei(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ei(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new re(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=l,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Pc extends Jn{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ei(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ei(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new re(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class Ic extends Jn{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new re(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class Uc extends Jn{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ei(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ei(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new re(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=l,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Dc extends Jn{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ei(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new re(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Nc extends Bo{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}function Oc(t,e,n){return Bc(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)}function Fc(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)}function Bc(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function zc(t){const e=t.length,n=new Array(e);for(let t=0;t!==e;++t)n[t]=t;return n.sort((function(e,n){return t[e]-t[n]})),n}function Hc(t,e,n){const i=t.length,r=new t.constructor(i);for(let s=0,a=0;a!==i;++s){const i=n[s]*e;for(let n=0;n!==e;++n)r[a++]=t[i+n]}return r}function Gc(t,e,n,i){let r=1,s=t[0];for(;void 0!==s&&void 0===s[i];)s=t[r++];if(void 0===s)return;let a=s[i];if(void 0!==a)if(Array.isArray(a))do{a=s[i],void 0!==a&&(e.push(s.time),n.push.apply(n,a)),s=t[r++]}while(void 0!==s);else if(void 0!==a.toArray)do{a=s[i],void 0!==a&&(e.push(s.time),a.toArray(n,n.length)),s=t[r++]}while(void 0!==s);else do{a=s[i],void 0!==a&&(e.push(s.time),n.push(a)),s=t[r++]}while(void 0!==s)}const kc={arraySlice:Oc,convertArray:Fc,isTypedArray:Bc,getKeyframeOrder:zc,sortedArray:Hc,flattenJSON:Gc,subclip:function(t,e,n,i,r=30){const s=t.clone();s.name=e;const a=[];for(let t=0;t=i)){l.push(e.times[t]);for(let n=0;ns.tracks[t].times[0]&&(o=s.tracks[t].times[0]);for(let t=0;t=i.times[u]){const t=u*l+o,e=t+l-o;d=Oc(i.values,t,e)}else{const t=i.createInterpolant(),e=o,n=l-o;t.evaluate(s),d=Oc(t.resultBuffer,e,n)}if("quaternion"===r){(new Ue).fromArray(d).normalize().conjugate().toArray(d)}const p=a.times.length;for(let t=0;t=r)break t;{const a=e[1];t=r)break e}s=n,n=0}}for(;n>>1;te;)--s;if(++s,0!==r||s!==i){r>=s&&(s=Math.max(s,1),r=s-1);const t=this.getValueSize();this.times=Oc(n,r,s),this.values=Oc(this.values,r*t,s*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==r;e++){const i=n[e];if("number"==typeof i&&isNaN(i)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,i),t=!1;break}if(null!==s&&s>i){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,i,s),t=!1;break}s=i}if(void 0!==i&&Bc(i))for(let e=0,n=i.length;e!==n;++e){const n=i[e];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,n),t=!1;break}}return t}optimize(){const t=Oc(this.times),e=Oc(this.values),n=this.getValueSize(),i=this.getInterpolation()===Et,r=t.length-1;let s=1;for(let a=1;a0){t[s]=t[r];for(let t=r*n,i=s*n,a=0;a!==n;++a)e[i+a]=e[t+a];++s}return s!==t.length?(this.times=Oc(t,0,s),this.values=Oc(e,0,s*n)):(this.times=t,this.values=e),this}clone(){const t=Oc(this.times,0),e=Oc(this.values,0),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}qc.prototype.TimeBufferType=Float32Array,qc.prototype.ValueBufferType=Float32Array,qc.prototype.DefaultInterpolation=Tt;class Yc extends qc{}Yc.prototype.ValueTypeName="bool",Yc.prototype.ValueBufferType=Array,Yc.prototype.DefaultInterpolation=bt,Yc.prototype.InterpolantFactoryMethodLinear=void 0,Yc.prototype.InterpolantFactoryMethodSmooth=void 0;class Zc extends qc{}Zc.prototype.ValueTypeName="color";class Jc extends qc{}Jc.prototype.ValueTypeName="number";class Kc extends Vc{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){const r=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=(n-e)/(i-e);let l=t*a;for(let t=l+a;l!==t;l+=4)Ue.slerpFlat(r,0,s,l-a,s,l,o);return r}}class $c extends qc{InterpolantFactoryMethodLinear(t){return new Kc(this.times,this.values,this.getValueSize(),t)}}$c.prototype.ValueTypeName="quaternion",$c.prototype.DefaultInterpolation=Tt,$c.prototype.InterpolantFactoryMethodSmooth=void 0;class Qc extends qc{}Qc.prototype.ValueTypeName="string",Qc.prototype.ValueBufferType=Array,Qc.prototype.DefaultInterpolation=bt,Qc.prototype.InterpolantFactoryMethodLinear=void 0,Qc.prototype.InterpolantFactoryMethodSmooth=void 0;class th extends qc{}th.prototype.ValueTypeName="vector";class eh{constructor(t,e=-1,n,i=2500){this.name=t,this.tracks=n,this.duration=e,this.blendMode=i,this.uuid=Yt(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],n=t.tracks,i=1/(t.fps||1);for(let t=0,r=n.length;t!==r;++t)e.push(nh(n[t]).scale(i));const r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(t){const e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,i=n.length;t!==i;++t)e.push(qc.toJSON(n[t]));return i}static CreateFromMorphTargetSequence(t,e,n,i){const r=e.length,s=[];for(let t=0;t1){const t=s[1];let e=i[t];e||(i[t]=e=[]),e.push(n)}}const s=[];for(const t in i)s.push(this.CreateFromMorphTargetSequence(t,i[t],e,n));return s}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(t,e,n,i,r){if(0!==n.length){const s=[],a=[];Gc(n,s,a,i),0!==s.length&&r.push(new t(e,s,a))}},i=[],r=t.name||"default",s=t.fps||30,a=t.blendMode;let o=t.length||-1;const l=t.hierarchy||[];for(let t=0;t{e&&e(r),this.manager.itemEnd(t)}),0),r;if(void 0!==oh[t])return void oh[t].push({onLoad:e,onProgress:n,onError:i});oh[t]=[],oh[t].push({onLoad:e,onProgress:n,onError:i});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,o=this.responseType;fetch(s).then((e=>{if(200===e.status||0===e.status){if(0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const n=oh[t],i=e.body.getReader(),r=e.headers.get("Content-Length")||e.headers.get("X-File-Size"),s=r?parseInt(r):0,a=0!==s;let o=0;const l=new ReadableStream({start(t){!function e(){i.read().then((({done:i,value:r})=>{if(i)t.close();else{o+=r.byteLength;const i=new ProgressEvent("progress",{lengthComputable:a,loaded:o,total:s});for(let t=0,e=n.length;t{switch(o){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then((t=>(new DOMParser).parseFromString(t,a)));case"json":return t.json();default:if(void 0===a)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(a),n=e&&e[1]?e[1].toLowerCase():void 0,i=new TextDecoder(n);return t.arrayBuffer().then((t=>i.decode(t)))}}})).then((e=>{ih.add(t,e);const n=oh[t];delete oh[t];for(let t=0,i=n.length;t{const n=oh[t];if(void 0===n)throw this.manager.itemError(t),e;delete oh[t];for(let t=0,i=n.length;t{this.manager.itemEnd(t)})),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class hh extends ah{constructor(t){super(t)}load(t,e,n,i){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,s=ih.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout((function(){e&&e(s),r.manager.itemEnd(t)}),0),s;const a=he("img");function o(){c(),ih.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){c(),i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)}function c(){a.removeEventListener("load",o,!1),a.removeEventListener("error",l,!1)}return a.addEventListener("load",o,!1),a.addEventListener("error",l,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(t),a.src=t,a}}class uh extends On{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new ei(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}class dh extends uh{constructor(t,e,n){super(t,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(On.DEFAULT_UP),this.updateMatrix(),this.groundColor=new ei(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}}const ph=new un,mh=new De,fh=new De;class gh{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new re(512,512),this.map=null,this.mapPass=null,this.matrix=new un,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new ar,this._frameExtents=new re(1,1),this._viewportCount=1,this._viewports=[new Re(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;mh.setFromMatrixPosition(t.matrixWorld),e.position.copy(mh),fh.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(fh),e.updateMatrixWorld(),ph.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ph),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(ph)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class _h extends gh{constructor(){super(new Zi(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(t){const e=this.camera,n=2*qt*t.angle*this.focus,i=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;n===e.fov&&i===e.aspect&&r===e.far||(e.fov=n,e.aspect=i,e.far=r,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}class vh extends uh{constructor(t,e,n=0,i=Math.PI/3,r=0,s=2){super(t,e),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(On.DEFAULT_UP),this.updateMatrix(),this.target=new On,this.distance=n,this.angle=i,this.penumbra=r,this.decay=s,this.map=null,this.shadow=new _h}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}const yh=new un,xh=new De,Mh=new De;class Sh extends gh{constructor(){super(new Zi(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new re(4,2),this._viewportCount=6,this._viewports=[new Re(2,1,1,1),new Re(0,1,1,1),new Re(3,1,1,1),new Re(1,1,1,1),new Re(3,0,1,1),new Re(1,0,1,1)],this._cubeDirections=[new De(1,0,0),new De(-1,0,0),new De(0,0,1),new De(0,0,-1),new De(0,1,0),new De(0,-1,0)],this._cubeUps=[new De(0,1,0),new De(0,1,0),new De(0,1,0),new De(0,1,0),new De(0,0,1),new De(0,0,-1)]}updateMatrices(t,e=0){const n=this.camera,i=this.matrix,r=t.distance||n.far;r!==n.far&&(n.far=r,n.updateProjectionMatrix()),xh.setFromMatrixPosition(t.matrixWorld),n.position.copy(xh),Mh.copy(n.position),Mh.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(Mh),n.updateMatrixWorld(),i.makeTranslation(-xh.x,-xh.y,-xh.z),yh.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(yh)}}class bh extends uh{constructor(t,e,n=0,i=2){super(t,e),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new Sh}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}class Th extends gh{constructor(){super(new xr(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Eh extends uh{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(On.DEFAULT_UP),this.updateMatrix(),this.target=new On,this.shadow=new Th}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}class wh extends uh{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}}class Ah extends uh{constructor(t,e,n=10,i=10){super(t,e),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(t){this.intensity=t/(this.width*this.height*Math.PI)}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){const e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}}class Rh{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new De)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){const n=t.x,i=t.y,r=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.282095),e.addScaledVector(s[1],.488603*i),e.addScaledVector(s[2],.488603*r),e.addScaledVector(s[3],.488603*n),e.addScaledVector(s[4],n*i*1.092548),e.addScaledVector(s[5],i*r*1.092548),e.addScaledVector(s[6],.315392*(3*r*r-1)),e.addScaledVector(s[7],n*r*1.092548),e.addScaledVector(s[8],.546274*(n*n-i*i)),e}getIrradianceAt(t,e){const n=t.x,i=t.y,r=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.886227),e.addScaledVector(s[1],1.023328*i),e.addScaledVector(s[2],1.023328*r),e.addScaledVector(s[3],1.023328*n),e.addScaledVector(s[4],.858086*n*i),e.addScaledVector(s[5],.858086*i*r),e.addScaledVector(s[6],.743125*r*r-.247708),e.addScaledVector(s[7],.858086*n*r),e.addScaledVector(s[8],.429043*(n*n-i*i)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(t.coefficients[n],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].fromArray(t,e+3*i);return this}toArray(t=[],e=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].toArray(t,e+3*i);return t}static getBasisAt(t,e){const n=t.x,i=t.y,r=t.z;e[0]=.282095,e[1]=.488603*i,e[2]=.488603*r,e[3]=.488603*n,e[4]=1.092548*n*i,e[5]=1.092548*i*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*n*r,e[8]=.546274*(n*n-i*i)}}class Ch extends uh{constructor(t=new Rh,e=1){super(void 0,e),this.isLightProbe=!0,this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}fromJSON(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this}toJSON(t){const e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}}class Lh extends ah{constructor(t){super(t),this.textures={}}load(t,e,n,i){const r=this,s=new ch(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(t,(function(n){try{e(r.parse(JSON.parse(n)))}catch(e){i?i(e):console.error(e),r.manager.itemError(t)}}),n,i)}parse(t){const e=this.textures;function n(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}const i=Lh.createMaterialFromType(t.type);if(void 0!==t.uuid&&(i.uuid=t.uuid),void 0!==t.name&&(i.name=t.name),void 0!==t.color&&void 0!==i.color&&i.color.setHex(t.color),void 0!==t.roughness&&(i.roughness=t.roughness),void 0!==t.metalness&&(i.metalness=t.metalness),void 0!==t.sheen&&(i.sheen=t.sheen),void 0!==t.sheenColor&&(i.sheenColor=(new ei).setHex(t.sheenColor)),void 0!==t.sheenRoughness&&(i.sheenRoughness=t.sheenRoughness),void 0!==t.emissive&&void 0!==i.emissive&&i.emissive.setHex(t.emissive),void 0!==t.specular&&void 0!==i.specular&&i.specular.setHex(t.specular),void 0!==t.specularIntensity&&(i.specularIntensity=t.specularIntensity),void 0!==t.specularColor&&void 0!==i.specularColor&&i.specularColor.setHex(t.specularColor),void 0!==t.shininess&&(i.shininess=t.shininess),void 0!==t.clearcoat&&(i.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(i.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.iridescence&&(i.iridescence=t.iridescence),void 0!==t.iridescenceIOR&&(i.iridescenceIOR=t.iridescenceIOR),void 0!==t.iridescenceThicknessRange&&(i.iridescenceThicknessRange=t.iridescenceThicknessRange),void 0!==t.transmission&&(i.transmission=t.transmission),void 0!==t.thickness&&(i.thickness=t.thickness),void 0!==t.attenuationDistance&&(i.attenuationDistance=t.attenuationDistance),void 0!==t.attenuationColor&&void 0!==i.attenuationColor&&i.attenuationColor.setHex(t.attenuationColor),void 0!==t.anisotropy&&(i.anisotropy=t.anisotropy),void 0!==t.anisotropyRotation&&(i.anisotropyRotation=t.anisotropyRotation),void 0!==t.fog&&(i.fog=t.fog),void 0!==t.flatShading&&(i.flatShading=t.flatShading),void 0!==t.blending&&(i.blending=t.blending),void 0!==t.combine&&(i.combine=t.combine),void 0!==t.side&&(i.side=t.side),void 0!==t.shadowSide&&(i.shadowSide=t.shadowSide),void 0!==t.opacity&&(i.opacity=t.opacity),void 0!==t.transparent&&(i.transparent=t.transparent),void 0!==t.alphaTest&&(i.alphaTest=t.alphaTest),void 0!==t.alphaHash&&(i.alphaHash=t.alphaHash),void 0!==t.depthTest&&(i.depthTest=t.depthTest),void 0!==t.depthWrite&&(i.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(i.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(i.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(i.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(i.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(i.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(i.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(i.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(i.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(i.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(i.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(i.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(i.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(i.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(i.rotation=t.rotation),1!==t.linewidth&&(i.linewidth=t.linewidth),void 0!==t.dashSize&&(i.dashSize=t.dashSize),void 0!==t.gapSize&&(i.gapSize=t.gapSize),void 0!==t.scale&&(i.scale=t.scale),void 0!==t.polygonOffset&&(i.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(i.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(i.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.dithering&&(i.dithering=t.dithering),void 0!==t.alphaToCoverage&&(i.alphaToCoverage=t.alphaToCoverage),void 0!==t.premultipliedAlpha&&(i.premultipliedAlpha=t.premultipliedAlpha),void 0!==t.forceSinglePass&&(i.forceSinglePass=t.forceSinglePass),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.toneMapped&&(i.toneMapped=t.toneMapped),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?i.vertexColors=t.vertexColors>0:i.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const e in t.uniforms){const r=t.uniforms[e];switch(i.uniforms[e]={},r.type){case"t":i.uniforms[e].value=n(r.value);break;case"c":i.uniforms[e].value=(new ei).setHex(r.value);break;case"v2":i.uniforms[e].value=(new re).fromArray(r.value);break;case"v3":i.uniforms[e].value=(new De).fromArray(r.value);break;case"v4":i.uniforms[e].value=(new Re).fromArray(r.value);break;case"m3":i.uniforms[e].value=(new se).fromArray(r.value);break;case"m4":i.uniforms[e].value=(new un).fromArray(r.value);break;default:i.uniforms[e].value=r.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.glslVersion&&(i.glslVersion=t.glslVersion),void 0!==t.extensions)for(const e in t.extensions)i.extensions[e]=t.extensions[e];if(void 0!==t.lights&&(i.lights=t.lights),void 0!==t.clipping&&(i.clipping=t.clipping),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=n(t.map)),void 0!==t.matcap&&(i.matcap=n(t.matcap)),void 0!==t.alphaMap&&(i.alphaMap=n(t.alphaMap)),void 0!==t.bumpMap&&(i.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),i.normalScale=(new re).fromArray(e)}return void 0!==t.displacementMap&&(i.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=n(t.specularMap)),void 0!==t.specularIntensityMap&&(i.specularIntensityMap=n(t.specularIntensityMap)),void 0!==t.specularColorMap&&(i.specularColorMap=n(t.specularColorMap)),void 0!==t.envMap&&(i.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(i.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(i.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(i.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=n(t.gradientMap)),void 0!==t.clearcoatMap&&(i.clearcoatMap=n(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=n(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(i.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(i.clearcoatNormalScale=(new re).fromArray(t.clearcoatNormalScale)),void 0!==t.iridescenceMap&&(i.iridescenceMap=n(t.iridescenceMap)),void 0!==t.iridescenceThicknessMap&&(i.iridescenceThicknessMap=n(t.iridescenceThicknessMap)),void 0!==t.transmissionMap&&(i.transmissionMap=n(t.transmissionMap)),void 0!==t.thicknessMap&&(i.thicknessMap=n(t.thicknessMap)),void 0!==t.anisotropyMap&&(i.anisotropyMap=n(t.anisotropyMap)),void 0!==t.sheenColorMap&&(i.sheenColorMap=n(t.sheenColorMap)),void 0!==t.sheenRoughnessMap&&(i.sheenRoughnessMap=n(t.sheenRoughnessMap)),i}setTextures(t){return this.textures=t,this}static createMaterialFromType(t){return new{ShadowMaterial:wc,SpriteMaterial:Ya,RawShaderMaterial:Ac,ShaderMaterial:qi,PointsMaterial:Zo,MeshPhysicalMaterial:Cc,MeshStandardMaterial:Rc,MeshPhongMaterial:Lc,MeshToonMaterial:Pc,MeshNormalMaterial:Ic,MeshLambertMaterial:Uc,MeshDepthMaterial:wa,MeshDistanceMaterial:Aa,MeshBasicMaterial:ii,MeshMatcapMaterial:Dc,LineDashedMaterial:Nc,LineBasicMaterial:Bo,Material:Jn}[t]}}class Ph{static decodeText(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let n=0,i=t.length;n0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(n,i,this._addIndex*e,1,e);for(let t=e,r=e+e;t!==r;++t)if(n[t]!==n[t+e]){a.setValue(n,i);break}}saveOriginalState(){const t=this.binding,e=this.buffer,n=this.valueSize,i=n*this._origIndex;t.getValue(e,i);for(let t=n,r=i;t!==r;++t)e[t]=e[i+t%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let n=t;n=.5)for(let i=0;i!==r;++i)t[e+i]=t[n+i]}_slerp(t,e,n,i){Ue.slerpFlat(t,e,t,e,t,n,i)}_slerpAdditive(t,e,n,i,r){const s=this._workIndex*r;Ue.multiplyQuaternionsFlat(t,s,t,e,t,n),Ue.slerpFlat(t,e,t,e,t,s,i)}_lerp(t,e,n,i,r){const s=1-i;for(let a=0;a!==r;++a){const r=e+a;t[r]=t[r]*s+t[n+a]*i}}_lerpAdditive(t,e,n,i,r){for(let s=0;s!==r;++s){const r=e+s;t[r]=t[r]+t[n+s]*i}}}const tu="\\[\\]\\.:\\/",eu=new RegExp("["+tu+"]","g"),nu="[^"+tu+"]",iu="[^"+tu.replace("\\.","")+"]",ru=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",nu)+/(WCOD+)?/.source.replace("WCOD",iu)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",nu)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",nu)+"$"),su=["material","materials","bones","map"];class au{constructor(t,e,n){this.path=e,this.parsedPath=n||au.parseTrackName(e),this.node=au.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new au.Composite(t,e,n):new au(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(eu,"")}static parseTrackName(t){const e=ru.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const t=n.nodeName.substring(i+1);-1!==su.indexOf(t)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=t)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){const n=function(t){for(let i=0;i0){const t=this._interpolants,e=this._propertyBindings;if(this.blendMode===Lt)for(let n=0,i=t.length;n!==i;++n)t[n].evaluate(s),e[n].accumulateAdditive(a);else for(let n=0,r=t.length;n!==r;++n)t[n].evaluate(s),e[n].accumulate(i,a)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const n=this._weightInterpolant;if(null!==n){const i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,n=this.loop;let i=this.time+t,r=this._loopCount;const s=2202===n;if(0===t)return-1===r?i:s&&1==(1&r)?e-i:i;if(2200===n){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(i>=e)i=e;else{if(!(i<0)){this.time=i;break t}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),i>=e||i<0){const n=Math.floor(i/e);i-=e*n,r+=Math.abs(n);const a=this.repetitions-r;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=t>0?e:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===a){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=i;if(s&&1==(1&r))return e-i}return i}_setEndings(t,e,n){const i=this._interpolantSettings;n?(i.endingStart=At,i.endingEnd=At):(i.endingStart=t?this.zeroSlopeAtStart?At:wt:Rt,i.endingEnd=e?this.zeroSlopeAtEnd?At:wt:Rt)}_scheduleFading(t,e,n){const i=this._mixer,r=i.time;let s=this._weightInterpolant;null===s&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const a=s.parameterPositions,o=s.sampleValues;return a[0]=r,o[0]=e,a[1]=r+t,o[1]=n,this}}const lu=new Float32Array(1);class cu{constructor(t){this.value=t}clone(){return new cu(void 0===this.value.clone?this.value:this.value.clone())}}let hu=0;function uu(t,e){return t.distance-e.distance}function du(t,e,n,i){if(t.layers.test(e.layers)&&t.raycast(e,n),!0===i){const i=t.children;for(let t=0,r=i.length;t=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,n=this._nActiveActions,i=this.time+=t,r=Math.sign(t),s=this._accuIndex^=1;for(let a=0;a!==n;++a){e[a]._update(i,t,r,s)}const a=this._bindings,o=this._nActiveBindings;for(let t=0;t!==o;++t)a[t].apply(s);return this}setTime(t){this.time=0;for(let t=0;t=r){const s=r++,c=t[s];e[c.uuid]=l,t[l]=c,e[o]=s,t[s]=a;for(let t=0,e=i;t!==e;++t){const e=n[t],i=e[s],r=e[l];e[l]=i,e[s]=r}}}this.nCachedObjects_=r}uncache(){const t=this._objects,e=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_,s=t.length;for(let a=0,o=arguments.length;a!==o;++a){const o=arguments[a].uuid,l=e[o];if(void 0!==l)if(delete e[o],l0&&(e[a.uuid]=l),t[l]=a,t.pop();for(let t=0,e=i;t!==e;++t){const e=n[t];e[l]=e[r],e.pop()}}}this.nCachedObjects_=r}subscribe_(t,e){const n=this._bindingsIndicesByPath;let i=n[t];const r=this._bindings;if(void 0!==i)return r[i];const s=this._paths,a=this._parsedPaths,o=this._objects,l=o.length,c=this.nCachedObjects_,h=new Array(l);i=r.length,n[t]=i,s.push(t),a.push(e),r.push(h);for(let n=c,i=o.length;n!==i;++n){const i=o[n];h[n]=new au(i,t,e)}return h}unsubscribe_(t){const e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){const i=this._paths,r=this._parsedPaths,s=this._bindings,a=s.length-1,o=s[a];e[t[a]]=n,s[n]=o,s.pop(),r[n]=r[a],r.pop(),i[n]=i[a],i.pop()}}},t.AnimationUtils=kc,t.ArcCurve=sl,t.ArrayCamera=Ia,t.ArrowHelper=class extends On{constructor(t=new De(0,0,1),e=new De(0,0,0),n=1,i=16776960,r=.2*n,s=.2*r){super(),this.type="ArrowHelper",void 0===Iu&&(Iu=new Si,Iu.setAttribute("position",new mi([0,0,0,0,1,0],3)),Uu=new Rl(0,.5,1,5,1),Uu.translate(0,-.5,0)),this.position.copy(e),this.line=new Wo(Iu,new Bo({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Hi(Uu,new ii({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,r,s)}setDirection(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{Pu.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(Pu,e)}}setLength(t,e=.2*t,n=.2*e){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},t.Audio=Yh,t.AudioAnalyser=class{constructor(t,e=2048){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=e,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let t=0;const e=this.getFrequencyData();for(let n=0;nthis.max.x||t.ythis.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,pu).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},t.Box3=Fe,t.Box3Helper=class extends qo{constructor(t,e=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Si;i.setIndex(new ui(n,1)),i.setAttribute("position",new mi([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(i,new Bo({color:e,toneMapped:!1})),this.box=t,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(t){const e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(t))}dispose(){this.geometry.dispose(),this.material.dispose()}},t.BoxGeometry=ki,t.BoxHelper=class extends qo{constructor(t,e=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),r=new Si;r.setIndex(new ui(n,1)),r.setAttribute("position",new ui(i,3)),super(r,new Bo({color:e,toneMapped:!1})),this.object=t,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Lu.setFromObject(this.object),Lu.isEmpty())return;const e=Lu.min,n=Lu.max,i=this.geometry.attributes.position,r=i.array;r[0]=n.x,r[1]=n.y,r[2]=n.z,r[3]=e.x,r[4]=n.y,r[5]=n.z,r[6]=e.x,r[7]=e.y,r[8]=n.z,r[9]=n.x,r[10]=e.y,r[11]=n.z,r[12]=n.x,r[13]=n.y,r[14]=e.z,r[15]=e.x,r[16]=n.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=n.x,r[22]=e.y,r[23]=e.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(t){return this.object=t,this.update(),this}copy(t,e){return super.copy(t,e),this.object=t.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}},t.BufferAttribute=ui,t.BufferGeometry=Si,t.BufferGeometryLoader=Uh,t.ByteType=1010,t.Cache=ih,t.Camera=Yi,t.CameraHelper=class extends qo{constructor(t){const e=new Si,n=new Bo({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],r=[],s={};function a(t,e){o(t),o(e)}function o(t){i.push(0,0,0),r.push(0,0,0),void 0===s[t]&&(s[t]=[]),s[t].push(i.length/3-1)}a("n1","n2"),a("n2","n4"),a("n4","n3"),a("n3","n1"),a("f1","f2"),a("f2","f4"),a("f4","f3"),a("f3","f1"),a("n1","f1"),a("n2","f2"),a("n3","f3"),a("n4","f4"),a("p","n1"),a("p","n2"),a("p","n3"),a("p","n4"),a("u1","u2"),a("u2","u3"),a("u3","u1"),a("c","t"),a("p","c"),a("cn1","cn2"),a("cn3","cn4"),a("cf1","cf2"),a("cf3","cf4"),e.setAttribute("position",new mi(i,3)),e.setAttribute("color",new mi(r,3)),super(e,n),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update();const l=new ei(16755200),c=new ei(16711680),h=new ei(43775),u=new ei(16777215),d=new ei(3355443);this.setColors(l,c,h,u,d)}setColors(t,e,n,i,r){const s=this.geometry.getAttribute("color");s.setXYZ(0,t.r,t.g,t.b),s.setXYZ(1,t.r,t.g,t.b),s.setXYZ(2,t.r,t.g,t.b),s.setXYZ(3,t.r,t.g,t.b),s.setXYZ(4,t.r,t.g,t.b),s.setXYZ(5,t.r,t.g,t.b),s.setXYZ(6,t.r,t.g,t.b),s.setXYZ(7,t.r,t.g,t.b),s.setXYZ(8,t.r,t.g,t.b),s.setXYZ(9,t.r,t.g,t.b),s.setXYZ(10,t.r,t.g,t.b),s.setXYZ(11,t.r,t.g,t.b),s.setXYZ(12,t.r,t.g,t.b),s.setXYZ(13,t.r,t.g,t.b),s.setXYZ(14,t.r,t.g,t.b),s.setXYZ(15,t.r,t.g,t.b),s.setXYZ(16,t.r,t.g,t.b),s.setXYZ(17,t.r,t.g,t.b),s.setXYZ(18,t.r,t.g,t.b),s.setXYZ(19,t.r,t.g,t.b),s.setXYZ(20,t.r,t.g,t.b),s.setXYZ(21,t.r,t.g,t.b),s.setXYZ(22,t.r,t.g,t.b),s.setXYZ(23,t.r,t.g,t.b),s.setXYZ(24,e.r,e.g,e.b),s.setXYZ(25,e.r,e.g,e.b),s.setXYZ(26,e.r,e.g,e.b),s.setXYZ(27,e.r,e.g,e.b),s.setXYZ(28,e.r,e.g,e.b),s.setXYZ(29,e.r,e.g,e.b),s.setXYZ(30,e.r,e.g,e.b),s.setXYZ(31,e.r,e.g,e.b),s.setXYZ(32,n.r,n.g,n.b),s.setXYZ(33,n.r,n.g,n.b),s.setXYZ(34,n.r,n.g,n.b),s.setXYZ(35,n.r,n.g,n.b),s.setXYZ(36,n.r,n.g,n.b),s.setXYZ(37,n.r,n.g,n.b),s.setXYZ(38,i.r,i.g,i.b),s.setXYZ(39,i.r,i.g,i.b),s.setXYZ(40,r.r,r.g,r.b),s.setXYZ(41,r.r,r.g,r.b),s.setXYZ(42,r.r,r.g,r.b),s.setXYZ(43,r.r,r.g,r.b),s.setXYZ(44,r.r,r.g,r.b),s.setXYZ(45,r.r,r.g,r.b),s.setXYZ(46,r.r,r.g,r.b),s.setXYZ(47,r.r,r.g,r.b),s.setXYZ(48,r.r,r.g,r.b),s.setXYZ(49,r.r,r.g,r.b),s.needsUpdate=!0}update(){const t=this.geometry,e=this.pointMap;Ru.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Cu("c",e,t,Ru,0,0,-1),Cu("t",e,t,Ru,0,0,1),Cu("n1",e,t,Ru,-1,-1,-1),Cu("n2",e,t,Ru,1,-1,-1),Cu("n3",e,t,Ru,-1,1,-1),Cu("n4",e,t,Ru,1,1,-1),Cu("f1",e,t,Ru,-1,-1,1),Cu("f2",e,t,Ru,1,-1,1),Cu("f3",e,t,Ru,-1,1,1),Cu("f4",e,t,Ru,1,1,1),Cu("u1",e,t,Ru,.7,1.1,-1),Cu("u2",e,t,Ru,-.7,1.1,-1),Cu("u3",e,t,Ru,0,2,-1),Cu("cf1",e,t,Ru,-1,0,1),Cu("cf2",e,t,Ru,1,0,1),Cu("cf3",e,t,Ru,0,-1,1),Cu("cf4",e,t,Ru,0,1,1),Cu("cn1",e,t,Ru,-1,0,-1),Cu("cn2",e,t,Ru,1,0,-1),Cu("cn3",e,t,Ru,0,-1,-1),Cu("cn4",e,t,Ru,0,1,-1),t.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}},t.CanvasTexture=class extends Ae{constructor(t,e,n,i,r,s,a,o,l){super(t,e,n,i,r,s,a,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}},t.CapsuleGeometry=wl,t.CatmullRomCurve3=ul,t.CineonToneMapping=m,t.CircleGeometry=Al,t.ClampToEdgeWrapping=T,t.Clock=kh,t.Color=ei,t.ColorKeyframeTrack=Zc,t.ColorManagement=xe,t.CompressedArrayTexture=class extends nl{constructor(t,e,n,i,r,s){super(t,e,n,r,s),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=T}},t.CompressedCubeTexture=class extends nl{constructor(t,e,n){super(void 0,t[0].width,t[0].height,e,n,v),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=t}},t.CompressedTexture=nl,t.CompressedTextureLoader=class extends ah{constructor(t){super(t)}load(t,e,n,i){const r=this,s=[],a=new nl,o=new ch(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(r.withCredentials);let l=0;function c(c){o.load(t[c],(function(t){const n=r.parse(t,!0);s[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},l+=1,6===l&&(1===n.mipmapCount&&(a.minFilter=C),a.image=s,a.format=n.format,a.needsUpdate=!0,e&&e(a))}),n,i)}if(Array.isArray(t))for(let e=0,n=t.length;e0){const n=new rh(e);r=new hh(n),r.setCrossOrigin(this.crossOrigin);for(let e=0,n=t.length;e0){i=new hh(this.manager),i.setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e1)for(let n=0;nNumber.EPSILON){if(l<0&&(n=e[s],o=-o,a=e[r],l=-l),t.ya.y)continue;if(t.y===n.y){if(t.x===n.x)return!0}else{const e=l*(t.x-n.x)-o*(t.y-n.y);if(0===e)return!0;if(e<0)continue;i=!i}}else{if(t.y!==n.y)continue;if(a.x<=t.x&&t.x<=n.x||n.x<=t.x&&t.x<=a.x)return!0}}return i}const n=cc.isClockWise,i=this.subPaths;if(0===i.length)return[];let r,s,a;const o=[];if(1===i.length)return s=i[0],a=new Fl,a.curves=s.curves,o.push(a),o;let l=!n(i[0].getPoints());l=t?!l:l;const c=[],h=[];let u,d,p=[],m=0;h[m]=void 0,p[m]=[];for(let e=0,a=i.length;e1){let t=!1,n=0;for(let t=0,e=h.length;t0&&!1===t&&(p=c)}for(let t=0,e=h.length;t=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}},t.WebGL1Renderer=Ga,t.WebGL3DRenderTarget=class extends Le{constructor(t=1,e=1,n=1){super(t,e),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new Ie(null,t,e,n),this.texture.isRenderTargetTexture=!0}},t.WebGLArrayRenderTarget=class extends Le{constructor(t=1,e=1,n=1){super(t,e),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new Pe(null,t,e,n),this.texture.isRenderTargetTexture=!0}},t.WebGLCoordinateSystem=Gt,t.WebGLCubeRenderTarget=Qi,t.WebGLMultipleRenderTargets=class extends Le{constructor(t=1,e=1,n=1,i={}){super(t,e,i),this.isWebGLMultipleRenderTargets=!0;const r=this.texture;this.texture=[];for(let t=0;t 0 ) data.alphaTest = this.alphaTest; + if ( this.alphaHash === true ) data.alphaHash = this.alphaHash; if ( this.alphaToCoverage === true ) data.alphaToCoverage = this.alphaToCoverage; if ( this.premultipliedAlpha === true ) data.premultipliedAlpha = this.premultipliedAlpha; if ( this.forceSinglePass === true ) data.forceSinglePass = this.forceSinglePass; @@ -8812,6 +8858,7 @@ class Material extends EventDispatcher { this.dithering = source.dithering; this.alphaTest = source.alphaTest; + this.alphaHash = source.alphaHash; this.alphaToCoverage = source.alphaToCoverage; this.premultipliedAlpha = source.premultipliedAlpha; this.forceSinglePass = source.forceSinglePass; @@ -9731,6 +9778,7 @@ class BufferAttribute { this.usage = StaticDrawUsage; this.updateRange = { offset: 0, count: - 1 }; + this.gpuType = FloatType; this.version = 0; @@ -9761,6 +9809,7 @@ class BufferAttribute { this.normalized = source.normalized; this.usage = source.usage; + this.gpuType = source.gpuType; return this; @@ -9876,6 +9925,26 @@ class BufferAttribute { } + getComponent( index, component ) { + + let value = this.array[ index * this.itemSize + component ]; + + if ( this.normalized ) value = denormalize( value, this.array ); + + return value; + + } + + setComponent( index, component, value ) { + + if ( this.normalized ) value = normalize( value, this.array ); + + this.array[ index * this.itemSize + component ] = value; + + return this; + + } + getX( index ) { let x = this.array[ index * this.itemSize ]; @@ -10047,30 +10116,6 @@ class BufferAttribute { } - copyColorsArray() { // @deprecated, r144 - - console.error( 'THREE.BufferAttribute: copyColorsArray() was removed in r144.' ); - - } - - copyVector2sArray() { // @deprecated, r144 - - console.error( 'THREE.BufferAttribute: copyVector2sArray() was removed in r144.' ); - - } - - copyVector3sArray() { // @deprecated, r144 - - console.error( 'THREE.BufferAttribute: copyVector3sArray() was removed in r144.' ); - - } - - copyVector4sArray() { // @deprecated, r144 - - console.error( 'THREE.BufferAttribute: copyVector4sArray() was removed in r144.' ); - - } - } // @@ -10081,18 +10126,6 @@ class Int8BufferAttribute extends BufferAttribute { super( new Int8Array( array ), itemSize, normalized ); - this.gpuType = FloatType; - - } - - copy( source ) { - - super.copy( source ); - - this.gpuType = source.gpuType; - - return this; - } } @@ -10103,18 +10136,6 @@ class Uint8BufferAttribute extends BufferAttribute { super( new Uint8Array( array ), itemSize, normalized ); - this.gpuType = FloatType; - - } - - copy( source ) { - - super.copy( source ); - - this.gpuType = source.gpuType; - - return this; - } } @@ -10135,18 +10156,6 @@ class Int16BufferAttribute extends BufferAttribute { super( new Int16Array( array ), itemSize, normalized ); - this.gpuType = FloatType; - - } - - copy( source ) { - - super.copy( source ); - - this.gpuType = source.gpuType; - - return this; - } } @@ -10157,18 +10166,6 @@ class Uint16BufferAttribute extends BufferAttribute { super( new Uint16Array( array ), itemSize, normalized ); - this.gpuType = FloatType; - - } - - copy( source ) { - - super.copy( source ); - - this.gpuType = source.gpuType; - - return this; - } } @@ -10366,7 +10363,7 @@ class Float64BufferAttribute extends BufferAttribute { } -let _id$1 = 0; +let _id$2 = 0; const _m1 = /*@__PURE__*/ new Matrix4(); const _obj = /*@__PURE__*/ new Object3D(); @@ -10383,7 +10380,7 @@ class BufferGeometry extends EventDispatcher { this.isBufferGeometry = true; - Object.defineProperty( this, 'id', { value: _id$1 ++ } ); + Object.defineProperty( this, 'id', { value: _id$2 ++ } ); this.uuid = generateUUID(); @@ -11082,13 +11079,6 @@ class BufferGeometry extends EventDispatcher { } - merge() { // @deprecated, r144 - - console.error( 'THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeGeometries() instead.' ); - return this; - - } - normalizeNormals() { const normals = this.attributes.normal; @@ -11495,7 +11485,7 @@ class Mesh extends Object3D { } - this.material = source.material; + this.material = Array.isArray( source.material ) ? source.material.slice() : source.material; this.geometry = source.geometry; return this; @@ -12331,6 +12321,8 @@ class Camera extends Object3D { this.projectionMatrix = new Matrix4(); this.projectionMatrixInverse = new Matrix4(); + this.coordinateSystem = WebGLCoordinateSystem; + } copy( source, recursive ) { @@ -12342,6 +12334,8 @@ class Camera extends Object3D { this.projectionMatrix.copy( source.projectionMatrix ); this.projectionMatrixInverse.copy( source.projectionMatrixInverse ); + this.coordinateSystem = source.coordinateSystem; + return this; } @@ -12579,7 +12573,7 @@ class PerspectiveCamera extends Camera { const skew = this.filmOffset; if ( skew !== 0 ) left += near * skew / this.getFilmWidth(); - this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far ); + this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far, this.coordinateSystem ); this.projectionMatrixInverse.copy( this.projectionMatrix ).invert(); @@ -12621,59 +12615,120 @@ class CubeCamera extends Object3D { this.type = 'CubeCamera'; this.renderTarget = renderTarget; + this.coordinateSystem = null; const cameraPX = new PerspectiveCamera( fov, aspect, near, far ); cameraPX.layers = this.layers; - cameraPX.up.set( 0, 1, 0 ); - cameraPX.lookAt( 1, 0, 0 ); this.add( cameraPX ); const cameraNX = new PerspectiveCamera( fov, aspect, near, far ); cameraNX.layers = this.layers; - cameraNX.up.set( 0, 1, 0 ); - cameraNX.lookAt( - 1, 0, 0 ); this.add( cameraNX ); const cameraPY = new PerspectiveCamera( fov, aspect, near, far ); cameraPY.layers = this.layers; - cameraPY.up.set( 0, 0, - 1 ); - cameraPY.lookAt( 0, 1, 0 ); this.add( cameraPY ); const cameraNY = new PerspectiveCamera( fov, aspect, near, far ); cameraNY.layers = this.layers; - cameraNY.up.set( 0, 0, 1 ); - cameraNY.lookAt( 0, - 1, 0 ); this.add( cameraNY ); const cameraPZ = new PerspectiveCamera( fov, aspect, near, far ); cameraPZ.layers = this.layers; - cameraPZ.up.set( 0, 1, 0 ); - cameraPZ.lookAt( 0, 0, 1 ); this.add( cameraPZ ); const cameraNZ = new PerspectiveCamera( fov, aspect, near, far ); cameraNZ.layers = this.layers; - cameraNZ.up.set( 0, 1, 0 ); - cameraNZ.lookAt( 0, 0, - 1 ); this.add( cameraNZ ); } + updateCoordinateSystem() { + + const coordinateSystem = this.coordinateSystem; + + const cameras = this.children.concat(); + + const [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = cameras; + + for ( const camera of cameras ) this.remove( camera ); + + if ( coordinateSystem === WebGLCoordinateSystem ) { + + cameraPX.up.set( 0, 1, 0 ); + cameraPX.lookAt( 1, 0, 0 ); + + cameraNX.up.set( 0, 1, 0 ); + cameraNX.lookAt( - 1, 0, 0 ); + + cameraPY.up.set( 0, 0, - 1 ); + cameraPY.lookAt( 0, 1, 0 ); + + cameraNY.up.set( 0, 0, 1 ); + cameraNY.lookAt( 0, - 1, 0 ); + + cameraPZ.up.set( 0, 1, 0 ); + cameraPZ.lookAt( 0, 0, 1 ); + + cameraNZ.up.set( 0, 1, 0 ); + cameraNZ.lookAt( 0, 0, - 1 ); + + } else if ( coordinateSystem === WebGPUCoordinateSystem ) { + + cameraPX.up.set( 0, - 1, 0 ); + cameraPX.lookAt( - 1, 0, 0 ); + + cameraNX.up.set( 0, - 1, 0 ); + cameraNX.lookAt( 1, 0, 0 ); + + cameraPY.up.set( 0, 0, 1 ); + cameraPY.lookAt( 0, 1, 0 ); + + cameraNY.up.set( 0, 0, - 1 ); + cameraNY.lookAt( 0, - 1, 0 ); + + cameraPZ.up.set( 0, - 1, 0 ); + cameraPZ.lookAt( 0, 0, 1 ); + + cameraNZ.up.set( 0, - 1, 0 ); + cameraNZ.lookAt( 0, 0, - 1 ); + + } else { + + throw new Error( 'THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: ' + coordinateSystem ); + + } + + for ( const camera of cameras ) { + + this.add( camera ); + + camera.updateMatrixWorld(); + + } + + } + update( renderer, scene ) { if ( this.parent === null ) this.updateMatrixWorld(); const renderTarget = this.renderTarget; + if ( this.coordinateSystem !== renderer.coordinateSystem ) { + + this.coordinateSystem = renderer.coordinateSystem; + + this.updateCoordinateSystem(); + + } + const [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = this.children; const currentRenderTarget = renderer.getRenderTarget(); - const currentToneMapping = renderer.toneMapping; const currentXrEnabled = renderer.xr.enabled; - renderer.toneMapping = NoToneMapping; renderer.xr.enabled = false; const generateMipmaps = renderTarget.texture.generateMipmaps; @@ -12702,7 +12757,6 @@ class CubeCamera extends Object3D { renderer.setRenderTarget( currentRenderTarget ); - renderer.toneMapping = currentToneMapping; renderer.xr.enabled = currentXrEnabled; renderTarget.texture.needsPMREMUpdate = true; @@ -13125,7 +13179,7 @@ class Frustum { } - setFromProjectionMatrix( m ) { + setFromProjectionMatrix( m, coordinateSystem = WebGLCoordinateSystem ) { const planes = this.planes; const me = m.elements; @@ -13139,7 +13193,20 @@ class Frustum { planes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize(); planes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize(); planes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize(); - planes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize(); + + if ( coordinateSystem === WebGLCoordinateSystem ) { + + planes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize(); + + } else if ( coordinateSystem === WebGPUCoordinateSystem ) { + + planes[ 5 ].setComponents( me2, me6, me10, me14 ).normalize(); + + } else { + + throw new Error( 'THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: ' + coordinateSystem ); + + } return this; @@ -13590,6 +13657,10 @@ class PlaneGeometry extends BufferGeometry { } +var alphahash_fragment = "#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif"; + +var alphahash_pars_fragment = "#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif"; + var alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif"; var alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif"; @@ -13602,13 +13673,13 @@ var aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( var aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif"; -var begin_vertex = "vec3 transformed = vec3( position );"; +var begin_vertex = "vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif"; var beginnormal_vertex = "vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif"; var bsdfs = "float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated"; -var iridescence_fragment = "#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\t return vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat R21 = R12;\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif"; +var iridescence_fragment = "#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif"; var bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif"; @@ -13628,7 +13699,7 @@ var color_pars_vertex = "#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\ var color_vertex = "#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif"; -var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated"; +var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated"; var cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif"; @@ -13642,9 +13713,9 @@ var emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = textu var emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif"; -var encodings_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );"; +var colorspace_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );"; -var encodings_pars_fragment = "vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}"; +var colorspace_pars_fragment = "vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}"; var envmap_fragment = "#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif"; @@ -13704,7 +13775,7 @@ var logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_ var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif"; -var map_fragment = "#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, vMapUv );\n#endif"; +var map_fragment = "#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif"; var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif"; @@ -13724,7 +13795,7 @@ var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\tuniform float morphTar var morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif"; -var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal, vNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;"; +var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;"; var normal_fragment_maps = "#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif"; @@ -13744,7 +13815,7 @@ var clearcoat_pars_fragment = "#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clea var iridescence_pars_fragment = "#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif"; -var output_fragment = "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );"; +var opaque_fragment = "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );"; var packing = "vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}"; @@ -13788,53 +13859,53 @@ var transmission_fragment = "#ifdef USE_TRANSMISSION\n\tmaterial.transmission = var transmission_pars_fragment = "#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif"; -var uv_pars_fragment = "#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif"; +var uv_pars_fragment = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif"; -var uv_pars_vertex = "#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif"; +var uv_pars_vertex = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif"; -var uv_vertex = "#ifdef USE_UV\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif"; +var uv_vertex = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif"; var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif"; const vertex$h = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}"; -const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}"; +const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}"; const vertex$g = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}"; -const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}"; +const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}"; const vertex$f = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}"; -const fragment$f = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}"; +const fragment$f = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}"; const vertex$e = "#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}"; -const fragment$e = "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}"; +const fragment$e = "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}"; const vertex$d = "#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}"; -const fragment$d = "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}"; +const fragment$d = "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}"; const vertex$c = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}"; -const fragment$c = "uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}"; +const fragment$c = "uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}"; const vertex$b = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; -const fragment$b = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; +const fragment$b = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$a = "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; -const fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; +const fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$9 = "#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}"; -const fragment$9 = "#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; +const fragment$9 = "#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$8 = "#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}"; -const fragment$8 = "#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; +const fragment$8 = "#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$7 = "#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}"; @@ -13842,29 +13913,31 @@ const fragment$7 = "#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SH const vertex$6 = "#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}"; -const fragment$6 = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; +const fragment$6 = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$5 = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}"; -const fragment$5 = "#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; +const fragment$5 = "#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$4 = "#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}"; -const fragment$4 = "#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; +const fragment$4 = "#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$3 = "uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}"; -const fragment$3 = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; +const fragment$3 = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; const vertex$2 = "#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; -const fragment$2 = "uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}"; +const fragment$2 = "uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}"; const vertex$1 = "uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"; -const fragment$1 = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"; +const fragment$1 = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"; const ShaderChunk = { + alphahash_fragment: alphahash_fragment, + alphahash_pars_fragment: alphahash_pars_fragment, alphamap_fragment: alphamap_fragment, alphamap_pars_fragment: alphamap_pars_fragment, alphatest_fragment: alphatest_fragment, @@ -13891,8 +13964,8 @@ const ShaderChunk = { displacementmap_vertex: displacementmap_vertex, emissivemap_fragment: emissivemap_fragment, emissivemap_pars_fragment: emissivemap_pars_fragment, - encodings_fragment: encodings_fragment, - encodings_pars_fragment: encodings_pars_fragment, + colorspace_fragment: colorspace_fragment, + colorspace_pars_fragment: colorspace_pars_fragment, envmap_fragment: envmap_fragment, envmap_common_pars_fragment: envmap_common_pars_fragment, envmap_pars_fragment: envmap_pars_fragment, @@ -13942,7 +14015,7 @@ const ShaderChunk = { clearcoat_normal_fragment_maps: clearcoat_normal_fragment_maps, clearcoat_pars_fragment: clearcoat_pars_fragment, iridescence_pars_fragment: iridescence_pars_fragment, - output_fragment: output_fragment, + opaque_fragment: opaque_fragment, packing: packing, premultiplied_alpha_fragment: premultiplied_alpha_fragment, project_vertex: project_vertex, @@ -14616,24 +14689,15 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha, } - const xr = renderer.xr; - const environmentBlendMode = xr.getEnvironmentBlendMode(); + const environmentBlendMode = renderer.xr.getEnvironmentBlendMode(); - switch ( environmentBlendMode ) { + if ( environmentBlendMode === 'additive' ) { - case 'opaque': - forceClear = true; - break; + state.buffers.color.setClear( 0, 0, 0, 1, premultipliedAlpha ); - case 'additive': - state.buffers.color.setClear( 0, 0, 0, 1, premultipliedAlpha ); - forceClear = true; - break; + } else if ( environmentBlendMode === 'alpha-blend' ) { - case 'alpha-blend': - state.buffers.color.setClear( 0, 0, 0, 0, premultipliedAlpha ); - forceClear = true; - break; + state.buffers.color.setClear( 0, 0, 0, 0, premultipliedAlpha ); } @@ -15987,7 +16051,7 @@ class OrthographicCamera extends Camera { } - this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far ); + this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far, this.coordinateSystem ); this.projectionMatrixInverse.copy( this.projectionMatrix ).invert(); @@ -17234,7 +17298,7 @@ function WebGLGeometries( gl, attributes, info, bindingStates ) { } - } else { + } else if ( geometryPosition !== undefined ) { const array = geometryPosition.array; version = geometryPosition.version; @@ -17249,6 +17313,10 @@ function WebGLGeometries( gl, attributes, info, bindingStates ) { } + } else { + + return; + } const attribute = new ( arrayNeedsUint32( indices ) ? Uint32BufferAttribute : Uint16BufferAttribute )( indices, 1 ); @@ -17769,11 +17837,31 @@ function WebGLObjects( gl, geometries, attributes, info ) { } - attributes.update( object.instanceMatrix, gl.ARRAY_BUFFER ); + if ( updateMap.get( object ) !== frame ) { + + attributes.update( object.instanceMatrix, gl.ARRAY_BUFFER ); - if ( object.instanceColor !== null ) { + if ( object.instanceColor !== null ) { - attributes.update( object.instanceColor, gl.ARRAY_BUFFER ); + attributes.update( object.instanceColor, gl.ARRAY_BUFFER ); + + } + + updateMap.set( object, frame ); + + } + + } + + if ( object.isSkinnedMesh ) { + + const skeleton = object.skeleton; + + if ( updateMap.get( skeleton ) !== frame ) { + + skeleton.update(); + + updateMap.set( skeleton, frame ); } @@ -19170,13 +19258,30 @@ function resolveIncludes( string ) { } +const shaderChunkMap = new Map( [ + [ 'encodings_fragment', 'colorspace_fragment' ], // @deprecated, r154 + [ 'encodings_pars_fragment', 'colorspace_pars_fragment' ], // @deprecated, r154 + [ 'output_fragment', 'opaque_fragment' ], // @deprecated, r154 +] ); + function includeReplacer( match, include ) { - const string = ShaderChunk[ include ]; + let string = ShaderChunk[ include ]; if ( string === undefined ) { - throw new Error( 'Can not resolve #include <' + include + '>' ); + const newInclude = shaderChunkMap.get( include ); + + if ( newInclude !== undefined ) { + + string = ShaderChunk[ newInclude ]; + console.warn( 'THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.', include, newInclude ); + + } else { + + throw new Error( 'Can not resolve #include <' + include + '>' ); + + } } @@ -19452,6 +19557,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) { parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '', parameters.metalnessMap ? '#define USE_METALNESSMAP' : '', parameters.alphaMap ? '#define USE_ALPHAMAP' : '', + parameters.alphaHash ? '#define USE_ALPHAHASH' : '', parameters.transmission ? '#define USE_TRANSMISSION' : '', parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '', @@ -19495,7 +19601,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) { // - parameters.vertexTangents ? '#define USE_TANGENT' : '', + parameters.vertexTangents && parameters.flatShading === false ? '#define USE_TANGENT' : '', parameters.vertexColors ? '#define USE_COLOR' : '', parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '', parameters.vertexUv1s ? '#define USE_UV1' : '', @@ -19673,6 +19779,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) { parameters.alphaMap ? '#define USE_ALPHAMAP' : '', parameters.alphaTest ? '#define USE_ALPHATEST' : '', + parameters.alphaHash ? '#define USE_ALPHAHASH' : '', parameters.sheen ? '#define USE_SHEEN' : '', parameters.sheenColorMap ? '#define USE_SHEEN_COLORMAP' : '', @@ -19682,7 +19789,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) { parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '', parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '', - parameters.vertexTangents ? '#define USE_TANGENT' : '', + parameters.vertexTangents && parameters.flatShading === false ? '#define USE_TANGENT' : '', parameters.vertexColors || parameters.instancingColor ? '#define USE_COLOR' : '', parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '', parameters.vertexUv1s ? '#define USE_UV1' : '', @@ -19705,6 +19812,8 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) { parameters.useLegacyLights ? '#define LEGACY_LIGHTS' : '', + parameters.decodeVideoTexture ? '#define DECODE_VIDEO_TEXTURE' : '', + parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', ( parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ) ? '#define USE_LOGDEPTHBUF_EXT' : '', @@ -19719,7 +19828,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) { parameters.dithering ? '#define DITHERING' : '', parameters.opaque ? '#define OPAQUE' : '', - ShaderChunk[ 'encodings_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below + ShaderChunk[ 'colorspace_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below getTexelEncodingFunction( 'linearToOutputTexel', parameters.outputColorSpace ), parameters.useDepthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '', @@ -19939,7 +20048,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) { } -let _id = 0; +let _id$1 = 0; class WebGLShaderCache { @@ -20053,7 +20162,7 @@ class WebGLShaderStage { constructor( code ) { - this.id = _id ++; + this.id = _id$1 ++; this.code = code; this.usedTimes = 0; @@ -20209,12 +20318,26 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities const HAS_ALPHATEST = material.alphaTest > 0; + const HAS_ALPHAHASH = !! material.alphaHash; + const HAS_EXTENSIONS = !! material.extensions; const HAS_ATTRIBUTE_UV1 = !! geometry.attributes.uv1; const HAS_ATTRIBUTE_UV2 = !! geometry.attributes.uv2; const HAS_ATTRIBUTE_UV3 = !! geometry.attributes.uv3; + let toneMapping = NoToneMapping; + + if ( material.toneMapped ) { + + if ( currentRenderTarget === null || currentRenderTarget.isXRRenderTarget === true ) { + + toneMapping = renderer.toneMapping; + + } + + } + const parameters = { isWebGL2: IS_WEBGL2, @@ -20289,6 +20412,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities alphaMap: HAS_ALPHAMAP, alphaTest: HAS_ALPHATEST, + alphaHash: HAS_ALPHAHASH, combine: material.combine, @@ -20374,8 +20498,10 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities shadowMapEnabled: renderer.shadowMap.enabled && shadows.length > 0, shadowMapType: renderer.shadowMap.type, - toneMapping: material.toneMapped ? renderer.toneMapping : NoToneMapping, - useLegacyLights: renderer.useLegacyLights, + toneMapping: toneMapping, + useLegacyLights: renderer._useLegacyLights, + + decodeVideoTexture: HAS_MAP && ( material.map.isVideoTexture === true ) && ( material.map.colorSpace === SRGBColorSpace ), premultipliedAlpha: material.premultipliedAlpha, @@ -20578,6 +20704,8 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities _programLayers.enable( 17 ); if ( parameters.pointsUvs ) _programLayers.enable( 18 ); + if ( parameters.decodeVideoTexture ) + _programLayers.enable( 19 ); array.push( _programLayers.mask ); @@ -23547,6 +23675,17 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, } + if ( glFormat === _gl.RED_INTEGER ) { + + if ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.R8UI; + if ( glType === _gl.UNSIGNED_SHORT ) internalFormat = _gl.R16UI; + if ( glType === _gl.UNSIGNED_INT ) internalFormat = _gl.R32UI; + if ( glType === _gl.BYTE ) internalFormat = _gl.R8I; + if ( glType === _gl.SHORT ) internalFormat = _gl.R16I; + if ( glType === _gl.INT ) internalFormat = _gl.R32I; + + } + if ( glFormat === _gl.RG ) { if ( glType === _gl.FLOAT ) internalFormat = _gl.RG32F; @@ -23723,14 +23862,32 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, for ( let i = 0; i < 6; i ++ ) { - _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ] ); + if ( Array.isArray( renderTargetProperties.__webglFramebuffer[ i ] ) ) { + + for ( let level = 0; level < renderTargetProperties.__webglFramebuffer[ i ].length; level ++ ) _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ][ level ] ); + + } else { + + _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ] ); + + } + if ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer[ i ] ); } } else { - _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer ); + if ( Array.isArray( renderTargetProperties.__webglFramebuffer ) ) { + + for ( let level = 0; level < renderTargetProperties.__webglFramebuffer.length; level ++ ) _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ level ] ); + + } else { + + _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer ); + + } + if ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer ); if ( renderTargetProperties.__webglMultisampledFramebuffer ) _gl.deleteFramebuffer( renderTargetProperties.__webglMultisampledFramebuffer ); @@ -24109,7 +24266,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, glFormat = utils.convert( texture.format, texture.colorSpace ); let glType = utils.convert( texture.type ), - glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace ); + glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace, texture.isVideoTexture ); setTextureParameters( textureType, texture, supportsMips ); @@ -24705,7 +24862,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, // Render targets // Setup storage for target texture and bind it to correct framebuffer - function setupFrameBufferTexture( framebuffer, renderTarget, texture, attachment, textureTarget ) { + function setupFrameBufferTexture( framebuffer, renderTarget, texture, attachment, textureTarget, level ) { const glFormat = utils.convert( texture.format, texture.colorSpace ); const glType = utils.convert( texture.type ); @@ -24714,13 +24871,16 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, if ( ! renderTargetProperties.__hasExternalTextures ) { + const width = Math.max( 1, renderTarget.width >> level ); + const height = Math.max( 1, renderTarget.height >> level ); + if ( textureTarget === _gl.TEXTURE_3D || textureTarget === _gl.TEXTURE_2D_ARRAY ) { - state.texImage3D( textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, renderTarget.depth, 0, glFormat, glType, null ); + state.texImage3D( textureTarget, level, glInternalFormat, width, height, renderTarget.depth, 0, glFormat, glType, null ); } else { - state.texImage2D( textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null ); + state.texImage2D( textureTarget, level, glInternalFormat, width, height, 0, glFormat, glType, null ); } @@ -24734,7 +24894,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, } else if ( textureTarget === _gl.TEXTURE_2D || ( textureTarget >= _gl.TEXTURE_CUBE_MAP_POSITIVE_X && textureTarget <= _gl.TEXTURE_CUBE_MAP_NEGATIVE_Z ) ) { // see #24753 - _gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( texture ).__webglTexture, 0 ); + _gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( texture ).__webglTexture, level ); } @@ -24955,7 +25115,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, if ( colorTexture !== undefined ) { - setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, renderTarget.texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D ); + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, renderTarget.texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D, 0 ); } @@ -25002,13 +25162,41 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, for ( let i = 0; i < 6; i ++ ) { - renderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer(); + if ( isWebGL2 && texture.mipmaps && texture.mipmaps.length > 0 ) { + + renderTargetProperties.__webglFramebuffer[ i ] = []; + + for ( let level = 0; level < texture.mipmaps.length; level ++ ) { + + renderTargetProperties.__webglFramebuffer[ i ][ level ] = _gl.createFramebuffer(); + + } + + } else { + + renderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer(); + + } } } else { - renderTargetProperties.__webglFramebuffer = _gl.createFramebuffer(); + if ( isWebGL2 && texture.mipmaps && texture.mipmaps.length > 0 ) { + + renderTargetProperties.__webglFramebuffer = []; + + for ( let level = 0; level < texture.mipmaps.length; level ++ ) { + + renderTargetProperties.__webglFramebuffer[ level ] = _gl.createFramebuffer(); + + } + + } else { + + renderTargetProperties.__webglFramebuffer = _gl.createFramebuffer(); + + } if ( isMultipleRenderTargets ) { @@ -25088,7 +25276,19 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, for ( let i = 0; i < 6; i ++ ) { - setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i ); + if ( isWebGL2 && texture.mipmaps && texture.mipmaps.length > 0 ) { + + for ( let level = 0; level < texture.mipmaps.length; level ++ ) { + + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ][ level ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, level ); + + } + + } else { + + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0 ); + + } } @@ -25111,7 +25311,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, state.bindTexture( _gl.TEXTURE_2D, attachmentProperties.__webglTexture ); setTextureParameters( _gl.TEXTURE_2D, attachment, supportsMips ); - setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, attachment, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D ); + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, attachment, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D, 0 ); if ( textureNeedsGenerateMipmaps( attachment, supportsMips ) ) { @@ -25143,7 +25343,20 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, state.bindTexture( glTextureType, textureProperties.__webglTexture ); setTextureParameters( glTextureType, texture, supportsMips ); - setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType ); + + if ( isWebGL2 && texture.mipmaps && texture.mipmaps.length > 0 ) { + + for ( let level = 0; level < texture.mipmaps.length; level ++ ) { + + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ level ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType, level ); + + } + + } else { + + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType, 0 ); + + } if ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) { @@ -25332,13 +25545,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, const format = texture.format; const type = texture.type; - if ( texture.isCompressedTexture === true || texture.format === _SRGBAFormat ) return image; + if ( texture.isCompressedTexture === true || texture.isVideoTexture === true || texture.format === _SRGBAFormat ) return image; if ( colorSpace !== LinearSRGBColorSpace && colorSpace !== NoColorSpace ) { // sRGB - if ( colorSpace === SRGBColorSpace ) { + if ( colorSpace === SRGBColorSpace || colorSpace === DisplayP3ColorSpace ) { if ( isWebGL2 === false ) { @@ -25404,6 +25617,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, } +const LinearTransferFunction = 0; +const SRGBTransferFunction = 1; + function WebGLUtils( gl, extensions, capabilities ) { const isWebGL2 = capabilities.isWebGL2; @@ -25412,6 +25628,8 @@ function WebGLUtils( gl, extensions, capabilities ) { let extension; + const transferFunction = ( colorSpace === SRGBColorSpace || colorSpace === DisplayP3ColorSpace ) ? SRGBTransferFunction : LinearTransferFunction; + if ( p === UnsignedByteType ) return gl.UNSIGNED_BYTE; if ( p === UnsignedShort4444Type ) return gl.UNSIGNED_SHORT_4_4_4_4; if ( p === UnsignedShort5551Type ) return gl.UNSIGNED_SHORT_5_5_5_1; @@ -25478,7 +25696,7 @@ function WebGLUtils( gl, extensions, capabilities ) { if ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) { - if ( colorSpace === SRGBColorSpace ) { + if ( transferFunction === SRGBTransferFunction ) { extension = extensions.get( 'WEBGL_compressed_texture_s3tc_srgb' ); @@ -25563,8 +25781,8 @@ function WebGLUtils( gl, extensions, capabilities ) { if ( extension !== null ) { - if ( p === RGB_ETC2_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2; - if ( p === RGBA_ETC2_EAC_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : extension.COMPRESSED_RGBA8_ETC2_EAC; + if ( p === RGB_ETC2_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2; + if ( p === RGBA_ETC2_EAC_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : extension.COMPRESSED_RGBA8_ETC2_EAC; } else { @@ -25586,20 +25804,20 @@ function WebGLUtils( gl, extensions, capabilities ) { if ( extension !== null ) { - if ( p === RGBA_ASTC_4x4_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : extension.COMPRESSED_RGBA_ASTC_4x4_KHR; - if ( p === RGBA_ASTC_5x4_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : extension.COMPRESSED_RGBA_ASTC_5x4_KHR; - if ( p === RGBA_ASTC_5x5_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : extension.COMPRESSED_RGBA_ASTC_5x5_KHR; - if ( p === RGBA_ASTC_6x5_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : extension.COMPRESSED_RGBA_ASTC_6x5_KHR; - if ( p === RGBA_ASTC_6x6_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : extension.COMPRESSED_RGBA_ASTC_6x6_KHR; - if ( p === RGBA_ASTC_8x5_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : extension.COMPRESSED_RGBA_ASTC_8x5_KHR; - if ( p === RGBA_ASTC_8x6_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : extension.COMPRESSED_RGBA_ASTC_8x6_KHR; - if ( p === RGBA_ASTC_8x8_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : extension.COMPRESSED_RGBA_ASTC_8x8_KHR; - if ( p === RGBA_ASTC_10x5_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : extension.COMPRESSED_RGBA_ASTC_10x5_KHR; - if ( p === RGBA_ASTC_10x6_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : extension.COMPRESSED_RGBA_ASTC_10x6_KHR; - if ( p === RGBA_ASTC_10x8_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : extension.COMPRESSED_RGBA_ASTC_10x8_KHR; - if ( p === RGBA_ASTC_10x10_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : extension.COMPRESSED_RGBA_ASTC_10x10_KHR; - if ( p === RGBA_ASTC_12x10_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : extension.COMPRESSED_RGBA_ASTC_12x10_KHR; - if ( p === RGBA_ASTC_12x12_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : extension.COMPRESSED_RGBA_ASTC_12x12_KHR; + if ( p === RGBA_ASTC_4x4_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : extension.COMPRESSED_RGBA_ASTC_4x4_KHR; + if ( p === RGBA_ASTC_5x4_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : extension.COMPRESSED_RGBA_ASTC_5x4_KHR; + if ( p === RGBA_ASTC_5x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : extension.COMPRESSED_RGBA_ASTC_5x5_KHR; + if ( p === RGBA_ASTC_6x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : extension.COMPRESSED_RGBA_ASTC_6x5_KHR; + if ( p === RGBA_ASTC_6x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : extension.COMPRESSED_RGBA_ASTC_6x6_KHR; + if ( p === RGBA_ASTC_8x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : extension.COMPRESSED_RGBA_ASTC_8x5_KHR; + if ( p === RGBA_ASTC_8x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : extension.COMPRESSED_RGBA_ASTC_8x6_KHR; + if ( p === RGBA_ASTC_8x8_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : extension.COMPRESSED_RGBA_ASTC_8x8_KHR; + if ( p === RGBA_ASTC_10x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : extension.COMPRESSED_RGBA_ASTC_10x5_KHR; + if ( p === RGBA_ASTC_10x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : extension.COMPRESSED_RGBA_ASTC_10x6_KHR; + if ( p === RGBA_ASTC_10x8_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : extension.COMPRESSED_RGBA_ASTC_10x8_KHR; + if ( p === RGBA_ASTC_10x10_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : extension.COMPRESSED_RGBA_ASTC_10x10_KHR; + if ( p === RGBA_ASTC_12x10_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : extension.COMPRESSED_RGBA_ASTC_12x10_KHR; + if ( p === RGBA_ASTC_12x12_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : extension.COMPRESSED_RGBA_ASTC_12x12_KHR; } else { @@ -25611,13 +25829,15 @@ function WebGLUtils( gl, extensions, capabilities ) { // BPTC - if ( p === RGBA_BPTC_Format ) { + if ( p === RGBA_BPTC_Format || p === RGB_BPTC_SIGNED_Format || p === RGB_BPTC_UNSIGNED_Format ) { extension = extensions.get( 'EXT_texture_compression_bptc' ); if ( extension !== null ) { - if ( p === RGBA_BPTC_Format ) return ( colorSpace === SRGBColorSpace ) ? extension.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : extension.COMPRESSED_RGBA_BPTC_UNORM_EXT; + if ( p === RGBA_BPTC_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : extension.COMPRESSED_RGBA_BPTC_UNORM_EXT; + if ( p === RGB_BPTC_SIGNED_Format ) return extension.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT; + if ( p === RGB_BPTC_UNSIGNED_Format ) return extension.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT; } else { @@ -26130,8 +26350,6 @@ class WebXRManager extends EventDispatcher { // - let userCamera = null; - const cameraL = new PerspectiveCamera(); cameraL.layers.enable( 1 ); cameraL.viewport = new Vector4(); @@ -26151,19 +26369,11 @@ class WebXRManager extends EventDispatcher { // - this.cameraAutoUpdate = true; // @deprecated, r153 + this.cameraAutoUpdate = true; this.enabled = false; this.isPresenting = false; - this.getCamera = function () {}; // @deprecated, r153 - - this.setUserCamera = function ( value ) { - - userCamera = value; - - }; - this.getController = function ( index ) { let controller = controllers[ index ]; @@ -26600,15 +26810,9 @@ class WebXRManager extends EventDispatcher { } - this.updateCameraXR = function ( camera ) { - - if ( session === null ) return camera; + this.updateCamera = function ( camera ) { - if ( userCamera ) { - - camera = userCamera; - - } + if ( session === null ) return; cameraXR.near = cameraR.near = cameraL.near = camera.near; cameraXR.far = cameraR.far = cameraL.far = camera.far; @@ -26654,19 +26858,11 @@ class WebXRManager extends EventDispatcher { // update user camera and its children - if ( userCamera ) { - - updateUserCamera( cameraXR, parent ); - - } - - return cameraXR; + updateUserCamera( camera, cameraXR, parent ); }; - function updateUserCamera( cameraXR, parent ) { - - const camera = userCamera; + function updateUserCamera( camera, cameraXR, parent ) { if ( parent === null ) { @@ -26683,14 +26879,6 @@ class WebXRManager extends EventDispatcher { camera.matrix.decompose( camera.position, camera.quaternion, camera.scale ); camera.updateMatrixWorld( true ); - const children = camera.children; - - for ( let i = 0, l = children.length; i < l; i ++ ) { - - children[ i ].updateMatrixWorld( true ); - - } - camera.projectionMatrix.copy( cameraXR.projectionMatrix ); camera.projectionMatrixInverse.copy( cameraXR.projectionMatrixInverse ); @@ -26703,6 +26891,12 @@ class WebXRManager extends EventDispatcher { } + this.getCamera = function () { + + return cameraXR; + + }; + this.getFoveation = function () { if ( glProjLayer === null && glBaseLayer === null ) { @@ -27100,7 +27294,7 @@ function WebGLMaterials( renderer, properties ) { uniforms.lightMap.value = material.lightMap; // artist-friendly light intensity scaling factor - const scaleFactor = ( renderer.useLegacyLights === true ) ? Math.PI : 1; + const scaleFactor = ( renderer._useLegacyLights === true ) ? Math.PI : 1; uniforms.lightMapIntensity.value = material.lightMapIntensity * scaleFactor; @@ -27847,14 +28041,6 @@ function WebGLUniformsGroups( gl, info, capabilities, state ) { } -function createCanvasElement() { - - const canvas = createElementNS( 'canvas' ); - canvas.style.display = 'block'; - return canvas; - -} - class WebGLRenderer { constructor( parameters = {} ) { @@ -27939,7 +28125,7 @@ class WebGLRenderer { // physical lights - this.useLegacyLights = true; + this._useLegacyLights = false; // tone mapping @@ -28076,7 +28262,7 @@ class WebGLRenderer { } - if ( _gl instanceof WebGLRenderingContext ) { // @deprecated, r153 + if ( typeof WebGLRenderingContext !== 'undefined' && _gl instanceof WebGLRenderingContext ) { // @deprecated, r153 console.warn( 'THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163.' ); @@ -28394,15 +28580,13 @@ class WebGLRenderer { const g = clearColor.g; const b = clearColor.b; - const __webglFramebuffer = properties.get( _currentRenderTarget ).__webglFramebuffer; - if ( isUnsignedType ) { uintClearColor[ 0 ] = r; uintClearColor[ 1 ] = g; uintClearColor[ 2 ] = b; uintClearColor[ 3 ] = a; - _gl.clearBufferuiv( _gl.COLOR, __webglFramebuffer, uintClearColor ); + _gl.clearBufferuiv( _gl.COLOR, 0, uintClearColor ); } else { @@ -28410,7 +28594,7 @@ class WebGLRenderer { intClearColor[ 1 ] = g; intClearColor[ 2 ] = b; intClearColor[ 3 ] = a; - _gl.clearBufferiv( _gl.COLOR, __webglFramebuffer, intClearColor ); + _gl.clearBufferiv( _gl.COLOR, 0, intClearColor ); } @@ -28584,6 +28768,9 @@ class WebGLRenderer { if ( material.wireframe === true ) { index = geometries.getWireframeAttribute( geometry ); + + if ( index === undefined ) return; + rangeFactor = 2; } @@ -28748,7 +28935,7 @@ class WebGLRenderer { } ); - currentRenderState.setupLights( _this.useLegacyLights ); + currentRenderState.setupLights( _this._useLegacyLights ); scene.traverse( function ( object ) { @@ -28843,7 +29030,9 @@ class WebGLRenderer { if ( xr.enabled === true && xr.isPresenting === true ) { - camera = xr.updateCameraXR( camera ); // use XR camera for rendering + if ( xr.cameraAutoUpdate === true ) xr.updateCamera( camera ); + + camera = xr.getCamera(); // use XR camera for rendering } @@ -28878,6 +29067,8 @@ class WebGLRenderer { // + this.info.render.frame ++; + if ( _clippingEnabled === true ) clipping.beginShadows(); const shadowsArray = currentRenderState.state.shadowsArray; @@ -28890,7 +29081,6 @@ class WebGLRenderer { if ( this.info.autoReset === true ) this.info.reset(); - this.info.render.frame ++; // @@ -28898,7 +29088,7 @@ class WebGLRenderer { // render scene - currentRenderState.setupLights( _this.useLegacyLights ); + currentRenderState.setupLights( _this._useLegacyLights ); if ( camera.isArrayCamera ) { @@ -29020,19 +29210,6 @@ class WebGLRenderer { if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) { - if ( object.isSkinnedMesh ) { - - // update skeleton only once in a frame - - if ( object.skeleton.frame !== info.render.frame ) { - - object.skeleton.update(); - object.skeleton.frame = info.render.frame; - - } - - } - const geometry = objects.update( object ); const material = object.material; @@ -29133,7 +29310,7 @@ class WebGLRenderer { generateMipmaps: true, type: extensions.has( 'EXT_color_buffer_half_float' ) ? HalfFloatType : UnsignedByteType, minFilter: LinearMipmapLinearFilter, - samples: ( isWebGL2 && antialias === true ) ? 4 : 0 + samples: ( isWebGL2 ) ? 4 : 0 } ); // debug @@ -29400,6 +29577,7 @@ class WebGLRenderer { materialProperties.outputColorSpace = parameters.outputColorSpace; materialProperties.instancing = parameters.instancing; + materialProperties.instancingColor = parameters.instancingColor; materialProperties.skinning = parameters.skinning; materialProperties.morphTargets = parameters.morphTargets; materialProperties.morphNormals = parameters.morphNormals; @@ -29428,7 +29606,18 @@ class WebGLRenderer { const morphTargets = !! geometry.morphAttributes.position; const morphNormals = !! geometry.morphAttributes.normal; const morphColors = !! geometry.morphAttributes.color; - const toneMapping = material.toneMapped ? _this.toneMapping : NoToneMapping; + + let toneMapping = NoToneMapping; + + if ( material.toneMapped ) { + + if ( _currentRenderTarget === null || _currentRenderTarget.isXRRenderTarget === true ) { + + toneMapping = _this.toneMapping; + + } + + } const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color; const morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0; @@ -29483,6 +29672,14 @@ class WebGLRenderer { needsProgramChange = true; + } else if ( object.isInstancedMesh && materialProperties.instancingColor === true && object.instanceColor === null ) { + + needsProgramChange = true; + + } else if ( object.isInstancedMesh && materialProperties.instancingColor === false && object.instanceColor !== null ) { + + needsProgramChange = true; + } else if ( materialProperties.envMap !== envMap ) { needsProgramChange = true; @@ -29569,48 +29766,28 @@ class WebGLRenderer { if ( refreshProgram || _currentCamera !== camera ) { - p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix ); - - if ( capabilities.logarithmicDepthBuffer ) { + // common camera uniforms - p_uniforms.setValue( _gl, 'logDepthBufFC', - 2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) ); - - } - - if ( _currentCamera !== camera ) { + p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix ); + p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse ); - _currentCamera = camera; + const uCamPos = p_uniforms.map.cameraPosition; - // lighting uniforms depend on the camera so enforce an update - // now, in case this material supports lights - or later, when - // the next material that does gets activated: + if ( uCamPos !== undefined ) { - refreshMaterial = true; // set to true on material change - refreshLights = true; // remains set until update done + uCamPos.setValue( _gl, _vector3.setFromMatrixPosition( camera.matrixWorld ) ); } - // load material specific uniforms - // (shader material also gets them for the sake of genericity) - - if ( material.isShaderMaterial || - material.isMeshPhongMaterial || - material.isMeshToonMaterial || - material.isMeshStandardMaterial || - material.envMap ) { - - const uCamPos = p_uniforms.map.cameraPosition; - - if ( uCamPos !== undefined ) { - - uCamPos.setValue( _gl, - _vector3.setFromMatrixPosition( camera.matrixWorld ) ); + if ( capabilities.logarithmicDepthBuffer ) { - } + p_uniforms.setValue( _gl, 'logDepthBufFC', + 2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) ); } + // consider moving isOrthographic to UniformLib and WebGLMaterials, see https://github.com/mrdoob/three.js/pull/26467#issuecomment-1645185067 + if ( material.isMeshPhongMaterial || material.isMeshToonMaterial || material.isMeshLambertMaterial || @@ -29622,16 +29799,16 @@ class WebGLRenderer { } - if ( material.isMeshPhongMaterial || - material.isMeshToonMaterial || - material.isMeshLambertMaterial || - material.isMeshBasicMaterial || - material.isMeshStandardMaterial || - material.isShaderMaterial || - material.isShadowMaterial || - object.isSkinnedMesh ) { + if ( _currentCamera !== camera ) { - p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse ); + _currentCamera = camera; + + // lighting uniforms depend on the camera so enforce an update + // now, in case this material supports lights - or later, when + // the next material that does gets activated: + + refreshMaterial = true; // set to true on material change + refreshLights = true; // remains set until update done } @@ -29898,7 +30075,16 @@ class WebGLRenderer { if ( renderTarget.isWebGLCubeRenderTarget ) { - framebuffer = __webglFramebuffer[ activeCubeFace ]; + if ( Array.isArray( __webglFramebuffer[ activeCubeFace ] ) ) { + + framebuffer = __webglFramebuffer[ activeCubeFace ][ activeMipmapLevel ]; + + } else { + + framebuffer = __webglFramebuffer[ activeCubeFace ]; + + } + isCube = true; } else if ( ( capabilities.isWebGL2 && renderTarget.samples > 0 ) && textures.useMultisampledRTT( renderTarget ) === false ) { @@ -29907,7 +30093,15 @@ class WebGLRenderer { } else { - framebuffer = __webglFramebuffer; + if ( Array.isArray( __webglFramebuffer ) ) { + + framebuffer = __webglFramebuffer[ activeMipmapLevel ]; + + } else { + + framebuffer = __webglFramebuffer; + + } } @@ -30198,16 +30392,22 @@ class WebGLRenderer { } + get coordinateSystem() { + + return WebGLCoordinateSystem; + + } + get physicallyCorrectLights() { // @deprecated, r150 - console.warn( 'THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' ); + console.warn( 'THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' ); return ! this.useLegacyLights; } set physicallyCorrectLights( value ) { // @deprecated, r150 - console.warn( 'THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' ); + console.warn( 'THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' ); this.useLegacyLights = ! value; } @@ -30226,6 +30426,20 @@ class WebGLRenderer { } + get useLegacyLights() { // @deprecated, r155 + + console.warn( 'THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733.' ); + return this._useLegacyLights; + + } + + set useLegacyLights( value ) { // @deprecated, r155 + + console.warn( 'THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733.' ); + this._useLegacyLights = value; + + } + } class WebGL1Renderer extends WebGLRenderer {} @@ -30355,20 +30569,6 @@ class Scene extends Object3D { } - get autoUpdate() { // @deprecated, r144 - - console.warn( 'THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.' ); - return this.matrixWorldAutoUpdate; - - } - - set autoUpdate( value ) { // @deprecated, r144 - - console.warn( 'THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.' ); - this.matrixWorldAutoUpdate = value; - - } - } class InterleavedBuffer { @@ -31571,8 +31771,6 @@ class Skeleton { this.boneTexture = null; this.boneTextureSize = 0; - this.frame = - 1; - this.init(); } @@ -32141,7 +32339,7 @@ class Line extends Object3D { super.copy( source, recursive ); - this.material = source.material; + this.material = Array.isArray( source.material ) ? source.material.slice() : source.material; this.geometry = source.geometry; return this; @@ -32462,7 +32660,7 @@ class Points extends Object3D { super.copy( source, recursive ); - this.material = source.material; + this.material = Array.isArray( source.material ) ? source.material.slice() : source.material; this.geometry = source.geometry; return this; @@ -32702,6 +32900,21 @@ class CompressedArrayTexture extends CompressedTexture { } +class CompressedCubeTexture extends CompressedTexture { + + constructor( images, format, type ) { + + super( undefined, images[ 0 ].width, images[ 0 ].height, format, type, CubeReflectionMapping ); + + this.isCompressedCubeTexture = true; + this.isCubeTexture = true; + + this.image = images; + + } + +} + class CanvasTexture extends Texture { constructor( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) { @@ -34812,7 +35025,7 @@ class CapsuleGeometry extends LatheGeometry { this.parameters = { radius: radius, - height: length, + length: length, capSegments: capSegments, radialSegments: radialSegments, }; @@ -41631,6 +41844,8 @@ class Loader { } +Loader.DEFAULT_MATERIAL_NAME = '__DEFAULT'; + const loading = {}; class HttpError extends Error { @@ -42193,6 +42408,7 @@ class CubeTextureLoader extends Loader { load( urls, onLoad, onProgress, onError ) { const texture = new CubeTexture(); + texture.colorSpace = SRGBColorSpace; const loader = new ImageLoader( this.manager ); loader.setCrossOrigin( this.crossOrigin ); @@ -42259,9 +42475,26 @@ class DataTextureLoader extends Loader { loader.setWithCredentials( scope.withCredentials ); loader.load( url, function ( buffer ) { - const texData = scope.parse( buffer ); + let texData; + + try { + + texData = scope.parse( buffer ); + + } catch ( error ) { + + if ( onError !== undefined ) { - if ( ! texData ) return; + onError( error ); + + } else { + + console.error( error ); + return; + + } + + } if ( texData.image !== undefined ) { @@ -43347,6 +43580,7 @@ class MaterialLoader extends Loader { if ( json.opacity !== undefined ) material.opacity = json.opacity; if ( json.transparent !== undefined ) material.transparent = json.transparent; if ( json.alphaTest !== undefined ) material.alphaTest = json.alphaTest; + if ( json.alphaHash !== undefined ) material.alphaHash = json.alphaHash; if ( json.depthTest !== undefined ) material.depthTest = json.depthTest; if ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite; if ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite; @@ -45667,6 +45901,12 @@ class Audio extends Object3D { disconnect() { + if ( this._connected === false ) { + + return; + + } + if ( this.filters.length > 0 ) { this.source.disconnect( this.filters[ 0 ] ); @@ -45867,6 +46107,14 @@ class PositionalAudio extends Audio { } + connect() { + + super.connect(); + + this.panner.connect( this.gain ); + + } + disconnect() { super.disconnect(); @@ -46774,7 +47022,7 @@ class PropertyBinding { // ensure there is a value node if ( ! targetObject ) { - console.error( 'THREE.PropertyBinding: Trying to update node for track: ' + this.path + ' but it wasn\'t found.' ); + console.warn( 'THREE.PropertyBinding: No target node found for track: ' + this.path + '.' ); return; } @@ -48907,7 +49155,7 @@ class Uniform { } -let id = 0; +let _id = 0; class UniformsGroup extends EventDispatcher { @@ -48917,7 +49165,7 @@ class UniformsGroup extends EventDispatcher { this.isUniformsGroup = true; - Object.defineProperty( this, 'id', { value: id ++ } ); + Object.defineProperty( this, 'id', { value: _id ++ } ); this.name = ''; @@ -51163,216 +51411,6 @@ class ShapePath { } -class BoxBufferGeometry extends BoxGeometry { // @deprecated, r144 - - constructor( width, height, depth, widthSegments, heightSegments, depthSegments ) { - - console.warn( 'THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry.' ); - super( width, height, depth, widthSegments, heightSegments, depthSegments ); - - - } - -} - -class CapsuleBufferGeometry extends CapsuleGeometry { // @deprecated, r144 - - constructor( radius, length, capSegments, radialSegments ) { - - console.warn( 'THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry.' ); - super( radius, length, capSegments, radialSegments ); - - } - -} - -class CircleBufferGeometry extends CircleGeometry { // @deprecated, r144 - - constructor( radius, segments, thetaStart, thetaLength ) { - - console.warn( 'THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry.' ); - super( radius, segments, thetaStart, thetaLength ); - - } - -} - -class ConeBufferGeometry extends ConeGeometry { // @deprecated, r144 - - constructor( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { - - console.warn( 'THREE.ConeBufferGeometry has been renamed to THREE.ConeGeometry.' ); - super( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); - - } - -} - -class CylinderBufferGeometry extends CylinderGeometry { // @deprecated, r144 - - constructor( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { - - console.warn( 'THREE.CylinderBufferGeometry has been renamed to THREE.CylinderGeometry.' ); - super( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); - - } - -} - -class DodecahedronBufferGeometry extends DodecahedronGeometry { // @deprecated, r144 - - constructor( radius, detail ) { - - console.warn( 'THREE.DodecahedronBufferGeometry has been renamed to THREE.DodecahedronGeometry.' ); - super( radius, detail ); - - } - -} - -class ExtrudeBufferGeometry extends ExtrudeGeometry { // @deprecated, r144 - - constructor( shapes, options ) { - - console.warn( 'THREE.ExtrudeBufferGeometry has been renamed to THREE.ExtrudeGeometry.' ); - super( shapes, options ); - - } - -} - -class IcosahedronBufferGeometry extends IcosahedronGeometry { // @deprecated, r144 - - constructor( radius, detail ) { - - console.warn( 'THREE.IcosahedronBufferGeometry has been renamed to THREE.IcosahedronGeometry.' ); - super( radius, detail ); - - } - -} - -class LatheBufferGeometry extends LatheGeometry { // @deprecated, r144 - - constructor( points, segments, phiStart, phiLength ) { - - console.warn( 'THREE.LatheBufferGeometry has been renamed to THREE.LatheGeometry.' ); - super( points, segments, phiStart, phiLength ); - - } - -} - -class OctahedronBufferGeometry extends OctahedronGeometry { // @deprecated, r144 - - constructor( radius, detail ) { - - console.warn( 'THREE.OctahedronBufferGeometry has been renamed to THREE.OctahedronGeometry.' ); - super( radius, detail ); - - } - -} - -class PlaneBufferGeometry extends PlaneGeometry { // @deprecated, r144 - - constructor( width, height, widthSegments, heightSegments ) { - - console.warn( 'THREE.PlaneBufferGeometry has been renamed to THREE.PlaneGeometry.' ); - super( width, height, widthSegments, heightSegments ); - - } - -} - -class PolyhedronBufferGeometry extends PolyhedronGeometry { // @deprecated, r144 - - constructor( vertices, indices, radius, detail ) { - - console.warn( 'THREE.PolyhedronBufferGeometry has been renamed to THREE.PolyhedronGeometry.' ); - super( vertices, indices, radius, detail ); - - } - -} - -class RingBufferGeometry extends RingGeometry { // @deprecated, r144 - - constructor( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) { - - console.warn( 'THREE.RingBufferGeometry has been renamed to THREE.RingGeometry.' ); - super( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ); - - } - -} - -class ShapeBufferGeometry extends ShapeGeometry { // @deprecated, r144 - - constructor( shapes, curveSegments ) { - - console.warn( 'THREE.ShapeBufferGeometry has been renamed to THREE.ShapeGeometry.' ); - super( shapes, curveSegments ); - - } - -} - -class SphereBufferGeometry extends SphereGeometry { // @deprecated, r144 - - constructor( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) { - - console.warn( 'THREE.SphereBufferGeometry has been renamed to THREE.SphereGeometry.' ); - super( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ); - - } - -} - -class TetrahedronBufferGeometry extends TetrahedronGeometry { // @deprecated, r144 - - constructor( radius, detail ) { - - console.warn( 'THREE.TetrahedronBufferGeometry has been renamed to THREE.TetrahedronGeometry.' ); - super( radius, detail ); - - } - -} - -class TorusBufferGeometry extends TorusGeometry { // @deprecated, r144 - - constructor( radius, tube, radialSegments, tubularSegments, arc ) { - - console.warn( 'THREE.TorusBufferGeometry has been renamed to THREE.TorusGeometry.' ); - super( radius, tube, radialSegments, tubularSegments, arc ); - - } - -} - -class TorusKnotBufferGeometry extends TorusKnotGeometry { // @deprecated, r144 - - constructor( radius, tube, tubularSegments, radialSegments, p, q ) { - - console.warn( 'THREE.TorusKnotBufferGeometry has been renamed to THREE.TorusKnotGeometry.' ); - super( radius, tube, tubularSegments, radialSegments, p, q ); - - } - -} - -class TubeBufferGeometry extends TubeGeometry { // @deprecated, r144 - - constructor( path, tubularSegments, radius, radialSegments, closed ) { - - console.warn( 'THREE.TubeBufferGeometry has been renamed to THREE.TubeGeometry.' ); - super( path, tubularSegments, radius, radialSegments, closed ); - - } - -} - if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) { __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: { @@ -51395,4 +51433,4 @@ if ( typeof window !== 'undefined' ) { } -export { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AlphaFormat, AlwaysCompare, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AmbientLightProbe, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BackSide, BasicDepthPacking, BasicShadowMap, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxBufferGeometry, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasTexture, CapsuleBufferGeometry, CapsuleGeometry, CatmullRomCurve3, CineonToneMapping, CircleBufferGeometry, CircleGeometry, ClampToEdgeWrapping, Clock, Color, ColorKeyframeTrack, ColorManagement, CompressedArrayTexture, CompressedTexture, CompressedTextureLoader, ConeBufferGeometry, ConeGeometry, CubeCamera, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderBufferGeometry, CylinderGeometry, Cylindrical, Data3DTexture, DataArrayTexture, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DisplayP3ColorSpace, DodecahedronBufferGeometry, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualCompare, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExtrudeBufferGeometry, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, Float64BufferAttribute, FloatType, Fog, FogExp2, FramebufferTexture, FrontSide, Frustum, GLBufferAttribute, GLSL1, GLSL3, GreaterCompare, GreaterDepth, GreaterEqualCompare, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HemisphereLight, HemisphereLightHelper, HemisphereLightProbe, IcosahedronBufferGeometry, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheBufferGeometry, LatheGeometry, Layers, LessCompare, LessDepth, LessEqualCompare, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearEncoding, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, LuminanceAlphaFormat, LuminanceFormat, MOUSE, Material, MaterialLoader, MathUtils, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeverCompare, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoToneMapping, NormalAnimationBlendMode, NormalBlending, NotEqualCompare, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronBufferGeometry, OctahedronGeometry, OneFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, PMREMGenerator, Path, PerspectiveCamera, Plane, PlaneBufferGeometry, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronBufferGeometry, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, RED_GREEN_RGTC2_Format, RED_RGTC1_Format, REVISION, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, RingBufferGeometry, RingGeometry, SIGNED_RED_GREEN_RGTC2_Format, SIGNED_RED_RGTC1_Format, SRGBColorSpace, Scene, ShaderChunk, ShaderLib, ShaderMaterial, ShadowMaterial, Shape, ShapeBufferGeometry, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereBufferGeometry, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronBufferGeometry, TetrahedronGeometry, Texture, TextureLoader, TorusBufferGeometry, TorusGeometry, TorusKnotBufferGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeBufferGeometry, TubeGeometry, TwoPassDoubleSide, UVMapping, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsGroup, UniformsLib, UniformsUtils, UnsignedByteType, UnsignedInt248Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, VideoTexture, WebGL1Renderer, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGLCubeRenderTarget, WebGLMultipleRenderTargets, WebGLRenderTarget, WebGLRenderer, WebGLUtils, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, _SRGBAFormat, sRGBEncoding }; +export { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AlphaFormat, AlwaysCompare, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AmbientLightProbe, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BackSide, BasicDepthPacking, BasicShadowMap, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CineonToneMapping, CircleGeometry, ClampToEdgeWrapping, Clock, Color, ColorKeyframeTrack, ColorManagement, CompressedArrayTexture, CompressedCubeTexture, CompressedTexture, CompressedTextureLoader, ConeGeometry, CubeCamera, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderGeometry, Cylindrical, Data3DTexture, DataArrayTexture, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DisplayP3ColorSpace, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualCompare, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, Float64BufferAttribute, FloatType, Fog, FogExp2, FramebufferTexture, FrontSide, Frustum, GLBufferAttribute, GLSL1, GLSL3, GreaterCompare, GreaterDepth, GreaterEqualCompare, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HemisphereLight, HemisphereLightHelper, HemisphereLightProbe, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, Layers, LessCompare, LessDepth, LessEqualCompare, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearDisplayP3ColorSpace, LinearEncoding, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, LuminanceAlphaFormat, LuminanceFormat, MOUSE, Material, MaterialLoader, MathUtils, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeverCompare, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoToneMapping, NormalAnimationBlendMode, NormalBlending, NotEqualCompare, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronGeometry, OneFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, PMREMGenerator, Path, PerspectiveCamera, Plane, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, RED_GREEN_RGTC2_Format, RED_RGTC1_Format, REVISION, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RenderTarget, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, RingGeometry, SIGNED_RED_GREEN_RGTC2_Format, SIGNED_RED_RGTC1_Format, SRGBColorSpace, Scene, ShaderChunk, ShaderLib, ShaderMaterial, ShadowMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronGeometry, Texture, TextureLoader, TorusGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeGeometry, TwoPassDoubleSide, UVMapping, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsGroup, UniformsLib, UniformsUtils, UnsignedByteType, UnsignedInt248Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, VideoTexture, WebGL1Renderer, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGLCoordinateSystem, WebGLCubeRenderTarget, WebGLMultipleRenderTargets, WebGLRenderTarget, WebGLRenderer, WebGLUtils, WebGPUCoordinateSystem, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, _SRGBAFormat, createCanvasElement, sRGBEncoding }; diff --git a/build/three.module.min.js b/build/three.module.min.js index b79a4dda7c1a11..52e97bd23548c2 100644 --- a/build/three.module.min.js +++ b/build/three.module.min.js @@ -3,4 +3,4 @@ * Copyright 2010-2023 Three.js Authors * SPDX-License-Identifier: MIT */ -const t="153dev",e={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},n={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},i=0,r=1,s=2,a=3,o=0,l=1,c=2,h=3,u=0,d=1,p=2,m=2,f=0,g=1,v=2,_=3,y=4,x=5,M=100,S=101,b=102,E=103,T=104,w=200,A=201,R=202,C=203,P=204,L=205,I=206,U=207,N=208,D=209,O=210,F=0,B=1,z=2,H=3,k=4,V=5,G=6,W=7,X=0,j=1,q=2,Y=0,Z=1,J=2,K=3,$=4,Q=5,tt=300,et=301,nt=302,it=303,rt=304,st=306,at=1e3,ot=1001,lt=1002,ct=1003,ht=1004,ut=1004,dt=1005,pt=1005,mt=1006,ft=1007,gt=1007,vt=1008,_t=1008,yt=1009,xt=1010,Mt=1011,St=1012,bt=1013,Et=1014,Tt=1015,wt=1016,At=1017,Rt=1018,Ct=1020,Pt=1021,Lt=1023,It=1024,Ut=1025,Nt=1026,Dt=1027,Ot=1028,Ft=1029,Bt=1030,zt=1031,Ht=1033,kt=33776,Vt=33777,Gt=33778,Wt=33779,Xt=35840,jt=35841,qt=35842,Yt=35843,Zt=36196,Jt=37492,Kt=37496,$t=37808,Qt=37809,te=37810,ee=37811,ne=37812,ie=37813,re=37814,se=37815,ae=37816,oe=37817,le=37818,ce=37819,he=37820,ue=37821,de=36492,pe=36283,me=36284,fe=36285,ge=36286,ve=2200,_e=2201,ye=2202,xe=2300,Me=2301,Se=2302,be=2400,Ee=2401,Te=2402,we=2500,Ae=2501,Re=0,Ce=1,Pe=2,Le=3e3,Ie=3001,Ue=3200,Ne=3201,De=0,Oe=1,Fe="",Be="srgb",ze="srgb-linear",He="display-p3",ke=0,Ve=7680,Ge=7681,We=7682,Xe=7683,je=34055,qe=34056,Ye=5386,Ze=512,Je=513,Ke=514,$e=515,Qe=516,tn=517,en=518,nn=519,rn=512,sn=513,an=514,on=515,ln=516,cn=517,hn=518,un=519,dn=35044,pn=35048,mn=35040,fn=35045,gn=35049,vn=35041,_n=35046,yn=35050,xn=35042,Mn="100",Sn="300 es",bn=1035;class En{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,i=n.length;e>8&255]+Tn[t>>16&255]+Tn[t>>24&255]+"-"+Tn[255&e]+Tn[e>>8&255]+"-"+Tn[e>>16&15|64]+Tn[e>>24&255]+"-"+Tn[63&n|128]+Tn[n>>8&255]+"-"+Tn[n>>16&255]+Tn[n>>24&255]+Tn[255&i]+Tn[i>>8&255]+Tn[i>>16&255]+Tn[i>>24&255]).toLowerCase()}function Pn(t,e,n){return Math.max(e,Math.min(n,t))}function Ln(t,e){return(t%e+e)%e}function In(t,e,n){return(1-n)*t+n*e}function Un(t){return 0==(t&t-1)&&0!==t}function Nn(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function Dn(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function On(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Fn(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const Bn={DEG2RAD:An,RAD2DEG:Rn,generateUUID:Cn,clamp:Pn,euclideanModulo:Ln,mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},inverseLerp:function(t,e,n){return t!==e?(n-t)/(e-t):0},lerp:In,damp:function(t,e,n,i){return In(t,e,1-Math.exp(-n*i))},pingpong:function(t,e=1){return e-Math.abs(Ln(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(wn=t);let e=wn+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*An},radToDeg:function(t){return t*Rn},isPowerOfTwo:Un,ceilPowerOfTwo:Nn,floorPowerOfTwo:Dn,setQuaternionFromProperEuler:function(t,e,n,i,r){const s=Math.cos,a=Math.sin,o=s(n/2),l=a(n/2),c=s((e+i)/2),h=a((e+i)/2),u=s((e-i)/2),d=a((e-i)/2),p=s((i-e)/2),m=a((i-e)/2);switch(r){case"XYX":t.set(o*h,l*u,l*d,o*c);break;case"YZY":t.set(l*d,o*h,l*u,o*c);break;case"ZXZ":t.set(l*u,l*d,o*h,o*c);break;case"XZX":t.set(o*h,l*m,l*p,o*c);break;case"YXY":t.set(l*p,o*h,l*m,o*c);break;case"ZYZ":t.set(l*m,l*p,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:Fn,denormalize:On};class zn{constructor(t=0,e=0){zn.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Pn(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,s=this.y-t.y;return this.x=r*n-s*i+t.x,this.y=r*i+s*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Hn{constructor(t,e,n,i,r,s,a,o,l){Hn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,n,i,r,s,a,o,l)}set(t,e,n,i,r,s,a,o,l){const c=this.elements;return c[0]=t,c[1]=i,c[2]=a,c[3]=e,c[4]=r,c[5]=o,c[6]=n,c[7]=s,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[3],o=n[6],l=n[1],c=n[4],h=n[7],u=n[2],d=n[5],p=n[8],m=i[0],f=i[3],g=i[6],v=i[1],_=i[4],y=i[7],x=i[2],M=i[5],S=i[8];return r[0]=s*m+a*v+o*x,r[3]=s*f+a*_+o*M,r[6]=s*g+a*y+o*S,r[1]=l*m+c*v+h*x,r[4]=l*f+c*_+h*M,r[7]=l*g+c*y+h*S,r[2]=u*m+d*v+p*x,r[5]=u*f+d*_+p*M,r[8]=u*g+d*y+p*S,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8];return e*s*c-e*a*l-n*r*c+n*a*o+i*r*l-i*s*o}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8],h=c*s-a*l,u=a*o-c*r,d=l*r-s*o,p=e*h+n*u+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const m=1/p;return t[0]=h*m,t[1]=(i*l-c*n)*m,t[2]=(a*n-i*s)*m,t[3]=u*m,t[4]=(c*e-i*o)*m,t[5]=(i*r-a*e)*m,t[6]=d*m,t[7]=(n*o-l*e)*m,t[8]=(s*e-n*r)*m,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,s,a){const o=Math.cos(r),l=Math.sin(r);return this.set(n*o,n*l,-n*(o*s+l*a)+s+t,-i*l,i*o,-i*(-l*s+o*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(kn.makeScale(t,e)),this}rotate(t){return this.premultiply(kn.makeRotation(-t)),this}translate(t,e){return this.premultiply(kn.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}const kn=new Hn;function Vn(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const Gn={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Wn(t,e){return new Gn[t](e)}function Xn(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}const jn={};function qn(t){t in jn||(jn[t]=!0,console.warn(t))}function Yn(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Zn(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const Jn=(new Hn).fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),Kn=(new Hn).fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);const $n={[ze]:t=>t,[Be]:t=>t.convertSRGBToLinear(),[He]:function(t){return t.convertSRGBToLinear().applyMatrix3(Kn)}},Qn={[ze]:t=>t,[Be]:t=>t.convertLinearToSRGB(),[He]:function(t){return t.applyMatrix3(Jn).convertLinearToSRGB()}},ti={enabled:!0,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(t){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!t},get workingColorSpace(){return ze},set workingColorSpace(t){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(t,e,n){if(!1===this.enabled||e===n||!e||!n)return t;const i=$n[e],r=Qn[n];if(void 0===i||void 0===r)throw new Error(`Unsupported color space conversion, "${e}" to "${n}".`);return r(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)}};let ei;class ni{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===ei&&(ei=Xn("canvas")),ei.width=t.width,ei.height=t.height;const n=ei.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=ei}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=Xn("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const i=n.getImageData(0,0,t.width,t.height),r=i.data;for(let t=0;t0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==tt)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case at:t.x=t.x-Math.floor(t.x);break;case ot:t.x=t.x<0?0:1;break;case lt:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case at:t.y=t.y-Math.floor(t.y);break;case ot:t.y=t.y<0?0:1;break;case lt:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return qn("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Be?Ie:Le}set encoding(t){qn("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===Ie?Be:Fe}}oi.DEFAULT_IMAGE=null,oi.DEFAULT_MAPPING=tt,oi.DEFAULT_ANISOTROPY=1;class li{constructor(t=0,e=0,n=0,i=1){li.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i+s[12]*r,this.y=s[1]*e+s[5]*n+s[9]*i+s[13]*r,this.z=s[2]*e+s[6]*n+s[10]*i+s[14]*r,this.w=s[3]*e+s[7]*n+s[11]*i+s[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,r;const s=.01,a=.1,o=t.elements,l=o[0],c=o[4],h=o[8],u=o[1],d=o[5],p=o[9],m=o[2],f=o[6],g=o[10];if(Math.abs(c-u)o&&t>v?tv?o=0?1:-1,i=1-e*e;if(i>Number.EPSILON){const r=Math.sqrt(i),s=Math.atan2(r,e*n);t=Math.sin(t*s)/r,a=Math.sin(a*s)/r}const r=a*n;if(o=o*t+u*r,l=l*t+d*r,c=c*t+p*r,h=h*t+m*r,t===1-a){const t=1/Math.sqrt(o*o+l*l+c*c+h*h);o*=t,l*=t,c*=t,h*=t}}t[e]=o,t[e+1]=l,t[e+2]=c,t[e+3]=h}static multiplyQuaternionsFlat(t,e,n,i,r,s){const a=n[i],o=n[i+1],l=n[i+2],c=n[i+3],h=r[s],u=r[s+1],d=r[s+2],p=r[s+3];return t[e]=a*p+c*h+o*d-l*u,t[e+1]=o*p+c*u+l*h-a*d,t[e+2]=l*p+c*d+a*u-o*h,t[e+3]=c*p-a*h-o*u-l*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){const n=t._x,i=t._y,r=t._z,s=t._order,a=Math.cos,o=Math.sin,l=a(n/2),c=a(i/2),h=a(r/2),u=o(n/2),d=o(i/2),p=o(r/2);switch(s){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],r=e[8],s=e[1],a=e[5],o=e[9],l=e[2],c=e[6],h=e[10],u=n+a+h;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(c-o)*t,this._y=(r-l)*t,this._z=(s-i)*t}else if(n>a&&n>h){const t=2*Math.sqrt(1+n-a-h);this._w=(c-o)/t,this._x=.25*t,this._y=(i+s)/t,this._z=(r+l)/t}else if(a>h){const t=2*Math.sqrt(1+a-n-h);this._w=(r-l)/t,this._x=(i+s)/t,this._y=.25*t,this._z=(o+c)/t}else{const t=2*Math.sqrt(1+h-n-a);this._w=(s-i)/t,this._x=(r+l)/t,this._y=(o+c)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return nMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Pn(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,s=t._w,a=e._x,o=e._y,l=e._z,c=e._w;return this._x=n*c+s*a+i*l-r*o,this._y=i*c+s*o+r*a-n*l,this._z=r*c+s*l+n*o-i*a,this._w=s*c-n*a-i*o-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,i=this._y,r=this._z,s=this._w;let a=s*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=s,this._x=n,this._y=i,this._z=r,this;const o=1-a*a;if(o<=Number.EPSILON){const t=1-e;return this._w=t*s+e*this._w,this._x=t*n+e*this._x,this._y=t*i+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(o),c=Math.atan2(l,a),h=Math.sin((1-e)*c)/l,u=Math.sin(e*c)/l;return this._w=s*h+this._w*u,this._x=n*h+this._x*u,this._y=i*h+this._y*u,this._z=r*h+this._z*u,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=Math.random(),e=Math.sqrt(1-t),n=Math.sqrt(t),i=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(e*Math.cos(i),n*Math.sin(r),n*Math.cos(r),e*Math.sin(i))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class gi{constructor(t=0,e=0,n=0){gi.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(_i.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(_i.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.elements,s=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*s,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*s,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*s,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,a=t.z,o=t.w,l=o*e+s*i-a*n,c=o*n+a*e-r*i,h=o*i+r*n-s*e,u=-r*e-s*n-a*i;return this.x=l*o+u*-r+c*-a-h*-s,this.y=c*o+u*-s+h*-r-l*-a,this.z=h*o+u*-a+l*-s-c*-r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=i*o-r*a,this.y=r*s-n*o,this.z=n*a-i*s,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return vi.copy(this).projectOnVector(t),this.sub(vi)}reflect(t){return this.sub(vi.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Pn(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=2*(Math.random()-.5),e=Math.random()*Math.PI*2,n=Math.sqrt(1-t**2);return this.x=n*Math.cos(e),this.y=n*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const vi=new gi,_i=new fi;class yi{constructor(t=new gi(1/0,1/0,1/0),e=new gi(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Mi),Mi.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Ci),Pi.subVectors(this.max,Ci),bi.subVectors(t.a,Ci),Ei.subVectors(t.b,Ci),Ti.subVectors(t.c,Ci),wi.subVectors(Ei,bi),Ai.subVectors(Ti,Ei),Ri.subVectors(bi,Ti);let e=[0,-wi.z,wi.y,0,-Ai.z,Ai.y,0,-Ri.z,Ri.y,wi.z,0,-wi.x,Ai.z,0,-Ai.x,Ri.z,0,-Ri.x,-wi.y,wi.x,0,-Ai.y,Ai.x,0,-Ri.y,Ri.x,0];return!!Ui(e,bi,Ei,Ti,Pi)&&(e=[1,0,0,0,1,0,0,0,1],!!Ui(e,bi,Ei,Ti,Pi)&&(Li.crossVectors(wi,Ai),e=[Li.x,Li.y,Li.z],Ui(e,bi,Ei,Ti,Pi)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Mi).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(Mi).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(xi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),xi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),xi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),xi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),xi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),xi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),xi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),xi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(xi)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const xi=[new gi,new gi,new gi,new gi,new gi,new gi,new gi,new gi],Mi=new gi,Si=new yi,bi=new gi,Ei=new gi,Ti=new gi,wi=new gi,Ai=new gi,Ri=new gi,Ci=new gi,Pi=new gi,Li=new gi,Ii=new gi;function Ui(t,e,n,i,r){for(let s=0,a=t.length-3;s<=a;s+=3){Ii.fromArray(t,s);const a=r.x*Math.abs(Ii.x)+r.y*Math.abs(Ii.y)+r.z*Math.abs(Ii.z),o=e.dot(Ii),l=n.dot(Ii),c=i.dot(Ii);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>a)return!1}return!0}const Ni=new yi,Di=new gi,Oi=new gi;class Fi{constructor(t=new gi,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):Ni.setFromPoints(t).getCenter(n);let i=0;for(let e=0,r=t.length;ethis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Di.subVectors(t,this.center);const e=Di.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),n=.5*(t-this.radius);this.center.addScaledVector(Di,n/t),this.radius+=n}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(Oi.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Di.copy(t.center).add(Oi)),this.expandByPoint(Di.copy(t.center).sub(Oi))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Bi=new gi,zi=new gi,Hi=new gi,ki=new gi,Vi=new gi,Gi=new gi,Wi=new gi;class Xi{constructor(t=new gi,e=new gi(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Bi)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Bi.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Bi.copy(this.origin).addScaledVector(this.direction,e),Bi.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){zi.copy(t).add(e).multiplyScalar(.5),Hi.copy(e).sub(t).normalize(),ki.copy(this.origin).sub(zi);const r=.5*t.distanceTo(e),s=-this.direction.dot(Hi),a=ki.dot(this.direction),o=-ki.dot(Hi),l=ki.lengthSq(),c=Math.abs(1-s*s);let h,u,d,p;if(c>0)if(h=s*o-a,u=s*a-o,p=r*c,h>=0)if(u>=-p)if(u<=p){const t=1/c;h*=t,u*=t,d=h*(h+s*u+2*a)+u*(s*h+u+2*o)+l}else u=r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;else u=-r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;else u<=-p?(h=Math.max(0,-(-s*r+a)),u=h>0?-r:Math.min(Math.max(-r,-o),r),d=-h*h+u*(u+2*o)+l):u<=p?(h=0,u=Math.min(Math.max(-r,-o),r),d=u*(u+2*o)+l):(h=Math.max(0,-(s*r+a)),u=h>0?r:Math.min(Math.max(-r,-o),r),d=-h*h+u*(u+2*o)+l);else u=s>0?-r:r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(zi).addScaledVector(Hi,u),d}intersectSphere(t,e){Bi.subVectors(t.center,this.origin);const n=Bi.dot(this.direction),i=Bi.dot(Bi)-n*n,r=t.radius*t.radius;if(i>r)return null;const s=Math.sqrt(r-i),a=n-s,o=n+s;return o<0?null:a<0?this.at(o,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,r,s,a,o;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(n=(t.min.x-u.x)*l,i=(t.max.x-u.x)*l):(n=(t.max.x-u.x)*l,i=(t.min.x-u.x)*l),c>=0?(r=(t.min.y-u.y)*c,s=(t.max.y-u.y)*c):(r=(t.max.y-u.y)*c,s=(t.min.y-u.y)*c),n>s||r>i?null:((r>n||isNaN(n))&&(n=r),(s=0?(a=(t.min.z-u.z)*h,o=(t.max.z-u.z)*h):(a=(t.max.z-u.z)*h,o=(t.min.z-u.z)*h),n>o||a>i?null:((a>n||n!=n)&&(n=a),(o=0?n:i,e)))}intersectsBox(t){return null!==this.intersectBox(t,Bi)}intersectTriangle(t,e,n,i,r){Vi.subVectors(e,t),Gi.subVectors(n,t),Wi.crossVectors(Vi,Gi);let s,a=this.direction.dot(Wi);if(a>0){if(i)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}ki.subVectors(this.origin,t);const o=s*this.direction.dot(Gi.crossVectors(ki,Gi));if(o<0)return null;const l=s*this.direction.dot(Vi.cross(ki));if(l<0)return null;if(o+l>a)return null;const c=-s*ki.dot(Wi);return c<0?null:this.at(c/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class ji{constructor(t,e,n,i,r,s,a,o,l,c,h,u,d,p,m,f){ji.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,n,i,r,s,a,o,l,c,h,u,d,p,m,f)}set(t,e,n,i,r,s,a,o,l,c,h,u,d,p,m,f){const g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=r,g[5]=s,g[9]=a,g[13]=o,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=m,g[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new ji).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,i=1/qi.setFromMatrixColumn(t,0).length(),r=1/qi.setFromMatrixColumn(t,1).length(),s=1/qi.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*s,e[9]=n[9]*s,e[10]=n[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,i=t.y,r=t.z,s=Math.cos(n),a=Math.sin(n),o=Math.cos(i),l=Math.sin(i),c=Math.cos(r),h=Math.sin(r);if("XYZ"===t.order){const t=s*c,n=s*h,i=a*c,r=a*h;e[0]=o*c,e[4]=-o*h,e[8]=l,e[1]=n+i*l,e[5]=t-r*l,e[9]=-a*o,e[2]=r-t*l,e[6]=i+n*l,e[10]=s*o}else if("YXZ"===t.order){const t=o*c,n=o*h,i=l*c,r=l*h;e[0]=t+r*a,e[4]=i*a-n,e[8]=s*l,e[1]=s*h,e[5]=s*c,e[9]=-a,e[2]=n*a-i,e[6]=r+t*a,e[10]=s*o}else if("ZXY"===t.order){const t=o*c,n=o*h,i=l*c,r=l*h;e[0]=t-r*a,e[4]=-s*h,e[8]=i+n*a,e[1]=n+i*a,e[5]=s*c,e[9]=r-t*a,e[2]=-s*l,e[6]=a,e[10]=s*o}else if("ZYX"===t.order){const t=s*c,n=s*h,i=a*c,r=a*h;e[0]=o*c,e[4]=i*l-n,e[8]=t*l+r,e[1]=o*h,e[5]=r*l+t,e[9]=n*l-i,e[2]=-l,e[6]=a*o,e[10]=s*o}else if("YZX"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*c,e[4]=r-t*h,e[8]=i*h+n,e[1]=h,e[5]=s*c,e[9]=-a*c,e[2]=-l*c,e[6]=n*h+i,e[10]=t-r*h}else if("XZY"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*c,e[4]=-h,e[8]=l*c,e[1]=t*h+r,e[5]=s*c,e[9]=n*h-i,e[2]=i*h-n,e[6]=a*c,e[10]=r*h+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Zi,t,Ji)}lookAt(t,e,n){const i=this.elements;return Qi.subVectors(t,e),0===Qi.lengthSq()&&(Qi.z=1),Qi.normalize(),Ki.crossVectors(n,Qi),0===Ki.lengthSq()&&(1===Math.abs(n.z)?Qi.x+=1e-4:Qi.z+=1e-4,Qi.normalize(),Ki.crossVectors(n,Qi)),Ki.normalize(),$i.crossVectors(Qi,Ki),i[0]=Ki.x,i[4]=$i.x,i[8]=Qi.x,i[1]=Ki.y,i[5]=$i.y,i[9]=Qi.y,i[2]=Ki.z,i[6]=$i.z,i[10]=Qi.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[4],o=n[8],l=n[12],c=n[1],h=n[5],u=n[9],d=n[13],p=n[2],m=n[6],f=n[10],g=n[14],v=n[3],_=n[7],y=n[11],x=n[15],M=i[0],S=i[4],b=i[8],E=i[12],T=i[1],w=i[5],A=i[9],R=i[13],C=i[2],P=i[6],L=i[10],I=i[14],U=i[3],N=i[7],D=i[11],O=i[15];return r[0]=s*M+a*T+o*C+l*U,r[4]=s*S+a*w+o*P+l*N,r[8]=s*b+a*A+o*L+l*D,r[12]=s*E+a*R+o*I+l*O,r[1]=c*M+h*T+u*C+d*U,r[5]=c*S+h*w+u*P+d*N,r[9]=c*b+h*A+u*L+d*D,r[13]=c*E+h*R+u*I+d*O,r[2]=p*M+m*T+f*C+g*U,r[6]=p*S+m*w+f*P+g*N,r[10]=p*b+m*A+f*L+g*D,r[14]=p*E+m*R+f*I+g*O,r[3]=v*M+_*T+y*C+x*U,r[7]=v*S+_*w+y*P+x*N,r[11]=v*b+_*A+y*L+x*D,r[15]=v*E+_*R+y*I+x*O,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],s=t[1],a=t[5],o=t[9],l=t[13],c=t[2],h=t[6],u=t[10],d=t[14];return t[3]*(+r*o*h-i*l*h-r*a*u+n*l*u+i*a*d-n*o*d)+t[7]*(+e*o*d-e*l*u+r*s*u-i*s*d+i*l*c-r*o*c)+t[11]*(+e*l*h-e*a*d-r*s*h+n*s*d+r*a*c-n*l*c)+t[15]*(-i*a*c-e*o*h+e*a*u+i*s*h-n*s*u+n*o*c)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8],h=t[9],u=t[10],d=t[11],p=t[12],m=t[13],f=t[14],g=t[15],v=h*f*l-m*u*l+m*o*d-a*f*d-h*o*g+a*u*g,_=p*u*l-c*f*l-p*o*d+s*f*d+c*o*g-s*u*g,y=c*m*l-p*h*l+p*a*d-s*m*d-c*a*g+s*h*g,x=p*h*o-c*m*o-p*a*u+s*m*u+c*a*f-s*h*f,M=e*v+n*_+i*y+r*x;if(0===M)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/M;return t[0]=v*S,t[1]=(m*u*r-h*f*r-m*i*d+n*f*d+h*i*g-n*u*g)*S,t[2]=(a*f*r-m*o*r+m*i*l-n*f*l-a*i*g+n*o*g)*S,t[3]=(h*o*r-a*u*r-h*i*l+n*u*l+a*i*d-n*o*d)*S,t[4]=_*S,t[5]=(c*f*r-p*u*r+p*i*d-e*f*d-c*i*g+e*u*g)*S,t[6]=(p*o*r-s*f*r-p*i*l+e*f*l+s*i*g-e*o*g)*S,t[7]=(s*u*r-c*o*r+c*i*l-e*u*l-s*i*d+e*o*d)*S,t[8]=y*S,t[9]=(p*h*r-c*m*r-p*n*d+e*m*d+c*n*g-e*h*g)*S,t[10]=(s*m*r-p*a*r+p*n*l-e*m*l-s*n*g+e*a*g)*S,t[11]=(c*a*r-s*h*r-c*n*l+e*h*l+s*n*d-e*a*d)*S,t[12]=x*S,t[13]=(c*m*i-p*h*i+p*n*u-e*m*u-c*n*f+e*h*f)*S,t[14]=(p*a*i-s*m*i-p*n*o+e*m*o+s*n*f-e*a*f)*S,t[15]=(s*h*i-c*a*i+c*n*o-e*h*o-s*n*u+e*a*u)*S,this}scale(t){const e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,s=t.x,a=t.y,o=t.z,l=r*s,c=r*a;return this.set(l*s+n,l*a-i*o,l*o+i*a,0,l*a+i*o,c*a+n,c*o-i*s,0,l*o-i*a,c*o+i*s,r*o*o+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,r,s){return this.set(1,n,r,0,t,1,s,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){const i=this.elements,r=e._x,s=e._y,a=e._z,o=e._w,l=r+r,c=s+s,h=a+a,u=r*l,d=r*c,p=r*h,m=s*c,f=s*h,g=a*h,v=o*l,_=o*c,y=o*h,x=n.x,M=n.y,S=n.z;return i[0]=(1-(m+g))*x,i[1]=(d+y)*x,i[2]=(p-_)*x,i[3]=0,i[4]=(d-y)*M,i[5]=(1-(u+g))*M,i[6]=(f+v)*M,i[7]=0,i[8]=(p+_)*S,i[9]=(f-v)*S,i[10]=(1-(u+m))*S,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.elements;let r=qi.set(i[0],i[1],i[2]).length();const s=qi.set(i[4],i[5],i[6]).length(),a=qi.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],Yi.copy(this);const o=1/r,l=1/s,c=1/a;return Yi.elements[0]*=o,Yi.elements[1]*=o,Yi.elements[2]*=o,Yi.elements[4]*=l,Yi.elements[5]*=l,Yi.elements[6]*=l,Yi.elements[8]*=c,Yi.elements[9]*=c,Yi.elements[10]*=c,e.setFromRotationMatrix(Yi),n.x=r,n.y=s,n.z=a,this}makePerspective(t,e,n,i,r,s){const a=this.elements,o=2*r/(e-t),l=2*r/(n-i),c=(e+t)/(e-t),h=(n+i)/(n-i),u=-(s+r)/(s-r),d=-2*s*r/(s-r);return a[0]=o,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=l,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=u,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,n,i,r,s){const a=this.elements,o=1/(e-t),l=1/(n-i),c=1/(s-r),h=(e+t)*o,u=(n+i)*l,d=(s+r)*c;return a[0]=2*o,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-u,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<16;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const qi=new gi,Yi=new ji,Zi=new gi(0,0,0),Ji=new gi(1,1,1),Ki=new gi,$i=new gi,Qi=new gi,tr=new ji,er=new fi;class nr{constructor(t=0,e=0,n=0,i=nr.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const i=t.elements,r=i[0],s=i[4],a=i[8],o=i[1],l=i[5],c=i[9],h=i[2],u=i[6],d=i[10];switch(e){case"XYZ":this._y=Math.asin(Pn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Pn(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(Pn(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-Pn(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(Pn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-Pn(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return tr.makeRotationFromQuaternion(t),this.setFromRotationMatrix(tr,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return er.setFromEuler(this),this.setFromQuaternion(er,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}nr.DEFAULT_ORDER="XYZ";class ir{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let t=0;t1){for(let t=0;t0&&(n=n.concat(r))}return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(cr,t,hr),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(cr,ur,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,i=e.length;n0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const n=e.shapes;if(Array.isArray(n))for(let e=0,i=n.length;e0){i.children=[];for(let e=0;e0){i.animations=[];for(let e=0;e0&&(n.geometries=e),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),a.length>0&&(n.images=a),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),h.length>0&&(n.nodes=h)}return n.object=i,n;function s(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(t,e,n,i,r){_r.subVectors(i,e),yr.subVectors(n,e),xr.subVectors(t,e);const s=_r.dot(_r),a=_r.dot(yr),o=_r.dot(xr),l=yr.dot(yr),c=yr.dot(xr),h=s*l-a*a;if(0===h)return r.set(-2,-1,-1);const u=1/h,d=(l*o-a*c)*u,p=(s*c-a*o)*u;return r.set(1-d-p,p,d)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,Mr),Mr.x>=0&&Mr.y>=0&&Mr.x+Mr.y<=1}static getUV(t,e,n,i,r,s,a,o){return!1===Rr&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Rr=!0),this.getInterpolation(t,e,n,i,r,s,a,o)}static getInterpolation(t,e,n,i,r,s,a,o){return this.getBarycoord(t,e,n,i,Mr),o.setScalar(0),o.addScaledVector(r,Mr.x),o.addScaledVector(s,Mr.y),o.addScaledVector(a,Mr.z),o}static isFrontFacing(t,e,n,i){return _r.subVectors(n,e),yr.subVectors(t,e),_r.cross(yr).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return _r.subVectors(this.c,this.b),yr.subVectors(this.a,this.b),.5*_r.cross(yr).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Cr.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Cr.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,i,r){return!1===Rr&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Rr=!0),Cr.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}getInterpolation(t,e,n,i,r){return Cr.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}containsPoint(t){return Cr.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Cr.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,i=this.b,r=this.c;let s,a;Sr.subVectors(i,n),br.subVectors(r,n),Tr.subVectors(t,n);const o=Sr.dot(Tr),l=br.dot(Tr);if(o<=0&&l<=0)return e.copy(n);wr.subVectors(t,i);const c=Sr.dot(wr),h=br.dot(wr);if(c>=0&&h<=c)return e.copy(i);const u=o*h-c*l;if(u<=0&&o>=0&&c<=0)return s=o/(o-c),e.copy(n).addScaledVector(Sr,s);Ar.subVectors(t,r);const d=Sr.dot(Ar),p=br.dot(Ar);if(p>=0&&d<=p)return e.copy(r);const m=d*l-o*p;if(m<=0&&l>=0&&p<=0)return a=l/(l-p),e.copy(n).addScaledVector(br,a);const f=c*p-d*h;if(f<=0&&h-c>=0&&d-p>=0)return Er.subVectors(r,i),a=(h-c)/(h-c+(d-p)),e.copy(i).addScaledVector(Er,a);const g=1/(f+m+u);return s=m*g,a=u*g,e.copy(n).addScaledVector(Sr,s).addScaledVector(br,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let Pr=0;class Lr extends En{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Pr++}),this.uuid=Cn(),this.name="",this.type="Material",this.blending=g,this.side=u,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=P,this.blendDst=L,this.blendEquation=M,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=H,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ve,this.stencilZFail=Ve,this.stencilZPass=Ve,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n:console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`)}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function i(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==g&&(n.blending=this.blending),this.side!==u&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.forceSinglePass&&(n.forceSinglePass=this.forceSinglePass),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),e){const e=i(t.textures),r=i(t.images);e.length>0&&(n.textures=e),r.length>0&&(n.images=r)}return n}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let i=0;i!==t;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}const Ir={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ur={h:0,s:0,l:0},Nr={h:0,s:0,l:0};function Dr(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}class Or{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(void 0===e&&void 0===n){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Be){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,ti.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=ti.workingColorSpace){return this.r=t,this.g=e,this.b=n,ti.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=ti.workingColorSpace){if(t=Ln(t,1),e=Pn(e,0,1),n=Pn(n,0,1),0===e)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=Dr(r,i,t+1/3),this.g=Dr(r,i,t),this.b=Dr(r,i,t-1/3)}return ti.toWorkingColorSpace(this,i),this}setStyle(t,e=Be){function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const s=i[1],a=i[2];switch(s){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const n=i[1],r=n.length;if(3===r)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,e);if(6===r)return this.setHex(parseInt(n,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Be){const n=Ir[t.toLowerCase()];return void 0!==n?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Yn(t.r),this.g=Yn(t.g),this.b=Yn(t.b),this}copyLinearToSRGB(t){return this.r=Zn(t.r),this.g=Zn(t.g),this.b=Zn(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Be){return ti.fromWorkingColorSpace(Fr.copy(this),t),65536*Math.round(Pn(255*Fr.r,0,255))+256*Math.round(Pn(255*Fr.g,0,255))+Math.round(Pn(255*Fr.b,0,255))}getHexString(t=Be){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=ti.workingColorSpace){ti.fromWorkingColorSpace(Fr.copy(this),e);const n=Fr.r,i=Fr.g,r=Fr.b,s=Math.max(n,i,r),a=Math.min(n,i,r);let o,l;const c=(a+s)/2;if(a===s)o=0,l=0;else{const t=s-a;switch(l=c<=.5?t/(s+a):t/(2-s-a),s){case n:o=(i-r)/t+(i>-e-14,i[256|t]=1024>>-e-14|32768,r[t]=-e-1,r[256|t]=-e-1):e<=15?(i[t]=e+15<<10,i[256|t]=e+15<<10|32768,r[t]=13,r[256|t]=13):e<128?(i[t]=31744,i[256|t]=64512,r[t]=24,r[256|t]=24):(i[t]=31744,i[256|t]=64512,r[t]=13,r[256|t]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,n=0;for(;0==(8388608&e);)e<<=1,n-=8388608;e&=-8388609,n+=947912704,s[t]=e|n}for(let t=1024;t<2048;++t)s[t]=939524096+(t-1024<<13);for(let t=1;t<31;++t)a[t]=t<<23;a[31]=1199570944,a[32]=2147483648;for(let t=33;t<63;++t)a[t]=2147483648+(t-32<<23);a[63]=3347054592;for(let t=1;t<64;++t)32!==t&&(o[t]=1024);return{floatView:e,uint32View:n,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:o}}function kr(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=Pn(t,-65504,65504),zr.floatView[0]=t;const e=zr.uint32View[0],n=e>>23&511;return zr.baseTable[n]+((8388607&e)>>zr.shiftTable[n])}function Vr(t){const e=t>>10;return zr.uint32View[0]=zr.mantissaTable[zr.offsetTable[e]+(1023&t)]+zr.exponentTable[e],zr.floatView[0]}const Gr={toHalfFloat:kr,fromHalfFloat:Vr},Wr=new gi,Xr=new zn;class jr{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=n,this.usage=dn,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const i=n[e];t.data.attributes[e]=i.toJSON(t.data)}const i={};let r=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],s=[];for(let e=0,i=n.length;e0&&(i[e]=s,r=!0)}r&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return null!==a&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const i=t.attributes;for(const t in i){const n=i[t];this.setAttribute(t,n.clone(e))}const r=t.morphAttributes;for(const t in r){const n=[],i=r[t];for(let t=0,r=i.length;t0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t(t.far-t.near)**2)return}us.copy(r).invert(),ds.copy(t.ray).applyMatrix4(us),null!==n.boundingBox&&!1===ds.intersectsBox(n.boundingBox)||this._computeIntersections(t,e,ds)}}_computeIntersections(t,e,n){let i;const r=this.geometry,s=this.material,a=r.index,o=r.attributes.position,l=r.attributes.uv,c=r.attributes.uv1,h=r.attributes.normal,u=r.groups,d=r.drawRange;if(null!==a)if(Array.isArray(s))for(let r=0,o=u.length;rn.far?null:{distance:c,point:As.clone(),object:t}}(t,e,n,i,fs,gs,vs,ws);if(h){r&&(xs.fromBufferAttribute(r,o),Ms.fromBufferAttribute(r,l),Ss.fromBufferAttribute(r,c),h.uv=Cr.getInterpolation(ws,fs,gs,vs,xs,Ms,Ss,new zn)),s&&(xs.fromBufferAttribute(s,o),Ms.fromBufferAttribute(s,l),Ss.fromBufferAttribute(s,c),h.uv1=Cr.getInterpolation(ws,fs,gs,vs,xs,Ms,Ss,new zn),h.uv2=h.uv1),a&&(bs.fromBufferAttribute(a,o),Es.fromBufferAttribute(a,l),Ts.fromBufferAttribute(a,c),h.normal=Cr.getInterpolation(ws,fs,gs,vs,bs,Es,Ts,new gi),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const t={a:o,b:l,c:c,normal:new gi,materialIndex:0};Cr.getNormal(fs,gs,vs,t.normal),h.face=t}return h}class Ps extends hs{constructor(t=1,e=1,n=1,i=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:s};const a=this;i=Math.floor(i),r=Math.floor(r),s=Math.floor(s);const o=[],l=[],c=[],h=[];let u=0,d=0;function p(t,e,n,i,r,s,p,m,f,g,v){const _=s/f,y=p/g,x=s/2,M=p/2,S=m/2,b=f+1,E=g+1;let T=0,w=0;const A=new gi;for(let s=0;s0?1:-1,c.push(A.x,A.y,A.z),h.push(o/f),h.push(1-s/g),T+=1}}for(let t=0;t0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const t in this.extensions)!0===this.extensions[t]&&(n[t]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class Os extends vr{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ji,this.projectionMatrix=new ji,this.projectionMatrixInverse=new ji}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}class Fs extends Os{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*Rn*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*An*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*Rn*Math.atan(Math.tan(.5*An*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,n,i,r,s){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*An*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,a=s.fullHeight;r+=s.offsetX*i/t,e-=s.offsetY*n/a,i*=s.width/t,n*=s.height/a}const a=this.filmOffset;0!==a&&(r+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const Bs=-90;class zs extends vr{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n;const i=new Fs(Bs,1,t,e);i.layers=this.layers,i.up.set(0,1,0),i.lookAt(1,0,0),this.add(i);const r=new Fs(Bs,1,t,e);r.layers=this.layers,r.up.set(0,1,0),r.lookAt(-1,0,0),this.add(r);const s=new Fs(Bs,1,t,e);s.layers=this.layers,s.up.set(0,0,-1),s.lookAt(0,1,0),this.add(s);const a=new Fs(Bs,1,t,e);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(0,-1,0),this.add(a);const o=new Fs(Bs,1,t,e);o.layers=this.layers,o.up.set(0,1,0),o.lookAt(0,0,1),this.add(o);const l=new Fs(Bs,1,t,e);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,-1),this.add(l)}update(t,e){null===this.parent&&this.updateMatrixWorld();const n=this.renderTarget,[i,r,s,a,o,l]=this.children,c=t.getRenderTarget(),h=t.toneMapping,u=t.xr.enabled;t.toneMapping=Y,t.xr.enabled=!1;const d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,i),t.setRenderTarget(n,1),t.render(e,r),t.setRenderTarget(n,2),t.render(e,s),t.setRenderTarget(n,3),t.render(e,a),t.setRenderTarget(n,4),t.render(e,o),n.texture.generateMipmaps=d,t.setRenderTarget(n,5),t.render(e,l),t.setRenderTarget(c),t.toneMapping=h,t.xr.enabled=u,n.texture.needsPMREMUpdate=!0}}class Hs extends oi{constructor(t,e,n,i,r,s,a,o,l,c){super(t=void 0!==t?t:[],e=void 0!==e?e:et,n,i,r,s,a,o,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class ks extends ci{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];void 0!==e.encoding&&(qn("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),e.colorSpace=e.encoding===Ie?Be:Fe),this.texture=new Hs(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:mt}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},i=new Ps(5,5,5),r=new Ds({name:"CubemapFromEquirect",uniforms:Ls(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:d,blending:f});r.uniforms.tEquirect.value=e;const s=new Rs(i,r),a=e.minFilter;e.minFilter===vt&&(e.minFilter=mt);return new zs(1,10,this).update(t,s),e.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(t,e,n,i){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,n,i);t.setRenderTarget(r)}}const Vs=new gi,Gs=new gi,Ws=new Hn;class Xs{constructor(t=new gi(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const i=Vs.subVectors(n,e).cross(Gs.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta(Vs),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||Ws.getNormalMatrix(t),i=this.coplanarPoint(Vs).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const js=new Fi,qs=new gi;class Ys{constructor(t=new Xs,e=new Xs,n=new Xs,i=new Xs,r=new Xs,s=new Xs){this.planes=[t,e,n,i,r,s]}set(t,e,n,i,r,s){const a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[5].copy(s),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t){const e=this.planes,n=t.elements,i=n[0],r=n[1],s=n[2],a=n[3],o=n[4],l=n[5],c=n[6],h=n[7],u=n[8],d=n[9],p=n[10],m=n[11],f=n[12],g=n[13],v=n[14],_=n[15];return e[0].setComponents(a-i,h-o,m-u,_-f).normalize(),e[1].setComponents(a+i,h+o,m+u,_+f).normalize(),e[2].setComponents(a+r,h+l,m+d,_+g).normalize(),e[3].setComponents(a-r,h-l,m-d,_-g).normalize(),e[4].setComponents(a-s,h-c,m-p,_-v).normalize(),e[5].setComponents(a+s,h+c,m+p,_+v).normalize(),this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),js.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),js.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(js)}intersectsSprite(t){return js.center.set(0,0,0),js.radius=.7071067811865476,js.applyMatrix4(t.matrixWorld),this.intersectsSphere(js)}intersectsSphere(t){const e=this.planes,n=t.center,i=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(n)0?t.max.x:t.min.x,qs.y=i.normal.y>0?t.max.y:t.min.y,qs.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(qs)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Zs(){let t=null,e=!1,n=null,i=null;function r(e,s){n(e,s),i=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==n&&(i=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function Js(t,e){const n=e.isWebGL2,i=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),i.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const n=i.get(e);n&&(t.deleteBuffer(n.buffer),i.delete(e))},update:function(e,r){if(e.isGLBufferAttribute){const t=i.get(e);return void((!t||t.version 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tanisotropyV /= material.anisotropy;\n\tmaterial.anisotropy = saturate( material.anisotropy );\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x - tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x + tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometry.viewDir, geometry.normal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, vMapUv );\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal, vNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},Qs={common:{diffuse:{value:new Or(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Hn},alphaMap:{value:null},alphaMapTransform:{value:new Hn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Hn}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Hn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Hn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Hn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Hn},normalScale:{value:new zn(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Hn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Hn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Hn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Hn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Or(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Or(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Hn},alphaTest:{value:0},uvTransform:{value:new Hn}},sprite:{diffuse:{value:new Or(16777215)},opacity:{value:1},center:{value:new zn(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Hn},alphaMap:{value:null},alphaMapTransform:{value:new Hn},alphaTest:{value:0}}},ta={basic:{uniforms:Is([Qs.common,Qs.specularmap,Qs.envmap,Qs.aomap,Qs.lightmap,Qs.fog]),vertexShader:$s.meshbasic_vert,fragmentShader:$s.meshbasic_frag},lambert:{uniforms:Is([Qs.common,Qs.specularmap,Qs.envmap,Qs.aomap,Qs.lightmap,Qs.emissivemap,Qs.bumpmap,Qs.normalmap,Qs.displacementmap,Qs.fog,Qs.lights,{emissive:{value:new Or(0)}}]),vertexShader:$s.meshlambert_vert,fragmentShader:$s.meshlambert_frag},phong:{uniforms:Is([Qs.common,Qs.specularmap,Qs.envmap,Qs.aomap,Qs.lightmap,Qs.emissivemap,Qs.bumpmap,Qs.normalmap,Qs.displacementmap,Qs.fog,Qs.lights,{emissive:{value:new Or(0)},specular:{value:new Or(1118481)},shininess:{value:30}}]),vertexShader:$s.meshphong_vert,fragmentShader:$s.meshphong_frag},standard:{uniforms:Is([Qs.common,Qs.envmap,Qs.aomap,Qs.lightmap,Qs.emissivemap,Qs.bumpmap,Qs.normalmap,Qs.displacementmap,Qs.roughnessmap,Qs.metalnessmap,Qs.fog,Qs.lights,{emissive:{value:new Or(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:$s.meshphysical_vert,fragmentShader:$s.meshphysical_frag},toon:{uniforms:Is([Qs.common,Qs.aomap,Qs.lightmap,Qs.emissivemap,Qs.bumpmap,Qs.normalmap,Qs.displacementmap,Qs.gradientmap,Qs.fog,Qs.lights,{emissive:{value:new Or(0)}}]),vertexShader:$s.meshtoon_vert,fragmentShader:$s.meshtoon_frag},matcap:{uniforms:Is([Qs.common,Qs.bumpmap,Qs.normalmap,Qs.displacementmap,Qs.fog,{matcap:{value:null}}]),vertexShader:$s.meshmatcap_vert,fragmentShader:$s.meshmatcap_frag},points:{uniforms:Is([Qs.points,Qs.fog]),vertexShader:$s.points_vert,fragmentShader:$s.points_frag},dashed:{uniforms:Is([Qs.common,Qs.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:$s.linedashed_vert,fragmentShader:$s.linedashed_frag},depth:{uniforms:Is([Qs.common,Qs.displacementmap]),vertexShader:$s.depth_vert,fragmentShader:$s.depth_frag},normal:{uniforms:Is([Qs.common,Qs.bumpmap,Qs.normalmap,Qs.displacementmap,{opacity:{value:1}}]),vertexShader:$s.meshnormal_vert,fragmentShader:$s.meshnormal_frag},sprite:{uniforms:Is([Qs.sprite,Qs.fog]),vertexShader:$s.sprite_vert,fragmentShader:$s.sprite_frag},background:{uniforms:{uvTransform:{value:new Hn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:$s.background_vert,fragmentShader:$s.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:$s.backgroundCube_vert,fragmentShader:$s.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:$s.cube_vert,fragmentShader:$s.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:$s.equirect_vert,fragmentShader:$s.equirect_frag},distanceRGBA:{uniforms:Is([Qs.common,Qs.displacementmap,{referencePosition:{value:new gi},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:$s.distanceRGBA_vert,fragmentShader:$s.distanceRGBA_frag},shadow:{uniforms:Is([Qs.lights,Qs.fog,{color:{value:new Or(0)},opacity:{value:1}}]),vertexShader:$s.shadow_vert,fragmentShader:$s.shadow_frag}};ta.physical={uniforms:Is([ta.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Hn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Hn},clearcoatNormalScale:{value:new zn(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Hn},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Hn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Hn},sheen:{value:0},sheenColor:{value:new Or(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Hn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Hn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Hn},transmissionSamplerSize:{value:new zn},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Hn},attenuationDistance:{value:0},attenuationColor:{value:new Or(0)},specularColor:{value:new Or(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Hn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Hn},anisotropyVector:{value:new zn},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Hn}}]),vertexShader:$s.meshphysical_vert,fragmentShader:$s.meshphysical_frag};const ea={r:0,b:0,g:0};function na(t,e,n,i,r,s,a){const o=new Or(0);let l,c,h=!0===s?0:1,p=null,m=0,f=null;function g(e,n){e.getRGB(ea,Us(t)),i.buffers.color.setClear(ea.r,ea.g,ea.b,n,a)}return{getClearColor:function(){return o},setClearColor:function(t,e=1){o.set(t),h=e,g(o,h)},getClearAlpha:function(){return h},setClearAlpha:function(t){h=t,g(o,h)},render:function(s,v){let _=!1,y=!0===v.isScene?v.background:null;if(y&&y.isTexture){y=(v.backgroundBlurriness>0?n:e).get(y)}switch(null===y?g(o,h):y&&y.isColor&&(g(y,1),_=!0),t.xr.getEnvironmentBlendMode()){case"opaque":_=!0;break;case"additive":i.buffers.color.setClear(0,0,0,1,a),_=!0;break;case"alpha-blend":i.buffers.color.setClear(0,0,0,0,a),_=!0}(t.autoClear||_)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),y&&(y.isCubeTexture||y.mapping===st)?(void 0===c&&(c=new Rs(new Ps(1,1,1),new Ds({name:"BackgroundCubeMaterial",uniforms:Ls(ta.backgroundCube.uniforms),vertexShader:ta.backgroundCube.vertexShader,fragmentShader:ta.backgroundCube.fragmentShader,side:d,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(c)),c.material.uniforms.envMap.value=y,c.material.uniforms.flipEnvMap.value=y.isCubeTexture&&!1===y.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.toneMapped=y.colorSpace!==Be,p===y&&m===y.version&&f===t.toneMapping||(c.material.needsUpdate=!0,p=y,m=y.version,f=t.toneMapping),c.layers.enableAll(),s.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(void 0===l&&(l=new Rs(new Ks(2,2),new Ds({name:"BackgroundMaterial",uniforms:Ls(ta.background.uniforms),vertexShader:ta.background.vertexShader,fragmentShader:ta.background.fragmentShader,side:u,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l)),l.material.uniforms.t2D.value=y,l.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,l.material.toneMapped=y.colorSpace!==Be,!0===y.matrixAutoUpdate&&y.updateMatrix(),l.material.uniforms.uvTransform.value.copy(y.matrix),p===y&&m===y.version&&f===t.toneMapping||(l.material.needsUpdate=!0,p=y,m=y.version,f=t.toneMapping),l.layers.enableAll(),s.unshift(l,l.geometry,l.material,0,0,null))}}}function ia(t,e,n,i){const r=t.getParameter(t.MAX_VERTEX_ATTRIBS),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),a=i.isWebGL2||null!==s,o={},l=p(null);let c=l,h=!1;function u(e){return i.isWebGL2?t.bindVertexArray(e):s.bindVertexArrayOES(e)}function d(e){return i.isWebGL2?t.deleteVertexArray(e):s.deleteVertexArrayOES(e)}function p(t){const e=[],n=[],i=[];for(let t=0;t=0){const n=r[e];let i=s[e];if(void 0===i&&("instanceMatrix"===e&&t.instanceMatrix&&(i=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(i=t.instanceColor)),void 0===n)return!0;if(n.attribute!==i)return!0;if(i&&n.data!==i.data)return!0;a++}}return c.attributesNum!==a||c.index!==i}(r,y,d,x),M&&function(t,e,n,i){const r={},s=e.attributes;let a=0;const o=n.getAttributes();for(const e in o){if(o[e].location>=0){let n=s[e];void 0===n&&("instanceMatrix"===e&&t.instanceMatrix&&(n=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(n=t.instanceColor));const i={};i.attribute=n,n&&n.data&&(i.data=n.data),r[e]=i,a++}}c.attributes=r,c.attributesNum=a,c.index=i}(r,y,d,x)}else{const t=!0===l.wireframe;c.geometry===y.id&&c.program===d.id&&c.wireframe===t||(c.geometry=y.id,c.program=d.id,c.wireframe=t,M=!0)}null!==x&&n.update(x,t.ELEMENT_ARRAY_BUFFER),(M||h)&&(h=!1,function(r,s,a,o){if(!1===i.isWebGL2&&(r.isInstancedMesh||o.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;m();const l=o.attributes,c=a.getAttributes(),h=s.defaultAttributeValues;for(const e in c){const s=c[e];if(s.location>=0){let a=l[e];if(void 0===a&&("instanceMatrix"===e&&r.instanceMatrix&&(a=r.instanceMatrix),"instanceColor"===e&&r.instanceColor&&(a=r.instanceColor)),void 0!==a){const e=a.normalized,l=a.itemSize,c=n.get(a);if(void 0===c)continue;const h=c.buffer,u=c.type,d=c.bytesPerElement,p=!0===i.isWebGL2&&(u===t.INT||u===t.UNSIGNED_INT||a.gpuType===bt);if(a.isInterleavedBufferAttribute){const n=a.data,i=n.stride,c=a.offset;if(n.isInstancedInterleavedBuffer){for(let t=0;t0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===t.constructor.name;let a=void 0!==n.precision?n.precision:"highp";const o=r(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);const l=s||e.has("WEBGL_draw_buffers"),c=!0===n.logarithmicDepthBuffer,h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=t.getParameter(t.MAX_TEXTURE_SIZE),p=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),m=t.getParameter(t.MAX_VERTEX_ATTRIBS),f=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),g=t.getParameter(t.MAX_VARYING_VECTORS),v=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),_=u>0,y=s||e.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===e.has("EXT_texture_filter_anisotropic")){const n=e.get("EXT_texture_filter_anisotropic");i=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:r,precision:a,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:f,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:_,floatFragmentTextures:y,floatVertexTextures:_&&y,maxSamples:s?t.getParameter(t.MAX_SAMPLES):0}}function aa(t){const e=this;let n=null,i=0,r=!1,s=!1;const a=new Xs,o=new Hn,l={value:null,needsUpdate:!1};function c(t,n,i,r){const s=null!==t?t.length:0;let c=null;if(0!==s){if(c=l.value,!0!==r||null===c){const e=i+4*s,r=n.matrixWorldInverse;o.getNormalMatrix(r),(null===c||c.length0);e.numPlanes=i,e.numIntersection=0}();else{const t=s?0:i,e=4*t;let r=m.clippingState||null;l.value=r,r=c(u,o,e,h);for(let t=0;t!==e;++t)r[t]=n[t];m.clippingState=r,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=t}}}function oa(t){let e=new WeakMap;function n(t,e){return e===it?t.mapping=et:e===rt&&(t.mapping=nt),t}function i(t){const n=t.target;n.removeEventListener("dispose",i);const r=e.get(n);void 0!==r&&(e.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture&&!1===r.isRenderTargetTexture){const s=r.mapping;if(s===it||s===rt){if(e.has(r)){return n(e.get(r).texture,r.mapping)}{const s=r.image;if(s&&s.height>0){const a=new ks(s.height/2);return a.fromEquirectangularTexture(t,r),e.set(r,a),r.addEventListener("dispose",i),n(a.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}class la extends Os{constructor(t=-1,e=1,n=1,i=-1,r=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=r,this.far=s,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,r,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=n-t,s=n+t,a=i+e,o=i-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,s=r+t*this.view.width,a-=e*this.view.offsetY,o=a-e*this.view.height}this.projectionMatrix.makeOrthographic(r,s,a,o,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}const ca=4,ha=[.125,.215,.35,.446,.526,.582],ua=20,da=new la,pa=new Or;let ma=null;const fa=(1+Math.sqrt(5))/2,ga=1/fa,va=[new gi(1,1,1),new gi(-1,1,1),new gi(1,1,-1),new gi(-1,1,-1),new gi(0,fa,ga),new gi(0,fa,-ga),new gi(ga,0,fa),new gi(-ga,0,fa),new gi(fa,ga,0),new gi(-fa,ga,0)];class _a{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){ma=this._renderer.getRenderTarget(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,n,i,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=Sa(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Ma(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;tt-ca?o=ha[a-t+ca-1]:0===a&&(o=0),i.push(o);const l=1/(s-2),c=-l,h=1+l,u=[c,c,h,c,h,h,c,c,h,h,c,h],d=6,p=6,m=3,f=2,g=1,v=new Float32Array(m*p*d),_=new Float32Array(f*p*d),y=new Float32Array(g*p*d);for(let t=0;t2?0:-1,i=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];v.set(i,m*p*t),_.set(u,f*p*t);const r=[t,t,t,t,t,t];y.set(r,g*p*t)}const x=new hs;x.setAttribute("position",new jr(v,m)),x.setAttribute("uv",new jr(_,f)),x.setAttribute("faceIndex",new jr(y,g)),e.push(x),r>ca&&r--}return{lodPlanes:e,sizeLods:n,sigmas:i}}(i)),this._blurMaterial=function(t,e,n){const i=new Float32Array(ua),r=new gi(0,1,0),s=new Ds({name:"SphericalGaussianBlur",defines:{n:ua,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:ba(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:f,depthTest:!1,depthWrite:!1});return s}(i,t,e)}return i}_compileMaterial(t){const e=new Rs(this._lodPlanes[0],t);this._renderer.compile(e,da)}_sceneToCubeUV(t,e,n,i){const r=new Fs(90,1,e,n),s=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],o=this._renderer,l=o.autoClear,c=o.toneMapping;o.getClearColor(pa),o.toneMapping=Y,o.autoClear=!1;const h=new Br({name:"PMREM.Background",side:d,depthWrite:!1,depthTest:!1}),u=new Rs(new Ps,h);let p=!1;const m=t.background;m?m.isColor&&(h.color.copy(m),t.background=null,p=!0):(h.color.copy(pa),p=!0);for(let e=0;e<6;e++){const n=e%3;0===n?(r.up.set(0,s[e],0),r.lookAt(a[e],0,0)):1===n?(r.up.set(0,0,s[e]),r.lookAt(0,a[e],0)):(r.up.set(0,s[e],0),r.lookAt(0,0,a[e]));const l=this._cubeSize;xa(i,n*l,e>2?l:0,l,l),o.setRenderTarget(i),p&&o.render(u,r),o.render(t,r)}u.geometry.dispose(),u.material.dispose(),o.toneMapping=c,o.autoClear=l,t.background=m}_textureToCubeUV(t,e){const n=this._renderer,i=t.mapping===et||t.mapping===nt;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=Sa()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Ma());const r=i?this._cubemapMaterial:this._equirectMaterial,s=new Rs(this._lodPlanes[0],r);r.uniforms.envMap.value=t;const a=this._cubeSize;xa(e,0,0,3*a,2*a),n.setRenderTarget(e),n.render(s,da)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;for(let e=1;eua&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${ua}`);const f=[];let g=0;for(let t=0;tv-ca?i-v+ca:0),4*(this._cubeSize-_),3*_,2*_),o.setRenderTarget(e),o.render(c,da)}}function ya(t,e,n){const i=new ci(t,e,n);return i.texture.mapping=st,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function xa(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function Ma(){return new Ds({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:ba(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:f,depthTest:!1,depthWrite:!1})}function Sa(){return new Ds({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:ba(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:f,depthTest:!1,depthWrite:!1})}function ba(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function Ea(t){let e=new WeakMap,n=null;function i(t){const n=t.target;n.removeEventListener("dispose",i);const r=e.get(n);void 0!==r&&(e.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){const s=r.mapping,a=s===it||s===rt,o=s===et||s===nt;if(a||o){if(r.isRenderTargetTexture&&!0===r.needsPMREMUpdate){r.needsPMREMUpdate=!1;let i=e.get(r);return null===n&&(n=new _a(t)),i=a?n.fromEquirectangular(r,i):n.fromCubemap(r,i),e.set(r,i),i.texture}if(e.has(r))return e.get(r).texture;{const s=r.image;if(a&&s&&s.height>0||o&&s&&function(t){let e=0;const n=6;for(let i=0;ie.maxTextureSize&&(m=Math.ceil(p/e.maxTextureSize),p=e.maxTextureSize);const f=new Float32Array(p*m*4*r),g=new hi(f,p,m,r);g.type=Tt,g.needsUpdate=!0;const v=4*d;for(let e=0;e0)return t;const r=e*n;let s=Fa[r];if(void 0===s&&(s=new Float32Array(r),Fa[r]=s),0!==e){i.toArray(s,0);for(let i=1,r=0;i!==e;++i)r+=n,t[i].toArray(s,r)}return s}function Ga(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n":" "} ${r}: ${n[t]}`)}return i.join("\n")}(t.getShaderSource(e),i)}return r}function ko(t,e){const n=function(t){switch(t){case ze:return["Linear","( value )"];case Be:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),["Linear","( value )"]}}(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function Vo(t,e){let n;switch(e){case Z:n="Linear";break;case J:n="Reinhard";break;case K:n="OptimizedCineon";break;case $:n="ACESFilmic";break;case Q:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Go(t){return""!==t}function Wo(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Xo(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const jo=/^[ \t]*#include +<([\w\d./]+)>/gm;function qo(t){return t.replace(jo,Yo)}function Yo(t,e){const n=$s[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return qo(n)}const Zo=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Jo(t){return t.replace(Zo,Ko)}function Ko(t,e,n,i){let r="";for(let t=parseInt(e);t0&&(y+="\n"),x=[g,"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v].filter(Go).join("\n"),x.length>0&&(x+="\n")):(y=[$o(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+p:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+u:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Go).join("\n"),x=[g,$o(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+d:"",n.envMap?"#define "+p:"",n.envMap?"#define "+m:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+u:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Y?"#define TONE_MAPPING":"",n.toneMapping!==Y?$s.tonemapping_pars_fragment:"",n.toneMapping!==Y?Vo("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",$s.encodings_pars_fragment,ko("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Go).join("\n")),a=qo(a),a=Wo(a,n),a=Xo(a,n),o=qo(o),o=Wo(o,n),o=Xo(o,n),a=Jo(a),o=Jo(o),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(M="#version 300 es\n",y=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+y,x=["#define varying in",n.glslVersion===Sn?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===Sn?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+x);const S=M+y+a,b=M+x+o,E=Bo(r,r.VERTEX_SHADER,S),T=Bo(r,r.FRAGMENT_SHADER,b);if(r.attachShader(_,E),r.attachShader(_,T),void 0!==n.index0AttributeName?r.bindAttribLocation(_,0,n.index0AttributeName):!0===n.morphTargets&&r.bindAttribLocation(_,0,"position"),r.linkProgram(_),t.debug.checkShaderErrors){const e=r.getProgramInfoLog(_).trim(),n=r.getShaderInfoLog(E).trim(),i=r.getShaderInfoLog(T).trim();let s=!0,a=!0;if(!1===r.getProgramParameter(_,r.LINK_STATUS))if(s=!1,"function"==typeof t.debug.onShaderError)t.debug.onShaderError(r,_,E,T);else{const t=Ho(r,E,"vertex"),n=Ho(r,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(_,r.VALIDATE_STATUS)+"\n\nProgram Info Log: "+e+"\n"+t+"\n"+n)}else""!==e?console.warn("THREE.WebGLProgram: Program Info Log:",e):""!==n&&""!==i||(a=!1);a&&(this.diagnostics={runnable:s,programLog:e,vertexShader:{log:n,prefix:y},fragmentShader:{log:i,prefix:x}})}let w,A;return r.deleteShader(E),r.deleteShader(T),this.getUniforms=function(){return void 0===w&&(w=new Fo(r,_)),w},this.getAttributes=function(){return void 0===A&&(A=function(t,e){const n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let r=0;r0,Z=s.clearcoat>0,J=s.iridescence>0,K=s.sheen>0,$=s.transmission>0,Q=q&&!!s.anisotropyMap,tt=Z&&!!s.clearcoatMap,et=Z&&!!s.clearcoatNormalMap,nt=Z&&!!s.clearcoatRoughnessMap,it=J&&!!s.iridescenceMap,rt=J&&!!s.iridescenceThicknessMap,at=K&&!!s.sheenColorMap,ot=K&&!!s.sheenRoughnessMap,lt=!!s.specularMap,ct=!!s.specularColorMap,ht=!!s.specularIntensityMap,ut=$&&!!s.transmissionMap,dt=$&&!!s.thicknessMap,pt=!!s.gradientMap,mt=!!s.alphaMap,ft=s.alphaTest>0,gt=!!s.extensions,vt=!!S.attributes.uv1,_t=!!S.attributes.uv2,yt=!!S.attributes.uv3;return{isWebGL2:h,shaderID:w,shaderType:s.type,shaderName:s.name,vertexShader:C,fragmentShader:P,defines:s.defines,customVertexShaderID:L,customFragmentShaderID:I,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:f,instancing:D,instancingColor:D&&null!==x.instanceColor,supportsVertexTextures:m,outputColorSpace:null===N?t.outputColorSpace:!0===N.isXRRenderTarget?N.texture.colorSpace:ze,map:O,matcap:F,envMap:B,envMapMode:B&&E.mapping,envMapCubeUVHeight:T,aoMap:z,lightMap:H,bumpMap:k,normalMap:V,displacementMap:m&&G,emissiveMap:W,normalMapObjectSpace:V&&s.normalMapType===Oe,normalMapTangentSpace:V&&s.normalMapType===De,metalnessMap:X,roughnessMap:j,anisotropy:q,anisotropyMap:Q,clearcoat:Z,clearcoatMap:tt,clearcoatNormalMap:et,clearcoatRoughnessMap:nt,iridescence:J,iridescenceMap:it,iridescenceThicknessMap:rt,sheen:K,sheenColorMap:at,sheenRoughnessMap:ot,specularMap:lt,specularColorMap:ct,specularIntensityMap:ht,transmission:$,transmissionMap:ut,thicknessMap:dt,gradientMap:pt,opaque:!1===s.transparent&&s.blending===g,alphaMap:mt,alphaTest:ft,combine:s.combine,mapUv:O&&_(s.map.channel),aoMapUv:z&&_(s.aoMap.channel),lightMapUv:H&&_(s.lightMap.channel),bumpMapUv:k&&_(s.bumpMap.channel),normalMapUv:V&&_(s.normalMap.channel),displacementMapUv:G&&_(s.displacementMap.channel),emissiveMapUv:W&&_(s.emissiveMap.channel),metalnessMapUv:X&&_(s.metalnessMap.channel),roughnessMapUv:j&&_(s.roughnessMap.channel),anisotropyMapUv:Q&&_(s.anisotropyMap.channel),clearcoatMapUv:tt&&_(s.clearcoatMap.channel),clearcoatNormalMapUv:et&&_(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:nt&&_(s.clearcoatRoughnessMap.channel),iridescenceMapUv:it&&_(s.iridescenceMap.channel),iridescenceThicknessMapUv:rt&&_(s.iridescenceThicknessMap.channel),sheenColorMapUv:at&&_(s.sheenColorMap.channel),sheenRoughnessMapUv:ot&&_(s.sheenRoughnessMap.channel),specularMapUv:lt&&_(s.specularMap.channel),specularColorMapUv:ct&&_(s.specularColorMap.channel),specularIntensityMapUv:ht&&_(s.specularIntensityMap.channel),transmissionMapUv:ut&&_(s.transmissionMap.channel),thicknessMapUv:dt&&_(s.thicknessMap.channel),alphaMapUv:mt&&_(s.alphaMap.channel),vertexTangents:!!S.attributes.tangent&&(V||q),vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!S.attributes.color&&4===S.attributes.color.itemSize,vertexUv1s:vt,vertexUv2s:_t,vertexUv3s:yt,pointsUvs:!0===x.isPoints&&!!S.attributes.uv&&(O||mt),fog:!!M,useFog:!0===s.fog,fogExp2:M&&M.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:u,skinning:!0===x.isSkinnedMesh,morphTargets:void 0!==S.morphAttributes.position,morphNormals:void 0!==S.morphAttributes.normal,morphColors:void 0!==S.morphAttributes.color,morphTargetsCount:R,morphTextureStride:U,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&c.length>0,shadowMapType:t.shadowMap.type,toneMapping:s.toneMapped?t.toneMapping:Y,useLegacyLights:t.useLegacyLights,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===p,flipSided:s.side===d,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:gt&&!0===s.extensions.derivatives,extensionFragDepth:gt&&!0===s.extensions.fragDepth,extensionDrawBuffers:gt&&!0===s.extensions.drawBuffers,extensionShaderTextureLOD:gt&&!0===s.extensions.shaderTextureLOD,rendererExtensionFragDepth:h||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||i.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.customVertexShaderID),n.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(!function(t,e){t.push(e.precision),t.push(e.outputColorSpace),t.push(e.envMapMode),t.push(e.envMapCubeUVHeight),t.push(e.mapUv),t.push(e.alphaMapUv),t.push(e.lightMapUv),t.push(e.aoMapUv),t.push(e.bumpMapUv),t.push(e.normalMapUv),t.push(e.displacementMapUv),t.push(e.emissiveMapUv),t.push(e.metalnessMapUv),t.push(e.roughnessMapUv),t.push(e.anisotropyMapUv),t.push(e.clearcoatMapUv),t.push(e.clearcoatNormalMapUv),t.push(e.clearcoatRoughnessMapUv),t.push(e.iridescenceMapUv),t.push(e.iridescenceThicknessMapUv),t.push(e.sheenColorMapUv),t.push(e.sheenRoughnessMapUv),t.push(e.specularMapUv),t.push(e.specularColorMapUv),t.push(e.specularIntensityMapUv),t.push(e.transmissionMapUv),t.push(e.thicknessMapUv),t.push(e.combine),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numSpotLightMaps),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.numSpotLightShadowsWithMaps),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}(n,e),function(t,e){o.disableAll(),e.isWebGL2&&o.enable(0);e.supportsVertexTextures&&o.enable(1);e.instancing&&o.enable(2);e.instancingColor&&o.enable(3);e.matcap&&o.enable(4);e.envMap&&o.enable(5);e.normalMapObjectSpace&&o.enable(6);e.normalMapTangentSpace&&o.enable(7);e.clearcoat&&o.enable(8);e.iridescence&&o.enable(9);e.alphaTest&&o.enable(10);e.vertexColors&&o.enable(11);e.vertexAlphas&&o.enable(12);e.vertexUv1s&&o.enable(13);e.vertexUv2s&&o.enable(14);e.vertexUv3s&&o.enable(15);e.vertexTangents&&o.enable(16);e.anisotropy&&o.enable(17);t.push(o.mask),o.disableAll(),e.fog&&o.enable(0);e.useFog&&o.enable(1);e.flatShading&&o.enable(2);e.logarithmicDepthBuffer&&o.enable(3);e.skinning&&o.enable(4);e.morphTargets&&o.enable(5);e.morphNormals&&o.enable(6);e.morphColors&&o.enable(7);e.premultipliedAlpha&&o.enable(8);e.shadowMapEnabled&&o.enable(9);e.useLegacyLights&&o.enable(10);e.doubleSided&&o.enable(11);e.flipSided&&o.enable(12);e.useDepthPacking&&o.enable(13);e.dithering&&o.enable(14);e.transmission&&o.enable(15);e.sheen&&o.enable(16);e.opaque&&o.enable(17);e.pointsUvs&&o.enable(18);t.push(o.mask)}(n,e),n.push(t.outputColorSpace)),n.push(e.customProgramCacheKey),n.join()},getUniforms:function(t){const e=v[t.type];let n;if(e){const t=ta[e];n=Ns.clone(t.uniforms)}else n=t.uniforms;return n},acquireProgram:function(e,n){let i;for(let t=0,e=c.length;t0?i.push(h):!0===a.transparent?r.push(h):n.push(h)},unshift:function(t,e,a,o,l,c){const h=s(t,e,a,o,l,c);a.transmission>0?i.unshift(h):!0===a.transparent?r.unshift(h):n.unshift(h)},finish:function(){for(let n=e,i=t.length;n1&&n.sort(t||sl),i.length>1&&i.sort(e||al),r.length>1&&r.sort(e||al)}}}function ll(){let t=new WeakMap;return{get:function(e,n){const i=t.get(e);let r;return void 0===i?(r=new ol,t.set(e,[r])):n>=i.length?(r=new ol,i.push(r)):r=i[n],r},dispose:function(){t=new WeakMap}}}function cl(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new gi,color:new Or};break;case"SpotLight":n={position:new gi,direction:new gi,color:new Or,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new gi,color:new Or,distance:0,decay:0};break;case"HemisphereLight":n={direction:new gi,skyColor:new Or,groundColor:new Or};break;case"RectAreaLight":n={color:new Or,position:new gi,halfWidth:new gi,halfHeight:new gi}}return t[e.id]=n,n}}}let hl=0;function ul(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function dl(t,e){const n=new cl,i=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new zn};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new zn,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let t=0;t<9;t++)r.probe.push(new gi);const s=new gi,a=new ji,o=new ji;return{setup:function(s,a){let o=0,l=0,c=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let h=0,u=0,d=0,p=0,m=0,f=0,g=0,v=0,_=0,y=0;s.sort(ul);const x=!0===a?Math.PI:1;for(let t=0,e=s.length;t0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=Qs.LTC_FLOAT_1,r.rectAreaLTC2=Qs.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=Qs.LTC_HALF_1,r.rectAreaLTC2=Qs.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=o,r.ambient[1]=l,r.ambient[2]=c;const M=r.hash;M.directionalLength===h&&M.pointLength===u&&M.spotLength===d&&M.rectAreaLength===p&&M.hemiLength===m&&M.numDirectionalShadows===f&&M.numPointShadows===g&&M.numSpotShadows===v&&M.numSpotMaps===_||(r.directional.length=h,r.spot.length=d,r.rectArea.length=p,r.point.length=u,r.hemi.length=m,r.directionalShadow.length=f,r.directionalShadowMap.length=f,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=v,r.spotShadowMap.length=v,r.directionalShadowMatrix.length=f,r.pointShadowMatrix.length=g,r.spotLightMatrix.length=v+_-y,r.spotLightMap.length=_,r.numSpotLightShadowsWithMaps=y,M.directionalLength=h,M.pointLength=u,M.spotLength=d,M.rectAreaLength=p,M.hemiLength=m,M.numDirectionalShadows=f,M.numPointShadows=g,M.numSpotShadows=v,M.numSpotMaps=_,r.version=hl++)},setupView:function(t,e){let n=0,i=0,l=0,c=0,h=0;const u=e.matrixWorldInverse;for(let e=0,d=t.length;e=s.length?(a=new pl(t,e),s.push(a)):a=s[r],a},dispose:function(){n=new WeakMap}}}class fl extends Lr{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class gl extends Lr{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}function vl(t,e,n){let i=new Ys;const r=new zn,s=new zn,a=new li,o=new fl({depthPacking:Ne}),c=new gl,m={},g=n.maxTextureSize,v={[u]:d,[d]:u,[p]:p},_=new Ds({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new zn},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),y=_.clone();y.defines.HORIZONTAL_PASS=1;const x=new hs;x.setAttribute("position",new jr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const M=new Rs(x,_),S=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=l;let b=this.type;function E(n,i){const s=e.update(M);_.defines.VSM_SAMPLES!==n.blurSamples&&(_.defines.VSM_SAMPLES=n.blurSamples,y.defines.VSM_SAMPLES=n.blurSamples,_.needsUpdate=!0,y.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new ci(r.x,r.y)),_.uniforms.shadow_pass.value=n.map.texture,_.uniforms.resolution.value=n.mapSize,_.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(i,null,s,_,M,null),y.uniforms.shadow_pass.value=n.mapPass.texture,y.uniforms.resolution.value=n.mapSize,y.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(i,null,s,y,M,null)}function T(e,n,i,r){let s=null;const a=!0===i.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(void 0!==a)s=a;else if(s=!0===i.isPointLight?c:o,t.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const t=s.uuid,e=n.uuid;let i=m[t];void 0===i&&(i={},m[t]=i);let r=i[e];void 0===r&&(r=s.clone(),i[e]=r),s=r}if(s.visible=n.visible,s.wireframe=n.wireframe,s.side=r===h?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:v[n.side],s.alphaMap=n.alphaMap,s.alphaTest=n.alphaTest,s.map=n.map,s.clipShadows=n.clipShadows,s.clippingPlanes=n.clippingPlanes,s.clipIntersection=n.clipIntersection,s.displacementMap=n.displacementMap,s.displacementScale=n.displacementScale,s.displacementBias=n.displacementBias,s.wireframeLinewidth=n.wireframeLinewidth,s.linewidth=n.linewidth,!0===i.isPointLight&&!0===s.isMeshDistanceMaterial){t.properties.get(s).light=i}return s}function w(n,r,s,a,o){if(!1===n.visible)return;if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&o===h)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const i=e.update(n),r=n.material;if(Array.isArray(r)){const e=i.groups;for(let l=0,c=e.length;lg||r.y>g)&&(r.x>g&&(s.x=Math.floor(g/f.x),r.x=s.x*f.x,u.mapSize.x=s.x),r.y>g&&(s.y=Math.floor(g/f.y),r.y=s.y*f.y,u.mapSize.y=s.y)),null===u.map||!0===p||!0===m){const t=this.type!==h?{minFilter:ct,magFilter:ct}:{};null!==u.map&&u.map.dispose(),u.map=new ci(r.x,r.y,t),u.map.texture.name=c.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const v=u.getViewportCount();for(let t=0;t=1):-1!==dt.indexOf("OpenGL ES")&&(ut=parseFloat(/^OpenGL ES (\d)/.exec(dt)[1]),ht=ut>=2);let pt=null,mt={};const ft=t.getParameter(t.SCISSOR_BOX),gt=t.getParameter(t.VIEWPORT),vt=(new li).fromArray(ft),_t=(new li).fromArray(gt);function yt(e,n,i,r){const s=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let o=0;oi||t.height>i)&&(r=i/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const i=e?Dn:Math.floor,s=i(r*t.width),a=i(r*t.height);void 0===f&&(f=_(s,a));const o=n?_(s,a):f;o.width=s,o.height=a;return o.getContext("2d").drawImage(t,0,0,s,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+a+")."),o}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function x(t){return Un(t.width)&&Un(t.height)}function M(t,e){return t.generateMipmaps&&e&&t.minFilter!==ct&&t.minFilter!==mt}function S(e){t.generateMipmap(e)}function b(n,i,r,s,a=!1){if(!1===o)return i;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let l=i;return i===t.RED&&(r===t.FLOAT&&(l=t.R32F),r===t.HALF_FLOAT&&(l=t.R16F),r===t.UNSIGNED_BYTE&&(l=t.R8)),i===t.RG&&(r===t.FLOAT&&(l=t.RG32F),r===t.HALF_FLOAT&&(l=t.RG16F),r===t.UNSIGNED_BYTE&&(l=t.RG8)),i===t.RGBA&&(r===t.FLOAT&&(l=t.RGBA32F),r===t.HALF_FLOAT&&(l=t.RGBA16F),r===t.UNSIGNED_BYTE&&(l=s===Be&&!1===a?t.SRGB8_ALPHA8:t.RGBA8),r===t.UNSIGNED_SHORT_4_4_4_4&&(l=t.RGBA4),r===t.UNSIGNED_SHORT_5_5_5_1&&(l=t.RGB5_A1)),l!==t.R16F&&l!==t.R32F&&l!==t.RG16F&&l!==t.RG32F&&l!==t.RGBA16F&&l!==t.RGBA32F||e.get("EXT_color_buffer_float"),l}function E(t,e,n){return!0===M(t,n)||t.isFramebufferTexture&&t.minFilter!==ct&&t.minFilter!==mt?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function T(e){return e===ct||e===ht||e===dt?t.NEAREST:t.LINEAR}function w(t){const e=t.target;e.removeEventListener("dispose",w),function(t){const e=i.get(t);if(void 0===e.__webglInit)return;const n=t.source,r=g.get(n);if(r){const i=r[e.__cacheKey];i.usedTimes--,0===i.usedTimes&&R(t),0===Object.keys(r).length&&g.delete(n)}i.remove(t)}(e),e.isVideoTexture&&m.delete(e)}function A(e){const n=e.target;n.removeEventListener("dispose",A),function(e){const n=e.texture,r=i.get(e),s=i.get(n);void 0!==s.__webglTexture&&(t.deleteTexture(s.__webglTexture),a.memory.textures--);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(r.__webglFramebuffer[e]),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer[e]);else{if(t.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&t.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer)for(let e=0;e0&&s.__version!==e.version){const t=e.image;if(null===t)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==t.complete)return void O(s,e,r);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(t.TEXTURE_2D,s.__webglTexture,t.TEXTURE0+r)}const L={[at]:t.REPEAT,[ot]:t.CLAMP_TO_EDGE,[lt]:t.MIRRORED_REPEAT},I={[ct]:t.NEAREST,[ht]:t.NEAREST_MIPMAP_NEAREST,[dt]:t.NEAREST_MIPMAP_LINEAR,[mt]:t.LINEAR,[ft]:t.LINEAR_MIPMAP_NEAREST,[vt]:t.LINEAR_MIPMAP_LINEAR},U={[rn]:t.NEVER,[un]:t.ALWAYS,[sn]:t.LESS,[on]:t.LEQUAL,[an]:t.EQUAL,[hn]:t.GEQUAL,[ln]:t.GREATER,[cn]:t.NOTEQUAL};function N(n,s,a){if(a?(t.texParameteri(n,t.TEXTURE_WRAP_S,L[s.wrapS]),t.texParameteri(n,t.TEXTURE_WRAP_T,L[s.wrapT]),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,L[s.wrapR]),t.texParameteri(n,t.TEXTURE_MAG_FILTER,I[s.magFilter]),t.texParameteri(n,t.TEXTURE_MIN_FILTER,I[s.minFilter])):(t.texParameteri(n,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(n,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),s.wrapS===ot&&s.wrapT===ot||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,t.TEXTURE_MAG_FILTER,T(s.magFilter)),t.texParameteri(n,t.TEXTURE_MIN_FILTER,T(s.minFilter)),s.minFilter!==ct&&s.minFilter!==mt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),s.compareFunction&&(t.texParameteri(n,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(n,t.TEXTURE_COMPARE_FUNC,U[s.compareFunction])),!0===e.has("EXT_texture_filter_anisotropic")){const a=e.get("EXT_texture_filter_anisotropic");if(s.magFilter===ct)return;if(s.minFilter!==dt&&s.minFilter!==vt)return;if(s.type===Tt&&!1===e.has("OES_texture_float_linear"))return;if(!1===o&&s.type===wt&&!1===e.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||i.get(s).__currentAnisotropy)&&(t.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),i.get(s).__currentAnisotropy=s.anisotropy)}}function D(e,n){let i=!1;void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",w));const r=n.source;let s=g.get(r);void 0===s&&(s={},g.set(r,s));const o=function(t){const e=[];return e.push(t.wrapS),e.push(t.wrapT),e.push(t.wrapR||0),e.push(t.magFilter),e.push(t.minFilter),e.push(t.anisotropy),e.push(t.internalFormat),e.push(t.format),e.push(t.type),e.push(t.generateMipmaps),e.push(t.premultiplyAlpha),e.push(t.flipY),e.push(t.unpackAlignment),e.push(t.colorSpace),e.join()}(n);if(o!==e.__cacheKey){void 0===s[o]&&(s[o]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,i=!0),s[o].usedTimes++;const r=s[e.__cacheKey];void 0!==r&&(s[e.__cacheKey].usedTimes--,0===r.usedTimes&&R(n)),e.__cacheKey=o,e.__webglTexture=s[o].texture}return i}function O(e,r,a){let l=t.TEXTURE_2D;(r.isDataArrayTexture||r.isCompressedArrayTexture)&&(l=t.TEXTURE_2D_ARRAY),r.isData3DTexture&&(l=t.TEXTURE_3D);const c=D(e,r),u=r.source;n.bindTexture(l,e.__webglTexture,t.TEXTURE0+a);const d=i.get(u);if(u.version!==d.__version||!0===c){n.activeTexture(t.TEXTURE0+a),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,r.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,r.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE);const e=function(t){return!o&&(t.wrapS!==ot||t.wrapT!==ot||t.minFilter!==ct&&t.minFilter!==mt)}(r)&&!1===x(r.image);let i=y(r.image,e,!1,h);i=V(r,i);const p=x(i)||o,m=s.convert(r.format,r.colorSpace);let f,g=s.convert(r.type),v=b(r.internalFormat,m,g,r.colorSpace);N(l,r,p);const _=r.mipmaps,T=o&&!0!==r.isVideoTexture,w=void 0===d.__version||!0===c,A=E(r,i,p);if(r.isDepthTexture)v=t.DEPTH_COMPONENT,o?v=r.type===Tt?t.DEPTH_COMPONENT32F:r.type===Et?t.DEPTH_COMPONENT24:r.type===Ct?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT16:r.type===Tt&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===Nt&&v===t.DEPTH_COMPONENT&&r.type!==St&&r.type!==Et&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=Et,g=s.convert(r.type)),r.format===Dt&&v===t.DEPTH_COMPONENT&&(v=t.DEPTH_STENCIL,r.type!==Ct&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=Ct,g=s.convert(r.type))),w&&(T?n.texStorage2D(t.TEXTURE_2D,1,v,i.width,i.height):n.texImage2D(t.TEXTURE_2D,0,v,i.width,i.height,0,m,g,null));else if(r.isDataTexture)if(_.length>0&&p){T&&w&&n.texStorage2D(t.TEXTURE_2D,A,v,_[0].width,_[0].height);for(let e=0,i=_.length;e>=1,r>>=1}}else if(_.length>0&&p){T&&w&&n.texStorage2D(t.TEXTURE_2D,A,v,_[0].width,_[0].height);for(let e=0,i=_.length;e=t.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,o,l,i.get(a).__webglTexture,0),n.bindFramebuffer(t.FRAMEBUFFER,null)}function B(e,n,i){if(t.bindRenderbuffer(t.RENDERBUFFER,e),n.depthBuffer&&!n.stencilBuffer){let r=t.DEPTH_COMPONENT16;if(i||k(n)){const e=n.depthTexture;e&&e.isDepthTexture&&(e.type===Tt?r=t.DEPTH_COMPONENT32F:e.type===Et&&(r=t.DEPTH_COMPONENT24));const i=H(n);k(n)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,i,r,n.width,n.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,i,r,n.width,n.height)}else t.renderbufferStorage(t.RENDERBUFFER,r,n.width,n.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)}else if(n.depthBuffer&&n.stencilBuffer){const r=H(n);i&&!1===k(n)?t.renderbufferStorageMultisample(t.RENDERBUFFER,r,t.DEPTH24_STENCIL8,n.width,n.height):k(n)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,r,t.DEPTH24_STENCIL8,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)}else{const e=!0===n.isWebGLMultipleRenderTargets?n.texture:[n.texture];for(let r=0;r0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function V(t,n){const i=t.colorSpace,r=t.format,s=t.type;return!0===t.isCompressedTexture||t.format===bn||i!==ze&&i!==Fe&&(i===Be?!1===o?!0===e.has("EXT_sRGB")&&r===Lt?(t.format=bn,t.minFilter=mt,t.generateMipmaps=!1):n=ni.sRGBToLinear(n):r===Lt&&s===yt||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",i)),n}this.allocateTextureUnit=function(){const t=C;return t>=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),C+=1,t},this.resetTextureUnits=function(){C=0},this.setTexture2D=P,this.setTexture2DArray=function(e,r){const s=i.get(e);e.version>0&&s.__version!==e.version?O(s,e,r):n.bindTexture(t.TEXTURE_2D_ARRAY,s.__webglTexture,t.TEXTURE0+r)},this.setTexture3D=function(e,r){const s=i.get(e);e.version>0&&s.__version!==e.version?O(s,e,r):n.bindTexture(t.TEXTURE_3D,s.__webglTexture,t.TEXTURE0+r)},this.setTextureCube=function(e,r){const a=i.get(e);e.version>0&&a.__version!==e.version?function(e,r,a){if(6!==r.image.length)return;const l=D(e,r),h=r.source;n.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+a);const u=i.get(h);if(h.version!==u.__version||!0===l){n.activeTexture(t.TEXTURE0+a),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,r.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,r.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE);const e=r.isCompressedTexture||r.image[0].isCompressedTexture,i=r.image[0]&&r.image[0].isDataTexture,d=[];for(let t=0;t<6;t++)d[t]=e||i?i?r.image[t].image:r.image[t]:y(r.image[t],!1,!0,c),d[t]=V(r,d[t]);const p=d[0],m=x(p)||o,f=s.convert(r.format,r.colorSpace),g=s.convert(r.type),v=b(r.internalFormat,f,g,r.colorSpace),_=o&&!0!==r.isVideoTexture,T=void 0===u.__version||!0===l;let w,A=E(r,p,m);if(N(t.TEXTURE_CUBE_MAP,r,m),e){_&&T&&n.texStorage2D(t.TEXTURE_CUBE_MAP,A,v,p.width,p.height);for(let e=0;e<6;e++){w=d[e].mipmaps;for(let i=0;i0&&A++,n.texStorage2D(t.TEXTURE_CUBE_MAP,A,v,d[0].width,d[0].height));for(let e=0;e<6;e++)if(i){_?n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,d[e].width,d[e].height,f,g,d[e].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,v,d[e].width,d[e].height,0,f,g,d[e].data);for(let i=0;i0&&!1===k(e)){const i=d?l:[l];c.__webglMultisampledFramebuffer=t.createFramebuffer(),c.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,c.__webglMultisampledFramebuffer);for(let n=0;n0&&!1===k(e)){const r=e.isWebGLMultipleRenderTargets?e.texture:[e.texture],s=e.width,a=e.height;let o=t.COLOR_BUFFER_BIT;const l=[],c=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,h=i.get(e),u=!0===e.isWebGLMultipleRenderTargets;if(u)for(let e=0;eo+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&a<=o-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==o&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1));null!==a&&(i=e.getPose(t.targetRaySpace,n),null===i&&null!==r&&(i=r),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(bl)))}return null!==a&&(a.visible=null!==i),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==s),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){const n=new Sl;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}class Tl extends oi{constructor(t,e,n,i,r,s,a,o,l,c){if((c=void 0!==c?c:Nt)!==Nt&&c!==Dt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===Nt&&(n=Et),void 0===n&&c===Dt&&(n=Ct),super(null,i,r,s,a,o,c,n,l),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=void 0!==a?a:ct,this.minFilter=void 0!==o?o:ct,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return null!==this.compareFunction&&(e.compareFunction=this.compareFunction),e}}class wl extends En{constructor(t,e){super();const n=this;let i=null,r=1,s=null,a="local-floor",o=1,l=null,c=null,h=null,u=null,d=null,p=null;const m=e.getContextAttributes();let f=null,g=null;const v=[],_=[];let y=null;const x=new Fs;x.layers.enable(1),x.viewport=new li;const M=new Fs;M.layers.enable(2),M.viewport=new li;const S=[x,M],b=new Ml;b.layers.enable(1),b.layers.enable(2);let E=null,T=null;function w(t){const e=_.indexOf(t.inputSource);if(-1===e)return;const n=v[e];void 0!==n&&(n.update(t.inputSource,t.frame,l||s),n.dispatchEvent({type:t.type,data:t.inputSource}))}function A(){i.removeEventListener("select",w),i.removeEventListener("selectstart",w),i.removeEventListener("selectend",w),i.removeEventListener("squeeze",w),i.removeEventListener("squeezestart",w),i.removeEventListener("squeezeend",w),i.removeEventListener("end",A),i.removeEventListener("inputsourceschange",R);for(let t=0;t=0&&(_[i]=null,v[i].disconnect(n))}for(let e=0;e=_.length){_.push(n),i=t;break}if(null===_[t]){_[t]=n,i=t;break}}if(-1===i)break}const r=v[i];r&&r.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getCamera=function(){},this.setUserCamera=function(t){y=t},this.getController=function(t){let e=v[t];return void 0===e&&(e=new El,v[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=v[t];return void 0===e&&(e=new El,v[t]=e),e.getGripSpace()},this.getHand=function(t){let e=v[t];return void 0===e&&(e=new El,v[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){r=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){a=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||s},this.setReferenceSpace=function(t){l=t},this.getBaseLayer=function(){return null!==u?u:d},this.getBinding=function(){return h},this.getFrame=function(){return p},this.getSession=function(){return i},this.setSession=async function(c){if(i=c,null!==i){if(f=t.getRenderTarget(),i.addEventListener("select",w),i.addEventListener("selectstart",w),i.addEventListener("selectend",w),i.addEventListener("squeeze",w),i.addEventListener("squeezestart",w),i.addEventListener("squeezeend",w),i.addEventListener("end",A),i.addEventListener("inputsourceschange",R),!0!==m.xrCompatible&&await e.makeXRCompatible(),void 0===i.renderState.layers||!1===t.capabilities.isWebGL2){const n={antialias:void 0!==i.renderState.layers||m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:r};d=new XRWebGLLayer(i,e,n),i.updateRenderState({baseLayer:d}),g=new ci(d.framebufferWidth,d.framebufferHeight,{format:Lt,type:yt,colorSpace:t.outputColorSpace,stencilBuffer:m.stencil})}else{let n=null,s=null,a=null;m.depth&&(a=m.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,n=m.stencil?Dt:Nt,s=m.stencil?Ct:Et);const o={colorFormat:e.RGBA8,depthFormat:a,scaleFactor:r};h=new XRWebGLBinding(i,e),u=h.createProjectionLayer(o),i.updateRenderState({layers:[u]}),g=new ci(u.textureWidth,u.textureHeight,{format:Lt,type:yt,depthTexture:new Tl(u.textureWidth,u.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:m.stencil,colorSpace:t.outputColorSpace,samples:m.antialias?4:0});t.properties.get(g).__ignoreDepthValues=u.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(o),l=null,s=await i.requestReferenceSpace(a),U.setContext(i),U.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode};const C=new gi,P=new gi;function L(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCameraXR=function(t){if(null===i)return t;y&&(t=y),b.near=M.near=x.near=t.near,b.far=M.far=x.far=t.far,E===b.near&&T===b.far||(i.updateRenderState({depthNear:b.near,depthFar:b.far}),E=b.near,T=b.far);const e=t.parent,n=b.cameras;L(b,e);for(let t=0;t0&&(i.alphaTest.value=r.alphaTest);const s=e.get(r).envMap;if(s&&(i.envMap.value=s,i.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,i.reflectivity.value=r.reflectivity,i.ior.value=r.ior,i.refractionRatio.value=r.refractionRatio),r.lightMap){i.lightMap.value=r.lightMap;const e=!0===t.useLegacyLights?Math.PI:1;i.lightMapIntensity.value=r.lightMapIntensity*e,n(r.lightMap,i.lightMapTransform)}r.aoMap&&(i.aoMap.value=r.aoMap,i.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,i.aoMapTransform))}return{refreshFogUniforms:function(e,n){n.color.getRGB(e.fogColor.value,Us(t)),n.isFog?(e.fogNear.value=n.near,e.fogFar.value=n.far):n.isFogExp2&&(e.fogDensity.value=n.density)},refreshMaterialUniforms:function(t,r,s,a,o){r.isMeshBasicMaterial||r.isMeshLambertMaterial?i(t,r):r.isMeshToonMaterial?(i(t,r),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,r)):r.isMeshPhongMaterial?(i(t,r),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,r)):r.isMeshStandardMaterial?(i(t,r),function(t,i){t.metalness.value=i.metalness,i.metalnessMap&&(t.metalnessMap.value=i.metalnessMap,n(i.metalnessMap,t.metalnessMapTransform));t.roughness.value=i.roughness,i.roughnessMap&&(t.roughnessMap.value=i.roughnessMap,n(i.roughnessMap,t.roughnessMapTransform));const r=e.get(i).envMap;r&&(t.envMapIntensity.value=i.envMapIntensity)}(t,r),r.isMeshPhysicalMaterial&&function(t,e,i){t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap,n(e.sheenColorMap,t.sheenColorMapTransform)),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap,n(e.sheenRoughnessMap,t.sheenRoughnessMapTransform)));e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap,n(e.clearcoatMap,t.clearcoatMapTransform)),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap,n(e.clearcoatRoughnessMap,t.clearcoatRoughnessMapTransform)),e.clearcoatNormalMap&&(t.clearcoatNormalMap.value=e.clearcoatNormalMap,n(e.clearcoatNormalMap,t.clearcoatNormalMapTransform),t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),e.side===d&&t.clearcoatNormalScale.value.negate()));e.iridescence>0&&(t.iridescence.value=e.iridescence,t.iridescenceIOR.value=e.iridescenceIOR,t.iridescenceThicknessMinimum.value=e.iridescenceThicknessRange[0],t.iridescenceThicknessMaximum.value=e.iridescenceThicknessRange[1],e.iridescenceMap&&(t.iridescenceMap.value=e.iridescenceMap,n(e.iridescenceMap,t.iridescenceMapTransform)),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap,n(e.iridescenceThicknessMap,t.iridescenceThicknessMapTransform)));e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=i.texture,t.transmissionSamplerSize.value.set(i.width,i.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap,n(e.transmissionMap,t.transmissionMapTransform)),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap,n(e.thicknessMap,t.thicknessMapTransform)),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor));e.anisotropy>0&&(t.anisotropyVector.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation)),e.anisotropyMap&&(t.anisotropyMap.value=e.anisotropyMap,n(e.anisotropyMap,t.anisotropyMapTransform)));t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap,n(e.specularColorMap,t.specularColorMapTransform));e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap,n(e.specularIntensityMap,t.specularIntensityMapTransform))}(t,r,o)):r.isMeshMatcapMaterial?(i(t,r),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,r)):r.isMeshDepthMaterial?i(t,r):r.isMeshDistanceMaterial?(i(t,r),function(t,n){const i=e.get(n).light;t.referencePosition.value.setFromMatrixPosition(i.matrixWorld),t.nearDistance.value=i.shadow.camera.near,t.farDistance.value=i.shadow.camera.far}(t,r)):r.isMeshNormalMaterial?i(t,r):r.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform))}(t,r),r.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,r)):r.isPointsMaterial?function(t,e,i,r){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*r,e.map&&(t.map.value=e.map,n(e.map,t.uvTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,r,s,a):r.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,r):r.isShadowMaterial?(t.color.value.copy(r.color),t.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function Rl(t,e,n,i){let r={},s={},a=[];const o=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(t,e,n){const i=t.value;if(void 0===n[e]){if("number"==typeof i)n[e]=i;else{const t=Array.isArray(i)?i:[i],r=[];for(let e=0;e0){r=n%i;0!==r&&i-r-a.boundary<0&&(n+=i-r,s.__offset=n)}n+=a.storage}r=n%i,r>0&&(n+=i-r);t.__size=n,t.__cache={}}(n),d=function(e){const n=function(){for(let t=0;t0),u=!!n.morphAttributes.position,d=!!n.morphAttributes.normal,p=!!n.morphAttributes.color,m=i.toneMapped?S.toneMapping:Y,f=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,g=void 0!==f?f.length:0,v=nt.get(i),_=y.state.lights;if(!0===G&&(!0===W||t!==R)){const e=t===R&&i.id===A;pt.setState(i,t,e)}let x=!1;i.version===v.__version?v.needsLights&&v.lightsStateVersion!==_.state.version||v.outputColorSpace!==o||r.isInstancedMesh&&!1===v.instancing?x=!0:r.isInstancedMesh||!0!==v.instancing?r.isSkinnedMesh&&!1===v.skinning?x=!0:r.isSkinnedMesh||!0!==v.skinning?v.envMap!==l||!0===i.fog&&v.fog!==s?x=!0:void 0===v.numClippingPlanes||v.numClippingPlanes===pt.numPlanes&&v.numIntersection===pt.numIntersection?(v.vertexAlphas!==c||v.vertexTangents!==h||v.morphTargets!==u||v.morphNormals!==d||v.morphColors!==p||v.toneMapping!==m||!0===Q.isWebGL2&&v.morphTargetsCount!==g)&&(x=!0):x=!0:x=!0:x=!0:(x=!0,v.__version=i.version);let M=v.currentProgram;!0===x&&(M=Kt(i,e,r));let b=!1,E=!1,T=!1;const C=M.getUniforms(),P=v.uniforms;tt.useProgram(M.program)&&(b=!0,E=!0,T=!0);i.id!==A&&(A=i.id,E=!0);if(b||R!==t){if(C.setValue(It,"projectionMatrix",t.projectionMatrix),Q.logarithmicDepthBuffer&&C.setValue(It,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),R!==t&&(R=t,E=!0,T=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshStandardMaterial||i.envMap){const e=C.map.cameraPosition;void 0!==e&&e.setValue(It,Z.setFromMatrixPosition(t.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&C.setValue(It,"isOrthographic",!0===t.isOrthographicCamera),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.isShadowMaterial||r.isSkinnedMesh)&&C.setValue(It,"viewMatrix",t.matrixWorldInverse)}if(r.isSkinnedMesh){C.setOptional(It,r,"bindMatrix"),C.setOptional(It,r,"bindMatrixInverse");const t=r.skeleton;t&&(Q.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),C.setValue(It,"boneTexture",t.boneTexture,it),C.setValue(It,"boneTextureSize",t.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const L=n.morphAttributes;(void 0!==L.position||void 0!==L.normal||void 0!==L.color&&!0===Q.isWebGL2)&>.update(r,n,M);(E||v.receiveShadow!==r.receiveShadow)&&(v.receiveShadow=r.receiveShadow,C.setValue(It,"receiveShadow",r.receiveShadow));i.isMeshGouraudMaterial&&null!==i.envMap&&(P.envMap.value=l,P.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);E&&(C.setValue(It,"toneMappingExposure",S.toneMappingExposure),v.needsLights&&(U=T,(I=P).ambientLightColor.needsUpdate=U,I.lightProbe.needsUpdate=U,I.directionalLights.needsUpdate=U,I.directionalLightShadows.needsUpdate=U,I.pointLights.needsUpdate=U,I.pointLightShadows.needsUpdate=U,I.spotLights.needsUpdate=U,I.spotLightShadows.needsUpdate=U,I.rectAreaLights.needsUpdate=U,I.hemisphereLights.needsUpdate=U),s&&!0===i.fog&&ht.refreshFogUniforms(P,s),ht.refreshMaterialUniforms(P,i,O,D,X),Fo.upload(It,v.uniformsList,P,it));var I,U;i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(Fo.upload(It,v.uniformsList,P,it),i.uniformsNeedUpdate=!1);i.isSpriteMaterial&&C.setValue(It,"center",r.center);if(C.setValue(It,"modelViewMatrix",r.modelViewMatrix),C.setValue(It,"normalMatrix",r.normalMatrix),C.setValue(It,"modelMatrix",r.matrixWorld),i.isShaderMaterial||i.isRawShaderMaterial){const t=i.uniformsGroups;for(let e=0,n=t.length;e0&&function(t,e,n,i){const r=Q.isWebGL2;null===X&&(X=new ci(1,1,{generateMipmaps:!0,type:$.has("EXT_color_buffer_half_float")?wt:yt,minFilter:vt,samples:r&&!0===o?4:0}));S.getDrawingBufferSize(q),r?X.setSize(q.x,q.y):X.setSize(Dn(q.x),Dn(q.y));const s=S.getRenderTarget();S.setRenderTarget(X),S.getClearColor(I),U=S.getClearAlpha(),U<1&&S.setClearColor(16777215,.5);S.clear();const a=S.toneMapping;S.toneMapping=Y,Zt(t,n,i),it.updateMultisampleRenderTarget(X),it.updateRenderTargetMipmap(X);let l=!1;for(let t=0,r=e.length;t0&&Zt(r,e,n),s.length>0&&Zt(s,e,n),a.length>0&&Zt(a,e,n),tt.buffers.depth.setTest(!0),tt.buffers.depth.setMask(!0),tt.buffers.color.setMask(!0),tt.setPolygonOffset(!1)}function Zt(t,e,n){const i=!0===e.isScene?e.overrideMaterial:null;for(let r=0,s=t.length;r0?M[M.length-1]:null,x.pop(),_=x.length>0?x[x.length-1]:null},this.getActiveCubeFace=function(){return E},this.getActiveMipmapLevel=function(){return T},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(t,e,n){nt.get(t.texture).__webglTexture=e,nt.get(t.depthTexture).__webglTexture=n;const i=nt.get(t);i.__hasExternalTextures=!0,i.__hasExternalTextures&&(i.__autoAllocateDepthBuffer=void 0===n,i.__autoAllocateDepthBuffer||!0===$.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(t,e){const n=nt.get(t);n.__webglFramebuffer=e,n.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,n=0){w=t,E=e,T=n;let i=!0,r=null,s=!1,a=!1;if(t){const n=nt.get(t);void 0!==n.__useDefaultFramebuffer?(tt.bindFramebuffer(It.FRAMEBUFFER,null),i=!1):void 0===n.__webglFramebuffer?it.setupRenderTarget(t):n.__hasExternalTextures&&it.rebindTextures(t,nt.get(t.texture).__webglTexture,nt.get(t.depthTexture).__webglTexture);const o=t.texture;(o.isData3DTexture||o.isDataArrayTexture||o.isCompressedArrayTexture)&&(a=!0);const l=nt.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=l[e],s=!0):r=Q.isWebGL2&&t.samples>0&&!1===it.useMultisampledRTT(t)?nt.get(t).__webglMultisampledFramebuffer:l,C.copy(t.viewport),P.copy(t.scissor),L=t.scissorTest}else C.copy(z).multiplyScalar(O).floor(),P.copy(H).multiplyScalar(O).floor(),L=k;if(tt.bindFramebuffer(It.FRAMEBUFFER,r)&&Q.drawBuffers&&i&&tt.drawBuffers(t,r),tt.viewport(C),tt.scissor(P),tt.setScissorTest(L),s){const i=nt.get(t.texture);It.framebufferTexture2D(It.FRAMEBUFFER,It.COLOR_ATTACHMENT0,It.TEXTURE_CUBE_MAP_POSITIVE_X+e,i.__webglTexture,n)}else if(a){const i=nt.get(t.texture),r=e||0;It.framebufferTextureLayer(It.FRAMEBUFFER,It.COLOR_ATTACHMENT0,i.__webglTexture,n||0,r)}A=-1},this.readRenderTargetPixels=function(t,e,n,i,r,s,a){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=nt.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){tt.bindFramebuffer(It.FRAMEBUFFER,o);try{const a=t.texture,o=a.format,l=a.type;if(o!==Lt&&Mt.convert(o)!==It.getParameter(It.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===wt&&($.has("EXT_color_buffer_half_float")||Q.isWebGL2&&$.has("EXT_color_buffer_float"));if(!(l===yt||Mt.convert(l)===It.getParameter(It.IMPLEMENTATION_COLOR_READ_TYPE)||l===Tt&&(Q.isWebGL2||$.has("OES_texture_float")||$.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&It.readPixels(e,n,i,r,Mt.convert(o),Mt.convert(l),s)}finally{const t=null!==w?nt.get(w).__webglFramebuffer:null;tt.bindFramebuffer(It.FRAMEBUFFER,t)}}},this.copyFramebufferToTexture=function(t,e,n=0){const i=Math.pow(2,-n),r=Math.floor(e.image.width*i),s=Math.floor(e.image.height*i);it.setTexture2D(e,0),It.copyTexSubImage2D(It.TEXTURE_2D,n,0,0,t.x,t.y,r,s),tt.unbindTexture()},this.copyTextureToTexture=function(t,e,n,i=0){const r=e.image.width,s=e.image.height,a=Mt.convert(n.format),o=Mt.convert(n.type);it.setTexture2D(n,0),It.pixelStorei(It.UNPACK_FLIP_Y_WEBGL,n.flipY),It.pixelStorei(It.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),It.pixelStorei(It.UNPACK_ALIGNMENT,n.unpackAlignment),e.isDataTexture?It.texSubImage2D(It.TEXTURE_2D,i,t.x,t.y,r,s,a,o,e.image.data):e.isCompressedTexture?It.compressedTexSubImage2D(It.TEXTURE_2D,i,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data):It.texSubImage2D(It.TEXTURE_2D,i,t.x,t.y,a,o,e.image),0===i&&n.generateMipmaps&&It.generateMipmap(It.TEXTURE_2D),tt.unbindTexture()},this.copyTextureToTexture3D=function(t,e,n,i,r=0){if(S.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=t.max.x-t.min.x+1,a=t.max.y-t.min.y+1,o=t.max.z-t.min.z+1,l=Mt.convert(i.format),c=Mt.convert(i.type);let h;if(i.isData3DTexture)it.setTexture3D(i,0),h=It.TEXTURE_3D;else{if(!i.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");it.setTexture2DArray(i,0),h=It.TEXTURE_2D_ARRAY}It.pixelStorei(It.UNPACK_FLIP_Y_WEBGL,i.flipY),It.pixelStorei(It.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),It.pixelStorei(It.UNPACK_ALIGNMENT,i.unpackAlignment);const u=It.getParameter(It.UNPACK_ROW_LENGTH),d=It.getParameter(It.UNPACK_IMAGE_HEIGHT),p=It.getParameter(It.UNPACK_SKIP_PIXELS),m=It.getParameter(It.UNPACK_SKIP_ROWS),f=It.getParameter(It.UNPACK_SKIP_IMAGES),g=n.isCompressedTexture?n.mipmaps[0]:n.image;It.pixelStorei(It.UNPACK_ROW_LENGTH,g.width),It.pixelStorei(It.UNPACK_IMAGE_HEIGHT,g.height),It.pixelStorei(It.UNPACK_SKIP_PIXELS,t.min.x),It.pixelStorei(It.UNPACK_SKIP_ROWS,t.min.y),It.pixelStorei(It.UNPACK_SKIP_IMAGES,t.min.z),n.isDataTexture||n.isData3DTexture?It.texSubImage3D(h,r,e.x,e.y,e.z,s,a,o,l,c,g.data):n.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),It.compressedTexSubImage3D(h,r,e.x,e.y,e.z,s,a,o,l,g.data)):It.texSubImage3D(h,r,e.x,e.y,e.z,s,a,o,l,c,g),It.pixelStorei(It.UNPACK_ROW_LENGTH,u),It.pixelStorei(It.UNPACK_IMAGE_HEIGHT,d),It.pixelStorei(It.UNPACK_SKIP_PIXELS,p),It.pixelStorei(It.UNPACK_SKIP_ROWS,m),It.pixelStorei(It.UNPACK_SKIP_IMAGES,f),0===r&&i.generateMipmaps&&It.generateMipmap(h),tt.unbindTexture()},this.initTexture=function(t){t.isCubeTexture?it.setTextureCube(t,0):t.isData3DTexture?it.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?it.setTexture2DArray(t,0):it.setTexture2D(t,0),tt.unbindTexture()},this.resetState=function(){E=0,T=0,w=null,tt.reset(),bt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(t){console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!t}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Be?Ie:Le}set outputEncoding(t){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=t===Ie?Be:ze}}class Ll extends Pl{}Ll.prototype.isWebGL1Renderer=!0;class Il{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new Or(t),this.density=e}clone(){return new Il(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Ul{constructor(t,e=1,n=1e3){this.isFog=!0,this.name="",this.color=new Or(t),this.near=e,this.far=n}clone(){return new Ul(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class Nl extends vr{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(t){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=t}}class Dl{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=dn,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Cn()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let i=0,r=this.stride;it.far||e.push({distance:o,point:Hl.clone(),uv:Cr.getInterpolation(Hl,jl,ql,Yl,Zl,Jl,Kl,new zn),face:null,object:this})}copy(t,e){return super.copy(t,e),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function Ql(t,e,n,i,r,s){Gl.subVectors(t,n).addScalar(.5).multiply(i),void 0!==r?(Wl.x=s*Gl.x-r*Gl.y,Wl.y=r*Gl.x+s*Gl.y):Wl.copy(Gl),t.copy(e),t.x+=Wl.x,t.y+=Wl.y,t.applyMatrix4(Xl)}const tc=new gi,ec=new gi;class nc extends vr{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let t=0,n=e.length;t0){let n,i;for(n=1,i=e.length;n0){tc.setFromMatrixPosition(this.matrixWorld);const n=t.ray.origin.distanceTo(tc);this.getObjectForDistance(n).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){tc.setFromMatrixPosition(t.matrixWorld),ec.setFromMatrixPosition(this.matrixWorld);const n=tc.distanceTo(ec)/t.zoom;let i,r;for(e[0].object.visible=!0,i=1,r=e.length;i=t))break;e[i-1].object.visible=!1,e[i].object.visible=!0}for(this._currentLevel=i-1;io)continue;u.applyMatrix4(this.matrixWorld);const s=t.ray.origin.distanceTo(u);st.far||e.push({distance:s,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else{for(let n=Math.max(0,s.start),i=Math.min(m.count,s.start+s.count)-1;no)continue;u.applyMatrix4(this.matrixWorld);const i=t.ray.origin.distanceTo(u);it.far||e.push({distance:i,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;tr.far)return;s.push({distance:l,distanceToRay:Math.sqrt(o),point:n,index:e,face:null,object:a})}}class Xc extends oi{constructor(t,e,n,i,r,s,a,o,l){super(t,e,n,i,r,s,a,o,l),this.isVideoTexture=!0,this.minFilter=void 0!==s?s:mt,this.magFilter=void 0!==r?r:mt,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback((function e(){c.needsUpdate=!0,t.requestVideoFrameCallback(e)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;!1==="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class jc extends oi{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=ct,this.minFilter=ct,this.generateMipmaps=!1,this.needsUpdate=!0}}class qc extends oi{constructor(t,e,n,i,r,s,a,o,l,c,h,u){super(null,s,a,o,l,c,i,r,h,u),this.isCompressedTexture=!0,this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class Yc extends qc{constructor(t,e,n,i,r,s){super(t,e,n,r,s),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=ot}}class Zc extends oi{constructor(t,e,n,i,r,s,a,o,l){super(t,e,n,i,r,s,a,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Jc{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,i=this.getPoint(0),r=0;e.push(0);for(let s=1;s<=t;s++)n=this.getPoint(s/t),r+=n.distanceTo(i),e.push(r),i=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let i=0;const r=n.length;let s;s=e||t*n[r-1];let a,o=0,l=r-1;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),a=n[i]-s,a<0)o=i+1;else{if(!(a>0)){l=i;break}l=i-1}if(i=l,n[i]===s)return i/(r-1);const c=n[i];return(i+(s-c)/(n[i+1]-c))/(r-1)}getTangent(t,e){const n=1e-4;let i=t-n,r=t+n;i<0&&(i=0),r>1&&(r=1);const s=this.getPoint(i),a=this.getPoint(r),o=e||(s.isVector2?new zn:new gi);return o.copy(a).sub(s).normalize(),o}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new gi,i=[],r=[],s=[],a=new gi,o=new ji;for(let e=0;e<=t;e++){const n=e/t;i[e]=this.getTangentAt(n,new gi)}r[0]=new gi,s[0]=new gi;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),h=Math.abs(i[0].y),u=Math.abs(i[0].z);c<=l&&(l=c,n.set(1,0,0)),h<=l&&(l=h,n.set(0,1,0)),u<=l&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],a),s[0].crossVectors(i[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),s[e]=s[e-1].clone(),a.crossVectors(i[e-1],i[e]),a.length()>Number.EPSILON){a.normalize();const t=Math.acos(Pn(i[e-1].dot(i[e]),-1,1));r[e].applyMatrix4(o.makeRotationAxis(a,t))}s[e].crossVectors(i[e],r[e])}if(!0===e){let e=Math.acos(Pn(r[0].dot(r[t]),-1,1));e/=t,i[0].dot(a.crossVectors(r[0],r[t]))>0&&(e=-e);for(let n=1;n<=t;n++)r[n].applyMatrix4(o.makeRotationAxis(i[n],e*n)),s[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class Kc extends Jc{constructor(t=0,e=0,n=1,i=1,r=0,s=2*Math.PI,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=a,this.aRotation=o}getPoint(t,e){const n=e||new zn,i=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)i;)r-=i;r0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===c&&l===r-1&&(l=r-2,c=1),this.closed||l>0?a=i[(l-1)%r]:(th.subVectors(i[0],i[1]).add(i[0]),a=th);const h=i[l%r],u=i[(l+1)%r];if(this.closed||l+2i.length-2?i.length-1:s+1],h=i[s>i.length-3?i.length-1:s+2];return n.set(sh(a,o.x,l.x,c.x,h.x),sh(a,o.y,l.y,c.y,h.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e=n){const t=i[r]-n,s=this.curves[r],a=s.getLength(),o=0===a?0:1-t/a;return s.getPointAt(o,e)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,i=this.curves.length;n1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class _h extends hs{constructor(t=[new zn(0,-.5),new zn(.5,0),new zn(0,.5)],e=12,n=0,i=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},e=Math.floor(e),i=Pn(i,0,2*Math.PI);const r=[],s=[],a=[],o=[],l=[],c=1/e,h=new gi,u=new zn,d=new gi,p=new gi,m=new gi;let f=0,g=0;for(let e=0;e<=t.length-1;e++)switch(e){case 0:f=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-f,d.z=0*g,m.copy(d),d.normalize(),o.push(d.x,d.y,d.z);break;case t.length-1:o.push(m.x,m.y,m.z);break;default:f=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-f,d.z=0*g,p.copy(d),d.x+=m.x,d.y+=m.y,d.z+=m.z,d.normalize(),o.push(d.x,d.y,d.z),m.copy(p)}for(let r=0;r<=e;r++){const d=n+r*c*i,p=Math.sin(d),m=Math.cos(d);for(let n=0;n<=t.length-1;n++){h.x=t[n].x*p,h.y=t[n].y,h.z=t[n].x*m,s.push(h.x,h.y,h.z),u.x=r/e,u.y=n/(t.length-1),a.push(u.x,u.y);const i=o[3*n+0]*p,c=o[3*n+1],d=o[3*n+0]*m;l.push(i,c,d)}}for(let n=0;n0&&v(!0),e>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new es(h,3)),this.setAttribute("normal",new es(u,3)),this.setAttribute("uv",new es(d,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Mh(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Sh extends Mh{constructor(t=1,e=1,n=32,i=1,r=!1,s=0,a=2*Math.PI){super(0,t,e,n,i,r,s,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:s,thetaLength:a}}static fromJSON(t){return new Sh(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class bh extends hs{constructor(t=[],e=[],n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i};const r=[],s=[];function a(t,e,n,i){const r=i+1,s=[];for(let i=0;i<=r;i++){s[i]=[];const a=t.clone().lerp(n,i/r),o=e.clone().lerp(n,i/r),l=r-i;for(let t=0;t<=l;t++)s[i][t]=0===t&&i===r?a:a.clone().lerp(o,t/l)}for(let t=0;t.9&&a<.1&&(e<.2&&(s[t+0]+=1),n<.2&&(s[t+2]+=1),i<.2&&(s[t+4]+=1))}}()}(),this.setAttribute("position",new es(r,3)),this.setAttribute("normal",new es(r.slice(),3)),this.setAttribute("uv",new es(s,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new bh(t.vertices,t.indices,t.radius,t.details)}}class Eh extends bh{constructor(t=1,e=0){const n=(1+Math.sqrt(5))/2,i=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Eh(t.radius,t.detail)}}const Th=new gi,wh=new gi,Ah=new gi,Rh=new Cr;class Ch extends hs{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},null!==t){const n=4,i=Math.pow(10,n),r=Math.cos(An*e),s=t.getIndex(),a=t.getAttribute("position"),o=s?s.count:a.count,l=[0,0,0],c=["a","b","c"],h=new Array(3),u={},d=[];for(let t=0;t80*n){o=c=t[0],l=h=t[1];for(let e=n;ec&&(c=u),d>h&&(h=d);p=Math.max(c-o,h-l),p=0!==p?32767/p:0}return Nh(s,a,n,o,l,p,0),a};function Ih(t,e,n,i,r){let s,a;if(r===function(t,e,n,i){let r=0;for(let s=e,a=n-i;s0)for(s=e;s=e;s-=i)a=Qh(s,t[s],t[s+1],a);return a&&qh(a,a.next)&&(tu(a),a=a.next),a}function Uh(t,e){if(!t)return t;e||(e=t);let n,i=t;do{if(n=!1,i.steiner||!qh(i,i.next)&&0!==jh(i.prev,i,i.next))i=i.next;else{if(tu(i),i=e=i.prev,i===i.next)break;n=!0}}while(n||i!==e);return e}function Nh(t,e,n,i,r,s,a){if(!t)return;!a&&s&&function(t,e,n,i){let r=t;do{0===r.z&&(r.z=Vh(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,n,i,r,s,a,o,l,c=1;do{for(n=t,t=null,s=null,a=0;n;){for(a++,i=n,o=0,e=0;e0||l>0&&i;)0!==o&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,o--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;n=i}s.nextZ=null,c*=2}while(a>1)}(r)}(t,i,r,s);let o,l,c=t;for(;t.prev!==t.next;)if(o=t.prev,l=t.next,s?Oh(t,i,r,s):Dh(t))e.push(o.i/n|0),e.push(t.i/n|0),e.push(l.i/n|0),tu(t),t=l.next,c=l.next;else if((t=l)===c){a?1===a?Nh(t=Fh(Uh(t),e,n),e,n,i,r,s,2):2===a&&Bh(t,e,n,i,r,s):Nh(Uh(t),e,n,i,r,s,1);break}}function Dh(t){const e=t.prev,n=t,i=t.next;if(jh(e,n,i)>=0)return!1;const r=e.x,s=n.x,a=i.x,o=e.y,l=n.y,c=i.y,h=rs?r>a?r:a:s>a?s:a,p=o>l?o>c?o:c:l>c?l:c;let m=i.next;for(;m!==e;){if(m.x>=h&&m.x<=d&&m.y>=u&&m.y<=p&&Wh(r,o,s,l,a,c,m.x,m.y)&&jh(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Oh(t,e,n,i){const r=t.prev,s=t,a=t.next;if(jh(r,s,a)>=0)return!1;const o=r.x,l=s.x,c=a.x,h=r.y,u=s.y,d=a.y,p=ol?o>c?o:c:l>c?l:c,g=h>u?h>d?h:d:u>d?u:d,v=Vh(p,m,e,n,i),_=Vh(f,g,e,n,i);let y=t.prevZ,x=t.nextZ;for(;y&&y.z>=v&&x&&x.z<=_;){if(y.x>=p&&y.x<=f&&y.y>=m&&y.y<=g&&y!==r&&y!==a&&Wh(o,h,l,u,c,d,y.x,y.y)&&jh(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,x.x>=p&&x.x<=f&&x.y>=m&&x.y<=g&&x!==r&&x!==a&&Wh(o,h,l,u,c,d,x.x,x.y)&&jh(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;y&&y.z>=v;){if(y.x>=p&&y.x<=f&&y.y>=m&&y.y<=g&&y!==r&&y!==a&&Wh(o,h,l,u,c,d,y.x,y.y)&&jh(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;x&&x.z<=_;){if(x.x>=p&&x.x<=f&&x.y>=m&&x.y<=g&&x!==r&&x!==a&&Wh(o,h,l,u,c,d,x.x,x.y)&&jh(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Fh(t,e,n){let i=t;do{const r=i.prev,s=i.next.next;!qh(r,s)&&Yh(r,i,i.next,s)&&Kh(r,s)&&Kh(s,r)&&(e.push(r.i/n|0),e.push(i.i/n|0),e.push(s.i/n|0),tu(i),tu(i.next),i=t=s),i=i.next}while(i!==t);return Uh(i)}function Bh(t,e,n,i,r,s){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&Xh(a,t)){let o=$h(a,t);return a=Uh(a,a.next),o=Uh(o,o.next),Nh(a,e,n,i,r,s,0),void Nh(o,e,n,i,r,s,0)}t=t.next}a=a.next}while(a!==t)}function zh(t,e){return t.x-e.x}function Hh(t,e){const n=function(t,e){let n,i=e,r=-1/0;const s=t.x,a=t.y;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){const t=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=s&&t>r&&(r=t,n=i.x=i.x&&i.x>=l&&s!==i.x&&Wh(an.x||i.x===n.x&&kh(n,i)))&&(n=i,u=h)),i=i.next}while(i!==o);return n}(t,e);if(!n)return e;const i=$h(n,t);return Uh(i,i.next),Uh(n,n.next)}function kh(t,e){return jh(t.prev,t,e.prev)<0&&jh(e.next,t,t.next)<0}function Vh(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Gh(t){let e=t,n=t;do{(e.x=(t-a)*(s-o)&&(t-a)*(i-o)>=(n-a)*(e-o)&&(n-a)*(s-o)>=(r-a)*(i-o)}function Xh(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Yh(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Kh(t,e)&&Kh(e,t)&&function(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(jh(t.prev,t,e.prev)||jh(t,e.prev,e))||qh(t,e)&&jh(t.prev,t,t.next)>0&&jh(e.prev,e,e.next)>0)}function jh(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function qh(t,e){return t.x===e.x&&t.y===e.y}function Yh(t,e,n,i){const r=Jh(jh(t,e,n)),s=Jh(jh(t,e,i)),a=Jh(jh(n,i,t)),o=Jh(jh(n,i,e));return r!==s&&a!==o||(!(0!==r||!Zh(t,n,e))||(!(0!==s||!Zh(t,i,e))||(!(0!==a||!Zh(n,t,i))||!(0!==o||!Zh(n,e,i)))))}function Zh(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Jh(t){return t>0?1:t<0?-1:0}function Kh(t,e){return jh(t.prev,t,t.next)<0?jh(t,e,t.next)>=0&&jh(t,t.prev,e)>=0:jh(t,e,t.prev)<0||jh(t,t.next,e)<0}function $h(t,e){const n=new eu(t.i,t.x,t.y),i=new eu(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function Qh(t,e,n,i){const r=new eu(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function tu(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function eu(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class nu{static area(t){const e=t.length;let n=0;for(let i=e-1,r=0;r2&&t[e-1].equals(t[0])&&t.pop()}function ru(t,e){for(let n=0;nNumber.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),p=e.x-o/u,m=e.y+a/u,f=((n.x-c/d-p)*c-(n.y+l/d-m)*l)/(a*c-o*l);i=p+a*f-t.x,r=m+o*f-t.y;const g=i*i+r*r;if(g<=2)return new zn(i,r);s=Math.sqrt(g/2)}else{let t=!1;a>Number.EPSILON?l>Number.EPSILON&&(t=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(o)===Math.sign(c)&&(t=!0),t?(i=-o,r=a,s=Math.sqrt(h)):(i=a,r=o,s=Math.sqrt(h/2))}return new zn(i/s,r/s)}const L=[];for(let t=0,e=w.length,n=e-1,i=t+1;t=0;t--){const e=t/p,n=h*Math.cos(e*Math.PI/2),i=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=w.length;t=0;){const i=n;let r=n-1;r<0&&(r=t.length-1);for(let t=0,n=o+2*p;t0)&&d.push(e,r,l),(t!==n-1||o0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class bu extends Lr{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Or(16777215),this.specular=new Or(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Or(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=De,this.normalScale=new zn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=X,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Eu extends Lr{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Or(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Or(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=De,this.normalScale=new zn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class Tu extends Lr{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=De,this.normalScale=new zn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class wu extends Lr{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Or(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Or(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=De,this.normalScale=new zn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=X,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Au extends Lr{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Or(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=De,this.normalScale=new zn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Ru extends Ac{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}function Cu(t,e,n){return Lu(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)}function Pu(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)}function Lu(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Iu(t){const e=t.length,n=new Array(e);for(let t=0;t!==e;++t)n[t]=t;return n.sort((function(e,n){return t[e]-t[n]})),n}function Uu(t,e,n){const i=t.length,r=new t.constructor(i);for(let s=0,a=0;a!==i;++s){const i=n[s]*e;for(let n=0;n!==e;++n)r[a++]=t[i+n]}return r}function Nu(t,e,n,i){let r=1,s=t[0];for(;void 0!==s&&void 0===s[i];)s=t[r++];if(void 0===s)return;let a=s[i];if(void 0!==a)if(Array.isArray(a))do{a=s[i],void 0!==a&&(e.push(s.time),n.push.apply(n,a)),s=t[r++]}while(void 0!==s);else if(void 0!==a.toArray)do{a=s[i],void 0!==a&&(e.push(s.time),a.toArray(n,n.length)),s=t[r++]}while(void 0!==s);else do{a=s[i],void 0!==a&&(e.push(s.time),n.push(a)),s=t[r++]}while(void 0!==s)}const Du={arraySlice:Cu,convertArray:Pu,isTypedArray:Lu,getKeyframeOrder:Iu,sortedArray:Uu,flattenJSON:Nu,subclip:function(t,e,n,i,r=30){const s=t.clone();s.name=e;const a=[];for(let t=0;t=i)){l.push(e.times[t]);for(let n=0;ns.tracks[t].times[0]&&(o=s.tracks[t].times[0]);for(let t=0;t=i.times[u]){const t=u*l+o,e=t+l-o;d=Cu(i.values,t,e)}else{const t=i.createInterpolant(),e=o,n=l-o;t.evaluate(s),d=Cu(t.resultBuffer,e,n)}if("quaternion"===r){(new fi).fromArray(d).normalize().conjugate().toArray(d)}const p=a.times.length;for(let t=0;t=r)break t;{const a=e[1];t=r)break e}s=n,n=0}}for(;n>>1;te;)--s;if(++s,0!==r||s!==i){r>=s&&(s=Math.max(s,1),r=s-1);const t=this.getValueSize();this.times=Cu(n,r,s),this.values=Cu(this.values,r*t,s*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==r;e++){const i=n[e];if("number"==typeof i&&isNaN(i)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,i),t=!1;break}if(null!==s&&s>i){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,i,s),t=!1;break}s=i}if(void 0!==i&&Lu(i))for(let e=0,n=i.length;e!==n;++e){const n=i[e];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,n),t=!1;break}}return t}optimize(){const t=Cu(this.times),e=Cu(this.values),n=this.getValueSize(),i=this.getInterpolation()===Se,r=t.length-1;let s=1;for(let a=1;a0){t[s]=t[r];for(let t=r*n,i=s*n,a=0;a!==n;++a)e[i+a]=e[t+a];++s}return s!==t.length?(this.times=Cu(t,0,s),this.values=Cu(e,0,s*n)):(this.times=t,this.values=e),this}clone(){const t=Cu(this.times,0),e=Cu(this.values,0),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}Hu.prototype.TimeBufferType=Float32Array,Hu.prototype.ValueBufferType=Float32Array,Hu.prototype.DefaultInterpolation=Me;class ku extends Hu{}ku.prototype.ValueTypeName="bool",ku.prototype.ValueBufferType=Array,ku.prototype.DefaultInterpolation=xe,ku.prototype.InterpolantFactoryMethodLinear=void 0,ku.prototype.InterpolantFactoryMethodSmooth=void 0;class Vu extends Hu{}Vu.prototype.ValueTypeName="color";class Gu extends Hu{}Gu.prototype.ValueTypeName="number";class Wu extends Ou{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){const r=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=(n-e)/(i-e);let l=t*a;for(let t=l+a;l!==t;l+=4)fi.slerpFlat(r,0,s,l-a,s,l,o);return r}}class Xu extends Hu{InterpolantFactoryMethodLinear(t){return new Wu(this.times,this.values,this.getValueSize(),t)}}Xu.prototype.ValueTypeName="quaternion",Xu.prototype.DefaultInterpolation=Me,Xu.prototype.InterpolantFactoryMethodSmooth=void 0;class ju extends Hu{}ju.prototype.ValueTypeName="string",ju.prototype.ValueBufferType=Array,ju.prototype.DefaultInterpolation=xe,ju.prototype.InterpolantFactoryMethodLinear=void 0,ju.prototype.InterpolantFactoryMethodSmooth=void 0;class qu extends Hu{}qu.prototype.ValueTypeName="vector";class Yu{constructor(t,e=-1,n,i=2500){this.name=t,this.tracks=n,this.duration=e,this.blendMode=i,this.uuid=Cn(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],n=t.tracks,i=1/(t.fps||1);for(let t=0,r=n.length;t!==r;++t)e.push(Zu(n[t]).scale(i));const r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(t){const e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,i=n.length;t!==i;++t)e.push(Hu.toJSON(n[t]));return i}static CreateFromMorphTargetSequence(t,e,n,i){const r=e.length,s=[];for(let t=0;t1){const t=s[1];let e=i[t];e||(i[t]=e=[]),e.push(n)}}const s=[];for(const t in i)s.push(this.CreateFromMorphTargetSequence(t,i[t],e,n));return s}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(t,e,n,i,r){if(0!==n.length){const s=[],a=[];Nu(n,s,a,i),0!==s.length&&r.push(new t(e,s,a))}},i=[],r=t.name||"default",s=t.fps||30,a=t.blendMode;let o=t.length||-1;const l=t.hierarchy||[];for(let t=0;t{e&&e(r),this.manager.itemEnd(t)}),0),r;if(void 0!==td[t])return void td[t].push({onLoad:e,onProgress:n,onError:i});td[t]=[],td[t].push({onLoad:e,onProgress:n,onError:i});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,o=this.responseType;fetch(s).then((e=>{if(200===e.status||0===e.status){if(0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const n=td[t],i=e.body.getReader(),r=e.headers.get("Content-Length")||e.headers.get("X-File-Size"),s=r?parseInt(r):0,a=0!==s;let o=0;const l=new ReadableStream({start(t){!function e(){i.read().then((({done:i,value:r})=>{if(i)t.close();else{o+=r.byteLength;const i=new ProgressEvent("progress",{lengthComputable:a,loaded:o,total:s});for(let t=0,e=n.length;t{switch(o){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then((t=>(new DOMParser).parseFromString(t,a)));case"json":return t.json();default:if(void 0===a)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(a),n=e&&e[1]?e[1].toLowerCase():void 0,i=new TextDecoder(n);return t.arrayBuffer().then((t=>i.decode(t)))}}})).then((e=>{Ju.add(t,e);const n=td[t];delete td[t];for(let t=0,i=n.length;t{const n=td[t];if(void 0===n)throw this.manager.itemError(t),e;delete td[t];for(let t=0,i=n.length;t{this.manager.itemEnd(t)})),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class id extends Qu{constructor(t){super(t)}load(t,e,n,i){const r=this,s=new nd(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,(function(n){try{e(r.parse(JSON.parse(n)))}catch(e){i?i(e):console.error(e),r.manager.itemError(t)}}),n,i)}parse(t){const e=[];for(let n=0;n0:i.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const e in t.uniforms){const r=t.uniforms[e];switch(i.uniforms[e]={},r.type){case"t":i.uniforms[e].value=n(r.value);break;case"c":i.uniforms[e].value=(new Or).setHex(r.value);break;case"v2":i.uniforms[e].value=(new zn).fromArray(r.value);break;case"v3":i.uniforms[e].value=(new gi).fromArray(r.value);break;case"v4":i.uniforms[e].value=(new li).fromArray(r.value);break;case"m3":i.uniforms[e].value=(new Hn).fromArray(r.value);break;case"m4":i.uniforms[e].value=(new ji).fromArray(r.value);break;default:i.uniforms[e].value=r.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.glslVersion&&(i.glslVersion=t.glslVersion),void 0!==t.extensions)for(const e in t.extensions)i.extensions[e]=t.extensions[e];if(void 0!==t.lights&&(i.lights=t.lights),void 0!==t.clipping&&(i.clipping=t.clipping),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=n(t.map)),void 0!==t.matcap&&(i.matcap=n(t.matcap)),void 0!==t.alphaMap&&(i.alphaMap=n(t.alphaMap)),void 0!==t.bumpMap&&(i.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),i.normalScale=(new zn).fromArray(e)}return void 0!==t.displacementMap&&(i.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=n(t.specularMap)),void 0!==t.specularIntensityMap&&(i.specularIntensityMap=n(t.specularIntensityMap)),void 0!==t.specularColorMap&&(i.specularColorMap=n(t.specularColorMap)),void 0!==t.envMap&&(i.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(i.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(i.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(i.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=n(t.gradientMap)),void 0!==t.clearcoatMap&&(i.clearcoatMap=n(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=n(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(i.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(i.clearcoatNormalScale=(new zn).fromArray(t.clearcoatNormalScale)),void 0!==t.iridescenceMap&&(i.iridescenceMap=n(t.iridescenceMap)),void 0!==t.iridescenceThicknessMap&&(i.iridescenceThicknessMap=n(t.iridescenceThicknessMap)),void 0!==t.transmissionMap&&(i.transmissionMap=n(t.transmissionMap)),void 0!==t.thicknessMap&&(i.thicknessMap=n(t.thicknessMap)),void 0!==t.anisotropyMap&&(i.anisotropyMap=n(t.anisotropyMap)),void 0!==t.sheenColorMap&&(i.sheenColorMap=n(t.sheenColorMap)),void 0!==t.sheenRoughnessMap&&(i.sheenRoughnessMap=n(t.sheenRoughnessMap)),i}setTextures(t){return this.textures=t,this}static createMaterialFromType(t){return new{ShadowMaterial:yu,SpriteMaterial:Bl,RawShaderMaterial:xu,ShaderMaterial:Ds,PointsMaterial:Bc,MeshPhysicalMaterial:Su,MeshStandardMaterial:Mu,MeshPhongMaterial:bu,MeshToonMaterial:Eu,MeshNormalMaterial:Tu,MeshLambertMaterial:wu,MeshDepthMaterial:fl,MeshDistanceMaterial:gl,MeshBasicMaterial:Br,MeshMatcapMaterial:Au,LineDashedMaterial:Ru,LineBasicMaterial:Ac,Material:Lr}[t]}}class Cd{static decodeText(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let n=0,i=t.length;n0){const n=new Ku(e);r=new sd(n),r.setCrossOrigin(this.crossOrigin);for(let e=0,n=t.length;e0){i=new sd(this.manager),i.setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(n,i,this._addIndex*e,1,e);for(let t=e,r=e+e;t!==r;++t)if(n[t]!==n[t+e]){a.setValue(n,i);break}}saveOriginalState(){const t=this.binding,e=this.buffer,n=this.valueSize,i=n*this._origIndex;t.getValue(e,i);for(let t=n,r=i;t!==r;++t)e[t]=e[i+t%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let n=t;n=.5)for(let i=0;i!==r;++i)t[e+i]=t[n+i]}_slerp(t,e,n,i){fi.slerpFlat(t,e,t,e,t,n,i)}_slerpAdditive(t,e,n,i,r){const s=this._workIndex*r;fi.multiplyQuaternionsFlat(t,s,t,e,t,n),fi.slerpFlat(t,e,t,e,t,s,i)}_lerp(t,e,n,i,r){const s=1-i;for(let a=0;a!==r;++a){const r=e+a;t[r]=t[r]*s+t[n+a]*i}}_lerpAdditive(t,e,n,i,r){for(let s=0;s!==r;++s){const r=e+s;t[r]=t[r]+t[n+s]*i}}}const op="\\[\\]\\.:\\/",lp=new RegExp("["+op+"]","g"),cp="[^"+op+"]",hp="[^"+op.replace("\\.","")+"]",up=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",cp)+/(WCOD+)?/.source.replace("WCOD",hp)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",cp)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",cp)+"$"),dp=["material","materials","bones","map"];class pp{constructor(t,e,n){this.path=e,this.parsedPath=n||pp.parseTrackName(e),this.node=pp.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new pp.Composite(t,e,n):new pp(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(lp,"")}static parseTrackName(t){const e=up.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const t=n.nodeName.substring(i+1);-1!==dp.indexOf(t)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=t)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){const n=function(t){for(let i=0;i=r){const s=r++,c=t[s];e[c.uuid]=l,t[l]=c,e[o]=s,t[s]=a;for(let t=0,e=i;t!==e;++t){const e=n[t],i=e[s],r=e[l];e[l]=i,e[s]=r}}}this.nCachedObjects_=r}uncache(){const t=this._objects,e=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_,s=t.length;for(let a=0,o=arguments.length;a!==o;++a){const o=arguments[a].uuid,l=e[o];if(void 0!==l)if(delete e[o],l0&&(e[a.uuid]=l),t[l]=a,t.pop();for(let t=0,e=i;t!==e;++t){const e=n[t];e[l]=e[r],e.pop()}}}this.nCachedObjects_=r}subscribe_(t,e){const n=this._bindingsIndicesByPath;let i=n[t];const r=this._bindings;if(void 0!==i)return r[i];const s=this._paths,a=this._parsedPaths,o=this._objects,l=o.length,c=this.nCachedObjects_,h=new Array(l);i=r.length,n[t]=i,s.push(t),a.push(e),r.push(h);for(let n=c,i=o.length;n!==i;++n){const i=o[n];h[n]=new pp(i,t,e)}return h}unsubscribe_(t){const e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){const i=this._paths,r=this._parsedPaths,s=this._bindings,a=s.length-1,o=s[a];e[t[a]]=n,s[n]=o,s.pop(),r[n]=r[a],r.pop(),i[n]=i[a],i.pop()}}}class fp{constructor(t,e,n=null,i=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=n,this.blendMode=i;const r=e.tracks,s=r.length,a=new Array(s),o={endingStart:be,endingEnd:be};for(let t=0;t!==s;++t){const e=r[t].createInterpolant(null);a[t]=e,e.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){const n=this._clip.duration,i=t._clip.duration,r=i/n,s=n/i;t.warp(1,r,e),this.warp(s,1,e)}return this}crossFadeTo(t,e,n){return t.crossFadeFrom(this,e,n)}stopFading(){const t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,n){const i=this._mixer,r=i.time,s=this.timeScale;let a=this._timeScaleInterpolant;null===a&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const o=a.parameterPositions,l=a.sampleValues;return o[0]=r,o[1]=r+n,l[0]=t/s,l[1]=e/s,this}stopWarping(){const t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,n,i){if(!this.enabled)return void this._updateWeight(t);const r=this._startTime;if(null!==r){const i=(t-r)*n;i<0||0===n?e=0:(this._startTime=null,e=n*i)}e*=this._updateTimeScale(t);const s=this._updateTime(e),a=this._updateWeight(t);if(a>0){const t=this._interpolants,e=this._propertyBindings;if(this.blendMode===Ae)for(let n=0,i=t.length;n!==i;++n)t[n].evaluate(s),e[n].accumulateAdditive(a);else for(let n=0,r=t.length;n!==r;++n)t[n].evaluate(s),e[n].accumulate(i,a)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const n=this._weightInterpolant;if(null!==n){const i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,n=this.loop;let i=this.time+t,r=this._loopCount;const s=2202===n;if(0===t)return-1===r?i:s&&1==(1&r)?e-i:i;if(2200===n){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(i>=e)i=e;else{if(!(i<0)){this.time=i;break t}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),i>=e||i<0){const n=Math.floor(i/e);i-=e*n,r+=Math.abs(n);const a=this.repetitions-r;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=t>0?e:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===a){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=i;if(s&&1==(1&r))return e-i}return i}_setEndings(t,e,n){const i=this._interpolantSettings;n?(i.endingStart=Ee,i.endingEnd=Ee):(i.endingStart=t?this.zeroSlopeAtStart?Ee:be:Te,i.endingEnd=e?this.zeroSlopeAtEnd?Ee:be:Te)}_scheduleFading(t,e,n){const i=this._mixer,r=i.time;let s=this._weightInterpolant;null===s&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const a=s.parameterPositions,o=s.sampleValues;return a[0]=r,o[0]=e,a[1]=r+t,o[1]=n,this}}const gp=new Float32Array(1);class vp extends En{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const n=t._localRoot||this._root,i=t._clip.tracks,r=i.length,s=t._propertyBindings,a=t._interpolants,o=n.uuid,l=this._bindingsByRootAndName;let c=l[o];void 0===c&&(c={},l[o]=c);for(let t=0;t!==r;++t){const r=i[t],l=r.name;let h=c[l];if(void 0!==h)++h.referenceCount,s[t]=h;else{if(h=s[t],void 0!==h){null===h._cacheIndex&&(++h.referenceCount,this._addInactiveBinding(h,o,l));continue}const i=e&&e._propertyBindings[t].binding.parsedPath;h=new ap(pp.create(n,l,i),r.ValueTypeName,r.getValueSize()),++h.referenceCount,this._addInactiveBinding(h,o,l),s[t]=h}a[t].resultBuffer=h.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,n=t._clip.uuid,i=this._actionsByClip[n];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,n,e)}const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const e=t._cacheIndex;return null!==e&&e=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,n=this._nActiveActions,i=this.time+=t,r=Math.sign(t),s=this._accuIndex^=1;for(let a=0;a!==n;++a){e[a]._update(i,t,r,s)}const a=this._bindings,o=this._nActiveBindings;for(let t=0;t!==o;++t)a[t].apply(s);return this}setTime(t){this.time=0;for(let t=0;tthis.max.x||t.ythis.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Rp).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const Pp=new gi,Lp=new gi;class Ip{constructor(t=new gi,e=new gi){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){Pp.subVectors(t,this.start),Lp.subVectors(this.end,this.start);const n=Lp.dot(Lp);let i=Lp.dot(Pp)/n;return e&&(i=Pn(i,0,1)),i}closestPointToPoint(t,e,n){const i=this.closestPointToPointParameter(t,e);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}const Up=new gi;class Np extends vr{constructor(t,e){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e,this.type="SpotLightHelper";const n=new hs,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let t=0,e=1,n=32;t1)for(let n=0;n.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{sm.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(sm,e)}}setLength(t,e=.2*t,n=.2*e){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class cm extends Oc{constructor(t=1){const e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],n=new hs;n.setAttribute("position",new es(e,3)),n.setAttribute("color",new es([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(n,new Ac({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(t,e,n){const i=new Or,r=this.geometry.attributes.color.array;return i.set(t),i.toArray(r,0),i.toArray(r,3),i.set(e),i.toArray(r,6),i.toArray(r,9),i.set(n),i.toArray(r,12),i.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class hm{constructor(){this.type="ShapePath",this.color=new Or,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new vh,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,n,i){return this.currentPath.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,s){return this.currentPath.bezierCurveTo(t,e,n,i,r,s),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(t,e){const n=e.length;let i=!1;for(let r=n-1,s=0;sNumber.EPSILON){if(l<0&&(n=e[s],o=-o,a=e[r],l=-l),t.ya.y)continue;if(t.y===n.y){if(t.x===n.x)return!0}else{const e=l*(t.x-n.x)-o*(t.y-n.y);if(0===e)return!0;if(e<0)continue;i=!i}}else{if(t.y!==n.y)continue;if(a.x<=t.x&&t.x<=n.x||n.x<=t.x&&t.x<=a.x)return!0}}return i}const n=nu.isClockWise,i=this.subPaths;if(0===i.length)return[];let r,s,a;const o=[];if(1===i.length)return s=i[0],a=new Ph,a.curves=s.curves,o.push(a),o;let l=!n(i[0].getPoints());l=t?!l:l;const c=[],h=[];let u,d,p=[],m=0;h[m]=void 0,p[m]=[];for(let e=0,a=i.length;e1){let t=!1,n=0;for(let t=0,e=h.length;t0&&!1===t&&(p=c)}for(let t=0,e=h.length;t>8&255]+Ln[t>>16&255]+Ln[t>>24&255]+"-"+Ln[255&e]+Ln[e>>8&255]+"-"+Ln[e>>16&15|64]+Ln[e>>24&255]+"-"+Ln[63&n|128]+Ln[n>>8&255]+"-"+Ln[n>>16&255]+Ln[n>>24&255]+Ln[255&i]+Ln[i>>8&255]+Ln[i>>16&255]+Ln[i>>24&255]).toLowerCase()}function Nn(t,e,n){return Math.max(e,Math.min(n,t))}function On(t,e){return(t%e+e)%e}function Fn(t,e,n){return(1-n)*t+n*e}function zn(t){return 0==(t&t-1)&&0!==t}function Bn(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function Hn(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function kn(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Vn(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const Gn={DEG2RAD:In,RAD2DEG:Un,generateUUID:Dn,clamp:Nn,euclideanModulo:On,mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},inverseLerp:function(t,e,n){return t!==e?(n-t)/(e-t):0},lerp:Fn,damp:function(t,e,n,i){return Fn(t,e,1-Math.exp(-n*i))},pingpong:function(t,e=1){return e-Math.abs(On(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(Pn=t);let e=Pn+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*In},radToDeg:function(t){return t*Un},isPowerOfTwo:zn,ceilPowerOfTwo:Bn,floorPowerOfTwo:Hn,setQuaternionFromProperEuler:function(t,e,n,i,r){const s=Math.cos,a=Math.sin,o=s(n/2),l=a(n/2),c=s((e+i)/2),h=a((e+i)/2),u=s((e-i)/2),d=a((e-i)/2),p=s((i-e)/2),f=a((i-e)/2);switch(r){case"XYX":t.set(o*h,l*u,l*d,o*c);break;case"YZY":t.set(l*d,o*h,l*u,o*c);break;case"ZXZ":t.set(l*u,l*d,o*h,o*c);break;case"XZX":t.set(o*h,l*f,l*p,o*c);break;case"YXY":t.set(l*p,o*h,l*f,o*c);break;case"ZYZ":t.set(l*f,l*p,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:Vn,denormalize:kn};class Wn{constructor(t=0,e=0){Wn.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Nn(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,s=this.y-t.y;return this.x=r*n-s*i+t.x,this.y=r*i+s*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Xn{constructor(t,e,n,i,r,s,a,o,l){Xn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,n,i,r,s,a,o,l)}set(t,e,n,i,r,s,a,o,l){const c=this.elements;return c[0]=t,c[1]=i,c[2]=a,c[3]=e,c[4]=r,c[5]=o,c[6]=n,c[7]=s,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[3],o=n[6],l=n[1],c=n[4],h=n[7],u=n[2],d=n[5],p=n[8],f=i[0],m=i[3],g=i[6],v=i[1],_=i[4],y=i[7],x=i[2],M=i[5],S=i[8];return r[0]=s*f+a*v+o*x,r[3]=s*m+a*_+o*M,r[6]=s*g+a*y+o*S,r[1]=l*f+c*v+h*x,r[4]=l*m+c*_+h*M,r[7]=l*g+c*y+h*S,r[2]=u*f+d*v+p*x,r[5]=u*m+d*_+p*M,r[8]=u*g+d*y+p*S,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8];return e*s*c-e*a*l-n*r*c+n*a*o+i*r*l-i*s*o}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8],h=c*s-a*l,u=a*o-c*r,d=l*r-s*o,p=e*h+n*u+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return t[0]=h*f,t[1]=(i*l-c*n)*f,t[2]=(a*n-i*s)*f,t[3]=u*f,t[4]=(c*e-i*o)*f,t[5]=(i*r-a*e)*f,t[6]=d*f,t[7]=(n*o-l*e)*f,t[8]=(s*e-n*r)*f,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,s,a){const o=Math.cos(r),l=Math.sin(r);return this.set(n*o,n*l,-n*(o*s+l*a)+s+t,-i*l,i*o,-i*(-l*s+o*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(jn.makeScale(t,e)),this}rotate(t){return this.premultiply(jn.makeRotation(-t)),this}translate(t,e){return this.premultiply(jn.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}const jn=new Xn;function qn(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const Yn={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Zn(t,e){return new Yn[t](e)}function Jn(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function Kn(){const t=Jn("canvas");return t.style.display="block",t}const $n={};function Qn(t){t in $n||($n[t]=!0,console.warn(t))}function ti(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function ei(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const ni=(new Xn).fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),ii=(new Xn).fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);const ri={[ke]:t=>t,[He]:t=>t.convertSRGBToLinear(),[Ve]:function(t){return t.convertSRGBToLinear().applyMatrix3(ii)}},si={[ke]:t=>t,[He]:t=>t.convertLinearToSRGB(),[Ve]:function(t){return t.applyMatrix3(ni).convertLinearToSRGB()}},ai={enabled:!0,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(t){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!t},get workingColorSpace(){return ke},set workingColorSpace(t){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(t,e,n){if(!1===this.enabled||e===n||!e||!n)return t;const i=ri[e],r=si[n];if(void 0===i||void 0===r)throw new Error(`Unsupported color space conversion, "${e}" to "${n}".`);return r(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)}};let oi;class li{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===oi&&(oi=Jn("canvas")),oi.width=t.width,oi.height=t.height;const n=oi.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=oi}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=Jn("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const i=n.getImageData(0,0,t.width,t.height),r=i.data;for(let t=0;t0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==tt)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case at:t.x=t.x-Math.floor(t.x);break;case ot:t.x=t.x<0?0:1;break;case lt:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case at:t.y=t.y-Math.floor(t.y);break;case ot:t.y=t.y<0?0:1;break;case lt:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return Qn("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===He?De:Ue}set encoding(t){Qn("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===De?He:Be}}pi.DEFAULT_IMAGE=null,pi.DEFAULT_MAPPING=tt,pi.DEFAULT_ANISOTROPY=1;class fi{constructor(t=0,e=0,n=0,i=1){fi.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i+s[12]*r,this.y=s[1]*e+s[5]*n+s[9]*i+s[13]*r,this.z=s[2]*e+s[6]*n+s[10]*i+s[14]*r,this.w=s[3]*e+s[7]*n+s[11]*i+s[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,r;const s=.01,a=.1,o=t.elements,l=o[0],c=o[4],h=o[8],u=o[1],d=o[5],p=o[9],f=o[2],m=o[6],g=o[10];if(Math.abs(c-u)o&&t>v?tv?o=0?1:-1,i=1-e*e;if(i>Number.EPSILON){const r=Math.sqrt(i),s=Math.atan2(r,e*n);t=Math.sin(t*s)/r,a=Math.sin(a*s)/r}const r=a*n;if(o=o*t+u*r,l=l*t+d*r,c=c*t+p*r,h=h*t+f*r,t===1-a){const t=1/Math.sqrt(o*o+l*l+c*c+h*h);o*=t,l*=t,c*=t,h*=t}}t[e]=o,t[e+1]=l,t[e+2]=c,t[e+3]=h}static multiplyQuaternionsFlat(t,e,n,i,r,s){const a=n[i],o=n[i+1],l=n[i+2],c=n[i+3],h=r[s],u=r[s+1],d=r[s+2],p=r[s+3];return t[e]=a*p+c*h+o*d-l*u,t[e+1]=o*p+c*u+l*h-a*d,t[e+2]=l*p+c*d+a*u-o*h,t[e+3]=c*p-a*h-o*u-l*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){const n=t._x,i=t._y,r=t._z,s=t._order,a=Math.cos,o=Math.sin,l=a(n/2),c=a(i/2),h=a(r/2),u=o(n/2),d=o(i/2),p=o(r/2);switch(s){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],r=e[8],s=e[1],a=e[5],o=e[9],l=e[2],c=e[6],h=e[10],u=n+a+h;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(c-o)*t,this._y=(r-l)*t,this._z=(s-i)*t}else if(n>a&&n>h){const t=2*Math.sqrt(1+n-a-h);this._w=(c-o)/t,this._x=.25*t,this._y=(i+s)/t,this._z=(r+l)/t}else if(a>h){const t=2*Math.sqrt(1+a-n-h);this._w=(r-l)/t,this._x=(i+s)/t,this._y=.25*t,this._z=(o+c)/t}else{const t=2*Math.sqrt(1+h-n-a);this._w=(s-i)/t,this._x=(r+l)/t,this._y=(o+c)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return nMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Nn(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,s=t._w,a=e._x,o=e._y,l=e._z,c=e._w;return this._x=n*c+s*a+i*l-r*o,this._y=i*c+s*o+r*a-n*l,this._z=r*c+s*l+n*o-i*a,this._w=s*c-n*a-i*o-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,i=this._y,r=this._z,s=this._w;let a=s*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=s,this._x=n,this._y=i,this._z=r,this;const o=1-a*a;if(o<=Number.EPSILON){const t=1-e;return this._w=t*s+e*this._w,this._x=t*n+e*this._x,this._y=t*i+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(o),c=Math.atan2(l,a),h=Math.sin((1-e)*c)/l,u=Math.sin(e*c)/l;return this._w=s*h+this._w*u,this._x=n*h+this._x*u,this._y=i*h+this._y*u,this._z=r*h+this._z*u,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=Math.random(),e=Math.sqrt(1-t),n=Math.sqrt(t),i=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(e*Math.cos(i),n*Math.sin(r),n*Math.cos(r),e*Math.sin(i))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class bi{constructor(t=0,e=0,n=0){bi.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(Ti.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Ti.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.elements,s=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*s,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*s,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*s,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,a=t.z,o=t.w,l=o*e+s*i-a*n,c=o*n+a*e-r*i,h=o*i+r*n-s*e,u=-r*e-s*n-a*i;return this.x=l*o+u*-r+c*-a-h*-s,this.y=c*o+u*-s+h*-r-l*-a,this.z=h*o+u*-a+l*-s-c*-r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=i*o-r*a,this.y=r*s-n*o,this.z=n*a-i*s,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return Ei.copy(this).projectOnVector(t),this.sub(Ei)}reflect(t){return this.sub(Ei.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Nn(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=2*(Math.random()-.5),e=Math.random()*Math.PI*2,n=Math.sqrt(1-t**2);return this.x=n*Math.cos(e),this.y=n*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Ei=new bi,Ti=new Si;class wi{constructor(t=new bi(1/0,1/0,1/0),e=new bi(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Ri),Ri.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Oi),Fi.subVectors(this.max,Oi),Li.subVectors(t.a,Oi),Pi.subVectors(t.b,Oi),Ii.subVectors(t.c,Oi),Ui.subVectors(Pi,Li),Di.subVectors(Ii,Pi),Ni.subVectors(Li,Ii);let e=[0,-Ui.z,Ui.y,0,-Di.z,Di.y,0,-Ni.z,Ni.y,Ui.z,0,-Ui.x,Di.z,0,-Di.x,Ni.z,0,-Ni.x,-Ui.y,Ui.x,0,-Di.y,Di.x,0,-Ni.y,Ni.x,0];return!!Hi(e,Li,Pi,Ii,Fi)&&(e=[1,0,0,0,1,0,0,0,1],!!Hi(e,Li,Pi,Ii,Fi)&&(zi.crossVectors(Ui,Di),e=[zi.x,zi.y,zi.z],Hi(e,Li,Pi,Ii,Fi)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Ri).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(Ri).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(Ai[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ai[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ai[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ai[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ai[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ai[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ai[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ai[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ai)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const Ai=[new bi,new bi,new bi,new bi,new bi,new bi,new bi,new bi],Ri=new bi,Ci=new wi,Li=new bi,Pi=new bi,Ii=new bi,Ui=new bi,Di=new bi,Ni=new bi,Oi=new bi,Fi=new bi,zi=new bi,Bi=new bi;function Hi(t,e,n,i,r){for(let s=0,a=t.length-3;s<=a;s+=3){Bi.fromArray(t,s);const a=r.x*Math.abs(Bi.x)+r.y*Math.abs(Bi.y)+r.z*Math.abs(Bi.z),o=e.dot(Bi),l=n.dot(Bi),c=i.dot(Bi);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>a)return!1}return!0}const ki=new wi,Vi=new bi,Gi=new bi;class Wi{constructor(t=new bi,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):ki.setFromPoints(t).getCenter(n);let i=0;for(let e=0,r=t.length;ethis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Vi.subVectors(t,this.center);const e=Vi.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),n=.5*(t-this.radius);this.center.addScaledVector(Vi,n/t),this.radius+=n}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(Gi.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Vi.copy(t.center).add(Gi)),this.expandByPoint(Vi.copy(t.center).sub(Gi))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Xi=new bi,ji=new bi,qi=new bi,Yi=new bi,Zi=new bi,Ji=new bi,Ki=new bi;class $i{constructor(t=new bi,e=new bi(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Xi)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Xi.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Xi.copy(this.origin).addScaledVector(this.direction,e),Xi.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){ji.copy(t).add(e).multiplyScalar(.5),qi.copy(e).sub(t).normalize(),Yi.copy(this.origin).sub(ji);const r=.5*t.distanceTo(e),s=-this.direction.dot(qi),a=Yi.dot(this.direction),o=-Yi.dot(qi),l=Yi.lengthSq(),c=Math.abs(1-s*s);let h,u,d,p;if(c>0)if(h=s*o-a,u=s*a-o,p=r*c,h>=0)if(u>=-p)if(u<=p){const t=1/c;h*=t,u*=t,d=h*(h+s*u+2*a)+u*(s*h+u+2*o)+l}else u=r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;else u=-r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;else u<=-p?(h=Math.max(0,-(-s*r+a)),u=h>0?-r:Math.min(Math.max(-r,-o),r),d=-h*h+u*(u+2*o)+l):u<=p?(h=0,u=Math.min(Math.max(-r,-o),r),d=u*(u+2*o)+l):(h=Math.max(0,-(s*r+a)),u=h>0?r:Math.min(Math.max(-r,-o),r),d=-h*h+u*(u+2*o)+l);else u=s>0?-r:r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(ji).addScaledVector(qi,u),d}intersectSphere(t,e){Xi.subVectors(t.center,this.origin);const n=Xi.dot(this.direction),i=Xi.dot(Xi)-n*n,r=t.radius*t.radius;if(i>r)return null;const s=Math.sqrt(r-i),a=n-s,o=n+s;return o<0?null:a<0?this.at(o,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,r,s,a,o;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(n=(t.min.x-u.x)*l,i=(t.max.x-u.x)*l):(n=(t.max.x-u.x)*l,i=(t.min.x-u.x)*l),c>=0?(r=(t.min.y-u.y)*c,s=(t.max.y-u.y)*c):(r=(t.max.y-u.y)*c,s=(t.min.y-u.y)*c),n>s||r>i?null:((r>n||isNaN(n))&&(n=r),(s=0?(a=(t.min.z-u.z)*h,o=(t.max.z-u.z)*h):(a=(t.max.z-u.z)*h,o=(t.min.z-u.z)*h),n>o||a>i?null:((a>n||n!=n)&&(n=a),(o=0?n:i,e)))}intersectsBox(t){return null!==this.intersectBox(t,Xi)}intersectTriangle(t,e,n,i,r){Zi.subVectors(e,t),Ji.subVectors(n,t),Ki.crossVectors(Zi,Ji);let s,a=this.direction.dot(Ki);if(a>0){if(i)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}Yi.subVectors(this.origin,t);const o=s*this.direction.dot(Ji.crossVectors(Yi,Ji));if(o<0)return null;const l=s*this.direction.dot(Zi.cross(Yi));if(l<0)return null;if(o+l>a)return null;const c=-s*Yi.dot(Ki);return c<0?null:this.at(c/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Qi{constructor(t,e,n,i,r,s,a,o,l,c,h,u,d,p,f,m){Qi.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,n,i,r,s,a,o,l,c,h,u,d,p,f,m)}set(t,e,n,i,r,s,a,o,l,c,h,u,d,p,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=r,g[5]=s,g[9]=a,g[13]=o,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Qi).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,i=1/tr.setFromMatrixColumn(t,0).length(),r=1/tr.setFromMatrixColumn(t,1).length(),s=1/tr.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*s,e[9]=n[9]*s,e[10]=n[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,i=t.y,r=t.z,s=Math.cos(n),a=Math.sin(n),o=Math.cos(i),l=Math.sin(i),c=Math.cos(r),h=Math.sin(r);if("XYZ"===t.order){const t=s*c,n=s*h,i=a*c,r=a*h;e[0]=o*c,e[4]=-o*h,e[8]=l,e[1]=n+i*l,e[5]=t-r*l,e[9]=-a*o,e[2]=r-t*l,e[6]=i+n*l,e[10]=s*o}else if("YXZ"===t.order){const t=o*c,n=o*h,i=l*c,r=l*h;e[0]=t+r*a,e[4]=i*a-n,e[8]=s*l,e[1]=s*h,e[5]=s*c,e[9]=-a,e[2]=n*a-i,e[6]=r+t*a,e[10]=s*o}else if("ZXY"===t.order){const t=o*c,n=o*h,i=l*c,r=l*h;e[0]=t-r*a,e[4]=-s*h,e[8]=i+n*a,e[1]=n+i*a,e[5]=s*c,e[9]=r-t*a,e[2]=-s*l,e[6]=a,e[10]=s*o}else if("ZYX"===t.order){const t=s*c,n=s*h,i=a*c,r=a*h;e[0]=o*c,e[4]=i*l-n,e[8]=t*l+r,e[1]=o*h,e[5]=r*l+t,e[9]=n*l-i,e[2]=-l,e[6]=a*o,e[10]=s*o}else if("YZX"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*c,e[4]=r-t*h,e[8]=i*h+n,e[1]=h,e[5]=s*c,e[9]=-a*c,e[2]=-l*c,e[6]=n*h+i,e[10]=t-r*h}else if("XZY"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*c,e[4]=-h,e[8]=l*c,e[1]=t*h+r,e[5]=s*c,e[9]=n*h-i,e[2]=i*h-n,e[6]=a*c,e[10]=r*h+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(nr,t,ir)}lookAt(t,e,n){const i=this.elements;return ar.subVectors(t,e),0===ar.lengthSq()&&(ar.z=1),ar.normalize(),rr.crossVectors(n,ar),0===rr.lengthSq()&&(1===Math.abs(n.z)?ar.x+=1e-4:ar.z+=1e-4,ar.normalize(),rr.crossVectors(n,ar)),rr.normalize(),sr.crossVectors(ar,rr),i[0]=rr.x,i[4]=sr.x,i[8]=ar.x,i[1]=rr.y,i[5]=sr.y,i[9]=ar.y,i[2]=rr.z,i[6]=sr.z,i[10]=ar.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[4],o=n[8],l=n[12],c=n[1],h=n[5],u=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],_=n[7],y=n[11],x=n[15],M=i[0],S=i[4],b=i[8],E=i[12],T=i[1],w=i[5],A=i[9],R=i[13],C=i[2],L=i[6],P=i[10],I=i[14],U=i[3],D=i[7],N=i[11],O=i[15];return r[0]=s*M+a*T+o*C+l*U,r[4]=s*S+a*w+o*L+l*D,r[8]=s*b+a*A+o*P+l*N,r[12]=s*E+a*R+o*I+l*O,r[1]=c*M+h*T+u*C+d*U,r[5]=c*S+h*w+u*L+d*D,r[9]=c*b+h*A+u*P+d*N,r[13]=c*E+h*R+u*I+d*O,r[2]=p*M+f*T+m*C+g*U,r[6]=p*S+f*w+m*L+g*D,r[10]=p*b+f*A+m*P+g*N,r[14]=p*E+f*R+m*I+g*O,r[3]=v*M+_*T+y*C+x*U,r[7]=v*S+_*w+y*L+x*D,r[11]=v*b+_*A+y*P+x*N,r[15]=v*E+_*R+y*I+x*O,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],s=t[1],a=t[5],o=t[9],l=t[13],c=t[2],h=t[6],u=t[10],d=t[14];return t[3]*(+r*o*h-i*l*h-r*a*u+n*l*u+i*a*d-n*o*d)+t[7]*(+e*o*d-e*l*u+r*s*u-i*s*d+i*l*c-r*o*c)+t[11]*(+e*l*h-e*a*d-r*s*h+n*s*d+r*a*c-n*l*c)+t[15]*(-i*a*c-e*o*h+e*a*u+i*s*h-n*s*u+n*o*c)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8],h=t[9],u=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15],v=h*m*l-f*u*l+f*o*d-a*m*d-h*o*g+a*u*g,_=p*u*l-c*m*l-p*o*d+s*m*d+c*o*g-s*u*g,y=c*f*l-p*h*l+p*a*d-s*f*d-c*a*g+s*h*g,x=p*h*o-c*f*o-p*a*u+s*f*u+c*a*m-s*h*m,M=e*v+n*_+i*y+r*x;if(0===M)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/M;return t[0]=v*S,t[1]=(f*u*r-h*m*r-f*i*d+n*m*d+h*i*g-n*u*g)*S,t[2]=(a*m*r-f*o*r+f*i*l-n*m*l-a*i*g+n*o*g)*S,t[3]=(h*o*r-a*u*r-h*i*l+n*u*l+a*i*d-n*o*d)*S,t[4]=_*S,t[5]=(c*m*r-p*u*r+p*i*d-e*m*d-c*i*g+e*u*g)*S,t[6]=(p*o*r-s*m*r-p*i*l+e*m*l+s*i*g-e*o*g)*S,t[7]=(s*u*r-c*o*r+c*i*l-e*u*l-s*i*d+e*o*d)*S,t[8]=y*S,t[9]=(p*h*r-c*f*r-p*n*d+e*f*d+c*n*g-e*h*g)*S,t[10]=(s*f*r-p*a*r+p*n*l-e*f*l-s*n*g+e*a*g)*S,t[11]=(c*a*r-s*h*r-c*n*l+e*h*l+s*n*d-e*a*d)*S,t[12]=x*S,t[13]=(c*f*i-p*h*i+p*n*u-e*f*u-c*n*m+e*h*m)*S,t[14]=(p*a*i-s*f*i-p*n*o+e*f*o+s*n*m-e*a*m)*S,t[15]=(s*h*i-c*a*i+c*n*o-e*h*o-s*n*u+e*a*u)*S,this}scale(t){const e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,s=t.x,a=t.y,o=t.z,l=r*s,c=r*a;return this.set(l*s+n,l*a-i*o,l*o+i*a,0,l*a+i*o,c*a+n,c*o-i*s,0,l*o-i*a,c*o+i*s,r*o*o+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,r,s){return this.set(1,n,r,0,t,1,s,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){const i=this.elements,r=e._x,s=e._y,a=e._z,o=e._w,l=r+r,c=s+s,h=a+a,u=r*l,d=r*c,p=r*h,f=s*c,m=s*h,g=a*h,v=o*l,_=o*c,y=o*h,x=n.x,M=n.y,S=n.z;return i[0]=(1-(f+g))*x,i[1]=(d+y)*x,i[2]=(p-_)*x,i[3]=0,i[4]=(d-y)*M,i[5]=(1-(u+g))*M,i[6]=(m+v)*M,i[7]=0,i[8]=(p+_)*S,i[9]=(m-v)*S,i[10]=(1-(u+f))*S,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.elements;let r=tr.set(i[0],i[1],i[2]).length();const s=tr.set(i[4],i[5],i[6]).length(),a=tr.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],er.copy(this);const o=1/r,l=1/s,c=1/a;return er.elements[0]*=o,er.elements[1]*=o,er.elements[2]*=o,er.elements[4]*=l,er.elements[5]*=l,er.elements[6]*=l,er.elements[8]*=c,er.elements[9]*=c,er.elements[10]*=c,e.setFromRotationMatrix(er),n.x=r,n.y=s,n.z=a,this}makePerspective(t,e,n,i,r,s,a=2e3){const o=this.elements,l=2*r/(e-t),c=2*r/(n-i),h=(e+t)/(e-t),u=(n+i)/(n-i);let d,p;if(a===An)d=-(s+r)/(s-r),p=-2*s*r/(s-r);else{if(a!==Rn)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);d=-s/(s-r),p=-s*r/(s-r)}return o[0]=l,o[4]=0,o[8]=h,o[12]=0,o[1]=0,o[5]=c,o[9]=u,o[13]=0,o[2]=0,o[6]=0,o[10]=d,o[14]=p,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(t,e,n,i,r,s,a=2e3){const o=this.elements,l=1/(e-t),c=1/(n-i),h=1/(s-r),u=(e+t)*l,d=(n+i)*c;let p,f;if(a===An)p=(s+r)*h,f=-2*h;else{if(a!==Rn)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);p=r*h,f=-1*h}return o[0]=2*l,o[4]=0,o[8]=0,o[12]=-u,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-d,o[2]=0,o[6]=0,o[10]=f,o[14]=-p,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<16;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const tr=new bi,er=new Qi,nr=new bi(0,0,0),ir=new bi(1,1,1),rr=new bi,sr=new bi,ar=new bi,or=new Qi,lr=new Si;class cr{constructor(t=0,e=0,n=0,i=cr.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const i=t.elements,r=i[0],s=i[4],a=i[8],o=i[1],l=i[5],c=i[9],h=i[2],u=i[6],d=i[10];switch(e){case"XYZ":this._y=Math.asin(Nn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Nn(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(Nn(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-Nn(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(Nn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-Nn(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return or.makeRotationFromQuaternion(t),this.setFromRotationMatrix(or,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return lr.setFromEuler(this),this.setFromQuaternion(lr,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}cr.DEFAULT_ORDER="XYZ";class hr{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let t=0;t1){for(let t=0;t0&&(n=n.concat(r))}return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(gr,t,vr),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(gr,_r,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,i=e.length;n0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const n=e.shapes;if(Array.isArray(n))for(let e=0,i=n.length;e0){i.children=[];for(let e=0;e0){i.animations=[];for(let e=0;e0&&(n.geometries=e),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),a.length>0&&(n.images=a),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),h.length>0&&(n.nodes=h)}return n.object=i,n;function s(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(t,e,n,i,r){Tr.subVectors(i,e),wr.subVectors(n,e),Ar.subVectors(t,e);const s=Tr.dot(Tr),a=Tr.dot(wr),o=Tr.dot(Ar),l=wr.dot(wr),c=wr.dot(Ar),h=s*l-a*a;if(0===h)return r.set(-2,-1,-1);const u=1/h,d=(l*o-a*c)*u,p=(s*c-a*o)*u;return r.set(1-d-p,p,d)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,Rr),Rr.x>=0&&Rr.y>=0&&Rr.x+Rr.y<=1}static getUV(t,e,n,i,r,s,a,o){return!1===Nr&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Nr=!0),this.getInterpolation(t,e,n,i,r,s,a,o)}static getInterpolation(t,e,n,i,r,s,a,o){return this.getBarycoord(t,e,n,i,Rr),o.setScalar(0),o.addScaledVector(r,Rr.x),o.addScaledVector(s,Rr.y),o.addScaledVector(a,Rr.z),o}static isFrontFacing(t,e,n,i){return Tr.subVectors(n,e),wr.subVectors(t,e),Tr.cross(wr).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Tr.subVectors(this.c,this.b),wr.subVectors(this.a,this.b),.5*Tr.cross(wr).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Or.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Or.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,i,r){return!1===Nr&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Nr=!0),Or.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}getInterpolation(t,e,n,i,r){return Or.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}containsPoint(t){return Or.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Or.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,i=this.b,r=this.c;let s,a;Cr.subVectors(i,n),Lr.subVectors(r,n),Ir.subVectors(t,n);const o=Cr.dot(Ir),l=Lr.dot(Ir);if(o<=0&&l<=0)return e.copy(n);Ur.subVectors(t,i);const c=Cr.dot(Ur),h=Lr.dot(Ur);if(c>=0&&h<=c)return e.copy(i);const u=o*h-c*l;if(u<=0&&o>=0&&c<=0)return s=o/(o-c),e.copy(n).addScaledVector(Cr,s);Dr.subVectors(t,r);const d=Cr.dot(Dr),p=Lr.dot(Dr);if(p>=0&&d<=p)return e.copy(r);const f=d*l-o*p;if(f<=0&&l>=0&&p<=0)return a=l/(l-p),e.copy(n).addScaledVector(Lr,a);const m=c*p-d*h;if(m<=0&&h-c>=0&&d-p>=0)return Pr.subVectors(r,i),a=(h-c)/(h-c+(d-p)),e.copy(i).addScaledVector(Pr,a);const g=1/(m+f+u);return s=f*g,a=u*g,e.copy(n).addScaledVector(Cr,s).addScaledVector(Lr,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let Fr=0;class zr extends Cn{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Fr++}),this.uuid=Dn(),this.name="",this.type="Material",this.blending=1,this.side=u,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=M,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Xe,this.stencilZFail=Xe,this.stencilZPass=Xe,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n:console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`)}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function i(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),this.side!==u&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=this.alphaHash),!0===this.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.forceSinglePass&&(n.forceSinglePass=this.forceSinglePass),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),e){const e=i(t.textures),r=i(t.images);e.length>0&&(n.textures=e),r.length>0&&(n.images=r)}return n}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let i=0;i!==t;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}const Br={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Hr={h:0,s:0,l:0},kr={h:0,s:0,l:0};function Vr(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}class Gr{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(void 0===e&&void 0===n){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=He){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,ai.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=ai.workingColorSpace){return this.r=t,this.g=e,this.b=n,ai.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=ai.workingColorSpace){if(t=On(t,1),e=Nn(e,0,1),n=Nn(n,0,1),0===e)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=Vr(r,i,t+1/3),this.g=Vr(r,i,t),this.b=Vr(r,i,t-1/3)}return ai.toWorkingColorSpace(this,i),this}setStyle(t,e=He){function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const s=i[1],a=i[2];switch(s){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const n=i[1],r=n.length;if(3===r)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,e);if(6===r)return this.setHex(parseInt(n,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=He){const n=Br[t.toLowerCase()];return void 0!==n?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=ti(t.r),this.g=ti(t.g),this.b=ti(t.b),this}copyLinearToSRGB(t){return this.r=ei(t.r),this.g=ei(t.g),this.b=ei(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=He){return ai.fromWorkingColorSpace(Wr.copy(this),t),65536*Math.round(Nn(255*Wr.r,0,255))+256*Math.round(Nn(255*Wr.g,0,255))+Math.round(Nn(255*Wr.b,0,255))}getHexString(t=He){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=ai.workingColorSpace){ai.fromWorkingColorSpace(Wr.copy(this),e);const n=Wr.r,i=Wr.g,r=Wr.b,s=Math.max(n,i,r),a=Math.min(n,i,r);let o,l;const c=(a+s)/2;if(a===s)o=0,l=0;else{const t=s-a;switch(l=c<=.5?t/(s+a):t/(2-s-a),s){case n:o=(i-r)/t+(i>-e-14,i[256|t]=1024>>-e-14|32768,r[t]=-e-1,r[256|t]=-e-1):e<=15?(i[t]=e+15<<10,i[256|t]=e+15<<10|32768,r[t]=13,r[256|t]=13):e<128?(i[t]=31744,i[256|t]=64512,r[t]=24,r[256|t]=24):(i[t]=31744,i[256|t]=64512,r[t]=13,r[256|t]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,n=0;for(;0==(8388608&e);)e<<=1,n-=8388608;e&=-8388609,n+=947912704,s[t]=e|n}for(let t=1024;t<2048;++t)s[t]=939524096+(t-1024<<13);for(let t=1;t<31;++t)a[t]=t<<23;a[31]=1199570944,a[32]=2147483648;for(let t=33;t<63;++t)a[t]=2147483648+(t-32<<23);a[63]=3347054592;for(let t=1;t<64;++t)32!==t&&(o[t]=1024);return{floatView:e,uint32View:n,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:o}}function Yr(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=Nn(t,-65504,65504),jr.floatView[0]=t;const e=jr.uint32View[0],n=e>>23&511;return jr.baseTable[n]+((8388607&e)>>jr.shiftTable[n])}function Zr(t){const e=t>>10;return jr.uint32View[0]=jr.mantissaTable[jr.offsetTable[e]+(1023&t)]+jr.exponentTable[e],jr.floatView[0]}const Jr={toHalfFloat:Yr,fromHalfFloat:Zr},Kr=new bi,$r=new Wn;class Qr{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=n,this.usage=mn,this.updateRange={offset:0,count:-1},this.gpuType=Tt,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const i=n[e];t.data.attributes[e]=i.toJSON(t.data)}const i={};let r=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],s=[];for(let e=0,i=n.length;e0&&(i[e]=s,r=!0)}r&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return null!==a&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const i=t.attributes;for(const t in i){const n=i[t];this.setAttribute(t,n.clone(e))}const r=t.morphAttributes;for(const t in r){const n=[],i=r[t];for(let t=0,r=i.length;t0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t(t.far-t.near)**2)return}_s.copy(r).invert(),ys.copy(t.ray).applyMatrix4(_s),null!==n.boundingBox&&!1===ys.intersectsBox(n.boundingBox)||this._computeIntersections(t,e,ys)}}_computeIntersections(t,e,n){let i;const r=this.geometry,s=this.material,a=r.index,o=r.attributes.position,l=r.attributes.uv,c=r.attributes.uv1,h=r.attributes.normal,u=r.groups,d=r.drawRange;if(null!==a)if(Array.isArray(s))for(let r=0,o=u.length;rn.far?null:{distance:c,point:Ds.clone(),object:t}}(t,e,n,i,Ss,bs,Es,Us);if(h){r&&(As.fromBufferAttribute(r,o),Rs.fromBufferAttribute(r,l),Cs.fromBufferAttribute(r,c),h.uv=Or.getInterpolation(Us,Ss,bs,Es,As,Rs,Cs,new Wn)),s&&(As.fromBufferAttribute(s,o),Rs.fromBufferAttribute(s,l),Cs.fromBufferAttribute(s,c),h.uv1=Or.getInterpolation(Us,Ss,bs,Es,As,Rs,Cs,new Wn),h.uv2=h.uv1),a&&(Ls.fromBufferAttribute(a,o),Ps.fromBufferAttribute(a,l),Is.fromBufferAttribute(a,c),h.normal=Or.getInterpolation(Us,Ss,bs,Es,Ls,Ps,Is,new bi),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const t={a:o,b:l,c:c,normal:new bi,materialIndex:0};Or.getNormal(Ss,bs,Es,t.normal),h.face=t}return h}class Fs extends vs{constructor(t=1,e=1,n=1,i=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:s};const a=this;i=Math.floor(i),r=Math.floor(r),s=Math.floor(s);const o=[],l=[],c=[],h=[];let u=0,d=0;function p(t,e,n,i,r,s,p,f,m,g,v){const _=s/m,y=p/g,x=s/2,M=p/2,S=f/2,b=m+1,E=g+1;let T=0,w=0;const A=new bi;for(let s=0;s0?1:-1,c.push(A.x,A.y,A.z),h.push(o/m),h.push(1-s/g),T+=1}}for(let t=0;t0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const t in this.extensions)!0===this.extensions[t]&&(n[t]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class Gs extends Er{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Qi,this.projectionMatrix=new Qi,this.projectionMatrixInverse=new Qi,this.coordinateSystem=An}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}class Ws extends Gs{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*Un*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*In*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*Un*Math.atan(Math.tan(.5*In*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,n,i,r,s){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*In*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,a=s.fullHeight;r+=s.offsetX*i/t,e-=s.offsetY*n/a,i*=s.width/t,n*=s.height/a}const a=this.filmOffset;0!==a&&(r+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const Xs=-90;class js extends Er{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null;const i=new Ws(Xs,1,t,e);i.layers=this.layers,this.add(i);const r=new Ws(Xs,1,t,e);r.layers=this.layers,this.add(r);const s=new Ws(Xs,1,t,e);s.layers=this.layers,this.add(s);const a=new Ws(Xs,1,t,e);a.layers=this.layers,this.add(a);const o=new Ws(Xs,1,t,e);o.layers=this.layers,this.add(o);const l=new Ws(Xs,1,t,e);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,i,r,s,a,o]=e;for(const t of e)this.remove(t);if(t===An)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else{if(t!==Rn)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1)}for(const t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();const n=this.renderTarget;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[i,r,s,a,o,l]=this.children,c=t.getRenderTarget(),h=t.xr.enabled;t.xr.enabled=!1;const u=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,i),t.setRenderTarget(n,1),t.render(e,r),t.setRenderTarget(n,2),t.render(e,s),t.setRenderTarget(n,3),t.render(e,a),t.setRenderTarget(n,4),t.render(e,o),n.texture.generateMipmaps=u,t.setRenderTarget(n,5),t.render(e,l),t.setRenderTarget(c),t.xr.enabled=h,n.texture.needsPMREMUpdate=!0}}class qs extends pi{constructor(t,e,n,i,r,s,a,o,l,c){super(t=void 0!==t?t:[],e=void 0!==e?e:et,n,i,r,s,a,o,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class Ys extends gi{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];void 0!==e.encoding&&(Qn("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),e.colorSpace=e.encoding===De?He:Be),this.texture=new qs(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:ft}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},i=new Fs(5,5,5),r=new Vs({name:"CubemapFromEquirect",uniforms:zs(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:d,blending:0});r.uniforms.tEquirect.value=e;const s=new Ns(i,r),a=e.minFilter;e.minFilter===vt&&(e.minFilter=ft);return new js(1,10,this).update(t,s),e.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(t,e,n,i){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,n,i);t.setRenderTarget(r)}}const Zs=new bi,Js=new bi,Ks=new Xn;class $s{constructor(t=new bi(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const i=Zs.subVectors(n,e).cross(Js.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta(Zs),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||Ks.getNormalMatrix(t),i=this.coplanarPoint(Zs).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Qs=new Wi,ta=new bi;class ea{constructor(t=new $s,e=new $s,n=new $s,i=new $s,r=new $s,s=new $s){this.planes=[t,e,n,i,r,s]}set(t,e,n,i,r,s){const a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[5].copy(s),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=2e3){const n=this.planes,i=t.elements,r=i[0],s=i[1],a=i[2],o=i[3],l=i[4],c=i[5],h=i[6],u=i[7],d=i[8],p=i[9],f=i[10],m=i[11],g=i[12],v=i[13],_=i[14],y=i[15];if(n[0].setComponents(o-r,u-l,m-d,y-g).normalize(),n[1].setComponents(o+r,u+l,m+d,y+g).normalize(),n[2].setComponents(o+s,u+c,m+p,y+v).normalize(),n[3].setComponents(o-s,u-c,m-p,y-v).normalize(),n[4].setComponents(o-a,u-h,m-f,y-_).normalize(),e===An)n[5].setComponents(o+a,u+h,m+f,y+_).normalize();else{if(e!==Rn)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);n[5].setComponents(a,h,f,_).normalize()}return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),Qs.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),Qs.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Qs)}intersectsSprite(t){return Qs.center.set(0,0,0),Qs.radius=.7071067811865476,Qs.applyMatrix4(t.matrixWorld),this.intersectsSphere(Qs)}intersectsSphere(t){const e=this.planes,n=t.center,i=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(n)0?t.max.x:t.min.x,ta.y=i.normal.y>0?t.max.y:t.min.y,ta.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(ta)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function na(){let t=null,e=!1,n=null,i=null;function r(e,s){n(e,s),i=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==n&&(i=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function ia(t,e){const n=e.isWebGL2,i=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),i.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const n=i.get(e);n&&(t.deleteBuffer(n.buffer),i.delete(e))},update:function(e,r){if(e.isGLBufferAttribute){const t=i.get(e);return void((!t||t.version 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tanisotropyV /= material.anisotropy;\n\tmaterial.anisotropy = saturate( material.anisotropy );\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x - tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x + tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometry.viewDir, geometry.normal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},aa={common:{diffuse:{value:new Gr(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Xn},alphaMap:{value:null},alphaMapTransform:{value:new Xn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Xn}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Xn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Xn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Xn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Xn},normalScale:{value:new Wn(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Xn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Xn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Xn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Xn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Gr(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Gr(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Xn},alphaTest:{value:0},uvTransform:{value:new Xn}},sprite:{diffuse:{value:new Gr(16777215)},opacity:{value:1},center:{value:new Wn(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Xn},alphaMap:{value:null},alphaMapTransform:{value:new Xn},alphaTest:{value:0}}},oa={basic:{uniforms:Bs([aa.common,aa.specularmap,aa.envmap,aa.aomap,aa.lightmap,aa.fog]),vertexShader:sa.meshbasic_vert,fragmentShader:sa.meshbasic_frag},lambert:{uniforms:Bs([aa.common,aa.specularmap,aa.envmap,aa.aomap,aa.lightmap,aa.emissivemap,aa.bumpmap,aa.normalmap,aa.displacementmap,aa.fog,aa.lights,{emissive:{value:new Gr(0)}}]),vertexShader:sa.meshlambert_vert,fragmentShader:sa.meshlambert_frag},phong:{uniforms:Bs([aa.common,aa.specularmap,aa.envmap,aa.aomap,aa.lightmap,aa.emissivemap,aa.bumpmap,aa.normalmap,aa.displacementmap,aa.fog,aa.lights,{emissive:{value:new Gr(0)},specular:{value:new Gr(1118481)},shininess:{value:30}}]),vertexShader:sa.meshphong_vert,fragmentShader:sa.meshphong_frag},standard:{uniforms:Bs([aa.common,aa.envmap,aa.aomap,aa.lightmap,aa.emissivemap,aa.bumpmap,aa.normalmap,aa.displacementmap,aa.roughnessmap,aa.metalnessmap,aa.fog,aa.lights,{emissive:{value:new Gr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:sa.meshphysical_vert,fragmentShader:sa.meshphysical_frag},toon:{uniforms:Bs([aa.common,aa.aomap,aa.lightmap,aa.emissivemap,aa.bumpmap,aa.normalmap,aa.displacementmap,aa.gradientmap,aa.fog,aa.lights,{emissive:{value:new Gr(0)}}]),vertexShader:sa.meshtoon_vert,fragmentShader:sa.meshtoon_frag},matcap:{uniforms:Bs([aa.common,aa.bumpmap,aa.normalmap,aa.displacementmap,aa.fog,{matcap:{value:null}}]),vertexShader:sa.meshmatcap_vert,fragmentShader:sa.meshmatcap_frag},points:{uniforms:Bs([aa.points,aa.fog]),vertexShader:sa.points_vert,fragmentShader:sa.points_frag},dashed:{uniforms:Bs([aa.common,aa.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:sa.linedashed_vert,fragmentShader:sa.linedashed_frag},depth:{uniforms:Bs([aa.common,aa.displacementmap]),vertexShader:sa.depth_vert,fragmentShader:sa.depth_frag},normal:{uniforms:Bs([aa.common,aa.bumpmap,aa.normalmap,aa.displacementmap,{opacity:{value:1}}]),vertexShader:sa.meshnormal_vert,fragmentShader:sa.meshnormal_frag},sprite:{uniforms:Bs([aa.sprite,aa.fog]),vertexShader:sa.sprite_vert,fragmentShader:sa.sprite_frag},background:{uniforms:{uvTransform:{value:new Xn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:sa.background_vert,fragmentShader:sa.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:sa.backgroundCube_vert,fragmentShader:sa.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:sa.cube_vert,fragmentShader:sa.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:sa.equirect_vert,fragmentShader:sa.equirect_frag},distanceRGBA:{uniforms:Bs([aa.common,aa.displacementmap,{referencePosition:{value:new bi},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:sa.distanceRGBA_vert,fragmentShader:sa.distanceRGBA_frag},shadow:{uniforms:Bs([aa.lights,aa.fog,{color:{value:new Gr(0)},opacity:{value:1}}]),vertexShader:sa.shadow_vert,fragmentShader:sa.shadow_frag}};oa.physical={uniforms:Bs([oa.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Xn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Xn},clearcoatNormalScale:{value:new Wn(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Xn},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Xn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Xn},sheen:{value:0},sheenColor:{value:new Gr(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Xn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Xn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Xn},transmissionSamplerSize:{value:new Wn},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Xn},attenuationDistance:{value:0},attenuationColor:{value:new Gr(0)},specularColor:{value:new Gr(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Xn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Xn},anisotropyVector:{value:new Wn},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Xn}}]),vertexShader:sa.meshphysical_vert,fragmentShader:sa.meshphysical_frag};const la={r:0,b:0,g:0};function ca(t,e,n,i,r,s,a){const o=new Gr(0);let l,c,h=!0===s?0:1,p=null,f=0,m=null;function g(e,n){e.getRGB(la,Hs(t)),i.buffers.color.setClear(la.r,la.g,la.b,n,a)}return{getClearColor:function(){return o},setClearColor:function(t,e=1){o.set(t),h=e,g(o,h)},getClearAlpha:function(){return h},setClearAlpha:function(t){h=t,g(o,h)},render:function(s,v){let _=!1,y=!0===v.isScene?v.background:null;if(y&&y.isTexture){y=(v.backgroundBlurriness>0?n:e).get(y)}null===y?g(o,h):y&&y.isColor&&(g(y,1),_=!0);const x=t.xr.getEnvironmentBlendMode();"additive"===x?i.buffers.color.setClear(0,0,0,1,a):"alpha-blend"===x&&i.buffers.color.setClear(0,0,0,0,a),(t.autoClear||_)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),y&&(y.isCubeTexture||y.mapping===st)?(void 0===c&&(c=new Ns(new Fs(1,1,1),new Vs({name:"BackgroundCubeMaterial",uniforms:zs(oa.backgroundCube.uniforms),vertexShader:oa.backgroundCube.vertexShader,fragmentShader:oa.backgroundCube.fragmentShader,side:d,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(c)),c.material.uniforms.envMap.value=y,c.material.uniforms.flipEnvMap.value=y.isCubeTexture&&!1===y.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.toneMapped=y.colorSpace!==He,p===y&&f===y.version&&m===t.toneMapping||(c.material.needsUpdate=!0,p=y,f=y.version,m=t.toneMapping),c.layers.enableAll(),s.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(void 0===l&&(l=new Ns(new ra(2,2),new Vs({name:"BackgroundMaterial",uniforms:zs(oa.background.uniforms),vertexShader:oa.background.vertexShader,fragmentShader:oa.background.fragmentShader,side:u,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l)),l.material.uniforms.t2D.value=y,l.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,l.material.toneMapped=y.colorSpace!==He,!0===y.matrixAutoUpdate&&y.updateMatrix(),l.material.uniforms.uvTransform.value.copy(y.matrix),p===y&&f===y.version&&m===t.toneMapping||(l.material.needsUpdate=!0,p=y,f=y.version,m=t.toneMapping),l.layers.enableAll(),s.unshift(l,l.geometry,l.material,0,0,null))}}}function ha(t,e,n,i){const r=t.getParameter(t.MAX_VERTEX_ATTRIBS),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),a=i.isWebGL2||null!==s,o={},l=p(null);let c=l,h=!1;function u(e){return i.isWebGL2?t.bindVertexArray(e):s.bindVertexArrayOES(e)}function d(e){return i.isWebGL2?t.deleteVertexArray(e):s.deleteVertexArrayOES(e)}function p(t){const e=[],n=[],i=[];for(let t=0;t=0){const n=r[e];let i=s[e];if(void 0===i&&("instanceMatrix"===e&&t.instanceMatrix&&(i=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(i=t.instanceColor)),void 0===n)return!0;if(n.attribute!==i)return!0;if(i&&n.data!==i.data)return!0;a++}}return c.attributesNum!==a||c.index!==i}(r,y,d,x),M&&function(t,e,n,i){const r={},s=e.attributes;let a=0;const o=n.getAttributes();for(const e in o){if(o[e].location>=0){let n=s[e];void 0===n&&("instanceMatrix"===e&&t.instanceMatrix&&(n=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(n=t.instanceColor));const i={};i.attribute=n,n&&n.data&&(i.data=n.data),r[e]=i,a++}}c.attributes=r,c.attributesNum=a,c.index=i}(r,y,d,x)}else{const t=!0===l.wireframe;c.geometry===y.id&&c.program===d.id&&c.wireframe===t||(c.geometry=y.id,c.program=d.id,c.wireframe=t,M=!0)}null!==x&&n.update(x,t.ELEMENT_ARRAY_BUFFER),(M||h)&&(h=!1,function(r,s,a,o){if(!1===i.isWebGL2&&(r.isInstancedMesh||o.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;f();const l=o.attributes,c=a.getAttributes(),h=s.defaultAttributeValues;for(const e in c){const s=c[e];if(s.location>=0){let a=l[e];if(void 0===a&&("instanceMatrix"===e&&r.instanceMatrix&&(a=r.instanceMatrix),"instanceColor"===e&&r.instanceColor&&(a=r.instanceColor)),void 0!==a){const e=a.normalized,l=a.itemSize,c=n.get(a);if(void 0===c)continue;const h=c.buffer,u=c.type,d=c.bytesPerElement,p=!0===i.isWebGL2&&(u===t.INT||u===t.UNSIGNED_INT||a.gpuType===bt);if(a.isInterleavedBufferAttribute){const n=a.data,i=n.stride,c=a.offset;if(n.isInstancedInterleavedBuffer){for(let t=0;t0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===t.constructor.name;let a=void 0!==n.precision?n.precision:"highp";const o=r(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);const l=s||e.has("WEBGL_draw_buffers"),c=!0===n.logarithmicDepthBuffer,h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=t.getParameter(t.MAX_TEXTURE_SIZE),p=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),f=t.getParameter(t.MAX_VERTEX_ATTRIBS),m=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),g=t.getParameter(t.MAX_VARYING_VECTORS),v=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),_=u>0,y=s||e.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===e.has("EXT_texture_filter_anisotropic")){const n=e.get("EXT_texture_filter_anisotropic");i=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:r,precision:a,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:_,floatFragmentTextures:y,floatVertexTextures:_&&y,maxSamples:s?t.getParameter(t.MAX_SAMPLES):0}}function pa(t){const e=this;let n=null,i=0,r=!1,s=!1;const a=new $s,o=new Xn,l={value:null,needsUpdate:!1};function c(t,n,i,r){const s=null!==t?t.length:0;let c=null;if(0!==s){if(c=l.value,!0!==r||null===c){const e=i+4*s,r=n.matrixWorldInverse;o.getNormalMatrix(r),(null===c||c.length0);e.numPlanes=i,e.numIntersection=0}();else{const t=s?0:i,e=4*t;let r=f.clippingState||null;l.value=r,r=c(u,o,e,h);for(let t=0;t!==e;++t)r[t]=n[t];f.clippingState=r,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=t}}}function fa(t){let e=new WeakMap;function n(t,e){return e===it?t.mapping=et:e===rt&&(t.mapping=nt),t}function i(t){const n=t.target;n.removeEventListener("dispose",i);const r=e.get(n);void 0!==r&&(e.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture&&!1===r.isRenderTargetTexture){const s=r.mapping;if(s===it||s===rt){if(e.has(r)){return n(e.get(r).texture,r.mapping)}{const s=r.image;if(s&&s.height>0){const a=new Ys(s.height/2);return a.fromEquirectangularTexture(t,r),e.set(r,a),r.addEventListener("dispose",i),n(a.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}class ma extends Gs{constructor(t=-1,e=1,n=1,i=-1,r=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=r,this.far=s,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,r,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=n-t,s=n+t,a=i+e,o=i-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,s=r+t*this.view.width,a-=e*this.view.offsetY,o=a-e*this.view.height}this.projectionMatrix.makeOrthographic(r,s,a,o,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}const ga=[.125,.215,.35,.446,.526,.582],va=20,_a=new ma,ya=new Gr;let xa=null;const Ma=(1+Math.sqrt(5))/2,Sa=1/Ma,ba=[new bi(1,1,1),new bi(-1,1,1),new bi(1,1,-1),new bi(-1,1,-1),new bi(0,Ma,Sa),new bi(0,Ma,-Sa),new bi(Sa,0,Ma),new bi(-Sa,0,Ma),new bi(Ma,Sa,0),new bi(-Ma,Sa,0)];class Ea{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){xa=this._renderer.getRenderTarget(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,n,i,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=Ra(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Aa(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;tt-4?o=ga[a-t+4-1]:0===a&&(o=0),i.push(o);const l=1/(s-2),c=-l,h=1+l,u=[c,c,h,c,h,h,c,c,h,h,c,h],d=6,p=6,f=3,m=2,g=1,v=new Float32Array(f*p*d),_=new Float32Array(m*p*d),y=new Float32Array(g*p*d);for(let t=0;t2?0:-1,i=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];v.set(i,f*p*t),_.set(u,m*p*t);const r=[t,t,t,t,t,t];y.set(r,g*p*t)}const x=new vs;x.setAttribute("position",new Qr(v,f)),x.setAttribute("uv",new Qr(_,m)),x.setAttribute("faceIndex",new Qr(y,g)),e.push(x),r>4&&r--}return{lodPlanes:e,sizeLods:n,sigmas:i}}(i)),this._blurMaterial=function(t,e,n){const i=new Float32Array(va),r=new bi(0,1,0),s=new Vs({name:"SphericalGaussianBlur",defines:{n:va,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:Ca(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1});return s}(i,t,e)}return i}_compileMaterial(t){const e=new Ns(this._lodPlanes[0],t);this._renderer.compile(e,_a)}_sceneToCubeUV(t,e,n,i){const r=new Ws(90,1,e,n),s=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],o=this._renderer,l=o.autoClear,c=o.toneMapping;o.getClearColor(ya),o.toneMapping=Y,o.autoClear=!1;const h=new Xr({name:"PMREM.Background",side:d,depthWrite:!1,depthTest:!1}),u=new Ns(new Fs,h);let p=!1;const f=t.background;f?f.isColor&&(h.color.copy(f),t.background=null,p=!0):(h.color.copy(ya),p=!0);for(let e=0;e<6;e++){const n=e%3;0===n?(r.up.set(0,s[e],0),r.lookAt(a[e],0,0)):1===n?(r.up.set(0,0,s[e]),r.lookAt(0,a[e],0)):(r.up.set(0,s[e],0),r.lookAt(0,0,a[e]));const l=this._cubeSize;wa(i,n*l,e>2?l:0,l,l),o.setRenderTarget(i),p&&o.render(u,r),o.render(t,r)}u.geometry.dispose(),u.material.dispose(),o.toneMapping=c,o.autoClear=l,t.background=f}_textureToCubeUV(t,e){const n=this._renderer,i=t.mapping===et||t.mapping===nt;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=Ra()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Aa());const r=i?this._cubemapMaterial:this._equirectMaterial,s=new Ns(this._lodPlanes[0],r);r.uniforms.envMap.value=t;const a=this._cubeSize;wa(e,0,0,3*a,2*a),n.setRenderTarget(e),n.render(s,_a)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;for(let e=1;eva&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let t=0;tv-4?i-v+4:0),4*(this._cubeSize-_),3*_,2*_),o.setRenderTarget(e),o.render(c,_a)}}function Ta(t,e,n){const i=new gi(t,e,n);return i.texture.mapping=st,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function wa(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function Aa(){return new Vs({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Ca(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Ra(){return new Vs({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ca(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Ca(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function La(t){let e=new WeakMap,n=null;function i(t){const n=t.target;n.removeEventListener("dispose",i);const r=e.get(n);void 0!==r&&(e.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){const s=r.mapping,a=s===it||s===rt,o=s===et||s===nt;if(a||o){if(r.isRenderTargetTexture&&!0===r.needsPMREMUpdate){r.needsPMREMUpdate=!1;let i=e.get(r);return null===n&&(n=new Ea(t)),i=a?n.fromEquirectangular(r,i):n.fromCubemap(r,i),e.set(r,i),i.texture}if(e.has(r))return e.get(r).texture;{const s=r.image;if(a&&s&&s.height>0||o&&s&&function(t){let e=0;const n=6;for(let i=0;ie.maxTextureSize&&(f=Math.ceil(p/e.maxTextureSize),p=e.maxTextureSize);const m=new Float32Array(p*f*4*r),g=new vi(m,p,f,r);g.type=Tt,g.needsUpdate=!0;const v=4*d;for(let e=0;e0)return t;const r=e*n;let s=Ga[r];if(void 0===s&&(s=new Float32Array(r),Ga[r]=s),0!==e){i.toArray(s,0);for(let i=1,r=0;i!==e;++i)r+=n,t[i].toArray(s,r)}return s}function Za(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n":" "} ${r}: ${n[t]}`)}return i.join("\n")}(t.getShaderSource(e),i)}return r}function qo(t,e){const n=function(t){switch(t){case ke:return["Linear","( value )"];case He:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),["Linear","( value )"]}}(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function Yo(t,e){let n;switch(e){case Z:n="Linear";break;case J:n="Reinhard";break;case K:n="OptimizedCineon";break;case $:n="ACESFilmic";break;case Q:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Zo(t){return""!==t}function Jo(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Ko(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const $o=/^[ \t]*#include +<([\w\d./]+)>/gm;function Qo(t){return t.replace($o,el)}const tl=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function el(t,e){let n=sa[e];if(void 0===n){const t=tl.get(e);if(void 0===t)throw new Error("Can not resolve #include <"+e+">");n=sa[t],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,t)}return Qo(n)}const nl=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function il(t){return t.replace(nl,rl)}function rl(t,e,n,i){let r="";for(let t=parseInt(e);t0&&(y+="\n"),x=[g,"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v].filter(Zo).join("\n"),x.length>0&&(x+="\n")):(y=[sl(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+p:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+u:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Zo).join("\n"),x=[g,sl(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+d:"",n.envMap?"#define "+p:"",n.envMap?"#define "+f:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+u:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Y?"#define TONE_MAPPING":"",n.toneMapping!==Y?sa.tonemapping_pars_fragment:"",n.toneMapping!==Y?Yo("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",sa.colorspace_pars_fragment,qo("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Zo).join("\n")),a=Qo(a),a=Jo(a,n),a=Ko(a,n),o=Qo(o),o=Jo(o,n),o=Ko(o,n),a=il(a),o=il(o),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(M="#version 300 es\n",y=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+y,x=["#define varying in",n.glslVersion===Tn?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===Tn?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+x);const S=M+y+a,b=M+x+o,E=Wo(r,r.VERTEX_SHADER,S),T=Wo(r,r.FRAGMENT_SHADER,b);if(r.attachShader(_,E),r.attachShader(_,T),void 0!==n.index0AttributeName?r.bindAttribLocation(_,0,n.index0AttributeName):!0===n.morphTargets&&r.bindAttribLocation(_,0,"position"),r.linkProgram(_),t.debug.checkShaderErrors){const e=r.getProgramInfoLog(_).trim(),n=r.getShaderInfoLog(E).trim(),i=r.getShaderInfoLog(T).trim();let s=!0,a=!0;if(!1===r.getProgramParameter(_,r.LINK_STATUS))if(s=!1,"function"==typeof t.debug.onShaderError)t.debug.onShaderError(r,_,E,T);else{const t=jo(r,E,"vertex"),n=jo(r,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(_,r.VALIDATE_STATUS)+"\n\nProgram Info Log: "+e+"\n"+t+"\n"+n)}else""!==e?console.warn("THREE.WebGLProgram: Program Info Log:",e):""!==n&&""!==i||(a=!1);a&&(this.diagnostics={runnable:s,programLog:e,vertexShader:{log:n,prefix:y},fragmentShader:{log:i,prefix:x}})}let w,A;return r.deleteShader(E),r.deleteShader(T),this.getUniforms=function(){return void 0===w&&(w=new Go(r,_)),w},this.getAttributes=function(){return void 0===A&&(A=function(t,e){const n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let r=0;r0,j=s.clearcoat>0,q=s.iridescence>0,Z=s.sheen>0,J=s.transmission>0,K=X&&!!s.anisotropyMap,$=j&&!!s.clearcoatMap,Q=j&&!!s.clearcoatNormalMap,tt=j&&!!s.clearcoatRoughnessMap,et=q&&!!s.iridescenceMap,nt=q&&!!s.iridescenceThicknessMap,it=Z&&!!s.sheenColorMap,rt=Z&&!!s.sheenRoughnessMap,at=!!s.specularMap,ot=!!s.specularColorMap,lt=!!s.specularIntensityMap,ct=J&&!!s.transmissionMap,ht=J&&!!s.thicknessMap,ut=!!s.gradientMap,dt=!!s.alphaMap,pt=s.alphaTest>0,ft=!!s.alphaHash,mt=!!s.extensions,gt=!!x.attributes.uv1,vt=!!x.attributes.uv2,_t=!!x.attributes.uv3;let yt=Y;return s.toneMapped&&(null!==I&&!0!==I.isXRRenderTarget||(yt=t.toneMapping)),{isWebGL2:h,shaderID:E,shaderType:s.type,shaderName:s.name,vertexShader:A,fragmentShader:R,defines:s.defines,customVertexShaderID:C,customFragmentShaderID:L,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:f,instancing:U,instancingColor:U&&null!==_.instanceColor,supportsVertexTextures:p,outputColorSpace:null===I?t.outputColorSpace:!0===I.isXRRenderTarget?I.texture.colorSpace:ke,map:D,matcap:N,envMap:O,envMapMode:O&&S.mapping,envMapCubeUVHeight:b,aoMap:F,lightMap:z,bumpMap:B,normalMap:H,displacementMap:p&&k,emissiveMap:V,normalMapObjectSpace:H&&1===s.normalMapType,normalMapTangentSpace:H&&0===s.normalMapType,metalnessMap:G,roughnessMap:W,anisotropy:X,anisotropyMap:K,clearcoat:j,clearcoatMap:$,clearcoatNormalMap:Q,clearcoatRoughnessMap:tt,iridescence:q,iridescenceMap:et,iridescenceThicknessMap:nt,sheen:Z,sheenColorMap:it,sheenRoughnessMap:rt,specularMap:at,specularColorMap:ot,specularIntensityMap:lt,transmission:J,transmissionMap:ct,thicknessMap:ht,gradientMap:ut,opaque:!1===s.transparent&&1===s.blending,alphaMap:dt,alphaTest:pt,alphaHash:ft,combine:s.combine,mapUv:D&&g(s.map.channel),aoMapUv:F&&g(s.aoMap.channel),lightMapUv:z&&g(s.lightMap.channel),bumpMapUv:B&&g(s.bumpMap.channel),normalMapUv:H&&g(s.normalMap.channel),displacementMapUv:k&&g(s.displacementMap.channel),emissiveMapUv:V&&g(s.emissiveMap.channel),metalnessMapUv:G&&g(s.metalnessMap.channel),roughnessMapUv:W&&g(s.roughnessMap.channel),anisotropyMapUv:K&&g(s.anisotropyMap.channel),clearcoatMapUv:$&&g(s.clearcoatMap.channel),clearcoatNormalMapUv:Q&&g(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:tt&&g(s.clearcoatRoughnessMap.channel),iridescenceMapUv:et&&g(s.iridescenceMap.channel),iridescenceThicknessMapUv:nt&&g(s.iridescenceThicknessMap.channel),sheenColorMapUv:it&&g(s.sheenColorMap.channel),sheenRoughnessMapUv:rt&&g(s.sheenRoughnessMap.channel),specularMapUv:at&&g(s.specularMap.channel),specularColorMapUv:ot&&g(s.specularColorMap.channel),specularIntensityMapUv:lt&&g(s.specularIntensityMap.channel),transmissionMapUv:ct&&g(s.transmissionMap.channel),thicknessMapUv:ht&&g(s.thicknessMap.channel),alphaMapUv:dt&&g(s.alphaMap.channel),vertexTangents:!!x.attributes.tangent&&(H||X),vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!x.attributes.color&&4===x.attributes.color.itemSize,vertexUv1s:gt,vertexUv2s:vt,vertexUv3s:_t,pointsUvs:!0===_.isPoints&&!!x.attributes.uv&&(D||dt),fog:!!y,useFog:!0===s.fog,fogExp2:y&&y.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:u,skinning:!0===_.isSkinnedMesh,morphTargets:void 0!==x.morphAttributes.position,morphNormals:void 0!==x.morphAttributes.normal,morphColors:void 0!==x.morphAttributes.color,morphTargetsCount:w,morphTextureStride:P,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&c.length>0,shadowMapType:t.shadowMap.type,toneMapping:yt,useLegacyLights:t._useLegacyLights,decodeVideoTexture:D&&!0===s.map.isVideoTexture&&s.map.colorSpace===He,premultipliedAlpha:s.premultipliedAlpha,doubleSided:2===s.side,flipSided:s.side===d,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:mt&&!0===s.extensions.derivatives,extensionFragDepth:mt&&!0===s.extensions.fragDepth,extensionDrawBuffers:mt&&!0===s.extensions.drawBuffers,extensionShaderTextureLOD:mt&&!0===s.extensions.shaderTextureLOD,rendererExtensionFragDepth:h||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||i.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.customVertexShaderID),n.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(!function(t,e){t.push(e.precision),t.push(e.outputColorSpace),t.push(e.envMapMode),t.push(e.envMapCubeUVHeight),t.push(e.mapUv),t.push(e.alphaMapUv),t.push(e.lightMapUv),t.push(e.aoMapUv),t.push(e.bumpMapUv),t.push(e.normalMapUv),t.push(e.displacementMapUv),t.push(e.emissiveMapUv),t.push(e.metalnessMapUv),t.push(e.roughnessMapUv),t.push(e.anisotropyMapUv),t.push(e.clearcoatMapUv),t.push(e.clearcoatNormalMapUv),t.push(e.clearcoatRoughnessMapUv),t.push(e.iridescenceMapUv),t.push(e.iridescenceThicknessMapUv),t.push(e.sheenColorMapUv),t.push(e.sheenRoughnessMapUv),t.push(e.specularMapUv),t.push(e.specularColorMapUv),t.push(e.specularIntensityMapUv),t.push(e.transmissionMapUv),t.push(e.thicknessMapUv),t.push(e.combine),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numSpotLightMaps),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.numSpotLightShadowsWithMaps),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}(n,e),function(t,e){o.disableAll(),e.isWebGL2&&o.enable(0);e.supportsVertexTextures&&o.enable(1);e.instancing&&o.enable(2);e.instancingColor&&o.enable(3);e.matcap&&o.enable(4);e.envMap&&o.enable(5);e.normalMapObjectSpace&&o.enable(6);e.normalMapTangentSpace&&o.enable(7);e.clearcoat&&o.enable(8);e.iridescence&&o.enable(9);e.alphaTest&&o.enable(10);e.vertexColors&&o.enable(11);e.vertexAlphas&&o.enable(12);e.vertexUv1s&&o.enable(13);e.vertexUv2s&&o.enable(14);e.vertexUv3s&&o.enable(15);e.vertexTangents&&o.enable(16);e.anisotropy&&o.enable(17);t.push(o.mask),o.disableAll(),e.fog&&o.enable(0);e.useFog&&o.enable(1);e.flatShading&&o.enable(2);e.logarithmicDepthBuffer&&o.enable(3);e.skinning&&o.enable(4);e.morphTargets&&o.enable(5);e.morphNormals&&o.enable(6);e.morphColors&&o.enable(7);e.premultipliedAlpha&&o.enable(8);e.shadowMapEnabled&&o.enable(9);e.useLegacyLights&&o.enable(10);e.doubleSided&&o.enable(11);e.flipSided&&o.enable(12);e.useDepthPacking&&o.enable(13);e.dithering&&o.enable(14);e.transmission&&o.enable(15);e.sheen&&o.enable(16);e.opaque&&o.enable(17);e.pointsUvs&&o.enable(18);e.decodeVideoTexture&&o.enable(19);t.push(o.mask)}(n,e),n.push(t.outputColorSpace)),n.push(e.customProgramCacheKey),n.join()},getUniforms:function(t){const e=m[t.type];let n;if(e){const t=oa[e];n=ks.clone(t.uniforms)}else n=t.uniforms;return n},acquireProgram:function(e,n){let i;for(let t=0,e=c.length;t0?i.push(h):!0===a.transparent?r.push(h):n.push(h)},unshift:function(t,e,a,o,l,c){const h=s(t,e,a,o,l,c);a.transmission>0?i.unshift(h):!0===a.transparent?r.unshift(h):n.unshift(h)},finish:function(){for(let n=e,i=t.length;n1&&n.sort(t||dl),i.length>1&&i.sort(e||pl),r.length>1&&r.sort(e||pl)}}}function ml(){let t=new WeakMap;return{get:function(e,n){const i=t.get(e);let r;return void 0===i?(r=new fl,t.set(e,[r])):n>=i.length?(r=new fl,i.push(r)):r=i[n],r},dispose:function(){t=new WeakMap}}}function gl(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new bi,color:new Gr};break;case"SpotLight":n={position:new bi,direction:new bi,color:new Gr,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new bi,color:new Gr,distance:0,decay:0};break;case"HemisphereLight":n={direction:new bi,skyColor:new Gr,groundColor:new Gr};break;case"RectAreaLight":n={color:new Gr,position:new bi,halfWidth:new bi,halfHeight:new bi}}return t[e.id]=n,n}}}let vl=0;function _l(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function yl(t,e){const n=new gl,i=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Wn};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Wn,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let t=0;t<9;t++)r.probe.push(new bi);const s=new bi,a=new Qi,o=new Qi;return{setup:function(s,a){let o=0,l=0,c=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let h=0,u=0,d=0,p=0,f=0,m=0,g=0,v=0,_=0,y=0;s.sort(_l);const x=!0===a?Math.PI:1;for(let t=0,e=s.length;t0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=aa.LTC_FLOAT_1,r.rectAreaLTC2=aa.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=aa.LTC_HALF_1,r.rectAreaLTC2=aa.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=o,r.ambient[1]=l,r.ambient[2]=c;const M=r.hash;M.directionalLength===h&&M.pointLength===u&&M.spotLength===d&&M.rectAreaLength===p&&M.hemiLength===f&&M.numDirectionalShadows===m&&M.numPointShadows===g&&M.numSpotShadows===v&&M.numSpotMaps===_||(r.directional.length=h,r.spot.length=d,r.rectArea.length=p,r.point.length=u,r.hemi.length=f,r.directionalShadow.length=m,r.directionalShadowMap.length=m,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=v,r.spotShadowMap.length=v,r.directionalShadowMatrix.length=m,r.pointShadowMatrix.length=g,r.spotLightMatrix.length=v+_-y,r.spotLightMap.length=_,r.numSpotLightShadowsWithMaps=y,M.directionalLength=h,M.pointLength=u,M.spotLength=d,M.rectAreaLength=p,M.hemiLength=f,M.numDirectionalShadows=m,M.numPointShadows=g,M.numSpotShadows=v,M.numSpotMaps=_,r.version=vl++)},setupView:function(t,e){let n=0,i=0,l=0,c=0,h=0;const u=e.matrixWorldInverse;for(let e=0,d=t.length;e=s.length?(a=new xl(t,e),s.push(a)):a=s[r],a},dispose:function(){n=new WeakMap}}}class Sl extends zr{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class bl extends zr{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}function El(t,e,n){let i=new ea;const r=new Wn,s=new Wn,a=new fi,o=new Sl({depthPacking:3201}),c=new bl,p={},f=n.maxTextureSize,m={[u]:d,[d]:u,2:2},g=new Vs({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Wn},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),v=g.clone();v.defines.HORIZONTAL_PASS=1;const _=new vs;_.setAttribute("position",new Qr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const y=new Ns(_,g),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=l;let M=this.type;function S(n,i){const s=e.update(y);g.defines.VSM_SAMPLES!==n.blurSamples&&(g.defines.VSM_SAMPLES=n.blurSamples,v.defines.VSM_SAMPLES=n.blurSamples,g.needsUpdate=!0,v.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new gi(r.x,r.y)),g.uniforms.shadow_pass.value=n.map.texture,g.uniforms.resolution.value=n.mapSize,g.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(i,null,s,g,y,null),v.uniforms.shadow_pass.value=n.mapPass.texture,v.uniforms.resolution.value=n.mapSize,v.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(i,null,s,v,y,null)}function b(e,n,i,r){let s=null;const a=!0===i.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(void 0!==a)s=a;else if(s=!0===i.isPointLight?c:o,t.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const t=s.uuid,e=n.uuid;let i=p[t];void 0===i&&(i={},p[t]=i);let r=i[e];void 0===r&&(r=s.clone(),i[e]=r),s=r}if(s.visible=n.visible,s.wireframe=n.wireframe,s.side=r===h?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:m[n.side],s.alphaMap=n.alphaMap,s.alphaTest=n.alphaTest,s.map=n.map,s.clipShadows=n.clipShadows,s.clippingPlanes=n.clippingPlanes,s.clipIntersection=n.clipIntersection,s.displacementMap=n.displacementMap,s.displacementScale=n.displacementScale,s.displacementBias=n.displacementBias,s.wireframeLinewidth=n.wireframeLinewidth,s.linewidth=n.linewidth,!0===i.isPointLight&&!0===s.isMeshDistanceMaterial){t.properties.get(s).light=i}return s}function E(n,r,s,a,o){if(!1===n.visible)return;if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&o===h)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const i=e.update(n),r=n.material;if(Array.isArray(r)){const e=i.groups;for(let l=0,c=e.length;lf||r.y>f)&&(r.x>f&&(s.x=Math.floor(f/g.x),r.x=s.x*g.x,u.mapSize.x=s.x),r.y>f&&(s.y=Math.floor(f/g.y),r.y=s.y*g.y,u.mapSize.y=s.y)),null===u.map||!0===p||!0===m){const t=this.type!==h?{minFilter:ct,magFilter:ct}:{};null!==u.map&&u.map.dispose(),u.map=new gi(r.x,r.y,t),u.map.texture.name=c.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const v=u.getViewportCount();for(let t=0;t=1):-1!==U.indexOf("OpenGL ES")&&(I=parseFloat(/^OpenGL ES (\d)/.exec(U)[1]),P=I>=2);let D=null,N={};const O=t.getParameter(t.SCISSOR_BOX),F=t.getParameter(t.VIEWPORT),z=(new fi).fromArray(O),B=(new fi).fromArray(F);function H(e,n,r,s){const a=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let o=0;oi||t.height>i)&&(r=i/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const i=e?Hn:Math.floor,s=i(r*t.width),a=i(r*t.height);void 0===m&&(m=_(s,a));const o=n?_(s,a):m;o.width=s,o.height=a;return o.getContext("2d").drawImage(t,0,0,s,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+a+")."),o}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function x(t){return zn(t.width)&&zn(t.height)}function M(t,e){return t.generateMipmaps&&e&&t.minFilter!==ct&&t.minFilter!==ft}function S(e){t.generateMipmap(e)}function b(n,i,r,s,a=!1){if(!1===o)return i;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let l=i;return i===t.RED&&(r===t.FLOAT&&(l=t.R32F),r===t.HALF_FLOAT&&(l=t.R16F),r===t.UNSIGNED_BYTE&&(l=t.R8)),i===t.RED_INTEGER&&(r===t.UNSIGNED_BYTE&&(l=t.R8UI),r===t.UNSIGNED_SHORT&&(l=t.R16UI),r===t.UNSIGNED_INT&&(l=t.R32UI),r===t.BYTE&&(l=t.R8I),r===t.SHORT&&(l=t.R16I),r===t.INT&&(l=t.R32I)),i===t.RG&&(r===t.FLOAT&&(l=t.RG32F),r===t.HALF_FLOAT&&(l=t.RG16F),r===t.UNSIGNED_BYTE&&(l=t.RG8)),i===t.RGBA&&(r===t.FLOAT&&(l=t.RGBA32F),r===t.HALF_FLOAT&&(l=t.RGBA16F),r===t.UNSIGNED_BYTE&&(l=s===He&&!1===a?t.SRGB8_ALPHA8:t.RGBA8),r===t.UNSIGNED_SHORT_4_4_4_4&&(l=t.RGBA4),r===t.UNSIGNED_SHORT_5_5_5_1&&(l=t.RGB5_A1)),l!==t.R16F&&l!==t.R32F&&l!==t.RG16F&&l!==t.RG32F&&l!==t.RGBA16F&&l!==t.RGBA32F||e.get("EXT_color_buffer_float"),l}function E(t,e,n){return!0===M(t,n)||t.isFramebufferTexture&&t.minFilter!==ct&&t.minFilter!==ft?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function T(e){return e===ct||e===ht||e===dt?t.NEAREST:t.LINEAR}function w(t){const e=t.target;e.removeEventListener("dispose",w),function(t){const e=i.get(t);if(void 0===e.__webglInit)return;const n=t.source,r=g.get(n);if(r){const i=r[e.__cacheKey];i.usedTimes--,0===i.usedTimes&&R(t),0===Object.keys(r).length&&g.delete(n)}i.remove(t)}(e),e.isVideoTexture&&f.delete(e)}function A(e){const n=e.target;n.removeEventListener("dispose",A),function(e){const n=e.texture,r=i.get(e),s=i.get(n);void 0!==s.__webglTexture&&(t.deleteTexture(s.__webglTexture),a.memory.textures--);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++){if(Array.isArray(r.__webglFramebuffer[e]))for(let n=0;n0&&s.__version!==e.version){const t=e.image;if(null===t)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==t.complete)return void O(s,e,r);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(t.TEXTURE_2D,s.__webglTexture,t.TEXTURE0+r)}const P={[at]:t.REPEAT,[ot]:t.CLAMP_TO_EDGE,[lt]:t.MIRRORED_REPEAT},I={[ct]:t.NEAREST,[ht]:t.NEAREST_MIPMAP_NEAREST,[dt]:t.NEAREST_MIPMAP_LINEAR,[ft]:t.LINEAR,[mt]:t.LINEAR_MIPMAP_NEAREST,[vt]:t.LINEAR_MIPMAP_LINEAR},U={512:t.NEVER,519:t.ALWAYS,513:t.LESS,515:t.LEQUAL,514:t.EQUAL,518:t.GEQUAL,516:t.GREATER,517:t.NOTEQUAL};function D(n,s,a){if(a?(t.texParameteri(n,t.TEXTURE_WRAP_S,P[s.wrapS]),t.texParameteri(n,t.TEXTURE_WRAP_T,P[s.wrapT]),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,P[s.wrapR]),t.texParameteri(n,t.TEXTURE_MAG_FILTER,I[s.magFilter]),t.texParameteri(n,t.TEXTURE_MIN_FILTER,I[s.minFilter])):(t.texParameteri(n,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(n,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),s.wrapS===ot&&s.wrapT===ot||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,t.TEXTURE_MAG_FILTER,T(s.magFilter)),t.texParameteri(n,t.TEXTURE_MIN_FILTER,T(s.minFilter)),s.minFilter!==ct&&s.minFilter!==ft&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),s.compareFunction&&(t.texParameteri(n,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(n,t.TEXTURE_COMPARE_FUNC,U[s.compareFunction])),!0===e.has("EXT_texture_filter_anisotropic")){const a=e.get("EXT_texture_filter_anisotropic");if(s.magFilter===ct)return;if(s.minFilter!==dt&&s.minFilter!==vt)return;if(s.type===Tt&&!1===e.has("OES_texture_float_linear"))return;if(!1===o&&s.type===wt&&!1===e.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||i.get(s).__currentAnisotropy)&&(t.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),i.get(s).__currentAnisotropy=s.anisotropy)}}function N(e,n){let i=!1;void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",w));const r=n.source;let s=g.get(r);void 0===s&&(s={},g.set(r,s));const o=function(t){const e=[];return e.push(t.wrapS),e.push(t.wrapT),e.push(t.wrapR||0),e.push(t.magFilter),e.push(t.minFilter),e.push(t.anisotropy),e.push(t.internalFormat),e.push(t.format),e.push(t.type),e.push(t.generateMipmaps),e.push(t.premultiplyAlpha),e.push(t.flipY),e.push(t.unpackAlignment),e.push(t.colorSpace),e.join()}(n);if(o!==e.__cacheKey){void 0===s[o]&&(s[o]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,i=!0),s[o].usedTimes++;const r=s[e.__cacheKey];void 0!==r&&(s[e.__cacheKey].usedTimes--,0===r.usedTimes&&R(n)),e.__cacheKey=o,e.__webglTexture=s[o].texture}return i}function O(e,r,a){let l=t.TEXTURE_2D;(r.isDataArrayTexture||r.isCompressedArrayTexture)&&(l=t.TEXTURE_2D_ARRAY),r.isData3DTexture&&(l=t.TEXTURE_3D);const c=N(e,r),u=r.source;n.bindTexture(l,e.__webglTexture,t.TEXTURE0+a);const d=i.get(u);if(u.version!==d.__version||!0===c){n.activeTexture(t.TEXTURE0+a),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,r.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,r.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE);const e=function(t){return!o&&(t.wrapS!==ot||t.wrapT!==ot||t.minFilter!==ct&&t.minFilter!==ft)}(r)&&!1===x(r.image);let i=y(r.image,e,!1,h);i=V(r,i);const p=x(i)||o,f=s.convert(r.format,r.colorSpace);let m,g=s.convert(r.type),v=b(r.internalFormat,f,g,r.colorSpace,r.isVideoTexture);D(l,r,p);const _=r.mipmaps,T=o&&!0!==r.isVideoTexture,w=void 0===d.__version||!0===c,A=E(r,i,p);if(r.isDepthTexture)v=t.DEPTH_COMPONENT,o?v=r.type===Tt?t.DEPTH_COMPONENT32F:r.type===Et?t.DEPTH_COMPONENT24:r.type===Ct?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT16:r.type===Tt&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===Dt&&v===t.DEPTH_COMPONENT&&r.type!==St&&r.type!==Et&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=Et,g=s.convert(r.type)),r.format===Nt&&v===t.DEPTH_COMPONENT&&(v=t.DEPTH_STENCIL,r.type!==Ct&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=Ct,g=s.convert(r.type))),w&&(T?n.texStorage2D(t.TEXTURE_2D,1,v,i.width,i.height):n.texImage2D(t.TEXTURE_2D,0,v,i.width,i.height,0,f,g,null));else if(r.isDataTexture)if(_.length>0&&p){T&&w&&n.texStorage2D(t.TEXTURE_2D,A,v,_[0].width,_[0].height);for(let e=0,i=_.length;e>=1,r>>=1}}else if(_.length>0&&p){T&&w&&n.texStorage2D(t.TEXTURE_2D,A,v,_[0].width,_[0].height);for(let e=0,i=_.length;e>c),i=Math.max(1,r.height>>c);l===t.TEXTURE_3D||l===t.TEXTURE_2D_ARRAY?n.texImage3D(l,c,p,e,i,r.depth,0,h,u,null):n.texImage2D(l,c,p,e,i,0,h,u,null)}n.bindFramebuffer(t.FRAMEBUFFER,e),k(r)?d.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,o,l,i.get(a).__webglTexture,0,H(r)):(l===t.TEXTURE_2D||l>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,o,l,i.get(a).__webglTexture,c),n.bindFramebuffer(t.FRAMEBUFFER,null)}function z(e,n,i){if(t.bindRenderbuffer(t.RENDERBUFFER,e),n.depthBuffer&&!n.stencilBuffer){let r=t.DEPTH_COMPONENT16;if(i||k(n)){const e=n.depthTexture;e&&e.isDepthTexture&&(e.type===Tt?r=t.DEPTH_COMPONENT32F:e.type===Et&&(r=t.DEPTH_COMPONENT24));const i=H(n);k(n)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,i,r,n.width,n.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,i,r,n.width,n.height)}else t.renderbufferStorage(t.RENDERBUFFER,r,n.width,n.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)}else if(n.depthBuffer&&n.stencilBuffer){const r=H(n);i&&!1===k(n)?t.renderbufferStorageMultisample(t.RENDERBUFFER,r,t.DEPTH24_STENCIL8,n.width,n.height):k(n)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,r,t.DEPTH24_STENCIL8,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)}else{const e=!0===n.isWebGLMultipleRenderTargets?n.texture:[n.texture];for(let r=0;r0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function V(t,n){const i=t.colorSpace,r=t.format,s=t.type;return!0===t.isCompressedTexture||!0===t.isVideoTexture||t.format===wn||i!==ke&&i!==Be&&(i===He||i===Ve?!1===o?!0===e.has("EXT_sRGB")&&r===Pt?(t.format=wn,t.minFilter=ft,t.generateMipmaps=!1):n=li.sRGBToLinear(n):r===Pt&&s===yt||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",i)),n}this.allocateTextureUnit=function(){const t=C;return t>=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),C+=1,t},this.resetTextureUnits=function(){C=0},this.setTexture2D=L,this.setTexture2DArray=function(e,r){const s=i.get(e);e.version>0&&s.__version!==e.version?O(s,e,r):n.bindTexture(t.TEXTURE_2D_ARRAY,s.__webglTexture,t.TEXTURE0+r)},this.setTexture3D=function(e,r){const s=i.get(e);e.version>0&&s.__version!==e.version?O(s,e,r):n.bindTexture(t.TEXTURE_3D,s.__webglTexture,t.TEXTURE0+r)},this.setTextureCube=function(e,r){const a=i.get(e);e.version>0&&a.__version!==e.version?function(e,r,a){if(6!==r.image.length)return;const l=N(e,r),h=r.source;n.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+a);const u=i.get(h);if(h.version!==u.__version||!0===l){n.activeTexture(t.TEXTURE0+a),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,r.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,r.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE);const e=r.isCompressedTexture||r.image[0].isCompressedTexture,i=r.image[0]&&r.image[0].isDataTexture,d=[];for(let t=0;t<6;t++)d[t]=e||i?i?r.image[t].image:r.image[t]:y(r.image[t],!1,!0,c),d[t]=V(r,d[t]);const p=d[0],f=x(p)||o,m=s.convert(r.format,r.colorSpace),g=s.convert(r.type),v=b(r.internalFormat,m,g,r.colorSpace),_=o&&!0!==r.isVideoTexture,T=void 0===u.__version||!0===l;let w,A=E(r,p,f);if(D(t.TEXTURE_CUBE_MAP,r,f),e){_&&T&&n.texStorage2D(t.TEXTURE_CUBE_MAP,A,v,p.width,p.height);for(let e=0;e<6;e++){w=d[e].mipmaps;for(let i=0;i0&&A++,n.texStorage2D(t.TEXTURE_CUBE_MAP,A,v,d[0].width,d[0].height));for(let e=0;e<6;e++)if(i){_?n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,d[e].width,d[e].height,m,g,d[e].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,v,d[e].width,d[e].height,0,m,g,d[e].data);for(let i=0;i0){c.__webglFramebuffer[e]=[];for(let n=0;n0){c.__webglFramebuffer=[];for(let e=0;e0&&!1===k(e)){const i=d?l:[l];c.__webglMultisampledFramebuffer=t.createFramebuffer(),c.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,c.__webglMultisampledFramebuffer);for(let n=0;n0)for(let i=0;i0)for(let n=0;n0&&!1===k(e)){const r=e.isWebGLMultipleRenderTargets?e.texture:[e.texture],s=e.width,a=e.height;let o=t.COLOR_BUFFER_BIT;const l=[],c=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,h=i.get(e),u=!0===e.isWebGLMultipleRenderTargets;if(u)for(let e=0;eo+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&a<=o-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==o&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1));null!==a&&(i=e.getPose(t.targetRaySpace,n),null===i&&null!==r&&(i=r),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Ll)))}return null!==a&&(a.visible=null!==i),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==s),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){const n=new Cl;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}class Il extends pi{constructor(t,e,n,i,r,s,a,o,l,c){if((c=void 0!==c?c:Dt)!==Dt&&c!==Nt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===Dt&&(n=Et),void 0===n&&c===Nt&&(n=Ct),super(null,i,r,s,a,o,c,n,l),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=void 0!==a?a:ct,this.minFilter=void 0!==o?o:ct,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return null!==this.compareFunction&&(e.compareFunction=this.compareFunction),e}}class Ul extends Cn{constructor(t,e){super();const n=this;let i=null,r=1,s=null,a="local-floor",o=1,l=null,c=null,h=null,u=null,d=null,p=null;const f=e.getContextAttributes();let m=null,g=null;const v=[],_=[],y=new Ws;y.layers.enable(1),y.viewport=new fi;const x=new Ws;x.layers.enable(2),x.viewport=new fi;const M=[y,x],S=new Rl;S.layers.enable(1),S.layers.enable(2);let b=null,E=null;function T(t){const e=_.indexOf(t.inputSource);if(-1===e)return;const n=v[e];void 0!==n&&(n.update(t.inputSource,t.frame,l||s),n.dispatchEvent({type:t.type,data:t.inputSource}))}function w(){i.removeEventListener("select",T),i.removeEventListener("selectstart",T),i.removeEventListener("selectend",T),i.removeEventListener("squeeze",T),i.removeEventListener("squeezestart",T),i.removeEventListener("squeezeend",T),i.removeEventListener("end",w),i.removeEventListener("inputsourceschange",A);for(let t=0;t=0&&(_[i]=null,v[i].disconnect(n))}for(let e=0;e=_.length){_.push(n),i=t;break}if(null===_[t]){_[t]=n,i=t;break}}if(-1===i)break}const r=v[i];r&&r.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=v[t];return void 0===e&&(e=new Pl,v[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=v[t];return void 0===e&&(e=new Pl,v[t]=e),e.getGripSpace()},this.getHand=function(t){let e=v[t];return void 0===e&&(e=new Pl,v[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){r=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){a=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||s},this.setReferenceSpace=function(t){l=t},this.getBaseLayer=function(){return null!==u?u:d},this.getBinding=function(){return h},this.getFrame=function(){return p},this.getSession=function(){return i},this.setSession=async function(c){if(i=c,null!==i){if(m=t.getRenderTarget(),i.addEventListener("select",T),i.addEventListener("selectstart",T),i.addEventListener("selectend",T),i.addEventListener("squeeze",T),i.addEventListener("squeezestart",T),i.addEventListener("squeezeend",T),i.addEventListener("end",w),i.addEventListener("inputsourceschange",A),!0!==f.xrCompatible&&await e.makeXRCompatible(),void 0===i.renderState.layers||!1===t.capabilities.isWebGL2){const n={antialias:void 0!==i.renderState.layers||f.antialias,alpha:!0,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:r};d=new XRWebGLLayer(i,e,n),i.updateRenderState({baseLayer:d}),g=new gi(d.framebufferWidth,d.framebufferHeight,{format:Pt,type:yt,colorSpace:t.outputColorSpace,stencilBuffer:f.stencil})}else{let n=null,s=null,a=null;f.depth&&(a=f.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,n=f.stencil?Nt:Dt,s=f.stencil?Ct:Et);const o={colorFormat:e.RGBA8,depthFormat:a,scaleFactor:r};h=new XRWebGLBinding(i,e),u=h.createProjectionLayer(o),i.updateRenderState({layers:[u]}),g=new gi(u.textureWidth,u.textureHeight,{format:Pt,type:yt,depthTexture:new Il(u.textureWidth,u.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:f.stencil,colorSpace:t.outputColorSpace,samples:f.antialias?4:0});t.properties.get(g).__ignoreDepthValues=u.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(o),l=null,s=await i.requestReferenceSpace(a),I.setContext(i),I.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode};const R=new bi,C=new bi;function L(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCamera=function(t){if(null===i)return;S.near=x.near=y.near=t.near,S.far=x.far=y.far=t.far,b===S.near&&E===S.far||(i.updateRenderState({depthNear:S.near,depthFar:S.far}),b=S.near,E=S.far);const e=t.parent,n=S.cameras;L(S,e);for(let t=0;t0&&(i.alphaTest.value=r.alphaTest);const s=e.get(r).envMap;if(s&&(i.envMap.value=s,i.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,i.reflectivity.value=r.reflectivity,i.ior.value=r.ior,i.refractionRatio.value=r.refractionRatio),r.lightMap){i.lightMap.value=r.lightMap;const e=!0===t._useLegacyLights?Math.PI:1;i.lightMapIntensity.value=r.lightMapIntensity*e,n(r.lightMap,i.lightMapTransform)}r.aoMap&&(i.aoMap.value=r.aoMap,i.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,i.aoMapTransform))}return{refreshFogUniforms:function(e,n){n.color.getRGB(e.fogColor.value,Hs(t)),n.isFog?(e.fogNear.value=n.near,e.fogFar.value=n.far):n.isFogExp2&&(e.fogDensity.value=n.density)},refreshMaterialUniforms:function(t,r,s,a,o){r.isMeshBasicMaterial||r.isMeshLambertMaterial?i(t,r):r.isMeshToonMaterial?(i(t,r),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,r)):r.isMeshPhongMaterial?(i(t,r),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,r)):r.isMeshStandardMaterial?(i(t,r),function(t,i){t.metalness.value=i.metalness,i.metalnessMap&&(t.metalnessMap.value=i.metalnessMap,n(i.metalnessMap,t.metalnessMapTransform));t.roughness.value=i.roughness,i.roughnessMap&&(t.roughnessMap.value=i.roughnessMap,n(i.roughnessMap,t.roughnessMapTransform));const r=e.get(i).envMap;r&&(t.envMapIntensity.value=i.envMapIntensity)}(t,r),r.isMeshPhysicalMaterial&&function(t,e,i){t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap,n(e.sheenColorMap,t.sheenColorMapTransform)),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap,n(e.sheenRoughnessMap,t.sheenRoughnessMapTransform)));e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap,n(e.clearcoatMap,t.clearcoatMapTransform)),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap,n(e.clearcoatRoughnessMap,t.clearcoatRoughnessMapTransform)),e.clearcoatNormalMap&&(t.clearcoatNormalMap.value=e.clearcoatNormalMap,n(e.clearcoatNormalMap,t.clearcoatNormalMapTransform),t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),e.side===d&&t.clearcoatNormalScale.value.negate()));e.iridescence>0&&(t.iridescence.value=e.iridescence,t.iridescenceIOR.value=e.iridescenceIOR,t.iridescenceThicknessMinimum.value=e.iridescenceThicknessRange[0],t.iridescenceThicknessMaximum.value=e.iridescenceThicknessRange[1],e.iridescenceMap&&(t.iridescenceMap.value=e.iridescenceMap,n(e.iridescenceMap,t.iridescenceMapTransform)),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap,n(e.iridescenceThicknessMap,t.iridescenceThicknessMapTransform)));e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=i.texture,t.transmissionSamplerSize.value.set(i.width,i.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap,n(e.transmissionMap,t.transmissionMapTransform)),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap,n(e.thicknessMap,t.thicknessMapTransform)),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor));e.anisotropy>0&&(t.anisotropyVector.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation)),e.anisotropyMap&&(t.anisotropyMap.value=e.anisotropyMap,n(e.anisotropyMap,t.anisotropyMapTransform)));t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap,n(e.specularColorMap,t.specularColorMapTransform));e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap,n(e.specularIntensityMap,t.specularIntensityMapTransform))}(t,r,o)):r.isMeshMatcapMaterial?(i(t,r),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,r)):r.isMeshDepthMaterial?i(t,r):r.isMeshDistanceMaterial?(i(t,r),function(t,n){const i=e.get(n).light;t.referencePosition.value.setFromMatrixPosition(i.matrixWorld),t.nearDistance.value=i.shadow.camera.near,t.farDistance.value=i.shadow.camera.far}(t,r)):r.isMeshNormalMaterial?i(t,r):r.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform))}(t,r),r.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,r)):r.isPointsMaterial?function(t,e,i,r){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*r,e.map&&(t.map.value=e.map,n(e.map,t.uvTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,r,s,a):r.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,r):r.isShadowMaterial?(t.color.value.copy(r.color),t.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function Nl(t,e,n,i){let r={},s={},a=[];const o=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(t,e,n){const i=t.value;if(void 0===n[e]){if("number"==typeof i)n[e]=i;else{const t=Array.isArray(i)?i:[i],r=[];for(let e=0;e0){r=n%i;0!==r&&i-r-a.boundary<0&&(n+=i-r,s.__offset=n)}n+=a.storage}r=n%i,r>0&&(n+=i-r);t.__size=n,t.__cache={}}(n),d=function(e){const n=function(){for(let t=0;t0),u=!!n.morphAttributes.position,d=!!n.morphAttributes.normal,p=!!n.morphAttributes.color;let f=Y;i.toneMapped&&(null!==T&&!0!==T.isXRRenderTarget||(f=M.toneMapping));const m=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,g=void 0!==m?m.length:0,v=et.get(i),y=_.state.lights;if(!0===V&&(!0===G||t!==A)){const e=t===A&&i.id===w;dt.setState(i,t,e)}let x=!1;i.version===v.__version?v.needsLights&&v.lightsStateVersion!==y.state.version||v.outputColorSpace!==o||r.isInstancedMesh&&!1===v.instancing?x=!0:r.isInstancedMesh||!0!==v.instancing?r.isSkinnedMesh&&!1===v.skinning?x=!0:r.isSkinnedMesh||!0!==v.skinning?r.isInstancedMesh&&!0===v.instancingColor&&null===r.instanceColor||r.isInstancedMesh&&!1===v.instancingColor&&null!==r.instanceColor||v.envMap!==l||!0===i.fog&&v.fog!==s?x=!0:void 0===v.numClippingPlanes||v.numClippingPlanes===dt.numPlanes&&v.numIntersection===dt.numIntersection?(v.vertexAlphas!==c||v.vertexTangents!==h||v.morphTargets!==u||v.morphNormals!==d||v.morphColors!==p||v.toneMapping!==f||!0===$.isWebGL2&&v.morphTargetsCount!==g)&&(x=!0):x=!0:x=!0:x=!0:(x=!0,v.__version=i.version);let S=v.currentProgram;!0===x&&(S=Jt(i,e,r));let b=!1,E=!1,R=!1;const C=S.getUniforms(),L=v.uniforms;Q.useProgram(S.program)&&(b=!0,E=!0,R=!0);i.id!==w&&(w=i.id,E=!0);if(b||A!==t){C.setValue(Lt,"projectionMatrix",t.projectionMatrix),C.setValue(Lt,"viewMatrix",t.matrixWorldInverse);const e=C.map.cameraPosition;void 0!==e&&e.setValue(Lt,q.setFromMatrixPosition(t.matrixWorld)),$.logarithmicDepthBuffer&&C.setValue(Lt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&C.setValue(Lt,"isOrthographic",!0===t.isOrthographicCamera),A!==t&&(A=t,E=!0,R=!0)}if(r.isSkinnedMesh){C.setOptional(Lt,r,"bindMatrix"),C.setOptional(Lt,r,"bindMatrixInverse");const t=r.skeleton;t&&($.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),C.setValue(Lt,"boneTexture",t.boneTexture,nt),C.setValue(Lt,"boneTextureSize",t.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const P=n.morphAttributes;(void 0!==P.position||void 0!==P.normal||void 0!==P.color&&!0===$.isWebGL2)&&mt.update(r,n,S);(E||v.receiveShadow!==r.receiveShadow)&&(v.receiveShadow=r.receiveShadow,C.setValue(Lt,"receiveShadow",r.receiveShadow));i.isMeshGouraudMaterial&&null!==i.envMap&&(L.envMap.value=l,L.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);E&&(C.setValue(Lt,"toneMappingExposure",M.toneMappingExposure),v.needsLights&&(U=R,(I=L).ambientLightColor.needsUpdate=U,I.lightProbe.needsUpdate=U,I.directionalLights.needsUpdate=U,I.directionalLightShadows.needsUpdate=U,I.pointLights.needsUpdate=U,I.pointLightShadows.needsUpdate=U,I.spotLights.needsUpdate=U,I.spotLightShadows.needsUpdate=U,I.rectAreaLights.needsUpdate=U,I.hemisphereLights.needsUpdate=U),s&&!0===i.fog&&ct.refreshFogUniforms(L,s),ct.refreshMaterialUniforms(L,i,N,D,W),Go.upload(Lt,v.uniformsList,L,nt));var I,U;i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(Go.upload(Lt,v.uniformsList,L,nt),i.uniformsNeedUpdate=!1);i.isSpriteMaterial&&C.setValue(Lt,"center",r.center);if(C.setValue(Lt,"modelViewMatrix",r.modelViewMatrix),C.setValue(Lt,"normalMatrix",r.normalMatrix),C.setValue(Lt,"modelMatrix",r.matrixWorld),i.isShaderMaterial||i.isRawShaderMaterial){const t=i.uniformsGroups;for(let e=0,n=t.length;e0&&function(t,e,n,i){const r=$.isWebGL2;null===W&&(W=new gi(1,1,{generateMipmaps:!0,type:K.has("EXT_color_buffer_half_float")?wt:yt,minFilter:vt,samples:r?4:0}));M.getDrawingBufferSize(j),r?W.setSize(j.x,j.y):W.setSize(Hn(j.x),Hn(j.y));const s=M.getRenderTarget();M.setRenderTarget(W),M.getClearColor(P),I=M.getClearAlpha(),I<1&&M.setClearColor(16777215,.5);M.clear();const a=M.toneMapping;M.toneMapping=Y,Yt(t,n,i),nt.updateMultisampleRenderTarget(W),nt.updateRenderTargetMipmap(W);let o=!1;for(let t=0,r=e.length;t0&&Yt(r,e,n),s.length>0&&Yt(s,e,n),a.length>0&&Yt(a,e,n),Q.buffers.depth.setTest(!0),Q.buffers.depth.setMask(!0),Q.buffers.color.setMask(!0),Q.setPolygonOffset(!1)}function Yt(t,e,n){const i=!0===e.isScene?e.overrideMaterial:null;for(let r=0,s=t.length;r0?x[x.length-1]:null,y.pop(),v=y.length>0?y[y.length-1]:null},this.getActiveCubeFace=function(){return b},this.getActiveMipmapLevel=function(){return E},this.getRenderTarget=function(){return T},this.setRenderTargetTextures=function(t,e,n){et.get(t.texture).__webglTexture=e,et.get(t.depthTexture).__webglTexture=n;const i=et.get(t);i.__hasExternalTextures=!0,i.__hasExternalTextures&&(i.__autoAllocateDepthBuffer=void 0===n,i.__autoAllocateDepthBuffer||!0===K.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(t,e){const n=et.get(t);n.__webglFramebuffer=e,n.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,n=0){T=t,b=e,E=n;let i=!0,r=null,s=!1,a=!1;if(t){const o=et.get(t);void 0!==o.__useDefaultFramebuffer?(Q.bindFramebuffer(Lt.FRAMEBUFFER,null),i=!1):void 0===o.__webglFramebuffer?nt.setupRenderTarget(t):o.__hasExternalTextures&&nt.rebindTextures(t,et.get(t.texture).__webglTexture,et.get(t.depthTexture).__webglTexture);const l=t.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(a=!0);const c=et.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=Array.isArray(c[e])?c[e][n]:c[e],s=!0):r=$.isWebGL2&&t.samples>0&&!1===nt.useMultisampledRTT(t)?et.get(t).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,R.copy(t.viewport),C.copy(t.scissor),L=t.scissorTest}else R.copy(z).multiplyScalar(N).floor(),C.copy(B).multiplyScalar(N).floor(),L=H;if(Q.bindFramebuffer(Lt.FRAMEBUFFER,r)&&$.drawBuffers&&i&&Q.drawBuffers(t,r),Q.viewport(R),Q.scissor(C),Q.setScissorTest(L),s){const i=et.get(t.texture);Lt.framebufferTexture2D(Lt.FRAMEBUFFER,Lt.COLOR_ATTACHMENT0,Lt.TEXTURE_CUBE_MAP_POSITIVE_X+e,i.__webglTexture,n)}else if(a){const i=et.get(t.texture),r=e||0;Lt.framebufferTextureLayer(Lt.FRAMEBUFFER,Lt.COLOR_ATTACHMENT0,i.__webglTexture,n||0,r)}w=-1},this.readRenderTargetPixels=function(t,e,n,i,r,s,a){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=et.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){Q.bindFramebuffer(Lt.FRAMEBUFFER,o);try{const a=t.texture,o=a.format,l=a.type;if(o!==Pt&&xt.convert(o)!==Lt.getParameter(Lt.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===wt&&(K.has("EXT_color_buffer_half_float")||$.isWebGL2&&K.has("EXT_color_buffer_float"));if(!(l===yt||xt.convert(l)===Lt.getParameter(Lt.IMPLEMENTATION_COLOR_READ_TYPE)||l===Tt&&($.isWebGL2||K.has("OES_texture_float")||K.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&Lt.readPixels(e,n,i,r,xt.convert(o),xt.convert(l),s)}finally{const t=null!==T?et.get(T).__webglFramebuffer:null;Q.bindFramebuffer(Lt.FRAMEBUFFER,t)}}},this.copyFramebufferToTexture=function(t,e,n=0){const i=Math.pow(2,-n),r=Math.floor(e.image.width*i),s=Math.floor(e.image.height*i);nt.setTexture2D(e,0),Lt.copyTexSubImage2D(Lt.TEXTURE_2D,n,0,0,t.x,t.y,r,s),Q.unbindTexture()},this.copyTextureToTexture=function(t,e,n,i=0){const r=e.image.width,s=e.image.height,a=xt.convert(n.format),o=xt.convert(n.type);nt.setTexture2D(n,0),Lt.pixelStorei(Lt.UNPACK_FLIP_Y_WEBGL,n.flipY),Lt.pixelStorei(Lt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),Lt.pixelStorei(Lt.UNPACK_ALIGNMENT,n.unpackAlignment),e.isDataTexture?Lt.texSubImage2D(Lt.TEXTURE_2D,i,t.x,t.y,r,s,a,o,e.image.data):e.isCompressedTexture?Lt.compressedTexSubImage2D(Lt.TEXTURE_2D,i,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data):Lt.texSubImage2D(Lt.TEXTURE_2D,i,t.x,t.y,a,o,e.image),0===i&&n.generateMipmaps&&Lt.generateMipmap(Lt.TEXTURE_2D),Q.unbindTexture()},this.copyTextureToTexture3D=function(t,e,n,i,r=0){if(M.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=t.max.x-t.min.x+1,a=t.max.y-t.min.y+1,o=t.max.z-t.min.z+1,l=xt.convert(i.format),c=xt.convert(i.type);let h;if(i.isData3DTexture)nt.setTexture3D(i,0),h=Lt.TEXTURE_3D;else{if(!i.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");nt.setTexture2DArray(i,0),h=Lt.TEXTURE_2D_ARRAY}Lt.pixelStorei(Lt.UNPACK_FLIP_Y_WEBGL,i.flipY),Lt.pixelStorei(Lt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),Lt.pixelStorei(Lt.UNPACK_ALIGNMENT,i.unpackAlignment);const u=Lt.getParameter(Lt.UNPACK_ROW_LENGTH),d=Lt.getParameter(Lt.UNPACK_IMAGE_HEIGHT),p=Lt.getParameter(Lt.UNPACK_SKIP_PIXELS),f=Lt.getParameter(Lt.UNPACK_SKIP_ROWS),m=Lt.getParameter(Lt.UNPACK_SKIP_IMAGES),g=n.isCompressedTexture?n.mipmaps[0]:n.image;Lt.pixelStorei(Lt.UNPACK_ROW_LENGTH,g.width),Lt.pixelStorei(Lt.UNPACK_IMAGE_HEIGHT,g.height),Lt.pixelStorei(Lt.UNPACK_SKIP_PIXELS,t.min.x),Lt.pixelStorei(Lt.UNPACK_SKIP_ROWS,t.min.y),Lt.pixelStorei(Lt.UNPACK_SKIP_IMAGES,t.min.z),n.isDataTexture||n.isData3DTexture?Lt.texSubImage3D(h,r,e.x,e.y,e.z,s,a,o,l,c,g.data):n.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Lt.compressedTexSubImage3D(h,r,e.x,e.y,e.z,s,a,o,l,g.data)):Lt.texSubImage3D(h,r,e.x,e.y,e.z,s,a,o,l,c,g),Lt.pixelStorei(Lt.UNPACK_ROW_LENGTH,u),Lt.pixelStorei(Lt.UNPACK_IMAGE_HEIGHT,d),Lt.pixelStorei(Lt.UNPACK_SKIP_PIXELS,p),Lt.pixelStorei(Lt.UNPACK_SKIP_ROWS,f),Lt.pixelStorei(Lt.UNPACK_SKIP_IMAGES,m),0===r&&i.generateMipmaps&&Lt.generateMipmap(h),Q.unbindTexture()},this.initTexture=function(t){t.isCubeTexture?nt.setTextureCube(t,0):t.isData3DTexture?nt.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?nt.setTexture2DArray(t,0):nt.setTexture2D(t,0),Q.unbindTexture()},this.resetState=function(){b=0,E=0,T=null,Q.reset(),Mt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return An}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(t){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!t}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===He?De:Ue}set outputEncoding(t){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=t===De?He:ke}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}}class Fl extends Ol{}Fl.prototype.isWebGL1Renderer=!0;class zl{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new Gr(t),this.density=e}clone(){return new zl(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Bl{constructor(t,e=1,n=1e3){this.isFog=!0,this.name="",this.color=new Gr(t),this.near=e,this.far=n}clone(){return new Bl(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class Hl extends Er{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e}}class kl{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=mn,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Dn()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let i=0,r=this.stride;it.far||e.push({distance:o,point:jl.clone(),uv:Or.getInterpolation(jl,$l,Ql,tc,ec,nc,ic,new Wn),face:null,object:this})}copy(t,e){return super.copy(t,e),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function sc(t,e,n,i,r,s){Zl.subVectors(t,n).addScalar(.5).multiply(i),void 0!==r?(Jl.x=s*Zl.x-r*Zl.y,Jl.y=r*Zl.x+s*Zl.y):Jl.copy(Zl),t.copy(e),t.x+=Jl.x,t.y+=Jl.y,t.applyMatrix4(Kl)}const ac=new bi,oc=new bi;class lc extends Er{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let t=0,n=e.length;t0){let n,i;for(n=1,i=e.length;n0){ac.setFromMatrixPosition(this.matrixWorld);const n=t.ray.origin.distanceTo(ac);this.getObjectForDistance(n).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){ac.setFromMatrixPosition(t.matrixWorld),oc.setFromMatrixPosition(this.matrixWorld);const n=ac.distanceTo(oc)/t.zoom;let i,r;for(e[0].object.visible=!0,i=1,r=e.length;i=t))break;e[i-1].object.visible=!1,e[i].object.visible=!0}for(this._currentLevel=i-1;io)continue;u.applyMatrix4(this.matrixWorld);const s=t.ray.origin.distanceTo(u);st.far||e.push({distance:s,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else{for(let n=Math.max(0,s.start),i=Math.min(f.count,s.start+s.count)-1;no)continue;u.applyMatrix4(this.matrixWorld);const i=t.ray.origin.distanceTo(u);it.far||e.push({distance:i,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;tr.far)return;s.push({distance:l,distanceToRay:Math.sqrt(o),point:n,index:e,face:null,object:a})}}class Kc extends pi{constructor(t,e,n,i,r,s,a,o,l){super(t,e,n,i,r,s,a,o,l),this.isVideoTexture=!0,this.minFilter=void 0!==s?s:ft,this.magFilter=void 0!==r?r:ft,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback((function e(){c.needsUpdate=!0,t.requestVideoFrameCallback(e)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;!1==="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class $c extends pi{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=ct,this.minFilter=ct,this.generateMipmaps=!1,this.needsUpdate=!0}}class Qc extends pi{constructor(t,e,n,i,r,s,a,o,l,c,h,u){super(null,s,a,o,l,c,i,r,h,u),this.isCompressedTexture=!0,this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class th extends Qc{constructor(t,e,n,i,r,s){super(t,e,n,r,s),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=ot}}class eh extends Qc{constructor(t,e,n){super(void 0,t[0].width,t[0].height,e,n,et),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=t}}class nh extends pi{constructor(t,e,n,i,r,s,a,o,l){super(t,e,n,i,r,s,a,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class ih{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,i=this.getPoint(0),r=0;e.push(0);for(let s=1;s<=t;s++)n=this.getPoint(s/t),r+=n.distanceTo(i),e.push(r),i=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let i=0;const r=n.length;let s;s=e||t*n[r-1];let a,o=0,l=r-1;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),a=n[i]-s,a<0)o=i+1;else{if(!(a>0)){l=i;break}l=i-1}if(i=l,n[i]===s)return i/(r-1);const c=n[i];return(i+(s-c)/(n[i+1]-c))/(r-1)}getTangent(t,e){const n=1e-4;let i=t-n,r=t+n;i<0&&(i=0),r>1&&(r=1);const s=this.getPoint(i),a=this.getPoint(r),o=e||(s.isVector2?new Wn:new bi);return o.copy(a).sub(s).normalize(),o}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new bi,i=[],r=[],s=[],a=new bi,o=new Qi;for(let e=0;e<=t;e++){const n=e/t;i[e]=this.getTangentAt(n,new bi)}r[0]=new bi,s[0]=new bi;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),h=Math.abs(i[0].y),u=Math.abs(i[0].z);c<=l&&(l=c,n.set(1,0,0)),h<=l&&(l=h,n.set(0,1,0)),u<=l&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],a),s[0].crossVectors(i[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),s[e]=s[e-1].clone(),a.crossVectors(i[e-1],i[e]),a.length()>Number.EPSILON){a.normalize();const t=Math.acos(Nn(i[e-1].dot(i[e]),-1,1));r[e].applyMatrix4(o.makeRotationAxis(a,t))}s[e].crossVectors(i[e],r[e])}if(!0===e){let e=Math.acos(Nn(r[0].dot(r[t]),-1,1));e/=t,i[0].dot(a.crossVectors(r[0],r[t]))>0&&(e=-e);for(let n=1;n<=t;n++)r[n].applyMatrix4(o.makeRotationAxis(i[n],e*n)),s[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class rh extends ih{constructor(t=0,e=0,n=1,i=1,r=0,s=2*Math.PI,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=a,this.aRotation=o}getPoint(t,e){const n=e||new Wn,i=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)i;)r-=i;r0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===c&&l===r-1&&(l=r-2,c=1),this.closed||l>0?a=i[(l-1)%r]:(oh.subVectors(i[0],i[1]).add(i[0]),a=oh);const h=i[l%r],u=i[(l+1)%r];if(this.closed||l+2i.length-2?i.length-1:s+1],h=i[s>i.length-3?i.length-1:s+2];return n.set(dh(a,o.x,l.x,c.x,h.x),dh(a,o.y,l.y,c.y,h.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e=n){const t=i[r]-n,s=this.curves[r],a=s.getLength(),o=0===a?0:1-t/a;return s.getPointAt(o,e)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,i=this.curves.length;n1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class Th extends vs{constructor(t=[new Wn(0,-.5),new Wn(.5,0),new Wn(0,.5)],e=12,n=0,i=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},e=Math.floor(e),i=Nn(i,0,2*Math.PI);const r=[],s=[],a=[],o=[],l=[],c=1/e,h=new bi,u=new Wn,d=new bi,p=new bi,f=new bi;let m=0,g=0;for(let e=0;e<=t.length-1;e++)switch(e){case 0:m=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-m,d.z=0*g,f.copy(d),d.normalize(),o.push(d.x,d.y,d.z);break;case t.length-1:o.push(f.x,f.y,f.z);break;default:m=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-m,d.z=0*g,p.copy(d),d.x+=f.x,d.y+=f.y,d.z+=f.z,d.normalize(),o.push(d.x,d.y,d.z),f.copy(p)}for(let r=0;r<=e;r++){const d=n+r*c*i,p=Math.sin(d),f=Math.cos(d);for(let n=0;n<=t.length-1;n++){h.x=t[n].x*p,h.y=t[n].y,h.z=t[n].x*f,s.push(h.x,h.y,h.z),u.x=r/e,u.y=n/(t.length-1),a.push(u.x,u.y);const i=o[3*n+0]*p,c=o[3*n+1],d=o[3*n+0]*f;l.push(i,c,d)}}for(let n=0;n0&&v(!0),e>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new ls(h,3)),this.setAttribute("normal",new ls(u,3)),this.setAttribute("uv",new ls(d,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Rh(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Ch extends Rh{constructor(t=1,e=1,n=32,i=1,r=!1,s=0,a=2*Math.PI){super(0,t,e,n,i,r,s,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:s,thetaLength:a}}static fromJSON(t){return new Ch(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Lh extends vs{constructor(t=[],e=[],n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i};const r=[],s=[];function a(t,e,n,i){const r=i+1,s=[];for(let i=0;i<=r;i++){s[i]=[];const a=t.clone().lerp(n,i/r),o=e.clone().lerp(n,i/r),l=r-i;for(let t=0;t<=l;t++)s[i][t]=0===t&&i===r?a:a.clone().lerp(o,t/l)}for(let t=0;t.9&&a<.1&&(e<.2&&(s[t+0]+=1),n<.2&&(s[t+2]+=1),i<.2&&(s[t+4]+=1))}}()}(),this.setAttribute("position",new ls(r,3)),this.setAttribute("normal",new ls(r.slice(),3)),this.setAttribute("uv",new ls(s,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Lh(t.vertices,t.indices,t.radius,t.details)}}class Ph extends Lh{constructor(t=1,e=0){const n=(1+Math.sqrt(5))/2,i=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Ph(t.radius,t.detail)}}const Ih=new bi,Uh=new bi,Dh=new bi,Nh=new Or;class Oh extends vs{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},null!==t){const n=4,i=Math.pow(10,n),r=Math.cos(In*e),s=t.getIndex(),a=t.getAttribute("position"),o=s?s.count:a.count,l=[0,0,0],c=["a","b","c"],h=new Array(3),u={},d=[];for(let t=0;t80*n){o=c=t[0],l=h=t[1];for(let e=n;ec&&(c=u),d>h&&(h=d);p=Math.max(c-o,h-l),p=0!==p?32767/p:0}return kh(s,a,n,o,l,p,0),a};function Bh(t,e,n,i,r){let s,a;if(r===function(t,e,n,i){let r=0;for(let s=e,a=n-i;s0)for(s=e;s=e;s-=i)a=au(s,t[s],t[s+1],a);return a&&tu(a,a.next)&&(ou(a),a=a.next),a}function Hh(t,e){if(!t)return t;e||(e=t);let n,i=t;do{if(n=!1,i.steiner||!tu(i,i.next)&&0!==Qh(i.prev,i,i.next))i=i.next;else{if(ou(i),i=e=i.prev,i===i.next)break;n=!0}}while(n||i!==e);return e}function kh(t,e,n,i,r,s,a){if(!t)return;!a&&s&&function(t,e,n,i){let r=t;do{0===r.z&&(r.z=Zh(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,n,i,r,s,a,o,l,c=1;do{for(n=t,t=null,s=null,a=0;n;){for(a++,i=n,o=0,e=0;e0||l>0&&i;)0!==o&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,o--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;n=i}s.nextZ=null,c*=2}while(a>1)}(r)}(t,i,r,s);let o,l,c=t;for(;t.prev!==t.next;)if(o=t.prev,l=t.next,s?Gh(t,i,r,s):Vh(t))e.push(o.i/n|0),e.push(t.i/n|0),e.push(l.i/n|0),ou(t),t=l.next,c=l.next;else if((t=l)===c){a?1===a?kh(t=Wh(Hh(t),e,n),e,n,i,r,s,2):2===a&&Xh(t,e,n,i,r,s):kh(Hh(t),e,n,i,r,s,1);break}}function Vh(t){const e=t.prev,n=t,i=t.next;if(Qh(e,n,i)>=0)return!1;const r=e.x,s=n.x,a=i.x,o=e.y,l=n.y,c=i.y,h=rs?r>a?r:a:s>a?s:a,p=o>l?o>c?o:c:l>c?l:c;let f=i.next;for(;f!==e;){if(f.x>=h&&f.x<=d&&f.y>=u&&f.y<=p&&Kh(r,o,s,l,a,c,f.x,f.y)&&Qh(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function Gh(t,e,n,i){const r=t.prev,s=t,a=t.next;if(Qh(r,s,a)>=0)return!1;const o=r.x,l=s.x,c=a.x,h=r.y,u=s.y,d=a.y,p=ol?o>c?o:c:l>c?l:c,g=h>u?h>d?h:d:u>d?u:d,v=Zh(p,f,e,n,i),_=Zh(m,g,e,n,i);let y=t.prevZ,x=t.nextZ;for(;y&&y.z>=v&&x&&x.z<=_;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==r&&y!==a&&Kh(o,h,l,u,c,d,y.x,y.y)&&Qh(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==r&&x!==a&&Kh(o,h,l,u,c,d,x.x,x.y)&&Qh(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;y&&y.z>=v;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==r&&y!==a&&Kh(o,h,l,u,c,d,y.x,y.y)&&Qh(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;x&&x.z<=_;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==r&&x!==a&&Kh(o,h,l,u,c,d,x.x,x.y)&&Qh(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Wh(t,e,n){let i=t;do{const r=i.prev,s=i.next.next;!tu(r,s)&&eu(r,i,i.next,s)&&ru(r,s)&&ru(s,r)&&(e.push(r.i/n|0),e.push(i.i/n|0),e.push(s.i/n|0),ou(i),ou(i.next),i=t=s),i=i.next}while(i!==t);return Hh(i)}function Xh(t,e,n,i,r,s){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&$h(a,t)){let o=su(a,t);return a=Hh(a,a.next),o=Hh(o,o.next),kh(a,e,n,i,r,s,0),void kh(o,e,n,i,r,s,0)}t=t.next}a=a.next}while(a!==t)}function jh(t,e){return t.x-e.x}function qh(t,e){const n=function(t,e){let n,i=e,r=-1/0;const s=t.x,a=t.y;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){const t=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=s&&t>r&&(r=t,n=i.x=i.x&&i.x>=l&&s!==i.x&&Kh(an.x||i.x===n.x&&Yh(n,i)))&&(n=i,u=h)),i=i.next}while(i!==o);return n}(t,e);if(!n)return e;const i=su(n,t);return Hh(i,i.next),Hh(n,n.next)}function Yh(t,e){return Qh(t.prev,t,e.prev)<0&&Qh(e.next,t,t.next)<0}function Zh(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Jh(t){let e=t,n=t;do{(e.x=(t-a)*(s-o)&&(t-a)*(i-o)>=(n-a)*(e-o)&&(n-a)*(s-o)>=(r-a)*(i-o)}function $h(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&eu(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(ru(t,e)&&ru(e,t)&&function(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(Qh(t.prev,t,e.prev)||Qh(t,e.prev,e))||tu(t,e)&&Qh(t.prev,t,t.next)>0&&Qh(e.prev,e,e.next)>0)}function Qh(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function tu(t,e){return t.x===e.x&&t.y===e.y}function eu(t,e,n,i){const r=iu(Qh(t,e,n)),s=iu(Qh(t,e,i)),a=iu(Qh(n,i,t)),o=iu(Qh(n,i,e));return r!==s&&a!==o||(!(0!==r||!nu(t,n,e))||(!(0!==s||!nu(t,i,e))||(!(0!==a||!nu(n,t,i))||!(0!==o||!nu(n,e,i)))))}function nu(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function iu(t){return t>0?1:t<0?-1:0}function ru(t,e){return Qh(t.prev,t,t.next)<0?Qh(t,e,t.next)>=0&&Qh(t,t.prev,e)>=0:Qh(t,e,t.prev)<0||Qh(t,t.next,e)<0}function su(t,e){const n=new lu(t.i,t.x,t.y),i=new lu(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function au(t,e,n,i){const r=new lu(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function ou(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function lu(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class cu{static area(t){const e=t.length;let n=0;for(let i=e-1,r=0;r2&&t[e-1].equals(t[0])&&t.pop()}function uu(t,e){for(let n=0;nNumber.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),p=e.x-o/u,f=e.y+a/u,m=((n.x-c/d-p)*c-(n.y+l/d-f)*l)/(a*c-o*l);i=p+a*m-t.x,r=f+o*m-t.y;const g=i*i+r*r;if(g<=2)return new Wn(i,r);s=Math.sqrt(g/2)}else{let t=!1;a>Number.EPSILON?l>Number.EPSILON&&(t=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(o)===Math.sign(c)&&(t=!0),t?(i=-o,r=a,s=Math.sqrt(h)):(i=a,r=o,s=Math.sqrt(h/2))}return new Wn(i/s,r/s)}const P=[];for(let t=0,e=w.length,n=e-1,i=t+1;t=0;t--){const e=t/p,n=h*Math.cos(e*Math.PI/2),i=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=w.length;t=0;){const i=n;let r=n-1;r<0&&(r=t.length-1);for(let t=0,n=o+2*p;t0)&&d.push(e,r,l),(t!==n-1||o0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class Lu extends zr{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Gr(16777215),this.specular=new Gr(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Gr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Wn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=X,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Pu extends zr{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Gr(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Gr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Wn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class Iu extends zr{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Wn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class Uu extends zr{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Gr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Gr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Wn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=X,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Du extends zr{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Gr(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Wn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Nu extends Uc{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}function Ou(t,e,n){return zu(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)}function Fu(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)}function zu(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Bu(t){const e=t.length,n=new Array(e);for(let t=0;t!==e;++t)n[t]=t;return n.sort((function(e,n){return t[e]-t[n]})),n}function Hu(t,e,n){const i=t.length,r=new t.constructor(i);for(let s=0,a=0;a!==i;++s){const i=n[s]*e;for(let n=0;n!==e;++n)r[a++]=t[i+n]}return r}function ku(t,e,n,i){let r=1,s=t[0];for(;void 0!==s&&void 0===s[i];)s=t[r++];if(void 0===s)return;let a=s[i];if(void 0!==a)if(Array.isArray(a))do{a=s[i],void 0!==a&&(e.push(s.time),n.push.apply(n,a)),s=t[r++]}while(void 0!==s);else if(void 0!==a.toArray)do{a=s[i],void 0!==a&&(e.push(s.time),a.toArray(n,n.length)),s=t[r++]}while(void 0!==s);else do{a=s[i],void 0!==a&&(e.push(s.time),n.push(a)),s=t[r++]}while(void 0!==s)}const Vu={arraySlice:Ou,convertArray:Fu,isTypedArray:zu,getKeyframeOrder:Bu,sortedArray:Hu,flattenJSON:ku,subclip:function(t,e,n,i,r=30){const s=t.clone();s.name=e;const a=[];for(let t=0;t=i)){l.push(e.times[t]);for(let n=0;ns.tracks[t].times[0]&&(o=s.tracks[t].times[0]);for(let t=0;t=i.times[u]){const t=u*l+o,e=t+l-o;d=Ou(i.values,t,e)}else{const t=i.createInterpolant(),e=o,n=l-o;t.evaluate(s),d=Ou(t.resultBuffer,e,n)}if("quaternion"===r){(new Si).fromArray(d).normalize().conjugate().toArray(d)}const p=a.times.length;for(let t=0;t=r)break t;{const a=e[1];t=r)break e}s=n,n=0}}for(;n>>1;te;)--s;if(++s,0!==r||s!==i){r>=s&&(s=Math.max(s,1),r=s-1);const t=this.getValueSize();this.times=Ou(n,r,s),this.values=Ou(this.values,r*t,s*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==r;e++){const i=n[e];if("number"==typeof i&&isNaN(i)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,i),t=!1;break}if(null!==s&&s>i){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,i,s),t=!1;break}s=i}if(void 0!==i&&zu(i))for(let e=0,n=i.length;e!==n;++e){const n=i[e];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,n),t=!1;break}}return t}optimize(){const t=Ou(this.times),e=Ou(this.values),n=this.getValueSize(),i=this.getInterpolation()===Ee,r=t.length-1;let s=1;for(let a=1;a0){t[s]=t[r];for(let t=r*n,i=s*n,a=0;a!==n;++a)e[i+a]=e[t+a];++s}return s!==t.length?(this.times=Ou(t,0,s),this.values=Ou(e,0,s*n)):(this.times=t,this.values=e),this}clone(){const t=Ou(this.times,0),e=Ou(this.values,0),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}qu.prototype.TimeBufferType=Float32Array,qu.prototype.ValueBufferType=Float32Array,qu.prototype.DefaultInterpolation=be;class Yu extends qu{}Yu.prototype.ValueTypeName="bool",Yu.prototype.ValueBufferType=Array,Yu.prototype.DefaultInterpolation=Se,Yu.prototype.InterpolantFactoryMethodLinear=void 0,Yu.prototype.InterpolantFactoryMethodSmooth=void 0;class Zu extends qu{}Zu.prototype.ValueTypeName="color";class Ju extends qu{}Ju.prototype.ValueTypeName="number";class Ku extends Gu{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){const r=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=(n-e)/(i-e);let l=t*a;for(let t=l+a;l!==t;l+=4)Si.slerpFlat(r,0,s,l-a,s,l,o);return r}}class $u extends qu{InterpolantFactoryMethodLinear(t){return new Ku(this.times,this.values,this.getValueSize(),t)}}$u.prototype.ValueTypeName="quaternion",$u.prototype.DefaultInterpolation=be,$u.prototype.InterpolantFactoryMethodSmooth=void 0;class Qu extends qu{}Qu.prototype.ValueTypeName="string",Qu.prototype.ValueBufferType=Array,Qu.prototype.DefaultInterpolation=Se,Qu.prototype.InterpolantFactoryMethodLinear=void 0,Qu.prototype.InterpolantFactoryMethodSmooth=void 0;class td extends qu{}td.prototype.ValueTypeName="vector";class ed{constructor(t,e=-1,n,i=2500){this.name=t,this.tracks=n,this.duration=e,this.blendMode=i,this.uuid=Dn(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],n=t.tracks,i=1/(t.fps||1);for(let t=0,r=n.length;t!==r;++t)e.push(nd(n[t]).scale(i));const r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(t){const e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,i=n.length;t!==i;++t)e.push(qu.toJSON(n[t]));return i}static CreateFromMorphTargetSequence(t,e,n,i){const r=e.length,s=[];for(let t=0;t1){const t=s[1];let e=i[t];e||(i[t]=e=[]),e.push(n)}}const s=[];for(const t in i)s.push(this.CreateFromMorphTargetSequence(t,i[t],e,n));return s}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(t,e,n,i,r){if(0!==n.length){const s=[],a=[];ku(n,s,a,i),0!==s.length&&r.push(new t(e,s,a))}},i=[],r=t.name||"default",s=t.fps||30,a=t.blendMode;let o=t.length||-1;const l=t.hierarchy||[];for(let t=0;t{e&&e(r),this.manager.itemEnd(t)}),0),r;if(void 0!==od[t])return void od[t].push({onLoad:e,onProgress:n,onError:i});od[t]=[],od[t].push({onLoad:e,onProgress:n,onError:i});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,o=this.responseType;fetch(s).then((e=>{if(200===e.status||0===e.status){if(0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const n=od[t],i=e.body.getReader(),r=e.headers.get("Content-Length")||e.headers.get("X-File-Size"),s=r?parseInt(r):0,a=0!==s;let o=0;const l=new ReadableStream({start(t){!function e(){i.read().then((({done:i,value:r})=>{if(i)t.close();else{o+=r.byteLength;const i=new ProgressEvent("progress",{lengthComputable:a,loaded:o,total:s});for(let t=0,e=n.length;t{switch(o){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then((t=>(new DOMParser).parseFromString(t,a)));case"json":return t.json();default:if(void 0===a)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(a),n=e&&e[1]?e[1].toLowerCase():void 0,i=new TextDecoder(n);return t.arrayBuffer().then((t=>i.decode(t)))}}})).then((e=>{id.add(t,e);const n=od[t];delete od[t];for(let t=0,i=n.length;t{const n=od[t];if(void 0===n)throw this.manager.itemError(t),e;delete od[t];for(let t=0,i=n.length;t{this.manager.itemEnd(t)})),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class hd extends ad{constructor(t){super(t)}load(t,e,n,i){const r=this,s=new cd(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,(function(n){try{e(r.parse(JSON.parse(n)))}catch(e){i?i(e):console.error(e),r.manager.itemError(t)}}),n,i)}parse(t){const e=[];for(let n=0;n0:i.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const e in t.uniforms){const r=t.uniforms[e];switch(i.uniforms[e]={},r.type){case"t":i.uniforms[e].value=n(r.value);break;case"c":i.uniforms[e].value=(new Gr).setHex(r.value);break;case"v2":i.uniforms[e].value=(new Wn).fromArray(r.value);break;case"v3":i.uniforms[e].value=(new bi).fromArray(r.value);break;case"v4":i.uniforms[e].value=(new fi).fromArray(r.value);break;case"m3":i.uniforms[e].value=(new Xn).fromArray(r.value);break;case"m4":i.uniforms[e].value=(new Qi).fromArray(r.value);break;default:i.uniforms[e].value=r.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.glslVersion&&(i.glslVersion=t.glslVersion),void 0!==t.extensions)for(const e in t.extensions)i.extensions[e]=t.extensions[e];if(void 0!==t.lights&&(i.lights=t.lights),void 0!==t.clipping&&(i.clipping=t.clipping),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=n(t.map)),void 0!==t.matcap&&(i.matcap=n(t.matcap)),void 0!==t.alphaMap&&(i.alphaMap=n(t.alphaMap)),void 0!==t.bumpMap&&(i.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),i.normalScale=(new Wn).fromArray(e)}return void 0!==t.displacementMap&&(i.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=n(t.specularMap)),void 0!==t.specularIntensityMap&&(i.specularIntensityMap=n(t.specularIntensityMap)),void 0!==t.specularColorMap&&(i.specularColorMap=n(t.specularColorMap)),void 0!==t.envMap&&(i.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(i.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(i.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(i.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=n(t.gradientMap)),void 0!==t.clearcoatMap&&(i.clearcoatMap=n(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=n(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(i.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(i.clearcoatNormalScale=(new Wn).fromArray(t.clearcoatNormalScale)),void 0!==t.iridescenceMap&&(i.iridescenceMap=n(t.iridescenceMap)),void 0!==t.iridescenceThicknessMap&&(i.iridescenceThicknessMap=n(t.iridescenceThicknessMap)),void 0!==t.transmissionMap&&(i.transmissionMap=n(t.transmissionMap)),void 0!==t.thicknessMap&&(i.thicknessMap=n(t.thicknessMap)),void 0!==t.anisotropyMap&&(i.anisotropyMap=n(t.anisotropyMap)),void 0!==t.sheenColorMap&&(i.sheenColorMap=n(t.sheenColorMap)),void 0!==t.sheenRoughnessMap&&(i.sheenRoughnessMap=n(t.sheenRoughnessMap)),i}setTextures(t){return this.textures=t,this}static createMaterialFromType(t){return new{ShadowMaterial:wu,SpriteMaterial:Wl,RawShaderMaterial:Au,ShaderMaterial:Vs,PointsMaterial:Wc,MeshPhysicalMaterial:Cu,MeshStandardMaterial:Ru,MeshPhongMaterial:Lu,MeshToonMaterial:Pu,MeshNormalMaterial:Iu,MeshLambertMaterial:Uu,MeshDepthMaterial:Sl,MeshDistanceMaterial:bl,MeshBasicMaterial:Xr,MeshMatcapMaterial:Du,LineDashedMaterial:Nu,LineBasicMaterial:Uc,Material:zr}[t]}}class Od{static decodeText(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let n=0,i=t.length;n0){const n=new rd(e);r=new dd(n),r.setCrossOrigin(this.crossOrigin);for(let e=0,n=t.length;e0){i=new dd(this.manager),i.setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(n,i,this._addIndex*e,1,e);for(let t=e,r=e+e;t!==r;++t)if(n[t]!==n[t+e]){a.setValue(n,i);break}}saveOriginalState(){const t=this.binding,e=this.buffer,n=this.valueSize,i=n*this._origIndex;t.getValue(e,i);for(let t=n,r=i;t!==r;++t)e[t]=e[i+t%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let n=t;n=.5)for(let i=0;i!==r;++i)t[e+i]=t[n+i]}_slerp(t,e,n,i){Si.slerpFlat(t,e,t,e,t,n,i)}_slerpAdditive(t,e,n,i,r){const s=this._workIndex*r;Si.multiplyQuaternionsFlat(t,s,t,e,t,n),Si.slerpFlat(t,e,t,e,t,s,i)}_lerp(t,e,n,i,r){const s=1-i;for(let a=0;a!==r;++a){const r=e+a;t[r]=t[r]*s+t[n+a]*i}}_lerpAdditive(t,e,n,i,r){for(let s=0;s!==r;++s){const r=e+s;t[r]=t[r]+t[n+s]*i}}}const fp="\\[\\]\\.:\\/",mp=new RegExp("["+fp+"]","g"),gp="[^"+fp+"]",vp="[^"+fp.replace("\\.","")+"]",_p=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",gp)+/(WCOD+)?/.source.replace("WCOD",vp)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",gp)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",gp)+"$"),yp=["material","materials","bones","map"];class xp{constructor(t,e,n){this.path=e,this.parsedPath=n||xp.parseTrackName(e),this.node=xp.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new xp.Composite(t,e,n):new xp(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(mp,"")}static parseTrackName(t){const e=_p.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const t=n.nodeName.substring(i+1);-1!==yp.indexOf(t)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=t)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){const n=function(t){for(let i=0;i=r){const s=r++,c=t[s];e[c.uuid]=l,t[l]=c,e[o]=s,t[s]=a;for(let t=0,e=i;t!==e;++t){const e=n[t],i=e[s],r=e[l];e[l]=i,e[s]=r}}}this.nCachedObjects_=r}uncache(){const t=this._objects,e=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_,s=t.length;for(let a=0,o=arguments.length;a!==o;++a){const o=arguments[a].uuid,l=e[o];if(void 0!==l)if(delete e[o],l0&&(e[a.uuid]=l),t[l]=a,t.pop();for(let t=0,e=i;t!==e;++t){const e=n[t];e[l]=e[r],e.pop()}}}this.nCachedObjects_=r}subscribe_(t,e){const n=this._bindingsIndicesByPath;let i=n[t];const r=this._bindings;if(void 0!==i)return r[i];const s=this._paths,a=this._parsedPaths,o=this._objects,l=o.length,c=this.nCachedObjects_,h=new Array(l);i=r.length,n[t]=i,s.push(t),a.push(e),r.push(h);for(let n=c,i=o.length;n!==i;++n){const i=o[n];h[n]=new xp(i,t,e)}return h}unsubscribe_(t){const e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){const i=this._paths,r=this._parsedPaths,s=this._bindings,a=s.length-1,o=s[a];e[t[a]]=n,s[n]=o,s.pop(),r[n]=r[a],r.pop(),i[n]=i[a],i.pop()}}}class Sp{constructor(t,e,n=null,i=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=n,this.blendMode=i;const r=e.tracks,s=r.length,a=new Array(s),o={endingStart:Te,endingEnd:Te};for(let t=0;t!==s;++t){const e=r[t].createInterpolant(null);a[t]=e,e.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){const n=this._clip.duration,i=t._clip.duration,r=i/n,s=n/i;t.warp(1,r,e),this.warp(s,1,e)}return this}crossFadeTo(t,e,n){return t.crossFadeFrom(this,e,n)}stopFading(){const t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,n){const i=this._mixer,r=i.time,s=this.timeScale;let a=this._timeScaleInterpolant;null===a&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const o=a.parameterPositions,l=a.sampleValues;return o[0]=r,o[1]=r+n,l[0]=t/s,l[1]=e/s,this}stopWarping(){const t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,n,i){if(!this.enabled)return void this._updateWeight(t);const r=this._startTime;if(null!==r){const i=(t-r)*n;i<0||0===n?e=0:(this._startTime=null,e=n*i)}e*=this._updateTimeScale(t);const s=this._updateTime(e),a=this._updateWeight(t);if(a>0){const t=this._interpolants,e=this._propertyBindings;if(this.blendMode===Ce)for(let n=0,i=t.length;n!==i;++n)t[n].evaluate(s),e[n].accumulateAdditive(a);else for(let n=0,r=t.length;n!==r;++n)t[n].evaluate(s),e[n].accumulate(i,a)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const n=this._weightInterpolant;if(null!==n){const i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,n=this.loop;let i=this.time+t,r=this._loopCount;const s=2202===n;if(0===t)return-1===r?i:s&&1==(1&r)?e-i:i;if(2200===n){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(i>=e)i=e;else{if(!(i<0)){this.time=i;break t}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),i>=e||i<0){const n=Math.floor(i/e);i-=e*n,r+=Math.abs(n);const a=this.repetitions-r;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=t>0?e:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===a){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=i;if(s&&1==(1&r))return e-i}return i}_setEndings(t,e,n){const i=this._interpolantSettings;n?(i.endingStart=we,i.endingEnd=we):(i.endingStart=t?this.zeroSlopeAtStart?we:Te:Ae,i.endingEnd=e?this.zeroSlopeAtEnd?we:Te:Ae)}_scheduleFading(t,e,n){const i=this._mixer,r=i.time;let s=this._weightInterpolant;null===s&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const a=s.parameterPositions,o=s.sampleValues;return a[0]=r,o[0]=e,a[1]=r+t,o[1]=n,this}}const bp=new Float32Array(1);class Ep extends Cn{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const n=t._localRoot||this._root,i=t._clip.tracks,r=i.length,s=t._propertyBindings,a=t._interpolants,o=n.uuid,l=this._bindingsByRootAndName;let c=l[o];void 0===c&&(c={},l[o]=c);for(let t=0;t!==r;++t){const r=i[t],l=r.name;let h=c[l];if(void 0!==h)++h.referenceCount,s[t]=h;else{if(h=s[t],void 0!==h){null===h._cacheIndex&&(++h.referenceCount,this._addInactiveBinding(h,o,l));continue}const i=e&&e._propertyBindings[t].binding.parsedPath;h=new pp(xp.create(n,l,i),r.ValueTypeName,r.getValueSize()),++h.referenceCount,this._addInactiveBinding(h,o,l),s[t]=h}a[t].resultBuffer=h.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,n=t._clip.uuid,i=this._actionsByClip[n];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,n,e)}const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const e=t._cacheIndex;return null!==e&&e=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,n=this._nActiveActions,i=this.time+=t,r=Math.sign(t),s=this._accuIndex^=1;for(let a=0;a!==n;++a){e[a]._update(i,t,r,s)}const a=this._bindings,o=this._nActiveBindings;for(let t=0;t!==o;++t)a[t].apply(s);return this}setTime(t){this.time=0;for(let t=0;tthis.max.x||t.ythis.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Np).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const Fp=new bi,zp=new bi;class Bp{constructor(t=new bi,e=new bi){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){Fp.subVectors(t,this.start),zp.subVectors(this.end,this.start);const n=zp.dot(zp);let i=zp.dot(Fp)/n;return e&&(i=Nn(i,0,1)),i}closestPointToPoint(t,e,n){const i=this.closestPointToPointParameter(t,e);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}const Hp=new bi;class kp extends Er{constructor(t,e){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e,this.type="SpotLightHelper";const n=new vs,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let t=0,e=1,n=32;t1)for(let n=0;n.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{pf.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(pf,e)}}setLength(t,e=.2*t,n=.2*e){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class vf extends Vc{constructor(t=1){const e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],n=new vs;n.setAttribute("position",new ls(e,3)),n.setAttribute("color",new ls([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(n,new Uc({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(t,e,n){const i=new Gr,r=this.geometry.attributes.color.array;return i.set(t),i.toArray(r,0),i.toArray(r,3),i.set(e),i.toArray(r,6),i.toArray(r,9),i.set(n),i.toArray(r,12),i.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class _f{constructor(){this.type="ShapePath",this.color=new Gr,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new Eh,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,n,i){return this.currentPath.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,s){return this.currentPath.bezierCurveTo(t,e,n,i,r,s),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(t,e){const n=e.length;let i=!1;for(let r=n-1,s=0;sNumber.EPSILON){if(l<0&&(n=e[s],o=-o,a=e[r],l=-l),t.ya.y)continue;if(t.y===n.y){if(t.x===n.x)return!0}else{const e=l*(t.x-n.x)-o*(t.y-n.y);if(0===e)return!0;if(e<0)continue;i=!i}}else{if(t.y!==n.y)continue;if(a.x<=t.x&&t.x<=n.x||n.x<=t.x&&t.x<=a.x)return!0}}return i}const n=cu.isClockWise,i=this.subPaths;if(0===i.length)return[];let r,s,a;const o=[];if(1===i.length)return s=i[0],a=new Fh,a.curves=s.curves,o.push(a),o;let l=!n(i[0].getPoints());l=t?!l:l;const c=[],h=[];let u,d,p=[],f=0;h[f]=void 0,p[f]=[];for(let e=0,a=i.length;e1){let t=!1,n=0;for(let t=0,e=h.length;t0&&!1===t&&(p=c)}for(let t=0,e=h.length;t[property:TypedArray array]

[property:Integer count]

يخزن طول [page:BufferAttribute.array array] مقسومًا على - [page:BufferAttribute.itemSize itemSize].

+ [page:BufferAttribute.itemSize itemSize]. Read-only property.

إذا كان المخزن يخزن متجهًا من 3 مكونات (مثل الموضع أو الطبيعي أو اللون) ، فسيحسب عدد هذه المتجهات المخزنة.

@@ -166,6 +166,9 @@

[method:this copyArray](array)

[method:this copyAt]([param:Integer index1]، [param:BufferAttribute bufferAttribute]، [param:Integer index2])

انسخ متجهًا من bufferAttribute[index2] إلى [page:BufferAttribute.array array][index1].

+

[method:Number getComponent]( [param:Integer index], [param:Integer component] )

+

Returns the given component of the vector at the given index.

+

[method:Number getX]([param:Integer index])

يعيد مكون x من المتجه في المؤشر المحدد.

@@ -211,6 +214,9 @@

[method:this setUsage]([param:Usage value])

بدلاً من ذلك ، قم بإنشاء نسخة جديدة وتعيين الاستخدام المطلوب قبل التالي جعل.

+ +

[method:Number setComponent]( [param:Integer index], [param:Integer component], [param:Float value] )

+

Sets the given component of the vector at the given index.

[method:this setX]([param:Integer index], [param:Float x])

تضبط مكون x من المتجه في المؤشر المحدد.

diff --git a/docs/api/ar/extras/core/ShapePath.html b/docs/api/ar/extras/core/ShapePath.html index 477a5ce54233a9..7972a713a2be01 100644 --- a/docs/api/ar/extras/core/ShapePath.html +++ b/docs/api/ar/extras/core/ShapePath.html @@ -11,7 +11,7 @@

[name]

يتم استخدام هذه الفئة لتحويل سلسلة من الأشكال إلى مصفوفة من - [page:Path]s، على سبيل المثال شكل SVG إلى مسار (انظر المثال أدناه). + [page:Path]s، على سبيل المثال شكل SVG إلى مسار.

المنشئ (Constructor)

diff --git a/docs/api/ar/helpers/ArrowHelper.html b/docs/api/ar/helpers/ArrowHelper.html new file mode 100644 index 00000000000000..a81460d2a738ef --- /dev/null +++ b/docs/api/ar/helpers/ArrowHelper.html @@ -0,0 +1,103 @@ + + + + + + + + + + [page:Object3D] → + +

[name]

+ +

كائن سهم ثلاثي الأبعاد لتصور الاتجاهات.

+ +

مثال الكود

+ + + const dir = new THREE.Vector3( 1, 2, 0 ); + + //normalize the direction vector (convert to vector of length 1) + dir.normalize(); + + const origin = new THREE.Vector3( 0, 0, 0 ); + const length = 1; + const hex = 0xffff00; + + const arrowHelper = new THREE.ArrowHelper( dir, origin, length, hex ); + scene.add( arrowHelper ); + + +

أمثلة (Examples)

+ +

[example:webgl_shadowmesh WebGL / shadowmesh]

+ +

المنشئ (Constructor)

+ +

+ [name]([param:Vector3 dir], [param:Vector3 origin], [param:Number length], + [param:Number hex], [param:Number headLength], [param:Number headWidth]) +

+

+ [page:Vector3 dir] - الاتجاه من المنشأ. يجب أن يكون متجه وحدة.
+ [page:Vector3 origin] - النقطة التي يبدأ فيها السهم.
+ [page:Number length] - طول السهم. الافتراضي هو `1`.
+ [page:Number hex] - قيمة ست عشرية لتحديد اللون. الافتراضي هو + 0xffff00.
+ [page:Number headLength] - طول رأس السهم. الافتراضي + هو 0.2 * الطول.
+ [page:Number headWidth] - عرض رأس السهم. الافتراضي هو + 0.2 * headLength.
+

+ +

الخصائص (Properties)

+

انظر إلى قاعدة [page:Object3D] class للخصائص المشتركة.

+ +

[property:Line line]

+

يحتوي على جزء الخط من المساعد السهم.

+ +

[property:Mesh cone]

+

يحتوي على جزء المخروط من المساعد السهم.

+ +

الطرق (Methods)

+

انظر إلى قاعدة [page:Object3D] class للطرق المشتركة.

+ +

[method:undefined setColor]([param:Color color])

+

+ اللون - اللون المطلوب.

+ + يضبط لون المساعد السهم. +

+ +

+ [method:undefined setLength]([param:Number length], [param:Number headLength], [param:Number headWidth]) +

+

+ الطول - الطول المطلوب.
+ headLength - طول رأس السهم.
+ headWidth - عرض رأس السهم.

+ + يضبط طول المساعد السهم. +

+ +

[method:undefined setDirection]([param:Vector3 dir])

+

+ dir - الاتجاه المطلوب. يجب أن يكون متجه وحدة.

+ + يضبط اتجاه المساعد السهم. +

+ +

[method:undefined dispose]()

+

+ يحرر الموارد المتعلقة بالـ GPU التي تم تخصيصها من قبل هذا المثيل. اتصل بهذه + الطريقة كلما لم يعد هذا المثيل مستخدمًا في تطبيقك. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/helpers/AxesHelper.html b/docs/api/ar/helpers/AxesHelper.html new file mode 100644 index 00000000000000..d143a55873d0c6 --- /dev/null +++ b/docs/api/ar/helpers/AxesHelper.html @@ -0,0 +1,64 @@ + + + + + + + + + + [page:Object3D] → [page:Line] → [page:LineSegments] → + +

[name]

+

+ كائن المحور لتصور المحاور الثلاثة بطريقة بسيطة.
+ المحور X هو اللون الأحمر. المحور Y هو اللون الأخضر. المحور Z هو اللون الأزرق. +

+ +

مثال الكود

+ + +const axesHelper = new THREE.AxesHelper( 5 ); +scene.add( axesHelper ); + + +

أمثلة (Examples)

+

+ [example:webgl_buffergeometry_compression WebGL / buffergeometry / compression]
+ [example:webgl_geometry_convex WebGL / geometry / convex]
+ [example:webgl_loader_nrrd WebGL / loader / nrrd] +

+ +

المنشئ (Constructor)

+

[name]( [param:Number size] )

+

+ [page:Number size] - (اختياري) حجم الخطوط التي تمثل المحاور. + الافتراضي هو `1`. +

+ +

الخصائص (Properties)

+

انظر إلى قاعدة [page:LineSegments] class للخصائص المشتركة.

+ +

الطرق (Methods)

+

انظر إلى قاعدة [page:LineSegments] class للطرق المشتركة.

+ +

+ [method:this setColors]( [param:Color xAxisColor], [param:Color yAxisColor], [param:Color zAxisColor] ) +

+

+ يضبط ألوان المحاور إلى [page:Color xAxisColor]، [page:Color yAxisColor]، + [page:Color zAxisColor]. +

+ +

[method:undefined dispose]()

+

+ يحرر الموارد المتعلقة بالـ GPU التي تم تخصيصها من قبل هذا المثيل. اتصل بهذه + الطريقة كلما لم يعد هذا المثيل مستخدمًا في تطبيقك. +

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/helpers/Box3Helper.html b/docs/api/ar/helpers/Box3Helper.html new file mode 100644 index 00000000000000..114d5d0498765e --- /dev/null +++ b/docs/api/ar/helpers/Box3Helper.html @@ -0,0 +1,62 @@ + + + + + + + + + + [page:Object3D] → [page:Line] → [page:LineSegments] → + +

[name]

+ +

كائن مساعد لتصور [page:Box3].

+ +

مثال الكود

+ + + const box = new THREE.Box3(); + box.setFromCenterAndSize( new THREE.Vector3( 1, 1, 1 ), new THREE.Vector3( 2, 1, 3 ) ); + + const helper = new THREE.Box3Helper( box, 0xffff00 ); + scene.add( helper ); + + +

المنشئ (Constructor)

+ +

[name]( [param:Box3 box], [param:Color color] )

+

+ [page:Box3 box] -- الـ Box3 المراد عرضه.
+ [page:Color color] -- (اختياري) لون الصندوق. الافتراضي هو 0xffff00.

+ + ينشئ صندوقًا جديدًا بإطار سلكي يمثل Box3 المُمرَّر. +

+ +

الخصائص (Properties)

+

انظر إلى الفئة الأساسية [page:LineSegments] للحصول على الخصائص المشتركة.

+ +

[property:Box3 box]

+

الـ Box3 المُعروض.

+ +

الطرق (Methods)

+

انظر إلى الفئة الأساسية [page:LineSegments] للحصول على الطرق المشتركة.

+ +

[method:undefined updateMatrixWorld]( [param:Boolean force] )

+

+ هذا يتجاوز الطريقة في الفئة الأساسية [page:Object3D] بحيث يُحدِّث أيضًا + الإطار السلكي للصندوق إلى مدى خاصية [page:Box3Helper.box .box]. +

+ +

[method:undefined dispose]()

+

+ يُطلِق الموارد المتعلقة بوحدة معالجة الرسومات التي تم تخصيصها من قبل هذه العيّنة. اتصل بهذه + الطريقة كلما لم يعد هذه العيّنة مستخدمة في تطبيقك. +

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/helpers/BoxHelper.html b/docs/api/ar/helpers/BoxHelper.html new file mode 100644 index 00000000000000..fe36d5d57b55d5 --- /dev/null +++ b/docs/api/ar/helpers/BoxHelper.html @@ -0,0 +1,77 @@ + + + + + + + + + + [page:Object3D] → [page:Line] → [page:LineSegments] → + +

[name]

+ +

+ كائن مساعد لإظهار الحدود المحيطة المتوازية مع محور العالم بشكل بصري + حول كائن. يتم التعامل مع الحدود المحيطة الفعلية باستخدام [page:Box3]، + هذا مجرد مساعد بصري للتصحيح. يمكن تغيير حجمه تلقائيًا باستخدام طريقة [page:BoxHelper.update] + عندما يتم تحويل الكائن الذي تم إنشاؤه منه. لاحظ أن يجب أن يكون للكائن + [page:BufferGeometry] لكي يعمل هذا، لذلك لن يعمل مع [page:Sprite Sprites]. +

+ +

مثال الكود

+ + + const sphere = new THREE.SphereGeometry(); + const object = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( 0xff0000 ) ); + const box = new THREE.BoxHelper( object, 0xffff00 ); + scene.add( box ); + + +

أمثلة (Examples)

+

+ [example:webgl_helpers WebGL / helpers]
+ [example:webgl_loader_nrrd WebGL / loader / nrrd]
+ [example:webgl_buffergeometry_drawrange WebGL / buffergeometry / drawrange] +

+ +

المنشئ (Constructor)

+

[name]( [param:Object3D object], [param:Color color] )

+

+ [page:Object3D object] -- (اختياري) الـ object3D المراد عرض الحدود المحيطة المتوازية مع محور العالم.
+ [page:Color color] -- (اختياري) قيمة ست عشرية تحدد لون الصندوق. الافتراضي هو 0xffff00.

+ + ينشئ صندوقًا جديدًا بإطار سلكي يحد الكائن المُمرَّر. يستخدم هذا داخليًا + [page:Box3.setFromObject] لحساب الأبعاد. لاحظ أن هذا يشمل أي أطفال. +

+ +

الخصائص (Properties)

+

انظر إلى الفئة الأساسية [page:LineSegments] للحصول على الخصائص المشتركة.

+ +

الطرق (Methods)

+

انظر إلى الفئة الأساسية [page:LineSegments] للحصول على الطرق المشتركة.

+ +

[method:undefined update]()

+

+ يُحدِّث هندسة المساعد لتطابق أبعاد الكائن، بما في ذلك أي أطفال. انظر [page:Box3.setFromObject]. +

+ +

[method:this setFromObject]( [param:Object3D object] )

+

+ [page:Object3D object] - [page:Object3D] لإنشاء المساعد منه.

+ + يُحدِّث صندوق الإطار السلكي للكائن المُمرَّر. +

+ +

[method:undefined dispose]()

+

+ يُطلِق الموارد المتعلقة بوحدة معالجة الرسومات التي تم تخصيصها من قبل هذه العيّنة. اتصل بهذه + الطريقة كلما لم يعد هذه العيّنة مستخدمة في تطبيقك. +

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/helpers/CameraHelper.html b/docs/api/ar/helpers/CameraHelper.html new file mode 100644 index 00000000000000..bc06940db58a58 --- /dev/null +++ b/docs/api/ar/helpers/CameraHelper.html @@ -0,0 +1,82 @@ + + + + + + + + + + [page:Object3D] → [page:Line] → [page:LineSegments] → + +

[name]

+ +

+ هذا يساعد في تصور ما يحتويه الكاميرا في مخروط الرؤية الخاص بها. يُصوِّر + مخروط الرؤية للكاميرا باستخدام [page:LineSegments].

+ يجب أن يكون [name] طفلًا للمشهد. +

+ +

مثال الكود

+ +const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 ); +const helper = new THREE.CameraHelper( camera ); +scene.add( helper ); + + +

أمثلة (Examples)

+

+ [example:webgl_camera WebGL / camera]
+ [example:webgl_geometry_extrude_splines WebGL / extrude / splines] +

+ +

المنشئ (Constructor)

+

[name]( [param:Camera camera] )

+

+ [page:Camera camera] -- الكاميرا المراد تصويرها.

+ + ينشئ [Name] جديدًا للكاميرا المحددة. +

+ +

الخصائص (Properties)

+

انظر إلى الفئة الأساسية [page:LineSegments] للحصول على الخصائص المشتركة.

+ +

[property:Camera camera]

+

الكاميرا المُعروضة.

+ +

[property:Object pointMap]

+

يحتوي هذا على النقاط المستخدمة لتصوير الكاميرا.

+ +

[property:Object matrix]

+

إشارة إلى [page:Object3D.matrixWorld camera.matrixWorld].

+ +

[property:Object matrixAutoUpdate]

+

+ انظر [page:Object3D.matrixAutoUpdate]. تعيين إلى `false` هنا كما يستخدم المساعد + [page:Object3D.matrixWorld matrixWorld] الخاص بالكاميرا. +

+ +

الطرق (Methods)

+

انظر إلى الفئة الأساسية [page:LineSegments] للحصول على الطرق المشتركة.

+ +

[method:undefined dispose]()

+

+ يُطلِق الموارد المتعلقة بوحدة معالجة الرسومات التي تم تخصيصها من قبل هذه العيّنة. اتصل بهذه + الطريقة كلما لم يعد هذه العيّنة مستخدمة في تطبيقك. +

+ +

+ [method:this setColors]( [param:Color frustum], [param:Color cone], [param:Color up], [param:Color target], [param:Color cross] ) +

+

يحدد ألوان المساعد.

+ +

[method:undefined update]()

+

يُحدِّث المساعد بناءً على projectionMatrix للكاميرا.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/helpers/DirectionalLightHelper.html b/docs/api/ar/helpers/DirectionalLightHelper.html new file mode 100644 index 00000000000000..a516b0ee5367bd --- /dev/null +++ b/docs/api/ar/helpers/DirectionalLightHelper.html @@ -0,0 +1,88 @@ + + + + + + + + + + [page:Object3D] → + +

[name]

+ +

+ كائن مساعد للمساعدة في تصور تأثير [page:DirectionalLight] على المشهد. + يتكون هذا من مستوى وخط يمثلان موقع الضوء واتجاهه. +

+ +

مثال الكود

+ + + const light = new THREE.DirectionalLight( 0xFFFFFF ); + const helper = new THREE.DirectionalLightHelper( light, 5 ); + scene.add( helper ); + + +

المنشئ (Constructor)

+ +

+ [name]( [param:DirectionalLight light], [param:Number size], [param:Hex color] ) +

+

+ [page:DirectionalLight light]-- الضوء المراد تصويره.

+ + [page:Number size] -- (اختياري) أبعاد المستوى. الافتراضي هو + `1`.

+ + [page:Hex color] -- (اختياري) إذا لم يتم تعيين هذا، فسيأخذ المساعد + لون الضوء. +

+ +

الخصائص (Properties)

+

انظر إلى الفئة الأساسية [page:Object3D] للحصول على الخصائص المشتركة.

+ +

[property:Line lightPlane]

+

يحتوي على شبكة الخط التي تظهر موقع الضوء الاتجاهي.

+ +

[property:DirectionalLight light]

+

+ إشارة إلى [page:DirectionalLight directionalLight] المُعروض. +

+ +

[property:Object matrix]

+

إشارة إلى [page:Object3D.matrixWorld matrixWorld] الخاص بالضوء.

+ +

[property:Object matrixAutoUpdate]

+

+ انظر [page:Object3D.matrixAutoUpdate]. تعيين إلى `false` هنا كما يستخدم المساعد + [page:Object3D.matrixWorld matrixWorld] الخاص بالضوء. +

+ +

[property:hex color]

+

+ معلمة اللون التي تم تمريرها في المُنشئ. الافتراضي هو `undefined`. إذا تغير هذا، + سيُحدِّث لون المساعد في المرة التالية التي يتم فيها استدعاء [page:.update update]. +

+ +

الطرق (Methods)

+

انظر إلى الفئة الأساسية [page:Object3D] للحصول على الخصائص المشتركة.

+ +

[method:undefined dispose]()

+

+ يُطلِق الموارد المتعلقة بوحدة معالجة الرسومات التي تم تخصيصها من قبل هذه العيّنة. اتصل بهذه + الطريقة كلما لم يعد هذه العيّنة مستخدمة في تطبيقك. +

+ +

[method:undefined update]()

+

+ يُحدِّث المساعد ليطابق موقع واتجاه [page:.light directionalLight] المُعروض. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/helpers/GridHelper.html b/docs/api/ar/helpers/GridHelper.html new file mode 100644 index 00000000000000..325524ccdb244b --- /dev/null +++ b/docs/api/ar/helpers/GridHelper.html @@ -0,0 +1,69 @@ + + + + + + + + + + [page:Object3D] → [page:Line] → + +

[name]

+ +

+ GridHelper هو كائن لتحديد الشبكات. الشبكات هي مصفوفات ثنائية الأبعاد + من الخطوط. +

+ +

مثال الكود

+ + + const size = 10; + const divisions = 10; + + const gridHelper = new THREE.GridHelper( size, divisions ); + scene.add( gridHelper ); + + +

أمثلة (Examples)

+ +

[example:webgl_helpers WebGL / helpers]

+ +

المنشئ (Constructor)

+ +

+ [name]( [param:number size], [param:Number divisions], [param:Color colorCenterLine], [param:Color colorGrid] ) +

+

+ size -- حجم الشبكة. الافتراضي هو 10.
+ divisions -- عدد التقسيمات عبر الشبكة. الافتراضي هو 10. +
+ colorCenterLine -- لون الخط الأوسط. يمكن أن يكون هذا + [page:Color]، قيمة ست عشرية واسم لون CSS. الافتراضي هو + 0x444444
+ colorGrid -- لون خطوط الشبكة. يمكن أن يكون هذا + [page:Color]، قيمة ست عشرية واسم لون CSS. الافتراضي هو + 0x888888 +

+

+ ينشئ [name] جديدًا بحجم 'size' ومقسَّمًا إلى 'divisions' شرائح + لكل جانب. الألوان اختيارية. +

+ +

الطرق (Methods)

+

انظر إلى الفئة الأساسية [page:LineSegments] للحصول على الطرق المشتركة.

+ +

[method:undefined dispose]()

+

+ يُطلِق الموارد المتعلقة بوحدة معالجة الرسومات التي تم تخصيصها من قبل هذه العيّنة. اتصل بهذه + الطريقة كلما لم يعد هذه العيّنة مستخدمة في تطبيقك. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/helpers/HemisphereLightHelper.html b/docs/api/ar/helpers/HemisphereLightHelper.html new file mode 100644 index 00000000000000..2648f61524f41c --- /dev/null +++ b/docs/api/ar/helpers/HemisphereLightHelper.html @@ -0,0 +1,85 @@ + + + + + + + + + + [page:Object3D] → + +

[name]

+ +

+ ينشئ مساعدًا بصريًا يتكون من [page:Mesh] كروي لـ + [page:HemisphereLight HemisphereLight]. +

+ +

مثال الكود

+ + + const light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 ); + const helper = new THREE.HemisphereLightHelper( light, 5 ); + scene.add( helper ); + + +

المنشئ (Constructor)

+ +

+ [name]( [param:HemisphereLight light], [param:Number sphereSize], + [param:Hex color] ) +

+

+ [page:HemisphereLight light] -- الضوء المراد تصويره.

+ + [page:Number size] -- حجم الشبكة المستخدمة لتصوير الضوء.

+ + [page:Hex color] -- (اختياري) إذا لم يتم تعيين هذا، فسيأخذ المساعد + لون الضوء. +

+ +

الخصائص (Properties)

+

انظر إلى الفئة الأساسية [page:Object3D] للحصول على الخصائص المشتركة.

+ +

[property:HemisphereLight light]

+

إشارة إلى HemisphereLight المُعروض.

+ +

[property:Object matrix]

+

+ إشارة إلى [page:Object3D.matrixWorld matrixWorld] الخاص بـ hemisphereLight. +

+ +

[property:Object matrixAutoUpdate]

+

+ انظر [page:Object3D.matrixAutoUpdate]. تعيين إلى `false` هنا كما يستخدم المساعد + [page:Object3D.matrixWorld matrixWorld] الخاص بـ hemisphereLight. +

+ +

[property:hex color]

+

+ معلمة اللون التي تم تمريرها في المُنشئ. الافتراضي هو `undefined`. إذا تغير هذا، + سيُحدِّث لون المساعد في المرة التالية التي يتم فيها استدعاء [page:.update update]. +

+ +

الطرق (Methods)

+

انظر إلى الفئة الأساسية [page:Object3D] للحصول على الطرق المشتركة.

+ +

[method:undefined dispose]()

+

+ يُطلِق الموارد المتعلقة بوحدة معالجة الرسومات التي تم تخصيصها من قبل هذه العيّنة. اتصل بهذه + الطريقة كلما لم يعد هذه العيّنة مستخدمة في تطبيقك. +

+ +

[method:undefined update]()

+

+ يُحدِّث المساعد ليطابق موقع واتجاه [page:.light]. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/helpers/PlaneHelper.html b/docs/api/ar/helpers/PlaneHelper.html new file mode 100644 index 00000000000000..0313a882a0a89c --- /dev/null +++ b/docs/api/ar/helpers/PlaneHelper.html @@ -0,0 +1,69 @@ + + + + + + + + + + [page:Object3D] → [page:Line] → [page:LineSegments] → + +

[name]

+ +

كائن مساعد لتصور [page:Plane].

+ +

مثال الكود

+ + + const plane = new THREE.Plane( new THREE.Vector3( 1, 1, 0.2 ), 3 ); + const helper = new THREE.PlaneHelper( plane, 1, 0xffff00 ); + scene.add( helper ); + + +

المنشئ (Constructor)

+ +

+ [name]( [param:Plane plane], [param:Float size], [param:Color hex] ) +

+

+ [page:Plane plane] -- الطائرة المراد تصويرها.
+ [page:Float size] -- (اختياري) طول جانب مساعد الطائرة. الافتراضي هو + 1.
+ [page:Color color] -- (اختياري) لون المساعد. الافتراضي هو + 0xffff00.

+ + ينشئ تمثيلًا جديدًا بإطار سلكي للطائرة المُمرَّرة. +

+ +

الخصائص (Properties)

+

انظر إلى الفئة الأساسية [page:Line] للحصول على الخصائص المشتركة.

+ +

[property:Plane plane]

+

[page:Plane plane] المُعروض.

+ +

[property:Float size]

+

أطوال جانب مساعد الطائرة.

+ +

الطرق (Methods)

+

انظر إلى الفئة الأساسية [page:LineSegments] للحصول على الطرق المشتركة.

+ +

[method:undefined updateMatrixWorld]( [param:Boolean force] )

+

+ هذا يتجاوز الطريقة في الفئة الأساسية [page:Object3D] بحيث يُحدِّث أيضًا + كائن المساعد وفقًا لخصائص [page:PlaneHelper.plane .plane] و [page:PlaneHelper.size .size]. +

+ +

[method:undefined dispose]()

+

+ يُطلِق الموارد المتعلقة بوحدة معالجة الرسومات التي تم تخصيصها من قبل هذه العيّنة. اتصل بهذه + الطريقة كلما لم يعد هذه العيّنة مستخدمة في تطبيقك. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/helpers/PointLightHelper.html b/docs/api/ar/helpers/PointLightHelper.html new file mode 100644 index 00000000000000..ed11fb3a0461ab --- /dev/null +++ b/docs/api/ar/helpers/PointLightHelper.html @@ -0,0 +1,91 @@ + + + + + + + + + + [page:Object3D] → [page:Mesh] → + +

[name]

+ +

+ يعرض كائن مساعد يتكون من [page:Mesh] كروي لتصوير + [page:PointLight]. +

+ +

مثال الكود

+ + + const pointLight = new THREE.PointLight( 0xff0000, 1, 100 ); + pointLight.position.set( 10, 10, 10 ); + scene.add( pointLight ); + + const sphereSize = 1; + const pointLightHelper = new THREE.PointLightHelper( pointLight, sphereSize ); + scene.add( pointLightHelper ); + + +

أمثلة (Examples)

+ +

[example:webgl_helpers WebGL / helpers]

+ +

المنشئ (Constructor)

+ +

+ [name]( [param:PointLight light], [param:Float sphereSize], [param:Hex color] ) +

+

+ [page:PointLight light] -- الضوء المراد تصويره.

+ + [page:Float sphereSize] -- (اختياري) حجم مساعد الكرة. + الافتراضي هو `1`.

+ + [page:Hex color] -- (اختياري) إذا لم يتم تعيين هذا، فسيأخذ المساعد + لون الضوء. +

+ +

الخصائص (Properties)

+

انظر إلى الفئة الأساسية [page:Mesh] للحصول على الخصائص المشتركة.

+ +

[property:PointLight light]

+

[page:PointLight] المُعروض.

+ +

[property:Object matrix]

+

+ إشارة إلى [page:Object3D.matrixWorld matrixWorld] الخاص بـ pointLight. +

+ +

[property:Object matrixAutoUpdate]

+

+ انظر [page:Object3D.matrixAutoUpdate]. تعيين إلى `false` هنا كما يستخدم المساعد + [page:Object3D.matrixWorld matrixWorld] الخاص بـ pointLight. +

+ +

[property:hex color]

+

+ معلمة اللون التي تم تمريرها في المُنشئ. الافتراضي هو `undefined`. إذا تغير هذا، + سيُحدِّث لون المساعد في المرة التالية التي يتم فيها استدعاء [page:.update update]. +

+ +

الطرق (Methods)

+

انظر إلى الفئة الأساسية [page:Mesh] للحصول على الطرق المشتركة.

+ +

[method:undefined dispose]()

+

+ يُطلِق الموارد المتعلقة بوحدة معالجة الرسومات التي تم تخصيصها من قبل هذه العيّنة. اتصل بهذه + الطريقة كلما لم يعد هذه العيّنة مستخدمة في تطبيقك. +

+ +

[method:undefined update]()

+

يُحدِّث المساعد ليطابق موقع [page:.light].

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/helpers/PolarGridHelper.html b/docs/api/ar/helpers/PolarGridHelper.html new file mode 100644 index 00000000000000..9537a0a535ab8c --- /dev/null +++ b/docs/api/ar/helpers/PolarGridHelper.html @@ -0,0 +1,77 @@ + + + + + + + + + + [page:Object3D] → [page:Line] → + +

[name]

+ +

+ PolarGridHelper هو كائن لتحديد الشبكات القطبية. الشبكات هي مصفوفات ثنائية الأبعاد + من الخطوط. +

+ +

مثال الكود

+ + + const radius = 10; + const sectors = 16; + const rings = 8; + const divisions = 64; + + const helper = new THREE.PolarGridHelper( radius, sectors, rings, divisions ); + scene.add( helper ); + + +

أمثلة (Examples)

+ +

[example:webgl_helpers WebGL / helpers]

+ +

المنشئ (Constructor)

+ +

+ [name]( [param:Number radius], [param:Number sectors], [param:Number rings], [param:Number divisions], [param:Color color1], [param:Color color2] ) +

+

+ radius -- نصف قطر الشبكة القطبية. يمكن أن يكون هذا أي رقم موجب. + الافتراضي هو 10.
+ sectors -- عدد القطاعات التي ستُقسَّم إليها الشبكة. يمكن أن يكون هذا + أي عدد صحيح موجب. الافتراضي هو 16.
+ rings -- عدد الحلقات. يمكن أن يكون هذا أي عدد صحيح موجب. الافتراضي هو + 8.
+ divisions -- عدد شرائح الخط المستخدمة لكل دائرة. يمكن أن يكون هذا + أي عدد صحيح موجب لا يقل عن 3. الافتراضي هو 64.
+ color1 -- اللون الأول المستخدم لعناصر الشبكة. يمكن أن يكون هذا + [page:Color]، قيمة ست عشرية واسم لون CSS. الافتراضي هو + 0x444444
+ color2 -- اللون الثاني المستخدم لعناصر الشبكة. يمكن أن يكون هذا + [page:Color]، قيمة ست عشرية واسم لون CSS. الافتراضي هو + 0x888888 +

+

+ ينشئ [name] جديدًا بقطر 'radius' مع 'sectors' عدد من القطاعات + و 'rings' عدد من الحلقات، حيث تُسَهَّل كل دائرة إلى + 'divisions' عدد من شرائح الخط. الألوان اختيارية. +

+ +

الطرق (Methods)

+

انظر إلى الفئة الأساسية [page:LineSegments] للحصول على الطرق المشتركة.

+ +

[method:undefined dispose]()

+

+ يُطلِق الموارد المتعلقة بوحدة معالجة الرسومات التي تم تخصيصها من قبل هذه العيّنة. اتصل بهذه + الطريقة كلما لم يعد هذه العيّنة مستخدمة في تطبيقك. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/helpers/SkeletonHelper.html b/docs/api/ar/helpers/SkeletonHelper.html new file mode 100644 index 00000000000000..162d873881890a --- /dev/null +++ b/docs/api/ar/helpers/SkeletonHelper.html @@ -0,0 +1,68 @@ + + + + + + + + + + [page:Object3D] → [page:Line] → [page:LineSegments] → + +

[name]

+ +

+ كائن مساعد للمساعدة في تصور [page:Skeleton Skeleton]. يتم + تقديم المساعد باستخدام [page:LineBasicMaterial LineBasicMaterial]. +

+ +

مثال الكود

+ + + const helper = new THREE.SkeletonHelper( skinnedMesh ); + scene.add( helper ); + + +

أمثلة (Examples)

+ +

+ [example:webgl_animation_skinning_blending WebGL / animation / skinning / blending]
+ [example:webgl_animation_skinning_morph WebGL / animation / skinning / morph]
+ [example:webgl_loader_bvh WebGL / loader / bvh ] +

+ +

المنشئ (Constructor)

+ +

[name]( [param:Object3D object] )

+

+ object -- عادةً مثيل من [page:SkinnedMesh]. ومع ذلك ، يمكن استخدام أي مثيل + من [page:Object3D] إذا كان يمثل تسلسل هرمي من [page:Bone Bone]s (عبر [page:Object3D.children]). +

+ +

الخصائص (Properties)

+ +

[property:Array bones]

+

قائمة العظام التي يعرضها المساعد كـ [page:Line Lines].

+ +

[property:Boolean isSkeletonHelper]

+

علامة للقراءة فقط للتحقق مما إذا كان الكائن المعطى هو من نوع [name].

+ +

[property:Object3D root]

+

الكائن الذي تم تمريره في المنشئ.

+ +

الطرق (Methods)

+

انظر الفئة الأساسية [page:LineSegments] للطرق المشتركة.

+ +

[method:undefined dispose]()

+

+ تحرير الموارد ذات الصلة بوحدة معالجة الرسومات التي تم تخصيصها من قبل هذه الحالة. استدعاء هذه + الطريقة كلما لم يعد يستخدم هذا الحال في تطبيقك. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/helpers/SpotLightHelper.html b/docs/api/ar/helpers/SpotLightHelper.html new file mode 100644 index 00000000000000..12111e2484230d --- /dev/null +++ b/docs/api/ar/helpers/SpotLightHelper.html @@ -0,0 +1,86 @@ + + + + + + + + + + [page:Object3D] → + +

[name]

+ +

+ يعرض هذا مساعد على شكل مخروط لـ [page:SpotLight]. +

+ +

مثال الكود

+ + + const spotLight = new THREE.SpotLight( 0xffffff ); + spotLight.position.set( 10, 10, 10 ); + scene.add( spotLight ); + + const spotLightHelper = new THREE.SpotLightHelper( spotLight ); + scene.add( spotLightHelper ); + + +

أمثلة (Examples)

+

[example:webgl_lights_spotlights WebGL/ lights / spotlights ]

+ +

المنشئ (Constructor)

+ +

[name]( [param:SpotLight light], [param:Hex color] )

+

+ [page:SpotLight light] -- [page:SpotLight] المراد تصوره. +

+ + [page:Hex color] -- (اختياري) إذا لم يتم تعيين هذا ، فسيأخذ المساعد + لون الضوء. +

+ +

الخصائص (Properties)

+

انظر الفئة الأساسية [page:Object3D] للخصائص المشتركة.

+ +

[property:LineSegments cone]

+

[page:LineSegments] المستخدمة لتصور الضوء.

+ +

[property:SpotLight light]

+

إشارة إلى [page:SpotLight] المرئي.

+ +

[property:Object matrix]

+

إشارة إلى [page:Object3D.matrixWorld matrixWorld] الخاص بـ spotLight.

+ +

[property:Object matrixAutoUpdate]

+

+ انظر [page:Object3D.matrixAutoUpdate]. تعيين إلى `false` هنا كما يستخدم المساعد + [page:Object3D.matrixWorld matrixWorld] الخاص بـ spotLight. +

+ +

[property:hex color]

+

+ معلمة اللون الممررة في المنشئ. الافتراضي هو `undefined`. إذا + تغير هذا ، سيتحدث لون المساعد في المرة التالية + [page:.update update] يتم استدعاؤه. +

+ +

الطرق (Methods)

+

انظر الفئة الأساسية [page:Object3D] للطرق المشتركة.

+ +

[method:undefined dispose]()

+

+ تحرير الموارد ذات الصلة بوحدة معالجة الرسومات التي تم تخصيصها من قبل هذه الحالة. استدعاء هذه + الطريقة كلما لم يعد يستخدم هذا الحال في تطبيقك. +

+ +

[method:undefined update]()

+

تحديث مساعد الضوء.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + \ No newline at end of file diff --git a/docs/api/ar/lights/AmbientLight.html b/docs/api/ar/lights/AmbientLight.html new file mode 100644 index 00000000000000..9a257904840d92 --- /dev/null +++ b/docs/api/ar/lights/AmbientLight.html @@ -0,0 +1,53 @@ + + + + + + + + + + [page:Object3D] → [page:Light] → + +

[name]

+ +

+ يضيء هذا الضوء جميع الأشياء في المشهد بشكل متساوٍ على مستوى العالم.

+ + لا يمكن استخدام هذا الضوء لرمي الظلال لأنه لا يحتوي على اتجاه. +

+ +

مثال الكود

+ + + const light = new THREE.AmbientLight( 0x404040 ); // soft white light + scene.add( light ); + + +

المنشئ (Constructor)

+ +

[name]( [param:Integer color], [param:Float intensity] )

+

+ [page:Integer color] - (اختياري) قيمة عددية لمكون RGB من + اللون. الافتراضي هو 0xffffff.
+ [page:Float intensity] - (اختياري) قيمة عددية لـ + قوة / شدة الضوء. الافتراضي هو 1.

+ + ينشئ [name] جديدًا. +

+ +

الخصائص (Properties)

+

انظر الفئة الأساسية [page:Light Light] للخصائص المشتركة.

+ +

[property:Boolean isAmbientLight]

+

علامة للقراءة فقط للتحقق مما إذا كان الكائن المعطى هو من نوع [name].

+ +

الطرق (Methods)

+

انظر الفئة الأساسية [page:Light Light] للطرق المشتركة.

+

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/lights/AmbientLightProbe.html b/docs/api/ar/lights/AmbientLightProbe.html new file mode 100644 index 00000000000000..fae5e681d8e8fd --- /dev/null +++ b/docs/api/ar/lights/AmbientLightProbe.html @@ -0,0 +1,49 @@ + + + + + + + + + + [page:Object3D] → [page:Light] → [page:LightProbe] + +

[name]

+ +

+ تعتبر مسابير الضوء طريقة بديلة لإضافة الضوء إلى مشهد ثلاثي الأبعاد. + AmbientLightProbe هي بيانات تقدير الضوء لضوء محيط واحد + في المشهد. لمزيد من المعلومات حول مسابير الضوء ، انتقل إلى + [page:LightProbe]. +

+ +

المنشئ (Constructor)

+ +

[name]( [param:Color color], [param:Float intensity] )

+

+ [page:Color color] - (اختياري) مثيل من Color ، سلسلة تمثل + لون أو رقم يمثل لونًا.
+ [page:Float intensity] - (اختياري) قيمة عددية لـ + شدة مسبار الضوء. الافتراضي هو 1.

+ + ينشئ [name] جديدًا. +

+ +

الخصائص (Properties)

+

+ انظر الفئة الأساسية [page:LightProbe LightProbe] للخصائص المشتركة. +

+ +

[property:Boolean isAmbientLightProbe]

+

علامة للقراءة فقط للتحقق مما إذا كان الكائن المعطى هو من نوع [name].

+ +

الطرق (Methods)

+

انظر الفئة الأساسية [page:LightProbe LightProbe] للطرق المشتركة.

+

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/lights/DirectionalLight.html b/docs/api/ar/lights/DirectionalLight.html new file mode 100644 index 00000000000000..355dc7924558cd --- /dev/null +++ b/docs/api/ar/lights/DirectionalLight.html @@ -0,0 +1,146 @@ + + + + + + + + + + [page:Object3D] → [page:Light] → + +

[name]

+ +

+ ضوء ينبعث في اتجاه محدد. سيتصرف هذا الضوء كما لو كان بعيدًا لانهائيًا وأن الأشعة المنبعثة منه كلها + متوازية. الاستخدام الشائع لهذا هو محاكاة ضوء النهار ؛ الشمس + بعيد بما يكفي بحيث يمكن اعتبار موقعه لانهائيًا ، و + جميع أشعة الضوء القادمة منه متوازية.

+ + يمكن لهذا الضوء إلقاء الظلال - انظر صفحة [page:DirectionalLightShadow] + للتفاصيل. +

+ +

ملاحظة حول الموقف والهدف والدوران

+

+ نقطة شائعة من الالتباس بالنسبة للأضواء الاتجاهية هي أن تحديد + لا يؤثر التدوير. هذا لأن DirectionalLight في three.js هو + ما يعادل ما يسمى بـ "Target Direct Light" في غيره + التطبيقات.

+ + هذا يعني أن اتجاهه يتم حسابه كمؤشر من ضوء + [page:Object3D.position position] إلى [page:.target target] الموقف + (على عكس "Free Direct Light" التي لديها فقط دوران + مكون).

+ + السبب في ذلك هو السماح للضوء بإلقاء الظلال - ال + [page:.shadow shadow] تحتاج الكاميرا إلى موقف لحساب الظلال + من.

+ + انظر خاصية [page:.target target] أدناه للحصول على تفاصيل حول تحديث + الهدف. +

+ +

مثال للكود

+ + + // ضوء اتجاهي أبيض بشدة نصفية يشرق من الأعلى. + const directionalLight = new THREE.DirectionalLight( 0xffffff, 0.5 ); + scene.add( directionalLight ); + + +

أمثلة (Examples)

+

+ [example:misc_controls_fly controls / fly ]
+ [example:webgl_effects_parallaxbarrier effects / parallaxbarrier ]
+ [example:webgl_effects_stereo effects / stereo ]
+ [example:webgl_geometry_extrude_splines geometry / extrude / splines ]
+ [example:webgl_materials_bumpmap materials / bumpmap ] +

+ +

المنشئ (Constructor)

+ +

[name]( [param:Color color], [param:Float intensity] )

+

+ [page:Color color] - (اختياري) مثيل من Color ، سلسلة تمثل + لون أو رقم يمثل لونًا.
+ [page:Float intensity] - (اختياري) قيمة عددية لـ + شدة مسبار الضوء. الافتراضي هو 1.

+ + ينشئ [name] جديدًا. +

+ +

الخصائص (Properties)

+ +

انظر قائمة [page:Light Light] الأساسية للخصائص المشتركة.

+ +

[property:Boolean castShadow]

+

+ إذا تم تعيينه على `true` فإن الضوء سيلقي ظلالًا ديناميكية. تحذير: هذا هو + باهظ الثمن ويتطلب التلاعب لجعل الظلال تبدو صحيحة. انظر + [page:DirectionalLightShadow] للتفاصيل. الافتراضي هو `false`. +

+ +

[property:Boolean isDirectionalLight]

+

علامة للقراءة فقط للتحقق مما إذا كان الكائن المعطى هو من نوع [name].

+ +

[property:Vector3 position]

+

+ يتم تعيين هذا يساوي [page:Object3D.DEFAULT_UP] (0، 1، 0) ، بحيث + الضوء يشرق من الأعلى إلى الأسفل. +

+ +

[property:DirectionalLightShadow shadow]

+

+ [page:DirectionalLightShadow] يستخدم لحساب الظلال لهذا الضوء. +

+ +

[property:Object3D target]

+

+ يشير DirectionalLight من [page:.position position] إلى + target.position. الموضع الافتراضي للهدف هو `(0، 0، 0)`.
+ + ملاحظة: لتغيير موضع الهدف إلى أي شيء آخر غير + الافتراضي ، يجب إضافته إلى [page:Scene scene] باستخدام +

+ + scene.add( light.target ); + +

+ هذا حتى يتم تحديث [page:Object3D.matrixWorld matrixWorld] الخاص بالهدف + تلقائيًا كل إطار.

+ + من الممكن أيضًا تعيين الهدف ليكون كائنًا آخر في المشهد + (أي شيء يحتوي على خاصية [page:Object3D.position position]) ، مثل: +

+ + const targetObject = new THREE.Object3D(); + scene.add(targetObject); + + light.target = targetObject; + +

سيتبع directionalLight الكائن الهدف الآن.

+ +

الطرق (Methods)

+ +

انظر الفئة الأساسية [page:Light Light] للطرق المشتركة.

+ +

[method:undefined dispose]()

+

+ تحرير الموارد ذات الصلة بوحدة معالجة الرسومات التى تم تخصيصها من قبل هذه الحالة. استدعاء هذه + الطریقة كلما لم يعد يستخدم هذه الحال فى تطبیقك. +

+ +

[method:this copy]( [param:DirectionalLight source] )

+

+ ينسخ قيمة جمیع خصائص من [page:DirectionalLight source] + إلى هذا DirectionalLight. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/lights/HemisphereLight.html b/docs/api/ar/lights/HemisphereLight.html new file mode 100644 index 00000000000000..cfac6af9969049 --- /dev/null +++ b/docs/api/ar/lights/HemisphereLight.html @@ -0,0 +1,93 @@ + + + + + + + + + + [page:Object3D] → [page:Light] → + +

[name]

+ +

+ مصدر ضوء موضوع مباشرة فوق المشهد ، مع تلاشي اللون من + لون السماء إلى لون الأرض.

+ لا يمكن استخدام هذا الضوء لإلقاء الظلال. +

+ +

مثال للكود

+ + const light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 ); + scene.add( light ); + + +

أمثلة (Examples)

+ +

+ [example:webgl_animation_skinning_blending animation / skinning / blending ]
+ [example:webgl_lights_hemisphere lights / hemisphere ]
+ [example:misc_controls_pointerlock controls / pointerlock ]
+ [example:webgl_loader_collada_kinematics loader / collada / kinematics ]
+ [example:webgl_loader_stl loader / stl ] +

+ +

المنشئ (Constructor)

+

+ [name]( [param:Integer skyColor], [param:Integer groundColor], + [param:Float intensity] ) +

+

+ [page:Integer skyColor] - (optional) لون سداسي عشري للسماء. الافتراضي + هو 0xffffff.
+ [page:Integer groundColor] - (optional) لون سداسي عشري للأرض. + الافتراضي هو 0xffffff.
+ [page:Float intensity] - (optional) قيمة رقمية لـ + قوة / شدة الضوء. الافتراضي هو 1.

+ + يخلق جديد [name]. +

+ +

الخصائص (Properties)

+

انظر قائمة [page:Light Light] الأساسية للخصائص المشتركة.

+ +

[property:Float color]

+

+ لون سماء الضوء ، كما تم تمريره في المُنشئ. الافتراضي هو جديد + [page:Color] محدد على الأبيض (0xffffff). +

+ +

[property:Float groundColor]

+

+ لون أرضية الضوء ، كما تم تمريره في المُنشئ. الافتراضي هو جديد + [page:Color] محدد على الأبيض (0xffffff). +

+ +

[property:Boolean isHemisphereLight]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معينًا من نوع [name].

+ +

[property:Vector3 position]

+

+ يتم تعيين هذا يساوي [page:Object3D.DEFAULT_UP] (0، 1، 0) ، بحيث + يشرق الضوء من أعلى إلى أسفل. +

+ +

الطرق (Methods)

+ +

انظر قائمة [page:Light Light] الأساسية للطرق المشتركة.

+ +

[method:this copy]( [param:HemisphereLight source] )

+

+ ينسخ قيمة [page:.color color] و[page:.intensity intensity] و + [page:.groundColor groundColor] من ضوء المصدر [page:Light source] إلى + هذا واحد. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/lights/HemisphereLightProbe.html b/docs/api/ar/lights/HemisphereLightProbe.html new file mode 100644 index 00000000000000..970d74e4bb9675 --- /dev/null +++ b/docs/api/ar/lights/HemisphereLightProbe.html @@ -0,0 +1,53 @@ + + + + + + + + + + [page:Object3D] → [page:Light] → [page:LightProbe] + +

[name]

+ +

+ مسابير الضوء هي طريقة بديلة لإضافة الضوء إلى مشهد ثلاثي الأبعاد. + HemisphereLightProbe هي بيانات تقدير الضوء لضوء نصف كرة واحد + في المشهد. لمزيد من المعلومات حول مسابير الضوء ، انتقل إلى + [page:LightProbe]. +

+ +

المنشئ (Constructor)

+ +

+ [name]( [param:Color skyColor], [param:Color groundColor], [param:Float intensity] ) +

+

+ [page:Color skyColor] - (اختياري) مثيل من Color ، سلسلة + يمثل لونًا أو رقمًا يمثل لونًا.
+ [page:Color groundColor] - (اختياري) مثيل من Color ، سلسلة + يمثل لونًا أو رقمًا يمثل لونًا.
+ [page:Float intensity] - (اختياري) قيمة رقمية لـ + شدة مسبار الضوء. الافتراضي هو 1.

+ + يخلق جديد [name]. +

+ +

الخصائص (Properties)

+

+ انظر قائمة [page:LightProbe LightProbe] الأساسية للخصائص المشتركة. +

+ +

[property:Boolean isHemisphereLightProbe]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معينًا من نوع [name].

+ +

الطرق (Methods)

+

انظر قائمة [page:LightProbe LightProbe] الأساسية للطرق المشتركة.

+

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/lights/Light.html b/docs/api/ar/lights/Light.html new file mode 100644 index 00000000000000..19b862c464b51b --- /dev/null +++ b/docs/api/ar/lights/Light.html @@ -0,0 +1,79 @@ + + + + + + + + + + [page:Object3D] → + +

[name]

+ +

+ الفئة الأساسية المجردة للأضواء - ترث جميع أنواع الأضواء الأخرى + الخصائص والطرق الموصوفة هنا. +

+ +

المنشئ (Constructor)

+ +

[name]( [param:Integer color], [param:Float intensity] )

+

+ [page:Integer color] - (اختياري) لون سداسي عشري للضوء. الافتراضي + هو 0xffffff (أبيض).
+ [page:Float intensity] - (اختياري) قيمة رقمية لـ + قوة / شدة الضوء. الافتراضي هو 1.

+ يخلق جديد [name]. يرجى ملاحظة أنه لا يُقصد منه أن يتم استدعاؤه مباشرةً + (استخدم واحدًا من الفئات المشتقة بدلاً من ذلك). +

+ +

الخصائص (Properties)

+

انظر قائمة [page:Object3D Object3D] الأساسية للخصائص المشتركة.

+ +

[property:Color color]

+

+ لون الضوء. يعود إلى جديد [page:Color] محدد على الأبيض ، إذا لم + تمرير في المُنشئ.
+

+ +

[property:Float intensity]

+

+ شدة الضوء ، أو قوته.
+ وحدات الشدة تعتمد على نوع الضوء.
+ الافتراضي - `1.0`. +

+ +

[property:Boolean isLight]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معينًا من نوع [name].

+ +

الطرق (Methods)

+

انظر قائمة [page:Object3D Object3D] الأساسية للطرق المشتركة.

+ +

[method:undefined dispose]()

+

+ طريقة التخلص المجردة للفئات التي تمتد هذه الفئة ؛ تنفذه + الفئات الفرعية التي لديها موارد قابلة للتصرف متعلقة بالجهاز. +

+ +

[method:this copy]( [param:Light source] )

+

+ ينسخ قيمة [page:.color color] و[page:.intensity intensity] + من ضوء المصدر [page:Light source] إلى + هذا واحد. +

+ +

[method:Object toJSON]( [param:Object meta] )

+

+ meta - كائن يحتوي على بيانات تعريفية مثل المواد والقوام لـ + objects.
+ حول الضوء إلى three.js + [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format]. +

+

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/lights/LightProbe.html b/docs/api/ar/lights/LightProbe.html new file mode 100644 index 00000000000000..8fbecfda89b000 --- /dev/null +++ b/docs/api/ar/lights/LightProbe.html @@ -0,0 +1,78 @@ + + + + + + + + + + [page:Object3D] → [page:Light] → + +

[name]

+ +

+ مسابير الضوء هي طريقة بديلة لإضافة الضوء إلى مشهد ثلاثي الأبعاد. على عكس + مصادر الضوء الكلاسيكية (على سبيل المثال الاتجاهية ، النقطية أو الأضواء الموجهة) ، الضوء + لا تنبعث المسابير. بدلاً من ذلك ، يخزنون معلومات حول الضوء + يمر عبر المساحة ثلاثية الأبعاد. أثناء التقديم ، يتم تقريب الضوء الذي يضرب 3D + الكائن باستخدام بيانات من مسبار الضوء. +

+ +

+ عادةً ما يتم إنشاء مسابير الضوء من خرائط البيئة (الإشعاع). جناح + [page:LightProbeGenerator] يمكن استخدامه لإنشاء مسابير ضوء من + مثيلات [page:CubeTexture] أو [page:WebGLCubeRenderTarget]. ومع ذلك، + يمكن توفير بيانات تقدير الضوء أيضًا في أشكال أخرى على سبيل المثال من قبل WebXR. + هذا يتيح تقديم محتوى الواقع المعزز الذي يتفاعل مع + إضاءة العالم الحقيقي. +

+ +

+ تدعم تطبيق المسبار الحالي في three.js ما يسمى بـ + مسابير ضوء ناعمة. هذا النوع من مسبار الضوء هو وظيفيًا مكافئ لـ + خريطة بيئة إشعاعية. +

+ +

أمثلة (Examples)

+

+ [example:webgl_lightprobe WebGL / light probe ]
+ [example:webgl_lightprobe_cubecamera WebGL / light probe / cube camera ] +

+ +

المنشئ (Constructor)

+ +

[name]( [param:SphericalHarmonics3 sh], [param:Float intensity] )

+

+ [page:SphericalHarmonics3 sh] - (اختياري) مثيل من + [page:SphericalHarmonics3].
+ [page:Float intensity] - (اختياري) قيمة رقمية لـ + شدة مسبار الضوء. الافتراضي هو 1.

+ + يخلق جديد [name]. +

+ +

الخصائص (Properties)

+

+ انظر قائمة [page:Light Light] الأساسية للخصائص المشتركة. جناح + خاصية [page:Light.color color] لا يتم تقديرها حاليًا وبالتالي لديها + لا تأثير. +

+ +

[property:Boolean isLightProbe]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معينًا من نوع [name].

+ +

[property:SphericalHarmonics3 sh]

+

+ يستخدم مسبار الضوء التجانسات المجالية لتشفير معلومات التحديد. +

+ +

الطرق (Methods)

+

انظر قائمة [page:Light Light] الأساسية للطرق المشتركة.

+

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/lights/PointLight.html b/docs/api/ar/lights/PointLight.html new file mode 100644 index 00000000000000..9b1fa81092b530 --- /dev/null +++ b/docs/api/ar/lights/PointLight.html @@ -0,0 +1,131 @@ + + + + + + + + + + [page:Object3D] → [page:Light] → + +

[name]

+ +

+ ضوء ينبعث من نقطة واحدة في جميع الاتجاهات. حالة استخدام شائعة لهذا هي تكرار الضوء الذي ينبعث من مصباح عاري + .

+ + يمكن لهذا الضوء إلقاء الظلال - انظر صفحة [page:PointLightShadow] للحصول على + تفاصيل. +

+ +

مثال للكود

+ + + const light = new THREE.PointLight( 0xff0000, 1, 100 ); + light.position.set( 50, 50, 50 ); + scene.add( light ); + + +

أمثلة (Examples)

+ +

+ [example:webgl_lights_pointlights lights / pointlights ]
+ [example:webgl_effects_anaglyph effects / anaglyph ]
+ [example:webgl_geometry_text geometry / text ]
+ [example:webgl_lensflares lensflares ] +

+ +

المنشئ (Constructor)

+ +

+ [name]( [param:Integer color], [param:Float intensity], [param:Number distance], [param:Float decay] ) +

+

+ [page:Integer color] - (اختياري) لون سداسي عشري للضوء. الافتراضي + هو 0xffffff (أبيض).
+ [page:Float intensity] - (اختياري) قيمة رقمية لقوة / شدة الضوء. + الافتراضي هو 1.
+ [page:Number distance] - المدى الأقصى للضوء. الافتراضي هو 0 (لا + حدود).
+ [page:Float decay] - مقدار تضاؤل الضوء على طول مسافة الضوء. + الافتراضي هو 2.

+ + إنشاء جديد [name]. +

+ +

الخصائص (Properties)

+

انظر إلى قائمة [page:Light Light] للخصائص المشتركة.

+ +

[property:Boolean castShadow]

+

+ إذا تم تعيينه إلى `true`، ستلقي الضوء ظلالًا ديناميكية. تحذير: هذا مكلف ويتطلب التعديل للحصول على الظلال المناسبة. راجع [page:PointLightShadow] للحصول على التفاصيل. الافتراضي هو `false`. +

+ +

[property:Float decay]

+

+ مقدار تضاؤل الضوء على طول مسافة الضوء. القيمة الافتراضية هي + `2`.
+ في سياق التصيير الفعلي الصحيح ، يجب عدم تغيير القيمة الافتراضية. +

+ +

[property:Float distance]

+

+ عندما تكون المسافة صفرًا ، سيتلاشى الضوء وفقًا لقانون المربع المعكوس + إلى مسافة لانهائية. عندما تكون المسافة غير صفرية ، سيتلاشى الضوء + وفقًا لقانون المربع المعكوس حتى قرب نقطة قطع المسافة ، حيث + سيتلاشى بسرعة وبسلاسة إلى 0. بطبعه، ليست نقطة القطع فيزيائية صحيحة. +

+

القيمة الافتراضية هي `0.0`.

+ +

[property:Float intensity]

+

+ شدة الضوء. القيمة الافتراضية هي `1`.
+ الشدة هي شدة إضاءة الضوء المقاسة بالشمعات + (cd).

+ + تغيير الشدة سيغير أيضًا قوة الضوء. +

+ +

[property:Float power]

+

+ قوة الضوء.
+ الطاقة هي قوة إضاءة الضوء المقاسة باللومن (lm). +

+ + تغيير الطاقة سيغير أيضًا شدة الضوء. +

+ +

[property:PointLightShadow shadow]

+

+ [page:PointLightShadow] يستخدم لحساب ظلال هذا الضوء.

+ + [page:LightShadow.camera كاميرا] lightShadow مُعَدَّلَهُ إلى + [page:PerspectiveCamera] مع [page:PerspectiveCamera.fov fov] من 90، + [page:PerspectiveCamera.aspect aspect] من 1، [page:PerspectiveCamera.near near] + clipping plane at 0.5 and [page:PerspectiveCamera.far far] clipping + plane at 500. +

+ +

الطرق (Methods)

+

انظر إلى قائمة [page:Light Light] للطرق المشتركة.

+ +

[method:undefined dispose]()

+

+ تحرير المصادر المتعلقة بالجهاز GPU التي تم تخصيصها من قبل هذه المثيل. اتصل بهذه + الطريقة كلما لم يُستخدَم هذه المثيل في تطبيقك. +

+ +

[method:this copy]( [param:PointLight source] )

+

+ نسخ قِيَم جميع خصائص [page:PointLight source] إلى + هذه PointLight. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/lights/RectAreaLight.html b/docs/api/ar/lights/RectAreaLight.html new file mode 100644 index 00000000000000..3d25e2e7f16775 --- /dev/null +++ b/docs/api/ar/lights/RectAreaLight.html @@ -0,0 +1,109 @@ + + + + + + + + + + [page:Object3D] → [page:Light] → + +

[name]

+ +

+ ينبعث RectAreaLight بالضوء بشكل موحد عبر وجه سطح مستطيل. يمكن استخدام هذا النوع من الضوء لمحاكاة مصادر الضوء مثل النوافذ المشرقة أو الإضاءة المخططة.

+ + ملاحظات هامة: +

+
    +
  • لا يوجد دعم للظلال.
  • +
  • + يتم دعم [page:MeshStandardMaterial MeshStandardMaterial] و + [page:MeshPhysicalMaterial MeshPhysicalMaterial] فقط. +
  • +
  • + يجب عليك تضمين + [link:https://threejs.org/examples/jsm/lights/RectAreaLightUniformsLib.js RectAreaLightUniformsLib] في مشهدك واستدعاء `init()`. +
  • +
+ +

مثال للكود

+ + + const width = 10; + const height = 10; + const intensity = 1; + const rectLight = new THREE.RectAreaLight( 0xffffff, intensity, width, height ); + rectLight.position.set( 5, 5, 0 ); + rectLight.lookAt( 0, 0, 0 ); + scene.add( rectLight ) + + const rectLightHelper = new RectAreaLightHelper( rectLight ); + rectLight.add( rectLightHelper ); + + +

أمثلة (Examples)

+ +

[example:webgl_lights_rectarealight WebGL / rectarealight ]

+ +

المنشئ (Constructor)

+ +

+ [name]( [param:Integer color], [param:Float intensity], [param:Float width], [param:Float height] ) +

+

+ [page:Integer color] - (اختياري) لون سداسي عشري للضوء. الافتراضي + هو 0xffffff (أبيض).
+ [page:Float intensity] - (اختياري) شدة الضوء ، أو سطوعه. + الافتراضي هو 1.
+ [page:Float width] - (اختياري) عرض الضوء. الافتراضي هو 10.
+ [page:Float height] - (اختياري) ارتفاع الضوء. الافتراضي هو 10.

+ + إنشاء جديد [name]. +

+ +

الخصائص (Properties)

+

انظر إلى قائمة [page:Light Light] للخصائص المشتركة.

+ +

[property:Float height]

+

ارتفاع الضوء.

+ +

[property:Float intensity]

+

+ شدة الضوء. القيمة الافتراضية هي `1`.
+ الشدة هي الإضاءة (السطوع) للضوء المقاسة بالنيتات + (cd/m^2).

+ + تغيير الشدة سيغير أيضًا قوة الضوء. +

+ +

[property:Boolean isRectAreaLight]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معينًا من نوع [name].

+ +

[property:Float power]

+

+ قوة الضوء.
+ الطاقة هي قوة إضاءة الضوء المقاسة باللومن (lm). +

+ + تغيير الطاقة سيغير أيضًا شدة الضوء. +

+ +

[property:Float width]

+

عرض الضوء.

+ +

الطرق (Methods)

+

انظر إلى قائمة [page:Light Light] للطرق المشتركة.

+ +

[method:this copy]( [param:RectAreaLight source] )

+

+ نسخ قِيَم جميع خصائص [page:RectAreaLight source] إلى + هذه RectAreaLight. +

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/lights/SpotLight.html b/docs/api/ar/lights/SpotLight.html new file mode 100644 index 00000000000000..bef43422d032cf --- /dev/null +++ b/docs/api/ar/lights/SpotLight.html @@ -0,0 +1,180 @@ + + + + + + + + + + [page:Object3D] → [page:Light] → + +

[name]

+ +

+ يتم إصدار هذا الضوء من نقطة واحدة في اتجاه واحد ، على طول مخروط + يزداد حجمه كلما ابتعد عن الضوء.

+ يمكن لهذا الضوء إلقاء الظلال - انظر صفحة [page:SpotLightShadow] للحصول على + تفاصيل. +

+ +

مثال للكود

+ + // مصباح كاشف أبيض يشرق من الجانب ، يتم تعديله بواسطة ملمس ، يلقي ظلاً + + const spotLight = new THREE.SpotLight( 0xffffff ); + spotLight.position.set( 100, 1000, 100 ); + spotLight.map = new THREE.TextureLoader().load( url ); + + spotLight.castShadow = true; + + spotLight.shadow.mapSize.width = 1024; + spotLight.shadow.mapSize.height = 1024; + + spotLight.shadow.camera.near = 500; + spotLight.shadow.camera.far = 4000; + spotLight.shadow.camera.fov = 30; + + scene.add( spotLight ); + + +

أمثلة (Examples)

+

+ [example:webgl_lights_spotlight lights / spotlight ]
+ [example:webgl_lights_spotlights lights / spotlights ] +

+ +

المنشئ (Constructor)

+

+ [name]( [param:Integer color], [param:Float intensity], [param:Float distance], [param:Radians angle], [param:Float penumbra], [param:Float decay] ) +

+

+ [page:Integer color] - (اختياري) لون سداسي عشري للضوء. الافتراضي + هو 0xffffff (أبيض).
+ [page:Float intensity] - (اختياري) قيمة رقمية لقوة / شدة الضوء. + الافتراضي هو 1.
+ [page:Float distance] - المدى الأقصى للضوء. الافتراضي هو 0 (لا + حدود).
+ [page:Radians angle] - أقصى زاوية لانتشار الضوء من + اتجاهه الذي يعتبر حدًا أعلى Math.PI/2.
+ [page:Float penumbra] - نسبة مخروط الضوء الذي يتلاشى + بسبب الظلال الجانبية. يأخذ قيم بين الصفر و 1. الافتراضي هو صفر.
+ [page:Float decay] - مقدار تضاؤل الضوء على طول مسافة ال + ضوء.

+ إنشاء جديد [name]. +

+ +

الخصائص (Properties)

+

انظر إلى قائمة [page:Light Light] للخصائص المشتركة.

+ +

[property:Float angle]

+

+ أقصى مدى للضوء الكاشف ، بالراديان ، من اتجاهه. يجب أن يكون + لا يزيد عن `Math.PI/2`. القيمة الافتراضية هي `Math.PI/3`. +

+ +

[property:Boolean castShadow]

+

+ إذا تم تعيينه على `true` ، فسيقوم الضوء بإلقاء ظلال ديناميكية. تحذير: هذا + مكلف ويتطلب التعديل لجعل الظلال تبدو صحيحة. انظر + [page:SpotLightShadow] للحصول على التفاصيل. الافتراضي هو `false`. +

+ +

[property:Float decay]

+

+ مقدار تضاؤل الضوء على طول مسافة الضوء. القيمة الافتراضية هي + `2`.
+ في سياق التصيير الفعلي الصحيح ، يجب عدم تغيير القيمة الافتراضية. +

+ +

[property:Float distance]

+

+ عندما تكون المسافة صفرًا ، سيتلاشى الضوء وفقًا لقانون المربع المعكوس + إلى مسافة لانهائية. عندما تكون المسافة غير صفرية ، سيتلاشى الضوء + وفقًا لقانون المربع المعكوس حتى قرب نقطة قطع المسافة ، حيث + سيتلاشى بسرعة وبسلاسة إلى `0`. بطبعه، ليست نقطة القطع فيزيائية صحيحة. +

+

القيمة الافتراضية هى `0.0`.

+ +

[property:Float intensity]

+

+ شدة الضوء. القيمة الافتراضية هي `1`.
+ الشدة هى شدة إضاءة الضوء المقاسة بالشمعات(cd).

+ تغيير الشدة سيغير أيضًا قوة الضوء. +

+ +

[property:Boolean isSpotLight]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معينًا من نوع [name].

+ +

[property:Float penumbra]

+

+ نسبة مخروط الضوء الذي يتلاشى بسبب الظلال الجانبية. يأخذ + قيم بين الصفر و 1. القيمة الافتراضية هي `0.0`. +

+ +

[property:Vector3 position]

+

+ يتم تعيين هذا مساويًا لـ [page:Object3D.DEFAULT_UP] (0، 1، 0) ، بحيث + الضوء يشرق من الأعلى إلى الأسفل. +

+ +

[property:Float power]

+

+ قوة الضوء.
+ الطاقة هي قوة إضاءة الضوء المقاسة باللومن (lm).

+ تغيير الطاقة سيغير أيضًا شدة الضوء. +

+ +

[property:SpotLightShadow shadow]

+

[page:SpotLightShadow] يستخدم لحساب ظلال هذا الضوء.

+ +

[property:Object3D target]

+

+ يشير Spotlight من [page:.position position] إلى + target.position. موقع الهدف الافتراضي هو `(0، 0، 0)`.
+ ملاحظة: لتغيير موقع الهدف إلى أي شيء آخر غير + الافتراضي ، يجب إضافته إلى [page:Scene scene] باستخدام + scene.add( light.target ); + هذا حتى يتم تحديث [page:Object3D.matrixWorld matrixWorld] للهدف + تلقائيًا في كل إطار.

+ من الممكن أيضًا تعيين الهدف لكونه كائنًا آخر في المشهد + (أي شيء لديه خاصية [page:Object3D.position position]) ، مثل: + + const targetObject = new THREE.Object3D(); + scene.add(targetObject); + + light.target = targetObject; + + سوف يتبع المصباح الكاشف الآن كائن الهدف. +

+ +

[property:Texture map]

+

+ [page:Texture] يستخدم لتعديل لون الضوء. يتم خلط لون المصباح + مع قيمة RGB لهذه الملمس ، بنسبة + تتوافق مع قيمة ألفا. يتم تكرار التأثير المشابه للكعكة باستخدام قِيَم بكسل (0، 0، 0، 1-قِيَم_الكعكة). تحذير: + [page:.map] مُعَطَّلَ إذا كان [page:.castShadow] + خطأ. +

+ +

الطرق (Methods)

+ +

انظر إلى قائمة [page:Light Light] للطرق المشتركة.

+ +

[method:undefined dispose]()

+

+ تحرير المصادر المتعلقة بالجهاز GPU التي تم تخصيصها من قبل هذه المثيل. اتصل بهذه + الطريقة كلما لم يُستخدَم هذه المثيل في تطبيقك. +

+ +

[method:this copy]( [param:SpotLight source] )

+

+ نسخ قِيَم جميع خصائص [page:SpotLight source] إلى + هذه SpotLight. +

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/lights/shadows/DirectionalLightShadow.html b/docs/api/ar/lights/shadows/DirectionalLightShadow.html new file mode 100644 index 00000000000000..4df6f3a12b0745 --- /dev/null +++ b/docs/api/ar/lights/shadows/DirectionalLightShadow.html @@ -0,0 +1,101 @@ + + + + + + + + + + [page:LightShadow] → + +

[name]

+ +

+ يتم استخدام هذا داخليًا من قبل [page:DirectionalLight DirectionalLights] لـ + حساب الظلال.

+ + على عكس فئات الظلال الأخرى ، يستخدم هذا [page:OrthographicCamera] لـ + حساب الظلال ، بدلاً من [page:PerspectiveCamera]. هذا هو + لأن أشعة الضوء من [page:DirectionalLight] متوازية. +

+ +

مثال الكود

+ + + //Create a WebGLRenderer and turn on shadows in the renderer + const renderer = new THREE.WebGLRenderer(); + renderer.shadowMap.enabled = true; + renderer.shadowMap.type = THREE.PCFSoftShadowMap; // default THREE.PCFShadowMap + + //Create a DirectionalLight and turn on shadows for the light + const light = new THREE.DirectionalLight( 0xffffff, 1 ); + light.position.set( 0, 1, 0 ); //default; light shining from top + light.castShadow = true; // default false + scene.add( light ); + + //Set up shadow properties for the light + light.shadow.mapSize.width = 512; // default + light.shadow.mapSize.height = 512; // default + light.shadow.camera.near = 0.5; // default + light.shadow.camera.far = 500; // default + + //Create a sphere that cast shadows (but does not receive them) + const sphereGeometry = new THREE.SphereGeometry( 5, 32, 32 ); + const sphereMaterial = new THREE.MeshStandardMaterial( { color: 0xff0000 } ); + const sphere = new THREE.Mesh( sphereGeometry, sphereMaterial ); + sphere.castShadow = true; //default is false + sphere.receiveShadow = false; //default + scene.add( sphere ); + + //Create a plane that receives shadows (but does not cast them) + const planeGeometry = new THREE.PlaneGeometry( 20, 20, 32, 32 ); + const planeMaterial = new THREE.MeshStandardMaterial( { color: 0x00ff00 } ) + const plane = new THREE.Mesh( planeGeometry, planeMaterial ); + plane.receiveShadow = true; + scene.add( plane ); + + //Create a helper for the shadow camera (optional) + const helper = new THREE.CameraHelper( light.shadow.camera ); + scene.add( helper ); + + +

المنشئ (Constructor)

+

[name]( )

+

+ ينشئ [name] جديدًا. لا يُقصد من هذا الاتصال مباشرة - هو + يتم استدعاؤه داخليًا من قبل [page:DirectionalLight]. +

+ +

الخصائص (Properties)

+

+ انظر الفئة الأساسية [page:LightShadow LightShadow] للخصائص المشتركة. +

+ +

[property:Camera camera]

+

+ رؤية الضوء للعالم. يتم استخدام هذا لإنشاء خريطة عمق لـ + المشهد ؛ الأشياء خلف الأشياء الأخرى من منظور الضوء ستكون + في الظل.

+ + الافتراضي هو [page:OrthographicCamera] مع + [page:OrthographicCamera.left left] و [page:OrthographicCamera.bottom bottom] + مضبوط على -5 ، [page:OrthographicCamera.right right] و + [page:OrthographicCamera.top top] مضبوط على 5 ، + [page:OrthographicCamera.near near] كليبينغ بلان عند 0.5 و + [page:OrthographicCamera.far far] كليبينغ بلان عند 500. +

+ +

[property:Boolean isDirectionalLightShadow]

+

علامة للقراءة فقط للتحقق مما إذا كان الكائن المعطى هو من نوع [name].

+ +

الطرق (Methods)

+

انظر الفئة الأساسية [page:LightShadow LightShadow] للطرق المشتركة.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/lights/[name].js src/lights/[name].js] +

+ + diff --git a/docs/api/ar/lights/shadows/LightShadow.html b/docs/api/ar/lights/shadows/LightShadow.html new file mode 100644 index 00000000000000..db051066db9d99 --- /dev/null +++ b/docs/api/ar/lights/shadows/LightShadow.html @@ -0,0 +1,165 @@ + + + + + + + + + +

[name]

+ +

يعمل كفئة أساسية لفئات الظلال الأخرى.

+ +

المنشئ (Constructor)

+ +

[name]( [param:Camera camera] )

+

+ [page:Camera camera] - رؤية الضوء للعالم.

+ + إنشاء [name] جديد. لا يُقصد من هذا الاتصال مباشرة - هو + يستخدم كفئة أساسية من قبل ظلال الضوء الأخرى. +

+ +

الخصائص (Properties)

+ +

[property:Boolean autoUpdate]

+

+ يتيح التحديثات التلقائية لظل الضوء. الافتراضي هو `true`. إذا كنت + لا تتطلب إضاءة / ظلال ديناميكية ، يمكنك تعيين هذا على `false`. +

+ +

[property:Camera camera]

+

+ رؤية الضوء للعالم. يتم استخدام هذا لإنشاء خريطة عمق لـ + المشهد ؛ الأشياء خلف الأشياء الأخرى من منظور الضوء ستكون + في الظل. +

+ +

[property:Float bias]

+

+ انحياز خريطة الظل ، كم يجب إضافة أو طرح من العمق المعاد تدويره + عند تحديد ما إذا كانت سطحًا في الظل.
+ الافتراضي هو 0. قد تساعد التعديلات الصغيرة جدًا هنا (بترتيب 0.0001) + تقليل التحف في الظلال +

+ +

[property:Integer blurSamples]

+

عدد العينات المستخدمة عند طمس خريطة ظل VSM.

+ +

[property:WebGLRenderTarget map]

+

+ خريطة العمق التي تم إنشاؤها باستخدام الكاميرا الداخلية ؛ موقع خارج + عمق بكسل في الظل. يتم حسابه داخليًا أثناء التقديم. +

+ +

[property:WebGLRenderTarget mapPass]

+

+ خريطة التوزيع التي تم إنشاؤها باستخدام الكاميرا الداخلية ؛ يتم حساب احتجاب + بناءً على توزيع الأعماق. يتم حسابه داخليًا أثناء + التقديم. +

+ +

[property:Vector2 mapSize]

+

+ [Page:Vector2] يحدد عرض وارتفاع خريطة الظل.

+ + تعطي قيم أعلى جودة أفضل للظلال بتكلفة وقت الحساب. + يجب أن تكون قيم قوى 2 ، حتى + [page:WebGLRenderer.capabilities].maxTextureSize لجهاز معين, + على الرغم من أنه لا يجب أن يكون نفسه (ولذلك ، على سبيل المثال ، + (512، 1024) صالح). الافتراضي هو * (512، 512) *. +

+ +

[property:Matrix4 matrix]

+

+ نموذج لمساحة الكاميرا الظلية ، لحساب الموقع والعمق في خريطة الظل. + تخزين في [page:Matrix4 Matrix4]. يتم حساب هذا داخليًا أثناء + التقديم. +

+ +

[property:Boolean needsUpdate]

+

+ عند تعيينه على `true` ، سيتم تحديث خرائط الظل في الاتصال التالي `render`. + الافتراضي هو `false`. إذا قمت بتعيين [page:.autoUpdate] على `false` ، فأنت + سوف تحتاج إلى تعيين هذه الخاصية على `true` ثم إجراء مكالمة تقديم لـ + تحديث ظل الضوء. +

+ +

[property:Float normalBias]

+

+ يحدد كمية الموضع المستخدم للاستعلام عن خريطة الظل معوضًا عن + الكائن الطبيعي. الافتراضي هو 0. يمكن استخدام زيادة هذه القيمة لـ + تقليل حب الشباب في الظلال خاصة في المشاهد الكبيرة التي يضيء فيها الضوء + الهندسة بزاوية ضحلة. التكلفة هي أن الظلال قد تبدو + مشوه. +

+ +

[property:Float radius]

+

+ إعداد هذه القيم إلى قيم أكبر من 1 ستطمس حواف + الظل.
+ + ستسبب قيم عالية تأثيرات تجزئة غير مرغوب فيها في الظلال - أكبر + [page:.mapSize mapSize] ستسمح بقيمة أعلى للاستخدام هنا + قبل أن تصبح هذه التأثيرات مرئية.
+ إذا تم تعيين [page:WebGLRenderer.shadowMap.type] على [page:Renderer PCFSoftShadowMap]، + لا يوجد لـ radius أثر و يُفضل زيادة + النعومة عن طريق تقليل [page:.mapSize mapSize] بدلاً من ذلك.

+ + لاحظ أن هذا لا يؤثر إذا كان [page:WebGLRenderer.shadowMap.type] هو + تعيين إلى [page:Renderer BasicShadowMap]. +

+ +

الطرق (Methods)

+ +

[method:Vector2 getFrameExtents]()

+

+ تستخدم داخليًا من قبل المصور لتوسيع خريطة الظل لتحتوى على جميع + viewports +

+ +

[method:undefined updateMatrices]( [param:Light light] )

+

+ تحديث المصفوفات للكاميرا والظل ، يستخدم داخليًا من قبل المصور.

+ + light -- الضوء الذي يتم تقديم الظل له. +

+ +

[method:Frustum getFrustum]()

+

+ تحصل على فروستوم كاميرات الظل. يستخدم داخليًا من قبل المصور لإزالة + الأشياء. +

+ +

[method:number getViewportCount]()

+

+ تستخدم داخليًا من قبل المصور للحصول على عدد viewports التى تحتاج + إلى التقديم لهذا الظل. +

+ +

[method:undefined dispose]()

+

+ تحرير الموارد ذات الصلة بوحدة معالجة الرسومات التى تم تخصيصها من قبل هذه الحالة. استدعاء هذه + الطریقة كلما لم يعد يستخدم هذه الحال فى تطبیقك. +

+ +

[method:this copy]( [param:LightShadow source] )

+

+ ينسخ قيمة جميع الخصائص من [page:LightShadow source] إلى + هذا الضوء. +

+ +

[method:LightShadow clone]()

+

ينشئ LightShadow جديد بنفس خصائص هذا.

+ +

[method:Object toJSON]()

+

سيريالايز هذا LightShadow.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/lights/[name].js src/lights/[name].js] +

+ + diff --git a/docs/api/ar/lights/shadows/PointLightShadow.html b/docs/api/ar/lights/shadows/PointLightShadow.html new file mode 100644 index 00000000000000..aadee02bebcf8f --- /dev/null +++ b/docs/api/ar/lights/shadows/PointLightShadow.html @@ -0,0 +1,94 @@ + + + + + + + + + + [page:LightShadow] → + +

[name]

+ +

+ يتم استخدام هذا داخليًا من قبل [page:PointLight PointLights] لحساب + الظلال. +

+ +

مثال الكود

+ + + //Create a WebGLRenderer and turn on shadows in the renderer + const renderer = new THREE.WebGLRenderer(); + renderer.shadowMap.enabled = true; + renderer.shadowMap.type = THREE.PCFSoftShadowMap; // default THREE.PCFShadowMap + + //Create a PointLight and turn on shadows for the light + const light = new THREE.PointLight( 0xffffff, 1, 100 ); + light.position.set( 0, 10, 4 ); + light.castShadow = true; // default false + scene.add( light ); + + //Set up shadow properties for the light + light.shadow.mapSize.width = 512; // default + light.shadow.mapSize.height = 512; // default + light.shadow.camera.near = 0.5; // default + light.shadow.camera.far = 500; // default + + //Create a sphere that cast shadows (but does not receive them) + const sphereGeometry = new THREE.SphereGeometry( 5, 32, 32 ); + const sphereMaterial = new THREE.MeshStandardMaterial( { color: 0xff0000 } ); + const sphere = new THREE.Mesh( sphereGeometry, sphereMaterial ); + sphere.castShadow = true; //default is false + sphere.receiveShadow = false; //default + scene.add( sphere ); + + //Create a plane that receives shadows (but does not cast them) + const planeGeometry = new THREE.PlaneGeometry( 20, 20, 32, 32 ); + const planeMaterial = new THREE.MeshStandardMaterial( { color: 0x00ff00 } ) + const plane = new THREE.Mesh( planeGeometry, planeMaterial ); + plane.receiveShadow = true; + scene.add( plane ); + + //Create a helper for the shadow camera (optional) + const helper = new THREE.CameraHelper( light.shadow.camera ); + scene.add( helper ); + + +

المنشئ (Constructor)

+

[name]( )

+

+ ينشئ [name] جديدًا. لا يُقصد من هذا الاتصال مباشرة - هو + يتم استدعاؤه داخليًا من قبل [page:PointLight]. +

+ +

الخصائص (Properties)

+

+ انظر الفئة الأساسية [page:LightShadow LightShadow] للخصائص المشتركة. +

+ +

[property:Boolean isPointLightShadow]

+

علامة للقراءة فقط للتحقق مما إذا كان الكائن المعطى هو من نوع [name].

+ +

الطرق (Methods)

+ +

انظر الفئة الأساسية [page:LightShadow LightShadow] للطرق المشتركة.

+ +

+ [method:undefined updateMatrices]( [param:Light light], [param:number viewportIndex]) +

+

+ تحديث المصفوفات للكاميرا والظل ، يستخدم داخليًا من قبل المصور.

+ + light -- الضوء الذي يتم تقديم الظل له.
+ viewportIndex -- يحسب المصفوفة لهذا viewport +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/lights/[name].js src/lights/[name].js] +

+ + diff --git a/docs/api/ar/lights/shadows/SpotLightShadow.html b/docs/api/ar/lights/shadows/SpotLightShadow.html new file mode 100644 index 00000000000000..8c41bf052079b0 --- /dev/null +++ b/docs/api/ar/lights/shadows/SpotLightShadow.html @@ -0,0 +1,106 @@ + + + + + + + + + + [page:LightShadow] → + +

[name]

+ +

+ يتم استخدام هذا داخليًا من قبل [page:SpotLight SpotLights] لحساب + الظلال. +

+ +

مثال الكود

+ + //Create a WebGLRenderer and turn on shadows in the renderer + const renderer = new THREE.WebGLRenderer(); + renderer.shadowMap.enabled = true; + renderer.shadowMap.type = THREE.PCFSoftShadowMap; // default THREE.PCFShadowMap + + //Create a SpotLight and turn on shadows for the light + const light = new THREE.SpotLight( 0xffffff ); + light.castShadow = true; // default false + scene.add( light ); + + //Set up shadow properties for the light + light.shadow.mapSize.width = 512; // default + light.shadow.mapSize.height = 512; // default + light.shadow.camera.near = 0.5; // default + light.shadow.camera.far = 500; // default + light.shadow.focus = 1; // default + + //Create a sphere that cast shadows (but does not receive them) + const sphereGeometry = new THREE.SphereGeometry( 5, 32, 32 ); + const sphereMaterial = new THREE.MeshStandardMaterial( { color: 0xff0000 } ); + const sphere = new THREE.Mesh( sphereGeometry, sphereMaterial ); + sphere.castShadow = true; //default is false + sphere.receiveShadow = false; //default + scene.add( sphere ); + + //Create a plane that receives shadows (but does not cast them) + const planeGeometry = new THREE.PlaneGeometry( 20, 20, 32, 32 ); + const planeMaterial = new THREE.MeshStandardMaterial( { color: 0x00ff00 } ) + const plane = new THREE.Mesh( planeGeometry, planeMaterial ); + plane.receiveShadow = true; + scene.add( plane ); + + //Create a helper for the shadow camera (optional) + const helper = new THREE.CameraHelper( light.shadow.camera ); + scene.add( helper ); + + +

المنشئ (Constructor)

+ +

+ ينشئ المنشئ [param:PerspectiveCamera PerspectiveCamera] لـ + إدارة رؤية الظل للعالم. +

+ +

الخصائص (Properties)

+

+ انظر الفئة الأساسية [page:LightShadow LightShadow] للخصائص المشتركة. +

+ +

[property:Camera camera]

+

+ رؤية الضوء للعالم. يتم استخدام هذا لإنشاء خريطة عمق لـ + المشهد ؛ الأشياء خلف الأشياء الأخرى من منظور الضوء ستكون + في الظل.

+ + الافتراضي هو [page:PerspectiveCamera] مع + [page:PerspectiveCamera.near near] كليبينغ بلان عند `0.5`. ال + [page:PerspectiveCamera.fov fov] ستتبع [page:SpotLight.angle angle] + خاصية [page:SpotLight SpotLight] المملوكة عبر + [page:SpotLightShadow.update update] طريقة. بالمثل ، + [page:PerspectiveCamera.aspect aspect] خاصية ستتبع نسبة + [page:LightShadow.mapSize mapSize]. إذا تم تعيين [page:SpotLight.distance distance] + خاصية الضوء ، فستتبع [page:PerspectiveCamera.far far] + كليبينغ بلان ذلك ، وإلا فإنه يفترض `500`. +

+ +

[property:Number focus]

+

+ تستخدم لتركيز كاميرا الظل. يتم تعيين حقل رؤية الكاميرا كـ + نسبة مئوية من حقل رؤية المصباح. المدى هو `[0، 1]`. الافتراضي هو + `1.0`.
+

+ +

[property:Boolean isSpotLightShadow]

+

علامة للقراءة فقط للتحقق مما إذا كان الكائن المعطى هو من نوع [name].

+ +

الطرق (Methods)

+

انظر الفئة الأساسية [page:LightShadow LightShadow] للطرق المشتركة.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/lights/[name].js src/lights/[name].js] +

+ + diff --git a/docs/api/ar/loaders/AnimationLoader.html b/docs/api/ar/loaders/AnimationLoader.html new file mode 100644 index 00000000000000..dc20e0b3acb67c --- /dev/null +++ b/docs/api/ar/loaders/AnimationLoader.html @@ -0,0 +1,91 @@ + + + + + + + + + + [page:Loader] → + +

[name]

+ +

+ فئة لتحميل [page:AnimationClip AnimationClips] بتنسيق JSON. هذا + يستخدم [page:FileLoader] داخليًا لتحميل الملفات. +

+ +

مثال للكود

+ + + // instantiate a loader + const loader = new THREE.AnimationLoader(); + + // load a resource + loader.load( + // resource URL + 'animations/animation.js', + + // onLoad callback + function ( animations ) { + // animations is an array of AnimationClips + }, + + // onProgress callback + function ( xhr ) { + console.log( (xhr.loaded / xhr.total * 100) + '% loaded' ); + }, + + // onError callback + function ( err ) { + console.log( 'An error happened' ); + } + ); + + +

المنشئ (Constructor)

+ +

[name]( [param:LoadingManager manager] )

+

+ [page:LoadingManager manager] — [page:LoadingManager loadingManager] + للمحمل الذي سيتم استخدامه. الافتراضي هو [page:LoadingManager THREE.DefaultLoadingManager].

+ ينشئ جديدًا [name]. +

+ +

الخصائص (Properties)

+

انظر الفئة الأساسية [page:Loader] للخصائص المشتركة.

+ +

الطرق (Methods)

+

انظر الفئة الأساسية [page:Loader] للطرق المشتركة.

+ +

+ [method:undefined load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] ) +

+

+ [page:String url] — المسار أو عنوان URL للملف. يمكن أن يكون هذا أيضًا + [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].
+ [page:Function onLoad] — سيتم استدعاؤه عند اكتمال التحميل. الحجة + ستكون المقاطع المحملة [page:AnimationClip animation].
+ [page:Function onProgress] (اختياري) — سيتم استدعاؤه أثناء التقدم في التحميل + يتقدم. الحجة ستكون نسخة ProgressEvent، والتي + يحتوي على .[page:Boolean lengthComputable]، .[page:Integer total] و + .[page:Integer loaded]. إذا لم يضبط الخادم رأس Content-Length + .[page:Integer total] سيكون 0.
+ [page:Function onError] (اختياري) — سيتم استدعاؤه إذا حدث خطأ في التحميل.

+ ابدأ التحميل من url وأرسل المقطع المحمل إلى onLoad. +

+ +

[method:Array parse]( [param:JSON json] )

+

+ [page:JSON json] — مطلوب

+ قم بتحليل كائن JSON وإرجاع مصفوفة من مقاطع الرسوم المتحركة. فردي + سيتم تحليل المقاطع في الكائن باستخدام [page:AnimationClip.parse]. +

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/loaders/AudioLoader.html b/docs/api/ar/loaders/AudioLoader.html new file mode 100644 index 00000000000000..6841925bb09cd2 --- /dev/null +++ b/docs/api/ar/loaders/AudioLoader.html @@ -0,0 +1,107 @@ + + + + + + + + + + [page:Loader] → + +

[name]

+ +

+ فئة لتحميل + [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer AudioBuffer]. + يستخدم هذا [page:FileLoader] داخليًا لتحميل + الملفات. +

+ +

مثال للكود

+ + + // instantiate a listener + const audioListener = new THREE.AudioListener(); + + // add the listener to the camera + camera.add( audioListener ); + + // instantiate audio object + const oceanAmbientSound = new THREE.Audio( audioListener ); + + // add the audio object to the scene + scene.add( oceanAmbientSound ); + + // instantiate a loader + const loader = new THREE.AudioLoader(); + + // load a resource + loader.load( + // resource URL + 'audio/ambient_ocean.ogg', + + // onLoad callback + function ( audioBuffer ) { + // set the audio object buffer to the loaded object + oceanAmbientSound.setBuffer( audioBuffer ); + + // play the audio + oceanAmbientSound.play(); + }, + + // onProgress callback + function ( xhr ) { + console.log( (xhr.loaded / xhr.total * 100) + '% loaded' ); + }, + + // onError callback + function ( err ) { + console.log( 'An error happened' ); + } + ); + + +

المنشئ (Constructor)

+ +

[name]( [param:LoadingManager manager] )

+

+ [page:LoadingManager manager] — [page:LoadingManager loadingManager] + للمحمل الذي سيتم استخدامه. الافتراضي هو [page:LoadingManager THREE.DefaultLoadingManager].

+ + ينشئ جديدًا [name]. +

+ +

الخصائص (Properties)

+

انظر الفئة الأساسية [page:Loader] للخصائص المشتركة.

+ +

الطرق (Methods)

+

انظر الفئة الأساسية [page:Loader] للطرق المشتركة.

+ +

+ [method:undefined load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] ) +

+

+ [page:String url] — المسار أو عنوان URL للملف. يمكن أن يكون هذا أيضًا + [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].
+ [page:Function onLoad] — سيتم استدعاؤه عند اكتمال التحميل. الحجة + ستكون الاستجابة المحملة للنص.
+ [page:Function onProgress] (اختياري) — سيتم استدعاؤه أثناء التقدم في التحميل + يتقدم. الحجة ستكون نسخة ProgressEvent، والتي + يحتوي على .[page:Boolean lengthComputable]، .[page:Integer total] و + .[page:Integer loaded]. إذا لم يضبط الخادم رأس Content-Length + .[page:Integer total] سيكون 0.
+ [page:Function onError] (اختياري) — سيتم استدعاؤه إذا حدث خطأ في التحميل.
+

+

+ ابدأ التحميل من url وأرسل المحمَّل [page:String AudioBuffer] إلى + onLoad. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/loaders/BufferGeometryLoader.html b/docs/api/ar/loaders/BufferGeometryLoader.html new file mode 100644 index 00000000000000..7f517b2a6f5422 --- /dev/null +++ b/docs/api/ar/loaders/BufferGeometryLoader.html @@ -0,0 +1,94 @@ + + + + + + + + + + [page:Loader] → + +

[name]

+ +

+ محمل لتحميل [page:BufferGeometry]. يستخدم هذا + [page:FileLoader] داخليًا لتحميل الملفات. +

+ +

مثال للكود

+ + + // instantiate a loader + const loader = new THREE.BufferGeometryLoader(); + + // load a resource + loader.load( + // resource URL + 'models/json/pressure.json', + + // onLoad callback + function ( geometry ) { + const material = new THREE.MeshLambertMaterial( { color: 0xF5F5F5 } ); + const object = new THREE.Mesh( geometry, material ); + scene.add( object ); + }, + + // onProgress callback + function ( xhr ) { + console.log( (xhr.loaded / xhr.total * 100) + '% loaded' ); + }, + + // onError callback + function ( err ) { + console.log( 'An error happened' ); + } + ); + + +

المنشئ (Constructor)

+ +

[name]( [param:LoadingManager manager] )

+

+ [page:LoadingManager manager] — [page:LoadingManager loadingManager] + للمحمل الذي سيتم استخدامه. الافتراضي هو [page:LoadingManager THREE.DefaultLoadingManager]. +

+

ينشئ جديدًا [name].

+ +

الخصائص (Properties)

+

انظر الفئة الأساسية [page:Loader] للخصائص المشتركة.

+ +

الطرق (Methods)

+

انظر الفئة الأساسية [page:Loader] للطرق المشتركة.

+ +

+ [method:undefined load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] ) +

+

+ [page:String url] — المسار أو عنوان URL للملف. يمكن أن يكون هذا أيضًا + [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].d
+ [page:Function onLoad] — سيتم استدعاؤه عند اكتمال التحميل. الحجة + ستكون المحمَّلة [page:BufferGeometry].
+ [page:Function onProgress] (اختياري) — سيتم استدعاؤه أثناء التقدم في التحميل + يتقدم. الحجة ستكون نسخة ProgressEvent، والتي + يحتوي على .[page:Boolean lengthComputable]، .[page:Integer total] و + .[page:Integer loaded]. إذا لم يضبط الخادم رأس Content-Length + .[page:Integer total] سيكون 0.
+ [page:Function onError] (اختياري) — سيتم استدعاؤه إذا حدث خطأ في التحميل.
+

+

+ ابدأ التحميل من url واتصل بـ onLoad مع محتوى الاستجابة المحلَّل. +

+ +

[method:BufferGeometry parse]( [param:Object json] )

+

+ [page:Object json] — هيكل `JSON` للتحليل.

+ قم بتحليل هيكل `JSON` وإرجاع [page:BufferGeometry]. +

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/loaders/Cache.html b/docs/api/ar/loaders/Cache.html new file mode 100644 index 00000000000000..13a5fab7ab874d --- /dev/null +++ b/docs/api/ar/loaders/Cache.html @@ -0,0 +1,74 @@ + + + + + + + + + +

[name]

+ +

+ نظام تخزين مؤقت بسيط، يستخدم داخليًا من قبل [page:FileLoader]. +

+ +

مثال للكود

+ +

لتمكين التخزين المؤقت عبر جميع المحملات التي تستخدم [page:FileLoader]، قم بتعيين

+ THREE.Cache.enabled = true. + +

أمثلة (Examples)

+ +

+ [example:webgl_geometry_text WebGL / geometry / text ]
+ [example:webgl_interactive_instances_gpu WebGL / interactive / instances / gpu]
+ [example:webgl_loader_ttf WebGL / loader / ttf] +

+ +

الخصائص (Properties)

+ +

[property:Boolean enabled]

+

هل التخزين المؤقت ممكَّن. الافتراضي هو `false`.

+ +

[property:Object files]

+

[page:Object object] يحتوي على الملفات المخزنة مؤقتًا.

+ +

الطرق (Methods)

+ +

[method:undefined add]( [param:String key], [param:Object file] )

+

+ [page:String key] — [page:String key] للإشارة إلى الملف المخزن مؤقتًا + بواسطته.
+ [page:Object file] — الملف الذي سيتم تخزينه مؤقتًا.

+ + يضيف إدخال تخزين مؤقت بمفتاح للإشارة إلى الملف. إذا كان هذا المفتاح بالفعل + يحمل ملفًا، يتم استبداله. +

+ +

[method:Any get]( [param:String key] )

+

+ [page:String key] — مفتاح نصي

+ + احصل على قيمة [page:String key]. إذا لم يكن المفتاح موجودًا `undefined` + يتم إرجاعه. +

+ +

[method:undefined remove]( [param:String key] )

+

+ [page:String key] — مفتاح نصي يشير إلى ملف مخزن مؤقتًا.

+ + قم بإزالة الملف المخزن مؤقتًا المرتبط بالمفتاح. +

+ +

[method:undefined clear]()

+

إزالة جميع القيم من التخزين المؤقت.

+ + +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/loaders/CompressedTextureLoader.html b/docs/api/ar/loaders/CompressedTextureLoader.html new file mode 100644 index 00000000000000..298e33b84d4bba --- /dev/null +++ b/docs/api/ar/loaders/CompressedTextureLoader.html @@ -0,0 +1,71 @@ + + + + + + + + + + [page:Loader] → + +

[name]

+ +

+ الفئة الأساسية المجردة لمحمل القوام المستندة إلى الكتل (dds، pvr، ...). هذا + يستخدم [page:FileLoader] داخليًا لتحميل الملفات. +

+ +

أمثلة (Examples)

+ +

+ انظر + [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/DDSLoader.js DDSLoader] + و [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/PVRLoader.js PVRLoader] + لأمثلة على الفئات المشتقة. +

+ +

المنشئ (Constructor)

+ +

[name]( [param:LoadingManager manager] )

+

+ [page:LoadingManager manager] — [page:LoadingManager loadingManager] + للمحمل الذي سيتم استخدامه. الافتراضي هو [page:LoadingManager THREE.DefaultLoadingManager].

+ + ينشئ جديدًا [name]. +

+ +

الخصائص (Properties)

+

انظر الفئة الأساسية [page:Loader] للخصائص المشتركة.

+ +

الطرق (Methods)

+

انظر الفئة الأساسية [page:Loader] للطرق المشتركة.

+ +

+ [method:CompressedTexture load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] ) +

+

+ [page:String url] — المسار أو عنوان URL للملف. يمكن أن يكون هذا أيضًا + [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].
+ [page:Function onLoad] (اختياري) — سيتم استدعاؤه عند اكتمال التحميل. + الحجة ستكون القوام المحمَّل.
+ [page:Function onProgress] (اختياري) — سيتم استدعاؤه أثناء التقدم في التحميل + يتقدم. الحجة ستكون نسخة ProgressEvent، والتي + يحتوي على .[page:Boolean lengthComputable]، .[page:Integer total] و + .[page:Integer loaded]. إذا لم يضبط الخادم رأس Content-Length + .[page:Integer total] سيكون 0.
+ [page:Function onError] (اختياري) — سيتم استدعاؤه إذا حدث خطأ في التحميل.
+

+

+ ابدأ التحميل من url وأرسل القوام المحمَّل إلى onLoad. تعود الطريقة + أيضًا كائن قوام جديد يمكن استخدامه مباشرةً لإنشاء مادة + . +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/loaders/CubeTextureLoader.html b/docs/api/ar/loaders/CubeTextureLoader.html new file mode 100644 index 00000000000000..29d1b0e5db54fc --- /dev/null +++ b/docs/api/ar/loaders/CubeTextureLoader.html @@ -0,0 +1,93 @@ + + + + + + + + + + [page:Loader] → + +

[name]

+ +

+ يمكن استخدام [name] لتحميل خرائط المكعب. يُرجع محمل نسخة من [page:CubeTexture] ويتوقع تعريف خريطة المكعب + على أنها ستة صور منفصلة تمثل جوانب المكعب. لا يتم دعم تعاريف خريطة المكعب الأخرى مثل الصليب العمودي والأفقي والتصميم بالأعمدة والصفوف. +

+

+ [page:CubeTexture] المحملة موجودة في مساحة الألوان sRGB. يعني ذلك أن [page:Texture.colorSpace colorSpace] + تم تعيين الخاصية إلى `THREE.SRGBColorSpace` افتراضيًا. +

+ +

مثال للكود

+ + +const scene = new THREE.Scene(); +scene.background = new THREE.CubeTextureLoader() + .setPath( 'textures/cubeMaps/' ) + .load( [ + 'px.png', + 'nx.png', + 'py.png', + 'ny.png', + 'pz.png', + 'nz.png' + ] ); + + +

أمثلة (Examples)

+ +

+ [example:webgl_materials_cubemap materials / cubemap]
+ [example:webgl_materials_cubemap_dynamic materials / cubemap / dynamic]
+ [example:webgl_materials_cubemap_refraction materials / cubemap / refraction] +

+ +

المنشئ (Constructor)

+ +

[name]( [param:LoadingManager manager] )

+

+ [page:LoadingManager manager] — [page:LoadingManager loadingManager] + للمحمل الذي سيتم استخدامه. الافتراضي هو [page:LoadingManager THREE.DefaultLoadingManager].

+ + ينشئ جديدًا [name]. +

+ +

الخصائص (Properties)

+

انظر الفئة الأساسية [page:Loader] للخصائص المشتركة.

+ +

الطرق (Methods)

+

انظر الفئة الأساسية [page:Loader] للطرق المشتركة.

+ +

+ [method:CubeTexture load]( [param:String urls], [param:Function onLoad], [param:Function onProgress], [param:Function onError] ) +

+

+ [page:String urls] — مصفوفة من 6 عناوين URL للصور، واحدة لكل جانب من + CubeTexture. يجب تحديد عناوين URL بالترتيب التالي: pos-x، + neg-x، pos-y، neg-y، pos-z، neg-z. يمكن أن يكونوا أيضًا + [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URIs].
+ يجب ملاحظة أنه بالاتفاقية، تتم تحديد خرائط المكعب في نظام إحداثيات + فيه x الموجب إلى اليمين عند النظر إلى محور z الموجب - بعبارة أخرى، باستخدام نظام إحداثيات ذو يد يسرى. نظرًا لأن three.js يستخدم + نظام إحداثيات ذو يد يمنى، ستكون خرائط البيئة المستخدمة في three.js + pos-x و neg-x مبادلتان.
+ [page:Function onLoad] (اختياري) — سيتم استدعاؤه عند اكتمال التحميل. + الحجة ستكون القوام المحمَّلة [page:CubeTexture texture].
+ [page:Function onProgress] (اختياري) — هذه الدالة التابعة للرد + غير معتمد حاليًا.
+ [page:Function onError] (اختياري) — سيتم استدعاؤه إذا حدث خطأ في التحميل.
+

+

+ ابدأ التحميل من url وأرسل القوام المحمَّلة [page:CubeTexture texture] إلى + onLoad. تعود الطريقة أيضًا كائن قوام جديد يمكن استخدامه مباشرةً لإنشاء مادة + . +

+ + +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/loaders/DataTextureLoader.html b/docs/api/ar/loaders/DataTextureLoader.html new file mode 100644 index 00000000000000..7cb90c3afda150 --- /dev/null +++ b/docs/api/ar/loaders/DataTextureLoader.html @@ -0,0 +1,68 @@ + + + + + + + + + + [page:Loader] → + +

[name]

+ +

+ الفئة الأساسية المجردة لتحميل تنسيقات القوام الثنائية العامة (rgbe، hdr، + ...). يستخدم هذا [page:FileLoader] داخليًا لتحميل الملفات، و + ينشئ جديدًا [page:DataTexture]. +

+ +

أمثلة (Examples)

+

+ انظر + [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/RGBELoader.js RGBELoader] + لمثال على فئة مشتقة. +

+ +

المنشئ (Constructor)

+

[name]( [param:LoadingManager manager] )

+

+ [page:LoadingManager manager] — [page:LoadingManager loadingManager] + للمحمل الذي سيتم استخدامه. الافتراضي هو [page:LoadingManager THREE.DefaultLoadingManager].

+ + ينشئ جديدًا [name]. +

+ +

الخصائص (Properties)

+

انظر الفئة الأساسية [page:Loader] للخصائص المشتركة.

+ +

الطرق (Methods)

+

انظر الفئة الأساسية [page:Loader] للطرق المشتركة.

+ +

+ [method:DataTexture load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] ) +

+

+ [page:String url] — المسار أو عنوان URL للملف. يمكن أن يكون هذا أيضًا + [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].
+ [page:Function onLoad] (اختياري) — سيتم استدعاؤه عند اكتمال التحميل. + الحجة ستكون القوام المحمَّلة.
+ [page:Function onProgress] (اختياري) — سيتم استدعاؤه أثناء التقدم في التحميل + يتقدم. الحجة ستكون نسخة ProgressEvent، والتي تحتوي على + .[page:Boolean lengthComputable]، .[page:Integer total] و .[page:Integer loaded]. + إذا لم يضبط الخادم رأس Content-Length؛ + .[page:Integer total] سيكون 0.
+ [page:Function onError] (اختياري) — سيتم استدعاؤه إذا حدث خطأ في التحميل.
+

+

+ ابدأ التحميل من url وأرسل القوام المحمَّلة إلى onLoad. تعود الطريقة + أيضًا كائن قوام جديد يمكن استخدامه مباشرةً لإنشاء مادة + . +

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/loaders/FileLoader.html b/docs/api/ar/loaders/FileLoader.html new file mode 100644 index 00000000000000..c8561d333fafd7 --- /dev/null +++ b/docs/api/ar/loaders/FileLoader.html @@ -0,0 +1,131 @@ + + + + + + + + + + [page:Loader] → + +

[name]

+ +

+ فئة منخفضة المستوى لتحميل الموارد باستخدام Fetch ، يتم استخدامها داخليًا من قبل + معظم المحملات. يمكن أيضًا استخدامها مباشرة لتحميل أي نوع ملف لا يحتوي على + محمل. +

+ +

مثال الكود

+ + const loader = new THREE.FileLoader(); + + //load a text file and output the result to the console + loader.load( + // resource URL + 'example.txt', + + // onLoad callback + function ( data ) { + // output the text to the console + console.log( data ) + }, + + // onProgress callback + function ( xhr ) { + console.log( (xhr.loaded / xhr.total * 100) + '% loaded' ); + }, + + // onError callback + function ( err ) { + console.error( 'An error happened' ); + } + ); + + +

+ * ملاحظة: * يجب تمكين ذاكرة التخزين المؤقت باستخدام + THREE.Cache.enabled = true; + هذه خاصية عالمية ولا يحتاج إلى تعيينها مرة واحدة فقط لتستخدمها جميع + المحملات التي تستخدم FileLoader داخليًا. [page:Cache Cache] هو وحدة ذاكرة التخزين المؤقت + التي تحتوي على الاستجابة من كل طلب يتم من خلال هذا المحمل ، + لذلك يتم طلب كل ملف مرة واحدة. +

+ +

المنشئ (Constructor)

+ +

[name] ( [param:LoadingManager manager] )

+

+ [page:LoadingManager manager] - [page:LoadingManager loadingManager] + للمحمل الذي سيستخدمه. الافتراضي هو [page:DefaultLoadingManager]. +

+ +

الخصائص (Properties)

+

انظر إلى الصفحة الأساسية [page:Loader] للخصائص المشتركة.

+ +

[property:String mimeType]

+

+ المتوقع + [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types mimeType]. + انظر [page:.setMimeType]. الافتراضي هو `undefined`. +

+ +

[property:String responseType]

+

+ نوع الاستجابة المتوقع. انظر [page:.setResponseType]. الافتراضي هو + `undefined`. +

+ +

الطرق (Methods)

+

انظر إلى الصفحة الأساسية [page:Loader] للطرق المشتركة.

+ +

+ [method:undefined load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] ) +

+

+ [page:String url] - المسار أو عنوان URL للملف. يمكن أن يكون هذا أيضًا + [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].
+ [page:Function onLoad] (اختياري) - سيتم استدعاؤه عند اكتمال التحميل. + الوسيطة ستكون الاستجابة المحملة.
+ [page:Function onProgress] (اختياري) - سيتم استدعاؤه أثناء تقدم التحميل. + الوسيطة ستكون مثيل ProgressEvent ، والذي + يحتوي على .[page:Boolean lengthComputable]، .[page:Integer total] و + .[page:Integer loaded]. إذا لم يضع الخادم رأس Content-Length + ؛ .[page:Integer total] ستكون 0.
+ [page:Function onError] (اختياري) - سيتم استدعاؤه في حالة حدوث خطأ.

+ + قم بتحميل عنوان URL وإرسال الاستجابة إلى وظيفة onLoad. +

+ +

[method:this setMimeType]( [param:String mimeType] )

+

+ قم بتعيين + [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types mimeType] + المتوقع للملف الذي يتم تحميله. لاحظ أنه في كثير من الحالات سيتم + تحديده تلقائيًا ، لذلك بشكل افتراضي هو `undefined`. +

+ +

[method:this setResponseType]( [param:String responseType] )

+

+ قم بتغيير نوع الاستجابة. القيم المقبولة هي:
+ [page:String text] أو سلسلة فارغة (افتراضية) - تعود بالبيانات كـ + [page:String String].
+ [page:String arraybuffer] - يحمل البيانات في + [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer ArrayBuffer] + ويرجع ذلك.
+ [page:String blob] - يعود بالبيانات كـ + [link:https://developer.mozilla.org/en/docs/Web/API/Blob Blob].
+ [page:String document] - يحلل الملف باستخدام + [link:https://developer.mozilla.org/en-US/docs/Web/API/DOMParser DOMParser].
+ [page:String json] - يحلل الملف باستخدام + [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse JSON.parse].
+

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/loaders/ImageBitmapLoader.html b/docs/api/ar/loaders/ImageBitmapLoader.html new file mode 100644 index 00000000000000..e6d2b50658ee14 --- /dev/null +++ b/docs/api/ar/loaders/ImageBitmapLoader.html @@ -0,0 +1,117 @@ + + + + + + + + + + [page:Loader] → + +

[name]

+ +

+ محمل لتحميل صورة [page:Image] كـ + [link:https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap ImageBitmap]. يوفر ImageBitmap مسارًا غير متزامن وفعال من حيث الموارد + لإعداد القوام للتقديم في WebGL.
+ على عكس [page:FileLoader]، [name] لا يتجنب الطلبات المتعددة المتزامنة + إلى نفس عنوان URL. +

+ +

+ لاحظ أن [page:Texture.flipY] و [page:Texture.premultiplyAlpha] مع + [link:https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap ImageBitmap] يتم تجاهلهم. + [link:https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap ImageBitmap] + يحتاج هذه التكوينات على إنشاء الخريطة البيانية على عكس الصور العادية التي تحتاجها عند تحميلها على وحدة معالجة الرسومات. تحتاج إلى تعيين الخيارات المكافئة عبر [page:ImageBitmapLoader.setOptions] بدلاً من ذلك. راجع + [link:https://www.khronos.org/registry/webgl/specs/latest/1.0/#6.10 WebGL specification] للحصول على التفاصيل. +

+ +

مثال الكود

+ + + const loader = new THREE.FileLoader(); + + //load a text file and output the result to the console + loader.load( + // resource URL + 'example.txt', + + // onLoad callback + function ( data ) { + // output the text to the console + console.log( data ) + }, + + // onProgress callback + function ( xhr ) { + console.log( (xhr.loaded / xhr.total * 100) + '% loaded' ); + }, + + // onError callback + function ( err ) { + console.error( 'An error happened' ); + } + ); + + +

أمثلة (Examples)

+ +

[example:webgl_loader_imagebitmap WebGL / loader / ImageBitmap]

+ +

المنشئ (Constructor)

+ +

[name]( [param:LoadingManager manager] )

+

+ [page:LoadingManager manager] - [page:LoadingManager loadingManager] + للمحمل الذي سيستخدمه. الافتراضي هو [page:LoadingManager THREE.DefaultLoadingManager].

+ + ينشئ جديد [name]. +

+ +

الخصائص (Properties)

+

انظر إلى الصفحة الأساسية [page:Loader] للخصائص المشتركة.

+ +

[property:Boolean isImageBitmapLoader]

+

علامة للقراءة فقط للتحقق مما إذا كان الكائن المعطى هو من نوع [name].

+ +

[property:String options]

+

+ كائن اختياري يضع خيارات لـ + [link:https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/createImageBitmap createImageBitmap] + طريقة المصنع المستخدمة داخليًا. الافتراضي هو `undefined`. +

+ +

الطرق (Methods)

+

انظر إلى الصفحة الأساسية [page:Loader] للطرق المشتركة.

+ +

+ [method:undefined load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] ) +

+

+ [page:String url] - المسار أو عنوان URL للملف. يمكن أن يكون هذا أيضًا + [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].
+ [page:Function onLoad] - سيتم استدعاؤه عند اكتمال التحميل. الوسيطة + ستكون الصورة المحملة [page:Image image].
+ [page:Function onProgress] (اختياري) - هذه وظيفة رد الاتصال + غير مدعوم حاليًا.
+ [page:Function onError] (اختياري) - سيتم استدعاؤه عند حدوث خطأ في التحميل.
+

+

+ قم ببدء التحميل من عنوان URL وإرجاع كائن الصورة [page:ImageBitmap image] + الذي سيحتوي على البيانات. +

+ +

[method:this setOptions]( [param:Object options] )

+

+ يضع كائن الخيارات لـ + [link:https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/createImageBitmap createImageBitmap]. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/loaders/ImageLoader.html b/docs/api/ar/loaders/ImageLoader.html new file mode 100644 index 00000000000000..e3cfe30a7ee9a2 --- /dev/null +++ b/docs/api/ar/loaders/ImageLoader.html @@ -0,0 +1,100 @@ + + + + + + + + + + [page:Loader] → + +

[name]

+ +

+ محمل لتحميل صورة [page:Image]. يتم استخدام هذا داخليًا من قبل + [page:CubeTextureLoader]، [page:ObjectLoader] و [page:TextureLoader]. +

+ +

مثال الكود

+ + + // instantiate a loader + const loader = new THREE.ImageLoader(); + + // load a image resource + loader.load( + // resource URL + 'textures/skyboxsun25degtest.png', + + // onLoad callback + function ( image ) { + // use the image, e.g. draw part of it on a canvas + const canvas = document.createElement( 'canvas' ); + const context = canvas.getContext( '2d' ); + context.drawImage( image, 100, 100 ); + }, + + // onProgress callback currently not supported + undefined, + + // onError callback + function () { + console.error( 'An error happened.' ); + } + ); + + +

+ يرجى ملاحظة أن three.js r84 قام بإسقاط دعم أحداث التقدم لـ ImageLoader. + لـ ImageLoader يدعم أحداث التقدم ، انظر + [link:https://github.com/mrdoob/three.js/issues/10439#issuecomment-275785639 هذا الموضوع]. +

+ +

أمثلة (Examples)

+ +

+ [example:webgl_loader_obj WebGL / loader / obj]
+ [example:webgl_shaders_ocean WebGL / shaders / ocean] +

+ +

المنشئ (Constructor)

+ +

[name]( [param:LoadingManager manager] )

+

+ [page:LoadingManager manager] - [page:LoadingManager loadingManager] + للمحمل الذي سيستخدمه. الافتراضي هو [page:LoadingManager THREE.DefaultLoadingManager].

+ + ينشئ جديد [name]. +

+ +

الخصائص (Properties)

+

انظر إلى الصفحة الأساسية [page:Loader] للخصائص المشتركة.

+ +

الطرق (Methods)

+

انظر إلى الصفحة الأساسية [page:Loader] للطرق المشتركة.

+ +

+ [method:HTMLImageElement load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] ) +

+

+ [page:String url] - المسار أو عنوان URL للملف. يمكن أن يكون هذا أيضًا + [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].
+ [page:Function onLoad] - سيتم استدعاؤه عند اكتمال التحميل. الوسيطة + ستكون الصورة المحملة [page:Image image].
+ [page:Function onProgress] (اختياري) - هذه وظيفة رد الاتصال + غير مدعوم حاليًا.
+ [page:Function onError] (اختياري) - سيتم استدعاؤه عند حدوث خطأ في التحميل.
+

+

+ قم ببدء التحميل من عنوان URL وإرجاع كائن الصورة [page:Image image] + الذي سيحتوي على البيانات. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/loaders/Loader.html b/docs/api/ar/loaders/Loader.html new file mode 100644 index 00000000000000..43a0eeb7d92110 --- /dev/null +++ b/docs/api/ar/loaders/Loader.html @@ -0,0 +1,138 @@ + + + + + + + + + +

[name]

+ +

الفئة الأساسية لتنفيذ المحملات.

+ +

المنشئ (Constructor)

+ +

[name]( [param:LoadingManager manager] )

+

+ [page:LoadingManager manager] — [page:LoadingManager loadingManager] + للمحمل الذي سيتم استخدامه. الافتراضي هو [page:LoadingManager THREE.DefaultLoadingManager]. +

+

ينشئ [name] جديد.

+ +

الخصائص (Properties)

+ +

[property:String crossOrigin]

+

+ السلسلة crossOrigin لتنفيذ CORS لتحميل عنوان url من + نطاق مختلف يسمح بـ CORS. الافتراضي هو `anonymous`. +

+ +

[property:Boolean withCredentials]

+

+ ما إذا كان XMLHttpRequest يستخدم بيانات الاعتماد. انظر + [page:.setWithCredentials]. الافتراضي هو `false`. +

+ +

[property:LoadingManager manager]

+

+ [page:LoadingManager loadingManager] الذي يستخدمه المحمل. الافتراضي هو + [page:DefaultLoadingManager]. +

+ +

[property:String path]

+

+ المسار الأساسي الذي سيتم منه تحميل الأصل. الافتراضي هو + سلسلة فارغة. +

+ +

[property:String resourcePath]

+

+ المسار الأساسي الذي سيتم منه تحميل الموارد الإضافية مثل الملمسات. + الافتراضي هو سلسلة فارغة. +

+ +

[property:Object requestHeader]

+

+ [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header رأس الطلب] + المستخدم في طلب HTTP. انظر [page:.setRequestHeader]. + الافتراضي هو كائن فارغ. +

+ +

الطرق (Methods)

+ +

[method:undefined load]()

+

+ يجب تنفيذ هذه الطريقة من قبل جميع المحملات الخرسانية. يحتوي على + المنطق لتحميل الأصل من الخلفية. +

+ +

+ [method:Promise loadAsync]( [param:String url], [param:Function onProgress] ) +

+

+ [page:String url] — سلسلة تحتوي على مسار / عنوان URL للملف المراد + تحميله.
+ [page:Function onProgress] (اختياري) — وظيفة يتم استدعاؤها أثناء + التحميل قيد التقدم. ستكون الوسيطة هي مثيل ProgressEvent ، + الذي يحتوي على .[page:Boolean lengthComputable] ، .[page:Integer total] و + .[page:Integer loaded]. إذا لم يقم الخادم بتعيين رأس Content-Length ؛ + .[page:Integer total] ستكون 0.
+

+

+ هذه الطريقة مكافئة لـ [page:.load] ، ولكنها تعود بـ + [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise Promise]. +

+

+ يتم التعامل مع [page:Function onLoad] من قبل + [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve Promise.resolve] + ويتم التعامل مع [page:Function onError] من قبل + [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/reject Promise.reject]. +

+ +

[method:undefined parse]()

+

+ يجب تنفيذ هذه الطريقة من قبل جميع المحملات الخرسانية. يحتوي على + المنطق لتحليل الأصول إلى كائنات three.js. +

+ +

[method:this setCrossOrigin]( [param:String crossOrigin] )

+

+ [page:String crossOrigin] — سلسلة crossOrigin لتطبيق CORS لـ + تحميل عنوان url من نطاق مختلف يسمح بـ CORS. +

+ +

[method:this setWithCredentials]( [param:Boolean value] )

+

+ ما إذا كان XMLHttpRequest يستخدم بيانات اعتماد مثل ملفات تعريف الارتباط ، ورؤوس التفويض + أو شهادات عميل TLS. انظر + [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
+ لاحظ أن هذا لا يؤثر إذا كنت تقوم بتحميل الملفات محليًا أو من + نفس المجال. +

+ +

[method:this setPath]( [param:String path] )

+

[page:String path] — حدد المسار الأساسي للأصول.

+ +

[method:this setResourcePath]( [param:String resourcePath] )

+

+ [page:String resourcePath] — حدد المسار الأساسي للموارد التابعة + مثل الملمس. +

+ +

[method:this setRequestHeader]( [param:Object requestHeader] )

+

+ [page:Object requestHeader] - key: اسم الرأس الذي ستُضبط قيمته. + value: القيمة التى ستضبط كجسم للرأس.

+ + حدد + [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] المستخدم في طلب HTTP. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/loaders/LoaderUtils.html b/docs/api/ar/loaders/LoaderUtils.html new file mode 100644 index 00000000000000..7a5b5b11ab8612 --- /dev/null +++ b/docs/api/ar/loaders/LoaderUtils.html @@ -0,0 +1,43 @@ + + + + + + + + + +

[name]

+ +

كائن يحتوي على العديد من وظائف المحمل المساعدة.

+ +

الطرق (Methods)

+ +

[method:String decodeText]( [param:TypedArray array] )

+

[page:TypedArray array] — تدفق بايتات كمصفوفة مكتوبة.

+

+ تأخذ الوظيفة تدفق بايتات كمدخل وتعيد تمثيلًا للسلسلة +

+ +

[method:String extractUrlBase]( [param:String url] )

+

[page:String url] — عنوان url الذي سيتم استخراج العنوان الأساسي منه.

+

استخراج الأساس من عنوان URL.

+ +

+ [method:String resolveURL]( [param:String url], [param:String path] ) +

+

+ [page:String url] — عنوان url المطلق أو النسبي للحل. [page:String path] — المسار الأساسي لحل عناوين url النسبية ضده. +

+

+ يحل عناوين url النسبية ضد المسار المعطى. ستعاد المسارات المطلقة وعناوين url للبيانات + وعناوين url للكتل كما هي. ستعود عناوين url غير صالحة + سلسلة فارغة. +

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/loaders/MaterialLoader.html b/docs/api/ar/loaders/MaterialLoader.html new file mode 100644 index 00000000000000..8c2b8a8ab355e0 --- /dev/null +++ b/docs/api/ar/loaders/MaterialLoader.html @@ -0,0 +1,106 @@ + + + + + + + + + + [page:Loader] → + +

[name]

+ +

+ محمل لتحميل [page:Material] بتنسيق JSON. يستخدم هذا + [page:FileLoader] داخليًا لتحميل الملفات. +

+ +

مثال الكود

+ + + // instantiate a loader + const loader = new THREE.MaterialLoader(); + + // load a resource + loader.load( + // resource URL + 'path/to/material.json', + + // onLoad callback + function ( material ) { + object.material = material; + }, + + // onProgress callback + function ( xhr ) { + console.log( (xhr.loaded / xhr.total * 100) + '% loaded' ); + }, + + // onError callback + function ( err ) { + console.log( 'An error happened' ); + } + ); + + +

المنشئ (Constructor)

+ +

[name]( [param:LoadingManager manager] )

+

+ [page:LoadingManager manager] — [page:LoadingManager loadingManager] + للمحمل الذي سيتم استخدامه. الافتراضي هو [page:LoadingManager THREE.DefaultLoadingManager].

+ ينشئ [name] جديد. +

+ + +

الخصائص (Properties)

+

انظر الفئة الأساسية [page:Loader] للخصائص المشتركة.

+ +

[property:Object textures]

+

+ كائن يحمل أي نسيج يستخدمه المواد. انظر [page:.setTextures]. +

+ +

الطرق (Methods)

+

انظر الفئة الأساسية [page:Loader] للطرق المشتركة.

+ +

+ [method:undefined load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] ) +

+

+ [page:String url] — المسار أو عنوان URL للملف. يمكن أن يكون هذا أيضًا + [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].
+ [page:Function onLoad] — سيتم استدعاؤه عند اكتمال التحميل. الحجة + سيكون ال [page:Material] المحمّل.
+ [page:Function onProgress] (اختياري) — سيتم استدعاؤه أثناء تقدم التحميل. الحجة ستكون مثيل ProgressEvent، والذي + يحتوي على .[page:Boolean lengthComputable]، .[page:Integer total] و + .[page:Integer loaded]. إذا لم يضبط الخادم رأس Content-Length + ؛ سيكون .[page:Integer total] 0.
+ [page:Function onError] (اختياري) — سيتم استدعاؤه عند حدوث خطأ في التحميل.

+ + ابدأ التحميل من url. +

+ +

[method:Material parse]( [param:Object json] )

+

+ [page:Object json] — كائن json الذي يحتوي على معلمات + Material.

+ + قم بتحليل هيكل `JSON` وإنشاء جديد [page:Material] من نوع + [page:String json.type] مع المعلمات المحددة في كائن json. +

+ +

[method:this setTextures]( [param:Object textures] )

+

+ [page:Object textures] — كائن يحتوي على أي نسيج يستخدمه + المادة. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/loaders/ObjectLoader.html b/docs/api/ar/loaders/ObjectLoader.html new file mode 100644 index 00000000000000..0b28c06e7e1e1d --- /dev/null +++ b/docs/api/ar/loaders/ObjectLoader.html @@ -0,0 +1,161 @@ + + + + + + + + + + [page:Loader] → + +

[name]

+ +

+ محمل لتحميل مورد JSON في + [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].

+ يستخدم هذا [page:FileLoader] داخليًا لتحميل الملفات. +

+ +

مثال الكود

+ + + const loader = new THREE.ObjectLoader(); + + loader.load( + // resource URL + "models/json/example.json", + + // onLoad callback + // Here the loaded data is assumed to be an object + function ( obj ) { + // Add the loaded object to the scene + scene.add( obj ); + }, + + // onProgress callback + function ( xhr ) { + console.log( (xhr.loaded / xhr.total * 100) + '% loaded' ); + }, + + // onError callback + function ( err ) { + console.error( 'An error happened' ); + } + ); + + + // Alternatively, to parse a previously loaded JSON structure + const object = loader.parse( a_json_object ); + + scene.add( object ); + + +

أمثلة (Examples)

+ +

[example:webgl_materials_lightmap WebGL / materials / lightmap]

+ +

المنشئ (Constructor)

+ +

[name]( [param:LoadingManager manager] )

+

+ [page:LoadingManager manager] — [page:LoadingManager loadingManager] + للمحمل الذي سيتم استخدامه. الافتراضي هو [page:LoadingManager THREE.DefaultLoadingManager].

+ ينشئ [name] جديد. +

+ +

الخصائص (Properties)

+

انظر الفئة الأساسية [page:Loader] للخصائص المشتركة.

+ +

الطرق (Methods)

+

انظر الفئة الأساسية [page:Loader] للطرق المشتركة.

+ +

+ [method:undefined load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] ) +

+

+ [page:String url] — المسار أو عنوان URL للملف. يمكن أن يكون هذا أيضًا + [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].
+ [page:Function onLoad] — سيتم استدعاؤه عند اكتمال التحميل. الحجة + سيكون ال [page:Object3D object] المحمّل.
+ [page:Function onProgress] (اختياري) — سيتم استدعاؤه أثناء تقدم التحميل. الحجة ستكون مثيل ProgressEvent، والذي + يحتوي على .[page:Boolean lengthComputable]، .[page:Integer total] و + .[page:Integer loaded]. إذا لم يضبط الخادم رأس Content-Length + ؛ سيكون .[page:Integer total] 0.
+ [page:Function onError] (اختياري) — سيتم استدعاؤه عند حدوث خطأ في التحميل.
+

+

+ ابدأ التحميل من url واستدعِ onLoad مع محتوى الاستجابة المحلل. +

+ +

+ [method:Object3D parse]( [param:Object json], [param:Function onLoad] ) +

+

+ [page:Object json] — مطلوب. مصدر JSON للتحليل.

+ [page:Function onLoad] — سيتم استدعاؤه عند اكتمال التحليل. ال + الحجة ستكون ال [page:Object3D object] المحلل.

+ قم بتحليل هيكل `JSON` وإرجاع كائن three.js. يستخدم هذا + داخليًا بواسطة [page:.load]() ولكن يمكن أيضًا استخدامه مباشرة لتحليل + هيكل JSON محمّل مسبقًا. +

+ +

[method:Object parseGeometries]( [param:Object json] )

+

+ [page:Object json] — مطلوب. مصدر JSON للتحليل.

+ + يستخدم هذا بواسطة [page:.parse]() لتحليل أي [page:BufferGeometry geometries] في هيكل JSON. +

+ +

[method:Object parseMaterials]( [param:Object json] )

+

+ [page:Object json] — مطلوب. مصدر JSON للتحليل.

+ + يستخدم هذا بواسطة [page:.parse]() لتحليل أي مواد في ال JSON + هيكل باستخدام [page:MaterialLoader]. +

+ +

[method:Object parseAnimations]( [param:Object json] )

+

+ [page:Object json] — مطلوب. مصدر JSON للتحليل.

+ + يستخدم هذا بواسطة [page:.parse]() لتحليل أي رسوم متحركة في ال JSON + هيكل، باستخدام [page:AnimationClip.parse](). +

+ +

[method:Object parseImages]( [param:Object json] )

+

+ [page:Object json] — مطلوب. مصدر JSON للتحليل.

+ + يستخدم هذا بواسطة [page:.parse]() لتحليل أي صور في هيكل JSON، + باستخدام [page:ImageLoader]. +

+ +

[method:Object parseTextures]( [param:Object json] )

+

+ [page:Object json] — مطلوب. مصدر JSON للتحليل.

+ + يستخدم هذا بواسطة [page:.parse]() لتحليل أي نسيج في ال JSON + هيكل. +

+ +

+ [method:Object3D parseObject]( [param:Object json], [param:BufferGeometry geometries], [param:Material materials], [param:AnimationClip animations] ) +

+

+ [page:Object json] — مطلوب. مصدر JSON للتحليل.
+ [page:BufferGeometry geometries] — مطلوب. الهندسات الخاصة بـ + JSON.
+ [page:Material materials] — مطلوب. المواد الخاصة بـ JSON.
+ [page:AnimationClip animations] — مطلوب. الرسوم المتحركة الخاصة بـ JSON.

+ + يستخدم هذا بواسطة [page:.parse]() لتحليل أي كائنات ثُنائية الأبعاد في ال JSON + هيكل. +

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/loaders/TextureLoader.html b/docs/api/ar/loaders/TextureLoader.html new file mode 100644 index 00000000000000..a727f10fa2289a --- /dev/null +++ b/docs/api/ar/loaders/TextureLoader.html @@ -0,0 +1,104 @@ + + + + + + + + + + [page:Loader] → + +

[name]

+ +

+ فئة لتحميل [page:Texture texture]. يستخدم هذا + [page:ImageLoader] داخليًا لتحميل الملفات. +

+ +

مثال الكود

+ + + const texture = new THREE.TextureLoader().load('textures/land_ocean_ice_cloud_2048.jpg' ); + // immediately use the texture for material creation + + const material = new THREE.MeshBasicMaterial( { map:texture } ); + + +

مثال الكود مع الردود (Code Example with Callbacks)

+ + + // instantiate a loader + const loader = new THREE.TextureLoader(); + + // load a resource + loader.load( + // resource URL + 'textures/land_ocean_ice_cloud_2048.jpg', + + // onLoad callback + function ( texture ) { + // in this example we create the material when the texture is loaded + const material = new THREE.MeshBasicMaterial( { + map: texture + } ); + }, + + // onProgress callback currently not supported + undefined, + + // onError callback + function ( err ) { + console.error( 'An error happened.' ); + } + ); + + +

+ يرجى ملاحظة أن three.js r84 قام بإسقاط دعم حدث التقدم لـ TextureLoader + . لـ TextureLoader يدعم أحداث التقدم، انظر + [link:https://github.com/mrdoob/three.js/issues/10439#issuecomment-293260145 هذا الموضوع]. +

+ +

أمثلة (Examples)

+

[example:webgl_geometry_cube geometry / cube]

+ +

المنشئ (Constructor)

+

[name]( [param:LoadingManager manager] )

+

+ [page:LoadingManager manager] — [page:LoadingManager loadingManager] + للمحمل الذي سيتم استخدامه. الافتراضي هو [page:LoadingManager THREE.DefaultLoadingManager].

+ + ينشئ [name] جديد. +

+ +

الخصائص (Properties)

+

انظر الفئة الأساسية [page:Loader] للخصائص المشتركة.

+ +

الطرق (Methods)

+

انظر الفئة الأساسية [page:Loader] للطرق المشتركة.

+ +

+ [method:Texture load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] ) +

+

+ [page:String url] — المسار أو عنوان URL للملف. يمكن أن يكون هذا أيضًا + [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].
+ [page:Function onLoad] (اختياري) — سيتم استدعاؤه عند اكتمال التحميل. + الحجة ستكون ال [page:Texture texture] المحمّل.
+ [page:Function onProgress] (اختياري) — هذه الدالة الرجعية + غير مدعومة حاليًا.
+ [page:Function onError] (اختياري) — سيتم استدعاؤه عند حدوث خطأ في التحميل.

+ + ابدأ التحميل من عنوان URL المعطى وأرسل الـ[page:Texture texture] المحمّل بالكامل + إلى onLoad. تعيد الطريقة أيضًا كائن نسيج جديد يمكن + استخدامه مباشرة لإنشاء المادة. إذا قمت بذلك بهذه الطريقة، فقد يظهر النسيج + في مشهدك بمجرد انتهاء عملية التحميل المعنية. +

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/loaders/managers/DefaultLoadingManager.html b/docs/api/ar/loaders/managers/DefaultLoadingManager.html new file mode 100644 index 00000000000000..7fa15480bc662f --- /dev/null +++ b/docs/api/ar/loaders/managers/DefaultLoadingManager.html @@ -0,0 +1,68 @@ + + + + + + + + + +

[name]

+ +

+ نسخة عالمية من [page:LoadingManager LoadingManager]، يستخدمها + معظم المحملات عندما لم يتم تحديد مدير مخصص.

+ + هذا سيكون كافيًا لمعظم الأغراض، ولكن قد يكون هناك أوقات عندما + ترغب في مديري تحميل منفصلين للقول، القوام والنماذج. +

+ +

مثال للكود

+ +

+ يمكنك تعيين [page:LoadingManager.onStart onStart]، + [page:LoadingManager.onLoad onLoad]، [page:LoadingManager.onProgress onProgress]، + [page:LoadingManager.onStart onError] وظائف لل + مدير. ستطبق هذه على أي محملات تستخدم + DefaultLoadingManager.

+ + يجب عدم الخلط بين هذه الوظائف المسماة بشكل مشابه + من المحملات الفردية، لأنها مخصصة لعرض المعلومات + حول الحالة العامة للتحميل، بدلاً من التعامل مع البيانات + التي تم تحميلها. +

+ +THREE.DefaultLoadingManager.onStart = function ( url, itemsLoaded, itemsTotal ) { + console.log( 'Started loading file: ' + url + '.\nLoaded ' + itemsLoaded + ' of ' + itemsTotal + ' files.' ); +}; + +THREE.DefaultLoadingManager.onLoad = function ( ) { + console.log( 'Loading Complete!'); +}; + +THREE.DefaultLoadingManager.onProgress = function ( url, itemsLoaded, itemsTotal ) { + console.log( 'Loading file: ' + url + '.\nLoaded ' + itemsLoaded + ' of ' + itemsTotal + ' files.' ); +}; + +THREE.DefaultLoadingManager.onError = function ( url ) { + console.log( 'There was an error loading ' + url ); +}; + + +

الخصائص (Properties)

+

+ انظر صفحة [page:LoadingManager LoadingManager] لتفاصيل + الخصائص. +

+ +

الطرق (Methods)

+

+ انظر صفحة [page:LoadingManager LoadingManager] لتفاصيل الطرق. +

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/loaders/LoadingManager.js src/loaders/LoadingManager.js] +

+ + diff --git a/docs/api/ar/loaders/managers/LoadingManager.html b/docs/api/ar/loaders/managers/LoadingManager.html new file mode 100644 index 00000000000000..bfe70192ed9d59 --- /dev/null +++ b/docs/api/ar/loaders/managers/LoadingManager.html @@ -0,0 +1,236 @@ + + + + + + + + + +

[name]

+ +

+ يتعامل ويتتبع البيانات المحملة والمعلقة. يتم إنشاء نسخة عالمية افتراضية + من هذه الفئة واستخدامها من قبل المحملات إذا لم يتم توفيرها + يدويًا - انظر [page:DefaultLoadingManager].

+ + بشكل عام يجب أن يكون ذلك كافيًا، ولكن هناك أوقات يمكن أن تكون فيها + مفيدًا لديك محملات منفصلة - على سبيل المثال إذا كنت ترغب في عرض + شرائط تحميل منفصلة للأشياء والقوام. +

+ +

مثال للكود

+ +

+ يوضح هذا المثال كيفية استخدام LoadingManager لتتبع التقدم + [page:OBJLoader]. +

+ + + const manager = new THREE.LoadingManager(); + manager.onStart = function ( url, itemsLoaded, itemsTotal ) { + console.log( 'Started loading file: ' + url + '.\nLoaded ' + itemsLoaded + ' of ' + itemsTotal + ' files.' ); + }; + + manager.onLoad = function ( ) { + console.log( 'Loading complete!'); + }; + + manager.onProgress = function ( url, itemsLoaded, itemsTotal ) { + console.log( 'Loading file: ' + url + '.\nLoaded ' + itemsLoaded + ' of ' + itemsTotal + ' files.' ); + }; + + manager.onError = function ( url ) { + console.log( 'There was an error loading ' + url ); + }; + + const loader = new THREE.OBJLoader( manager ); + loader.load( 'file.obj', function ( object ) { + // + } ); + + +

+ بالإضافة إلى مراقبة التقدم، يمكن استخدام LoadingManager ل + تجاوز عناوين URL للموارد أثناء التحميل. قد يكون ذلك مفيدًا للأصول + القادمة من أحداث السحب والإفلات، WebSockets، WebRTC، أو غيرها من واجهات برمجة التطبيقات. A + مثال يظهر كيفية تحميل نموذج في الذاكرة باستخدام عناوين URL لـ Blob أدناه. +

+ + + // Blob or File objects created when dragging files into the webpage. + const blobs = {'fish.gltf': blob1, 'diffuse.png': blob2, 'normal.png': blob3}; + + const manager = new THREE.LoadingManager(); + + // Initialize loading manager with URL callback. + const objectURLs = []; + manager.setURLModifier( ( url ) => { + + url = URL.createObjectURL( blobs[ url ] ); + objectURLs.push( url ); + return url; + + } ); + + // Load as usual, then revoke the blob URLs. + const loader = new THREE.GLTFLoader( manager ); + loader.load( 'fish.gltf', (gltf) => { + + scene.add( gltf.scene ); + objectURLs.forEach( ( url ) => URL.revokeObjectURL( url ) ); + + }); + + +

أمثلة (Examples)

+ +

+ [example:webgl_loader_obj WebGL / loader / obj]
+ [example:webgl_postprocessing_outline WebGL / postprocesing / outline] +

+ +

المنشئ (Constructor)

+

+ [name]( [param:Function onLoad], [param:Function onProgress], + [param:Function onError] ) +

+

+ [page:Function onLoad] — (اختياري) سيتم استدعاء هذه الدالة عندما يتم + جميع المحملات.
+ [page:Function onProgress] — (اختياري) سيتم استدعاء هذه الدالة عند + اكتمال عنصر.
+ [page:Function onError] — (اختياري) سيتم استدعاء هذه الدالة عندما يواجه المحمل + أخطاء.
+ + ينشئ جديدًا [name]. +

+ +

الخصائص (Properties)

+ +

[property:Function onStart]

+

+ سيتم استدعاء هذه الدالة عند بدء التحميل. المعاملات هي:
+ [page:String url] — عنوان url للعنصر المحمل للتو.
+ [page:Integer itemsLoaded] — عدد العناصر المحملة حتى الآن.
+ [page:Integer itemsTotal] — إجمالي عدد العناصر التي يجب تحميلها.

+ + بشكل افتراضي هذا غير محدد. +

+ +

[property:Function onLoad]

+

+ سيتم استدعاء هذه الدالة عند اكتمال جميع التحميلات. بشكل افتراضي + هذا غير محدد، ما لم يتم تمريره في المنشئ. +

+ +

[property:Function onProgress]

+

+ سيتم استدعاء هذه الدالة عند اكتمال عنصر. المعاملات + هي:
+ [page:String url] — عنوان url للعنصر المحمل للتو.
+ [page:Integer itemsLoaded] — عدد العناصر المحملة حتى الآن.
+ [page:Integer itemsTotal] — إجمالي عدد العناصر التي يجب تحميلها.

+ + بشكل افتراضي هذا غير محدد، ما لم يتم تمريره في المنشئ. +

+ +

[property:Function onError]

+

+ سيتم استدعاء هذه الدالة عند حدوث خطأ في أي عنصر، مع الحجة:
+ [page:String url] — عنوان url للعنصر الذي حدث فيه خطأ.

+ + بشكل افتراضي هذا غير محدد، ما لم يتم تمريره في المنشئ. +

+ +

الطرق (Methods)

+ +

+ [method:this addHandler]( [param:Object regex], [param:Loader loader] ) +

+

+ [page:Object regex] — تعبير منتظم.
+ [page:Loader loader] — المحمل. +

+ +

+ يسجل محملًا مع التعبير المنتظم المعطى. يمكن استخدامه ل + تحديد أي محمل يجب استخدامه لتحميل ملفات معينة. A + حالة استخدام نموذجية هي الكتابة فوق المحمل الافتراضي للقوام. +

+ +// add handler for TGA textures +manager.addHandler( /\.tga$/i, new TGALoader() ); + + +

[method:Loader getHandler]( [param:String file] )

+

[page:String file] — مسار الملف.

+ +

+ يمكن استخدامه لاسترجاع المحمل المسجل لمسار الملف المعطى. +

+ +

[method:this removeHandler]( [param:Object regex] )

+

[page:Object regex] — تعبير منتظم.

+ +

يزيل المحمل للتعبير المنتظم المعطى.

+ +

[method:String resolveURL]( [param:String url] )

+

+ [page:String url] — عنوان url للتحميل

+ + بالنظر إلى عنوان URL، يستخدم رد الاتصال بتعديل URL (إن وجد) ويعيد + عنوان URL المحلول. إذا لم يتم تعيين تعديل URL، فسيتم إرجاع العنوان الأصلي. +

+ +

[method:this setURLModifier]( [param:Function callback] )

+

+ [page:Function callback] — رد اتصال تعديل URL. يتم استدعاؤه مع [page:String url] الحجة، + ويجب أن يعود [page:String resolvedURL].

+ + إذا تم توفيره، سيتم تمرير رد الاتصال لكل عنوان URL للمورد قبل + يتم إرسال طلب. قد يعود الرد الاتصال بالعنوان الأصلي، أو عنوان URL جديد ل + تجاوز سلوك التحميل. يمكن استخدام هذا السلوك لتحميل الأصول من + ملفات .ZIP، واجهات برمجة التطبيقات السحب والإفلات، وعناوين URI البيانات. +

+ +
+ +

+ + ملاحظة: تم تصميم الطرق التالية ليتم استدعاؤها داخليًا من قبل + المحملات. يجب ألا تستدعيها مباشرة. + +

+ +

[method:undefined itemStart]( [param:String url] )

+

+ [page:String url] — عنوان url للتحميل

+ + يجب استدعاء هذا من قبل أي محمل يستخدم المدير عندما يبدأ المحمل + تحميل عنوان url. +

+ +

[method:undefined itemEnd]( [param:String url] )

+

+ [page:String url] — عنوان url المحمَّل

+ + يجب استدعاء هذا من قبل أي محمل يستخدم المدير عند انتهاء المحمل + تحميل عنوان url. +

+ +

[method:undefined itemError]( [param:String url] )

+

+ [page:String url] — عنوان url المحمَّل

+ + يجب استدعاء هذا من قبل أي محمل يستخدم المدير عند حدوث خطأ في المحمل + تحميل عنوان url. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/loaders/LoadingManager.js src/loaders/LoadingManager.js] +

+ + diff --git a/docs/api/ar/materials/LineBasicMaterial.html b/docs/api/ar/materials/LineBasicMaterial.html new file mode 100644 index 00000000000000..a02727e47d3ae8 --- /dev/null +++ b/docs/api/ar/materials/LineBasicMaterial.html @@ -0,0 +1,104 @@ + + + + + + + + + + [page:Material] → + +

[name]

+ +

مادة لرسم الهندسة على طريقة الإطار السلكي.

+ +

مثال الكود

+ + const material = new THREE.LineBasicMaterial( { + color: 0xffffff, + linewidth: 1, + linecap: 'round', //ignored by WebGLRenderer + linejoin: 'round' //ignored by WebGLRenderer + } ); + + +

أمثلة (Examples)

+

+ [example:webgl_buffergeometry_drawrange WebGL / buffergeometry / drawrange]
+ [example:webgl_buffergeometry_lines WebGL / buffergeometry / lines]
+ [example:webgl_buffergeometry_lines_indexed WebGL / buffergeometry / lines / indexed]
+ [example:webgl_decals WebGL / decals]
+ [example:webgl_geometry_nurbs WebGL / geometry / nurbs]
+ [example:webgl_geometry_shapes WebGL / geometry / shapes]
+ [example:webgl_geometry_spline_editor WebGL / geometry / spline / editor]
+ [example:webgl_interactive_buffergeometry WebGL / interactive / buffergeometry]
+ [example:webgl_interactive_voxelpainter WebGL / interactive / voxelpainter]
+ [example:webgl_lines_colors WebGL / lines / colors]
+ [example:webgl_lines_dashed WebGL / lines / dashed]
+ [example:physics_ammo_rope physics / ammo / rope] +

+ +

المنشئ (Constructor)

+

[name]( [param:Object parameters] )

+ +

+ [page:Object parameters] - (اختياري) كائن به خاصية واحدة أو أكثر + تحدد مظهر المادة. يمكن تمرير أي خاصية من المادة (بما في ذلك أي خاصية موروثة من [page:Material]) هنا.

+ + الاستثناء هو الخاصية [page:Hexadecimal color]، التي يمكن تمريرها كسلسلة ست عشرية وهي `0xffffff` (أبيض) بشكل افتراضي. + يتم استدعاء [page:Color.set]( color ) داخليًا. +

+ +

الخصائص (Properties)

+

انظر إلى الفئة الأساسية [page:Material] للحصول على خصائص شائعة.

+ +

[property:Color color]

+

[page:Color] للمادة ، الافتراضي هو الأبيض (0xffffff).

+ +

[property:Boolean fog]

+

ما إذا كانت المادة متأثرة بالضباب. الافتراضي هو `true`.

+ +

[property:Float linewidth]

+

+ يتحكم في سمك الخط. الافتراضي هو `1`.

+ + بسبب قيود + [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] + مع [page:WebGLRenderer WebGL] renderer على معظم + المنصات سيكون linewidth دائمًا 1 بغض النظر عن القيمة المحددة. +

+ +

[property:String linecap]

+

+ تحديد مظهر نهايات الخط. القيم الممكنة هي 'butt' و 'round' و + 'square'. الافتراضي هو 'round'.

+ + هذا يتوافق مع + [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap] + خاصية ويتم تجاهلها من قبل [page:WebGLRenderer WebGL] renderer. +

+ +

[property:String linejoin]

+

+ تحديد مظهر مفاصل الخط. القيم الممكنة هي 'round' و 'bevel' و + 'miter'. الافتراضي هو 'round'.

+ + هذا يتوافق مع + [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin] + خاصية ويتم تجاهلها من قبل [page:WebGLRenderer WebGL] renderer. +

+ +

[property:Texture map]

+

يحدد لون الخطوط باستخدام بيانات من [page:Texture].

+ +

الطرق (Methods)

+

انظر إلى قاعدة [page:Material] class للطرق المشتركة.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/materials/LineDashedMaterial.html b/docs/api/ar/materials/LineDashedMaterial.html new file mode 100644 index 00000000000000..3dbb2af30e398a --- /dev/null +++ b/docs/api/ar/materials/LineDashedMaterial.html @@ -0,0 +1,69 @@ + + + + + + + + + + [page:Material] → [page:LineBasicMaterial] → + +

[name]

+ +

+ مادة لرسم الهندسة على طريقة الإطار السلكي بخطوط متقطعة. +

+ +

مثال الكود

+ + + const material = new THREE.LineDashedMaterial( { + color: 0xffffff, + linewidth: 1, + scale: 1, + dashSize: 3, + gapSize: 1, + } ); + + +

أمثلة (Examples)

+ +

[example:webgl_lines_dashed WebGL / lines / dashed]

+ +

المنشئ (Constructor)

+ +

[name]( [param:Object parameters] )

+

+ [page:Object parameters] - (اختياري) كائن به خاصية واحدة أو أكثر + تحدد مظهر المادة. يمكن تمرير أي خاصية من المادة (بما في ذلك أي خاصية موروثة من [page:LineBasicMaterial]) + هنا. +

+ +

الخصائص (Properties)

+

انظر إلى الفئة الأساسية [page:LineBasicMaterial] للحصول على خصائص شائعة.

+ +

[property:number dashSize]

+

+ حجم الشَرطة. هذا هو كل من الفجوة مع الضربة. الافتراضي هو + `3`. +

+ +

[property:number gapSize]

+

حجم الفجوة. الافتراضي هو `1`.

+ +

[property:Boolean isLineDashedMaterial]

+

علامة قراءة فقط للتحقق مما إذا كان كائنًا معينًا من نوع [name].

+ +

[property:number scale]

+

مقياس الجزء المتقطع من الخط. الافتراضي هو `1`.

+ +

الطرق (Methods)

+

انظر إلى الفئة الأساسية [page:LineBasicMaterial] للحصول على طرق شائعة.

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/materials/Material.html b/docs/api/ar/materials/Material.html new file mode 100644 index 00000000000000..e8027c8939cb45 --- /dev/null +++ b/docs/api/ar/materials/Material.html @@ -0,0 +1,447 @@ + + + + + + + + + +

[name]

+ +

+ الفئة الأساسية المجردة للمواد.

+ + تصف المواد مظهر [page:Object objects]. هم + محددة بطريقة (غالبًا) مستقلة عن المصور ، لذلك لا تضطر إلى + إعادة كتابة المواد إذا قررت استخدام مصور مختلف.

+ + تمتلك الخصائص والطرق التالية من جميع أنواع المواد الأخرى + (على الرغم من أنها قد تكون لها افتراضات مختلفة). +

+ +

المنشئ (Constructor)

+ +

[name]()

+

هذا ينشئ مادة عامة.

+ +

الخصائص (Properties)

+ +

[property:Float alphaTest]

+

+ يحدد قيمة ألفا التي يجب استخدامها عند تشغيل اختبار ألفا. المادة + لن يتم عرضه إذا كانت الشفافية أقل من هذه القيمة. الافتراضي هو + `0`. +

+ +

[property:Boolean alphaToCoverage]

+

+ يمكّن ألفا للتغطية. يمكن استخدامه فقط مع سياقات MSAA-enabled + (وهذا يعني عند إنشاء المصور بمعامل `antialias` مضبوطًا على + `true`). الافتراضي هو `false`. +

+ +

[property:Integer blendDst]

+

+ وجهة المزج. الافتراضي هو [page:CustomBlendingEquation OneMinusSrcAlphaFactor]. + انظر عوامل الوجهة [page:CustomBlendingEquation constants] لجميع القِيَم المحتملة.
+ يجب تعيين [page:Constant blending] للمادة على [page:Materials CustomBlending] + لهذا لديه أي تأثير. +

+ +

[property:Integer blendDstAlpha]

+

+ شفافية [page:.blendDst]. يستخدم قيمة [page:.blendDst] إذا + null. الافتراضي هو `null`. +

+ +

[property:Integer blendEquation]

+

+ معادلة المزج للاستخدام عند تطبيق المزج. الافتراضي هو + [page:CustomBlendingEquation AddEquation]. انظر معادلة المزج + [page:CustomBlendingEquation constants] لجميع القيم الممكنة.
+ يجب تعيين [page:Constant blending] للمادة على [page:Materials CustomBlending] + لهذا لديه أي تأثير. +

+ +

[property:Integer blendEquationAlpha]

+

+ شفافية [page:.blendEquation]. يستخدم قيمة [page:.blendEquation] + إذا كان null. الافتراضي هو `null`. +

+ +

[property:Blending blending]

+

+ أي مزج للاستخدام عند عرض الكائنات بهذه المادة.
+ يجب تعيين هذا على [page:Materials CustomBlending] لاستخدام مخصص + [page:Constant blendSrc]، [page:Constant blendDst] أو [page:Constant blendEquation].
+ انظر وضع المزج [page:Materials constants] لجميع القيم الممكنة. + الافتراضي هو [page:Materials NormalBlending]. +

+ +

[property:Integer blendSrc]

+

+ مصدر المزج. الافتراضي هو [page:CustomBlendingEquation SrcAlphaFactor]. + انظر عوامل المصدر [page:CustomBlendingEquation constants] للكل + القِيَم المحتملة.
+ يجب تعيين [page:Constant blending] للمادة على [page:Materials CustomBlending] + لهذا لديه أي تأثير. +

+ +

[property:Integer blendSrcAlpha]

+

+ شفافية [page:.blendSrc]. يستخدم قيمة [page:.blendSrc] إذا + null. الافتراضي هو `null`. +

+ +

[property:Boolean clipIntersection]

+

+ تغير سلوك مستويات القطع بحيث يتم قطع تقاطعها فقط + ، بدلاً من اتحادهم. الافتراضي هو `false`. +

+ +

[property:Array clippingPlanes]

+

+ مستويات القطع المحددة من قبل المستخدم محددة كـ THREE.Plane objects في العالم + الفضاء. تنطبق هذه المستويات على الكائنات التي يتم إرفاق هذه المادة بها. + يتم قطع النقاط في الفضاء التي يكون مسافتها الموقعة إلى المستوى سلبية + (غير معروض). هذا يتطلب [page:WebGLRenderer.localClippingEnabled] إلى + كن `true`. انظر [example:webgl_clipping_intersection WebGL / clipping /intersection] مثال. الافتراضي هو `null`. +

+ +

[property:Boolean clipShadows]

+

+ يحدد ما إذا كان يجب قطع الظلال وفقًا للمستويات القطع المحددة + على هذه المادة. الافتراضي هو `false`. +

+ +

[property:Boolean colorWrite]

+

+ سواء كان يجب عرض لون المادة. يمكن استخدام هذا بالتزامن + مع خاصية [page:Integer renderOrder] لشبكة لإنشاء غير مرئية + الأشياء التي تحجب الأشياء الأخرى. الافتراضي هو `true`. +

+ +

[property:Object defines]

+

+ تعريفات مخصصة لإدخالها في المظلل. يتم تمرير هذه في شكل + محدد كائن حرفي ، بأزواج من المفتاح / القيمة. `{ MY_CUSTOM_DEFINE: '' , PI2: + Math.PI * 2 }`. يتم تعريف الأزواج في كل من قمة وشظية المظللات. + الافتراضي هو `undefined`. +

+ +

[property:Integer depthFunc]

+

+ أي دالة عمق للاستخدام. الافتراضي هو [page:Materials LessEqualDepth]. + انظر وضع العمق [page:Materials constants] لجميع القيم الممكنة. +

+ +

[property:Boolean depthTest]

+

+ سواء كان يجب تمكين اختبار العمق عند عرض هذه المادة. افتراضي + هو `true`. +

+ +

[property:Boolean depthWrite]

+

+ سواء كان عرض هذه المادة له أي تأثير على مخزن العمق. + الافتراضي هو `true`.

+ + عند رسم تراكبات 2D ، يمكن أن يكون من المفيد تعطيل كتابة العمق في + لطبقة عدة أشياء معًا دون إنشاء فنون فهرس z. +

+ +

[property:Boolean forceSinglePass]

+

+ سواء كان يجب عرض الأشياء الشفافة ذات الجانبين بمرور واحد + أم لا. الافتراضي هو `false`.

+ + يعرض المحرك الأشياء الشفافة ذات الجانبين بمكالمتين رسم + (الوجوه الخلفية أولاً ، ثم الوجوه الأمامية) للتخفيف من التحولات الشفافة. + هناك سيناريوهات ومع ذلك حيث لا ينتج هذا النهج عن مكاسب في الجودة + ولكن لا يزال يضاعف المكالمات الرسمية على سبيل المثال عند عرض نباتات مسطحة مثل + رشات العشب. في هذه الحالات ، قم بتعيين علامة `forceSinglePass` على `true` إلى + تعطيل التقديم المزدوج لتجنب مشاكل الأداء. +

+ +

[property:Boolean isMaterial]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معينًا من نوع [name].

+ +

[property:Boolean stencilWrite]

+

+ سواء كانت تتم عمليات الشبكة ضد مخزن الشبكة. في + لإجراء كتابات أو مقارنات ضد مخزن الشبكة هذه + القيمة يجب أن تكون `true`. الافتراضي هو `false`. +

+ +

[property:Integer stencilWriteMask]

+

+ قناع البت المستخدم عند الكتابة إلى مخزن الشبكة. الافتراضي هو `0xFF`. +

+ +

[property:Integer stencilFunc]

+

+ دالة المقارنة بالشبكة التي يجب استخدامها. الافتراضي هو [page:Materials AlwaysStencilFunc]. + انظر دالة شبكية [page:Materials constants] لـ + جميع القيم الممكنة. +

+ +

[property:Integer stencilRef]

+

+ القيمة المستخدمة عند إجراء مقارنات شبكية أو شبكية + عمليات. الافتراضي هو `0`. +

+ +

[property:Integer stencilFuncMask]

+

+ قناع البت المستخدم عند المقارنة مع مخزن الشبكة. الافتراضي هو + `0xFF`. +

+ +

[property:Integer stencilFail]

+

+ العملية الشبكية التي يجب تنفيذها عندما تعود دالة المقارنة + خطأ. الافتراضي هو [page:Materials KeepStencilOp]. انظر شبكية + عمليات [page:Materials constants] لجميع القيم الممكنة. +

+ +

[property:Integer stencilZFail]

+

+ العملية الشبكية التي يجب تنفيذها عندما تعود دالة المقارنة + صحيح ولكن اختبار العمق يفشل. الافتراضي هو [page:Materials KeepStencilOp]. + انظر عمليات شبكية [page:Materials constants] لجميع المحتمل + القِيَم. +

+ +

[property:Integer stencilZPass]

+

+ العملية الشبكية التي يجب تنفيذها عندما تعود دالة المقارنة + صحيح واختبار العمق يمر. الافتراضي هو [page:Materials KeepStencilOp]. + انظر عمليات الشبكة [page:Materials constants] لجميع القيم الممكنة +

+ +

[property:Integer id]

+

رقم فريد لهذه المادة.

+ +

[property:String name]

+

+ اسم اختياري للكائن (لا يحتاج إلى أن يكون فريدًا). الافتراضي هو + سلسلة فارغة. +

+ +

[property:Boolean needsUpdate]

+

يحدد أن المادة تحتاج إلى إعادة التجميع.

+ +

[property:Float opacity]

+

+ عائم في نطاق `0.0` - `1.0` يشير إلى مدى شفافية + المادة. قيمة `0.0` تشير إلى الشفافية الكاملة ، `1.0` هو كامل + غير شفاف.
+ إذا لم يتم تعيين خاصية [page:Boolean transparent] للمادة على + `true`، ستظل المادة غير شفافة تمامًا وسيؤثر هذا القيمة فقط + تأثير لونه.
+ الافتراضي هو `1.0`. +

+ +

[property:Boolean polygonOffset]

+

+ سواء كان يجب استخدام إزاحة المضلع. الافتراضي هو `false`. هذا يتوافق مع + `GL_POLYGON_OFFSET_FILL` ميزة WebGL. +

+ +

[property:Integer polygonOffsetFactor]

+

تعيين عامل إزاحة المضلع. الافتراضي هو `0`.

+ +

[property:Integer polygonOffsetUnits]

+

تعيين وحدات إزاحة المضلع. الافتراضي هو `0`.

+ +

[property:String precision]

+

+ تجاوز دقة المصور الافتراضية لهذه المادة. يمكن أن يكون + `"highp"`، `"mediump"` أو `"lowp"`. الافتراضي هو `null`. +

+ +

[property:Boolean premultipliedAlpha]

+

+ سواء كان يجب ضرب قيمة ألفا (الشفافية). انظر + [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] + لمثال على الفرق. الافتراضي هو `false`. +

+ +

[property:Boolean dithering]

+

+ سواء كان يجب تطبيق التدرج على اللون لإزالة مظهر + الفرقة. الافتراضي هو `false`. +

+ +

[property:Integer shadowSide]

+

+ يحدد أي جانب من الوجوه يلقي الظلال. عند التعيين، يمكن أن يكون [page:Materials THREE.FrontSide]، + [page:Materials THREE.BackSide]، أو [page:Materials THREE.DoubleSide]. + الافتراضي هو `null`.
+ إذا كان `null`، يتم تحديد الجانب الذي يلقي الظلال على النحو التالي:
+

+ + + + + + + + + + + + + + + + + + + + + + +
[page:Material.side]Side casting shadows
THREE.FrontSideback side
THREE.BackSidefront side
THREE.DoubleSideboth sides
+ +

[property:Integer side]

+

+ يحدد أي جانب من الوجوه سيتم عرضه - الأمامية، الخلفية أو كلاهما. + الافتراضي هو [page:Materials THREE.FrontSide]. خيارات أخرى هي + [page:Materials THREE.BackSide] أو [page:Materials THREE.DoubleSide]. +

+ +

[property:Boolean toneMapped]

+

+ يحدد ما إذا كانت هذه المادة معدلة نغمة وفقًا لإعدادات [page:WebGLRenderer.toneMapping toneMapping] للمُصير. + الافتراضي هو `true`. +

+ +

[property:Boolean transparent]

+

+ يحدد ما إذا كانت هذه المادة شفافة. له تأثير على + التصيير كما تحتاج الأشياء الشفافة إلى معاملة خاصة وتُصاغ + بعد الأشياء غير الشفافة.
+ عند تعيينه على true، يتم التحكم في مدى شفافية المادة + عن طريق تعيين خاصية [page:Float opacity] الخاصة به.
+ الافتراضي هو `false`. +

+ +

[property:String type]

+

+ القيمة هي السلسلة 'Material'. يجب عدم تغيير هذا، ويمكن استخدامه + للعثور على جميع الكائنات من هذا النوع في المشهد. +

+ +

[property:String uuid]

+

+ [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] من + هذه الحالة المادية. يتم تعيين هذا تلقائيًا، لذلك يجب عدم تحريره. +

+ +

[property:Integer version]

+

+ يبدأ هذا في `0` ويحسب كم مرة يتم تعيين [page:Material.needsUpdate .needsUpdate] إلى `true`. +

+ +

[property:Boolean vertexColors]

+

+ يحدد ما إذا كان يتم استخدام تلوين الرأس. الافتراضي هو `false`. يدعم المحرك + ألوان RGB و RGBA للرأس اعتمادًا على ما إذا كان يتم استخدام سمة مخزنة لونية + ذات ثلاثة (RGB) أو أربعة (RGBA) مكونات. +

+ +

[property:Boolean visible]

+

يحدد ما إذا كانت هذه المادة مرئية. الافتراضي هو `true`.

+ +

[property:Object userData]

+

+ كائن يمكن استخدامه لتخزين بيانات مخصصة حول المادة. يجب ألا يحتوي على + مراجع إلى الوظائف لأنها لن تتم نسخها. +

+ +

الطرق (Methods)

+

+ طرق [page:EventDispatcher EventDispatcher] متاحة على هذه + الفئة. +

+ +

[method:Material clone]( )

+

يرجع مادة جديدة بنفس المعلمات كهذه المادة.

+ +

[method:this copy]( [param:material material] )

+

انسخ المعلمات من المادة المارة إلى هذه المادة.

+ +

[method:undefined dispose]()

+

+ يحرر الموارد المتعلقة بوحدة معالجة الرسومات التي تم تخصيصها بواسطة هذه الحالة. اتصل بهذه + الطريقة كلما لم يعد هذه الحالة مستخدمة في التطبيق الخاص بك. +

+

+ يجب التخلص من نسج المادة من خلال طريقة dispose() من + [page:Texture Texture]. +

+ +

+ [method:undefined onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) +

+

+ رد الاتصال الاختياري الذي يتم تنفيذه مباشرة قبل تجميع برنامج الشادر. يتم استدعاء هذه الدالة مع شفرة مصدر الشادر كمعلمة. مفيد لتعديل المواد المدمجة. +

+

+ على عكس الخصائص، لا يتم دعم رد الاتصال بواسطة [page:Material.clone .clone]()، + [page:Material.copy .copy]() و [page:Material.toJSON .toJSON](). +

+ +

[method:String customProgramCacheKey]()

+

+ في حالة استخدام onBeforeCompile، يمكن استخدام هذا الرد الاتصال لتحديد + قيم إعدادات المستخدمة في onBeforeCompile، بحيث يمكن لـ three.js إعادة استخدام + شادر مخزن في ذاكرة التخزين المؤقت أو إعادة تجميع شادر لهذه المادة حسب الحاجة. +

+ +

+ على سبيل المثال، إذا كان onBeforeCompile يحتوي على جملة شرطية مثل:
+ + + if ( black ) { + shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', + 'gl_FragColor = vec4(0)') + } + + + فيجب تعيين customProgramCacheKey مثل هذا:
+ + + material.customProgramCacheKey = function() { + return black ? '1' : '0'; + } + +

+ +

+ على عكس الخصائص، لا يتم دعم رد الاتصال بواسطة [page:Material.clone .clone]()، + [page:Material.copy .copy]() و [page:Material.toJSON .toJSON](). +

+ +

[method:undefined setValues]( [param:Object values] )

+

+ values - حاوية بالمعلمات.
+ يضبط الخصائص بناءً على `values`. +

+ +

[method:Object toJSON]( [param:Object meta] )

+

+ meta - كائن يحتوي على بيانات تعريفية مثل الملمس أو الصور للمادة.
+ تحويل المادة إلى three.js + [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format]. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/materials/MeshBasicMaterial.html b/docs/api/ar/materials/MeshBasicMaterial.html new file mode 100644 index 00000000000000..5c7c30542793ed --- /dev/null +++ b/docs/api/ar/materials/MeshBasicMaterial.html @@ -0,0 +1,178 @@ + + + + + + + + + + [page:Material] → + +

[name]

+ +

+ مادة لرسم الهندسة بطريقة مظللة بسيطة (مسطحة أو إطار سلكي) + طريقة.

+ + هذه المادة لا تتأثر بالأضواء. +

+ + + + + +

المنشئ (Constructor)

+ +

[name]( [param:Object parameters] )

+

+ [page:Object parameters] - (اختياري) كائن يحتوي على واحد أو أكثر + خصائص تحدد مظهر المادة. يمكن تمرير أي خاصية من + المادة (بما في ذلك أي خاصية موروثة من [page:Material]) يمكن + تمريرها هنا.

+ + الاستثناء هو خاصية [page:Hexadecimal color] ، والتي يمكن + تمريرها كسلسلة ست عشرية وهي `0xffffff` (أبيض) بشكل افتراضي. + يتم استدعاء [page:Color.set]( color ) داخليًا. +

+ +

الخصائص (Properties)

+

انظر فئة [page:Material] الأساسية للخصائص المشتركة.

+ +

[property:Texture alphaMap]

+

+ خريطة الألفا هي نسيج رمادي يتحكم في التعتيم عبر + السطح (أسود: شفاف تمامًا ؛ أبيض: غير شفاف تمامًا). الافتراضي هو + null.

+ + يتم استخدام لون النسيج فقط ، مع تجاهل قناة الألفا إذا كانت واحدة + موجود. بالنسبة للقوام RGB و RGBA ، سيستخدم [page:WebGLRenderer WebGL] renderer + قناة اللون الأخضر عند أخذ عينات من هذا النسيج بسبب البت الإضافي + من الدقة المقدمة للأخضر في تنسيقات DXT المضغوطة و RGB 565 غير المضغوطة + التنسيقات. ستعمل القوام المضاء فقط والقوام المضاء / ألفا أيضًا كما هو متوقع. +

+ +

[property:Texture aoMap]

+

+ يتم استخدام قناة اللون الأحمر من هذه القوام كخريطة إضاءة محيطية. + الافتراضي هو null. يتطلب aoMap مجموعة ثانية من UVs. +

+ +

[property:Float aoMapIntensity]

+

+ شدة تأثير الإضاءة المحيطة. الافتراضي هو 1. صفر لا + تأثير انعكاس. +

+ +

[property:Color color]

+

[page:Color] المادة ، بشكل افتراضي محدد كأبيض (0xffffff).

+ +

[property:Integer combine]

+

+ كيفية دمج نتيجة لون السطح مع خريطة البيئة ، إن وجدت.

+ + الخيارات هي [page:Materials THREE.MultiplyOperation] (الافتراضية)، + [page:Materials THREE.MixOperation]، [page:Materials THREE.AddOperation]. + إذا تم اختيار المزج ، يتم استخدام [page:.reflectivity] للمزج بين + اللونان. +

+ +

[property:Texture envMap]

+

خريطة البيئة. الافتراضي هو null.

+ +

[property:Boolean fog]

+

هل يتأثر المادة بالضباب. الافتراضي هو `true`.

+ +

[property:Texture lightMap]

+

+ خريطة الإضاءة. الافتراضي هو null. يتطلب lightMap مجموعة ثانية من UVs. +

+ +

[property:Float lightMapIntensity]

+

شدة الإضاءة المخبوزة. الافتراضي هو 1.

+ +

[property:Texture map]

+

+ خريطة اللون. قد تتضمن قناة ألفا اختياريًا ، عادةً ما يتم دمجها + مع [page:Material.transparent .transparent] أو [page:Material.alphaTest .alphaTest]. الافتراضي هو null. +

+ +

[property:Float reflectivity]

+

+ مدى تأثير خريطة البيئة على السطح ؛ انظر أيضًا + [page:.combine]. القيمة الافتراضية هي 1 والنطاق الصحيح هو بين 0 + (لا انعكاسات) و 1 (انعكاسات كاملة). +

+ +

[property:Float refractionRatio]

+

+ مؤشر انكسار (IOR) الهواء (حوالي 1) مقسومًا على + مؤشر انكسار المادة. يستخدم مع وسائط تعيين البيئة + [page:Textures THREE.CubeRefractionMapping] و [page:Textures THREE.EquirectangularRefractionMapping]. + نسبة الانكسار لا يجب أن تتجاوز 1. الافتراضي هو `0.98`. +

+ +

[property:Texture specularMap]

+

خريطة التألق المستخدمة من قبل المادة. الافتراضي هو null.

+ +

[property:Boolean wireframe]

+

+ عرض الهندسة كإطار سلكي. الافتراضي هو `false` (أي عرض كـ + مضلعات مسطحة). +

+ +

[property:String wireframeLinecap]

+

+ تحديد مظهر نهاية الخط. القيم الممكنة هي "butt" و "round" و + "square". الافتراضي هو 'round'.

+ + يتوافق هذا مع + [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap] + خاصية وهو يتجاهل من قبل [page:WebGLRenderer WebGL] renderer. +

+ +

[property:String wireframeLinejoin]

+

+ تحديد مظهر مفصلات الخط. القيم الممكنة هي "round" و "bevel" و + "miter". الافتراضي هو 'round'.

+ + يتوافق هذا مع + [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin] + خاصية وهو يتجاهل من قبل [page:WebGLRenderer WebGL] renderer. +

+ +

[property:Float wireframeLinewidth]

+

+ التحكم في سمك الإطار السلكي. الافتراضي هو 1.

+ + بسبب قصور + [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] + مع [page:WebGLRenderer WebGL] renderer على معظم المنصات ستظل linewidth دائمًا 1 بغض النظر عن القيمة المحددة. +

+ +

الطرق (Methods)

+

انظر فئة [page:Material] الأساسية للطرق المشتركة.

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/materials/MeshDepthMaterial.html b/docs/api/ar/materials/MeshDepthMaterial.html new file mode 100644 index 00000000000000..b895e186c9d148 --- /dev/null +++ b/docs/api/ar/materials/MeshDepthMaterial.html @@ -0,0 +1,125 @@ + + + + + + + + + + [page:Material] → + +

[name]

+ +

+ مادة لرسم الهندسة بالعمق. يعتمد العمق على الكاميرا + قريب وبعيد. الأبيض هو الأقرب ، الأسود هو الأبعد. +

+ + + + + +

المنشئ (Constructor)

+ +

[name]( [param:Object parameters] )

+

+ [page:Object parameters] - (اختياري) كائن به واحد أو أكثر + خصائص تحدد مظهر المادة. يمكن تمرير أي خاصية من + المادة (بما في ذلك أي خاصية موروثة من [page:Material]) يمكن + تمريرها هنا. +

+ +

الخصائص (Properties)

+

انظر فئة [page:Material] الأساسية للخصائص المشتركة.

+ +

[property:Texture alphaMap]

+

+ خريطة الألفا هي نسيج رمادي يتحكم في التعتيم عبر + السطح (أسود: شفاف تمامًا ؛ أبيض: غير شفاف تمامًا). الافتراضية هى + null.

+ + يتم استخدام لون النسيج فقط ، مع تجاهل قناة الألفا إذا كانت واحدة + موجود. بالنسبة للقوام RGB و RGBA ، سيستخدم [page:WebGLRenderer WebGL] renderer + قناة اللون الأخضر عند عيّنة هذا القوام بسبب البت الإضافي + من الدقة المقدمة للأخضر في DXT-compressed وغير المضغوط RGB 565 + التنسيقات. ستعمل قوام الإضاءة فقط وقوام الإضاءة / الألفا أيضًا كما هو متوقع. +

+ +

[property:Constant depthPacking]

+

نوع التعبئة العميقة. الافتراضية هى [page:Textures BasicDepthPacking].

+ +

[property:Texture displacementMap]

+

+ يؤثر خريطة التشويه على موضع رؤوس الشبكة. على عكس + الخرائط الأخرى التي تؤثر فقط على الضوء والظل من المادة + يمكن للرؤوس المشوهة أن تلقي ظلالًا ، وتحجب الأشياء الأخرى ، وغيرها + يعمل كهندسة حقيقية. نسيج التشويه هو صورة حيث القيمة + من كل بكسل (الأبيض هو الأعلى) يتم تعيينها ضد ، و + إعادة تحديد مواقع ، رؤوس الشبكة. +

+ +

[property:Float displacementScale]

+

+ مدى تأثير خريطة التشويه على الشبكة (حيث الأسود هو لا + التشويه ، والأبيض هو التشويه الأقصى). بدون تشويه + تم تعيين خريطة ، لا يتم تطبيق هذه القيمة. الافتراضية هي 1. +

+ +

[property:Float displacementBias]

+

+ إزاحة قيم خريطة التشويه على رؤوس شبكة المصفوفات. + بدون تعيين خريطة التشويه ، لا يتم تطبيق هذه القيمة. الافتراضية هى 0. +

+ +

[property:Boolean fog]

+

ما إذا كانت المادة متأثرة بالضباب. الافتراضية هى `false`.

+ +

[property:Texture map]

+

+ خريطة اللون. قد يتضمن اختيارًا قناة ألفا ، عادةً مجتمعة + مع [page:Material.transparent .transparent] أو [page:Material.alphaTest .alphaTest]. + الافتراضية هى null. +

+ +

[property:Boolean wireframe]

+

+ عرض الهندسة كإطار سلكي. الافتراضية هى false (أى + عرض كظل ملساء). +

+ +

[property:Float wireframeLinewidth]

+

+ يتحكم في سُمك الإطار السلكى. الافتراضية هى 1.

+ + نظرًا للقصور في + [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] + مع [page:WebGLRenderer WebGL] renderer على معظم المنصات ستكون linewidth دائمًا 1 بغض النظر عن القيمة المحددة. +

+ +

الطرق (Methods)

+

انظر فئة [page:Material] الأساسية للطُرُق المشتركة.

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/materials/MeshDistanceMaterial.html b/docs/api/ar/materials/MeshDistanceMaterial.html new file mode 100644 index 00000000000000..0338bcd724194b --- /dev/null +++ b/docs/api/ar/materials/MeshDistanceMaterial.html @@ -0,0 +1,111 @@ + + + + + + + + + + [page:Material] → + +

[name]

+ +

+ يتم استخدام [name] داخليًا لتنفيذ تعيين الظلال مع + [page:PointLight]s.

+ + يمكن أيضًا استخدامه لتخصيص رمي الظل لكائن عن طريق تعيين + مثيل من [name] إلى [page:Object3D.customDistanceMaterial]. ال + يوضح الأمثلة التالية هذا النهج لضمان + أجزاء شفافة من الأشياء لا تلقي ظلالًا. +

+ +

أمثلة (Examples)

+ +

[example:webgl_shadowmap_pointlight WebGL / shadowmap / pointlight]

+ + + +

المنشئ (Constructor)

+ +

[name]( [param:Object parameters] )

+

+ [page:Object parameters] - (اختياري) كائن به واحد أو أكثر + خصائص تحدد مظهر المادة. يمكن تمرير أي خاصية من + المادة (بما في ذلك أي خاصية موروثة من [page:Material]) يمكن + تمريرها هنا. +

+ +

الخصائص (Properties)

+

انظر فئة [page:Material] الأساسية للخصائص المشتركة.

+ +

[property:Texture alphaMap]

+

+ خريطة الألفا هي نسيج رمادي يتحكم في التعتيم عبر + السطح (أسود: شفاف تمامًا ؛ أبيض: غير شفاف تمامًا). الافتراضية هى + null.

+ + يتم استخدام لون النسيج فقط ، مع تجاهل قناة الألفا إذا كانت واحدة + موجود. بالنسبة للقوام RGB و RGBA ، سيستخدم [page:WebGLRenderer WebGL] renderer + قناة اللون الأخضر عند عيّنة هذا القوام بسبب البت الإضافي + من الدقة المقدمة للأخضر في DXT-compressed وغير المضغوط RGB 565 + التنسيقات. ستعمل قوام الإضاءة فقط وقوام الإضاءة / الألفا أيضًا كما هو متوقع. +

+ +

[property:Texture displacementMap]

+

+ يؤثر خريطة التشوه على موضع رؤوس الشبكة. على عكس + الخرائط الأخرى التي تؤثر فقط على الضوء والظل من المادة + يمكن للرؤوس المشوهة أن تلقي ظلالًا ، وتحجب الأشياء الأخرى ، وغيرها + يعمل كهندسة حقيقية. نسيج التشوه هو صورة حيث القيمة + من كل بكسل (الأبيض هو الأعلى) يتم تعيينها ضد ، و + إعادة تحديد مواقع ، رؤوس الشبكة. +

+ +

[property:Float displacementScale]

+

+ مدى تأثير خريطة التشوه على الشبكة (حيث الأسود هو لا + التشوه ، والأبيض هو التشوه الأقصى). بدون تشوه + تم تعيين خريطة ، لا يتم تطبيق هذه القيمة. الافتراضية هى 1. +

+ +

[property:Float displacementBias]

+

+ إزاحة قيم خريطة التشوه على رؤوس شبكة المصفوفات. + بدون تعيين خريطة التشوه ، لا يتم تطبيق هذه القيمة. الافتراضية هى 0. +

+ +

[property:Boolean fog]

+

ما إذا كانت المادة متأثرة بالضباب. الافتراضية هى `false`.

+ +

[property:Texture map]

+

+ خريطة اللون. قد يتضمن اختيارًا قناة ألفا ، عادةً مجتمعة + مع [page:Material.transparent .transparent] أو [page:Material.alphaTest .alphaTest]. + الافتراضية هى null. +

+ +

الطرق (Methods)

+

انظر فئة [page:Material] الأساسية للطُرُق المشتركة.

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/materials/MeshLambertMaterial.html b/docs/api/ar/materials/MeshLambertMaterial.html new file mode 100644 index 00000000000000..7d2d4894fd1d22 --- /dev/null +++ b/docs/api/ar/materials/MeshLambertMaterial.html @@ -0,0 +1,278 @@ + + + + + + + + + + [page:Material] → + +

[name]

+ +

+ مادة للأسطح غير اللامعة ، بدون تسليط الضوء اللامع.

+ + تستخدم المادة نموذجًا غير قائم على الفيزياء + [link:https://en.wikipedia.org/wiki/Lambertian_reflectance Lambertian] + لحساب الانعكاس. يمكن أن يحاكي هذا بعض الأسطح (مثل + الخشب غير المعالج أو الحجر) بشكل جيد ، ولكن لا يمكن محاكاة الأسطح اللامعة مع + تسليط الضوء اللامع (مثل الخشب المصقول). [name] يستخدم لكل قطعة + التظليل.

+ + نظرًا لبساطة نماذج الانعكاس والإضاءة ، + ستكون الأداء أكبر عند استخدام هذه المادة على + [page:MeshPhongMaterial] ، [page:MeshStandardMaterial] أو + [page:MeshPhysicalMaterial] ، على حساب بعض الدقة الرسومية. +

+ + + + + +

المنشئ (Constructor)

+ +

[name]( [param:Object parameters] )

+

+ [page:Object parameters] - (اختياري) كائن به واحد أو أكثر + خصائص تحدد مظهر المادة. يمكن تمرير أي خاصية من + المادة (بما في ذلك أي خاصية موروثة من [page:Material]) يمكن + تمريرها هنا.

+ + الاستثناء هو خاصية [page:Hexadecimal color] ، التي يمكن + تمريرها كسلسلة ست عشرية وهي `0xffffff` (أبيض) افتراضيًا. + يتم استدعاء [page:Color.set]( color ) داخليًا. +

+ +

الخصائص (Properties)

+

انظر فئة [page:Material] الأساسية للخصائص المشتركة.

+ +

[property:Texture alphaMap]

+

+ خريطة الألفا هي نسيج رمادي يتحكم في التعتيم عبر + السطح (أسود: شفاف تمامًا ؛ أبيض: غير شفاف تمامًا). الافتراضية هى + null.

+ + يتم استخدام لون النسيج فقط ، مع تجاهل قناة الألفا إذا كانت واحدة + موجود. بالنسبة للقوام RGB و RGBA ، سيستخدم [page:WebGLRenderer WebGL] renderer + قناة اللون الأخضر عند عيّنة هذا القوام بسبب البت الإضافي + من الدقة المقدمة للأخضر في DXT-compressed وغير المضغوط RGB 565 + التنسيقات. ستعمل قوام الإضاءة فقط وقوام الإضاءة / الألفا أيضًا كما هو متوقع. +

+ +

[property:Texture aoMap]

+

+ يتم استخدام قناة اللون الأحمر من هذه القوام كخريطة التظليل المحيط. + الافتراضية هى null. يتطلب aoMap مجموعة ثانية من UVs. +

+ +

[property:Float aoMapIntensity]

+

+ شدة تأثير التظليل المحيط. الافتراضية هى 1. صفر هو لا + تأثير التظليل. +

+ +

[property:Texture bumpMap]

+

+ القوام لإنشاء خريطة بروز. تُعيَّن قِيَمُ الأبْيَضِ والأسْوَدِ إلى + عُمْقٍ مُدْرَكٍ بالنسبة للأضواء. لا يؤثر Bump في الواقع + هندسة الكائن ، فقط الإضاءة. إذا تم تعريف خريطة طبيعية + سيتم تجاهل هذا. +

+ +

[property:Float bumpScale]

+

+ مدى تأثير خريطة البروز على المادة. المدى النموذجي هو 0-1. + الافتراضية هى 1. +

+ +

[property:Color color]

+

[page:Color] المادة ، افتراضيًا مضبوط على أبيض (0xffffff).

+ +

[property:Integer combine]

+

+ كيفية دمج نتيجة لون السطح مع خريطة البيئة ، + إن وجد.

+ + الخيارات هي [page:Materials THREE.MultiplyOperation] (الافتراضية) ، + [page:Materials THREE.MixOperation] ، [page:Materials THREE.AddOperation]. + إذا تم اختيار المزج ، يتم استخدام [page:.reflectivity] للمزج بين + اللونين. +

+ +

[property:Texture displacementMap]

+

+ يؤثر خريطة التشوه على موضع رؤوس الشبكة. على عكس + الخرائط الأخرى التي تؤثر فقط على الضوء والظل من المادة + يمكن للرؤوس المشوهة أن تلقي ظلالًا ، وتحجب الأشياء الأخرى ، وغيرها + يعمل كهندسة حقيقية. نسيج التشوه هو صورة حيث القيمة + من كل بكسل (الأبيض هو الأعلى) يتم تعيينها ضد ، و + إعادة تحديد مواقع ، رؤوس الشبكة. +

+ +

[property:Float displacementScale]

+

+ مدى تأثير خريطة التشوه على الشبكة (حيث الأسود هو لا + التشوه ، والأبيض هو التشوه الأقصى). بدون تشوه + تم تعيين خريطة ، لا يتم تطبيق هذه القيمة. الافتراضية هى 1. +

+ +

[property:Float displacementBias]

+

+ إزاحة قيم خريطة التشوه على رؤوس شبكة المصفوفات. + بدون تعيين خريطة التشوه ، لا يتم تطبیق هذه القیمۀ. الافتراضیۀ هى 0. +

+ +

[property:Color emissive]

+

+ لون المادة المُضِئ (الضوء) ، في الأساس لون صلب + لا يتأثر بإضاءة أخرى. الافتراضية هى black. +

+ +

[property:Texture emissiveMap]

+

+ قم بتعیین خریطۀ emissive (glow). الافتراضیۀ هى null. لون خریطۀ emissive + یتم تعدیلہ بلون emissive و شدۀ emissive. إذا كان لدیك + خریطۀ emissive، تأكد من تعیین لون emissive على شیء غیر + black. +

+ +

[property:Float emissiveIntensity]

+

+ شدۀ الضوء المُضِئ. یعدل لون emissive. الافتراضیۀ هى + 1. +

+ +

[property:Texture envMap]

+

خریطۀ البیئۀ. الافتراضیۀ هى null.

+ +

[property:Boolean flatShading]

+

+ تحديد ما إذا كان يتم عرض المادة بتظليل مسطح. الافتراضية هى + false. +

+ +

[property:Boolean fog]

+

ما إذا كانت المادة متأثرة بالضباب. الافتراضية هى `true`.

+ +

[property:Texture lightMap]

+

+ خريطة الضوء. الافتراضية هى null. يتطلب lightMap مجموعة ثانية من UVs. +

+ +

[property:Float lightMapIntensity]

+

شدة الضوء المخبوز. الافتراضية هى 1.

+ +

[property:Texture map]

+

+ خريطة اللون. قد يتضمن اختيارًا قناة ألفا ، عادةً مجتمعة + مع [page:Material.transparent .transparent] أو [page:Material.alphaTest .alphaTest]. + الافتراضية هى null. +

+ +

[property:Texture normalMap]

+

+ القوام لإنشاء خريطة طبيعية. تؤثر قيم RGB على سطح + الطبيعي لكل قطعة بكسل وتغير طريقة إضاءة اللون. الخرائط الطبيعية + لا تغير شكل السطح الفعلي ، فقط الإضاءة. في + في حال كانت المادة تحتوي على خريطة طبيعية باستخدام التقليد المستخدم باليد اليسرى + يجب إنكار مكون y من normalScale للتعويض + للاختلاف في التوجه. +

+ +

[property:Integer normalMapType]

+

+ نوع خريطة الطبيعية.

+ + الخيارات هي [page:constant THREE.TangentSpaceNormalMap] (الافتراضية) ، و + [page:constant THREE.ObjectSpaceNormalMap]. +

+ +

[property:Vector2 normalScale]

+

+ مدى تأثير خريطة الطبيعية على المادة. المدى النموذجي هو 0-1. + الافتراضية هى [page:Vector2] مضبوط على (1،1). +

+ +

[property:Float reflectivity]

+

+ مدى تأثير خريطة البيئة على السطح ؛ انظر أيضًا + [page:.combine]. +

+ +

[property:Float refractionRatio]

+

+ مؤشر الانكسار (IOR) للهواء (حوالي 1) مقسومًا على + مؤشر الانكسار للمادة. يتم استخدامه مع وضعيات تعيين البيئة + [page:Textures THREE.CubeRefractionMapping] و [page:Textures THREE.EquirectangularRefractionMapping]. + نسبة الانكسار لا يجب أن + تتجاوز 1. الافتراضية هى `0.98`. +

+ +

[property:Texture specularMap]

+

خريطة التسليط المستخدمة من قبل المادة. الافتراضية هى null.

+ +

[property:Boolean wireframe]

+

+ عرض الهندسة كإطار سلكي. الافتراضية هى `false` (أى عرض كمضلعات + مسطحة). +

+ +

[property:String wireframeLinecap]

+

+ تحديد مظهر نهايات الخطوط. القيم الممكنة هي "butt" و "round" و + "square". الافتراضية هى 'round'.

+ + يتوافق هذا مع + [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap] + خاصية ويتم تجاهلها من قبل [page:WebGLRenderer WebGL] renderer. +

+ +

[property:String wireframeLinejoin]

+

+ تحديد مظهر مفاصل الخطوط. القيم الممكنة هي "round" و "bevel" و + "miter". الافتراضية هى 'round'.

+ + يتوافق هذا مع + [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin] + خاصية ويتم تجاهلها من قبل [page:WebGLRenderer WebGL] renderer. +

+ +

[property:Float wireframeLinewidth]

+

+ يتحكم في سُمك الإطار السلكى. الافتراضية هى 1.

+ + نظرًا للقصور في + [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] + مع [page:WebGLRenderer WebGL] renderer على معظم + المنصات ستكون linewidth دائمًا 1 بغض النظر عن القيمة المحددة. +

+ +

الطرق (Methods)

+

انظر فئة [page:Material] الأساسية للطُرُق المشتركة.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/materials/MeshMatcapMaterial.html b/docs/api/ar/materials/MeshMatcapMaterial.html new file mode 100644 index 00000000000000..99d8bfdaf5eb27 --- /dev/null +++ b/docs/api/ar/materials/MeshMatcapMaterial.html @@ -0,0 +1,160 @@ + + + + + + + + + + [page:Material] → + +

[name]

+ +

+ يتم تحديد [name] بواسطة نسيج MatCap (أو Lit Sphere) ، الذي يشفر لون المادة والظلال.

+ لا يستجيب [name] للأضواء لأن ملف صورة matcap يشفر الإضاءة المخبوزة. سيطرح ظلًا على كائن يتلقى الظلال (ويعمل قص الظلال) ، ولكنه لن يظلل نفسه أو يتلقى الظلال. +

+ + + + + +

المنشئ (Constructor)

+ +

[name]( [param:Object parameters] )

+

+ [page:Object parameters] - (اختياري) كائن يحتوي على خاصية واحدة أو أكثر تحدد مظهر المادة. يمكن تمرير أي خاصية من المادة (بما في ذلك أي خاصية موروثة من [page:Material]) هنا.

+ + الاستثناء هو الخاصية [page:Hexadecimal color] ، التي يمكن تمريرها كسلسلة ست عشرية وهي `0xffffff` (أبيض) بشكل افتراضي. يتم استدعاء [page:Color.set]( color ) داخليًا. +

+ +

الخصائص (Properties)

+

انظر إلى الفئة الأساسية [page:Material] للحصول على الخصائص المشتركة.

+ +

[property:Texture alphaMap]

+

+ خريطة الألفا هي نسيج رمادي يتحكم في التعتيم عبر + + +

[property:Texture alphaMap]

+

+ خريطة الألفا هي نسيج رمادي يتحكم في التعتيم عبر + السطح (أسود: شفاف تمامًا ؛ أبيض: غير شفاف تمامًا). الافتراضية هى + null.

+ + يتم استخدام لون النسيج فقط ، مع تجاهل قناة الألفا إذا كانت واحدة + موجود. بالنسبة للقوام RGB و RGBA ، سيستخدم [page:WebGLRenderer WebGL] renderer + قناة اللون الأخضر عند عيّنة هذا القوام بسبب البت الإضافي + من الدقة المقدمة للأخضر في DXT-compressed وغير المضغوط RGB 565 + التنسيقات. ستعمل قوام الإضاءة فقط وقوام الإضاءة / الألفا أيضًا كما هو متوقع. +

+ +

[property:Texture bumpMap]

+

+ القوام لإنشاء خريطة بروز. تُعيَّن قِيَمُ الأبْيَضِ والأسْوَدِ إلى + عُمْقٍ مُدْرَكٍ بالنسبة للأضواء. لا يؤثر Bump في الواقع + هندسة الكائن ، فقط الإضاءة. إذا تم تعريف خريطة طبيعية + سيتم تجاهل هذا. +

+ +

[property:Float bumpScale]

+

+ مدى تأثير خريطة البروز على المادة. المدى النموذجي هو 0-1. + الافتراضية هى 1. +

+ +

[property:Color color]

+

[page:Color] المادة ، افتراضيًا مضبوط على أبيض (0xffffff).

+ +

[property:Texture displacementMap]

+

+ يؤثر خريطة التشوه على موضع رؤوس الشبكة. على عكس + الخرائط الأخرى التي تؤثر فقط على الضوء والظل من المادة + يمكن للرؤوس المشوهة أن تلقي ظلالًا ، وتحجب الأشياء الأخرى ، وغيرها + يعمل كهندسة حقيقية. نسيج التشوه هو صورة حيث القيمة + من كل بكسل (الأبيض هو الأعلى) يتم تعيينها ضد ، و + إعادة تحديد مواقع ، رؤوس الشبكة. +

+ +

[خاصية:Float displacementScale]

+

+ كم يؤثر خريطة التشويه على الشبكة (حيث اللون الأسود لا يوجد تشويه ، واللون الأبيض هو التشويه الأقصى). بدون تعيين خريطة تشويه ، لا يتم تطبيق هذه القيمة. الافتراضي هو 1. +

+ +

[property:Float displacementBias]

+

+ إزاحة قيم خريطة التشوه على رؤوس شبكة المصفوفات. + بدون تعيين خريطة التشوه ، لا يتم تطبيق هذه القيمة. الافتراضية هى 0. +

+ +

[property:Boolean flatShading]

+

+ تحديد ما إذا كان يتم عرض المادة بتظليل مسطح. الافتراضية هى + false. +

+ +

[property:Boolean fog]

+

ما إذا كانت المادة متأثرة بالضباب. الافتراضية هى `true`.

+ +

[property:Texture map]

+

+ خريطة اللون. قد يتضمن اختيارًا قناة ألفا ، عادةً مجتمعة + مع [page:Material.transparent .transparent] أو [page:Material.alphaTest .alphaTest]. + الافتراضية هى null. يتم تعديل لون خريطة القوام بواسطة + diffuse [page:.color]. +

+ +

[property:Texture matcap]

+

خريطة matcap. الافتراضية هى null.

+ +

[property:Texture normalMap]

+

+ القوام لإنشاء خريطة طبيعية. تؤثر قيم RGB على سطح + الطبيعي لكل قطعة بكسل وتغير طريقة إضاءة اللون. الخرائط الطبيعية + لا تغير شكل السطح الفعلي ، فقط الإضاءة. في + في حال كانت المادة تحتوي على خريطة طبيعية باستخدام التقليد المستخدم باليد اليسرى + يجب إنكار مكون y من normalScale للتعويض + للاختلاف في التوجه. +

+ +

[property:Integer normalMapType]

+

+ نوع خريطة الطبيعية.

+ + الخيارات هي [page:constant THREE.TangentSpaceNormalMap] (الافتراضية) ، و + [page:constant THREE.ObjectSpaceNormalMap]. +

+ +

[property:Vector2 normalScale]

+

+ مدى تأثير خريطة الطبيعية على المادة. المدى النموذجي هو 0-1. + الافتراضية هى [page:Vector2] مضبوط على (1،1). +

+ +

الطرق (Methods)

+

انظر فئة [page:Material] الأساسية للطُرُق المشتركة.

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/materials/MeshNormalMaterial.html b/docs/api/ar/materials/MeshNormalMaterial.html new file mode 100644 index 00000000000000..77cfca2ce67cf9 --- /dev/null +++ b/docs/api/ar/materials/MeshNormalMaterial.html @@ -0,0 +1,121 @@ + + + + + + + + + + [page:Material] → + +

[name]

+ +

مادة تقوم بتعيين المتجهات الطبيعية إلى ألوان RGB.

+ + + + + +

المنشئ (Constructor)

+ +

[name]( [param:Object parameters] )

+

+ [page:Object parameters] - (اختياري) كائن يحتوي على خاصية واحدة أو أكثر تحدد مظهر المادة. يمكن تمرير أي خاصية من المادة (بما في ذلك أي خاصية موروثة من [page:Material]) هنا. +

+ +

الخصائص (Properties)

+

انظر إلى الفئة الأساسية [page:Material] للحصول على الخصائص المشتركة.

+ +

[property:Texture bumpMap]

+

+ النسيج لإنشاء خريطة بامب. تقوم القيم السوداء والبيضاء بتعيين العمق المتصور فيما يتعلق بالأضواء. لا يؤثر البامب فعليًا على هندسة الكائن ، فقط على الإضاءة. إذا تم تعريف خريطة طبيعية ، سيتم تجاهل هذا. +

+ +

[property:Float bumpScale]

+

+ كم يؤثر خريطة البامب على المادة. المدى النموذجي هو 0-1. الافتراضي هو 1. +

+ +

[property:Texture displacementMap]

+

+ تؤثر خريطة التشويه على موضع رؤوس الشبكة. على عكس الخرائط الأخرى التي تؤثر فقط على ضوء وظل المادة ، يمكن للرؤوس المزحزحة أن تلقي ظلالًا وتحجب كائنات أخرى وتتصرف بطرق أخرى كهندسة حقيقية. نسيج التشويه هو صورة حيث يتم تعيين قيمة كل بكسل (الأبيض هو الأعلى) ضد وإعادة تحديد موضع رؤوس الشبكة. +

+ +

[property:Float displacementScale]

+

+ كم يؤثر خريطة التشوه على الشبكة (حيث اللون الأسود لا يوجد تشويه ، واللون الأبيض هو التشويه الأقصى). بدون تعیین خریطۀ تشویه، لا یتم تطبیق هذه القیمۀ. الافتراضی هو 1. +

+ +

[property:Float displacementBias]

+

+ إزاحة قيم خريطة التشويه على رؤوس الشبكة. بدون تعيين خريطة تشويه ، لا يتم تطبيق هذه القيمة. الافتراضي هو 0. +

+ +

[property:Boolean flatShading]

+

+ تحديد ما إذا كان يتم عرض المادة بظلال مسطحة. الافتراضي هو خطأ. +

+ +

[property:Boolean fog]

+

ما إذا كانت المادة متأثرة بالضباب. الافتراضي هو `false`.

+ +

[property:Texture normalMap]

+

+ النسيج لإنشاء خريطة طبيعية. تؤثر قيم RGB على السطح الطبيعي لكل قطعة بكسل وتغير طريقة إضاءة اللون. لا تغير خرائط العادية شكل السطح الفعلي ، فقط الإضاءة. في حال كانت المادة تحتوي على خريطة طبيعية مؤلفة باستخدام اتفاقية اليد اليسرى ، يجب إنكار مكون y من normalScale للتعويض عن اختلاف التوجه. +

+ +

[property:Integer normalMapType]

+

+ نوع خريطة العادية.

+ + الخيارات هي [page:constant THREE.TangentSpaceNormalMap] (افتراضي) ، و [page:constant THREE.ObjectSpaceNormalMap]. +

+ +

[property:Vector2 normalScale]

+

+ كم يؤثر خريطة العادية على المادة. المدى النموذجي هو 0-1. الافتراضي هو [page:Vector2] مضبوط على (1،1). +

+ +

[property:Boolean wireframe]

+

+ عرض الهندسة كإطار سلكي. الافتراضي هو false (أي عرض كظلال ناعمة). +

+ +

[property:Float wireframeLinewidth]

+

+ التحكم في سمك الإطار السلكى. الافتراضى هو 1.

+ + بسبب قصور + [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] + مع [page:WebGLRenderer WebGL] renderer على معظم + المنصات ستكون linewidth دائمًا 1 بغض النظر عن القيمة المحددة. +

+ +

الطرق (Methods)

+

انظر إلى فئة [page:Material] الأساسية للحصول على طرق شائعة.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/materials/MeshPhongMaterial.html b/docs/api/ar/materials/MeshPhongMaterial.html new file mode 100644 index 00000000000000..ccf3d8cd3b0486 --- /dev/null +++ b/docs/api/ar/materials/MeshPhongMaterial.html @@ -0,0 +1,284 @@ + + + + + + + + + + [page:Material] → + +

[name]

+ +

+ مادة للأسطح اللامعة مع تسليط الضوء على التجمعات.

+ + تستخدم المادة نموذجًا غير مستندًا إلى الفيزياء + [link:https://en.wikipedia.org/wiki/Blinn-Phong_shading_model Blinn-Phong] + لحساب الانعكاس. على عكس نموذج Lambertian المستخدم في + [page:MeshLambertMaterial] يمكن لهذا محاكاة الأسطح اللامعة مع تسليط الضوء على التجمعات (مثل الخشب المصقول). يستخدم [name] تظليل لكل قطعة.

+ + سيكون الأداء عمومًا أكبر عند استخدام هذه المادة على + [page:MeshStandardMaterial] أو [page:MeshPhysicalMaterial] ، بتكلفة بعض الدقة الرسومية. +

+ + + + + + +

المنشئ (Constructor)

+ +

[name]( [param:Object parameters] )

+

+ [page:Object parameters] - (اختياري) كائن بواحد أو أكثر + خصائص تحدد مظهر المادة. يمكن تمرير أي خاصية من + المادة (بما في ذلك أي خاصية موروثة من [page:Material]) هنا.

+ + الاستثناء هو الخاصية [page:Hexadecimal color]، التي يمكن + تمريرها كسلسلة ست عشرية وهي `0xffffff` (أبيض) بشكل افتراضي. + يتم استدعاء [page:Color.set]( color ) داخليًا. +

+ +

الخصائص (Properties)

+

انظر إلى فئة [page:Material] الأساسية للخصائص المشتركة.

+ +

[property:Texture alphaMap]

+

+ خريطة الألفا هي قوام رمادي يتحكم في التعتيم عبر + السطح (أسود: شفاف تمامًا؛ أبيض: غير شفاف تمامًا). الافتراضي هو + null.

+ + يتم استخدام لون القوام فقط، مع تجاهل قناة الألفا إذا كانت موجودة + . بالنسبة لقوام RGB و RGBA، سيستخدم [page:WebGLRenderer WebGL] renderer + قناة اللون الأخضر عند أخذ عينات من هذا القوام بسبب البت الإضافي + من الدقة المقدمة للأخضر في تنسيقات DXT المضغوطة و RGB 565 غير المضغوطة + . ستعمل قوام الإضاءة فقط وقوام الإضاءة / الألفا أيضًا كما هو متوقع. +

+ +

[property:Texture aoMap]

+

+ يتم استخدام قناة اللون الأحمر من هذه القوام كخريطة التظليل المحيط. + الافتراضي هو null. يتطلب aoMap مجموعة ثانية من UVs. +

+ +

[property:Float aoMapIntensity]

+

+ شدة تأثير التظليل المحيط. الافتراضي هو 1. صفر هو لا + تأثير التظليل. +

+ +

[property:Texture bumpMap]

+

+ القوام لإنشاء خريطة بروز. تُعيَّن قِيَمُ الأبْيَضِ والأسْودِ إلى + العُمْقِ المُدْرَكِ في علاقة بالأضْواءِ. لا يؤثر التَّبَّرُ فِعْلِيًّا على + هندسة الكائن، فقط على الإضاءة. إذا تم تعريف خريطة عادية + سيتم تجاهل هذا. +

+ +

[property:Float bumpScale]

+

+ مدى تأثير خريطة التببر على المادة. المدى النموذجى هو 0-1. + الافتراضى هو 1. +

+ +

[property:Color color]

+

[page:Color] المادة، بشكل افتراضى مضبوط على أبيض (0xffffff).

+ +

[property:Integer combine]

+

+ كيفية دمج نتائج لون السطح مع خرائط البيئة، إذا كانت موجودة.

+ + الخيارات هى [page:Materials THREE.MultiplyOperation] (الافتراضى)، + [page:Materials THREE.MixOperation]، [page:Materials THREE.AddOperation]. + إذا تم اختيار mix، يُستخدَم [page:.reflectivity] للدمج بين + اللونَيْنِ. +

+ +

[property:Texture displacementMap]

+

+ تؤثر خريطة التشويه على موضع رؤوس الشبكة. على عكس + الخرائط الأخرى التي تؤثر فقط على الضوء والظل للمادة + يمكن للرؤوس المشوهة أن تلقي ظلالًا، وتحجب كائنات أخرى، وغير ذلك + تعمل كهندسة حقيقية. خريطة التشويه هي صورة حيث قيمة + كل بكسل (الأبيض هو الأعلى) يتم تعيينها ضد، و + إعادة تحديد مواقع، رؤوس الشبكة. +

+ +

[property:Float displacementScale]

+

+ مدى تأثير خريطة التشويه على الشبكة (حيث الأسود هو لا + تشويه، والأبيض هو التشويه الأقصى). بدون تعيين خريطة تشويه، + لا يتم تطبيق هذه القيمة. الافتراضي هو 1. +

+ +

[property:Float displacementBias]

+

+ إزاحة قيم خريطة التشويه على رؤوس شبكة المادة. + بدون تعيين خريطة تشويه، لا يتم تطبيق هذه القيمة. الافتراضي هو 0. +

+ +

[property:Color emissive]

+

+ لون المادة المُضاء (الضوء)، في الأساس لون صلب + غير متأثر بالإضاءة الأخرى. الافتراضي هو أسود. +

+ +

[property:Texture emissiveMap]

+

+ تعيين خريطة المُضاء (التوهج). الافتراضي هو null. يتم تعديل لون خريطة المُضاء بواسطة + اللون المُضاء وشدة المُضاء. إذا كان لديك خريطة مُضاء، تأكد من تعديل + اللون المُضاء إلى شئ غير أسود. +

+ +

[property:Float emissiveIntensity]

+

+ شدة الضوء المُضاء. يعدل اللون المُضاء. الافتراضي هو + 1. +

+ +

[property:Texture envMap]

+

خريطة البيئة. الافتراضية هى null.

+ +

[property:Boolean flatShading]

+

+ تحديد ما إذا كان يتم تصدير المادة بظلال مسطحة. الافتراضى هو + false. +

+ +

[property:Boolean fog]

+

ما إذا كانت المادة متأثرة بالضباب. الافتراضى هو `true`.

+ +

[property:Texture lightMap]

+

+ خرائط الإضاءة. الافتراضى هى null. يتطلب lightMap مجموعة ثانية من UVs. +

+ +

[property:Float lightMapIntensity]

+

شدة الضوء المخبوز. الافتراضي هو 1.

+ +

[property:Texture map]

+

+ خريطة اللون. قد تشمل اختياريًا قناة ألفا، عادةً ما تكون مجتمعة + مع [page:Material.transparent .transparent] أو [page:Material.alphaTest .alphaTest]. + الافتراضي هو null. يتم تعديل لون خريطة القوام بواسطة + اللون المنتشر [page:.color]. +

+ +

[property:Texture normalMap]

+

+ القوام لإنشاء خريطة عادية. تؤثر قيم RGB على السطح + العادي لكل جزء بكسل وتغير طريقة إضاءة اللون. لا تغير خرائط العادية + شكل السطح الفعلي، فقط الإضاءة. في حال كانت المادة تحتوي على خريطة عادية مصممة باستخدام المعايير + اليد اليسرى، يجب إنكار مكون y من normalScale للتعويض + عن اختلاف المعايير. +

+ +

[property:Integer normalMapType]

+

+ نوع خريطة العادية.

+ + الخيارات هي [page:constant THREE.TangentSpaceNormalMap] (الافتراضي)، و + [page:constant THREE.ObjectSpaceNormalMap]. +

+ +

[property:Vector2 normalScale]

+

+ مدى تأثير خريطة العادية على المادة. المدى النموذجي هو 0-1. + الافتراضي هو [page:Vector2] مضبوط على (1,1). +

+ +

[property:Float reflectivity]

+

+ مدى تأثير خريطة البيئة على السطح؛ انظر أيضًا + [page:.combine]. قيمة الافتراضية هي 1 والمدى الصحيح هو بين 0 + (لا انعكاسات) و 1 (انعكاسات كاملة). +

+ +

[property:Float refractionRatio]

+

+ مؤشر انكسار (IOR) الهواء (حوالى 1) مقسومًا على + مؤشر انكسار المادة. يستخدم مع وضع خرائط البيئة [page:Textures THREE.CubeRefractionMapping] و [page:Textures THREE.EquirectangularRefractionMapping]. + لا يجب أن يتجاوز نسبة الانكسار 1. الافتراضي هو `0.98`. +

+ +

[property:Float shininess]

+

+ مدى لمعان [page:.specular] highlight؛ قيمة أعلى تعطي + highlight أكثر حدة. الافتراضي هو `30`. +

+ +

[property:Color specular]

+

+ لون المواد العاكس. الافتراضي هو [page:Color] مضبوط على + `0x111111` (رمادي داكن جدًا).

+ + هذا يحدد مدى لمعان المادة ولون لمعانها. +

+ +

[property:Texture specularMap]

+

+ قيمة خريطة العاكس تؤثر على كل من مدى مساهمة تسليط الضوء على السطح العاكس ومدى تأثير خريطة البيئة على السطح. الافتراضي هو null. +

+ +

[property:Boolean wireframe]

+

+ تصيير الهندسة كإطار سلكي. الافتراضي هو `false` (أي تصيير كمضلعات مسطحة). +

+ +

[property:String wireframeLinecap]

+

+ تحديد مظهر نهايات الخطوط. القيم الممكنة هي "butt" و "round" و "square". الافتراضي هو 'round'.

+ + هذا يتوافق مع + [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap خاصية lineCap لـ 2D Canvas] + ويتم تجاهله من قبل [page:WebGLRenderer WebGL] renderer. +

+ +

[property:String wireframeLinejoin]

+

+ تحديد مظهر مفاصل الخطوط. القيم الممكنة هي "round" و "bevel" و "miter". الافتراضي هو 'round'.

+ + هذا يتوافق مع + [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin خاصية lineJoin لـ 2D Canvas] + ويتم تجاهله من قبل [page:WebGLRenderer WebGL] renderer. +

+ +

[property:Float wireframeLinewidth]

+

+ التحكم في سُمك الإطار السلكي. الافتراضي هو 1.

+ + بسبب قيود + [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] + مع [page:WebGLRenderer WebGL] renderer على معظم + المنصات ستكون linewidth دائمًا 1 بغض النظر عن القيمة المحددة. +

+ +

الطرق (Methods)

+

انظر إلى فئة [page:Material] الأساسية للطرق المشتركة.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/materials/MeshPhysicalMaterial.html b/docs/api/ar/materials/MeshPhysicalMaterial.html new file mode 100644 index 00000000000000..d7a66ad07dcb63 --- /dev/null +++ b/docs/api/ar/materials/MeshPhysicalMaterial.html @@ -0,0 +1,266 @@ + + + + + + + + + + [page:Material] → [page:MeshStandardMaterial] → + +

[name]

+ +

+ تمديد لـ [page:MeshStandardMaterial]، يوفر خصائص تقديم + أكثر تقدمًا على أساس الفيزياء: +

+ +
    +
  • + طلاء شفاف: بعض المواد - مثل طلاءات السيارات والألياف الكربونية و + الأسطح الرطبة - تتطلب طبقة شفافة عاكسة فوق طبقة أخرى + قد تكون غير منتظمة أو خشنة. يقرب الطلاء الشفاف هذا التأثير، + دون الحاجة إلى سطح شفاف منفصل. +
  • +
  • + الشفافية المستندة إلى الفيزياء: إحدى قيود + [page:Material.opacity .opacity] هو أن المواد شديدة الشفافية + أقل انعكاسية. يوفر [page:.transmission] المستند إلى الفيزياء + خيارًا أكثر واقعية للأسطح الشفافة الرقيقة مثل الزجاج. +
  • +
  • + انعكاسية متقدمة: انعكاسية أكثر مرونة للمواد غير المعدنية. +
  • +
  • + اللمعان: يمكن استخدامه لتمثيل مواد القماش والأقمشة. +
  • +
+ +

+ نتيجة لهذه الميزات المعقدة للظلال، يحتوي MeshPhysicalMaterial على + تكلفة أداء أعلى، لكل بكسل، من مواد three.js الأخرى. معظم + التأثيرات معطلة افتراضيًا، وتضيف التكلفة كما يتم تمكينها. للحصول على أفضل النتائج، حدد دائمًا [page:.envMap خريطة بيئة] عند استخدام + هذه المادة. +

+ + + + + +

أمثلة (Examples)

+

+ [example:webgl_materials_physical_clearcoat materials / physical / clearcoat]
+ [example:webgl_loader_gltf_sheen loader / gltf / sheen]
+ [example:webgl_materials_physical_transmission materials / physical / transmission] +

+ +

المنشئ (Constructor)

+ +

[name]( [param:Object parameters] )

+

+ [page:Object parameters] - (اختياري) كائن بواحد أو أكثر + خصائص تحدد مظهر المادة. يمكن تمرير أي خاصية من + المادة (بما في ذلك أي خاصية موروثة من [page:Material] و + [page:MeshStandardMaterial]) هنا.

+ + الاستثناء هو الخاصية [page:Hexadecimal color]، التي يمكن + تمريرها كسلسلة ست عشرية وهي `0xffffff` (أبيض) بشكل افتراضي. + يتم استدعاء [page:Color.set]( color ) داخليًا. +

+ +

الخصائص (Properties)

+

+ انظر إلى فئات [page:Material] و [page:MeshStandardMaterial] الأساسية للخصائص المشتركة. +

+ +

[property:Color attenuationColor]

+

+ اللون الذي يتحول إليه الضوء الأبيض بسبب الامتصاص عند الوصول إلى + مسافة التخفيف. الافتراضى هو `white` (0xffffff). +

+ +

[property:Float attenuationDistance]

+

+ كثافة الوسط المعطاة كمتوسط ​​المسافة التي يسافرها الضوء في + الوسط قبل التفاعل مع جزيئة. يتم إعطاء القيمة في وحدات مساحة العالم + ، ويجب أن تكون أكبر من الصفر. الافتراضي هو `Infinity`. +

+ +

[property:Float clearcoat]

+

+ يمثل شدة طبقة الطلاء الشفاف، من `0.0` إلى `1.0`. استخدم + خصائص طلاء شفاف ذات الصلة لتمكين المواد متعددة الطبقات التي لديها + طبقة رقيقة شفافة فوق الطبقة الأساسية. الافتراضى هو `0.0`. +

+ +

[property:Texture clearcoatMap]

+

+ تتم ضرب قناة اللون الأحمر من هذه القوام ضد [page:.clearcoat]، + للتحكم في شدة طلاء لكل بكسل. الافتراضى هى `null`. +

+ +

[property:Texture clearcoatNormalMap]

+

+ يمكن استخدامه لتمكين المعايير المستقلة لطبقة الطلاء الشفاف. + الافتراضى هى `null`. +

+ +

[property:Vector2 clearcoatNormalScale]

+

+ مدى تأثير [page:.clearcoatNormalMap] على طبقة الطلاء الشفاف، من + `(0,0)` إلى `(1,1)`. الافتراضى هو `(1,1)`. +

+ +

[property:Float clearcoatRoughness]

+

+ خشونة طبقة الطلاء الشفاف، من `0.0` إلى `1.0`. الافتراضى هو `0.0`. +

+ +

[property:Texture clearcoatRoughnessMap]

+

+ تتم ضرب قناة اللون الأخضر من هذه القوام ضد + [page:.clearcoatRoughness]، للتحكم في خشونة طلاء لكل بكسل. + الافتراضى هى `null`. +

+ +

[property:Object defines]

+

+ كائن من نوع: + + { + 'STANDARD': '', + 'PHYSICAL': '', + }; + + + يستخدم هذا بواسطة [page:WebGLRenderer] لتحديد المُظَهِّرات. +

+ + +

[property:Float ior]

+

+ Index-of-refraction for non-metallic materials, from `1.0` to `2.333`. + Default is `1.5`.
+

+ +

[property:Float reflectivity]

+

+ درجة الانعكاسية، من `0.0` إلى `1.0`. الافتراضي هو `0.5`، الذي + يتوافق مع مؤشر انكسار 1.5.
+ + هذا ينمذج انعكاسية المواد غير المعدنية. ليس له تأثير + عندما يكون [page:MeshStandardMaterial.metalness metalness] هو `1.0` +

+ +

[property:Float sheen]

+

+ شدة طبقة اللمعان، من `0.0` إلى `1.0`. الافتراضي هو `0.0`. +

+ +

[property:Float sheenRoughness]

+

خشونة طبقة اللمعان، من `0.0` إلى `1.0`. الافتراضي هو `1.0`.

+ +

[property:Texture sheenRoughnessMap]

+

+ تتم ضرب قناة الألفا من هذه القوام ضد + [page:.sheenRoughness]، للتحكم في خشونة اللمعان لكل بكسل. + الافتراضى هى `null`. +

+ +

[property:Color sheenColor]

+

لون اللمعان. الافتراضي هو `0xffffff`، أبيض.

+ +

[property:Texture sheenColorMap]

+

+ تتم ضرب قنوات RGB من هذه القوام ضد + [page:.sheenColor]، للتحكم في لون اللمعان لكل بكسل. الافتراضي + هو `null`. +

+ +

[property:Float specularIntensity]

+

+ عدد عائم يُقيِّس كمية الانعكاس العاكس للأشياء غير المعدنية فقط. + عند تعيينه على صفر، يصبح النموذج فعالًا كـ Lambertian. من `0.0` إلى + `1.0`. الافتراضى هو `1.0`. +

+ +

[property:Texture specularIntensityMap]

+

+ تتم ضرب قناة الألفا من هذه القوام ضد + [page:.specularIntensity]، للتحكم في شدة الانعكاس العاكس لكل بكسل. + الافتراضى هى `null`. +

+ +

[property:Color specularColor]

+

+ [page:Color] يلون الانعكاس العاكس عند التعرض الطبيعي للأشياء غير المعدنية فقط. الافتراضي هو `0xffffff`، أبيض. +

+ +

[property:Texture specularColorMap]

+

+ تتم ضرب قنوات RGB من هذه القوام ضد + [page:.specularColor]، للتحكم في لون العاكس لكل بكسل. الافتراضي + هو `null`. +

+ +

[property:Float thickness]

+

+ سُمْكُ الحجمِ تحتَ السطحِ. يُعطى القيمةُ في + مساحة التنسيق للشبكة. إذا كانت القيمة 0 فإن المادة + رقيقة الجدران. وإلا فإن المادة هي حدود حجم. الافتراضي هو `0`. +

+ +

[property:Texture thicknessMap]

+

+ قوام يحدد السُمْكَ، مخزن في قناة G. سيتم ضرب هذا بـ + [page:.thickness]. الافتراضي هو `null`. +

+ +

[property:Float transmission]

+

+ درجة الإرسال (أو الشفافية البصرية)، من `0.0` إلى `1.0`. + الافتراضي هو `0.0`.
+ + المواد البلاستيكية أو الزجاجية رقيقة أو شفافة أو نصف شفافة تظل + عاكسة إلى حد كبير حتى لو كانت مُرسِلَة بالكامل. يمكن استخدام خاصية الإرسال لنمذجة هذه المواد.
+ + عندما يكون الإرسال غير صفر، يجب تعيين [page:Material.opacity opacity] إلى `0`. +

+ +

[property:Texture transmissionMap]

+

+ تتم ضرب قناة اللون الأحمر من هذه القوام ضد + [page:.transmission]، للتحكم في الشفافية البصرية لكل بكسل. + الافتراضى هى `null`. +

+ +

الطرق (Methods)

+

+ انظر إلى فئات [page:Material] و [page:MeshStandardMaterial] الأساسية للطرق المشتركة. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/materials/MeshStandardMaterial.html b/docs/api/ar/materials/MeshStandardMaterial.html new file mode 100644 index 00000000000000..1613fcbb3a6cbc --- /dev/null +++ b/docs/api/ar/materials/MeshStandardMaterial.html @@ -0,0 +1,312 @@ + + + + + + + + + + [page:Material] → + +

[name]

+ +

+ مادة قائمة على الفيزياء القياسية، باستخدام سير عمل Metallic-Roughness.

+ + أصبح التقديم القائم على الفيزياء (PBR) مؤخرًا المعيار في العديد من + تطبيقات 3D، مثل + [link:https://blogs.unity3d.com/2014/10/29/physically-based-shading-in-unity-5-a-primer/ Unity]، + [link:https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/PhysicallyBased/ Unreal] و + [link:http://area.autodesk.com/blogs/the-3ds-max-blog/what039s-new-for-rendering-in-3ds-max-2017 3D Studio Max].

+ + هذا النهج يختلف عن النهج الأقدم في أنه بدلاً من استخدام + تقريبات لطريقة تفاعل الضوء مع سطح، يتم استخدام نموذج صحيح فيزيائيًا. الفكرة هي أنه، بدلاً من تعديل + المواد لتبدو جيدة تحت إضاءة محددة، يمكن إنشاء مادة + سوف تتفاعل 'بشكل صحيح' تحت جميع سيناريوهات الإضاءة.

+ + عمليًا يعطي هذا نتيجة أكثر دقة وواقعية من + [page:MeshLambertMaterial] أو [page:MeshPhongMaterial]، بتكلفة + أن يكون أكثر تكلفة حسابية قليلًا. يستخدم [name] التظليل لكل جزء.

+ + لاحظ أنه للحصول على أفضل النتائج يجب دائمًا تحديد [page:.envMap خريطة بيئة] + عند استخدام هذه المادة.

+ + لمقدمة غير فنية لمفهوم PBR وكيفية إعداد مادة PBR، تحقق من هذه المقالات من قِبَل الأشخاص في + [link:https://www.marmoset.co marmoset]: +

+
    +
  • + [link:https://www.marmoset.co/posts/basic-theory-of-physically-based-rendering/ Basic Theory of Physically Based Rendering] +
  • +
  • + [link:https://www.marmoset.co/posts/physically-based-rendering-and-you-can-too/ Physically Based Rendering and You Can Too] +
  • +
+

+ التفاصيل الفنية للنهج المستخدم في three.js (ومعظم نظم PBR الأخرى) + يمكن العثور على هذا + [link:https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf ورقة من Disney] + (pdf)، بواسطة Brent Burley. +

+ + + + + +

المنشئ (Constructor)

+ +

[name]( [param:Object parameters] )

+

+ [page:Object parameters] - (اختياري) كائن بواحد أو أكثر + خصائص تحدد مظهر المادة. يمكن تمرير أي خاصية من + المادة (بما في ذلك أي خاصية موروثة من [page:Material]) هنا.

+ + الاستثناء هو الخاصية [page:Hexadecimal color]، التي يمكن + تمريرها كسلسلة ست عشرية وهي `0xffffff` (أبيض) بشكل افتراضي. + يتم استدعاء [page:Color.set]( color ) داخليًا. +

+ +

الخصائص (Properties)

+

انظر إلى فئة [page:Material] الأساسية للخصائص المشتركة.

+ +

[property:Texture alphaMap]

+

+ خريطة الألفا هي قوام رمادي يتحكم في الشفافية عبر + السطح (أسود: شفاف تمامًا؛ أبيض: غير شفاف تمامًا). الافتراضى هى null.

+ + يُستخدَم فقط لون القوام، متجاهلاً قناة الألفا إذا كانت واحدة + موجود. بالنسبة لقوام RGB و RGBA، سوف يستخدم [page:WebGLRenderer WebGL] renderer + قناة اللون الأخضر عند أخذ عينات من هذه القوام بسبب البت الإضافي + الدقة المقدمة للأخضر في تنسيقات DXT المضغوطة و RGB 565 غير المضغوطة. + ستعمل قوام الإضاءة فقط وقوام الإضاءة / الألفا أيضًا كما هو متوقع. +

+ +

[property:Texture aoMap]

+

+ يُستخدَم قناة اللون الأحمر من هذه القوام كخريطة احتجاب محيط. + الافتراضى هى null. يتطلب aoMap مجموعة ثانية من UVs. +

+ +

[property:Float aoMapIntensity]

+

+ شدة تأثير الاحتجاب المحيط. الافتراضى هو 1. الصفر هو لا + تأثير احتجاب. +

+ +

[property:Texture bumpMap]

+

+ القوام لإنشاء خريطة بروز. تُعين قِيَمُ الأبيض والأسود إلى + العمق المدرك فيما يتعلق بالأضواء. لا يؤثر البروز فعليًا + على هندسة الكائن، فقط الإضاءة. إذا تم تعريف خريطة عادية + سيتم تجاهل هذا. +

+ +

[property:Float bumpScale]

+

+ مدى تأثير خريطة البروز على المادة. المدى النموذجى هو 0-1. + الافتراضى هو 1. +

+ +

[property:Color color]

+

[page:Color] المادة، بشكل افتراضى مضبوط على أبيض (0xffffff).

+ +

[property:Object defines]

+

+ كائن من نوع: + { 'STANDARD': '' }; + + يستخدم هذا بواسطة [page:WebGLRenderer] لتحديد المُظَهِّرات. +

+ +

[property:Texture displacementMap]

+

+ تؤثر خريطة التشويه على موضع رؤوس شبكة المادة. على عكس + خرائط أخرى التي تؤثر فقط على الضوء والظل للمادة + الرؤوس المشوهة يمكن أن تلقي ظلالًا، وتحجب كائنات أخرى، وغير ذلك + العمل كهندسة حقيقية. خريطة التشويه هي صورة حيث قِيَمَةُ كل بكسل (الأبيض هو الأعلى) مُعَيَّنَةٌ ضد، و + إعادة تحديد مواقع، رؤوس الشبكة. +

+ +

[property:Float displacementScale]

+

+ مدى تأثير خريطة التشويه على الشبكة (حيث اللون الأسود هو لا + التشويه، والأبيض هو التشويه الأقصى). بدون تعيين خريطة تشويه، + لا يتم تطبيق هذه القيمة. الافتراضى هو 1. +

+ +

[property:Float displacementBias]

+

+ إزاحة قِيَمِ خريطة التشويه على رؤوس شبكة المادة. + بدون تعيين خريطة تشويه، لا يتم تطبيق هذه القيمة. الافتراضى هو 0. +

+ +

[property:Color emissive]

+

+ لون المادة المُضِيءِ (الضوء)، عبارة عن لون صلب + غير متأثر بإضاءة أخرى. الافتراضى هو أسود. +

+ +

[property:Texture emissiveMap]

+

+ تعيين خريطة مُضِيئَة (مُضِيئَة). الافتراضى هى null. يتم تعديل لون خريطة المُضِيئَة + بواسطة اللون المُضِيئَ وشدة المُضِيئَ. إذا كان لديك + خريطة مُضِيئَ، تأكد من تعيين اللون المُضِيئَ إلى شيء آخر + غير أسود. +

+ +

[property:Float emissiveIntensity]

+

+ شدة الضوء المُضِيئَ. يعدل اللون المُضِيئَ. الافتراضى هو + 1. +

+ +

[property:Texture envMap]

+

+ خريطة البيئة. لضمان التقديم الصحيح فيزيائًا، يجب عليك + فقط إضافة خرائط بيئية تم معالجتها مسبقًا بـ + [page:PMREMGenerator]. الافتراضى هى null. +

+ +

[property:Float envMapIntensity]

+

تقوم بتحجيم تأثير خريطة البيئة عن طريق ضرب لونها.

+ +

[property:Boolean flatShading]

+

+ تحديد ما إذا كان يتم تصدير المادة بظلال مسطحة. الافتراضى هو + false. +

+ +

[property:Boolean fog]

+

ما إذا كانت المادة متأثرة بالضباب. الافتراضى هو `true`.

+ +

[property:Boolean isMeshStandardMaterial]

+

علامة للقراءة فقط للتحقق مما إذا كان كائن معين من نوع [name].

+ +

[property:Texture lightMap]

+

+ خريطة الضوء. الافتراضى هى null. يتطلب lightMap مجموعة ثانية من UVs. +

+ +

[property:Float lightMapIntensity]

+

شدة الضوء المخبوز. الافتراضى هو 1.

+ +

[property:Texture map]

+

+ خريطة اللون. قد تشمل اختياريًا قناة ألفا، عادةً مجتمعة + مع [page:Material.transparent .transparent] أو [page:Material.alphaTest .alphaTest]. + الافتراضى هى null. يتم تعديل لون خريطة القوام بواسطة اللون المُشْتَتِّ [page:.color]. +

+ +

[property:Float metalness]

+

+ مدى شبه المادة بالمعدن. المواد غير المعدنية مثل الخشب + أو الحجر استخدم 0.0، المعدن استخدم 1.0، مع عدم وجود شيء (عادة) في الوسط. + الافتراضى هو 0.0. يمكن استخدام قيمة بين 0.0 و 1.0 للحصول على مظهر معدن صدئ. + إذا تم توفير metalnessMap أيضًا، تتم ضرب كلا القيمتين. +

+ +

[property:Texture metalnessMap]

+

+ يُستخدَم قناة اللون الأزرق من هذه القوام لتغيير شبه المادة + بالمعدن. +

+ +

[property:Texture normalMap]

+

+ القوام لإنشاء خريطة عادية. تؤثر قِيَمُ RGB على سطح + الطبيعية لكل جزء بكسل وتغير طريقة إضاءة اللون. خرائط عادية + لا تغير شكل السطح الفعلي، فقط الإضاءة. في حال كانت المادة لديها خريطة عادية باستخدام التقليد + الذي يستخدم يدًا يسرى، يجب إنكار مكوِّن y من normalScale للتعويض + على التفاوت في التسلسل. +

+ +

[property:Integer normalMapType]

+

+ نوع خريطة عادية.

+ + الخيارات هى [page:constant THREE.TangentSpaceNormalMap] (الافتراضى)، و + [page:constant THREE.ObjectSpaceNormalMap]. +

+ +

[property:Vector2 normalScale]

+

+ مدى تأثير خريطة عادية على المادة. المدى النموذجى هو 0-1. + الافتراضى هو [page:Vector2] مضبوط على (1,1). +

+ +

[property:Float roughness]

+

+ مدى خشونة المادة. 0.0 يعني انعكاس مرآة ناعم، 1.0 + يعني تشتت كامل. الافتراضي هو 1.0. إذا تم توفير roughnessMap أيضًا، + تتم ضرب كلا القيمتين. +

+ +

[property:Texture roughnessMap]

+

+ يُستخدَم قناة اللون الأخضر من هذه القوام لتغيير خشونة + المادة. +

+ +

[property:Boolean wireframe]

+

+ تصدير الهندسة كإطار سلكي. الافتراضى هو `false` (أي تصدير كأشكال مسطحة). +

+ +

[property:String wireframeLinecap]

+

+ تحديد مظهر نهايات الخطوط. القيم الممكنة هى "butt"، "round" و + "square". الافتراضى هو 'round'.

+ + هذا يتوافق مع + [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap] + خاصية ويتم تجاهله بواسطة [page:WebGLRenderer WebGL] renderer. +

+ +

[property:String wireframeLinejoin]

+

+ تحديد مظهر مفاصل الخطوط. القيم الممكنة هى "round"، "bevel" و + "miter". الافتراضى هو 'round'.

+ + هذا يتوافق مع + [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin] + خاصية ويتم تجاهله بواسطة [page:WebGLRenderer WebGL] renderer. +

+ +

[property:Float wireframeLinewidth]

+

+ يتحكم في سُمْكِ الإطارِ السلكِيِّ. الافتراضى هو 1.

+ + بسبب قيود + [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] + مع [page:WebGLRenderer WebGL] renderer على معظم + المنصات سيظل linewidth دائمًا 1 بغض النظر عن القيمة المحددة. +

+ +

الطرق (Methods)

+

انظر إلى فئة [page:Material] الأساسية للطرق المشتركة.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/materials/MeshToonMaterial.html b/docs/api/ar/materials/MeshToonMaterial.html new file mode 100644 index 00000000000000..ce6af157167871 --- /dev/null +++ b/docs/api/ar/materials/MeshToonMaterial.html @@ -0,0 +1,235 @@ + + + + + + + + + + [page:Material] → + +

[name]

+ +
مادة تنفذ التظليل الكرتوني.
+ + + + + +

أمثلة (Examples)

+

+ [example:webgl_materials_toon materials / toon] +

+ +

المنشئ (Constructor)

+ +

[name]( [param:Object parameters] )

+

+ [page:Object parameters] - (اختياري) كائن يحتوي على واحد أو أكثر + خصائص تحدد مظهر المادة. يمكن تمرير أي خاصية من + المادة (بما في ذلك أي خاصية موروثة من [page:Material]) يمكن + تمريرها هنا.

+ + الاستثناء هو خاصية [page:Hexadecimal color] ، التي يمكن + تمريرها كسلسلة ست عشرية وهي `0xffffff` (الأبيض) بشكل افتراضي. + يتم استدعاء [page:Color.set]( color ) داخليًا. +

+ +

الخصائص (Properties)

+

انظر فئة [page:Material] الأساسية للخصائص المشتركة.

+ +

[property:Texture alphaMap]

+

+ خريطة ألفا هي ملمس رمادي يتحكم في التعتيم عبر + السطح (الأسود: شفافية كاملة ؛ الأبيض: غير شفاف تمامًا). الافتراضي هو + null.

+ + يتم استخدام لون الملمس فقط ، مع تجاهل قناة الألفا إذا كانت واحدة + موجود. بالنسبة لقوام RGB و RGBA ، سوف [page:WebGLRenderer WebGL] renderer + استخدام القناة الخضراء عند أخذ عينات من هذه الملمس بسبب البت الإضافي + من الدقة المقدمة للأخضر في DXT-compressed وغير المضغوط RGB 565 + التنسيقات. ستعمل الملمسات التي تحتوي على إضاءة فقط وإضاءة / ألفا أيضًا + كما هو متوقع. +

+ +

[property:Texture aoMap]

+

+ يستخدم القناة الحمراء من هذه الملمس كخريطة احتجاب الجو. + الافتراضي هو null. يتطلب aoMap مجموعة ثانية من UVs. +

+ +

[property:Float aoMapIntensity]

+

+ شدة تأثير احتجاب الجو. الافتراضي هو 1. صفر لا + تأثير احتجاب. +

+ +

[property:Texture bumpMap]

+

+ الملمس لإنشاء خريطة البثرة. تتوافق القيم السوداء والبيضاء مع + العمق المتصور فيما يتعلق بالأضواء. لا يؤثر البثرة فعليًا + هندسة الكائن ، فقط الإضاءة. إذا تم تحديد خريطة طبيعية + سيتم تجاهل هذا. +

+ +

[property:Float bumpScale]

+

+ مدى تأثير خريطة البثرة على المادة. المدى النموذجي هو 0-1. + الافتراضي هو 1. +

+ +

[property:Color color]

+

[page:Color] المادة ، بشكل افتراضي مضبوط على الأبيض (0xffffff).

+ +

[property:Texture displacementMap]

+

+ تؤثر خريطة التشوه على موضع رؤوس شبكة الشبكة. على عكس + خرائط أخرى التي تؤثر فقط على الضوء والظل للمادة + يمكن للرؤوس المشتتة أن تلقي ظلالًا ، وتحجب كائنات أخرى ، وغيرها + يعمل كهندسة حقيقية. خريطة التشوه هي صورة حيث قيمة + كل بكسل (الأبيض هو الأعلى) يتم تعيينه ضد ، و + إعادة تحديد مواقع رؤوس الشبكة. +

+ +

[property:Float displacementScale]

+

+ مدى تأثير خريطة التشوه على الشبكة (حيث يكون الأسود لا + التشوه ، والأبيض هو التشوه الأقصى). بدون تشوه + تعيين خريطة ، لا يتم تطبيق هذه القيمة. الافتراضي هو 1. +

+ +

[property:Float displacementBias]

+

+ إزاحة قيم خريطة التشوه على رؤوس شبكة الشبكات. + بدون تعيين خريطة التشوه ، لا يتم تطبيق هذه القيمة. الافتراضية هى 0. +

+ +

[property:Color emissive]

+

+ لون المادة المنبعث (الضوء) ، في جوهره لون صلب + غير متأثر بإضاءة أخرى. الافتراضية هى سوداء. +

+ +

[property:Texture emissiveMap]

+

+ تعيين الخريطة الانبعاثية (التوهج). الافتراضي هو null. يتم تعديل لون الخريطة الانبعاثية + بواسطة اللون الانبعاثي وشدة الانبعاث. إذا كان لديك خريطة انبعاثية ، تأكد من تعيين اللون الانبعاثي على شيء آخر + من الأسود. +

+ +

[property:Float emissiveIntensity]

+

+ شدة الضوء المنبعث. يعدل اللون المنبعث. الافتراضي هو + 1. +

+ +

[property:Boolean fog]

+

ما إذا كانت المادة متأثرة بالضباب. الافتراضي هو `true`.

+ +

[property:Texture gradientMap]

+

+ خريطة التدرج للتظليل الكرتوني. يجب تعيين + [page:Texture.minFilter] و [page:Texture.magFilter] إلى [page:Textures THREE.NearestFilter] + عند استخدام هذا النوع من الملمس. الافتراضي هو `null`. +

+ +

[property:Texture lightMap]

+

+ خريطة الضوء. الافتراضي هو null. يتطلب lightMap مجموعة ثانية من UVs. +

+ +

[property:Float lightMapIntensity]

+

شدة الضوء المخبوز. الافتراضي هو 1.

+ +

[property:Texture map]

+

+ خريطة اللون. قد تشمل اختياريًا قناة ألفا ، عادةً مجتمعة + مع [page:Material.transparent .transparent] أو [page:Material.alphaTest .alphaTest]. + الافتراضي هو null. يتم تعديل لون خريطة الملمس باللون المنتشر [page:.color]. +

+ +

[property:Texture normalMap]

+

+ الملمس لإنشاء خريطة طبيعية. تؤثر قيم RGB على سطح + normal لكل جزء بكسل وتغير طريقة إضاءة اللون. لا تغير خرائط normal شكل السطح فعلًا ، فقط الإضاءة. في + في حال كانت المادة تحتوي على خريطة طبيعية باستخدام التقاليد التي يستخدمها يدًا يسارىً + يجب إنكار مكوِّن y من normalScale للتعويض عن اختلاف التقاليد. +

+ +

[property:Integer normalMapType]

+

+ نوع الخريطة الطبيعية.

+ + الخيارات هي [page:constant THREE.TangentSpaceNormalMap] (الافتراضي) ، و + [page:constant THREE.ObjectSpaceNormalMap]. +

+ +

[property:Vector2 normalScale]

+

+ مدى تأثير الخريطة الطبيعية على المادة. المدى النموذجي هو 0-1. + الافتراضي هو [page:Vector2] مضبوط على (1،1). +

+ +

[property:Boolean wireframe]

+

+ تقديم الهندسة كإطار سلكي. الافتراضي هو `false` (أي تقديم كمضلعات مسطحة). +

+ +

[property:String wireframeLinecap]

+

+ تحديد مظهر نهايات الخط. القيم الممكنة هي "butt" و "round" و + "square". الافتراضي هو 'round'.

+ + يتوافق هذا مع + [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap] + خاصية و يتم تجاهلها من قبل [page:WebGLRenderer WebGL] renderer. +

+ +

[property:String wireframeLinejoin]

+

+ تحديد مظهر مفاصل الخط. القيم الممكنة هي "round" و "bevel" و + "miter". الافتراضي هو 'round'.

+ + يتوافق هذا مع + [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin] + خاصية و يتم تجاهلها من قبل [page:WebGLRenderer WebGL] renderer. +

+ +

[property:Float wireframeLinewidth]

+

+ التحكم في سمك الإطار السلكي. الافتراضي هو 1.

+ + بسبب قيود + [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] + مع [page:WebGLRenderer WebGL] renderer على معظم + المنصات ستكون linewidth دائمًا 1 بغض النظر عن القيمة المحددة. +

+ +

الطرق (Methods)

+

انظر فئة [page:Material] الأساسية للطرق المشتركة.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/materials/PointsMaterial.html b/docs/api/ar/materials/PointsMaterial.html new file mode 100644 index 00000000000000..858ffe56619453 --- /dev/null +++ b/docs/api/ar/materials/PointsMaterial.html @@ -0,0 +1,116 @@ + + + + + + + + + + [page:Material] → + +

[name]

+ +

المادة الافتراضية المستخدمة بواسطة [page:Points].

+ +

مثال الكود

+ + const vertices = []; + + for ( let i = 0; i < 10000; i ++ ) { + const x = THREE.MathUtils.randFloatSpread( 2000 ); + const y = THREE.MathUtils.randFloatSpread( 2000 ); + const z = THREE.MathUtils.randFloatSpread( 2000 ); + + vertices.push( x, y, z ); + } + + const geometry = new THREE.BufferGeometry(); + geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) ); + const material = new THREE.PointsMaterial( { color: 0x888888 } ); + const points = new THREE.Points( geometry, material ); + scene.add( points ); + + +

أمثلة (Examples)

+

+ [example:misc_controls_fly misc / controls / fly]
+ [example:webgl_buffergeometry_drawrange WebGL / BufferGeometry / drawrange]
+ [example:webgl_buffergeometry_points WebGL / BufferGeometry / points]
+ [example:webgl_buffergeometry_points_interleaved WebGL / BufferGeometry / points / interleaved]
+ [example:webgl_camera WebGL / camera ]
+ [example:webgl_geometry_convex WebGL / geometry / convex]
+ [example:webgl_geometry_shapes WebGL / geometry / shapes]
+ [example:webgl_interactive_raycasting_points WebGL / interactive / raycasting / points]
+ [example:webgl_multiple_elements_text WebGL / multiple / elements / text]
+ [example:webgl_points_billboards WebGL / points / billboards]
+ [example:webgl_points_dynamic WebGL / points / dynamic]
+ [example:webgl_points_sprites WebGL / points / sprites] +

+ +

المنشئ (Constructor)

+

[name]( [param:Object parameters] )

+

+ [page:Object parameters] - (اختياري) كائن يحتوي على واحد أو أكثر + خصائص تحدد مظهر المادة. يمكن تمرير أي خاصية من + المادة (بما في ذلك أي خاصية موروثة من [page:Material]) يمكن + تمريرها هنا.

+ + الاستثناء هو خاصية [page:Hexadecimal color] ، التي يمكن + تمريرها كسلسلة ست عشرية وهي `0xffffff` (الأبيض) بشكل افتراضي. + يتم استدعاء [page:Color.set]( color ) داخليًا. +

+ +

الخصائص (Properties)

+

انظر فئة [page:Material] الأساسية للخصائص المشتركة.

+ +

[property:Texture alphaMap]

+

+ خريطة ألفا هي ملمس رمادي يتحكم في التعتيم عبر + السطح (الأسود: شفافية كاملة ؛ الأبيض: غير شفاف تمامًا). الافتراضي هو + null.

+ + يتم استخدام لون الملمس فقط ، مع تجاهل قناة الألفا إذا كانت واحدة + موجود. بالنسبة لقوام RGB و RGBA ، سوف [page:WebGLRenderer WebGL] renderer + استخدام القناة الخضراء عند أخذ عينات من هذه الملمس بسبب البت الإضافي + من الدقة المقدمة للأخضر في DXT-compressed وغير المضغوط RGB 565 + التنسيقات. ستعمل الملمسات التي تحتوي على إضاءة فقط وإضاءة / ألفا أيضًا + كما هو متوقع. +

+ +

[property:Color color]

+

[page:Color] المادة ، بشكل افتراضي مضبوط على الأبيض (0xffffff).

+ +

[property:Boolean fog]

+

ما إذا كانت المادة متأثرة بالضباب. الافتراضي هو `true`.

+ +

[property:Texture map]

+

+ يحدد لون النقاط باستخدام بيانات من [page:Texture]. قد + اختیاریًا تشمل قناة ألفا ، عادةً مجتمعة مع + [page:Material.transparent .transparent] أو [page:Material.alphaTest .alphaTest]. +

+ +

[property:Number size]

+

+ يحدد حجم النقط بالبكسل. الافتراضي هو 1.0.
+ سيتم قطعه إذا تجاوز المعامل المستقل عن الأجهزة + [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getParameter gl.ALIASED_POINT_SIZE_RANGE]. +

+ +

[property:Boolean sizeAttenuation]

+

+ حدد ما إذا كان حجم النقط يُخفَّف بعمق الكاميرا. + (كاميرات التصوير فقط.) الافتراضي هو true. +

+ +

الطرق (Methods)

+

انظر فئة [page:Material] الأساسية للطرق المشتركة.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/materials/RawShaderMaterial.html b/docs/api/ar/materials/RawShaderMaterial.html new file mode 100644 index 00000000000000..b83ff39dcd1bad --- /dev/null +++ b/docs/api/ar/materials/RawShaderMaterial.html @@ -0,0 +1,70 @@ + + + + + + + + + + [page:Material] → [page:ShaderMaterial] → + +

[name]

+ +

+ هذه الفئة تعمل تمامًا مثل [page:ShaderMaterial]، باستثناء أن التعريفات + من الموحدات والسمات المدمجة لا يتم إلحاقها تلقائيًا بـ + كود GLSL shader. +

+ +

مثال الكود

+ + const material = new THREE.RawShaderMaterial( { + + uniforms: { + time: { value: 1.0 } + }, + vertexShader: document.getElementById( 'vertexShader' ).textContent, + fragmentShader: document.getElementById( 'fragmentShader' ).textContent, + + } ); + + +

أمثلة (Examples)

+

+ [example:webgl_buffergeometry_rawshader WebGL / buffergeometry / rawshader]
+ [example:webgl_buffergeometry_instancing_billboards WebGL / buffergeometry / instancing / billboards]
+ [example:webgl_buffergeometry_instancing WebGL / buffergeometry / instancing]
+ [example:webgl_raymarching_reflect WebGL / raymarching / reflect]
+ [example:webgl2_volume_cloud WebGL 2 / volume / cloud]
+ [example:webgl2_volume_instancing WebGL 2 / volume / instancing]
+ [example:webgl2_volume_perlin WebGL 2 / volume / perlin] +

+ +

المنشئ (Constructor)

+ +

[name]( [param:Object parameters] )

+

+ [page:Object parameters] - (اختياري) كائن يحتوي على واحد أو أكثر + خصائص تحدد مظهر المادة. يمكن تمرير أي خاصية من + المادة (بما في ذلك أي خاصية موروثة من [page:Material] و + [page:ShaderMaterial]) هنا.

+

+ +

الخصائص (Properties)

+

+ انظر إلى الفئات الأساسية [page:Material] و [page:ShaderMaterial] للخصائص المشتركة. +

+ +

الطرق (Methods)

+

+ انظر إلى الفئات الأساسية [page:Material] و [page:ShaderMaterial] للطرق المشتركة. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/materials/ShaderMaterial.html b/docs/api/ar/materials/ShaderMaterial.html new file mode 100644 index 00000000000000..6b40ad984311e1 --- /dev/null +++ b/docs/api/ar/materials/ShaderMaterial.html @@ -0,0 +1,463 @@ + + + + + + + + + + [page:Material] → + +

[name]

+ +

+ مادة يتم عرضها بشيدرات مخصصة. الشيدر هو برنامج صغير + مكتوب في + [link:https://www.khronos.org/files/opengles_shading_language.pdf GLSL] + يعمل على GPU. قد ترغب في استخدام شيدر مخصص إذا كنت بحاجة إلى: +

+ +
    +
  • + تنفيذ تأثير غير مضمن في أي من المواد المدمجة [page:Material materials] +
  • +
  • + دمج العديد من الكائنات في [page:BufferGeometry] واحد لكي + تحسين الأداء +
  • +
+ هناك الملاحظات التالية التي يجب مراعاتها عند استخدام `ShaderMaterial`: +
    +
  • + سيتم عرض `ShaderMaterial` بشكل صحيح فقط من قِبَل + [page:WebGLRenderer]، نظرًا لأن كود GLSL في + [link:https://en.wikipedia.org/wiki/Shader#Vertex_shaders vertexShader] + و [link:https://en.wikipedia.org/wiki/Shader#Pixel_shaders fragmentShader] + يجب تجميعه وتشغيله على GPU باستخدام WebGL. +
  • +
  • + اعتبارًا من THREE r72، لم يعد يتم دعم تعيين السمات مباشرة في ShaderMaterial. يجب استخدام نسخة [page:BufferGeometry] بدلاً من ذلك، + باستخدام [page:BufferAttribute] instances لتعريف السمات المخصصة. +
  • +
  • + اعتبارًا من THREE r77، لم يعد من المفترض استخدام نسخ [page:WebGLRenderTarget] أو + [page:WebGLCubeRenderTarget] كموحدات. يجب استخدام خاصية [page:Texture texture] بدلاً من ذلك. +
  • +
  • + يتم تمرير السمات والموحدات المضمنة إلى الشيدرات جنبًا إلى جنب + مع كودك. إذا كنت لا ترغب في أن يضيف [page:WebGLProgram] أي شيء إلى + كود شيدرك، يمكنك استخدام [page:RawShaderMaterial] بدلاً من هذه + الفئة. +
  • +
  • + يمكنك استخدام التوجيه #pragma unroll_loop_start و #pragma + unroll_loop_end لفك حلقة `for` في GLSL بواسطة معالج شيدر + قبل التشغيل. يجب وضع التوجيه فوق الحلقة مباشرة. يجب أن يتطابق تنسيق الحلقة مع معيار محدد. +
      +
    • + يجب أن تكون الحلقة + [link:https://en.wikipedia.org/wiki/Normalized_loop normalized]. +
    • +
    • يجب أن يكون متغير الحلقة *i*.
    • +
    • + ستستبدل قِبَال `UNROLLED_LOOP_INDEX` بالقِبَال المُعَبرَة لـ *i* للتكرار المُعَبرَ ويمكن استخدامها في بيانات قِبَال التشغيل. +
    • +
    + + #pragma unroll_loop_start + for ( int i = 0; i < 10; i ++ ) { + // ... + } + #pragma unroll_loop_end + +
  • +
+ +

مثال الكود

+ + + const material = new THREE.ShaderMaterial( { + + uniforms: { + time: { value: 1.0 }, + resolution: { value: new THREE.Vector2() } + }, + + vertexShader: document.getElementById( 'vertexShader' ).textContent, + fragmentShader: document.getElementById( 'fragmentShader' ).textContent + + } ); + + +

أمثلة (Examples)

+ +

+ [example:webgl_buffergeometry_custom_attributes_particles webgl / buffergeometry / custom / attributes / particles]
+ [example:webgl_buffergeometry_selective_draw webgl / buffergeometry / selective / draw]
+ [example:webgl_custom_attributes webgl / custom / attributes]
+ [example:webgl_custom_attributes_lines webgl / custom / attributes / lines]
+ [example:webgl_custom_attributes_points webgl / custom / attributes / points]
+ [example:webgl_custom_attributes_points2 webgl / custom / attributes / points2]
+ [example:webgl_custom_attributes_points3 webgl / custom / attributes / points3]
+ [example:webgl_depth_texture webgl / depth / texture]
+ [example:webgl_gpgpu_birds webgl / gpgpu / birds]
+ [example:webgl_gpgpu_protoplanet webgl / gpgpu / protoplanet]
+ [example:webgl_gpgpu_water webgl / gpgpu / water]
+ [example:webgl_interactive_points webgl / interactive / points]
+ [example:webgl_video_kinect webgl / video / kinect]
+ [example:webgl_lights_hemisphere webgl / lights / hemisphere]
+ [example:webgl_marchingcubes webgl / marchingcubes]
+ [example:webgl_materials_envmaps webgl / materials / envmaps]
+ [example:webgl_materials_lightmap webgl / materials / lightmap]
+ [example:webgl_materials_wireframe webgl / materials / wireframe]
+ [example:webgl_modifier_tessellation webgl / modifier / tessellation]
+ [example:webgl_postprocessing_dof2 webgl / postprocessing / dof2]
+ [example:webgl_postprocessing_godrays webgl / postprocessing / + godrays] +

+ +

شيدرات الرأس وشيدرات الجزء (Vertex shaders and fragment shaders)

+ +
+

يمكنك تحديد نوعين مختلفين من الشيدرات لكل مادة:

+
    +
  • + يعمل شيدر الرأس أولاً؛ يتلقى `attributes`، يحسب / + يعدل موضع كل رأس فردي، ويمرر + بيانات إضافية (`varying`s) إلى شيدر الجزء. +
  • +
  • + يعمل شيدر الجزء (أو البكسل) ثانيًا؛ يضبط لون + كل "جزء" فردي (بكسل) يتم عرضه على الشاشة. +
  • +
+

+ هناك ثلاثة أنواع من المتغيرات في الشيدرات: الموحدات، والسمات، و + varyings: +

+
    +
  • + `Uniforms` هي متغيرات لها نفس القيمة لجميع الرؤوس - + الإضاءة، والضباب، وخرائط الظل هي أمثلة على البيانات التي ستكون + مخزنة في الموحدات. يمكن الوصول إلى الموحدات من قبل كل من شيدر الرأس + وشيدر الجزء. +
  • +
  • + `Attributes` هي متغيرات مرتبطة بكل رأس - على سبيل المثال، + موضع الرأس، والوجه الطبيعي، ولون الرأس هي جميعها أمثلة على + البيانات التي ستكون مخزنة في السمات. يمكن `فقط` الوصول إلى السمات + داخل شيدر الرأس. +
  • +
  • + `Varyings` هي متغيرات تُمَرَّر من شيدر الرأس إلى + شيدر الجزء. لكل جزء، ستتم تقديم قيمة كل varying بشكل سلس من قِبَال رؤوس مجاورة. +
  • +
+

+ يجب ملاحظة أن `within` الشيدر نفسه، تعمل الموحدات والسمات مثل + المستمرات؛ يمكنك فقط تعديل قِبَالها بتمرير قِبَال مختلفة + إلى المخازن من كود JavaScript الخاص بك. +

+
+ +

السمات والموحدات المدمجة (Built-in attributes and uniforms)

+ +
+

+ يوفر [page:WebGLRenderer] العديد من السمات والموحدات إلى + الشيدرات افتراضيًا؛ يتم إلحاق تعريفات هذه المتغيرات بكود + `fragmentShader` و `vertexShader` الخاص بك من قبل [page:WebGLProgram] عندما + يتم تجميع الشيدر؛ ليس عليك إعلانها بنفسك. انظر + [page:WebGLProgram] للحصول على تفاصيل هذه المتغيرات. +

+

+ بعض هذه الموحدات أو السمات (على سبيل المثال تلك المتعلقة بالإضاءة، + الضباب، إلخ) تتطلب تعيين خصائص على المادة لكي + [page:WebGLRenderer] لنسخ القيم المناسبة إلى GPU - تأكد من تعيين هذه العلامات إذا كنت ترغب في استخدام هذه الميزات في شيدرك الخاص. +

+

+ إذا كنت لا ترغب في أن يضيف [page:WebGLProgram] أي شيء إلى كود شيدرك + ، يمكنك استخدام [page:RawShaderMaterial] بدلاً من هذه الفئة. +

+
+ +

السمات والموحدات المخصصة (Custom attributes and uniforms)

+ +
+

+ يجب إعلان كل من السمات والموحدات المخصصة في كود GLSL shader + (داخل `vertexShader` و / أو `fragmentShader`). يجب تعريف الموحدات المخصصة + في `both` خاصية `uniforms` لـ + `ShaderMaterial`، في حين يجب تعريف أي سمات مخصصة عبر + [page:BufferAttribute] instances. يجب ملاحظة أن `varying`s يجب فقط أن + يتم إعلانها داخل كود الشيدر (وليس داخل المادة). +

+

+ لإعلان سمة مخصصة، يرجى الإشارة إلى + [page:BufferGeometry] للحصول على نظرة عامة، و + [page:BufferAttribute] للحصول على نظرة مفصلة على API `BufferAttribute`. +

+

+ عند إنشاء سماتك، يجب أن يكون كل مجموعة مُطَبَّقَة التي تقوم بإنشائها لحفظ بيانات سمتك مضروبًا في حجم نوع بياناتك. على سبيل المثال، إذا كانت سمتك من نوع [page:Vector3 THREE.Vector3] ، وكان لديك 3000 رأس في [page:BufferGeometry] ، فيجب إنشاء قيمة مجموعتك المُطَبَّقَة بطول 3000 * 3 ، أو 9000 (قيمة واحدة + لكل مُكَوِّن). يظهر جدول حجم كل نوع من أنواع البيانات أدناه للإشارة: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Attribute sizes +
GLSL typeJavaScript typeSize
float[page:Number]1
vec2[page:Vector2 THREE.Vector2]2
vec3[page:Vector3 THREE.Vector3]3
vec3[page:Color THREE.Color]3
vec4[page:Vector4 THREE.Vector4]4
+ +

+ يجب ملاحظة أن مخازن السمات `ليست` تتحدث تلقائيًا عندما تتغير قيمها. لتحديث السمات المخصصة، قم بتعيين علامة `needsUpdate` + إلى true على [page:BufferAttribute] للهندسة (انظر + [page:BufferGeometry] لمزيد من التفاصيل). +

+ +

+ لإعلان [page:Uniform] مخصص، استخدم خاصية `uniforms`: + +uniforms: { + time: { value: 1.0 }, + resolution: { value: new THREE.Vector2() } +} + +

+ +

+ يوصى بتحديث قيم [page:Uniform] المخصصة اعتمادًا على + [page:Object3D object] و [page:Camera camera] في + [page:Object3D.onBeforeRender] لأن [page:Material] يمكن أن يتم مشاركته + بين [page:Mesh meshes]، يتم تحديث [page:Matrix4 matrixWorld] لـ [page:Scene] و + [page:Camera] في [page:WebGLRenderer.render]، وبعض + المؤثرات تعرض [page:Scene scene] باستخدام خاصة بهم [page:Camera cameras]. +

+
+ +

المنشئ (Constructor)

+ +

[name]( [param:Object parameters] )

+

+ [page:Object parameters] - (اختياري) كائن يحتوي على واحد أو أكثر + خصائص تحدد مظهر المادة. يمكن تمرير أي خاصية من + المادة (بما في ذلك أي خاصية موروثة من [page:Material]) هنا. +

+ +

الخصائص (Properties)

+

انظر إلى الفئة الأساسية [page:Material] للخصائص المشتركة.

+ +

[property:Boolean clipping]

+

+ يحدد ما إذا كانت هذه المادة تدعم القطع؛ صحيح للسماح للعارض + بتمرير الزي الرسمي clippingPlanes. الافتراضي هو false. +

+ +

[property:Object defaultAttributeValues]

+

+ عندما لا تتضمن الهندسة المعروضة هذه السمات ولكن المادة تفعل ذلك، سيتم تمرير هذه القيم الافتراضية إلى الشيدرات. هذا يتجنب الأخطاء عندما تكون بيانات المخزن المؤقت مفقودة. + + +this.defaultAttributeValues = { + 'color': [ 1, 1, 1 ], + 'uv': [ 0, 0 ], + 'uv1': [ 0, 0 ] +}; + +

+ +

[property:Object defines]

+

+ يحدد ثوابت مخصصة باستخدام توجيهات `#define` داخل كود GLSL + لكل من شيدر الرأس وشيدر الجزء؛ كل زوج من المفتاح / القيمة + يولد توجيهًا آخر: + + defines: { + FOO: 15, + BAR: true + } + + يولد الأسطر + + #define FOO 15 + #define BAR true + + في كود GLSL. +

+ +

[property:Object extensions]

+

+ كائن يحتوي على الخصائص التالية: + +this.extensions = { + derivatives: false, // set to use derivatives + fragDepth: false, // set to use fragment depth values + drawBuffers: false, // set to use draw buffers + shaderTextureLOD: false // set to use + shader texture LOD +}; + +

+ +

[property:Boolean fog]

+

+ تحدد ما إذا كان يتم التأثير على لون المادة بإعدادات الضباب العالمية؛ صحيح + لتمرير موحدات الضباب إلى الشيدر. الافتراضي هو false. +

+ +

[property:String fragmentShader]

+

+ كود GLSL لشيدر الجزء. هذا هو الكود الفعلي للشيدر. في + المثال أعلاه، يتم استخراج كود `vertexShader` و `fragmentShader` من + DOM؛ يمكن تمريره كسلسلة مباشرة أو تحميله عبر AJAX + بدلاً من ذلك. +

+ +

[property:String glslVersion]

+

+ يحدد إصدار GLSL لكود الشيدر المخصص. ذو صلة فقط لـ WebGL 2 + لتحديد ما إذا كان يجب تحديد GLSL 3.0 أم لا. القيم المتاحة هي + `THREE.GLSL1` أو `THREE.GLSL3`. الافتراضي هو `null`. +

+ +

[property:String index0AttributeName]

+

+ إذا تم تعيينه، يستدعي هذا + [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bindAttribLocation gl.bindAttribLocation] + لربط فهرس رأس عام بمتغير سمة. الافتراضي هو غير معرف. +

+ +

[property:Boolean isShaderMaterial]

+

علامة قراءة فقط للتحقق مما إذا كان كائنًا معينًا من نوع [name].

+ +

[property:Boolean lights]

+

+ يحدد ما إذا كانت هذه المادة تستخدم الإضاءة؛ صحيح لتمرير بيانات الموحدات + المتعلقة بالإضاءة إلى هذا الشيدر. الافتراضي هو false. +

+ +

[property:Float linewidth]

+

+ يتحكم في سُمك الإطار السلكي. الافتراضي هو 1.

+ + نظرًا للقيود + [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] + مع [page:WebGLRenderer WebGL] renderer على معظم + المنصات ستكون linewidth دائمًا 1 بغض النظر عن القيمة المُعَدَّة. +

+ +

[property:Boolean flatShading]

+

+ حدد ما إذا كان يتم عرض المادة بظلال مسطحة. + الافتراضي هو false. +

+ +

[property:Object uniforms]

+

+ كائن من الشكل: + + { + "uniform1": { value: 1.0 }, + "uniform2": { value: 2 } + } + + يحدد الموحدات التي يتم تمريرها إلى كود الشيدر؛ المفاتيح هي أسماء الموحدات + ، والقيم هي تعريفات من الشكل + + { + value: 1.0 + } + + حيث `value` هو قيمة الموحد. يجب أن تتطابق الأسماء مع اسم + الموحد، كما هو محدد في كود GLSL. يجب ملاحظة أن الموحدات يتم تحديثها + في كل إطار، لذلك تحديث قيمة الموحد سيؤدي فورًا إلى + تحديث القيمة المتاحة لكود GLSL. +

+ +

[property:Boolean uniformsNeedUpdate]

+

+ يمكن استخدامه لإجبار تحديث الموحدات أثناء تغيير الموحدات في + [page:Object3D.onBeforeRender](). الافتراضي هو `false`. +

+ +

[property:Boolean vertexColors]

+

يعرف ما إذا كان يتم استخدام تلوين الرأس. الافتراضي هو `false`.

+ +

[property:String vertexShader]

+

+ كود GLSL لشيدر الرأس. هذا هو الكود الفعلي للشيدر. في + المثال أعلاه، يتم استخراج كود `vertexShader` و `fragmentShader` من + DOM؛ يمكن تمريره كسلسلة مباشرة أو تحميله عبر AJAX + بدلاً من ذلك. +

+ +

[property:Boolean wireframe]

+

+ عرض الهندسة كإطار سلكي (باستخدام GL_LINES بدلاً من GL_TRIANGLES). + الافتراضي هو false (أي عرض كأشكال مسطحة). +

+ +

[property:Float wireframeLinewidth]

+

+ يتحكم في سُمك الإطار السلكي. الافتراضي هو 1.

+ + نظرًا للقيود + [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] + مع [page:WebGLRenderer WebGL] renderer على معظم + المنصات ستكون linewidth دائمًا 1 بغض النظر عن القيمة المُعَدَّة. +

+ +

الطرق (Methods)

+

انظر إلى الفئة الأساسية [page:Material] للطرق المشتركة.

+ +

[method:ShaderMaterial clone]()

+

+ يولِّد نسخة طبقية من هذه المادة. يجب ملاحظة أن vertexShader و + fragmentShader يتم نسخهم `by reference`، كذلك تعاريف + `attributes`؛ هذا يعني أن نسخ المادة ستشارك نفس + [page:WebGLProgram] المُجَمَّع. ومع ذلك، فإن `uniforms` يتم نسخها `by + value`، مما يتيح لك امتلاك مجموعات مختلفة من الموحدات لنسخ مختلفة من + المادة. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/materials/ShadowMaterial.html b/docs/api/ar/materials/ShadowMaterial.html new file mode 100644 index 00000000000000..6d759c2a8fb1c7 --- /dev/null +++ b/docs/api/ar/materials/ShadowMaterial.html @@ -0,0 +1,67 @@ + + + + + + + + + + [page:Material] → + +

[name]

+ +

+ يمكن لهذه المادة تلقي الظلال، ولكنها في الوقت نفسه شفافة تمامًا. +

+ +

مثال الكود

+ + + const geometry = new THREE.PlaneGeometry( 2000, 2000 ); + geometry.rotateX( - Math.PI / 2 ); + + const material = new THREE.ShadowMaterial(); + material.opacity = 0.2; + + const plane = new THREE.Mesh( geometry, material ); + plane.position.y = -200; + plane.receiveShadow = true; + scene.add( plane ); + + +

أمثلة (Examples)

+ +

[example:webgl_geometry_spline_editor geometry / spline / editor]

+ +

المنشئ (Constructor)

+ +

[name]( [param:Object parameters] )

+

+ [page:Object parameters] - (اختياري) كائن يحتوي على واحد أو أكثر + خصائص تحدد مظهر المادة. يمكن تمرير أي خاصية من + المادة (بما في ذلك أي خاصية موروثة من [page:Material]) هنا.

+

+ +

الخصائص (Properties)

+

انظر إلى الفئات الأساسية [page:Material] للخصائص المشتركة.

+ +

[property:Color color]

+

[page:Color] المادة، بشكل افتراضي مضبوط على الأسود (0x000000).

+ +

[property:Boolean fog]

+

ما إذا كانت المادة متأثرة بالضباب. الافتراضي هو `true`.

+ +

[property:Boolean transparent]

+

يحدد ما إذا كانت هذه المادة شفافة. الافتراضي هو `true`.

+ +

الطرق (Methods)

+

انظر إلى الفئات الأساسية [page:Material] للطرق المشتركة.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/materials/SpriteMaterial.html b/docs/api/ar/materials/SpriteMaterial.html new file mode 100644 index 00000000000000..c86ce8f9c72563 --- /dev/null +++ b/docs/api/ar/materials/SpriteMaterial.html @@ -0,0 +1,97 @@ + + + + + + + + + + [page:Material] → + +

[name]

+ +

A material for a use with a [page:Sprite].

+ +

مثال للكود

+ + + const map = new THREE.TextureLoader().load( 'textures/sprite.png' ); + const material = new THREE.SpriteMaterial( { map: map, color: 0xffffff } ); + + const sprite = new THREE.Sprite( material ); + sprite.scale.set(200, 200, 1) + scene.add( sprite ); + + +

Examples

+

+ [example:webgl_raycaster_sprite WebGL / raycast / sprite]
+ [example:webgl_sprites WebGL / sprites]
+ [example:svg_sandbox SVG / sandbox] +

+ +

المنشئ (Constructor)

+ +

[name]( [param:Object parameters] )

+

+ [page:Object parameters] - (اختياري) كائن يحتوي على واحد أو أكثر + خصائص تحدد مظهر المادة. يمكن تمرير أي خاصية من + المادة (بما في ذلك أي خاصية موروثة من [page:Material]) هنا.

+ + الاستثناء هو خاصية [page:Hexadecimal color]، التي يمكن + تمريرها كسلسلة ست عشرية وهي `0xffffff` (أبيض) افتراضيًا. + يتم استدعاء [page:Color.set]( color ) داخليًا. لا يتم قطع SpriteMaterials باستخدام [page:Material.clippingPlanes]. +

+ +

الخصائص (Properties)

+

انظر إلى الفئة الأساسية [page:Material] للخصائص المشتركة.

+ +

[property:Texture alphaMap]

+

+ الخريطة الألفية هي نسيج رمادي يتحكم في التعتيم عبر السطح (أسود: شفاف تمامًا؛ أبيض: غير شفاف تمامًا). الافتراضي هو + null.

+ + يتم استخدام لون النسيج فقط، متجاهلاً قناة الألفا إذا كانت موجودة. بالنسبة للقوام RGB و RGBA، سيستخدم [page:WebGLRenderer WebGL] renderer + قناة الأخضر عند عينة هذا النسيج بسبب البت الإضافي من الدقة المقدمة للأخضر في تنسيقات DXT المضغوطة و RGB 565 غير المضغوطة. ستعمل القوام المُضِئَة فقط والقوام المُضِئَة / الألفية أيضًا كما هو متوقع. +

+ +

[property:Color color]

+

+ [page:Color] المادة، بشكل افتراضي مضبوط على الأبيض (0xffffff). The + [page:.map] مضروب باللون. +

+ +

[property:Boolean fog]

+

ما إذا كانت المادة متأثرة بالضباب. الافتراضي هو `true`.

+ +

[property:Boolean isSpriteMaterial]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معطىً من نوع [name].

+ +

[property:Texture map]

+

+ خريطة اللون. قد تشمل اختيارًا قناة ألفا، عادةً مُجَمَّعَةً مع [page:Material.transparent .transparent] أو [page:Material.alphaTest .alphaTest]. + الافتراضي هو null. +

+ +

[property:Radians rotation]

+

دوران الرذاذ بالراديان. الافتراضي هو 0.

+ +

[property:Boolean sizeAttenuation]

+

+ ما إذا كان حجم الرذاذ يُخَفَّف بعمق الكاميرات. + (كاميرات المنظور فقط.) الافتراضي هو `true`. +

+ +

[property:Boolean transparent]

+

يحدد ما إذا كانت هذه المادة شفافة. الافتراضي هو `true`.

+ +

الطرق (Methods)

+

انظر إلى الفئة الأساسية [page:Material] للطرق المشتركة.

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/Box2.html b/docs/api/ar/math/Box2.html new file mode 100644 index 00000000000000..e44280e0d36bb6 --- /dev/null +++ b/docs/api/ar/math/Box2.html @@ -0,0 +1,203 @@ + + + + + + + + + +

[name]

+ +

+ يمثل مربعًا محدودًا بمحاور (AABB) في الفضاء ثنائي الأبعاد. +

+ +

المنشئ (Constructor)

+ +

[name]( [param:Vector2 min], [param:Vector2 max] )

+

+ [page:Vector2 min] - (اختياري) [page:Vector2] يمثل الحد السفلي (x، y) للمربع. الافتراضي هو (+ Infinity، + Infinity).
+ + [page:Vector2 max] - (اختياري) [page:Vector2] يمثل الحد العلوي (x، y) للمربع. الافتراضي هو (- Infinity، - Infinity).

+ + ينشئ [name] محدودًا بواسطة min و max. +

+ +

الخصائص (Properties)

+ +

[property:Vector2 min]

+

+ [page:Vector2] يمثل الحد السفلي (x، y) للمربع.
+ الافتراضي هو (+ Infinity، + Infinity). +

+ +

[property:Vector2 max]

+

+ [page:Vector2] يمثل الحد العلوي (x، y) للمربع.
+ الافتراضي هو (- Infinity، - Infinity). +

+ +

الطرق (Methods)

+ +

+ [method:Vector2 clampPoint]( [param:Vector2 point], [param:Vector2 target] ) +

+

+ [page:Vector2 point] - [page:Vector2] للتثبيت.
+ [page:Vector2 target] — سيتم نسخ النتيجة في هذا Vector2.

+ + [link:https://en.wikipedia.org/wiki/Clamping_(graphics) يثبت] [page:Vector2 point] داخل حدود هذا المربع.
+

+ +

[method:Box2 clone]()

+

+ يعود بـ [page:Box2] جديد مع نفس [page:.min min] و [page:.max max] كهذا المربع. +

+ +

[method:Boolean containsBox]( [param:Box2 box] )

+

+ [page:Box2 box] - [page:Box2 Box2] للاختبار للتضمين.

+ + يعود بـ true إذا كان هذا المربع يشمل كامل [page:Box2 box]. إذا كان هذا و [page:Box2 box] متطابقان،
+ فإن هذه الوظيفة تعود أيضًا بـ true. +

+ +

[method:Boolean containsPoint]( [param:Vector2 point] )

+

+ [page:Vector2 point] - [page:Vector2] للاختبار للتضمين.

+ + يعود بـ true إذا كانت [page:Vector2 point] المحددة تقع داخل أو على حدود هذا المربع. +

+ +

[method:this copy]( [param:Box2 box] )

+

+ ينسخ [page:.min min] و [page:.max max] من [page:Box2 box] إلى هذا المربع. +

+ +

[method:Float distanceToPoint]( [param:Vector2 point] )

+

+ [page:Vector2 point] - [page:Vector2] لقياس المسافة إليها.

+ + يعود بالمسافة من أي حافة لهذا المربع إلى النقطة المحددة. إذا كانت [page:Vector2 point] داخل هذا المربع، فستكون المسافة 0. +

+ +

[method:Boolean equals]( [param:Box2 box] )

+

+ [page:Box2 box] - مربع للمقارنة مع هذا المربع.

+ + يعود بـ true إذا كان هذا المربع و [page:Box2 box] يشتركان في نفس الحدود السفلى والعليا. +

+ +

[method:this expandByPoint]( [param:Vector2 point] )

+

+ [page:Vector2 point] - [page:Vector2] التي يجب تضمينها في المربع.

+ + يوسع حدود هذا المربع لتضمين [page:Vector2 point]. +

+ +

[method:this expandByScalar]( [param:Float scalar] )

+

+ [page:Float scalar] - المسافة التي يتم توسيع المربع بها.

+ + يوسع كل بُعد من أبعاد المربع بواسطة [page:Float scalar]. إذا كانت سالبة، فستتقلص أبعاد المربع. +

+ +

[method:this expandByVector]( [param:Vector2 vector] )

+

+ [page:Vector2 vector] - [page:Vector2] لتوسيع المربع بها.

+ + يوسع هذا المربع بشكل متساوٍ بواسطة [page:Vector2 vector]. سيتم توسيع عرض هذا المربع بمكون x من [page:Vector2 vector] في كلا الاتجاهين. ستتم توسيع ارتفاع هذا المربع بمكون y من [page:Vector2 vector] في كلا الاتجاهين. +

+ +

[method:Vector2 getCenter] ([param:Vector2 target])

+

+ [page:Vector2 target] — سيتم نسخ النتيجة في هذا Vector2.

+ + يعود نقطة المركز للصندوق كـ [page:Vector2]. +

+ +

[method:Vector2 getParameter] ([param:Vector2 point], [param:Vector2 target])

+

+ [page:Vector2 point] - [page:Vector2].
+ [page:Vector2 target] — سيتم نسخ النتيجة في هذا Vector2.

+ + يعود نقطة كنسبة من عرض وارتفاع هذا الصندوق. +

+ +

[method:Vector2 getSize] ([param:Vector2 target])

+

+ [page:Vector2 target] — سيتم نسخ النتيجة في هذا Vector2.

+ + يعود عرض وارتفاع هذا الصندوق. +

+ +

[method:this intersect] ([param:Box2 box])

+

+ [page:Box2 box] - مربع للتقاطع معه.

+ + يعود تقاطع هذا و [page:Box2 box]، محددًا الحد الأعلى لهذا المربع إلى أقل من حدود المربعين الأعلى والحد الأدنى لهذا المربع إلى أكبر من حدود المربعين الأدنى. +

+ +

[method:Boolean intersectsBox] ([param:Box2 box])

+

+ [page:Box2 box] - مربع للتحقق من التقاطع ضده.

+ + يحدد ما إذا كان هذا المربع يتقاطع مع [page:Box2 box]. +

+ +

[method:Boolean isEmpty]()

+

+ يُرجَع صوابًا إذا كان هذا المربع يشمل صفر نقط داخل حدوده.
+ لاحظ أن المربع الذي يحتوي على حدود سفلى وعلوية متساوية لا يزال يشمل نقطة واحدة، وهي التي تشترك فيها كلا الحدود. +

+ +

[method:this makeEmpty]()

+

يجعل هذا المربع فارغًا.

+ + +

[method:this set]([param:Vector2 min], [param:Vector2 max])

+

+ [page:Vector2 min] - (مطلوب) [page:Vector2] يمثل الحد الأدنى (x، y) للمربع.
+ [page:Vector2 max] - (مطلوب) [page:Vector2] يمثل الحد الأعلى (x، y) للمربع.

+ + يضع الحدود العليا والسفلى (x، y) لهذا المربع.
+ يرجى ملاحظة أن هذه الطريقة تنسخ فقط القيم من الكائنات المعطاة. +

+ +

[method:this setFromCenterAndSize]([param:Vector2 center], [param:Vector2 size])

+

+ [page:Vector2 center] - الموضع المركزي المطلوب للمربع ([page:Vector2]).
+ [page:Vector2 size] - أبعاد x و y المطلوبة للمربع ([page:Vector2]).

+ + يضع هذا المربع في مركز [page:Vector2 center] ويضع عرض وارتفاع هذا المربع إلى القيم المحددة في [page:Vector2 size]. +

+ +

[method:this setFromPoints]([param:Array points])

+

+ [page:Array points] - مصفوفة من [page:Vector2 Vector2s] التي ستحتوي عليها المربعات الناتجة.

+ + يضع الحدود العليا والسفلى لهذا المربع لتشمل جميع النقاط في [page:Array points]. +

+ +

[method:this translate]([param:Vector2 offset])

+

+ [page:Vector2 offset] - اتجاه ومسافة التحويل.

+ + يضيف [page:Vector2 offset] إلى كلاً من الحدود العليا والسفلى لهذا المربع، مما يؤدي بشكل فعال إلى نقل هذا المربع [page:Vector2 offset] وحدات في مسافة 2D. +

+ +

[method:this union]([param:Box2 box])

+

+ [page:Box2 box] - مربع سيتم دمجه مع هذا المربع.

+ + يجمع هذا المربع مع [page:Box2 box]، حيث يضع الحد الأقصى لهذا المربع على أكبر حدود علوية للمربعين والحد الأدنى لهذا المربع على أقل حدود سفلى للمربعين. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/Box3.html b/docs/api/ar/math/Box3.html new file mode 100644 index 00000000000000..ba2368d3298a55 --- /dev/null +++ b/docs/api/ar/math/Box3.html @@ -0,0 +1,303 @@ + + + + + + + + + +

[name]

+ +

+ يمثل مربعًا محدودًا بمحاور (AABB) في الفضاء ثلاثي الأبعاد. +

+ +

مثال الكود

+ + + const box = new THREE.Box3(); + + const mesh = new THREE.Mesh( + new THREE.SphereGeometry(), + new THREE.MeshBasicMaterial() + ); + + // تأكد من حساب مربع التحديد لهندسته + // يجب القيام بذلك مرة واحدة فقط (باستخدام هندسات ثابتة) + mesh.geometry.computeBoundingBox(); + + // ... + + // في حلقة الرسوم المتحركة، احسب المربع الحالي مع المصفوفة العالمية + box.copy( mesh.geometry.boundingBox ).applyMatrix4( mesh.matrixWorld ); + + +

المنشئ (Constructor)

+ +

[name]( [param:Vector3 min], [param:Vector3 max] )

+

+ [page:Vector3 min] - (اختياري) [page:Vector3] يمثل الحد السفلي (x، y، z) للمربع. الافتراضي هو (+ Infinity، + Infinity، + Infinity).
+ + [page:Vector3 max] - (اختياري) [page:Vector3] يمثل الحد العلوي (x، y، z) للمربع. الافتراضي هو (- Infinity، - Infinity، - Infinity).

+ + ينشئ [name] محدودًا بواسطة min و max. +

+ +

الخصائص (Properties)

+ +

[property:Boolean isBox3]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معينًا من نوع [name].

+ +

[property:Vector3 min]

+

+ [page:Vector3] يمثل الحد السفلي (x، y، z) للمربع.
+ الافتراضي هو (+ Infinity، + Infinity، + Infinity). +

+ +

[property:Vector3 max]

+

+ [page:Vector3] يمثل الحد العلوي (x، y، z) للمربع.
+ الافتراضي هو (- Infinity، - Infinity، - Infinity). +

+ +

الطرق (Methods)

+ +

[method:this applyMatrix4]( [param:Matrix4 matrix] )

+

+ [page:Matrix4 matrix] - [page:Matrix4] للتطبيق

+ + يحول هذا Box3 مع المصفوفة الموردة. +

+ +

+ [method:Vector3 clampPoint]( [param:Vector3 point], [param:Vector3 target] ) +

+

+ [page:Vector3 point] - [page:Vector3] للتثبيت.
+ [page:Vector3 target] — سيتم نسخ النتيجة في هذا Vector3.

+ + [link:https://en.wikipedia.org/wiki/Clamping_(graphics) يثبت] [page:Vector3 point] داخل حدود هذا المربع.
+

+ +

[method:Box3 clone]()

+

+ يعود بـ [page:Box3] جديد مع نفس [page:.min min] و [page:.max max] كهذا المربع. +

+ +

[method:Boolean containsBox]( [param:Box3 box] )

+

+ [page:Box3 box] - [page:Box3 Box3] للاختبار للتضمين.

+ + يعود بـ true إذا كان هذا المربع يشمل كامل [page:Box3 box]. إذا كان هذا و [page:Box3 box] متطابقان،
+ فإن هذه الوظيفة تعود أيضًا بـ true. +

+ +

[method:Boolean containsPoint]( [param:Vector3 point] )

+

+ [page:Vector3 point] - [page:Vector3] للاختبار للتضمين.

+ + يعود بـ true إذا كانت [page:Vector3 point] المحددة تقع داخل أو على حدود هذا المربع. +

+ +

[method:this copy]( [param:Box3 box] )

+

+ [page:Box3 box] - [page:Box3] للنسخ.

+ + ينسخ [page:.min min] و [page:.max max] من [page:Box3 box] إلى هذا المربع. +

+ +

[method:Float distanceToPoint]( [param:Vector3 point] )

+

+ [page:Vector3 point] - [page:Vector3] لقياس المسافة إليها.

+ + يعود بالمسافة من أي حافة لهذا المربع إلى النقطة المحددة. إذا كانت [page:Vector3 point] داخل هذا المربع، فستكون المسافة 0. +

+ +

[method:Boolean equals]( [param:Box3 box] )

+

+ [page:Box3 box] - مربع للمقارنة مع هذا المربع.

+ + يعود بـ true إذا كان هذا المربع و [page:Box3 box] يشتركان في نفس الحدود السفلى والعليا. +

+ +

+ [method:this expandByObject]( [param:Object3D object], [param:Boolean precise] ) +

+

+ [page:Object3D object] - [page:Object3D] لتوسيع المربع به.
+ precise - (اختياري) توسيع مربع التحديد بأقل ما يمكن على حساب المزيد من الحسابات. الافتراضي هو false.

+ + يوسع حدود هذا المربع لتضمين [page:Object3D object] وأطفاله، مع مراعاة تحولات الكائن والأطفال العالمية. قد يؤدي التابع إلى مربع أكبر من اللازم بشكل صارم (ما لم يتم تحديد معلمة precise على true). +

+ +

[method:this expandByPoint]( [param:Vector3 point] )

+

+ [page:Vector3 point] - [page:Vector3] التي يجب تضمينها في المربع.

+ + يوسع حدود هذا المربع لتضمين [page:Vector3 point]. +

+ +

[method:this expandByScalar]( [param:Float scalar] )

+

+ [page:Float scalar] - المسافة التي يتم توسيع المربع بها.

+ + يوسع كل بُعد من أبعاد المربع بواسطة [page:Float scalar]. إذا كانت سالبة، فستتقلص أبعاد المربع. +

+ +

[method:this expandByVector]( [param:Vector3 vector] )

+

+ [page:Vector3 vector] - [page:Vector3] لتوسيع المربع به.

+ + يوسع هذا المربع بشكل متساوٍ بواسطة [page:Vector3 vector]. سيتم توسيع عرض هذا المربع بمكون x من [page:Vector3 vector] في كلا الاتجاهين. ستتم توسيع ارتفاع هذا المربع بمكون y من [page:Vector3 vector] في كلا الاتجاهين. ستتم توسيع عمق هذا المربع بمكون z من `vector` في كلا الاتجاهين. +

+ +

[method:Sphere getBoundingSphere]( [param:Sphere target] )

+

+ [page:Sphere target] — سيتم نسخ النتيجة في هذا الكرة.

+ + يحصل على [page:Sphere] يحد المربع. +

+ +

[method:Vector3 getCenter]( [param:Vector3 target] )

+

+ [page:Vector3 target] — سيتم نسخ النتيجة في هذا Vector3.

+ + يعود بنقطة المركز للمربع كـ [page:Vector3]. +

+ +

+ [method:Vector3 getParameter]( [param:Vector3 point], [param:Vector3 target] ) +

+

+ [page:Vector3 point] - [page:Vector3].
+ [page:Vector3 target] — سيتم نسخ النتيجة في هذا Vector3.

+ + يعود بنقطة كنسبة من عرض وارتفاع وعمق هذا المربع. +

+ +

[method:Vector3 getSize]( [param:Vector3 target] )

+

+ [page:Vector3 target] — سيتم نسخ النتيجة في هذا Vector3.

+ + يعود بعرض وارتفاع وعمق هذا المربع. +

+ +

[method:this intersect]( [param:Box3 box] )

+

+ [page:Box3 box] - مربع للتقاطع معه.

+ + يحسب تقاطع هذا و [page:Box3 box]، وضع الحد الأقصى لهذا المربع على أقل حدود علوية للمربعين والحد الأدنى لهذا المربع على أكبر حدود سفلى للمربعين. إذا لم يكن هناك تداخل، يجعل هذا المربع فارغًا. +

+ +

[method:Boolean intersectsBox]( [param:Box3 box] )

+

+ [page:Box3 box] - مربع للتحقق من التقاطع ضده.

+ + يحدد ما إذا كان هذا المربع يتقاطع مع [page:Box3 box] أم لا. +

+ +

[method:Boolean intersectsPlane]( [param:Plane plane] )

+

+ [page:Plane plane] - [page:Plane] للتحقق من التقاطع ضده.

+ + يحدد ما إذا كان هذا المربع يتقاطع مع [page:Plane plane] أم لا. +

+ +

[method:Boolean intersectsSphere]( [param:Sphere sphere] )

+

+ [page:Sphere sphere] - [page:Sphere] للتحقق من التقاطع ضده.

+ + يحدد ما إذا كان هذا المربع يتقاطع مع [page:Sphere sphere] أم لا. +

+ +

[method:Boolean intersectsTriangle]( [param:Triangle triangle] )

+

+ [page:Triangle triangle] - [page:Triangle] للتحقق من التقاطع ضده.

+ + يحدد ما إذا كان هذا المربع يتقاطع مع [page:Triangle triangle] أم لا. +

+ +

[method:Boolean isEmpty]()

+

+ يعود بـ true إذا كان هذا المربع يشمل صفر نقطة داخل حدوده.
+ يرجى ملاحظة أن المربع الذي يحتوي على حدود سفلى وعلوية متساوية لا يزال يشمل نقطة واحدة، وهي النقطة التي تشترك فيها كلا الحدود. +

+ +

[method:this makeEmpty]()

+

يجعل هذا المربع فارغًا.

+ +

[method:this set]( [param:Vector3 min], [param:Vector3 max] )

+

+ [page:Vector3 min] - [page:Vector3] يمثل الحد السفلي (x، y، z) للمربع.
+ [page:Vector3 max] - [page:Vector3] يمثل الحد العلوي (x، y، z) للمربع.

+ + يضع الحدود السفلى والعلوية (x، y، z) لهذا المربع.
+ يرجى ملاحظة أن هذه الطريقة تنسخ فقط القيم من الكائنات المحددة. +

+ +

[method:this setFromArray]( [param:Array array] )

+

+ array -- مجموعة من بيانات الموضع التي سيغلفها المربع الناتج.

+ + يضع الحدود العلوية والسفلى لهذا المربع لتشمل كل البيانات في `array`. +

+ +

+ [method:this setFromBufferAttribute]( [param:BufferAttribute attribute] ) +

+

+ [page:BufferAttribute attribute] - سمة مخزنة لبيانات الموضع التي سيغلفها المربع الناتج.

+ + يضع الحدود العلوية والسفلى لهذا المربع لتشمل كل البيانات في [page:BufferAttribute attribute]. +

+ +

+ [method:this setFromCenterAndSize]( [param:Vector3 center], [param:Vector3 size] ) +

+

+ [page:Vector3 center], - الموضع المركزي المطلوب للمربع.
+ [page:Vector3 size] - الأبعاد المطلوبة x و y و z للمربع.

+ + يضع هذا المربع في مركز [page:Vector3 center] ويضع عرض وارتفاع وعمق هذا المربع على القيم المحددة
+ في [page:Vector3 size] +

+ +

+ [method:this setFromObject]( [param:Object3D object], [param:Boolean precise] ) +

+

+ [page:Object3D object] - [page:Object3D] لحساب مربع التحديد الخاص به.
+ precise - (اختياري) حساب أصغر مربع تحديد محدود بمحاور العالم على حساب المزيد من الحسابات. الافتراضي هو false.

+ + يحسب مربع التحديد المحدود بمحاور العالم لـ [page:Object3D] (بما في ذلك أطفاله)، مع مراعاة تحولات الكائن والأطفال العالمية. قد يؤدي التابع إلى مربع أكبر من اللازم بشكل صارم. +

+ +

[method:this setFromPoints]( [param:Array points] )

+

+ [page:Array points] - مجموعة من [page:Vector3 Vector3s] التي سيحتوي عليها المربع الناتج.

+ + يضع الحدود العلوية والسفلى لهذا المربع لتشمل كل النقاط في [page:Array points]. +

+ +

[method:this translate]( [param:Vector3 offset] )

+

+ [page:Vector3 offset] - اتجاه ومسافة التحويل.

+ + يضيف [page:Vector3 offset] إلى كلا من الحدود العلوية والسفلى لهذا المربع، بشكل فعال ينقل هذا المربع [page:Vector3 offset] وحدات في الفضاء ثلاثي الأبعاد. +

+ +

[method:this union]( [param:Box3 box] )

+

+ [page:Box3 box] - مربع سيتم دمجه مع هذا المربع.

+ + يحسب اتحاد هذا المربع و [page:Box3 box]، وضع الحد الأقصى لهذا المربع على أكبر حدود علوية للمربعين والحد الأدنى لهذا المربع على أقل حدود سفلى للمربعين. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/Color.html b/docs/api/ar/math/Color.html new file mode 100644 index 00000000000000..42a3c89fa17429 --- /dev/null +++ b/docs/api/ar/math/Color.html @@ -0,0 +1,364 @@ + + + + + + + + + +

[name]

+ +

فئة تمثل لونًا.

+ +

+ التكرار عبر مثيل [name] سيعود بمكوناته (r، g، b) بالترتيب المقابل. +

+ +

أمثلة الكود

+ +

يمكن تهيئة Color بأي من الطرق التالية:

+ + // المُنشئ الفارغ - سيكون الافتراضي أبيض + const color1 = new THREE.Color(); + + // لون سداسي عشري (مستحسن) + const color2 = new THREE.Color( 0xff0000 ); + + // سلسلة RGB + const color3 = new THREE.Color("rgb(255، 0، 0)"); + const color4 = new THREE.Color("rgb(100٪، 0٪، 0٪)"); + + // اسم لون X11 - يتم دعم جميع أسماء الألوان الـ 140. + // يرجى ملاحظة عدم وجود CamelCase في الاسم + const color5 = new THREE.Color( 'skyblue' ); + + // سلسلة HSL + const color6 = new THREE.Color("hsl(0، 100٪، 50٪)"); + + // قيم RGB منفصلة بين 0 و 1 + const color7 = new THREE.Color( 1، 0، 0 ); + + +

المنشئ (Constructor)

+ +

+ [name]( [param:Color_Hex_or_String r]، [param:Float g]، [param:Float b] ) +

+

+ [page:Color_Hex_or_String r] - (اختياري) إذا تم تعريف الوسيطتين [page:Float g] و [page:Float b]، فهو مكون أحمر للون. إذا لم يتم تعريفهما، فيمكن أن يكون [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet ثلاثيًا سداسيًا عشريًا] (مستحسن)، أو سلسلة على طراز CSS، أو مثيل `Color` آخر.
+ [page:Float g] - (اختياري) إذا تم تعريفه، فهو مكون أخضر للون.
+ [page:Float b] - (اختياري) إذا تم تعريفه، فهو مكون أزرق للون.

+ + يرجى ملاحظة أن الطريقة القياسية لتحديد اللون في three.js هي باستخدام [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet ثلاثية سداسية عشرية]، وتستخدم هذه الطريقة في جميع أنحاء المستندات المتبقية.

+ + عند تعريف جميع المعاملات ثم [page:Color_Hex_or_String r] هو المكوِّن الأحمر و [page:Float g] هو المكوِّن الأخضر و [page:Float b] هو المكوِّن الأزرق للون.
+ عند تعريف [page:Color_Hex_or_String r] فقط:
+

+ +
    +
  • + يمكن أن يكون [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet ثلاثيًا سداسيًا عشريًا] يمثل اللون (مستحسن). +
  • +
  • يمكن أن يكون مثيل Color آخر.
  • +
  • + يمكن أن يكون سلسلة على طراز CSS. على سبيل المثال: +
      +
    • 'rgb(250، 0،0)'
    • +
    • 'rgb(100٪،0٪،0٪)'
    • +
    • 'hsl(0، 100٪، 50٪)'
    • +
    • '#ff0000'
    • +
    • '#f00'
    • +
    • 'red'
    • +
    +
  • +
+ +

الخصائص (Properties)

+ +

[property:Boolean isColor]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معينًا من نوع [name].

+ +

[property:Float r]

+

قيمة قناة حمراء بين 0 و 1. الافتراضي هو 1.

+ +

[property:Float g]

+

قيمة قناة خضراء بين 0 و 1. الافتراضي هو 1.

+ +

[property:Float b]

+

قيمة قناة زرقاء بين 0 و 1. الافتراضي هو 1.

+ +

الطرق (Methods)

+ +

[method:this add]( [param:Color color] )

+

+ يضيف قيم RGB لـ [page:Color color] إلى قيم RGB لهذا اللون. +

+ +

+ [method:this addColors]( [param:Color color1], [param:Color color2] ) +

+

+ يضع قيم RGB لهذا اللون على مجموع قيم RGB لـ [page:Color color1] و [page:Color color2]. +

+ +

[method:this addScalar]( [param:Number s] )

+

يضيف [page:Number s] إلى قيم RGB لهذا اللون.

+ +

[method:this applyMatrix3]( [param:Matrix3 m] )

+

+ يطبق التحول [page:Matrix3 m] على مكونات RGB لهذا اللون. +

+ +

[method:Color clone]()

+

+ يعود بـ Color جديد مع نفس قيم [page:.r r] و [page:.g g] و [page:.b b] كهذا المربع. +

+ +

[method:this copy]( [param:Color color] )

+

+ ينسخ معاملات [page:.r r] و [page:.g g] و [page:.b b] من [page:Color color] في هذا اللون. +

+ +

[method:this convertLinearToSRGB]()

+

يحول هذا اللون من مساحة خطية إلى مساحة sRGB.

+ +

[method:this convertSRGBToLinear]()

+

يحول هذا اللون من مساحة sRGB إلى مساحة خطية.

+ +

[method:this copyLinearToSRGB]( [param:Color color] )

+

+ [page:Color color] — لون للنسخ.
+ + ينسخ اللون المعطى في هذا اللون، ثم يحول هذا اللون من مساحة خطية إلى مساحة sRGB. +

+ + +

[method:this copySRGBToLinear]( [param:Color color] )

+

+ [page:Color color] — لون للنسخ.
+ + ينسخ اللون المعطى في هذا اللون، ثم يحول هذا اللون من مساحة sRGB إلى مساحة خطية. +

+ +

[method:Boolean equals]( [param:Color color] )

+

+ يقارن قيم RGB لـ [page:Color color] مع تلك الموجودة في هذا الكائن. يعود بـ true إذا كانت متطابقة، و false في حالة عدم التطابق. +

+ +

+ [method:this fromArray]( [param:Array array], [param:Integer offset] ) +

+

+ [page:Array array] - [page:Array] من الأرقام العشرية على شكل [[page:Float r]، [page:Float g]، [page:Float b]].
+ [page:Integer offset] - إزاحة اختيارية في المجموعة.

+ + يضع مكونات هذا اللون بناءً على مجموعة مهيأة مثل [[page:Float r]، [page:Float g]، [page:Float b]]. +

+ +

+ [method:this fromBufferAttribute]( [param:BufferAttribute attribute], [param:Integer index] ) +

+

+ [page:BufferAttribute attribute] - السمة المصدر.
+ [page:Integer index] - فهرس في السمة.

+ + يضع مكونات هذا اللون من [page:BufferAttribute attribute]. +

+ +

+ [method:Integer getHex]( [param:string colorSpace] = SRGBColorSpace ) +

+

يعود بالقيمة السداسية عشرية لهذا اللون.

+ +

+ [method:String getHexString]( [param:string colorSpace] = SRGBColorSpace ) +

+

+ يعود بالقيمة السداسية عشرية لهذا اللون كسلسلة (على سبيل المثال، 'FFFFFF'). +

+ +

+ [method:Object getHSL]( [param:Object target], [param:string colorSpace] = LinearSRGBColorSpace ) +

+

+ [page:Object target] — سيتم نسخ النتيجة في هذا الكائن. يضيف مفاتيح h و s و l إلى الكائن (إذا لم يكن موجودًا بالفعل).

+ + يحول قيم [page:.r r] و [page:.g g] و [page:.b b] لهذا اللون إلى تنسيق [link:https://en.wikipedia.org/wiki/HSL_and_HSV HSL] ويعود بكائن على الشكل: + + + { + h: 0, + s: 0, + l: 0 + } + +

+ +

+ [method:Color getRGB]( [param:Color target], [param:string colorSpace] = LinearSRGBColorSpace ) +

+

+ [page:Color target] — سيتم نسخ النتيجة في هذا الكائن.

+ + يعود بقيم RGB لهذا اللون كمثيل من [page:Color]. +

+ +

+ [method:String getStyle]( [param:string colorSpace] = SRGBColorSpace ) +

+

+ يعود بقيمة هذا اللون كسلسلة على طراز CSS. مثال: `rgb(255،0،0)`. +

+ +

[method:this lerp]( [param:Color color], [param:Float alpha] )

+

+ [page:Color color] - لون للاقتراب منه.
+ [page:Float alpha] - عامل التداخل في الفاصل المغلق `[0، 1]`.

+ + يتداخل بشكل خطي قيم RGB لهذا اللون نحو قيم RGB للحجة الممررة. يمكن التفكير في وسيطة alpha كالنسبة بين اللونين، حيث `0.0` هذا اللون و `1.0` هو الحجة الأولى. +

+ + +

+ [method:this lerpColors]( [param:Color color1], [param:Color color2], [param:Float alpha] ) +

+

+ [page:Color color1] - اللون الابتدائي [page:Color].
+ [page:Color color2] - [page:Color] للتداخل نحوه.
+ [page:Float alpha] - عامل التداخل، عادة في الفاصل المغلق `[0، 1]`.

+ + يضع هذا اللون ليكون اللون المتداخل بشكل خطي بين [page:Color color1] و [page:Color color2] حيث يكون alpha هو نسبة المسافة على الخط الذي يربط بين اللونين - سيكون alpha = 0 [page:Color color1]، وسيكون alpha = 1 [page:Color color2]. +

+ +

[method:this lerpHSL]( [param:Color color], [param:Float alpha] )

+

+ [page:Color color] - لون للاقتراب منه.
+ [page:Float alpha] - عامل التداخل في الفاصل المغلق `[0، 1]`.

+ + يتداخل بشكل خطي قيم HSL لهذا اللون نحو قيم HSL للحجة الممررة. يختلف عن [page:.lerp] الكلاسيكية بعدم التداخل مباشرة من لون إلى آخر، ولكن بدلاً من ذلك يمر عبر جميع الألوان الموجودة بين تلك الألوان. يمكن التفكير في وسيطة alpha كالنسبة بين اللونين، حيث 0.0 هذا اللون و 1.0 هو الحجة الأولى. +

+ +

[method:this multiply]( [param:Color color] )

+

+ يضرب قيم RGB لهذا اللون بقيم RGB لـ [page:Color color] المعطى. +

+ +

[method:this multiplyScalar]( [param:Number s] )

+

يضرب قيم RGB لهذا اللون بـ [page:Number s].

+ +

+ [method:this offsetHSL]( [param:Float h], [param:Float s], [param:Float l] ) +

+

+ يضيف [page:Float h] و [page:Float s] و [page:Float l] المعطى إلى قيم هذا اللون. داخليًا، يحول هذا اللون قيم [page:.r r] و [page:.g g] و [page:.b b] إلى HSL، يضيف [page:Float h] و [page:Float s] و [page:Float l]، ثم يحول اللون مرة أخرى إلى RGB. +

+ +

[method:this set]( [param:Color_Hex_or_String r], [param:Float g], [param:Float b] )

+

+ [page:Color_Hex_or_String r] - (اختياري) إذا تم تعريف الوسيطتين [page:Float g] و [page:Float b]، فهو مكون أحمر للون. إذا لم يتم تعريفهما، فيمكن أن يكون [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet ثلاثيًا سداسيًا عشريًا] (مستحسن)، أو سلسلة على طراز CSS، أو مثيل `Color` آخر.
+ [page:Float g] - (اختياري) إذا تم تعريفه، فهو مكون أخضر للون.
+ [page:Float b] - (اختياري) إذا تم تعريفه، فهو مكون أزرق للون.

+ + انظر المُنشئ أعلاه للحصول على التفاصيل الكاملة حول الوسائط الممكنة. يفوض إلى [page:.copy]، + [page:.setStyle]، [page:.setRGB] أو [page:.setHex] اعتمادًا على نوع الإدخال. +

+ +

[method:this setFromVector3]( [param:Vector3 vector] )

+

+ يضع مكونات [page:.r r] و [page:.g g] و [page:.b b] لهذا اللون من مكونات x و y و z لـ [page:Vector3 vector] المحدد. +

+ +

+ [method:this setHex]( [param:Integer hex], [param:string colorSpace] = SRGBColorSpace ) +

+

+ [page:Integer hex] — + [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet شكل ثلاثي سداسي عشر].

+ + يضع هذا اللون من قيمة سداسية عشرية. +

+ +

+ [method:this setHSL]( [param:Float h], [param:Float s], [param:Float l], [param:string colorSpace] = LinearSRGBColorSpace ) +

+

+ [page:Float h] — قيمة اللون بين 0.0 و 1.0
+ [page:Float s] — قيمة التشبع بين 0.0 و 1.0
+ [page:Float l] — قيمة الإضاءة بين 0.0 و 1.0

+ + يضع اللون من قيم HSL. +

+ +

+ [method:this setRGB]( [param:Float r], [param:Float g], [param:Float b], [param:string colorSpace] = LinearSRGBColorSpace ) +

+

+ [page:Float r] — قيمة قناة حمراء بين 0.0 و 1.0.
+ [page:Float g] — قيمة قناة خضراء بين 0.0 و 1.0.
+ [page:Float b] — قيمة قناة زرقاء بين 0.0 و 1.0.

+ + يضع هذا اللون من قيم RGB. +

+ +

[method:this setScalar]( [param:Float scalar] )

+

+ [page:Float scalar] — قيمة بين 0.0 و 1.0.

+ + تضع جميع مكونات اللون الثلاثة على قيمة [page:Float scalar]. +

+ +

+ [method:this setStyle]( [param:String style], [param:string colorSpace] = SRGBColorSpace ) +

+

+ [page:String style] — اللون كسلسلة على طراز CSS.

+ + يضع هذا اللون من سلسلة على طراز CSS. على سبيل المثال، "rgb(250، 0،0)"، "rgb(100٪، 0٪، 0٪)"، "hsl(0، 100٪، 50٪)"، "#ff0000"، "#f00" أو "red" (أو أي [link:https://en.wikipedia.org/wiki/X11_color_names#Color_name_chart اسم لون X11] - يتم دعم جميع أسماء الألوان الـ 140).
+ + يتم قبول الألوان شفافة مثل "rgba(255، 0، 0، 0.5)" و "hsla(0، 100٪، 50٪، 0.5)" أيضًا، ولكن سيتم تجاهل إحداثية قناة ألفا.

+ + يرجى ملاحظة أنه بالنسبة لأسماء الألوان X11، تصبح الكلمات المتعددة مثل Dark Orange السلسلة 'darkorange'. +

+ +

+ [method:this setColorName]( [param:String style], [param:string colorSpace] = SRGBColorSpace ) +

+

+ [page:String style] — اسم اللون (من [link:https://en.wikipedia.org/wiki/X11_color_names#Color_name_chart أسماء الألوان X11]).

+ + يضع هذا اللون من اسم لون. أسرع من طريقة [page:.setStyle] إذا كنت لا تحتاج إلى التنسيقات الأخرى على طراز CSS.

+ + للراحة، يتم عرض قائمة الأسماء في Color.NAMES كتجزئة: + + Color.NAMES.aliceblue // returns 0xF0F8FF + +

+ +

[method:this sub]( [param:Color color] )

+

+ يطرح مكونات RGB للون المحدد من مكونات RGB لهذا اللون. إذا نتج عن ذلك مكون سالب، يتم تعيين هذا المكون إلى صفر. +

+ +

+ [method:Array toArray]( [param:Array array], [param:Integer offset] ) +

+

+ [page:Array array] - مجموعة اختيارية لتخزين اللون فيها.
+ [page:Integer offset] - إزاحة اختيارية في المجموعة.

+ + يعود بمجموعة على شكل [r, g, b]. +

+ +

[method:Number toJSON]()

+

+ هذه الطرق تحدد نتيجة التسلسل لـ [name]. يعود باللون كقيمة سداسية عشرية. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/Cylindrical.html b/docs/api/ar/math/Cylindrical.html new file mode 100644 index 00000000000000..d7a017d87b0b03 --- /dev/null +++ b/docs/api/ar/math/Cylindrical.html @@ -0,0 +1,77 @@ + + + + + + + + + +

[name]

+ +

+ نقطة + [link:https://en.wikipedia.org/wiki/Cylindrical_coordinate_system الإحداثيات الاسطوانية]. +

+ +

المنشئ (Constructor)

+ +

+ [name]( [param:Float radius], [param:Float theta], [param:Float y] ) +

+

+ [page:Float radius] - المسافة من المبدأ إلى نقطة في المستوى x-z. الافتراضي هو `1.0`.
+ [page:Float theta] - الزاوية عكس عقارب الساعة في المستوى x-z مقاسة بالراديان من المحور z الموجب. الافتراضي هو `0`.
+ [page:Float y] - الارتفاع فوق المستوى x-z. الافتراضي هو `0`. +

+ +

الخصائص (Properties)

+ +

[property:Float radius]

+ +

[property:Float theta]

+ +

[property:Float y]

+ +

الطرق (Methods)

+ +

[method:Cylindrical clone]()

+

+ يعيد اسطواني جديد بنفس خصائص [page:.radius radius], + [page:.theta theta] و [page:.y y] كهذا. +

+ +

[method:this copy]( [param:Cylindrical other] )

+

+ ينسخ قيم خصائص [page:.radius radius], + [page:.theta theta] و [page:.y y] للإسطواني الممرر إلى هذا الإسطواني. +

+ +

+ [method:this set]( [param:Float radius], [param:Float theta], [param:Float y] ) +

+

+ يضبط قيم خصائص هذا الإسطواني [page:.radius radius], [page:.theta theta] و [page:.y y]. +

+ +

[method:this setFromVector3]( [param:Vector3 vec3] )

+

+ يضبط قيم خصائص هذا الإسطواني [page:.radius radius], [page:.theta theta] + و [page:.y y] من الـ[page:Vector3 Vector3]. +

+ +

+ [method:this setFromCartesianCoords]( [param:Float x], [param:Float y], [param:Float z] ) +

+

+ يضبط قيم خصائص هذا الإسطواني [page:.radius radius], [page:.theta theta] و + [page:.y y] من الإحداثيات الديكارتية. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/Euler.html b/docs/api/ar/math/Euler.html new file mode 100644 index 00000000000000..f1078b82115356 --- /dev/null +++ b/docs/api/ar/math/Euler.html @@ -0,0 +1,175 @@ + + + + + + + + + +

[name]

+ +

+ فئة تمثل [link:http://en.wikipedia.org/wiki/Euler_angles زوايا أويلر].

+ + تصف زوايا أويلر التحول الدوار بتدوير كائن على + محاوره المختلفة بمقادير محددة لكل محور، وترتيب محور محدد. +

+ +

+ التكرار عبر نسخة [name] سيعود بمكوناته (x، y، z، + order) في الترتيب المقابل. +

+ +

مثال الكود

+ + + const a = new THREE.Euler( 0, 1, 1.57, 'XYZ' ); + const b = new THREE.Vector3( 1, 0, 1 ); + b.applyEuler(a); + + +

المنشئ (Constructor)

+ +

+ [name]( [param:Float x], [param:Float y], [param:Float z], [param:String order] ) +

+

+ [page:Float x] - (اختياري) زاوية المحور x بالراديان. الافتراضي هو + `0`.
+ [page:Float y] - (اختياري) زاوية المحور y بالراديان. الافتراضي هو + `0`.
+ [page:Float z] - (اختياري) زاوية المحور z بالراديان. الافتراضي هو + `0`.
+ [page:String order] - (اختياري) سلسلة تمثل الترتيب الذى يتم فيه تطبیق + التدویرات، الافتراضی هو 'XYZ' (یجب أن تكون بحروف كبیرة).

+

+ +

الخصائص (Properties)

+ +

[property:Boolean isEuler]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معطىً من نوع [name].

+ +

[property:String order]

+

+ الترتيب الذي يتم فيه تطبيق التدويرات. الافتراضي هو 'XYZ'، مما يعني أن + الكائن سيتم تدويره أولاً حول محور X الخاص به، ثم محور Y الخاص به وأخيرًا + محور Z الخاص به. الإمكانيات الأخرى هي: 'YZX'، 'ZXY'، 'XZY'، 'YXZ' + و'ZYX'. يجب أن تكون هذه بحروف كبيرة.

+ + يستخدم Three.js زوايا Tait-Bryan `intrinsic`. هذا يعني أن التدويرات + يتم تنفيذها بالنسبة إلى نظام الإحداثيات `local`. أي للترتيب 'XYZ'، يتم + التدوير أولاً حول محور local-X (وهو نفسه محور world-X)، ثم حول local-Y + (الذي قد يكون الآن مختلفًا عن محور world Y)، ثم local-Z (الذي قد يكون + مختلفًا عن محور world Z).

+

+ +

[property:Float x]

+

القيمة الحالية للمكون x.

+ +

[property:Float y]

+

القيمة الحالية للمكون y.

+ +

[property:Float z]

+

القيمة الحالية للمكون z.

+ +

الطرق (Methods)

+ +

[method:this copy]( [param:Euler euler] )

+

ينسخ قيمة [page:Euler euler] إلى هذه الزاوية الأويلر.

+ +

[method:Euler clone]()

+

يعود إلى أويلر جديد بنفس المعلمات كهذا.

+ +

[method:Boolean equals]( [param:Euler euler] )

+

يتحقق من المساواة الصارمة لهذه الزاوية الأويلر و[page:Euler euler].

+ +

[method:this fromArray]( [param:Array array] )

+

+ [page:Array array] من طول 3 أو 4. يتوافق السجل 4 اختياريًا + إلى [page:.order order].

+ + يعيّن زاوية [page:.x x] لهذه الزاوية الأويلر إلى `array[0]`.
+ يعيّن زاوية [page:.y y] لهذه الزاوية الأويلر إلى `array[1]`.
+ يعيّن زاوية [page:.z z] لهذه الزاوية الأويلر إلى `array[2]`.
+ اختیاریًا یعین ترتیب هذه الزاویة الأویلر [page:.order order] إلى `array[3]`. +

+ +

[method:this reorder]( [param:String newOrder] )

+

+ يعيد تعيين زاوية الأويلر بترتيب جديد عن طريق إنشاء رباعية من هذه + زاوية الأويلر ثم تعيين هذه الزاوية الأويلر مع الرباعية والترتيب + الجديد.

+ + *تحذير*: هذا يتجاهل معلومات الثورة. +

+ +

+ [method:this set]( [param:Float x], [param:Float y], [param:Float z], [param:String order] ) +

+

+ [page:.x x] - زاوية المحور x بالراديان.
+ [page:.y y] - زاوية المحور y بالراديان.
+ [page:.z z] - زاوية المحور z بالراديان.
+ [page:.order order] - (اختياري) سلسلة تمثل الترتيب الذي يتم فيه تطبيق + التدويرات.

+ + يضبط زوايا هذا التحول الأويلر واختياريًا الترتيب [page:.order order]. +

+ +

+ [method:this setFromRotationMatrix]( [param:Matrix4 m], [param:String order] ) +

+

+ [page:Matrix4 m] - a [page:Matrix4] منها 3x3 العلوية من المصفوفة هي + مصفوفة دوران نقية + (أي غير مقاسة).
+ [page:.order order] - (اختياري) سلسلة تمثل الترتيب الذي يتم فيه تطبيق + التدويرات.
+ + يضبط زوايا هذا التحول الأويلر من مصفوفة دوران نقية بناءً على + التوجه المحدد بالترتيب. +

+ +

+ [method:this setFromQuaternion]( [param:Quaternion q], [param:String order] ) +

+

+ [page:Quaternion q] - رباعية معدلة.
+ [page:.order order] - (اختياري) سلسلة تمثل الترتيب الذى يتم فيه تطبیق + التدويرات.
+ + يضبط زوايا هذا التحول الأويلر من رباعية معدلة بناءً على + التوجه المحدد بـ[page:.order order]. +

+ +

+ [method:this setFromVector3]( [param:Vector3 vector], [param:String order] ) +

+

+ [page:Vector3 vector] - [page:Vector3].
+ [page:.order order] - (اختیاری) سلسلة تمثل الترتیب الذى يتم فيه تطبیق + التدویرات.

+ + قم بضبط [page:.x x], [page:.y y] و[page:.z z]، وقم اختیاریًا بتحديث + الترتیب[page:.order order]. +

+ +

+ [method:Array toArray]( [param:Array array], [param:Integer offset] ) +

+

+ [page:Array array] - (optional) array to store the euler in.
+ [page:Integer offset] (optional) offset in the array.
+ + يعود إلى مصفوفة من شكل [[page:.x x], [page:.y y], [page:.z z], + [page:.order order ]]. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/Frustum.html b/docs/api/ar/math/Frustum.html new file mode 100644 index 00000000000000..be360ad35f27c1 --- /dev/null +++ b/docs/api/ar/math/Frustum.html @@ -0,0 +1,111 @@ + + + + + + + + + +

[name]

+ +

+ يتم استخدام [link:http://en.wikipedia.org/wiki/Frustum الهرم] لتحديد + ما هو داخل مجال رؤية الكاميرا. يساعدون في تسريع عملية التصيير - يمكن استبعاد + الكائنات التي تقع خارج هرم الكاميرا بأمان من التصيير.

+ + هذه الفئة مخصصة بشكل رئيسي للاستخدام داخليًا من قبل محرك التصيير لحساب + هرم [page:Camera camera] أو [page:LightShadow.camera shadowCamera]. +

+ +

المنشئ (Constructor)

+ +

+ [name]([param:Plane p0], [param:Plane p1], [param:Plane p2], [param:Plane p3], [param:Plane p4], [param:Plane p5]) +

+

+ [page:Plane p0] - (اختياري) الافتراضي هو [page:Plane] جديد.
+ [page:Plane p1] - (اختياري) الافتراضي هو [page:Plane] جديد.
+ [page:Plane p2] - (اختياري) الافتراضي هو [page:Plane] جديد.
+ [page:Plane p3] - (اختياري) الافتراضي هو [page:Plane] جديد.
+ [page:Plane p4] - (اختياري) الافتراضي هو [page:Plane] جديد.
+ [page:Plane p5] - (اختياري) الافتراضي هو [page:Plane] جديد.

+ + ينشئ [name] جديد. +

+ +

الخصائص (Properties)

+ +

[property:Array planes]

+

مصفوفة من 6 مستويات [page:Plane].

+ +

الطرق (Methods)

+ +

[method:Frustum clone]()

+

أعد هرمًا جديدًا بنفس المعلمات كهذا.

+ +

[method:Boolean containsPoint]( [param:Vector3 point] )

+

+ [page:Vector3 point] - [page:Vector3] للاختبار.

+ + يتحقق مما إذا كان الهرم يحتوي على نقطة[page:Vector3]. +

+ +

[method:this copy]( [param:Frustum frustum] )

+

+ [page:Frustum frustum] - الهرم الذي يتم نسخه

+ + ينسخ خصائص [page:Frustum frustum] الممررة إلى هذا. +

+ +

[method:Boolean intersectsBox]( [param:Box3 box] )

+

+ [page:Box3 box] - [page:Box3] للتحقق من التقاطع.

+ + يعود بـtrue إذا كان [page:Box3 box] يتقاطع مع هذا الهرم. +

+ +

[method:Boolean intersectsObject]( [param:Object3D object] )

+

+ يتحقق مما إذا كانت [page:Object3D object] + [page:BufferGeometry.boundingSphere bounding sphere] تتقاطع مع + الهرم.

+ + لاحظ أن الكائن يجب أن يحتوي على [page:BufferGeometry geometry] حتى + يمكن حساب الكرة المحيطة. +

+ +

[method:Boolean intersectsSphere]( [param:Sphere sphere] )

+

+ [page:Sphere sphere] - [page:Sphere] للتحقق من التقاطع.

+ + يعود بـtrue إذا كان [page:Sphere sphere] يتقاطع مع هذا الهرم. +

+ +

[method:Boolean intersectsSprite]( [param:Sprite sprite] )

+

+ يتحقق مما إذا كان [page:Sprite sprite] يتقاطع مع الهرم.

+

+ +

+ [method:this set]( [param:Plane p0], [param:Plane p1], [param:Plane p2], [param:Plane p3], [param:Plane p4], [param:Plane p5] ) +

+

+ يضبط الهرم من المستويات الممررة. لا يوجد ترتيب مستوى ضمني.
+ لاحظ أن هذه الطريقة تنسخ فقط القيم من الكائنات المعطاة. +

+ +

[method:this setFromProjectionMatrix]( [param:Matrix4 matrix] )

+

+ [page:Matrix4 matrix] - Projection [page:Matrix4] used to set the + [page:.planes planes]

+ يضبط مستويات الهرم من مصفوفة الإسقاط. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/Interpolant.html b/docs/api/ar/math/Interpolant.html new file mode 100644 index 00000000000000..6219b78af3154d --- /dev/null +++ b/docs/api/ar/math/Interpolant.html @@ -0,0 +1,68 @@ + + + + + + + + + +

[name]

+ +

+ الفئة الأساسية المجردة للمتداخلات على العينات المعلمية.

+ + مجال المعلمة هو أحادي البعد، عادةً الوقت أو مسار على طول منحنى + محدد بالبيانات.

+ + يمكن أن تكون قيم العينات ذات أبعاد مختلفة وقد تطبق الفئات المشتقة + تفسيرات خاصة للبيانات.

+ + توفر هذه الفئة البحث عن الفاصل في طريقة قالب، مؤجلًا التداخل الفعلي + إلى الفئات المشتقة.

+ + تعقيد الوقت هو `O(1)` للوصول الخطي المتقاطع في نقطتين على الأكثر + و`O(log N)` للوصول العشوائي، حيث *N* هو عدد المواضع.

+ + المراجع: [link:http://www.oodesign.com/template-method-pattern.html http://www.oodesign.com/template-method-pattern.html] +

+ +

المنشئ (Constructor)

+ +

+ [name]( parameterPositions, sampleValues, sampleSize, resultBuffer ) +

+

+ parameterPositions -- مصفوفة من المواضع
+ sampleValues -- مصفوفة من العينات
+ sampleSize -- عدد العينات
+ resultBuffer -- مخزن لتخزين نتائج التداخل.

+ + ملاحظة: هذا غير مصمم ليتم استدعاؤه مباشرة. +

+ +

الخصائص (Properties)

+ +

[property:null parameterPositions]

+ +

[property:null resultBuffer]

+ +

[property:null sampleValues]

+ +

[property:Object settings]

+

هيكل إعدادات اختياري خاص بالفئة الفرعية.

+ +

[property:null valueSize]

+ +

الطرق (Methods)

+ +

[method:Array evaluate]( [param:Number t] )

+

تقيم المتداخل في الموضع *t*.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/Line3.html b/docs/api/ar/math/Line3.html new file mode 100644 index 00000000000000..528efecb3dc253 --- /dev/null +++ b/docs/api/ar/math/Line3.html @@ -0,0 +1,142 @@ + + + + + + + + + +

[name]

+ +

+ قطعة خطية هندسية ممثلة بنقطة البداية والنهاية. +

+ +

المنشئ (Constructor)

+ +

[name]( [param:Vector3 start], [param:Vector3 end] )

+

+ [page:Vector3 start] - بداية القطعة الخطية. الافتراضي هو `(0, 0, + 0)`.
+ [page:Vector3 end] - نهاية القطعة الخطية. الافتراضي هو `(0, 0, 0)`.

+ + ينشئ [name] جديد. +

+ +

الخصائص (Properties)

+ +

[property:Vector3 start]

+

[page:Vector3] يمثل نقطة بداية الخط.

+ +

[property:Vector3 end]

+

[page:Vector3] يمثل نقطة نهاية الخط.

+ +

الطرق (Methods)

+ +

[method:this applyMatrix4]( [param:Matrix4 matrix] )

+

يطبق تحويل المصفوفة على القطعة الخطية.

+ +

[method:Vector3 at]( [param:Float t], [param:Vector3 target] )

+

+ [page:Float t] - استخدم قيم 0-1 لإرجاع موضع على طول القطعة + الخطية.
+ [page:Vector3 target] — سيتم نسخ النتيجة في هذا Vector3.

+ + يعود بمتجه في موضع معين على طول الخط. عندما يكون [page:Float t] + = 0، يعود بالمتجه البدائي، وعندما يكون [page:Float t] = 1 يعود + بالمتجه النهائي.
+

+ +

[method:Line3 clone]()

+

+ يعود بـ[page:Line3] جديد مع نفس المتجهات [page:.start start] و + [page:.end end] كهذا. +

+ +

+ [method:Vector3 closestPointToPoint]( [param:Vector3 point], [param:Boolean clampToLine], [param:Vector3 target] ) +

+

+ [page:Vector3 point] - أعد أقرب نقطة على الخط إلى هذه + نقطة.
+ [page:Boolean clampToLine] - ما إذا كان يجب تثبيت القيمة المرجعة على + قطعة خطية.
+ [page:Vector3 target] — سيتم نسخ النتيجة في هذا Vector3.

+ + يعود بأقرب نقطة على الخط. إذا كان [page:Boolean clampToLine] + صحيحًا، فإن القيمة المرجعة ستكون مثبتة على قطعة خطية. +

+ +

+ [method:Float closestPointToPointParameter]( [param:Vector3 point], [param:Boolean clampToLine] ) +

+

+ [page:Vector3 point] - نقطة لإرجاع معلم نقطة له. +
+ [page:Boolean clampToLine] - ما إذا كان يجب تثبيت النتيجة في المدى `[0, + 1]`.

+ + يعود بمعلم نقطة بناءً على أقرب نقطة كما تم توصيلها على + قطعة خطية. إذا كان [page:Boolean clampToLine] صحيحًا، فإن القيمة المرجعة + ستكون بين 0 و 1. +

+ +

[method:this copy]( [param:Line3 line] )

+

+ ينسخ متجهات [page:.start start] و [page:.end end] للخط الممرر + إلى هذا الخط. +

+ +

[method:Vector3 delta]( [param:Vector3 target] )

+

+ [page:Vector3 target] — سيتم نسخ النتيجة في هذا Vector3.

+ + يعود بمتجه دلتا القطعة الخطية (متجه [page:.end end] + ناقص متجه [page:.start start]). +

+ +

[method:Float distance]()

+

+ يعود بـ[link:https://en.wikipedia.org/wiki/Euclidean_distance المسافة الإقليدية] + (المسافة الخطية) بين نقاط [page:.start start] و [page:.end end] للخط. +

+ +

[method:Float distanceSq]()

+

+ يعود بمربع + [link:https://en.wikipedia.org/wiki/Euclidean_distance المسافة الإقليدية] + (المسافة الخطية) بين متجهات [page:.start start] و + [page:.end end] للخط. +

+ +

[method:Boolean equals]( [param:Line3 line] )

+

+ [page:Line3 line] - [page:Line3] للمقارنة مع هذا.

+ + يعود بـtrue إذا كانت نقاط [page:.start start] و [page:.end end] لكلا الخطين + متساوية. +

+ +

[method:Vector3 getCenter]( [param:Vector3 target] )

+

+ [page:Vector3 target] — سيتم نسخ النتيجة في هذا Vector3.

+ + يعود بمركز القطعة الخطية. +

+ +

[method:this set]( [param:Vector3 start], [param:Vector3 end] )

+

+ [page:Vector3 start] - قم بضبط نقطة البدء[page:.start ] للخط.
+ [page:Vector3 end] - قم بضبط نقطة النهاية[page:.end ] للخط.

+ + يضبط قيم البدء والنهاية عن طريق نسخ المتجهات الموفرة. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/MathUtils.html b/docs/api/ar/math/MathUtils.html new file mode 100644 index 00000000000000..595ef12d15f05c --- /dev/null +++ b/docs/api/ar/math/MathUtils.html @@ -0,0 +1,208 @@ + + + + + + + + + +

[name]

+ +

كائن مع عدة وظائف مساعدة للرياضيات.

+ +

الطرق (Methods)

+ +

+ [method:Float clamp]( [param:Float value], [param:Float min], [param:Float max] ) +

+

+ [page:Float value] — القيمة التي يتم تثبيتها.
+ [page:Float min] — الحد الأدنى.
+ [page:Float max] — الحد الأقصى.

+ + يثبت[page:Float value ] ليكون بين[page:Float min ] و + [page:Float max ]. +

+ +

[method:Float degToRad]( [param:Float degrees] )

+

تحويل الدرجات إلى راديان.

+ +

+ [method:Integer euclideanModulo]( [param:Integer n], [param:Integer m] ) +

+

+ [page:Integer n]،[page:Integer m ] - أعداد صحيحة

+ + يحسب نمط إقليدي لـ[page:Integer m ] % [page:Integer n ]، هذا + هو: + ( ( n % m ) + m ) % m +

+ +

[method:UUID generateUUID]( )

+

+ توليد + [link:https://en.wikipedia.org/wiki/Universally_unique_identifier UUID] + (معرف فريد عالميًا). +

+ +

[method:Boolean isPowerOfTwo]( [param:Number n] )

+

يعود بـ`true` إذا كان [page:Number n] قوة لـ2.

+ +

+ [method:Float inverseLerp]( [param:Float x], [param:Float y], [param:Float value] ) +

+

+ [page:Float x] - نقطة البداية.
+ [page:Float y] - نقطة النهاية.
+ [page:Float value] - قيمة بين البداية والنهاية.

+ + يعود بالنسبة المئوية في الفترة المغلقة `[0، 1]` للقيمة المعطاة + بين نقطة البداية والنهاية. +

+ +

+ [method:Float lerp]( [param:Float x], [param:Float y], [param:Float t] ) +

+

+ [page:Float x] - نقطة البداية.
+ [page:Float y] - نقطة النهاية.
+ [page:Float t] - عامل التداخل في الفترة المغلقة `[0، 1]`.

+ + يعود بقيمة[link:https://en.wikipedia.org/wiki/Linear_interpolation متداخلة خطيًا ] + من نقطتين معروفتين بناءً على الفترة المعطاة - + [page:Float t ] = 0 سيعود بـ[page:Float x ] و[page:Float t ] = 1 سوف + يعود بـ[page:Float y ]. +

+ +

+ [method:Float damp]( [param:Float x], [param:Float y], [param:Float lambda], [param:Float dt] ) +

+

+ [page:Float x] - نقطة حالية.
+ [page:Float y] - نقطة الهدف.
+ [page:Float lambda] - قيمة lambda أعلى ستجعل الحركة أكثر + فجأة، وقيمة أقل ستجعل الحركة أكثر تدرجًا.
+ [page:Float dt] - وقت دلتا بالثواني.

+ + تداخل عدد من[page:Float x ] نحو[page:Float y ] بطريقة + ربيعية باستخدام[page:Float dt ] للحفاظ على حركة مستقلة عن معدل + الإطارات. للحصول على التفاصيل، راجع + [link:http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/ تخميد مستقل عن معدل الإطارات باستخدام lerp]. +

+ + +

+ [method:Float mapLinear]( [param:Float x], [param:Float a1], [param:Float a2], [param:Float b1], [param:Float b2] ) +

+

+ [page:Float x] — القيمة التي يتم تعيينها.
+ [page:Float a1] — الحد الأدنى للنطاق A.
+ [page:Float a2] — الحد الأقصى للنطاق A.
+ [page:Float b1] — الحد الأدنى للنطاق B.
+ [page:Float b2] — الحد الأقصى للنطاق B.

+ + تعيين خطي لـ[page:Float x ] من النطاق [[page:Float a1 ], [page:Float a2 ]] إلى النطاق [[page:Float b1 ], [page:Float b2 ]]. +

+ +

[method:Float pingpong]( [param:Float x], [param:Float length] )

+

+ [page:Float x] — القيمة التي يتم تعيينها.
+ [page:Float length] — القيمة الموجبة التي ستتعامل معها الوظيفة. + الافتراضي هو 1.

+ + يعود بقيمة تتبادل بين 0 و[param:Float length ]. +

+ +

[method:Integer ceilPowerOfTwo]( [param:Number n] )

+

+ يعود بأصغر قوة من 2 أكبر من أو يساوي + [page:Number n ]. +

+ +

[method:Integer floorPowerOfTwo]( [param:Number n] )

+

+ يعود بأكبر قوة من 2 أقل من أو يساوي[page:Number n ]. +

+ +

[method:Float radToDeg]( [param:Float radians] )

+

تحويل الراديان إلى درجات.

+ +

[method:Float randFloat]( [param:Float low], [param:Float high] )

+

عشوائية عائمة في الفترة [[page:Float low ], [page:Float high ]].

+ +

[method:Float randFloatSpread]( [param:Float range] )

+

+ عشوائية عائمة في الفترة [-[page:Float range ] / 2،[page:Float range ] + / 2]. +

+ +

+ [method:Integer randInt]( [param:Integer low], [param:Integer high] ) +

+

عشوائية صحيحة في الفترة [[page:Float low ],[page:Float high ]].

+ +

[method:Float seededRandom]( [param:Integer seed] )

+

+ عشوائية زائفة محددة عائمة في الفترة `[0، 1]`. هو اختیاری + [page:Integer seed ]. +

+ +

+ [method:Float smoothstep]( [param:Float x], [param:Float min], [param:Float max] ) +

+

+ [page:Float x] - القيمة التي يتم تقييمها بناءً على موقعها بين الحد + الأدنى والأقصى.
+ [page:Float min] - أي قيمة x أدنى من الحد الأدنى ستكون 0.
+ [page:Float max] - أي قيمة x أعلى من الحد الأقصى ستكون 1.

+ + يعود بقيمة بين 0-1 تمثل النسبة المئوية التي انتقلت فيها x بين الحد + الأدنى والأقصى، ولكن تم تجانسها أو تبطئها كلما اقترب X من + الحد الأدنى والأقصى.

+ + راجع [link:http://en.wikipedia.org/wiki/Smoothstep Smoothstep] للحصول على التفاصيل. +

+ +

+ [method:Float smootherstep]( [param:Float x], [param:Float min], [param:Float max] ) +

+

+ [page:Float x] - القيمة التي يتم تقييمها بناءً على موقعها بين الحد + الأدنى والأقصى.
+ [page:Float min] - أي قيمة x أدنى من الحد الأدنى ستكون 0.
+ [page:Float max] - أي قيمة x أعلى من الحد الأقصى ستكون 1.

+ + يعود بقيمة بين 0-1. تغير على smoothstep + يحتوي على مشتقات من الطلب 1st و 2nd صفر في x=0 و x=1. +

+ +

+ [method:undefined setQuaternionFromProperEuler]( [param:Quaternion q], [param:Float a], [param:Float b], [param:Float c], [param:String order] ) +

+

+ [page:Quaternion q] - رباعية لضبطها
+ [page:Float a] - التدوير المطبق على المحور الأول، بالراديان
+ [page:Float b] - التدوير المطبق على المحور الثاني، بالراديان +
+ [page:Float c] - التدوير المطبق على المحور الثالث، بالراديان
+ [page:String order] - سلسلة تحدد ترتيب المحاور: 'XYX'، 'XZX'، + 'YXY'، 'YZY'، 'ZXZ'، أو 'ZYZ'

+ + يضبط رباعية[page:Quaternion q ] من + [link:http://en.wikipedia.org/wiki/Euler_angles زوايا أويلر Proper intrinsic ] + المعرفة بزوايا[page:Float a ]،[page:Float b ]، و[page:Float c ]، + والترتیب[page:String order].
+ + يتم تطبیق التدویرات على المحاور بالترتیب المحدد بـ[page:String order]: + يتم تطبیق التدویر بزاویة[page:Float a ] أولًا، ثم بزاویة + [page:Float b ]، ثم بزاویة[page:Float c ]. زوایا هی فی رادیان. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/Matrix3.html b/docs/api/ar/math/Matrix3.html new file mode 100644 index 00000000000000..aac1922428296b --- /dev/null +++ b/docs/api/ar/math/Matrix3.html @@ -0,0 +1,282 @@ + + + + + + + + + +

[name]

+ +

+ فئة تمثل 3x3 + [link:https://en.wikipedia.org/wiki/Matrix_(mathematics) مصفوفة]. +

+ +

مثال الكود

+ +const m = new Matrix3(); + + +

ملاحظة حول الترتيب الرئيسي للصف والعمود الرئيسي

+

+ يأخذ المنشئ وطريقة [page:set]() الوسائط في + [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order ترتيب الصف الرئيسي] + ، في حين أنها مخزنة داخليًا في مصفوفة [page:.elements elements] + بترتيب العمود الرئيسي.

+ + هذا يعني أن استدعاء + +m.set( 11, 12, 13, + 21, 22, 23, + 31, 32, 33 ); + + ستؤدي إلى مصفوفة [page:.elements elements] التي تحتوي على: + +m.elements = [ 11, 21, 31, + 12, 22, 32, + 13, 23, 33 ]; + + وداخليًا يتم تنفيذ جميع الحسابات باستخدام ترتيب العمود الرئيسي. + ومع ذلك ، نظرًا لأن الترتيب الفعلي لا يحدث فرقًا رياضيًا و + معظم الناس معتادون على التفكير في المصفوفات بترتيب الصف الرئيسي ، فإن + وثائق three.js تظهر المصفوفات بترتيب الصف الرئيسي. فقط تحمل في + اذهانك أنه إذا كنت تقرأ التعليمات البرمجية المصدرية ، فستضطر إلى أخذ + [link:https://en.wikipedia.org/wiki/Transpose عكس] لأية مصفوفات + الموضحة هنا لجعل المحاسبات منطقية. +

+ +

المنشئ (Constructor)

+ +

[name]( [param:Number n11], [param:Number n12], [param:Number n13], + [param:Number n21], [param:Number n22], [param:Number n23], + [param:Number n31], [param:Number n32], [param:Number n33] )

+

+ ينشئ مصفوفة 3x3 بالوسائط المعطاة بترتيب الصف الرئيسي. إذا لم يتم توفير أية وسائط ، يقوم المنشئ بتهيئة + [name] إلى مصفوفة هوية 3x3 [link:https://en.wikipedia.org/wiki/Identity_matrix]. +

+ +

الخصائص (Properties)

+ +

[property:Array elements]

+

+ قائمة [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order بالعمود الرئيسي] من قيم المصفوفة. +

+ +

الطرق (Methods)

+ +

[method:Matrix3 clone]()

+

ينشئ Matrix3 جديدًا وبعناصر متطابقة مع هذا.

+ +

[method:this copy]( [param:Matrix3 m] )

+

ينسخ عناصر المصفوفة [page:Matrix3 m] في هذه المصفوفة.

+ +

[method:Float determinant]()

+

+ يحسب ويعيد [link:https://en.wikipedia.org/wiki/Determinant المحدد] لهذه المصفوفة. +

+ +

[method:Boolean equals]( [param:Matrix3 m] )

+

يرجع صحيحًا إذا كانت هذه المصفوفة و [page:Matrix3 m] متساويتين.

+ +

+ [method:this extractBasis]( [param:Vector3 xAxis], [param:Vector3 yAxis], [param:Vector3 zAxis] ) +

+

+ يستخرج [link:https://en.wikipedia.org/wiki/Basis_(linear_algebra) الأساس] + لهذه المصفوفة في ثلاثة متجهات محورية مقدمة. إذا كانت هذه المصفوفة + هي: + + a, b, c, + d, e, f, + g, h, i + + ثم سيتم تعيين [page:Vector3 xAxis] ، [page:Vector3 yAxis] ، [page:Vector3 zAxis] + إلى: + + xAxis = (a, d, g) + yAxis = (b, e, h) + zAxis = (c, f, i) + +

+ +

+ [method:this fromArray]( [param:Array array], [param:Integer offset] ) +

+

+ [page:Array array] - المصفوفة التي يتم قراءة العناصر منها.
+ [page:Integer offset] - (اختياري) فهرس العنصر الأول في المصفوفة. + الافتراضي هو 0.

+ + يضع عناصر هذه المصفوفة بناءً على مصفوفة في + [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order تنسيق العمود الرئيسي]. +

+ +

[method:this invert]()

+

+ يعكس هذه المصفوفة ، باستخدام + [link:https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution الطريقة التحليلية]. + لا يمكنك العكس مع محدد صفر. إذا قمت بمحاولة هذا ، فإن الطريقة تنتج مصفوفة صفرية بدلاً من ذلك. +

+ +

[method:this getNormalMatrix]( [param:Matrix4 m] )

+

+ [page:Matrix4 m] - [page:Matrix4]

+ + يضع هذه المصفوفة كـ 3x3 العلوي الأيسر من + [link:https://en.wikipedia.org/wiki/Normal_matrix المصفوفة الطبيعية] لل + مرور [page:Matrix4 matrix4]. + المصفوفة الطبيعية هي + [link:https://en.wikipedia.org/wiki/Invertible_matrix العكس] + [link:https://en.wikipedia.org/wiki/Transpose عكس] للمصفوفة + [page:Matrix4 m]. +

+ +

[method:this identity]()

+

+ يعيد هذه المصفوفة إلى مصفوفة الهوية 3x3: + + 1, 0, 0 + 0, 1, 0 + 0, 0, 1 + +

+ +

[method:this makeRotation]( [param:Float theta] )

+

+ [page:Float theta] - زاوية الدوران بالراديان. تدور القيم الموجبة + عكس عقارب الساعة.

+ + يضع هذه المصفوفة كتحول دوران ثنائي الأبعاد بـ [page:Float theta] + راديان. المصفوفة الناتجة ستكون: + + cos(θ) -sin(θ) 0 + sin(θ) cos(θ) 0 + 0 0 1 + +

+ +

[method:this makeScale]( [param:Float x], [param:Float y] )

+

+ [page:Float x] - المبلغ الذي يتم قياسه في المحور X.
+ [page:Float y] - المبلغ الذي يتم قياسه في المحور Y.
+ + يضع هذه المصفوفة كتحول قياس ثنائي الأبعاد: + + x, 0, 0, + 0, y, 0, + 0, 0, 1 + +

+ +

[method:this makeTranslation]( [param:Vector2 v] )

+

[method:this makeTranslation]( [param:Float x], [param:Float y] )

+

+ [page:Vector2 v] تحويل الترجمة من المتجه.
+ أو
+ [page:Float x] - المبلغ الذي يتم ترجمته في المحور X.
+ [page:Float y] - المبلغ الذي يتم ترجمته في المحور Y.
+ + يضع هذه المصفوفة كتحويل ترجمة ثنائي الأبعاد: + + 1, 0, x, + 0, 1, y, + 0, 0, 1 + +

+ +

[method:this multiply]( [param:Matrix3 m] )

+

يضرب هذه المصفوفة بعد [page:Matrix3 m].

+ +

+ [method:this multiplyMatrices]( [param:Matrix3 a], [param:Matrix3 b] ) +

+

يضع هذه المصفوفة على [page:Matrix3 a] x [page:Matrix3 b].

+ +

[method:this multiplyScalar]( [param:Float s] )

+

يضرب كل مكون من مكونات المصفوفة بالقيمة العددية *s*.

+ +

[method:this rotate]( [param:Float theta] )

+

يدور هذه المصفوفة بالزاوية المعطاة (بالراديان).

+ +

[method:this scale]( [param:Float sx], [param:Float sy] )

+

يقيس هذه المصفوفة بالقيم العددية المعطاة.

+ +

+ [method:this set]( [param:Float n11], [param:Float n12], [param:Float n13], [param:Float n21], [param:Float n22], [param:Float n23], [param:Float n31], [param:Float n32], [param:Float n33] ) +

+

+ [page:Float n11] - القيمة التي يتم وضعها في الصف 1 ، العمود 1.
+ [page:Float n12] - القيمة التي يتم وضعها في الصف 1 ، العمود 2.
+ ...
+ ...
+ [page:Float n32] - القيمة التي يتم وضعها في الصف 3 ، العمود 2.
+ [page:Float n33] - القيمة التي يتم وضعها في الصف 3 ، العمود 3.

+ + يضع قيم المصفوفة 3x3 على + [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order تسلسل قيم رئيسية للصف]. +

+ +

[method:this premultiply]( [param:Matrix3 m] )

+

Pre-multiplies this matrix by [page:Matrix3 m].

+ +

[method:this setFromMatrix4]( [param:Matrix4 m] )

+

+ قم بتعيين هذه المصفوفة إلى مصفوفة 3x3 العلوية من Matrix4 + [page:Matrix4 m]. +

+ +

+ [method:this setUvTransform]( [param:Float tx], [param:Float ty], [param:Float sx], [param:Float sy], [param:Float rotation], [param:Float cx], [param:Float cy] ) +

+

+ [page:Float tx] - الإزاحة x
+ [page:Float ty] - الإزاحة y
+ [page:Float sx] - تكرار x
+ [page:Float sy] - تكرار y
+ [page:Float rotation] - الدوران ، بالراديان. تدور القيم الموجبة + عكس عقارب الساعة
+ [page:Float cx] - مركز x للدوران
+ [page:Float cy] - مركز y للدوران

+ + يضع مصفوفة التحويل UV من الإزاحة والتكرار والدوران والمركز. +

+ +

+ [method:Array toArray]( [param:Array array], [param:Integer offset] ) +

+

+ [page:Array array] - (اختياري) مصفوفة لتخزين المتجه الناتج فيها. إذا + لم يتم إعطاء مصفوفة جديدة سيتم إنشاؤها.
+ [page:Integer offset] - (اختياري) إزاحة في المصفوفة التي يجب وضعها فيها + النتيجة.

+ + يكتب عناصر هذه المصفوفة في مصفوفة في + [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order تنسيق العمود الرئيسي]. +

+ +

[method:this translate]( [param:Float tx], [param:Float ty] )

+

يترجم هذه المصفوفة بالقيم العددية المعطاة.

+ +

[method:this transpose]()

+

+ [link:https://en.wikipedia.org/wiki/Transpose يعكس] هذه المصفوفة في + مكان. +

+ +

[method:this transposeIntoArray]( [param:Array array] )

+

+ [page:Array array] - مصفوفة لتخزين المتجه الناتج فيها.

+ + [link:https://en.wikipedia.org/wiki/Transpose يعكس] هذه المصفوفة في + المصفوفة الموردة ، ويرجع نفسه دون تغيير. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/Matrix4.html b/docs/api/ar/math/Matrix4.html new file mode 100644 index 00000000000000..7af425235be813 --- /dev/null +++ b/docs/api/ar/math/Matrix4.html @@ -0,0 +1,493 @@ + + + + + + + + + +

[name]

+ +

+ فئة تمثل 4x4 + [link:https://en.wikipedia.org/wiki/Matrix_(mathematics) matrix].

+ + أكثر استخدامات مصفوفة 4x4 شيوعًا في الرسومات الحاسوبية ثلاثية الأبعاد هي كـ + [link:https://en.wikipedia.org/wiki/Transformation_matrix Transformation Matrix]. + لمقدمة عن مصفوفات التحول كما هو مستخدم في WebGL ، + تحقق من + [link:http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices هذا البرنامج التعليمي].

+ + يسمح هذا لـ[page:Vector3] يمثل نقطة في الفضاء ثلاثي الأبعاد بالخضوع + التحولات مثل الترجمة والدوران والقص والتحجيم والانعكاس و + الإسقاط المتعامد أو المنظور وهكذا ، عن طريق ضربه بـ + المصفوفة. يُعرف هذا باسم `تطبيق` المصفوفة على المتجه.

+ + كل [page:Object3D] لديه ثلاث Matrix4s مرتبطة: +

+
    +
  • + [page:Object3D.matrix]: يخزن هذا التحول المحلي للكائن. + هذا هو تحول الكائن نسبةً إلى والده. +
  • +
  • + [page:Object3D.matrixWorld]: التحول العالمي أو العالمي لـ + الكائن. إذا لم يكن للكائن والد ، فإن هذا مطابق للتحول المحلي + المخزن في [page:Object3D.matrix matrix]. +
  • +
  • + [page:Object3D.modelViewMatrix]: يمثل هذا تحول الكائن + نسبةً إلى نظام إحداثيات الكاميرا. مصفوفة modelViewMatrix للكائن هي + matrixWorld للكائن مضروبًا بـ + matrixWorldInverse للكاميرا. +
  • +
+ + [page:Camera Cameras] لديها ثلاث Matrix4s إضافية: +
    +
  • + [page:Camera.matrixWorldInverse]: مصفوفة العرض - عكس + Camera's [page:Object3D.matrixWorld matrixWorld]. +
  • +
  • + [page:Camera.projectionMatrix]: يمثل المعلومات حول كيفية + إسقاط المشهد على مسافة قص. +
  • +
  • + [page:Camera.projectionMatrixInverse]: عكس projectionMatrix. +
  • +
+ + ملاحظة: [page:Object3D.normalMatrix] ليست Matrix4 ، ولكنها [page:Matrix3]. + +

ملاحظة حول ترتيب الصف الرئيسي والعمود الرئيسي

+

+ يأخذ الباني وطريقة [page:set]() المعاملات في + [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order row-major] + ترتيب ، في حين يتم تخزينها داخليًا في مصفوفة [page:.elements elements] بترتيب العمود الرئيسي.

+ + هذا يعني أن الاتصال + + const m = new THREE.Matrix4(); + m.set( 11، 12، 13، 14، + 21، 22، 23، 24, + 31، 32، 33، 34، + 41، 42، 43، 44 ); + + ستؤدي إلى مصفوفة [page:.elements elements] التي تحتوي على: + + m.elements = [ 11, 21, 31, 41, + 12, 22, 32, 42, + 13, 23, 33, 43, + 14, 24, 34, 44 ]; + + وداخليًا يتم إجراء جميع الحسابات باستخدام ترتيب العمود الرئيسي. + ومع ذلك ، نظرًا لأن الترتيب الفعلي لا يحدث فرقًا رياضيًا و + معظم الناس معتادون على التفكير في المصفوفات بترتيب الصف الرئيسي ، + توثق three.js المصفوفات بترتيب الصف الرئيسي. فقط تذكر أنه إذا كنت + قراءة شفرة المصدر ، ستضطر إلى أخذ + [link:https://en.wikipedia.org/wiki/Transpose transpose] من أية مصفوفات + الموضح هنا لجعل المحاسبات منطقية. +

+ + +

استخراج الموضع والدوران والمقياس

+

+ هناك العديد من الخيارات المتاحة لاستخراج الموضع والدوران و + المقياس من Matrix4. +

+
    +
  • + [page:Vector3.setFromMatrixPosition]: يمكن استخدامه لاستخراج + مكون الترجمة. +
  • +
  • + [page:Vector3.setFromMatrixScale]: يمكن استخدامه لاستخراج المقياس + مكون. +
  • +
  • + [page:Quaternion.setFromRotationMatrix] ، + [page:Euler.setFromRotationMatrix] أو [page:.extractRotation extractRotation] + يمكن استخدامه لاستخراج مكون الدوران من مصفوفة نقية (غير متساوية القياس). +
  • +
  • + [page:.decompose decompose] يمكن استخدامه لاستخراج الموضع والدوران + والمقياس كلهم في آن واحد. +
  • +
+ +

المنشئ (Constructor)

+ +

[name]( [param:Number n11], [param:Number n12], [param:Number n13], [param:Number n14], + [param:Number n21], [param:Number n22], [param:Number n23], [param:Number n24], + [param:Number n31], [param:Number n32], [param:Number n33], [param:Number n34], + [param:Number n41], [param:Number n42], [param:Number n43], [param:Number n44] )

+ +

+ ينشئ مصفوفة 4x4 بالمعاملات المعطاة بترتيب الصف. إذا لم يتم توفير أي معاملات ، فإن الباني يقوم بتهيئة + الـ[name] إلى مصفوفة 4x4[link:https://en.wikipedia.org/wiki/Identity_matrix identity matrix]. +

+ +

الخصائص (Properties)

+ +

[property:Array elements]

+

+ قائمة + [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major] من قيم المصفوفة. +

+ +

الطرق (Methods)

+ +

[method:Matrix4 clone]()

+

+ ينشئ Matrix4 جديدًا بـ[page:.elements elements] متطابقة لهذه + واحد. +

+ +

+ [method:this compose]( [param:Vector3 position], [param:Quaternion quaternion], [param:Vector3 scale] ) +

+

+ يضع هذه المصفوفة على التحول المكون من[page:Vector3 position] ، + [page:Quaternion quaternion] و[page:Vector3 scale]. +

+ + +

[method:this copy]( [param:Matrix4 m] )

+

+ ينسخ [page:.elements elements] من المصفوفة [page:Matrix4 m] في هذه + المصفوفة. +

+ +

[method:this copyPosition]( [param:Matrix4 m] )

+

+ ينسخ مكون الترجمة من المصفوفة المعطاة [page:Matrix4 m] + في مكون الترجمة لهذه المصفوفة. +

+ +

+ [method:this decompose]( [param:Vector3 position], [param:Quaternion quaternion], [param:Vector3 scale] ) +

+

+ يقوم بتحليل هذه المصفوفة إلى مكوناتها[page:Vector3 position] ،[page:Quaternion quaternion] + و[page:Vector3 scale].

+ ملاحظة: ليست جميع المصفوفات قابلة للتحليل بهذه الطريقة. على سبيل المثال ، إذا كان + كائن لديه والد غير متساوي القياس ، فقد لا تكون مصفوفة العالم الخاصة بالكائن + قابلة للتحليل ، وقد لا تكون هذه الطريقة مناسبة. +

+ +

[method:Float determinant]()

+

+ يحسب ويعيد[link:https://en.wikipedia.org/wiki/Determinant determinant] لهذه المصفوفة.

+ + بناءً على الطريقة المبينة + [link:http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.html هنا]. +

+ +

[method:Boolean equals]( [param:Matrix4 m] )

+

يرجع صحيحًا إذا كانت هذه المصفوفة و[page:Matrix4 m] متساويتين.

+ +

+ [method:this extractBasis]( [param:Vector3 xAxis], [param:Vector3 yAxis], [param:Vector3 zAxis] ) +

+

+ يستخرج[link:https://en.wikipedia.org/wiki/Basis_(linear_algebra) basis] + من هذه المصفوفة في المتجهات الثلاثة المحورية المقدمة. إذا كانت هذه المصفوفة + : + + a، b، c، d، + e، f، g، h، + i، j، k، l، + m، n، o، p + + ثم سيتم تعيين[page:Vector3 xAxis] ،[page:Vector3 yAxis] ،[page:Vector3 zAxis] + إلى: + + xAxis = (a, e, i) + yAxis = (b, f, j) + zAxis = (c, g, k) + +

+ +

[method:this extractRotation]( [param:Matrix4 m] )

+

+ يستخرج مكون الدوران من المصفوفة المعطاة [page:Matrix4 m] + في مكون الدوران لهذه المصفوفة. +

+ +

+ [method:this fromArray]( [param:Array array], [param:Integer offset] ) +

+

+ [page:Array array] - المصفوفة التي يتم قراءة العناصر منها.
+ [page:Integer offset] - (اختياري) إزاحة في المصفوفة. الافتراضي هو + 0.

+ + يضع عناصر هذه المصفوفة بناءً على [page:Array array] في + [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major] تنسيق. +

+ +

[method:this invert]()

+

+ يعكس هذه المصفوفة ، باستخدام + [link:https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution الطريقة التحليلية]. + لا يمكنك عكس مع محدد صفر. إذا + حاولت ذلك ، فإن الطريقة تنتج مصفوفة صفرية بدلاً من ذلك. +

+ +

[method:Float getMaxScaleOnAxis]()

+

يحصل على أقصى قيمة مقياس للمحاور الثلاثة.

+ +

[method:this identity]()

+

+ يعيد تعيين هذه المصفوفة إلى + [link:https://en.wikipedia.org/wiki/Identity_matrix مصفوفة الهوية]. +

+ +

+ [method:this lookAt]( [param:Vector3 eye], [param:Vector3 target], [param:Vector3 up] ) +

+

+ يبني مصفوفة دوران ، تبحث من[page:Vector3 eye] نحو + [page:Vector3 target] متجهًا بالمتجه[page:Vector3 up]. +

+ +

+ [method:this makeRotationAxis]( [param:Vector3 axis], [param:Float theta] ) +

+

+ [page:Vector3 axis] - محور الدوران ، يجب تطبيعه.
+ [page:Float theta] - زاوية الدوران بالراديان.

+ + يضع هذه المصفوفة كتحويل دوران حول[page:Vector3 axis] بـ + [page:Float theta] راديان.
+ + هذا بديل مثير للجدل نوعًا ما ولكنه صحيح رياضيًا للدوران عبر[page:Quaternion Quaternions]. انظر المناقشة + [link:https://www.gamedev.net/articles/programming/math-and-physics/do-we-really-need-quaternions-r1199 هنا]. +

+ +

+ [method:this makeBasis]( [param:Vector3 xAxis], [param:Vector3 yAxis], [param:Vector3 zAxis] ) +

+

+ قم بتعيين هذا إلى [link:https://en.wikipedia.org/wiki/Basis_(linear_algebra) basis] + مصفوفة تتكون من المتجهات الأساسية الثلاثة المقدمة: + + xAxis.x، yAxis.x، zAxis.x، 0، + xAxis.y، yAxis.y، zAxis.y، 0، + xAxis.z، yAxis.z، zAxis.z، 0، + 0, 0, 0, 1 + +

+ +

+ [method:this makePerspective]( [param:Float left], [param:Float right], [param:Float top], [param:Float bottom], [param:Float near], [param:Float far] ) +

+

+ ينشئ + [link:https://en.wikipedia.org/wiki/3D_projection#Perspective_projection perspective projection] + مصفوفة. يتم استخدام هذا داخليًا بواسطة + [page:PerspectiveCamera.updateProjectionMatrix]() +

+ +

+ [method:this makeOrthographic]( [param:Float left], [param:Float right], [param:Float top], [param:Float bottom], [param:Float near], [param:Float far] ) +

+

+ ينشئ مصفوفة اسقاط متعامدة[link:https://en.wikipedia.org/wiki/Orthographic_projection orthographic projection]. يتم استخدام هذا داخليًا بواسطة + [page:OrthographicCamera.updateProjectionMatrix](). +

+ +

[method:this makeRotationFromEuler]( [param:Euler euler] )

+

+ يضع مكون الدوران (المصفوفة العلوية اليسرى 3x3) من هذه المصفوفة على + الدوران المحدد بالزاوية المعطاة[page:Euler Euler Angle]. باقي + المصفوفة يتم تعيينها على المعرف. اعتمادًا على[page:Euler.order order] + من[page:Euler euler] ، هناك ست نتائج محتملة. راجع + [link:https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix هذه الصفحة] للحصول على قائمة كاملة. +

+ +

[method:this makeRotationFromQuaternion]( [param:Quaternion q] )

+

+ يضع مكون الدوران من هذه المصفوفة على الدوران المحدد بـ + [page:Quaternion q] ، كما هو مبين + [link:https://en.wikipedia.org/wiki/Rotation_matrix#Quaternion هنا]. ال + باقي من المصفوفة يتم تعيينه إلى المعرف. لذلك ، بالنظر إلى[page:Quaternion q] = + w + xi + yj + zk ، فإن المصفوفة الناتجة ستكون: + +1-2y²-2z² 2xy-2zw 2xz+2yw 0 +2xy+2zw 1-2x²-2z² 2yz-2xw 0 +2xz-2yw 2yz+2xw 1-2x²-2y² 0 + 0 0 0 1 + +

+ +

[method:this makeRotationX]( [param:Float theta] )

+

+ [page:Float theta] - زاوية الدوران بالراديان.

+ + يضع هذه المصفوفة كتحويل دوران حول محور X بواسطة + [page:Float theta] (θ) راديان. المصفوفة الناتجة ستكون: + +1 0 0 0 +0 cos(θ) -sin(θ) 0 +0 sin(θ) cos(θ) 0 +0 0 0 1 + +

+ +

[method:this makeRotationY]( [param:Float theta] )

+

+ [page:Float theta] - زاوية الدوران بالراديان.

+ + يضع هذه المصفوفة كتحويل دوران حول محور Y بواسطة + [page:Float theta] (θ) راديان. المصفوفة الناتجة ستكون: + + cos(θ) 0 sin(θ) 0 0 1 0 0 -sin(θ) 0 cos(θ) 0 0 0 + 0 1 + +

+ +

[method:this makeRotationZ]( [param:Float theta] )

+

+ [page:Float theta] - زاوية الدوران بالراديان.

+ + يضع هذه المصفوفة كتحويل دوران حول محور Z بواسطة + [page:Float theta] (θ) راديان. المصفوفة الناتجة ستكون: + +cos(θ) -sin(θ) 0 0 +sin(θ) cos(θ) 0 0 +0 0 1 0 +0 0 0 1 + +

+ +

+ [method:this makeScale]( [param:Float x], [param:Float y], [param:Float z] ) +

+

+ [page:Float x] - المقدار الذي يجب تغييره في محور X.
+ [page:Float y] - المقدار الذي يجب تغييره في محور Y.
+ [page:Float z] - المقدار الذي يجب تغييره في محور Z.

+ + يضع هذه المصفوفة كتحويل قياس: + + x، 0، 0، 0، + 0، y، 0، 0، + 0، 0، z، 0، + 0، 0، 0، 1 + +

+ +

+ [method:this makeShear]( [param:Float xy], [param:Float xz], [param:Float yx], + [param:Float yz], [param:Float zx], [param:Float zy] ) +

+

+ [page:Float xy] - المقدار الذي يجب قصه X بواسطة Y.
+ [page:Float xz] - المقدار الذي يجب قصه X بواسطة Z.
+ [page:Float yx] - المقدار الذي يجب قصه Y بواسطة X.
+ [page:Float yz] - المقدار الذي يجب قصه Y بواسطة Z.
+ [page:Float zx] - المقدار الذي يجب قصه Z بواسطة X.
+ [page:Float zy] - المقدار الذي يجب قصه Z بواسطة Y.

+ + يضع هذه المصفوفة كتحويل قص: + + 1، yx، zx، 0، + xy، 1، zy، 0، + xz، yz، 1، 0، + 0، 0، 0، 1 +

+ +

[method:this makeTranslation]( [param:Vector3 v] )

+

+ [method:this makeTranslation]( [param:Float x], [param:Float y], [param:Float z] ) // واجهة برمجة التطبيقات الاختيارية +

+

+ يضع هذه المصفوفة كتحويل ترجمة من متجه [page:Vector3 v] ، أو أرقام [page:Float x] ، [page:Float y] و [page:Float z]: + + 1، 0، 0، x، + 0، 1، 0، y، + 0، 0، 1، z، + 0، 0، 0، 1 +

+ +

[method:this multiply]( [param:Matrix4 m] )

+

تعدل هذه المصفوفة بعد ضربها بـ[page:Matrix4 m].

+ +

+ [method:this multiplyMatrices]( [param:Matrix4 a], [param:Matrix4 b] ) +

+

يضع هذه المصفوفة على[page:Matrix4 a] x[page:Matrix4 b].

+ +

[method:this multiplyScalar]( [param:Float s] )

+

+ يضرب كل مكون من مكونات المصفوفة بقيمة مقياسية[page:Float s]. +

+ +

[method:this premultiply]( [param:Matrix4 m] )

+

تعدل هذه المصفوفة قبل ضربها بـ[page:Matrix4 m].

+ +

[method:this scale]( [param:Vector3 v] )

+

يضرب أعمدة هذه المصفوفة بالمتجه[page:Vector3 v].

+ +

+ [method:this set]( [param:Float n11], [param:Float n12], [param:Float n13], [param:Float n14], [param:Float n21], [param:Float n22], [param:Float n23], [param:Float n24], [param:Float n31], [param:Float n32], [param:Float n33], [param:Float n34], [param:Float n41], [param:Float n42], [param:Float n43], [param:Float n44] ) +

+

+ قم بتعيين عناصر المصفوفة الخاصة بك إلى القيم الموردة بترتيب الصف الرئيسي + قيم [page:Float n11] ، [page:Float n12] ، ... [page:Float n44]. +

+ +

[method:this setFromMatrix3]( [param:Matrix3 m] )

+

+ قم بتعيين عناصر 3x3 العلوية لهذه المصفوفة إلى قيم Matrix3 + [page:Matrix3 m]. +

+ +

[method:this setPosition]( [param:Vector3 v] )

+

+ [method:this setPosition]( [param:Float x], [param:Float y], [param:Float z] ) // واجهة برمجة تطبيقات اختيارية +

+

+ يضع مكون الموضع لهذه المصفوفة من المتجه [page:Vector3 v] ، + دون التأثير على بقية المصفوفة - أي إذا كانت المصفوفة هي + حاليا: + + a, b, c, d, + e, f, g, h, + i, j, k, l, + m, n, o, p + هذا يصبح: + + a, b, c, v.x, + e, f, g, v.y, + i, j, k, v.z, + m, n, o, p +

+ +

+ [method:Array toArray]( [param:Array array], [param:Integer offset] ) +

+

+ [page:Array array] - (اختياري) مصفوفة لتخزين المتجه الناتج فيها.
+ [page:Integer offset] - (اختياري) إزاحة في المصفوفة التي يجب وضعها فيها + النتيجة.

+ + يكتب عناصر هذه المصفوفة في مصفوفة في + [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order تنسيق العمود الرئيسي]. +

+ +

[method:this transpose]()

+

+ [link:https://en.wikipedia.org/wiki/Transpose يعكس] هذه المصفوفة. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/Plane.html b/docs/api/ar/math/Plane.html new file mode 100644 index 00000000000000..d59caf30f00116 --- /dev/null +++ b/docs/api/ar/math/Plane.html @@ -0,0 +1,208 @@ + + + + + + + + + +

[name]

+ +

+ سطح ثنائي الأبعاد يمتد إلى ما لا نهاية في الفضاء ثلاثي الأبعاد ، ممثلًا + في [link:http://mathworld.wolfram.com/HessianNormalForm.html Hessian normal form] + بواسطة متجه طبيعي ذو طول وحدة وثابت. +

+ +

المنشئ (Constructor)

+ +

[name]( [param:Vector3 normal], [param:Float constant] )

+

+ [page:Vector3 normal] - (اختياري) وحدة طول[page:Vector3] تحدد + الطبيعي للطائرة. الافتراضي هو `(1، 0، 0)`.
+ [page:Float constant] - (اختياري) المسافة الموقعة من المنشأ إلى + الطائرة. الافتراضي هو `0`. +

+ +

الخصائص (Properties)

+ +

[property:Boolean isPlane]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معينًا من نوع [name].

+ +

[property:Vector3 normal]

+ +

[property:Float constant]

+ +

الطرق (Methods)

+ +

+ [method:this applyMatrix4]( [param:Matrix4 matrix], [param:Matrix3 optionalNormalMatrix] ) +

+

+ [page:Matrix4 matrix] - الـ[Page:Matrix4] للتطبيق.
+ [page:Matrix3 optionalNormalMatrix] - (اختياري) محسوب مسبقًا عادي + [Page:Matrix3] من Matrix4 قيد التطبيق.

+ + تطبيق Matrix4 على الطائرة. يجب أن تكون المصفوفة تحولًا متجانسًا ومتجانسًا. +
+ إذا كنت تزود بـ[page:Matrix3 optionalNormalMatrix] ، فيمكن إنشاؤه + هكذا: + + const optionalNormalMatrix = new THREE.Matrix3().getNormalMatrix( matrix ); + +

+ +

[method:Plane clone]()

+

+ يعيد طائرة جديدة بنفس [page:.normal normal] و + [page:.constant constant] كهذا. +

+ +

[method:Vector3 coplanarPoint]( [param:Vector3 target] )

+

+ [page:Vector3 target] - سيتم نسخ النتيجة في هذا Vector3.

+ + يعيد[page:Vector3] متعامدًا على الطائرة ، عن طريق حساب + إسقاط المتجه الطبيعي في المنشأ على الطائرة. +

+ +

[method:this copy]( [param:Plane plane] )

+

+ ينسخ قيم خصائص [page:.normal normal] و[page:.constant constant] + للطائرة الممر إلى هذه الطائرة. +

+ +

[method:Float distanceToPoint]( [param:Vector3 point] )

+

+ يعود بالمسافة الموقعة من[page:Vector3 point] إلى الطائرة. +

+ +

[method:Float distanceToSphere]( [param:Sphere sphere] )

+

+ يعود بالمسافة الموقعة من[page:Sphere sphere] إلى الطائرة. +

+ +

[method:Boolean equals]( [param:Plane plane] )

+

+ يتحقق لمعرفة ما إذا كانت طائرتان متساويتين (خصائصهما [page:.normal normal] و + [page:.constant constant] تتطابق). +

+ +

+ [method:Vector3 intersectLine]( [param:Line3 line], [param:Vector3 target] ) +

+

+ [page:Line3 line] - الـ[page:Line3] للتحقق من التقاطع.
+ [page:Vector3 target] - سيتم نسخ النتيجة في هذا Vector3.

+ + يعيد نقطة التقاطع للخط الممر والطائرة. يعود + فارغ إذا لم يتقاطع الخط. يعود نقطة البداية للخط إذا كان + الخط متعامد مع الطائرة. +

+ +

[method:Boolean intersectsBox]( [param:Box3 box] )

+

+ [page:Box3 box] - الـ[page:Box3] للتحقق من التقاطع.

+ + يحدد ما إذا كانت هذه الطائرة تتقاطع مع[page:Box3 box]. +

+ +

[method:Boolean intersectsLine]( [param:Line3 line] )

+

+ [page:Line3 line] - الـ[page:Line3] للتحقق من التقاطع.

+ + يختبر ما إذا كان قطع الخط يتقاطع مع (يمر عبر) الطائرة. +

+ +

[method:Boolean intersectsSphere]( [param:Sphere sphere] )

+

+ [page:Sphere sphere] - الـ[page:Sphere] للتحقق من التقاطع.

+ + يحدد ما إذا كانت هذه الطائرة تتقاطع مع[page:Sphere sphere]. +

+ +

[method:this negate]()

+

ينفي كلاً من المتجه الطبيعي والثابت.

+ +

[method:this normalize]()

+

+ يسوي المتجه[page:.normal normal] ، ويضبط + قيمة[page:.constant constant] بشكل ملائم. +

+ +

+ [method:Vector3 projectPoint]( [param:Vector3 point], [param:Vector3 target] ) +

+

+ [page:Vector3 point] - الـ[page:Vector3] للإسقاط على الطائرة.
+ [page:Vector3 target] - سيتم نسخ النتيجة في هذا Vector3.

+ + يسقط نقطة[page:Vector3 point] على الطائرة. +

+ +

[method:this set]( [param:Vector3 normal], [param:Float constant] )

+

+ [page:Vector3 normal] - وحدة طول [page:Vector3] تحدد الطبيعي + من الطائرة.
+ [page:Float constant] - المسافة الموقعة من المنشأ إلى الطائرة. + الافتراضي هو `0`.

+ + يضع خصائص [page:.normal normal] و[page:.constant constant] + لهذه الطائرة عن طريق نسخ القيم من الطبيعي المعطى. +

+ +

+ [method:this setComponents]( [param:Float x], [param:Float y], [param:Float z], [param:Float w] ) +

+

+ [page:Float x] - قيمة x للمتجه الطبيعي ذو الطول الوحدة.
+ [page:Float y] - قيمة y للمتجه الطبيعي ذو الطول الوحدة.
+ [page:Float z] - قيمة z للمتجه الطبيعي ذو الطول الوحدة.
+ [page:Float w] - قيمة خاصية [page:.constant constant] + للطائرة.

+ + قم بتعيين المكونات الفردية التي تحدد الطائرة. +

+ +

+ [method:this setFromCoplanarPoints]( [param:Vector3 a], [param:Vector3 b], [param:Vector3 c] ) +

+

+ [page:Vector3 a] - أول نقطة على الطائرة.
+ [page:Vector3 b] - نقطة ثانية على الطائرة.
+ [page:Vector3 c] - نقطة ثالثة على الطائرة.

+ + يحدد الطائرة بناءً على 3 نقاط مقدمة. يفترض أن تكون ترتيب التغليف + عكس عقارب الساعة ، وتحدد اتجاه + [page:.normal normal]. +

+ +

+ [method:this setFromNormalAndCoplanarPoint]( [param:Vector3 normal], [param:Vector3 point] ) +

+

+ [page:Vector3 normal] - وحدة طول[page:Vector3] تحدد الطبيعي + من الطائرة.
+ [page:Vector3 point] -[page:Vector3]

+ + يضع خصائص الطائرة كما هو محدد بـ[page:Vector3 normal] و + نقطة متعامدية عشوائية[page:Vector3 point]. +

+ +

[method:this translate]( [param:Vector3 offset] )

+

+ [page:Vector3 offset] - المسافة التي يجب تحريك الطائرة بها.

+ + يترجم الطائرة بالمسافة التي يحددها متجه[page:Vector3 offset] + . لاحظ أن هذا يؤثر فقط على ثابت الطائرة ولن يؤثر + المتجه الطبيعي. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/Quaternion.html b/docs/api/ar/math/Quaternion.html new file mode 100644 index 00000000000000..e1c24612bb3c22 --- /dev/null +++ b/docs/api/ar/math/Quaternion.html @@ -0,0 +1,322 @@ + + + + + + + + + +

[name]

+ +

+ تنفيذ [link:http://en.wikipedia.org/wiki/Quaternion كواترنيون].
+ يتم استخدام الكواترنيونات في three.js لتمثيل + [link:https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation الدوران]. +

+ +

+ التكرار عبر مثيل [name] سيعطي مكوناته (x، y، z، w) + بالترتيب المقابل. +

+ +

مثال الكود

+ + + const quaternion = new THREE.Quaternion(); + quaternion.setFromAxisAngle( new THREE.Vector3( 0, 1, 0 ), Math.PI / 2 ); + + const vector = new THREE.Vector3( 1, 0, 0 ); + vector.applyQuaternion( quaternion ); + + +

المنشئ (Constructor)

+ +

+ [name]( [param:Float x], [param:Float y], [param:Float z], [param:Float w] ) +

+

+ [page:Float x] - إحداثية x
+ [page:Float y] - إحداثية y
+ [page:Float z] - إحداثية z
+ [page:Float w] - إحداثية w +

+ +

الخصائص (Properties)

+ +

[property:Boolean isQuaternion]

+

علامة للقراءة فقط للتحقق مما إذا كان الكائن المعطى هو من نوع [name].

+ +

[property:Float x]

+ +

[property:Float y]

+ +

[property:Float z]

+ +

[property:Float w]

+ +

الطرق (Methods)

+ +

[method:Float angleTo]( [param:Quaternion q] )

+

+ يعيد الزاوية بين هذا الكواترنيون وكواترنيون [page:Quaternion q] بالراديان. +

+ +

[method:Quaternion clone]()

+

+ ينشئ كواترنيون جديدًا بخصائص [page:.x x] و [page:.y y] و [page:.z z] + و [page:.w w] متطابقة مع هذا. +

+ +

[method:this conjugate]()

+

+ يعيد التجانس الدوراني لهذا الكواترنيون. التجانس لـ + كواترنيون يمثل نفس الدوران في الاتجاه المعاكس حول + محور الدوران. +

+ +

[method:this copy]( [param:Quaternion q] )

+

+ ينسخ خصائص [page:.x x] و [page:.y y] و [page:.z z] و [page:.w w] + من [page:Quaternion q] إلى هذا الكواترنيون. +

+ +

[method:Boolean equals]( [param:Quaternion v] )

+

+ [page:Quaternion v] - كواترنيون سيتم مقارنة هذا الكواترنيون + إليه.

+ + يقارن خصائص [page:.x x] و [page:.y y] و [page:.z z] و [page:.w w] + من [page:Quaternion v] إلى الخصائص المكافئة لهذا + كواترنيون لتحديد ما إذا كانت تمثل نفس الدوران. +

+ +

[method:Float dot]( [param:Quaternion v] )

+

+ يحسب [link:https://en.wikipedia.org/wiki/Dot_product dot product] + من كواترنيونات [page:Quaternion v] وهذا. +

+ +

+ [method:this fromArray]( [param:Array array], [param:Integer offset] ) +

+

+ [page:Array array] - مصفوفة بتنسيق (x، y، z، w) تستخدم لبناء + الكواترنيون.
+ [page:Integer offset] - (اختياري) إزاحة في المصفوفة.

+ + يضع خصائص [page:.x x] و [page:.y y] و [page:.z z] و [page:.w w] + لهذا الكواترنيون من مصفوفة. +

+ +

[method:this identity]()

+

+ يضع هذا الكواترنيون على الكواترنيون المتطابق ؛ أي إلى + الكواترنيون الذي يمثل "لا دوران". +

+ +

[method:this invert]()

+

+ يعكس هذا الكواترنيون - يحسب [page:.conjugate conjugate]. The + يفترض أن الكواترنيون لديه طول وحدة. +

+ +

[method:Float length]()

+

+ يحسب [link:https://en.wikipedia.org/wiki/Euclidean_distance الطول الإقليدي] + (طول خط مستقيم) لهذا الكواترنيون ، كما هو معتبر + متجه 4 أبعاد. +

+ +

[method:Float lengthSq]()

+

+ يحسب المربع + [link:https://en.wikipedia.org/wiki/Euclidean_distance الطول الإقليدي] + (طول خط مستقيم) لهذا الكواترنيون ، كما هو معتبر متجه 4 أبعاد + . هذا يمكن أن يكون مفيدًا إذا كنت تقارن طول اثنين + كواترنيون ، حيث أن هذا حساب أكثر كفاءة قليلاً من + [page:.length length](). +

+ +

[method:this normalize]()

+

+ [link:https://en.wikipedia.org/wiki/Normalized_vector يعدل] هذا + كواترنيون - أي حساب الكواترنيون الذي يؤدي نفس + دوران كهذا ، ولكن لديه [page:.length length] يساوي `1`. +

+ + +

[method:this multiply]( [param:Quaternion q] )

+

يضرب هذا الكواترنيون بـ[page:Quaternion q].

+ +

+ [method:this multiplyQuaternions]( [param:Quaternion a], [param:Quaternion b] ) +

+

+ يضع هذا الكواترنيون على[page:Quaternion a] x[page:Quaternion b].
+ تم تكييفه من الطريقة الموضحة + [link:http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.html هنا]. +

+ +

[method:this premultiply]( [param:Quaternion q] )

+

يضرب مسبقًا هذا الكواترنيون بـ[page:Quaternion q].

+ +

[method:this random]()

+

يضع هذا الكواترنيون على كواترنيون عشوائي معتدل ومعتدل.

+ +

+ [method:this rotateTowards]( [param:Quaternion q], [param:Float step] ) +

+

+ [page:Quaternion q] - كواترنيون الهدف.
+ [page:Float step] - الخطوة الزاوية بالراديان.

+ + يدور هذا الكواترنيون بخطوة زاوية معطاة إلى كواترنيون محدد + *q*. تضمن الطريقة ألا يتجاوز الكواترنيون النهائي *q*. +

+ +

[method:this slerp]( [param:Quaternion qb], [param:Float t] )

+

+ [page:Quaternion qb] - التدوير الكواترنيون الآخر
+ [page:Float t] - عامل التداخل في الفترة المغلقة `[0، 1]`.

+ + يتعامل مع التداخل الخطي الكروي بين كواترنيون. + [page:Float t] يمثل مقدار التدوير بين هذا الكواترنيون + (حيث[page:Float t] هو 0) و[page:Quaternion qb] (حيث[page:Float t] + هو 1). يتم تعيين هذا الكواترنيون على النتيجة. اطلع أيضًا على الإصدار الثابت + من `slerp` أدناه. + + + // تدور شبكة نحو كواترنيون هدف + mesh.quaternion.slerp( endQuaternion، 0.01 ); + +

+ +

+ [method:this slerpQuaternions]( [param:Quaternion qa], [param:Quaternion qb], [param:Float t] ) +

+

+ يؤدي التداخل الخطي الكروي بين كواترنيون المعطى + وتخزين النتائج في هذا الكواترنيون. +

+ +

+ [method:this set]( [param:Float x], [param:Float y], [param:Float z], [param:Float w] ) +

+

+ يضع خصائص [page:.x x] ،[page:.y y] ،[page:.z z] ،[page:.w w] من هذا + كواترنيون. +

+ +

+ [method:this setFromAxisAngle]( [param:Vector3 axis], [param:Float angle] ) +

+

+ يضع هذا الكواترنيون من التدوير المحدد بـ[page:Vector3 axis] و + [page:Float angle].
+ تم تكييفه من الطريقة + [link:http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.html هنا].
+ يفترض أن يكون `Axis` معتدلًا ، `angle` بالراديان. +

+ +

[method:this setFromEuler]( [param:Euler euler] )

+

+ يضع هذا الكواترنيون من التدوير المحدد بزاوية[page:Euler]. +

+ +

[method:this setFromRotationMatrix]( [param:Matrix4 m] )

+

+ [page:Matrix4 m] - a[page:Matrix4] من الذي العلوي 3x3 من المصفوفة هو + مصفوفة دوران نقية + (أي غير متساوية القياس).
+ يضع هذا الكواترنيون من مكون التدوير لـ[page:Matrix4 m].
+ تم تكييفه من الطريقة + [link:http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.html هنا]. +

+ +

+ [method:this setFromUnitVectors]( [param:Vector3 vFrom], [param:Vector3 vTo] ) +

+

+ يضع هذا الكواترنيون على التدوير المطلوب لتدوير متجه الاتجاه + [page:Vector3 vFrom] إلى متجه الاتجاه[page:Vector3 vTo].
+ تم تكييفه من الطريقة + [link:http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors هنا].
+ يفترض أن يكون[page:Vector3 vFrom] و[page:Vector3 vTo] معتدلًا. +

+ +

+ [method:Array toArray]( [param:Array array], [param:Integer offset] ) +

+

+ [page:Array array] - مصفوفة اختيارية لتخزين الكواترنيون. إذا لم يتم + محدد ، سيتم إنشاء مصفوفة جديدة.
+ [page:Integer offset] - (اختياري) إذا تم تحديده ، فسيتم نسخ + في هذه[page:Array].

+ + يعود بالعناصر العددية لهذا الكواترنيون في مصفوفة بتنسيق + [x، y، z، w]. +

+ +

[method:Array toJSON]()

+

+ هذه الطرق تحدد نتيجة التسلسل لـ[name]. يعود + العناصر العددية لهذا الكواترنيون في مصفوفة بتنسيق [x، y، z، w]. +

+ +

+ [method:this fromBufferAttribute]( [param:BufferAttribute attribute], [param:Integer index] ) +

+

+ [page:BufferAttribute attribute] - السمة المصدر.
+ [page:Integer index] - فهرس في السمة.

+ + يضع خصائص [page:.x x] ،[page:.y y] ،[page:.z z] ،[page:.w w] من هذا + كواترنيون من[page:BufferAttribute attribute]. +

+ +

طرق ثابتة (Static Methods)

+ +

+ [method:undefined slerpFlat]( [param:Array dst], [param:Integer dstOffset], + [param:Array src0], [param:Integer srcOffset0], [param:Array src1], + [param:Integer srcOffset1], [param:Float t] ) +

+

+ [page:Array dst] - مصفوفة الإخراج.
+ [page:Integer dstOffset] - إزاحة في مصفوفة الإخراج.
+ [page:Array src0] - مصفوفة المصدر للكواترنيون البدائي.
+ [page:Integer srcOffset0] - إزاحة في مصفوفة `src0`.
+ [page:Array src1] - مصفوفة المصدر للكواترنيون المستهدف.
+ [page:Integer srcOffset1] - إزاحة في مصفوفة `src1`.
+ [page:Float t] - عامل التداخل المعتدل (بين 0 و 1).

+ + تفترض هذه التطبيقات SLERP أن بيانات الكواترنيون يتم إدارتها في + مصفوفات مسطحة. +

+ +

+ [method:Array multiplyQuaternionsFlat]( [param:Array dst], [param:Integer dstOffset], + [param:Array src0], [param:Integer srcOffset0], [param:Array src1], [param:Integer srcOffset1] ) +

+

+ [page:Array dst] - مصفوفة الإخراج.
+ [page:Integer dstOffset] - إزاحة في مصفوفة الإخراج.
+ [page:Array src0] - مصفوفة المصدر للكواترنيون البدائي.
+ [page:Integer srcOffset0] - إزاحة في مصفوفة `src0`.
+ [page:Array src1] - مصفوفة المصدر للكواترنيون المستهدف.
+ [page:Integer srcOffset1] - إزاحة في مصفوفة `src1`.

+ + تفترض هذه التطبيقات التعددية أن بيانات الكواترنيون يتم إدارتها + في مصفوفات مسطحة. +

+ + + +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/Ray.html b/docs/api/ar/math/Ray.html new file mode 100644 index 00000000000000..c4ad4476a8146b --- /dev/null +++ b/docs/api/ar/math/Ray.html @@ -0,0 +1,237 @@ + + + + + + + + + +

[name]

+ +

+ شعاع ينبعث من أصل في اتجاه معين. يتم استخدام هذا بواسطة + [page:Raycaster] للمساعدة في + [link:https://en.wikipedia.org/wiki/Ray_casting الإشعاع]. يتم استخدام الإشعاع + لاختيار الماوس (معرفة الكائنات في المسافة 3D التي يكون الماوس + فوقها) من بين أشياء أخرى. +

+ +

المنشئ (Constructor)

+ +

[name]( [param:Vector3 origin], [param:Vector3 direction] )

+

+ [page:Vector3 origin] - (اختياري) أصل الـ[page:Ray]. الافتراضي + هو [page:Vector3] عند (0، 0، 0).
+ [page:Vector3 direction] - [page:Vector3] اتجاه الـ[page:Ray]. + يجب تسوية هذا (بـ[page:Vector3.normalize]) لتشغيل الطرق بشكل صحيح. الافتراضي هو [page:Vector3] عند (0، 0، -1).

+ + ينشئ [name] جديدًا. +

+ +

الخصائص (Properties)

+ +

[property:Vector3 origin]

+

+ أصل الـ[page:Ray]. الافتراضي هو [page:Vector3] عند `(0، 0، 0)`. +

+ +

[property:Vector3 direction]

+

+ اتجاه الـ[page:Ray]. يجب تسوية هذا (بـ + [page:Vector3.normalize]) لتشغيل الطرق بشكل صحيح. الافتراضي هو + [page:Vector3] عند (0، 0، -1). +

+ +

الطرق (Methods)

+ +

[method:this applyMatrix4]( [param:Matrix4 matrix4] )

+

+ [page:Matrix4 matrix4] - الـ[page:Matrix4] لتطبيقه على هذا + [page:Ray].

+ + تحويل هذا الـ[page:Ray] بواسطة [page:Matrix4]. +

+ +

[method:Vector3 at]( [param:Float t], [param:Vector3 target] )

+

+ [page:Float t] - المسافة على طول الـ[page:Ray] لاسترداد موضع + ل.
+ [page:Vector3 target] — سيتم نسخ النتيجة في هذا Vector3.

+ + احصل على [page:Vector3] هو مسافة معينة على طول هذا الـ[page:Ray]. +

+ +

[method:Ray clone]()

+

+ ينشئ Ray جديدًا بخصائص [page:.origin origin] و + [page:.direction direction] متطابقة مع هذا. +

+ +

+ [method:Vector3 closestPointToPoint]( [param:Vector3 point], [param:Vector3 target] ) +

+

+ [page:Vector3 point] - النقطة التي سيتم الحصول على أقرب نهج إليها.
+ [page:Vector3 target] — سيتم نسخ النتيجة في هذا Vector3.

+ + احصل على النقطة على طول هذا الـ[page:Ray] التي تكون أقرب إلى المزود + [page:Vector3]. +

+ +

[method:this copy]( [param:Ray ray] )

+

+ ينسخ خصائص [page:.origin origin] و [page:.direction direction] + من [page:Ray ray] إلى هذا الشعاع. +

+ +

[method:Float distanceSqToPoint]( [param:Vector3 point] )

+

+ [page:Vector3 point] - الـ[page:Vector3] لحساب المسافة إليه.

+ + احصل على المسافة المربعة لأقرب نهج بين [page:Ray] + و [page:Vector3]. +

+ +

+ [method:Float distanceSqToSegment]( [param:Vector3 v0], [param:Vector3 v1], + [param:Vector3 optionalPointOnRay], [param:Vector3 optionalPointOnSegment] ) +

+

+ [page:Vector3 v0] - بداية الخط المستقيم.
+ [page:Vector3 v1] - نهاية الخط المستقيم.
+ optionalPointOnRay - (اختياري) إذا تم توفير هذا ، فإنه يتلقى النقطة + على هذا الـ[page:Ray] الأقرب إلى الشريحة.
+ optionalPointOnSegment - (اختياري) إذا تم توفير هذا ، فإنه يتلقى + نقطة على شريحة الخط الأقرب إلى هذا الـ[page:Ray].

+ + احصل على المسافة المربعة بين هذا الـ[page:Ray] وشريحة خط. +

+ +

[method:Float distanceToPlane]( [param:Plane plane] )

+

+ [page:Plane plane] - الـ[page:Plane] للحصول على المسافة إليه.

+ + احصل على المسافة من [page:.origin origin] إلى [page:Plane] ، أو `null` + إذا لم يتقاطع الـ[page:Ray] مع [page:Plane]. +

+ +

[method:Float distanceToPoint]( [param:Vector3 point] )

+

+ [page:Vector3 point] - [page:Vector3] The [page:Vector3] لحساب + مسافة إليه.

+ + احصل على مسافة أقرب نهج بين الـ[page:Ray] و + [page:Vector3 point]. +

+ +

[method:Boolean equals]( [param:Ray ray] )

+

+ [page:Ray ray] - الـ[page:Ray] للمقارنة معه.

+ + يعود بالقيمة true إذا كان هذا والآخر [page:Ray ray] لديهما [page:.origin origin] + و [page:.direction direction] متساويان. +

+ +

+ [method:Vector3 intersectBox]( [param:Box3 box], [param:Vector3 target] ) +

+

+ [page:Box3 box] - الـ[page:Box3] للتقاطع معه.
+ [page:Vector3 target] — سيتم نسخ النتيجة في هذا Vector3.

+ + تقاطع هذا الـ[page:Ray] مع [page:Box3] ، وإرجاع نقطة التقاطع + أو `null` إذا لم يكن هناك تقاطع. +

+ +

+ [method:Vector3 intersectPlane]( [param:Plane plane], [param:Vector3 target] ) +

+

+ [page:Plane plane] - الـ[page:Plane] للتقاطع معه.
+ [page:Vector3 target] — سيتم نسخ النتيجة في هذا Vector3.

+ + تقاطع هذا الـ[page:Ray] مع [page:Plane] ، وإرجاع نقطة التقاطع + أو `null` إذا لم يكن هناك تقاطع. +

+ +

+ [method:Vector3 intersectSphere]( [param:Sphere sphere], [param:Vector3 target] ) +

+

+ [page:Sphere sphere] - الـ[page:Sphere] للتقاطع معه.
+ [page:Vector3 target] — سيتم نسخ النتيجة في هذا Vector3.

+ + تقاطع هذا الـ[page:Ray] مع [page:Sphere] ، وإرجاع نقطة التقاطع + أو `null` إذا لم يكن هناك تقاطع. +

+ +

+ [method:Vector3 intersectTriangle]( [param:Vector3 a], [param:Vector3 b], [param:Vector3 c], [param:Boolean backfaceCulling], [param:Vector3 target] ) +

+

+ [page:Vector3 a], [page:Vector3 b], [page:Vector3 c] - نقاط الـ[page:Vector3] + التي تشكل المثلث.
+ [page:Boolean backfaceCulling] - ما إذا كان سيتم استخدام قص الوجه الخلفي.
+ [page:Vector3 target] — سيتم نسخ النتيجة في هذا Vector3.

+ + تقاطع هذه الـ[page:Ray] مع مثلث ، وإرجاع نقطة التقاطع + أو `null` إذا لم يكن هناك تقاطع. +

+ +

[method:Boolean intersectsBox]( [param:Box3 box] )

+

+ [page:Box3 box] - [page:Box3] للتقاطع معه.

+ + يعود بالقيمة true إذا كان هذا [page:Ray] يتقاطع مع [page:Box3]. +

+ +

[method:Boolean intersectsPlane]( [param:Plane plane] )

+

+ [page:Plane plane] - [page:Plane] للتقاطع معه.

+ + يعود بالقيمة true إذا كان هذا [page:Ray] يتقاطع مع [page:Plane]. +

+ +

[method:Boolean intersectsSphere]( [param:Sphere sphere] )

+

+ [page:Sphere sphere] - [page:Sphere] للتقاطع معه.

+ + يعود بالقيمة true إذا كان هذا [page:Ray] يتقاطع مع [page:Sphere]. +

+ +

[method:this lookAt]( [param:Vector3 v] )

+

+ [page:Vector3 v] - الـ[page:Vector3] الذي سينظر إليه.

+ + يضبط اتجاه الشعاع للإشارة إلى المتجه في الإحداثيات العالمية. +

+ +

[method:this recast]( [param:Float t] )

+

+ [page:Float t] - المسافة على طول الـ[page:Ray] للإدراج.

+ + تحريك أصل هذا الـ[page:Ray] على طول اتجاهه بالمسافة + المحددة. +

+ +

+ [method:this set]( [param:Vector3 origin], [param:Vector3 direction] ) +

+

+ [page:Vector3 origin] - أصل الـ[page:.origin origin] لـ[page:Ray].
+ [page:Vector3 direction] - اتجاه الـ[page:.direction direction] + لـ[page:Ray]. يجب تسوية هذا (بـ[page:Vector3.normalize]) لـ + تشغيل الطرق بشكل صحيح.

+ + يضبط خصائص أصل واتجاه هذا الشعاع + من خلال نسخ القيم من الكائنات المحددة. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/Sphere.html b/docs/api/ar/math/Sphere.html new file mode 100644 index 00000000000000..65962669f86c73 --- /dev/null +++ b/docs/api/ar/math/Sphere.html @@ -0,0 +1,177 @@ + + + + + + + + + +

[name]

+ +

كرة محددة بمركز ونصف قطر.

+ +

المنشئ (Constructor)

+

[name]( [param:Vector3 center], [param:Float radius] )

+

+ [page:Vector3 center] - مركز الكرة. الافتراضي هو [page:Vector3] + عند `(0، 0، 0)`.
+ [page:Float radius] - نصف قطر الكرة. الافتراضي هو -1.

+ + ينشئ [name] جديدًا. +

+ +

الخصائص (Properties)

+ +

[property:Vector3 center]

+

+ [page:Vector3] يحدد مركز الكرة. الافتراضي هو `(0، 0، + 0)`. +

+ +

[property:Float radius]

+

نصف قطر الكرة. الافتراضي هو -1.

+ +

الطرق (Methods)

+ +

[method:this applyMatrix4]( [param:Matrix4 matrix] )

+

+ [page:Matrix4 matrix] - [Page:Matrix4] للتطبيق

+ + يحول هذه الكرة بواسطة [page:Matrix4] المحدد. +

+ +

+ [method:Vector3 clampPoint]( [param:Vector3 point], [param:Vector3 target] ) +

+

+ [page:Vector3 point] - [page:Vector3] النقطة التي سيتم تثبيتها.
+ [page:Vector3 target] — سيتم نسخ النتيجة في هذا Vector3.

+ + يثبت نقطة داخل الكرة. إذا كانت النقطة خارج الكرة ، فسوف + يثبتها على أقرب نقطة على حافة الكرة. لن تتأثر النقاط + بالفعل داخل الكرة. +

+ +

[method:Sphere clone]()

+

+ يعود بكرة جديدة بنفس [page:.center center] و [page:.radius radius] كهذه. +

+ +

[method:Boolean containsPoint]( [param:Vector3 point] )

+

+ [page:Vector3 point] - الـ[page:Vector3] المطلوب التحقق منه

+ + يتحقق مما إذا كانت الكرة تحتوي على [page:Vector3 point] المحدد + شاملاً سطح الكرة. +

+ +

[method:this copy]( [param:Sphere sphere] )

+

+ ينسخ قيم خصائص [page:.center center] و [page:.radius radius] للكرة المعطاة إلى هذه الكرة. +

+ +

[method:Float distanceToPoint]( [param:Vector3 point] )

+

+ يعيد أقرب مسافة من حدود الكرة إلى + [page:Vector3 point]. إذا كانت الكرة تحتوي على النقطة ، فستكون المسافة + سلبية. +

+ +

[method:this expandByPoint]( [param:Vector3 point] )

+

+ [page:Vector3 point] - [page:Vector3] التي يجب تضمينها في + الكرة.

+ + يوسع حدود هذه الكرة لتشمل [page:Vector3 point]. +

+ +

[method:Boolean isEmpty]()

+

+ يتحقق مما إذا كانت الكرة فارغة (تم تعيين نصف القطر إلى رقم + سلبي).
+ الكرات التي يبلغ نصف قطرها 0 تحتوي فقط على نقطة مركزها ولا + يعتبر فارغًا. +

+ +

[method:this makeEmpty]()

+

+ يجعل الكرة فارغة عن طريق تعيين [page:.center center] إلى (0، 0، 0) و + [page:.radius radius] إلى -1. +

+ +

[method:Boolean equals]( [param:Sphere sphere] )

+

يتحقق مما إذا كانت مراكز وأشعة الكرتين متساوية.

+ +

[method:Box3 getBoundingBox]( [param:Box3 target] )

+

+ [page:Box3 target] — سيتم نسخ النتيجة في هذا Box3.

+ + يعود بـ[link:https://en.wikipedia.org/wiki/Minimum_bounding_box Minimum Bounding Box] + للكرة. +

+ +

[method:Boolean intersectsBox]( [param:Box3 box] )

+

+ [page:Box3 box] - [page:Box3] للتحقق من التقاطع ضدها.

+ + يحدد ما إذا كانت هذه الكرة تتقاطع مع [page:Box3 box] المحددة أم لا. +

+ +

[method:Boolean intersectsPlane]( [param:Plane plane] )

+

+ [page:Plane plane] - الطائرة للتحقق من التقاطع ضدها.

+ + يحدد ما إذا كانت هذه الكرة تتقاطع مع [page:Plane plane] المحددة أم لا. +

+ +

[method:Boolean intersectsSphere]( [param:Sphere sphere] )

+

+ [page:Sphere sphere] - الكرة للتحقق من التقاطع ضدها.

+ + يتحقق مما إذا كانت كرتين تتقاطعان. +

+ +

[method:this set]( [param:Vector3 center], [param:Float radius] )

+

+ [page:Vector3 center] - مركز الكرة.
+ [page:Float radius] - نصف قطر الكرة.

+ + يضبط خصائص [page:.center center] و [page:.radius radius] + لهذه الكرة.
+ يرجى ملاحظة أن هذه الطريقة تنسخ فقط القيم من المركز المحدد. +

+ +

+ [method:this setFromPoints]( [param:Array points], [param:Vector3 optionalCenter] ) +

+

+ [page:Array points] - مصفوفة من مواضع [page:Vector3].
+ [page:Vector3 optionalCenter] - موضع اختياري لـ[page:Vector3] + مركز الكرة.

+ + يحسب الكرة المحيطة الدنيا لمصفوفة من نقاط [page:Array]. + إذا تم إعطاء [page:Vector3 optionalCenter] ، يتم استخدامه كمركز للكرة + . وإلا ، يتم حساب مركز المستطيل المحيط المستوي + تغليف نقاط [page:Array]. +

+ +

[method:this translate]( [param:Vector3 offset] )

+

ترجمة مركز الكرة بالإزاحة المحددة [page:Vector3].

+ +

[method:this union]( [param:Sphere sphere] )

+

+ [page:Sphere sphere] - كرة المحيط التي ستتحد مع هذه + كرة.

+ + يوسع هذه الكرة لإغلاق كل من الكرة الأصلية والمعطى + كرة. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/Spherical.html b/docs/api/ar/math/Spherical.html new file mode 100644 index 00000000000000..cabd9cdec9731a --- /dev/null +++ b/docs/api/ar/math/Spherical.html @@ -0,0 +1,90 @@ + + + + + + + + + +

[name]

+ +

+ إحداثيات [link:https://en.wikipedia.org/wiki/Spherical_coordinate_system الكروية] للنقطة. +

+ +

المنشئ (Constructor)

+ +

+ [name]( [param:Float radius], [param:Float phi], [param:Float theta] ) +

+

+ [page:Float radius] - نصف القطر ، أو + [link:https://en.wikipedia.org/wiki/Euclidean_distance المسافة الإقليدية] + (المسافة الخطية) من النقطة إلى الأصل. الافتراضي هو + `1.0`.
+ [page:Float phi] - الزاوية القطبية بالراديان من المحور y (لأعلى). الافتراضي هو + `0`.
+ [page:Float theta] - زاوية خط الاستواء بالراديان حول المحور y (لأعلى). + الافتراضي هو `0`.

+ + الأقطاب (phi) عند المحور y الموجب والسالب. يبدأ خط الاستواء + (theta) في z الموجب. +

+ +

Properties

+ +

[property:Float radius]

+ +

[property:Float phi]

+ +

[property:Float theta]

+ +

الطرق (Methods)

+ +

[method:Spherical clone]()

+

+ يعود بكرة جديدة بنفس خصائص [page:.radius radius] و [page:.phi phi] + و [page:.theta theta] كهذه. +

+ +

[method:this copy]( [param:Spherical s] )

+

+ ينسخ قيم خصائص [page:.radius radius] و [page:.phi phi] و [page:.theta theta] للكرة المعطاة إلى هذه الكرة. +

+ +

[method:this makeSafe]()

+

+ يقيد الزاوية القطبية [page:.phi phi] لتكون بين 0.000001 و pi - + 0.000001. +

+ +

+ [method:this set]( [param:Float radius], [param:Float phi], [param:Float theta] ) +

+

+ يضبط قيم خصائص [page:.radius radius] و [page:.phi phi] و + [page:.theta theta] لهذه الكرة. +

+ +

[method:this setFromVector3]( [param:Vector3 vec3] )

+

+ يضبط قيم خصائص [page:.radius radius] و [page:.phi phi] و + [page:.theta theta] لهذه الكرة من الـ[page:Vector3 Vector3]. +

+ +

+ [method:this setFromCartesianCoords]( [param:Float x], [param:Float y], [param:Float z] ) +

+

+ يضبط قيم خصائص [page:.radius radius] و [page:.phi phi] و + [page:.theta theta] لهذه الكرة من الإحداثيات الديكارتية. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/SphericalHarmonics3.html b/docs/api/ar/math/SphericalHarmonics3.html new file mode 100644 index 00000000000000..e62f45bc711e80 --- /dev/null +++ b/docs/api/ar/math/SphericalHarmonics3.html @@ -0,0 +1,155 @@ + + + + + + + + + +

[name]

+ +

+ يمثل تناغم كروي من الدرجة الثالثة (SH). تستخدم مسابر الضوء هذه الفئة لتشفير معلومات الإضاءة. +

+ +

المنشئ (Constructor)

+

[name]()

+

ينشئ نسخة جديدة من [name].

+ +

الخصائص (Properties)

+ +

[property:Array coefficients]

+

+ مصفوفة تحتوي على (9) معاملات SH. يتم تمثيل معامل واحد كنسخة من [page:Vector3]. +

+ +

[property:Boolean isSphericalHarmonics3]

+

علامة للقراءة فقط للتحقق مما إذا كان الكائن المعطى من نوع [name].

+ +

الطرق (Methods)

+ +

[method:this add]( [param:SphericalHarmonics3 sh] )

+

+ [page:SphericalHarmonics3 sh] - SH المراد إضافته.

+ + يضيف SH المعطى إلى هذه النسخة. +

+ +

+ [method:this addScaledSH]( [param:SphericalHarmonics3 sh], [param:Number scale] ) +

+

+ [page:SphericalHarmonics3 sh] - SH المراد إضافته.
+ [page:Number scale] - عامل التحجيم.

+ + طريقة سهلة لأداء [page:.add]() و [page:.scale]() في آن واحد. +

+ +

[method:SphericalHarmonics3 clone]()

+

يعود بحالة جديدة من [name] بمعاملات متساوية.

+ +

[method:this copy]( [param:SphericalHarmonics3 sh] )

+

+ [page:SphericalHarmonics3 sh] - الـSH للنسخ.

+ + ينسخ الـSH المعطى إلى هذه الحالة. +

+ +

[method:Boolean equals]( [param:SphericalHarmonics3 sh] )

+

+ [page:SphericalHarmonics3 sh] - الـSH للمقارنة معه.

+ + يعود بـtrue إذا كان الـSH المعطى وهذه الحالة لديهما معاملات متساوية. +

+ +

+ [method:this fromArray]( [param:Array array], [param:Number offset] ) +

+

+ [page:Array array] - المصفوفة التي تحمل أرقام معاملات SH + .
+ [page:Number offset] - (اختياري) إزاحة المصفوفة.

+ + يضبط معاملات هذه الحالة من المصفوفة المعطاة. +

+ +

+ [method:Vector3 getAt]( [param:Vector3 normal], [param:Vector3 target] ) +

+

+ [page:Vector3 normal] - متجه الطبيعي (يفترض أن يكون طول الوحدة).
+ [page:Vector3 target] - متجه النتيجة.

+ + يعود بالإشعاع في اتجاه الطبيعي المحدد. +

+ +

+ [method:Vector3 getIrradianceAt]( [param:Vector3 normal], [param:Vector3 target] ) +

+

+ [page:Vector3 normal] - متجه الطبيعي (يفترض أن يكون طول الوحدة).
+ [page:Vector3 target] - متجه النتيجة.

+ + يعود بالإشعاع (الإشعاع الملتف مع فص الجيب) في + اتجاه الطبيعي المحدد. +

+ +

+ [method:this lerp]( [param:SphericalHarmonics3 sh], [param:Number alpha] ) +

+

+ [page:SphericalHarmonics3 sh] - الـSH للتداخل معه.
+ [page:Number alpha] - عامل الألفا.

+ + يتداخل بين الـSH المعطى وهذه الحالة بواسطة + عامل الألفا المعطى. +

+ +

[method:this scale]( [param:Number scale] )

+

+ [page:Number scale] - عامل المقياس.

+ + يقيس هذا الـSH بواسطة عامل المقياس المعطى. +

+ +

[method:this set]( [param:Array coefficients] )

+

+ [page:Array coefficients] - مصفوفة من معاملات SH.

+ + يضبط معاملات SH المعطاة لهذه الحالة. +

+ +

+ [method:Array toArray]( [param:Array array], [param:Number offset] ) +

+

+ [page:Array array] - (اختياري) المصفوفة الهدف.
+ [page:Number offset] - (اختياري) إزاحة المصفوفة.

+ + يعود بمصفوفة بالمعاملات ، أو ينسخهم في المصفوفة المحددة + صفيف. يتم تمثيل المعاملات كأرقام. +

+ +

[method:this zero]()

+

يضبط جميع معاملات SH على 0.

+ +

طرق ثابتة (Static Methods)

+ +

+ [method:undefined getBasisAt]( [param:Vector3 normal], [param:Array shBasis] ) +

+

+ [page:Vector3 normal] - متجه الطبيعي (يفترض أن يكون طول الوحدة).
+ [page:Array shBasis] - الأساس SH الناتج.

+ + يحسب أساس SH لمتجه الطبيعي المحدد. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/Triangle.html b/docs/api/ar/math/Triangle.html new file mode 100644 index 00000000000000..faf321b6209ccd --- /dev/null +++ b/docs/api/ar/math/Triangle.html @@ -0,0 +1,184 @@ + + + + + + + + + +

[name]

+ +

+ مثلث هندسي كما هو محدد بثلاثة [page:Vector3 Vector3s] تمثل زواياه الثلاثة. +

+ +

المنشئ (Constructor)

+ +

[name]( [param:Vector3 a], [param:Vector3 b], [param:Vector3 c] )

+

+ [page:Vector3 a] - الزاوية الأولى للمثلث. الافتراضي هو [page:Vector3] في `(0، 0، 0)`.
+ [page:Vector3 b] - الزاوية الثانية للمثلث. الافتراضي هو [page:Vector3] في `(0، 0، 0)`.
+ [page:Vector3 c] - الزاوية النهائية للمثلث. الافتراضي هو [page:Vector3] في `(0، 0، 0)`.

+ + ينشئ نسخة جديدة من [name]. +

+ +

الخصائص (Properties)

+ +

[property:Vector3 a]

+

+ الزاوية الأولى للمثلث. الافتراضي هو [page:Vector3] في `(0، 0، 0)`. +

+ +

[property:Vector3 b]

+

+ الزاوية الثانية للمثلث. الافتراضي هو [page:Vector3] في `(0، 0، 0)`. +

+ +

[property:Vector3 c]

+

+ الزاوية النهائية للمثلث. الافتراضي هو [page:Vector3] في `(0، 0، 0)`. +

+ +

الطرق (Methods)

+ +

[method:Triangle clone]()

+

+ يعود بمثلث جديد بنفس خصائص [page:.a a]، [page:.b b] و [page:.c c] كهذا. +

+ +

+ [method:Vector3 closestPointToPoint]( [param:Vector3 point], [param:Vector3 target] ) +

+

+ [page:Vector3 point] - [page:Vector3]
+ [page:Vector3 target] - سيتم نسخ النتيجة في هذا Vector3.

+ + يعود بأقرب نقطة على المثلث إلى [page:Vector3 point]. +

+ +

[method:Boolean containsPoint]( [param:Vector3 point] )

+

+ [page:Vector3 point] - [page:Vector3] للتحقق.

+ + يعود بـ true إذا كانت النقطة الممررة، عندما يتم إسقاطها على مستوى المثلث، تقع داخل المثلث. +

+ +

[method:this copy]( [param:Triangle triangle] )

+

+ ينسخ قيم خصائص [page:.a a]، [page:.b b] و [page:.c c] للمثلث الممرر إلى هذا المثلث. +

+ +

[method:Boolean equals]( [param:Triangle triangle] )

+

+ يعود بـ true إذا كانت المثلثين لديهما خصائص متطابقة من [page:.a a]، [page:.b b] + و [page:.c c]. +

+ +

[method:Float getArea]()

+

يرجع مساحة المثلث.

+ +

+ [method:Vector3 getBarycoord]( [param:Vector3 point], [param:Vector3 target] ) +

+

+ [page:Vector3 point] - [page:Vector3]
+ [page:Vector3 target] - سيتم نسخ النتيجة في هذا Vector3.

+ + يرجع إحداثية ثلاثية من المتجه المعطى.

+ + [link:http://commons.wikimedia.org/wiki/File:Barycentric_coordinates_1.png صورة لإحداثيات ثلاثية] +

+ +

[method:Vector3 getMidpoint]( [param:Vector3 target] )

+

+ [page:Vector3 target] - سيتم نسخ النتيجة في هذا Vector3.

+ + حساب نقطة منتصف المثلث. +

+ +

[method:Vector3 getNormal]( [param:Vector3 target] )

+

+ [page:Vector3 target] - سيتم نسخ النتيجة في هذا Vector3.

+ + حساب [link:https://en.wikipedia.org/wiki/Normal_(geometry) متجه العادي] للمثلث. +

+ +

[method:Plane getPlane]( [param:Plane target] )

+

+ [page:Plane target] - سيتم نسخ النتيجة في هذا Plane.

+ + حساب [page:Plane plane] بناءً على المثلث. . +

+ +

+ [method:Vector getInterpolation]( [param:Vector3 point], [param:Vector3 p1], [param:Vector3 p2], [param:Vector3 p3], [param:Vector v1], [param:Vector v2], [param:Vector v3], [param:Vector target] ) +

+

+ [page:Vector3 point] - موقع النقطة المُركبة.
+ [page:Vector3 p1] - موقع الرأس الأول.
+ [page:Vector3 p2] - موقع الرأس الثاني.
+ [page:Vector3 p3] - موقع الرأس الثالث.
+ [page:Vector v1] - قيمة الرأس الأولى.
+ [page:Vector v2] - قيمة الرأس الثانية.
+ [page:Vector v3] - قيمة الرأس الثالثة.
+ [page:Vector target] — سيتم نسخ النتيجة في هذا Vector.

+ + تعود بالقيمة المُركبة بشكل ثلاثي للنقطة المعطاة على المثلث. +

+ +

[method:Boolean intersectsBox]( [param:Box3 box] )

+

+ [page:Box3 box] - مربع للتحقق من التقاطع ضده.

+ + يحدد ما إذا كان هذا المثلث يتقاطع مع [page:Box3 box] أم لا. +

+ +

[method:Boolean isFrontFacing]( [param:Vector3 direction] )

+

+ [page:Vector3 direction] - الاتجاه الذي يتم اختباره.

+ + ما إذا كان المثلث موجهًا نحو الاتجاه المعطى أم لا. +

+ +

+ [method:this set]( [param:Vector3 a], [param:Vector3 b], [param:Vector3 c] ) +

+

+ يضبط خصائص المثلث [page:.a a]، [page:.b b] و [page:.c c] على [page:Vector3 vector3s] الممررة.
+ يرجى ملاحظة أن هذه الطريقة تنسخ فقط القيم من الكائنات المعطاة. +

+ +

+ [method:this setFromAttributeAndIndices]( [param:BufferAttribute attribute], + [param:Integer i0], [param:Integer i1], [param:Integer i2] ) +

+

+ attribute - [page:BufferAttribute] من بيانات الرأس
+ i0 - فهرس [page:Integer]
+ i1 - فهرس [page:Integer]
+ i2 - فهرس [page:Integer]

+ + يضبط رؤوس المثلث من بيانات رأس سمة الحافظة. +

+ +

+ [method:this setFromPointsAndIndices]( [param:Array points], [param:Integer i0], [param:Integer i1], [param:Integer i2] ) +

+

+ points - مصفوفة من [page:Vector3]s
+ i0 - فهرس [page:Integer]
+ i1 - فهرس [page:Integer]
+ i2 - فهرس [page:Integer]

+ + يضبط متجهات المثلث على المتجهات في المصفوفة. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/Vector2.html b/docs/api/ar/math/Vector2.html new file mode 100644 index 00000000000000..9893bb26c5c66b --- /dev/null +++ b/docs/api/ar/math/Vector2.html @@ -0,0 +1,353 @@ + + + + + + + + + +

[name]

+ +

+ فئة تمثل متجه 2D [link:https://en.wikipedia.org/wiki/Vector_space]. متجه 2D هو زوج مرتب من الأرقام (مسمى x و y)، والذي يمكن استخدامه لتمثيل عدد من الأشياء، مثل: +

+ +
    +
  • نقطة في الفضاء 2D (أي موضع على مستوى).
  • +
  • + اتجاه وطول عبر مستوى. في three.js سيكون الطول دائمًا [link:https://en.wikipedia.org/wiki/Euclidean_distance الطول الإقليدي] (طول الخط المستقيم) من `(0، 0)` إلى `(x، y)` ويتم قياس الاتجاه أيضًا من `(0، 0)` نحو `(x، y)`. +
  • +
  • أي زوج مرتب عشوائي من الأرقام.
  • +
+ +

+ هناك أشياء أخرى يمكن استخدام متجه 2D لتمثيلها، مثل المتجهات الزخمية، والأعداد المركبة وما إلى ذلك، ومع ذلك فإن هذه هي الاستخدامات الأكثر شيوعًا في three.js. +

+ +

+ التكرار عبر نسخة [name] سيعود بمكوناته `(x، y)` بالترتيب المقابل. +

+ +

مثال للكود

+ + + const a = new THREE.Vector2( 0, 1 ); + + //no arguments; will be initialised to (0, 0) + const b = new THREE.Vector2( ); + + const d = a.distanceTo( b ); + + +

المنشئ (Constructor)

+ +

[name]( [param:Float x], [param:Float y] )

+

+ [page:Float x] - قيمة x لهذا المتجه. الافتراضي هو `0`.
+ [page:Float y] - قيمة y لهذا المتجه. الافتراضي هو `0`.

+ + ينشئ نسخة جديدة من [name]. +

+ +

الخصائص (Properties)

+ +

[property:Float height]

+

اسم آخر لـ [page:.y y].

+ +

[property:Boolean isVector2]

+

علامة للقراءة فقط للتحقق مما إذا كان الكائن المعطى من نوع [name].

+ +

[property:Float width]

+

اسم آخر لـ [page:.x x].

+ +

[property:Float x]

+ +

[property:Float y]

+ +

الطرق (Methods)

+ +

[method:this add]( [param:Vector2 v] )

+

يضيف [page:Vector2 v] إلى هذا المتجه.

+ +

[method:this addScalar]( [param:Float s] )

+

+ يضيف القيمة القياسية [page:Float s] إلى قيم [page:.x x] و [page:.y y] لهذا المتجه. +

+ +

[method:this addScaledVector]( [param:Vector2 v], [param:Float s] )

+

+ يضيف الضعف من [page:Vector2 v] و [page:Float s] إلى هذا المتجه. +

+ +

[method:this addVectors]( [param:Vector2 a], [param:Vector2 b] )

+

يضبط هذا المتجه على [page:Vector2 a] + [page:Vector2 b].

+ +

[method:Float angle]()

+

+ يحسب الزاوية بالراديان لهذا المتجه بالنسبة للمحور x الموجب. +

+ +

[method:Float angleTo]( [param:Vector2 v] )

+

+ يعود بالزاوية بين هذا المتجه والمتجه [page:Vector2 v] بالراديان. +

+ +

[method:this applyMatrix3]( [param:Matrix3 m] )

+

+ يضرب هذا المتجه (مع 1 ضمني كمكون الثالث) في m. +

+ +

[method:this ceil]()

+

+ تتم جولة مكونات [page:.x x] و [page:.y y] لهذا المتجه إلى أعلى إلى أقرب قيمة صحيحة. +

+ +

[method:this clamp]( [param:Vector2 min], [param:Vector2 max] )

+

+ [page:Vector2 min] - الحد الأدنى لقيم x و y.
+ [page:Vector2 max] - الحد الأقصى لقيم x و y في النطاق المطلوب

+ + إذا كانت قيمة x أو y لهذا المتجه أكبر من قيمة x أو y للمتجه max، يتم استبدالها بالقيمة المقابلة.

+ إذا كانت قيمة x أو y لهذا المتجه أقل من قيمة x أو y للمتجه min، يتم استبدالها بالقيمة المقابلة. +

+ +

[method:this clampLength]( [param:Float min], [param:Float max] )

+

+ [page:Float min] - الحد الأدنى الذي سيتم تثبيت الطول عليه
+ [page:Float max] - الحد الأقصى الذي سيتم تثبيت الطول عليه

+ + إذا كان طول هذا المتجه أكبر من قيمة max، يتم استبداله بالقيمة max.

+ إذا كان طول هذا المتجه أقل من قيمة min، يتم استبداله بالقيمة min. +

+ +

[method:this clampScalar]( [param:Float min], [param:Float max] )

+

+ [page:Float min] - الحد الأدنى الذي ستُثبَّت عليه العناصر +
+ [page:Float max] - الحد الأقصى الذي سُتثبَّت عليه العناصر

+ + إذا كانت قيم x أو y لهذا المتجه أكبر من قيمة max، يتم استبدالها بالقيمة max.

+ إذا كانت قيم x أو y لهذا المتجه أقل من قيمة min، يتم استبدالها بالقيمة min. +

+ +

[method:Vector2 clone]()

+

+ يعود بـ Vector2 جديد بنفس قيم [page:.x x] و [page:.y y] كهذا. +

+ +

[method:this copy]( [param:Vector2 v] )

+

+ ينسخ قيم خصائص [page:.x x] و [page:.y y] لـ Vector2 الممرر إلى هذا Vector2. +

+ +

[method:Float distanceTo]( [param:Vector2 v] )

+

يحسب المسافة من هذا المتجه إلى [page:Vector2 v].

+ +

[method:Float manhattanDistanceTo]( [param:Vector2 v] )

+

+ يحسب [link:https://en.wikipedia.org/wiki/Taxicab_geometry مسافة مانهاتن] من هذا المتجه إلى [page:Vector2 v]. +

+ +

[method:Float distanceToSquared]( [param:Vector2 v] )

+

+ يحسب المسافة المربعة من هذا المتجه إلى [page:Vector2 v]. إذا كنت تقارن فقط المسافة مع مسافة أخرى، يجب عليك مقارنة المسافة المربعة بدلاً من ذلك لأنه أكثر كفاءة قليلاً في الحساب. +

+ +

[method:this divide]( [param:Vector2 v] )

+

يقسم هذا المتجه على [page:Vector2 v].

+ +

[method:this divideScalar]( [param:Float s] )

+

يقسم هذا المتجه على العدد القياسي [page:Float s].

+ +

[method:Float dot]( [param:Vector2 v] )

+

+ يحسب [link:https://en.wikipedia.org/wiki/Dot_product حاصل الضرب النقطي] لهذا المتجه و [page:Vector2 v]. +

+ +

[method:Float cross]( [param:Vector2 v] )

+

+ يحسب [link:https://en.wikipedia.org/wiki/Cross_product حاصل الضرب المتقاطع] لهذا المتجه و [page:Vector2 v]. يرجى ملاحظة أن "حاصل الضرب المتقاطع" في 2D غير محدد بشكل جيد. تحسب هذه الوظيفة حاصل ضرب متقاطع هندسي يستخدم في الغالب في رسومات 2D +

+ +

[method:Boolean equals]( [param:Vector2 v] )

+

+ يعود بـ `true` إذا كانت مكونات هذا المتجه و [page:Vector2 v] متطابقة بدقة؛ `false` في حالة عدم ذلك. +

+ +

[method:this floor]()

+

+ تتم جولة مكونات هذا المتجه إلى أسفل إلى أقرب قيمة صحيحة. +

+ +

+ [method:this fromArray]( [param:Array array], [param:Integer offset] ) +

+

+ [page:Array array] - المصفوفة المصدر.
+ [page:Integer offset] - (اختياري) إزاحة في المصفوفة. الافتراضي هو 0.

+ + يضبط قيمة [page:.x x] لهذا المتجه على `array[ offset ]` وقيمة [page:.y y] على `array[ offset + 1 ]`. +

+ +

+ [method:this fromBufferAttribute]( [param:BufferAttribute attribute], [param:Integer index] ) +

+

+ [page:BufferAttribute attribute] - السمة المصدر.
+ [page:Integer index] - فهرس في السمة.

+ + يضبط قيم [page:.x x] و [page:.y y] لهذا المتجه من [page:BufferAttribute attribute]. +

+ +

[method:Float getComponent]( [param:Integer index] )

+

+ [page:Integer index] - 0 أو 1.

+ + إذا كان index يساوي 0 يعود بقيمة [page:.x x].
+ إذا كان index يساوي 1 يعود بقيمة [page:.y y]. +

+ +

[method:Float length]()

+

+ يحسب [link:https://en.wikipedia.org/wiki/Euclidean_distance الطول الإقليدي] (طول الخط المستقيم) من (0، 0) إلى (x، y). +

+ +

[method:Float manhattanLength]()

+

+ يحسب [link:http://en.wikipedia.org/wiki/Taxicab_geometry طول مانهاتن] لهذا المتجه. +

+ +

[method:Float lengthSq]()

+

+ يحسب مربع [link:https://en.wikipedia.org/wiki/Euclidean_distance الطول الإقليدي] (طول الخط المستقيم) من (0، 0) إلى (x، y). إذا كنت تقارن أطوال المتجهات، يجب عليك مقارنة الطول المربع بدلاً من ذلك لأنه أكثر كفاءة قليلاً في الحساب. +

+ +

[method:this lerp]( [param:Vector2 v], [param:Float alpha] )

+

+ [page:Vector2 v] - [page:Vector2] للتداخل نحوه.
+ [page:Float alpha] - عامل التداخل، عادة في الفترة المغلقة `[0، 1]`.

+ + يتداخل بشكل خطي بين هذا المتجه و [page:Vector2 v]، حيث alpha هو نسبة المسافة على طول الخط - سيكون alpha = 0 هذا المتجه، وسيكون alpha = 1 [page:Vector2 v]. +

+ +

+ [method:this lerpVectors]( [param:Vector2 v1], [param:Vector2 v2], [param:Float alpha] ) +

+

+ [page:Vector2 v1] - [page:Vector2] البداية.
+ [page:Vector2 v2] - [page:Vector2] للتداخل نحوه.
+ [page:Float alpha] - عامل التداخل، عادة في الفترة المغلقة `[0، 1]`.

+ + يضبط هذا المتجه ليكون المتجه المُركب بشكل خطي بين [page:Vector2 v1] و [page:Vector2 v2] حيث alpha هو نسبة المسافة على طول الخط الذي يربط بين المتجهين - سيكون alpha = 0 [page:Vector2 v1]، وسيكون alpha = 1 [page:Vector2 v2]. +

+ +

[method:this negate]()

+

يعكس هذا المتجه - أي يضع x = -x و y = -y.

+ +

[method:this normalize]()

+

+ يحول هذا المتجه إلى [link:https://en.wikipedia.org/wiki/Unit_vector متجه وحدة] - + أي يضعه مساوٍ لمتجه بنفس الاتجاه + كهذا، ولكن [page:.length length] 1. +

+ +

[method:this max]( [param:Vector2 v] )

+

+ إذا كانت قيمة x أو y لهذا المتجه أقل من قيمة x أو y لـ [page:Vector2 v]، استبدل تلك القيمة بالقيمة العظمى المقابلة. +

+ +

[method:this min]( [param:Vector2 v] )

+

+ إذا كانت قيمة x أو y لهذا المتجه أكبر من قيمة x أو y لـ [page:Vector2 v]، استبدل تلك القيمة بالقيمة الدنيا المقابلة. +

+ +

[method:this multiply]( [param:Vector2 v] )

+

يضرب هذا المتجه في [page:Vector2 v].

+ +

[method:this multiplyScalar]( [param:Float s] )

+

يضرب هذا المتجه في العدد القياسي [page:Float s].

+ +

+ [method:this rotateAround]( [param:Vector2 center], [param:Float angle] ) +

+

+ [page:Vector2 center] - النقطة التي يتم التدوير حولها.
+ [page:Float angle] - الزاوية التي يتم التدوير بها، بالراديان.

+ + يدور هذا المتجه حول [page:Vector2 center] بـ [page:Float angle] راديان. +

+ +

[method:this round]()

+

+ تتم جولة مكونات هذا المتجه إلى أقرب قيمة صحيحة. +

+ +

[method:this roundToZero]()

+

+ تتم جولة مكونات هذا المتجه نحو الصفر (لأعلى إذا كان سالبًا، لأسفل إذا كان موجبًا) إلى قيمة صحيحة. +

+ +

[method:this set]( [param:Float x], [param:Float y] )

+

يضبط مكونات [page:.x x] و [page:.y y] لهذا المتجه.

+ +

+ [method:this setComponent]( [param:Integer index], [param:Float value] ) +

+

+ [page:Integer index] - 0 أو 1.
+ [page:Float value] - [page:Float]

+ + إذا كان index يساوي 0 ضع [page:.x x] على [page:Float value].
+ إذا كان index يساوي 1 ضع [page:.y y] على [page:Float value] +

+ +

[method:this setLength]( [param:Float l] )

+

+ يضبط هذا المتجه على متجه بنفس الاتجاه كهذا، ولكن [page:.length length] [page:Float l]. +

+ +

[method:this setScalar]( [param:Float scalar] )

+

+ يضبط قيم [page:.x x] و [page:.y y] لهذا المتجه على حد سواء مساوية لـ [page:Float scalar]. +

+ +

[method:this setX]( [param:Float x] )

+

يستبدل قيمة [page:.x x] لهذا المتجه بـ [page:Float x].

+ +

[method:this setY]( [param:Float y] )

+

يستبدل قيمة [page:.y y] لهذا المتجه بـ [page:Float y].

+ +

[method:this sub]( [param:Vector2 v] )

+

يطرح [page:Vector2 v] من هذا المتجه.

+ +

[method:this subScalar]( [param:Float s] )

+

+ يطرح [page:Float s] من مكونات [page:.x x] و [page:.y y] لهذا المتجه. +

+ +

[method:this subVectors]( [param:Vector2 a], [param:Vector2 b] )

+

يضبط هذا المتجه على [page:Vector2 a] - [page:Vector2 b].

+ +

+ [method:Array toArray]( [param:Array array], [param:Integer offset] ) +

+

+ [page:Array array] - (اختياري) مصفوفة لتخزين هذا المتجه فيها. إذا لم يتم توفير هذا، سيتم إنشاء مصفوفة جديدة.
+ [page:Integer offset] - (اختياري) إزاحة اختيارية في المصفوفة.

+ + يرجع مصفوفة [x، y]، أو ينسخ x و y في المصفوفة المعطاة من نوع [page:Array array]. +

+ +

[method:this random]()

+

+ يضبط كل مكون من مكونات هذا المتجه على قيمة شبه عشوائية بين 0 و 1، باستثناء 1. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/Vector3.html b/docs/api/ar/math/Vector3.html new file mode 100644 index 00000000000000..486c1fa3fd8287 --- /dev/null +++ b/docs/api/ar/math/Vector3.html @@ -0,0 +1,523 @@ + + + + + + + + + +

[name]

+ +

+ فئة تمثل [link:https://en.wikipedia.org/wiki/Vector_space متجه] ثلاثي الأبعاد. + متجه ثلاثي الأبعاد هو ثلاثي مرتب من الأرقام (مسمى x و y و z) ، والذي يمكن استخدامه لتمثيل عدد من الأشياء ، مثل: +

+ +
    +
  • نقطة في الفضاء ثلاثي الأبعاد.
  • +
  • + اتجاه وطول في الفضاء ثلاثي الأبعاد. في three.js سيكون الطول دائمًا + [link:https://en.wikipedia.org/wiki/Euclidean_distance المسافة الإقليدية] + (المسافة المستقيمة) من `(0, 0, 0)` إلى `(x, y, z)` و + يتم قياس الاتجاه أيضًا من `(0, 0, 0)` نحو `(x, y, z)`. +
  • +
  • أي ثلاثي مرتب عشوائي من الأرقام.
  • +
+ +

+ هناك أشياء أخرى يمكن استخدام متجه ثلاثي الأبعاد لتمثيلها ، مثل + متجهات الزخم وما إلى ذلك ، ومع ذلك فإن هذه هي الاستخدامات الأكثر شيوعًا في + three.js. +

+ +

+ التكرار عبر مثيل [name] سوف ينتج عنه مكوناته `(x, y, z)` + بالترتيب المقابل. +

+ +

مثال للكود

+ + const a = new THREE.Vector3( 0, 1, 0 ); + + //no arguments; will be initialised to (0, 0, 0) + const b = new THREE.Vector3( ); + + const d = a.distanceTo( b ); + + +

المنشئ (Constructor)

+ +

[name]( [param:Float x], [param:Float y], [param:Float z] )

+

+ [page:Float x] - قيمة x لهذا الفيكتور. القيمة الافتراضية هي `0`.
+ [page:Float y] - قيمة y لهذا الفيكتور. القيمة الافتراضية هي `0`.
+ [page:Float z] - قيمة z لهذا الفيكتور. القيمة الافتراضية هي `0`.

+ + ينشئ [name] جديد. +

+ +

الخصائص (Properties)

+ +

[property:Boolean isVector3]

+

علامة للتحقق مما إذا كان الكائن المعطى من نوع [name] أم لا.

+ +

[property:Float x]

+ +

[property:Float y]

+ +

[property:Float z]

+ +

الوظائف (Methods)

+ +

[method:this add]( [param:Vector3 v] )

+

يضيف [page:Vector3 v] إلى هذا الفيكتور.

+ +

[method:this addScalar]( [param:Float s] )

+

+ يضيف قيمة العدد s إلى قيم [page:.x x]، [page:.y y] و [page:.z z] لهذا الفيكتور. +

+ +

[method:this addScaledVector]( [param:Vector3 v], [param:Float s] )

+

+ يضيف الضرب المتعدد لـ [page:Vector3 v] و [page:Float s] إلى هذا الفيكتور. +

+ +

[method:this addVectors]( [param:Vector3 a], [param:Vector3 b] )

+

يعيد هذا الفيكتور إلى [page:Vector3 a] + [page:Vector3 b].

+ +

+ [method:this applyAxisAngle]( [param:Vector3 axis], [param:Float angle] ) +

+

+ [page:Vector3 axis] - محور [page:Vector3] موحّد.
+ [page:Float angle] - زاوية بالراديان.

+ + يطبق تحويلًا يُحدد بواسطة محور وزاوية على هذا الفيكتور. +

+ +

[method:this applyEuler]( [param:Euler euler] )

+

+ يطبق تحويل أويلر على هذا الفيكتور من خلال تحويل الكائن [page:Euler] + إلى [page:Quaternion] وتطبيقه. +

+ +

[method:this applyMatrix3]( [param:Matrix3 m] )

+

يضرب هذا الفيكتور بواسطة [page:Matrix3 m].

+ +

[method:this applyMatrix4]( [param:Matrix4 m] )

+

+ يضرب هذا الفيكتور (مع وجود 1 ضمن الأبعاد الرابعة) بـ m، ويقسمه على + التوازن. +

+ +

[method:this applyNormalMatrix]( [param:Matrix3 m] )

+

+ يضرب هذا الفيكتور بواسطة مصفوفة القوامة العادية [page:Matrix3 m] ويقوم + بتطبيع النتيجة. +

+ +

[method:this applyQuaternion]( [param:Quaternion quaternion] )

+

يطبق تحويل [page:Quaternion] على هذا الفيكتور.

+ +

[method:Float angleTo]( [param:Vector3 v] )

+

+ يعيد الزاوية بين هذا الفيكتور وفيكتور [page:Vector3 v] بالراديان. +

+ +

[method:this ceil]()

+

+ يقوم بتقريب مكونات [page:.x x]، [page:.y y] و [page:.z z] لهذا الفيكتور إلى + أقرب قيمة صحيحة. +

+ +

[method:this clamp]( [param:Vector3 min], [param:Vector3 max] )

+

+ [page:Vector3 min] - القيم [page:.x x]، [page:.y y] و [page:.z z] الدنيا.
+ [page:Vector3 max] - القيم [page:.x x]، [page:.y y] و [page:.z z] العليا في النطاق المطلوب.

+ + إذا كانت قيم x أو y أو z لهذا الفيكتور أكبر من قيم x أو y أو z العليا للفيكتور، يتم استبدالها بالقيم المقابلة.

+ إذا كانت قيم x أو y أو z لهذا الفيكتور أقل من قيم x أو y أو z الدنيا للفيكتور، يتم استبدالها بالقيم المقابلة. +

+ + +

[method:this clampLength]( [param:Float min], [param:Float max] )

+

+ [page:Float min] - القيمة الدنيا التي ستتم تقييدها للطول
+ [page:Float max] - القيمة العليا التي ستتم تقييدها للطول

+ + إذا كان طول هذا الفيكتور أكبر من القيمة العليا، سيتم تصغير الفيكتور بحيث يصبح طوله هو القيمة العليا.

+ إذا كان طول هذا الفيكتور أقل من القيمة الدنيا، سيتم تكبير الفيكتور بحيث يصبح طوله هو القيمة الدنيا. +

+ +

[method:this clampScalar]( [param:Float min], [param:Float max] )

+

+ [page:Float min] - القيمة الدنيا التي ستتم تقييدها للمكونات +
+ [page:Float max] - القيمة العليا التي ستتم تقييدها للمكونات

+ + إذا كانت قيم x أو y أو z لهذا الفيكتور أكبر من القيمة العليا، سيتم استبدالها بالقيمة العليا.

+ إذا كانت قيم x أو y أو z لهذا الفيكتور أقل من القيمة الدنيا، سيتم استبدالها بالقيمة الدنيا. +

+ +

[method:Vector3 clone]()

+

+ يعيد فيكتور3 جديدًا بنفس القيم x، y، و z كهذا الفيكتور. +

+ +

[method:this copy]( [param:Vector3 v] )

+

+ ينسخ قيم خصائص x، y، و z لفيكتور3 الممرر إلى هذا الفيكتور. +

+ +

[method:this cross]( [param:Vector3 v] )

+

+ يضبط هذا الفيكتور إلى ناتج الضرب النقطي بينه وبين Vector3 v. +

+ +

[method:this crossVectors]( [param:Vector3 a], [param:Vector3 b] )

+

+ يضبط هذا الفيكتور إلى ناتج الضرب النقطي بين Vector3 a و Vector3 b. +

+ +

[method:Float distanceTo]( [param:Vector3 v] )

+

يحسب المسافة من هذا الفيكتور إلى Vector3 v.

+ +

[method:Float manhattanDistanceTo]( [param:Vector3 v] )

+

+ يحسب [link:https://en.wikipedia.org/wiki/Taxicab_geometry Manhattan distance] + من هذا المتجه إلى [page:Vector3 v]. +

+ +

[method:Float distanceToSquared]( [param:Vector3 v] )

+

+ يحسب المسافة المربعة من هذا المتجه إلى [page:Vector3 v]. إذا كنت + تقارن المسافة مع مسافة أخرى، يجب عليك مقارنة + المسافة المربعة بدلاً من ذلك كما هو أكثر كفاءة قليلاً في + الحساب. +

+ +

[method:this divide]( [param:Vector3 v] )

+

يقسم هذا المتجه بواسطة [page:Vector3 v].

+ +

[method:this divideScalar]( [param:Float s] )

+

يقسم هذا المتجه بواسطة العدد الفردي [page:Float s].

+ +

[method:Float dot]( [param:Vector3 v] )

+

+ حساب [link:https://en.wikipedia.org/wiki/Dot_product dot product] + لهذا المتجه و[page:Vector3 v]. +

+ +

[method:Boolean equals]( [param:Vector3 v] )

+

+ يعود `true` إذا كانت مكونات هذا المتجه و[page:Vector3 v] هي + صارمة متساوية؛ `false` في حالات أخرى. +

+ +

[method:this floor]()

+

+ يتم تقريب مكونات هذا المتجه إلى أسفل إلى أقرب قيمة صحيحة + قيمة. +

+ +

+ [method:this fromArray]( [param:Array array], [param:Integer offset] ) +

+

+ [page:Array array] - المصفوفة المصدر.
+ [page:Integer offset] - ( اختياري) الإزاحة في المصفوفة. الافتراضي هو + 0.

+ + يضع قيمة هذا المتجه [page:.x x] لتكون `array[ offset + 0 ]`، قيمة [page:.y y] + لتكون `array[ offset + 1 ]` وقيمة [page:.z z] لتكون `array[ offset + 2 ]`. +

+ +

+ [method:this fromBufferAttribute]( [param:BufferAttribute attribute], [param:Integer index] ) +

+

+ [page:BufferAttribute attribute] - السمة المصدر.
+ [page:Integer index] - الفهرس في السمة.

+ + يضع قيم هذا المتجه [page:.x x]، [page:.y y] و [page:.z z] من + ال[page:BufferAttribute attribute]. +

+ +

[method:Float getComponent]( [param:Integer index] )

+

+ [page:Integer index] - 0، 1 أو 2.

+ + إذا كان الفهرس يساوي 0 يعيد قيمة [page:.x x].
+ إذا كان الفهرس يساوي 1 يعيد قيمة [page:.y y].
+ إذا كان الفهرس يساوي 2 يعيد قيمة [page:.z z]. +

+ +

[method:Float length]()

+

+ يحسب [link:https://en.wikipedia.org/wiki/Euclidean_distance الطول الإقليدي] + (طول الخط المستقيم) من (0، 0، 0) إلى (x، y، z). +

+ +

[method:Float manhattanLength]()

+

+ يحسب طول مانهاتن + لهذا المتجه. +

+ +

[method:Float lengthSq]()

+

+ يحسب مربع + [link:https://en.wikipedia.org/wiki/Euclidean_distance الطول الإقليدي] + (طول الخط المستقيم) من (0، 0، 0) إلى (x، y، z). إذا كنت تقارن + أطوال المتجهات، يجب عليك مقارنة طول المربع بدلاً من ذلك كما + أنه أكثر كفاءة قليلاً في الحساب. +

+ +

[method:this lerp]( [param:Vector3 v], [param:Float alpha] )

+

+ [page:Vector3 v] - [page:Vector3] للتداخل نحوه.
+ [page:Float alpha] - عامل التداخل، عادة في المغلق + الفاصل `[0, 1]`.

+ + تداخل خطي بين هذا المتجه و[page:Vector3 v]، حيث alpha + هو نسبة المسافة على طول الخط - alpha = 0 سيكون هذا المتجه، + وalpha = 1 ستكون [page:Vector3 v]. +

+ +

+ [method:this lerpVectors]( [param:Vector3 v1], [param:Vector3 v2], [param:Float alpha] ) +

+

+ [page:Vector3 v1] - البداية [page:Vector3].
+ [page:Vector3 v2] - [page:Vector3] للتداخل نحوه.
+ [page:Float alpha] - عامل التداخل، عادة في الفاصل المغلق + `[0، 1]`.

+ + يضع هذا المتجه ليكون المتجه المتداخل خطيًا بين + [page:Vector3 v1] و [page:Vector3 v2] حيث يكون ألفا هو النسبة + المئوية للمسافة على طول الخط الذي يربط المتجهين - سيكون ألفا = 0 + [page:Vector3 v1]، وسيكون ألفا = 1 [page:Vector3 v2]. +

+ +

[method:this max]( [param:Vector3 v] )

+

+ إذا كانت قيمة x أو y أو z لهذا المتجه أقل من قيمة x أو y أو z + لـ [page:Vector3 v]، استبدل تلك القيمة بالقيمة القصوى المقابلة. +

+ +

[method:this min]( [param:Vector3 v] )

+

+ إذا كانت قيمة x أو y أو z لهذا المتجه أكبر من قيمة x أو y + أو z لـ [page:Vector3 v]، استبدل تلك القيمة بالقيمة الدنيا المقابلة. +

+ +

[method:this multiply]( [param:Vector3 v] )

+

يضرب هذا المتجه بـ [page:Vector3 v].

+ +

[method:this multiplyScalar]( [param:Float s] )

+

يضرب هذا المتجه بالعدد القائم [page:Float s].

+ +

+ [method:this multiplyVectors]( [param:Vector3 a], [param:Vector3 b] ) +

+

+ يضع هذا المتجه يساوي [page:Vector3 a] * [page:Vector3 b]، + مكونًا حكيمًا. +

+ +

[method:this negate]()

+

يعكس هذا المتجه - أي يضع x = -x، y = -y و z = -z.

+ +

[method:this normalize]()

+

+ تحويل هذا المتجه إلى متجه وحدة + - أي يضعه يساوي متجه بنفس الاتجاه + كهذا واحد، ولكن طول الصفحة 1. +

+ +

[method:this project]( [param:Camera camera] )

+

+ [page:Camera camera] — الكاميرا المستخدمة في الإسقاط.

+ + يسقط هذا المتجه من مساحة العالم إلى مساحة جهاز الكاميرا المعيارية + (NDC). +

+ +

[method:this projectOnPlane]( [param:Vector3 planeNormal] )

+

+ [page:Vector3 planeNormal] - متجه يمثل عادي الطائرة.

+ + [link:https://en.wikipedia.org/wiki/Vector_projection يسقط] هذا + المتجه على طائرة عن طريق طرح هذا المتجه المسقط على عادي الطائرة من هذا + المتجه. +

+ +

[method:this projectOnVector]( [param:Vector3 v] )

+

+ [link:https://en.wikipedia.org/wiki/Vector_projection يسقط] هذا + المتجه على [page:Vector3 v]. +

+ +

[method:this reflect]( [param:Vector3 normal] )

+

+ [page:Vector3 normal] - العادي إلى طائرة الانعكاس

+ + يعكس هذا المتجه قبالة طائرة متعامدة على [page:Vector3 normal]. + يفترض أن يكون العادي لديه طول وحدة. +

+ +

[method:this round]()

+

+ تتم جولة مكونات هذا المتجه إلى أقرب قيمة صحيحة. +

+ +

[method:this roundToZero]()

+

+ تتم جولة مكونات هذا المتجه نحو الصفر (لأعلى إذا كان سالبًا، + لأسفل إذا كان إيجابيًا) إلى قيمة صحيحة. +

+ +

+ [method:this set]( [param:Float x], [param:Float y], [param:Float z] ) +

+

+ يضبط مكونات [page:.x x]، [page:.y y] و [page:.z z] من هذا + المتجه. +

+ +

+ [method:this setComponent]( [param:Integer index], [param:Float value] ) +

+

+ [page:Integer index] - 0، 1 أو 2.
+ [page:Float value] - [page:Float]

+ + إذا كان index يساوي 0 يضبط [page:.x x] على [page:Float value].
+ إذا كان index يساوي 1 يضبط [page:.y y] على [page:Float value].
+ إذا كان index يساوي 2 يضبط [page:.z z] على [page:Float value] +

+ +

[method:this setFromColor]( [param:Color color] )

+

+ يضبط مكونات [page:.x x] و [page:.y y] و [page:.z z] لهذا المتجه من مكونات r و g و b لـ[page:Color color] المحدد. +

+ +

[method:this setFromCylindrical]( [param:Cylindrical c] )

+

+ يضبط هذا المتجه من الإحداثيات الأسطوانية [page:Cylindrical c]. +

+ +

+ [method:this setFromCylindricalCoords]( [param:Float radius], [param:Float theta], [param:Float y] ) +

+

+ يضبط هذا المتجه من الإحداثيات الأسطوانية [page:Cylindrical radius]، و[page:Cylindrical theta] و[page:Cylindrical y]. +

+ +

[method:this setFromEuler]( [param:Euler euler] )

+

+ يضبط مكونات [page:.x x] و[page:.y y] و[page:.z z] لهذا المتجه من مكونات x و y و z لـ[page:Euler Euler Angle] المحدد. +

+ +

+ [method:this setFromMatrixColumn]( [param:Matrix4 matrix], [param:Integer index] ) +

+

+ يضبط مكونات [page:.x x] و[page:.y y] و[page:.z z] لهذا المتجه من العمود [page:Integer index] من [page:Matrix4 matrix]. +

+ +

+ [method:this setFromMatrix3Column]( [param:Matrix3 matrix], [param:Integer index] ) +

+

+ يضبط مكونات [page:.x x] و [page:.y y] و [page:.z z] لهذا المتجه من العمود [page:Integer index] من [page:Matrix3 matrix]. +

+ +

[method:this setFromMatrixPosition]( [param:Matrix4 m] )

+

+ يضبط هذا المتجه على عناصر الموضع لـ [link:https://en.wikipedia.org/wiki/Transformation_matrix مصفوفة التحويل] [page:Matrix4 m]. +

+ +

[method:this setFromMatrixScale]( [param:Matrix4 m] )

+

+ يضبط هذا المتجه على عناصر الحجم لـ [link:https://en.wikipedia.org/wiki/Transformation_matrix مصفوفة التحويل] [page:Matrix4 m]. +

+ +

[method:this setFromSpherical]( [param:Spherical s] )

+

يضبط هذا المتجه من الإحداثيات الكروية [page:Spherical s].

+ +

+ [method:this setFromSphericalCoords]( [param:Float radius], [param:Float phi], [param:Float theta] ) +

+

+ يضبط هذا المتجه من الإحداثيات الكروية [page:Spherical radius]، و[page:Spherical phi] و[page:Spherical theta]. +

+ +

[method:this setLength]( [param:Float l] )

+

+ يضبط هذا المتجه على متجه بنفس اتجاه هذا، ولكن بـ [page:.length length] يساوي [page:Float l]. +

+ +

[method:this setScalar]( [param:Float scalar] )

+

+ يضبط قيمة كل من [page:.x x] و[page:.y y] و[page:.z z] لهذا المتجه على قيمة مساوية لـ[page:Float scalar]. +

+ +

[method:this setX]( [param:Float x] )

+

يستبدل قيمة [page:.x x] لهذا المتجه بـ[page:Float x].

+ +

[method:this setY]( [param:Float y] )

+

يستبدل قيمة [page:.y y] لهذا المتجه بـ[page:Float y].

+ +

[method:this setZ]( [param:Float z] )

+

يستبدل قيمة [page:.z z] لهذا المتجه بـ[page:Float z].

+ +

[method:this sub]( [param:Vector3 v] )

+

يطرح [page:Vector3 v] من هذا المتجه.

+ +

[method:this subScalar]( [param:Float s] )

+

+ يطرح [page:Float s] من مكونات [page:.x x] و [page:.y y] و [page:.z z] لهذا المتجه. +

+ +

[method:this subVectors]( [param:Vector3 a], [param:Vector3 b] )

+

يضبط هذا المتجه على [page:Vector3 a] - [page:Vector3 b].

+ +

+ [method:Array toArray]( [param:Array array], [param:Integer offset] ) +

+

+ [page:Array array] - (اختياري) مصفوفة لتخزين هذا المتجه فيها. إذا لم يتم توفير هذا، سيتم إنشاء مصفوفة جديدة.
+ [page:Integer offset] - (اختياري) إزاحة اختيارية في المصفوفة.

+ + يرجع مصفوفة [x، y، z]، أو ينسخ x و y و z في المصفوفة المعطاة من نوع [page:Array array]. +

+ +

[method:this transformDirection]( [param:Matrix4 m] )

+

+ يحول اتجاه هذا المتجه بمصفوفة (المجموعة العلوية اليسرى 3 × 3 من [page:Matrix4 m]) ثم يقوم بـ [page:.normalize تطبيع] النتيجة. +

+ +

[method:this unproject]( [param:Camera camera] )

+

+ [page:Camera camera] — الكاميرا المستخدمة في الإسقاط.

+ + يُسقِط هذا المتجه من مساحة الجهاز المعيارية للكاميرا (NDC) إلى مساحة العالم. +

+ +

[method:this random]()

+

+ يضبط كل مكون من مكونات هذا المتجه على قيمة شبه عشوائية بين 0 و 1، باستثناء 1. +

+ +

[method:this randomDirection]()

+

يضبط هذا المتجه على نقطة عشوائية موحدة على كرة وحدة.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/Vector4.html b/docs/api/ar/math/Vector4.html new file mode 100644 index 00000000000000..1b78501a55a197 --- /dev/null +++ b/docs/api/ar/math/Vector4.html @@ -0,0 +1,392 @@ + + + + + + + + + +

[name]

+ +

+ تمثل الفئة متجه 4D [link:https://en.wikipedia.org/wiki/Vector_space vector]. + متجه 4D هو رباعي من الأرقام المرتبة (مسمى x و y و z و w) ، والذي يمكن استخدامه لتمثيل عدد من الأشياء ، مثل: +

+ +
    +
  • نقطة في الفضاء 4D.
  • +
  • + اتجاه وطول في الفضاء 4D. في three.js ، سيكون الطول دائمًا + [link:https://en.wikipedia.org/wiki/Euclidean_distance المسافة الإقليدية] + (المسافة المستقيمة) من `(0، 0، 0، 0)` إلى `(x، y، z، w)` + ويتم قياس الاتجاه أيضًا من `(0، 0، 0، 0)` نحو `(x، y، z، w)`. +
  • +
  • أي رباعي مرتب عشوائي من الأرقام.
  • +
+ +

+ هناك أشياء أخرى يمكن استخدام متجه 4D لتمثيلها ، ولكن هذه هي + الاستخدامات الأكثر شيوعًا في *three.js*. +

+ +

+ التكرار عبر مثيل [name] سيعطي مكوناته `(x، y، z، w)` بالترتيب المقابل. +

+ +

مثال للكود

+ + + const a = new THREE.Vector4( 0, 1, 0, 0 ); + + //لا معاملات؛ سيتم تهيئته إلى (0 ، 0 ، 0 ، 1) + const b = new THREE.Vector4( ); + + const d = a.dot( b ); + + +

المنشئ (Constructor)

+ +

+ [name]( [param:Float x], [param:Float y], [param:Float z], [param:Float w] ) +

+

+ [page:Float x] - قيمة x لهذا المتجه. الافتراضية هي `0`.
+ [page:Float y] - قيمة y لهذا المتجه. الافتراضية هي `0`.
+ [page:Float z] - قيمة z لهذا المتجه. الافتراضية هي `0`.
+ [page:Float w] - قيمة w لهذا المتجه. الافتراضية هي `1`.

+ + ينشئ جديدًا [name]. +

+ +

الخصائص (Properties)

+ +

[property:Boolean isVector4]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معطىً من نوع [name].

+ +

[property:Float x]

+ +

[property:Float y]

+ +

[property:Float z]

+ +

[property:Float w]

+ +

[property:Float width]

+

الاسم المستعار لـ [page:.z z].

+ +

[property:Float height]

+

الاسم المستعار لـ [page:.w w].

+ +

الطرق (Methods)

+ +

[method:this add]( [param:Vector4 v] )

+

يضيف [page:Vector4 v] إلى هذا المتجه.

+ +

[method:this addScalar]( [param:Float s] )

+

+ يضيف القيمة القياسية s إلى قيم [page:.x x] و [page:.y y] و + [page:.z z] و [page:.w w] لهذا المتجه. +

+ +

[method:this addScaledVector]( [param:Vector4 v], [param:Float s] )

+

+ يضيف مضاعفة [page:Vector4 v] و [page:Float s] إلى هذا المتجه. +

+ +

[method:this addVectors]( [param:Vector4 a], [param:Vector4 b] )

+

يضبط هذا المتجه على [page:Vector4 a] + [page:Vector4 b].

+ +

[method:this applyMatrix4]( [param:Matrix4 m] )

+

يضرب هذا المتجه في 4 × 4 [page:Matrix4 m].

+ +

[method:this ceil]()

+

+ يتم تقريب مكونات [page:.x x] و [page:.y y] و [page:.z z] و + [page:.w w] من هذا المتجه إلى أعلى إلى أقرب قيمة صحيحة. +

+ +

[method:this clamp]( [param:Vector4 min], [param:Vector4 max] )

+

+ [page:Vector4 min]- الحد الأدنى للقيمة [page:.x x] و [page:.y y] و + [page:.z z] و[page:.w w].
+ [page:Vector4 max]- الحد الأقصى للقيمة [page:.x x] و [page:.y y] و + [page:.z z] و[page:.w w] في النطاق المطلوب

+ + إذا كانت قيم x أو y أو z أو w لهذا المتجه أكبر من قيمة x أو y أو z أو w للمتجه الأقصى ، فإنها + تستبدل بالقيمة المقابلة.

+ إذا كانت قيم x أو y أو z أو w لهذا المتجه أقل من قيمة x أو y أو z + أو w للمتجه الأدنى ، يتم استبداله بالقيمة المقابلة. +

+ +

[method:this clampLength]( [param:Float min], [param:Float max] )

+

+ [page:Float min]- الحد الأدنى للقيمة التي سيتم تثبيتها على الطول
+ [page:Float max]- الحد الأقصى للقيمة التي سيتم تثبيتها على الطول

+ + إذا كان طول هذا المتجه أكبر من القيمة القصوى ، يتم استبداله بـ + القيمة القصوى.

+ إذا كان طول هذا المتجه أقل من الحد الأدنى للقيمة ، يتم استبداله بـ + الحد الأدنى للقيمة. +

+ +

[method:this clampScalar]( [param:Float min], [param:Float max] )

+

+ [page:Float min]- الحد الأدنى للقيمة التي سيتم تثبيت المكونات عليها +
+ [page:Float max]- الحد الأقصى للقيمة التي سيتم تثبيت المكونات عليها

+ + إذا كانت قيم x أو y أو z أو w لهذا المتجه أكبر من الحد الأقصى للقيمة ، فإنها + تستبدل بالحد الأقصى للقيمة.

+ إذا كانت قيم x أو y أو z أو w لهذا المتجه أقل من الحد الأدنى للقيمة ، فإنها + تستبدل بالحد الأدنى للقيمة. +

+ +

[method:Vector4 clone]()

+

+ يرجع Vector4 جديدًا بنفس قيم [page:.x x] و [page:.y y] و [page:.z z] + و [page:.w w] كهذا. +

+ +

[method:this copy]( [param:Vector4 v] )

+

+ ينسخ قيم خصائص [page:.x x] و [page:.y y] و [page:.z z] و [page:.w w] من Vector4 المار إلى هذا Vector4. +

+ +

[method:this divideScalar]( [param:Float s] )

+

يقسم هذا المتجه على العدد القياسي [page:Float s].

+ +

[method:Float dot]( [param:Vector4 v] )

+

+ يحسب [link:https://en.wikipedia.org/wiki/Dot_product حاصل ضرب نقطة] + هذا المتجه و [page:Vector4 v]. +

+ +

[method:Boolean equals]( [param:Vector4 v] )

+

+ يرجع `true` إذا كانت مكونات هذا المتجه و [page:Vector4 v] + صارمًا مساوية ؛ `false` في حالات أخرى. +

+ +

[method:this floor]()

+

+ يتم تقريب مكونات هذا المتجه إلى أسفل إلى أقرب قيمة صحيحة + قيمة. +

+ +

+ [method:this fromArray]( [param:Array array], [param:Integer offset]) +

+

+ [page:Array array]- المصفوفة المصدر.
+ [page:Integer offset]- (اختياري) إزاحة في المصفوفة. الافتراضي هو 0.

+ + يضبط قيمة [page:.x x] لهذا المتجه لتكون `array [offset + 0]` ، قيمة [page:.y y] + لتكون `array [offset + 1]` قيمة [page:.z z] لتكون `array [offset + 2]` + وقيمة [page:.w w] لتكون `array [offset + 3]`. +

+ +

+ [method:this fromBufferAttribute]( [param:BufferAttribute attribute], [param:Integer index]) +

+

+ [page:BufferAttribute attribute]- السمة المصدر.
+ [page:Integer index]- فهرس في السمة.

+ + يضبط قيم [page:.x x] و [page:.y y] و [page:.z z] و [page:.w w] + لهذا المتجه من [page:BufferAttribute attribute]. +

+ +

[method:Float getComponent]( [param:Integer index] )

+

+ [page:Integer index]- 0، 1، 2 أو 3.

+ + إذا كان index يساوي 0 يعود بقيمة [page:.x x].
+ إذا كان index يساوي 1 يعود بقيمة [page:.y y].
+ إذا كان index يساوي 2 يعود بقيمة [page:.z z].
+ إذا كان index يساوي 3 يعود بقيمة [page:.w w]. +

+ +

[method:Float length]()

+

+ يحسب [link:https://en.wikipedia.org/wiki/Euclidean_distance الطول الإقليدي] + (طول المستقيم) من `(0، 0، 0، 0)` إلى `(x، y، z، w)`. +

+ +

[method:Float manhattanLength]()

+

+ يحسب طول مانهاتن لهذا المتجه. +

+ +

[method:Float lengthSq]()

+

+ يحسب مربع + [link:https://en.wikipedia.org/wiki/Euclidean_distance الطول الإقليدي] + (طول المستقيم) من `(0، 0، 0، 0)` إلى `(x، y، z، w)`. إذا كنت + تقارن أطوال المتجهات ، فيجب عليك مقارنة الطول المربع + بدلاً من ذلك لأنه أكثر كفاءة قليلاً في الحساب. +

+ +

[method:this lerp]( [param:Vector4 v], [param:Float alpha] )

+

+ [page:Vector4 v]- [page:Vector4] للتداخل نحوه.
+ [page:Float alpha]- عامل التداخل ، عادةً في الفاصل المغلق + الفاصل "[0، 1]".

+ + يتداخل بشكل خطي بين هذا المتجه و [page:Vector4 v] ، حيث + alpha هو نسبة المسافة على طول الخط - سيكون `alpha = 0` هذا + المتجه ، و `alpha = 1` سيكون [page:Vector4 v]. +

+ +

+ [method:this lerpVectors]( [param:Vector4 v1], [param:Vector4 v2], [param:Float alpha]) +

+

+ [page:Vector4 v1]- [page:Vector4] الابتدائية.
+ [page:Vector4 v2]- [page:Vector4] للتداخل نحوه.
+ [page:Float alpha]- عامل التداخل ، عادةً في الفاصل المغلق + الفاصل `[0، 1]`.

+ + يضبط هذا المتجه ليكون المتجه المتداخل خطيًا بين + [page:Vector4 v1] و [page:Vector4 v2] حيث alpha هو نسبة + المسافة على طول الخط الذي يربط بين المتجهين - سيكون alpha = 0 + [page:Vector4 v1] ، وسيكون alpha = 1 [page:Vector4 v2]. +

+ +

[method:this negate]()

+

يعكس هذا المتجه - أي يضبط x = -x و y = -y و z = -z و w = -w.

+ +

[method:this normalize]()

+

+ يحول هذا المتجه إلى [link:https://en.wikipedia.org/wiki/Unit_vector متجه وحدة] + - أي يضعه يساوي متجهًا بنفس الاتجاه + كهذا ، لكن [page:.length الطول] 1. +

+ +

[method:this max]( [param:Vector4 v] )

+

+ إذا كانت قيمة x أو y أو z أو w لهذا المتجه أقل من قيمة x أو y أو z أو w لـ [page:Vector4 v] + ، استبدل تلك القيمة بالقيمة القصوى المقابلة. +

+ +

[method:this min]( [param:Vector4 v] )

+

+ إذا كانت قيمة x أو y أو z أو w لهذا المتجه أكبر من قيمة x أو y أو z أو w لـ [page:Vector4 v] + ، استبدل تلك القيمة بالقيمة الدنيا المقابلة. +

+ +

[method:this multiply]( [param:Vector4 v] )

+

يضرب هذا المتجه في [page:Vector4 v].

+ +

[method:this multiplyScalar]( [param:Float s] )

+

يضرب هذا المتجه بالعدد القياسي [page:Float s].

+ +

[method:this round]()

+

+ يتم تقريب مكونات هذا المتجه إلى أقرب قيمة صحيحة. +

+ +

[method:this roundToZero]()

+

+ يتم تقريب مكونات هذا المتجه نحو الصفر (لأعلى إذا كانت سالبة ، + لأسفل إذا كانت موجبة) إلى قيمة صحيحة. +

+ +

+ [method:this set]( [param:Float x], [param:Float y], [param:Float z], [param:Float w] ) +

+

+ يضبط مكونات [page:.x x] و [page:.y y] و [page:.z z] و [page:.w w] + من هذا المتجه. +

+ +

[method:this setAxisAngleFromQuaternion]( [param:Quaternion q] )

+

+ [page:Quaternion q] - a normalized [page:Quaternion]

+ + يضبط مكونات [page:.x x] و [page:.y y] و [page:.z z] من هذا + المتجه على محور الرباعية و[page:.w w] على الزاوية. +

+ +

[method:this setAxisAngleFromRotationMatrix]( [param:Matrix4 m] )

+

+ [page:Matrix4 m] - a [page:Matrix4] of which the upper left 3x3 matrix is + a pure rotation matrix.

+ + يضبط [page:.x x] و [page:.y y] و [page:.z z] على محور الدوران + و[page:.w w] على الزاوية. +

+ +

+ [method:this setComponent]( [param:Integer index], [param:Float value]) +

+

+ [page:Integer index]- 0، 1، 2 أو 3.

+ [page:Float value]- [page:Float]

+ + إذا كان index يساوي 0 ، فقم بتعيين [page:.x x] إلى [page:Float value].
+ إذا كان index يساوي 1 ، فقم بتعيين [page:.y y] إلى [page:Float value].
+ إذا كان index يساوي 2 ، فقم بتعيين [page:.z z] إلى [page:Float value].
+ إذا كان index يساوي 3 ، فقم بتعيين [page:.w w] إلى [page:Float value]. +

+ +

[method:this setLength]( [param:Float l] )

+

+ يضبط هذا المتجه على متجه بنفس الاتجاه كهذا ، لكن + [page:.length الطول] [page:Float l]. +

+ +

[method:this setScalar]( [param:Float scalar] )

+

+ يضبط قيم [page:.x x] و [page:.y y] و [page:.z z] و [page:.w w] من + هذا المتجه متساوية مع [page:Float scalar]. +

+ +

[method:this setX]( [param:Float x] )

+

يستبدل قيمة [page:.x x] لهذا المتجه بـ [page:Float x].

+ +

[method:this setY]( [param:Float y] )

+

يستبدل قيمة [page:.y y] لهذا المتجه بـ [page:Float y].

+ +

[method:this setZ]( [param:Float z] )

+

يستبدل قيمة [page:.z z] لهذا المتجه بـ [page:Float z].

+ +

[method:this setW]( [param:Float w] )

+

يستبدل قيمة [page:.w w] لهذا المتجه بـ [page:Float w].

+ +

[method:this sub]( [param:Vector4 v] )

+

يطرح [page:Vector4 v] من هذا المتجه.

+ +

[method:this subScalar]( [param:Float s] )

+

+ يطرح [page:Float s] من مكونات هذا المتجه [page:.x x] و [page:.y y] + و[page:.z z] و[page:.w w]. +

+ +

[method:this subVectors]( [param:Vector4 a], [param:Vector4 b] )

+

يضبط هذا المتجه على [page:Vector4 a] - [page:Vector4 b].

+ +

+ [method:Array toArray]( [param:Array array], [param:Integer offset]) +

+

+ [page:Array array]- (اختياري) مصفوفة لتخزين هذا المتجه فيها. إذا لم يتم توفير هذا ، سيتم إنشاء مصفوفة جديدة.
+ [page:Integer offset]- (اختياري) إزاحة اختيارية في المصفوفة.

+ + يرجع مصفوفة [x، y، z، w] ، أو ينسخ x و y و z و w في المصفوفة المقدمة + [page:Array array]. +

+ +

[method:this random]()

+

+ يضبط كل مكون من مكونات هذا المتجه على قيمة شبه عشوائية بين 0 و + 1 ، باستثناء 1. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/interpolants/CubicInterpolant.html b/docs/api/ar/math/interpolants/CubicInterpolant.html new file mode 100644 index 00000000000000..1743df5a972ab8 --- /dev/null +++ b/docs/api/ar/math/interpolants/CubicInterpolant.html @@ -0,0 +1,62 @@ + + + + + + + + + + [page:Interpolant] → + +

[name]

+ +

+ +

مثال الكود

+ + const interpolant = new THREE.[name]( + new Float32Array(2), + new Float32Array(2), + 1, + new Float32Array(1) + ); + + interpolant.evaluate(0.5); + + +

المنشئ (Constructor)

+

+ [name](parameterPositions, sampleValues, sampleSize, resultBuffer) +

+

+ parameterPositions - مصفوفة المواضع
+ sampleValues - مصفوفة العينات
+ sampleSize - عدد العينات
+ resultBuffer - مخزن لتخزين نتائج التداخل.

+

+ +

الخصائص (Properties)

+ +

[property:null parameterPositions]

+ +

[property:null resultBuffer]

+ +

[property:null sampleValues]

+ +

[property:Object settings]

+ +

[property:null valueSize]

+ +

الطرق (Methods)

+ +

[method:Array evaluate]([param:Number t])

+

تقييم المُداخِل في الموضع *t*.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/interpolants/DiscreteInterpolant.html b/docs/api/ar/math/interpolants/DiscreteInterpolant.html new file mode 100644 index 00000000000000..1743df5a972ab8 --- /dev/null +++ b/docs/api/ar/math/interpolants/DiscreteInterpolant.html @@ -0,0 +1,62 @@ + + + + + + + + + + [page:Interpolant] → + +

[name]

+ +

+ +

مثال الكود

+ + const interpolant = new THREE.[name]( + new Float32Array(2), + new Float32Array(2), + 1, + new Float32Array(1) + ); + + interpolant.evaluate(0.5); + + +

المنشئ (Constructor)

+

+ [name](parameterPositions, sampleValues, sampleSize, resultBuffer) +

+

+ parameterPositions - مصفوفة المواضع
+ sampleValues - مصفوفة العينات
+ sampleSize - عدد العينات
+ resultBuffer - مخزن لتخزين نتائج التداخل.

+

+ +

الخصائص (Properties)

+ +

[property:null parameterPositions]

+ +

[property:null resultBuffer]

+ +

[property:null sampleValues]

+ +

[property:Object settings]

+ +

[property:null valueSize]

+ +

الطرق (Methods)

+ +

[method:Array evaluate]([param:Number t])

+

تقييم المُداخِل في الموضع *t*.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/interpolants/LinearInterpolant.html b/docs/api/ar/math/interpolants/LinearInterpolant.html new file mode 100644 index 00000000000000..45b2dcb164e7f9 --- /dev/null +++ b/docs/api/ar/math/interpolants/LinearInterpolant.html @@ -0,0 +1,62 @@ + + + + + + + + + + [page:Interpolant] → + +

[name]

+ +

+ +

مثال الكود

+ + const interpolant = new THREE.[name]( + new Float32Array(2), + new Float32Array(2), + 1, + new Float32Array(1) + ); + + interpolant.evaluate(0.5); + + +

المنشئ (Constructor)

+

+ [name](parameterPositions, sampleValues, sampleSize, resultBuffer) +

+

+ parameterPositions - مصفوفة المواضع
+ sampleValues - مصفوفة العينات
+ sampleSize - عدد العينات
+ resultBuffer - مخزن لتخزين نتائج التداخل.

+

+ +

الخصائص (Properties)

+ +

[property:null parameterPositions]

+ +

[property:null resultBuffer]

+ +

[property:null sampleValues]

+ +

[property:Object settings]

+ +

[property:null valueSize]

+ +

الطرق (Methods)

+ +

[method:Array evaluate]([param:Number t])

+

تقييم المُداخِل في الموضع *t*.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/math/interpolants/QuaternionLinearInterpolant.html b/docs/api/ar/math/interpolants/QuaternionLinearInterpolant.html new file mode 100644 index 00000000000000..45b2dcb164e7f9 --- /dev/null +++ b/docs/api/ar/math/interpolants/QuaternionLinearInterpolant.html @@ -0,0 +1,62 @@ + + + + + + + + + + [page:Interpolant] → + +

[name]

+ +

+ +

مثال الكود

+ + const interpolant = new THREE.[name]( + new Float32Array(2), + new Float32Array(2), + 1, + new Float32Array(1) + ); + + interpolant.evaluate(0.5); + + +

المنشئ (Constructor)

+

+ [name](parameterPositions, sampleValues, sampleSize, resultBuffer) +

+

+ parameterPositions - مصفوفة المواضع
+ sampleValues - مصفوفة العينات
+ sampleSize - عدد العينات
+ resultBuffer - مخزن لتخزين نتائج التداخل.

+

+ +

الخصائص (Properties)

+ +

[property:null parameterPositions]

+ +

[property:null resultBuffer]

+ +

[property:null sampleValues]

+ +

[property:Object settings]

+ +

[property:null valueSize]

+ +

الطرق (Methods)

+ +

[method:Array evaluate]([param:Number t])

+

تقييم المُداخِل في الموضع *t*.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/objects/Bone.html b/docs/api/ar/objects/Bone.html new file mode 100644 index 00000000000000..5b13b7f168db7e --- /dev/null +++ b/docs/api/ar/objects/Bone.html @@ -0,0 +1,53 @@ + + + + + + + + + + [page:Object3D] → + +

[name]

+ +

+ عظمة هي جزء من [page:Skeleton]. يتم استخدام الهيكل العظمي بدوره من قبل + [page:SkinnedMesh]. العظام تكاد تكون مطابقة لـ + [page:Object3D] فارغ. +

+ +

مثال للكود

+ + + const root = new THREE.Bone(); + const child = new THREE.Bone(); + + root.add( child ); + child.position.y = 5; + + +

المنشئ (Constructor)

+ +

[name]( )

+

ينشئ جديدًا [name].

+ +

الخصائص (Properties)

+

راجع الفئة الأساسية [page:Object3D] للحصول على الخصائص المشتركة.

+ +

[property:Boolean isBone]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معطىً من نوع [name].

+ +

[property:String type]

+

تعيين إلى 'Bone' ، يمكن استخدام هذا للعثور على جميع العظام في المشهد.

+ +

الطرق (Methods)

+

راجع الفئة الأساسية [page:Object3D] للحصول على الطرق المشتركة.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/objects/Group.html b/docs/api/ar/objects/Group.html new file mode 100644 index 00000000000000..3a07251d7a34d3 --- /dev/null +++ b/docs/api/ar/objects/Group.html @@ -0,0 +1,61 @@ + + + + + + + + + + [page:Object3D] → + +

[name]

+ +

+ هذا مطابق تقريبًا لـ [page:Object3D Object3D]. الغرض منه هو + جعل العمل مع مجموعات من الكائنات أكثر وضوحًا نحويًا. +

+ +

مثال للكود

+ + + const geometry = new THREE.BoxGeometry( 1, 1, 1 ); + const material = new THREE.MeshBasicMaterial( {color: 0x00ff00} ); + + const cubeA = new THREE.Mesh( geometry, material ); + cubeA.position.set( 100, 100, 0 ); + + const cubeB = new THREE.Mesh( geometry, material ); + cubeB.position.set( -100, -100, 0 ); + + //إنشاء مجموعة وإضافة المكعبين + //يمكن الآن تدوير / تحجيم هذه المكعبات كمجموعة + const group = new THREE.Group(); + group.add( cubeA ); + group.add( cubeB ); + + scene.add( group ); + + +

المنشئ (Constructor)

+ +

[name]( )

+ +

الخصائص (Properties)

+

راجع الفئة الأساسية [page:Object3D] للحصول على الخصائص المشتركة.

+ +

[property:Boolean isGroup]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معطىً من نوع [name].

+ +

[property:String type]

+

سلسلة 'Group'. يجب عدم تغيير هذا.

+ +

الطرق (Methods)

+

راجع الفئة الأساسية [page:Object3D] للحصول على الطرق المشتركة.

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/objects/InstancedMesh.html b/docs/api/ar/objects/InstancedMesh.html new file mode 100644 index 00000000000000..8413a73e50c680 --- /dev/null +++ b/docs/api/ar/objects/InstancedMesh.html @@ -0,0 +1,172 @@ + + + + + + + + + + [page:Mesh] → + +

[name]

+ +

+ نسخة خاصة من [page:Mesh] مع دعم التصيير المثيل. استخدم + [name] إذا كان عليك تقديم عدد كبير من الكائنات بنفس + الهندسة والمواد ولكن مع تحولات العالم المختلفة. الاستخدام + من [name] سيساعدك على تقليل عدد مكالمات الرسم وبالتالي + تحسين أداء التصيير العام في تطبيقك. +

+ +

أمثلة (Examples)

+

+ [example:webgl_instancing_dynamic WebGL / instancing / dynamic]
+ [example:webgl_instancing_performance WebGL / instancing / performance]
+ [example:webgl_instancing_scatter WebGL / instancing / scatter]
+ [example:webgl_instancing_raycast WebGL / instancing / raycast] +

+ +

المنشئ (Constructor)

+

+ [name]( [param:BufferGeometry geometry], [param:Material material], + [param:Integer count] ) +

+

+ [page:BufferGeometry geometry] - عينة من [page:BufferGeometry].
+ [page:Material material] - عينة من [page:Material]. الافتراضية هي + جديد [page:MeshBasicMaterial].
+ [page:Integer count] - عدد العينات.
+

+ +

الخصائص (Properties)

+

راجع الفئة الأساسية [page:Mesh] للحصول على الخصائص المشتركة.

+ +

[property:Box3 boundingBox]

+

+ يحيط هذا المربع التجزئة بجميع عينات [name]. يمكن حسابه + مع [page:.computeBoundingBox](). الافتراضية هي `null`. +

+ +

[property:Sphere boundingSphere]

+

+ يحيط هذا المجال المحدد بجميع عينات [name]. يمكن + حسابه مع [page:.computeBoundingSphere](). الافتراضية هي `null`. +

+ +

[property:Integer count]

+

+ عدد العينات. قيمة `count` الممررة إلى الباني + تمثل الحد الأقصى لعدد العينات من هذه المشبك. يمكنك تغيير + عدد العينات في وقت التشغيل إلى قيمة صحيحة في النطاق [0، count]. +

+

+ إذا كنت بحاجة إلى عدد أكبر من العينات من قيمة العدد الأصلية ، فلديك + إنشاء جديد [name]. +

+ +

[property:InstancedBufferAttribute instanceColor]

+

+ يمثل ألوان جميع العينات. `null` بشكل افتراضي. يجب عليك ضبط + علامة [page:BufferAttribute.needsUpdate needsUpdate] الخاصة بها على صحيح إذا كان لديك + تعديل بيانات مثيل عبر [page:.setColorAt](). +

+ +

[property:InstancedBufferAttribute instanceMatrix]

+

+ يمثل التحول المحلي لجميع العينات. يجب عليك ضبطه + [page:BufferAttribute.needsUpdate needsUpdate] علامة صحيحة إذا قمت بتعديل + بيانات مثيل عبر [page:.setMatrixAt](). +

+ +

[property:Boolean isInstancedMesh]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معطىً من نوع [name].

+ +

الطرق (Methods)

+

راجع الفئة الأساسية [page:Mesh] للحصول على الطرق المشتركة.

+ +

[method:undefined computeBoundingBox]()

+

+ يحسب مربع التجزئة ، وتحديث [page:.boundingBox] سمة.
+ لا يتم حساب مربعات التجزئة افتراضيًا. يجب حسابها بشكل صريح + حسابها ، وإلا كانت `null`. +

+ +

[method:undefined computeBoundingSphere]()

+

+ يحسب المجال المحدد ، وتحديث [page:.boundingSphere] + سمة.
+ لا يتم حساب المجالات المحددة افتراضيًا. يجب حسابها بشكل صريح + حسابها ، وإلا كانت `null`. +

+ +

[method:undefined dispose]()

+

+ يطلق الموارد المتعلقة بوحدة معالجة الرسومات التي تم تخصيصها من قبل هذه العينة. استدعاء هذه + الطريقة كلما لم تستخدم هذه العينة في تطبيقك. +

+ +

+ [method:undefined getColorAt]( [param:Integer index], [param:Color color] ) +

+

+ [page:Integer index]: فهرس العينة. يجب أن تكون القيم في + النطاق [0، count]. +

+

+ [page:Color color]: سيتم تعيين كائن اللون هذا إلى لون + العينة المحددة. +

+

احصل على لون العينة المحددة.

+ +

+ [method:undefined getMatrixAt]( [param:Integer index], [param:Matrix4 matrix] ) +

+

+ [page:Integer index]: فهرس العينة. يجب أن تكون القيم في + النطاق [0، count]. +

+

+ [page:Matrix4 matrix]: ستتم تعيين مصفوفة 4x4 هذه إلى المحلية + مصفوفة التحول للعينة المحددة. +

+

احصل على مصفوفة التحول المحلية للعينة المحددة.

+ +

+ [method:undefined setColorAt]( [param:Integer index], [param:Color color] ) +

+

+ [page:Integer index]: فهرس العينة. يجب أن تكون القيم في + النطاق [0، count]. +

+

[page:Color color]: لون عينة واحدة.

+

+ يضع اللون المحدد على العينة المحددة. تأكد من ضبط + [page:.instanceColor][page:BufferAttribute.needsUpdate .needsUpdate] إلى + صحيح بعد تحديث جميع الألوان. +

+ +

+ [method:undefined setMatrixAt]( [param:Integer index], [param:Matrix4 matrix] ) +

+

+ [page:Integer index]: فهرس العينة. يجب أن تكون القيم في + النطاق [0، count]. +

+

+ [page:Matrix4 matrix]: مصفوفة 4x4 تمثل التحول المحلي + لعينة واحدة. +

+

+ يضع مصفوفة التحول المحلية المحددة على العينة المحددة. جعل + تأكد من ضبط [page:.instanceMatrix][page:BufferAttribute.needsUpdate .needsUpdate] + صحيح بعد تحديث جميع المصفوفات. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/objects/LOD.html b/docs/api/ar/objects/LOD.html new file mode 100644 index 00000000000000..7fc785ca1226c8 --- /dev/null +++ b/docs/api/ar/objects/LOD.html @@ -0,0 +1,118 @@ + + + + + + + + + + [page:Object3D] → + +

[name]

+

+ مستوى التفاصيل - عرض الشبكات بمزيد أو أقل من الهندسة بناءً على المسافة + من الكاميرا.

+ + كل مستوى مرتبط بكائن، ويمكن تبديل التصيير + بينهم على المسافات المحددة. عادةً ما تقوم بإنشاء، قل، + ثلاث شبكات، واحدة للبعيد (تفاصيل منخفضة)، واحدة للمدى المتوسط ​​(تفاصيل متوسطة) + وواحد للقريب (تفاصيل عالية). +

+ +

مثال للكود

+ + + const lod = new THREE.LOD(); + + // إنشاء كرات مع 3 مستويات من التفاصيل وإنشاء مستويات LOD جديدة لهم + for( let i = 0; i < 3; i++ ) { + const geometry = new THREE.IcosahedronGeometry( 10, 3 - i ) + const mesh = new THREE.Mesh( geometry, material ); + lod.addLevel( mesh, i * 75 ); + } + + scene.add( lod ); + + +

أمثلة (Examples)

+ +

[example:webgl_lod webgl / lod ]

+ +

المنشئ (Constructor)

+

[name]( )

+

إنشاء [name] جديد.

+ +

الخصائص (Properties)

+

انظر إلى الفئة الأساسية [page:Object3D] للحصول على الخصائص المشتركة.

+ +

[property:Boolean autoUpdate]

+

+ ما إذا كان يتم تحديث كائن LOD تلقائيًا من قبل المُصور في كل إطار + أم لا. إذا تم تعيينه إلى false، يجب عليك استدعاء [page:LOD.update]() في + حلقة التصيير بنفسك. الافتراضي هو true. +

+ +

[property:Boolean isLOD]

+

علامة للقراءة فقط للتحقق مما إذا كان كائن معين هو من نوع [name].

+ +

[property:Array levels]

+

+ مصفوفة من كائنات [page:Object level]

+ + كل مستوى هو كائن يحتوي على الخصائص التالية:
+ [page:Object3D object] - الـ [page:Object3D] المراد عرضه في هذا المستوى.
+ [page:Float distance] - المسافة التي يتم عرض هذا المستوى من التفاصيل فيها.
+ [page:Float hysteresis] - الحد الذي يستخدم لتجنب الوميض عند حدود LOD، كجزء من المسافة. +

+ +

الطرق (Methods)

+

انظر إلى الفئة الأساسية [page:Object3D] للحصول على الطرق المشتركة.

+ +

+ [method:this addLevel]( [param:Object3D object], [param:Float distance], [param:Float hysteresis] ) +

+

+ [page:Object3D object] - الـ [page:Object3D] المراد عرضه في هذا المستوى.
+ [page:Float distance] - المسافة التي يتم عرض هذا المستوى من التفاصيل فيها. الافتراضي 0.0.
+ [page:Float hysteresis] - الحد الذي يستخدم لتجنب الوميض عند حدود LOD، كجزء من المسافة. الافتراضي 0.0.

+ + إضافة شبكة ستعرض عند مسافة معينة وأكبر. عادةً ما تكون المسافة أبعد، كلما كان التفصيل أقل في الشبكة. +

+ +

[method:LOD clone]()

+

إرجاع نسخة من هذا كائن LOD مع مستوياته المرتبطة.

+ +

[method:Integer getCurrentLevel]()

+

الحصول على مستوى LOD النشط حاليًا. كفهرس لمصفوفة المستويات.

+ +

[method:Object3D getObjectForDistance]( [param:Float distance] )

+

+ الحصول على مرجع إلى أول [page:Object3D] (شبكة) أكبر من + [page:Float distance]. +

+ +

+ [method:undefined raycast]( [param:Raycaster raycaster], [param:Array intersects] ) +

+

+ الحصول على تقاطعات بين [page:Ray] ملقى وهذا LOD. + سيتم استدعاء هذه الطريقة بواسطة [page:Raycaster.intersectObject]. +

+ +

[method:Object toJSON]( meta )

+

إنشاء بنية JSON بتفاصيل هذا كائن LOD.

+ +

[method:undefined update]( [param:Camera camera] )

+

+ تعيين رؤية كل كائن [page:Object3D object] في [page:levels level] + بناءً على المسافة من [page:Camera camera]. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/objects/Line.html b/docs/api/ar/objects/Line.html new file mode 100644 index 00000000000000..3a71480ab163cd --- /dev/null +++ b/docs/api/ar/objects/Line.html @@ -0,0 +1,114 @@ + + + + + + + + + + [page:Object3D] → + +

[name]

+ +

+ خط مستمر.

+ + هذا مطابق تقريبًا لـ [page:LineSegments] ؛ الفرق الوحيد هو + أنه يتم تقديمه باستخدام + [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_STRIP] بدلاً من + [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINES] +

+ +

مثال للكود

+ + + const material = new THREE.LineBasicMaterial({ + color: 0x0000ff + }); + + const points = []; + points.push( new THREE.Vector3( - 10, 0, 0 ) ); + points.push( new THREE.Vector3( 0, 10, 0 ) ); + points.push( new THREE.Vector3( 10, 0, 0 ) ); + + const geometry = new THREE.BufferGeometry().setFromPoints( points ); + + const line = new THREE.Line( geometry, material ); + scene.add( line ); + + +

المنشئ (Constructor)

+ +

+ [name]( [param:BufferGeometry geometry], [param:Material material] ) +

+ +

+ [page:BufferGeometry geometry] - الرؤوس التي تمثل الخط + القطعة (القطع). الافتراضية هي جديدة [page:BufferGeometry].
+ [page:Material material] - مادة للخط. الافتراضية هي جديدة + [page:LineBasicMaterial].
+

+ +

الخصائص (Properties)

+

راجع الفئة الأساسية [page:Object3D] للحصول على الخصائص المشتركة.

+ +

[property:BufferGeometry geometry]

+

الرؤوس التي تمثل الخط القطعة (القطع).

+ +

[property:Boolean isLine]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معطىً من نوع [name].

+ +

[property:Material material]

+

مادة للخط.

+ +

[property:Array morphTargetInfluences]

+

+ مجموعة من الأوزان عادةً من 0-1 التي تحدد مدى تطبيق التغير + يتم تطبيقه. غير محدد بشكل افتراضي ، ولكن يتم إعادة تعيينه إلى مجموعة فارغة بواسطة + [page:.updateMorphTargets](). +

+ +

[property:Object morphTargetDictionary]

+

+ قاموس من morphTargets بناءً على خاصية morphTarget.name. + غير محدد بشكل افتراضي ، ولكن يتم إعادة بنائه [page:.updateMorphTargets](). +

+ +

الطرق (Methods)

+

راجع الفئة الأساسية [page:Object3D] للحصول على الطرق المشتركة.

+ +

[method:this computeLineDistances]()

+

+ يحسب مجموعة من قيم المسافات التي هي ضرورية لـ + [page:LineDashedMaterial]. بالنسبة لكل رأس في الهندسة ، يحسب الأسلوب + الطول التراكمي من النقطة الحالية إلى + بداية جدا من الخط. +

+ +

+ [method:undefined raycast]( [param:Raycaster raycaster], [param:Array intersects] ) +

+

+ احصل على تقاطعات بين [page:Ray] المصبوب وهذا الخط. + ستستدعي [page:Raycaster.intersectObject] هذه الطريقة. +

+ +

[method:Line clone]()

+

يعود بنسخة من هذا كائن Line وأحفاده.

+ +

[method:undefined updateMorphTargets]()

+

+ يحدث morphTargets ليكون لها تأثير على الكائن. يعيد تعيين + [page:.morphTargetInfluences] و [page:.morphTargetDictionary] + خصائص. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/objects/LineLoop.html b/docs/api/ar/objects/LineLoop.html new file mode 100644 index 00000000000000..1f91059aa07bb3 --- /dev/null +++ b/docs/api/ar/objects/LineLoop.html @@ -0,0 +1,53 @@ + + + + + + + + + + [page:Object3D] → [page:Line] → + +

[name]

+ +

+ خط مستمر يتصل بالعودة إلى البداية.

+ + هذا مطابق تقريبًا لـ [page:Line] ؛ الفرق الوحيد هو أنه + يتم تقديمه باستخدام + [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_LOOP] بدلاً من + [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_STRIP]، + الذي يرسم خطًا مستقيمًا إلى الرأس التالي ، و + يربط الرأس الأخير مرة أخرى إلى الأول. +

+ +

المنشئ (Constructor)

+ +

+ [name]( [param:BufferGeometry geometry], [param:Material material] ) +

+ +

+ [page:BufferGeometry geometry] - قائمة من الرؤوس التي تمثل نقاط على + حلقة الخط.
+ [page:Material material] - مادة للخط. الافتراضية هي + [page:LineBasicMaterial LineBasicMaterial]. +

+ +

الخصائص (Properties)

+

راجع الفئة الأساسية [page:Line] للحصول على الخصائص المشتركة.

+ +

[property:Boolean isLineLoop]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معطىً من نوع [name].

+ +

الطرق (Methods)

+

راجع الفئة الأساسية [page:Line] للحصول على الطرق المشتركة.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/objects/LineSegments.html b/docs/api/ar/objects/LineSegments.html new file mode 100644 index 00000000000000..c97b74e2900ecf --- /dev/null +++ b/docs/api/ar/objects/LineSegments.html @@ -0,0 +1,49 @@ + + + + + + + + + + [page:Object3D] → [page:Line] → + +

[name]

+ +

+ سلسلة من الخطوط المرسومة بين أزواج الرؤوس.

+ + هذا مشابه تقريبًا لـ [page:Line]؛ الفرق الوحيد هو أنه يتم عرضه باستخدام + [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINES] بدلاً من + [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_STRIP]. +

+ +

المنشئ (Constructor)

+ +

+ [name]( [param:BufferGeometry geometry], [param:Material material] ) +

+ +

+ [page:BufferGeometry geometry] — زوج (أزواج) من الرؤوس التي تمثل كل + خط (خطوط) القطع.
+ [page:Material material] — المادة المستخدمة للخط. الافتراضي هو + [page:LineBasicMaterial LineBasicMaterial]. +

+ +

الخصائص (Properties)

+

انظر إلى الفئة الأساسية [page:Line] للحصول على الخصائص المشتركة.

+ +

[property:Boolean isLineSegments]

+

علامة للقراءة فقط للتحقق مما إذا كان كائن معين هو من نوع [name].

+ +

الطرق (Methods)

+

انظر إلى الفئة الأساسية [page:Line] للحصول على الطرق المشتركة.

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/objects/Mesh.html b/docs/api/ar/objects/Mesh.html new file mode 100644 index 00000000000000..9a197a36212c39 --- /dev/null +++ b/docs/api/ar/objects/Mesh.html @@ -0,0 +1,108 @@ + + + + + + + + + + [page:Object3D] → + +

[name]

+ +

+ فئة تمثل كائنات مبنية على شبكات مضلعة ثلاثية الأضلاع + [link:https://en.wikipedia.org/wiki/Polygon_mesh]. كما تعمل كقاعدة لفئات أخرى مثل + [page:SkinnedMesh]. +

+ +

مثال للكود

+ + + const geometry = new THREE.BoxGeometry( 1, 1, 1 ); + const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } ); + const mesh = new THREE.Mesh( geometry, material ); + scene.add( mesh ); + + +

المنشئ (Constructor)

+ +

+ [name]( [param:BufferGeometry geometry], [param:Material material] ) +

+

+ [page:BufferGeometry geometry] — (اختياري) نسخة من + [page:BufferGeometry]. الافتراضي هو [page:BufferGeometry] جديد.
+ [page:Material material] — (اختياري) نسخة واحدة أو مصفوفة من + [page:Material]. الافتراضي هو [page:MeshBasicMaterial] جديد +

+ +

الخصائص (Properties)

+

انظر إلى الفئة الأساسية [page:Object3D] للحصول على الخصائص المشتركة.

+ +

[property:BufferGeometry geometry]

+

+ نسخة من [page:BufferGeometry] (أو الفئات المشتقة منها)، تحدد بنية + الكائن. +

+ +

[property:Boolean isMesh]

+

علامة للقراءة فقط للتحقق مما إذا كان كائن معين هو من نوع [name].

+ +

[property:Material material]

+

+ نسخة من المادة المشتقة من فئة [page:Material] الأساسية أو مصفوفة من المواد، تحدد مظهر الكائن. الافتراضي هو + [page:MeshBasicMaterial]. +

+ +

[property:Array morphTargetInfluences]

+

+ مصفوفة من الأوزان عادةً من 0-1 تحدد مقدار التحول + الذي يتم تطبيقه. غير معرف بشكل افتراضي، ولكن يتم إعادة تعيينه إلى مصفوفة فارغة بواسطة + [page:Mesh.updateMorphTargets updateMorphTargets]. +

+ +

[property:Object morphTargetDictionary]

+

+ قاموس من morphTargets بناءً على خاصية morphTarget.name. + غير معرف بشكل افتراضي، ولكن يتم إعادة بنائه [page:Mesh.updateMorphTargets updateMorphTargets]. +

+ +

الطرق (Methods)

+

انظر إلى الفئة الأساسية [page:Object3D] للحصول على الطرق المشتركة.

+ +

[method:Mesh clone]()

+

إرجاع نسخة من هذا كائن [name] وأحفاده.

+ +

+ [method:Vector3 getVertexPosition]( [param:Integer index], [param:Vector3 target] ) +

+

+ الحصول على موضع الرأس المحلي في الفهرس المحدد، مع مراعاة + حالة الرسوم المتحركة الحالية لكل من التحولات والتشكيل. +

+ +

+ [method:undefined raycast]( [param:Raycaster raycaster], [param:Array intersects] ) +

+

+ الحصول على تقاطعات بين شعاع ملقى وهذه الشبكة. + سيتم استدعاء هذه الطريقة بواسطة [page:Raycaster.intersectObject]، ولكن النتائج + غير مرتبة. +

+ +

[method:undefined updateMorphTargets]()

+

+ تحديث التحولات لعدم التأثير على الكائن. يعيد تعيين خصائص + [page:Mesh.morphTargetInfluences morphTargetInfluences] و + [page:Mesh.morphTargetDictionary morphTargetDictionary]. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/objects/Points.html b/docs/api/ar/objects/Points.html new file mode 100644 index 00000000000000..eada0b0616cc58 --- /dev/null +++ b/docs/api/ar/objects/Points.html @@ -0,0 +1,90 @@ + + + + + + + + + + [page:Object3D] → + +

[name]

+ +

+ فئة لعرض النقاط. يتم عرض النقاط بواسطة + [page:WebGLRenderer] باستخدام + [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.POINTS]. +

+ +

المنشئ (Constructor)

+ +

+ [name]( [param:BufferGeometry geometry], [param:Material material] ) +

+

+ [page:BufferGeometry geometry] — (اختياري) نسخة من + [page:BufferGeometry]. الافتراضي هو [page:BufferGeometry] جديد.
+ [page:Material material] — (اختياري) نسخة من [page:Material]. الافتراضي هو + [page:PointsMaterial] جديد. +

+ +

الخصائص (Properties)

+

انظر إلى الفئة الأساسية [page:Object3D] للحصول على الخصائص المشتركة.

+ +

[property:BufferGeometry geometry]

+

+ نسخة من [page:BufferGeometry] (أو الفئات المشتقة منها)، تحدد بنية + الكائن. +

+ +

[property:Boolean isPoints]

+

علامة للقراءة فقط للتحقق مما إذا كان كائن معين هو من نوع [name].

+ +

[property:Material material]

+

+ نسخة من [page:Material]، تحدد مظهر الكائن. الافتراضي + هو [page:PointsMaterial]. +

+ +

[property:Array morphTargetInfluences]

+

+ مصفوفة من الأوزان عادةً من 0-1 تحدد مقدار التحول + الذي يتم تطبيقه. غير معرف بشكل افتراضي، ولكن يتم إعادة تعيينه إلى مصفوفة فارغة بواسطة + [page:Points.updateMorphTargets updateMorphTargets]. +

+ +

[property:Object morphTargetDictionary]

+

+ قاموس من morphTargets بناءً على خاصية morphTarget.name. + غير معرف بشكل افتراضي، ولكن يتم إعادة بنائه [page:Points.updateMorphTargets updateMorphTargets]. +

+ +

الطرق (Methods)

+

انظر إلى الفئة الأساسية [page:Object3D] للحصول على الطرق المشتركة.

+ +

+ [method:undefined raycast]( [param:Raycaster raycaster], [param:Array intersects] ) +

+

+ الحصول على تقاطعات بين شعاع ملقى وهذه النقاط. + سيتم استدعاء هذه الطريقة بواسطة [page:Raycaster.intersectObject]. +

+ +

[method:Points clone]()

+

إرجاع نسخة من هذا كائن Points وأحفاده.

+ +

[method:undefined updateMorphTargets]()

+

+ تحديث التحولات لعدم التأثير على الكائن. يعيد تعيين خصائص + [page:Points.morphTargetInfluences morphTargetInfluences] و + [page:Points.morphTargetDictionary morphTargetDictionary]. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/objects/Skeleton.html b/docs/api/ar/objects/Skeleton.html new file mode 100644 index 00000000000000..d4bbd62ed6f161 --- /dev/null +++ b/docs/api/ar/objects/Skeleton.html @@ -0,0 +1,131 @@ + + + + + + + + + +

[name]

+ +

+ استخدم مصفوفة من [page:Bone bones] لإنشاء هيكل عظمي يمكن استخدامه بواسطة + [page:SkinnedMesh]. +

+ +

مثال للكود

+ + // إنشاء "ذراع" بسيط + + const bones = []; + + const shoulder = new THREE.Bone(); + const elbow = new THREE.Bone(); + const hand = new THREE.Bone(); + + shoulder.add( elbow ); + elbow.add( hand ); + + bones.push( shoulder ); + bones.push( elbow ); + bones.push( hand ); + + shoulder.position.y = -5; + elbow.position.y = 0; + hand.position.y = 5; + + const armSkeleton = new THREE.Skeleton( bones ); + + +

+ انظر إلى صفحة [page:SkinnedMesh] للحصول على مثال على الاستخدام مع + [page:BufferGeometry] القياسية. +

+ +

المنشئ (Constructor)

+ +

[name]( [param:Array bones], [param:Array boneInverses] )

+

+ [page:Array bones] - مصفوفة من [page:Bone bones]. الافتراضي هو مصفوفة فارغة + .
+ [page:Array boneInverses] - (اختياري) مصفوفة من [page:Matrix4 Matrix4s].

+ + إنشاء [name] جديد. +

+ +

الخصائص (Properties)

+ +

[property:Array bones]

+

+ مصفوفة من [page:bone bones]. لاحظ أن هذه نسخة من المصفوفة الأصلية، + وليس مرجعًا، لذلك يمكنك تعديل المصفوفة الأصلية دون التأثير + هذه واحدة. +

+ +

[property:Array boneInverses]

+

+ مصفوفة من [page:Matrix4 Matrix4s] تمثل معكوس + [page:Matrix4 matrixWorld] للعظام الفردية. +

+ +

[property:Float32Array boneMatrices]

+

مصفوفة البيانات التي تحمل بيانات العظام عند استخدام نسيج الرأس.

+ +

[property:DataTexture boneTexture]

+

+ [page:DataTexture] التي تحمل بيانات العظام عند استخدام نسيج الرأس. +

+ +

[property:Integer boneTextureSize]

+

حجم [page:.boneTexture].

+ +

الطرق (Methods)

+ +

[method:Skeleton clone]()

+

إرجاع نسخة من هذا كائن Skeleton.

+ +

[method:undefined calculateInverses]()

+

+ توليد مصفوفة [page:.boneInverses boneInverses] إذا لم يتم توفيرها في + المُنشئ. +

+ +

[method:this computeBoneTexture]()

+

+ حساب نسخة من [page:DataTexture] لتمرير بيانات العظام + بشكل أكثر كفاءة إلى المُظلل. يتم تعيين النسيج إلى + [page:.boneTexture boneTexture]. +

+ +

[method:undefined pose]()

+

إعادة الهيكل العظمي إلى وضعية الأساس.

+ +

[method:undefined update]()

+

+ تحديث [page:Float32Array boneMatrices] و [page:DataTexture boneTexture] + بعد تغيير العظام. يتم استدعاء هذا تلقائيًا بواسطة + [page:WebGLRenderer] إذا تم استخدام الهيكل العظمي مع [page:SkinnedMesh]. +

+ +

[method:Bone getBoneByName]( [param:String name] )

+

+ name -- سلسلة لتطابق خاصية .name لـ Bone.

+ + البحث في مصفوفة عظام الهيكل العظمي وإرجاع الأولى التي تطابق + الاسم.
+

+ +

[method:undefined dispose]()

+

+ تحرير الموارد المتعلقة بوحدة معالجة الرسومات المخصصة من قبل هذه النسخة. استدعِ هذه + الطريقة كلما لم يتم استخدام هذه النسخة في تطبيقك. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/objects/SkinnedMesh.html b/docs/api/ar/objects/SkinnedMesh.html new file mode 100644 index 00000000000000..919ce64051c9ef --- /dev/null +++ b/docs/api/ar/objects/SkinnedMesh.html @@ -0,0 +1,189 @@ + + + + + + + + + + [page:Object3D] → [page:Mesh] → + +

[name]

+ +

+ شبكة لديها [page:Skeleton] مع [page:Bone bones] يمكن استخدامها بعد ذلك + لتحريك رؤوس الهندسة.

+ + يمكن استخدام [name] فقط مع WebGL 2. مع WebGL 1 `OES_texture_float` و + مطلوب دعم نسيج الرأس. +

+ + + + + +

مثال للكود

+ + + const geometry = new THREE.CylinderGeometry( 5, 5, 5, 5, 15, 5, 30 ); + + // create the skin indices and skin weights manually + // (typically a loader would read this data from a 3D model for you) + + const position = geometry.attributes.position; + + const vertex = new THREE.Vector3(); + + const skinIndices = []; + const skinWeights = []; + + for ( let i = 0; i < position.count; i ++ ) { + + vertex.fromBufferAttribute( position, i ); + + // compute skinIndex and skinWeight based on some configuration data + const y = ( vertex.y + sizing.halfHeight ); + const skinIndex = Math.floor( y / sizing.segmentHeight ); + const skinWeight = ( y % sizing.segmentHeight ) / sizing.segmentHeight; + skinIndices.push( skinIndex, skinIndex + 1, 0, 0 ); + skinWeights.push( 1 - skinWeight, skinWeight, 0, 0 ); + } + + geometry.setAttribute( 'skinIndex', new THREE.Uint16BufferAttribute( skinIndices, 4 ) ); + geometry.setAttribute( 'skinWeight', new THREE.Float32BufferAttribute( skinWeights, 4 ) ); + + // create skinned mesh and skeleton + + const mesh = new THREE.SkinnedMesh( geometry, material ); + const skeleton = new THREE.Skeleton( bones ); + + // see example from THREE.Skeleton + const rootBone = skeleton.bones[ 0 ]; + mesh.add( rootBone ); + + // bind the skeleton to the mesh + mesh.bind( skeleton ); + + // move the bones and manipulate the model + skeleton.bones[ 0 ].rotation.x = -0.1; + skeleton.bones[ 1 ].rotation.x = 0.2; + + +

المنشئ (Constructor)

+

+ [name]( [param:BufferGeometry geometry], [param:Material material] ) +

+

+ [page:BufferGeometry geometry] - نسخة من [page:BufferGeometry].
+ [page:Material material] - (اختياري) نسخة من [page:Material]. + الافتراضي هو [page:MeshBasicMaterial] جديد. +

+ +

الخصائص (Properties)

+

انظر إلى الفئة الأساسية [page:Mesh] للحصول على الخصائص المشتركة.

+ +

[property:String bindMode]

+

+ إما "مرفق" أو "منفصل". "مرفق" يستخدم + خاصية [page:SkinnedMesh.matrixWorld] لمصفوفة التحويل الأساسية لـ + العظام. "منفصل" يستخدم [page:SkinnedMesh.bindMatrix]. الافتراضي هو + "مرفق". +

+ +

[property:Matrix4 bindMatrix]

+

المصفوفة الأساسية المستخدمة لتحويلات العظام المربوطة.

+ +

[property:Matrix4 bindMatrixInverse]

+

المصفوفة الأساسية المستخدمة لإعادة تعيين تحويلات العظام المربوطة.

+ +

[property:Box3 boundingBox]

+

+ مربع التحديد لـ [name]. يمكن حسابه بـ + [page:.computeBoundingBox](). الافتراضي هو `null`. +

+ +

[property:Sphere boundingSphere]

+

+ الكرة المحيطة لـ [name]. يمكن حسابها بـ + [page:.computeBoundingSphere](). الافتراضي هو `null`. +

+ +

[property:Boolean isSkinnedMesh]

+

علامة للقراءة فقط للتحقق مما إذا كان كائن معين هو من نوع [name].

+ +

[property:Skeleton skeleton]

+

[page:Skeleton] يمثل هيكل العظام للشبكة المشدودة.

+ +

الطرق (Methods)

+

انظر إلى الفئة الأساسية [page:Mesh] للحصول على الطرق المشتركة.

+ +

+ [method:undefined bind]( [param:Skeleton skeleton], [param:Matrix4 bindMatrix] ) +

+

+ [page:Skeleton skeleton] - [page:Skeleton] تم إنشاؤه من شجرة [page:Bone Bones].
+ [page:Matrix4 bindMatrix] - [page:Matrix4] يمثل التحويل الأساسي + للهيكل العظمي.

+ + ربط هيكل عظمي بالشبكة المشدودة. يتم حفظ bindMatrix في + خاصية .bindMatrix ويتم حساب .bindMatrixInverse. +

+ +

[method:SkinnedMesh clone]()

+

+ لا تقوم هذه الطريقة حاليًا بنسخ نسخة من [name] بشكل صحيح. + يرجى استخدام [page:SkeletonUtils.clone]() في هذه الأثناء. +

+ +

[method:undefined computeBoundingBox]()

+

+ حساب مربع التحديد، وتحديث خاصية [page:.boundingBox].
+ لا يتم حساب مربعات التحديد افتراضيًا. يجب حسابها بشكل صريح + ، وإلا كانت `null`. إذا كانت نسخة من [name] متحركة، + يجب استدعاء هذه الطريقة في كل إطار لحساب مربع تحديد صحيح. +

+ +

[method:undefined computeBoundingSphere]()

+

+ حساب الكرة المحيطة، وتحديث خاصية [page:.boundingSphere] + .
+ لا يتم حساب الكرات المحيطة افتراضيًا. يجب حسابها بشكل صريح + ، وإلا كانت `null`. إذا كانت نسخة من [name] متحركة، + يجب استدعاء هذه الطريقة في كل إطار لحساب كرة محيطة صحيحة. +

+ +

[method:undefined normalizeSkinWeights]()

+

تطبيع أوزان الجلد.

+ +

[method:undefined pose]()

+

هذه الطريقة تضع الشبكة المشدودة في وضعية الأساس (إعادة تعيين الوضعية).

+ +

+ [method:Vector3 applyBoneTransform]( [param:Integer index], [param:Vector3 vector] ) +

+

+ تطبق تحويل العظام المرتبط بالفهرس المعطى على موضع المتجه المعطى. يُعاد المتجه المُحدَّث. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/objects/Sprite.html b/docs/api/ar/objects/Sprite.html new file mode 100644 index 00000000000000..770b694c1df5c0 --- /dev/null +++ b/docs/api/ar/objects/Sprite.html @@ -0,0 +1,87 @@ + + + + + + + + + + [page:Object3D] → + +

[name]

+ +

+ الرذاذ هو طائرة تواجه دائمًا نحو الكاميرا، عمومًا مع + تطبيق نسيج شفاف جزئيًا.

+ + الرذاذ لا يلقي ظلالًا، وضبط castShadow = true سوف + لا يكون له أي تأثير. +

+ +

مثال للكود

+ + + const map = new THREE.TextureLoader().load( 'sprite.png' ); + const material = new THREE.SpriteMaterial( { map: map } ); + + const sprite = new THREE.Sprite( material ); + scene.add( sprite ); + + +

المنشئ (Constructor)

+ +

[name]( [param:Material material] )

+

+ [page:Material material] - (اختياري) نسخة من + [page:SpriteMaterial]. الافتراضي هو [page:SpriteMaterial] أبيض.

+ + إنشاء [name] جديد. +

+ +

الخصائص (Properties)

+

انظر إلى الفئة الأساسية [page:Object3D] للحصول على الخصائص المشتركة.

+ +

[property:Boolean isSprite]

+

علامة للقراءة فقط للتحقق مما إذا كان كائن معين هو من نوع [name].

+ +

[property:SpriteMaterial material]

+

+ نسخة من [page:SpriteMaterial]، تحدد مظهر الكائن. + الافتراضي هو [page:SpriteMaterial] أبيض. +

+ +

[property:Vector2 center]

+

+ نقطة مرساة الرذاذ، والنقطة التي يدور حولها الرذاذ. + قيمة (0.5، 0.5) تتوافق مع منتصف الرذاذ. قيمة + من (0، 0) يتوافق مع الزاوية السفلى اليسرى من الرذاذ. الافتراضي + هو (0.5، 0.5). +

+ +

الطرق (Methods)

+

انظر إلى الفئة الأساسية [page:Object3D] للحصول على الطرق المشتركة.

+ +

[method:Sprite clone]()

+

إرجاع نسخة من هذا كائن Sprite وأحفاده.

+ +

[method:this copy]( [param:Sprite sprite] )

+

نسخ خصائص رذاذ المارة إلى هذه واحدة.

+ +

+ [method:undefined raycast]( [param:Raycaster raycaster], [param:Array intersects] ) +

+

+ الحصول على تقاطعات بين شعاع ملقى وهذه الرذاذ. + سيتم استدعاء هذه الطريقة بواسطة [page:Raycaster.intersectObject](). يجب تهيئة raycaster + بواسطة استدعاء [page:Raycaster.setFromCamera]() قبل + raycasting ضد sprites. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/renderers/WebGL1Renderer.html b/docs/api/ar/renderers/WebGL1Renderer.html new file mode 100644 index 00000000000000..0eaaa2e81f086e --- /dev/null +++ b/docs/api/ar/renderers/WebGL1Renderer.html @@ -0,0 +1,47 @@ + + + + + + + + + + [page:WebGLRenderer] → + +

[name]

+ +

+ منذ r118 [page:WebGLRenderer] يستخدم تلقائيًا سياق عرض WebGL 2. عند الترقية + مشروع موجود إلى => r118 ، قد تتعطل التطبيقات لسببين: +

+
    +
  • يجب أن يكون كود الشادر المخصص مطابقًا لـ GLSL 3.0.
  • +
  • يجب تغيير فحوصات ملحقات WebGL 1.
  • +
+

+ إذا لم تتمكن من تحمل الوقت لترقية الكود الخاص بك ولكنك ما زلت ترغب في استخدام + أحدث إصدار ، يمكنك استخدام [name]. هذه الإصدارة من المُعالج ستفرض + سياق عرض WebGL 1. +

+ +

المنشئ (Constructor)

+ +

[name]( [param:Object parameters] )

+

ينشئ [name] جديدًا.

+ +

الخصائص (Properties)

+

انظر فئة [page:WebGLRenderer] الأساسية للحصول على خصائص شائعة.

+ +

[property:Boolean isWebGL1Renderer]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معينًا من نوع [name].

+ +

الطرق (Methods)

+

انظر فئة [page:WebGLRenderer] الأساسية للحصول على طرق شائعة.

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/renderers/WebGL3DRenderTarget.html b/docs/api/ar/renderers/WebGL3DRenderTarget.html new file mode 100644 index 00000000000000..4fb44ea6413958 --- /dev/null +++ b/docs/api/ar/renderers/WebGL3DRenderTarget.html @@ -0,0 +1,51 @@ + + + + + + + + + + [page:WebGLRenderTarget] → + +

[name]

+ +

يمثل هدف عرض ثلاثي الأبعاد.

+ +

المنشئ (Constructor)

+ +

+ [name]( [param:Number width], [param:Number height], [param:Number depth] ) +

+

+ [page:Number width] - عرض هدف العرض ، بالبكسل. الافتراضي + هو `1`.
+ [page:Number height] - ارتفاع هدف العرض ، بالبكسل. الافتراضي + هو `1`.
+ [page:Number depth] - عمق هدف العرض. الافتراضي هو `1`.

+ + ينشئ [name] جديدًا. +

+ +

الخصائص (Properties)

+

انظر [page:WebGLRenderTarget] للخصائص الموروثة

+ +

[property:number depth]

+

عمق هدف العرض.

+ +

[property:Data3DTexture texture]

+

+ يتم استبدال خاصية القوام بمثيل من + [page:Data3DTexture]. +

+ +

الطرق (Methods)

+

انظر [page:WebGLRenderTarget] للطرق الموروثة

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/renderers/WebGLArrayRenderTarget.html b/docs/api/ar/renderers/WebGLArrayRenderTarget.html new file mode 100644 index 00000000000000..6f7ce977e96fdd --- /dev/null +++ b/docs/api/ar/renderers/WebGLArrayRenderTarget.html @@ -0,0 +1,61 @@ + + + + + + + + + + [page:WebGLRenderTarget] → + +

[name]

+ +

+ هذا النوع من أهداف العرض يمثل مجموعة من القوام. +

+ +

أمثلة (Examples)

+ +

+ [example:webgl2_rendertarget_texture2darray WebGL 2 / render target / array]
+

+ +

المنشئ (Constructor)

+ +

+ [name]( [param:Number width], [param:Number height], [param:Number depth] ) +

+

+ [page:Number width] - عرض هدف العرض ، بالبكسل. الافتراضي + هو `1`.
+ [page:Number height] - ارتفاع هدف العرض ، بالبكسل. الافتراضي + هو `1`.
+ [page:Number depth] - عمق/عدد الطبقات لهدف العرض. الافتراضي + هو `1`.

+ + ينشئ [name] جديدًا. +

+ +

الخصائص (Properties)

+ +

انظر [page:WebGLRenderTarget] للخصائص الموروثة

+ +

[property:number depth]

+

عمق هدف العرض.

+ +

[property:DataArrayTexture texture]

+

+ يتم استبدال خاصية القوام بمثيل من + [page:DataArrayTexture]. +

+ +

الطرق (Methods)

+

انظر [page:WebGLRenderTarget] للطرق الموروثة

+ +

المصدر (Source)

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/renderers/WebGLCubeRenderTarget.html b/docs/api/ar/renderers/WebGLCubeRenderTarget.html new file mode 100644 index 00000000000000..9e8f71dcc353ed --- /dev/null +++ b/docs/api/ar/renderers/WebGLCubeRenderTarget.html @@ -0,0 +1,90 @@ + + + + + + + + + + [page:WebGLRenderTarget] → + +

[name]

+ +

+ يستخدمه [page:CubeCamera] كـ [page:WebGLRenderTarget]. +

+ +

أمثلة (Examples)

+ +

انظر [page:CubeCamera] للحصول على أمثلة.

+ +

المنشئ (Constructor)

+ +

[name]([param:Number size], [param:Object options])

+

+ [page:Float size] - الحجم ، بالبكسل. الافتراضي هو `1`.
+ options - (اختياري) كائن يحمل معلمات القوام لـ + قوام الهدف المُنشأ تلقائيًا وعمق المخزن/مخططات المخزن booleans. لـ + شرح معلمات القوام انظر [page:Texture Texture]. التالي هي خيارات صالحة:

+ + [page:Constant wrapS] - الافتراضي هو [page:Textures ClampToEdgeWrapping]. +
+ [page:Constant wrapT] - الافتراضي هو [page:Textures ClampToEdgeWrapping]. +
+ [page:Constant magFilter] - الافتراضي هو [page:Textures .LinearFilter]. +
+ [page:Constant minFilter] - الافتراضي هو [page:Textures LinearFilter]. +
+ [page:Boolean generateMipmaps] - الافتراضي هو `false`.
+ [page:Constant format] - الافتراضي هو [page:Textures RGBAFormat].
+ [page:Constant type] - الافتراضي هو [page:Textures UnsignedByteType].
+ [page:Number anisotropy] - الافتراضي هو `1`. انظر + [page:Texture.anisotropy]
+ [page:Constant colorSpace] - الافتراضي هو [page:Textures NoColorSpace]. +
+ [page:Boolean depthBuffer] - الافتراضي هو `true`.
+ [page:Boolean stencilBuffer] - الافتراضي هو `false`.

+ + ينشئ [name] جديدًا +

+ + +

الخصائص (Properties)

+ +

انظر [page:WebGLRenderTarget] للخصائص الموروثة

+ +

الطرق (Methods)

+ +

انظر [page:WebGLRenderTarget] للطرق الموروثة

+ +

+ [method:this fromEquirectangularTexture]( [param:WebGLRenderer renderer], [param:Texture texture] ) +

+

+ [page:WebGLRenderer renderer] — المُعالج.
+ [page:Texture texture] — القوام الإستوائي المستطيل. +

+

+ استخدم هذه الطريقة إذا كنت ترغب في تحويل بانوراما إستوائية مستطيلة إلى + تنسيق cubemap. +

+ +

+ [method:undefined clear]( [param:WebGLRenderer renderer], [param:Boolean color], + [param:Boolean depth], [param:Boolean stencil] ) +

+

+ اتصل بهذا لمسح لون هدف العرض وعمقه و/أو مخططات + المخزنات. يتم تعيين مخزن اللون على لون المسح الحالي للمُعالج. + المعاملات الافتراضية هي `true`. +

+ + +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/renderers/WebGLMultipleRenderTargets.html b/docs/api/ar/renderers/WebGLMultipleRenderTargets.html new file mode 100644 index 00000000000000..31298f1b2bf47d --- /dev/null +++ b/docs/api/ar/renderers/WebGLMultipleRenderTargets.html @@ -0,0 +1,75 @@ + + + + + + + + + + [page:WebGLRenderTarget] → + +

[name]

+ +

+ هدف عرض خاص يتيح لشادر الجزء الكتابة إلى عدة + قوام. هذا النهج مفيد لتقنيات العرض المتقدمة مثل + معالجة ما بعد الإنتاج أو العرض المؤجل. انتبه: [name] يمكن استخدامه فقط + مع سياق عرض WebGL 2. +

+ +

أمثلة (Examples)

+ +

+ [example:webgl2_multiple_rendertargets webgl2 / multiple / rendertargets ] +

+ +

المنشئ (Constructor)

+ +

+ [name]([param:Number width], [param:Number height], [param:Number count], + [param:Object options]) +

+ +

+ [page:Number width] - عرض هدف العرض. الافتراضي هو `1`.
+ [page:Number height] - ارتفاع هدف العرض. الافتراضي هو `1`.
+ [page:Number count] - عدد أهداف العرض. الافتراضي هو `1`.
+ + options - (كائن اختياري يحمل معلمات القوام لـ + قوام الهدف المُنشأ تلقائيًا وعمق المخزن/مخططات المخزن booleans. لـ + شرح معلمات القوام انظر [page:Texture Texture]. لـ + قائمة بالخيارات الصالحة ، انظر [page:WebGLRenderTarget WebGLRenderTarget]).

+

+ +

الخصائص (Properties)

+ +

[property:Boolean isWebGLMultipleRenderTargets]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معينًا من نوع [name].

+ +

[property:Array texture]

+

+ يتم استبدال خاصية القوام في [name] واستبدالها بمصفوفة. + تحتوي هذه المصفوفة على مراجع [page:WebGLRenderTarget.texture texture] + من أهداف العرض المعنية. +

+ +

+ خصائص [page:WebGLRenderTarget WebGLRenderTarget] متوفرة على + هذه الفئة. +

+ +

الطرق (Methods)

+ +

+ طرق [page:WebGLRenderTarget WebGLRenderTarget] متوفرة على هذه + فئة. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/renderers/WebGLRenderTarget.html b/docs/api/ar/renderers/WebGLRenderTarget.html new file mode 100644 index 00000000000000..c1dd14bc82a524 --- /dev/null +++ b/docs/api/ar/renderers/WebGLRenderTarget.html @@ -0,0 +1,131 @@ + + + + + + + + + +

[name]

+ +

+ A + [link:https://webglfundamentals.org/webgl/lessons/webgl-render-to-texture.html render target] + هو مخزن حيث ترسم بطاقة الفيديو بكسل لمشهد + يتم تجسيده في الخلفية. يستخدم في تأثيرات مختلفة ، + مثل تطبيق المعالجة اللاحقة على صورة معروضة قبل عرضها + على الشاشة. +

+ +

المنشئ (Constructor)

+ +

+ [name]([param:Number width], [param:Number height], [param:Object options]) +

+ +

+ [page:Float width] - عرض renderTarget. الافتراضي هو `1`.
+ [page:Float height] - ارتفاع renderTarget. الافتراضي هو `1`.
+ الخيارات - كائن اختياري يحمل معلمات القوام لـ + قوام الهدف التلقائي المتولد وعمق المخزن / مخطط قالب booleans. لـ + شرح معلمات القوام انظر [page:Texture Texture]. التالية هي خيارات صالحة:

+ + [page:Constant wrapS] - الافتراضي هو [page:Textures ClampToEdgeWrapping]. +
+ [page:Constant wrapT] - الافتراضي هو [page:Textures ClampToEdgeWrapping]. +
+ [page:Constant magFilter] - الافتراضي هو [page:Textures LinearFilter]. +
+ [page:Constant minFilter] - الافتراضي هو [page:Textures LinearFilter]. +
+ [page:Boolean generateMipmaps] - الافتراضي هو `false`.
+ [page:Constant format] - الافتراضي هو [page:Textures RGBAFormat].
+ [page:Constant type] - الافتراضي هو [page:Textures UnsignedByteType].
+ [page:Number anisotropy] - الافتراضي هو `1`. انظر + [page:Texture.anisotropy]
+ [page:Constant colorSpace] - الافتراضي هو [page:Textures NoColorSpace]. +
+ [page:Boolean depthBuffer] - الافتراضي هو `true`.
+ [page:Boolean stencilBuffer] - الافتراضي هو `false`.
+ [page:Number samples] - الافتراضي هو 0.

+ + ينشئ جديدًا [name] +

+ +

الخصائص (Properties)

+ +

[property:Boolean isWebGLRenderTarget]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معطىً من نوع [name].

+ +

[property:number width]

+

عرض هدف التجسيم.

+ +

[property:number height]

+

ارتفاع هدف التجسيم.

+ +

[property:Vector4 scissor]

+

+ منطقة مستطيلة داخل منفذ عرض render target. سيتم تجاهل الشظايا التي + خارج المنطقة. +

+ +

[property:Boolean scissorTest]

+ +

[property:Vector4 viewport]

+

منفذ العرض الخاص بهذا الهدف التجسيم.

+ +

[property:Texture texture]

+

+ تحتوي هذه النسخة من القوام على البكسلات المعروضة. استخدمه كإدخال لـ + معالجة إضافية. +

+ +

[property:Boolean depthBuffer]

+

يعرض على مخزن العمق. الافتراضي هو true.

+ +

[property:Boolean stencilBuffer]

+

يعرض على مخزن القالب. الافتراضي هو false.

+ +

[property:DepthTexture depthTexture]

+

+ إذا تم تعيينه ، سيتم عرض عمق المشهد على هذه القوام. الافتراضي هو null. +

+ +

[property:Number samples]

+

+ يحدد عدد عينات MSAA. يمكن استخدامه فقط مع WebGL 2. الافتراضي + هو `0`. +

+ +

الطرق (Methods)

+ +

+ [method:undefined setSize]( [param:Number width], [param:Number height] ) +

+

يحدد حجم هدف التجسيم.

+ +

[method:WebGLRenderTarget clone]()

+

ينشئ نسخة من هذا الهدف التجسيم.

+ +

[method:this copy]( [param:WebGLRenderTarget source] )

+

يتبنى إعدادات الهدف التجسيم المعطى.

+ +

[method:undefined dispose]()

+

+ يحرر الموارد المتعلقة بوحدة معالجة الرسومات المخصصة من قبل هذه الحالة. اتصل بهذا + طريقة كلما لم يعد يستخدم هذا المثيل في تطبيقك. +

+ +

+ [page:EventDispatcher EventDispatcher] الطرق متاحة على هذا + فئة. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/renderers/WebGLRenderer.html b/docs/api/ar/renderers/WebGLRenderer.html new file mode 100644 index 00000000000000..5cb4a85dbe1078 --- /dev/null +++ b/docs/api/ar/renderers/WebGLRenderer.html @@ -0,0 +1,644 @@ + + + + + + + + + +

[name]

+ +

+ يعرض مقدم WebGL مشاهدك المصنوعة بشكل جميل باستخدام + [link:https://en.wikipedia.org/wiki/WebGL WebGL]. +

+ +

المنشئ (Constructor)

+ +

[name]( [param:Object parameters] )

+

+ [page:Object parameters] - (اختياري) كائن بخصائص تحدد سلوك المقدم. + يقبل المنشئ أيضًا عدم وجود معلمات على الإطلاق. + في جميع الحالات ، سيفترض الافتراضات السليمة عندما تكون المعلمات مفقودة. + التالية هي المعلمات الصالحة:

+ + [page:DOMElement canvas] - A + [link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas canvas] + حيث يرسم المقدم ناتجه. يتوافق هذا مع + [page:WebGLRenderer.domElement domElement] property below. إذا لم يتم تمريره + هنا ، سيتم إنشاء عنصر قماش جديد.
+ + [page:WebGLRenderingContext context] - يمكن استخدام هذا لإرفاق + المقدم بـ + [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext RenderingContext] موجود. + الافتراضي هو null.
+ + [page:String precision] - دقة الشادر. يمكن أن يكون `"highp"` ، `"mediump"` + أو `"lowp"`. الافتراضي هو `"highp"` إذا كان مدعومًا من قبل الجهاز.
+ + [page:Boolean alpha] - يتحكم في قيمة alpha الافتراضية الواضحة. عند تعيينه على + `true` ، تكون القيمة `0`. وإلا فهو `1`. الافتراضي هو `false`.
+ + [page:Boolean premultipliedAlpha] - ما إذا كان المقدم سيفترض أن + الألوان لديها + [link:https://en.wikipedia.org/wiki/Glossary_of_computer_graphics#Premultiplied_alpha premultiplied alpha]. + الافتراضي هو `true`.
+ + [page:Boolean antialias] - ما إذا كان سيتم إجراء التنعيم. الافتراضي هو + `false`.
+ + [page:Boolean stencil] - ما إذا كانت ذاكرة التخزين المؤقت للرسم لديها + [link:https://en.wikipedia.org/wiki/Stencil_buffer stencil buffer] من على + الأقل 8 بت. الافتراضي هو `true`.
+ + [page:Boolean preserveDrawingBuffer] - ما إذا كان سيتم الحفاظ على المخابئ + حتى يتم مسحها يدويًا أو استبدالها. الافتراضي هو `false`.
+ + [page:String powerPreference] - يوفر تلميحًا لوكيل المستخدم + تشير إلى ما هو التكوين من GPU مناسب لهذه سياق WebGL. + يمكن أن يكون `"high-performance"` ، `"low-power"` أو `"default"`. الافتراضي هو + `"default"`. انظر + [link:https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.2 WebGL spec] للحصول على التفاصيل.
+ + [page:Boolean failIfMajorPerformanceCaveat] - ما إذا كان إنشاء المقدم + سيفشل عند اكتشاف أداء منخفض. الافتراضي هو `false`. + انظر [link:https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.2 WebGL spec] للحصول على التفاصيل.
+ + [page:Boolean depth] - ما إذا كانت ذاكرة التخزين المؤقت للرسم لديها + [link:https://en.wikipedia.org/wiki/Z-buffering مخزن عمق] من على الأقل + 16 بت. الافتراضي هو `true`.
+ + [page:Boolean logarithmicDepthBuffer] - ما إذا كان سيتم استخدام مخزن عمق لوغاريتمي + قد يكون من الضروري استخدام هذا إذا كان يتعامل مع اختلافات ضخمة + في المقياس في مشهد واحد. لاحظ أن هذا الإعداد يستخدم gl_FragDepth إذا + متوفرة والتي تعطل + [link:https://www.khronos.org/opengl/wiki/Early_Fragment_Test Early Fragment Test] + التحسين ويمكن أن يسبب انخفاضًا في الأداء. + الافتراضي هو `false`. انظر [example:webgl_camera_logarithmicdepthbuffer camera / logarithmicdepthbuffer] المثال. +

+ +

الخصائص (Properties)

+ +

[property:Boolean autoClear]

+

+ يحدد ما إذا كان المُعالج يجب أن يمسح تلقائيًا ناتجه قبل + عرض الإطار. +

+ +

[property:Boolean autoClearColor]

+

+ إذا كان [page:.autoClear autoClear] صحيحًا ، يحدد ما إذا كان المُعالج + يجب مسح مخزن اللون. الافتراضي هو `true`. +

+ +

[property:Boolean autoClearDepth]

+

+ إذا كان [page:.autoClear autoClear] صحيحًا ، يحدد ما إذا كان المُعالج + يجب مسح مخزن العمق. الافتراضي هو `true`. +

+ +

[property:Boolean autoClearStencil]

+

+ إذا كان [page:.autoClear autoClear] صحيحًا ، يحدد ما إذا كان المُعالج + يجب مسح مخزن القالب. الافتراضي هو `true`. +

+ +

[property:Object debug]

+

+ - [page:Boolean checkShaderErrors]: إذا كان صحيحًا ، يحدد ما إذا كان + يتم التحقق من برامج الشادر المادية للأخطاء أثناء التجميع و + عملية الربط. قد يكون من المفيد تعطيل هذا الفحص في الإنتاج لـ + الحصول على مكاسب في الأداء. يوصى بشدة بالاحتفاظ بهذه الفحوصات ممكّنة + أثناء التطوير. إذا لم يتم تجميع وربط الشادر - فلن يعمل + والمادة المرتبطة لن تعرض. الافتراضي هو `true`.
+ - [page:Function onShaderError]( gl, program, glVertexShader, + glFragmentShader ): وظيفة رد اتصال يمكن استخدامها للإبلاغ عن الأخطاء المخصصة + التقارير. يتلقى الرد الاتصال سياق WebGL ، ومثيل من + WebGLProgram كذلك اثنين من مثيلات WebGLShader تمثل قمة + وشادر الجزء. تعيين وظيفة مخصصة يعطل الافتراضي + التقارير عن الأخطاء. الافتراضي هو `null`. +

+ +

[property:Object capabilities]

+

+ كائن يحتوي على تفاصيل حول قدرات الحالية + [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext RenderingContext].
+ + - [page:Boolean floatFragmentTextures]: ما إذا كان السياق يدعم + [link:https://developer.mozilla.org/en-US/docs/Web/API/OES_texture_float OES_texture_float] extension.
+ - [page:Boolean floatVertexTextures]: `true` إذا كان [page:Boolean floatFragmentTextures] + و [page:Boolean vertexTextures] صحيحان على حد سواء.
+ - [page:Method getMaxAnisotropy](): يعود بأقصى قدر متاح + التشوه.
+ - [page:Method getMaxPrecision](): يعود بأقصى دقة متاحة + لشادرات القمة والجزء.
+ - [page:Boolean isWebGL2]: `true` إذا كان السياق في استخدام هو a + WebGL2RenderingContext object.
+ - [page:Boolean logarithmicDepthBuffer]: `true` إذا كان [page:parameter logarithmicDepthBuffer] + تم تعيينه على true في المُنشئ والسياق + يدعم + [link:https://developer.mozilla.org/en-US/docs/Web/API/EXT_frag_depth EXT_frag_depth] extension.
+ - [page:Integer maxAttributes]: قيمة `gl.MAX_VERTEX_ATTRIBS`.
+ - [page:Integer maxCubemapSize]: قيمة + `gl.MAX_CUBE_MAP_TEXTURE_SIZE`. أقصى ارتفاع * عرض لخرائط المكعبات + الملمسات التي يمكن استخدامها من قبل شادر.
+ - [page:Integer maxFragmentUniforms]: قيمة + `gl.MAX_FRAGMENT_UNIFORM_VECTORS`. عدد الموحدات التي يمكن استخدامها + من قبل شادر جزء.
+ - [page:Integer maxSamples]: قيمة `gl.MAX_SAMPLES`. أقصى عدد + من العينات في سياق مكافحة التعرج المتعدد (MSAA).
+ - [page:Integer maxTextureSize]: قيمة `gl.MAX_TEXTURE_SIZE`. + أقصى ارتفاع * عرض للقوام التي يستخدمها شادر.
+ - [page:Integer maxTextures]: قيمة `gl.MAX_TEXTURE_IMAGE_UNITS`. + أقصى عدد من الملمسات التي يمكن استخدامها من قبل شادر.
+ - [page:Integer maxVaryings]: قيمة `gl.MAX_VARYING_VECTORS`. The + عدد المتغيرات المتغيرة التي يمكن استخدامها من قبل shaders.
+ - [page:Integer maxVertexTextures]: قيمة + `gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS`. عدد الملمسات الت + يمكن استخدامها في شادر القمة.
+ - [page:Integer maxVertexUniforms]: قيمة + `gl.MAX_VERTEX_UNIFORM_VECTORS`. أقصى عدد من الموحدات التي يمكن + يتم استخدامها في شادر القمة.
+ - [page:String precision]: دقة الشادر التي يتم استخدامها حاليًا من قبل + المُعالج.
+ - [page:Boolean vertexTextures]: `true` إذا كان [property:Integer maxVertexTextures] + أكبر من 0 (أي يمكن استخدام ملمسات القمة).
+

+ +

[property:Array clippingPlanes]

+

+ خطوط المقص المحددة من قبل المستخدم محددة كـ THREE.Plane objects في العالم + الفضاء. تطبق هذه الطائرات عالميًا. النقاط في الفضاء التي نقطة المنتج مع + الطائرة هي سلبية يتم قطعها. الافتراضي هو []. +

+ +

[property:DOMElement domElement]

+

+ [link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas canvas] + حيث يرسم المُعالج ناتجه.
+ يتم إنشاء هذا تلقائيًا من قبل المُعالج في المُنشئ (إذا لم يكن + متوفر بالفعل) ؛ تحتاج فقط إلى إضافته إلى صفحتك مثل هذا:
+ + document.body.appendChild( renderer.domElement ); + +

+ +

[property:Object extensions]

+

+ - [page:Object get]( [param:String extensionName] ): يستخدم للتحقق مما إذا كان + مختلف الامتدادات مدعومة ويعود كائنًا بتفاصيل + التمديد إذا كان متوفرًا. يمكن لهذه الطريقة التحقق من التالية + extensions:
+

+ +
    +
  • `WEBGL_depth_texture`
  • +
  • `EXT_texture_filter_anisotropic`
  • +
  • `WEBGL_compressed_texture_s3tc`
  • +
  • `WEBGL_compressed_texture_pvrtc`
  • +
  • `WEBGL_compressed_texture_etc1`
  • +
+ +

[property:string outputColorSpace]

+

+ يحدد مساحة اللون الناتجة للمُعالج. الافتراضي هو [page:Textures THREE.SRGBColorSpace]. +

+

+ إذا تم تعيين هدف عرض باستخدام [page:WebGLRenderer.setRenderTarget .setRenderTarget] + ثم سيتم استخدام renderTarget.texture.colorSpace بدلاً من ذلك. +

+

+ انظر صفحة [page:Textures texture constants] للحصول على تفاصيل أخرى + صيغ. +

+ + +

[property:Object info]

+

+ كائن مع سلسلة من المعلومات الإحصائية حول ذاكرة لوحة الرسومات + عملية العرض. مفيد للتصحيح أو فقط لأجل + الفضول. يحتوي الكائن على الحقول التالية: +

+
    +
  • + ذاكرة: +
      +
    • الهندسة
    • +
    • القوام
    • +
    +
  • +
  • + عرض: +
      +
    • المكالمات
    • +
    • المثلثات
    • +
    • النقاط
    • +
    • خطوط
    • +
    • إطار
    • +
    +
  • +
  • برامج
  • +
+

+ بشكل افتراضي ، يتم إعادة تعيين هذه البيانات في كل مكالمة عرض ولكن عندما + مرورات عرض متعددة لكل إطار (على سبيل المثال عند استخدام معالجة ما بعد) يمكن + يفضل إعادة التعيين بنمط مخصص. أولاً ، قم بتعيين `autoReset` إلى + `false`. + renderer.info.autoReset = false; + استدعاء `reset()` كلما انتهيت من عرض إطار واحد. + renderer.info.reset(); +

+ +

[property:Boolean localClippingEnabled]

+

+ يحدد ما إذا كان المُعالج يحترم خطوط المقص على مستوى الكائن. + الافتراضي هو `false`. +

+ +

[property:Object properties]

+

+ يستخدم داخليًا من قبل المُعالج لتتبع خصائص الكائنات الفرعية المختلفة + خصائص. +

+ +

[property:WebGLRenderLists renderLists]

+

يستخدم داخليًا للتعامل مع ترتيب عرض كائنات المشهد.

+ +

[property:WebGLShadowMap shadowMap]

+

+ يحتوي هذا على المرجع إلى خريطة الظل ، إذا تم استخدامها.
+ - [page:Boolean enabled]: إذا تم تعيينه ، استخدم خرائط الظل في المشهد. الافتراضي هو + `false`.
+ - [page:Boolean autoUpdate]: يتيح التحديثات التلقائية للظلال في + المشهد. الافتراضي هو `true`.
+ إذا لم تكن بحاجة إلى إضاءة / ظلال ديناميكية ، فيمكنك تعيين هذا على + `false` عندما يتم تجزئة المُعالج.
+ - [page:Boolean needsUpdate]: عند تعيينه على `true` ، ستتم تحديث خرائط الظل في المشهد + سيتم التحديث في الاتصال `render` التالي. الافتراضي هو `false`.
+ إذا قمت بتعطيل التحديثات التلقائية لخرائط الظل + (`shadowMap.autoUpdate = false`) ، ستحتاج إلى تعيين هذا على `true` + وبعد ذلك قم بإجراء مكالمة عرض لتحديث الظلال في مشهدك.
+ - [page:Integer type]: يحدد نوع خريطة الظل (غير مفلترة ، نسبة + تصفية قريبة ، نسبة تصفية قريبة مع التصفية الثنائية في + شادر). الخيارات هي: +

+
    +
  • THREE.BasicShadowMap
  • +
  • THREE.PCFShadowMap (افتراضي)
  • +
  • THREE.PCFSoftShadowMap
  • +
  • THREE.VSMShadowMap
  • +
+

انظر [page:Renderer Renderer constants] للحصول على التفاصيل.

+ +

[property:Boolean sortObjects]

+

+ يحدد ما إذا كان المُعالج يجب أن يقوم بفرز الكائنات. الافتراضي هو `true`.

+ + ملاحظة: يتم استخدام الترتيب لمحاولة عرض الكائنات بشكل صحيح التي لديها بعض + درجة من الشفافية. بالتعريف ، قد لا يعمل فرز الكائنات في جميع + حالات. اعتمادًا على احتياجات التطبيق ، قد يكون من الضروري إغلاق + الترتيب واستخدام طرق أخرى للتعامل مع عرض الشفافية مثل + تحديد ترتيب عرض كل كائن يدويًا. +

+ +

[property:Object state]

+

+ يحتوي على وظائف لضبط خصائص مختلفة من + [page:WebGLRenderer.context] حالة. +

+ +

[property:Constant toneMapping]

+

+ الافتراضي هو [page:Renderer NoToneMapping]. انظر [page:Renderer Renderer constants] للاختيارات الأخرى. +

+ +

[property:Number toneMappingExposure]

+

مستوى التعرض للإطارات. الافتراضي هو `1`.

+ +

[property:WebXRManager xr]

+

+ يوفر وصولًا إلى واجهة [page:WebXRManager] المتعلقة بـ WebXR من + المُعالج. +

+ +

الطُرق(Methods)

+ +

+ [method:undefined clear]( [param:Boolean color], [param:Boolean depth], [param:Boolean stencil] ) +

+

+ يخبر المُعالج بمسح مخزن الرسم الخاص به للون أو العمق أو المخطط. + هذه الطريقة تقوم بتهيئة مخزن اللون إلى قيمة المسح الحالية + قيمة.
+ الحجج الافتراضية هي `true`. +

+ +

[method:undefined clearColor]( )

+

+ مسح مخزن اللون. يعادل استدعاء [page:WebGLRenderer.clear .clear]( true, false, false ). +

+ +

[method:undefined clearDepth]( )

+

+ مسح مخزن العمق. يعادل استدعاء [page:WebGLRenderer.clear .clear]( false, true, false ). +

+ +

[method:undefined clearStencil]( )

+

+ مسح مخزنات المخططات. يعادل استدعاء [page:WebGLRenderer.clear .clear]( false, false, true ). +

+ +

+ [method:undefined compile]( [param:Object3D scene], [param:Camera camera] ) +

+

+ يجمع جميع المواد في المشهد مع الكاميرا. هذا مفيد لـ + تجميع الشادرات قبل العرض الأول. +

+ +

+ [method:undefined copyFramebufferToTexture]( [param:Vector2 position], [param:FramebufferTexture texture], [param:Number level] ) +

+

+ ينسخ بكسلات من WebGLFramebuffer الحالي إلى قوام ثنائي الأبعاد. يتيح + الوصول إلى + [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/copyTexImage2D WebGLRenderingContext.copyTexImage2D]. +

+ +

+ [method:undefined copyTextureToTexture]( [param:Vector2 position], [param:Texture srcTexture], [param:Texture dstTexture], [param:Number level] ) +

+

+ ينسخ جميع بكسلات قوام إلى قوام موجود بدءًا من + الموضع المعطى. يتيح الوصول إلى + [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texSubImage2D WebGLRenderingContext.texSubImage2D]. +

+ +

+ [method:undefined copyTextureToTexture3D]( [param:Box3 sourceBox], [param:Vector3 position], [param:Texture srcTexture], [param:Texture dstTexture], [param:Number level] ) +

+

+ ينسخ بكسلات قوام في الحدود '[page:Box3 sourceBox]' في + قوام الوجهة بدءًا من الموضع المعطى. يتيح الوصول + إلى + [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texSubImage3D WebGL2RenderingContext.texSubImage3D]. +

+ +

[method:undefined dispose]( )

+

+ يحرر الموارد المتعلقة بـ GPU التي تم تخصيصها من قبل هذا المثيل. استدعاء هذا + الطريقة كلما لم يعد هذا المثيل مستخدمًا في تطبيقك. +

+ +

[method:undefined forceContextLoss]()

+

+ محاكاة فقدان سياق WebGL. هذا يتطلب دعمًا لـ + [link:https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_lose_context WEBGL_lose_context] extensions. +

+ +

[method:undefined forceContextRestore]( )

+

+ محاكاة استعادة سياق WebGL. هذا يتطلب دعمًا لـ + [link:https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_lose_context WEBGL_lose_context] extensions. +

+ +

[method:Float getClearAlpha]()

+

+ يعود [page:Float float] مع الألفا الواضح الحالي. يتراوح من 0 + إلى 1. +

+ +

[method:Color getClearColor]( [param:Color target] )

+

+ يعود مثيل [page:Color THREE.Color] مع لون المسح الحالي. +

+ +

[method:WebGL2RenderingContext getContext]()

+

يرجع سياق WebGL الحالي.

+ +

[method:WebGLContextAttributes getContextAttributes]()

+

+ يعود كائنًا يصف السمات المضبوطة على سياق WebGL + عند إنشائه. +

+ +

[method:Integer getActiveCubeFace]()

+

يعيد الوجه المكعب النشط الحالي.

+ +

[method:Integer getActiveMipmapLevel]()

+

يعيد مستوى mipmap النشط الحالي.

+ +

[method:RenderTarget getRenderTarget]()

+

+ يعيد [page:RenderTarget RenderTarget] الحالي إذا كان هناك ؛ يعود + `null` خلاف ذلك. +

+ +

[method:Vector4 getCurrentViewport]( [param:Vector4 target] )

+

+ [page:Vector4 target] — سيتم نسخ النتيجة في هذا Vector4.

+ + يعود نافذة العرض الحالية. +

+ +

[method:Vector2 getDrawingBufferSize]( [param:Vector2 target] )

+

+ [page:Vector2 target] — سيتم نسخ النتيجة في هذا Vector2.

+ + يعود عرض وارتفاع مخزن الرسم للمُعالج ، بالبكسل. +

+ +

[method:number getPixelRatio]()

+

يعود نسبة بكسل الجهاز الحالية المستخدمة.

+ +

[method:Vector4 getScissor]( [param:Vector4 target] )

+

+ [page:Vector4 target] — سيتم نسخ النتيجة في هذا Vector4.

+ + يعود منطقة المقص. +

+ +

[method:Boolean getScissorTest]()

+

يعود `true` إذا تم تمكين اختبار المقص ؛ يعود `false` خلاف ذلك.

+ +

[method:Vector2 getSize]( [param:Vector2 target] )

+

+ [page:Vector2 target] — سيتم نسخ النتيجة في هذا Vector2.

+ + يعود عرض وارتفاع قماش إخراج المُعالج ، بالبكسل. +

+ +

[method:Vector4 getViewport]( [param:Vector4 target] )

+

+ [page:Vector4 target] — سيتم نسخ النتيجة في هذا Vector4.

+ + يعود نافذة العرض. +

+ +

[method:undefined initTexture]( [param:Texture texture] )

+

+ يقوم بتهيئة القوام المعطى. مفيد لتحميل القوام مسبقًا بدلاً من + الانتظار حتى العرض الأول (الذي يمكن أن يسبب تأخيرات ملحوظة بسبب فك تشفير + وتحميل GPU). +

+ +

[method:undefined resetGLState]( )

+

+ إعادة تعيين حالة GL إلى الافتراضي. يتم استدعاؤها داخليًا إذا كان سياق WebGL + ضائع. +

+ +

+ [method:undefined readRenderTargetPixels]( [param:WebGLRenderTarget renderTarget], [param:Float x], [param:Float y], [param:Float width], [param:Float height], [param:TypedArray buffer], [param:Integer activeCubeFaceIndex] ) +

+

+ buffer - Uint8Array هو النوع الوحيد المدعوم في جميع الحالات ، + أنواع أخرى هي renderTarget ومنصة مستقلة. انظر + [link:https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.12 WebGL spec] للحصول على التفاصيل. +

+

+ يقرأ بيانات البكسل من renderTarget إلى المخزن الذي تمرره. + هذا هو حول + [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/readPixels WebGLRenderingContext.readPixels](). +

+

+ انظر [example:webgl_interactive_cubes_gpu interactive / cubes / gpu] + مثال. +

+

+ لقراءة [page:WebGLCubeRenderTarget WebGLCubeRenderTarget] استخدم + المعلمة الاختيارية activeCubeFaceIndex لتحديد أي وجه يجب + قراءة. +

+ +

+ [method:undefined render]( [param:Object3D scene], [param:Camera camera] ) +

+

+ عرض [page:Scene scene] أو نوع آخر من [page:Object3D object] + باستخدام كاميرا [page:Camera].
+ + يتم العرض إلى [page:WebGLRenderTarget renderTarget] محدد مسبقًا + مجموعة من خلال استدعاء [page:WebGLRenderer.setRenderTarget .setRenderTarget] أو إلى قماش كالمعتاد.
+ + بشكل افتراضي ، يتم مسح مخزنات العرض قبل العرض ولكن يمكنك منع + هذا عن طريق تعيين خاصية [page:WebGLRenderer.autoClear autoClear] إلى + false. إذا كنت ترغب في منع مسح مخزنات معينة فقط ، فيمكنك + تعيين خصائص [page:WebGLRenderer.autoClearColor autoClearColor], + [page:WebGLRenderer.autoClearStencil autoClearStencil] أو + [page:WebGLRenderer.autoClearDepth autoClearDepth] إلى false. لإجبار مسح واحد أو أكثر من المخزنات اتصل بـ [page:WebGLRenderer.clear .clear]. +

+ +

[method:undefined resetState]()

+

+ يمكن استخدامها لإعادة تعيين حالة WebGL الداخلية. هذه الطريقة هي في الغالب + ذات صلة بالتطبيقات التي تشارك سياق WebGL واحد عبر + مكتبات WebGL متعددة. +

+ +

[method:undefined setAnimationLoop]( [param:Function callback] )

+

+ [page:Function callback] — سيتم استدعاء الوظيفة في كل إطار متاح + الإطار. إذا تم تمرير `null` ، فسيتوقف أي رسم متحرك قائم بالفعل. +

+

+ وظيفة مدمجة يمكن استخدامها بدلاً من + [link:https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame requestAnimationFrame]. + بالنسبة لمشاريع WebXR ، يجب استخدام هذه الوظيفة. +

+ +

[method:undefined setClearAlpha]( [param:Float alpha] )

+

يضبط الألفا الواضح. المدخلات الصالحة هي عدد عشري بين `0.0` و `1.0`.

+ +

+ [method:undefined setClearColor]( [param:Color color], [param:Float alpha] ) +

+

يضبط لون المسح والشفافية.

+ +

[method:undefined setPixelRatio]( [param:number value] )

+

+ يضبط نسبة بكسل الجهاز. يتم استخدام هذا عادةً لجهاز HiDPI لمنع + قماش الإخراج المشوش. +

+ +

+ [method:undefined setRenderTarget]( [param:WebGLRenderTarget renderTarget], + [param:Integer activeCubeFace], [param:Integer activeMipmapLevel] ) +

+

+ renderTarget -- [page:WebGLRenderTarget renderTarget] التي تحتاج إلى + تفعيله. عند إعطاء `null` ، يتم تعيين قماش كـ هدف عرض نشط + بدلاً من ذلك.
+ activeCubeFace -- يحدد جانب المكعب النشط (PX 0 ، NX 1 ، PY 2 ، NY 3 ، + PZ 4 ، NZ 5) من [page:WebGLCubeRenderTarget]. عند تمرير + [page:WebGLArrayRenderTarget] أو [page:WebGL3DRenderTarget] هذا يشير + إلى طبقة z للعرض فيه (اختياري).
+ activeMipmapLevel -- يحدد مستوى mipmap النشط (اختياري).

+ هذه الطريقة تضبط rendertarget النشط. +

+ +

+ [method:undefined setScissor]( [param:Integer x], [param:Integer y], [param:Integer width], [param:Integer height] )
+ [method:undefined setScissor]( [param:Vector4 vector] ) +

+ +

+ معلمات x و y والعرض والارتفاع لمنطقة المقص.
+ اختياريًا ، متجه مكون من 4 مكونات يحدد معلمات + المنطقة.

+ + يضبط منطقة المقص من (x ، y) إلى (x + width ، y + height).
+ (x ، y) هو الزاوية السفلى اليسرى لمنطقة المقص. +

+ +

[method:undefined setScissorTest]( [param:Boolean boolean] )

+

+ تمكين أو تعطيل اختبار المقص. عند تمكين هذا ، فقط البكسلات + داخل منطقة المقص المحددة ستتأثر بإجراءات المُعالج + التالية. +

+ +

[method:undefined setOpaqueSort]( [param:Function method] )

+

+ يضبط وظيفة الترتيب الشفاف المخصصة لـ WebGLRenderLists. امرر null + لاستخدام وظيفة painterSortStable الافتراضية. +

+ +

[method:undefined setTransparentSort]( [param:Function method] )

+

+ يضبط وظيفة الترتيب الشفاف المخصصة لـ WebGLRenderLists. امرر + null لاستخدام وظيفة reversePainterSortStable الافتراضية. +

+ +

+ [method:undefined setSize]( [param:Integer width], [param:Integer height], [param:Boolean updateStyle] ) +

+

+ يغير حجم قماش الإخراج إلى (العرض ، الارتفاع) مع نسبة بكسل الجهاز التي تؤخذ في + بعين الاعتبار ، ويضبط أيضًا نافذة العرض لتناسب هذا الحجم ، بدءًا من (0 ، + 0). يؤدي تعيين [page:Boolean updateStyle] إلى false إلى منع أي تغييرات في الأسلوب + إلى قماش الإخراج. +

+ +

+ [method:undefined setViewport]( [param:Integer x], [param:Integer y], [param:Integer width], [param:Integer height] )
+ [method:undefined setViewport]( [param:Vector4 vector] ) +

+ +

+ معلمات x و y والعرض والارتفاع لنافذة العرض.
+ اختياريًا ، متجه مكون من 4 مكونات يحدد معلمات + نافذة عرض.

+ + يضبط نافذة العرض للعرض من (x ، y) إلى (x + width ، y + height).
+ (x ، y) هو الزاوية السفلى اليسرى للمنطقة. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/renderers/shaders/ShaderChunk.html b/docs/api/ar/renderers/shaders/ShaderChunk.html new file mode 100644 index 00000000000000..1d97db14ad5132 --- /dev/null +++ b/docs/api/ar/renderers/shaders/ShaderChunk.html @@ -0,0 +1,24 @@ + + + + + + + + + +

[name]

+ +

قطع الشادر لمكتبة شادر WebGL

+ +

الخصائص (Properties)

+ +

الطرق (Methods)

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/renderers/shaders/ShaderLib.html b/docs/api/ar/renderers/shaders/ShaderLib.html new file mode 100644 index 00000000000000..0bac76675304e0 --- /dev/null +++ b/docs/api/ar/renderers/shaders/ShaderLib.html @@ -0,0 +1,24 @@ + + + + + + + + + +

[name]

+ +

مكتبة شادر WebGL لـ three.js

+ +

الخصائص (Properties)

+ +

الطرق (Methods)

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/renderers/shaders/UniformsLib.html b/docs/api/ar/renderers/shaders/UniformsLib.html new file mode 100644 index 00000000000000..8bc070c0d67fb7 --- /dev/null +++ b/docs/api/ar/renderers/shaders/UniformsLib.html @@ -0,0 +1,24 @@ + + + + + + + + + +

[name]

+ +

مكتبة الزي الموحد لشادرات WebGL المشتركة

+ +

الخصائص (Properties)

+ +

الطرق (Methods)

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/renderers/shaders/UniformsUtils.html b/docs/api/ar/renderers/shaders/UniformsUtils.html new file mode 100644 index 00000000000000..3d69614f637266 --- /dev/null +++ b/docs/api/ar/renderers/shaders/UniformsUtils.html @@ -0,0 +1,41 @@ + + + + + + + + + +

[name]

+ +

يوفر دوال المساعدة لإدارة الزي الموحد.

+ +

الطرق (Methods)

+ +

[method:Object clone]( [param:Object src] )

+

+ src -- كائن يمثل تعريفات الزي الموحد.

+ + يستنسخ تعريفات الزي الموحد المعطاة عن طريق إجراء نسخة عميقة. هذا يعني + إذا كان [page:Uniform.value value] من الزي الموحد يشير إلى كائن مثل + [page:Vector3] أو [page:Texture]، فإن الزي الموحد المستنسخ سيشير إلى مرجع + كائن جديد. +

+ +

[method:Object merge]( [param:Array uniforms] )

+

+ uniforms -- مصفوفة من الكائنات التي تحتوي على تعريفات الزي الموحد.

+ + تدمج تعريفات الزي الموحد المعطاة في كائن واحد. نظرًا لأن + الطريقة تستخدم داخليًا [page:.clone](), فهو يؤدي نسخًا عميقًا عند + إنتاج تعريفات الزي الموحد المدمجة. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/renderers/webxr/WebXRManager.html b/docs/api/ar/renderers/webxr/WebXRManager.html new file mode 100644 index 00000000000000..65207d444c2838 --- /dev/null +++ b/docs/api/ar/renderers/webxr/WebXRManager.html @@ -0,0 +1,165 @@ + + + + + + + + + +

[name]

+ +

+ تمثل هذه الفئة تجريدًا لواجهة برمجة تطبيقات WebXR Device وتستخدم + داخليًا بواسطة [page:WebGLRenderer]. [name] يوفر أيضًا واجهة عامة + الذي يسمح للمستخدمين بتمكين / تعطيل XR وتنفيذ مهام ذات صلة بـ XR + مثل استرداد التحكُّمات على سبيل المثال. +

+ +

الخصائص (Properties)

+ +

[property:Boolean cameraAutoUpdate]

+

+ ما إذا كان يجب تحديث كاميرا XR الخاصة بالمدير تلقائيًا أم لا. + الافتراضي هو `true`. +

+ +

[property:Boolean enabled]

+

+ هذا العلم يخطر المقدم بأن يكون جاهزًا للتصوير XR. الافتراضي هو + `false`. قم بتعيينه على `true` إذا كنت ستستخدم XR في تطبيقك. +

+ +

[property:Boolean isPresenting]

+

+ ما إذا كان التقديم XR نشطًا أم لا. الافتراضي هو `false`. هذا العلم هو + للقراءة فقط وتعيينه تلقائيًا بواسطة [name]. +

+ +

الطرق (Methods)

+ +

[method:ArrayCamera getCamera]()

+

+ يرجع نسخة من [page:ArrayCamera] التي تمثل كاميرا XR + لجلسة XR النشطة. لكل عرض يحتفظ بكائن كاميرا منفصل + في خصائص [page:ArrayCamera.cameras cameras]. +

+

+ حاليًا لا يتم استخدام `fov` الكاميرا ولا يعكس fov من + كاميرا XR. إذا كنت بحاجة إلى fov على مستوى التطبيق ، فعليك حسابه + بشكل يدوي من مصفوفات الإسقاط الخاصة بكاميرا XR. +

+ +

[method:Group getController]( [param:Integer index] )

+

+ [page:Integer index] — فهرس المتحكم.

+ + يعود بـ [page:Group] يمثل ما يسمى بمساحة *الشعاع المستهدف* من + المتحكم XR. استخدم هذه المساحة لتصور الكائنات ثلاثية الأبعاد التي تدعم + المستخدم في مهام الإشارة مثل التفاعل مع واجهة المستخدم. +

+ +

[method:Group getControllerGrip]( [param:Integer index] )

+

+ [page:Integer index] — فهرس المتحكم.

+ + يعود بـ [page:Group] يمثل ما يسمى بمساحة `القبضة` من المتحكم XR + . استخدم هذه المساحة إذا كان المستخدم سيحمل كائنات ثلاثية الأبعاد أخرى + مثل سيف الضوء. +

+ +

+ ملاحظة: إذا كنت ترغب في إظهار شيء في يد المستخدم وتقديم + شعاع الإشارة في نفس الوقت ، فسترغب في إرفاق الكائن المحمول باليد + إلى المجموعة التي يتم إرجاعها بواسطة [page:.getControllerGrip]() والشعاع إلى + المجموعة التي يتم إرجاعها بواسطة [page:.getController](). الفكرة هي أن يكون لديك اثنان + مجموعات مختلفة في مسافتين إحداثيتين مختلفتين لنفس WebXR + التحكم. +

+ +

[method:Float getFoveation]()

+

+ يعود بكمية الفوفيشن المستخدمة من قبل ملحق XR لـ + طبقة الإسقاط. +

+ +

[method:Group getHand]( [param:Integer index] )

+

+ [page:Integer index] — فهرس المتحكم.

+ + يعود بـ [page:Group] يمثل ما يسمى بـ `hand` أو `joint` space + التحكم XR. استخدام هذه المساحة لتصور أيدي المستخدم عند عدم استخدام + التحكُّمات الفعلية. +

+ +

[method:String getReferenceSpace]()

+

يرجع المسافة المرجعية.

+ +

[method:XRSession getSession]()

+

+ يرجع كائن `XRSession` الذي يسمح بإدارة أكثر دقة + لجلسات WebXR النشطة على مستوى التطبيق. +

+ +

[method:undefined setFoveation]( [param:Float foveation] )

+

+ [page:Float foveation] — الفوفيشن المراد تعيينه.

+ + يحدد مقدار الفوفيشن المستخدم من قبل ملحق XR للطبقة. + يجب أن يكون قيمة بين `0` و `1`. +

+ +

[method:undefined setFramebufferScaleFactor]( [param:Float framebufferScaleFactor] )

+

+ [page:Float framebufferScaleFactor] — عامل مقياس الإطار المراد تعيينه.

+ + يحدد عامل التحجيم المستخدم عند تحديد حجم الإطار عند التصوير إلى جهاز XR. القيمة نسبية إلى + دقة عرض جهاز XR الافتراضية. الافتراضي هو `1`. قيمة `0.5` + تحدد إطارًا بنسبة 50٪ من دقة العرض الأصلية. +

+ +

+ ملاحظة: لا يمكن تغيير عامل مقياس الإطار أثناء + تقديم محتوى XR. +

+ +

[method:undefined setReferenceSpace]( [param:XRReferenceSpace referenceSpace] )

+

+ [page:XRReferenceSpace referenceSpace] — مساحة مرجعية مخصصة.

+ + يمكن استخدامه لتكوين مساحة مرجعية مخصصة تستبدل + المساحة المرجعية الافتراضية. +

+ +

[method:undefined setReferenceSpaceType]( [param:String referenceSpaceType] )

+

+ [page:String referenceSpaceType] — نوع المساحة المرجعية المراد تعيينه.

+ + يمكن استخدامه لتكوين علاقة فضائية مع + بيئة المستخدم الفعلية. اعتمادًا على كيفية حركة المستخدم في الفضاء ثلاثي الأبعاد ، يمكن أن يؤدي تعيين + مساحة مرجعية مناسبة إلى تحسين التتبع. الافتراضي هو + `local-floor`. يرجى التحقق من + [link:https://developer.mozilla.org/en-US/docs/Web/API/XRReferenceSpaceType MDN] + للحصول على قائمة بالقيم الممكنة وحالات استخدامها. +

+ +

[method:undefined updateCamera]( [param:PerspectiveCamera camera] )

+

+ تحديث حالة كاميرا XR. استخدم هذه الطريقة على مستوى التطبيق إذا + ضبط [page:.cameraAutoUpdate] إلى `false`. تتطلب الطريقة كاميرا غير XR + المشهد كمعلم. يتم ضبط تحولات الكاميرا التي تم تمريرها تلقائيًا إلى موضع كاميرا XR عند استدعاء + هذه الطريقة. +

+ +

+ ملاحظة: لا يمكن تغيير نوع المساحة المرجعية أثناء + تقديم محتوى XR. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/scenes/Fog.html b/docs/api/ar/scenes/Fog.html new file mode 100644 index 00000000000000..6098b14b648f1b --- /dev/null +++ b/docs/api/ar/scenes/Fog.html @@ -0,0 +1,80 @@ + + + + + + + + + +

[name]

+ +

+ تحتوي هذه الفئة على المعلمات التي تحدد الضباب الخطي ، أي + ينمو بشكل خطي أكثر كثافة مع المسافة. +

+ +

مثال للكود

+ + + const scene = new THREE.Scene(); + scene.fog = new THREE.Fog( 0xcccccc, 10, 15 ); + + +

المنشئ (Constructor)

+ +

+ [name]( [param:Integer color], [param:Float near], [param:Float far] ) +

+

+ يتم تمرير معلمة اللون إلى [page:Color] المنشئ لتعيين + خاصية اللون. يمكن أن يكون اللون عددًا صحيحًا سداسي عشريًا أو سلسلة على طراز CSS. +

+ +

الخصائص (Properties)

+ +

[property:Boolean isFog]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معطىً من نوع [name].

+ +

[property:String name]

+

+ اسم اختياري للكائن (لا يحتاج إلى أن يكون فريدًا). الافتراضي هو + سلسلة فارغة. +

+ +

[property:Color color]

+

+ لون الضباب. مثال: إذا تم تعيينه على الأسود ، سيتم عرض الأشياء البعيدة + أسود. +

+ +

[property:Float near]

+

+ المسافة الدنيا لبدء تطبيق الضباب. الأشياء التي هي أقل من + 'near' units from the active camera won't be affected by fog. +

+

الافتراضي هو `1`.

+ +

[property:Float far]

+

+ المسافة القصوى التي يتوقف فيها حساب وتطبيق الضباب. + الأشياء التي تبعد أكثر من 'far' units away from the active camera won't + يتأثر بالضباب. +

+

الافتراضي هو `1000`.

+ +

الطرق (Methods)

+ +

[method:Fog clone]()

+

يرجع مثيل ضباب جديد بنفس المعلمات كهذا.

+ +

[method:Object toJSON]()

+

إرجاع بيانات الضباب في تنسيق JSON.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/scenes/FogExp2.html b/docs/api/ar/scenes/FogExp2.html new file mode 100644 index 00000000000000..6e2706b8f77443 --- /dev/null +++ b/docs/api/ar/scenes/FogExp2.html @@ -0,0 +1,68 @@ + + + + + + + + + +

[name]

+ +

+ تحتوي هذه الفئة على المعلمات التي تحدد الضباب المربع الأسي ، + الذي يعطي رؤية واضحة بالقرب من الكاميرا وأسرع من الضباب المتزايد بشكل أسي + بعيدًا عن الكاميرا. +

+ +

مثال للكود

+ + + const scene = new THREE.Scene(); + scene.fog = new THREE.FogExp2( 0xcccccc, 0.002 ); + + +

المنشئ (Constructor)

+ +

[name]( [param:Integer color], [param:Float density] )

+ +

+ يتم تمرير معلمة اللون إلى [page:Color] المنشئ لتعيين + خاصية اللون. يمكن أن يكون اللون عددًا صحيحًا سداسي عشريًا أو سلسلة على طراز CSS. +

+

الخصائص (Properties)

+ +

[property:Boolean isFogExp2]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معطىً من نوع [name].

+ +

[property:String name]

+

+ اسم اختياري للكائن (لا يحتاج إلى أن يكون فريدًا). الافتراضي هو + سلسلة فارغة. +

+ +

[property:Color color]

+

+ لون الضباب. مثال: إذا تم تعيينه على الأسود ، سيتم عرض الأشياء البعيدة + أسود. +

+ +

[property:Float density]

+

يحدد مدى سرعة نمو الضباب.

+

الافتراضي هو `0.00025`.

+ +

الطرق (Methods)

+ +

[method:FogExp2 clone]()

+

يرجع مثيل FogExp2 جديد بنفس المعلمات كهذا.

+ +

[method:Object toJSON]()

+

إرجاع بيانات FogExp2 في تنسيق JSON.

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/ar/scenes/Scene.html b/docs/api/ar/scenes/Scene.html new file mode 100644 index 00000000000000..221ef88106bc43 --- /dev/null +++ b/docs/api/ar/scenes/Scene.html @@ -0,0 +1,92 @@ + + + + + + + + + + [page:Object3D] → +

[name]

+ +

+ تسمح لك المشاهد بتحديد ما وأين يتم تجسيده بواسطة three.js. + هذا هو المكان الذي تضع فيه الأشياء والأضواء والكاميرات. +

+ +

المنشئ (Constructor)

+ +

[name]()

+

إنشاء كائن مشهد جديد.

+ +

الخصائص (Properties)

+ +

[property:Object background]

+

+ يحدد خلفية المشهد. الافتراضي هو `null`. المدخلات الصالحة هي: +

+
    +
  • [page:Color] لتحديد خلفية ملونة موحدة.
  • +
  • [page:Texture] لتحديد خلفية ملمس (مسطح).
  • +
  • + مكعبات القوام ([page:CubeTexture]) أو القوام المستطيلة لـ + تحديد صندوق سماء. +
  • +
+ ملاحظة: يتم تجاهل أي تكوينات ذات صلة بالكاميرا مثل `zoom` أو `view`. + +

[property:Float backgroundBlurriness]

+

+ يحدد ضبابية الخلفية. يؤثر فقط على خرائط البيئة + المعينة إلى [page:Scene.background]. الإدخال الصالح هو عدد عشري بين `0` + و `1`. الافتراضي هو `0`. +

+ +

[property:Float backgroundIntensity]

+

+ يضعف لون الخلفية. ينطبق فقط على خلفية + الملمس. الافتراضي هو `1`. +

+ +

[property:Texture environment]

+

+ يحدد خريطة البيئة لجميع المواد الفعلية في المشهد. ومع ذلك ، + ليس من الممكن الكتابة فوق نسيج موجود معين إلى + [page:MeshStandardMaterial.envMap]. الافتراضي هو `null`. +

+ +

[property:Fog fog]

+ +

+ مثيل [page:Fog fog] يحدد نوع الضباب الذي يؤثر على كل شيء + تم تجسيده في المشهد. الافتراضي هو `null`. +

+ +

[property:Boolean isScene]

+

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معطىً من نوع [name].

+ +

[property:Material overrideMaterial]

+ +

+ يجبر كل شيء في المشهد على التجسيم باستخدام المادة المحددة. + الافتراضي هو `null`. +

+ +

الطرق (Methods)

+ +

[method:Object toJSON]( [param:Object meta] )

+

+ meta - كائن يحتوي على بيانات تعريفية مثل الملمس أو الصور لـ + scene.
+ قم بتحويل المشهد إلى three.js + [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format]. +

+ +

المصدر (Source)

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/en/animation/AnimationAction.html b/docs/api/en/animation/AnimationAction.html index a2ca9e65896672..000f3d6c359992 100644 --- a/docs/api/en/animation/AnimationAction.html +++ b/docs/api/en/animation/AnimationAction.html @@ -59,7 +59,7 @@

[property:Boolean clampWhenFinished]

automatically be switched to false when the last loop of the action has finished, so that this action has no further impact.

- Default is false.

+ Default is `false`.

Note: `clampWhenFinished` has no impact if the action is interrupted (it has only an effect if its last loop has really finished). @@ -140,7 +140,7 @@

[property:Number timeScale]

[property:Number weight]

The degree of influence of this action (in the interval `[0, 1]`). Values - between `0` (no impact) and 1 (full impact) can be used to blend between + between `0` (no impact) and `1` (full impact) can be used to blend between several actions. Default is `1`.

Properties/methods concerning `weight` are: [page:.crossFadeFrom crossFadeFrom], @@ -179,7 +179,7 @@

of the time scales) will be applied.

Note: Like with `fadeIn`/`fadeOut`, the fading starts/ends with a weight - of 1. + of `1`.

@@ -193,7 +193,7 @@

of the time scales) will be applied.

Note: Like with `fadeIn`/`fadeOut`, the fading starts/ends with a weight - of 1. + of `1`.

[method:this fadeIn]( [param:Number durationInSeconds] )

diff --git a/docs/api/en/animation/tracks/ColorKeyframeTrack.html b/docs/api/en/animation/tracks/ColorKeyframeTrack.html index 04b321eae0acb2..1ed0c6aedbfe13 100644 --- a/docs/api/en/animation/tracks/ColorKeyframeTrack.html +++ b/docs/api/en/animation/tracks/ColorKeyframeTrack.html @@ -26,7 +26,7 @@

[page:String name] - (required) identifier for the KeyframeTrack.
[page:Array times] - (required) array of keyframe times.
[page:Array values] - values for the keyframes at the times specified, a - flat array of color components between 0 and 1.
+ flat array of color components between `0` and `1`.
[page:Constant interpolation] - the type of interpolation to use. See [page:Animation Animation Constants] for possible values. Default is [page:Animation InterpolateLinear]. diff --git a/docs/api/en/cameras/PerspectiveCamera.html b/docs/api/en/cameras/PerspectiveCamera.html index 3e426f80d651cb..ac582391e37135 100644 --- a/docs/api/en/cameras/PerspectiveCamera.html +++ b/docs/api/en/cameras/PerspectiveCamera.html @@ -66,7 +66,7 @@

[property:Float far]

[property:Float filmGauge]

- Film size used for the larger axis. Default is 35 (millimeters). This + Film size used for the larger axis. Default is `35` (millimeters). This parameter does not influence the projection matrix unless .filmOffset is set to a nonzero value.

diff --git a/docs/api/en/constants/Materials.html b/docs/api/en/constants/Materials.html index 7ffee38f8d0624..449d9cc168a200 100644 --- a/docs/api/en/constants/Materials.html +++ b/docs/api/en/constants/Materials.html @@ -144,7 +144,7 @@

Stencil Operations

Which stencil operation the material will perform on the stencil buffer pixel if the provided stencil function passes.
- [page:Materials ZeroStencilOp] will set the stencil value to 0.
+ [page:Materials ZeroStencilOp] will set the stencil value to `0`.
[page:Materials KeepStencilOp] will not change the current stencil value.
[page:Materials ReplaceStencilOp] will replace the stencil value with the diff --git a/docs/api/en/core/BufferAttribute.html b/docs/api/en/core/BufferAttribute.html index ba570b79039182..8821ef09a0e782 100644 --- a/docs/api/en/core/BufferAttribute.html +++ b/docs/api/en/core/BufferAttribute.html @@ -56,11 +56,8 @@

[property:TypedArray array]

[property:Integer count]

- Stores the [page:BufferAttribute.array array]'s length divided by the - [page:BufferAttribute.itemSize itemSize].

- - If the buffer is storing a 3-component vector (such as a position, normal, - or color), then this will count the number of such vectors stored. + Represents the number of items this buffer attribute stores. It is internally computed by dividing the [page:BufferAttribute.array array]'s length by the + [page:BufferAttribute.itemSize itemSize]. Read-only property.

[property:Number gpuType]

@@ -176,6 +173,9 @@

[method:this copyArray]( array )

[method:this copyAt] ( [param:Integer index1], [param:BufferAttribute bufferAttribute], [param:Integer index2] )

Copy a vector from bufferAttribute[index2] to [page:BufferAttribute.array array][index1].

+

[method:Number getComponent]( [param:Integer index], [param:Integer component] )

+

Returns the given component of the vector at the given index.

+

[method:Number getX]( [param:Integer index] )

Returns the x component of the vector at the given index.

@@ -221,7 +221,10 @@

[method:this setUsage] ( [param:Usage value] )

Instead, instantiate a new one and set the desired usage before the next render.

- + +

[method:Number setComponent]( [param:Integer index], [param:Integer component], [param:Float value] )

+

Sets the given component of the vector at the given index.

+

[method:this setX]( [param:Integer index], [param:Float x] )

Sets the x component of the vector at the given index.

diff --git a/docs/api/en/core/BufferGeometry.html b/docs/api/en/core/BufferGeometry.html index 2469686bcc404a..b4ff4e2ce6081b 100644 --- a/docs/api/en/core/BufferGeometry.html +++ b/docs/api/en/core/BufferGeometry.html @@ -289,7 +289,7 @@

[method:this lookAt] ( [param:Vector3 vector] )

[method:undefined normalizeNormals]()

- Every normal vector in a geometry will have a magnitude of 1. This will + Every normal vector in a geometry will have a magnitude of `1`. This will correct lighting on the geometry surfaces.

diff --git a/docs/api/en/core/Object3D.html b/docs/api/en/core/Object3D.html index 08601c7e1acf06..399f53964bf3bd 100644 --- a/docs/api/en/core/Object3D.html +++ b/docs/api/en/core/Object3D.html @@ -280,6 +280,9 @@

[method:this attach]( [param:Object3D object] )

Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).

+ +

[method:this clear]()

+

Removes all child objects.

[method:Object3D clone]( [param:Boolean recursive] )

@@ -412,9 +415,6 @@

[method:this remove]( [param:Object3D object], ... )

[method:this removeFromParent]()

Removes this object from its current parent.

-

[method:this clear]()

-

Removes all child objects.

-

[method:this rotateOnAxis]( [param:Vector3 axis], [param:Float angle] )

axis -- A normalized vector in object space.
diff --git a/docs/api/en/core/Raycaster.html b/docs/api/en/core/Raycaster.html index 91e42a29e0c808..467b56b1671d6c 100644 --- a/docs/api/en/core/Raycaster.html +++ b/docs/api/en/core/Raycaster.html @@ -77,7 +77,7 @@

[name]( [param:Vector3 origin], [param:Vector3 direction], [param:Float near [page:Vector3 direction] — The direction vector that gives direction to the ray. Should be normalized.
[page:Float near] — All results returned are further away than near. Near - can't be negative. Default value is 0.
+ can't be negative. Default value is `0`.
[page:Float far] — All results returned are closer than far. Far can't be lower than near. Default value is Infinity.

@@ -155,7 +155,7 @@

[method:undefined set]( [param:Vector3 origin], [param:Vector3 direction])[method:undefined setFromCamera]( [param:Vector2 coords], [param:Camera camera] )

[page:Vector2 coords] — 2D coordinates of the mouse, in normalized device - coordinates (NDC)---X and Y components should be between -1 and 1.
+ coordinates (NDC)---X and Y components should be between `-1` and `1`.
[page:Camera camera] — camera from which the ray should originate

Updates the ray with a new origin and direction.

diff --git a/docs/api/en/extras/core/Curve.html b/docs/api/en/extras/core/Curve.html index 6bde52b833e2f5..8bc7e91e1b5d66 100644 --- a/docs/api/en/extras/core/Curve.html +++ b/docs/api/en/extras/core/Curve.html @@ -27,7 +27,7 @@

[property:Integer arcLengthDivisions]

cumulative segment lengths of a curve via [page:.getLengths]. To ensure precision when using methods like [page:.getSpacedPoints], it is recommended to increase [page:.arcLengthDivisions] if the curve is very - large. Default is 200. + large. Default is `200`.

Methods

diff --git a/docs/api/en/extras/core/Path.html b/docs/api/en/extras/core/Path.html index ae0c5733b58adf..c487b210ea40ca 100644 --- a/docs/api/en/extras/core/Path.html +++ b/docs/api/en/extras/core/Path.html @@ -81,7 +81,7 @@

[method:this absellipse]( [param:Float x], [param:Float y], [param:Float xRa endAngle -- The end angle in radians.
clockwise -- Sweep the ellipse clockwise. Defaults to false.
rotation -- The rotation angle of the ellipse in radians, counterclockwise - from the positive X axis. Optional, defaults to 0.

+ from the positive X axis. Optional, defaults to `0`.

Adds an absolutely positioned [page:EllipseCurve EllipseCurve] to the path. diff --git a/docs/api/en/extras/core/ShapePath.html b/docs/api/en/extras/core/ShapePath.html index ca027fb71ff8ec..6bba72a4cd96ac 100644 --- a/docs/api/en/extras/core/ShapePath.html +++ b/docs/api/en/extras/core/ShapePath.html @@ -11,7 +11,7 @@

[name]

This class is used to convert a series of shapes to an array of - [page:Path]s, for example an SVG shape to a path (see the example below). + [page:Path]s, for example an SVG shape to a path.

Constructor

diff --git a/docs/api/en/geometries/BoxGeometry.html b/docs/api/en/geometries/BoxGeometry.html index 4be58bd3ee05ec..3672a8658491ad 100644 --- a/docs/api/en/geometries/BoxGeometry.html +++ b/docs/api/en/geometries/BoxGeometry.html @@ -58,22 +58,22 @@

width — Width; that is, the length of the edges parallel to the X axis. - Optional; defaults to 1. + Optional; defaults to `1`.
height — Height; that is, the length of the edges parallel to the Y axis. - Optional; defaults to 1. + Optional; defaults to `1`.
depth — Depth; that is, the length of the edges parallel to the Z axis. - Optional; defaults to 1. + Optional; defaults to `1`.
widthSegments — Number of segmented rectangular faces along the width of - the sides. Optional; defaults to 1. + the sides. Optional; defaults to `1`.
heightSegments — Number of segmented rectangular faces along the height of - the sides. Optional; defaults to 1. + the sides. Optional; defaults to `1`.
depthSegments — Number of segmented rectangular faces along the depth of - the sides. Optional; defaults to 1. + the sides. Optional; defaults to `1`.

diff --git a/docs/api/en/geometries/CapsuleGeometry.html b/docs/api/en/geometries/CapsuleGeometry.html index 8615d9921995da..293149b320fce7 100644 --- a/docs/api/en/geometries/CapsuleGeometry.html +++ b/docs/api/en/geometries/CapsuleGeometry.html @@ -51,12 +51,12 @@

[name]([param:Float radius], [param:Float length], [param:Integer capSubdivisions], [param:Integer radialSegments])

- radius — Radius of the capsule. Optional; defaults to 1.
- length — Length of the middle section. Optional; defaults to 1.
+ radius — Radius of the capsule. Optional; defaults to `1`.
+ length — Length of the middle section. Optional; defaults to `1`.
capSegments — Number of curve segments used to build the caps. Optional; - defaults to 4.
+ defaults to `4`.
radialSegments — Number of segmented faces around the circumference of the - capsule. Optional; defaults to 8.
+ capsule. Optional; defaults to `8`.

Properties

diff --git a/docs/api/en/geometries/CircleGeometry.html b/docs/api/en/geometries/CircleGeometry.html index c615ef262924f3..57aa380de1a493 100644 --- a/docs/api/en/geometries/CircleGeometry.html +++ b/docs/api/en/geometries/CircleGeometry.html @@ -56,11 +56,11 @@

radius — Radius of the circle, default = 1.
- segments — Number of segments (triangles), minimum = 3, default = 32.
- thetaStart — Start angle for first segment, default = 0 (three o'clock + segments — Number of segments (triangles), minimum = `3`, default = `32`.
+ thetaStart — Start angle for first segment, default = `0` (three o'clock position).
thetaLength — The central angle, often called theta, of the circular - sector. The default is 2*Pi, which makes for a complete circle. + sector. The default is `2`*Pi, which makes for a complete circle.

Properties

diff --git a/docs/api/en/geometries/ConeGeometry.html b/docs/api/en/geometries/ConeGeometry.html index c238c2e44d221c..ecff667f4ce0ca 100644 --- a/docs/api/en/geometries/ConeGeometry.html +++ b/docs/api/en/geometries/ConeGeometry.html @@ -45,18 +45,18 @@

[name]([param:Float radius], [param:Float height], [param:Integer radialSegments], [param:Integer heightSegments], [param:Boolean openEnded], [param:Float thetaStart], [param:Float thetaLength])

- radius — Radius of the cone base. Default is 1.
- height — Height of the cone. Default is 1.
+ radius — Radius of the cone base. Default is `1`.
+ height — Height of the cone. Default is `1`.
radialSegments — Number of segmented faces around the circumference of the - cone. Default is 32
+ cone. Default is `32`
heightSegments — Number of rows of faces along the height of the cone. - Default is 1.
+ Default is `1`.
openEnded — A Boolean indicating whether the base of the cone is open or capped. Default is false, meaning capped.
thetaStart — Start angle for first segment, default = 0 (three o'clock position).
thetaLength — The central angle, often called theta, of the circular - sector. The default is 2*Pi, which makes for a complete cone. + sector. The default is `2`*Pi, which makes for a complete cone.

Properties

diff --git a/docs/api/en/geometries/CylinderGeometry.html b/docs/api/en/geometries/CylinderGeometry.html index c53b2bb2dff3ff..3b9a596b8e8b35 100644 --- a/docs/api/en/geometries/CylinderGeometry.html +++ b/docs/api/en/geometries/CylinderGeometry.html @@ -49,19 +49,19 @@

[param:Boolean openEnded], [param:Float thetaStart], [param:Float thetaLength])

- radiusTop — Radius of the cylinder at the top. Default is 1.
- radiusBottom — Radius of the cylinder at the bottom. Default is 1.
- height — Height of the cylinder. Default is 1.
+ radiusTop — Radius of the cylinder at the top. Default is `1`.
+ radiusBottom — Radius of the cylinder at the bottom. Default is `1`.
+ height — Height of the cylinder. Default is `1`.
radialSegments — Number of segmented faces around the circumference of the - cylinder. Default is 32
+ cylinder. Default is `32`
heightSegments — Number of rows of faces along the height of the cylinder. - Default is 1.
+ Default is `1`.
openEnded — A Boolean indicating whether the ends of the cylinder are open or capped. Default is false, meaning capped.
thetaStart — Start angle for first segment, default = 0 (three o'clock position).
thetaLength — The central angle, often called theta, of the circular - sector. The default is 2*Pi, which makes for a complete cylinder. + sector. The default is `2`*Pi, which makes for a complete cylinder.

Properties

diff --git a/docs/api/en/geometries/DodecahedronGeometry.html b/docs/api/en/geometries/DodecahedronGeometry.html index 58caebf9d07342..28f2b687cd19d5 100644 --- a/docs/api/en/geometries/DodecahedronGeometry.html +++ b/docs/api/en/geometries/DodecahedronGeometry.html @@ -38,8 +38,8 @@

Constructor

[name]([param:Float radius], [param:Integer detail])

- radius — Radius of the dodecahedron. Default is 1.
- detail — Default is 0. Setting this to a value greater than 0 adds + radius — Radius of the dodecahedron. Default is `1`.
+ detail — Default is `0`. Setting this to a value greater than `0` adds vertices making it no longer a dodecahedron.

diff --git a/docs/api/en/geometries/ExtrudeGeometry.html b/docs/api/en/geometries/ExtrudeGeometry.html index ec228f0149e79e..867e3018d4b196 100644 --- a/docs/api/en/geometries/ExtrudeGeometry.html +++ b/docs/api/en/geometries/ExtrudeGeometry.html @@ -72,19 +72,19 @@

[name]([param:Array shapes], [param:Object options])

  • - curveSegments — int. Number of points on the curves. Default is 12. + curveSegments — int. Number of points on the curves. Default is `12`.
  • steps — int. Number of points used for subdividing segments along the - depth of the extruded spline. Default is 1. + depth of the extruded spline. Default is `1`.
  • -
  • depth — float. Depth to extrude the shape. Default is 1.
  • +
  • depth — float. Depth to extrude the shape. Default is `1`.
  • bevelEnabled — bool. Apply beveling to the shape. Default is true.
  • bevelThickness — float. How deep into the original shape the bevel goes. - Default is 0.2. + Default is `0.2`.
  • bevelSize — float. Distance from the shape outline that the bevel @@ -92,9 +92,9 @@

    [name]([param:Array shapes], [param:Object options])

  • bevelOffset — float. Distance from the shape outline that the bevel - starts. Default is 0. + starts. Default is `0`.
  • -
  • bevelSegments — int. Number of bevel layers. Default is 3.
  • +
  • bevelSegments — int. Number of bevel layers. Default is `3`.
  • extrudePath — THREE.Curve. A 3D spline path along which the shape should be extruded. Bevels not supported for path extrusion. diff --git a/docs/api/en/geometries/IcosahedronGeometry.html b/docs/api/en/geometries/IcosahedronGeometry.html index d5be5440e54103..fe5ade45fa264a 100644 --- a/docs/api/en/geometries/IcosahedronGeometry.html +++ b/docs/api/en/geometries/IcosahedronGeometry.html @@ -37,8 +37,8 @@

    Constructor

    [name]([param:Float radius], [param:Integer detail])

    - radius — Default is 1.
    - detail — Default is 0. Setting this to a value greater than 0 adds more + radius — Default is `1`.
    + detail — Default is `0`. Setting this to a value greater than `0` adds more vertices making it no longer an icosahedron. When detail is greater than 1, it's effectively a sphere.

    diff --git a/docs/api/en/geometries/LatheGeometry.html b/docs/api/en/geometries/LatheGeometry.html index 088c0f16b3ab82..e177e55d615b79 100644 --- a/docs/api/en/geometries/LatheGeometry.html +++ b/docs/api/en/geometries/LatheGeometry.html @@ -61,7 +61,7 @@

    creates a simple diamond shape.
    segments — the number of circumference segments to generate. Default is 12.
    - phiStart — the starting angle in radians. Default is 0.
    + phiStart — the starting angle in radians. Default is `0`.
    phiLength — the radian (0 to 2PI) range of the lathed section 2PI is a closed lathe, less than 2PI is a portion. Default is 2PI.

    diff --git a/docs/api/en/geometries/OctahedronGeometry.html b/docs/api/en/geometries/OctahedronGeometry.html index 4db513f8abc642..b72649a29ce8b4 100644 --- a/docs/api/en/geometries/OctahedronGeometry.html +++ b/docs/api/en/geometries/OctahedronGeometry.html @@ -36,8 +36,8 @@

    Constructor

    [name]([param:Float radius], [param:Integer detail])

    - radius — Radius of the octahedron. Default is 1.
    - detail — Default is 0. Setting this to a value greater than zero add + radius — Radius of the octahedron. Default is `1`.
    + detail — Default is `0`. Setting this to a value greater than zero add vertices making it no longer an octahedron.

    diff --git a/docs/api/en/geometries/PlaneGeometry.html b/docs/api/en/geometries/PlaneGeometry.html index acb046c6f7e1ae..b68be0f3bc62ee 100644 --- a/docs/api/en/geometries/PlaneGeometry.html +++ b/docs/api/en/geometries/PlaneGeometry.html @@ -45,14 +45,13 @@

    Code Example

    Constructor

    - [name]([param:Float width], [param:Float height], [param:Integer - widthSegments], [param:Integer heightSegments]) + [name]([param:Float width], [param:Float height], [param:Integer widthSegments], [param:Integer heightSegments])

    - width — Width along the X axis. Default is 1.
    - height — Height along the Y axis. Default is 1.
    - widthSegments — Optional. Default is 1.
    - heightSegments — Optional. Default is 1. + width — Width along the X axis. Default is `1`.
    + height — Height along the Y axis. Default is `1`.
    + widthSegments — Optional. Default is `1`.
    + heightSegments — Optional. Default is `1`.

    Properties

    diff --git a/docs/api/en/geometries/RingGeometry.html b/docs/api/en/geometries/RingGeometry.html index e3bd23a1f49e98..c6c14a84336741 100644 --- a/docs/api/en/geometries/RingGeometry.html +++ b/docs/api/en/geometries/RingGeometry.html @@ -45,12 +45,12 @@

    [param:Integer thetaSegments], [param:Integer phiSegments], [param:Float thetaStart], [param:Float thetaLength])

    - innerRadius — Default is 0.5.
    - outerRadius — Default is 1.
    + innerRadius — Default is `0.5`.
    + outerRadius — Default is `1`.
    thetaSegments — Number of segments. A higher number means the ring will be - more round. Minimum is 3. Default is 32.
    - phiSegments — Minimum is 1. Default is 1.
    - thetaStart — Starting angle. Default is 0.
    + more round. Minimum is `3`. Default is `32`.
    + phiSegments — Minimum is `1`. Default is `1`.
    + thetaStart — Starting angle. Default is `0`.
    thetaLength — Central angle. Default is Math.PI * 2.

    diff --git a/docs/api/en/geometries/SphereGeometry.html b/docs/api/en/geometries/SphereGeometry.html index 91b904d89d7b87..f5ad3a18e22471 100644 --- a/docs/api/en/geometries/SphereGeometry.html +++ b/docs/api/en/geometries/SphereGeometry.html @@ -49,15 +49,15 @@

    - radius — sphere radius. Default is 1.
    - widthSegments — number of horizontal segments. Minimum value is 3, and the - default is 32.
    - heightSegments — number of vertical segments. Minimum value is 2, and the - default is 16.
    - phiStart — specify horizontal starting angle. Default is 0.
    + radius — sphere radius. Default is `1`.
    + widthSegments — number of horizontal segments. Minimum value is `3`, and the + default is `32`.
    + heightSegments — number of vertical segments. Minimum value is `2`, and the + default is `16`.
    + phiStart — specify horizontal starting angle. Default is `0`.
    phiLength — specify horizontal sweep angle size. Default is Math.PI * 2.
    - thetaStart — specify vertical starting angle. Default is 0.
    + thetaStart — specify vertical starting angle. Default is `0`.
    thetaLength — specify vertical sweep angle size. Default is Math.PI.

    diff --git a/docs/api/en/geometries/TetrahedronGeometry.html b/docs/api/en/geometries/TetrahedronGeometry.html index ccbd9f09ebc5d2..b3384b81f3de8f 100644 --- a/docs/api/en/geometries/TetrahedronGeometry.html +++ b/docs/api/en/geometries/TetrahedronGeometry.html @@ -37,8 +37,8 @@

    Constructor

    [name]([param:Float radius], [param:Integer detail])

    - radius — Radius of the tetrahedron. Default is 1.
    - detail — Default is 0. Setting this to a value greater than 0 adds + radius — Radius of the tetrahedron. Default is `1`.
    + detail — Default is `0`. Setting this to a value greater than `0` adds vertices making it no longer a tetrahedron.

    diff --git a/docs/api/en/geometries/TorusGeometry.html b/docs/api/en/geometries/TorusGeometry.html index 709f39520bded9..7121d63b5d0819 100644 --- a/docs/api/en/geometries/TorusGeometry.html +++ b/docs/api/en/geometries/TorusGeometry.html @@ -48,10 +48,10 @@

    radius - Radius of the torus, from the center of the torus to the center - of the tube. Default is 1.
    - tube — Radius of the tube. Default is 0.4.
    - radialSegments — Default is 12
    - tubularSegments — Default is 48.
    + of the tube. Default is `1`.
    + tube — Radius of the tube. Default is `0.4`.
    + radialSegments — Default is `12`
    + tubularSegments — Default is `48`.
    arc — Central angle. Default is Math.PI * 2.

    diff --git a/docs/api/en/geometries/TorusKnotGeometry.html b/docs/api/en/geometries/TorusKnotGeometry.html index 48f342ce407d68..a4bee441e62e18 100644 --- a/docs/api/en/geometries/TorusKnotGeometry.html +++ b/docs/api/en/geometries/TorusKnotGeometry.html @@ -52,17 +52,17 @@

    [param:Integer q])

      -
    • radius - Radius of the torus. Default is 1.
    • -
    • tube — Radius of the tube. Default is 0.4.
    • -
    • tubularSegments — Default is 64.
    • -
    • radialSegments — Default is 8.
    • +
    • radius - Radius of the torus. Default is `1`.
    • +
    • tube — Radius of the tube. Default is `0.4`.
    • +
    • tubularSegments — Default is `64`.
    • +
    • radialSegments — Default is `8`.
    • p — This value determines, how many times the geometry winds around its - axis of rotational symmetry. Default is 2. + axis of rotational symmetry. Default is `2`.
    • q — This value determines, how many times the geometry winds around a - circle in the interior of the torus. Default is 3. + circle in the interior of the torus. Default is `3`.
    diff --git a/docs/api/en/helpers/ArrowHelper.html b/docs/api/en/helpers/ArrowHelper.html index da0baf740e4d3a..42d3acb1b21a06 100644 --- a/docs/api/en/helpers/ArrowHelper.html +++ b/docs/api/en/helpers/ArrowHelper.html @@ -46,9 +46,9 @@

    [page:Number hex] -- hexadecimal value to define color. Default is 0xffff00.
    [page:Number headLength] -- The length of the head of the arrow. Default - is 0.2 * length.
    + is `0.2` * length.
    [page:Number headWidth] -- The width of the head of the arrow. Default is - 0.2 * headLength.
    + `0.2` * headLength.

    Properties

    diff --git a/docs/api/en/helpers/GridHelper.html b/docs/api/en/helpers/GridHelper.html index 956101ebb1beeb..2f0af274a267dc 100644 --- a/docs/api/en/helpers/GridHelper.html +++ b/docs/api/en/helpers/GridHelper.html @@ -36,8 +36,8 @@

    [name]( [param:number size], [param:Number divisions], [param:Color colorCenterLine], [param:Color colorGrid] )

    - size -- The size of the grid. Default is 10.
    - divisions -- The number of divisions across the grid. Default is 10. + size -- The size of the grid. Default is `10`.
    + divisions -- The number of divisions across the grid. Default is `10`.
    colorCenterLine -- The color of the centerline. This can be a [page:Color], a hexadecimal value and an CSS-Color name. Default is diff --git a/docs/api/en/helpers/PolarGridHelper.html b/docs/api/en/helpers/PolarGridHelper.html index e365305bd03167..d60f730ac937d9 100644 --- a/docs/api/en/helpers/PolarGridHelper.html +++ b/docs/api/en/helpers/PolarGridHelper.html @@ -39,13 +39,13 @@

    radius -- The radius of the polar grid. This can be any positive number. - Default is 10.
    + Default is `10`.
    sectors -- The number of sectors the grid will be divided into. This can - be any positive integer. Default is 16.
    + be any positive integer. Default is `16`.
    rings -- The number of rings. This can be any positive integer. Default is 8.
    divisions -- The number of line segments used for each circle. This can be - any positive integer that is 3 or greater. Default is 64.
    + any positive integer that is 3 or greater. Default is `64`.
    color1 -- The first color used for grid elements. This can be a [page:Color], a hexadecimal value and an CSS-Color name. Default is 0x444444
    diff --git a/docs/api/en/lights/AmbientLight.html b/docs/api/en/lights/AmbientLight.html index 70f903368ea92c..2b91e253cbb976 100644 --- a/docs/api/en/lights/AmbientLight.html +++ b/docs/api/en/lights/AmbientLight.html @@ -31,7 +31,7 @@

    [name]( [param:Integer color], [param:Float intensity] )

    [page:Integer color] - (optional) Numeric value of the RGB component of the color. Default is 0xffffff.
    [page:Float intensity] - (optional) Numeric value of the light's - strength/intensity. Default is 1.

    + strength/intensity. Default is `1`.

    Creates a new [name].

    diff --git a/docs/api/en/lights/AmbientLightProbe.html b/docs/api/en/lights/AmbientLightProbe.html index a36432eb4b787c..ceb4a5c2675493 100644 --- a/docs/api/en/lights/AmbientLightProbe.html +++ b/docs/api/en/lights/AmbientLightProbe.html @@ -25,7 +25,7 @@

    [name]( [param:Color color], [param:Float intensity] )

    [page:Color color] - (optional) An instance of Color, string representing a color or a number representing a color.
    [page:Float intensity] - (optional) Numeric value of the light probe's - intensity. Default is 1.

    + intensity. Default is `1`.

    Creates a new [name].

    diff --git a/docs/api/en/lights/DirectionalLight.html b/docs/api/en/lights/DirectionalLight.html index 707db4a3dab060..421e44a84459b7 100644 --- a/docs/api/en/lights/DirectionalLight.html +++ b/docs/api/en/lights/DirectionalLight.html @@ -66,7 +66,7 @@

    [name]( [param:Integer color], [param:Float intensity] )

    [page:Integer color] - (optional) hexadecimal color of the light. Default is 0xffffff (white).
    [page:Float intensity] - (optional) numeric value of the light's - strength/intensity. Default is 1.

    + strength/intensity. Default is `1`.

    Creates a new [name].

    diff --git a/docs/api/en/lights/HemisphereLight.html b/docs/api/en/lights/HemisphereLight.html index 4f1aa4102a4855..f25215a38f68fa 100644 --- a/docs/api/en/lights/HemisphereLight.html +++ b/docs/api/en/lights/HemisphereLight.html @@ -44,7 +44,7 @@

    [page:Integer groundColor] - (optional) hexadecimal color of the ground. Default is 0xffffff.
    [page:Float intensity] - (optional) numeric value of the light's - strength/intensity. Default is 1.

    + strength/intensity. Default is `1`.

    Creates a new [name].

    diff --git a/docs/api/en/lights/HemisphereLightProbe.html b/docs/api/en/lights/HemisphereLightProbe.html index 50eb258fd4bdf7..6d97dbc504effb 100644 --- a/docs/api/en/lights/HemisphereLightProbe.html +++ b/docs/api/en/lights/HemisphereLightProbe.html @@ -29,7 +29,7 @@

    [page:Color groundColor] - (optional) An instance of Color, string representing a color or a number representing a color.
    [page:Float intensity] - (optional) Numeric value of the light probe's - intensity. Default is 1.

    + intensity. Default is `1`.

    Creates a new [name].

    diff --git a/docs/api/en/lights/Light.html b/docs/api/en/lights/Light.html index dec5eca152768e..54c2ab05bf8418 100644 --- a/docs/api/en/lights/Light.html +++ b/docs/api/en/lights/Light.html @@ -23,7 +23,7 @@

    [name]( [param:Integer color], [param:Float intensity] )

    [page:Integer color] - (optional) hexadecimal color of the light. Default is 0xffffff (white).
    [page:Float intensity] - (optional) numeric value of the light's - strength/intensity. Default is 1.

    + strength/intensity. Default is `1`.

    Creates a new [name]. Note that this is not intended to be called directly (use one of derived classes instead).

    @@ -40,8 +40,7 @@

    [property:Color color]

    [property:Float intensity]

    The light's intensity, or strength.
    - When [page:WebGLRenderer.useLegacyLights legacy lighting mode] is disabled, - the units of intensity depend on the type of light.
    + Tthe units of intensity depend on the type of light.
    Default - `1.0`.

    diff --git a/docs/api/en/lights/LightProbe.html b/docs/api/en/lights/LightProbe.html index e04787a4d8980f..35ae41af0bb4cf 100644 --- a/docs/api/en/lights/LightProbe.html +++ b/docs/api/en/lights/LightProbe.html @@ -47,7 +47,7 @@

    [name]( [param:SphericalHarmonics3 sh], [param:Float intensity] )

    [page:SphericalHarmonics3 sh] - (optional) An instance of [page:SphericalHarmonics3].
    [page:Float intensity] - (optional) Numeric value of the light probe's - intensity. Default is 1.

    + intensity. Default is `1`.

    Creates a new [name].

    diff --git a/docs/api/en/lights/PointLight.html b/docs/api/en/lights/PointLight.html index ba4665362708b1..5d5fa6888f4705 100644 --- a/docs/api/en/lights/PointLight.html +++ b/docs/api/en/lights/PointLight.html @@ -46,11 +46,11 @@

    [page:Integer color] - (optional) hexadecimal color of the light. Default is 0xffffff (white).
    [page:Float intensity] - (optional) numeric value of the light's - strength/intensity. Default is 1.
    - [page:Number distance] - Maximum range of the light. Default is 0 (no + strength/intensity. Default is `1`.
    + [page:Number distance] - Maximum range of the light. Default is `0` (no limit).
    [page:Float decay] - The amount the light dims along the distance of the - light. Default is 2.

    + light. Default is `2`.

    Creates a new [name].

    @@ -75,12 +75,6 @@

    [property:Float decay]

    [property:Float distance]

    - `Default mode` — When distance is zero, light does not attenuate. When - distance is non-zero, light will attenuate linearly from maximum intensity - at the light's position down to zero at this distance from the light. -

    -

    - When [page:WebGLRenderer.useLegacyLights legacy lighting mode] is disabled — When distance is zero, light will attenuate according to inverse-square law to infinite distance. When distance is non-zero, light will attenuate according to inverse-square law until near the distance cutoff, where it @@ -91,19 +85,15 @@

    [property:Float distance]

    [property:Float intensity]

    - The light's intensity. Default is `1`.
    - When [page:WebGLRenderer.useLegacyLights legacy lighting mode] is disabled, - intensity is the luminous intensity of the light measured in candela - (cd).

    - + The light's luminous intensity measured in candela (cd). Default is `1`. +

    Changing the intensity will also change the light's power.

    [property:Float power]

    The light's power.
    - When [page:WebGLRenderer.useLegacyLights legacy lighting mode] is disabled, - power is the luminous power of the light measured in lumens (lm). + Power is the luminous power of the light measured in lumens (lm).

    Changing the power will also change the light's intensity. @@ -114,10 +104,10 @@

    [property:PointLightShadow shadow]

    A [page:PointLightShadow] used to calculate shadows for this light.

    The lightShadow's [page:LightShadow.camera camera] is set to a - [page:PerspectiveCamera] with [page:PerspectiveCamera.fov fov] of 90, - [page:PerspectiveCamera.aspect aspect] of 1, [page:PerspectiveCamera.near near] - clipping plane at 0.5 and [page:PerspectiveCamera.far far] clipping - plane at 500. + [page:PerspectiveCamera] with [page:PerspectiveCamera.fov fov] of `90`, + [page:PerspectiveCamera.aspect aspect] of `1`, [page:PerspectiveCamera.near near] + clipping plane at `0.5` and [page:PerspectiveCamera.far far] clipping + plane at `500`.

    Methods

    diff --git a/docs/api/en/lights/RectAreaLight.html b/docs/api/en/lights/RectAreaLight.html index 5c0c0e3b698007..f8d621eeb0709f 100644 --- a/docs/api/en/lights/RectAreaLight.html +++ b/docs/api/en/lights/RectAreaLight.html @@ -58,9 +58,9 @@

    [page:Integer color] - (optional) hexadecimal color of the light. Default is 0xffffff (white).
    [page:Float intensity] - (optional) the light's intensity, or brightness. - Default is 1.
    - [page:Float width] - (optional) width of the light. Default is 10.
    - [page:Float height] - (optional) height of the light. Default is 10.

    + Default is `1`.
    + [page:Float width] - (optional) width of the light. Default is `10`.
    + [page:Float height] - (optional) height of the light. Default is `10`.

    Creates a new [name].

    @@ -73,10 +73,8 @@

    [property:Float height]

    [property:Float intensity]

    - The light's intensity. Default is `1`.
    - When [page:WebGLRenderer.useLegacyLights legacy lighting mode] is disabled, - intensity is the luminance (brightness) of the light measured in nits - (cd/m^2).

    + The light's intensity. It is the luminance (brightness) of the light measured in nits (cd/m^2). + Default is `1`.

    Changing the intensity will also change the light's power.

    @@ -87,8 +85,7 @@

    [property:Boolean isRectAreaLight]

    [property:Float power]

    The light's power.
    - When [page:WebGLRenderer.useLegacyLights legacy lighting mode] is disabled, - power is the luminous power of the light measured in lumens (lm). + Power is the luminous power of the light measured in lumens (lm).

    Changing the power will also change the light's intensity. diff --git a/docs/api/en/lights/SpotLight.html b/docs/api/en/lights/SpotLight.html index 5cfc28e18b3b34..776deedc5263d4 100644 --- a/docs/api/en/lights/SpotLight.html +++ b/docs/api/en/lights/SpotLight.html @@ -52,13 +52,13 @@

    [page:Integer color] - (optional) hexadecimal color of the light. Default is 0xffffff (white).
    [page:Float intensity] - (optional) numeric value of the light's - strength/intensity. Default is 1.
    - [page:Float distance] - Maximum range of the light. Default is 0 (no + strength/intensity. Default is `1`.
    + [page:Float distance] - Maximum range of the light. Default is `0` (no limit).
    [page:Radians angle] - Maximum angle of light dispersion from its direction whose upper bound is Math.PI/2.
    [page:Float penumbra] - Percent of the spotlight cone that is attenuated - due to penumbra. Takes values between zero and 1. Default is zero.
    + due to penumbra. Takes values between zero and `1`. Default is zero.
    [page:Float decay] - The amount the light dims along the distance of the light.

    Creates a new [name]. @@ -90,12 +90,6 @@

    [property:Float decay]

    [property:Float distance]

    - `Default mode` — When distance is zero, light does not attenuate. When - distance is non-zero, light will attenuate linearly from maximum intensity - at the light's position down to zero at this distance from the light. -

    -

    - When [page:WebGLRenderer.useLegacyLights legacy lighting mode] is disabled — When distance is zero, light will attenuate according to inverse-square law to infinite distance. When distance is non-zero, light will attenuate according to inverse-square law until near the distance cutoff, where it @@ -106,10 +100,8 @@

    [property:Float distance]

    [property:Float intensity]

    - The light's intensity. Default is `1`.
    - When [page:WebGLRenderer.useLegacyLights legacy lighting mode] is disabled, - intensity is the luminous intensity of the light measured in candela - (cd).

    + The light's luminous intensity measured in candela (cd). Default is `1`. +

    Changing the intensity will also change the light's power.

    @@ -119,7 +111,7 @@

    [property:Boolean isSpotLight]

    [property:Float penumbra]

    Percent of the spotlight cone that is attenuated due to penumbra. Takes - values between zero and 1. The default is `0.0`. + values between zero and `1`. The default is `0.0`.

    [property:Vector3 position]

    @@ -131,8 +123,7 @@

    [property:Vector3 position]

    [property:Float power]

    The light's power.
    - When [page:WebGLRenderer.useLegacyLights legacy lighting mode] is disabled, - power is the luminous power of the light measured in lumens (lm). + Power is the luminous power of the light measured in lumens (lm).

    Changing the power will also change the light's intensity.

    @@ -143,7 +134,7 @@

    [property:SpotLightShadow shadow]

    [property:Object3D target]

    The Spotlight points from its [page:.position position] to - target.position. The default position of the target is *(0, 0, 0)*.
    + target.position. The default position of the target is `(0, 0, 0)`.
    *Note*: For the target's position to be changed to anything other than the default, it must be added to the [page:Scene scene] using scene.add( light.target ); @@ -166,8 +157,7 @@

    [property:Texture map]

    color is mixed with the RGB value of this texture, with a ratio corresponding to its alpha value. The cookie-like masking effect is reproduced using pixel values (0, 0, 0, 1-cookie_value). *Warning*: - [param:SpotLight map] is disabled if [param:SpotLight castShadow] is - *false*. + [page:.map] is disabled if [page:.castShadow] is *false*.

    Methods

    diff --git a/docs/api/en/lights/shadows/DirectionalLightShadow.html b/docs/api/en/lights/shadows/DirectionalLightShadow.html index 5201c48061a7c8..e72d899f88ae67 100644 --- a/docs/api/en/lights/shadows/DirectionalLightShadow.html +++ b/docs/api/en/lights/shadows/DirectionalLightShadow.html @@ -81,9 +81,9 @@

    [property:Camera camera]

    The default is an [page:OrthographicCamera] with [page:OrthographicCamera.left left] and [page:OrthographicCamera.bottom bottom] set to -5, [page:OrthographicCamera.right right] and - [page:OrthographicCamera.top top] set to 5, the - [page:OrthographicCamera.near near] clipping plane at 0.5 and the - [page:OrthographicCamera.far far] clipping plane at 500. + [page:OrthographicCamera.top top] set to `5`, the + [page:OrthographicCamera.near near] clipping plane at `0.5` and the + [page:OrthographicCamera.far far] clipping plane at `500`.

    [property:Boolean isDirectionalLightShadow]

    diff --git a/docs/api/en/lights/shadows/LightShadow.html b/docs/api/en/lights/shadows/LightShadow.html index e4576a6d66403c..1724e90d049c50 100644 --- a/docs/api/en/lights/shadows/LightShadow.html +++ b/docs/api/en/lights/shadows/LightShadow.html @@ -40,7 +40,7 @@

    [property:Float bias]

    Shadow map bias, how much to add or subtract from the normalized depth when deciding whether a surface is in shadow.
    - The default is 0. Very tiny adjustments here (in the order of 0.0001) may + The default is `0`. Very tiny adjustments here (in the order of `0.0001`) may help reduce artifacts in shadows

    @@ -68,7 +68,7 @@

    [property:Vector2 mapSize]

    Values must be powers of 2, up to the [page:WebGLRenderer.capabilities].maxTextureSize for a given device, although the width and height don't have to be the same (so, for example, - (512, 1024) is valid). The default is *( 512, 512 )*. + (512, 1024) is valid). The default is `( 512, 512 )`.

    [property:Matrix4 matrix]

    @@ -89,7 +89,7 @@

    [property:Boolean needsUpdate]

    [property:Float normalBias]

    Defines how much the position used to query the shadow map is offset along - the object normal. The default is 0. Increasing this value can be used to + the object normal. The default is `0`. Increasing this value can be used to reduce shadow acne especially in large scenes where light shines onto geometry at a shallow angle. The cost is that shadows may appear distorted. diff --git a/docs/api/en/loaders/CubeTextureLoader.html b/docs/api/en/loaders/CubeTextureLoader.html index 5656f0505897ba..e769033a0876f5 100644 --- a/docs/api/en/loaders/CubeTextureLoader.html +++ b/docs/api/en/loaders/CubeTextureLoader.html @@ -12,8 +12,13 @@

    [name]

    - Class for loading a [page:CubeTexture CubeTexture]. This uses the - [page:ImageLoader] internally for loading files. + [name] can be used to load cube maps. The loader returns an instance of [page:CubeTexture] and expects the cube map to + be defined as six separate images representing the sides of a cube. Other cube map definitions like vertical and horizontal cross, + column and row layouts are not supported. +

    +

    + The loaded [page:CubeTexture] is in sRGB color space. Meaning the [page:Texture.colorSpace colorSpace] + property is set to `THREE.SRGBColorSpace` by default.

    Code Example

    diff --git a/docs/api/en/materials/LineBasicMaterial.html b/docs/api/en/materials/LineBasicMaterial.html index afcb3e22638f99..8efaf0b1be3fd4 100644 --- a/docs/api/en/materials/LineBasicMaterial.html +++ b/docs/api/en/materials/LineBasicMaterial.html @@ -36,7 +36,6 @@

    Examples

    [example:webgl_interactive_voxelpainter WebGL / interactive / voxelpainter]
    [example:webgl_lines_colors WebGL / lines / colors]
    [example:webgl_lines_dashed WebGL / lines / dashed]
    - [example:webgl_materials WebGL / materials]
    [example:physics_ammo_rope physics / ammo / rope]

    @@ -70,7 +69,7 @@

    [property:Float linewidth]

    Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most - platforms linewidth will always be 1 regardless of the set value. + platforms linewidth will always be `1` regardless of the set value.

    [property:String linecap]

    diff --git a/docs/api/en/materials/MeshBasicMaterial.html b/docs/api/en/materials/MeshBasicMaterial.html index 998c4dddccee62..045b9a66ad479a 100644 --- a/docs/api/en/materials/MeshBasicMaterial.html +++ b/docs/api/en/materials/MeshBasicMaterial.html @@ -78,7 +78,7 @@

    [property:Texture aoMap]

    [property:Float aoMapIntensity]

    - Intensity of the ambient occlusion effect. Default is 1. Zero is no + Intensity of the ambient occlusion effect. Default is `1`. Zero is no occlusion effect.

    @@ -108,7 +108,7 @@

    [property:Texture lightMap]

    [property:Float lightMapIntensity]

    -

    Intensity of the baked light. Default is 1.

    +

    Intensity of the baked light. Default is `1`.

    [property:Texture map]

    @@ -119,8 +119,8 @@

    [property:Texture map]

    [property:Float reflectivity]

    How much the environment map affects the surface; also see - [page:.combine]. The default value is 1 and the valid range is between 0 - (no reflections) and 1 (full reflections). + [page:.combine]. The default value is `1` and the valid range is between `0` + (no reflections) and `1` (full reflections).

    [property:Float refractionRatio]

    @@ -128,7 +128,7 @@

    [property:Float refractionRatio]

    The index of refraction (IOR) of air (approximately 1) divided by the index of refraction of the material. It is used with environment mapping modes [page:Textures THREE.CubeRefractionMapping] and [page:Textures THREE.EquirectangularRefractionMapping]. - The refraction ratio should not exceed 1. Default is `0.98`. + The refraction ratio should not exceed `1`. Default is `0.98`.

    [property:Texture specularMap]

    @@ -162,11 +162,11 @@

    [property:String wireframeLinejoin]

    [property:Float wireframeLinewidth]

    - Controls wireframe thickness. Default is 1.

    + Controls wireframe thickness. Default is `1`.

    Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] - with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value. + with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be `1` regardless of the set value.

    Methods

    diff --git a/docs/api/en/materials/MeshDepthMaterial.html b/docs/api/en/materials/MeshDepthMaterial.html index ee14331785741a..8ccde4431a2b2d 100644 --- a/docs/api/en/materials/MeshDepthMaterial.html +++ b/docs/api/en/materials/MeshDepthMaterial.html @@ -81,13 +81,13 @@

    [property:Float displacementScale]

    How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement - map set, this value is not applied. Default is 1. + map set, this value is not applied. Default is `1`.

    [property:Float displacementBias]

    The offset of the displacement map's values on the mesh's vertices. - Without a displacement map set, this value is not applied. Default is 0. + Without a displacement map set, this value is not applied. Default is `0`.

    [property:Boolean fog]

    @@ -108,11 +108,11 @@

    [property:Boolean wireframe]

    [property:Float wireframeLinewidth]

    - Controls wireframe thickness. Default is 1.

    + Controls wireframe thickness. Default is `1`.

    Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] - with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value. + with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be `1` regardless of the set value.

    Methods

    diff --git a/docs/api/en/materials/MeshDistanceMaterial.html b/docs/api/en/materials/MeshDistanceMaterial.html index e87333306c500c..538ff4cdd8e882 100644 --- a/docs/api/en/materials/MeshDistanceMaterial.html +++ b/docs/api/en/materials/MeshDistanceMaterial.html @@ -82,13 +82,13 @@

    [property:Float displacementScale]

    How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement - map set, this value is not applied. Default is 1. + map set, this value is not applied. Default is `1`.

    [property:Float displacementBias]

    The offset of the displacement map's values on the mesh's vertices. - Without a displacement map set, this value is not applied. Default is 0. + Without a displacement map set, this value is not applied. Default is `0`.

    [property:Boolean fog]

    diff --git a/docs/api/en/materials/MeshLambertMaterial.html b/docs/api/en/materials/MeshLambertMaterial.html index d26f53a3db61d7..d52c84ccb31668 100644 --- a/docs/api/en/materials/MeshLambertMaterial.html +++ b/docs/api/en/materials/MeshLambertMaterial.html @@ -87,7 +87,7 @@

    [property:Texture aoMap]

    [property:Float aoMapIntensity]

    - Intensity of the ambient occlusion effect. Default is 1. Zero is no + Intensity of the ambient occlusion effect. Default is `1`. Zero is no occlusion effect.

    @@ -133,13 +133,13 @@

    [property:Float displacementScale]

    How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement - map set, this value is not applied. Default is 1. + map set, this value is not applied. Default is `1`.

    [property:Float displacementBias]

    The offset of the displacement map's values on the mesh's vertices. - Without a displacement map set, this value is not applied. Default is 0. + Without a displacement map set, this value is not applied. Default is `0`.

    [property:Color emissive]

    @@ -180,7 +180,7 @@

    [property:Texture lightMap]

    [property:Float lightMapIntensity]

    -

    Intensity of the baked light. Default is 1.

    +

    Intensity of the baked light. Default is `1`.

    [property:Texture map]

    @@ -225,7 +225,7 @@

    [property:Float refractionRatio]

    index of refraction of the material. It is used with environment mapping modes [page:Textures THREE.CubeRefractionMapping] and [page:Textures THREE.EquirectangularRefractionMapping]. The refraction ratio should not - exceed 1. Default is `0.98`. + exceed `1`. Default is `0.98`.

    [property:Texture specularMap]

    @@ -259,12 +259,12 @@

    [property:String wireframeLinejoin]

    [property:Float wireframeLinewidth]

    - Controls wireframe thickness. Default is 1.

    + Controls wireframe thickness. Default is `1`.

    Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most - platforms linewidth will always be 1 regardless of the set value. + platforms linewidth will always be `1` regardless of the set value.

    Methods

    diff --git a/docs/api/en/materials/MeshMatcapMaterial.html b/docs/api/en/materials/MeshMatcapMaterial.html index d0b0e64e4cd4d2..d1f61f0702a936 100644 --- a/docs/api/en/materials/MeshMatcapMaterial.html +++ b/docs/api/en/materials/MeshMatcapMaterial.html @@ -83,7 +83,7 @@

    [property:Texture bumpMap]

    [property:Float bumpScale]

    How much the bump map affects the material. Typical ranges are 0-1. - Default is 1. + Default is `1`.

    [property:Color color]

    @@ -103,13 +103,13 @@

    [property:Float displacementScale]

    How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement - map set, this value is not applied. Default is 1. + map set, this value is not applied. Default is `1`.

    [property:Float displacementBias]

    The offset of the displacement map's values on the mesh's vertices. - Without a displacement map set, this value is not applied. Default is 0. + Without a displacement map set, this value is not applied. Default is `0`.

    [property:Boolean flatShading]

    diff --git a/docs/api/en/materials/MeshNormalMaterial.html b/docs/api/en/materials/MeshNormalMaterial.html index 71120a6ba7c333..0be71865a70b70 100644 --- a/docs/api/en/materials/MeshNormalMaterial.html +++ b/docs/api/en/materials/MeshNormalMaterial.html @@ -58,7 +58,7 @@

    [property:Texture bumpMap]

    [property:Float bumpScale]

    How much the bump map affects the material. Typical ranges are 0-1. - Default is 1. + Default is `1`.

    [property:Texture displacementMap]

    @@ -75,13 +75,13 @@

    [property:Float displacementScale]

    How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement - map set, this value is not applied. Default is 1. + map set, this value is not applied. Default is `1`.

    [property:Float displacementBias]

    The offset of the displacement map's values on the mesh's vertices. - Without a displacement map set, this value is not applied. Default is 0. + Without a displacement map set, this value is not applied. Default is `0`.

    [property:Boolean flatShading]

    @@ -125,12 +125,12 @@

    [property:Boolean wireframe]

    [property:Float wireframeLinewidth]

    - Controls wireframe thickness. Default is 1.

    + Controls wireframe thickness. Default is `1`.

    Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most - platforms linewidth will always be 1 regardless of the set value. + platforms linewidth will always be `1` regardless of the set value.

    Methods

    diff --git a/docs/api/en/materials/MeshPhongMaterial.html b/docs/api/en/materials/MeshPhongMaterial.html index bf280617ababb1..fd52e2cae0ce4f 100644 --- a/docs/api/en/materials/MeshPhongMaterial.html +++ b/docs/api/en/materials/MeshPhongMaterial.html @@ -85,7 +85,7 @@

    [property:Texture aoMap]

    [property:Float aoMapIntensity]

    - Intensity of the ambient occlusion effect. Default is 1. Zero is no + Intensity of the ambient occlusion effect. Default is `1`. Zero is no occlusion effect.

    @@ -100,7 +100,7 @@

    [property:Texture bumpMap]

    [property:Float bumpScale]

    How much the bump map affects the material. Typical ranges are 0-1. - Default is 1. + Default is `1`.

    [property:Color color]

    @@ -131,13 +131,13 @@

    [property:Float displacementScale]

    How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement - map set, this value is not applied. Default is 1. + map set, this value is not applied. Default is `1`.

    [property:Float displacementBias]

    The offset of the displacement map's values on the mesh's vertices. - Without a displacement map set, this value is not applied. Default is 0. + Without a displacement map set, this value is not applied. Default is `0`.

    [property:Color emissive]

    @@ -178,7 +178,7 @@

    [property:Texture lightMap]

    [property:Float lightMapIntensity]

    -

    Intensity of the baked light. Default is 1.

    +

    Intensity of the baked light. Default is `1`.

    [property:Texture map]

    @@ -215,8 +215,8 @@

    [property:Vector2 normalScale]

    [property:Float reflectivity]

    How much the environment map affects the surface; also see - [page:.combine]. The default value is 1 and the valid range is between 0 - (no reflections) and 1 (full reflections). + [page:.combine]. The default value is `1` and the valid range is between `0` + (no reflections) and `1` (full reflections).

    [property:Float refractionRatio]

    @@ -224,7 +224,7 @@

    [property:Float refractionRatio]

    The index of refraction (IOR) of air (approximately 1) divided by the index of refraction of the material. It is used with environment mapping modes [page:Textures THREE.CubeRefractionMapping] and [page:Textures THREE.EquirectangularRefractionMapping]. - The refraction ratio should not exceed 1. Default is `0.98`. + The refraction ratio should not exceed `1`. Default is `0.98`.

    [property:Float shininess]

    @@ -276,12 +276,12 @@

    [property:String wireframeLinejoin]

    [property:Float wireframeLinewidth]

    - Controls wireframe thickness. Default is 1.

    + Controls wireframe thickness. Default is `1`.

    Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most - platforms linewidth will always be 1 regardless of the set value. + platforms linewidth will always be `1` regardless of the set value.

    Methods

    diff --git a/docs/api/en/materials/MeshPhysicalMaterial.html b/docs/api/en/materials/MeshPhysicalMaterial.html index 9f4f1d7483cdca..d6b2529f55977f 100644 --- a/docs/api/en/materials/MeshPhysicalMaterial.html +++ b/docs/api/en/materials/MeshPhysicalMaterial.html @@ -160,7 +160,7 @@

    [property:Object defines]

    [property:Float ior]

    Index-of-refraction for non-metallic materials, from `1.0` to `2.333`. - Default is `1.5`.
    + Default is `1.5`.

    [property:Float reflectivity]

    @@ -172,6 +172,45 @@

    [property:Float reflectivity]

    when [page:MeshStandardMaterial.metalness metalness] is `1.0`

    +

    [property:Float iridescence]

    +

    + The intensity of the [link:https://en.wikipedia.org/wiki/Iridescence iridescence] layer, simulating RGB color shift based on the angle between the surface and the viewer, from `0.0` to `1.0`. Default is `0.0`. +

    + +

    [property:Texture iridescenceMap]

    +

    + The red channel of this texture is multiplied against + [page:.iridescence], for per-pixel control over iridescence. + Default is `null`. +

    + +

    [property:Float iridescenceIOR]

    +

    + Strength of the iridescence RGB color shift effect, represented by an index-of-refraction. Between `1.0` to `2.333`. + Default is `1.3`. +

    + +

    [property:Array iridescenceThicknessRange]

    +

    + Array of exactly 2 elements, specifying minimum and maximum thickness of the iridescence layer. + Thickness of iridescence layer has an equivalent effect of the one [page:.thickness] has on [page:.ior]. + Default is `[100, 400]`.
    + + If [page:.iridescenceThicknessMap] is not defined, iridescence thickness will use only the second element of the given array. +

    + +

    [property:Texture iridescenceThicknessMap]

    +

    + A texture that defines the thickness of the iridescence layer, stored in the green channel. + Minimum and maximum values of thickness are defined by [page:.iridescenceThicknessRange] array:
    +

      +
    • `0.0` in the green channel will result in thickness equal to first element of the array.
    • +
    • `1.0` in the green channel will result in thickness equal to second element of the array.
    • +
    • Values in-between will linearly interpolate between the elements of the array.
    • +
    + Default is `null`. +

    +

    [property:Float sheen]

    The intensity of the sheen layer, from `0.0` to `1.0`. Default is `0.0`. @@ -201,7 +240,7 @@

    [property:Float specularIntensity]

    A float that scales the amount of specular reflection for non-metals only. When set to zero, the model is effectively Lambertian. From `0.0` to - `1.0`. Default is `0.0`. + `1.0`. Default is `1.0`.

    [property:Texture specularIntensityMap]

    @@ -227,13 +266,13 @@

    [property:Texture specularColorMap]

    [property:Float thickness]

    The thickness of the volume beneath the surface. The value is given in the - coordinate space of the mesh. If the value is 0 the material is + coordinate space of the mesh. If the value is `0` the material is thin-walled. Otherwise the material is a volume boundary. Default is `0`.

    [property:Texture thicknessMap]

    - A texture that defines the thickness, stored in the G channel. This will + A texture that defines the thickness, stored in the green channel. This will be multiplied by [page:.thickness]. Default is `null`.

    diff --git a/docs/api/en/materials/MeshStandardMaterial.html b/docs/api/en/materials/MeshStandardMaterial.html index 5e854c19d95565..803a884f9c791c 100644 --- a/docs/api/en/materials/MeshStandardMaterial.html +++ b/docs/api/en/materials/MeshStandardMaterial.html @@ -114,7 +114,7 @@

    [property:Texture aoMap]

    [property:Float aoMapIntensity]

    - Intensity of the ambient occlusion effect. Default is 1. Zero is no + Intensity of the ambient occlusion effect. Default is `1`. Zero is no occlusion effect.

    @@ -129,7 +129,7 @@

    [property:Texture bumpMap]

    [property:Float bumpScale]

    How much the bump map affects the material. Typical ranges are 0-1. - Default is 1. + Default is `1`.

    [property:Color color]

    @@ -157,13 +157,13 @@

    [property:Float displacementScale]

    How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement - map set, this value is not applied. Default is 1. + map set, this value is not applied. Default is `1`.

    [property:Float displacementBias]

    The offset of the displacement map's values on the mesh's vertices. - Without a displacement map set, this value is not applied. Default is 0. + Without a displacement map set, this value is not applied. Default is `0`.

    [property:Color emissive]

    @@ -214,7 +214,7 @@

    [property:Texture lightMap]

    [property:Float lightMapIntensity]

    -

    Intensity of the baked light. Default is 1.

    +

    Intensity of the baked light. Default is `1`.

    [property:Texture map]

    @@ -226,8 +226,8 @@

    [property:Texture map]

    [property:Float metalness]

    How much the material is like a metal. Non-metallic materials such as wood - or stone use 0.0, metallic use 1.0, with nothing (usually) in between. - Default is 0.0. A value between 0.0 and 1.0 could be used for a rusty + or stone use `0.0`, metallic use `1.0`, with nothing (usually) in between. + Default is `0.0`. A value between `0.0` and `1.0` could be used for a rusty metal look. If metalnessMap is also provided, both values are multiplied.

    @@ -263,8 +263,8 @@

    [property:Vector2 normalScale]

    [property:Float roughness]

    - How rough the material appears. 0.0 means a smooth mirror reflection, 1.0 - means fully diffuse. Default is 1.0. If roughnessMap is also provided, + How rough the material appears. `0.0` means a smooth mirror reflection, `1.0` + means fully diffuse. Default is `1.0`. If roughnessMap is also provided, both values are multiplied.

    @@ -302,12 +302,12 @@

    [property:String wireframeLinejoin]

    [property:Float wireframeLinewidth]

    - Controls wireframe thickness. Default is 1.

    + Controls wireframe thickness. Default is `1`.

    Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most - platforms linewidth will always be 1 regardless of the set value. + platforms linewidth will always be `1` regardless of the set value.

    Methods

    diff --git a/docs/api/en/materials/MeshToonMaterial.html b/docs/api/en/materials/MeshToonMaterial.html index f71f494e9e889b..49bb1435c5fafb 100644 --- a/docs/api/en/materials/MeshToonMaterial.html +++ b/docs/api/en/materials/MeshToonMaterial.html @@ -78,7 +78,7 @@

    [property:Texture aoMap]

    [property:Float aoMapIntensity]

    - Intensity of the ambient occlusion effect. Default is 1. Zero is no + Intensity of the ambient occlusion effect. Default is `1`. Zero is no occlusion effect.

    @@ -93,7 +93,7 @@

    [property:Texture bumpMap]

    [property:Float bumpScale]

    How much the bump map affects the material. Typical ranges are 0-1. - Default is 1. + Default is `1`.

    [property:Color color]

    @@ -113,13 +113,13 @@

    [property:Float displacementScale]

    How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement - map set, this value is not applied. Default is 1. + map set, this value is not applied. Default is `1`.

    [property:Float displacementBias]

    The offset of the displacement map's values on the mesh's vertices. - Without a displacement map set, this value is not applied. Default is 0. + Without a displacement map set, this value is not applied. Default is `0`.

    [property:Color emissive]

    @@ -158,7 +158,7 @@

    [property:Texture lightMap]

    [property:Float lightMapIntensity]

    -

    Intensity of the baked light. Default is 1.

    +

    Intensity of the baked light. Default is `1`.

    [property:Texture map]

    @@ -219,12 +219,12 @@

    [property:String wireframeLinejoin]

    [property:Float wireframeLinewidth]

    - Controls wireframe thickness. Default is 1.

    + Controls wireframe thickness. Default is `1`.

    Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most - platforms linewidth will always be 1 regardless of the set value. + platforms linewidth will always be `1` regardless of the set value.

    Methods

    diff --git a/docs/api/en/materials/PointsMaterial.html b/docs/api/en/materials/PointsMaterial.html index 118d5779ccc61d..1be3a4728da3a0 100644 --- a/docs/api/en/materials/PointsMaterial.html +++ b/docs/api/en/materials/PointsMaterial.html @@ -93,7 +93,7 @@

    [property:Texture map]

    [property:Number size]

    - Defines the size of the points in pixels. Default is 1.0.
    + Defines the size of the points in pixels. Default is `1.0`.
    Will be capped if it exceeds the hardware dependent parameter [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getParameter gl.ALIASED_POINT_SIZE_RANGE].

    diff --git a/docs/api/en/materials/ShaderMaterial.html b/docs/api/en/materials/ShaderMaterial.html index 241503e585c03c..b4456e131797f4 100644 --- a/docs/api/en/materials/ShaderMaterial.html +++ b/docs/api/en/materials/ShaderMaterial.html @@ -390,12 +390,12 @@

    [property:Boolean lights]

    [property:Float linewidth]

    - Controls wireframe thickness. Default is 1.

    + Controls wireframe thickness. Default is `1`.

    Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most - platforms linewidth will always be 1 regardless of the set value. + platforms linewidth will always be `1` regardless of the set value.

    [property:Boolean flatShading]

    @@ -451,12 +451,12 @@

    [property:Boolean wireframe]

    [property:Float wireframeLinewidth]

    - Controls wireframe thickness. Default is 1.

    + Controls wireframe thickness. Default is `1`.

    Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most - platforms linewidth will always be 1 regardless of the set value. + platforms linewidth will always be `1` regardless of the set value.

    Methods

    diff --git a/docs/api/en/materials/SpriteMaterial.html b/docs/api/en/materials/SpriteMaterial.html index 7edbc0cc6eea3c..2313aff9e9424f 100644 --- a/docs/api/en/materials/SpriteMaterial.html +++ b/docs/api/en/materials/SpriteMaterial.html @@ -83,7 +83,7 @@

    [property:Texture map]

    [property:Radians rotation]

    -

    The rotation of the sprite in radians. Default is 0.

    +

    The rotation of the sprite in radians. Default is `0`.

    [property:Boolean sizeAttenuation]

    diff --git a/docs/api/en/math/Box2.html b/docs/api/en/math/Box2.html index 0250e3207b3f35..656e79b74446ac 100644 --- a/docs/api/en/math/Box2.html +++ b/docs/api/en/math/Box2.html @@ -86,7 +86,7 @@

    [method:Float distanceToPoint]( [param:Vector2 point] )

    [page:Vector2 point] - [page:Vector2] to measure distance to.

    Returns the distance from any edge of this box to the specified point. If - the [page:Vector2 point] lies inside of this box, the distance will be 0. + the [page:Vector2 point] lies inside of this box, the distance will be `0`.

    [method:Boolean equals]( [param:Box2 box] )

    diff --git a/docs/api/en/math/Box3.html b/docs/api/en/math/Box3.html index 573384e9900d5b..6be37e5bb64918 100644 --- a/docs/api/en/math/Box3.html +++ b/docs/api/en/math/Box3.html @@ -120,7 +120,7 @@

    [method:Float distanceToPoint]( [param:Vector3 point] )

    [page:Vector3 point] - [page:Vector3] to measure distance to.

    Returns the distance from any edge of this box to the specified point. If - the [page:Vector3 point] lies inside of this box, the distance will be 0. + the [page:Vector3 point] lies inside of this box, the distance will be `0`.

    [method:Boolean equals]( [param:Box3 box] )

    diff --git a/docs/api/en/math/Color.html b/docs/api/en/math/Color.html index ab0da689a1ff90..408ced10806d74 100644 --- a/docs/api/en/math/Color.html +++ b/docs/api/en/math/Color.html @@ -91,13 +91,13 @@

    [property:Boolean isColor]

    Read-only flag to check if a given object is of type [name].

    [property:Float r]

    -

    Red channel value between 0 and 1. Default is 1.

    +

    Red channel value between `0` and `1`. Default is `1`.

    [property:Float g]

    -

    Green channel value between 0 and 1. Default is 1.

    +

    Green channel value between `0` and `1`. Default is `1`.

    [property:Float b]

    -

    Blue channel value between 0 and 1. Default is 1.

    +

    Blue channel value between `0` and `1`. Default is `1`.

    Methods

    @@ -217,7 +217,7 @@

    - [method:Color getRGB]( [param:Color target], [param:string colorSpace] = SRGBColorSpace ) + [method:Color getRGB]( [param:Color target], [param:string colorSpace] = LinearSRGBColorSpace )

    [page:Color target] — the result will be copied into this object.

    @@ -324,9 +324,9 @@

    [method:this setHSL]( [param:Float h], [param:Float s], [param:Float l], [param:string colorSpace] = LinearSRGBColorSpace )

    - [page:Float h] — hue value between 0.0 and 1.0
    - [page:Float s] — saturation value between 0.0 and 1.0
    - [page:Float l] — lightness value between 0.0 and 1.0

    + [page:Float h] — hue value between `0.0` and `1.0`
    + [page:Float s] — saturation value between `0.0` and `1.0`
    + [page:Float l] — lightness value between `0.0` and `1.0`

    Sets color from HSL values.

    @@ -335,16 +335,16 @@

    [method:this setRGB]( [param:Float r], [param:Float g], [param:Float b], [param:string colorSpace] = LinearSRGBColorSpace )

    - [page:Float r] — Red channel value between 0.0 and 1.0.
    - [page:Float g] — Green channel value between 0.0 and 1.0.
    - [page:Float b] — Blue channel value between 0.0 and 1.0.

    + [page:Float r] — Red channel value between `0.0` and `1.0`.
    + [page:Float g] — Green channel value between `0.0` and `1.0`.
    + [page:Float b] — Blue channel value between `0.0` and `1.0`.

    Sets this color from RGB values.

    [method:this setScalar]( [param:Float scalar] )

    - [page:Float scalar] — a value between 0.0 and 1.0.

    + [page:Float scalar] — a value between `0.0` and `1.0`.

    Sets all three color components to the value [page:Float scalar].

    diff --git a/docs/api/en/math/Line3.html b/docs/api/en/math/Line3.html index 6b759c14afb287..525ccf3fcfd2ed 100644 --- a/docs/api/en/math/Line3.html +++ b/docs/api/en/math/Line3.html @@ -79,7 +79,7 @@

    Returns a point parameter based on the closest point as projected on the line segment. If [page:Boolean clampToLine] is true, then the returned - value will be between 0 and 1. + value will be between `0` and `1`.

    [method:this copy]( [param:Line3 line] )

    diff --git a/docs/api/en/math/MathUtils.html b/docs/api/en/math/MathUtils.html index b2da9de8d122c8..82969838826fea 100644 --- a/docs/api/en/math/MathUtils.html +++ b/docs/api/en/math/MathUtils.html @@ -108,9 +108,9 @@

    [method:Float pingpong]( [param:Float x], [param:Float length] )

    [page:Float x] — The value to pingpong.
    [page:Float length] — The positive value the function will pingpong to. - Default is 1.

    + Default is `1`.

    - Returns a value that alternates between 0 and [param:Float length]. + Returns a value that alternates between `0` and [param:Float length].

    [method:Integer ceilPowerOfTwo]( [param:Number n] )

    @@ -121,7 +121,7 @@

    [method:Integer ceilPowerOfTwo]( [param:Number n] )

    [method:Integer floorPowerOfTwo]( [param:Number n] )

    - Returns the largest power of 2 that is less than or equal to [page:Number n]. + Returns the largest power of `2` that is less than or equal to [page:Number n].

    [method:Float radToDeg]( [param:Float radians] )

    @@ -153,8 +153,8 @@

    [page:Float x] - The value to evaluate based on its position between min and max.
    - [page:Float min] - Any x value below min will be 0.
    - [page:Float max] - Any x value above max will be 1.

    + [page:Float min] - Any x value below min will be `0`.
    + [page:Float max] - Any x value above max will be `1`.

    Returns a value between 0-1 that represents the percentage that x has moved between min and max, but smoothed or slowed down the closer X is to @@ -169,8 +169,8 @@

    [page:Float x] - The value to evaluate based on its position between min and max.
    - [page:Float min] - Any x value below min will be 0.
    - [page:Float max] - Any x value above max will be 1.

    + [page:Float min] - Any x value below min will be `0`.
    + [page:Float max] - Any x value above max will be `1`.

    Returns a value between 0-1. A [link:https://en.wikipedia.org/wiki/Smoothstep#Variations variation on smoothstep] diff --git a/docs/api/en/math/Matrix3.html b/docs/api/en/math/Matrix3.html index b8a66df2bd1be4..784edaa678c893 100644 --- a/docs/api/en/math/Matrix3.html +++ b/docs/api/en/math/Matrix3.html @@ -50,7 +50,7 @@

    A Note on Row-Major and Column-Major Ordering

    Constructor

    [name]( [param:Number n11], [param:Number n12], [param:Number n13], - [param:Number n21], [param:Number n22], [param:Number n22], + [param:Number n21], [param:Number n22], [param:Number n23], [param:Number n31], [param:Number n32], [param:Number n33] )

    Creates a 3x3 matrix with the given arguments in row-major order. If no arguments are provided, the constructor initializes @@ -107,7 +107,7 @@

    [page:Array array] - the array to read the elements from.
    [page:Integer offset] - (optional) index of first element in the array. - Default is 0.

    + Default is `0`.

    Sets the elements of this matrix based on an array in [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major] format. diff --git a/docs/api/en/math/Plane.html b/docs/api/en/math/Plane.html index 80a097eb4c5e9b..8ee22b711d054e 100644 --- a/docs/api/en/math/Plane.html +++ b/docs/api/en/math/Plane.html @@ -20,7 +20,7 @@

    Constructor

    [name]( [param:Vector3 normal], [param:Float constant] )

    [page:Vector3 normal] - (optional) a unit length [page:Vector3] defining - the normal of the plane. Default is *(1, 0, 0)*.
    + the normal of the plane. Default is `(1, 0, 0)`.
    [page:Float constant] - (optional) the signed distance from the origin to the plane. Default is `0`.

    diff --git a/docs/api/en/math/Quaternion.html b/docs/api/en/math/Quaternion.html index 615f3dcaf88b27..3fc0a4efcd1e75 100644 --- a/docs/api/en/math/Quaternion.html +++ b/docs/api/en/math/Quaternion.html @@ -288,7 +288,7 @@

    [page:Integer srcOffset0] - An offset into the array `src0`.
    [page:Array src1] - The source array of the target quaternion.
    [page:Integer srcOffset1] - An offset into the array `src1`.
    - [page:Float t] - Normalized interpolation factor (between 0 and 1).

    + [page:Float t] - Normalized interpolation factor (between `0` and `1`).

    This SLERP implementation assumes the quaternion data are managed in flat arrays. diff --git a/docs/api/en/math/Sphere.html b/docs/api/en/math/Sphere.html index 05cdc77d203655..91fe283fd723b6 100644 --- a/docs/api/en/math/Sphere.html +++ b/docs/api/en/math/Sphere.html @@ -16,7 +16,7 @@

    [name]( [param:Vector3 center], [param:Float radius] )

    [page:Vector3 center] - center of the sphere. Default is a [page:Vector3] at `(0, 0, 0)`.
    - [page:Float radius] - radius of the sphere. Default is -1.

    + [page:Float radius] - radius of the sphere. Default is `-1`.

    Creates a new [name].

    @@ -91,7 +91,7 @@

    [method:Boolean isEmpty]()

    Checks to see if the sphere is empty (the radius set to a negative number).
    - Spheres with a radius of 0 contain only their center point and are not + Spheres with a radius of `0` contain only their center point and are not considered to be empty.

    diff --git a/docs/api/en/math/SphericalHarmonics3.html b/docs/api/en/math/SphericalHarmonics3.html index ac74838bbe2ae3..cb6de7c39ec7f6 100644 --- a/docs/api/en/math/SphericalHarmonics3.html +++ b/docs/api/en/math/SphericalHarmonics3.html @@ -135,7 +135,7 @@

    [method:this zero]()

    -

    Sets all SH coefficients to 0.

    +

    Sets all SH coefficients to `0`.

    Static Methods

    diff --git a/docs/api/en/math/Vector2.html b/docs/api/en/math/Vector2.html index 3450db8ced24ea..c5b37f313e1c4a 100644 --- a/docs/api/en/math/Vector2.html +++ b/docs/api/en/math/Vector2.html @@ -215,7 +215,7 @@

    [page:Array array] - the source array.
    - [page:Integer offset] - (optional) offset into the array. Default is 0.

    + [page:Integer offset] - (optional) offset into the array. Default is `0`.

    Sets this vector's [page:.x x] value to be `array[ offset ]` and [page:.y y] value to be `array[ offset + 1 ]`. @@ -234,10 +234,10 @@

    [method:Float getComponent]( [param:Integer index] )

    - [page:Integer index] - 0 or 1.

    + [page:Integer index] - `0` or `1`.

    - If index equals 0 returns the [page:.x x] value.
    - If index equals 1 returns the [page:.y y] value. + If index equals `0` returns the [page:.x x] value.
    + If index equals `1` returns the [page:.y y] value.

    [method:Float length]()

    @@ -343,11 +343,11 @@

    [method:this setComponent]( [param:Integer index], [param:Float value] )

    - [page:Integer index] - 0 or 1.
    + [page:Integer index] - `0` or `1`.
    [page:Float value] - [page:Float]

    - If index equals 0 set [page:.x x] to [page:Float value].
    - If index equals 1 set [page:.y y] to [page:Float value] + If index equals `0` set [page:.x x] to [page:Float value].
    + If index equals `1` set [page:.y y] to [page:Float value]

    [method:this setLength]( [param:Float l] )

    @@ -393,8 +393,8 @@

    [method:this random]()

    - Sets each component of this vector to a pseudo-random value between 0 and - 1, excluding 1. + Sets each component of this vector to a pseudo-random value between `0` and + `1`, excluding `1`.

    Source

    diff --git a/docs/api/en/math/Vector3.html b/docs/api/en/math/Vector3.html index 9126f02d58dc2d..d071fe37a1e97f 100644 --- a/docs/api/en/math/Vector3.html +++ b/docs/api/en/math/Vector3.html @@ -260,11 +260,11 @@

    [method:Float getComponent]( [param:Integer index] )

    - [page:Integer index] - 0, 1 or 2.

    + [page:Integer index] - `0`, `1` or `2`.

    - If index equals 0 returns the [page:.x x] value.
    - If index equals 1 returns the [page:.y y] value.
    - If index equals 2 returns the [page:.z z] value. + If index equals `0` returns the [page:.x x] value.
    + If index equals `1` returns the [page:.y y] value.
    + If index equals `2` returns the [page:.z z] value.

    [method:Float length]()

    @@ -404,12 +404,12 @@

    [method:this setComponent]( [param:Integer index], [param:Float value] )

    - [page:Integer index] - 0, 1 or 2.
    + [page:Integer index] - `0`, `1` or `2`.
    [page:Float value] - [page:Float]

    - If index equals 0 set [page:.x x] to [page:Float value].
    - If index equals 1 set [page:.y y] to [page:Float value].
    - If index equals 2 set [page:.z z] to [page:Float value] + If index equals `0` set [page:.x x] to [page:Float value].
    + If index equals `1` set [page:.y y] to [page:Float value].
    + If index equals `2` set [page:.z z] to [page:Float value]

    [method:this setFromColor]( [param:Color color] )

    @@ -538,8 +538,8 @@

    [method:this unproject]( [param:Camera camera] )

    [method:this random]()

    - Sets each component of this vector to a pseudo-random value between 0 and - 1, excluding 1. + Sets each component of this vector to a pseudo-random value between `0` and + `1`, excluding `1`.

    [method:this randomDirection]()

    diff --git a/docs/api/en/math/Vector4.html b/docs/api/en/math/Vector4.html index b49ac98bc99224..f9bfdb33d24a54 100644 --- a/docs/api/en/math/Vector4.html +++ b/docs/api/en/math/Vector4.html @@ -183,7 +183,7 @@

    [page:Array array] - the source array.
    - [page:Integer offset] - (optional) offset into the array. Default is 0.

    + [page:Integer offset] - (optional) offset into the array. Default is `0`.

    Sets this vector's [page:.x x] value to be `array[ offset + 0 ]`, [page:.y y] value to be `array[ offset + 1 ]` [page:.z z] value to be `array[ offset + 2 ]` @@ -203,12 +203,12 @@

    [method:Float getComponent]( [param:Integer index] )

    - [page:Integer index] - 0, 1, 2 or 3.

    + [page:Integer index] - `0`, `1`, `2` or `3`.

    - If index equals 0 returns the [page:.x x] value.
    - If index equals 1 returns the [page:.y y] value.
    - If index equals 2 returns the [page:.z z] value.
    - If index equals 3 returns the [page:.w w] value. + If index equals `0` returns the [page:.x x] value.
    + If index equals `1` returns the [page:.y y] value.
    + If index equals `2` returns the [page:.z z] value.
    + If index equals `3` returns the [page:.w w] value.

    [method:Float length]()

    @@ -325,13 +325,13 @@

    [method:this setComponent]( [param:Integer index], [param:Float value] )

    - [page:Integer index] - 0, 1, 2 or 3.
    + [page:Integer index] - `0`, `1`, `2` or `3`.
    [page:Float value] - [page:Float]

    - If index equals 0 set [page:.x x] to [page:Float value].
    - If index equals 1 set [page:.y y] to [page:Float value].
    - If index equals 2 set [page:.z z] to [page:Float value].
    - If index equals 3 set [page:.w w] to [page:Float value]. + If index equals `0` set [page:.x x] to [page:Float value].
    + If index equals `1` set [page:.y y] to [page:Float value].
    + If index equals `2` set [page:.z z] to [page:Float value].
    + If index equals `3` set [page:.w w] to [page:Float value].

    [method:this setLength]( [param:Float l] )

    @@ -384,8 +384,8 @@

    [method:this random]()

    - Sets each component of this vector to a pseudo-random value between 0 and - 1, excluding 1. + Sets each component of this vector to a pseudo-random value between `0` and + `1`, excluding `1`.

    Source

    diff --git a/docs/api/en/objects/LOD.html b/docs/api/en/objects/LOD.html index 6f20b73dc3bc64..a1104da83618e3 100644 --- a/docs/api/en/objects/LOD.html +++ b/docs/api/en/objects/LOD.html @@ -78,9 +78,9 @@

    [page:Object3D object] - The [page:Object3D] to display at this level.
    [page:Float distance] - The distance at which to display this level of - detail. Default 0.0.
    + detail. Default `0.0`.
    [page:Float hysteresis] - Threshold used to avoid flickering at LOD - boundaries, as a fraction of distance. Default 0.0.

    + boundaries, as a fraction of distance. Default `0.0`.

    Adds a mesh that will display at a certain distance and greater. Typically the further away the distance, the lower the detail on the mesh. diff --git a/docs/api/en/renderers/WebGLRenderTarget.html b/docs/api/en/renderers/WebGLRenderTarget.html index 80f9df342c9db6..43d03fd516b818 100644 --- a/docs/api/en/renderers/WebGLRenderTarget.html +++ b/docs/api/en/renderers/WebGLRenderTarget.html @@ -49,7 +49,7 @@


    [page:Boolean depthBuffer] - default is `true`.
    [page:Boolean stencilBuffer] - default is `false`.
    - [page:Number samples] - default is 0.

    + [page:Number samples] - default is `0`.

    Creates a new [name]

    diff --git a/docs/api/en/renderers/WebGLRenderer.html b/docs/api/en/renderers/WebGLRenderer.html index 60140a3254661c..af0e3db4b01d85 100644 --- a/docs/api/en/renderers/WebGLRenderer.html +++ b/docs/api/en/renderers/WebGLRenderer.html @@ -103,22 +103,6 @@

    [property:Boolean autoClearStencil]

    should clear the stencil buffer. Default is `true`.

    -

    [property:Object debug]

    -

    - - [page:Boolean checkShaderErrors]: If it is true, defines whether - material shader programs are checked for errors during compilation and - linkage process. It may be useful to disable this check in production for - performance gain. It is strongly recommended to keep these checks enabled - during development. If the shader does not compile and link - it will not - work and associated material will not render. Default is `true`.
    - - [page:Function onShaderError]( gl, program, glVertexShader, - glFragmentShader ): A callback function that can be used for custom error - reporting. The callback receives the WebGL context, an instance of - WebGLProgram as well two instances of WebGLShader representing the vertex - and fragment shader. Assigning a custom function disables the default - error reporting. Default is `null`. -

    -

    [property:Object capabilities]

    An object containing details about the capabilities of the current @@ -172,6 +156,22 @@

    [property:Array clippingPlanes]

    the plane is negative are cut away. Default is [].

    +

    [property:Object debug]

    +

    + - [page:Boolean checkShaderErrors]: If it is true, defines whether + material shader programs are checked for errors during compilation and + linkage process. It may be useful to disable this check in production for + performance gain. It is strongly recommended to keep these checks enabled + during development. If the shader does not compile and link - it will not + work and associated material will not render. Default is `true`.
    + - [page:Function onShaderError]( gl, program, glVertexShader, + glFragmentShader ): A callback function that can be used for custom error + reporting. The callback receives the WebGL context, an instance of + WebGLProgram as well two instances of WebGLShader representing the vertex + and fragment shader. Assigning a custom function disables the default + error reporting. Default is `null`. +

    +

    [property:DOMElement domElement]

    A [link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas canvas] @@ -254,9 +254,6 @@

    [property:Boolean localClippingEnabled]

    Default is `false`.

    -

    [property:Boolean useLegacyLights]

    -

    Whether to use the legacy lighting mode or not. Default is `true`.

    -

    [property:Object properties]

    Used internally by the renderer to keep track of various sub object @@ -406,8 +403,8 @@

    [method:undefined forceContextRestore]( )

    [method:Float getClearAlpha]()

    - Returns a [page:Float float] with the current clear alpha. Ranges from 0 - to 1. + Returns a [page:Float float] with the current clear alpha. Ranges from `0` + to `1`.

    [method:Color getClearColor]( [param:Color target] )

    diff --git a/docs/api/en/scenes/Fog.html b/docs/api/en/scenes/Fog.html index 140dac91884963..2294256848c41c 100644 --- a/docs/api/en/scenes/Fog.html +++ b/docs/api/en/scenes/Fog.html @@ -52,7 +52,7 @@

    [property:Float near]

    The minimum distance to start applying fog. Objects that are less than 'near' units from the active camera won't be affected by fog.

    -

    Default is 1.

    +

    Default is `1`.

    [property:Float far]

    @@ -60,7 +60,7 @@

    [property:Float far]

    Objects that are more than 'far' units away from the active camera won't be affected by fog.

    -

    Default is 1000.

    +

    Default is `1000`.

    Methods

    diff --git a/docs/api/en/scenes/FogExp2.html b/docs/api/en/scenes/FogExp2.html index 200adfcb885202..acaf062a1d8b1b 100644 --- a/docs/api/en/scenes/FogExp2.html +++ b/docs/api/en/scenes/FogExp2.html @@ -49,7 +49,7 @@

    [property:Color color]

    [property:Float density]

    Defines how fast the fog will grow dense.

    -

    Default is 0.00025.

    +

    Default is `0.00025`.

    Methods

    diff --git a/docs/api/en/scenes/Scene.html b/docs/api/en/scenes/Scene.html index 81821b91ed3473..41c21f1b479715 100644 --- a/docs/api/en/scenes/Scene.html +++ b/docs/api/en/scenes/Scene.html @@ -39,14 +39,14 @@

    [property:Object background]

    [property:Float backgroundBlurriness]

    Sets the blurriness of the background. Only influences environment maps - assigned to [page:Scene.background]. Valid input is a float between *0* - and *1*. Default is *0*. + assigned to [page:Scene.background]. Valid input is a float between `0` + and `1`. Default is `0`.

    [property:Float backgroundIntensity]

    Attenuates the color of the background. Only applies to background - textures. Default is *1*. + textures. Default is `1`.

    [property:Texture environment]

    diff --git a/docs/api/en/textures/CanvasTexture.html b/docs/api/en/textures/CanvasTexture.html index 9971fbc89cfab5..9c5828d5edf975 100644 --- a/docs/api/en/textures/CanvasTexture.html +++ b/docs/api/en/textures/CanvasTexture.html @@ -57,7 +57,7 @@

    [page:Number anisotropy] -- The number of samples taken along the axis through the pixel that has the highest density of texels. By default, this - value is 1. A higher value gives a less blurry result than a basic mipmap, + value is `1`. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use [page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a diff --git a/docs/api/en/textures/CompressedTexture.html b/docs/api/en/textures/CompressedTexture.html index f343b3df2c6005..c0f11bae493466 100644 --- a/docs/api/en/textures/CompressedTexture.html +++ b/docs/api/en/textures/CompressedTexture.html @@ -64,7 +64,7 @@

    [page:Number anisotropy] -- The number of samples taken along the axis through the pixel that has the highest density of texels. By default, this - value is 1. A higher value gives a less blurry result than a basic mipmap, + value is `1`. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use renderer.getMaxAnisotropy() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
    diff --git a/docs/api/en/textures/Data3DTexture.html b/docs/api/en/textures/Data3DTexture.html index 782c55664f2cf5..3722cce5dead3e 100644 --- a/docs/api/en/textures/Data3DTexture.html +++ b/docs/api/en/textures/Data3DTexture.html @@ -113,7 +113,7 @@

    [property:number minFilter]

    [property:number unpackAlignment]

    - 1 by default. Specifies the alignment requirements for the start of each + `1` by default. Specifies the alignment requirements for the start of each pixel row in memory. The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows start on double-word boundaries). See diff --git a/docs/api/en/textures/DataArrayTexture.html b/docs/api/en/textures/DataArrayTexture.html index c7b3c66861ae2d..aa6e07fb7bdaaa 100644 --- a/docs/api/en/textures/DataArrayTexture.html +++ b/docs/api/en/textures/DataArrayTexture.html @@ -127,7 +127,7 @@

    [property:number minFilter]

    [property:number unpackAlignment]

    - 1 by default. Specifies the alignment requirements for the start of each + `1` by default. Specifies the alignment requirements for the start of each pixel row in memory. The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows start on double-word boundaries). See diff --git a/docs/api/en/textures/DataTexture.html b/docs/api/en/textures/DataTexture.html index 44eaff9d8b21cf..201f849da97d91 100644 --- a/docs/api/en/textures/DataTexture.html +++ b/docs/api/en/textures/DataTexture.html @@ -98,7 +98,7 @@

    [property:Boolean isDataTexture]

    [property:number unpackAlignment]

    - 1 by default. Specifies the alignment requirements for the start of each + `1` by default. Specifies the alignment requirements for the start of each pixel row in memory. The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows start on double-word boundaries). See diff --git a/docs/api/en/textures/DepthTexture.html b/docs/api/en/textures/DepthTexture.html index 24f84ea0746f05..5a92ab2aaafc62 100644 --- a/docs/api/en/textures/DepthTexture.html +++ b/docs/api/en/textures/DepthTexture.html @@ -63,7 +63,7 @@

    [page:Number anisotropy] -- The number of samples taken along the axis through the pixel that has the highest density of texels. By default, this - value is 1. A higher value gives a less blurry result than a basic mipmap, + value is `1`. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use [page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a @@ -122,7 +122,7 @@

    [property:Boolean isDepthTexture]

    [property:number compareFunction]

    This is used to define the comparison function used when comparing texels in the depth texture to the value in the depth buffer. - Default is *null* which means comparison is disabled.

    + Default is `null` which means comparison is disabled.

    See the [page:Textures texture constants] page for details of other functions.

    diff --git a/docs/api/en/textures/Texture.html b/docs/api/en/textures/Texture.html index 748c7bb8d26303..1b0971a6bef6d1 100644 --- a/docs/api/en/textures/Texture.html +++ b/docs/api/en/textures/Texture.html @@ -133,7 +133,7 @@

    [property:number minFilter]

    [property:number anisotropy]

    The number of samples taken along the axis through the pixel that has the - highest density of texels. By default, this value is 1. A higher value + highest density of texels. By default, this value is `1`. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use [page:WebGLRenderer.capabilities renderer.capabilities.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2. diff --git a/docs/api/en/textures/VideoTexture.html b/docs/api/en/textures/VideoTexture.html index 2518e894da1a6b..8655646c6cf53b 100644 --- a/docs/api/en/textures/VideoTexture.html +++ b/docs/api/en/textures/VideoTexture.html @@ -75,7 +75,7 @@

    [page:Number anisotropy] -- The number of samples taken along the axis through the pixel that has the highest density of texels. By default, this - value is 1. A higher value gives a less blurry result than a basic mipmap, + value is `1`. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use [page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a diff --git a/docs/api/fr/core/BufferAttribute.html b/docs/api/fr/core/BufferAttribute.html index 4d889291c81b71..3a4fefc3964363 100644 --- a/docs/api/fr/core/BufferAttribute.html +++ b/docs/api/fr/core/BufferAttribute.html @@ -49,7 +49,7 @@

    [property:TypedArray array]

    [property:Integer count]

    - Stocke la longueur du tableau [page:BufferAttribute.array array] divisée par [page:BufferAttribute.itemSize itemSize].

    + Stocke la longueur du tableau [page:BufferAttribute.array array] divisée par [page:BufferAttribute.itemSize itemSize]. Read-only property.

    Si le tampon stocke un vecteur à 3 composants (tel qu'une position, une normale ou une couleur), cela comptera alors le nombre de ces vecteurs stockés. @@ -146,6 +146,9 @@

    [method:this copyArray]( array )

    [method:this copyAt] ( [param:Integer index1], [param:BufferAttribute bufferAttribute], [param:Integer index2] )

    Copie un vecteur de bufferAttribute[index2] à [page:BufferAttribute.array array][index1].

    +

    [method:Number getComponent]( [param:Integer index], [param:Integer component] )

    +

    Returns the given component of the vector at the given index.

    +

    [method:Number getX]( [param:Integer index] )

    Renvoie le composant x d'un vecteur à l'index donné.

    @@ -185,6 +188,9 @@

    [method:this setUsage] ( [param:Usage value] )

    Remarque : Après la première utilisation d'un tampon, son utilisation ne peut pas être modifiée. Au lieu de cela, instanciez-en un nouveau et définissez l'utilisation souhaitée avant le prochain rendu.

    +

    [method:Number setComponent]( [param:Integer index], [param:Integer component], [param:Float value] )

    +

    Sets the given component of the vector at the given index.

    +

    [method:this setX]( [param:Integer index], [param:Float x] )

    Définit la composante x du vecteur à l'indice donné.

    diff --git a/docs/api/fr/materials/LineBasicMaterial.html b/docs/api/fr/materials/LineBasicMaterial.html index e0ca3f19e7423f..2c4d0aeee3d610 100644 --- a/docs/api/fr/materials/LineBasicMaterial.html +++ b/docs/api/fr/materials/LineBasicMaterial.html @@ -38,7 +38,6 @@

    Exemples

    [example:webgl_interactive_voxelpainter WebGL / interactive / voxelpainter]
    [example:webgl_lines_colors WebGL / lines / colors]
    [example:webgl_lines_dashed WebGL / lines / dashed]
    - [example:webgl_materials WebGL / materials]
    [example:physics_ammo_rope physics / ammo / rope]

    diff --git a/docs/api/fr/materials/MeshDistanceMaterial.html b/docs/api/fr/materials/MeshDistanceMaterial.html index db4a186c3b6e1a..2d7a43fa17e4b6 100644 --- a/docs/api/fr/materials/MeshDistanceMaterial.html +++ b/docs/api/fr/materials/MeshDistanceMaterial.html @@ -15,8 +15,7 @@

    [name]

    [name] est utilisé en interne pour implémenter le shadow mapping avec [page:PointLight]s.

    Peut également être utilisé pour personnaliser la projection d'ombre d'un objet en attribuant une instance de [name] à [page:Object3D.customDistanceMaterial]. - Les exemples suivants illustrent cette approche afin de s'assurer que les parties transparentes des objets ne projettent pas d'ombres.ce of [name] to [page:Object3D.customDistanceMaterial]. - The following examples demonstrates this approach in order to ensure transparent parts of objects do no cast shadows. + Les exemples suivants illustrent cette approche afin de s'assurer que les parties transparentes des objets ne projettent pas d'ombres.

    Exemples

    diff --git a/docs/api/fr/materials/MeshPhysicalMaterial.html b/docs/api/fr/materials/MeshPhysicalMaterial.html index 76cd50f9c13b11..6c53a737bf4e91 100644 --- a/docs/api/fr/materials/MeshPhysicalMaterial.html +++ b/docs/api/fr/materials/MeshPhysicalMaterial.html @@ -172,7 +172,7 @@

    [property:Texture sheenColorMap]

    [property:Float specularIntensity]

    - Un float qui met à l'échelle la quantité de réflexion spéculaire pour les non-métaux uniquement. Lorsqu'il est défini sur zéro, le modèle est effectivement lambertien. De `0.0` à `1.0`. La valeur par défaut est `0.0`. + Un float qui met à l'échelle la quantité de réflexion spéculaire pour les non-métaux uniquement. Lorsqu'il est défini sur zéro, le modèle est effectivement lambertien. De `0.0` à `1.0`. La valeur par défaut est `1.0`.

    [property:Texture specularIntensityMap]

    diff --git a/docs/api/it/core/BufferAttribute.html b/docs/api/it/core/BufferAttribute.html index 67f30fada40bca..35e417b0801f74 100644 --- a/docs/api/it/core/BufferAttribute.html +++ b/docs/api/it/core/BufferAttribute.html @@ -47,7 +47,7 @@

    [property:TypedArray array]

    [property:Integer count]

    - Memorizza la lunghezza dell'[page:BufferAttribute.array array] divisa per [page:BufferAttribute.itemSize itemSize].

    + Memorizza la lunghezza dell'[page:BufferAttribute.array array] divisa per [page:BufferAttribute.itemSize itemSize]. Read-only property.

    Se il buffer memorizza un vettore a 3 componenti (come una posizione, una normale o un colore), questo conterà il numero dei vettori memorizzati. @@ -160,6 +160,9 @@

    [method:this copyArray]( array )

    [method:this copyAt] ( [param:Integer index1], [param:BufferAttribute bufferAttribute], [param:Integer index2] )

    Copia un vettore da bufferAttribute[index2] a [page:BufferAttribute.array array][index1].

    +

    [method:Number getComponent]( [param:Integer index], [param:Integer component] )

    +

    Returns the given component of the vector at the given index.

    +

    [method:Number getX]( [param:Integer index] )

    Restituisce il componente x del vettore in corrispondenza dell'indice specificato.

    @@ -198,6 +201,9 @@

    [method:this setUsage] ( [param:Usage value] )

    Nota: Dopo l'utilizzo iniziale di un buffer, il suo utilizzo non può cambiare. Invece, istanziane uno nuovo e imposta l'utilizzo desiderato prima del rendering successivo.

    + +

    [method:Number setComponent]( [param:Integer index], [param:Integer component], [param:Float value] )

    +

    Sets the given component of the vector at the given index.

    [method:this setX]( [param:Integer index], [param:Float x] )

    Imposta il componente x del vettore in corrispondenza dell'indice specificato.

    diff --git a/docs/api/it/extras/core/ShapePath.html b/docs/api/it/extras/core/ShapePath.html index 79595d06292fea..fa7185d27a207b 100644 --- a/docs/api/it/extras/core/ShapePath.html +++ b/docs/api/it/extras/core/ShapePath.html @@ -11,7 +11,7 @@

    [name]

    Questa classe viene utilizzata per convertire una serie di forme in un array di [page:Path], ad esempio una - forma SVG in un path (vedere l'esempio seguente). + forma SVG in un path.

    Costruttore

    diff --git a/docs/api/it/lights/Light.html b/docs/api/it/lights/Light.html index 1885ffa6d88bb6..35c6ca47ff978c 100644 --- a/docs/api/it/lights/Light.html +++ b/docs/api/it/lights/Light.html @@ -40,7 +40,7 @@

    [property:Color color]

    [property:Float intensity]

    L'intensità o la forza della luce.
    - Quando [page:WebGLRenderer.useLegacyLights legacy lighting mode] è disabilitata, le unità di intensità dipendono dal tipo di luce.
    + Le unità di intensità dipendono dal tipo di luce.
    Il valore predefinito è `1.0`.

    diff --git a/docs/api/it/lights/PointLight.html b/docs/api/it/lights/PointLight.html index e80e14be8b7ee7..9c269e03399197 100644 --- a/docs/api/it/lights/PointLight.html +++ b/docs/api/it/lights/PointLight.html @@ -68,16 +68,10 @@

    [property:Float decay]

    [property:Float distance]

    - `Modalità predefinita` — Quando la distanza è zero, la luce non si attenua. Quando la distanza è diversa da zero, - la luce si attenuerà linearmente dalla massima intensità nella posizione della luce fino a zero a questa distanza - dalla luce. -

    -

    - Quando [page:WebGLRenderer.useLegacyLights legacy lighting mode] è disabilitata — Quando la distanza è - zero, la luce si attenuerà secondo la legge dell'inverso del quadrato alla distanza infinita. - Quando la distanza è diversa da zero, la luce si attenuerà secondo la legge dell'inverso del quadrato - fino in prossimità del limite di distanza, dove si attenuerà quindi rapidamente e senza intoppi fino a 0. - Intrinsecamente, i limiti non sono fisicamente corretti. + Quando la distanza è zero, la luce si attenuerà secondo la legge dell'inverso del quadrato alla distanza infinita. + Quando la distanza è diversa da zero, la luce si attenuerà secondo la legge dell'inverso del quadrato + fino in prossimità del limite di distanza, dove si attenuerà quindi rapidamente e senza intoppi fino a 0. + Intrinsecamente, i limiti non sono fisicamente corretti.

    Il valore predefinito è `0.0`. @@ -86,8 +80,7 @@

    [property:Float distance]

    [property:Float intensity]

    L'intensità della luce. Il valore predefinito è `1`.
    - Quando [page:WebGLRenderer.useLegacyLights legacy lighting mode] è disabilitata, l'intensità - è l'intensità luminosa della luce misurata in candela (cd).

    + L'intensità è l'intensità luminosa della luce misurata in candela (cd).

    Modificando l'intensità si modificherà anche la potenza della luce.

    @@ -95,8 +88,7 @@

    [property:Float intensity]

    [property:Float power]

    La potenza della luce.
    - Quando [page:WebGLRenderer.useLegacyLights legacy lighting mode] è disabilitata, la potenza è la potenza - della luminosità della luce misurata in lumen (lm).

    + La potenza è la potenza della luminosità della luce misurata in lumen (lm).

    Modificando la potenza si modificherà anche l'intensità della luce.

    diff --git a/docs/api/it/lights/RectAreaLight.html b/docs/api/it/lights/RectAreaLight.html index bdbcfcf5232f3f..0f3385a3e06487 100644 --- a/docs/api/it/lights/RectAreaLight.html +++ b/docs/api/it/lights/RectAreaLight.html @@ -70,8 +70,7 @@

    [property:Float height]

    [property:Float intensity]

    L'intensità della luce. Il valore predefinito è `1`.
    - Quando [page:WebGLRenderer.useLegacyLights legacy lighting mode] è disabilitata, l'intesità è la luminanza - (luminosità) della luce misurata in nits (cd/m^2).

    + L'intesità è la luminanza (luminosità) della luce misurata in nits (cd/m^2).

    Modificando l'intensità si modificherà anche la potenza della luce.

    @@ -84,8 +83,7 @@

    [property:Boolean isRectAreaLight]

    [property:Float power]

    La potenza della luce.
    - Quando [page:WebGLRenderer.useLegacyLights legacy lighting mode] è disabilitata, la potenza è la potenza - della luminosità della luce misurata in lumen (lm).

    + La potenza è la potenza della luminosità della luce misurata in lumen (lm).

    Modificando la potenza si modificherà anche l'intensità della luce.

    diff --git a/docs/api/it/lights/SpotLight.html b/docs/api/it/lights/SpotLight.html index 43a7d4b15583e6..9b220c6b8f7ab1 100644 --- a/docs/api/it/lights/SpotLight.html +++ b/docs/api/it/lights/SpotLight.html @@ -88,13 +88,7 @@

    [property:Float decay]

    [property:Float distance]

    - `Modalità predefinita` — Quando la distanza è zero, la luce non si attenua. Quando la distanza è diversa da zero, - la luce si attenuerà linearmente dalla massima intensità nella posizione della luce fino a zero a questa distanza - dalla luce. -

    -

    - Quando [page:WebGLRenderer.useLegacyLights legacy lighting mode] è disabilitata — Quando la distanza è - zero, la luce si attenuerà secondo la legge dell'inverso del quadrato alla distanza infinita. + Quando la distanza è zero, la luce si attenuerà secondo la legge dell'inverso del quadrato alla distanza infinita. Quando la distanza è diversa da zero, la luce si attenuerà secondo la legge dell'inverso del quadrato fino in prossimità del limite di distanza, dove si attenuerà quindi rapidamente e uniformemente fino a `0`. Intrinsecamente, i limiti non sono fisicamente corretti. @@ -106,8 +100,7 @@

    [property:Float distance]

    [property:Float intensity]

    L'intensità della luce. Il valore predefinito è `1`.
    - Quando [page:WebGLRenderer.useLegacyLights legacy lighting mode] è disabilitata, l'intensità - è l'intensità luminosa della luce misurata in candela (cd).

    + L'intensità è l'intensità luminosa della luce misurata in candela (cd).

    Modificando l'intensità si modificherà anche la potenza della luce.

    @@ -132,8 +125,7 @@

    [property:Float power]

    La potenza della luce.
    - Quando [page:WebGLRenderer.useLegacyLights legacy lighting mode] è disabilitata, la potenza è la potenza - della luminosità della luce misurata in lumen (lm).

    + La potenza è la potenza della luminosità della luce misurata in lumen (lm).

    Modificando la potenza si modificherà anche l'intensità della luce.

    @@ -174,7 +166,7 @@

    [property:Texture map]

    Una [page:Texture] utilizzata per modulare il colore della luce. Il colore della luce spot viene mescolato con il valore RGB di questa texture, con un rapporto corrispondente al suo valore alfa. L'effetto di mascheramento simile a quello dei cookie viene riprodotto utilizzando i valori (0, 0, 0, 1-cookie_value). - *Attenzione*: [param:SpotLight map] è disabilitata se [param:SpotLight castShadow] è *false*. + *Attenzione*: [page:.map] è disabilitata se [page:.castShadow] è *false*.

    Metodi

    diff --git a/docs/api/it/loaders/CubeTextureLoader.html b/docs/api/it/loaders/CubeTextureLoader.html index 21cacfd5b94f63..fa269891be6c87 100644 --- a/docs/api/it/loaders/CubeTextureLoader.html +++ b/docs/api/it/loaders/CubeTextureLoader.html @@ -16,6 +16,11 @@

    [name]

    Utilizza internamente l'[page:ImageLoader] per caricare i file.

    +

    + The loaded [page:CubeTexture] is in sRGB color space. Meaning the [page:Texture.colorSpace colorSpace] + property is set to `THREE.SRGBColorSpace` by default. +

    +

    Codice di Esempio

    diff --git a/docs/api/it/materials/LineBasicMaterial.html b/docs/api/it/materials/LineBasicMaterial.html index cdc4eb5dcd61d0..4ad5cb54d8a6d3 100644 --- a/docs/api/it/materials/LineBasicMaterial.html +++ b/docs/api/it/materials/LineBasicMaterial.html @@ -38,7 +38,6 @@

    Esempi

    [example:webgl_interactive_voxelpainter WebGL / interactive / voxelpainter]
    [example:webgl_lines_colors WebGL / lines / colors]
    [example:webgl_lines_dashed WebGL / lines / dashed]
    - [example:webgl_materials WebGL / materials]
    [example:physics_ammo_rope physics / ammo / rope]

    diff --git a/docs/api/it/materials/MeshPhysicalMaterial.html b/docs/api/it/materials/MeshPhysicalMaterial.html index cbce5a11831710..3234d46871b9d7 100644 --- a/docs/api/it/materials/MeshPhysicalMaterial.html +++ b/docs/api/it/materials/MeshPhysicalMaterial.html @@ -178,7 +178,7 @@

    [property:Texture sheenColorMap]

    [property:Float specularIntensity]

    Un float che ridimensiona la quantità di riflessione speculare solo per i non metalli. Quando è impostato su zero, il modello - è effettivamente Lambertiano. Da `0.0` a `1.0`. Il valore predefinito è `0.0`. + è effettivamente Lambertiano. Da `0.0` a `1.0`. Il valore predefinito è `1.0`.

    [property:Texture specularIntensityMap]

    diff --git a/docs/api/it/math/Color.html b/docs/api/it/math/Color.html index 8460c5d8679e61..c4879fb67ead94 100644 --- a/docs/api/it/math/Color.html +++ b/docs/api/it/math/Color.html @@ -181,7 +181,7 @@

    [method:Object getHSL]( [param:Object target], [param:string colorSpace] = L

    -

    [method:Color getRGB]( [param:Color target], [param:string colorSpace] = SRGBColorSpace )

    +

    [method:Color getRGB]( [param:Color target], [param:string colorSpace] = LinearSRGBColorSpace )

    [page:Color target] - questo risultato sarà copiato in questo oggetto.

    diff --git a/docs/api/it/math/Matrix3.html b/docs/api/it/math/Matrix3.html index 1733b712971e65..919a2d12ba9968 100644 --- a/docs/api/it/math/Matrix3.html +++ b/docs/api/it/math/Matrix3.html @@ -47,7 +47,7 @@

    Costruttore

    [name]( [param:Number n11], [param:Number n12], [param:Number n13], - [param:Number n21], [param:Number n22], [param:Number n22], + [param:Number n21], [param:Number n22], [param:Number n23], [param:Number n31], [param:Number n32], [param:Number n33] )

    Creates a 3x3 matrix with the given arguments in row-major. If no arguments are provided, the constructor initializes diff --git a/docs/api/it/renderers/WebGLRenderer.html b/docs/api/it/renderers/WebGLRenderer.html index ccf8d7c1f1101a..d58dcb979d5e4a 100644 --- a/docs/api/it/renderers/WebGLRenderer.html +++ b/docs/api/it/renderers/WebGLRenderer.html @@ -223,11 +223,6 @@

    [property:Object info]

    [property:Boolean localClippingEnabled]

    Definisce se il render rispetta i piani di taglio a livello di oggetto. Il valore predefinito è `false`.

    -

    [property:Boolean useLegacyLights]

    -

    - Whether to use the legacy lighting mode or not. Il valore predefinito è `true`. -

    -

    [property:Object properties]

    Utilizzato internamente dal renderer per mantenere traccia delle proprietà dei vari oggetti secondari. diff --git a/docs/api/ko/core/BufferAttribute.html b/docs/api/ko/core/BufferAttribute.html index e3843d427bdb7b..5847f4a57f6ad0 100644 --- a/docs/api/ko/core/BufferAttribute.html +++ b/docs/api/ko/core/BufferAttribute.html @@ -53,7 +53,7 @@

    [property:TypedArray array]

    [property:Integer count]

    - [page:BufferAttribute.itemSize itemSize]로 나눈 [page:BufferAttribute.array array]의 길이를 저장.

    + [page:BufferAttribute.itemSize itemSize]로 나눈 [page:BufferAttribute.array array]의 길이를 저장. Read-only property.

    버퍼가 3개의 컴포넌트를 저장한 벡터(위치, 법선, 색 등) 저장된 벡터들의 수를 계산합니다. @@ -146,6 +146,9 @@

    [method:this copyArray]( array )

    [method:this copyAt] ( [param:Integer index1], [param:BufferAttribute bufferAttribute], [param:Integer index2] )

    bufferAttribute[index2]의 벡터를 [page:BufferAttribute.array array][index1]에 복사합니다.

    +

    [method:Number getComponent]( [param:Integer index], [param:Integer component] )

    +

    Returns the given component of the vector at the given index.

    +

    [method:Number getX]( [param:Integer index] )

    해당 index의 벡터의 x 컴포넌트 값을 리턴합니다.

    @@ -179,6 +182,9 @@

    [method:this set] ( [param:Array value], [param:Integer offset] )

    [method:this setUsage] ( [param:Usage value] )

    [page:BufferAttribute.usage usage]를 value로 설정합니다.

    +

    [method:Number setComponent]( [param:Integer index], [param:Integer component], [param:Float value] )

    +

    Sets the given component of the vector at the given index.

    +

    [method:this setX]( [param:Integer index], [param:Float x] )

    x 컴포넌트 값을 설정합니다.

    diff --git a/docs/api/zh/animation/AnimationAction.html b/docs/api/zh/animation/AnimationAction.html index d1fe7dc2f1462c..be1ad88ecad4b5 100644 --- a/docs/api/zh/animation/AnimationAction.html +++ b/docs/api/zh/animation/AnimationAction.html @@ -228,7 +228,7 @@

    [method:this reset]()

    [method:this setDuration]( [param:Number durationInSeconds] )

    - 设置单此循环的持续时间(通过调整时间比例([page:.timeScale timeScale])以及停用所有的变形)。此方法可以链式调用。 + 设置单次循环的持续时间(通过调整时间比例([page:.timeScale timeScale])以及停用所有的变形)。此方法可以链式调用。

    [method:this setEffectiveTimeScale]( [param:Number timeScale] )

    diff --git a/docs/api/zh/core/BufferAttribute.html b/docs/api/zh/core/BufferAttribute.html index 98203c6085a9e9..c2ef4b2a35c57d 100644 --- a/docs/api/zh/core/BufferAttribute.html +++ b/docs/api/zh/core/BufferAttribute.html @@ -51,7 +51,7 @@

    [property:TypedArray array]

    [property:Integer count]

    - 保存 [page:BufferAttribute.array array] 除以 [page:BufferAttribute.itemSize itemSize] 之后的大小。

    + 保存 [page:BufferAttribute.array array] 除以 [page:BufferAttribute.itemSize itemSize] 之后的大小。Read-only property.

    若缓存存储三元组(例如顶点位置、法向量、颜色值),则该值应等于队列中三元组的个数。

    @@ -135,6 +135,9 @@

    [method:this copyArray]( array )

    [method:this copyAt] ( [param:Integer index1], [param:BufferAttribute bufferAttribute], [param:Integer index2] )

    将一个矢量从 bufferAttribute[index2] 拷贝到 [page:BufferAttribute.array array][index1] 中。

    +

    [method:Number getComponent]( [param:Integer index], [param:Integer component] )

    +

    Returns the given component of the vector at the given index.

    +

    [method:Number getX]( [param:Integer index] )

    获取给定索引的矢量的第一维元素 (即 X 值)。

    @@ -166,6 +169,9 @@

    [method:this set] ( [param:Array value], [param:Integer offset] )

    [method:this setUsage] ( [param:Usage value] )

    Set [page:BufferAttribute.usage usage] to value. See usage [page:BufferAttributeUsage constants] for all possible input values.

    +

    [method:Number setComponent]( [param:Integer index], [param:Integer component], [param:Float value] )

    +

    Sets the given component of the vector at the given index.

    +

    [method:this setX]( [param:Integer index], [param:Float x] )

    设置给定索引的矢量的第一维数据(设置 X 值)。

    diff --git a/docs/api/zh/extras/DataUtils.html b/docs/api/zh/extras/DataUtils.html new file mode 100644 index 00000000000000..5692f69a09dfc3 --- /dev/null +++ b/docs/api/zh/extras/DataUtils.html @@ -0,0 +1,36 @@ + + + + + + + + + +

    [name]

    + +

    包含数据功能函数的类

    + +

    方法

    + +

    [method:Number toHalfFloat]( [param:Number val] )

    +

    + val -- 单精度浮点值。

    + + 根据给定的单精度浮点值返回半精度浮点值。 +

    + +

    [method:Number fromHalfFloat]( [param:Number val] )

    +

    + val -- 半精度浮点值。

    + + 根据给定的半精度浮点值返回单精度浮点值。 +

    + +

    源码

    + +

    + [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

    + + diff --git a/docs/api/zh/extras/core/ShapePath.html b/docs/api/zh/extras/core/ShapePath.html index d58d483a30e8e9..dcf66189edbd5b 100644 --- a/docs/api/zh/extras/core/ShapePath.html +++ b/docs/api/zh/extras/core/ShapePath.html @@ -10,7 +10,7 @@

    形状路径([name])

    - 该类用于转换一系列的形状为一个[page:Path]数组,例如转换SVG中的Path为three.js中的Path(请参阅下方的example)。 + 该类用于转换一系列的形状为一个[page:Path]数组,例如转换SVG中的Path为three.js中的Path。

    构造函数

    diff --git a/docs/api/zh/lights/Light.html b/docs/api/zh/lights/Light.html index 3a196ea922530a..46c900c6d2cf81 100644 --- a/docs/api/zh/lights/Light.html +++ b/docs/api/zh/lights/Light.html @@ -40,7 +40,7 @@

    [property:Color color]

    [property:Float intensity]

    光照的强度,或者说能量。
    - 禁用 [page:WebGLRenderer.useLegacyLights legacy lighting mode] 的情况下,强度的单位取决于光的类型。
    + 强度的单位取决于光的类型。
    默认值为 `1.0`。

    diff --git a/docs/api/zh/lights/PointLight.html b/docs/api/zh/lights/PointLight.html index 1073133c317ef5..b3f3c7a58e8acd 100644 --- a/docs/api/zh/lights/PointLight.html +++ b/docs/api/zh/lights/PointLight.html @@ -66,10 +66,6 @@

    [property:Float decay]

    [property:Float distance]

    - 默认模式下 — 当值为零时,光线不会衰减。当值不为零时,光线会从灯光的位置开始,到指定的距离之间,随着距离的增加线性衰减为零。 -

    -

    - 禁用 [page:WebGLRenderer.useLegacyLights legacy lighting mode] 的情况下 — 当值为零时,光线将根据平方反比定律衰减到无限远。 当值不为零时,光线会先按照平方反比定律衰减,直到距离截止点附近,然后线性衰减到 0。

    @@ -78,15 +74,14 @@

    [property:Float distance]

    [property:Float intensity]

    光源的强度。默认值为 `1`。
    - 禁用 [page:WebGLRenderer.useLegacyLights legacy lighting mode] 的情况下,单位是坎德拉(cd)。

    + 单位是坎德拉(cd)。

    改变该值会影响到 `power` 的值。

    [property:Float power]

    光源的功率。
    - 禁用 [page:WebGLRenderer.useLegacyLights legacy lighting mode] 的情况下,单位为流明(lm)。 -

    + 单位为流明(lm)。

    改变该值会影响到 `intensity` 的值。

    diff --git a/docs/api/zh/lights/RectAreaLight.html b/docs/api/zh/lights/RectAreaLight.html index 24c353455c5f4a..971b39d9bb2f25 100644 --- a/docs/api/zh/lights/RectAreaLight.html +++ b/docs/api/zh/lights/RectAreaLight.html @@ -67,7 +67,7 @@

    [property:Float height]

    [property:Float intensity]

    光源的强度。默认值为 `1`。
    - 禁用 [page:WebGLRenderer.useLegacyLights legacy lighting mode] 的情况下,单位是尼特(cd/m^2)。

    + 单位是尼特(cd/m^2)。

    改变该值会影响到 `power` 的值。

    @@ -80,7 +80,7 @@

    [property:Boolean isRectAreaLight]

    [property:Float power]

    光源的功率。
    - 禁用 [page:WebGLRenderer.useLegacyLights legacy lighting mode] 的情况下,单位为流明(lm)。

    + 单位为流明(lm)。

    改变该值会影响到 `intensity` 的值。

    diff --git a/docs/api/zh/lights/SpotLight.html b/docs/api/zh/lights/SpotLight.html index 3367702157a41d..5ae4857e2b4027 100644 --- a/docs/api/zh/lights/SpotLight.html +++ b/docs/api/zh/lights/SpotLight.html @@ -84,10 +84,6 @@

    [property:Float decay]

    [property:Float distance]

    - 默认模式下 — 当值为零时,光线不会衰减。当值不为零时,光线会从灯光的位置开始,到指定的距离之间,随着距离的增加线性衰减为零。 -

    -

    - 禁用 [page:WebGLRenderer.useLegacyLights legacy lighting mode] 的情况下 — 当值为零时,光线将根据平方反比定律衰减到无限远。 当值不为零时,光线会先按照平方反比定律衰减,直到距离截止点附近,然后线性衰减到 0。

    @@ -96,7 +92,7 @@

    [property:Float distance]

    [property:Float intensity]

    光源的强度。默认值为 `1`。
    - 禁用 [page:WebGLRenderer.useLegacyLights legacy lighting mode] 的情况下,单位是坎德拉(cd)。

    + 单位是坎德拉(cd)。

    改变该值会影响到 `power` 的值。

    @@ -118,8 +114,7 @@

    [property:Vector3 position]

    [property:Float power]

    光源的功率。
    - 禁用 [page:WebGLRenderer.useLegacyLights legacy lighting mode] 的情况下,单位为流明(lm)。 -

    + 单位为流明(lm)。

    改变该值会影响到 `intensity` 的值。

    @@ -151,7 +146,7 @@

    [property:Texture map]

    用于调节光线颜色的纹理([page:Texture]),聚光灯颜色会与该纹理的RGB值混合,其比例与其alpha值相对应。
    The cookie-like masking effect is reproduced using pixel values (0, 0, 0, 1-cookie_value).
    - *注意*: 如果 `castShadow` 值为 `false` 时,`map` 不可用。 + *注意*: 如果 [page:.castShadow] 值为 `false` 时,[page:.map] 不可用。

    diff --git a/docs/api/zh/loaders/CubeTextureLoader.html b/docs/api/zh/loaders/CubeTextureLoader.html index 5e216ecc06919b..9320e631942b7b 100644 --- a/docs/api/zh/loaders/CubeTextureLoader.html +++ b/docs/api/zh/loaders/CubeTextureLoader.html @@ -16,6 +16,11 @@

    [name]

    内部使用[page:ImageLoader]来加载文件。

    +

    + The loaded [page:CubeTexture] is in sRGB color space. Meaning the [page:Texture.colorSpace colorSpace] + property is set to `THREE.SRGBColorSpace` by default. +

    +

    代码示例

    diff --git a/docs/api/zh/materials/LineBasicMaterial.html b/docs/api/zh/materials/LineBasicMaterial.html index 36b03110837246..94a6ebc785b748 100644 --- a/docs/api/zh/materials/LineBasicMaterial.html +++ b/docs/api/zh/materials/LineBasicMaterial.html @@ -38,7 +38,6 @@

    例子

    [example:webgl_interactive_voxelpainter WebGL / interactive / voxelpainter]
    [example:webgl_lines_colors WebGL / lines / colors]
    [example:webgl_lines_dashed WebGL / lines / dashed]
    - [example:webgl_materials WebGL / materials]
    [example:physics_ammo_rope physics / ammo / rope]

    diff --git a/docs/api/zh/materials/MeshPhysicalMaterial.html b/docs/api/zh/materials/MeshPhysicalMaterial.html index 7ec11885c59cfd..8779fa4b0535a7 100644 --- a/docs/api/zh/materials/MeshPhysicalMaterial.html +++ b/docs/api/zh/materials/MeshPhysicalMaterial.html @@ -159,7 +159,7 @@

    [property:Texture sheenColorMap]

    [property:Float specularIntensity]

    - 用于控制非金属材质高光反射强度的浮点值。漫反射材质对应的值为0。范围从*0.0*到*1.0*。 默认值为*0.0*。 + 用于控制非金属材质高光反射强度的浮点值。漫反射材质对应的值为0。范围从*0.0*到*1.0*。 默认值为*1.0*。

    [property:Texture specularIntensityMap]

    diff --git a/docs/api/zh/math/Color.html b/docs/api/zh/math/Color.html index 2e77617fb21007..8d31093444856b 100644 --- a/docs/api/zh/math/Color.html +++ b/docs/api/zh/math/Color.html @@ -182,7 +182,7 @@

    [method:Object getHSL]( [param:Object target], [param:string colorSpace] = L

    -

    [method:Color getRGB]( [param:Color target], [param:string colorSpace] = SRGBColorSpace )

    +

    [method:Color getRGB]( [param:Color target], [param:string colorSpace] = LinearSRGBColorSpace )

    [page:Color target] - 结果将复制到这个对象中.

    diff --git a/docs/api/zh/math/Matrix3.html b/docs/api/zh/math/Matrix3.html index 356cdaa77c2d89..04bd451a6ccd8b 100644 --- a/docs/api/zh/math/Matrix3.html +++ b/docs/api/zh/math/Matrix3.html @@ -44,7 +44,7 @@

    Constructor

    [name]( [param:Number n11], [param:Number n12], [param:Number n13], - [param:Number n21], [param:Number n22], [param:Number n22], + [param:Number n21], [param:Number n22], [param:Number n23], [param:Number n31], [param:Number n32], [param:Number n33] )

    Creates a 3x3 matrix with the given arguments in row-major order. If no arguments are provided, the constructor initializes diff --git a/docs/api/zh/renderers/WebGLRenderer.html b/docs/api/zh/renderers/WebGLRenderer.html index 263e861f436fea..365c2ff28cafc6 100644 --- a/docs/api/zh/renderers/WebGLRenderer.html +++ b/docs/api/zh/renderers/WebGLRenderer.html @@ -192,11 +192,6 @@

    [property:Object info]

    [property:Boolean localClippingEnabled]

    定义渲染器是否考虑对象级剪切平面。 默认为*false*.

    -

    [property:Boolean useLegacyLights]

    -

    - Whether to use the legacy lighting mode or not. 默认是*true*。 -

    -

    [property:Object properties]

    渲染器内部使用,以跟踪各种子对象属性。 diff --git a/docs/api/zh/textures/CompressedArrayTexture.html b/docs/api/zh/textures/CompressedArrayTexture.html index 8383f04f18c6e8..66a7a152084b21 100644 --- a/docs/api/zh/textures/CompressedArrayTexture.html +++ b/docs/api/zh/textures/CompressedArrayTexture.html @@ -1,5 +1,5 @@ - + @@ -12,61 +12,58 @@

    [name]

    - Creates an texture 2D array based on data in compressed form, for example from a [link:https://en.wikipedia.org/wiki/DirectDraw_Surface DDS] file.

    + 基于压缩形式的数据(例如从[link:https://en.wikipedia.org/wiki/DirectDraw_Surface DDS]文件)创建纹理2D数组

    - - For use with the [page:CompressedTextureLoader CompressedTextureLoader]. + 用于 [page:CompressedTextureLoader CompressedTextureLoader].

    -

    Constructor

    +

    构造函数

    [name]( [param:Array mipmaps], [param:Number width], [param:Number height], [param:Constant format], [param:Constant type] )

    - [page:Array mipmaps] -- The mipmaps array should contain objects with data, width and height. The mipmaps should be of the correct format and type.
    + [page:Array mipmaps] -- mipmaps数组应包含具有数据、宽度和高度的对象。mipmap 应具有正确的格式和类型。
    - [page:Number width] -- The width of the biggest mipmap.
    + [page:Number width] -- 最大 mipmap 的宽度
    - [page:Number height] -- The height of the biggest mipmap.
    + [page:Number height] -- 最大 mipmap 的高度
    - [page:Number depth] -- The number of layers of the 2D array texture.
    + [page:Number depth] -- 二维阵列纹理的层数。
    - [page:Constant format] -- The format used in the mipmaps. - See [page:Textures ST3C Compressed Texture Formats], - [page:Textures PVRTC Compressed Texture Formats] and - [page:Textures ETC Compressed Texture Format] for other choices.
    + [page:Constant format] -- mipmap 中使用的格式。 + 有关其他选择,请参阅[page:Textures ST3C Compressed Texture Formats] 、 + [page:Textures PVRTC Compressed Texture Formats]和[page:Textures ETC Compressed Texture Format]。 +
    - [page:Constant type] -- Default is [page:Textures THREE.UnsignedByteType]. - See [page:Textures type constants] for other choices.
    + [page:Constant type] -- 默认值为[page:Textures THREE.UnsignedByteType]。 有关其他选择,请参阅[page:Textures type constants]。

    -

    Properties

    - - See the base [page:CompressedTexture CompressedTexture] class for common properties. +

    属性

    + 有关常见属性,请参阅基本[page:CompressedTexture CompressedTexture]类。

    [property:number wrapR]

    - This defines how the texture is wrapped in the depth direction.
    - The default is [page:Textures THREE.ClampToEdgeWrapping], where the edge is clamped to the outer edge texels. - The other two choices are [page:Textures THREE.RepeatWrapping] and [page:Textures THREE.MirroredRepeatWrapping]. - See the [page:Textures texture constants] page for details. + 这定义了纹理在深度方向上的包裹方式。
    + 默认值为[page:Textures THREE.ClampToEdgeWrapping],其中边缘被紧贴到外边缘纹素上。 + 另外两个选择是[page:Textures THREE.RepeatWrapping]和[page:Textures THREE.MirroredRepeatWrapping]。 + 有关详细信息,请参阅[page:Textures texture constants]页面。

    [property:Boolean isCompressedArrayTexture]

    - Read-only flag to check if a given object is of type [name]. + 只读标志,用于检查给定对象是否为[name]类型。

    -

    Methods

    +

    函数

    - See the base [page:CompressedTexture CompressedTexture] class for common methods. + 有关常用方法,请参阅基本[page:CompressedTexture CompressedTexture]类。

    -

    Source

    +

    源代码

    [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] diff --git a/docs/examples/en/controls/ArcballControls.html b/docs/examples/en/controls/ArcballControls.html index 9565896556b0d7..93131fa454aaa1 100644 --- a/docs/examples/en/controls/ArcballControls.html +++ b/docs/examples/en/controls/ArcballControls.html @@ -186,6 +186,16 @@

    [property:Float minZoom]

    How far you can zoom in ( [page:OrthographicCamera] only ). Default is 0.

    +

    [property:Float radiusFactor]

    +

    + The size of the gizmo relative to the screen width and height. Default is 0.67. +

    + +

    [property:Float rotateSpeed]

    +

    + Speed of rotation. Default is 1. +

    +

    [property:Float scaleFactor]

    The scaling factor used when performing zoom operation. @@ -201,11 +211,6 @@

    [property:Float wMax]

    Maximum angular velocity allowed on rotation animation start.

    -

    [property:Float radiusFactor]

    -

    - The size of the gizmo relative to the screen width and height. Default is 0.67. -

    -

    Methods

    diff --git a/docs/examples/en/controls/FlyControls.html b/docs/examples/en/controls/FlyControls.html index 952b6b84618f60..8e50998b7ee9d6 100644 --- a/docs/examples/en/controls/FlyControls.html +++ b/docs/examples/en/controls/FlyControls.html @@ -70,6 +70,11 @@

    [property:Boolean dragToLook]

    If set to `true`, you can only look around by performing a drag interaction. Default is `false`.

    +

    [property:Boolean enabled]

    +

    + When set to `false`, the controls will not respond to user input. Default is `true`. +

    +

    [property:Number movementSpeed]

    The movement speed. Default is *1*. diff --git a/docs/examples/en/controls/OrbitControls.html b/docs/examples/en/controls/OrbitControls.html index b8f38209c9be5e..3f3ba3b85cfce9 100644 --- a/docs/examples/en/controls/OrbitControls.html +++ b/docs/examples/en/controls/OrbitControls.html @@ -91,7 +91,7 @@

    Properties

    [property:Boolean autoRotate]

    Set to true to automatically rotate around the target.
    Note that if this is enabled, you must call [page:.update] - () in your animation loop. + () in your animation loop. If you want the auto-rotate speed to be independent of the frame rate (the refresh rate of the display), you must pass the time `deltaTime`, in seconds, to [page:.update]().

    [property:Float autoRotateSpeed]

    @@ -273,7 +273,10 @@

    [property:Float zoomSpeed]

    Speed of zooming / dollying. Default is 1.

    - +

    [property:Boolean zoomToCursor]

    +

    + Setting this property to `true` allows to zoom to the cursor's position. Default is `false`. +

    Methods

    @@ -317,10 +320,11 @@

    [method:undefined stopListenToKeyEvents] ()

    Removes the key event listener previously defined with [page:.listenToKeyEvents]().

    -

    [method:Boolean update] ()

    +

    [method:Boolean update] ( [param:Number deltaTime] )

    Update the controls. Must be called after any manual changes to the camera's transform, - or in the update loop if [page:.autoRotate] or [page:.enableDamping] are set. + or in the update loop if [page:.autoRotate] or [page:.enableDamping] are set. `deltaTime`, in seconds, is optional, + and is only required if you want the auto-rotate speed to be independent of the frame rate (the refresh rate of the display).

    Source

    diff --git a/docs/examples/en/controls/TrackballControls.html b/docs/examples/en/controls/TrackballControls.html index ed2fd22311620f..12ecef6181fd8b 100644 --- a/docs/examples/en/controls/TrackballControls.html +++ b/docs/examples/en/controls/TrackballControls.html @@ -171,6 +171,11 @@

    [property:Boolean staticMoving]

    Whether or not damping is disabled. Default is `false`.

    +

    [property:Vector3 target]

    +

    + The focus point of the controls. +

    +

    [property:Number zoomSpeed]

    The zoom speed. Default is `1.2`. diff --git a/docs/examples/en/exporters/ColladaExporter.html b/docs/examples/en/exporters/ColladaExporter.html deleted file mode 100644 index e64279dfd388fa..00000000000000 --- a/docs/examples/en/exporters/ColladaExporter.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - -

    [name]

    - -

    - An exporter for `Collada`. -

    - [link:https://www.khronos.org/collada/ Collada] is a - file format for robust representation of scenes, materials, animations, and other 3D content in an xml format. - This exporter only supports exporting geometry, materials, textures, and scene hierarchy. -

    - -

    Import

    - -

    - [name] is an add-on, and must be imported explicitly. - See [link:#manual/introduction/Installation Installation / Addons]. -

    - - - import { ColladaExporter } from 'three/addons/exporters/ColladaExporter.js'; - - -

    Code Example

    - - - // Instantiate an exporter - const exporter = new ColladaExporter(); - - // Parse the input and generate the collada ( .dae ) output - const data = exporter.parse( scene, null, options ); - downloadFile( data ); - - -

    Constructor

    - -

    [name]()

    -

    -

    -

    - Creates a new [name]. -

    - -

    Methods

    - -

    [method:Object parse]( [param:Object3D input], [param:Function onCompleted], [param:Object options] )

    -

    - [page:Object input] — Object3D to be exported
    - [page:Function onCompleted] — Will be called when the export completes. Optional. The same data is immediately returned from the function.
    - [page:Options options] — Export options
    -

    -
      -
    • version - string. Which version of Collada to export. The options are "1.4.1" or "1.5.0". Defaults to "1.4.1".
    • -
    • author - string. The name to include in the author field. Author field is excluded by default.
    • -
    • textureDirectory - string. The directory relative to the Collada file to save the textures to.
    • -
    • upAxis - string. Either Y_UP (default), Z_UP or X_UP.
    • -
    • unitName - string. Name of the unit. Can be any string, but could be for example "meter", "inch", or "parsec".
    • -
    • unitMeter - number. Length of the unit in meters.
    • -
    -

    - Generates an object with Collada file and texture data. This object is returned from the function and passed into the "onCompleted" callback. - - { - // Collada file content - data: "", - - // List of referenced textures - textures: [{ - - // File directory, name, and extension of the texture data - directory: "", - name: "", - ext: "", - - // The texture data and original texture object - data: [], - original: <THREE.Texture> - }, ...] - } - -

    - -

    Source

    - -

    - [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/exporters/ColladaExporter.js examples/jsm/exporters/ColladaExporter.js] -

    - - diff --git a/docs/examples/en/loaders/GLTFLoader.html b/docs/examples/en/loaders/GLTFLoader.html index 5e276132e78aed..3b36b23a1e0371 100644 --- a/docs/examples/en/loaders/GLTFLoader.html +++ b/docs/examples/en/loaders/GLTFLoader.html @@ -70,10 +70,6 @@

    Extensions

  • [link:https://github.com/takahirox/three-gltf-extensions MSFT_texture_dds]
-

- 1Requires [link:https://threejs.org/docs/#api/en/renderers/WebGLRenderer.useLegacyLights useLegacyLights] to be disabled. -

-

2You can also manually process the extension after loading in your application. See [link:https://threejs.org/examples/#webgl_loader_gltf_variants Three.js glTF materials variants example].

diff --git a/docs/examples/en/math/MeshSurfaceSampler.html b/docs/examples/en/math/MeshSurfaceSampler.html index ceb92ecd2d0141..6f0bfbc8336516 100644 --- a/docs/examples/en/math/MeshSurfaceSampler.html +++ b/docs/examples/en/math/MeshSurfaceSampler.html @@ -80,9 +80,9 @@

[method:this build]()

Processes the input geometry and prepares to return samples. Any configuration of the geometry or sampler must occur before this method is called. Time complexity is O(n) for a surface with n faces.

-

[method:this sample]( [param:Vector3 targetPosition], [param:Vector3 targetNormal], [param:Color targetColor] )

+

[method:this sample]( [param:Vector3 targetPosition], [param:Vector3 targetNormal], [param:Color targetColor], [param:Vector2 targetUV] )

- Selects a random point on the surface of the input geometry, returning the position and optionally the normal vector and color at that point. Time complexity is O(log n) for a surface with n faces.

+ Selects a random point on the surface of the input geometry, returning the position and optionally the normal vector, color and UV Coordinate at that point. Time complexity is O(log n) for a surface with n faces.

Source

diff --git a/docs/examples/en/math/OBB.html b/docs/examples/en/math/OBB.html index 0ffd648f29a1c2..cd0149d1c7681b 100644 --- a/docs/examples/en/math/OBB.html +++ b/docs/examples/en/math/OBB.html @@ -148,6 +148,14 @@

[method:Boolean intersectsOBB]( [param:OBB obb], [param:Number epsilon] ) +

[method:Boolean intersectsPlane]( [param:Plane plane] )

+

+ [page:Plane plane] — The plane to test. +

+

+ Whether the given plane intersects this [name] or not. +

+

[method:Boolean intersectsRay]( [param:Ray ray] )

[page:Ray ray] — The ray to test. diff --git a/docs/examples/en/utils/BufferGeometryUtils.html b/docs/examples/en/utils/BufferGeometryUtils.html index 1b4fe1f4f83fa5..ff052ba838f367 100644 --- a/docs/examples/en/utils/BufferGeometryUtils.html +++ b/docs/examples/en/utils/BufferGeometryUtils.html @@ -122,11 +122,19 @@

[method:BufferGeometry mergeVertices]( [param:BufferGeometry geometry], [par

[method:BufferGeometry toCreasedNormals]( [param:BufferGeometry geometry], [param:Number creaseAngle] )

+
    +
  • geometry -- The input geometry.
  • +
  • creaseAngle -- The crease angle in radians.
  • +
+

- geometry -- The input geometry.
- creaseAngle -- The crease angle.

+ Modifies the supplied geometry if it is non-indexed, otherwise creates a new, + non-indexed geometry. +

- Creates a new, non-indexed geometry with smooth normals everywhere except faces that meet at an angle greater than the crease angle. +

+ Returns the geometry with smooth normals everywhere except faces + that meet at an angle greater than the crease angle.

[method:BufferGeometry toTrianglesDrawMode]( [param:BufferGeometry geometry], [param:TrianglesDrawMode drawMode] )

diff --git a/docs/examples/en/utils/CameraUtils.html b/docs/examples/en/utils/CameraUtils.html index 5d2876df7c98e4..772ddd2b98de59 100644 --- a/docs/examples/en/utils/CameraUtils.html +++ b/docs/examples/en/utils/CameraUtils.html @@ -21,7 +21,7 @@

Import

- import { CameraUtils } from 'three/addons/utils/CameraUtils.js'; + import * as CameraUtils from 'three/addons/utils/CameraUtils.js';

Methods

diff --git a/docs/examples/ko/controls/FlyControls.html b/docs/examples/ko/controls/FlyControls.html index 2e74af2f0f1ff2..0cfea2476c7554 100644 --- a/docs/examples/ko/controls/FlyControls.html +++ b/docs/examples/ko/controls/FlyControls.html @@ -70,6 +70,11 @@

[property:Boolean dragToLook]

*true* 으로 설정되어 있을 경우, 드래그 상호 작용을 수행해야만 주변을 둘러볼 수 있습니다. 기본값은 *false* 입니다.

+

[property:Boolean enabled]

+

+ *false*로 설정할 경우, 컨트롤은 사용자 입력에 응답하지 못합니다. 기본값은 *true* 입니다. +

+

[property:Number movementSpeed]

이동 속도를 설정할 수 있습니다. 기본값은 *1* 입니다. diff --git a/docs/examples/ko/controls/OrbitControls.html b/docs/examples/ko/controls/OrbitControls.html index 9bf86f3e03c2ed..95bd9a843d9de5 100644 --- a/docs/examples/ko/controls/OrbitControls.html +++ b/docs/examples/ko/controls/OrbitControls.html @@ -91,7 +91,8 @@

특성

[property:Boolean autoRotate]

대상 주위를 자동으로 회전하려면 true로 설정합니다.
autoRotate를 활성할 경우, 애니메이션 루프에서 [page:.update()]를 호출해야 합니다. - + Set to true to automatically rotate around the target.
Note that if this is enabled, you must call [page:.update] + () in your animation loop. If you want the auto-rotate speed to be independent of the frame rate (the refresh rate of the display), you must pass the time `deltaTime`, in seconds, to [page:.update]().

[property:Float autoRotateSpeed]

@@ -269,7 +270,10 @@

[property:Float zoomSpeed]

줌잉(Zooming)과 달링(Dollying)의 속도를 설정합니다. 기본값은 1 입니다.

- +

[property:Boolean zoomToCursor]

+

+ Setting this property to `true` allows to zoom to the cursor's position. Default is `false`. +

메서드

@@ -314,9 +318,12 @@

[method:undefined stopListenToKeyEvents] ()

Removes the key event listener previously defined with [page:.listenToKeyEvents]().

-

[method:Boolean update] ()

+

[method:Boolean update] ( [param:Number deltaTime] )

컨트롤을 업데이트합니다. 카메라를 수동으로 변환하거나, [page:.autoRotate] 또는 [page:.enableDamping]을 설정할 경우 업데이트 루프에서 호출해야 합니다. + Update the controls. Must be called after any manual changes to the camera's transform, + or in the update loop if [page:.autoRotate] or [page:.enableDamping] are set. `deltaTime`, in seconds, is optional, + and is only required if you want the auto-rotate speed to be independent of the frame rate (the refresh rate of the display).

Source

diff --git a/docs/examples/zh/controls/DragControls.html b/docs/examples/zh/controls/DragControls.html index f81e6efee0b4b9..8ba4abd4290daa 100644 --- a/docs/examples/zh/controls/DragControls.html +++ b/docs/examples/zh/controls/DragControls.html @@ -50,7 +50,7 @@

例子

[example:misc_controls_drag misc / controls / drag ]

-

Constructor

+

构造函数

[name]( [param:Array objects], [param:Camera camera], [param:HTMLDOMElement domElement] )

@@ -104,11 +104,10 @@

[property:Boolean enabled]

[property:Boolean transformGroup]

- This option only works if the [page:DragControls.objects] array contains a single draggable group object. - If set to *true*, [name] does not transform individual objects but the entire group. Default is *false*. + 当[page:DragControls.objects]数组包含一个单个可拖拽的组对象时该选项生效。如果设置为`true`,[name]会转换整个组对象,而不对单个对象做转换。默认值为`false`。

-

Methods

+

方法

共有方法请参见其基类[page:EventDispatcher]。

@@ -129,12 +128,12 @@

[method:undefined dispose] ()

[method:Array getObjects] ()

- Returns the array of draggable objects. + 返回可拖拽的对象数组。

[method:Raycaster getRaycaster] ()

- Returns the internal [page:Raycaster] instance that is used for intersection tests. + 返回用于相交测试的内部[page:Raycaster]实例。

Source

diff --git a/docs/examples/zh/controls/FirstPersonControls.html b/docs/examples/zh/controls/FirstPersonControls.html index a2d504e8fc219e..72cc81f899bd0a 100644 --- a/docs/examples/zh/controls/FirstPersonControls.html +++ b/docs/examples/zh/controls/FirstPersonControls.html @@ -18,7 +18,7 @@

进口

[name] 是一个附加组件,必须显式导入。 - See [link:#manual/introduction/Installation Installation / Addons]. + 请参考[link:#manual/introduction/Installation Installation / Addons].

@@ -73,17 +73,17 @@

[property:Boolean enabled]

[property:Number heightCoef]

- Determines how much faster the camera moves when it's y-component is near [page:.heightMax]. Default is *1*. + 当Y坐标接近[page:.heightMax]时摄像机的移动速度。默认值为*1*。

[property:Number heightMax]

- Upper camera height limit used for movement speed adjusment. Default is *1*. + 用于调节移动速度的摄像机最大高度限制。默认值为*1*。

[property:Number heightMin]

- Lower camera height limit used for movement speed adjusment. Default is *0*. + 用于调节移动速度的摄像机最低高度限制。默认值为*0*。

[property:Boolean heightSpeed]

@@ -158,7 +158,7 @@

[method:FirstPersonControls lookAt]( [param:Vector3 vector] )

[method:undefined update] ( [param:Number delta] )

- [page:Number delta]: Time delta value. + [page:Number delta]:时间增量值。

更新控制器,常被用在动画循环中。 diff --git a/docs/examples/zh/controls/FlyControls.html b/docs/examples/zh/controls/FlyControls.html index 99691d491823bd..0fa59ed8629817 100644 --- a/docs/examples/zh/controls/FlyControls.html +++ b/docs/examples/zh/controls/FlyControls.html @@ -49,7 +49,7 @@

Events

change

- Fires when the camera has been transformed by the controls. + 当摄像机被组件改变时触发。

属性

@@ -69,6 +69,11 @@

[property:Boolean dragToLook]

若该值设为*true*,你将只能通过执行拖拽交互来环视四周。默认为*false*。

+

[property:Boolean enabled]

+

+ 当设置为false时,控制器将不会响应用户的操作。默认值为true。 +

+

[property:Number movementSpeed]

移动速度,默认为*1*。 @@ -94,7 +99,7 @@

[method:undefined dispose] ()

[method:undefined update] ( [param:Number delta] )

- [page:Number delta]: Time delta value. + [page:Number delta]:时间增量值。

更新控制器,常被用在动画循环中。 diff --git a/docs/examples/zh/controls/OrbitControls.html b/docs/examples/zh/controls/OrbitControls.html index cfee58e37fc3bb..0854712c7f3972 100644 --- a/docs/examples/zh/controls/OrbitControls.html +++ b/docs/examples/zh/controls/OrbitControls.html @@ -74,17 +74,17 @@

Events

change

- Fires when the camera has been transformed by the controls. + 当摄像机被组件改变时触发。

start

- Fires when an interaction was initiated. + 初始化交互时触发。

end

- Fires when an interaction has finished. + 当交互结束时触发。

属性

@@ -93,6 +93,8 @@

[property:Boolean autoRotate]

将其设为true,以自动围绕目标旋转。
请注意,如果它被启用,你必须在你的动画循环里调用[page:.update]()。 + Set to true to automatically rotate around the target.
Note that if this is enabled, you must call [page:.update] + () in your animation loop. If you want the auto-rotate speed to be independent of the frame rate (the refresh rate of the display), you must pass the time `deltaTime`, in seconds, to [page:.update]().

[property:Float autoRotateSpeed]

@@ -272,7 +274,10 @@

[property:Float zoomSpeed]

摄像机缩放的速度,其默认值为1。

- +

[property:Boolean zoomToCursor]

+

+ Setting this property to `true` allows to zoom to the cursor's position. Default is `false`. +

Methods

@@ -316,10 +321,13 @@

[method:undefined stopListenToKeyEvents] ()

Removes the key event listener previously defined with [page:.listenToKeyEvents]().

-

[method:Boolean update] ()

+

[method:Boolean update] ( [param:Number deltaTime] )

更新控制器。必须在摄像机的变换发生任何手动改变后调用, 或如果[page:.autoRotate]或[page:.enableDamping]被设置时,在update循环里调用。 + Update the controls. Must be called after any manual changes to the camera's transform, + or in the update loop if [page:.autoRotate] or [page:.enableDamping] are set. `deltaTime`, in seconds, is optional, + and is only required if you want the auto-rotate speed to be independent of the frame rate (the refresh rate of the display).

源代码

diff --git a/docs/examples/zh/controls/PointerLockControls.html b/docs/examples/zh/controls/PointerLockControls.html index 12a8d4db54e650..d43d8377e735d8 100644 --- a/docs/examples/zh/controls/PointerLockControls.html +++ b/docs/examples/zh/controls/PointerLockControls.html @@ -20,7 +20,7 @@

进口

[name] 是一个附加组件,必须显式导入。 - See [link:#manual/introduction/Installation Installation / Addons]. + 请参阅 [link:#manual/introduction/Installation Installation / Addons].

@@ -51,7 +51,7 @@

例子

[example:misc_controls_pointerlock misc / controls / pointerlock ]

-

Constructor

+

构造函数

[name]( [param:Camera camera], [param:HTMLDOMElement domElement] )

@@ -98,12 +98,12 @@

[property:Boolean isLocked]

[property:Float maxPolarAngle]

- Camera pitch, upper limit. Range is 0 to Math.PI radians. Default is Math.PI. + 摄像机的俯仰角上限限制。范围为0到Math.PI弧度之间。默认值为Math.PI。

[property:Float minPolarAngle]

- Camera pitch, lower limit. Range is 0 to Math.PI radians. Default is 0. + 摄像机的俯仰角下限限制。范围为0到Math.PI弧度之间。默认值为0。

Methods

diff --git a/docs/examples/zh/loaders/GLTFLoader.html b/docs/examples/zh/loaders/GLTFLoader.html index d8f58ef48354ec..a78e11450230d6 100644 --- a/docs/examples/zh/loaders/GLTFLoader.html +++ b/docs/examples/zh/loaders/GLTFLoader.html @@ -69,9 +69,6 @@

扩展

  • [link:https://github.com/takahirox/three-gltf-extensions MSFT_texture_dds]
  • -

    - 1Requires [link:https://threejs.org/docs/#api/en/renderers/WebGLRenderer.useLegacyLights useLegacyLights] to be disabled. -

    2支持UV变换,但存在一些重要的限制。 Transforms applied to diff --git a/docs/examples/zh/utils/BufferGeometryUtils.html b/docs/examples/zh/utils/BufferGeometryUtils.html index 4e8c9bbc3ad9bc..09ac23bcef5020 100644 --- a/docs/examples/zh/utils/BufferGeometryUtils.html +++ b/docs/examples/zh/utils/BufferGeometryUtils.html @@ -120,12 +120,19 @@

    [method:BufferGeometry mergeVertices]( [param:BufferGeometry geometry], [par

    [method:BufferGeometry toCreasedNormals]( [param:BufferGeometry geometry], [param:Number creaseAngle] )

    +
      +
    • geometry -- The input geometry.
    • +
    • creaseAngle -- The crease angle in radians.
    • +
    +

    - geometry -- The input geometry.
    - creaseAngle -- The crease angle. + Modifies the supplied geometry if it is non-indexed, otherwise creates a new, + non-indexed geometry.

    +

    - Creates a new, non-indexed geometry with smooth normals everywhere except faces that meet at an angle greater than the crease angle. + Returns the geometry with smooth normals everywhere except faces + that meet at an angle greater than the crease angle.

    [method:BufferGeometry toTrianglesDrawMode]( [param:BufferGeometry geometry], [param:TrianglesDrawMode drawMode] )

    diff --git a/docs/list.json b/docs/list.json index 8ce2314ccb2198..66695c1b231e0c 100644 --- a/docs/list.json +++ b/docs/list.json @@ -386,7 +386,6 @@ }, "Exporters": { - "ColladaExporter": "examples/en/exporters/ColladaExporter", "DRACOExporter": "examples/en/exporters/DRACOExporter", "EXRExporter": "examples/en/exporters/EXRExporter", "GLTFExporter": "examples/en/exporters/GLTFExporter", @@ -583,6 +582,159 @@ "TorusKnotGeometry": "api/ar/geometries/TorusKnotGeometry", "TubeGeometry": "api/ar/geometries/TubeGeometry", "WireframeGeometry": "api/ar/geometries/WireframeGeometry" + }, + + "Helpers": { + "ArrowHelper": "api/ar/helpers/ArrowHelper", + "AxesHelper": "api/ar/helpers/AxesHelper", + "BoxHelper": "api/ar/helpers/BoxHelper", + "Box3Helper": "api/ar/helpers/Box3Helper", + "CameraHelper": "api/ar/helpers/CameraHelper", + "DirectionalLightHelper": "api/ar/helpers/DirectionalLightHelper", + "GridHelper": "api/ar/helpers/GridHelper", + "PolarGridHelper": "api/ar/helpers/PolarGridHelper", + "HemisphereLightHelper": "api/ar/helpers/HemisphereLightHelper", + "PlaneHelper": "api/ar/helpers/PlaneHelper", + "PointLightHelper": "api/ar/helpers/PointLightHelper", + "SkeletonHelper": "api/ar/helpers/SkeletonHelper", + "SpotLightHelper": "api/ar/helpers/SpotLightHelper" + }, + + "Lights": { + "AmbientLight": "api/ar/lights/AmbientLight", + "AmbientLightProbe": "api/ar/lights/AmbientLightProbe", + "DirectionalLight": "api/ar/lights/DirectionalLight", + "HemisphereLight": "api/ar/lights/HemisphereLight", + "HemisphereLightProbe": "api/ar/lights/HemisphereLightProbe", + "Light": "api/ar/lights/Light", + "LightProbe": "api/ar/lights/LightProbe", + "PointLight": "api/ar/lights/PointLight", + "RectAreaLight": "api/ar/lights/RectAreaLight", + "SpotLight": "api/ar/lights/SpotLight" + }, + + "Lights / Shadows": { + "LightShadow": "api/ar/lights/shadows/LightShadow", + "PointLightShadow": "api/ar/lights/shadows/PointLightShadow", + "DirectionalLightShadow": "api/ar/lights/shadows/DirectionalLightShadow", + "SpotLightShadow": "api/ar/lights/shadows/SpotLightShadow" + }, + + "Loaders": { + "AnimationLoader": "api/ar/loaders/AnimationLoader", + "AudioLoader": "api/ar/loaders/AudioLoader", + "BufferGeometryLoader": "api/ar/loaders/BufferGeometryLoader", + "Cache": "api/ar/loaders/Cache", + "CompressedTextureLoader": "api/ar/loaders/CompressedTextureLoader", + "CubeTextureLoader": "api/ar/loaders/CubeTextureLoader", + "DataTextureLoader": "api/ar/loaders/DataTextureLoader", + "FileLoader": "api/ar/loaders/FileLoader", + "ImageBitmapLoader": "api/ar/loaders/ImageBitmapLoader", + "ImageLoader": "api/ar/loaders/ImageLoader", + "Loader": "api/ar/loaders/Loader", + "LoaderUtils": "api/ar/loaders/LoaderUtils", + "MaterialLoader": "api/ar/loaders/MaterialLoader", + "ObjectLoader": "api/ar/loaders/ObjectLoader", + "TextureLoader": "api/ar/loaders/TextureLoader" + }, + + "Loaders / Managers": { + "DefaultLoadingManager": "api/ar/loaders/managers/DefaultLoadingManager", + "LoadingManager": "api/ar/loaders/managers/LoadingManager" + }, + + "Materials": { + "LineBasicMaterial": "api/ar/materials/LineBasicMaterial", + "LineDashedMaterial": "api/ar/materials/LineDashedMaterial", + "Material": "api/ar/materials/Material", + "MeshBasicMaterial": "api/ar/materials/MeshBasicMaterial", + "MeshDepthMaterial": "api/ar/materials/MeshDepthMaterial", + "MeshDistanceMaterial": "api/ar/materials/MeshDistanceMaterial", + "MeshLambertMaterial": "api/ar/materials/MeshLambertMaterial", + "MeshMatcapMaterial": "api/ar/materials/MeshMatcapMaterial", + "MeshNormalMaterial": "api/ar/materials/MeshNormalMaterial", + "MeshPhongMaterial": "api/ar/materials/MeshPhongMaterial", + "MeshPhysicalMaterial": "api/ar/materials/MeshPhysicalMaterial", + "MeshStandardMaterial": "api/ar/materials/MeshStandardMaterial", + "MeshToonMaterial": "api/ar/materials/MeshToonMaterial", + "PointsMaterial": "api/ar/materials/PointsMaterial", + "RawShaderMaterial": "api/ar/materials/RawShaderMaterial", + "ShaderMaterial": "api/ar/materials/ShaderMaterial", + "ShadowMaterial": "api/ar/materials/ShadowMaterial", + "SpriteMaterial": "api/ar/materials/SpriteMaterial" + }, + + "Math": { + "Box2": "api/ar/math/Box2", + "Box3": "api/ar/math/Box3", + "Color": "api/ar/math/Color", + "Cylindrical": "api/ar/math/Cylindrical", + "Euler": "api/ar/math/Euler", + "Frustum": "api/ar/math/Frustum", + "Interpolant": "api/ar/math/Interpolant", + "Line3": "api/ar/math/Line3", + "MathUtils": "api/ar/math/MathUtils", + "Matrix3": "api/ar/math/Matrix3", + "Matrix4": "api/ar/math/Matrix4", + "Plane": "api/ar/math/Plane", + "Quaternion": "api/ar/math/Quaternion", + "Ray": "api/ar/math/Ray", + "Sphere": "api/ar/math/Sphere", + "Spherical": "api/ar/math/Spherical", + "SphericalHarmonics3": "api/ar/math/SphericalHarmonics3", + "Triangle": "api/ar/math/Triangle", + "Vector2": "api/ar/math/Vector2", + "Vector3": "api/ar/math/Vector3", + "Vector4": "api/ar/math/Vector4" + }, + + "Math / Interpolants": { + "CubicInterpolant": "api/ar/math/interpolants/CubicInterpolant", + "DiscreteInterpolant": "api/ar/math/interpolants/DiscreteInterpolant", + "LinearInterpolant": "api/ar/math/interpolants/LinearInterpolant", + "QuaternionLinearInterpolant": "api/ar/math/interpolants/QuaternionLinearInterpolant" + }, + + "Objects": { + "Bone": "api/ar/objects/Bone", + "Group": "api/ar/objects/Group", + "InstancedMesh": "api/ar/objects/InstancedMesh", + "Line": "api/ar/objects/Line", + "LineLoop": "api/ar/objects/LineLoop", + "LineSegments": "api/ar/objects/LineSegments", + "LOD": "api/ar/objects/LOD", + "Mesh": "api/ar/objects/Mesh", + "Points": "api/ar/objects/Points", + "Skeleton": "api/ar/objects/Skeleton", + "SkinnedMesh": "api/ar/objects/SkinnedMesh", + "Sprite": "api/ar/objects/Sprite" + }, + + "Renderers": { + "WebGLMultipleRenderTargets": "api/ar/renderers/WebGLMultipleRenderTargets", + "WebGLRenderer": "api/ar/renderers/WebGLRenderer", + "WebGL1Renderer": "api/ar/renderers/WebGL1Renderer", + "WebGLRenderTarget": "api/ar/renderers/WebGLRenderTarget", + "WebGL3DRenderTarget": "api/ar/renderers/WebGL3DRenderTarget", + "WebGLArrayRenderTarget": "api/ar/renderers/WebGLArrayRenderTarget", + "WebGLCubeRenderTarget": "api/ar/renderers/WebGLCubeRenderTarget" + }, + + "Renderers / Shaders": { + "ShaderChunk": "api/ar/renderers/shaders/ShaderChunk", + "ShaderLib": "api/ar/renderers/shaders/ShaderLib", + "UniformsLib": "api/ar/renderers/shaders/UniformsLib", + "UniformsUtils": "api/ar/renderers/shaders/UniformsUtils" + }, + + "Renderers / WebXR": { + "WebXRManager": "api/ar/renderers/webxr/WebXRManager" + }, + + "Scenes": { + "Fog": "api/ar/scenes/Fog", + "FogExp2": "api/ar/scenes/FogExp2", + "Scene": "api/ar/scenes/Scene" } } @@ -2094,7 +2246,6 @@ }, "Exporters": { - "ColladaExporter": "examples/en/exporters/ColladaExporter", "EXRExporter": "examples/en/exporters/EXRExporter", "GLTFExporter": "examples/en/exporters/GLTFExporter", "OBJExporter": "examples/en/exporters/OBJExporter", diff --git a/docs/manual/ar/introduction/Installation.html b/docs/manual/ar/introduction/Installation.html index 9fbf8a889a8eb0..6242620bb6d6bd 100644 --- a/docs/manual/ar/introduction/Installation.html +++ b/docs/manual/ar/introduction/Installation.html @@ -85,7 +85,7 @@

    التثبيت من CDN أو استضافة ثابتة

    - <script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script> + <script async src="https://unpkg.com/es-module-shims@1.8.0/dist/es-module-shims.js"></script> <script type="importmap"> { @@ -126,7 +126,7 @@

    أمثلة

    - <script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script> + <script async src="https://unpkg.com/es-module-shims@1.8.0/dist/es-module-shims.js"></script> <script type="importmap"> { diff --git a/docs/manual/en/introduction/Color-management.html b/docs/manual/en/introduction/Color-management.html index a6ba8095d431a7..72f158e625bbc9 100644 --- a/docs/manual/en/introduction/Color-management.html +++ b/docs/manual/en/introduction/Color-management.html @@ -244,7 +244,7 @@

    Output color space

    Custom materials based on [page:ShaderMaterial] and [page:RawShaderMaterial] have to implement their own output color space conversion. - For instances of `ShaderMaterial`, adding the `encodings_fragment` shader chunk to the fragment shader's `main()` function should be sufficient. + For instances of `ShaderMaterial`, adding the `colorspace_fragment` shader chunk to the fragment shader's `main()` function should be sufficient.

    Working with THREE.Color instances

    diff --git a/docs/manual/en/introduction/How-to-dispose-of-objects.html b/docs/manual/en/introduction/How-to-dispose-of-objects.html index 287bed80b91f15..4edcf1ece0afae 100644 --- a/docs/manual/en/introduction/How-to-dispose-of-objects.html +++ b/docs/manual/en/introduction/How-to-dispose-of-objects.html @@ -99,8 +99,10 @@

    What happens when you call `dispose()` on a texture but the image is not loa

    What happens when I call `dispose()` and then use the respective object at a later point?

    - The deleted internal resources will be created again by the engine. So no runtime error will occur but you might notice a negative performance impact for the current frame, - especially when shader programs have to be compiled. + That depends. For geometries, materials, textures, render targets and post processing passes the deleted internal resources can be created again by the engine. + So no runtime error will occur but you might notice a negative performance impact for the current frame, especially when shader programs have to be compiled. + + Controls and renderers are an exception. Instances of these classes can not be used after `dispose()` has been called. You have to create new instances in this case.

    How should I manage *three.js* objects in my app? When do I know how to dispose things?

    diff --git a/docs/manual/en/introduction/How-to-use-post-processing.html b/docs/manual/en/introduction/How-to-use-post-processing.html index 31bb893b4d9546..0b0e0a917f919e 100644 --- a/docs/manual/en/introduction/How-to-use-post-processing.html +++ b/docs/manual/en/introduction/How-to-use-post-processing.html @@ -31,6 +31,7 @@

    Workflow

    import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; import { GlitchPass } from 'three/addons/postprocessing/GlitchPass.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';

    @@ -59,8 +60,8 @@

    Workflow

    Our composer is now ready so it's possible to configure the chain of post-processing passes. These passes are responsible for creating the final visual output of the application. They are processed in order of their addition/insertion. In our example, the instance of `RenderPass` - is executed first and then the instance of `GlitchPass`. The last enabled pass in the chain is automatically rendered to the screen. The setup - of the passes looks like so: + is executed first, then the instance of `GlitchPass` and finally `OutputPass`. The last enabled pass in the chain is automatically rendered to the screen. + The setup of the passes looks like so:

    @@ -69,12 +70,15 @@

    Workflow

    const glitchPass = new GlitchPass(); composer.addPass( glitchPass ); + + const outputPass = new OutputPass(); + composer.addPass( outputPass );

    `RenderPass` is normally placed at the beginning of the chain in order to provide the rendered scene as an input for the next post-processing step. In our case, - `GlitchPass` is going to use these image data to apply a wild glitch effect. Check out this [link:https://threejs.org/examples/webgl_postprocessing_glitch live example] - to see it in action. + `GlitchPass` is going to use these image data to apply a wild glitch effect. `OutputPass` is usually the last pass in the chain which performs sRGB color space conversion and optional tone mapping. + Check out this [link:https://threejs.org/examples/webgl_postprocessing_glitch live example] to see it in action.

    Built-in Passes

    diff --git a/docs/manual/en/introduction/Installation.html b/docs/manual/en/introduction/Installation.html index 1d2feaf0b51ba6..5fc04f5a8c5a18 100644 --- a/docs/manual/en/introduction/Installation.html +++ b/docs/manual/en/introduction/Installation.html @@ -149,7 +149,7 @@

    Development

    We imported code from 'three' (an npm package) in main.js, and web browsers don't know what that means. In index.html we'll need to add an [link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap import map] defining where to get the package. Put the code below inside the <head></head> tag, after the styles.

    -<script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script> +<script async src="https://unpkg.com/es-module-shims@1.8.0/dist/es-module-shims.js"></script> <script type="importmap"> { diff --git a/docs/manual/fr/introduction/Color-management.html b/docs/manual/fr/introduction/Color-management.html index eb4baf4b293be2..8ade640aa54749 100644 --- a/docs/manual/fr/introduction/Color-management.html +++ b/docs/manual/fr/introduction/Color-management.html @@ -244,7 +244,7 @@

    L'espace colorimétrique de sortie

    Custom materials based on [page:ShaderMaterial] and [page:RawShaderMaterial] have to implement their own output color space conversion. - For instances of `ShaderMaterial`, adding the `encodings_fragment` shader chunk to the fragment shader's `main()` function should be sufficient. + For instances of `ShaderMaterial`, adding the `colorspace_fragment` shader chunk to the fragment shader's `main()` function should be sufficient.

    Utiliser des instances de THREE.Color

    diff --git a/docs/manual/fr/introduction/How-to-use-post-processing.html b/docs/manual/fr/introduction/How-to-use-post-processing.html index e6619029e8b289..1e5c9254668eea 100644 --- a/docs/manual/fr/introduction/How-to-use-post-processing.html +++ b/docs/manual/fr/introduction/How-to-use-post-processing.html @@ -31,6 +31,7 @@

    Workflow

    import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; import { GlitchPass } from 'three/addons/postprocessing/GlitchPass.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';

    @@ -58,8 +59,8 @@

    Workflow

    Notre composer est maintenant prêt, il est donc possible de configurer la chaîne d'effets de post-processing. Ces effets (passes) sont chargés de la création - de l'apparence visuelle finale de l'application. Ils sont traités dans l'ordre de leur ajout/insertion. Dans notre example, l'instance de `RenderPass` - est exécutée en première, puis l'instance de `GlitchPass` est exécutée. Le dernier effet activé de la chaîne est automatiquement rendu dans la scène. Le setup + de l'apparence visuelle finale de l'application. Ils sont traités dans l'ordre de leur ajout/insertion. In our example, the instance of `RenderPass` + is executed first, then the instance of `GlitchPass` and finally `OutputPass`. Le dernier effet activé de la chaîne est automatiquement rendu dans la scène. Le setup des effets ressemble à ça:

    @@ -69,12 +70,15 @@

    Workflow

    const glitchPass = new GlitchPass(); composer.addPass( glitchPass ); + + const outputPass = new OutputPass(); + composer.addPass( outputPass );

    `RenderPass` est normalement placé au début de la chaîne pour fournir la scène rendue en tant qu'entrée pour les prochaines étapes de post-processing. Dans notre cas, - `GlitchPass` va utiliser les données de l'image pour appliquer un effet de glitch. Regardez cet [link:https://threejs.org/examples/webgl_postprocessing_glitch exemple live] - pour voir cela en action. + `GlitchPass` va utiliser les données de l'image pour appliquer un effet de glitch. `OutputPass` is usually the last pass in the chain which performs sRGB color space conversion and optional tone mapping. + Regardez cet [link:https://threejs.org/examples/webgl_postprocessing_glitch exemple live] pour voir cela en action.

    Effets Intégrés

    diff --git a/docs/manual/fr/introduction/Installation.html b/docs/manual/fr/introduction/Installation.html index 9796ba6943e428..eeae067ea7fc5a 100644 --- a/docs/manual/fr/introduction/Installation.html +++ b/docs/manual/fr/introduction/Installation.html @@ -68,7 +68,7 @@

    Installer depuis un CDN ou un hébergement statique

    - <script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script> + <script async src="https://unpkg.com/es-module-shims@1.8.0/dist/es-module-shims.js"></script> <script type="importmap"> { @@ -113,7 +113,7 @@

    Addons

    - <script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script> + <script async src="https://unpkg.com/es-module-shims@1.8.0/dist/es-module-shims.js"></script> <script type="importmap"> { diff --git a/docs/manual/it/introduction/Color-management.html b/docs/manual/it/introduction/Color-management.html index b110a1b2891491..649265a9610054 100644 --- a/docs/manual/it/introduction/Color-management.html +++ b/docs/manual/it/introduction/Color-management.html @@ -299,7 +299,7 @@

    Output color space

    Custom materials based on [page:ShaderMaterial] and [page:RawShaderMaterial] have to implement their own output color space conversion. - For instances of `ShaderMaterial`, adding the `encodings_fragment` shader chunk to the fragment shader's `main()` function should be sufficient. + For instances of `ShaderMaterial`, adding the `colorspace_fragment` shader chunk to the fragment shader's `main()` function should be sufficient.

    Lavorare con le istanze di THREE.Color

    diff --git a/docs/manual/it/introduction/How-to-use-post-processing.html b/docs/manual/it/introduction/How-to-use-post-processing.html index 60b3a0d0c0a69c..5ce994a34f4e42 100644 --- a/docs/manual/it/introduction/How-to-use-post-processing.html +++ b/docs/manual/it/introduction/How-to-use-post-processing.html @@ -32,6 +32,7 @@

    Workflow

    import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; import { GlitchPass } from 'three/addons/postprocessing/GlitchPass.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';

    @@ -59,8 +60,8 @@

    Workflow

    Il composer è pronto, ed è possibile configurare la catena di passaggi di post-processing. Questi passaggi sono i responsabili per la creazione - dell'output visivo finale dell'applicazione. Vengono elaborati nello stesso ordine in cui sono stati aggiunti/inseriti. Nel nostro esempio, l'istanza - di `RenderPass` viene eseguita per prima, poi l'istanza di `GlitchPass`. L'ultimo passaggio abilitato della catena viene automaticamente renderizzato sullo schermo. + dell'output visivo finale dell'applicazione. Vengono elaborati nello stesso ordine in cui sono stati aggiunti/inseriti. In our example, the instance of `RenderPass` + is executed first, then the instance of `GlitchPass` and finally `OutputPass`. L'ultimo passaggio abilitato della catena viene automaticamente renderizzato sullo schermo. La configurazione dei passaggi è la seguente:

    @@ -70,12 +71,15 @@

    Workflow

    const glitchPass = new GlitchPass(); composer.addPass( glitchPass ); + + const outputPass = new OutputPass(); + composer.addPass( outputPass );

    `RenderPass` viene normalmente posizionata all'inizio della catena per fornire la scena renderizzata come input per il passaggio successivo di post-processing. - Nel nostro caso `GlitchPass` utilizzarà questi dati di immagine per applicare un effetto glitch selvaggio. Guarda questo [link:https://threejs.org/examples/webgl_postprocessing_glitch esempio live] - per vederli in azione. + Nel nostro caso `GlitchPass` utilizzarà questi dati di immagine per applicare un effetto glitch selvaggio. `OutputPass` is usually the last pass in the chain which performs sRGB color space conversion and optional tone mapping. + Guarda questo [link:https://threejs.org/examples/webgl_postprocessing_glitch esempio live] per vederli in azione.

    Passi Built-in

    diff --git a/docs/manual/it/introduction/Installation.html b/docs/manual/it/introduction/Installation.html index 6c3c457b5a2ac2..4a7ec3b7445c7c 100644 --- a/docs/manual/it/introduction/Installation.html +++ b/docs/manual/it/introduction/Installation.html @@ -69,7 +69,7 @@

    Installazione da CDN o hosting statico

    - <script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script> + <script async src="https://unpkg.com/es-module-shims@1.8.0/dist/es-module-shims.js"></script> <script type="importmap"> { @@ -113,7 +113,7 @@

    Addons

    - <script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script> + <script async src="https://unpkg.com/es-module-shims@1.8.0/dist/es-module-shims.js"></script> <script type="importmap"> { diff --git a/docs/manual/ja/introduction/How-to-use-post-processing.html b/docs/manual/ja/introduction/How-to-use-post-processing.html index fd311f4afae066..7d126119c34cb3 100644 --- a/docs/manual/ja/introduction/How-to-use-post-processing.html +++ b/docs/manual/ja/introduction/How-to-use-post-processing.html @@ -33,6 +33,7 @@

    Workflow

    import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; import { GlitchPass } from 'three/addons/postprocessing/GlitchPass.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';

    @@ -61,8 +62,8 @@

    Workflow

    composerが準備できたので、post-processingパスのチェーンを設定できるようになりました。 これらのパスはアプリケーションの最終的なビジュアルを出力することに責任を持ちます。 - これらのパスは追加/挿入の順番で処理されます。今回示している例では、*RenderPass*インスタンスがはじめに実行され、 - それから*GlitchPass*インスタンスが実行されます。チェーンの中で最後の有効なpassが自動的に画面に描画されます。 + これらのパスは追加/挿入の順番で処理されます。In our example, the instance of `RenderPass` + is executed first, then the instance of `GlitchPass` and finally `OutputPass`。チェーンの中で最後の有効なpassが自動的に画面に描画されます。 passの設定は以下のように行います。

    @@ -72,12 +73,16 @@

    Workflow

    const glitchPass = new GlitchPass(); composer.addPass( glitchPass ); -
    + + const outputPass = new OutputPass(); + composer.addPass( outputPass ); +

    *RenderPass*は普通チェインのはじめにあります。 これはレンダリングされたシーンを次のpost-processingの入力とするためです。 *GlitchPass*は、これらのイメージをワイルドなglitch effectを適用するために使います。 + `OutputPass` is usually the last pass in the chain which performs sRGB color space conversion and optional tone mapping. 実際に動いているものを見るために、[link:https://threejs.org/examples/webgl_postprocessing_glitch sample]を見てみましょう。

    diff --git a/docs/manual/ja/introduction/Installation.html b/docs/manual/ja/introduction/Installation.html index 16654b7029c133..6bb9ff5c48c8d5 100644 --- a/docs/manual/ja/introduction/Installation.html +++ b/docs/manual/ja/introduction/Installation.html @@ -69,7 +69,7 @@

    CDNや静的ホスティングからインストールをする

    -<script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script> +<script async src="https://unpkg.com/es-module-shims@1.8.0/dist/es-module-shims.js"></script> <script type="importmap"> { @@ -110,7 +110,7 @@

    Addons

    -<script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script> +<script async src="https://unpkg.com/es-module-shims@1.8.0/dist/es-module-shims.js"></script> <script type="importmap"> { diff --git a/docs/manual/ko/introduction/How-to-use-post-processing.html b/docs/manual/ko/introduction/How-to-use-post-processing.html index 6dce9e4b086378..e2a79138c0a493 100644 --- a/docs/manual/ko/introduction/How-to-use-post-processing.html +++ b/docs/manual/ko/introduction/How-to-use-post-processing.html @@ -31,6 +31,7 @@

    작업 절차

    import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; import { GlitchPass } from 'three/addons/postprocessing/GlitchPass.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';

    @@ -59,7 +60,7 @@

    작업 절차

    composer는 이제 준비가 다 되었으니, 후처리 과정 연결을 설정할 수 있습니다. 이러한 과정은 앱을 만드는 최종 화면 출력을 담당하며, 첨부/삽입한 순서대로 처리합니다. - 이 예제에서 먼저 실행한 것은 *RenderPass* 인스턴스이고 그 다음이 *GlitchPass* 입니다. + In our example, the instance of `RenderPass` is executed first, then the instance of `GlitchPass` and finally `OutputPass`. 마지막 과정이 끝나면 자동으로 화면에 렌더링됩니다. 패스 설정은 아래와 같습니다.

    @@ -69,12 +70,16 @@

    작업 절차

    const glitchPass = new GlitchPass(); composer.addPass( glitchPass ); + + const outputPass = new OutputPass(); + composer.addPass( outputPass );

    - *RenderPass*는 일반적으로 맨 위에 위치해서 렌더링된 장면을 후처리의 기본 입력 장면으로 활용합니다. 예제의 경우, - *GlitchPass*는 이 이미지 데이터에 거친 글리치 효과를 넣어줍니다. [link:https://threejs.org/examples/webgl_postprocessing_glitch live example]에서 작동을 - 확인해보세요. + *RenderPass*는 일반적으로 맨 위에 위치해서 렌더링된 장면을 후처리의 기본 입력 장면으로 활용합니다. 예제의 경우, + *GlitchPass*는 이 이미지 데이터에 거친 글리치 효과를 넣어줍니다. + `OutputPass` is usually the last pass in the chain which performs sRGB color space conversion and optional tone mapping. + [link:https://threejs.org/examples/webgl_postprocessing_glitch live example]에서 작동을 확인해보세요.

    기본 내장 후처리방식

    diff --git a/docs/manual/ko/introduction/Installation.html b/docs/manual/ko/introduction/Installation.html index 023627d39e950d..a54cad2fddc274 100644 --- a/docs/manual/ko/introduction/Installation.html +++ b/docs/manual/ko/introduction/Installation.html @@ -77,7 +77,7 @@

    static hosting 및 CDN을 통한 설치

    -<script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script> +<script async src="https://unpkg.com/es-module-shims@1.8.0/dist/es-module-shims.js"></script> <script type="importmap"> { @@ -122,7 +122,7 @@

    Addons

    -<script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script> +<script async src="https://unpkg.com/es-module-shims@1.8.0/dist/es-module-shims.js"></script> <script type="importmap"> { diff --git a/docs/manual/pt-br/introduction/Color-management.html b/docs/manual/pt-br/introduction/Color-management.html index 01cd9526a48cda..290019f857731a 100644 --- a/docs/manual/pt-br/introduction/Color-management.html +++ b/docs/manual/pt-br/introduction/Color-management.html @@ -245,7 +245,7 @@

    Output do espaço de cores

    Custom materials based on [page:ShaderMaterial] and [page:RawShaderMaterial] have to implement their own output color space conversion. - For instances of `ShaderMaterial`, adding the `encodings_fragment` shader chunk to the fragment shader's `main()` function should be sufficient. + For instances of `ShaderMaterial`, adding the `colorspace_fragment` shader chunk to the fragment shader's `main()` function should be sufficient.

    Trabalhando com instâncias THREE.Color

    diff --git a/docs/manual/pt-br/introduction/How-to-use-post-processing.html b/docs/manual/pt-br/introduction/How-to-use-post-processing.html index b91a9c9ab42fd5..210eca4af3cb52 100644 --- a/docs/manual/pt-br/introduction/How-to-use-post-processing.html +++ b/docs/manual/pt-br/introduction/How-to-use-post-processing.html @@ -31,6 +31,7 @@

    Workflow

    import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; import { GlitchPass } from 'three/addons/postprocessing/GlitchPass.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';

    @@ -58,8 +59,8 @@

    Workflow

    Nosso composer já está pronto para que seja possível configurar a cadeia de passos de pós-processamento. Esses passos são responsáveis ​​por criar - a saída visual final do aplicativo. Eles são processados ​​na ordem de sua adição/inserção. Em nosso exemplo, a instância de `RenderPass` - é executada primeiro e depois a instância de `GlitchPass`. A última passagem habilitada na cadeia é renderizada automaticamente na tela. A configuração + a saída visual final do aplicativo. Eles são processados ​​na ordem de sua adição/inserção. In our example, the instance of `RenderPass` + is executed first, then the instance of `GlitchPass` and finally `OutputPass`. A última passagem habilitada na cadeia é renderizada automaticamente na tela. A configuração dos passos fica assim:

    @@ -69,12 +70,16 @@

    Workflow

    const glitchPass = new GlitchPass(); composer.addPass( glitchPass ); + + const outputPass = new OutputPass(); + composer.addPass( outputPass );

    - O `RenderPass` é normalmente colocado no início da cadeia para fornecer a cena renderizada como entrada para a próxima etapa de pós-processamento. No nosso caso, - o `GlitchPass` usará esses dados de imagem para aplicar um efeito de glitch selvagem. Confira este [link:https://threejs.org/examples/webgl_postprocessing_glitch exemplo] - para vê-lo em ação. + O `RenderPass` é normalmente colocado no início da cadeia para fornecer a cena renderizada como entrada para a próxima etapa de pós-processamento. + No nosso caso, o `GlitchPass` usará esses dados de imagem para aplicar um efeito de glitch selvagem. + `OutputPass` is usually the last pass in the chain which performs sRGB color space conversion and optional tone mapping. + Confira este [link:https://threejs.org/examples/webgl_postprocessing_glitch exemplo] para vê-lo em ação.

    Passes integrados

    diff --git a/docs/manual/pt-br/introduction/Installation.html b/docs/manual/pt-br/introduction/Installation.html index f5548c24daa31a..92e0152e55f02d 100644 --- a/docs/manual/pt-br/introduction/Installation.html +++ b/docs/manual/pt-br/introduction/Installation.html @@ -53,7 +53,7 @@

    Instalar através de CDN ou hospedagem estática

    A biblioteca three.js pode ser utilizada sem nenhum sistema de build, seja fazendo o upload dos arquivos para seu próprio servidor web ou usando um CDN existente. Como a biblioteca depende dos ES modules, qualquer script que faça referência a eles deve usar type="module" como mostrado abaixo. Também é necessário definir um mapa de importação que resolva a importação direta do `three`.

    - <script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script> + <script async src="https://unpkg.com/es-module-shims@1.8.0/dist/es-module-shims.js"></script> <script type="importmap"> { @@ -99,7 +99,7 @@

    Addons

    Se o three.js foi instalado de um CDN, use o mesmo CDN para instalar outros componentes:

    - <script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script> + <script async src="https://unpkg.com/es-module-shims@1.8.0/dist/es-module-shims.js"></script> <script type="importmap"> { diff --git a/docs/manual/ru/introduction/Installation.html b/docs/manual/ru/introduction/Installation.html index 663783a29fc8b2..11594309d66908 100644 --- a/docs/manual/ru/introduction/Installation.html +++ b/docs/manual/ru/introduction/Installation.html @@ -92,7 +92,7 @@

    Установка с CDN или статического хостинга - <script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script> + <script async src="https://unpkg.com/es-module-shims@1.8.0/dist/es-module-shims.js"></script> <script type="importmap"> { @@ -143,7 +143,7 @@

    Дополнения

    - <script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script> + <script async src="https://unpkg.com/es-module-shims@1.8.0/dist/es-module-shims.js"></script> <script type="importmap"> { diff --git a/docs/manual/zh/introduction/How-to-use-post-processing.html b/docs/manual/zh/introduction/How-to-use-post-processing.html index 5007e574870c5d..9e31f999b66655 100644 --- a/docs/manual/zh/introduction/How-to-use-post-processing.html +++ b/docs/manual/zh/introduction/How-to-use-post-processing.html @@ -31,6 +31,7 @@

    工作流程

    import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; import { GlitchPass } from 'three/addons/postprocessing/GlitchPass.js'; + import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';

    @@ -59,7 +60,7 @@

    工作流程

    我们的合成器已经准备好了,现在我们就可以来配置后期处理过程链了。 这些过程负责创建应用程序的最终视觉输出,它们按照添加/插入的顺序来进行处理。 - 在我们的示例中,首先执行的是*RenderPass*实例,然后是*GlitchPass*。在链中的最后一个过程将自动被渲染到屏幕上。 + In our example, the instance of `RenderPass` is executed first, then the instance of `GlitchPass` and finally `OutputPass`。 这些过程的设置类似这样:

    @@ -69,12 +70,16 @@

    工作流程

    const glitchPass = new GlitchPass(); composer.addPass( glitchPass ); + + const outputPass = new OutputPass(); + composer.addPass( outputPass );

    *RenderPass*通常位于过程链的开始,以便将渲染好的场景作为输入来提供给下一个后期处理步骤。 - 在我们的示例中,*GlitchPass*将会使用这些图像数据,来应用一个疯狂的故障效果。参见这个示例: - [link:https://threejs.org/examples/webgl_postprocessing_glitch live example]来看一看它的实际效果。 + 在我们的示例中,*GlitchPass*将会使用这些图像数据,来应用一个疯狂的故障效果。 + `OutputPass` is usually the last pass in the chain which performs sRGB color space conversion and optional tone mapping. + 参见这个示例:[link:https://threejs.org/examples/webgl_postprocessing_glitch live example]来看一看它的实际效果。

    内置过程

    diff --git a/docs/manual/zh/introduction/Installation.html b/docs/manual/zh/introduction/Installation.html index ca8829aee1623b..15dfb7ab772904 100644 --- a/docs/manual/zh/introduction/Installation.html +++ b/docs/manual/zh/introduction/Installation.html @@ -67,7 +67,7 @@

    从CDN或静态主机安装

    - <script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script> + <script async src="https://unpkg.com/es-module-shims@1.8.0/dist/es-module-shims.js"></script> <script type="importmap"> { @@ -108,7 +108,7 @@

    Addons

    - <script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script> + <script async src="https://unpkg.com/es-module-shims@1.8.0/dist/es-module-shims.js"></script> <script type="importmap"> { diff --git a/docs/page.js b/docs/page.js index a8ee9c3d0714e4..553603ea0670da 100644 --- a/docs/page.js +++ b/docs/page.js @@ -67,7 +67,7 @@ function onDocumentLoad() { text = text.replace( /\[link:([\w\:\/\.\-\_\(\)\?\#\=\!\~]+)\]/gi, '$1' ); // [link:url] text = text.replace( /\[link:([\w:/.\-_()?#=!~]+) ([\w\p{L}:/.\-_'\s]+)\]/giu, '$2' ); // [link:url title] text = text.replace( /\*([\u4e00-\u9fa5\w\d\-\(\"\(\“][\u4e00-\u9fa5\w\d\ \/\+\-\(\)\=\,\.\(\)\,\。"]*[\u4e00-\u9fa5\w\d\"\)\”\)]|\w)\*/gi, '$1' ); // *text* - text = text.replace( /\`(.*?)\`/gi, '$1' ); // `code` + text = text.replace( /\`(.*?)\`/gs, '$1' ); // `code` text = text.replace( /\[example:([\w\_]+)\]/gi, '[example:$1 $1]' ); // [example:name] to [example:name title] text = text.replace( /\[example:([\w\_]+) ([\w\:\/\.\-\_ \s]+)\]/gi, '$2' ); // [example:name title] @@ -106,16 +106,32 @@ function onDocumentLoad() { // handle code snippets formatting + function dedent( text ) { + + // ignores singleline text + const lines = text.split( '\n' ); + if ( lines.length <= 1 ) return text; + + // ignores blank text + const nonBlankLine = lines.filter( l => l.trim() )[ 0 ]; + if ( nonBlankLine === undefined ) return text; + + // strips indents if any + const m = nonBlankLine.match( /^([\t ]+)/ ); + if ( m ) text = lines.map( l => l.startsWith( m[ 1 ] ) ? l.substring( m[ 1 ].length ) : l ).join( '\n' ); + + // strips leading and trailing whitespaces finally + return text.trim(); + + } + const elements = document.getElementsByTagName( 'code' ); for ( let i = 0; i < elements.length; i ++ ) { const element = elements[ i ]; - text = element.textContent.trim(); - text = text.replace( /^\t\t/gm, '' ); - - element.textContent = text; + element.textContent = dedent( element.textContent ); } diff --git a/docs/scenes/bones-browser.html b/docs/scenes/bones-browser.html index cac044ee1e3147..c8a50cfb785c48 100644 --- a/docs/scenes/bones-browser.html +++ b/docs/scenes/bones-browser.html @@ -25,7 +25,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -74,10 +74,10 @@ scene.background = new THREE.Color( 0xfce4ec ); // lights - const ambient = new THREE.HemisphereLight( 0xffffff, 0xbfd4d2, 0.9 ); + const ambient = new THREE.HemisphereLight( 0xffffff, 0xbfd4d2, 3 ); scene.add( ambient ); - const directionalLight = new THREE.DirectionalLight( 0xffffff, 0.1 ); + const directionalLight = new THREE.DirectionalLight( 0xffffff, 0.3 ); directionalLight.position.set( 1, 4, 3 ).multiplyScalar( 3 ); directionalLight.castShadow = true; directionalLight.shadow.mapSize.setScalar( 2048 ); diff --git a/examples/webgl_geometry_cube.html b/examples/webgl_geometry_cube.html index 7f3b9108282fd4..9df8b0da366e1e 100644 --- a/examples/webgl_geometry_cube.html +++ b/examples/webgl_geometry_cube.html @@ -10,7 +10,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/webgl_loader_pcd.html b/examples/webgl_loader_pcd.html index e889664f1ee549..8ee9b2ee01b41c 100644 --- a/examples/webgl_loader_pcd.html +++ b/examples/webgl_loader_pcd.html @@ -14,7 +14,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/webgl_materials_blending.html b/examples/webgl_materials_blending.html index c64b51f5bda708..4dc7682ae18bfc 100644 --- a/examples/webgl_materials_blending.html +++ b/examples/webgl_materials_blending.html @@ -10,7 +10,7 @@ - + + + + + + + + + + + + + + + + diff --git a/examples/webgl_materials_curvature.html b/examples/webgl_materials_curvature.html index 897a52e2eb32ac..fcc6378d54bde1 100644 --- a/examples/webgl_materials_curvature.html +++ b/examples/webgl_materials_curvature.html @@ -44,7 +44,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -90,7 +90,7 @@ scene = new THREE.Scene(); scene.background = new THREE.Color( 0xeeeeee ); - const ambient = new THREE.HemisphereLight( 0xffffff, 0x999999 ); + const ambient = new THREE.HemisphereLight( 0xffffff, 0x999999, 3 ); scene.add( ambient ); // renderer diff --git a/examples/webgl_raycaster_sprite.html b/examples/webgl_raycaster_sprite.html index 24fdfafbbaf3c5..6dd69f307433fa 100644 --- a/examples/webgl_raycaster_sprite.html +++ b/examples/webgl_raycaster_sprite.html @@ -20,7 +20,7 @@ - + + + + + + diff --git a/examples/webgl_rtt.html b/examples/webgl_rtt.html index 1254247ddf0caa..74d6650c6419fd 100644 --- a/examples/webgl_rtt.html +++ b/examples/webgl_rtt.html @@ -19,7 +19,7 @@ void main() { gl_FragColor = texture2D( tDiffuse, vUv ); - #include + #include } @@ -58,7 +58,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/webgpu_clearcoat.html b/examples/webgpu_clearcoat.html new file mode 100644 index 00000000000000..89d3916b61ae0b --- /dev/null +++ b/examples/webgpu_clearcoat.html @@ -0,0 +1,263 @@ + + + + three.js webgpu - materials - clearcoat + + + + + +
    + three.js webgpu - clearcoat +
    + + + + + + + + + + \ No newline at end of file diff --git a/examples/webgpu_compute.html b/examples/webgpu_compute.html index 90cd3b3260f8de..b2b38a93facb51 100644 --- a/examples/webgpu_compute.html +++ b/examples/webgpu_compute.html @@ -11,7 +11,7 @@ three.js WebGPU - Compute - + + + + + + + diff --git a/examples/webgpu_compute_texture.html b/examples/webgpu_compute_texture.html new file mode 100644 index 00000000000000..b0b717fcca018b --- /dev/null +++ b/examples/webgpu_compute_texture.html @@ -0,0 +1,136 @@ + + + three.js - WebGPU - Compute Texture + + + + + + +
    + three.js WebGPU - Compute Texture +
    Texture generated using GPU Compute. +
    + + + + + + + + diff --git a/examples/webgpu_cubemap_adjustments.html b/examples/webgpu_cubemap_adjustments.html index 4eb25f13860880..e6c0f195aeae79 100644 --- a/examples/webgpu_cubemap_adjustments.html +++ b/examples/webgpu_cubemap_adjustments.html @@ -16,7 +16,7 @@ - + + + + + + + + \ No newline at end of file diff --git a/examples/webgpu_cubemap_mix.html b/examples/webgpu_cubemap_mix.html index 657c1318798117..575b7343a10bac 100644 --- a/examples/webgpu_cubemap_mix.html +++ b/examples/webgpu_cubemap_mix.html @@ -16,7 +16,7 @@ - + + + + + + + + + + + + + + + + + + diff --git a/examples/webgpu_loader_gltf_sheen.html b/examples/webgpu_loader_gltf_sheen.html new file mode 100644 index 00000000000000..944caf35b8c173 --- /dev/null +++ b/examples/webgpu_loader_gltf_sheen.html @@ -0,0 +1,150 @@ + + + + three.js webgpu - sheen + + + + + + + +
    + three.js - GLTFLoader + KHR_materials_sheen
    + Sheen Chair from glTF-Sample-Models +
    + + + + + + + + + + + diff --git a/examples/webgpu_materials.html b/examples/webgpu_materials.html index 942d393f39c542..ce6da4edcf4655 100644 --- a/examples/webgpu_materials.html +++ b/examples/webgpu_materials.html @@ -12,7 +12,7 @@ three.js WebGPU - Materials - + + + + + + + + + diff --git a/examples/webgpu_multiple_rendertargets.html b/examples/webgpu_multiple_rendertargets.html new file mode 100644 index 00000000000000..a78c86d5009f4c --- /dev/null +++ b/examples/webgpu_multiple_rendertargets.html @@ -0,0 +1,221 @@ + + + + three.js webgpu - Multiple Render Targets + + + + + +
    + threejs webgpu - Multiple RenderTargets +
    + + + + + + + + + + + diff --git a/examples/webgpu_occlusion.html b/examples/webgpu_occlusion.html new file mode 100644 index 00000000000000..c1118eee45735e --- /dev/null +++ b/examples/webgpu_occlusion.html @@ -0,0 +1,153 @@ + + + + three.js - WebGPU - Occlusion + + + + + + +
    + three.js - WebGPU - Occlusion
    + The plane changes color if the sphere behind it is rendered +
    + + + + + + + + diff --git a/examples/webgpu_particles.html b/examples/webgpu_particles.html index d1fbb41adfc21c..66f3eec02ad821 100644 --- a/examples/webgpu_particles.html +++ b/examples/webgpu_particles.html @@ -11,7 +11,7 @@ three.js WebGPU - Particles - + + + + + + + + + + + + + + + + diff --git a/examples/webgpu_video_panorama.html b/examples/webgpu_video_panorama.html new file mode 100644 index 00000000000000..18a73a82ecaf9d --- /dev/null +++ b/examples/webgpu_video_panorama.html @@ -0,0 +1,169 @@ + + + + three.js webgpu - video panorama + + + + + + +
    + three.js - video panorama +
    + +
    + + + + + + + + + + + + diff --git a/examples/webxr_ar_cones.html b/examples/webxr_ar_cones.html index b063f31dbacb7f..a68a5a521f653a 100644 --- a/examples/webxr_ar_cones.html +++ b/examples/webxr_ar_cones.html @@ -14,7 +14,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/manual/en/debugging-glsl.html b/manual/en/debugging-glsl.html index 7500b0262437bb..f1bef4ed95498d 100644 --- a/manual/en/debugging-glsl.html +++ b/manual/en/debugging-glsl.html @@ -13,7 +13,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/manual/examples/align-html-elements-to-3d-globe-too-many-labels.html b/manual/examples/align-html-elements-to-3d-globe-too-many-labels.html index 3851074e776da6..581846e70888d6 100644 --- a/manual/examples/align-html-elements-to-3d-globe-too-many-labels.html +++ b/manual/examples/align-html-elements-to-3d-globe-too-many-labels.html @@ -60,7 +60,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - diff --git a/manual/examples/custom-geometry-cube-face-normals.html b/manual/examples/custom-geometry-cube-face-normals.html deleted file mode 100644 index d56d6b82ba5f4d..00000000000000 --- a/manual/examples/custom-geometry-cube-face-normals.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - Three.js - Custom Geometry - Cube - face normals - - - - - - - - - - - - - - diff --git a/manual/examples/custom-geometry-cube-texcoords.html b/manual/examples/custom-geometry-cube-texcoords.html deleted file mode 100644 index 7340127487c95d..00000000000000 --- a/manual/examples/custom-geometry-cube-texcoords.html +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - - Three.js - Custom Geometry - Cube - Texture Coordinates - - - - - - - - - - - - - - diff --git a/manual/examples/custom-geometry-cube-vertex-colors.html b/manual/examples/custom-geometry-cube-vertex-colors.html deleted file mode 100644 index 447d6123bfdc10..00000000000000 --- a/manual/examples/custom-geometry-cube-vertex-colors.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - Three.js - Custom Geometry - Cube - Vertex Colors - - - - - - - - - - - - - - diff --git a/manual/examples/custom-geometry-cube-vertex-normals.html b/manual/examples/custom-geometry-cube-vertex-normals.html deleted file mode 100644 index 422fe5a9233bc5..00000000000000 --- a/manual/examples/custom-geometry-cube-vertex-normals.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - Three.js - Custom Geometry - Cube - Vertex Normals - - - - - - - - - - - - - - diff --git a/manual/examples/custom-geometry-cube.html b/manual/examples/custom-geometry-cube.html deleted file mode 100644 index 7ea446946a2861..00000000000000 --- a/manual/examples/custom-geometry-cube.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - Three.js - Custom Geometry - Cube - - - - - - - - - - - - - - diff --git a/manual/examples/custom-geometry-heightmap.html b/manual/examples/custom-geometry-heightmap.html deleted file mode 100644 index 69a80d4fb3cdf6..00000000000000 --- a/manual/examples/custom-geometry-heightmap.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - Three.js - Custom Geometry - Heightmap - - - - - - - - - - - - - - diff --git a/manual/examples/debug-js-clearing-logger.html b/manual/examples/debug-js-clearing-logger.html index ba5affee7765d4..fc30ec010199f7 100644 --- a/manual/examples/debug-js-clearing-logger.html +++ b/manual/examples/debug-js-clearing-logger.html @@ -35,7 +35,7 @@ - + + + + + + + + + + + + + + + + diff --git a/manual/examples/indexed-textures-picking-and-highlighting.html b/manual/examples/indexed-textures-picking-and-highlighting.html index d053205dfc2bc2..ae512a213b8892 100644 --- a/manual/examples/indexed-textures-picking-and-highlighting.html +++ b/manual/examples/indexed-textures-picking-and-highlighting.html @@ -60,7 +60,7 @@ - + + + + + + + + - - - - - - diff --git a/manual/examples/lights-point.html b/manual/examples/lights-point.html index 67ea54c28a645c..aef02c458a49e7 100644 --- a/manual/examples/lights-point.html +++ b/manual/examples/lights-point.html @@ -22,7 +22,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/manual/examples/offscreencanvas.html b/manual/examples/offscreencanvas.html index 1eb2c93bfd33ed..b3f474780abc5d 100644 --- a/manual/examples/offscreencanvas.html +++ b/manual/examples/offscreencanvas.html @@ -33,28 +33,36 @@ diff --git a/manual/examples/picking-gpu.html b/manual/examples/picking-gpu.html index ed4b1af2646646..fb46d1e60b6491 100644 --- a/manual/examples/picking-gpu.html +++ b/manual/examples/picking-gpu.html @@ -22,7 +22,7 @@ - + + + + + + + + + + + + + + + + + diff --git a/manual/examples/responsive-editor.html b/manual/examples/responsive-editor.html index 7285afdd002b43..f59dc1b3e55754 100644 --- a/manual/examples/responsive-editor.html +++ b/manual/examples/responsive-editor.html @@ -63,19 +63,23 @@ // This code is only related to handling the split. // Our three.js code has not changed -Split(['#view', '#controls'], { // eslint-disable-line new-cap - sizes: [75, 25], - minSize: 100, - elementStyle: (dimension, size, gutterSize) => { - return { - 'flex-basis': `calc(${size}% - ${gutterSize}px)`, - }; - }, - gutterStyle: (dimension, gutterSize) => { - return { - 'flex-basis': `${gutterSize}px`, - }; - }, -}); +Split( [ '#view', '#controls' ], { // eslint-disable-line new-cap + sizes: [ 75, 25 ], + minSize: 100, + elementStyle: ( dimension, size, gutterSize ) => { + + return { + 'flex-basis': `calc(${size}% - ${gutterSize}px)`, + }; + + }, + gutterStyle: ( dimension, gutterSize ) => { + + return { + 'flex-basis': `${gutterSize}px`, + }; + + }, +} ); diff --git a/manual/examples/responsive-hd-dpi.html b/manual/examples/responsive-hd-dpi.html index 998c004b97b1aa..8e5f6b00ea8897 100644 --- a/manual/examples/responsive-hd-dpi.html +++ b/manual/examples/responsive-hd-dpi.html @@ -22,7 +22,7 @@ - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/manual/examples/tips-transparent-canvas.html b/manual/examples/tips-transparent-canvas.html index 6607b41e76c90f..d96d7328725e45 100644 --- a/manual/examples/tips-transparent-canvas.html +++ b/manual/examples/tips-transparent-canvas.html @@ -49,7 +49,7 @@

    Cubes-R-Us!

    - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/manual/fr/debugging-glsl.html b/manual/fr/debugging-glsl.html index 078177c4433c9b..50a72edabbccf6 100644 --- a/manual/fr/debugging-glsl.html +++ b/manual/fr/debugging-glsl.html @@ -13,7 +13,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/manual/zh/debugging-glsl.html b/manual/zh/debugging-glsl.html index 45d04dede74d58..df57488e077cca 100644 --- a/manual/zh/debugging-glsl.html +++ b/manual/zh/debugging-glsl.html @@ -13,7 +13,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +