From fce59371873f9e3f9c5272cb30caaf6f3fe5bb1c Mon Sep 17 00:00:00 2001 From: WestLangley Date: Sat, 7 Jun 2025 22:17:17 -0400 Subject: [PATCH 1/5] NodeMaterial: Honor `material.premultipliedAlpha` in the shader (#31166) --- src/materials/nodes/NodeMaterial.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/materials/nodes/NodeMaterial.js b/src/materials/nodes/NodeMaterial.js index ad219daa9802ed..d9bc9dc6c228cf 100644 --- a/src/materials/nodes/NodeMaterial.js +++ b/src/materials/nodes/NodeMaterial.js @@ -1077,6 +1077,21 @@ class NodeMaterial extends Material { } + /** + * Setups premultiplied alpha. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {Node} outputNode - The existing output node. + * @return {Node} The output node. + */ + setupPremultipliedAlpha( builder, outputNode ) { + + outputNode = vec4( outputNode.rgb.mul( outputNode.a ), outputNode.a ); + + return outputNode; + + } + /** * Setups the output node. * @@ -1094,6 +1109,14 @@ class NodeMaterial extends Material { } + // PREMULTIPLIED ALPHA + + if ( this.premultipliedAlpha === true ) { + + outputNode = this.setupPremultipliedAlpha( builder, outputNode ); + + } + return outputNode; } From ee7fd45703e055973215aee37e0b7d67286721fe Mon Sep 17 00:00:00 2001 From: sunag Date: Sat, 7 Jun 2025 23:33:56 -0300 Subject: [PATCH 2/5] SSAAPassNode: Ignoring `material.premultipliedAlpha` usage for now, related (#31166) --- examples/jsm/tsl/display/SSAAPassNode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/jsm/tsl/display/SSAAPassNode.js b/examples/jsm/tsl/display/SSAAPassNode.js index 3e494b71475ef3..0f54637a2cead0 100644 --- a/examples/jsm/tsl/display/SSAAPassNode.js +++ b/examples/jsm/tsl/display/SSAAPassNode.js @@ -281,7 +281,7 @@ class SSAAPassNode extends PassNode { this._quadMesh.material.transparent = true; this._quadMesh.material.depthTest = false; this._quadMesh.material.depthWrite = false; - this._quadMesh.material.premultipliedAlpha = true; + //this._quadMesh.material.premultipliedAlpha = true; this._quadMesh.material.blending = AdditiveBlending; this._quadMesh.material.name = 'SSAA'; From f5b96f823d9a7d6fa50a2ab08076647e64a98b1d Mon Sep 17 00:00:00 2001 From: sunag Date: Sun, 8 Jun 2025 00:58:22 -0300 Subject: [PATCH 3/5] TSL: Rename `premult` to `premultiplyAlpha` (#31240) * rename `premult`-> `premultiplyAlpha` * use native function * Update GaussianBlurNode.js * Update Three.TSL.js * Update SSAAPassNode.js --- examples/jsm/tsl/display/GaussianBlurNode.js | 6 +++--- examples/jsm/tsl/display/SSAAPassNode.js | 6 +++--- examples/jsm/tsl/display/hashBlur.js | 6 +++--- src/Three.TSL.js | 4 ++-- src/materials/nodes/NodeMaterial.js | 5 ++--- src/nodes/display/BlendModes.js | 4 ++-- 6 files changed, 15 insertions(+), 16 deletions(-) diff --git a/examples/jsm/tsl/display/GaussianBlurNode.js b/examples/jsm/tsl/display/GaussianBlurNode.js index 670112bbc274a3..38e1306e1c1bd3 100644 --- a/examples/jsm/tsl/display/GaussianBlurNode.js +++ b/examples/jsm/tsl/display/GaussianBlurNode.js @@ -1,5 +1,5 @@ import { RenderTarget, Vector2, NodeMaterial, RendererUtils, QuadMesh, TempNode, NodeUpdateType } from 'three/webgpu'; -import { nodeObject, Fn, float, uv, uniform, convertToTexture, vec2, vec4, passTexture, mul, premult, unpremult } from 'three/tsl'; +import { nodeObject, Fn, float, uv, uniform, convertToTexture, vec2, vec4, passTexture, mul, premultiplyAlpha, unpremultiplyAlpha } from 'three/tsl'; const _quadMesh = /*@__PURE__*/ new QuadMesh(); @@ -249,8 +249,8 @@ class GaussianBlurNode extends TempNode { // https://lisyarus.github.io/blog/posts/blur-coefficients-generator.html - sampleTexture = ( uv ) => premult( textureNode.sample( uv ) ); - output = ( color ) => unpremult( color ); + sampleTexture = ( uv ) => premultiplyAlpha( textureNode.sample( uv ) ); + output = ( color ) => unpremultiplyAlpha( color ); } else { diff --git a/examples/jsm/tsl/display/SSAAPassNode.js b/examples/jsm/tsl/display/SSAAPassNode.js index 0f54637a2cead0..88d2426b473b20 100644 --- a/examples/jsm/tsl/display/SSAAPassNode.js +++ b/examples/jsm/tsl/display/SSAAPassNode.js @@ -1,5 +1,5 @@ import { AdditiveBlending, Color, Vector2, RendererUtils, PassNode, QuadMesh, NodeMaterial } from 'three/webgpu'; -import { nodeObject, uniform, mrt, texture, getTextureIndex } from 'three/tsl'; +import { nodeObject, uniform, mrt, texture, getTextureIndex, unpremultiplyAlpha } from 'three/tsl'; const _size = /*@__PURE__*/ new Vector2(); @@ -277,11 +277,11 @@ class SSAAPassNode extends PassNode { } this._quadMesh.material = new NodeMaterial(); - this._quadMesh.material.fragmentNode = sampleTexture; + this._quadMesh.material.fragmentNode = unpremultiplyAlpha( sampleTexture ); this._quadMesh.material.transparent = true; this._quadMesh.material.depthTest = false; this._quadMesh.material.depthWrite = false; - //this._quadMesh.material.premultipliedAlpha = true; + this._quadMesh.material.premultipliedAlpha = true; this._quadMesh.material.blending = AdditiveBlending; this._quadMesh.material.name = 'SSAA'; diff --git a/examples/jsm/tsl/display/hashBlur.js b/examples/jsm/tsl/display/hashBlur.js index 5a5273c6367bc1..95889c9877d0b1 100644 --- a/examples/jsm/tsl/display/hashBlur.js +++ b/examples/jsm/tsl/display/hashBlur.js @@ -1,4 +1,4 @@ -import { float, Fn, vec2, uv, sin, rand, degrees, cos, Loop, vec4, premult, unpremult } from 'three/tsl'; +import { float, Fn, vec2, uv, sin, rand, degrees, cos, Loop, vec4, premultiplyAlpha, unpremultiplyAlpha } from 'three/tsl'; /** * Applies a hash blur effect to the given texture node. @@ -34,7 +34,7 @@ export const hashBlur = /*#__PURE__*/ Fn( ( [ textureNode, bluramount = float( 0 } - return premultipliedAlpha ? premult( sample ) : sample; + return premultipliedAlpha ? premultiplyAlpha( sample ) : sample; }; @@ -51,6 +51,6 @@ export const hashBlur = /*#__PURE__*/ Fn( ( [ textureNode, bluramount = float( 0 blurred_image.divAssign( repeats ); - return premultipliedAlpha ? unpremult( blurred_image ) : blurred_image; + return premultipliedAlpha ? unpremultiplyAlpha( blurred_image ) : blurred_image; } ); diff --git a/src/Three.TSL.js b/src/Three.TSL.js index e930ff2e500b4e..d138f79328f462 100644 --- a/src/Three.TSL.js +++ b/src/Three.TSL.js @@ -386,7 +386,7 @@ export const pow = TSL.pow; export const pow2 = TSL.pow2; export const pow3 = TSL.pow3; export const pow4 = TSL.pow4; -export const premult = TSL.premult; +export const premultiplyAlpha = TSL.premultiplyAlpha; export const property = TSL.property; export const radians = TSL.radians; export const rand = TSL.rand; @@ -511,7 +511,7 @@ export const uniformArray = TSL.uniformArray; export const uniformGroup = TSL.uniformGroup; export const uniformTexture = TSL.uniformTexture; export const uniforms = TSL.uniforms; -export const unpremult = TSL.unpremult; +export const unpremultiplyAlpha = TSL.unpremultiplyAlpha; export const userData = TSL.userData; export const uv = TSL.uv; export const uvec2 = TSL.uvec2; diff --git a/src/materials/nodes/NodeMaterial.js b/src/materials/nodes/NodeMaterial.js index d9bc9dc6c228cf..5280833d4891b7 100644 --- a/src/materials/nodes/NodeMaterial.js +++ b/src/materials/nodes/NodeMaterial.js @@ -24,6 +24,7 @@ import NodeMaterialObserver from './manager/NodeMaterialObserver.js'; import getAlphaHashThreshold from '../../nodes/functions/material/getAlphaHashThreshold.js'; import { modelViewMatrix } from '../../nodes/accessors/ModelNode.js'; import { vertexColor } from '../../nodes/accessors/VertexColorNode.js'; +import { premultiplyAlpha } from '../../nodes/display/BlendModes.js'; /** * Base class for all node materials. @@ -1086,9 +1087,7 @@ class NodeMaterial extends Material { */ setupPremultipliedAlpha( builder, outputNode ) { - outputNode = vec4( outputNode.rgb.mul( outputNode.a ), outputNode.a ); - - return outputNode; + return premultiplyAlpha( outputNode ); } diff --git a/src/nodes/display/BlendModes.js b/src/nodes/display/BlendModes.js index d72964cb64115f..0b865af4b08a9a 100644 --- a/src/nodes/display/BlendModes.js +++ b/src/nodes/display/BlendModes.js @@ -143,7 +143,7 @@ export const blendColor = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { * @param {Node} color - The input color with non-premultiplied alpha. * @return {Node} The color with premultiplied alpha. */ -export const premult = /*@__PURE__*/ Fn( ( [ color ] ) => { +export const premultiplyAlpha = /*@__PURE__*/ Fn( ( [ color ] ) => { return vec4( color.rgb.mul( color.a ), color.a ); @@ -162,7 +162,7 @@ export const premult = /*@__PURE__*/ Fn( ( [ color ] ) => { * @param {Node} color - The input color with premultiplied alpha. * @return {Node} The color with non-premultiplied alpha. */ -export const unpremult = /*@__PURE__*/ Fn( ( [ color ] ) => { +export const unpremultiplyAlpha = /*@__PURE__*/ Fn( ( [ color ] ) => { If( color.a.equal( 0.0 ), () => vec4( 0.0 ) ); From e9f3ce47312b6c99a6ab46bf33880bb61ab7061a Mon Sep 17 00:00:00 2001 From: Pasha Yakubovsky Date: Sun, 8 Jun 2025 04:09:24 +0000 Subject: [PATCH 4/5] TSL: Introduce Chromatic Aberration (#31236) * Chromatic aberration TSL node Example page for ca node * Fix comma * Remove unused delta from render loop in ca example * Rename CANode.js to ChromaticAberrationNode.js Add nodeObject in ca params, for ability to use a procedural node Update example gui to toggle procedural / static * Fix the gui in example * cleanup code style * use nodeObject() * Update webgpu_postprocessing_ca.html * cleanup --------- Co-authored-by: PashaDev2 --- examples/files.json | 1 + .../tsl/display/ChromaticAberrationNode.js | 206 +++++++++++ .../screenshots/webgpu_postprocessing_ca.jpg | Bin 0 -> 460520 bytes examples/tags.json | 1 + examples/webgpu_postprocessing_ca.html | 346 ++++++++++++++++++ test/e2e/puppeteer.js | 1 + 6 files changed, 555 insertions(+) create mode 100644 examples/jsm/tsl/display/ChromaticAberrationNode.js create mode 100644 examples/screenshots/webgpu_postprocessing_ca.jpg create mode 100644 examples/webgpu_postprocessing_ca.html diff --git a/examples/files.json b/examples/files.json index 3ef6533ef20b36..a9d6870b5317cd 100644 --- a/examples/files.json +++ b/examples/files.json @@ -405,6 +405,7 @@ "webgpu_postprocessing_fxaa", "webgpu_postprocessing_lensflare", "webgpu_postprocessing_masking", + "webgpu_postprocessing_ca", "webgpu_postprocessing_motion_blur", "webgpu_postprocessing_outline", "webgpu_postprocessing_smaa", diff --git a/examples/jsm/tsl/display/ChromaticAberrationNode.js b/examples/jsm/tsl/display/ChromaticAberrationNode.js new file mode 100644 index 00000000000000..625f58caeadc52 --- /dev/null +++ b/examples/jsm/tsl/display/ChromaticAberrationNode.js @@ -0,0 +1,206 @@ +import { Vector2, TempNode } from 'three/webgpu'; +import { + nodeObject, + Fn, + uniform, + convertToTexture, + float, + vec4, + uv, + NodeUpdateType, +} from 'three/tsl'; + +/** + * Post processing node for applying chromatic aberration effect. + * This effect simulates the color fringing that occurs in real camera lenses + * by separating and offsetting the red, green, and blue channels. + * + * @augments TempNode + * @three_import import { chromaticAberration } from 'three/addons/tsl/display/ChromaticAberrationNode.js'; + */ +class ChromaticAberrationNode extends TempNode { + + static get type() { + + return 'ChromaticAberrationNode'; + + } + + /** + * Constructs a new chromatic aberration node. + * + * @param {TextureNode} textureNode - The texture node that represents the input of the effect. + * @param {Node} strengthNode - The strength of the chromatic aberration effect as a node. + * @param {Node} centerNode - The center point of the effect as a node. + * @param {Node} scaleNode - The scale factor for stepped scaling from center as a node. + */ + constructor( textureNode, strengthNode, centerNode, scaleNode ) { + + super( 'vec4' ); + + /** + * The texture node that represents the input of the effect. + * + * @type {texture} + */ + this.textureNode = textureNode; + + /** + * The `updateBeforeType` is set to `NodeUpdateType.FRAME` since the node updates + * its internal uniforms once per frame in `updateBefore()`. + * + * @type {string} + * @default 'frame' + */ + this.updateBeforeType = NodeUpdateType.FRAME; + + /** + * A node holding the strength of the effect. + * + * @type {Node} + */ + this.strengthNode = strengthNode; + + /** + * A node holding the center point of the effect. + * + * @type {Node} + */ + this.centerNode = centerNode; + + /** + * A node holding the scale factor for stepped scaling. + * + * @type {Node} + */ + this.scaleNode = scaleNode; + + /** + * A uniform node holding the inverse resolution value. + * + * @private + * @type {UniformNode} + */ + this._invSize = uniform( new Vector2() ); + + } + + /** + * This method is used to update the effect's uniforms once per frame. + * + * @param {NodeFrame} frame - The current node frame. + */ + updateBefore( /* frame */ ) { + + const map = this.textureNode.value; + this._invSize.value.set( 1 / map.image.width, 1 / map.image.height ); + + } + + /** + * This method is used to setup the effect's TSL code. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {ShaderCallNodeInternal} + */ + setup( /* builder */ ) { + + const textureNode = this.textureNode; + const uvNode = textureNode.uvNode || uv(); + + const ApplyChromaticAberration = Fn( ( [ uv, strength, center, scale ] ) => { + + // Calculate distance from center + const offset = uv.sub( center ); + const distance = offset.length(); + + // Create stepped scaling zones based on distance + // Each channel gets different scaling steps + const redScale = float( 1.0 ).add( scale.mul( 0.02 ).mul( strength ) ); // Red channel scaled outward + const greenScale = float( 1.0 ); // Green stays at original scale + const blueScale = float( 1.0 ).sub( scale.mul( 0.02 ).mul( strength ) ); // Blue channel scaled inward + + // Create radial distortion based on distance from center + const aberrationStrength = strength.mul( distance ); + + // Calculate scaled UV coordinates for each channel + const redUV = center.add( offset.mul( redScale ) ); + const greenUV = center.add( offset.mul( greenScale ) ); + const blueUV = center.add( offset.mul( blueScale ) ); + + // Apply additional chromatic offset based on aberration strength + const rOffset = offset.mul( aberrationStrength ).mul( float( 0.01 ) ); + const gOffset = offset.mul( aberrationStrength ).mul( float( 0.0 ) ); + const bOffset = offset.mul( aberrationStrength ).mul( float( - 0.01 ) ); + + // Final UV coordinates combining scale and chromatic aberration + const finalRedUV = redUV.add( rOffset ); + const finalGreenUV = greenUV.add( gOffset ); + const finalBlueUV = blueUV.add( bOffset ); + + // Sample texture for each channel + const r = textureNode.sample( finalRedUV ).r; + const g = textureNode.sample( finalGreenUV ).g; + const b = textureNode.sample( finalBlueUV ).b; + + // Get original alpha + const a = textureNode.sample( uv ).a; + + return vec4( r, g, b, a ); + + } ).setLayout( { + name: 'ChromaticAberrationShader', + type: 'vec4', + inputs: [ + { name: 'uv', type: 'vec2' }, + { name: 'strength', type: 'float' }, + { name: 'center', type: 'vec2' }, + { name: 'scale', type: 'float' }, + { name: 'invSize', type: 'vec2' } + ] + } ); + + const chromaticAberrationFn = Fn( () => { + + return ApplyChromaticAberration( + uvNode, + this.strengthNode, + this.centerNode, + this.scaleNode, + this._invSize + ); + + } ); + + const outputNode = chromaticAberrationFn(); + + return outputNode; + + } + +} + +export default ChromaticAberrationNode; + +/** + * TSL function for creating a chromatic aberration node for post processing. + * + * @tsl + * @function + * @param {Node} node - The node that represents the input of the effect. + * @param {Node|number} [strength=1.0] - The strength of the chromatic aberration effect as a node or value. + * @param {Node|Vector2} [center=null] - The center point of the effect as a node or value. If null, uses screen center (0.5, 0.5). + * @param {Node|number} [scale=1.1] - The scale factor for stepped scaling from center as a node or value. + * @returns {ChromaticAberrationNode} + */ +export const chromaticAberration = ( node, strength = 1.0, center = null, scale = 1.1 ) => { + + return nodeObject( + new ChromaticAberrationNode( + convertToTexture( node ), + nodeObject( strength ), + nodeObject( center ), + nodeObject( scale ) + ) + ); +}; diff --git a/examples/screenshots/webgpu_postprocessing_ca.jpg b/examples/screenshots/webgpu_postprocessing_ca.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b84eefde8baed7d50810185fcda5a54ef3080a44 GIT binary patch literal 460520 zcmeEv2Ut^C+HkNVHb4jAD=$B=kOlbm=7!2skQA2{1~BKn6mHlz>1& zFG^La5C}sMBB6$kgx>zler@*O-EVhiWOimhZ=NSPIrpBop7Xxvyr#Ku0Dy_{0qhR}ZUPP;`sw=V`!M4=a_q=Y*NJ1tjviw^aq=Yd31;S#r_P=_$#RB; znfWy9=`&}~ont+B@)R38+c|bd`rJ=In0_jG_{a%H!E-FkER5WL^4fm|U_EiHgyr2~ zCRV^9R;I(OO#4j$9tM$z0f(7>BKSWqrbCC196fgY1T*6{4 za2CM0&3c6GOQ~=4kFxXM_4@AFG3m^nr5ljq*T>Hb0Of2Sm5wfZUwCftFstOmS28y_ z?0gz73d$P#G7H7^Qq_M#$-wm!!k^*%IZ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3EHNC|iNA-IU)ZOg8#$n`t;(EY#P<#qwgBa+U) z{*AlO|Dl~UnU@r!oe|1)DAWLey?$M&bM;SN6qjW?SB(pCB{O5*{uO+-uEg6NoaBLI NLclM-MKu0C@IS^75KjOA literal 0 HcmV?d00001 diff --git a/examples/tags.json b/examples/tags.json index f072a6cdb9dbda..d5873f7b93e6e8 100644 --- a/examples/tags.json +++ b/examples/tags.json @@ -148,6 +148,7 @@ "webgpu_postprocessing_dof": [ "bokeh" ], "webgpu_postprocessing_fxaa": [ "msaa", "multisampled" ], "webgpu_postprocessing_motion_blur": [ "mrt" ], + "webgpu_postprocessing_ca": [ "chromatic aberration" ], "webgpu_postprocessing_sobel": [ "filter", "edge detection" ], "webgpu_postprocessing_ssaa": [ "msaa", "multisampled" ], "webgpu_refraction": [ "water" ], diff --git a/examples/webgpu_postprocessing_ca.html b/examples/webgpu_postprocessing_ca.html new file mode 100644 index 00000000000000..8235ad0cdd4966 --- /dev/null +++ b/examples/webgpu_postprocessing_ca.html @@ -0,0 +1,346 @@ + + + + three.js webgpu - chromatic aberration + + + + + + + +

+ three.js webgpu - chromatic aberration +
+ + + + + + + diff --git a/test/e2e/puppeteer.js b/test/e2e/puppeteer.js index 16ccd238e2f785..88c548399aa4a3 100644 --- a/test/e2e/puppeteer.js +++ b/test/e2e/puppeteer.js @@ -170,6 +170,7 @@ const exceptionList = [ 'webgpu_postprocessing_3dlut', 'webgpu_postprocessing_fxaa', 'webgpu_postprocessing_afterimage', + 'webgpu_postprocessing_ca', 'webgpu_xr_native_layers', 'webgpu_volume_caustics', From 4948a0752e14e14a422b82c627d2bacb481ffa5c Mon Sep 17 00:00:00 2001 From: sunag Date: Sun, 8 Jun 2025 01:30:54 -0300 Subject: [PATCH 5/5] Updated builds. --- build/three.tsl.js | 6 +- build/three.tsl.min.js | 2 +- build/three.webgpu.js | 596 ++++++++++++++++++-------------- build/three.webgpu.min.js | 2 +- build/three.webgpu.nodes.js | 596 ++++++++++++++++++-------------- build/three.webgpu.nodes.min.js | 2 +- 6 files changed, 674 insertions(+), 530 deletions(-) diff --git a/build/three.tsl.js b/build/three.tsl.js index c2dbc51a6b1579..e550d39092007a 100644 --- a/build/three.tsl.js +++ b/build/three.tsl.js @@ -391,7 +391,7 @@ const pow = TSL.pow; const pow2 = TSL.pow2; const pow3 = TSL.pow3; const pow4 = TSL.pow4; -const premult = TSL.premult; +const premultiplyAlpha = TSL.premultiplyAlpha; const property = TSL.property; const radians = TSL.radians; const rand = TSL.rand; @@ -516,7 +516,7 @@ const uniformArray = TSL.uniformArray; const uniformGroup = TSL.uniformGroup; const uniformTexture = TSL.uniformTexture; const uniforms = TSL.uniforms; -const unpremult = TSL.unpremult; +const unpremultiplyAlpha = TSL.unpremultiplyAlpha; const userData = TSL.userData; const uv = TSL.uv; const uvec2 = TSL.uvec2; @@ -557,4 +557,4 @@ const workgroupId = TSL.workgroupId; const workingToColorSpace = TSL.workingToColorSpace; const xor = TSL.xor; -export { BRDF_GGX, BRDF_Lambert, BasicShadowFilter, Break, Const, Continue, DFGApprox, D_GGX, Discard, EPSILON, F_Schlick, Fn, INFINITY, If, Loop, NodeAccess, NodeShaderStage, NodeType, NodeUpdateType, PCFShadowFilter, PCFSoftShadowFilter, PI, PI2, Return, Schlick_to_F0, ScriptableNodeResources, ShaderNode, Switch, TBNViewMatrix, VSMShadowFilter, V_GGX_SmithCorrelated, Var, abs, acesFilmicToneMapping, acos, add, addNodeElement, agxToneMapping, all, alphaT, and, anisotropy, anisotropyB, anisotropyT, any, append, array, arrayBuffer, asin, assign, atan, atan2, atomicAdd, atomicAnd, atomicFunc, atomicLoad, atomicMax, atomicMin, atomicOr, atomicStore, atomicSub, atomicXor, attenuationColor, attenuationDistance, attribute, attributeArray, backgroundBlurriness, backgroundIntensity, backgroundRotation, batch, billboarding, bitAnd, bitNot, bitOr, bitXor, bitangentGeometry, bitangentLocal, bitangentView, bitangentWorld, bitcast, blendBurn, blendColor, blendDodge, blendOverlay, blendScreen, blur, bool, buffer, bufferAttribute, bumpMap, burn, bvec2, bvec3, bvec4, bypass, cache, call, cameraFar, cameraIndex, cameraNear, cameraNormalMatrix, cameraPosition, cameraProjectionMatrix, cameraProjectionMatrixInverse, cameraViewMatrix, cameraWorldMatrix, cbrt, cdl, ceil, checker, cineonToneMapping, clamp, clearcoat, clearcoatRoughness, code, color, colorSpaceToWorking, colorToDirection, compute, computeSkinning, cond, context, convert, convertColorSpace, convertToTexture, cos, cross, cubeTexture, dFdx, dFdy, dashSize, debug, decrement, decrementBefore, defaultBuildStages, defaultShaderStages, defined, degrees, deltaTime, densityFog, densityFogFactor, depth, depthPass, difference, diffuseColor, directPointLight, directionToColor, dispersion, distance, div, dodge, dot, drawIndex, dynamicBufferAttribute, element, emissive, equal, equals, equirectUV, exp, exp2, expression, faceDirection, faceForward, faceforward, float, floor, fog, fract, frameGroup, frameId, frontFacing, fwidth, gain, gapSize, getConstNodeType, getCurrentStack, getDirection, getDistanceAttenuation, getGeometryRoughness, getNormalFromDepth, getParallaxCorrectNormal, getRoughness, getScreenPosition, getShIrradianceAt, getShadowMaterial, getShadowRenderObjectFunction, getTextureIndex, getViewPosition, globalId, glsl, glslFn, grayscale, greaterThan, greaterThanEqual, hash, highpModelNormalViewMatrix, highpModelViewMatrix, hue, increment, incrementBefore, instance, instanceIndex, instancedArray, instancedBufferAttribute, instancedDynamicBufferAttribute, instancedMesh, int, inverseSqrt, inversesqrt, invocationLocalIndex, invocationSubgroupIndex, ior, iridescence, iridescenceIOR, iridescenceThickness, ivec2, ivec3, ivec4, js, label, length, lengthSq, lessThan, lessThanEqual, lightPosition, lightProjectionUV, lightShadowMatrix, lightTargetDirection, lightTargetPosition, lightViewPosition, lightingContext, lights, linearDepth, linearToneMapping, localId, log, log2, logarithmicDepthToViewZ, loop, luminance, mat2, mat3, mat4, matcapUV, materialAO, materialAlphaTest, materialAnisotropy, materialAnisotropyVector, materialAttenuationColor, materialAttenuationDistance, materialClearcoat, materialClearcoatNormal, materialClearcoatRoughness, materialColor, materialDispersion, materialEmissive, materialIOR, materialIridescence, materialIridescenceIOR, materialIridescenceThickness, materialLightMap, materialLineDashOffset, materialLineDashSize, materialLineGapSize, materialLineScale, materialLineWidth, materialMetalness, materialNormal, materialOpacity, materialPointSize, materialReference, materialReflectivity, materialRefractionRatio, materialRotation, materialRoughness, materialSheen, materialSheenRoughness, materialShininess, materialSpecular, materialSpecularColor, materialSpecularIntensity, materialSpecularStrength, materialThickness, materialTransmission, max, maxMipLevel, mediumpModelViewMatrix, metalness, min, mix, mixElement, mod, modInt, modelDirection, modelNormalMatrix, modelPosition, modelRadius, modelScale, modelViewMatrix, modelViewPosition, modelViewProjection, modelWorldMatrix, modelWorldMatrixInverse, morphReference, mrt, mul, mx_aastep, mx_cell_noise_float, mx_contrast, mx_fractal_noise_float, mx_fractal_noise_vec2, mx_fractal_noise_vec3, mx_fractal_noise_vec4, mx_hsvtorgb, mx_noise_float, mx_noise_vec3, mx_noise_vec4, mx_ramplr, mx_ramptb, mx_rgbtohsv, mx_safepower, mx_splitlr, mx_splittb, mx_srgb_texture_to_lin_rec709, mx_transform_uv, mx_worley_noise_float, mx_worley_noise_vec2, mx_worley_noise_vec3, namespace, negate, neutralToneMapping, nodeArray, nodeImmutable, nodeObject, nodeObjects, nodeProxy, normalFlat, normalGeometry, normalLocal, normalMap, normalView, normalWorld, normalize, not, notEqual, numWorkgroups, objectDirection, objectGroup, objectPosition, objectRadius, objectScale, objectViewPosition, objectWorldMatrix, oneMinus, or, orthographicDepthToViewZ, oscSawtooth, oscSine, oscSquare, oscTriangle, output, outputStruct, overlay, overloadingFn, parabola, parallaxDirection, parallaxUV, parameter, pass, passTexture, pcurve, perspectiveDepthToViewZ, pmremTexture, pointShadow, pointUV, pointWidth, positionGeometry, positionLocal, positionPrevious, positionView, positionViewDirection, positionWorld, positionWorldDirection, posterize, pow, pow2, pow3, pow4, premult, property, radians, rand, range, rangeFog, rangeFogFactor, reciprocal, reference, referenceBuffer, reflect, reflectVector, reflectView, reflector, refract, refractVector, refractView, reinhardToneMapping, remainder, remap, remapClamp, renderGroup, renderOutput, rendererReference, rotate, rotateUV, roughness, round, rtt, sRGBTransferEOTF, sRGBTransferOETF, sampler, samplerComparison, saturate, saturation, screen, screenCoordinate, screenSize, screenUV, scriptable, scriptableValue, select, setCurrentStack, shaderStages, shadow, shadowPositionWorld, shapeCircle, sharedUniformGroup, sheen, sheenRoughness, shiftLeft, shiftRight, shininess, sign, sin, sinc, skinning, smoothstep, smoothstepElement, specularColor, specularF90, spherizeUV, split, spritesheetUV, sqrt, stack, step, storage, storageBarrier, storageObject, storageTexture, string, struct, sub, subgroupIndex, subgroupSize, tan, tangentGeometry, tangentLocal, tangentView, tangentWorld, temp, texture, texture3D, textureBarrier, textureBicubic, textureCubeUV, textureLoad, textureSize, textureStore, thickness, time, timerDelta, timerGlobal, timerLocal, toneMapping, toneMappingExposure, toonOutlinePass, transformDirection, transformNormal, transformNormalToView, transformedBentNormalView, transformedBitangentView, transformedBitangentWorld, transformedClearcoatNormalView, transformedNormalView, transformedNormalWorld, transformedTangentView, transformedTangentWorld, transmission, transpose, triNoise3D, triplanarTexture, triplanarTextures, trunc, tslFn, uint, uniform, uniformArray, uniformCubeTexture, uniformGroup, uniformTexture, uniforms, unpremult, userData, uv, uvec2, uvec3, uvec4, varying, varyingProperty, vec2, vec3, vec4, vectorComponents, velocity, vertexColor, vertexIndex, vibrance, viewZToLogarithmicDepth, viewZToOrthographicDepth, viewZToPerspectiveDepth, viewport, viewportBottomLeft, viewportCoordinate, viewportDepthTexture, viewportLinearDepth, viewportMipTexture, viewportResolution, viewportSafeUV, viewportSharedTexture, viewportSize, viewportTexture, viewportTopLeft, viewportUV, wgsl, wgslFn, workgroupArray, workgroupBarrier, workgroupId, workingToColorSpace, xor }; +export { BRDF_GGX, BRDF_Lambert, BasicShadowFilter, Break, Const, Continue, DFGApprox, D_GGX, Discard, EPSILON, F_Schlick, Fn, INFINITY, If, Loop, NodeAccess, NodeShaderStage, NodeType, NodeUpdateType, PCFShadowFilter, PCFSoftShadowFilter, PI, PI2, Return, Schlick_to_F0, ScriptableNodeResources, ShaderNode, Switch, TBNViewMatrix, VSMShadowFilter, V_GGX_SmithCorrelated, Var, abs, acesFilmicToneMapping, acos, add, addNodeElement, agxToneMapping, all, alphaT, and, anisotropy, anisotropyB, anisotropyT, any, append, array, arrayBuffer, asin, assign, atan, atan2, atomicAdd, atomicAnd, atomicFunc, atomicLoad, atomicMax, atomicMin, atomicOr, atomicStore, atomicSub, atomicXor, attenuationColor, attenuationDistance, attribute, attributeArray, backgroundBlurriness, backgroundIntensity, backgroundRotation, batch, billboarding, bitAnd, bitNot, bitOr, bitXor, bitangentGeometry, bitangentLocal, bitangentView, bitangentWorld, bitcast, blendBurn, blendColor, blendDodge, blendOverlay, blendScreen, blur, bool, buffer, bufferAttribute, bumpMap, burn, bvec2, bvec3, bvec4, bypass, cache, call, cameraFar, cameraIndex, cameraNear, cameraNormalMatrix, cameraPosition, cameraProjectionMatrix, cameraProjectionMatrixInverse, cameraViewMatrix, cameraWorldMatrix, cbrt, cdl, ceil, checker, cineonToneMapping, clamp, clearcoat, clearcoatRoughness, code, color, colorSpaceToWorking, colorToDirection, compute, computeSkinning, cond, context, convert, convertColorSpace, convertToTexture, cos, cross, cubeTexture, dFdx, dFdy, dashSize, debug, decrement, decrementBefore, defaultBuildStages, defaultShaderStages, defined, degrees, deltaTime, densityFog, densityFogFactor, depth, depthPass, difference, diffuseColor, directPointLight, directionToColor, dispersion, distance, div, dodge, dot, drawIndex, dynamicBufferAttribute, element, emissive, equal, equals, equirectUV, exp, exp2, expression, faceDirection, faceForward, faceforward, float, floor, fog, fract, frameGroup, frameId, frontFacing, fwidth, gain, gapSize, getConstNodeType, getCurrentStack, getDirection, getDistanceAttenuation, getGeometryRoughness, getNormalFromDepth, getParallaxCorrectNormal, getRoughness, getScreenPosition, getShIrradianceAt, getShadowMaterial, getShadowRenderObjectFunction, getTextureIndex, getViewPosition, globalId, glsl, glslFn, grayscale, greaterThan, greaterThanEqual, hash, highpModelNormalViewMatrix, highpModelViewMatrix, hue, increment, incrementBefore, instance, instanceIndex, instancedArray, instancedBufferAttribute, instancedDynamicBufferAttribute, instancedMesh, int, inverseSqrt, inversesqrt, invocationLocalIndex, invocationSubgroupIndex, ior, iridescence, iridescenceIOR, iridescenceThickness, ivec2, ivec3, ivec4, js, label, length, lengthSq, lessThan, lessThanEqual, lightPosition, lightProjectionUV, lightShadowMatrix, lightTargetDirection, lightTargetPosition, lightViewPosition, lightingContext, lights, linearDepth, linearToneMapping, localId, log, log2, logarithmicDepthToViewZ, loop, luminance, mat2, mat3, mat4, matcapUV, materialAO, materialAlphaTest, materialAnisotropy, materialAnisotropyVector, materialAttenuationColor, materialAttenuationDistance, materialClearcoat, materialClearcoatNormal, materialClearcoatRoughness, materialColor, materialDispersion, materialEmissive, materialIOR, materialIridescence, materialIridescenceIOR, materialIridescenceThickness, materialLightMap, materialLineDashOffset, materialLineDashSize, materialLineGapSize, materialLineScale, materialLineWidth, materialMetalness, materialNormal, materialOpacity, materialPointSize, materialReference, materialReflectivity, materialRefractionRatio, materialRotation, materialRoughness, materialSheen, materialSheenRoughness, materialShininess, materialSpecular, materialSpecularColor, materialSpecularIntensity, materialSpecularStrength, materialThickness, materialTransmission, max, maxMipLevel, mediumpModelViewMatrix, metalness, min, mix, mixElement, mod, modInt, modelDirection, modelNormalMatrix, modelPosition, modelRadius, modelScale, modelViewMatrix, modelViewPosition, modelViewProjection, modelWorldMatrix, modelWorldMatrixInverse, morphReference, mrt, mul, mx_aastep, mx_cell_noise_float, mx_contrast, mx_fractal_noise_float, mx_fractal_noise_vec2, mx_fractal_noise_vec3, mx_fractal_noise_vec4, mx_hsvtorgb, mx_noise_float, mx_noise_vec3, mx_noise_vec4, mx_ramplr, mx_ramptb, mx_rgbtohsv, mx_safepower, mx_splitlr, mx_splittb, mx_srgb_texture_to_lin_rec709, mx_transform_uv, mx_worley_noise_float, mx_worley_noise_vec2, mx_worley_noise_vec3, namespace, negate, neutralToneMapping, nodeArray, nodeImmutable, nodeObject, nodeObjects, nodeProxy, normalFlat, normalGeometry, normalLocal, normalMap, normalView, normalWorld, normalize, not, notEqual, numWorkgroups, objectDirection, objectGroup, objectPosition, objectRadius, objectScale, objectViewPosition, objectWorldMatrix, oneMinus, or, orthographicDepthToViewZ, oscSawtooth, oscSine, oscSquare, oscTriangle, output, outputStruct, overlay, overloadingFn, parabola, parallaxDirection, parallaxUV, parameter, pass, passTexture, pcurve, perspectiveDepthToViewZ, pmremTexture, pointShadow, pointUV, pointWidth, positionGeometry, positionLocal, positionPrevious, positionView, positionViewDirection, positionWorld, positionWorldDirection, posterize, pow, pow2, pow3, pow4, premultiplyAlpha, property, radians, rand, range, rangeFog, rangeFogFactor, reciprocal, reference, referenceBuffer, reflect, reflectVector, reflectView, reflector, refract, refractVector, refractView, reinhardToneMapping, remainder, remap, remapClamp, renderGroup, renderOutput, rendererReference, rotate, rotateUV, roughness, round, rtt, sRGBTransferEOTF, sRGBTransferOETF, sampler, samplerComparison, saturate, saturation, screen, screenCoordinate, screenSize, screenUV, scriptable, scriptableValue, select, setCurrentStack, shaderStages, shadow, shadowPositionWorld, shapeCircle, sharedUniformGroup, sheen, sheenRoughness, shiftLeft, shiftRight, shininess, sign, sin, sinc, skinning, smoothstep, smoothstepElement, specularColor, specularF90, spherizeUV, split, spritesheetUV, sqrt, stack, step, storage, storageBarrier, storageObject, storageTexture, string, struct, sub, subgroupIndex, subgroupSize, tan, tangentGeometry, tangentLocal, tangentView, tangentWorld, temp, texture, texture3D, textureBarrier, textureBicubic, textureCubeUV, textureLoad, textureSize, textureStore, thickness, time, timerDelta, timerGlobal, timerLocal, toneMapping, toneMappingExposure, toonOutlinePass, transformDirection, transformNormal, transformNormalToView, transformedBentNormalView, transformedBitangentView, transformedBitangentWorld, transformedClearcoatNormalView, transformedNormalView, transformedNormalWorld, transformedTangentView, transformedTangentWorld, transmission, transpose, triNoise3D, triplanarTexture, triplanarTextures, trunc, tslFn, uint, uniform, uniformArray, uniformCubeTexture, uniformGroup, uniformTexture, uniforms, unpremultiplyAlpha, userData, uv, uvec2, uvec3, uvec4, varying, varyingProperty, vec2, vec3, vec4, vectorComponents, velocity, vertexColor, vertexIndex, vibrance, viewZToLogarithmicDepth, viewZToOrthographicDepth, viewZToPerspectiveDepth, viewport, viewportBottomLeft, viewportCoordinate, viewportDepthTexture, viewportLinearDepth, viewportMipTexture, viewportResolution, viewportSafeUV, viewportSharedTexture, viewportSize, viewportTexture, viewportTopLeft, viewportUV, wgsl, wgslFn, workgroupArray, workgroupBarrier, workgroupId, workingToColorSpace, xor }; diff --git a/build/three.tsl.min.js b/build/three.tsl.min.js index 482c7620a89096..bb6bbca96ae6dd 100644 --- a/build/three.tsl.min.js +++ b/build/three.tsl.min.js @@ -3,4 +3,4 @@ * Copyright 2010-2025 Three.js Authors * SPDX-License-Identifier: MIT */ -import{TSL as e}from"three/webgpu";const t=e.BRDF_GGX,r=e.BRDF_Lambert,a=e.BasicShadowFilter,o=e.Break,i=e.Continue,n=e.DFGApprox,s=e.D_GGX,l=e.Discard,c=e.EPSILON,m=e.F_Schlick,p=e.Fn,d=e.INFINITY,u=e.If,g=e.Switch,h=e.Loop,f=e.NodeShaderStage,x=e.NodeType,b=e.NodeUpdateType,w=e.NodeAccess,v=e.PCFShadowFilter,S=e.PCFSoftShadowFilter,T=e.PI,_=e.PI2,V=e.Return,y=e.Schlick_to_F0,M=e.ScriptableNodeResources,D=e.ShaderNode,F=e.TBNViewMatrix,C=e.VSMShadowFilter,I=e.V_GGX_SmithCorrelated,P=e.abs,R=e.acesFilmicToneMapping,N=e.acos,B=e.add,L=e.addNodeElement,k=e.agxToneMapping,A=e.all,G=e.alphaT,O=e.and,W=e.anisotropy,j=e.anisotropyB,U=e.anisotropyT,z=e.any,q=e.append,E=e.array,Z=e.arrayBuffer,X=e.asin,Y=e.assign,H=e.atan,J=e.atan2,K=e.atomicAdd,Q=e.atomicAnd,$=e.atomicFunc,ee=e.atomicMax,te=e.atomicMin,re=e.atomicOr,ae=e.atomicStore,oe=e.atomicSub,ie=e.atomicXor,ne=e.atomicLoad,se=e.attenuationColor,le=e.attenuationDistance,ce=e.attribute,me=e.attributeArray,pe=e.backgroundBlurriness,de=e.backgroundIntensity,ue=e.backgroundRotation,ge=e.batch,he=e.billboarding,fe=e.bitAnd,xe=e.bitNot,be=e.bitOr,we=e.bitXor,ve=e.bitangentGeometry,Se=e.bitangentLocal,Te=e.bitangentView,_e=e.bitangentWorld,Ve=e.bitcast,ye=e.blendBurn,Me=e.blendColor,De=e.blendDodge,Fe=e.blendOverlay,Ce=e.blendScreen,Ie=e.blur,Pe=e.bool,Re=e.buffer,Ne=e.bufferAttribute,Be=e.bumpMap,Le=e.burn,ke=e.bvec2,Ae=e.bvec3,Ge=e.bvec4,Oe=e.bypass,We=e.cache,je=e.call,Ue=e.cameraFar,ze=e.cameraIndex,qe=e.cameraNear,Ee=e.cameraNormalMatrix,Ze=e.cameraPosition,Xe=e.cameraProjectionMatrix,Ye=e.cameraProjectionMatrixInverse,He=e.cameraViewMatrix,Je=e.cameraWorldMatrix,Ke=e.cbrt,Qe=e.cdl,$e=e.ceil,et=e.checker,tt=e.cineonToneMapping,rt=e.clamp,at=e.clearcoat,ot=e.clearcoatRoughness,it=e.code,nt=e.color,st=e.colorSpaceToWorking,lt=e.colorToDirection,ct=e.compute,mt=e.computeSkinning,pt=e.cond,dt=e.Const,ut=e.context,gt=e.convert,ht=e.convertColorSpace,ft=e.convertToTexture,xt=e.cos,bt=e.cross,wt=e.cubeTexture,vt=e.dFdx,St=e.dFdy,Tt=e.dashSize,_t=e.debug,Vt=e.decrement,yt=e.decrementBefore,Mt=e.defaultBuildStages,Dt=e.defaultShaderStages,Ft=e.defined,Ct=e.degrees,It=e.deltaTime,Pt=e.densityFog,Rt=e.densityFogFactor,Nt=e.depth,Bt=e.depthPass,Lt=e.difference,kt=e.diffuseColor,At=e.directPointLight,Gt=e.directionToColor,Ot=e.dispersion,Wt=e.distance,jt=e.div,Ut=e.dodge,zt=e.dot,qt=e.drawIndex,Et=e.dynamicBufferAttribute,Zt=e.element,Xt=e.emissive,Yt=e.equal,Ht=e.equals,Jt=e.equirectUV,Kt=e.exp,Qt=e.exp2,$t=e.expression,er=e.faceDirection,tr=e.faceForward,rr=e.faceforward,ar=e.float,or=e.floor,ir=e.fog,nr=e.fract,sr=e.frameGroup,lr=e.frameId,cr=e.frontFacing,mr=e.fwidth,pr=e.gain,dr=e.gapSize,ur=e.getConstNodeType,gr=e.getCurrentStack,hr=e.getDirection,fr=e.getDistanceAttenuation,xr=e.getGeometryRoughness,br=e.getNormalFromDepth,wr=e.getParallaxCorrectNormal,vr=e.getRoughness,Sr=e.getScreenPosition,Tr=e.getShIrradianceAt,_r=e.getTextureIndex,Vr=e.getViewPosition,yr=e.getShadowMaterial,Mr=e.getShadowRenderObjectFunction,Dr=e.glsl,Fr=e.glslFn,Cr=e.grayscale,Ir=e.greaterThan,Pr=e.greaterThanEqual,Rr=e.hash,Nr=e.highpModelNormalViewMatrix,Br=e.highpModelViewMatrix,Lr=e.hue,kr=e.increment,Ar=e.incrementBefore,Gr=e.instance,Or=e.instanceIndex,Wr=e.instancedArray,jr=e.instancedBufferAttribute,Ur=e.instancedDynamicBufferAttribute,zr=e.instancedMesh,qr=e.int,Er=e.inverseSqrt,Zr=e.inversesqrt,Xr=e.invocationLocalIndex,Yr=e.invocationSubgroupIndex,Hr=e.ior,Jr=e.iridescence,Kr=e.iridescenceIOR,Qr=e.iridescenceThickness,$r=e.ivec2,ea=e.ivec3,ta=e.ivec4,ra=e.js,aa=e.label,oa=e.length,ia=e.lengthSq,na=e.lessThan,sa=e.lessThanEqual,la=e.lightPosition,ca=e.lightShadowMatrix,ma=e.lightTargetDirection,pa=e.lightTargetPosition,da=e.lightViewPosition,ua=e.lightingContext,ga=e.lights,ha=e.linearDepth,fa=e.linearToneMapping,xa=e.localId,ba=e.globalId,wa=e.log,va=e.log2,Sa=e.logarithmicDepthToViewZ,Ta=e.loop,_a=e.luminance,Va=e.mediumpModelViewMatrix,ya=e.mat2,Ma=e.mat3,Da=e.mat4,Fa=e.matcapUV,Ca=e.materialAO,Ia=e.materialAlphaTest,Pa=e.materialAnisotropy,Ra=e.materialAnisotropyVector,Na=e.materialAttenuationColor,Ba=e.materialAttenuationDistance,La=e.materialClearcoat,ka=e.materialClearcoatNormal,Aa=e.materialClearcoatRoughness,Ga=e.materialColor,Oa=e.materialDispersion,Wa=e.materialEmissive,ja=e.materialIOR,Ua=e.materialIridescence,za=e.materialIridescenceIOR,qa=e.materialIridescenceThickness,Ea=e.materialLightMap,Za=e.materialLineDashOffset,Xa=e.materialLineDashSize,Ya=e.materialLineGapSize,Ha=e.materialLineScale,Ja=e.materialLineWidth,Ka=e.materialMetalness,Qa=e.materialNormal,$a=e.materialOpacity,eo=e.materialPointSize,to=e.materialReference,ro=e.materialReflectivity,ao=e.materialRefractionRatio,oo=e.materialRotation,io=e.materialRoughness,no=e.materialSheen,so=e.materialSheenRoughness,lo=e.materialShininess,co=e.materialSpecular,mo=e.materialSpecularColor,po=e.materialSpecularIntensity,uo=e.materialSpecularStrength,go=e.materialThickness,ho=e.materialTransmission,fo=e.max,xo=e.maxMipLevel,bo=e.metalness,wo=e.min,vo=e.mix,So=e.mixElement,To=e.mod,_o=e.modInt,Vo=e.modelDirection,yo=e.modelNormalMatrix,Mo=e.modelPosition,Do=e.modelRadius,Fo=e.modelScale,Co=e.modelViewMatrix,Io=e.modelViewPosition,Po=e.modelViewProjection,Ro=e.modelWorldMatrix,No=e.modelWorldMatrixInverse,Bo=e.morphReference,Lo=e.mrt,ko=e.mul,Ao=e.mx_aastep,Go=e.mx_cell_noise_float,Oo=e.mx_contrast,Wo=e.mx_fractal_noise_float,jo=e.mx_fractal_noise_vec2,Uo=e.mx_fractal_noise_vec3,zo=e.mx_fractal_noise_vec4,qo=e.mx_hsvtorgb,Eo=e.mx_noise_float,Zo=e.mx_noise_vec3,Xo=e.mx_noise_vec4,Yo=e.mx_ramplr,Ho=e.mx_ramptb,Jo=e.mx_rgbtohsv,Ko=e.mx_safepower,Qo=e.mx_splitlr,$o=e.mx_splittb,ei=e.mx_srgb_texture_to_lin_rec709,ti=e.mx_transform_uv,ri=e.mx_worley_noise_float,ai=e.mx_worley_noise_vec2,oi=e.mx_worley_noise_vec3,ii=e.namespace,ni=e.negate,si=e.neutralToneMapping,li=e.nodeArray,ci=e.nodeImmutable,mi=e.nodeObject,pi=e.nodeObjects,di=e.nodeProxy,ui=e.normalFlat,gi=e.normalGeometry,hi=e.normalLocal,fi=e.normalMap,xi=e.normalView,bi=e.normalWorld,wi=e.normalize,vi=e.not,Si=e.notEqual,Ti=e.numWorkgroups,_i=e.objectDirection,Vi=e.objectGroup,yi=e.objectPosition,Mi=e.objectRadius,Di=e.objectScale,Fi=e.objectViewPosition,Ci=e.objectWorldMatrix,Ii=e.oneMinus,Pi=e.or,Ri=e.orthographicDepthToViewZ,Ni=e.oscSawtooth,Bi=e.oscSine,Li=e.oscSquare,ki=e.oscTriangle,Ai=e.output,Gi=e.outputStruct,Oi=e.overlay,Wi=e.overloadingFn,ji=e.parabola,Ui=e.parallaxDirection,zi=e.parallaxUV,qi=e.parameter,Ei=e.pass,Zi=e.passTexture,Xi=e.pcurve,Yi=e.perspectiveDepthToViewZ,Hi=e.pmremTexture,Ji=e.pointUV,Ki=e.pointWidth,Qi=e.positionGeometry,$i=e.positionLocal,en=e.positionPrevious,tn=e.positionView,rn=e.positionViewDirection,an=e.positionWorld,on=e.positionWorldDirection,nn=e.posterize,sn=e.pow,ln=e.pow2,cn=e.pow3,mn=e.pow4,pn=e.premult,dn=e.property,un=e.radians,gn=e.rand,hn=e.range,fn=e.rangeFog,xn=e.rangeFogFactor,bn=e.reciprocal,wn=e.lightProjectionUV,vn=e.reference,Sn=e.referenceBuffer,Tn=e.reflect,_n=e.reflectVector,Vn=e.reflectView,yn=e.reflector,Mn=e.refract,Dn=e.refractVector,Fn=e.refractView,Cn=e.reinhardToneMapping,In=e.remainder,Pn=e.remap,Rn=e.remapClamp,Nn=e.renderGroup,Bn=e.renderOutput,Ln=e.rendererReference,kn=e.rotate,An=e.rotateUV,Gn=e.roughness,On=e.round,Wn=e.rtt,jn=e.sRGBTransferEOTF,Un=e.sRGBTransferOETF,zn=e.sampler,qn=e.samplerComparison,En=e.saturate,Zn=e.saturation,Xn=e.screen,Yn=e.screenCoordinate,Hn=e.screenSize,Jn=e.screenUV,Kn=e.scriptable,Qn=e.scriptableValue,$n=e.select,es=e.setCurrentStack,ts=e.shaderStages,rs=e.shadow,as=e.pointShadow,os=e.shadowPositionWorld,is=e.sharedUniformGroup,ns=e.shapeCircle,ss=e.sheen,ls=e.sheenRoughness,cs=e.shiftLeft,ms=e.shiftRight,ps=e.shininess,ds=e.sign,us=e.sin,gs=e.sinc,hs=e.skinning,fs=e.smoothstep,xs=e.smoothstepElement,bs=e.specularColor,ws=e.specularF90,vs=e.spherizeUV,Ss=e.split,Ts=e.spritesheetUV,_s=e.sqrt,Vs=e.stack,ys=e.step,Ms=e.storage,Ds=e.storageBarrier,Fs=e.storageObject,Cs=e.storageTexture,Is=e.string,Ps=e.struct,Rs=e.sub,Ns=e.subgroupIndex,Bs=e.subgroupSize,Ls=e.tan,ks=e.tangentGeometry,As=e.tangentLocal,Gs=e.tangentView,Os=e.tangentWorld,Ws=e.temp,js=e.texture,Us=e.texture3D,zs=e.textureBarrier,qs=e.textureBicubic,Es=e.textureCubeUV,Zs=e.textureLoad,Xs=e.textureSize,Ys=e.textureStore,Hs=e.thickness,Js=e.time,Ks=e.timerDelta,Qs=e.timerGlobal,$s=e.timerLocal,el=e.toneMapping,tl=e.toneMappingExposure,rl=e.toonOutlinePass,al=e.transformDirection,ol=e.transformNormal,il=e.transformNormalToView,nl=e.transformedBentNormalView,sl=e.transformedBitangentView,ll=e.transformedBitangentWorld,cl=e.transformedClearcoatNormalView,ml=e.transformedNormalView,pl=e.transformedNormalWorld,dl=e.transformedTangentView,ul=e.transformedTangentWorld,gl=e.transmission,hl=e.transpose,fl=e.triNoise3D,xl=e.triplanarTexture,bl=e.triplanarTextures,wl=e.trunc,vl=e.tslFn,Sl=e.uint,Tl=e.uniform,_l=e.uniformCubeTexture,Vl=e.uniformArray,yl=e.uniformGroup,Ml=e.uniformTexture,Dl=e.uniforms,Fl=e.unpremult,Cl=e.userData,Il=e.uv,Pl=e.uvec2,Rl=e.uvec3,Nl=e.uvec4,Bl=e.Var,Ll=e.varying,kl=e.varyingProperty,Al=e.vec2,Gl=e.vec3,Ol=e.vec4,Wl=e.vectorComponents,jl=e.velocity,Ul=e.vertexColor,zl=e.vertexIndex,ql=e.vibrance,El=e.viewZToLogarithmicDepth,Zl=e.viewZToOrthographicDepth,Xl=e.viewZToPerspectiveDepth,Yl=e.viewport,Hl=e.viewportBottomLeft,Jl=e.viewportCoordinate,Kl=e.viewportDepthTexture,Ql=e.viewportLinearDepth,$l=e.viewportMipTexture,ec=e.viewportResolution,tc=e.viewportSafeUV,rc=e.viewportSharedTexture,ac=e.viewportSize,oc=e.viewportTexture,ic=e.viewportTopLeft,nc=e.viewportUV,sc=e.wgsl,lc=e.wgslFn,cc=e.workgroupArray,mc=e.workgroupBarrier,pc=e.workgroupId,dc=e.workingToColorSpace,uc=e.xor;export{t as BRDF_GGX,r as BRDF_Lambert,a as BasicShadowFilter,o as Break,dt as Const,i as Continue,n as DFGApprox,s as D_GGX,l as Discard,c as EPSILON,m as F_Schlick,p as Fn,d as INFINITY,u as If,h as Loop,w as NodeAccess,f as NodeShaderStage,x as NodeType,b as NodeUpdateType,v as PCFShadowFilter,S as PCFSoftShadowFilter,T as PI,_ as PI2,V as Return,y as Schlick_to_F0,M as ScriptableNodeResources,D as ShaderNode,g as Switch,F as TBNViewMatrix,C as VSMShadowFilter,I as V_GGX_SmithCorrelated,Bl as Var,P as abs,R as acesFilmicToneMapping,N as acos,B as add,L as addNodeElement,k as agxToneMapping,A as all,G as alphaT,O as and,W as anisotropy,j as anisotropyB,U as anisotropyT,z as any,q as append,E as array,Z as arrayBuffer,X as asin,Y as assign,H as atan,J as atan2,K as atomicAdd,Q as atomicAnd,$ as atomicFunc,ne as atomicLoad,ee as atomicMax,te as atomicMin,re as atomicOr,ae as atomicStore,oe as atomicSub,ie as atomicXor,se as attenuationColor,le as attenuationDistance,ce as attribute,me as attributeArray,pe as backgroundBlurriness,de as backgroundIntensity,ue as backgroundRotation,ge as batch,he as billboarding,fe as bitAnd,xe as bitNot,be as bitOr,we as bitXor,ve as bitangentGeometry,Se as bitangentLocal,Te as bitangentView,_e as bitangentWorld,Ve as bitcast,ye as blendBurn,Me as blendColor,De as blendDodge,Fe as blendOverlay,Ce as blendScreen,Ie as blur,Pe as bool,Re as buffer,Ne as bufferAttribute,Be as bumpMap,Le as burn,ke as bvec2,Ae as bvec3,Ge as bvec4,Oe as bypass,We as cache,je as call,Ue as cameraFar,ze as cameraIndex,qe as cameraNear,Ee as cameraNormalMatrix,Ze as cameraPosition,Xe as cameraProjectionMatrix,Ye as cameraProjectionMatrixInverse,He as cameraViewMatrix,Je as cameraWorldMatrix,Ke as cbrt,Qe as cdl,$e as ceil,et as checker,tt as cineonToneMapping,rt as clamp,at as clearcoat,ot as clearcoatRoughness,it as code,nt as color,st as colorSpaceToWorking,lt as colorToDirection,ct as compute,mt as computeSkinning,pt as cond,ut as context,gt as convert,ht as convertColorSpace,ft as convertToTexture,xt as cos,bt as cross,wt as cubeTexture,vt as dFdx,St as dFdy,Tt as dashSize,_t as debug,Vt as decrement,yt as decrementBefore,Mt as defaultBuildStages,Dt as defaultShaderStages,Ft as defined,Ct as degrees,It as deltaTime,Pt as densityFog,Rt as densityFogFactor,Nt as depth,Bt as depthPass,Lt as difference,kt as diffuseColor,At as directPointLight,Gt as directionToColor,Ot as dispersion,Wt as distance,jt as div,Ut as dodge,zt as dot,qt as drawIndex,Et as dynamicBufferAttribute,Zt as element,Xt as emissive,Yt as equal,Ht as equals,Jt as equirectUV,Kt as exp,Qt as exp2,$t as expression,er as faceDirection,tr as faceForward,rr as faceforward,ar as float,or as floor,ir as fog,nr as fract,sr as frameGroup,lr as frameId,cr as frontFacing,mr as fwidth,pr as gain,dr as gapSize,ur as getConstNodeType,gr as getCurrentStack,hr as getDirection,fr as getDistanceAttenuation,xr as getGeometryRoughness,br as getNormalFromDepth,wr as getParallaxCorrectNormal,vr as getRoughness,Sr as getScreenPosition,Tr as getShIrradianceAt,yr as getShadowMaterial,Mr as getShadowRenderObjectFunction,_r as getTextureIndex,Vr as getViewPosition,ba as globalId,Dr as glsl,Fr as glslFn,Cr as grayscale,Ir as greaterThan,Pr as greaterThanEqual,Rr as hash,Nr as highpModelNormalViewMatrix,Br as highpModelViewMatrix,Lr as hue,kr as increment,Ar as incrementBefore,Gr as instance,Or as instanceIndex,Wr as instancedArray,jr as instancedBufferAttribute,Ur as instancedDynamicBufferAttribute,zr as instancedMesh,qr as int,Er as inverseSqrt,Zr as inversesqrt,Xr as invocationLocalIndex,Yr as invocationSubgroupIndex,Hr as ior,Jr as iridescence,Kr as iridescenceIOR,Qr as iridescenceThickness,$r as ivec2,ea as ivec3,ta as ivec4,ra as js,aa as label,oa as length,ia as lengthSq,na as lessThan,sa as lessThanEqual,la as lightPosition,wn as lightProjectionUV,ca as lightShadowMatrix,ma as lightTargetDirection,pa as lightTargetPosition,da as lightViewPosition,ua as lightingContext,ga as lights,ha as linearDepth,fa as linearToneMapping,xa as localId,wa as log,va as log2,Sa as logarithmicDepthToViewZ,Ta as loop,_a as luminance,ya as mat2,Ma as mat3,Da as mat4,Fa as matcapUV,Ca as materialAO,Ia as materialAlphaTest,Pa as materialAnisotropy,Ra as materialAnisotropyVector,Na as materialAttenuationColor,Ba as materialAttenuationDistance,La as materialClearcoat,ka as materialClearcoatNormal,Aa as materialClearcoatRoughness,Ga as materialColor,Oa as materialDispersion,Wa as materialEmissive,ja as materialIOR,Ua as materialIridescence,za as materialIridescenceIOR,qa as materialIridescenceThickness,Ea as materialLightMap,Za as materialLineDashOffset,Xa as materialLineDashSize,Ya as materialLineGapSize,Ha as materialLineScale,Ja as materialLineWidth,Ka as materialMetalness,Qa as materialNormal,$a as materialOpacity,eo as materialPointSize,to as materialReference,ro as materialReflectivity,ao as materialRefractionRatio,oo as materialRotation,io as materialRoughness,no as materialSheen,so as materialSheenRoughness,lo as materialShininess,co as materialSpecular,mo as materialSpecularColor,po as materialSpecularIntensity,uo as materialSpecularStrength,go as materialThickness,ho as materialTransmission,fo as max,xo as maxMipLevel,Va as mediumpModelViewMatrix,bo as metalness,wo as min,vo as mix,So as mixElement,To as mod,_o as modInt,Vo as modelDirection,yo as modelNormalMatrix,Mo as modelPosition,Do as modelRadius,Fo as modelScale,Co as modelViewMatrix,Io as modelViewPosition,Po as modelViewProjection,Ro as modelWorldMatrix,No as modelWorldMatrixInverse,Bo as morphReference,Lo as mrt,ko as mul,Ao as mx_aastep,Go as mx_cell_noise_float,Oo as mx_contrast,Wo as mx_fractal_noise_float,jo as mx_fractal_noise_vec2,Uo as mx_fractal_noise_vec3,zo as mx_fractal_noise_vec4,qo as mx_hsvtorgb,Eo as mx_noise_float,Zo as mx_noise_vec3,Xo as mx_noise_vec4,Yo as mx_ramplr,Ho as mx_ramptb,Jo as mx_rgbtohsv,Ko as mx_safepower,Qo as mx_splitlr,$o as mx_splittb,ei as mx_srgb_texture_to_lin_rec709,ti as mx_transform_uv,ri as mx_worley_noise_float,ai as mx_worley_noise_vec2,oi as mx_worley_noise_vec3,ii as namespace,ni as negate,si as neutralToneMapping,li as nodeArray,ci as nodeImmutable,mi as nodeObject,pi as nodeObjects,di as nodeProxy,ui as normalFlat,gi as normalGeometry,hi as normalLocal,fi as normalMap,xi as normalView,bi as normalWorld,wi as normalize,vi as not,Si as notEqual,Ti as numWorkgroups,_i as objectDirection,Vi as objectGroup,yi as objectPosition,Mi as objectRadius,Di as objectScale,Fi as objectViewPosition,Ci as objectWorldMatrix,Ii as oneMinus,Pi as or,Ri as orthographicDepthToViewZ,Ni as oscSawtooth,Bi as oscSine,Li as oscSquare,ki as oscTriangle,Ai as output,Gi as outputStruct,Oi as overlay,Wi as overloadingFn,ji as parabola,Ui as parallaxDirection,zi as parallaxUV,qi as parameter,Ei as pass,Zi as passTexture,Xi as pcurve,Yi as perspectiveDepthToViewZ,Hi as pmremTexture,as as pointShadow,Ji as pointUV,Ki as pointWidth,Qi as positionGeometry,$i as positionLocal,en as positionPrevious,tn as positionView,rn as positionViewDirection,an as positionWorld,on as positionWorldDirection,nn as posterize,sn as pow,ln as pow2,cn as pow3,mn as pow4,pn as premult,dn as property,un as radians,gn as rand,hn as range,fn as rangeFog,xn as rangeFogFactor,bn as reciprocal,vn as reference,Sn as referenceBuffer,Tn as reflect,_n as reflectVector,Vn as reflectView,yn as reflector,Mn as refract,Dn as refractVector,Fn as refractView,Cn as reinhardToneMapping,In as remainder,Pn as remap,Rn as remapClamp,Nn as renderGroup,Bn as renderOutput,Ln as rendererReference,kn as rotate,An as rotateUV,Gn as roughness,On as round,Wn as rtt,jn as sRGBTransferEOTF,Un as sRGBTransferOETF,zn as sampler,qn as samplerComparison,En as saturate,Zn as saturation,Xn as screen,Yn as screenCoordinate,Hn as screenSize,Jn as screenUV,Kn as scriptable,Qn as scriptableValue,$n as select,es as setCurrentStack,ts as shaderStages,rs as shadow,os as shadowPositionWorld,ns as shapeCircle,is as sharedUniformGroup,ss as sheen,ls as sheenRoughness,cs as shiftLeft,ms as shiftRight,ps as shininess,ds as sign,us as sin,gs as sinc,hs as skinning,fs as smoothstep,xs as smoothstepElement,bs as specularColor,ws as specularF90,vs as spherizeUV,Ss as split,Ts as spritesheetUV,_s as sqrt,Vs as stack,ys as step,Ms as storage,Ds as storageBarrier,Fs as storageObject,Cs as storageTexture,Is as string,Ps as struct,Rs as sub,Ns as subgroupIndex,Bs as subgroupSize,Ls as tan,ks as tangentGeometry,As as tangentLocal,Gs as tangentView,Os as tangentWorld,Ws as temp,js as texture,Us as texture3D,zs as textureBarrier,qs as textureBicubic,Es as textureCubeUV,Zs as textureLoad,Xs as textureSize,Ys as textureStore,Hs as thickness,Js as time,Ks as timerDelta,Qs as timerGlobal,$s as timerLocal,el as toneMapping,tl as toneMappingExposure,rl as toonOutlinePass,al as transformDirection,ol as transformNormal,il as transformNormalToView,nl as transformedBentNormalView,sl as transformedBitangentView,ll as transformedBitangentWorld,cl as transformedClearcoatNormalView,ml as transformedNormalView,pl as transformedNormalWorld,dl as transformedTangentView,ul as transformedTangentWorld,gl as transmission,hl as transpose,fl as triNoise3D,xl as triplanarTexture,bl as triplanarTextures,wl as trunc,vl as tslFn,Sl as uint,Tl as uniform,Vl as uniformArray,_l as uniformCubeTexture,yl as uniformGroup,Ml as uniformTexture,Dl as uniforms,Fl as unpremult,Cl as userData,Il as uv,Pl as uvec2,Rl as uvec3,Nl as uvec4,Ll as varying,kl as varyingProperty,Al as vec2,Gl as vec3,Ol as vec4,Wl as vectorComponents,jl as velocity,Ul as vertexColor,zl as vertexIndex,ql as vibrance,El as viewZToLogarithmicDepth,Zl as viewZToOrthographicDepth,Xl as viewZToPerspectiveDepth,Yl as viewport,Hl as viewportBottomLeft,Jl as viewportCoordinate,Kl as viewportDepthTexture,Ql as viewportLinearDepth,$l as viewportMipTexture,ec as viewportResolution,tc as viewportSafeUV,rc as viewportSharedTexture,ac as viewportSize,oc as viewportTexture,ic as viewportTopLeft,nc as viewportUV,sc as wgsl,lc as wgslFn,cc as workgroupArray,mc as workgroupBarrier,pc as workgroupId,dc as workingToColorSpace,uc as xor}; +import{TSL as e}from"three/webgpu";const t=e.BRDF_GGX,r=e.BRDF_Lambert,a=e.BasicShadowFilter,o=e.Break,i=e.Continue,n=e.DFGApprox,l=e.D_GGX,s=e.Discard,c=e.EPSILON,m=e.F_Schlick,p=e.Fn,d=e.INFINITY,u=e.If,g=e.Switch,h=e.Loop,f=e.NodeShaderStage,x=e.NodeType,b=e.NodeUpdateType,w=e.NodeAccess,v=e.PCFShadowFilter,S=e.PCFSoftShadowFilter,T=e.PI,_=e.PI2,V=e.Return,y=e.Schlick_to_F0,M=e.ScriptableNodeResources,D=e.ShaderNode,F=e.TBNViewMatrix,C=e.VSMShadowFilter,I=e.V_GGX_SmithCorrelated,P=e.abs,R=e.acesFilmicToneMapping,N=e.acos,B=e.add,A=e.addNodeElement,L=e.agxToneMapping,k=e.all,G=e.alphaT,O=e.and,W=e.anisotropy,j=e.anisotropyB,U=e.anisotropyT,z=e.any,q=e.append,E=e.array,Z=e.arrayBuffer,X=e.asin,Y=e.assign,H=e.atan,J=e.atan2,K=e.atomicAdd,Q=e.atomicAnd,$=e.atomicFunc,ee=e.atomicMax,te=e.atomicMin,re=e.atomicOr,ae=e.atomicStore,oe=e.atomicSub,ie=e.atomicXor,ne=e.atomicLoad,le=e.attenuationColor,se=e.attenuationDistance,ce=e.attribute,me=e.attributeArray,pe=e.backgroundBlurriness,de=e.backgroundIntensity,ue=e.backgroundRotation,ge=e.batch,he=e.billboarding,fe=e.bitAnd,xe=e.bitNot,be=e.bitOr,we=e.bitXor,ve=e.bitangentGeometry,Se=e.bitangentLocal,Te=e.bitangentView,_e=e.bitangentWorld,Ve=e.bitcast,ye=e.blendBurn,Me=e.blendColor,De=e.blendDodge,Fe=e.blendOverlay,Ce=e.blendScreen,Ie=e.blur,Pe=e.bool,Re=e.buffer,Ne=e.bufferAttribute,Be=e.bumpMap,Ae=e.burn,Le=e.bvec2,ke=e.bvec3,Ge=e.bvec4,Oe=e.bypass,We=e.cache,je=e.call,Ue=e.cameraFar,ze=e.cameraIndex,qe=e.cameraNear,Ee=e.cameraNormalMatrix,Ze=e.cameraPosition,Xe=e.cameraProjectionMatrix,Ye=e.cameraProjectionMatrixInverse,He=e.cameraViewMatrix,Je=e.cameraWorldMatrix,Ke=e.cbrt,Qe=e.cdl,$e=e.ceil,et=e.checker,tt=e.cineonToneMapping,rt=e.clamp,at=e.clearcoat,ot=e.clearcoatRoughness,it=e.code,nt=e.color,lt=e.colorSpaceToWorking,st=e.colorToDirection,ct=e.compute,mt=e.computeSkinning,pt=e.cond,dt=e.Const,ut=e.context,gt=e.convert,ht=e.convertColorSpace,ft=e.convertToTexture,xt=e.cos,bt=e.cross,wt=e.cubeTexture,vt=e.dFdx,St=e.dFdy,Tt=e.dashSize,_t=e.debug,Vt=e.decrement,yt=e.decrementBefore,Mt=e.defaultBuildStages,Dt=e.defaultShaderStages,Ft=e.defined,Ct=e.degrees,It=e.deltaTime,Pt=e.densityFog,Rt=e.densityFogFactor,Nt=e.depth,Bt=e.depthPass,At=e.difference,Lt=e.diffuseColor,kt=e.directPointLight,Gt=e.directionToColor,Ot=e.dispersion,Wt=e.distance,jt=e.div,Ut=e.dodge,zt=e.dot,qt=e.drawIndex,Et=e.dynamicBufferAttribute,Zt=e.element,Xt=e.emissive,Yt=e.equal,Ht=e.equals,Jt=e.equirectUV,Kt=e.exp,Qt=e.exp2,$t=e.expression,er=e.faceDirection,tr=e.faceForward,rr=e.faceforward,ar=e.float,or=e.floor,ir=e.fog,nr=e.fract,lr=e.frameGroup,sr=e.frameId,cr=e.frontFacing,mr=e.fwidth,pr=e.gain,dr=e.gapSize,ur=e.getConstNodeType,gr=e.getCurrentStack,hr=e.getDirection,fr=e.getDistanceAttenuation,xr=e.getGeometryRoughness,br=e.getNormalFromDepth,wr=e.getParallaxCorrectNormal,vr=e.getRoughness,Sr=e.getScreenPosition,Tr=e.getShIrradianceAt,_r=e.getTextureIndex,Vr=e.getViewPosition,yr=e.getShadowMaterial,Mr=e.getShadowRenderObjectFunction,Dr=e.glsl,Fr=e.glslFn,Cr=e.grayscale,Ir=e.greaterThan,Pr=e.greaterThanEqual,Rr=e.hash,Nr=e.highpModelNormalViewMatrix,Br=e.highpModelViewMatrix,Ar=e.hue,Lr=e.increment,kr=e.incrementBefore,Gr=e.instance,Or=e.instanceIndex,Wr=e.instancedArray,jr=e.instancedBufferAttribute,Ur=e.instancedDynamicBufferAttribute,zr=e.instancedMesh,qr=e.int,Er=e.inverseSqrt,Zr=e.inversesqrt,Xr=e.invocationLocalIndex,Yr=e.invocationSubgroupIndex,Hr=e.ior,Jr=e.iridescence,Kr=e.iridescenceIOR,Qr=e.iridescenceThickness,$r=e.ivec2,ea=e.ivec3,ta=e.ivec4,ra=e.js,aa=e.label,oa=e.length,ia=e.lengthSq,na=e.lessThan,la=e.lessThanEqual,sa=e.lightPosition,ca=e.lightShadowMatrix,ma=e.lightTargetDirection,pa=e.lightTargetPosition,da=e.lightViewPosition,ua=e.lightingContext,ga=e.lights,ha=e.linearDepth,fa=e.linearToneMapping,xa=e.localId,ba=e.globalId,wa=e.log,va=e.log2,Sa=e.logarithmicDepthToViewZ,Ta=e.loop,_a=e.luminance,Va=e.mediumpModelViewMatrix,ya=e.mat2,Ma=e.mat3,Da=e.mat4,Fa=e.matcapUV,Ca=e.materialAO,Ia=e.materialAlphaTest,Pa=e.materialAnisotropy,Ra=e.materialAnisotropyVector,Na=e.materialAttenuationColor,Ba=e.materialAttenuationDistance,Aa=e.materialClearcoat,La=e.materialClearcoatNormal,ka=e.materialClearcoatRoughness,Ga=e.materialColor,Oa=e.materialDispersion,Wa=e.materialEmissive,ja=e.materialIOR,Ua=e.materialIridescence,za=e.materialIridescenceIOR,qa=e.materialIridescenceThickness,Ea=e.materialLightMap,Za=e.materialLineDashOffset,Xa=e.materialLineDashSize,Ya=e.materialLineGapSize,Ha=e.materialLineScale,Ja=e.materialLineWidth,Ka=e.materialMetalness,Qa=e.materialNormal,$a=e.materialOpacity,eo=e.materialPointSize,to=e.materialReference,ro=e.materialReflectivity,ao=e.materialRefractionRatio,oo=e.materialRotation,io=e.materialRoughness,no=e.materialSheen,lo=e.materialSheenRoughness,so=e.materialShininess,co=e.materialSpecular,mo=e.materialSpecularColor,po=e.materialSpecularIntensity,uo=e.materialSpecularStrength,go=e.materialThickness,ho=e.materialTransmission,fo=e.max,xo=e.maxMipLevel,bo=e.metalness,wo=e.min,vo=e.mix,So=e.mixElement,To=e.mod,_o=e.modInt,Vo=e.modelDirection,yo=e.modelNormalMatrix,Mo=e.modelPosition,Do=e.modelRadius,Fo=e.modelScale,Co=e.modelViewMatrix,Io=e.modelViewPosition,Po=e.modelViewProjection,Ro=e.modelWorldMatrix,No=e.modelWorldMatrixInverse,Bo=e.morphReference,Ao=e.mrt,Lo=e.mul,ko=e.mx_aastep,Go=e.mx_cell_noise_float,Oo=e.mx_contrast,Wo=e.mx_fractal_noise_float,jo=e.mx_fractal_noise_vec2,Uo=e.mx_fractal_noise_vec3,zo=e.mx_fractal_noise_vec4,qo=e.mx_hsvtorgb,Eo=e.mx_noise_float,Zo=e.mx_noise_vec3,Xo=e.mx_noise_vec4,Yo=e.mx_ramplr,Ho=e.mx_ramptb,Jo=e.mx_rgbtohsv,Ko=e.mx_safepower,Qo=e.mx_splitlr,$o=e.mx_splittb,ei=e.mx_srgb_texture_to_lin_rec709,ti=e.mx_transform_uv,ri=e.mx_worley_noise_float,ai=e.mx_worley_noise_vec2,oi=e.mx_worley_noise_vec3,ii=e.namespace,ni=e.negate,li=e.neutralToneMapping,si=e.nodeArray,ci=e.nodeImmutable,mi=e.nodeObject,pi=e.nodeObjects,di=e.nodeProxy,ui=e.normalFlat,gi=e.normalGeometry,hi=e.normalLocal,fi=e.normalMap,xi=e.normalView,bi=e.normalWorld,wi=e.normalize,vi=e.not,Si=e.notEqual,Ti=e.numWorkgroups,_i=e.objectDirection,Vi=e.objectGroup,yi=e.objectPosition,Mi=e.objectRadius,Di=e.objectScale,Fi=e.objectViewPosition,Ci=e.objectWorldMatrix,Ii=e.oneMinus,Pi=e.or,Ri=e.orthographicDepthToViewZ,Ni=e.oscSawtooth,Bi=e.oscSine,Ai=e.oscSquare,Li=e.oscTriangle,ki=e.output,Gi=e.outputStruct,Oi=e.overlay,Wi=e.overloadingFn,ji=e.parabola,Ui=e.parallaxDirection,zi=e.parallaxUV,qi=e.parameter,Ei=e.pass,Zi=e.passTexture,Xi=e.pcurve,Yi=e.perspectiveDepthToViewZ,Hi=e.pmremTexture,Ji=e.pointUV,Ki=e.pointWidth,Qi=e.positionGeometry,$i=e.positionLocal,en=e.positionPrevious,tn=e.positionView,rn=e.positionViewDirection,an=e.positionWorld,on=e.positionWorldDirection,nn=e.posterize,ln=e.pow,sn=e.pow2,cn=e.pow3,mn=e.pow4,pn=e.premultiplyAlpha,dn=e.property,un=e.radians,gn=e.rand,hn=e.range,fn=e.rangeFog,xn=e.rangeFogFactor,bn=e.reciprocal,wn=e.lightProjectionUV,vn=e.reference,Sn=e.referenceBuffer,Tn=e.reflect,_n=e.reflectVector,Vn=e.reflectView,yn=e.reflector,Mn=e.refract,Dn=e.refractVector,Fn=e.refractView,Cn=e.reinhardToneMapping,In=e.remainder,Pn=e.remap,Rn=e.remapClamp,Nn=e.renderGroup,Bn=e.renderOutput,An=e.rendererReference,Ln=e.rotate,kn=e.rotateUV,Gn=e.roughness,On=e.round,Wn=e.rtt,jn=e.sRGBTransferEOTF,Un=e.sRGBTransferOETF,zn=e.sampler,qn=e.samplerComparison,En=e.saturate,Zn=e.saturation,Xn=e.screen,Yn=e.screenCoordinate,Hn=e.screenSize,Jn=e.screenUV,Kn=e.scriptable,Qn=e.scriptableValue,$n=e.select,el=e.setCurrentStack,tl=e.shaderStages,rl=e.shadow,al=e.pointShadow,ol=e.shadowPositionWorld,il=e.sharedUniformGroup,nl=e.shapeCircle,ll=e.sheen,sl=e.sheenRoughness,cl=e.shiftLeft,ml=e.shiftRight,pl=e.shininess,dl=e.sign,ul=e.sin,gl=e.sinc,hl=e.skinning,fl=e.smoothstep,xl=e.smoothstepElement,bl=e.specularColor,wl=e.specularF90,vl=e.spherizeUV,Sl=e.split,Tl=e.spritesheetUV,_l=e.sqrt,Vl=e.stack,yl=e.step,Ml=e.storage,Dl=e.storageBarrier,Fl=e.storageObject,Cl=e.storageTexture,Il=e.string,Pl=e.struct,Rl=e.sub,Nl=e.subgroupIndex,Bl=e.subgroupSize,Al=e.tan,Ll=e.tangentGeometry,kl=e.tangentLocal,Gl=e.tangentView,Ol=e.tangentWorld,Wl=e.temp,jl=e.texture,Ul=e.texture3D,zl=e.textureBarrier,ql=e.textureBicubic,El=e.textureCubeUV,Zl=e.textureLoad,Xl=e.textureSize,Yl=e.textureStore,Hl=e.thickness,Jl=e.time,Kl=e.timerDelta,Ql=e.timerGlobal,$l=e.timerLocal,es=e.toneMapping,ts=e.toneMappingExposure,rs=e.toonOutlinePass,as=e.transformDirection,os=e.transformNormal,is=e.transformNormalToView,ns=e.transformedBentNormalView,ls=e.transformedBitangentView,ss=e.transformedBitangentWorld,cs=e.transformedClearcoatNormalView,ms=e.transformedNormalView,ps=e.transformedNormalWorld,ds=e.transformedTangentView,us=e.transformedTangentWorld,gs=e.transmission,hs=e.transpose,fs=e.triNoise3D,xs=e.triplanarTexture,bs=e.triplanarTextures,ws=e.trunc,vs=e.tslFn,Ss=e.uint,Ts=e.uniform,_s=e.uniformCubeTexture,Vs=e.uniformArray,ys=e.uniformGroup,Ms=e.uniformTexture,Ds=e.uniforms,Fs=e.unpremultiplyAlpha,Cs=e.userData,Is=e.uv,Ps=e.uvec2,Rs=e.uvec3,Ns=e.uvec4,Bs=e.Var,As=e.varying,Ls=e.varyingProperty,ks=e.vec2,Gs=e.vec3,Os=e.vec4,Ws=e.vectorComponents,js=e.velocity,Us=e.vertexColor,zs=e.vertexIndex,qs=e.vibrance,Es=e.viewZToLogarithmicDepth,Zs=e.viewZToOrthographicDepth,Xs=e.viewZToPerspectiveDepth,Ys=e.viewport,Hs=e.viewportBottomLeft,Js=e.viewportCoordinate,Ks=e.viewportDepthTexture,Qs=e.viewportLinearDepth,$s=e.viewportMipTexture,ec=e.viewportResolution,tc=e.viewportSafeUV,rc=e.viewportSharedTexture,ac=e.viewportSize,oc=e.viewportTexture,ic=e.viewportTopLeft,nc=e.viewportUV,lc=e.wgsl,sc=e.wgslFn,cc=e.workgroupArray,mc=e.workgroupBarrier,pc=e.workgroupId,dc=e.workingToColorSpace,uc=e.xor;export{t as BRDF_GGX,r as BRDF_Lambert,a as BasicShadowFilter,o as Break,dt as Const,i as Continue,n as DFGApprox,l as D_GGX,s as Discard,c as EPSILON,m as F_Schlick,p as Fn,d as INFINITY,u as If,h as Loop,w as NodeAccess,f as NodeShaderStage,x as NodeType,b as NodeUpdateType,v as PCFShadowFilter,S as PCFSoftShadowFilter,T as PI,_ as PI2,V as Return,y as Schlick_to_F0,M as ScriptableNodeResources,D as ShaderNode,g as Switch,F as TBNViewMatrix,C as VSMShadowFilter,I as V_GGX_SmithCorrelated,Bs as Var,P as abs,R as acesFilmicToneMapping,N as acos,B as add,A as addNodeElement,L as agxToneMapping,k as all,G as alphaT,O as and,W as anisotropy,j as anisotropyB,U as anisotropyT,z as any,q as append,E as array,Z as arrayBuffer,X as asin,Y as assign,H as atan,J as atan2,K as atomicAdd,Q as atomicAnd,$ as atomicFunc,ne as atomicLoad,ee as atomicMax,te as atomicMin,re as atomicOr,ae as atomicStore,oe as atomicSub,ie as atomicXor,le as attenuationColor,se as attenuationDistance,ce as attribute,me as attributeArray,pe as backgroundBlurriness,de as backgroundIntensity,ue as backgroundRotation,ge as batch,he as billboarding,fe as bitAnd,xe as bitNot,be as bitOr,we as bitXor,ve as bitangentGeometry,Se as bitangentLocal,Te as bitangentView,_e as bitangentWorld,Ve as bitcast,ye as blendBurn,Me as blendColor,De as blendDodge,Fe as blendOverlay,Ce as blendScreen,Ie as blur,Pe as bool,Re as buffer,Ne as bufferAttribute,Be as bumpMap,Ae as burn,Le as bvec2,ke as bvec3,Ge as bvec4,Oe as bypass,We as cache,je as call,Ue as cameraFar,ze as cameraIndex,qe as cameraNear,Ee as cameraNormalMatrix,Ze as cameraPosition,Xe as cameraProjectionMatrix,Ye as cameraProjectionMatrixInverse,He as cameraViewMatrix,Je as cameraWorldMatrix,Ke as cbrt,Qe as cdl,$e as ceil,et as checker,tt as cineonToneMapping,rt as clamp,at as clearcoat,ot as clearcoatRoughness,it as code,nt as color,lt as colorSpaceToWorking,st as colorToDirection,ct as compute,mt as computeSkinning,pt as cond,ut as context,gt as convert,ht as convertColorSpace,ft as convertToTexture,xt as cos,bt as cross,wt as cubeTexture,vt as dFdx,St as dFdy,Tt as dashSize,_t as debug,Vt as decrement,yt as decrementBefore,Mt as defaultBuildStages,Dt as defaultShaderStages,Ft as defined,Ct as degrees,It as deltaTime,Pt as densityFog,Rt as densityFogFactor,Nt as depth,Bt as depthPass,At as difference,Lt as diffuseColor,kt as directPointLight,Gt as directionToColor,Ot as dispersion,Wt as distance,jt as div,Ut as dodge,zt as dot,qt as drawIndex,Et as dynamicBufferAttribute,Zt as element,Xt as emissive,Yt as equal,Ht as equals,Jt as equirectUV,Kt as exp,Qt as exp2,$t as expression,er as faceDirection,tr as faceForward,rr as faceforward,ar as float,or as floor,ir as fog,nr as fract,lr as frameGroup,sr as frameId,cr as frontFacing,mr as fwidth,pr as gain,dr as gapSize,ur as getConstNodeType,gr as getCurrentStack,hr as getDirection,fr as getDistanceAttenuation,xr as getGeometryRoughness,br as getNormalFromDepth,wr as getParallaxCorrectNormal,vr as getRoughness,Sr as getScreenPosition,Tr as getShIrradianceAt,yr as getShadowMaterial,Mr as getShadowRenderObjectFunction,_r as getTextureIndex,Vr as getViewPosition,ba as globalId,Dr as glsl,Fr as glslFn,Cr as grayscale,Ir as greaterThan,Pr as greaterThanEqual,Rr as hash,Nr as highpModelNormalViewMatrix,Br as highpModelViewMatrix,Ar as hue,Lr as increment,kr as incrementBefore,Gr as instance,Or as instanceIndex,Wr as instancedArray,jr as instancedBufferAttribute,Ur as instancedDynamicBufferAttribute,zr as instancedMesh,qr as int,Er as inverseSqrt,Zr as inversesqrt,Xr as invocationLocalIndex,Yr as invocationSubgroupIndex,Hr as ior,Jr as iridescence,Kr as iridescenceIOR,Qr as iridescenceThickness,$r as ivec2,ea as ivec3,ta as ivec4,ra as js,aa as label,oa as length,ia as lengthSq,na as lessThan,la as lessThanEqual,sa as lightPosition,wn as lightProjectionUV,ca as lightShadowMatrix,ma as lightTargetDirection,pa as lightTargetPosition,da as lightViewPosition,ua as lightingContext,ga as lights,ha as linearDepth,fa as linearToneMapping,xa as localId,wa as log,va as log2,Sa as logarithmicDepthToViewZ,Ta as loop,_a as luminance,ya as mat2,Ma as mat3,Da as mat4,Fa as matcapUV,Ca as materialAO,Ia as materialAlphaTest,Pa as materialAnisotropy,Ra as materialAnisotropyVector,Na as materialAttenuationColor,Ba as materialAttenuationDistance,Aa as materialClearcoat,La as materialClearcoatNormal,ka as materialClearcoatRoughness,Ga as materialColor,Oa as materialDispersion,Wa as materialEmissive,ja as materialIOR,Ua as materialIridescence,za as materialIridescenceIOR,qa as materialIridescenceThickness,Ea as materialLightMap,Za as materialLineDashOffset,Xa as materialLineDashSize,Ya as materialLineGapSize,Ha as materialLineScale,Ja as materialLineWidth,Ka as materialMetalness,Qa as materialNormal,$a as materialOpacity,eo as materialPointSize,to as materialReference,ro as materialReflectivity,ao as materialRefractionRatio,oo as materialRotation,io as materialRoughness,no as materialSheen,lo as materialSheenRoughness,so as materialShininess,co as materialSpecular,mo as materialSpecularColor,po as materialSpecularIntensity,uo as materialSpecularStrength,go as materialThickness,ho as materialTransmission,fo as max,xo as maxMipLevel,Va as mediumpModelViewMatrix,bo as metalness,wo as min,vo as mix,So as mixElement,To as mod,_o as modInt,Vo as modelDirection,yo as modelNormalMatrix,Mo as modelPosition,Do as modelRadius,Fo as modelScale,Co as modelViewMatrix,Io as modelViewPosition,Po as modelViewProjection,Ro as modelWorldMatrix,No as modelWorldMatrixInverse,Bo as morphReference,Ao as mrt,Lo as mul,ko as mx_aastep,Go as mx_cell_noise_float,Oo as mx_contrast,Wo as mx_fractal_noise_float,jo as mx_fractal_noise_vec2,Uo as mx_fractal_noise_vec3,zo as mx_fractal_noise_vec4,qo as mx_hsvtorgb,Eo as mx_noise_float,Zo as mx_noise_vec3,Xo as mx_noise_vec4,Yo as mx_ramplr,Ho as mx_ramptb,Jo as mx_rgbtohsv,Ko as mx_safepower,Qo as mx_splitlr,$o as mx_splittb,ei as mx_srgb_texture_to_lin_rec709,ti as mx_transform_uv,ri as mx_worley_noise_float,ai as mx_worley_noise_vec2,oi as mx_worley_noise_vec3,ii as namespace,ni as negate,li as neutralToneMapping,si as nodeArray,ci as nodeImmutable,mi as nodeObject,pi as nodeObjects,di as nodeProxy,ui as normalFlat,gi as normalGeometry,hi as normalLocal,fi as normalMap,xi as normalView,bi as normalWorld,wi as normalize,vi as not,Si as notEqual,Ti as numWorkgroups,_i as objectDirection,Vi as objectGroup,yi as objectPosition,Mi as objectRadius,Di as objectScale,Fi as objectViewPosition,Ci as objectWorldMatrix,Ii as oneMinus,Pi as or,Ri as orthographicDepthToViewZ,Ni as oscSawtooth,Bi as oscSine,Ai as oscSquare,Li as oscTriangle,ki as output,Gi as outputStruct,Oi as overlay,Wi as overloadingFn,ji as parabola,Ui as parallaxDirection,zi as parallaxUV,qi as parameter,Ei as pass,Zi as passTexture,Xi as pcurve,Yi as perspectiveDepthToViewZ,Hi as pmremTexture,al as pointShadow,Ji as pointUV,Ki as pointWidth,Qi as positionGeometry,$i as positionLocal,en as positionPrevious,tn as positionView,rn as positionViewDirection,an as positionWorld,on as positionWorldDirection,nn as posterize,ln as pow,sn as pow2,cn as pow3,mn as pow4,pn as premultiplyAlpha,dn as property,un as radians,gn as rand,hn as range,fn as rangeFog,xn as rangeFogFactor,bn as reciprocal,vn as reference,Sn as referenceBuffer,Tn as reflect,_n as reflectVector,Vn as reflectView,yn as reflector,Mn as refract,Dn as refractVector,Fn as refractView,Cn as reinhardToneMapping,In as remainder,Pn as remap,Rn as remapClamp,Nn as renderGroup,Bn as renderOutput,An as rendererReference,Ln as rotate,kn as rotateUV,Gn as roughness,On as round,Wn as rtt,jn as sRGBTransferEOTF,Un as sRGBTransferOETF,zn as sampler,qn as samplerComparison,En as saturate,Zn as saturation,Xn as screen,Yn as screenCoordinate,Hn as screenSize,Jn as screenUV,Kn as scriptable,Qn as scriptableValue,$n as select,el as setCurrentStack,tl as shaderStages,rl as shadow,ol as shadowPositionWorld,nl as shapeCircle,il as sharedUniformGroup,ll as sheen,sl as sheenRoughness,cl as shiftLeft,ml as shiftRight,pl as shininess,dl as sign,ul as sin,gl as sinc,hl as skinning,fl as smoothstep,xl as smoothstepElement,bl as specularColor,wl as specularF90,vl as spherizeUV,Sl as split,Tl as spritesheetUV,_l as sqrt,Vl as stack,yl as step,Ml as storage,Dl as storageBarrier,Fl as storageObject,Cl as storageTexture,Il as string,Pl as struct,Rl as sub,Nl as subgroupIndex,Bl as subgroupSize,Al as tan,Ll as tangentGeometry,kl as tangentLocal,Gl as tangentView,Ol as tangentWorld,Wl as temp,jl as texture,Ul as texture3D,zl as textureBarrier,ql as textureBicubic,El as textureCubeUV,Zl as textureLoad,Xl as textureSize,Yl as textureStore,Hl as thickness,Jl as time,Kl as timerDelta,Ql as timerGlobal,$l as timerLocal,es as toneMapping,ts as toneMappingExposure,rs as toonOutlinePass,as as transformDirection,os as transformNormal,is as transformNormalToView,ns as transformedBentNormalView,ls as transformedBitangentView,ss as transformedBitangentWorld,cs as transformedClearcoatNormalView,ms as transformedNormalView,ps as transformedNormalWorld,ds as transformedTangentView,us as transformedTangentWorld,gs as transmission,hs as transpose,fs as triNoise3D,xs as triplanarTexture,bs as triplanarTextures,ws as trunc,vs as tslFn,Ss as uint,Ts as uniform,Vs as uniformArray,_s as uniformCubeTexture,ys as uniformGroup,Ms as uniformTexture,Ds as uniforms,Fs as unpremultiplyAlpha,Cs as userData,Is as uv,Ps as uvec2,Rs as uvec3,Ns as uvec4,As as varying,Ls as varyingProperty,ks as vec2,Gs as vec3,Os as vec4,Ws as vectorComponents,js as velocity,Us as vertexColor,zs as vertexIndex,qs as vibrance,Es as viewZToLogarithmicDepth,Zs as viewZToOrthographicDepth,Xs as viewZToPerspectiveDepth,Ys as viewport,Hs as viewportBottomLeft,Js as viewportCoordinate,Ks as viewportDepthTexture,Qs as viewportLinearDepth,$s as viewportMipTexture,ec as viewportResolution,tc as viewportSafeUV,rc as viewportSharedTexture,ac as viewportSize,oc as viewportTexture,ic as viewportTopLeft,nc as viewportUV,lc as wgsl,sc as wgslFn,cc as workgroupArray,mc as workgroupBarrier,pc as workgroupId,dc as workingToColorSpace,uc as xor}; diff --git a/build/three.webgpu.js b/build/three.webgpu.js index 7d4b6c1e7f875e..976c4a201bd0bc 100644 --- a/build/three.webgpu.js +++ b/build/three.webgpu.js @@ -17577,6 +17577,238 @@ class VertexColorNode extends AttributeNode { */ const vertexColor = ( index = 0 ) => nodeObject( new VertexColorNode( index ) ); +/** + * Represents a "Color Burn" blend mode. + * + * It's designed to darken the base layer's colors based on the color of the blend layer. + * It significantly increases the contrast of the base layer, making the colors more vibrant and saturated. + * The darker the color in the blend layer, the stronger the darkening and contrast effect on the base layer. + * + * @tsl + * @function + * @param {Node} base - The base color. + * @param {Node} blend - The blend color. A white (#ffffff) blend color does not alter the base color. + * @return {Node} The result. + */ +const blendBurn = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { + + return min$1( 1.0, base.oneMinus().div( blend ) ).oneMinus(); + +} ).setLayout( { + name: 'blendBurn', + type: 'vec3', + inputs: [ + { name: 'base', type: 'vec3' }, + { name: 'blend', type: 'vec3' } + ] +} ); + +/** + * Represents a "Color Dodge" blend mode. + * + * It's designed to lighten the base layer's colors based on the color of the blend layer. + * It significantly increases the brightness of the base layer, making the colors lighter and more vibrant. + * The brighter the color in the blend layer, the stronger the lightening and contrast effect on the base layer. + * + * @tsl + * @function + * @param {Node} base - The base color. + * @param {Node} blend - The blend color. A black (#000000) blend color does not alter the base color. + * @return {Node} The result. + */ +const blendDodge = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { + + return min$1( base.div( blend.oneMinus() ), 1.0 ); + +} ).setLayout( { + name: 'blendDodge', + type: 'vec3', + inputs: [ + { name: 'base', type: 'vec3' }, + { name: 'blend', type: 'vec3' } + ] +} ); + +/** + * Represents a "Screen" blend mode. + * + * Similar to `blendDodge()`, this mode also lightens the base layer's colors based on the color of the blend layer. + * The "Screen" blend mode is better for general brightening whereas the "Dodge" results in more subtle and nuanced + * effects. + * + * @tsl + * @function + * @param {Node} base - The base color. + * @param {Node} blend - The blend color. A black (#000000) blend color does not alter the base color. + * @return {Node} The result. + */ +const blendScreen = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { + + return base.oneMinus().mul( blend.oneMinus() ).oneMinus(); + +} ).setLayout( { + name: 'blendScreen', + type: 'vec3', + inputs: [ + { name: 'base', type: 'vec3' }, + { name: 'blend', type: 'vec3' } + ] +} ); + +/** + * Represents a "Overlay" blend mode. + * + * It's designed to increase the contrast of the base layer based on the color of the blend layer. + * It amplifies the existing colors and contrast in the base layer, making lighter areas lighter and darker areas darker. + * The color of the blend layer significantly influences the resulting contrast and color shift in the base layer. + * + * @tsl + * @function + * @param {Node} base - The base color. + * @param {Node} blend - The blend color + * @return {Node} The result. + */ +const blendOverlay = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { + + return mix( base.mul( 2.0 ).mul( blend ), base.oneMinus().mul( 2.0 ).mul( blend.oneMinus() ).oneMinus(), step( 0.5, base ) ); + +} ).setLayout( { + name: 'blendOverlay', + type: 'vec3', + inputs: [ + { name: 'base', type: 'vec3' }, + { name: 'blend', type: 'vec3' } + ] +} ); + +/** + * This function blends two color based on their alpha values by replicating the behavior of `THREE.NormalBlending`. + * It assumes both input colors have non-premultiplied alpha. + * + * @tsl + * @function + * @param {Node} base - The base color. + * @param {Node} blend - The blend color + * @return {Node} The result. + */ +const blendColor = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { + + const outAlpha = blend.a.add( base.a.mul( blend.a.oneMinus() ) ); + + return vec4( blend.rgb.mul( blend.a ).add( base.rgb.mul( base.a ).mul( blend.a.oneMinus() ) ).div( outAlpha ), outAlpha ); + +} ).setLayout( { + name: 'blendColor', + type: 'vec4', + inputs: [ + { name: 'base', type: 'vec4' }, + { name: 'blend', type: 'vec4' } + ] +} ); + +/** + * Premultiplies the RGB channels of a color by its alpha channel. + * + * This function is useful for converting a non-premultiplied alpha color + * into a premultiplied alpha format, where the RGB values are scaled + * by the alpha value. Premultiplied alpha is often used in graphics + * rendering for certain operations, such as compositing and image processing. + * + * @tsl + * @function + * @param {Node} color - The input color with non-premultiplied alpha. + * @return {Node} The color with premultiplied alpha. + */ +const premultiplyAlpha = /*@__PURE__*/ Fn( ( [ color ] ) => { + + return vec4( color.rgb.mul( color.a ), color.a ); + +}, { color: 'vec4', return: 'vec4' } ); + +/** + * Unpremultiplies the RGB channels of a color by its alpha channel. + * + * This function is useful for converting a premultiplied alpha color + * back into a non-premultiplied alpha format, where the RGB values are + * divided by the alpha value. Unpremultiplied alpha is often used in graphics + * rendering for certain operations, such as compositing and image processing. + * + * @tsl + * @function + * @param {Node} color - The input color with premultiplied alpha. + * @return {Node} The color with non-premultiplied alpha. + */ +const unpremultiplyAlpha = /*@__PURE__*/ Fn( ( [ color ] ) => { + + If( color.a.equal( 0.0 ), () => vec4( 0.0 ) ); + + return vec4( color.rgb.div( color.a ), color.a ); + +}, { color: 'vec4', return: 'vec4' } ); + + +// Deprecated + +/** + * @tsl + * @function + * @deprecated since r171. Use {@link blendBurn} instead. + * + * @param {...any} params + * @returns {Function} + */ +const burn = ( ...params ) => { // @deprecated, r171 + + console.warn( 'THREE.TSL: "burn" has been renamed. Use "blendBurn" instead.' ); + return blendBurn( params ); + +}; + +/** + * @tsl + * @function + * @deprecated since r171. Use {@link blendDodge} instead. + * + * @param {...any} params + * @returns {Function} + */ +const dodge = ( ...params ) => { // @deprecated, r171 + + console.warn( 'THREE.TSL: "dodge" has been renamed. Use "blendDodge" instead.' ); + return blendDodge( params ); + +}; + +/** + * @tsl + * @function + * @deprecated since r171. Use {@link blendScreen} instead. + * + * @param {...any} params + * @returns {Function} + */ +const screen = ( ...params ) => { // @deprecated, r171 + + console.warn( 'THREE.TSL: "screen" has been renamed. Use "blendScreen" instead.' ); + return blendScreen( params ); + +}; + +/** + * @tsl + * @function + * @deprecated since r171. Use {@link blendOverlay} instead. + * + * @param {...any} params + * @returns {Function} + */ +const overlay = ( ...params ) => { // @deprecated, r171 + + console.warn( 'THREE.TSL: "overlay" has been renamed. Use "blendOverlay" instead.' ); + return blendOverlay( params ); + +}; + /** * Base class for all node materials. * @@ -18629,6 +18861,19 @@ class NodeMaterial extends Material { } + /** + * Setups premultiplied alpha. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {Node} outputNode - The existing output node. + * @return {Node} The output node. + */ + setupPremultipliedAlpha( builder, outputNode ) { + + return premultiplyAlpha( outputNode ); + + } + /** * Setups the output node. * @@ -18646,6 +18891,14 @@ class NodeMaterial extends Material { } + // PREMULTIPLIED ALPHA + + if ( this.premultipliedAlpha === true ) { + + outputNode = this.setupPremultipliedAlpha( builder, outputNode ); + + } + return outputNode; } @@ -25986,6 +26239,16 @@ class RenderObject { */ this.attributes = null; + /** + * An object holding the version of the + * attributes. The keys are the attribute names + * and the values are the attribute versions. + * + * @type {?Object} + * @default null + */ + this.attributesId = null; + /** * A reference to a render pipeline the render * object is processed with. @@ -26105,7 +26368,7 @@ class RenderObject { /** * An event listener which is executed when `dispose()` is called on - * the render object's material. + * the material of this render object. * * @method */ @@ -26115,7 +26378,23 @@ class RenderObject { }; + /** + * An event listener which is executed when `dispose()` is called on + * the geometry of this render object. + * + * @method + */ + this.onGeometryDispose = () => { + + // clear geometry cache attributes + + this.attributes = null; + this.attributesId = null; + + }; + this.material.addEventListener( 'dispose', this.onMaterialDispose ); + this.geometry.addEventListener( 'dispose', this.onGeometryDispose ); } @@ -26254,6 +26533,7 @@ class RenderObject { this.geometry = geometry; this.attributes = null; + this.attributesId = null; } @@ -26273,9 +26553,25 @@ class RenderObject { const attributes = []; const vertexBuffers = new Set(); + const attributesId = {}; + for ( const nodeAttribute of nodeAttributes ) { - const attribute = nodeAttribute.node && nodeAttribute.node.attribute ? nodeAttribute.node.attribute : geometry.getAttribute( nodeAttribute.name ); + let attribute; + + if ( nodeAttribute.node && nodeAttribute.node.attribute ) { + + // node attribute + attribute = nodeAttribute.node.attribute; + + } else { + + // geometry attribute + attribute = geometry.getAttribute( nodeAttribute.name ); + + attributesId[ nodeAttribute.name ] = attribute.version; + + } if ( attribute === undefined ) continue; @@ -26287,6 +26583,7 @@ class RenderObject { } this.attributes = attributes; + this.attributesId = attributesId; this.vertexBuffers = Array.from( vertexBuffers.values() ); return attributes; @@ -26551,7 +26848,27 @@ class RenderObject { */ get needsGeometryUpdate() { - return this.geometry.id !== this.object.geometry.id; + if ( this.geometry.id !== this.object.geometry.id ) return true; + + if ( this.attributes !== null ) { + + const attributesId = this.attributesId; + + for ( const name in attributesId ) { + + const attribute = this.geometry.getAttribute( name ); + + if ( attribute === undefined || attributesId[ name ] !== attribute.id ) { + + return true; + + } + + } + + } + + return false; } @@ -26629,6 +26946,7 @@ class RenderObject { dispose() { this.material.removeEventListener( 'dispose', this.onMaterialDispose ); + this.geometry.removeEventListener( 'dispose', this.onGeometryDispose ); this.onDispose(); @@ -33550,238 +33868,6 @@ function getPreviousMatrix( object, index = 0 ) { */ const velocity = /*@__PURE__*/ nodeImmutable( VelocityNode ); -/** - * Represents a "Color Burn" blend mode. - * - * It's designed to darken the base layer's colors based on the color of the blend layer. - * It significantly increases the contrast of the base layer, making the colors more vibrant and saturated. - * The darker the color in the blend layer, the stronger the darkening and contrast effect on the base layer. - * - * @tsl - * @function - * @param {Node} base - The base color. - * @param {Node} blend - The blend color. A white (#ffffff) blend color does not alter the base color. - * @return {Node} The result. - */ -const blendBurn = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { - - return min$1( 1.0, base.oneMinus().div( blend ) ).oneMinus(); - -} ).setLayout( { - name: 'blendBurn', - type: 'vec3', - inputs: [ - { name: 'base', type: 'vec3' }, - { name: 'blend', type: 'vec3' } - ] -} ); - -/** - * Represents a "Color Dodge" blend mode. - * - * It's designed to lighten the base layer's colors based on the color of the blend layer. - * It significantly increases the brightness of the base layer, making the colors lighter and more vibrant. - * The brighter the color in the blend layer, the stronger the lightening and contrast effect on the base layer. - * - * @tsl - * @function - * @param {Node} base - The base color. - * @param {Node} blend - The blend color. A black (#000000) blend color does not alter the base color. - * @return {Node} The result. - */ -const blendDodge = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { - - return min$1( base.div( blend.oneMinus() ), 1.0 ); - -} ).setLayout( { - name: 'blendDodge', - type: 'vec3', - inputs: [ - { name: 'base', type: 'vec3' }, - { name: 'blend', type: 'vec3' } - ] -} ); - -/** - * Represents a "Screen" blend mode. - * - * Similar to `blendDodge()`, this mode also lightens the base layer's colors based on the color of the blend layer. - * The "Screen" blend mode is better for general brightening whereas the "Dodge" results in more subtle and nuanced - * effects. - * - * @tsl - * @function - * @param {Node} base - The base color. - * @param {Node} blend - The blend color. A black (#000000) blend color does not alter the base color. - * @return {Node} The result. - */ -const blendScreen = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { - - return base.oneMinus().mul( blend.oneMinus() ).oneMinus(); - -} ).setLayout( { - name: 'blendScreen', - type: 'vec3', - inputs: [ - { name: 'base', type: 'vec3' }, - { name: 'blend', type: 'vec3' } - ] -} ); - -/** - * Represents a "Overlay" blend mode. - * - * It's designed to increase the contrast of the base layer based on the color of the blend layer. - * It amplifies the existing colors and contrast in the base layer, making lighter areas lighter and darker areas darker. - * The color of the blend layer significantly influences the resulting contrast and color shift in the base layer. - * - * @tsl - * @function - * @param {Node} base - The base color. - * @param {Node} blend - The blend color - * @return {Node} The result. - */ -const blendOverlay = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { - - return mix( base.mul( 2.0 ).mul( blend ), base.oneMinus().mul( 2.0 ).mul( blend.oneMinus() ).oneMinus(), step( 0.5, base ) ); - -} ).setLayout( { - name: 'blendOverlay', - type: 'vec3', - inputs: [ - { name: 'base', type: 'vec3' }, - { name: 'blend', type: 'vec3' } - ] -} ); - -/** - * This function blends two color based on their alpha values by replicating the behavior of `THREE.NormalBlending`. - * It assumes both input colors have non-premultiplied alpha. - * - * @tsl - * @function - * @param {Node} base - The base color. - * @param {Node} blend - The blend color - * @return {Node} The result. - */ -const blendColor = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { - - const outAlpha = blend.a.add( base.a.mul( blend.a.oneMinus() ) ); - - return vec4( blend.rgb.mul( blend.a ).add( base.rgb.mul( base.a ).mul( blend.a.oneMinus() ) ).div( outAlpha ), outAlpha ); - -} ).setLayout( { - name: 'blendColor', - type: 'vec4', - inputs: [ - { name: 'base', type: 'vec4' }, - { name: 'blend', type: 'vec4' } - ] -} ); - -/** - * Premultiplies the RGB channels of a color by its alpha channel. - * - * This function is useful for converting a non-premultiplied alpha color - * into a premultiplied alpha format, where the RGB values are scaled - * by the alpha value. Premultiplied alpha is often used in graphics - * rendering for certain operations, such as compositing and image processing. - * - * @tsl - * @function - * @param {Node} color - The input color with non-premultiplied alpha. - * @return {Node} The color with premultiplied alpha. - */ -const premult = /*@__PURE__*/ Fn( ( [ color ] ) => { - - return vec4( color.rgb.mul( color.a ), color.a ); - -}, { color: 'vec4', return: 'vec4' } ); - -/** - * Unpremultiplies the RGB channels of a color by its alpha channel. - * - * This function is useful for converting a premultiplied alpha color - * back into a non-premultiplied alpha format, where the RGB values are - * divided by the alpha value. Unpremultiplied alpha is often used in graphics - * rendering for certain operations, such as compositing and image processing. - * - * @tsl - * @function - * @param {Node} color - The input color with premultiplied alpha. - * @return {Node} The color with non-premultiplied alpha. - */ -const unpremult = /*@__PURE__*/ Fn( ( [ color ] ) => { - - If( color.a.equal( 0.0 ), () => vec4( 0.0 ) ); - - return vec4( color.rgb.div( color.a ), color.a ); - -}, { color: 'vec4', return: 'vec4' } ); - - -// Deprecated - -/** - * @tsl - * @function - * @deprecated since r171. Use {@link blendBurn} instead. - * - * @param {...any} params - * @returns {Function} - */ -const burn = ( ...params ) => { // @deprecated, r171 - - console.warn( 'THREE.TSL: "burn" has been renamed. Use "blendBurn" instead.' ); - return blendBurn( params ); - -}; - -/** - * @tsl - * @function - * @deprecated since r171. Use {@link blendDodge} instead. - * - * @param {...any} params - * @returns {Function} - */ -const dodge = ( ...params ) => { // @deprecated, r171 - - console.warn( 'THREE.TSL: "dodge" has been renamed. Use "blendDodge" instead.' ); - return blendDodge( params ); - -}; - -/** - * @tsl - * @function - * @deprecated since r171. Use {@link blendScreen} instead. - * - * @param {...any} params - * @returns {Function} - */ -const screen = ( ...params ) => { // @deprecated, r171 - - console.warn( 'THREE.TSL: "screen" has been renamed. Use "blendScreen" instead.' ); - return blendScreen( params ); - -}; - -/** - * @tsl - * @function - * @deprecated since r171. Use {@link blendOverlay} instead. - * - * @param {...any} params - * @returns {Function} - */ -const overlay = ( ...params ) => { // @deprecated, r171 - - console.warn( 'THREE.TSL: "overlay" has been renamed. Use "blendOverlay" instead.' ); - return blendOverlay( params ); - -}; - /** * Computes a grayscale value for the given RGB color value. * @@ -41996,7 +42082,7 @@ var TSL = /*#__PURE__*/Object.freeze({ pow2: pow2, pow3: pow3, pow4: pow4, - premult: premult, + premultiplyAlpha: premultiplyAlpha, property: property, radians: radians, rand: rand, @@ -42119,7 +42205,7 @@ var TSL = /*#__PURE__*/Object.freeze({ uniformGroup: uniformGroup, uniformTexture: uniformTexture, uniforms: uniforms, - unpremult: unpremult, + unpremultiplyAlpha: unpremultiplyAlpha, userData: userData, uv: uv, uvec2: uvec2, @@ -61573,7 +61659,7 @@ class WebGLBackend extends Backend { if ( vaoGPU === undefined ) { - this._createVao( attributes ); + this.vaoCache[ vaoKey ] = this._createVao( attributes ); } else { @@ -61609,7 +61695,7 @@ class WebGLBackend extends Backend { const dualAttributeData = transformBuffers[ i ]; - if ( dualAttributeData.pbo ) { + if ( dualAttributeData.pbo && this.has( dualAttributeData.pbo ) ) { this.textureUtils.copyBufferToTexture( dualAttributeData.transformBuffer, dualAttributeData.pbo ); @@ -61691,28 +61777,23 @@ class WebGLBackend extends Backend { // vertex state - const renderObjectData = this.get( renderObject ); + const attributes = renderObject.getAttributes(); + const attributesData = this.get( attributes ); - let vaoGPU = renderObjectData.staticVao; + let vaoGPU = attributesData.vaoGPU; - if ( vaoGPU === undefined || renderObjectData.geometryId !== renderObject.geometry.id ) { + if ( vaoGPU === undefined ) { - const vaoKey = this._getVaoKey( renderObject.getAttributes() ); + const vaoKey = this._getVaoKey( attributes ); vaoGPU = this.vaoCache[ vaoKey ]; if ( vaoGPU === undefined ) { - let staticVao; - - ( { vaoGPU, staticVao } = this._createVao( renderObject.getAttributes() ) ); - - if ( staticVao ) { + vaoGPU = this._createVao( attributes ); - renderObjectData.staticVao = vaoGPU; - renderObjectData.geometryId = renderObject.geometry.id; - - } + this.vaoCache[ vaoKey ] = vaoGPU; + attributesData.vaoGPU = vaoGPU; } @@ -63012,9 +63093,6 @@ class WebGLBackend extends Backend { const { gl } = this; const vaoGPU = gl.createVertexArray(); - let key = ''; - - let staticVao = true; gl.bindVertexArray( vaoGPU ); @@ -63023,13 +63101,9 @@ class WebGLBackend extends Backend { const attribute = attributes[ i ]; const attributeData = this.get( attribute ); - key += ':' + attributeData.id; - gl.bindBuffer( gl.ARRAY_BUFFER, attributeData.bufferGPU ); gl.enableVertexAttribArray( i ); - if ( attribute.isStorageBufferAttribute || attribute.isStorageInstancedBufferAttribute ) staticVao = false; - let stride, offset; if ( attribute.isInterleavedBufferAttribute === true ) { @@ -63068,9 +63142,7 @@ class WebGLBackend extends Backend { gl.bindBuffer( gl.ARRAY_BUFFER, null ); - this.vaoCache[ key ] = vaoGPU; - - return { vaoGPU, staticVao }; + return vaoGPU; } diff --git a/build/three.webgpu.min.js b/build/three.webgpu.min.js index 4c6136b8542bb2..3ebb41ec22d7f7 100644 --- a/build/three.webgpu.min.js +++ b/build/three.webgpu.min.js @@ -3,4 +3,4 @@ * Copyright 2010-2025 Three.js Authors * SPDX-License-Identifier: MIT */ -import{Color as e,Vector2 as t,Vector3 as r,Vector4 as s,Matrix2 as i,Matrix3 as n,Matrix4 as a,EventDispatcher as o,MathUtils as u,WebGLCoordinateSystem as l,WebGPUCoordinateSystem as d,ColorManagement as c,SRGBTransfer as h,NoToneMapping as p,StaticDrawUsage as g,InterleavedBuffer as m,InterleavedBufferAttribute as f,DynamicDrawUsage as y,NoColorSpace as x,Texture as b,UnsignedIntType as T,IntType as _,NearestFilter as v,Sphere as N,BackSide as S,Euler as E,CubeTexture as w,CubeReflectionMapping as A,CubeRefractionMapping as R,TangentSpaceNormalMap as C,ObjectSpaceNormalMap as M,InstancedInterleavedBuffer as P,InstancedBufferAttribute as L,DataArrayTexture as F,FloatType as B,FramebufferTexture as I,LinearMipmapLinearFilter as D,DepthTexture as V,Material as U,NormalBlending as O,LineBasicMaterial as k,LineDashedMaterial as G,NoBlending as z,MeshNormalMaterial as H,SRGBColorSpace as $,WebGLCubeRenderTarget as W,BoxGeometry as j,Mesh as q,Scene as X,LinearFilter as K,CubeCamera as Y,EquirectangularReflectionMapping as Q,EquirectangularRefractionMapping as Z,AddOperation as J,MixOperation as ee,MultiplyOperation as te,MeshBasicMaterial as re,MeshLambertMaterial as se,MeshPhongMaterial as ie,OrthographicCamera as ne,PerspectiveCamera as ae,RenderTarget as oe,LinearSRGBColorSpace as ue,RGBAFormat as le,HalfFloatType as de,CubeUVReflectionMapping as ce,BufferGeometry as he,BufferAttribute as pe,MeshStandardMaterial as ge,MeshPhysicalMaterial as me,MeshToonMaterial as fe,MeshMatcapMaterial as ye,SpriteMaterial as xe,PointsMaterial as be,ShadowMaterial as Te,Uint32BufferAttribute as _e,Uint16BufferAttribute as ve,arrayNeedsUint32 as Ne,DoubleSide as Se,Camera as Ee,DepthStencilFormat as we,DepthFormat as Ae,UnsignedInt248Type as Re,UnsignedByteType as Ce,Plane as Me,Object3D as Pe,LinearMipMapLinearFilter as Le,Float32BufferAttribute as Fe,UVMapping as Be,VSMShadowMap as Ie,LessCompare as De,RGFormat as Ve,BasicShadowMap as Ue,SphereGeometry as Oe,LinearMipmapNearestFilter as ke,NearestMipmapLinearFilter as Ge,Float16BufferAttribute as ze,REVISION as He,ArrayCamera as $e,PlaneGeometry as We,FrontSide as je,CustomBlending as qe,AddEquation as Xe,ZeroFactor as Ke,CylinderGeometry as Ye,Quaternion as Qe,WebXRController as Ze,RAD2DEG as Je,PCFShadowMap as et,FrustumArray as tt,Frustum as rt,DataTexture as st,RedIntegerFormat as it,RedFormat as nt,ShortType as at,ByteType as ot,UnsignedShortType as ut,RGIntegerFormat as lt,RGBIntegerFormat as dt,RGBFormat as ct,RGBAIntegerFormat as ht,warnOnce as pt,createCanvasElement as gt,ReverseSubtractEquation as mt,SubtractEquation as ft,OneMinusDstAlphaFactor as yt,OneMinusDstColorFactor as xt,OneMinusSrcAlphaFactor as bt,OneMinusSrcColorFactor as Tt,DstAlphaFactor as _t,DstColorFactor as vt,SrcAlphaSaturateFactor as Nt,SrcAlphaFactor as St,SrcColorFactor as Et,OneFactor as wt,CullFaceNone as At,CullFaceBack as Rt,CullFaceFront as Ct,MultiplyBlending as Mt,SubtractiveBlending as Pt,AdditiveBlending as Lt,NotEqualDepth as Ft,GreaterDepth as Bt,GreaterEqualDepth as It,EqualDepth as Dt,LessEqualDepth as Vt,LessDepth as Ut,AlwaysDepth as Ot,NeverDepth as kt,UnsignedShort4444Type as Gt,UnsignedShort5551Type as zt,UnsignedInt5999Type as Ht,AlphaFormat as $t,RGB_S3TC_DXT1_Format as Wt,RGBA_S3TC_DXT1_Format as jt,RGBA_S3TC_DXT3_Format as qt,RGBA_S3TC_DXT5_Format as Xt,RGB_PVRTC_4BPPV1_Format as Kt,RGB_PVRTC_2BPPV1_Format as Yt,RGBA_PVRTC_4BPPV1_Format as Qt,RGBA_PVRTC_2BPPV1_Format as Zt,RGB_ETC1_Format as Jt,RGB_ETC2_Format as er,RGBA_ETC2_EAC_Format as tr,RGBA_ASTC_4x4_Format as rr,RGBA_ASTC_5x4_Format as sr,RGBA_ASTC_5x5_Format as ir,RGBA_ASTC_6x5_Format as nr,RGBA_ASTC_6x6_Format as ar,RGBA_ASTC_8x5_Format as or,RGBA_ASTC_8x6_Format as ur,RGBA_ASTC_8x8_Format as lr,RGBA_ASTC_10x5_Format as dr,RGBA_ASTC_10x6_Format as cr,RGBA_ASTC_10x8_Format as hr,RGBA_ASTC_10x10_Format as pr,RGBA_ASTC_12x10_Format as gr,RGBA_ASTC_12x12_Format as mr,RGBA_BPTC_Format as fr,RED_RGTC1_Format as yr,SIGNED_RED_RGTC1_Format as xr,RED_GREEN_RGTC2_Format as br,SIGNED_RED_GREEN_RGTC2_Format as Tr,MirroredRepeatWrapping as _r,ClampToEdgeWrapping as vr,RepeatWrapping as Nr,NearestMipmapNearestFilter as Sr,NotEqualCompare as Er,GreaterCompare as wr,GreaterEqualCompare as Ar,EqualCompare as Rr,LessEqualCompare as Cr,AlwaysCompare as Mr,NeverCompare as Pr,LinearTransfer as Lr,NotEqualStencilFunc as Fr,GreaterStencilFunc as Br,GreaterEqualStencilFunc as Ir,EqualStencilFunc as Dr,LessEqualStencilFunc as Vr,LessStencilFunc as Ur,AlwaysStencilFunc as Or,NeverStencilFunc as kr,DecrementWrapStencilOp as Gr,IncrementWrapStencilOp as zr,DecrementStencilOp as Hr,IncrementStencilOp as $r,InvertStencilOp as Wr,ReplaceStencilOp as jr,ZeroStencilOp as qr,KeepStencilOp as Xr,MaxEquation as Kr,MinEquation as Yr,SpotLight as Qr,PointLight as Zr,DirectionalLight as Jr,RectAreaLight as es,AmbientLight as ts,HemisphereLight as rs,LightProbe as ss,LinearToneMapping as is,ReinhardToneMapping as ns,CineonToneMapping as as,ACESFilmicToneMapping as os,AgXToneMapping as us,NeutralToneMapping as ls,Group as ds,Loader as cs,FileLoader as hs,MaterialLoader as ps,ObjectLoader as gs}from"./three.core.min.js";export{AdditiveAnimationBlendMode,AnimationAction,AnimationClip,AnimationLoader,AnimationMixer,AnimationObjectGroup,AnimationUtils,ArcCurve,ArrowHelper,AttachedBindMode,Audio,AudioAnalyser,AudioContext,AudioListener,AudioLoader,AxesHelper,BasicDepthPacking,BatchedMesh,Bone,BooleanKeyframeTrack,Box2,Box3,Box3Helper,BoxHelper,BufferGeometryLoader,Cache,CameraHelper,CanvasTexture,CapsuleGeometry,CatmullRomCurve3,CircleGeometry,Clock,ColorKeyframeTrack,CompressedArrayTexture,CompressedCubeTexture,CompressedTexture,CompressedTextureLoader,ConeGeometry,ConstantAlphaFactor,ConstantColorFactor,Controls,CubeTextureLoader,CubicBezierCurve,CubicBezierCurve3,CubicInterpolant,CullFaceFrontBack,Curve,CurvePath,CustomToneMapping,Cylindrical,Data3DTexture,DataTextureLoader,DataUtils,DefaultLoadingManager,DetachedBindMode,DirectionalLightHelper,DiscreteInterpolant,DodecahedronGeometry,DynamicCopyUsage,DynamicReadUsage,EdgesGeometry,EllipseCurve,ExtrudeGeometry,Fog,FogExp2,GLBufferAttribute,GLSL1,GLSL3,GridHelper,HemisphereLightHelper,IcosahedronGeometry,ImageBitmapLoader,ImageLoader,ImageUtils,InstancedBufferGeometry,InstancedMesh,Int16BufferAttribute,Int32BufferAttribute,Int8BufferAttribute,Interpolant,InterpolateDiscrete,InterpolateLinear,InterpolateSmooth,InterpolationSamplingMode,InterpolationSamplingType,KeyframeTrack,LOD,LatheGeometry,Layers,Light,Line,Line3,LineCurve,LineCurve3,LineLoop,LineSegments,LinearInterpolant,LinearMipMapNearestFilter,LoaderUtils,LoadingManager,LoopOnce,LoopPingPong,LoopRepeat,MOUSE,MeshDepthMaterial,MeshDistanceMaterial,NearestMipMapLinearFilter,NearestMipMapNearestFilter,NormalAnimationBlendMode,NumberKeyframeTrack,OctahedronGeometry,OneMinusConstantAlphaFactor,OneMinusConstantColorFactor,PCFSoftShadowMap,Path,PlaneHelper,PointLightHelper,Points,PolarGridHelper,PolyhedronGeometry,PositionalAudio,PropertyBinding,PropertyMixer,QuadraticBezierCurve,QuadraticBezierCurve3,QuaternionKeyframeTrack,QuaternionLinearInterpolant,RGBADepthPacking,RGBDepthPacking,RGB_BPTC_SIGNED_Format,RGB_BPTC_UNSIGNED_Format,RGDepthPacking,RawShaderMaterial,Ray,Raycaster,RenderTarget3D,RingGeometry,ShaderMaterial,Shape,ShapeGeometry,ShapePath,ShapeUtils,Skeleton,SkeletonHelper,SkinnedMesh,Source,Spherical,SphericalHarmonics3,SplineCurve,SpotLightHelper,Sprite,StaticCopyUsage,StaticReadUsage,StereoCamera,StreamCopyUsage,StreamDrawUsage,StreamReadUsage,StringKeyframeTrack,TOUCH,TetrahedronGeometry,TextureLoader,TextureUtils,TimestampQuery,TorusGeometry,TorusKnotGeometry,Triangle,TriangleFanDrawMode,TriangleStripDrawMode,TrianglesDrawMode,TubeGeometry,Uint8BufferAttribute,Uint8ClampedBufferAttribute,Uniform,UniformsGroup,VectorKeyframeTrack,VideoFrameTexture,VideoTexture,WebGL3DRenderTarget,WebGLArrayRenderTarget,WebGLRenderTarget,WireframeGeometry,WrapAroundEnding,ZeroCurvatureEnding,ZeroSlopeEnding}from"./three.core.min.js";const ms=["alphaMap","alphaTest","anisotropy","anisotropyMap","anisotropyRotation","aoMap","aoMapIntensity","attenuationColor","attenuationDistance","bumpMap","clearcoat","clearcoatMap","clearcoatNormalMap","clearcoatNormalScale","clearcoatRoughness","color","dispersion","displacementMap","emissive","emissiveIntensity","emissiveMap","envMap","envMapIntensity","gradientMap","ior","iridescence","iridescenceIOR","iridescenceMap","iridescenceThicknessMap","lightMap","lightMapIntensity","map","matcap","metalness","metalnessMap","normalMap","normalScale","opacity","roughness","roughnessMap","sheen","sheenColor","sheenColorMap","sheenRoughnessMap","shininess","specular","specularColor","specularColorMap","specularIntensity","specularIntensityMap","specularMap","thickness","transmission","transmissionMap"];class fs{constructor(e){this.renderObjects=new WeakMap,this.hasNode=this.containsNode(e),this.hasAnimation=!0===e.object.isSkinnedMesh,this.refreshUniforms=ms,this.renderId=0}firstInitialization(e){return!1===this.renderObjects.has(e)&&(this.getRenderObjectData(e),!0)}needsVelocity(e){const t=e.getMRT();return null!==t&&t.has("velocity")}getRenderObjectData(e){let t=this.renderObjects.get(e);if(void 0===t){const{geometry:r,material:s,object:i}=e;if(t={material:this.getMaterialData(s),geometry:{id:r.id,attributes:this.getAttributesData(r.attributes),indexVersion:r.index?r.index.version:null,drawRange:{start:r.drawRange.start,count:r.drawRange.count}},worldMatrix:i.matrixWorld.clone()},i.center&&(t.center=i.center.clone()),i.morphTargetInfluences&&(t.morphTargetInfluences=i.morphTargetInfluences.slice()),null!==e.bundle&&(t.version=e.bundle.version),t.material.transmission>0){const{width:r,height:s}=e.context;t.bufferWidth=r,t.bufferHeight=s}this.renderObjects.set(e,t)}return t}getAttributesData(e){const t={};for(const r in e){const s=e[r];t[r]={version:s.version}}return t}containsNode(e){const t=e.material;for(const e in t)if(t[e]&&t[e].isNode)return!0;return null!==e.renderer.overrideNodes.modelViewMatrix||null!==e.renderer.overrideNodes.modelNormalViewMatrix}getMaterialData(e){const t={};for(const r of this.refreshUniforms){const s=e[r];null!=s&&("object"==typeof s&&void 0!==s.clone?!0===s.isTexture?t[r]={id:s.id,version:s.version}:t[r]=s.clone():t[r]=s)}return t}equals(e){const{object:t,material:r,geometry:s}=e,i=this.getRenderObjectData(e);if(!0!==i.worldMatrix.equals(t.matrixWorld))return i.worldMatrix.copy(t.matrixWorld),!1;const n=i.material;for(const e in n){const t=n[e],s=r[e];if(void 0!==t.equals){if(!1===t.equals(s))return t.copy(s),!1}else if(!0===s.isTexture){if(t.id!==s.id||t.version!==s.version)return t.id=s.id,t.version=s.version,!1}else if(t!==s)return n[e]=s,!1}if(n.transmission>0){const{width:t,height:r}=e.context;if(i.bufferWidth!==t||i.bufferHeight!==r)return i.bufferWidth=t,i.bufferHeight=r,!1}const a=i.geometry,o=s.attributes,u=a.attributes,l=Object.keys(u),d=Object.keys(o);if(a.id!==s.id)return a.id=s.id,!1;if(l.length!==d.length)return i.geometry.attributes=this.getAttributesData(o),!1;for(const e of l){const t=u[e],r=o[e];if(void 0===r)return delete u[e],!1;if(t.version!==r.version)return t.version=r.version,!1}const c=s.index,h=a.indexVersion,p=c?c.version:null;if(h!==p)return a.indexVersion=p,!1;if(a.drawRange.start!==s.drawRange.start||a.drawRange.count!==s.drawRange.count)return a.drawRange.start=s.drawRange.start,a.drawRange.count=s.drawRange.count,!1;if(i.morphTargetInfluences){let e=!1;for(let r=0;r>>16,2246822507),r^=Math.imul(s^s>>>13,3266489909),s=Math.imul(s^s>>>16,2246822507),s^=Math.imul(r^r>>>13,3266489909),4294967296*(2097151&s)+(r>>>0)}const xs=e=>ys(e),bs=e=>ys(e),Ts=(...e)=>ys(e);function _s(e,t=!1){const r=[];!0===e.isNode&&(r.push(e.id),e=e.getSelf());for(const{property:s,childNode:i}of vs(e))r.push(ys(s.slice(0,-4)),i.getCacheKey(t));return ys(r)}function*vs(e,t=!1){for(const r in e){if(!0===r.startsWith("_"))continue;const s=e[r];if(!0===Array.isArray(s))for(let e=0;ee.charCodeAt(0))).buffer}var Is=Object.freeze({__proto__:null,arrayBufferToBase64:Fs,base64ToArrayBuffer:Bs,getByteBoundaryFromType:Cs,getCacheKey:_s,getDataFromObject:Ls,getLengthFromType:As,getMemoryLengthFromType:Rs,getNodeChildren:vs,getTypeFromLength:Es,getTypedArrayFromType:ws,getValueFromType:Ps,getValueType:Ms,hash:Ts,hashArray:bs,hashString:xs});const Ds={VERTEX:"vertex",FRAGMENT:"fragment"},Vs={NONE:"none",FRAME:"frame",RENDER:"render",OBJECT:"object"},Us={BOOLEAN:"bool",INTEGER:"int",FLOAT:"float",VECTOR2:"vec2",VECTOR3:"vec3",VECTOR4:"vec4",MATRIX2:"mat2",MATRIX3:"mat3",MATRIX4:"mat4"},Os={READ_ONLY:"readOnly",WRITE_ONLY:"writeOnly",READ_WRITE:"readWrite"},ks=["fragment","vertex"],Gs=["setup","analyze","generate"],zs=[...ks,"compute"],Hs=["x","y","z","w"],$s={analyze:"setup",generate:"analyze"};let Ws=0;class js extends o{static get type(){return"Node"}constructor(e=null){super(),this.nodeType=e,this.updateType=Vs.NONE,this.updateBeforeType=Vs.NONE,this.updateAfterType=Vs.NONE,this.uuid=u.generateUUID(),this.version=0,this.global=!1,this.parents=!1,this.isNode=!0,this._cacheKey=null,this._cacheKeyVersion=0,Object.defineProperty(this,"id",{value:Ws++})}set needsUpdate(e){!0===e&&this.version++}get type(){return this.constructor.type}onUpdate(e,t){return this.updateType=t,this.update=e.bind(this.getSelf()),this}onFrameUpdate(e){return this.onUpdate(e,Vs.FRAME)}onRenderUpdate(e){return this.onUpdate(e,Vs.RENDER)}onObjectUpdate(e){return this.onUpdate(e,Vs.OBJECT)}onReference(e){return this.updateReference=e.bind(this.getSelf()),this}getSelf(){return this.self||this}updateReference(){return this}isGlobal(){return this.global}*getChildren(){for(const{childNode:e}of vs(this))yield e}dispose(){this.dispatchEvent({type:"dispose"})}traverse(e){e(this);for(const t of this.getChildren())t.traverse(e)}getCacheKey(e=!1){return!0!==(e=e||this.version!==this._cacheKeyVersion)&&null!==this._cacheKey||(this._cacheKey=Ts(_s(this,e),this.customCacheKey()),this._cacheKeyVersion=this.version),this._cacheKey}customCacheKey(){return 0}getScope(){return this}getHash(){return this.uuid}getUpdateType(){return this.updateType}getUpdateBeforeType(){return this.updateBeforeType}getUpdateAfterType(){return this.updateAfterType}getElementType(e){const t=this.getNodeType(e);return e.getElementType(t)}getMemberType(){return"void"}getNodeType(e){const t=e.getNodeProperties(this);return t.outputNode?t.outputNode.getNodeType(e):this.nodeType}getShared(e){const t=this.getHash(e);return e.getNodeFromHash(t)||this}setup(e){const t=e.getNodeProperties(this);let r=0;for(const e of this.getChildren())t["node"+r++]=e;return t.outputNode||null}analyze(e,t=null){const r=e.increaseUsage(this);if(!0===this.parents){const r=e.getDataFromNode(this,"any");r.stages=r.stages||{},r.stages[e.shaderStage]=r.stages[e.shaderStage]||[],r.stages[e.shaderStage].push(t)}if(1===r){const t=e.getNodeProperties(this);for(const r of Object.values(t))r&&!0===r.isNode&&r.build(e,this)}}generate(e,t){const{outputNode:r}=e.getNodeProperties(this);if(r&&!0===r.isNode)return r.build(e,t)}updateBefore(){console.warn("Abstract function.")}updateAfter(){console.warn("Abstract function.")}update(){console.warn("Abstract function.")}build(e,t=null){const r=this.getShared(e);if(this!==r)return r.build(e,t);const s=e.getDataFromNode(this);s.buildStages=s.buildStages||{},s.buildStages[e.buildStage]=!0;const i=$s[e.buildStage];if(i&&!0!==s.buildStages[i]){const t=e.getBuildStage();e.setBuildStage(i),this.build(e),e.setBuildStage(t)}e.addNode(this),e.addChain(this);let n=null;const a=e.getBuildStage();if("setup"===a){this.updateReference(e);const t=e.getNodeProperties(this);if(!0!==t.initialized){t.initialized=!0,t.outputNode=this.setup(e)||t.outputNode||null;for(const r of Object.values(t))if(r&&!0===r.isNode){if(!0===r.parents){const t=e.getNodeProperties(r);t.parents=t.parents||[],t.parents.push(this)}r.build(e)}}n=t.outputNode}else if("analyze"===a)this.analyze(e,t);else if("generate"===a){if(1===this.generate.length){const r=this.getNodeType(e),s=e.getDataFromNode(this);n=s.snippet,void 0===n?void 0===s.generated?(s.generated=!0,n=this.generate(e)||"",s.snippet=n):(console.warn("THREE.Node: Recursion detected.",this),n=""):void 0!==s.flowCodes&&void 0!==e.context.nodeBlock&&e.addFlowCodeHierarchy(this,e.context.nodeBlock),n=e.format(n,r,t)}else n=this.generate(e,t)||""}return e.removeChain(this),e.addSequentialNode(this),n}getSerializeChildren(){return vs(this)}serialize(e){const t=this.getSerializeChildren(),r={};for(const{property:s,index:i,childNode:n}of t)void 0!==i?(void 0===r[s]&&(r[s]=Number.isInteger(i)?[]:{}),r[s][i]=n.toJSON(e.meta).uuid):r[s]=n.toJSON(e.meta).uuid;Object.keys(r).length>0&&(e.inputNodes=r)}deserialize(e){if(void 0!==e.inputNodes){const t=e.meta.nodes;for(const r in e.inputNodes)if(Array.isArray(e.inputNodes[r])){const s=[];for(const i of e.inputNodes[r])s.push(t[i]);this[r]=s}else if("object"==typeof e.inputNodes[r]){const s={};for(const i in e.inputNodes[r]){const n=e.inputNodes[r][i];s[i]=t[n]}this[r]=s}else{const s=e.inputNodes[r];this[r]=t[s]}}}toJSON(e){const{uuid:t,type:r}=this,s=void 0===e||"string"==typeof e;s&&(e={textures:{},images:{},nodes:{}});let i=e.nodes[t];function n(e){const t=[];for(const r in e){const s=e[r];delete s.metadata,t.push(s)}return t}if(void 0===i&&(i={uuid:t,type:r,meta:e,metadata:{version:4.7,type:"Node",generator:"Node.toJSON"}},!0!==s&&(e.nodes[i.uuid]=i),this.serialize(i),delete i.meta),s){const t=n(e.textures),r=n(e.images),s=n(e.nodes);t.length>0&&(i.textures=t),r.length>0&&(i.images=r),s.length>0&&(i.nodes=s)}return i}}class qs extends js{static get type(){return"ArrayElementNode"}constructor(e,t){super(),this.node=e,this.indexNode=t,this.isArrayElementNode=!0}getNodeType(e){return this.node.getElementType(e)}generate(e){const t=this.indexNode.getNodeType(e);return`${this.node.build(e)}[ ${this.indexNode.build(e,!e.isVector(t)&&e.isInteger(t)?t:"uint")} ]`}}class Xs extends js{static get type(){return"ConvertNode"}constructor(e,t){super(),this.node=e,this.convertTo=t}getNodeType(e){const t=this.node.getNodeType(e);let r=null;for(const s of this.convertTo.split("|"))null!==r&&e.getTypeLength(t)!==e.getTypeLength(s)||(r=s);return r}serialize(e){super.serialize(e),e.convertTo=this.convertTo}deserialize(e){super.deserialize(e),this.convertTo=e.convertTo}generate(e,t){const r=this.node,s=this.getNodeType(e),i=r.build(e,s);return e.format(i,s,t)}}class Ks extends js{static get type(){return"TempNode"}constructor(e=null){super(e),this.isTempNode=!0}hasDependencies(e){return e.getDataFromNode(this).usageCount>1}build(e,t){if("generate"===e.getBuildStage()){const r=e.getVectorType(this.getNodeType(e,t)),s=e.getDataFromNode(this);if(void 0!==s.propertyName)return e.format(s.propertyName,r,t);if("void"!==r&&"void"!==t&&this.hasDependencies(e)){const i=super.build(e,r),n=e.getVarFromNode(this,null,r),a=e.getPropertyName(n);return e.addLineFlowCode(`${a} = ${i}`,this),s.snippet=i,s.propertyName=a,e.format(s.propertyName,r,t)}}return super.build(e,t)}}class Ys extends Ks{static get type(){return"JoinNode"}constructor(e=[],t=null){super(t),this.nodes=e}getNodeType(e){return null!==this.nodeType?e.getVectorType(this.nodeType):e.getTypeFromLength(this.nodes.reduce(((t,r)=>t+e.getTypeLength(r.getNodeType(e))),0))}generate(e,t){const r=this.getNodeType(e),s=e.getTypeLength(r),i=this.nodes,n=e.getComponentType(r),a=[];let o=0;for(const t of i){if(o>=s){console.error(`THREE.TSL: Length of parameters exceeds maximum length of function '${r}()' type.`);break}let i,u=t.getNodeType(e),l=e.getTypeLength(u);o+l>s&&(console.error(`THREE.TSL: Length of '${r}()' data exceeds maximum length of output type.`),l=s-o,u=e.getTypeFromLength(l)),o+=l,i=t.build(e,u);const d=e.getComponentType(u);d!==n&&(i=e.format(i,d,n)),a.push(i)}const u=`${e.getType(r)}( ${a.join(", ")} )`;return e.format(u,r,t)}}const Qs=Hs.join("");class Zs extends js{static get type(){return"SplitNode"}constructor(e,t="x"){super(),this.node=e,this.components=t,this.isSplitNode=!0}getVectorLength(){let e=this.components.length;for(const t of this.components)e=Math.max(Hs.indexOf(t)+1,e);return e}getComponentType(e){return e.getComponentType(this.node.getNodeType(e))}getNodeType(e){return e.getTypeFromLength(this.components.length,this.getComponentType(e))}generate(e,t){const r=this.node,s=e.getTypeLength(r.getNodeType(e));let i=null;if(s>1){let n=null;this.getVectorLength()>=s&&(n=e.getTypeFromLength(this.getVectorLength(),this.getComponentType(e)));const a=r.build(e,n);i=this.components.length===s&&this.components===Qs.slice(0,this.components.length)?e.format(a,n,t):e.format(`${a}.${this.components}`,this.getNodeType(e),t)}else i=r.build(e,t);return i}serialize(e){super.serialize(e),e.components=this.components}deserialize(e){super.deserialize(e),this.components=e.components}}class Js extends Ks{static get type(){return"SetNode"}constructor(e,t,r){super(),this.sourceNode=e,this.components=t,this.targetNode=r}getNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{sourceNode:t,components:r,targetNode:s}=this,i=this.getNodeType(e),n=e.getComponentType(s.getNodeType(e)),a=e.getTypeFromLength(r.length,n),o=s.build(e,a),u=t.build(e,i),l=e.getTypeLength(i),d=[];for(let e=0;ee.replace(/r|s/g,"x").replace(/g|t/g,"y").replace(/b|p/g,"z").replace(/a|q/g,"w"),li=e=>ui(e).split("").sort().join(""),di={setup(e,t){const r=t.shift();return e(Ii(r),...t)},get(e,t,r){if("string"==typeof t&&void 0===e[t]){if(!0!==e.isStackNode&&"assign"===t)return(...e)=>(ni.assign(r,...e),r);if(ai.has(t)){const s=ai.get(t);return e.isStackNode?(...e)=>r.add(s(...e)):(...e)=>s(r,...e)}if("self"===t)return e;if(t.endsWith("Assign")&&ai.has(t.slice(0,t.length-6))){const s=ai.get(t.slice(0,t.length-6));return e.isStackNode?(...e)=>r.assign(e[0],s(...e)):(...e)=>r.assign(s(r,...e))}if(!0===/^[xyzwrgbastpq]{1,4}$/.test(t))return t=ui(t),Bi(new Zs(r,t));if(!0===/^set[XYZWRGBASTPQ]{1,4}$/.test(t))return t=li(t.slice(3).toLowerCase()),r=>Bi(new Js(e,t,Bi(r)));if(!0===/^flip[XYZWRGBASTPQ]{1,4}$/.test(t))return t=li(t.slice(4).toLowerCase()),()=>Bi(new ei(Bi(e),t));if("width"===t||"height"===t||"depth"===t)return"width"===t?t="x":"height"===t?t="y":"depth"===t&&(t="z"),Bi(new Zs(e,t));if(!0===/^\d+$/.test(t))return Bi(new qs(r,new si(Number(t),"uint")));if(!0===/^get$/.test(t))return e=>Bi(new ii(r,e))}return Reflect.get(e,t,r)},set:(e,t,r,s)=>"string"!=typeof t||void 0!==e[t]||!0!==/^[xyzwrgbastpq]{1,4}$/.test(t)&&"width"!==t&&"height"!==t&&"depth"!==t&&!0!==/^\d+$/.test(t)?Reflect.set(e,t,r,s):(s[t].assign(r),!0)},ci=new WeakMap,hi=new WeakMap,pi=function(e,t=null){for(const r in e)e[r]=Bi(e[r],t);return e},gi=function(e,t=null){const r=e.length;for(let s=0;sBi(null!==s?Object.assign(e,s):e);let n,a,o,u=t;function l(t){let r;return r=u?/[a-z]/i.test(u)?u+"()":u:e.type,void 0!==a&&t.lengtho?(console.error(`THREE.TSL: "${r}" parameter length exceeds limit.`),t.slice(0,o)):t}return null===t?n=(...t)=>i(new e(...Di(l(t)))):null!==r?(r=Bi(r),n=(...s)=>i(new e(t,...Di(l(s)),r))):n=(...r)=>i(new e(t,...Di(l(r)))),n.setParameterLength=(...e)=>(1===e.length?a=o=e[0]:2===e.length&&([a,o]=e),n),n.setName=e=>(u=e,n),n},fi=function(e,...t){return Bi(new e(...Di(t)))};class yi extends js{constructor(e,t){super(),this.shaderNode=e,this.inputNodes=t,this.isShaderCallNodeInternal=!0}getNodeType(e){return this.shaderNode.nodeType||this.getOutputNode(e).getNodeType(e)}getMemberType(e,t){return this.getOutputNode(e).getMemberType(e,t)}call(e){const{shaderNode:t,inputNodes:r}=this,s=e.getNodeProperties(t),i=t.namespace&&t.namespace===e.namespace?e.getNamespace("once"):"once";if(s[i])return s[i];let n=null;if(t.layout){let s=hi.get(e.constructor);void 0===s&&(s=new WeakMap,hi.set(e.constructor,s));let i=s.get(t);void 0===i&&(i=Bi(e.buildFunctionNode(t)),s.set(t,i)),e.addInclude(i),n=Bi(i.call(r))}else{const s=t.jsFunc,i=null!==r||s.length>1?s(r||[],e):s(e);n=Bi(i)}return t.once&&(s[i]=n),n}setupOutput(e){return e.addStack(),e.stack.outputNode=this.call(e),e.removeStack()}getOutputNode(e){const t=e.getNodeProperties(this),r=e.getOutputNamespace();return t[r]=t[r]||this.setupOutput(e),t[r]}build(e,t=null){let r=null;const s=e.getBuildStage(),i=e.getNodeProperties(this),n=e.getOutputNamespace(),a=this.getOutputNode(e);if("setup"===s){const t=e.getNamespace("initialized");!0!==i[t]&&(i[t]=!0,i[n]=this.getOutputNode(e),i[n].build(e)),r=i[n]}else"analyze"===s?a.build(e,t):"generate"===s&&(r=a.build(e,t)||"");return r}}class xi extends js{constructor(e,t){super(t),this.jsFunc=e,this.layout=null,this.global=!0,this.once=!1,this.namespace=null}setLayout(e){return this.layout=e,this}call(e=null){return Ii(e),Bi(new yi(this,e))}setup(){return this.call()}}const bi=[!1,!0],Ti=[0,1,2,3],_i=[-1,-2],vi=[.5,1.5,1/3,1e-6,1e6,Math.PI,2*Math.PI,1/Math.PI,2/Math.PI,1/(2*Math.PI),Math.PI/2],Ni=new Map;for(const e of bi)Ni.set(e,new si(e));const Si=new Map;for(const e of Ti)Si.set(e,new si(e,"uint"));const Ei=new Map([...Si].map((e=>new si(e.value,"int"))));for(const e of _i)Ei.set(e,new si(e,"int"));const wi=new Map([...Ei].map((e=>new si(e.value))));for(const e of vi)wi.set(e,new si(e));for(const e of vi)wi.set(-e,new si(-e));const Ai={bool:Ni,uint:Si,ints:Ei,float:wi},Ri=new Map([...Ni,...wi]),Ci=(e,t)=>Ri.has(e)?Ri.get(e):!0===e.isNode?e:new si(e,t),Mi=function(e,t=null){return(...r)=>{if((0===r.length||!["bool","float","int","uint"].includes(e)&&r.every((e=>"object"!=typeof e)))&&(r=[Ps(e,...r)]),1===r.length&&null!==t&&t.has(r[0]))return Bi(t.get(r[0]));if(1===r.length){const t=Ci(r[0],e);return(e=>{try{return e.getNodeType()}catch(e){return}})(t)===e?Bi(t):Bi(new Xs(t,e))}const s=r.map((e=>Ci(e)));return Bi(new Ys(s,e))}},Pi=e=>"object"==typeof e&&null!==e?e.value:e,Li=e=>null!=e?e.nodeType||e.convertTo||("string"==typeof e?e:null):null;function Fi(e,t){return new Proxy(new xi(e,t),di)}const Bi=(e,t=null)=>function(e,t=null){const r=Ms(e);if("node"===r){let t=ci.get(e);return void 0===t&&(t=new Proxy(e,di),ci.set(e,t),ci.set(t,t)),t}return null===t&&("float"===r||"boolean"===r)||r&&"shader"!==r&&"string"!==r?Bi(Ci(e,t)):"shader"===r?e.isFn?e:ki(e):e}(e,t),Ii=(e,t=null)=>new pi(e,t),Di=(e,t=null)=>new gi(e,t),Vi=(...e)=>new mi(...e),Ui=(...e)=>new fi(...e);let Oi=0;const ki=(e,t=null)=>{let r=null;null!==t&&("object"==typeof t?r=t.return:("string"==typeof t?r=t:console.error("THREE.TSL: Invalid layout type."),t=null));const s=new Fi(e,r),i=(...e)=>{let t;Ii(e);t=e[0]&&(e[0].isNode||Object.getPrototypeOf(e[0])!==Object.prototype)?[...e]:e[0];const i=s.call(t);return"void"===r&&i.toStack(),i};if(i.shaderNode=s,i.id=s.id,i.isFn=!0,i.getNodeType=(...e)=>s.getNodeType(...e),i.getCacheKey=(...e)=>s.getCacheKey(...e),i.setLayout=e=>(s.setLayout(e),i),i.once=(e=null)=>(s.once=!0,s.namespace=e,i),null!==t){if("object"!=typeof t.inputs){const e={name:"fn"+Oi++,type:r,inputs:[]};for(const r in t)"return"!==r&&e.inputs.push({name:r,type:t[r]});t=e}i.setLayout(t)}return i},Gi=e=>{ni=e},zi=()=>ni,Hi=(...e)=>ni.If(...e);function $i(e){return ni&&ni.add(e),e}oi("toStack",$i);const Wi=new Mi("color"),ji=new Mi("float",Ai.float),qi=new Mi("int",Ai.ints),Xi=new Mi("uint",Ai.uint),Ki=new Mi("bool",Ai.bool),Yi=new Mi("vec2"),Qi=new Mi("ivec2"),Zi=new Mi("uvec2"),Ji=new Mi("bvec2"),en=new Mi("vec3"),tn=new Mi("ivec3"),rn=new Mi("uvec3"),sn=new Mi("bvec3"),nn=new Mi("vec4"),an=new Mi("ivec4"),on=new Mi("uvec4"),un=new Mi("bvec4"),ln=new Mi("mat2"),dn=new Mi("mat3"),cn=new Mi("mat4");oi("toColor",Wi),oi("toFloat",ji),oi("toInt",qi),oi("toUint",Xi),oi("toBool",Ki),oi("toVec2",Yi),oi("toIVec2",Qi),oi("toUVec2",Zi),oi("toBVec2",Ji),oi("toVec3",en),oi("toIVec3",tn),oi("toUVec3",rn),oi("toBVec3",sn),oi("toVec4",nn),oi("toIVec4",an),oi("toUVec4",on),oi("toBVec4",un),oi("toMat2",ln),oi("toMat3",dn),oi("toMat4",cn);const hn=Vi(qs).setParameterLength(2),pn=(e,t)=>Bi(new Xs(Bi(e),t));oi("element",hn),oi("convert",pn);oi("append",(e=>(console.warn("THREE.TSL: .append() has been renamed to .toStack()."),$i(e))));class gn extends js{static get type(){return"PropertyNode"}constructor(e,t=null,r=!1){super(e),this.name=t,this.varying=r,this.isPropertyNode=!0,this.global=!0}getHash(e){return this.name||super.getHash(e)}generate(e){let t;return!0===this.varying?(t=e.getVaryingFromNode(this,this.name),t.needsInterpolation=!0):t=e.getVarFromNode(this,this.name),e.getPropertyName(t)}}const mn=(e,t)=>Bi(new gn(e,t)),fn=(e,t)=>Bi(new gn(e,t,!0)),yn=Ui(gn,"vec4","DiffuseColor"),xn=Ui(gn,"vec3","EmissiveColor"),bn=Ui(gn,"float","Roughness"),Tn=Ui(gn,"float","Metalness"),_n=Ui(gn,"float","Clearcoat"),vn=Ui(gn,"float","ClearcoatRoughness"),Nn=Ui(gn,"vec3","Sheen"),Sn=Ui(gn,"float","SheenRoughness"),En=Ui(gn,"float","Iridescence"),wn=Ui(gn,"float","IridescenceIOR"),An=Ui(gn,"float","IridescenceThickness"),Rn=Ui(gn,"float","AlphaT"),Cn=Ui(gn,"float","Anisotropy"),Mn=Ui(gn,"vec3","AnisotropyT"),Pn=Ui(gn,"vec3","AnisotropyB"),Ln=Ui(gn,"color","SpecularColor"),Fn=Ui(gn,"float","SpecularF90"),Bn=Ui(gn,"float","Shininess"),In=Ui(gn,"vec4","Output"),Dn=Ui(gn,"float","dashSize"),Vn=Ui(gn,"float","gapSize"),Un=Ui(gn,"float","pointWidth"),On=Ui(gn,"float","IOR"),kn=Ui(gn,"float","Transmission"),Gn=Ui(gn,"float","Thickness"),zn=Ui(gn,"float","AttenuationDistance"),Hn=Ui(gn,"color","AttenuationColor"),$n=Ui(gn,"float","Dispersion");class Wn extends js{static get type(){return"UniformGroupNode"}constructor(e,t=!1,r=1){super("string"),this.name=e,this.shared=t,this.order=r,this.isUniformGroup=!0}serialize(e){super.serialize(e),e.name=this.name,e.version=this.version,e.shared=this.shared}deserialize(e){super.deserialize(e),this.name=e.name,this.version=e.version,this.shared=e.shared}}const jn=e=>new Wn(e),qn=(e,t=0)=>new Wn(e,!0,t),Xn=qn("frame"),Kn=qn("render"),Yn=jn("object");class Qn extends ti{static get type(){return"UniformNode"}constructor(e,t=null){super(e,t),this.isUniformNode=!0,this.name="",this.groupNode=Yn}label(e){return this.name=e,this}setGroup(e){return this.groupNode=e,this}getGroup(){return this.groupNode}getUniformHash(e){return this.getHash(e)}onUpdate(e,t){const r=this.getSelf();return e=e.bind(r),super.onUpdate((t=>{const s=e(t,r);void 0!==s&&(this.value=s)}),t)}generate(e,t){const r=this.getNodeType(e),s=this.getUniformHash(e);let i=e.getNodeFromHash(s);void 0===i&&(e.setHashNode(this,s),i=this);const n=i.getInputType(e),a=e.getUniformFromNode(i,n,e.shaderStage,this.name||e.context.label),o=e.getPropertyName(a);return void 0!==e.context.label&&delete e.context.label,e.format(o,r,t)}}const Zn=(e,t)=>{const r=Li(t||e),s=e&&!0===e.isNode?e.node&&e.node.value||e.value:e;return Bi(new Qn(s,r))};class Jn extends Ks{static get type(){return"ArrayNode"}constructor(e,t,r=null){super(e),this.count=t,this.values=r,this.isArrayNode=!0}getNodeType(e){return null===this.nodeType&&(this.nodeType=this.values[0].getNodeType(e)),this.nodeType}getElementType(e){return this.getNodeType(e)}generate(e){const t=this.getNodeType(e);return e.generateArray(t,this.count,this.values)}}const ea=(...e)=>{let t;if(1===e.length){const r=e[0];t=new Jn(null,r.length,r)}else{const r=e[0],s=e[1];t=new Jn(r,s)}return Bi(t)};oi("toArray",((e,t)=>ea(Array(t).fill(e))));class ta extends Ks{static get type(){return"AssignNode"}constructor(e,t){super(),this.targetNode=e,this.sourceNode=t,this.isAssignNode=!0}hasDependencies(){return!1}getNodeType(e,t){return"void"!==t?this.targetNode.getNodeType(e):"void"}needsSplitAssign(e){const{targetNode:t}=this;if(!1===e.isAvailable("swizzleAssign")&&t.isSplitNode&&t.components.length>1){const r=e.getTypeLength(t.node.getNodeType(e));return Hs.join("").slice(0,r)!==t.components}return!1}setup(e){const{targetNode:t,sourceNode:r}=this,s=e.getNodeProperties(this);s.sourceNode=r,s.targetNode=t.context({assign:!0})}generate(e,t){const{targetNode:r,sourceNode:s}=e.getNodeProperties(this),i=this.needsSplitAssign(e),n=r.getNodeType(e),a=r.build(e),o=s.build(e,n),u=s.getNodeType(e),l=e.getDataFromNode(this);let d;if(!0===l.initialized)"void"!==t&&(d=a);else if(i){const s=e.getVarFromNode(this,null,n),i=e.getPropertyName(s);e.addLineFlowCode(`${i} = ${o}`,this);const u=r.node,l=u.node.context({assign:!0}).build(e);for(let t=0;t{const s=r.type;let i;return i="pointer"===s?"&"+t.build(e):t.build(e,s),i};if(Array.isArray(i)){if(i.length>s.length)console.error("THREE.TSL: The number of provided parameters exceeds the expected number of inputs in 'Fn()'."),i.length=s.length;else if(i.length(t=t.length>1||t[0]&&!0===t[0].isNode?Di(t):Ii(t[0]),Bi(new sa(Bi(e),t)));oi("call",ia);const na={"==":"equal","!=":"notEqual","<":"lessThan",">":"greaterThan","<=":"lessThanEqual",">=":"greaterThanEqual","%":"mod"};class aa extends Ks{static get type(){return"OperatorNode"}constructor(e,t,r,...s){if(super(),s.length>0){let i=new aa(e,t,r);for(let t=0;t>"===t||"<<"===t)return e.getIntegerType(i);if("!"===t||"&&"===t||"||"===t||"^^"===t)return"bool";if("=="===t||"!="===t||"<"===t||">"===t||"<="===t||">="===t){const t=Math.max(e.getTypeLength(i),e.getTypeLength(n));return t>1?`bvec${t}`:"bool"}if(e.isMatrix(i)){if("float"===n)return i;if(e.isVector(n))return e.getVectorFromMatrix(i);if(e.isMatrix(n))return i}else if(e.isMatrix(n)){if("float"===i)return n;if(e.isVector(i))return e.getVectorFromMatrix(n)}return e.getTypeLength(n)>e.getTypeLength(i)?n:i}generate(e,t){const r=this.op,{aNode:s,bNode:i}=this,n=this.getNodeType(e);let a=null,o=null;"void"!==n?(a=s.getNodeType(e),o=i?i.getNodeType(e):null,"<"===r||">"===r||"<="===r||">="===r||"=="===r||"!="===r?e.isVector(a)?o=a:e.isVector(o)?a=o:a!==o&&(a=o="float"):">>"===r||"<<"===r?(a=n,o=e.changeComponentType(o,"uint")):"%"===r?(a=n,o=e.isInteger(a)&&e.isInteger(o)?o:a):e.isMatrix(a)?"float"===o?o="float":e.isVector(o)?o=e.getVectorFromMatrix(a):e.isMatrix(o)||(a=o=n):a=e.isMatrix(o)?"float"===a?"float":e.isVector(a)?e.getVectorFromMatrix(o):o=n:o=n):a=o=n;const u=s.build(e,a),d=i?i.build(e,o):null,c=e.getFunctionOperator(r);if("void"!==t){const s=e.renderer.coordinateSystem===l;if("=="===r||"!="===r||"<"===r||">"===r||"<="===r||">="===r)return s&&e.isVector(a)?e.format(`${this.getOperatorMethod(e,t)}( ${u}, ${d} )`,n,t):e.format(`( ${u} ${r} ${d} )`,n,t);if("%"===r)return e.isInteger(o)?e.format(`( ${u} % ${d} )`,n,t):e.format(`${this.getOperatorMethod(e,n)}( ${u}, ${d} )`,n,t);if("!"===r||"~"===r)return e.format(`(${r}${u})`,a,t);if(c)return e.format(`${c}( ${u}, ${d} )`,n,t);if(e.isMatrix(a)&&"float"===o)return e.format(`( ${d} ${r} ${u} )`,n,t);if("float"===a&&e.isMatrix(o))return e.format(`${u} ${r} ${d}`,n,t);{let i=`( ${u} ${r} ${d} )`;return!s&&"bool"===n&&e.isVector(a)&&e.isVector(o)&&(i=`all${i}`),e.format(i,n,t)}}if("void"!==a)return c?e.format(`${c}( ${u}, ${d} )`,n,t):e.isMatrix(a)&&"float"===o?e.format(`${d} ${r} ${u}`,n,t):e.format(`${u} ${r} ${d}`,n,t)}serialize(e){super.serialize(e),e.op=this.op}deserialize(e){super.deserialize(e),this.op=e.op}}const oa=Vi(aa,"+").setParameterLength(2,1/0).setName("add"),ua=Vi(aa,"-").setParameterLength(2,1/0).setName("sub"),la=Vi(aa,"*").setParameterLength(2,1/0).setName("mul"),da=Vi(aa,"/").setParameterLength(2,1/0).setName("div"),ca=Vi(aa,"%").setParameterLength(2).setName("mod"),ha=Vi(aa,"==").setParameterLength(2).setName("equal"),pa=Vi(aa,"!=").setParameterLength(2).setName("notEqual"),ga=Vi(aa,"<").setParameterLength(2).setName("lessThan"),ma=Vi(aa,">").setParameterLength(2).setName("greaterThan"),fa=Vi(aa,"<=").setParameterLength(2).setName("lessThanEqual"),ya=Vi(aa,">=").setParameterLength(2).setName("greaterThanEqual"),xa=Vi(aa,"&&").setParameterLength(2,1/0).setName("and"),ba=Vi(aa,"||").setParameterLength(2,1/0).setName("or"),Ta=Vi(aa,"!").setParameterLength(1).setName("not"),_a=Vi(aa,"^^").setParameterLength(2).setName("xor"),va=Vi(aa,"&").setParameterLength(2).setName("bitAnd"),Na=Vi(aa,"~").setParameterLength(2).setName("bitNot"),Sa=Vi(aa,"|").setParameterLength(2).setName("bitOr"),Ea=Vi(aa,"^").setParameterLength(2).setName("bitXor"),wa=Vi(aa,"<<").setParameterLength(2).setName("shiftLeft"),Aa=Vi(aa,">>").setParameterLength(2).setName("shiftRight"),Ra=ki((([e])=>(e.addAssign(1),e))),Ca=ki((([e])=>(e.subAssign(1),e))),Ma=ki((([e])=>{const t=qi(e).toConst();return e.addAssign(1),t})),Pa=ki((([e])=>{const t=qi(e).toConst();return e.subAssign(1),t}));oi("add",oa),oi("sub",ua),oi("mul",la),oi("div",da),oi("mod",ca),oi("equal",ha),oi("notEqual",pa),oi("lessThan",ga),oi("greaterThan",ma),oi("lessThanEqual",fa),oi("greaterThanEqual",ya),oi("and",xa),oi("or",ba),oi("not",Ta),oi("xor",_a),oi("bitAnd",va),oi("bitNot",Na),oi("bitOr",Sa),oi("bitXor",Ea),oi("shiftLeft",wa),oi("shiftRight",Aa),oi("incrementBefore",Ra),oi("decrementBefore",Ca),oi("increment",Ma),oi("decrement",Pa);const La=(e,t)=>(console.warn('THREE.TSL: "remainder()" is deprecated. Use "mod( int( ... ) )" instead.'),ca(e,t)),Fa=(e,t)=>(console.warn('THREE.TSL: "modInt()" is deprecated. Use "mod( int( ... ) )" instead.'),ca(qi(e),qi(t)));oi("remainder",La),oi("modInt",Fa);class Ba extends Ks{static get type(){return"MathNode"}constructor(e,t,r=null,s=null){if(super(),(e===Ba.MAX||e===Ba.MIN)&&arguments.length>3){let i=new Ba(e,t,r);for(let t=2;tn&&i>a?t:n>a?r:a>i?s:t}getNodeType(e){const t=this.method;return t===Ba.LENGTH||t===Ba.DISTANCE||t===Ba.DOT?"float":t===Ba.CROSS?"vec3":t===Ba.ALL||t===Ba.ANY?"bool":t===Ba.EQUALS?e.changeComponentType(this.aNode.getNodeType(e),"bool"):this.getInputType(e)}setup(e){const{aNode:t,bNode:r,method:s}=this;let i=null;if(s===Ba.ONE_MINUS)i=ua(1,t);else if(s===Ba.RECIPROCAL)i=da(1,t);else if(s===Ba.DIFFERENCE)i=no(ua(t,r));else if(s===Ba.TRANSFORM_DIRECTION){let s=t,n=r;e.isMatrix(s.getNodeType(e))?n=nn(en(n),0):s=nn(en(s),0);const a=la(s,n).xyz;i=Qa(a)}return null!==i?i:super.setup(e)}generate(e,t){if(e.getNodeProperties(this).outputNode)return super.generate(e,t);let r=this.method;const s=this.getNodeType(e),i=this.getInputType(e),n=this.aNode,a=this.bNode,o=this.cNode,u=e.renderer.coordinateSystem;if(r===Ba.NEGATE)return e.format("( - "+n.build(e,i)+" )",s,t);{const c=[];return r===Ba.CROSS?c.push(n.build(e,s),a.build(e,s)):u===l&&r===Ba.STEP?c.push(n.build(e,1===e.getTypeLength(n.getNodeType(e))?"float":i),a.build(e,i)):u!==l||r!==Ba.MIN&&r!==Ba.MAX?r===Ba.REFRACT?c.push(n.build(e,i),a.build(e,i),o.build(e,"float")):r===Ba.MIX?c.push(n.build(e,i),a.build(e,i),o.build(e,1===e.getTypeLength(o.getNodeType(e))?"float":i)):(u===d&&r===Ba.ATAN&&null!==a&&(r="atan2"),"fragment"===e.shaderStage||r!==Ba.DFDX&&r!==Ba.DFDY||(console.warn(`THREE.TSL: '${r}' is not supported in the ${e.shaderStage} stage.`),r="/*"+r+"*/"),c.push(n.build(e,i)),null!==a&&c.push(a.build(e,i)),null!==o&&c.push(o.build(e,i))):c.push(n.build(e,i),a.build(e,1===e.getTypeLength(a.getNodeType(e))?"float":i)),e.format(`${e.getMethod(r,s)}( ${c.join(", ")} )`,s,t)}}serialize(e){super.serialize(e),e.method=this.method}deserialize(e){super.deserialize(e),this.method=e.method}}Ba.ALL="all",Ba.ANY="any",Ba.RADIANS="radians",Ba.DEGREES="degrees",Ba.EXP="exp",Ba.EXP2="exp2",Ba.LOG="log",Ba.LOG2="log2",Ba.SQRT="sqrt",Ba.INVERSE_SQRT="inversesqrt",Ba.FLOOR="floor",Ba.CEIL="ceil",Ba.NORMALIZE="normalize",Ba.FRACT="fract",Ba.SIN="sin",Ba.COS="cos",Ba.TAN="tan",Ba.ASIN="asin",Ba.ACOS="acos",Ba.ATAN="atan",Ba.ABS="abs",Ba.SIGN="sign",Ba.LENGTH="length",Ba.NEGATE="negate",Ba.ONE_MINUS="oneMinus",Ba.DFDX="dFdx",Ba.DFDY="dFdy",Ba.ROUND="round",Ba.RECIPROCAL="reciprocal",Ba.TRUNC="trunc",Ba.FWIDTH="fwidth",Ba.TRANSPOSE="transpose",Ba.BITCAST="bitcast",Ba.EQUALS="equals",Ba.MIN="min",Ba.MAX="max",Ba.STEP="step",Ba.REFLECT="reflect",Ba.DISTANCE="distance",Ba.DIFFERENCE="difference",Ba.DOT="dot",Ba.CROSS="cross",Ba.POW="pow",Ba.TRANSFORM_DIRECTION="transformDirection",Ba.MIX="mix",Ba.CLAMP="clamp",Ba.REFRACT="refract",Ba.SMOOTHSTEP="smoothstep",Ba.FACEFORWARD="faceforward";const Ia=ji(1e-6),Da=ji(1e6),Va=ji(Math.PI),Ua=ji(2*Math.PI),Oa=Vi(Ba,Ba.ALL).setParameterLength(1),ka=Vi(Ba,Ba.ANY).setParameterLength(1),Ga=Vi(Ba,Ba.RADIANS).setParameterLength(1),za=Vi(Ba,Ba.DEGREES).setParameterLength(1),Ha=Vi(Ba,Ba.EXP).setParameterLength(1),$a=Vi(Ba,Ba.EXP2).setParameterLength(1),Wa=Vi(Ba,Ba.LOG).setParameterLength(1),ja=Vi(Ba,Ba.LOG2).setParameterLength(1),qa=Vi(Ba,Ba.SQRT).setParameterLength(1),Xa=Vi(Ba,Ba.INVERSE_SQRT).setParameterLength(1),Ka=Vi(Ba,Ba.FLOOR).setParameterLength(1),Ya=Vi(Ba,Ba.CEIL).setParameterLength(1),Qa=Vi(Ba,Ba.NORMALIZE).setParameterLength(1),Za=Vi(Ba,Ba.FRACT).setParameterLength(1),Ja=Vi(Ba,Ba.SIN).setParameterLength(1),eo=Vi(Ba,Ba.COS).setParameterLength(1),to=Vi(Ba,Ba.TAN).setParameterLength(1),ro=Vi(Ba,Ba.ASIN).setParameterLength(1),so=Vi(Ba,Ba.ACOS).setParameterLength(1),io=Vi(Ba,Ba.ATAN).setParameterLength(1,2),no=Vi(Ba,Ba.ABS).setParameterLength(1),ao=Vi(Ba,Ba.SIGN).setParameterLength(1),oo=Vi(Ba,Ba.LENGTH).setParameterLength(1),uo=Vi(Ba,Ba.NEGATE).setParameterLength(1),lo=Vi(Ba,Ba.ONE_MINUS).setParameterLength(1),co=Vi(Ba,Ba.DFDX).setParameterLength(1),ho=Vi(Ba,Ba.DFDY).setParameterLength(1),po=Vi(Ba,Ba.ROUND).setParameterLength(1),go=Vi(Ba,Ba.RECIPROCAL).setParameterLength(1),mo=Vi(Ba,Ba.TRUNC).setParameterLength(1),fo=Vi(Ba,Ba.FWIDTH).setParameterLength(1),yo=Vi(Ba,Ba.TRANSPOSE).setParameterLength(1),xo=Vi(Ba,Ba.BITCAST).setParameterLength(2),bo=(e,t)=>(console.warn('THREE.TSL: "equals" is deprecated. Use "equal" inside a vector instead, like: "bvec*( equal( ... ) )"'),ha(e,t)),To=Vi(Ba,Ba.MIN).setParameterLength(2,1/0),_o=Vi(Ba,Ba.MAX).setParameterLength(2,1/0),vo=Vi(Ba,Ba.STEP).setParameterLength(2),No=Vi(Ba,Ba.REFLECT).setParameterLength(2),So=Vi(Ba,Ba.DISTANCE).setParameterLength(2),Eo=Vi(Ba,Ba.DIFFERENCE).setParameterLength(2),wo=Vi(Ba,Ba.DOT).setParameterLength(2),Ao=Vi(Ba,Ba.CROSS).setParameterLength(2),Ro=Vi(Ba,Ba.POW).setParameterLength(2),Co=Vi(Ba,Ba.POW,2).setParameterLength(1),Mo=Vi(Ba,Ba.POW,3).setParameterLength(1),Po=Vi(Ba,Ba.POW,4).setParameterLength(1),Lo=Vi(Ba,Ba.TRANSFORM_DIRECTION).setParameterLength(2),Fo=e=>la(ao(e),Ro(no(e),1/3)),Bo=e=>wo(e,e),Io=Vi(Ba,Ba.MIX).setParameterLength(3),Do=(e,t=0,r=1)=>Bi(new Ba(Ba.CLAMP,Bi(e),Bi(t),Bi(r))),Vo=e=>Do(e),Uo=Vi(Ba,Ba.REFRACT).setParameterLength(3),Oo=Vi(Ba,Ba.SMOOTHSTEP).setParameterLength(3),ko=Vi(Ba,Ba.FACEFORWARD).setParameterLength(3),Go=ki((([e])=>{const t=wo(e.xy,Yi(12.9898,78.233)),r=ca(t,Va);return Za(Ja(r).mul(43758.5453))})),zo=(e,t,r)=>Io(t,r,e),Ho=(e,t,r)=>Oo(t,r,e),$o=(e,t)=>(console.warn('THREE.TSL: "atan2" is overloaded. Use "atan" instead.'),io(e,t)),Wo=ko,jo=Xa;oi("all",Oa),oi("any",ka),oi("equals",bo),oi("radians",Ga),oi("degrees",za),oi("exp",Ha),oi("exp2",$a),oi("log",Wa),oi("log2",ja),oi("sqrt",qa),oi("inverseSqrt",Xa),oi("floor",Ka),oi("ceil",Ya),oi("normalize",Qa),oi("fract",Za),oi("sin",Ja),oi("cos",eo),oi("tan",to),oi("asin",ro),oi("acos",so),oi("atan",io),oi("abs",no),oi("sign",ao),oi("length",oo),oi("lengthSq",Bo),oi("negate",uo),oi("oneMinus",lo),oi("dFdx",co),oi("dFdy",ho),oi("round",po),oi("reciprocal",go),oi("trunc",mo),oi("fwidth",fo),oi("atan2",$o),oi("min",To),oi("max",_o),oi("step",vo),oi("reflect",No),oi("distance",So),oi("dot",wo),oi("cross",Ao),oi("pow",Ro),oi("pow2",Co),oi("pow3",Mo),oi("pow4",Po),oi("transformDirection",Lo),oi("mix",zo),oi("clamp",Do),oi("refract",Uo),oi("smoothstep",Ho),oi("faceForward",ko),oi("difference",Eo),oi("saturate",Vo),oi("cbrt",Fo),oi("transpose",yo),oi("rand",Go);class qo extends js{static get type(){return"ConditionalNode"}constructor(e,t,r=null){super(),this.condNode=e,this.ifNode=t,this.elseNode=r}getNodeType(e){const{ifNode:t,elseNode:r}=e.getNodeProperties(this);if(void 0===t)return this.setup(e),this.getNodeType(e);const s=t.getNodeType(e);if(null!==r){const t=r.getNodeType(e);if(e.getTypeLength(t)>e.getTypeLength(s))return t}return s}setup(e){const t=this.condNode.cache(),r=this.ifNode.cache(),s=this.elseNode?this.elseNode.cache():null,i=e.context.nodeBlock;e.getDataFromNode(r).parentNodeBlock=i,null!==s&&(e.getDataFromNode(s).parentNodeBlock=i);const n=e.getNodeProperties(this);n.condNode=t,n.ifNode=r.context({nodeBlock:r}),n.elseNode=s?s.context({nodeBlock:s}):null}generate(e,t){const r=this.getNodeType(e),s=e.getDataFromNode(this);if(void 0!==s.nodeProperty)return s.nodeProperty;const{condNode:i,ifNode:n,elseNode:a}=e.getNodeProperties(this),o=e.currentFunctionNode,u="void"!==t,l=u?mn(r).build(e):"";s.nodeProperty=l;const d=i.build(e,"bool");e.addFlowCode(`\n${e.tab}if ( ${d} ) {\n\n`).addFlowTab();let c=n.build(e,r);if(c&&(u?c=l+" = "+c+";":(c="return "+c+";",null===o&&(console.warn("THREE.TSL: Return statement used in an inline 'Fn()'. Define a layout struct to allow return values."),c="// "+c))),e.removeFlowTab().addFlowCode(e.tab+"\t"+c+"\n\n"+e.tab+"}"),null!==a){e.addFlowCode(" else {\n\n").addFlowTab();let t=a.build(e,r);t&&(u?t=l+" = "+t+";":(t="return "+t+";",null===o&&(console.warn("THREE.TSL: Return statement used in an inline 'Fn()'. Define a layout struct to allow return values."),t="// "+t))),e.removeFlowTab().addFlowCode(e.tab+"\t"+t+"\n\n"+e.tab+"}\n\n")}else e.addFlowCode("\n\n");return e.format(l,r,t)}}const Xo=Vi(qo).setParameterLength(2,3);oi("select",Xo);const Ko=(...e)=>(console.warn("THREE.TSL: cond() has been renamed to select()."),Xo(...e));oi("cond",Ko);class Yo extends js{static get type(){return"ContextNode"}constructor(e,t={}){super(),this.isContextNode=!0,this.node=e,this.value=t}getScope(){return this.node.getScope()}getNodeType(e){return this.node.getNodeType(e)}analyze(e){const t=e.getContext();e.setContext({...e.context,...this.value}),this.node.build(e),e.setContext(t)}setup(e){const t=e.getContext();e.setContext({...e.context,...this.value}),this.node.build(e),e.setContext(t)}generate(e,t){const r=e.getContext();e.setContext({...e.context,...this.value});const s=this.node.build(e,t);return e.setContext(r),s}}const Qo=Vi(Yo).setParameterLength(1,2),Zo=(e,t)=>Qo(e,{label:t});oi("context",Qo),oi("label",Zo);class Jo extends js{static get type(){return"VarNode"}constructor(e,t=null,r=!1){super(),this.node=e,this.name=t,this.global=!0,this.isVarNode=!0,this.readOnly=r,this.parents=!0}getMemberType(e,t){return this.node.getMemberType(e,t)}getElementType(e){return this.node.getElementType(e)}getNodeType(e){return this.node.getNodeType(e)}generate(e){const{node:t,name:r,readOnly:s}=this,{renderer:i}=e,n=!0===i.backend.isWebGPUBackend;let a=!1,o=!1;s&&(a=e.isDeterministic(t),o=n?s:a);const u=e.getVectorType(this.getNodeType(e)),l=t.build(e,u),d=e.getVarFromNode(this,r,u,void 0,o),c=e.getPropertyName(d);let h=c;if(o)if(n)h=a?`const ${c}`:`let ${c}`;else{const r=e.getArrayCount(t);h=`const ${e.getVar(d.type,c,r)}`}return e.addLineFlowCode(`${h} = ${l}`,this),c}}const eu=Vi(Jo),tu=(e,t=null)=>eu(e,t).toStack(),ru=(e,t=null)=>eu(e,t,!0).toStack();oi("toVar",tu),oi("toConst",ru);const su=e=>(console.warn('TSL: "temp( node )" is deprecated. Use "Var( node )" or "node.toVar()" instead.'),eu(e));oi("temp",su);class iu extends js{static get type(){return"VaryingNode"}constructor(e,t=null){super(),this.node=e,this.name=t,this.isVaryingNode=!0,this.interpolationType=null,this.interpolationSampling=null,this.global=!0}setInterpolation(e,t=null){return this.interpolationType=e,this.interpolationSampling=t,this}getHash(e){return this.name||super.getHash(e)}getNodeType(e){return this.node.getNodeType(e)}setupVarying(e){const t=e.getNodeProperties(this);let r=t.varying;if(void 0===r){const s=this.name,i=this.getNodeType(e),n=this.interpolationType,a=this.interpolationSampling;t.varying=r=e.getVaryingFromNode(this,s,i,n,a),t.node=this.node}return r.needsInterpolation||(r.needsInterpolation="fragment"===e.shaderStage),r}setup(e){this.setupVarying(e),e.flowNodeFromShaderStage(Ds.VERTEX,this.node)}analyze(e){this.setupVarying(e),e.flowNodeFromShaderStage(Ds.VERTEX,this.node)}generate(e){const t=e.getNodeProperties(this),r=this.setupVarying(e);if(void 0===t.propertyName){const s=this.getNodeType(e),i=e.getPropertyName(r,Ds.VERTEX);e.flowNodeFromShaderStage(Ds.VERTEX,this.node,s,i),t.propertyName=i}return e.getPropertyName(r)}}const nu=Vi(iu).setParameterLength(1,2),au=e=>nu(e);oi("toVarying",nu),oi("toVertexStage",au),oi("varying",((...e)=>(console.warn("THREE.TSL: .varying() has been renamed to .toVarying()."),nu(...e)))),oi("vertexStage",((...e)=>(console.warn("THREE.TSL: .vertexStage() has been renamed to .toVertexStage()."),nu(...e))));const ou=ki((([e])=>{const t=e.mul(.9478672986).add(.0521327014).pow(2.4),r=e.mul(.0773993808),s=e.lessThanEqual(.04045);return Io(t,r,s)})).setLayout({name:"sRGBTransferEOTF",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),uu=ki((([e])=>{const t=e.pow(.41666).mul(1.055).sub(.055),r=e.mul(12.92),s=e.lessThanEqual(.0031308);return Io(t,r,s)})).setLayout({name:"sRGBTransferOETF",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),lu="WorkingColorSpace";class du extends Ks{static get type(){return"ColorSpaceNode"}constructor(e,t,r){super("vec4"),this.colorNode=e,this.source=t,this.target=r}resolveColorSpace(e,t){return t===lu?c.workingColorSpace:"OutputColorSpace"===t?e.context.outputColorSpace||e.renderer.outputColorSpace:t}setup(e){const{colorNode:t}=this,r=this.resolveColorSpace(e,this.source),s=this.resolveColorSpace(e,this.target);let i=t;return!1!==c.enabled&&r!==s&&r&&s?(c.getTransfer(r)===h&&(i=nn(ou(i.rgb),i.a)),c.getPrimaries(r)!==c.getPrimaries(s)&&(i=nn(dn(c._getMatrix(new n,r,s)).mul(i.rgb),i.a)),c.getTransfer(s)===h&&(i=nn(uu(i.rgb),i.a)),i):i}}const cu=(e,t)=>Bi(new du(Bi(e),lu,t)),hu=(e,t)=>Bi(new du(Bi(e),t,lu));oi("workingToColorSpace",cu),oi("colorSpaceToWorking",hu);let pu=class extends qs{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),r=this.referenceNode.getNodeType(),s=this.getNodeType();return e.format(t,r,s)}};class gu extends js{static get type(){return"ReferenceBaseNode"}constructor(e,t,r=null,s=null){super(),this.property=e,this.uniformType=t,this.object=r,this.count=s,this.properties=e.split("."),this.reference=r,this.node=null,this.group=null,this.updateType=Vs.OBJECT}setGroup(e){return this.group=e,this}element(e){return Bi(new pu(this,Bi(e)))}setNodeType(e){const t=Zn(null,e).getSelf();null!==this.group&&t.setGroup(this.group),this.node=t}getNodeType(e){return null===this.node&&(this.updateReference(e),this.updateValue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let r=e[t[0]];for(let e=1;eBi(new mu(e,t,r));class yu extends Ks{static get type(){return"ToneMappingNode"}constructor(e,t=bu,r=null){super("vec3"),this.toneMapping=e,this.exposureNode=t,this.colorNode=r}customCacheKey(){return Ts(this.toneMapping)}setup(e){const t=this.colorNode||e.context.color,r=this.toneMapping;if(r===p)return t;let s=null;const i=e.renderer.library.getToneMappingFunction(r);return null!==i?s=nn(i(t.rgb,this.exposureNode),t.a):(console.error("ToneMappingNode: Unsupported Tone Mapping configuration.",r),s=t),s}}const xu=(e,t,r)=>Bi(new yu(e,Bi(t),Bi(r))),bu=fu("toneMappingExposure","float");oi("toneMapping",((e,t,r)=>xu(t,r,e)));class Tu extends ti{static get type(){return"BufferAttributeNode"}constructor(e,t=null,r=0,s=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferStride=r,this.bufferOffset=s,this.usage=g,this.instanced=!1,this.attribute=null,this.global=!0,e&&!0===e.isBufferAttribute&&(this.attribute=e,this.usage=e.usage,this.instanced=e.isInstancedBufferAttribute)}getHash(e){if(0===this.bufferStride&&0===this.bufferOffset){let t=e.globalCache.getData(this.value);return void 0===t&&(t={node:this},e.globalCache.setData(this.value,t)),t.node.uuid}return this.uuid}getNodeType(e){return null===this.bufferType&&(this.bufferType=e.getTypeFromAttribute(this.attribute)),this.bufferType}setup(e){if(null!==this.attribute)return;const t=this.getNodeType(e),r=this.value,s=e.getTypeLength(t),i=this.bufferStride||s,n=this.bufferOffset,a=!0===r.isInterleavedBuffer?r:new m(r,i),o=new f(a,s,n);a.setUsage(this.usage),this.attribute=o,this.attribute.isInstancedBufferAttribute=this.instanced}generate(e){const t=this.getNodeType(e),r=e.getBufferAttributeFromNode(this,t),s=e.getPropertyName(r);let i=null;if("vertex"===e.shaderStage||"compute"===e.shaderStage)this.name=s,i=s;else{i=nu(this).build(e,t)}return i}getInputType(){return"bufferAttribute"}setUsage(e){return this.usage=e,this.attribute&&!0===this.attribute.isBufferAttribute&&(this.attribute.usage=e),this}setInstanced(e){return this.instanced=e,this}}const _u=(e,t=null,r=0,s=0)=>Bi(new Tu(e,t,r,s)),vu=(e,t=null,r=0,s=0)=>_u(e,t,r,s).setUsage(y),Nu=(e,t=null,r=0,s=0)=>_u(e,t,r,s).setInstanced(!0),Su=(e,t=null,r=0,s=0)=>vu(e,t,r,s).setInstanced(!0);oi("toAttribute",(e=>_u(e.value)));class Eu extends js{static get type(){return"ComputeNode"}constructor(e,t,r=[64]){super("void"),this.isComputeNode=!0,this.computeNode=e,this.count=t,this.workgroupSize=r,this.dispatchCount=0,this.version=1,this.name="",this.updateBeforeType=Vs.OBJECT,this.onInitFunction=null,this.updateDispatchCount()}dispose(){this.dispatchEvent({type:"dispose"})}label(e){return this.name=e,this}updateDispatchCount(){const{count:e,workgroupSize:t}=this;let r=t[0];for(let e=1;eBi(new Eu(Bi(e),t,r));oi("compute",wu);class Au extends js{static get type(){return"CacheNode"}constructor(e,t=!0){super(),this.node=e,this.parent=t,this.isCacheNode=!0}getNodeType(e){const t=e.getCache(),r=e.getCacheFromNode(this,this.parent);e.setCache(r);const s=this.node.getNodeType(e);return e.setCache(t),s}build(e,...t){const r=e.getCache(),s=e.getCacheFromNode(this,this.parent);e.setCache(s);const i=this.node.build(e,...t);return e.setCache(r),i}}const Ru=(e,t)=>Bi(new Au(Bi(e),t)),Cu=(e,t)=>e.context({namespace:t});oi("cache",Ru);class Mu extends js{static get type(){return"BypassNode"}constructor(e,t){super(),this.isBypassNode=!0,this.outputNode=e,this.callNode=t}getNodeType(e){return this.outputNode.getNodeType(e)}generate(e){const t=this.callNode.build(e,"void");return""!==t&&e.addLineFlowCode(t,this),this.outputNode.build(e)}}const Pu=Vi(Mu).setParameterLength(2);oi("bypass",Pu);class Lu extends js{static get type(){return"RemapNode"}constructor(e,t,r,s=ji(0),i=ji(1)){super(),this.node=e,this.inLowNode=t,this.inHighNode=r,this.outLowNode=s,this.outHighNode=i,this.doClamp=!0}setup(){const{node:e,inLowNode:t,inHighNode:r,outLowNode:s,outHighNode:i,doClamp:n}=this;let a=e.sub(t).div(r.sub(t));return!0===n&&(a=a.clamp()),a.mul(i.sub(s)).add(s)}}const Fu=Vi(Lu,null,null,{doClamp:!1}).setParameterLength(3,5),Bu=Vi(Lu).setParameterLength(3,5);oi("remap",Fu),oi("remapClamp",Bu);class Iu extends js{static get type(){return"ExpressionNode"}constructor(e="",t="void"){super(t),this.snippet=e}generate(e,t){const r=this.getNodeType(e),s=this.snippet;if("void"!==r)return e.format(s,r,t);e.addLineFlowCode(s,this)}}const Du=Vi(Iu).setParameterLength(1,2),Vu=e=>(e?Xo(e,Du("discard")):Du("discard")).toStack();oi("discard",Vu);class Uu extends Ks{static get type(){return"RenderOutputNode"}constructor(e,t,r){super("vec4"),this.colorNode=e,this.toneMapping=t,this.outputColorSpace=r,this.isRenderOutputNode=!0}setup({context:e}){let t=this.colorNode||e.color;const r=(null!==this.toneMapping?this.toneMapping:e.toneMapping)||p,s=(null!==this.outputColorSpace?this.outputColorSpace:e.outputColorSpace)||x;return r!==p&&(t=t.toneMapping(r)),s!==x&&s!==c.workingColorSpace&&(t=t.workingToColorSpace(s)),t}}const Ou=(e,t=null,r=null)=>Bi(new Uu(Bi(e),t,r));oi("renderOutput",Ou);class ku extends Ks{static get type(){return"DebugNode"}constructor(e,t=null){super(),this.node=e,this.callback=t}getNodeType(e){return this.node.getNodeType(e)}setup(e){return this.node.build(e)}analyze(e){return this.node.build(e)}generate(e){const t=this.callback,r=this.node.build(e),s="--- TSL debug - "+e.shaderStage+" shader ---",i="-".repeat(s.length);let n="";return n+="// #"+s+"#\n",n+=e.flow.code.replace(/^\t/gm,"")+"\n",n+="/* ... */ "+r+" /* ... */\n",n+="// #"+i+"#\n",null!==t?t(e,n):console.log(n),r}}const Gu=(e,t=null)=>Bi(new ku(Bi(e),t));oi("debug",Gu);class zu extends js{static get type(){return"AttributeNode"}constructor(e,t=null){super(t),this.global=!0,this._attributeName=e}getHash(e){return this.getAttributeName(e)}getNodeType(e){let t=this.nodeType;if(null===t){const r=this.getAttributeName(e);if(e.hasGeometryAttribute(r)){const s=e.geometry.getAttribute(r);t=e.getTypeFromAttribute(s)}else t="float"}return t}setAttributeName(e){return this._attributeName=e,this}getAttributeName(){return this._attributeName}generate(e){const t=this.getAttributeName(e),r=this.getNodeType(e);if(!0===e.hasGeometryAttribute(t)){const s=e.geometry.getAttribute(t),i=e.getTypeFromAttribute(s),n=e.getAttribute(t,i);if("vertex"===e.shaderStage)return e.format(n.name,i,r);return nu(this).build(e,r)}return console.warn(`AttributeNode: Vertex attribute "${t}" not found on geometry.`),e.generateConst(r)}serialize(e){super.serialize(e),e.global=this.global,e._attributeName=this._attributeName}deserialize(e){super.deserialize(e),this.global=e.global,this._attributeName=e._attributeName}}const Hu=(e,t=null)=>Bi(new zu(e,t)),$u=(e=0)=>Hu("uv"+(e>0?e:""),"vec2");class Wu extends js{static get type(){return"TextureSizeNode"}constructor(e,t=null){super("uvec2"),this.isTextureSizeNode=!0,this.textureNode=e,this.levelNode=t}generate(e,t){const r=this.textureNode.build(e,"property"),s=null===this.levelNode?"0":this.levelNode.build(e,"int");return e.format(`${e.getMethod("textureDimensions")}( ${r}, ${s} )`,this.getNodeType(e),t)}}const ju=Vi(Wu).setParameterLength(1,2);class qu extends Qn{static get type(){return"MaxMipLevelNode"}constructor(e){super(0),this._textureNode=e,this.updateType=Vs.FRAME}get textureNode(){return this._textureNode}get texture(){return this._textureNode.value}update(){const e=this.texture,t=e.images,r=t&&t.length>0?t[0]&&t[0].image||t[0]:e.image;if(r&&void 0!==r.width){const{width:e,height:t}=r;this.value=Math.log2(Math.max(e,t))}}}const Xu=Vi(qu).setParameterLength(1),Ku=new b;class Yu extends Qn{static get type(){return"TextureNode"}constructor(e=Ku,t=null,r=null,s=null){super(e),this.isTextureNode=!0,this.uvNode=t,this.levelNode=r,this.biasNode=s,this.compareNode=null,this.depthNode=null,this.gradNode=null,this.sampler=!0,this.updateMatrix=!1,this.updateType=Vs.NONE,this.referenceNode=null,this._value=e,this._matrixUniform=null,this.setUpdateMatrix(null===t)}set value(e){this.referenceNode?this.referenceNode.value=e:this._value=e}get value(){return this.referenceNode?this.referenceNode.value:this._value}getUniformHash(){return this.value.uuid}getNodeType(){return!0===this.value.isDepthTexture?"float":this.value.type===T?"uvec4":this.value.type===_?"ivec4":"vec4"}getInputType(){return"texture"}getDefaultUV(){return $u(this.value.channel)}updateReference(){return this.value}getTransformedUV(e){return null===this._matrixUniform&&(this._matrixUniform=Zn(this.value.matrix)),this._matrixUniform.mul(en(e,1)).xy}setUpdateMatrix(e){return this.updateMatrix=e,this.updateType=e?Vs.OBJECT:Vs.NONE,this}setupUV(e,t){const r=this.value;return e.isFlipY()&&(r.image instanceof ImageBitmap&&!0===r.flipY||!0===r.isRenderTargetTexture||!0===r.isFramebufferTexture||!0===r.isDepthTexture)&&(t=this.sampler?t.flipY():t.setY(qi(ju(this,this.levelNode).y).sub(t.y).sub(1))),t}setup(e){const t=e.getNodeProperties(this);t.referenceNode=this.referenceNode;const r=this.value;if(!r||!0!==r.isTexture)throw new Error("THREE.TSL: `texture( value )` function expects a valid instance of THREE.Texture().");let s=this.uvNode;null!==s&&!0!==e.context.forceUVContext||!e.context.getUV||(s=e.context.getUV(this,e)),s||(s=this.getDefaultUV()),!0===this.updateMatrix&&(s=this.getTransformedUV(s)),s=this.setupUV(e,s);let i=this.levelNode;null===i&&e.context.getTextureLevel&&(i=e.context.getTextureLevel(this)),t.uvNode=s,t.levelNode=i,t.biasNode=this.biasNode,t.compareNode=this.compareNode,t.gradNode=this.gradNode,t.depthNode=this.depthNode}generateUV(e,t){return t.build(e,!0===this.sampler?"vec2":"ivec2")}generateSnippet(e,t,r,s,i,n,a,o){const u=this.value;let l;return l=s?e.generateTextureLevel(u,t,r,s,n):i?e.generateTextureBias(u,t,r,i,n):o?e.generateTextureGrad(u,t,r,o,n):a?e.generateTextureCompare(u,t,r,a,n):!1===this.sampler?e.generateTextureLoad(u,t,r,n):e.generateTexture(u,t,r,n),l}generate(e,t){const r=this.value,s=e.getNodeProperties(this),i=super.generate(e,"property");if(/^sampler/.test(t))return i+"_sampler";if(e.isReference(t))return i;{const n=e.getDataFromNode(this);let a=n.propertyName;if(void 0===a){const{uvNode:t,levelNode:r,biasNode:o,compareNode:u,depthNode:l,gradNode:d}=s,c=this.generateUV(e,t),h=r?r.build(e,"float"):null,p=o?o.build(e,"float"):null,g=l?l.build(e,"int"):null,m=u?u.build(e,"float"):null,f=d?[d[0].build(e,"vec2"),d[1].build(e,"vec2")]:null,y=e.getVarFromNode(this);a=e.getPropertyName(y);const x=this.generateSnippet(e,i,c,h,p,g,m,f);e.addLineFlowCode(`${a} = ${x}`,this),n.snippet=x,n.propertyName=a}let o=a;const u=this.getNodeType(e);return e.needsToWorkingColorSpace(r)&&(o=hu(Du(o,u),r.colorSpace).setup(e).build(e,u)),e.format(o,u,t)}}setSampler(e){return this.sampler=e,this}getSampler(){return this.sampler}uv(e){return console.warn("THREE.TextureNode: .uv() has been renamed. Use .sample() instead."),this.sample(e)}sample(e){const t=this.clone();return t.uvNode=Bi(e),t.referenceNode=this.getSelf(),Bi(t)}blur(e){const t=this.clone();t.biasNode=Bi(e).mul(Xu(t)),t.referenceNode=this.getSelf();const r=t.value;return!1===t.generateMipmaps&&(r&&!1===r.generateMipmaps||r.minFilter===v||r.magFilter===v)&&(console.warn("THREE.TSL: texture().blur() requires mipmaps and sampling. Use .generateMipmaps=true and .minFilter/.magFilter=THREE.LinearFilter in the Texture."),t.biasNode=null),Bi(t)}level(e){const t=this.clone();return t.levelNode=Bi(e),t.referenceNode=this.getSelf(),Bi(t)}size(e){return ju(this,e)}bias(e){const t=this.clone();return t.biasNode=Bi(e),t.referenceNode=this.getSelf(),Bi(t)}compare(e){const t=this.clone();return t.compareNode=Bi(e),t.referenceNode=this.getSelf(),Bi(t)}grad(e,t){const r=this.clone();return r.gradNode=[Bi(e),Bi(t)],r.referenceNode=this.getSelf(),Bi(r)}depth(e){const t=this.clone();return t.depthNode=Bi(e),t.referenceNode=this.getSelf(),Bi(t)}serialize(e){super.serialize(e),e.value=this.value.toJSON(e.meta).uuid,e.sampler=this.sampler,e.updateMatrix=this.updateMatrix,e.updateType=this.updateType}deserialize(e){super.deserialize(e),this.value=e.meta.textures[e.value],this.sampler=e.sampler,this.updateMatrix=e.updateMatrix,this.updateType=e.updateType}update(){const e=this.value,t=this._matrixUniform;null!==t&&(t.value=e.matrix),!0===e.matrixAutoUpdate&&e.updateMatrix()}clone(){const e=new this.constructor(this.value,this.uvNode,this.levelNode,this.biasNode);return e.sampler=this.sampler,e.depthNode=this.depthNode,e.compareNode=this.compareNode,e.gradNode=this.gradNode,e}}const Qu=Vi(Yu).setParameterLength(1,4).setName("texture"),Zu=(e=Ku,t=null,r=null,s=null)=>{let i;return e&&!0===e.isTextureNode?(i=Bi(e.clone()),i.referenceNode=e.getSelf(),null!==t&&(i.uvNode=Bi(t)),null!==r&&(i.levelNode=Bi(r)),null!==s&&(i.biasNode=Bi(s))):i=Qu(e,t,r,s),i},Ju=(...e)=>Zu(...e).setSampler(!1);class el extends Qn{static get type(){return"BufferNode"}constructor(e,t,r=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferCount=r}getElementType(e){return this.getNodeType(e)}getInputType(){return"buffer"}}const tl=(e,t,r)=>Bi(new el(e,t,r));class rl extends qs{static get type(){return"UniformArrayElementNode"}constructor(e,t){super(e,t),this.isArrayBufferElementNode=!0}generate(e){const t=super.generate(e),r=this.getNodeType(),s=this.node.getPaddedType();return e.format(t,s,r)}}class sl extends el{static get type(){return"UniformArrayNode"}constructor(e,t=null){super(null),this.array=e,this.elementType=null===t?Ms(e[0]):t,this.paddedType=this.getPaddedType(),this.updateType=Vs.RENDER,this.isArrayBufferNode=!0}getNodeType(){return this.paddedType}getElementType(){return this.elementType}getPaddedType(){const e=this.elementType;let t="vec4";return"mat2"===e?t="mat2":!0===/mat/.test(e)?t="mat4":"i"===e.charAt(0)?t="ivec4":"u"===e.charAt(0)&&(t="uvec4"),t}update(){const{array:e,value:t}=this,r=this.elementType;if("float"===r||"int"===r||"uint"===r)for(let r=0;rBi(new sl(e,t));const nl=Vi(class extends js{constructor(e){super("float"),this.name=e,this.isBuiltinNode=!0}generate(){return this.name}}).setParameterLength(1),al=Zn(0,"uint").label("u_cameraIndex").setGroup(qn("cameraIndex")).toVarying("v_cameraIndex"),ol=Zn("float").label("cameraNear").setGroup(Kn).onRenderUpdate((({camera:e})=>e.near)),ul=Zn("float").label("cameraFar").setGroup(Kn).onRenderUpdate((({camera:e})=>e.far)),ll=ki((({camera:e})=>{let t;if(e.isArrayCamera&&e.cameras.length>0){const r=[];for(const t of e.cameras)r.push(t.projectionMatrix);t=il(r).setGroup(Kn).label("cameraProjectionMatrices").element(e.isMultiViewCamera?nl("gl_ViewID_OVR"):al).toVar("cameraProjectionMatrix")}else t=Zn("mat4").label("cameraProjectionMatrix").setGroup(Kn).onRenderUpdate((({camera:e})=>e.projectionMatrix));return t})).once()(),dl=ki((({camera:e})=>{let t;if(e.isArrayCamera&&e.cameras.length>0){const r=[];for(const t of e.cameras)r.push(t.projectionMatrixInverse);t=il(r).setGroup(Kn).label("cameraProjectionMatricesInverse").element(e.isMultiViewCamera?nl("gl_ViewID_OVR"):al).toVar("cameraProjectionMatrixInverse")}else t=Zn("mat4").label("cameraProjectionMatrixInverse").setGroup(Kn).onRenderUpdate((({camera:e})=>e.projectionMatrixInverse));return t})).once()(),cl=ki((({camera:e})=>{let t;if(e.isArrayCamera&&e.cameras.length>0){const r=[];for(const t of e.cameras)r.push(t.matrixWorldInverse);t=il(r).setGroup(Kn).label("cameraViewMatrices").element(e.isMultiViewCamera?nl("gl_ViewID_OVR"):al).toVar("cameraViewMatrix")}else t=Zn("mat4").label("cameraViewMatrix").setGroup(Kn).onRenderUpdate((({camera:e})=>e.matrixWorldInverse));return t})).once()(),hl=Zn("mat4").label("cameraWorldMatrix").setGroup(Kn).onRenderUpdate((({camera:e})=>e.matrixWorld)),pl=Zn("mat3").label("cameraNormalMatrix").setGroup(Kn).onRenderUpdate((({camera:e})=>e.normalMatrix)),gl=Zn(new r).label("cameraPosition").setGroup(Kn).onRenderUpdate((({camera:e},t)=>t.value.setFromMatrixPosition(e.matrixWorld))),ml=new N;class fl extends js{static get type(){return"Object3DNode"}constructor(e,t=null){super(),this.scope=e,this.object3d=t,this.updateType=Vs.OBJECT,this.uniformNode=new Qn(null)}getNodeType(){const e=this.scope;return e===fl.WORLD_MATRIX?"mat4":e===fl.POSITION||e===fl.VIEW_POSITION||e===fl.DIRECTION||e===fl.SCALE?"vec3":e===fl.RADIUS?"float":void 0}update(e){const t=this.object3d,s=this.uniformNode,i=this.scope;if(i===fl.WORLD_MATRIX)s.value=t.matrixWorld;else if(i===fl.POSITION)s.value=s.value||new r,s.value.setFromMatrixPosition(t.matrixWorld);else if(i===fl.SCALE)s.value=s.value||new r,s.value.setFromMatrixScale(t.matrixWorld);else if(i===fl.DIRECTION)s.value=s.value||new r,t.getWorldDirection(s.value);else if(i===fl.VIEW_POSITION){const i=e.camera;s.value=s.value||new r,s.value.setFromMatrixPosition(t.matrixWorld),s.value.applyMatrix4(i.matrixWorldInverse)}else if(i===fl.RADIUS){const r=e.object.geometry;null===r.boundingSphere&&r.computeBoundingSphere(),ml.copy(r.boundingSphere).applyMatrix4(t.matrixWorld),s.value=ml.radius}}generate(e){const t=this.scope;return t===fl.WORLD_MATRIX?this.uniformNode.nodeType="mat4":t===fl.POSITION||t===fl.VIEW_POSITION||t===fl.DIRECTION||t===fl.SCALE?this.uniformNode.nodeType="vec3":t===fl.RADIUS&&(this.uniformNode.nodeType="float"),this.uniformNode.build(e)}serialize(e){super.serialize(e),e.scope=this.scope}deserialize(e){super.deserialize(e),this.scope=e.scope}}fl.WORLD_MATRIX="worldMatrix",fl.POSITION="position",fl.SCALE="scale",fl.VIEW_POSITION="viewPosition",fl.DIRECTION="direction",fl.RADIUS="radius";const yl=Vi(fl,fl.DIRECTION).setParameterLength(1),xl=Vi(fl,fl.WORLD_MATRIX).setParameterLength(1),bl=Vi(fl,fl.POSITION).setParameterLength(1),Tl=Vi(fl,fl.SCALE).setParameterLength(1),_l=Vi(fl,fl.VIEW_POSITION).setParameterLength(1),vl=Vi(fl,fl.RADIUS).setParameterLength(1);class Nl extends fl{static get type(){return"ModelNode"}constructor(e){super(e)}update(e){this.object3d=e.object,super.update(e)}}const Sl=Ui(Nl,Nl.DIRECTION),El=Ui(Nl,Nl.WORLD_MATRIX),wl=Ui(Nl,Nl.POSITION),Al=Ui(Nl,Nl.SCALE),Rl=Ui(Nl,Nl.VIEW_POSITION),Cl=Ui(Nl,Nl.RADIUS),Ml=Zn(new n).onObjectUpdate((({object:e},t)=>t.value.getNormalMatrix(e.matrixWorld))),Pl=Zn(new a).onObjectUpdate((({object:e},t)=>t.value.copy(e.matrixWorld).invert())),Ll=ki((e=>e.renderer.overrideNodes.modelViewMatrix||Fl)).once()().toVar("modelViewMatrix"),Fl=cl.mul(El),Bl=ki((e=>(e.context.isHighPrecisionModelViewMatrix=!0,Zn("mat4").onObjectUpdate((({object:e,camera:t})=>e.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,e.matrixWorld)))))).once()().toVar("highpModelViewMatrix"),Il=ki((e=>{const t=e.context.isHighPrecisionModelViewMatrix;return Zn("mat3").onObjectUpdate((({object:e,camera:r})=>(!0!==t&&e.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix))))})).once()().toVar("highpModelNormalViewMatrix"),Dl=Hu("position","vec3"),Vl=Dl.toVarying("positionLocal"),Ul=Dl.toVarying("positionPrevious"),Ol=ki((e=>El.mul(Vl).xyz.toVarying(e.getNamespace("v_positionWorld"))),"vec3").once("POSITION")(),kl=ki((e=>Vl.transformDirection(El).toVarying(e.getNamespace("v_positionWorldDirection")).normalize().toVar("positionWorldDirection")),"vec3").once("POSITION")(),Gl=ki((e=>e.context.setupPositionView().toVarying(e.getNamespace("v_positionView"))),"vec3").once("POSITION")(),zl=Gl.negate().toVarying("v_positionViewDirection").normalize().toVar("positionViewDirection");class Hl extends js{static get type(){return"FrontFacingNode"}constructor(){super("bool"),this.isFrontFacingNode=!0}generate(e){const{renderer:t,material:r}=e;return t.coordinateSystem===l&&r.side===S?"false":e.getFrontFacing()}}const $l=Ui(Hl),Wl=ji($l).mul(2).sub(1),jl=Hu("normal","vec3"),ql=ki((e=>!1===e.geometry.hasAttribute("normal")?(console.warn('THREE.TSL: Vertex attribute "normal" not found on geometry.'),en(0,1,0)):jl),"vec3").once()().toVar("normalLocal"),Xl=Gl.dFdx().cross(Gl.dFdy()).normalize().toVar("normalFlat"),Kl=ki((e=>{let t;return t=!0===e.material.flatShading?Xl:nu(td(ql),"v_normalView").normalize(),t}),"vec3").once()().toVar("normalView"),Yl=ki((e=>{let t=Kl.transformDirection(cl);return!0!==e.material.flatShading&&(t=nu(t,"v_normalWorld")),t}),"vec3").once()().normalize().toVar("normalWorld"),Ql=ki((e=>{let t=e.context.setupNormal().context({getUV:null});return!0!==e.material.flatShading&&(t=t.mul(Wl)),t}),"vec3").once()().toVar("transformedNormalView"),Zl=Ql.transformDirection(cl).toVar("transformedNormalWorld"),Jl=ki((e=>{let t=e.context.setupClearcoatNormal().context({getUV:null});return!0!==e.material.flatShading&&(t=t.mul(Wl)),t}),"vec3").once()().toVar("transformedClearcoatNormalView"),ed=ki((([e,t=El])=>{const r=dn(t),s=e.div(en(r[0].dot(r[0]),r[1].dot(r[1]),r[2].dot(r[2])));return r.mul(s).xyz})),td=ki((([e],t)=>{const r=t.renderer.overrideNodes.modelNormalViewMatrix;if(null!==r)return r.transformDirection(e);const s=Ml.mul(e);return cl.transformDirection(s)})),rd=new E,sd=new a,id=Zn(0).onReference((({material:e})=>e)).onObjectUpdate((({material:e})=>e.refractionRatio)),nd=Zn(1).onReference((({material:e})=>e)).onObjectUpdate((function({material:e,scene:t}){return e.envMap?e.envMapIntensity:t.environmentIntensity})),ad=Zn(new a).onReference((function(e){return e.material})).onObjectUpdate((function({material:e,scene:t}){const r=null!==t.environment&&null===e.envMap?t.environmentRotation:e.envMapRotation;return r?(rd.copy(r),sd.makeRotationFromEuler(rd)):sd.identity(),sd})),od=zl.negate().reflect(Ql),ud=zl.negate().refract(Ql,id),ld=od.transformDirection(cl).toVar("reflectVector"),dd=ud.transformDirection(cl).toVar("reflectVector"),cd=new w;class hd extends Yu{static get type(){return"CubeTextureNode"}constructor(e,t=null,r=null,s=null){super(e,t,r,s),this.isCubeTextureNode=!0}getInputType(){return"cubeTexture"}getDefaultUV(){const e=this.value;return e.mapping===A?ld:e.mapping===R?dd:(console.error('THREE.CubeTextureNode: Mapping "%s" not supported.',e.mapping),en(0,0,0))}setUpdateMatrix(){}setupUV(e,t){const r=this.value;return e.renderer.coordinateSystem!==d&&r.isRenderTargetTexture||(t=en(t.x.negate(),t.yz)),ad.mul(t)}generateUV(e,t){return t.build(e,"vec3")}}const pd=Vi(hd).setParameterLength(1,4).setName("cubeTexture"),gd=(e=cd,t=null,r=null,s=null)=>{let i;return e&&!0===e.isCubeTextureNode?(i=Bi(e.clone()),i.referenceNode=e.getSelf(),null!==t&&(i.uvNode=Bi(t)),null!==r&&(i.levelNode=Bi(r)),null!==s&&(i.biasNode=Bi(s))):i=pd(e,t,r,s),i};class md extends qs{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),r=this.referenceNode.getNodeType(),s=this.getNodeType();return e.format(t,r,s)}}class fd extends js{static get type(){return"ReferenceNode"}constructor(e,t,r=null,s=null){super(),this.property=e,this.uniformType=t,this.object=r,this.count=s,this.properties=e.split("."),this.reference=r,this.node=null,this.group=null,this.name=null,this.updateType=Vs.OBJECT}element(e){return Bi(new md(this,Bi(e)))}setGroup(e){return this.group=e,this}label(e){return this.name=e,this}setNodeType(e){let t=null;t=null!==this.count?tl(null,e,this.count):Array.isArray(this.getValueFromReference())?il(null,e):"texture"===e?Zu(null):"cubeTexture"===e?gd(null):Zn(null,e),null!==this.group&&t.setGroup(this.group),null!==this.name&&t.label(this.name),this.node=t.getSelf()}getNodeType(e){return null===this.node&&(this.updateReference(e),this.updateValue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let r=e[t[0]];for(let e=1;eBi(new fd(e,t,r)),xd=(e,t,r,s)=>Bi(new fd(e,t,s,r));class bd extends fd{static get type(){return"MaterialReferenceNode"}constructor(e,t,r=null){super(e,t,r),this.material=r,this.isMaterialReferenceNode=!0}updateReference(e){return this.reference=null!==this.material?this.material:e.material,this.reference}}const Td=(e,t,r=null)=>Bi(new bd(e,t,r)),_d=ki((e=>(!1===e.geometry.hasAttribute("tangent")&&e.geometry.computeTangents(),Hu("tangent","vec4"))))(),vd=_d.xyz.toVar("tangentLocal"),Nd=Ll.mul(nn(vd,0)).xyz.toVarying("v_tangentView").normalize().toVar("tangentView"),Sd=Nd.transformDirection(cl).toVarying("v_tangentWorld").normalize().toVar("tangentWorld"),Ed=Nd.toVar("transformedTangentView"),wd=Ed.transformDirection(cl).normalize().toVar("transformedTangentWorld"),Ad=ki((([e,t],r)=>{let s=e.mul(_d.w).xyz;return!0!==r.material.flatShading&&(s=nu(s,t)),s})).once(),Rd=Ad(jl.cross(_d),"v_bitangentGeometry").normalize().toVar("bitangentGeometry"),Cd=Ad(ql.cross(vd),"v_bitangentLocal").normalize().toVar("bitangentLocal"),Md=Ad(Kl.cross(Nd),"v_bitangentView").normalize().toVar("bitangentView"),Pd=Ad(Yl.cross(Sd),"v_bitangentWorld").normalize().toVar("bitangentWorld"),Ld=Ad(Ql.cross(Ed),"v_transformedBitangentView").normalize().toVar("transformedBitangentView"),Fd=Ld.transformDirection(cl).normalize().toVar("transformedBitangentWorld"),Bd=dn(Nd,Md,Kl),Id=zl.mul(Bd),Dd=(()=>{let e=Pn.cross(zl);return e=e.cross(Pn).normalize(),e=Io(e,Ql,Cn.mul(bn.oneMinus()).oneMinus().pow2().pow2()).normalize(),e})(),Vd=ki((e=>{const{eye_pos:t,surf_norm:r,mapN:s,uv:i}=e,n=t.dFdx(),a=t.dFdy(),o=i.dFdx(),u=i.dFdy(),l=r,d=a.cross(l),c=l.cross(n),h=d.mul(o.x).add(c.mul(u.x)),p=d.mul(o.y).add(c.mul(u.y)),g=h.dot(h).max(p.dot(p)),m=Wl.mul(g.inverseSqrt());return oa(h.mul(s.x,m),p.mul(s.y,m),l.mul(s.z)).normalize()}));class Ud extends Ks{static get type(){return"NormalMapNode"}constructor(e,t=null){super("vec3"),this.node=e,this.scaleNode=t,this.normalMapType=C}setup(e){const{normalMapType:t,scaleNode:r}=this;let s=this.node.mul(2).sub(1);null!==r&&(s=en(s.xy.mul(r),s.z));let i=null;if(t===M)i=td(s);else if(t===C){i=!0===e.hasGeometryAttribute("tangent")?Bd.mul(s).normalize():Vd({eye_pos:Gl,surf_norm:Kl,mapN:s,uv:$u()})}return i}}const Od=Vi(Ud).setParameterLength(1,2),kd=ki((({textureNode:e,bumpScale:t})=>{const r=t=>e.cache().context({getUV:e=>t(e.uvNode||$u()),forceUVContext:!0}),s=ji(r((e=>e)));return Yi(ji(r((e=>e.add(e.dFdx())))).sub(s),ji(r((e=>e.add(e.dFdy())))).sub(s)).mul(t)})),Gd=ki((e=>{const{surf_pos:t,surf_norm:r,dHdxy:s}=e,i=t.dFdx().normalize(),n=r,a=t.dFdy().normalize().cross(n),o=n.cross(i),u=i.dot(a).mul(Wl),l=u.sign().mul(s.x.mul(a).add(s.y.mul(o)));return u.abs().mul(r).sub(l).normalize()}));class zd extends Ks{static get type(){return"BumpMapNode"}constructor(e,t=null){super("vec3"),this.textureNode=e,this.scaleNode=t}setup(){const e=null!==this.scaleNode?this.scaleNode:1,t=kd({textureNode:this.textureNode,bumpScale:e});return Gd({surf_pos:Gl,surf_norm:Kl,dHdxy:t})}}const Hd=Vi(zd).setParameterLength(1,2),$d=new Map;class Wd extends js{static get type(){return"MaterialNode"}constructor(e){super(),this.scope=e}getCache(e,t){let r=$d.get(e);return void 0===r&&(r=Td(e,t),$d.set(e,r)),r}getFloat(e){return this.getCache(e,"float")}getColor(e){return this.getCache(e,"color")}getTexture(e){return this.getCache("map"===e?"map":e+"Map","texture")}setup(e){const t=e.context.material,r=this.scope;let s=null;if(r===Wd.COLOR){const e=void 0!==t.color?this.getColor(r):en();s=t.map&&!0===t.map.isTexture?e.mul(this.getTexture("map")):e}else if(r===Wd.OPACITY){const e=this.getFloat(r);s=t.alphaMap&&!0===t.alphaMap.isTexture?e.mul(this.getTexture("alpha")):e}else if(r===Wd.SPECULAR_STRENGTH)s=t.specularMap&&!0===t.specularMap.isTexture?this.getTexture("specular").r:ji(1);else if(r===Wd.SPECULAR_INTENSITY){const e=this.getFloat(r);s=t.specularIntensityMap&&!0===t.specularIntensityMap.isTexture?e.mul(this.getTexture(r).a):e}else if(r===Wd.SPECULAR_COLOR){const e=this.getColor(r);s=t.specularColorMap&&!0===t.specularColorMap.isTexture?e.mul(this.getTexture(r).rgb):e}else if(r===Wd.ROUGHNESS){const e=this.getFloat(r);s=t.roughnessMap&&!0===t.roughnessMap.isTexture?e.mul(this.getTexture(r).g):e}else if(r===Wd.METALNESS){const e=this.getFloat(r);s=t.metalnessMap&&!0===t.metalnessMap.isTexture?e.mul(this.getTexture(r).b):e}else if(r===Wd.EMISSIVE){const e=this.getFloat("emissiveIntensity"),i=this.getColor(r).mul(e);s=t.emissiveMap&&!0===t.emissiveMap.isTexture?i.mul(this.getTexture(r)):i}else if(r===Wd.NORMAL)t.normalMap?(s=Od(this.getTexture("normal"),this.getCache("normalScale","vec2")),s.normalMapType=t.normalMapType):s=t.bumpMap?Hd(this.getTexture("bump").r,this.getFloat("bumpScale")):Kl;else if(r===Wd.CLEARCOAT){const e=this.getFloat(r);s=t.clearcoatMap&&!0===t.clearcoatMap.isTexture?e.mul(this.getTexture(r).r):e}else if(r===Wd.CLEARCOAT_ROUGHNESS){const e=this.getFloat(r);s=t.clearcoatRoughnessMap&&!0===t.clearcoatRoughnessMap.isTexture?e.mul(this.getTexture(r).r):e}else if(r===Wd.CLEARCOAT_NORMAL)s=t.clearcoatNormalMap?Od(this.getTexture(r),this.getCache(r+"Scale","vec2")):Kl;else if(r===Wd.SHEEN){const e=this.getColor("sheenColor").mul(this.getFloat("sheen"));s=t.sheenColorMap&&!0===t.sheenColorMap.isTexture?e.mul(this.getTexture("sheenColor").rgb):e}else if(r===Wd.SHEEN_ROUGHNESS){const e=this.getFloat(r);s=t.sheenRoughnessMap&&!0===t.sheenRoughnessMap.isTexture?e.mul(this.getTexture(r).a):e,s=s.clamp(.07,1)}else if(r===Wd.ANISOTROPY)if(t.anisotropyMap&&!0===t.anisotropyMap.isTexture){const e=this.getTexture(r);s=ln(Cc.x,Cc.y,Cc.y.negate(),Cc.x).mul(e.rg.mul(2).sub(Yi(1)).normalize().mul(e.b))}else s=Cc;else if(r===Wd.IRIDESCENCE_THICKNESS){const e=yd("1","float",t.iridescenceThicknessRange);if(t.iridescenceThicknessMap){const i=yd("0","float",t.iridescenceThicknessRange);s=e.sub(i).mul(this.getTexture(r).g).add(i)}else s=e}else if(r===Wd.TRANSMISSION){const e=this.getFloat(r);s=t.transmissionMap?e.mul(this.getTexture(r).r):e}else if(r===Wd.THICKNESS){const e=this.getFloat(r);s=t.thicknessMap?e.mul(this.getTexture(r).g):e}else if(r===Wd.IOR)s=this.getFloat(r);else if(r===Wd.LIGHT_MAP)s=this.getTexture(r).rgb.mul(this.getFloat("lightMapIntensity"));else if(r===Wd.AO)s=this.getTexture(r).r.sub(1).mul(this.getFloat("aoMapIntensity")).add(1);else if(r===Wd.LINE_DASH_OFFSET)s=t.dashOffset?this.getFloat(r):ji(0);else{const t=this.getNodeType(e);s=this.getCache(r,t)}return s}}Wd.ALPHA_TEST="alphaTest",Wd.COLOR="color",Wd.OPACITY="opacity",Wd.SHININESS="shininess",Wd.SPECULAR="specular",Wd.SPECULAR_STRENGTH="specularStrength",Wd.SPECULAR_INTENSITY="specularIntensity",Wd.SPECULAR_COLOR="specularColor",Wd.REFLECTIVITY="reflectivity",Wd.ROUGHNESS="roughness",Wd.METALNESS="metalness",Wd.NORMAL="normal",Wd.CLEARCOAT="clearcoat",Wd.CLEARCOAT_ROUGHNESS="clearcoatRoughness",Wd.CLEARCOAT_NORMAL="clearcoatNormal",Wd.EMISSIVE="emissive",Wd.ROTATION="rotation",Wd.SHEEN="sheen",Wd.SHEEN_ROUGHNESS="sheenRoughness",Wd.ANISOTROPY="anisotropy",Wd.IRIDESCENCE="iridescence",Wd.IRIDESCENCE_IOR="iridescenceIOR",Wd.IRIDESCENCE_THICKNESS="iridescenceThickness",Wd.IOR="ior",Wd.TRANSMISSION="transmission",Wd.THICKNESS="thickness",Wd.ATTENUATION_DISTANCE="attenuationDistance",Wd.ATTENUATION_COLOR="attenuationColor",Wd.LINE_SCALE="scale",Wd.LINE_DASH_SIZE="dashSize",Wd.LINE_GAP_SIZE="gapSize",Wd.LINE_WIDTH="linewidth",Wd.LINE_DASH_OFFSET="dashOffset",Wd.POINT_SIZE="size",Wd.DISPERSION="dispersion",Wd.LIGHT_MAP="light",Wd.AO="ao";const jd=Ui(Wd,Wd.ALPHA_TEST),qd=Ui(Wd,Wd.COLOR),Xd=Ui(Wd,Wd.SHININESS),Kd=Ui(Wd,Wd.EMISSIVE),Yd=Ui(Wd,Wd.OPACITY),Qd=Ui(Wd,Wd.SPECULAR),Zd=Ui(Wd,Wd.SPECULAR_INTENSITY),Jd=Ui(Wd,Wd.SPECULAR_COLOR),ec=Ui(Wd,Wd.SPECULAR_STRENGTH),tc=Ui(Wd,Wd.REFLECTIVITY),rc=Ui(Wd,Wd.ROUGHNESS),sc=Ui(Wd,Wd.METALNESS),ic=Ui(Wd,Wd.NORMAL),nc=Ui(Wd,Wd.CLEARCOAT),ac=Ui(Wd,Wd.CLEARCOAT_ROUGHNESS),oc=Ui(Wd,Wd.CLEARCOAT_NORMAL),uc=Ui(Wd,Wd.ROTATION),lc=Ui(Wd,Wd.SHEEN),dc=Ui(Wd,Wd.SHEEN_ROUGHNESS),cc=Ui(Wd,Wd.ANISOTROPY),hc=Ui(Wd,Wd.IRIDESCENCE),pc=Ui(Wd,Wd.IRIDESCENCE_IOR),gc=Ui(Wd,Wd.IRIDESCENCE_THICKNESS),mc=Ui(Wd,Wd.TRANSMISSION),fc=Ui(Wd,Wd.THICKNESS),yc=Ui(Wd,Wd.IOR),xc=Ui(Wd,Wd.ATTENUATION_DISTANCE),bc=Ui(Wd,Wd.ATTENUATION_COLOR),Tc=Ui(Wd,Wd.LINE_SCALE),_c=Ui(Wd,Wd.LINE_DASH_SIZE),vc=Ui(Wd,Wd.LINE_GAP_SIZE),Nc=Ui(Wd,Wd.LINE_WIDTH),Sc=Ui(Wd,Wd.LINE_DASH_OFFSET),Ec=Ui(Wd,Wd.POINT_SIZE),wc=Ui(Wd,Wd.DISPERSION),Ac=Ui(Wd,Wd.LIGHT_MAP),Rc=Ui(Wd,Wd.AO),Cc=Zn(new t).onReference((function(e){return e.material})).onRenderUpdate((function({material:e}){this.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation))})),Mc=ki((e=>e.context.setupModelViewProjection()),"vec4").once()().toVarying("v_modelViewProjection");class Pc extends js{static get type(){return"IndexNode"}constructor(e){super("uint"),this.scope=e,this.isIndexNode=!0}generate(e){const t=this.getNodeType(e),r=this.scope;let s,i;if(r===Pc.VERTEX)s=e.getVertexIndex();else if(r===Pc.INSTANCE)s=e.getInstanceIndex();else if(r===Pc.DRAW)s=e.getDrawIndex();else if(r===Pc.INVOCATION_LOCAL)s=e.getInvocationLocalIndex();else if(r===Pc.INVOCATION_SUBGROUP)s=e.getInvocationSubgroupIndex();else{if(r!==Pc.SUBGROUP)throw new Error("THREE.IndexNode: Unknown scope: "+r);s=e.getSubgroupIndex()}if("vertex"===e.shaderStage||"compute"===e.shaderStage)i=s;else{i=nu(this).build(e,t)}return i}}Pc.VERTEX="vertex",Pc.INSTANCE="instance",Pc.SUBGROUP="subgroup",Pc.INVOCATION_LOCAL="invocationLocal",Pc.INVOCATION_SUBGROUP="invocationSubgroup",Pc.DRAW="draw";const Lc=Ui(Pc,Pc.VERTEX),Fc=Ui(Pc,Pc.INSTANCE),Bc=Ui(Pc,Pc.SUBGROUP),Ic=Ui(Pc,Pc.INVOCATION_SUBGROUP),Dc=Ui(Pc,Pc.INVOCATION_LOCAL),Vc=Ui(Pc,Pc.DRAW);class Uc extends js{static get type(){return"InstanceNode"}constructor(e,t,r=null){super("void"),this.count=e,this.instanceMatrix=t,this.instanceColor=r,this.instanceMatrixNode=null,this.instanceColorNode=null,this.updateType=Vs.FRAME,this.buffer=null,this.bufferColor=null}setup(e){const{count:t,instanceMatrix:r,instanceColor:s}=this;let{instanceMatrixNode:i,instanceColorNode:n}=this;if(null===i){if(t<=1e3)i=tl(r.array,"mat4",Math.max(t,1)).element(Fc);else{const e=new P(r.array,16,1);this.buffer=e;const t=r.usage===y?Su:Nu,s=[t(e,"vec4",16,0),t(e,"vec4",16,4),t(e,"vec4",16,8),t(e,"vec4",16,12)];i=cn(...s)}this.instanceMatrixNode=i}if(s&&null===n){const e=new L(s.array,3),t=s.usage===y?Su:Nu;this.bufferColor=e,n=en(t(e,"vec3",3,0)),this.instanceColorNode=n}const a=i.mul(Vl).xyz;if(Vl.assign(a),e.hasGeometryAttribute("normal")){const e=ed(ql,i);ql.assign(e)}null!==this.instanceColorNode&&fn("vec3","vInstanceColor").assign(this.instanceColorNode)}update(){this.instanceMatrix.usage!==y&&null!==this.buffer&&this.instanceMatrix.version!==this.buffer.version&&(this.buffer.version=this.instanceMatrix.version),this.instanceColor&&this.instanceColor.usage!==y&&null!==this.bufferColor&&this.instanceColor.version!==this.bufferColor.version&&(this.bufferColor.version=this.instanceColor.version)}}const Oc=Vi(Uc).setParameterLength(2,3);class kc extends Uc{static get type(){return"InstancedMeshNode"}constructor(e){const{count:t,instanceMatrix:r,instanceColor:s}=e;super(t,r,s),this.instancedMesh=e}}const Gc=Vi(kc).setParameterLength(1);class zc extends js{static get type(){return"BatchNode"}constructor(e){super("void"),this.batchMesh=e,this.batchingIdNode=null}setup(e){null===this.batchingIdNode&&(null===e.getDrawIndex()?this.batchingIdNode=Fc:this.batchingIdNode=Vc);const t=ki((([e])=>{const t=qi(ju(Ju(this.batchMesh._indirectTexture),0).x),r=qi(e).mod(t),s=qi(e).div(t);return Ju(this.batchMesh._indirectTexture,Qi(r,s)).x})).setLayout({name:"getIndirectIndex",type:"uint",inputs:[{name:"id",type:"int"}]}),r=t(qi(this.batchingIdNode)),s=this.batchMesh._matricesTexture,i=qi(ju(Ju(s),0).x),n=ji(r).mul(4).toInt().toVar(),a=n.mod(i),o=n.div(i),u=cn(Ju(s,Qi(a,o)),Ju(s,Qi(a.add(1),o)),Ju(s,Qi(a.add(2),o)),Ju(s,Qi(a.add(3),o))),l=this.batchMesh._colorsTexture;if(null!==l){const e=ki((([e])=>{const t=qi(ju(Ju(l),0).x),r=e,s=r.mod(t),i=r.div(t);return Ju(l,Qi(s,i)).rgb})).setLayout({name:"getBatchingColor",type:"vec3",inputs:[{name:"id",type:"int"}]}),t=e(r);fn("vec3","vBatchColor").assign(t)}const d=dn(u);Vl.assign(u.mul(Vl));const c=ql.div(en(d[0].dot(d[0]),d[1].dot(d[1]),d[2].dot(d[2]))),h=d.mul(c).xyz;ql.assign(h),e.hasGeometryAttribute("tangent")&&vd.mulAssign(d)}}const Hc=Vi(zc).setParameterLength(1);class $c extends qs{static get type(){return"StorageArrayElementNode"}constructor(e,t){super(e,t),this.isStorageArrayElementNode=!0}set storageBufferNode(e){this.node=e}get storageBufferNode(){return this.node}getMemberType(e,t){const r=this.storageBufferNode.structTypeNode;return r?r.getMemberType(e,t):"void"}setup(e){return!1===e.isAvailable("storageBuffer")&&!0===this.node.isPBO&&e.setupPBO(this.node),super.setup(e)}generate(e,t){let r;const s=e.context.assign;if(r=!1===e.isAvailable("storageBuffer")?!0!==this.node.isPBO||!0===s||!this.node.value.isInstancedBufferAttribute&&"compute"===e.shaderStage?this.node.build(e):e.generatePBO(this):super.generate(e),!0!==s){const s=this.getNodeType(e);r=e.format(r,s,t)}return r}}const Wc=Vi($c).setParameterLength(2);class jc extends el{static get type(){return"StorageBufferNode"}constructor(e,t=null,r=0){let s,i=null;t&&t.isStruct?(s="struct",i=t.layout,(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute)&&(r=e.count)):null===t&&(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute)?(s=Es(e.itemSize),r=e.count):s=t,super(e,s,r),this.isStorageBufferNode=!0,this.structTypeNode=i,this.access=Os.READ_WRITE,this.isAtomic=!1,this.isPBO=!1,this._attribute=null,this._varying=null,this.global=!0,!0!==e.isStorageBufferAttribute&&!0!==e.isStorageInstancedBufferAttribute&&(e.isInstancedBufferAttribute?e.isStorageInstancedBufferAttribute=!0:e.isStorageBufferAttribute=!0)}getHash(e){if(0===this.bufferCount){let t=e.globalCache.getData(this.value);return void 0===t&&(t={node:this},e.globalCache.setData(this.value,t)),t.node.uuid}return this.uuid}getInputType(){return this.value.isIndirectStorageBufferAttribute?"indirectStorageBuffer":"storageBuffer"}element(e){return Wc(this,e)}setPBO(e){return this.isPBO=e,this}getPBO(){return this.isPBO}setAccess(e){return this.access=e,this}toReadOnly(){return this.setAccess(Os.READ_ONLY)}setAtomic(e){return this.isAtomic=e,this}toAtomic(){return this.setAtomic(!0)}getAttributeData(){return null===this._attribute&&(this._attribute=_u(this.value),this._varying=nu(this._attribute)),{attribute:this._attribute,varying:this._varying}}getNodeType(e){if(null!==this.structTypeNode)return this.structTypeNode.getNodeType(e);if(e.isAvailable("storageBuffer")||e.isAvailable("indirectStorageBuffer"))return super.getNodeType(e);const{attribute:t}=this.getAttributeData();return t.getNodeType(e)}getMemberType(e,t){return null!==this.structTypeNode?this.structTypeNode.getMemberType(e,t):"void"}generate(e){if(null!==this.structTypeNode&&this.structTypeNode.build(e),e.isAvailable("storageBuffer")||e.isAvailable("indirectStorageBuffer"))return super.generate(e);const{attribute:t,varying:r}=this.getAttributeData(),s=r.build(e);return e.registerTransform(s,t),s}}const qc=(e,t=null,r=0)=>Bi(new jc(e,t,r)),Xc=new WeakMap;class Kc extends js{static get type(){return"SkinningNode"}constructor(e){super("void"),this.skinnedMesh=e,this.updateType=Vs.OBJECT,this.skinIndexNode=Hu("skinIndex","uvec4"),this.skinWeightNode=Hu("skinWeight","vec4"),this.bindMatrixNode=yd("bindMatrix","mat4"),this.bindMatrixInverseNode=yd("bindMatrixInverse","mat4"),this.boneMatricesNode=xd("skeleton.boneMatrices","mat4",e.skeleton.bones.length),this.positionNode=Vl,this.toPositionNode=Vl,this.previousBoneMatricesNode=null}getSkinnedPosition(e=this.boneMatricesNode,t=this.positionNode){const{skinIndexNode:r,skinWeightNode:s,bindMatrixNode:i,bindMatrixInverseNode:n}=this,a=e.element(r.x),o=e.element(r.y),u=e.element(r.z),l=e.element(r.w),d=i.mul(t),c=oa(a.mul(s.x).mul(d),o.mul(s.y).mul(d),u.mul(s.z).mul(d),l.mul(s.w).mul(d));return n.mul(c).xyz}getSkinnedNormal(e=this.boneMatricesNode,t=ql){const{skinIndexNode:r,skinWeightNode:s,bindMatrixNode:i,bindMatrixInverseNode:n}=this,a=e.element(r.x),o=e.element(r.y),u=e.element(r.z),l=e.element(r.w);let d=oa(s.x.mul(a),s.y.mul(o),s.z.mul(u),s.w.mul(l));return d=n.mul(d).mul(i),d.transformDirection(t).xyz}getPreviousSkinnedPosition(e){const t=e.object;return null===this.previousBoneMatricesNode&&(t.skeleton.previousBoneMatrices=new Float32Array(t.skeleton.boneMatrices),this.previousBoneMatricesNode=xd("skeleton.previousBoneMatrices","mat4",t.skeleton.bones.length)),this.getSkinnedPosition(this.previousBoneMatricesNode,Ul)}needsPreviousBoneMatrices(e){const t=e.renderer.getMRT();return t&&t.has("velocity")||!0===Ls(e.object).useVelocity}setup(e){this.needsPreviousBoneMatrices(e)&&Ul.assign(this.getPreviousSkinnedPosition(e));const t=this.getSkinnedPosition();if(this.toPositionNode&&this.toPositionNode.assign(t),e.hasGeometryAttribute("normal")){const t=this.getSkinnedNormal();ql.assign(t),e.hasGeometryAttribute("tangent")&&vd.assign(t)}return t}generate(e,t){if("void"!==t)return super.generate(e,t)}update(e){const t=e.object&&e.object.skeleton?e.object.skeleton:this.skinnedMesh.skeleton;Xc.get(t)!==e.frameId&&(Xc.set(t,e.frameId),null!==this.previousBoneMatricesNode&&t.previousBoneMatrices.set(t.boneMatrices),t.update())}}const Yc=e=>Bi(new Kc(e));class Qc extends js{static get type(){return"LoopNode"}constructor(e=[]){super(),this.params=e}getVarName(e){return String.fromCharCode("i".charCodeAt(0)+e)}getProperties(e){const t=e.getNodeProperties(this);if(void 0!==t.stackNode)return t;const r={};for(let e=0,t=this.params.length-1;eNumber(u)?">=":"<")),a)n=`while ( ${u} )`;else{const r={start:o,end:u},s=r.start,i=r.end;let a;const p=()=>c.includes("<")?"+=":"-=";if(null!=h)switch(typeof h){case"function":a=e.flowStagesNode(t.updateNode,"void").code.replace(/\t|;/g,"");break;case"number":a=l+" "+p()+" "+e.generateConst(d,h);break;case"string":a=l+" "+h;break;default:h.isNode?a=l+" "+p()+" "+h.build(e):(console.error("THREE.TSL: 'Loop( { update: ... } )' is not a function, string or number."),a="break /* invalid update */")}else h="int"===d||"uint"===d?c.includes("<")?"++":"--":p()+" 1.",a=l+" "+h;n=`for ( ${e.getVar(d,l)+" = "+s}; ${l+" "+c+" "+i}; ${a} )`}e.addFlowCode((0===s?"\n":"")+e.tab+n+" {\n\n").addFlowTab()}const i=s.build(e,"void"),n=t.returnsNode?t.returnsNode.build(e):"";e.removeFlowTab().addFlowCode("\n"+e.tab+i);for(let t=0,r=this.params.length-1;tBi(new Qc(Di(e,"int"))).toStack(),Jc=()=>Du("break").toStack(),eh=new WeakMap,th=new s,rh=ki((({bufferMap:e,influence:t,stride:r,width:s,depth:i,offset:n})=>{const a=qi(Lc).mul(r).add(n),o=a.div(s),u=a.sub(o.mul(s));return Ju(e,Qi(u,o)).depth(i).xyz.mul(t)}));class sh extends js{static get type(){return"MorphNode"}constructor(e){super("void"),this.mesh=e,this.morphBaseInfluence=Zn(1),this.updateType=Vs.OBJECT}setup(e){const{geometry:r}=e,s=void 0!==r.morphAttributes.position,i=r.hasAttribute("normal")&&void 0!==r.morphAttributes.normal,n=r.morphAttributes.position||r.morphAttributes.normal||r.morphAttributes.color,a=void 0!==n?n.length:0,{texture:o,stride:u,size:l}=function(e){const r=void 0!==e.morphAttributes.position,s=void 0!==e.morphAttributes.normal,i=void 0!==e.morphAttributes.color,n=e.morphAttributes.position||e.morphAttributes.normal||e.morphAttributes.color,a=void 0!==n?n.length:0;let o=eh.get(e);if(void 0===o||o.count!==a){void 0!==o&&o.texture.dispose();const u=e.morphAttributes.position||[],l=e.morphAttributes.normal||[],d=e.morphAttributes.color||[];let c=0;!0===r&&(c=1),!0===s&&(c=2),!0===i&&(c=3);let h=e.attributes.position.count*c,p=1;const g=4096;h>g&&(p=Math.ceil(h/g),h=g);const m=new Float32Array(h*p*4*a),f=new F(m,h,p,a);f.type=B,f.needsUpdate=!0;const y=4*c;for(let b=0;b{const t=ji(0).toVar();this.mesh.count>1&&null!==this.mesh.morphTexture&&void 0!==this.mesh.morphTexture?t.assign(Ju(this.mesh.morphTexture,Qi(qi(e).add(1),qi(Fc))).r):t.assign(yd("morphTargetInfluences","float").element(e).toVar()),Hi(t.notEqual(0),(()=>{!0===s&&Vl.addAssign(rh({bufferMap:o,influence:t,stride:u,width:d,depth:e,offset:qi(0)})),!0===i&&ql.addAssign(rh({bufferMap:o,influence:t,stride:u,width:d,depth:e,offset:qi(1)}))}))}))}update(){const e=this.morphBaseInfluence;this.mesh.geometry.morphTargetsRelative?e.value=1:e.value=1-this.mesh.morphTargetInfluences.reduce(((e,t)=>e+t),0)}}const ih=Vi(sh).setParameterLength(1);class nh extends js{static get type(){return"LightingNode"}constructor(){super("vec3"),this.isLightingNode=!0}}class ah extends nh{static get type(){return"AONode"}constructor(e=null){super(),this.aoNode=e}setup(e){e.context.ambientOcclusion.mulAssign(this.aoNode)}}class oh extends Yo{static get type(){return"LightingContextNode"}constructor(e,t=null,r=null,s=null){super(e),this.lightingModel=t,this.backdropNode=r,this.backdropAlphaNode=s,this._value=null}getContext(){const{backdropNode:e,backdropAlphaNode:t}=this,r={directDiffuse:en().toVar("directDiffuse"),directSpecular:en().toVar("directSpecular"),indirectDiffuse:en().toVar("indirectDiffuse"),indirectSpecular:en().toVar("indirectSpecular")};return{radiance:en().toVar("radiance"),irradiance:en().toVar("irradiance"),iblIrradiance:en().toVar("iblIrradiance"),ambientOcclusion:ji(1).toVar("ambientOcclusion"),reflectedLight:r,backdrop:e,backdropAlpha:t}}setup(e){return this.value=this._value||(this._value=this.getContext()),this.value.lightingModel=this.lightingModel||e.context.lightingModel,super.setup(e)}}const uh=Vi(oh);class lh extends nh{static get type(){return"IrradianceNode"}constructor(e){super(),this.node=e}setup(e){e.context.irradiance.addAssign(this.node)}}let dh,ch;class hh extends js{static get type(){return"ScreenNode"}constructor(e){super(),this.scope=e,this.isViewportNode=!0}getNodeType(){return this.scope===hh.VIEWPORT?"vec4":"vec2"}getUpdateType(){let e=Vs.NONE;return this.scope!==hh.SIZE&&this.scope!==hh.VIEWPORT||(e=Vs.RENDER),this.updateType=e,e}update({renderer:e}){const t=e.getRenderTarget();this.scope===hh.VIEWPORT?null!==t?ch.copy(t.viewport):(e.getViewport(ch),ch.multiplyScalar(e.getPixelRatio())):null!==t?(dh.width=t.width,dh.height=t.height):e.getDrawingBufferSize(dh)}setup(){const e=this.scope;let r=null;return r=e===hh.SIZE?Zn(dh||(dh=new t)):e===hh.VIEWPORT?Zn(ch||(ch=new s)):Yi(mh.div(gh)),r}generate(e){if(this.scope===hh.COORDINATE){let t=e.getFragCoord();if(e.isFlipY()){const r=e.getNodeProperties(gh).outputNode.build(e);t=`${e.getType("vec2")}( ${t}.x, ${r}.y - ${t}.y )`}return t}return super.generate(e)}}hh.COORDINATE="coordinate",hh.VIEWPORT="viewport",hh.SIZE="size",hh.UV="uv";const ph=Ui(hh,hh.UV),gh=Ui(hh,hh.SIZE),mh=Ui(hh,hh.COORDINATE),fh=Ui(hh,hh.VIEWPORT),yh=fh.zw,xh=mh.sub(fh.xy),bh=xh.div(yh),Th=ki((()=>(console.warn('THREE.TSL: "viewportResolution" is deprecated. Use "screenSize" instead.'),gh)),"vec2").once()(),_h=ki((()=>(console.warn('THREE.TSL: "viewportTopLeft" is deprecated. Use "screenUV" instead.'),ph)),"vec2").once()(),vh=ki((()=>(console.warn('THREE.TSL: "viewportBottomLeft" is deprecated. Use "screenUV.flipY()" instead.'),ph.flipY())),"vec2").once()(),Nh=new t;class Sh extends Yu{static get type(){return"ViewportTextureNode"}constructor(e=ph,t=null,r=null){null===r&&((r=new I).minFilter=D),super(r,e,t),this.generateMipmaps=!1,this.isOutputTextureNode=!0,this.updateBeforeType=Vs.FRAME}updateBefore(e){const t=e.renderer;t.getDrawingBufferSize(Nh);const r=this.value;r.image.width===Nh.width&&r.image.height===Nh.height||(r.image.width=Nh.width,r.image.height=Nh.height,r.needsUpdate=!0);const s=r.generateMipmaps;r.generateMipmaps=this.generateMipmaps,t.copyFramebufferToTexture(r),r.generateMipmaps=s}clone(){const e=new this.constructor(this.uvNode,this.levelNode,this.value);return e.generateMipmaps=this.generateMipmaps,e}}const Eh=Vi(Sh).setParameterLength(0,3),wh=Vi(Sh,null,null,{generateMipmaps:!0}).setParameterLength(0,3);let Ah=null;class Rh extends Sh{static get type(){return"ViewportDepthTextureNode"}constructor(e=ph,t=null){null===Ah&&(Ah=new V),super(e,t,Ah)}}const Ch=Vi(Rh).setParameterLength(0,2);class Mh extends js{static get type(){return"ViewportDepthNode"}constructor(e,t=null){super("float"),this.scope=e,this.valueNode=t,this.isViewportDepthNode=!0}generate(e){const{scope:t}=this;return t===Mh.DEPTH_BASE?e.getFragDepth():super.generate(e)}setup({camera:e}){const{scope:t}=this,r=this.valueNode;let s=null;if(t===Mh.DEPTH_BASE)null!==r&&(s=Ih().assign(r));else if(t===Mh.DEPTH)s=e.isPerspectiveCamera?Lh(Gl.z,ol,ul):Ph(Gl.z,ol,ul);else if(t===Mh.LINEAR_DEPTH)if(null!==r)if(e.isPerspectiveCamera){const e=Fh(r,ol,ul);s=Ph(e,ol,ul)}else s=r;else s=Ph(Gl.z,ol,ul);return s}}Mh.DEPTH_BASE="depthBase",Mh.DEPTH="depth",Mh.LINEAR_DEPTH="linearDepth";const Ph=(e,t,r)=>e.add(t).div(t.sub(r)),Lh=(e,t,r)=>t.add(e).mul(r).div(r.sub(t).mul(e)),Fh=(e,t,r)=>t.mul(r).div(r.sub(t).mul(e).sub(r)),Bh=(e,t,r)=>{t=t.max(1e-6).toVar();const s=ja(e.negate().div(t)),i=ja(r.div(t));return s.div(i)},Ih=Vi(Mh,Mh.DEPTH_BASE),Dh=Ui(Mh,Mh.DEPTH),Vh=Vi(Mh,Mh.LINEAR_DEPTH).setParameterLength(0,1),Uh=Vh(Ch());Dh.assign=e=>Ih(e);class Oh extends js{static get type(){return"ClippingNode"}constructor(e=Oh.DEFAULT){super(),this.scope=e}setup(e){super.setup(e);const t=e.clippingContext,{intersectionPlanes:r,unionPlanes:s}=t;return this.hardwareClipping=e.material.hardwareClipping,this.scope===Oh.ALPHA_TO_COVERAGE?this.setupAlphaToCoverage(r,s):this.scope===Oh.HARDWARE?this.setupHardwareClipping(s,e):this.setupDefault(r,s)}setupAlphaToCoverage(e,t){return ki((()=>{const r=ji().toVar("distanceToPlane"),s=ji().toVar("distanceToGradient"),i=ji(1).toVar("clipOpacity"),n=t.length;if(!1===this.hardwareClipping&&n>0){const e=il(t);Zc(n,(({i:t})=>{const n=e.element(t);r.assign(Gl.dot(n.xyz).negate().add(n.w)),s.assign(r.fwidth().div(2)),i.mulAssign(Oo(s.negate(),s,r))}))}const a=e.length;if(a>0){const t=il(e),n=ji(1).toVar("intersectionClipOpacity");Zc(a,(({i:e})=>{const i=t.element(e);r.assign(Gl.dot(i.xyz).negate().add(i.w)),s.assign(r.fwidth().div(2)),n.mulAssign(Oo(s.negate(),s,r).oneMinus())})),i.mulAssign(n.oneMinus())}yn.a.mulAssign(i),yn.a.equal(0).discard()}))()}setupDefault(e,t){return ki((()=>{const r=t.length;if(!1===this.hardwareClipping&&r>0){const e=il(t);Zc(r,(({i:t})=>{const r=e.element(t);Gl.dot(r.xyz).greaterThan(r.w).discard()}))}const s=e.length;if(s>0){const t=il(e),r=Ki(!0).toVar("clipped");Zc(s,(({i:e})=>{const s=t.element(e);r.assign(Gl.dot(s.xyz).greaterThan(s.w).and(r))})),r.discard()}}))()}setupHardwareClipping(e,t){const r=e.length;return t.enableHardwareClipping(r),ki((()=>{const s=il(e),i=nl(t.getClipDistance());Zc(r,(({i:e})=>{const t=s.element(e),r=Gl.dot(t.xyz).sub(t.w).negate();i.element(e).assign(r)}))}))()}}Oh.ALPHA_TO_COVERAGE="alphaToCoverage",Oh.DEFAULT="default",Oh.HARDWARE="hardware";const kh=ki((([e])=>Za(la(1e4,Ja(la(17,e.x).add(la(.1,e.y)))).mul(oa(.1,no(Ja(la(13,e.y).add(e.x)))))))),Gh=ki((([e])=>kh(Yi(kh(e.xy),e.z)))),zh=ki((([e])=>{const t=_o(oo(co(e.xyz)),oo(ho(e.xyz))),r=ji(1).div(ji(.05).mul(t)).toVar("pixScale"),s=Yi($a(Ka(ja(r))),$a(Ya(ja(r)))),i=Yi(Gh(Ka(s.x.mul(e.xyz))),Gh(Ka(s.y.mul(e.xyz)))),n=Za(ja(r)),a=oa(la(n.oneMinus(),i.x),la(n,i.y)),o=To(n,n.oneMinus()),u=en(a.mul(a).div(la(2,o).mul(ua(1,o))),a.sub(la(.5,o)).div(ua(1,o)),ua(1,ua(1,a).mul(ua(1,a)).div(la(2,o).mul(ua(1,o))))),l=a.lessThan(o.oneMinus()).select(a.lessThan(o).select(u.x,u.y),u.z);return Do(l,1e-6,1)})).setLayout({name:"getAlphaHashThreshold",type:"float",inputs:[{name:"position",type:"vec3"}]});class Hh extends zu{static get type(){return"VertexColorNode"}constructor(e){super(null,"vec4"),this.isVertexColorNode=!0,this.index=e}getAttributeName(){const e=this.index;return"color"+(e>0?e:"")}generate(e){const t=this.getAttributeName(e);let r;return r=!0===e.hasGeometryAttribute(t)?super.generate(e):e.generateConst(this.nodeType,new s(1,1,1,1)),r}serialize(e){super.serialize(e),e.index=this.index}deserialize(e){super.deserialize(e),this.index=e.index}}const $h=(e=0)=>Bi(new Hh(e));class Wh extends U{static get type(){return"NodeMaterial"}get type(){return this.constructor.type}set type(e){}constructor(){super(),this.isNodeMaterial=!0,this.fog=!0,this.lights=!1,this.hardwareClipping=!1,this.lightsNode=null,this.envNode=null,this.aoNode=null,this.colorNode=null,this.normalNode=null,this.opacityNode=null,this.backdropNode=null,this.backdropAlphaNode=null,this.alphaTestNode=null,this.maskNode=null,this.positionNode=null,this.geometryNode=null,this.depthNode=null,this.receivedShadowPositionNode=null,this.castShadowPositionNode=null,this.receivedShadowNode=null,this.castShadowNode=null,this.outputNode=null,this.mrtNode=null,this.fragmentNode=null,this.vertexNode=null,Object.defineProperty(this,"shadowPositionNode",{get:()=>this.receivedShadowPositionNode,set:e=>{console.warn('THREE.NodeMaterial: ".shadowPositionNode" was renamed to ".receivedShadowPositionNode".'),this.receivedShadowPositionNode=e}})}customProgramCacheKey(){return this.type+_s(this)}build(e){this.setup(e)}setupObserver(e){return new fs(e)}setup(e){e.context.setupNormal=()=>this.setupNormal(e),e.context.setupPositionView=()=>this.setupPositionView(e),e.context.setupModelViewProjection=()=>this.setupModelViewProjection(e);const t=e.renderer,r=t.getRenderTarget();e.addStack();const s=this.setupVertex(e),i=this.vertexNode||s;let n;e.stack.outputNode=i,this.setupHardwareClipping(e),null!==this.geometryNode&&(e.stack.outputNode=e.stack.outputNode.bypass(this.geometryNode)),e.addFlow("vertex",e.removeStack()),e.addStack();const a=this.setupClipping(e);if(!0!==this.depthWrite&&!0!==this.depthTest||(null!==r?!0===r.depthBuffer&&this.setupDepth(e):!0===t.depth&&this.setupDepth(e)),null===this.fragmentNode){this.setupDiffuseColor(e),this.setupVariants(e);const s=this.setupLighting(e);null!==a&&e.stack.add(a);const i=nn(s,yn.a).max(0);n=this.setupOutput(e,i),In.assign(n);const o=null!==this.outputNode;if(o&&(n=this.outputNode),null!==r){const e=t.getMRT(),r=this.mrtNode;null!==e?(o&&In.assign(n),n=e,null!==r&&(n=e.merge(r))):null!==r&&(n=r)}}else{let t=this.fragmentNode;!0!==t.isOutputStructNode&&(t=nn(t)),n=this.setupOutput(e,t)}e.stack.outputNode=n,e.addFlow("fragment",e.removeStack()),e.observer=this.setupObserver(e)}setupClipping(e){if(null===e.clippingContext)return null;const{unionPlanes:t,intersectionPlanes:r}=e.clippingContext;let s=null;if(t.length>0||r.length>0){const t=e.renderer.samples;this.alphaToCoverage&&t>1?s=Bi(new Oh(Oh.ALPHA_TO_COVERAGE)):e.stack.add(Bi(new Oh))}return s}setupHardwareClipping(e){if(this.hardwareClipping=!1,null===e.clippingContext)return;const t=e.clippingContext.unionPlanes.length;t>0&&t<=8&&e.isAvailable("clipDistance")&&(e.stack.add(Bi(new Oh(Oh.HARDWARE))),this.hardwareClipping=!0)}setupDepth(e){const{renderer:t,camera:r}=e;let s=this.depthNode;if(null===s){const e=t.getMRT();e&&e.has("depth")?s=e.get("depth"):!0===t.logarithmicDepthBuffer&&(s=r.isPerspectiveCamera?Bh(Gl.z,ol,ul):Ph(Gl.z,ol,ul))}null!==s&&Dh.assign(s).toStack()}setupPositionView(){return Ll.mul(Vl).xyz}setupModelViewProjection(){return ll.mul(Gl)}setupVertex(e){return e.addStack(),this.setupPosition(e),e.context.vertex=e.removeStack(),Mc}setupPosition(e){const{object:t,geometry:r}=e;if((r.morphAttributes.position||r.morphAttributes.normal||r.morphAttributes.color)&&ih(t).toStack(),!0===t.isSkinnedMesh&&Yc(t).toStack(),this.displacementMap){const e=Td("displacementMap","texture"),t=Td("displacementScale","float"),r=Td("displacementBias","float");Vl.addAssign(ql.normalize().mul(e.x.mul(t).add(r)))}return t.isBatchedMesh&&Hc(t).toStack(),t.isInstancedMesh&&t.instanceMatrix&&!0===t.instanceMatrix.isInstancedBufferAttribute&&Gc(t).toStack(),null!==this.positionNode&&Vl.assign(Cu(this.positionNode,"POSITION")),Vl}setupDiffuseColor({object:e,geometry:t}){null!==this.maskNode&&Ki(this.maskNode).not().discard();let r=this.colorNode?nn(this.colorNode):qd;if(!0===this.vertexColors&&t.hasAttribute("color")&&(r=r.mul($h())),e.instanceColor){r=fn("vec3","vInstanceColor").mul(r)}if(e.isBatchedMesh&&e._colorsTexture){r=fn("vec3","vBatchColor").mul(r)}yn.assign(r);const s=this.opacityNode?ji(this.opacityNode):Yd;yn.a.assign(yn.a.mul(s));let i=null;(null!==this.alphaTestNode||this.alphaTest>0)&&(i=null!==this.alphaTestNode?ji(this.alphaTestNode):jd,yn.a.lessThanEqual(i).discard()),!0===this.alphaHash&&yn.a.lessThan(zh(Vl)).discard();!1===this.transparent&&this.blending===O&&!1===this.alphaToCoverage?yn.a.assign(1):null===i&&yn.a.lessThanEqual(0).discard()}setupVariants(){}setupOutgoingLight(){return!0===this.lights?en(0):yn.rgb}setupNormal(){return this.normalNode?en(this.normalNode):ic}setupEnvironment(){let e=null;return this.envNode?e=this.envNode:this.envMap&&(e=this.envMap.isCubeTexture?Td("envMap","cubeTexture"):Td("envMap","texture")),e}setupLightMap(e){let t=null;return e.material.lightMap&&(t=new lh(Ac)),t}setupLights(e){const t=[],r=this.setupEnvironment(e);r&&r.isLightingNode&&t.push(r);const s=this.setupLightMap(e);if(s&&s.isLightingNode&&t.push(s),null!==this.aoNode||e.material.aoMap){const e=null!==this.aoNode?this.aoNode:Rc;t.push(new ah(e))}let i=this.lightsNode||e.lightsNode;return t.length>0&&(i=e.renderer.lighting.createNode([...i.getLights(),...t])),i}setupLightingModel(){}setupLighting(e){const{material:t}=e,{backdropNode:r,backdropAlphaNode:s,emissiveNode:i}=this,n=!0===this.lights||null!==this.lightsNode?this.setupLights(e):null;let a=this.setupOutgoingLight(e);if(n&&n.getScope().hasLights){const t=this.setupLightingModel(e)||null;a=uh(n,t,r,s)}else null!==r&&(a=en(null!==s?Io(a,r,s):r));return(i&&!0===i.isNode||t.emissive&&!0===t.emissive.isColor)&&(xn.assign(en(i||Kd)),a=a.add(xn)),a}setupFog(e,t){const r=e.fogNode;return r&&(In.assign(t),t=nn(r)),t}setupOutput(e,t){return!0===this.fog&&(t=this.setupFog(e,t)),t}setDefaultValues(e){for(const t in e){const r=e[t];void 0===this[t]&&(this[t]=r,r&&r.clone&&(this[t]=r.clone()))}const t=Object.getOwnPropertyDescriptors(e.constructor.prototype);for(const e in t)void 0===Object.getOwnPropertyDescriptor(this.constructor.prototype,e)&&void 0!==t[e].get&&Object.defineProperty(this.constructor.prototype,e,t[e])}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{},nodes:{}});const r=U.prototype.toJSON.call(this,e),s=vs(this);r.inputNodes={};for(const{property:t,childNode:i}of s)r.inputNodes[t]=i.toJSON(e).uuid;function i(e){const t=[];for(const r in e){const s=e[r];delete s.metadata,t.push(s)}return t}if(t){const t=i(e.textures),s=i(e.images),n=i(e.nodes);t.length>0&&(r.textures=t),s.length>0&&(r.images=s),n.length>0&&(r.nodes=n)}return r}copy(e){return this.lightsNode=e.lightsNode,this.envNode=e.envNode,this.colorNode=e.colorNode,this.normalNode=e.normalNode,this.opacityNode=e.opacityNode,this.backdropNode=e.backdropNode,this.backdropAlphaNode=e.backdropAlphaNode,this.alphaTestNode=e.alphaTestNode,this.maskNode=e.maskNode,this.positionNode=e.positionNode,this.geometryNode=e.geometryNode,this.depthNode=e.depthNode,this.receivedShadowPositionNode=e.receivedShadowPositionNode,this.castShadowPositionNode=e.castShadowPositionNode,this.receivedShadowNode=e.receivedShadowNode,this.castShadowNode=e.castShadowNode,this.outputNode=e.outputNode,this.mrtNode=e.mrtNode,this.fragmentNode=e.fragmentNode,this.vertexNode=e.vertexNode,super.copy(e)}}const jh=new k;class qh extends Wh{static get type(){return"LineBasicNodeMaterial"}constructor(e){super(),this.isLineBasicNodeMaterial=!0,this.setDefaultValues(jh),this.setValues(e)}}const Xh=new G;class Kh extends Wh{static get type(){return"LineDashedNodeMaterial"}constructor(e){super(),this.isLineDashedNodeMaterial=!0,this.setDefaultValues(Xh),this.dashOffset=0,this.offsetNode=null,this.dashScaleNode=null,this.dashSizeNode=null,this.gapSizeNode=null,this.setValues(e)}setupVariants(){const e=this.offsetNode?ji(this.offsetNode):Sc,t=this.dashScaleNode?ji(this.dashScaleNode):Tc,r=this.dashSizeNode?ji(this.dashSizeNode):_c,s=this.gapSizeNode?ji(this.gapSizeNode):vc;Dn.assign(r),Vn.assign(s);const i=nu(Hu("lineDistance").mul(t));(e?i.add(e):i).mod(Dn.add(Vn)).greaterThan(Dn).discard()}}let Yh=null;class Qh extends Sh{static get type(){return"ViewportSharedTextureNode"}constructor(e=ph,t=null){null===Yh&&(Yh=new I),super(e,t,Yh)}updateReference(){return this}}const Zh=Vi(Qh).setParameterLength(0,2),Jh=new G;class ep extends Wh{static get type(){return"Line2NodeMaterial"}constructor(e={}){super(),this.isLine2NodeMaterial=!0,this.setDefaultValues(Jh),this.useColor=e.vertexColors,this.dashOffset=0,this.lineWidth=1,this.lineColorNode=null,this.offsetNode=null,this.dashScaleNode=null,this.dashSizeNode=null,this.gapSizeNode=null,this.blending=z,this._useDash=e.dashed,this._useAlphaToCoverage=!0,this._useWorldUnits=!1,this.setValues(e)}setup(e){const{renderer:t}=e,r=this._useAlphaToCoverage,s=this.useColor,i=this._useDash,n=this._useWorldUnits,a=ki((({start:e,end:t})=>{const r=ll.element(2).element(2),s=ll.element(3).element(2).mul(-.5).div(r).sub(e.z).div(t.z.sub(e.z));return nn(Io(e.xyz,t.xyz,s),t.w)})).setLayout({name:"trimSegment",type:"vec4",inputs:[{name:"start",type:"vec4"},{name:"end",type:"vec4"}]});this.vertexNode=ki((()=>{const e=Hu("instanceStart"),t=Hu("instanceEnd"),r=nn(Ll.mul(nn(e,1))).toVar("start"),s=nn(Ll.mul(nn(t,1))).toVar("end");if(i){const e=this.dashScaleNode?ji(this.dashScaleNode):Tc,t=this.offsetNode?ji(this.offsetNode):Sc,r=Hu("instanceDistanceStart"),s=Hu("instanceDistanceEnd");let i=Dl.y.lessThan(.5).select(e.mul(r),e.mul(s));i=i.add(t),fn("float","lineDistance").assign(i)}n&&(fn("vec3","worldStart").assign(r.xyz),fn("vec3","worldEnd").assign(s.xyz));const o=fh.z.div(fh.w),u=ll.element(2).element(3).equal(-1);Hi(u,(()=>{Hi(r.z.lessThan(0).and(s.z.greaterThan(0)),(()=>{s.assign(a({start:r,end:s}))})).ElseIf(s.z.lessThan(0).and(r.z.greaterThanEqual(0)),(()=>{r.assign(a({start:s,end:r}))}))}));const l=ll.mul(r),d=ll.mul(s),c=l.xyz.div(l.w),h=d.xyz.div(d.w),p=h.xy.sub(c.xy).toVar();p.x.assign(p.x.mul(o)),p.assign(p.normalize());const g=nn().toVar();if(n){const e=s.xyz.sub(r.xyz).normalize(),t=Io(r.xyz,s.xyz,.5).normalize(),n=e.cross(t).normalize(),a=e.cross(n),o=fn("vec4","worldPos");o.assign(Dl.y.lessThan(.5).select(r,s));const u=Nc.mul(.5);o.addAssign(nn(Dl.x.lessThan(0).select(n.mul(u),n.mul(u).negate()),0)),i||(o.addAssign(nn(Dl.y.lessThan(.5).select(e.mul(u).negate(),e.mul(u)),0)),o.addAssign(nn(a.mul(u),0)),Hi(Dl.y.greaterThan(1).or(Dl.y.lessThan(0)),(()=>{o.subAssign(nn(a.mul(2).mul(u),0))}))),g.assign(ll.mul(o));const l=en().toVar();l.assign(Dl.y.lessThan(.5).select(c,h)),g.z.assign(l.z.mul(g.w))}else{const e=Yi(p.y,p.x.negate()).toVar("offset");p.x.assign(p.x.div(o)),e.x.assign(e.x.div(o)),e.assign(Dl.x.lessThan(0).select(e.negate(),e)),Hi(Dl.y.lessThan(0),(()=>{e.assign(e.sub(p))})).ElseIf(Dl.y.greaterThan(1),(()=>{e.assign(e.add(p))})),e.assign(e.mul(Nc)),e.assign(e.div(fh.w)),g.assign(Dl.y.lessThan(.5).select(l,d)),e.assign(e.mul(g.w)),g.assign(g.add(nn(e,0,0)))}return g}))();const o=ki((({p1:e,p2:t,p3:r,p4:s})=>{const i=e.sub(r),n=s.sub(r),a=t.sub(e),o=i.dot(n),u=n.dot(a),l=i.dot(a),d=n.dot(n),c=a.dot(a).mul(d).sub(u.mul(u)),h=o.mul(u).sub(l.mul(d)).div(c).clamp(),p=o.add(u.mul(h)).div(d).clamp();return Yi(h,p)}));if(this.colorNode=ki((()=>{const e=$u();if(i){const t=this.dashSizeNode?ji(this.dashSizeNode):_c,r=this.gapSizeNode?ji(this.gapSizeNode):vc;Dn.assign(t),Vn.assign(r);const s=fn("float","lineDistance");e.y.lessThan(-1).or(e.y.greaterThan(1)).discard(),s.mod(Dn.add(Vn)).greaterThan(Dn).discard()}const a=ji(1).toVar("alpha");if(n){const e=fn("vec3","worldStart"),s=fn("vec3","worldEnd"),n=fn("vec4","worldPos").xyz.normalize().mul(1e5),u=s.sub(e),l=o({p1:e,p2:s,p3:en(0,0,0),p4:n}),d=e.add(u.mul(l.x)),c=n.mul(l.y),h=d.sub(c).length().div(Nc);if(!i)if(r&&t.samples>1){const e=h.fwidth();a.assign(Oo(e.negate().add(.5),e.add(.5),h).oneMinus())}else h.greaterThan(.5).discard()}else if(r&&t.samples>1){const t=e.x,r=e.y.greaterThan(0).select(e.y.sub(1),e.y.add(1)),s=t.mul(t).add(r.mul(r)),i=ji(s.fwidth()).toVar("dlen");Hi(e.y.abs().greaterThan(1),(()=>{a.assign(Oo(i.oneMinus(),i.add(1),s).oneMinus())}))}else Hi(e.y.abs().greaterThan(1),(()=>{const t=e.x,r=e.y.greaterThan(0).select(e.y.sub(1),e.y.add(1));t.mul(t).add(r.mul(r)).greaterThan(1).discard()}));let u;if(this.lineColorNode)u=this.lineColorNode;else if(s){const e=Hu("instanceColorStart"),t=Hu("instanceColorEnd");u=Dl.y.lessThan(.5).select(e,t).mul(qd)}else u=qd;return nn(u,a)}))(),this.transparent){const e=this.opacityNode?ji(this.opacityNode):Yd;this.outputNode=nn(this.colorNode.rgb.mul(e).add(Zh().rgb.mul(e.oneMinus())),this.colorNode.a)}super.setup(e)}get worldUnits(){return this._useWorldUnits}set worldUnits(e){this._useWorldUnits!==e&&(this._useWorldUnits=e,this.needsUpdate=!0)}get dashed(){return this._useDash}set dashed(e){this._useDash!==e&&(this._useDash=e,this.needsUpdate=!0)}get alphaToCoverage(){return this._useAlphaToCoverage}set alphaToCoverage(e){this._useAlphaToCoverage!==e&&(this._useAlphaToCoverage=e,this.needsUpdate=!0)}}const tp=e=>Bi(e).mul(.5).add(.5),rp=new H;class sp extends Wh{static get type(){return"MeshNormalNodeMaterial"}constructor(e){super(),this.isMeshNormalNodeMaterial=!0,this.setDefaultValues(rp),this.setValues(e)}setupDiffuseColor(){const e=this.opacityNode?ji(this.opacityNode):Yd;yn.assign(hu(nn(tp(Ql),e),$))}}class ip extends Ks{static get type(){return"EquirectUVNode"}constructor(e=kl){super("vec2"),this.dirNode=e}setup(){const e=this.dirNode,t=e.z.atan(e.x).mul(1/(2*Math.PI)).add(.5),r=e.y.clamp(-1,1).asin().mul(1/Math.PI).add(.5);return Yi(t,r)}}const np=Vi(ip).setParameterLength(0,1);class ap extends W{constructor(e=1,t={}){super(e,t),this.isCubeRenderTarget=!0}fromEquirectangularTexture(e,t){const r=t.minFilter,s=t.generateMipmaps;t.generateMipmaps=!0,this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i=new j(5,5,5),n=np(kl),a=new Wh;a.colorNode=Zu(t,n,0),a.side=S,a.blending=z;const o=new q(i,a),u=new X;u.add(o),t.minFilter===D&&(t.minFilter=K);const l=new Y(1,10,this),d=e.getMRT();return e.setMRT(null),l.update(e,u),e.setMRT(d),t.minFilter=r,t.currentGenerateMipmaps=s,o.geometry.dispose(),o.material.dispose(),this}}const op=new WeakMap;class up extends Ks{static get type(){return"CubeMapNode"}constructor(e){super("vec3"),this.envNode=e,this._cubeTexture=null,this._cubeTextureNode=gd(null);const t=new w;t.isRenderTargetTexture=!0,this._defaultTexture=t,this.updateBeforeType=Vs.RENDER}updateBefore(e){const{renderer:t,material:r}=e,s=this.envNode;if(s.isTextureNode||s.isMaterialReferenceNode){const e=s.isTextureNode?s.value:r[s.property];if(e&&e.isTexture){const r=e.mapping;if(r===Q||r===Z){if(op.has(e)){const t=op.get(e);dp(t,e.mapping),this._cubeTexture=t}else{const r=e.image;if(function(e){return null!=e&&e.height>0}(r)){const s=new ap(r.height);s.fromEquirectangularTexture(t,e),dp(s.texture,e.mapping),this._cubeTexture=s.texture,op.set(e,s.texture),e.addEventListener("dispose",lp)}else this._cubeTexture=this._defaultTexture}this._cubeTextureNode.value=this._cubeTexture}else this._cubeTextureNode=this.envNode}}}setup(e){return this.updateBefore(e),this._cubeTextureNode}}function lp(e){const t=e.target;t.removeEventListener("dispose",lp);const r=op.get(t);void 0!==r&&(op.delete(t),r.dispose())}function dp(e,t){t===Q?e.mapping=A:t===Z&&(e.mapping=R)}const cp=Vi(up).setParameterLength(1);class hp extends nh{static get type(){return"BasicEnvironmentNode"}constructor(e=null){super(),this.envNode=e}setup(e){e.context.environment=cp(this.envNode)}}class pp extends nh{static get type(){return"BasicLightMapNode"}constructor(e=null){super(),this.lightMapNode=e}setup(e){const t=ji(1/Math.PI);e.context.irradianceLightMap=this.lightMapNode.mul(t)}}class gp{start(e){e.lightsNode.setupLights(e,e.lightsNode.getLightNodes(e)),this.indirect(e)}finish(){}direct(){}directRectArea(){}indirect(){}ambientOcclusion(){}}class mp extends gp{constructor(){super()}indirect({context:e}){const t=e.ambientOcclusion,r=e.reflectedLight,s=e.irradianceLightMap;r.indirectDiffuse.assign(nn(0)),s?r.indirectDiffuse.addAssign(s):r.indirectDiffuse.addAssign(nn(1,1,1,0)),r.indirectDiffuse.mulAssign(t),r.indirectDiffuse.mulAssign(yn.rgb)}finish(e){const{material:t,context:r}=e,s=r.outgoingLight,i=e.context.environment;if(i)switch(t.combine){case te:s.rgb.assign(Io(s.rgb,s.rgb.mul(i.rgb),ec.mul(tc)));break;case ee:s.rgb.assign(Io(s.rgb,i.rgb,ec.mul(tc)));break;case J:s.rgb.addAssign(i.rgb.mul(ec.mul(tc)));break;default:console.warn("THREE.BasicLightingModel: Unsupported .combine value:",t.combine)}}}const fp=new re;class yp extends Wh{static get type(){return"MeshBasicNodeMaterial"}constructor(e){super(),this.isMeshBasicNodeMaterial=!0,this.lights=!0,this.setDefaultValues(fp),this.setValues(e)}setupNormal(){return Kl}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new hp(t):null}setupLightMap(e){let t=null;return e.material.lightMap&&(t=new pp(Ac)),t}setupOutgoingLight(){return yn.rgb}setupLightingModel(){return new mp}}const xp=ki((({f0:e,f90:t,dotVH:r})=>{const s=r.mul(-5.55473).sub(6.98316).mul(r).exp2();return e.mul(s.oneMinus()).add(t.mul(s))})),bp=ki((e=>e.diffuseColor.mul(1/Math.PI))),Tp=ki((({dotNH:e})=>Bn.mul(ji(.5)).add(1).mul(ji(1/Math.PI)).mul(e.pow(Bn)))),_p=ki((({lightDirection:e})=>{const t=e.add(zl).normalize(),r=Ql.dot(t).clamp(),s=zl.dot(t).clamp(),i=xp({f0:Ln,f90:1,dotVH:s}),n=ji(.25),a=Tp({dotNH:r});return i.mul(n).mul(a)}));class vp extends mp{constructor(e=!0){super(),this.specular=e}direct({lightDirection:e,lightColor:t,reflectedLight:r}){const s=Ql.dot(e).clamp().mul(t);r.directDiffuse.addAssign(s.mul(bp({diffuseColor:yn.rgb}))),!0===this.specular&&r.directSpecular.addAssign(s.mul(_p({lightDirection:e})).mul(ec))}indirect(e){const{ambientOcclusion:t,irradiance:r,reflectedLight:s}=e.context;s.indirectDiffuse.addAssign(r.mul(bp({diffuseColor:yn}))),s.indirectDiffuse.mulAssign(t)}}const Np=new se;class Sp extends Wh{static get type(){return"MeshLambertNodeMaterial"}constructor(e){super(),this.isMeshLambertNodeMaterial=!0,this.lights=!0,this.setDefaultValues(Np),this.setValues(e)}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new hp(t):null}setupLightingModel(){return new vp(!1)}}const Ep=new ie;class wp extends Wh{static get type(){return"MeshPhongNodeMaterial"}constructor(e){super(),this.isMeshPhongNodeMaterial=!0,this.lights=!0,this.shininessNode=null,this.specularNode=null,this.setDefaultValues(Ep),this.setValues(e)}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new hp(t):null}setupLightingModel(){return new vp}setupVariants(){const e=(this.shininessNode?ji(this.shininessNode):Xd).max(1e-4);Bn.assign(e);const t=this.specularNode||Qd;Ln.assign(t)}copy(e){return this.shininessNode=e.shininessNode,this.specularNode=e.specularNode,super.copy(e)}}const Ap=ki((e=>{if(!1===e.geometry.hasAttribute("normal"))return ji(0);const t=Kl.dFdx().abs().max(Kl.dFdy().abs());return t.x.max(t.y).max(t.z)})),Rp=ki((e=>{const{roughness:t}=e,r=Ap();let s=t.max(.0525);return s=s.add(r),s=s.min(1),s})),Cp=ki((({alpha:e,dotNL:t,dotNV:r})=>{const s=e.pow2(),i=t.mul(s.add(s.oneMinus().mul(r.pow2())).sqrt()),n=r.mul(s.add(s.oneMinus().mul(t.pow2())).sqrt());return da(.5,i.add(n).max(Ia))})).setLayout({name:"V_GGX_SmithCorrelated",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNL",type:"float"},{name:"dotNV",type:"float"}]}),Mp=ki((({alphaT:e,alphaB:t,dotTV:r,dotBV:s,dotTL:i,dotBL:n,dotNV:a,dotNL:o})=>{const u=o.mul(en(e.mul(r),t.mul(s),a).length()),l=a.mul(en(e.mul(i),t.mul(n),o).length());return da(.5,u.add(l)).saturate()})).setLayout({name:"V_GGX_SmithCorrelated_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotTV",type:"float",qualifier:"in"},{name:"dotBV",type:"float",qualifier:"in"},{name:"dotTL",type:"float",qualifier:"in"},{name:"dotBL",type:"float",qualifier:"in"},{name:"dotNV",type:"float",qualifier:"in"},{name:"dotNL",type:"float",qualifier:"in"}]}),Pp=ki((({alpha:e,dotNH:t})=>{const r=e.pow2(),s=t.pow2().mul(r.oneMinus()).oneMinus();return r.div(s.pow2()).mul(1/Math.PI)})).setLayout({name:"D_GGX",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNH",type:"float"}]}),Lp=ji(1/Math.PI),Fp=ki((({alphaT:e,alphaB:t,dotNH:r,dotTH:s,dotBH:i})=>{const n=e.mul(t),a=en(t.mul(s),e.mul(i),n.mul(r)),o=a.dot(a),u=n.div(o);return Lp.mul(n.mul(u.pow2()))})).setLayout({name:"D_GGX_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotNH",type:"float",qualifier:"in"},{name:"dotTH",type:"float",qualifier:"in"},{name:"dotBH",type:"float",qualifier:"in"}]}),Bp=ki((e=>{const{lightDirection:t,f0:r,f90:s,roughness:i,f:n,USE_IRIDESCENCE:a,USE_ANISOTROPY:o}=e,u=e.normalView||Ql,l=i.pow2(),d=t.add(zl).normalize(),c=u.dot(t).clamp(),h=u.dot(zl).clamp(),p=u.dot(d).clamp(),g=zl.dot(d).clamp();let m,f,y=xp({f0:r,f90:s,dotVH:g});if(Pi(a)&&(y=En.mix(y,n)),Pi(o)){const e=Mn.dot(t),r=Mn.dot(zl),s=Mn.dot(d),i=Pn.dot(t),n=Pn.dot(zl),a=Pn.dot(d);m=Mp({alphaT:Rn,alphaB:l,dotTV:r,dotBV:n,dotTL:e,dotBL:i,dotNV:h,dotNL:c}),f=Fp({alphaT:Rn,alphaB:l,dotNH:p,dotTH:s,dotBH:a})}else m=Cp({alpha:l,dotNL:c,dotNV:h}),f=Pp({alpha:l,dotNH:p});return y.mul(m).mul(f)})),Ip=ki((({roughness:e,dotNV:t})=>{const r=nn(-1,-.0275,-.572,.022),s=nn(1,.0425,1.04,-.04),i=e.mul(r).add(s),n=i.x.mul(i.x).min(t.mul(-9.28).exp2()).mul(i.x).add(i.y);return Yi(-1.04,1.04).mul(n).add(i.zw)})).setLayout({name:"DFGApprox",type:"vec2",inputs:[{name:"roughness",type:"float"},{name:"dotNV",type:"vec3"}]}),Dp=ki((e=>{const{dotNV:t,specularColor:r,specularF90:s,roughness:i}=e,n=Ip({dotNV:t,roughness:i});return r.mul(n.x).add(s.mul(n.y))})),Vp=ki((({f:e,f90:t,dotVH:r})=>{const s=r.oneMinus().saturate(),i=s.mul(s),n=s.mul(i,i).clamp(0,.9999);return e.sub(en(t).mul(n)).div(n.oneMinus())})).setLayout({name:"Schlick_to_F0",type:"vec3",inputs:[{name:"f",type:"vec3"},{name:"f90",type:"float"},{name:"dotVH",type:"float"}]}),Up=ki((({roughness:e,dotNH:t})=>{const r=e.pow2(),s=ji(1).div(r),i=t.pow2().oneMinus().max(.0078125);return ji(2).add(s).mul(i.pow(s.mul(.5))).div(2*Math.PI)})).setLayout({name:"D_Charlie",type:"float",inputs:[{name:"roughness",type:"float"},{name:"dotNH",type:"float"}]}),Op=ki((({dotNV:e,dotNL:t})=>ji(1).div(ji(4).mul(t.add(e).sub(t.mul(e)))))).setLayout({name:"V_Neubelt",type:"float",inputs:[{name:"dotNV",type:"float"},{name:"dotNL",type:"float"}]}),kp=ki((({lightDirection:e})=>{const t=e.add(zl).normalize(),r=Ql.dot(e).clamp(),s=Ql.dot(zl).clamp(),i=Ql.dot(t).clamp(),n=Up({roughness:Sn,dotNH:i}),a=Op({dotNV:s,dotNL:r});return Nn.mul(n).mul(a)})),Gp=ki((({N:e,V:t,roughness:r})=>{const s=e.dot(t).saturate(),i=Yi(r,s.oneMinus().sqrt());return i.assign(i.mul(.984375).add(.0078125)),i})).setLayout({name:"LTC_Uv",type:"vec2",inputs:[{name:"N",type:"vec3"},{name:"V",type:"vec3"},{name:"roughness",type:"float"}]}),zp=ki((({f:e})=>{const t=e.length();return _o(t.mul(t).add(e.z).div(t.add(1)),0)})).setLayout({name:"LTC_ClippedSphereFormFactor",type:"float",inputs:[{name:"f",type:"vec3"}]}),Hp=ki((({v1:e,v2:t})=>{const r=e.dot(t),s=r.abs().toVar(),i=s.mul(.0145206).add(.4965155).mul(s).add(.8543985).toVar(),n=s.add(4.1616724).mul(s).add(3.417594).toVar(),a=i.div(n),o=r.greaterThan(0).select(a,_o(r.mul(r).oneMinus(),1e-7).inverseSqrt().mul(.5).sub(a));return e.cross(t).mul(o)})).setLayout({name:"LTC_EdgeVectorFormFactor",type:"vec3",inputs:[{name:"v1",type:"vec3"},{name:"v2",type:"vec3"}]}),$p=ki((({N:e,V:t,P:r,mInv:s,p0:i,p1:n,p2:a,p3:o})=>{const u=n.sub(i).toVar(),l=o.sub(i).toVar(),d=u.cross(l),c=en().toVar();return Hi(d.dot(r.sub(i)).greaterThanEqual(0),(()=>{const u=t.sub(e.mul(t.dot(e))).normalize(),l=e.cross(u).negate(),d=s.mul(dn(u,l,e).transpose()).toVar(),h=d.mul(i.sub(r)).normalize().toVar(),p=d.mul(n.sub(r)).normalize().toVar(),g=d.mul(a.sub(r)).normalize().toVar(),m=d.mul(o.sub(r)).normalize().toVar(),f=en(0).toVar();f.addAssign(Hp({v1:h,v2:p})),f.addAssign(Hp({v1:p,v2:g})),f.addAssign(Hp({v1:g,v2:m})),f.addAssign(Hp({v1:m,v2:h})),c.assign(en(zp({f:f})))})),c})).setLayout({name:"LTC_Evaluate",type:"vec3",inputs:[{name:"N",type:"vec3"},{name:"V",type:"vec3"},{name:"P",type:"vec3"},{name:"mInv",type:"mat3"},{name:"p0",type:"vec3"},{name:"p1",type:"vec3"},{name:"p2",type:"vec3"},{name:"p3",type:"vec3"}]}),Wp=ki((({P:e,p0:t,p1:r,p2:s,p3:i})=>{const n=r.sub(t).toVar(),a=i.sub(t).toVar(),o=n.cross(a),u=en().toVar();return Hi(o.dot(e.sub(t)).greaterThanEqual(0),(()=>{const n=t.sub(e).normalize().toVar(),a=r.sub(e).normalize().toVar(),o=s.sub(e).normalize().toVar(),l=i.sub(e).normalize().toVar(),d=en(0).toVar();d.addAssign(Hp({v1:n,v2:a})),d.addAssign(Hp({v1:a,v2:o})),d.addAssign(Hp({v1:o,v2:l})),d.addAssign(Hp({v1:l,v2:n})),u.assign(en(zp({f:d.abs()})))})),u})).setLayout({name:"LTC_Evaluate",type:"vec3",inputs:[{name:"P",type:"vec3"},{name:"p0",type:"vec3"},{name:"p1",type:"vec3"},{name:"p2",type:"vec3"},{name:"p3",type:"vec3"}]}),jp=1/6,qp=e=>la(jp,la(e,la(e,e.negate().add(3)).sub(3)).add(1)),Xp=e=>la(jp,la(e,la(e,la(3,e).sub(6))).add(4)),Kp=e=>la(jp,la(e,la(e,la(-3,e).add(3)).add(3)).add(1)),Yp=e=>la(jp,Ro(e,3)),Qp=e=>qp(e).add(Xp(e)),Zp=e=>Kp(e).add(Yp(e)),Jp=e=>oa(-1,Xp(e).div(qp(e).add(Xp(e)))),eg=e=>oa(1,Yp(e).div(Kp(e).add(Yp(e)))),tg=(e,t,r)=>{const s=e.uvNode,i=la(s,t.zw).add(.5),n=Ka(i),a=Za(i),o=Qp(a.x),u=Zp(a.x),l=Jp(a.x),d=eg(a.x),c=Jp(a.y),h=eg(a.y),p=Yi(n.x.add(l),n.y.add(c)).sub(.5).mul(t.xy),g=Yi(n.x.add(d),n.y.add(c)).sub(.5).mul(t.xy),m=Yi(n.x.add(l),n.y.add(h)).sub(.5).mul(t.xy),f=Yi(n.x.add(d),n.y.add(h)).sub(.5).mul(t.xy),y=Qp(a.y).mul(oa(o.mul(e.sample(p).level(r)),u.mul(e.sample(g).level(r)))),x=Zp(a.y).mul(oa(o.mul(e.sample(m).level(r)),u.mul(e.sample(f).level(r))));return y.add(x)},rg=ki((([e,t=ji(3)])=>{const r=Yi(e.size(qi(t))),s=Yi(e.size(qi(t.add(1)))),i=da(1,r),n=da(1,s),a=tg(e,nn(i,r),Ka(t)),o=tg(e,nn(n,s),Ya(t));return Za(t).mix(a,o)})),sg=ki((([e,t,r,s,i])=>{const n=en(Uo(t.negate(),Qa(e),da(1,s))),a=en(oo(i[0].xyz),oo(i[1].xyz),oo(i[2].xyz));return Qa(n).mul(r.mul(a))})).setLayout({name:"getVolumeTransmissionRay",type:"vec3",inputs:[{name:"n",type:"vec3"},{name:"v",type:"vec3"},{name:"thickness",type:"float"},{name:"ior",type:"float"},{name:"modelMatrix",type:"mat4"}]}),ig=ki((([e,t])=>e.mul(Do(t.mul(2).sub(2),0,1)))).setLayout({name:"applyIorToRoughness",type:"float",inputs:[{name:"roughness",type:"float"},{name:"ior",type:"float"}]}),ng=wh(),ag=wh(),og=ki((([e,t,r],{material:s})=>{const i=(s.side===S?ng:ag).sample(e),n=ja(gh.x).mul(ig(t,r));return rg(i,n)})),ug=ki((([e,t,r])=>(Hi(r.notEqual(0),(()=>{const s=Wa(t).negate().div(r);return Ha(s.negate().mul(e))})),en(1)))).setLayout({name:"volumeAttenuation",type:"vec3",inputs:[{name:"transmissionDistance",type:"float"},{name:"attenuationColor",type:"vec3"},{name:"attenuationDistance",type:"float"}]}),lg=ki((([e,t,r,s,i,n,a,o,u,l,d,c,h,p,g])=>{let m,f;if(g){m=nn().toVar(),f=en().toVar();const i=d.sub(1).mul(g.mul(.025)),n=en(d.sub(i),d,d.add(i));Zc({start:0,end:3},(({i:i})=>{const d=n.element(i),g=sg(e,t,c,d,o),y=a.add(g),x=l.mul(u.mul(nn(y,1))),b=Yi(x.xy.div(x.w)).toVar();b.addAssign(1),b.divAssign(2),b.assign(Yi(b.x,b.y.oneMinus()));const T=og(b,r,d);m.element(i).assign(T.element(i)),m.a.addAssign(T.a),f.element(i).assign(s.element(i).mul(ug(oo(g),h,p).element(i)))})),m.a.divAssign(3)}else{const i=sg(e,t,c,d,o),n=a.add(i),g=l.mul(u.mul(nn(n,1))),y=Yi(g.xy.div(g.w)).toVar();y.addAssign(1),y.divAssign(2),y.assign(Yi(y.x,y.y.oneMinus())),m=og(y,r,d),f=s.mul(ug(oo(i),h,p))}const y=f.rgb.mul(m.rgb),x=e.dot(t).clamp(),b=en(Dp({dotNV:x,specularColor:i,specularF90:n,roughness:r})),T=f.r.add(f.g,f.b).div(3);return nn(b.oneMinus().mul(y),m.a.oneMinus().mul(T).oneMinus())})),dg=dn(3.2404542,-.969266,.0556434,-1.5371385,1.8760108,-.2040259,-.4985314,.041556,1.0572252),cg=(e,t)=>e.sub(t).div(e.add(t)).pow2(),hg=ki((({outsideIOR:e,eta2:t,cosTheta1:r,thinFilmThickness:s,baseF0:i})=>{const n=Io(e,t,Oo(0,.03,s)),a=e.div(n).pow2().mul(r.pow2().oneMinus()).oneMinus();Hi(a.lessThan(0),(()=>en(1)));const o=a.sqrt(),u=cg(n,e),l=xp({f0:u,f90:1,dotVH:r}),d=l.oneMinus(),c=n.lessThan(e).select(Math.PI,0),h=ji(Math.PI).sub(c),p=(e=>{const t=e.sqrt();return en(1).add(t).div(en(1).sub(t))})(i.clamp(0,.9999)),g=cg(p,n.toVec3()),m=xp({f0:g,f90:1,dotVH:o}),f=en(p.x.lessThan(n).select(Math.PI,0),p.y.lessThan(n).select(Math.PI,0),p.z.lessThan(n).select(Math.PI,0)),y=n.mul(s,o,2),x=en(h).add(f),b=l.mul(m).clamp(1e-5,.9999),T=b.sqrt(),_=d.pow2().mul(m).div(en(1).sub(b)),v=l.add(_).toVar(),N=_.sub(d).toVar();return Zc({start:1,end:2,condition:"<=",name:"m"},(({m:e})=>{N.mulAssign(T);const t=((e,t)=>{const r=e.mul(2*Math.PI*1e-9),s=en(54856e-17,44201e-17,52481e-17),i=en(1681e3,1795300,2208400),n=en(43278e5,93046e5,66121e5),a=ji(9747e-17*Math.sqrt(2*Math.PI*45282e5)).mul(r.mul(2239900).add(t.x).cos()).mul(r.pow2().mul(-45282e5).exp());let o=s.mul(n.mul(2*Math.PI).sqrt()).mul(i.mul(r).add(t).cos()).mul(r.pow2().negate().mul(n).exp());return o=en(o.x.add(a),o.y,o.z).div(1.0685e-7),dg.mul(o)})(ji(e).mul(y),ji(e).mul(x)).mul(2);v.addAssign(N.mul(t))})),v.max(en(0))})).setLayout({name:"evalIridescence",type:"vec3",inputs:[{name:"outsideIOR",type:"float"},{name:"eta2",type:"float"},{name:"cosTheta1",type:"float"},{name:"thinFilmThickness",type:"float"},{name:"baseF0",type:"vec3"}]}),pg=ki((({normal:e,viewDir:t,roughness:r})=>{const s=e.dot(t).saturate(),i=r.pow2(),n=Xo(r.lessThan(.25),ji(-339.2).mul(i).add(ji(161.4).mul(r)).sub(25.9),ji(-8.48).mul(i).add(ji(14.3).mul(r)).sub(9.95)),a=Xo(r.lessThan(.25),ji(44).mul(i).sub(ji(23.7).mul(r)).add(3.26),ji(1.97).mul(i).sub(ji(3.27).mul(r)).add(.72));return Xo(r.lessThan(.25),0,ji(.1).mul(r).sub(.025)).add(n.mul(s).add(a).exp()).mul(1/Math.PI).saturate()})),gg=en(.04),mg=ji(1);class fg extends gp{constructor(e=!1,t=!1,r=!1,s=!1,i=!1,n=!1){super(),this.clearcoat=e,this.sheen=t,this.iridescence=r,this.anisotropy=s,this.transmission=i,this.dispersion=n,this.clearcoatRadiance=null,this.clearcoatSpecularDirect=null,this.clearcoatSpecularIndirect=null,this.sheenSpecularDirect=null,this.sheenSpecularIndirect=null,this.iridescenceFresnel=null,this.iridescenceF0=null}start(e){if(!0===this.clearcoat&&(this.clearcoatRadiance=en().toVar("clearcoatRadiance"),this.clearcoatSpecularDirect=en().toVar("clearcoatSpecularDirect"),this.clearcoatSpecularIndirect=en().toVar("clearcoatSpecularIndirect")),!0===this.sheen&&(this.sheenSpecularDirect=en().toVar("sheenSpecularDirect"),this.sheenSpecularIndirect=en().toVar("sheenSpecularIndirect")),!0===this.iridescence){const e=Ql.dot(zl).clamp();this.iridescenceFresnel=hg({outsideIOR:ji(1),eta2:wn,cosTheta1:e,thinFilmThickness:An,baseF0:Ln}),this.iridescenceF0=Vp({f:this.iridescenceFresnel,f90:1,dotVH:e})}if(!0===this.transmission){const t=Ol,r=gl.sub(Ol).normalize(),s=Zl,i=e.context;i.backdrop=lg(s,r,bn,yn,Ln,Fn,t,El,cl,ll,On,Gn,Hn,zn,this.dispersion?$n:null),i.backdropAlpha=kn,yn.a.mulAssign(Io(1,i.backdrop.a,kn))}super.start(e)}computeMultiscattering(e,t,r){const s=Ql.dot(zl).clamp(),i=Ip({roughness:bn,dotNV:s}),n=(this.iridescenceF0?En.mix(Ln,this.iridescenceF0):Ln).mul(i.x).add(r.mul(i.y)),a=i.x.add(i.y).oneMinus(),o=Ln.add(Ln.oneMinus().mul(.047619)),u=n.mul(o).div(a.mul(o).oneMinus());e.addAssign(n),t.addAssign(u.mul(a))}direct({lightDirection:e,lightColor:t,reflectedLight:r}){const s=Ql.dot(e).clamp().mul(t);if(!0===this.sheen&&this.sheenSpecularDirect.addAssign(s.mul(kp({lightDirection:e}))),!0===this.clearcoat){const r=Jl.dot(e).clamp().mul(t);this.clearcoatSpecularDirect.addAssign(r.mul(Bp({lightDirection:e,f0:gg,f90:mg,roughness:vn,normalView:Jl})))}r.directDiffuse.addAssign(s.mul(bp({diffuseColor:yn.rgb}))),r.directSpecular.addAssign(s.mul(Bp({lightDirection:e,f0:Ln,f90:1,roughness:bn,iridescence:this.iridescence,f:this.iridescenceFresnel,USE_IRIDESCENCE:this.iridescence,USE_ANISOTROPY:this.anisotropy})))}directRectArea({lightColor:e,lightPosition:t,halfWidth:r,halfHeight:s,reflectedLight:i,ltc_1:n,ltc_2:a}){const o=t.add(r).sub(s),u=t.sub(r).sub(s),l=t.sub(r).add(s),d=t.add(r).add(s),c=Ql,h=zl,p=Gl.toVar(),g=Gp({N:c,V:h,roughness:bn}),m=n.sample(g).toVar(),f=a.sample(g).toVar(),y=dn(en(m.x,0,m.y),en(0,1,0),en(m.z,0,m.w)).toVar(),x=Ln.mul(f.x).add(Ln.oneMinus().mul(f.y)).toVar();i.directSpecular.addAssign(e.mul(x).mul($p({N:c,V:h,P:p,mInv:y,p0:o,p1:u,p2:l,p3:d}))),i.directDiffuse.addAssign(e.mul(yn).mul($p({N:c,V:h,P:p,mInv:dn(1,0,0,0,1,0,0,0,1),p0:o,p1:u,p2:l,p3:d})))}indirect(e){this.indirectDiffuse(e),this.indirectSpecular(e),this.ambientOcclusion(e)}indirectDiffuse(e){const{irradiance:t,reflectedLight:r}=e.context;r.indirectDiffuse.addAssign(t.mul(bp({diffuseColor:yn})))}indirectSpecular(e){const{radiance:t,iblIrradiance:r,reflectedLight:s}=e.context;if(!0===this.sheen&&this.sheenSpecularIndirect.addAssign(r.mul(Nn,pg({normal:Ql,viewDir:zl,roughness:Sn}))),!0===this.clearcoat){const e=Jl.dot(zl).clamp(),t=Dp({dotNV:e,specularColor:gg,specularF90:mg,roughness:vn});this.clearcoatSpecularIndirect.addAssign(this.clearcoatRadiance.mul(t))}const i=en().toVar("singleScattering"),n=en().toVar("multiScattering"),a=r.mul(1/Math.PI);this.computeMultiscattering(i,n,Fn);const o=i.add(n),u=yn.mul(o.r.max(o.g).max(o.b).oneMinus());s.indirectSpecular.addAssign(t.mul(i)),s.indirectSpecular.addAssign(n.mul(a)),s.indirectDiffuse.addAssign(u.mul(a))}ambientOcclusion(e){const{ambientOcclusion:t,reflectedLight:r}=e.context,s=Ql.dot(zl).clamp().add(t),i=bn.mul(-16).oneMinus().negate().exp2(),n=t.sub(s.pow(i).oneMinus()).clamp();!0===this.clearcoat&&this.clearcoatSpecularIndirect.mulAssign(t),!0===this.sheen&&this.sheenSpecularIndirect.mulAssign(t),r.indirectDiffuse.mulAssign(t),r.indirectSpecular.mulAssign(n)}finish({context:e}){const{outgoingLight:t}=e;if(!0===this.clearcoat){const e=Jl.dot(zl).clamp(),r=xp({dotVH:e,f0:gg,f90:mg}),s=t.mul(_n.mul(r).oneMinus()).add(this.clearcoatSpecularDirect.add(this.clearcoatSpecularIndirect).mul(_n));t.assign(s)}if(!0===this.sheen){const e=Nn.r.max(Nn.g).max(Nn.b).mul(.157).oneMinus(),r=t.mul(e).add(this.sheenSpecularDirect,this.sheenSpecularIndirect);t.assign(r)}}}const yg=ji(1),xg=ji(-2),bg=ji(.8),Tg=ji(-1),_g=ji(.4),vg=ji(2),Ng=ji(.305),Sg=ji(3),Eg=ji(.21),wg=ji(4),Ag=ji(4),Rg=ji(16),Cg=ki((([e])=>{const t=en(no(e)).toVar(),r=ji(-1).toVar();return Hi(t.x.greaterThan(t.z),(()=>{Hi(t.x.greaterThan(t.y),(()=>{r.assign(Xo(e.x.greaterThan(0),0,3))})).Else((()=>{r.assign(Xo(e.y.greaterThan(0),1,4))}))})).Else((()=>{Hi(t.z.greaterThan(t.y),(()=>{r.assign(Xo(e.z.greaterThan(0),2,5))})).Else((()=>{r.assign(Xo(e.y.greaterThan(0),1,4))}))})),r})).setLayout({name:"getFace",type:"float",inputs:[{name:"direction",type:"vec3"}]}),Mg=ki((([e,t])=>{const r=Yi().toVar();return Hi(t.equal(0),(()=>{r.assign(Yi(e.z,e.y).div(no(e.x)))})).ElseIf(t.equal(1),(()=>{r.assign(Yi(e.x.negate(),e.z.negate()).div(no(e.y)))})).ElseIf(t.equal(2),(()=>{r.assign(Yi(e.x.negate(),e.y).div(no(e.z)))})).ElseIf(t.equal(3),(()=>{r.assign(Yi(e.z.negate(),e.y).div(no(e.x)))})).ElseIf(t.equal(4),(()=>{r.assign(Yi(e.x.negate(),e.z).div(no(e.y)))})).Else((()=>{r.assign(Yi(e.x,e.y).div(no(e.z)))})),la(.5,r.add(1))})).setLayout({name:"getUV",type:"vec2",inputs:[{name:"direction",type:"vec3"},{name:"face",type:"float"}]}),Pg=ki((([e])=>{const t=ji(0).toVar();return Hi(e.greaterThanEqual(bg),(()=>{t.assign(yg.sub(e).mul(Tg.sub(xg)).div(yg.sub(bg)).add(xg))})).ElseIf(e.greaterThanEqual(_g),(()=>{t.assign(bg.sub(e).mul(vg.sub(Tg)).div(bg.sub(_g)).add(Tg))})).ElseIf(e.greaterThanEqual(Ng),(()=>{t.assign(_g.sub(e).mul(Sg.sub(vg)).div(_g.sub(Ng)).add(vg))})).ElseIf(e.greaterThanEqual(Eg),(()=>{t.assign(Ng.sub(e).mul(wg.sub(Sg)).div(Ng.sub(Eg)).add(Sg))})).Else((()=>{t.assign(ji(-2).mul(ja(la(1.16,e))))})),t})).setLayout({name:"roughnessToMip",type:"float",inputs:[{name:"roughness",type:"float"}]}),Lg=ki((([e,t])=>{const r=e.toVar();r.assign(la(2,r).sub(1));const s=en(r,1).toVar();return Hi(t.equal(0),(()=>{s.assign(s.zyx)})).ElseIf(t.equal(1),(()=>{s.assign(s.xzy),s.xz.mulAssign(-1)})).ElseIf(t.equal(2),(()=>{s.x.mulAssign(-1)})).ElseIf(t.equal(3),(()=>{s.assign(s.zyx),s.xz.mulAssign(-1)})).ElseIf(t.equal(4),(()=>{s.assign(s.xzy),s.xy.mulAssign(-1)})).ElseIf(t.equal(5),(()=>{s.z.mulAssign(-1)})),s})).setLayout({name:"getDirection",type:"vec3",inputs:[{name:"uv",type:"vec2"},{name:"face",type:"float"}]}),Fg=ki((([e,t,r,s,i,n])=>{const a=ji(r),o=en(t),u=Do(Pg(a),xg,n),l=Za(u),d=Ka(u),c=en(Bg(e,o,d,s,i,n)).toVar();return Hi(l.notEqual(0),(()=>{const t=en(Bg(e,o,d.add(1),s,i,n)).toVar();c.assign(Io(c,t,l))})),c})),Bg=ki((([e,t,r,s,i,n])=>{const a=ji(r).toVar(),o=en(t),u=ji(Cg(o)).toVar(),l=ji(_o(Ag.sub(a),0)).toVar();a.assign(_o(a,Ag));const d=ji($a(a)).toVar(),c=Yi(Mg(o,u).mul(d.sub(2)).add(1)).toVar();return Hi(u.greaterThan(2),(()=>{c.y.addAssign(d),u.subAssign(3)})),c.x.addAssign(u.mul(d)),c.x.addAssign(l.mul(la(3,Rg))),c.y.addAssign(la(4,$a(n).sub(d))),c.x.mulAssign(s),c.y.mulAssign(i),e.sample(c).grad(Yi(),Yi())})),Ig=ki((({envMap:e,mipInt:t,outputDirection:r,theta:s,axis:i,CUBEUV_TEXEL_WIDTH:n,CUBEUV_TEXEL_HEIGHT:a,CUBEUV_MAX_MIP:o})=>{const u=eo(s),l=r.mul(u).add(i.cross(r).mul(Ja(s))).add(i.mul(i.dot(r).mul(u.oneMinus())));return Bg(e,l,t,n,a,o)})),Dg=ki((({n:e,latitudinal:t,poleAxis:r,outputDirection:s,weights:i,samples:n,dTheta:a,mipInt:o,envMap:u,CUBEUV_TEXEL_WIDTH:l,CUBEUV_TEXEL_HEIGHT:d,CUBEUV_MAX_MIP:c})=>{const h=en(Xo(t,r,Ao(r,s))).toVar();Hi(h.equal(en(0)),(()=>{h.assign(en(s.z,0,s.x.negate()))})),h.assign(Qa(h));const p=en().toVar();return p.addAssign(i.element(0).mul(Ig({theta:0,axis:h,outputDirection:s,mipInt:o,envMap:u,CUBEUV_TEXEL_WIDTH:l,CUBEUV_TEXEL_HEIGHT:d,CUBEUV_MAX_MIP:c}))),Zc({start:qi(1),end:e},(({i:e})=>{Hi(e.greaterThanEqual(n),(()=>{Jc()}));const t=ji(a.mul(ji(e))).toVar();p.addAssign(i.element(e).mul(Ig({theta:t.mul(-1),axis:h,outputDirection:s,mipInt:o,envMap:u,CUBEUV_TEXEL_WIDTH:l,CUBEUV_TEXEL_HEIGHT:d,CUBEUV_MAX_MIP:c}))),p.addAssign(i.element(e).mul(Ig({theta:t,axis:h,outputDirection:s,mipInt:o,envMap:u,CUBEUV_TEXEL_WIDTH:l,CUBEUV_TEXEL_HEIGHT:d,CUBEUV_MAX_MIP:c})))})),nn(p,1)})),Vg=[.125,.215,.35,.446,.526,.582],Ug=20,Og=new ne(-1,1,1,-1,0,1),kg=new ae(90,1),Gg=new e;let zg=null,Hg=0,$g=0;const Wg=(1+Math.sqrt(5))/2,jg=1/Wg,qg=[new r(-Wg,jg,0),new r(Wg,jg,0),new r(-jg,0,Wg),new r(jg,0,Wg),new r(0,Wg,-jg),new r(0,Wg,jg),new r(-1,1,-1),new r(1,1,-1),new r(-1,1,1),new r(1,1,1)],Xg=new r,Kg=new WeakMap,Yg=[3,1,5,0,4,2],Qg=Lg($u(),Hu("faceIndex")).normalize(),Zg=en(Qg.x,Qg.y,Qg.z);class Jg{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._backgroundBox=null}get _hasInitialized(){return this._renderer.hasInitialized()}fromScene(e,t=0,r=.1,s=100,i={}){const{size:n=256,position:a=Xg,renderTarget:o=null}=i;if(this._setSize(n),!1===this._hasInitialized){console.warn("THREE.PMREMGenerator: .fromScene() called before the backend is initialized. Try using .fromSceneAsync() instead.");const n=o||this._allocateTarget();return i.renderTarget=n,this.fromSceneAsync(e,t,r,s,i),n}zg=this._renderer.getRenderTarget(),Hg=this._renderer.getActiveCubeFace(),$g=this._renderer.getActiveMipmapLevel();const u=o||this._allocateTarget();return u.depthBuffer=!0,this._init(u),this._sceneToCubeUV(e,r,s,u,a),t>0&&this._blur(u,0,0,t),this._applyPMREM(u),this._cleanup(u),u}async fromSceneAsync(e,t=0,r=.1,s=100,i={}){return!1===this._hasInitialized&&await this._renderer.init(),this.fromScene(e,t,r,s,i)}fromEquirectangular(e,t=null){if(!1===this._hasInitialized){console.warn("THREE.PMREMGenerator: .fromEquirectangular() called before the backend is initialized. Try using .fromEquirectangularAsync() instead."),this._setSizeFromTexture(e);const r=t||this._allocateTarget();return this.fromEquirectangularAsync(e,r),r}return this._fromTexture(e,t)}async fromEquirectangularAsync(e,t=null){return!1===this._hasInitialized&&await this._renderer.init(),this._fromTexture(e,t)}fromCubemap(e,t=null){if(!1===this._hasInitialized){console.warn("THREE.PMREMGenerator: .fromCubemap() called before the backend is initialized. Try using .fromCubemapAsync() instead."),this._setSizeFromTexture(e);const r=t||this._allocateTarget();return this.fromCubemapAsync(e,t),r}return this._fromTexture(e,t)}async fromCubemapAsync(e,t=null){return!1===this._hasInitialized&&await this._renderer.init(),this._fromTexture(e,t)}async compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=sm(),await this._compileMaterial(this._cubemapMaterial))}async compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=im(),await this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose(),null!==this._backgroundBox&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSizeFromTexture(e){e.mapping===A||e.mapping===R?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4)}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;ee-4?u=Vg[o-e+4-1]:0===o&&(u=0),s.push(u);const l=1/(a-2),d=-l,c=1+l,h=[d,d,c,d,c,c,d,d,c,c,d,c],p=6,g=6,m=3,f=2,y=1,x=new Float32Array(m*g*p),b=new Float32Array(f*g*p),T=new Float32Array(y*g*p);for(let e=0;e2?0:-1,s=[t,r,0,t+2/3,r,0,t+2/3,r+1,0,t,r,0,t+2/3,r+1,0,t,r+1,0],i=Yg[e];x.set(s,m*g*i),b.set(h,f*g*i);const n=[i,i,i,i,i,i];T.set(n,y*g*i)}const _=new he;_.setAttribute("position",new pe(x,m)),_.setAttribute("uv",new pe(b,f)),_.setAttribute("faceIndex",new pe(T,y)),t.push(_),i.push(new q(_,null)),n>4&&n--}return{lodPlanes:t,sizeLods:r,sigmas:s,lodMeshes:i}}(t)),this._blurMaterial=function(e,t,s){const i=il(new Array(Ug).fill(0)),n=Zn(new r(0,1,0)),a=Zn(0),o=ji(Ug),u=Zn(0),l=Zn(1),d=Zu(null),c=Zn(0),h=ji(1/t),p=ji(1/s),g=ji(e),m={n:o,latitudinal:u,weights:i,poleAxis:n,outputDirection:Zg,dTheta:a,samples:l,envMap:d,mipInt:c,CUBEUV_TEXEL_WIDTH:h,CUBEUV_TEXEL_HEIGHT:p,CUBEUV_MAX_MIP:g},f=rm("blur");return f.fragmentNode=Dg({...m,latitudinal:u.equal(1)}),Kg.set(f,m),f}(t,e.width,e.height)}}async _compileMaterial(e){const t=new q(this._lodPlanes[0],e);await this._renderer.compile(t,Og)}_sceneToCubeUV(e,t,r,s,i){const n=kg;n.near=t,n.far=r;const a=[1,1,1,1,-1,1],o=[1,-1,1,-1,1,-1],u=this._renderer,l=u.autoClear;u.getClearColor(Gg),u.autoClear=!1;let d=this._backgroundBox;if(null===d){const e=new re({name:"PMREM.Background",side:S,depthWrite:!1,depthTest:!1});d=new q(new j,e)}let c=!1;const h=e.background;h?h.isColor&&(d.material.color.copy(h),e.background=null,c=!0):(d.material.color.copy(Gg),c=!0),u.setRenderTarget(s),u.clear(),c&&u.render(d,n);for(let t=0;t<6;t++){const r=t%3;0===r?(n.up.set(0,a[t],0),n.position.set(i.x,i.y,i.z),n.lookAt(i.x+o[t],i.y,i.z)):1===r?(n.up.set(0,0,a[t]),n.position.set(i.x,i.y,i.z),n.lookAt(i.x,i.y+o[t],i.z)):(n.up.set(0,a[t],0),n.position.set(i.x,i.y,i.z),n.lookAt(i.x,i.y,i.z+o[t]));const l=this._cubeSize;tm(s,r*l,t>2?l:0,l,l),u.render(e,n)}u.autoClear=l,e.background=h}_textureToCubeUV(e,t){const r=this._renderer,s=e.mapping===A||e.mapping===R;s?null===this._cubemapMaterial&&(this._cubemapMaterial=sm(e)):null===this._equirectMaterial&&(this._equirectMaterial=im(e));const i=s?this._cubemapMaterial:this._equirectMaterial;i.fragmentNode.value=e;const n=this._lodMeshes[0];n.material=i;const a=this._cubeSize;tm(t,0,0,3*a,2*a),r.setRenderTarget(t),r.render(n,Og)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;const s=this._lodPlanes.length;for(let t=1;tUg&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${g} samples when the maximum is set to 20`);const m=[];let f=0;for(let e=0;ey-4?s-y+4:0),4*(this._cubeSize-x),3*x,2*x),o.setRenderTarget(t),o.render(l,Og)}}function em(e,t){const r=new oe(e,t,{magFilter:K,minFilter:K,generateMipmaps:!1,type:de,format:le,colorSpace:ue});return r.texture.mapping=ce,r.texture.name="PMREM.cubeUv",r.texture.isPMREMTexture=!0,r.scissorTest=!0,r}function tm(e,t,r,s,i){e.viewport.set(t,r,s,i),e.scissor.set(t,r,s,i)}function rm(e){const t=new Wh;return t.depthTest=!1,t.depthWrite=!1,t.blending=z,t.name=`PMREM_${e}`,t}function sm(e){const t=rm("cubemap");return t.fragmentNode=gd(e,Zg),t}function im(e){const t=rm("equirect");return t.fragmentNode=Zu(e,np(Zg),0),t}const nm=new WeakMap;function am(e,t,r){const s=function(e){let t=nm.get(e);void 0===t&&(t=new WeakMap,nm.set(e,t));return t}(t);let i=s.get(e);if((void 0!==i?i.pmremVersion:-1)!==e.pmremVersion){const t=e.image;if(e.isCubeTexture){if(!function(e){if(null==e)return!1;let t=0;const r=6;for(let s=0;s0}(t))return null;i=r.fromEquirectangular(e,i)}i.pmremVersion=e.pmremVersion,s.set(e,i)}return i.texture}class om extends Ks{static get type(){return"PMREMNode"}constructor(e,t=null,r=null){super("vec3"),this._value=e,this._pmrem=null,this.uvNode=t,this.levelNode=r,this._generator=null;const s=new b;s.isRenderTargetTexture=!0,this._texture=Zu(s),this._width=Zn(0),this._height=Zn(0),this._maxMip=Zn(0),this.updateBeforeType=Vs.RENDER}set value(e){this._value=e,this._pmrem=null}get value(){return this._value}updateFromTexture(e){const t=function(e){const t=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:r,maxMip:t}}(e.image.height);this._texture.value=e,this._width.value=t.texelWidth,this._height.value=t.texelHeight,this._maxMip.value=t.maxMip}updateBefore(e){let t=this._pmrem;const r=t?t.pmremVersion:-1,s=this._value;r!==s.pmremVersion&&(t=!0===s.isPMREMTexture?s:am(s,e.renderer,this._generator),null!==t&&(this._pmrem=t,this.updateFromTexture(t)))}setup(e){null===this._generator&&(this._generator=new Jg(e.renderer)),this.updateBefore(e);let t=this.uvNode;null===t&&e.context.getUV&&(t=e.context.getUV(this)),t=ad.mul(en(t.x,t.y.negate(),t.z));let r=this.levelNode;return null===r&&e.context.getTextureLevel&&(r=e.context.getTextureLevel(this)),Fg(this._texture,t,r,this._width,this._height,this._maxMip)}dispose(){super.dispose(),null!==this._generator&&this._generator.dispose()}}const um=Vi(om).setParameterLength(1,3),lm=new WeakMap;class dm extends nh{static get type(){return"EnvironmentNode"}constructor(e=null){super(),this.envNode=e}setup(e){const{material:t}=e;let r=this.envNode;if(r.isTextureNode||r.isMaterialReferenceNode){const e=r.isTextureNode?r.value:t[r.property];let s=lm.get(e);void 0===s&&(s=um(e),lm.set(e,s)),r=s}const s=!0===t.useAnisotropy||t.anisotropy>0?Dd:Ql,i=r.context(cm(bn,s)).mul(nd),n=r.context(hm(Zl)).mul(Math.PI).mul(nd),a=Ru(i),o=Ru(n);e.context.radiance.addAssign(a),e.context.iblIrradiance.addAssign(o);const u=e.context.lightingModel.clearcoatRadiance;if(u){const e=r.context(cm(vn,Jl)).mul(nd),t=Ru(e);u.addAssign(t)}}}const cm=(e,t)=>{let r=null;return{getUV:()=>(null===r&&(r=zl.negate().reflect(t),r=e.mul(e).mix(r,t).normalize(),r=r.transformDirection(cl)),r),getTextureLevel:()=>e}},hm=e=>({getUV:()=>e,getTextureLevel:()=>ji(1)}),pm=new ge;class gm extends Wh{static get type(){return"MeshStandardNodeMaterial"}constructor(e){super(),this.isMeshStandardNodeMaterial=!0,this.lights=!0,this.emissiveNode=null,this.metalnessNode=null,this.roughnessNode=null,this.setDefaultValues(pm),this.setValues(e)}setupEnvironment(e){let t=super.setupEnvironment(e);return null===t&&e.environmentNode&&(t=e.environmentNode),t?new dm(t):null}setupLightingModel(){return new fg}setupSpecular(){const e=Io(en(.04),yn.rgb,Tn);Ln.assign(e),Fn.assign(1)}setupVariants(){const e=this.metalnessNode?ji(this.metalnessNode):sc;Tn.assign(e);let t=this.roughnessNode?ji(this.roughnessNode):rc;t=Rp({roughness:t}),bn.assign(t),this.setupSpecular(),yn.assign(nn(yn.rgb.mul(e.oneMinus()),yn.a))}copy(e){return this.emissiveNode=e.emissiveNode,this.metalnessNode=e.metalnessNode,this.roughnessNode=e.roughnessNode,super.copy(e)}}const mm=new me;class fm extends gm{static get type(){return"MeshPhysicalNodeMaterial"}constructor(e){super(),this.isMeshPhysicalNodeMaterial=!0,this.clearcoatNode=null,this.clearcoatRoughnessNode=null,this.clearcoatNormalNode=null,this.sheenNode=null,this.sheenRoughnessNode=null,this.iridescenceNode=null,this.iridescenceIORNode=null,this.iridescenceThicknessNode=null,this.specularIntensityNode=null,this.specularColorNode=null,this.iorNode=null,this.transmissionNode=null,this.thicknessNode=null,this.attenuationDistanceNode=null,this.attenuationColorNode=null,this.dispersionNode=null,this.anisotropyNode=null,this.setDefaultValues(mm),this.setValues(e)}get useClearcoat(){return this.clearcoat>0||null!==this.clearcoatNode}get useIridescence(){return this.iridescence>0||null!==this.iridescenceNode}get useSheen(){return this.sheen>0||null!==this.sheenNode}get useAnisotropy(){return this.anisotropy>0||null!==this.anisotropyNode}get useTransmission(){return this.transmission>0||null!==this.transmissionNode}get useDispersion(){return this.dispersion>0||null!==this.dispersionNode}setupSpecular(){const e=this.iorNode?ji(this.iorNode):yc;On.assign(e),Ln.assign(Io(To(Co(On.sub(1).div(On.add(1))).mul(Jd),en(1)).mul(Zd),yn.rgb,Tn)),Fn.assign(Io(Zd,1,Tn))}setupLightingModel(){return new fg(this.useClearcoat,this.useSheen,this.useIridescence,this.useAnisotropy,this.useTransmission,this.useDispersion)}setupVariants(e){if(super.setupVariants(e),this.useClearcoat){const e=this.clearcoatNode?ji(this.clearcoatNode):nc,t=this.clearcoatRoughnessNode?ji(this.clearcoatRoughnessNode):ac;_n.assign(e),vn.assign(Rp({roughness:t}))}if(this.useSheen){const e=this.sheenNode?en(this.sheenNode):lc,t=this.sheenRoughnessNode?ji(this.sheenRoughnessNode):dc;Nn.assign(e),Sn.assign(t)}if(this.useIridescence){const e=this.iridescenceNode?ji(this.iridescenceNode):hc,t=this.iridescenceIORNode?ji(this.iridescenceIORNode):pc,r=this.iridescenceThicknessNode?ji(this.iridescenceThicknessNode):gc;En.assign(e),wn.assign(t),An.assign(r)}if(this.useAnisotropy){const e=(this.anisotropyNode?Yi(this.anisotropyNode):cc).toVar();Cn.assign(e.length()),Hi(Cn.equal(0),(()=>{e.assign(Yi(1,0))})).Else((()=>{e.divAssign(Yi(Cn)),Cn.assign(Cn.saturate())})),Rn.assign(Cn.pow2().mix(bn.pow2(),1)),Mn.assign(Bd[0].mul(e.x).add(Bd[1].mul(e.y))),Pn.assign(Bd[1].mul(e.x).sub(Bd[0].mul(e.y)))}if(this.useTransmission){const e=this.transmissionNode?ji(this.transmissionNode):mc,t=this.thicknessNode?ji(this.thicknessNode):fc,r=this.attenuationDistanceNode?ji(this.attenuationDistanceNode):xc,s=this.attenuationColorNode?en(this.attenuationColorNode):bc;if(kn.assign(e),Gn.assign(t),zn.assign(r),Hn.assign(s),this.useDispersion){const e=this.dispersionNode?ji(this.dispersionNode):wc;$n.assign(e)}}}setupClearcoatNormal(){return this.clearcoatNormalNode?en(this.clearcoatNormalNode):oc}setup(e){e.context.setupClearcoatNormal=()=>this.setupClearcoatNormal(e),super.setup(e)}copy(e){return this.clearcoatNode=e.clearcoatNode,this.clearcoatRoughnessNode=e.clearcoatRoughnessNode,this.clearcoatNormalNode=e.clearcoatNormalNode,this.sheenNode=e.sheenNode,this.sheenRoughnessNode=e.sheenRoughnessNode,this.iridescenceNode=e.iridescenceNode,this.iridescenceIORNode=e.iridescenceIORNode,this.iridescenceThicknessNode=e.iridescenceThicknessNode,this.specularIntensityNode=e.specularIntensityNode,this.specularColorNode=e.specularColorNode,this.transmissionNode=e.transmissionNode,this.thicknessNode=e.thicknessNode,this.attenuationDistanceNode=e.attenuationDistanceNode,this.attenuationColorNode=e.attenuationColorNode,this.dispersionNode=e.dispersionNode,this.anisotropyNode=e.anisotropyNode,super.copy(e)}}class ym extends fg{constructor(e=!1,t=!1,r=!1,s=!1,i=!1,n=!1,a=!1){super(e,t,r,s,i,n),this.useSSS=a}direct({lightDirection:e,lightColor:t,reflectedLight:r},s){if(!0===this.useSSS){const i=s.material,{thicknessColorNode:n,thicknessDistortionNode:a,thicknessAmbientNode:o,thicknessAttenuationNode:u,thicknessPowerNode:l,thicknessScaleNode:d}=i,c=e.add(Ql.mul(a)).normalize(),h=ji(zl.dot(c.negate()).saturate().pow(l).mul(d)),p=en(h.add(o).mul(n));r.directDiffuse.addAssign(p.mul(u.mul(t)))}super.direct({lightDirection:e,lightColor:t,reflectedLight:r},s)}}class xm extends fm{static get type(){return"MeshSSSNodeMaterial"}constructor(e){super(e),this.thicknessColorNode=null,this.thicknessDistortionNode=ji(.1),this.thicknessAmbientNode=ji(0),this.thicknessAttenuationNode=ji(.1),this.thicknessPowerNode=ji(2),this.thicknessScaleNode=ji(10)}get useSSS(){return null!==this.thicknessColorNode}setupLightingModel(){return new ym(this.useClearcoat,this.useSheen,this.useIridescence,this.useAnisotropy,this.useTransmission,this.useDispersion,this.useSSS)}copy(e){return this.thicknessColorNode=e.thicknessColorNode,this.thicknessDistortionNode=e.thicknessDistortionNode,this.thicknessAmbientNode=e.thicknessAmbientNode,this.thicknessAttenuationNode=e.thicknessAttenuationNode,this.thicknessPowerNode=e.thicknessPowerNode,this.thicknessScaleNode=e.thicknessScaleNode,super.copy(e)}}const bm=ki((({normal:e,lightDirection:t,builder:r})=>{const s=e.dot(t),i=Yi(s.mul(.5).add(.5),0);if(r.material.gradientMap){const e=Td("gradientMap","texture").context({getUV:()=>i});return en(e.r)}{const e=i.fwidth().mul(.5);return Io(en(.7),en(1),Oo(ji(.7).sub(e.x),ji(.7).add(e.x),i.x))}}));class Tm extends gp{direct({lightDirection:e,lightColor:t,reflectedLight:r},s){const i=bm({normal:jl,lightDirection:e,builder:s}).mul(t);r.directDiffuse.addAssign(i.mul(bp({diffuseColor:yn.rgb})))}indirect(e){const{ambientOcclusion:t,irradiance:r,reflectedLight:s}=e.context;s.indirectDiffuse.addAssign(r.mul(bp({diffuseColor:yn}))),s.indirectDiffuse.mulAssign(t)}}const _m=new fe;class vm extends Wh{static get type(){return"MeshToonNodeMaterial"}constructor(e){super(),this.isMeshToonNodeMaterial=!0,this.lights=!0,this.setDefaultValues(_m),this.setValues(e)}setupLightingModel(){return new Tm}}class Nm extends Ks{static get type(){return"MatcapUVNode"}constructor(){super("vec2")}setup(){const e=en(zl.z,0,zl.x.negate()).normalize(),t=zl.cross(e);return Yi(e.dot(Ql),t.dot(Ql)).mul(.495).add(.5)}}const Sm=Ui(Nm),Em=new ye;class wm extends Wh{static get type(){return"MeshMatcapNodeMaterial"}constructor(e){super(),this.isMeshMatcapNodeMaterial=!0,this.setDefaultValues(Em),this.setValues(e)}setupVariants(e){const t=Sm;let r;r=e.material.matcap?Td("matcap","texture").context({getUV:()=>t}):en(Io(.2,.8,t.y)),yn.rgb.mulAssign(r.rgb)}}class Am extends Ks{static get type(){return"RotateNode"}constructor(e,t){super(),this.positionNode=e,this.rotationNode=t}getNodeType(e){return this.positionNode.getNodeType(e)}setup(e){const{rotationNode:t,positionNode:r}=this;if("vec2"===this.getNodeType(e)){const e=t.cos(),s=t.sin();return ln(e,s,s.negate(),e).mul(r)}{const e=t,s=cn(nn(1,0,0,0),nn(0,eo(e.x),Ja(e.x).negate(),0),nn(0,Ja(e.x),eo(e.x),0),nn(0,0,0,1)),i=cn(nn(eo(e.y),0,Ja(e.y),0),nn(0,1,0,0),nn(Ja(e.y).negate(),0,eo(e.y),0),nn(0,0,0,1)),n=cn(nn(eo(e.z),Ja(e.z).negate(),0,0),nn(Ja(e.z),eo(e.z),0,0),nn(0,0,1,0),nn(0,0,0,1));return s.mul(i).mul(n).mul(nn(r,1)).xyz}}}const Rm=Vi(Am).setParameterLength(2),Cm=new xe;class Mm extends Wh{static get type(){return"SpriteNodeMaterial"}constructor(e){super(),this.isSpriteNodeMaterial=!0,this._useSizeAttenuation=!0,this.positionNode=null,this.rotationNode=null,this.scaleNode=null,this.transparent=!0,this.setDefaultValues(Cm),this.setValues(e)}setupPositionView(e){const{object:t,camera:r}=e,s=this.sizeAttenuation,{positionNode:i,rotationNode:n,scaleNode:a}=this,o=Ll.mul(en(i||0));let u=Yi(El[0].xyz.length(),El[1].xyz.length());if(null!==a&&(u=u.mul(Yi(a))),!1===s)if(r.isPerspectiveCamera)u=u.mul(o.z.negate());else{const e=ji(2).div(ll.element(1).element(1));u=u.mul(e.mul(2))}let l=Dl.xy;if(t.center&&!0===t.center.isVector2){const e=((e,t,r)=>Bi(new gu(e,t,r)))("center","vec2",t);l=l.sub(e.sub(.5))}l=l.mul(u);const d=ji(n||uc),c=Rm(l,d);return nn(o.xy.add(c),o.zw)}copy(e){return this.positionNode=e.positionNode,this.rotationNode=e.rotationNode,this.scaleNode=e.scaleNode,super.copy(e)}get sizeAttenuation(){return this._useSizeAttenuation}set sizeAttenuation(e){this._useSizeAttenuation!==e&&(this._useSizeAttenuation=e,this.needsUpdate=!0)}}const Pm=new be;class Lm extends Mm{static get type(){return"PointsNodeMaterial"}constructor(e){super(),this.sizeNode=null,this.isPointsNodeMaterial=!0,this.setDefaultValues(Pm),this.setValues(e)}setupPositionView(){const{positionNode:e}=this;return Ll.mul(en(e||Vl)).xyz}setupVertex(e){const t=super.setupVertex(e);if(!0!==e.material.isNodeMaterial)return t;const{rotationNode:r,scaleNode:s,sizeNode:i}=this,n=Dl.xy.toVar(),a=fh.z.div(fh.w);if(r&&r.isNode){const e=ji(r);n.assign(Rm(n,e))}let o=null!==i?Yi(i):Ec;return!0===this.sizeAttenuation&&(o=o.mul(o.div(Gl.z.negate()))),s&&s.isNode&&(o=o.mul(Yi(s))),n.mulAssign(o.mul(2)),n.assign(n.div(fh.z)),n.y.assign(n.y.mul(a)),n.assign(n.mul(t.w)),t.addAssign(nn(n,0,0)),t}get alphaToCoverage(){return this._useAlphaToCoverage}set alphaToCoverage(e){this._useAlphaToCoverage!==e&&(this._useAlphaToCoverage=e,this.needsUpdate=!0)}}class Fm extends gp{constructor(){super(),this.shadowNode=ji(1).toVar("shadowMask")}direct({lightNode:e}){null!==e.shadowNode&&this.shadowNode.mulAssign(e.shadowNode)}finish({context:e}){yn.a.mulAssign(this.shadowNode.oneMinus()),e.outgoingLight.rgb.assign(yn.rgb)}}const Bm=new Te;class Im extends Wh{static get type(){return"ShadowNodeMaterial"}constructor(e){super(),this.isShadowNodeMaterial=!0,this.lights=!0,this.transparent=!0,this.setDefaultValues(Bm),this.setValues(e)}setupLightingModel(){return new Fm}}const Dm=mn("vec3"),Vm=mn("vec3"),Um=mn("vec3");class Om extends gp{constructor(){super()}start(e){const{material:t,context:r}=e,s=mn("vec3"),i=mn("vec3");Hi(gl.sub(Ol).length().greaterThan(Cl.mul(2)),(()=>{s.assign(gl),i.assign(Ol)})).Else((()=>{s.assign(Ol),i.assign(gl)}));const n=i.sub(s),a=Zn("int").onRenderUpdate((({material:e})=>e.steps)),o=n.length().div(a).toVar(),u=n.normalize().toVar(),l=ji(0).toVar(),d=en(1).toVar();t.offsetNode&&l.addAssign(t.offsetNode.mul(o)),Zc(a,(()=>{const i=s.add(u.mul(l)),n=cl.mul(nn(i,1)).xyz;let a;null!==t.depthNode&&(Vm.assign(Vh(Lh(n.z,ol,ul))),r.sceneDepthNode=Vh(t.depthNode).toVar()),r.positionWorld=i,r.shadowPositionWorld=i,r.positionView=n,Dm.assign(0),t.scatteringNode&&(a=t.scatteringNode({positionRay:i})),super.start(e),a&&Dm.mulAssign(a);const c=Dm.mul(.01).negate().mul(o).exp();d.mulAssign(c),l.addAssign(o)})),Um.addAssign(d.saturate().oneMinus())}scatteringLight(e,t){const r=t.context.sceneDepthNode;r?Hi(r.greaterThanEqual(Vm),(()=>{Dm.addAssign(e)})):Dm.addAssign(e)}direct({lightNode:e,lightColor:t},r){if(void 0===e.light.distance)return;const s=t.xyz.toVar();s.mulAssign(e.shadowNode),this.scatteringLight(s,r)}directRectArea({lightColor:e,lightPosition:t,halfWidth:r,halfHeight:s},i){const n=t.add(r).sub(s),a=t.sub(r).sub(s),o=t.sub(r).add(s),u=t.add(r).add(s),l=i.context.positionView,d=e.xyz.mul(Wp({P:l,p0:n,p1:a,p2:o,p3:u})).pow(1.5);this.scatteringLight(d,i)}finish(e){e.context.outgoingLight.assign(Um)}}class km extends Wh{static get type(){return"VolumeNodeMaterial"}constructor(e){super(),this.isVolumeNodeMaterial=!0,this.steps=25,this.offsetNode=null,this.scatteringNode=null,this.lights=!0,this.transparent=!0,this.side=S,this.depthTest=!1,this.depthWrite=!1,this.setValues(e)}setupLightingModel(){return new Om}}class Gm{constructor(e,t){this.nodes=e,this.info=t,this._context="undefined"!=typeof self?self:null,this._animationLoop=null,this._requestId=null}start(){const e=(t,r)=>{this._requestId=this._context.requestAnimationFrame(e),!0===this.info.autoReset&&this.info.reset(),this.nodes.nodeFrame.update(),this.info.frame=this.nodes.nodeFrame.frameId,null!==this._animationLoop&&this._animationLoop(t,r)};e()}stop(){this._context.cancelAnimationFrame(this._requestId),this._requestId=null}getAnimationLoop(){return this._animationLoop}setAnimationLoop(e){this._animationLoop=e}getContext(){return this._context}setContext(e){this._context=e}dispose(){this.stop()}}class zm{constructor(){this.weakMap=new WeakMap}get(e){let t=this.weakMap;for(let r=0;r{this.dispose()},this.material.addEventListener("dispose",this.onMaterialDispose)}updateClipping(e){this.clippingContext=e}get clippingNeedsUpdate(){return null!==this.clippingContext&&this.clippingContext.cacheKey!==this.clippingContextCacheKey&&(this.clippingContextCacheKey=this.clippingContext.cacheKey,!0)}get hardwareClippingPlanes(){return!0===this.material.hardwareClipping?this.clippingContext.unionClippingCount:0}getNodeBuilderState(){return this._nodeBuilderState||(this._nodeBuilderState=this._nodes.getForRender(this))}getMonitor(){return this._monitor||(this._monitor=this.getNodeBuilderState().observer)}getBindings(){return this._bindings||(this._bindings=this.getNodeBuilderState().createBindings())}getBindingGroup(e){for(const t of this.getBindings())if(t.name===e)return t}getIndex(){return this._geometries.getIndex(this)}getIndirect(){return this._geometries.getIndirect(this)}getChainArray(){return[this.object,this.material,this.context,this.lightsNode]}setGeometry(e){this.geometry=e,this.attributes=null}getAttributes(){if(null!==this.attributes)return this.attributes;const e=this.getNodeBuilderState().nodeAttributes,t=this.geometry,r=[],s=new Set;for(const i of e){const e=i.node&&i.node.attribute?i.node.attribute:t.getAttribute(i.name);if(void 0===e)continue;r.push(e);const n=e.isInterleavedBufferAttribute?e.data:e;s.add(n)}return this.attributes=r,this.vertexBuffers=Array.from(s.values()),r}getVertexBuffers(){return null===this.vertexBuffers&&this.getAttributes(),this.vertexBuffers}getDrawParameters(){const{object:e,material:t,geometry:r,group:s,drawRange:i}=this,n=this.drawParams||(this.drawParams={vertexCount:0,firstVertex:0,instanceCount:0,firstInstance:0}),a=this.getIndex(),o=null!==a;let u=1;if(!0===r.isInstancedBufferGeometry?u=r.instanceCount:void 0!==e.count&&(u=Math.max(0,e.count)),0===u)return null;if(n.instanceCount=u,!0===e.isBatchedMesh)return n;let l=1;!0!==t.wireframe||e.isPoints||e.isLineSegments||e.isLine||e.isLineLoop||(l=2);let d=i.start*l,c=(i.start+i.count)*l;null!==s&&(d=Math.max(d,s.start*l),c=Math.min(c,(s.start+s.count)*l));const h=r.attributes.position;let p=1/0;o?p=a.count:null!=h&&(p=h.count),d=Math.max(d,0),c=Math.min(c,p);const g=c-d;return g<0||g===1/0?null:(n.vertexCount=g,n.firstVertex=d,n)}getGeometryCacheKey(){const{geometry:e}=this;let t="";for(const r of Object.keys(e.attributes).sort()){const s=e.attributes[r];t+=r+",",s.data&&(t+=s.data.stride+","),s.offset&&(t+=s.offset+","),s.itemSize&&(t+=s.itemSize+","),s.normalized&&(t+="n,")}for(const r of Object.keys(e.morphAttributes).sort()){const s=e.morphAttributes[r];t+="morph-"+r+",";for(let e=0,r=s.length;e1&&(r+=e.uuid+","),r+=e.receiveShadow+",",xs(r)}get needsGeometryUpdate(){return this.geometry.id!==this.object.geometry.id}get needsUpdate(){return this.initialNodesCacheKey!==this.getDynamicCacheKey()||this.clippingNeedsUpdate}getDynamicCacheKey(){let e=0;return!0!==this.material.isShadowPassMaterial&&(e=this._nodes.getCacheKey(this.scene,this.lightsNode)),this.camera.isArrayCamera&&(e=Ts(e,this.camera.cameras.length)),this.object.receiveShadow&&(e=Ts(e,1)),e}getCacheKey(){return this.getMaterialCacheKey()+this.getDynamicCacheKey()}dispose(){this.material.removeEventListener("dispose",this.onMaterialDispose),this.onDispose()}}const Wm=[];class jm{constructor(e,t,r,s,i,n){this.renderer=e,this.nodes=t,this.geometries=r,this.pipelines=s,this.bindings=i,this.info=n,this.chainMaps={}}get(e,t,r,s,i,n,a,o){const u=this.getChainMap(o);Wm[0]=e,Wm[1]=t,Wm[2]=n,Wm[3]=i;let l=u.get(Wm);return void 0===l?(l=this.createRenderObject(this.nodes,this.geometries,this.renderer,e,t,r,s,i,n,a,o),u.set(Wm,l)):(l.updateClipping(a),l.needsGeometryUpdate&&l.setGeometry(e.geometry),(l.version!==t.version||l.needsUpdate)&&(l.initialCacheKey!==l.getCacheKey()?(l.dispose(),l=this.get(e,t,r,s,i,n,a,o)):l.version=t.version)),Wm.length=0,l}getChainMap(e="default"){return this.chainMaps[e]||(this.chainMaps[e]=new zm)}dispose(){this.chainMaps={}}createRenderObject(e,t,r,s,i,n,a,o,u,l,d){const c=this.getChainMap(d),h=new $m(e,t,r,s,i,n,a,o,u,l);return h.onDispose=()=>{this.pipelines.delete(h),this.bindings.delete(h),this.nodes.delete(h),c.delete(h.getChainArray())},h}}class qm{constructor(){this.data=new WeakMap}get(e){let t=this.data.get(e);return void 0===t&&(t={},this.data.set(e,t)),t}delete(e){let t=null;return this.data.has(e)&&(t=this.data.get(e),this.data.delete(e)),t}has(e){return this.data.has(e)}dispose(){this.data=new WeakMap}}const Xm=1,Km=2,Ym=3,Qm=4,Zm=16;class Jm extends qm{constructor(e){super(),this.backend=e}delete(e){const t=super.delete(e);return null!==t&&this.backend.destroyAttribute(e),t}update(e,t){const r=this.get(e);if(void 0===r.version)t===Xm?this.backend.createAttribute(e):t===Km?this.backend.createIndexAttribute(e):t===Ym?this.backend.createStorageAttribute(e):t===Qm&&this.backend.createIndirectStorageAttribute(e),r.version=this._getBufferAttribute(e).version;else{const t=this._getBufferAttribute(e);(r.version{this.info.memory.geometries--;const s=t.index,i=e.getAttributes();null!==s&&this.attributes.delete(s);for(const e of i)this.attributes.delete(e);const n=this.wireframes.get(t);void 0!==n&&this.attributes.delete(n),t.removeEventListener("dispose",r)};t.addEventListener("dispose",r)}updateAttributes(e){const t=e.getAttributes();for(const e of t)e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute?this.updateAttribute(e,Ym):this.updateAttribute(e,Xm);const r=this.getIndex(e);null!==r&&this.updateAttribute(r,Km);const s=e.geometry.indirect;null!==s&&this.updateAttribute(s,Qm)}updateAttribute(e,t){const r=this.info.render.calls;e.isInterleavedBufferAttribute?void 0===this.attributeCall.get(e)?(this.attributes.update(e,t),this.attributeCall.set(e,r)):this.attributeCall.get(e.data)!==r&&(this.attributes.update(e,t),this.attributeCall.set(e.data,r),this.attributeCall.set(e,r)):this.attributeCall.get(e)!==r&&(this.attributes.update(e,t),this.attributeCall.set(e,r))}getIndirect(e){return e.geometry.indirect}getIndex(e){const{geometry:t,material:r}=e;let s=t.index;if(!0===r.wireframe){const e=this.wireframes;let r=e.get(t);void 0===r?(r=tf(t),e.set(t,r)):r.version!==ef(t)&&(this.attributes.delete(r),r=tf(t),e.set(t,r)),s=r}return s}}class sf{constructor(){this.autoReset=!0,this.frame=0,this.calls=0,this.render={calls:0,frameCalls:0,drawCalls:0,triangles:0,points:0,lines:0,timestamp:0},this.compute={calls:0,frameCalls:0,timestamp:0},this.memory={geometries:0,textures:0}}update(e,t,r){this.render.drawCalls++,e.isMesh||e.isSprite?this.render.triangles+=r*(t/3):e.isPoints?this.render.points+=r*t:e.isLineSegments?this.render.lines+=r*(t/2):e.isLine?this.render.lines+=r*(t-1):console.error("THREE.WebGPUInfo: Unknown object type.")}reset(){this.render.drawCalls=0,this.render.frameCalls=0,this.compute.frameCalls=0,this.render.triangles=0,this.render.points=0,this.render.lines=0}dispose(){this.reset(),this.calls=0,this.render.calls=0,this.compute.calls=0,this.render.timestamp=0,this.compute.timestamp=0,this.memory.geometries=0,this.memory.textures=0}}class nf{constructor(e){this.cacheKey=e,this.usedTimes=0}}class af extends nf{constructor(e,t,r){super(e),this.vertexProgram=t,this.fragmentProgram=r}}class of extends nf{constructor(e,t){super(e),this.computeProgram=t,this.isComputePipeline=!0}}let uf=0;class lf{constructor(e,t,r,s=null,i=null){this.id=uf++,this.code=e,this.stage=t,this.name=r,this.transforms=s,this.attributes=i,this.usedTimes=0}}class df extends qm{constructor(e,t){super(),this.backend=e,this.nodes=t,this.bindings=null,this.caches=new Map,this.programs={vertex:new Map,fragment:new Map,compute:new Map}}getForCompute(e,t){const{backend:r}=this,s=this.get(e);if(this._needsComputeUpdate(e)){const i=s.pipeline;i&&(i.usedTimes--,i.computeProgram.usedTimes--);const n=this.nodes.getForCompute(e);let a=this.programs.compute.get(n.computeShader);void 0===a&&(i&&0===i.computeProgram.usedTimes&&this._releaseProgram(i.computeProgram),a=new lf(n.computeShader,"compute",e.name,n.transforms,n.nodeAttributes),this.programs.compute.set(n.computeShader,a),r.createProgram(a));const o=this._getComputeCacheKey(e,a);let u=this.caches.get(o);void 0===u&&(i&&0===i.usedTimes&&this._releasePipeline(i),u=this._getComputePipeline(e,a,o,t)),u.usedTimes++,a.usedTimes++,s.version=e.version,s.pipeline=u}return s.pipeline}getForRender(e,t=null){const{backend:r}=this,s=this.get(e);if(this._needsRenderUpdate(e)){const i=s.pipeline;i&&(i.usedTimes--,i.vertexProgram.usedTimes--,i.fragmentProgram.usedTimes--);const n=e.getNodeBuilderState(),a=e.material?e.material.name:"";let o=this.programs.vertex.get(n.vertexShader);void 0===o&&(i&&0===i.vertexProgram.usedTimes&&this._releaseProgram(i.vertexProgram),o=new lf(n.vertexShader,"vertex",a),this.programs.vertex.set(n.vertexShader,o),r.createProgram(o));let u=this.programs.fragment.get(n.fragmentShader);void 0===u&&(i&&0===i.fragmentProgram.usedTimes&&this._releaseProgram(i.fragmentProgram),u=new lf(n.fragmentShader,"fragment",a),this.programs.fragment.set(n.fragmentShader,u),r.createProgram(u));const l=this._getRenderCacheKey(e,o,u);let d=this.caches.get(l);void 0===d?(i&&0===i.usedTimes&&this._releasePipeline(i),d=this._getRenderPipeline(e,o,u,l,t)):e.pipeline=d,d.usedTimes++,o.usedTimes++,u.usedTimes++,s.pipeline=d}return s.pipeline}delete(e){const t=this.get(e).pipeline;return t&&(t.usedTimes--,0===t.usedTimes&&this._releasePipeline(t),t.isComputePipeline?(t.computeProgram.usedTimes--,0===t.computeProgram.usedTimes&&this._releaseProgram(t.computeProgram)):(t.fragmentProgram.usedTimes--,t.vertexProgram.usedTimes--,0===t.vertexProgram.usedTimes&&this._releaseProgram(t.vertexProgram),0===t.fragmentProgram.usedTimes&&this._releaseProgram(t.fragmentProgram))),super.delete(e)}dispose(){super.dispose(),this.caches=new Map,this.programs={vertex:new Map,fragment:new Map,compute:new Map}}updateForRender(e){this.getForRender(e)}_getComputePipeline(e,t,r,s){r=r||this._getComputeCacheKey(e,t);let i=this.caches.get(r);return void 0===i&&(i=new of(r,t),this.caches.set(r,i),this.backend.createComputePipeline(i,s)),i}_getRenderPipeline(e,t,r,s,i){s=s||this._getRenderCacheKey(e,t,r);let n=this.caches.get(s);return void 0===n&&(n=new af(s,t,r),this.caches.set(s,n),e.pipeline=n,this.backend.createRenderPipeline(e,i)),n}_getComputeCacheKey(e,t){return e.id+","+t.id}_getRenderCacheKey(e,t,r){return t.id+","+r.id+","+this.backend.getRenderCacheKey(e)}_releasePipeline(e){this.caches.delete(e.cacheKey)}_releaseProgram(e){const t=e.code,r=e.stage;this.programs[r].delete(t)}_needsComputeUpdate(e){const t=this.get(e);return void 0===t.pipeline||t.version!==e.version}_needsRenderUpdate(e){return void 0===this.get(e).pipeline||this.backend.needsRenderUpdate(e)}}class cf extends qm{constructor(e,t,r,s,i,n){super(),this.backend=e,this.textures=r,this.pipelines=i,this.attributes=s,this.nodes=t,this.info=n,this.pipelines.bindings=this}getForRender(e){const t=e.getBindings();for(const e of t){const r=this.get(e);void 0===r.bindGroup&&(this._init(e),this.backend.createBindings(e,t,0),r.bindGroup=e)}return t}getForCompute(e){const t=this.nodes.getForCompute(e).bindings;for(const e of t){const r=this.get(e);void 0===r.bindGroup&&(this._init(e),this.backend.createBindings(e,t,0),r.bindGroup=e)}return t}updateForCompute(e){this._updateBindings(this.getForCompute(e))}updateForRender(e){this._updateBindings(this.getForRender(e))}_updateBindings(e){for(const t of e)this._update(t,e)}_init(e){for(const t of e.bindings)if(t.isSampledTexture)this.textures.updateTexture(t.texture);else if(t.isStorageBuffer){const e=t.attribute,r=e.isIndirectStorageBufferAttribute?Qm:Ym;this.attributes.update(e,r)}}_update(e,t){const{backend:r}=this;let s=!1,i=!0,n=0,a=0;for(const t of e.bindings){if(t.isNodeUniformsGroup){if(!1===this.nodes.updateGroup(t))continue}if(t.isStorageBuffer){const e=t.attribute,r=e.isIndirectStorageBufferAttribute?Qm:Ym;this.attributes.update(e,r)}if(t.isUniformBuffer){t.update()&&r.updateBinding(t)}else if(t.isSampler)t.update();else if(t.isSampledTexture){const e=this.textures.get(t.texture);t.needsBindingsUpdate(e.generation)&&(s=!0);const o=t.update(),u=t.texture;o&&this.textures.updateTexture(u);const l=r.get(u);if(void 0!==l.externalTexture||e.isDefaultTexture?i=!1:(n=10*n+u.id,a+=u.version),!0===r.isWebGPUBackend&&void 0===l.texture&&void 0===l.externalTexture&&(console.error("Bindings._update: binding should be available:",t,o,u,t.textureNode.value,s),this.textures.updateTexture(u),s=!0),!0===u.isStorageTexture){const e=this.get(u);!0===t.store?e.needsMipmap=!0:this.textures.needsMipmaps(u)&&!0===e.needsMipmap&&(this.backend.generateMipmaps(u),e.needsMipmap=!1)}}}!0===s&&this.backend.updateBindings(e,t,i?n:0,a)}}function hf(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?e.z-t.z:e.id-t.id}function pf(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function gf(e){return(e.transmission>0||e.transmissionNode)&&e.side===Se&&!1===e.forceSinglePass}class mf{constructor(e,t,r){this.renderItems=[],this.renderItemsIndex=0,this.opaque=[],this.transparentDoublePass=[],this.transparent=[],this.bundles=[],this.lightsNode=e.getNode(t,r),this.lightsArray=[],this.scene=t,this.camera=r,this.occlusionQueryCount=0}begin(){return this.renderItemsIndex=0,this.opaque.length=0,this.transparentDoublePass.length=0,this.transparent.length=0,this.bundles.length=0,this.lightsArray.length=0,this.occlusionQueryCount=0,this}getNextRenderItem(e,t,r,s,i,n,a){let o=this.renderItems[this.renderItemsIndex];return void 0===o?(o={id:e.id,object:e,geometry:t,material:r,groupOrder:s,renderOrder:e.renderOrder,z:i,group:n,clippingContext:a},this.renderItems[this.renderItemsIndex]=o):(o.id=e.id,o.object=e,o.geometry=t,o.material=r,o.groupOrder=s,o.renderOrder=e.renderOrder,o.z=i,o.group=n,o.clippingContext=a),this.renderItemsIndex++,o}push(e,t,r,s,i,n,a){const o=this.getNextRenderItem(e,t,r,s,i,n,a);!0===e.occlusionTest&&this.occlusionQueryCount++,!0===r.transparent||r.transmission>0?(gf(r)&&this.transparentDoublePass.push(o),this.transparent.push(o)):this.opaque.push(o)}unshift(e,t,r,s,i,n,a){const o=this.getNextRenderItem(e,t,r,s,i,n,a);!0===r.transparent||r.transmission>0?(gf(r)&&this.transparentDoublePass.unshift(o),this.transparent.unshift(o)):this.opaque.unshift(o)}pushBundle(e){this.bundles.push(e)}pushLight(e){this.lightsArray.push(e)}sort(e,t){this.opaque.length>1&&this.opaque.sort(e||hf),this.transparentDoublePass.length>1&&this.transparentDoublePass.sort(t||pf),this.transparent.length>1&&this.transparent.sort(t||pf)}finish(){this.lightsNode.setLights(this.lightsArray);for(let e=this.renderItemsIndex,t=this.renderItems.length;e>t,u=a.height>>t;let l=e.depthTexture||i[t];const d=!0===e.depthBuffer||!0===e.stencilBuffer;let c=!1;void 0===l&&d&&(l=new V,l.format=e.stencilBuffer?we:Ae,l.type=e.stencilBuffer?Re:T,l.image.width=o,l.image.height=u,l.image.depth=a.depth,l.isArrayTexture=!0===e.multiview&&a.depth>1,i[t]=l),r.width===a.width&&a.height===r.height||(c=!0,l&&(l.needsUpdate=!0,l.image.width=o,l.image.height=u,l.image.depth=l.isArrayTexture?l.image.depth:1)),r.width=a.width,r.height=a.height,r.textures=n,r.depthTexture=l||null,r.depth=e.depthBuffer,r.stencil=e.stencilBuffer,r.renderTarget=e,r.sampleCount!==s&&(c=!0,l&&(l.needsUpdate=!0),r.sampleCount=s);const h={sampleCount:s};if(!0!==e.isXRRenderTarget){for(let e=0;e{e.removeEventListener("dispose",t);for(let e=0;e0){const s=e.image;if(void 0===s)console.warn("THREE.Renderer: Texture marked for update but image is undefined.");else if(!1===s.complete)console.warn("THREE.Renderer: Texture marked for update but image is incomplete.");else{if(e.images){const r=[];for(const t of e.images)r.push(t);t.images=r}else t.image=s;void 0!==r.isDefaultTexture&&!0!==r.isDefaultTexture||(i.createTexture(e,t),r.isDefaultTexture=!1,r.generation=e.version),!0===e.source.dataReady&&i.updateTexture(e,t),t.needsMipmaps&&0===e.mipmaps.length&&i.generateMipmaps(e)}}else i.createDefaultTexture(e),r.isDefaultTexture=!0,r.generation=e.version}if(!0!==r.initialized){r.initialized=!0,r.generation=e.version,this.info.memory.textures++;const t=()=>{e.removeEventListener("dispose",t),this._destroyTexture(e)};e.addEventListener("dispose",t)}r.version=e.version}getSize(e,t=Ef){let r=e.images?e.images[0]:e.image;return r?(void 0!==r.image&&(r=r.image),t.width=r.width||1,t.height=r.height||1,t.depth=e.isCubeTexture?6:r.depth||1):t.width=t.height=t.depth=1,t}getMipLevels(e,t,r){let s;return s=e.isCompressedTexture?e.mipmaps?e.mipmaps.length:1:Math.floor(Math.log2(Math.max(t,r)))+1,s}needsMipmaps(e){return!0===e.isCompressedTexture||e.generateMipmaps}_destroyTexture(e){!0===this.has(e)&&(this.backend.destroySampler(e),this.backend.destroyTexture(e),this.delete(e),this.info.memory.textures--)}}class Af extends e{constructor(e,t,r,s=1){super(e,t,r),this.a=s}set(e,t,r,s=1){return this.a=s,super.set(e,t,r)}copy(e){return void 0!==e.a&&(this.a=e.a),super.copy(e)}clone(){return new this.constructor(this.r,this.g,this.b,this.a)}}class Rf extends gn{static get type(){return"ParameterNode"}constructor(e,t=null){super(e,t),this.isParameterNode=!0}getHash(){return this.uuid}generate(){return this.name}}class Cf extends js{static get type(){return"StackNode"}constructor(e=null){super(),this.nodes=[],this.outputNode=null,this.parent=e,this._currentCond=null,this._expressionNode=null,this.isStackNode=!0}getNodeType(e){return this.outputNode?this.outputNode.getNodeType(e):"void"}getMemberType(e,t){return this.outputNode?this.outputNode.getMemberType(e,t):"void"}add(e){return this.nodes.push(e),this}If(e,t){const r=new Fi(t);return this._currentCond=Xo(e,r),this.add(this._currentCond)}ElseIf(e,t){const r=new Fi(t),s=Xo(e,r);return this._currentCond.elseNode=s,this._currentCond=s,this}Else(e){return this._currentCond.elseNode=new Fi(e),this}Switch(e){return this._expressionNode=Bi(e),this}Case(...e){const t=[];if(!(e.length>=2))throw new Error("TSL: Invalid parameter length. Case() requires at least two parameters.");for(let r=0;r"string"==typeof t?{name:e,type:t,atomic:!1}:{name:e,type:t.type,atomic:t.atomic||!1}))),this.name=t,this.isStructLayoutNode=!0}getLength(){const e=Float32Array.BYTES_PER_ELEMENT;let t=0;for(const r of this.membersLayout){const s=r.type,i=Rs(s)*e,n=t%8,a=n%Cs(s),o=n+a;t+=a,0!==o&&8-oe.name===t));return r?r.type:"void"}getNodeType(e){return e.getStructTypeFromNode(this,this.membersLayout,this.name).name}setup(e){e.addInclude(this)}generate(e){return this.getNodeType(e)}}class Lf extends js{static get type(){return"StructNode"}constructor(e,t){super("vec3"),this.structLayoutNode=e,this.values=t,this.isStructNode=!0}getNodeType(e){return this.structLayoutNode.getNodeType(e)}getMemberType(e,t){return this.structLayoutNode.getMemberType(e,t)}generate(e){const t=e.getVarFromNode(this),r=t.type,s=e.getPropertyName(t);return e.addLineFlowCode(`${s} = ${e.generateStruct(r,this.structLayoutNode.membersLayout,this.values)}`,this),t.name}}class Ff extends js{static get type(){return"OutputStructNode"}constructor(...e){super(),this.members=e,this.isOutputStructNode=!0}getNodeType(e){const t=e.getNodeProperties(this);if(void 0===t.membersLayout){const r=this.members,s=[];for(let t=0;t{const t=e.toUint().mul(747796405).add(2891336453),r=t.shiftRight(t.shiftRight(28).add(4)).bitXor(t).mul(277803737);return r.shiftRight(22).bitXor(r).toFloat().mul(1/2**32)})),Of=(e,t)=>Ro(la(4,e.mul(ua(1,e))),t),kf=ki((([e])=>e.fract().sub(.5).abs())).setLayout({name:"tri",type:"float",inputs:[{name:"x",type:"float"}]}),Gf=ki((([e])=>en(kf(e.z.add(kf(e.y.mul(1)))),kf(e.z.add(kf(e.x.mul(1)))),kf(e.y.add(kf(e.x.mul(1))))))).setLayout({name:"tri3",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),zf=ki((([e,t,r])=>{const s=en(e).toVar(),i=ji(1.4).toVar(),n=ji(0).toVar(),a=en(s).toVar();return Zc({start:ji(0),end:ji(3),type:"float",condition:"<="},(()=>{const e=en(Gf(a.mul(2))).toVar();s.addAssign(e.add(r.mul(ji(.1).mul(t)))),a.mulAssign(1.8),i.mulAssign(1.5),s.mulAssign(1.2);const o=ji(kf(s.z.add(kf(s.x.add(kf(s.y)))))).toVar();n.addAssign(o.div(i)),a.addAssign(.14)})),n})).setLayout({name:"triNoise3D",type:"float",inputs:[{name:"position",type:"vec3"},{name:"speed",type:"float"},{name:"time",type:"float"}]});class Hf extends js{static get type(){return"FunctionOverloadingNode"}constructor(e=[],...t){super(),this.functionNodes=e,this.parametersNodes=t,this._candidateFnCall=null,this.global=!0}getNodeType(){return this.functionNodes[0].shaderNode.layout.type}setup(e){const t=this.parametersNodes;let r=this._candidateFnCall;if(null===r){let s=null,i=-1;for(const r of this.functionNodes){const n=r.shaderNode.layout;if(null===n)throw new Error("FunctionOverloadingNode: FunctionNode must be a layout.");const a=n.inputs;if(t.length===a.length){let n=0;for(let r=0;ri&&(s=r,i=n)}}this._candidateFnCall=r=s(...t)}return r}}const $f=Vi(Hf),Wf=e=>(...t)=>$f(e,...t),jf=Zn(0).setGroup(Kn).onRenderUpdate((e=>e.time)),qf=Zn(0).setGroup(Kn).onRenderUpdate((e=>e.deltaTime)),Xf=Zn(0,"uint").setGroup(Kn).onRenderUpdate((e=>e.frameId)),Kf=ki((([e,t,r=Yi(.5)])=>Rm(e.sub(r),t).add(r))),Yf=ki((([e,t,r=Yi(.5)])=>{const s=e.sub(r),i=s.dot(s),n=i.mul(i).mul(t);return e.add(s.mul(n))})),Qf=ki((({position:e=null,horizontal:t=!0,vertical:r=!1})=>{let s;null!==e?(s=El.toVar(),s[3][0]=e.x,s[3][1]=e.y,s[3][2]=e.z):s=El;const i=cl.mul(s);return Pi(t)&&(i[0][0]=El[0].length(),i[0][1]=0,i[0][2]=0),Pi(r)&&(i[1][0]=0,i[1][1]=El[1].length(),i[1][2]=0),i[2][0]=0,i[2][1]=0,i[2][2]=1,ll.mul(i).mul(Vl)})),Zf=ki((([e=null])=>{const t=Vh();return Vh(Ch(e)).sub(t).lessThan(0).select(ph,e)}));class Jf extends js{static get type(){return"SpriteSheetUVNode"}constructor(e,t=$u(),r=ji(0)){super("vec2"),this.countNode=e,this.uvNode=t,this.frameNode=r}setup(){const{frameNode:e,uvNode:t,countNode:r}=this,{width:s,height:i}=r,n=e.mod(s.mul(i)).floor(),a=n.mod(s),o=i.sub(n.add(1).div(s).ceil()),u=r.reciprocal(),l=Yi(a,o);return t.add(l).mul(u)}}const ey=Vi(Jf).setParameterLength(3);class ty extends js{static get type(){return"TriplanarTexturesNode"}constructor(e,t=null,r=null,s=ji(1),i=Vl,n=ql){super("vec4"),this.textureXNode=e,this.textureYNode=t,this.textureZNode=r,this.scaleNode=s,this.positionNode=i,this.normalNode=n}setup(){const{textureXNode:e,textureYNode:t,textureZNode:r,scaleNode:s,positionNode:i,normalNode:n}=this;let a=n.abs().normalize();a=a.div(a.dot(en(1)));const o=i.yz.mul(s),u=i.zx.mul(s),l=i.xy.mul(s),d=e.value,c=null!==t?t.value:d,h=null!==r?r.value:d,p=Zu(d,o).mul(a.x),g=Zu(c,u).mul(a.y),m=Zu(h,l).mul(a.z);return oa(p,g,m)}}const ry=Vi(ty).setParameterLength(1,6),sy=new Me,iy=new r,ny=new r,ay=new r,oy=new a,uy=new r(0,0,-1),ly=new s,dy=new r,cy=new r,hy=new s,py=new t,gy=new oe,my=ph.flipX();gy.depthTexture=new V(1,1);let fy=!1;class yy extends Yu{static get type(){return"ReflectorNode"}constructor(e={}){super(e.defaultTexture||gy.texture,my),this._reflectorBaseNode=e.reflector||new xy(this,e),this._depthNode=null,this.setUpdateMatrix(!1)}get reflector(){return this._reflectorBaseNode}get target(){return this._reflectorBaseNode.target}getDepthNode(){if(null===this._depthNode){if(!0!==this._reflectorBaseNode.depth)throw new Error("THREE.ReflectorNode: Depth node can only be requested when the reflector is created with { depth: true }. ");this._depthNode=Bi(new yy({defaultTexture:gy.depthTexture,reflector:this._reflectorBaseNode}))}return this._depthNode}setup(e){return e.object.isQuadMesh||this._reflectorBaseNode.build(e),super.setup(e)}clone(){const e=new this.constructor(this.reflectorNode);return e._reflectorBaseNode=this._reflectorBaseNode,e}dispose(){super.dispose(),this._reflectorBaseNode.dispose()}}class xy extends js{static get type(){return"ReflectorBaseNode"}constructor(e,t={}){super();const{target:r=new Pe,resolution:s=1,generateMipmaps:i=!1,bounces:n=!0,depth:a=!1}=t;this.textureNode=e,this.target=r,this.resolution=s,this.generateMipmaps=i,this.bounces=n,this.depth=a,this.updateBeforeType=n?Vs.RENDER:Vs.FRAME,this.virtualCameras=new WeakMap,this.renderTargets=new Map,this.forceUpdate=!1,this.hasOutput=!1}_updateResolution(e,t){const r=this.resolution;t.getDrawingBufferSize(py),e.setSize(Math.round(py.width*r),Math.round(py.height*r))}setup(e){return this._updateResolution(gy,e.renderer),super.setup(e)}dispose(){super.dispose();for(const e of this.renderTargets.values())e.dispose()}getVirtualCamera(e){let t=this.virtualCameras.get(e);return void 0===t&&(t=e.clone(),this.virtualCameras.set(e,t)),t}getRenderTarget(e){let t=this.renderTargets.get(e);return void 0===t&&(t=new oe(0,0,{type:de}),!0===this.generateMipmaps&&(t.texture.minFilter=Le,t.texture.generateMipmaps=!0),!0===this.depth&&(t.depthTexture=new V),this.renderTargets.set(e,t)),t}updateBefore(e){if(!1===this.bounces&&fy)return!1;fy=!0;const{scene:t,camera:r,renderer:s,material:i}=e,{target:n}=this,a=this.getVirtualCamera(r),o=this.getRenderTarget(a);s.getDrawingBufferSize(py),this._updateResolution(o,s),ny.setFromMatrixPosition(n.matrixWorld),ay.setFromMatrixPosition(r.matrixWorld),oy.extractRotation(n.matrixWorld),iy.set(0,0,1),iy.applyMatrix4(oy),dy.subVectors(ny,ay);let u=!1;if(!0===dy.dot(iy)>0&&!1===this.forceUpdate){if(!1===this.hasOutput)return void(fy=!1);u=!0}dy.reflect(iy).negate(),dy.add(ny),oy.extractRotation(r.matrixWorld),uy.set(0,0,-1),uy.applyMatrix4(oy),uy.add(ay),cy.subVectors(ny,uy),cy.reflect(iy).negate(),cy.add(ny),a.coordinateSystem=r.coordinateSystem,a.position.copy(dy),a.up.set(0,1,0),a.up.applyMatrix4(oy),a.up.reflect(iy),a.lookAt(cy),a.near=r.near,a.far=r.far,a.updateMatrixWorld(),a.projectionMatrix.copy(r.projectionMatrix),sy.setFromNormalAndCoplanarPoint(iy,ny),sy.applyMatrix4(a.matrixWorldInverse),ly.set(sy.normal.x,sy.normal.y,sy.normal.z,sy.constant);const l=a.projectionMatrix;hy.x=(Math.sign(ly.x)+l.elements[8])/l.elements[0],hy.y=(Math.sign(ly.y)+l.elements[9])/l.elements[5],hy.z=-1,hy.w=(1+l.elements[10])/l.elements[14],ly.multiplyScalar(1/ly.dot(hy));l.elements[2]=ly.x,l.elements[6]=ly.y,l.elements[10]=s.coordinateSystem===d?ly.z-0:ly.z+1-0,l.elements[14]=ly.w,this.textureNode.value=o.texture,!0===this.depth&&(this.textureNode.getDepthNode().value=o.depthTexture),i.visible=!1;const c=s.getRenderTarget(),h=s.getMRT(),p=s.autoClear;s.setMRT(null),s.setRenderTarget(o),s.autoClear=!0,u?(s.clear(),this.hasOutput=!1):(s.render(t,a),this.hasOutput=!0),s.setMRT(h),s.setRenderTarget(c),s.autoClear=p,i.visible=!0,fy=!1,this.forceUpdate=!1}}const by=new ne(-1,1,1,-1,0,1);class Ty extends he{constructor(e=!1){super();const t=!1===e?[0,-1,0,1,2,1]:[0,2,0,0,2,0];this.setAttribute("position",new Fe([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Fe(t,2))}}const _y=new Ty;class vy extends q{constructor(e=null){super(_y,e),this.camera=by,this.isQuadMesh=!0}async renderAsync(e){return e.renderAsync(this,by)}render(e){e.render(this,by)}}const Ny=new t;class Sy extends Yu{static get type(){return"RTTNode"}constructor(e,t=null,r=null,s={type:de}){const i=new oe(t,r,s);super(i.texture,$u()),this.node=e,this.width=t,this.height=r,this.pixelRatio=1,this.renderTarget=i,this.textureNeedsUpdate=!0,this.autoUpdate=!0,this._rttNode=null,this._quadMesh=new vy(new Wh),this.updateBeforeType=Vs.RENDER}get autoSize(){return null===this.width}setup(e){return this._rttNode=this.node.context(e.getSharedContext()),this._quadMesh.material.name="RTT",this._quadMesh.material.needsUpdate=!0,super.setup(e)}setSize(e,t){this.width=e,this.height=t;const r=e*this.pixelRatio,s=t*this.pixelRatio;this.renderTarget.setSize(r,s),this.textureNeedsUpdate=!0}setPixelRatio(e){this.pixelRatio=e,this.setSize(this.width,this.height)}updateBefore({renderer:e}){if(!1===this.textureNeedsUpdate&&!1===this.autoUpdate)return;if(this.textureNeedsUpdate=!1,!0===this.autoSize){this.pixelRatio=e.getPixelRatio();const t=e.getSize(Ny);this.setSize(t.width,t.height)}this._quadMesh.material.fragmentNode=this._rttNode;const t=e.getRenderTarget();e.setRenderTarget(this.renderTarget),this._quadMesh.render(e),e.setRenderTarget(t)}clone(){const e=new Yu(this.value,this.uvNode,this.levelNode);return e.sampler=this.sampler,e.referenceNode=this,e}}const Ey=(e,...t)=>Bi(new Sy(Bi(e),...t)),wy=ki((([e,t,r],s)=>{let i;s.renderer.coordinateSystem===d?(e=Yi(e.x,e.y.oneMinus()).mul(2).sub(1),i=nn(en(e,t),1)):i=nn(en(e.x,e.y.oneMinus(),t).mul(2).sub(1),1);const n=nn(r.mul(i));return n.xyz.div(n.w)})),Ay=ki((([e,t])=>{const r=t.mul(nn(e,1)),s=r.xy.div(r.w).mul(.5).add(.5).toVar();return Yi(s.x,s.y.oneMinus())})),Ry=ki((([e,t,r])=>{const s=ju(Ju(t)),i=Qi(e.mul(s)).toVar(),n=Ju(t,i).toVar(),a=Ju(t,i.sub(Qi(2,0))).toVar(),o=Ju(t,i.sub(Qi(1,0))).toVar(),u=Ju(t,i.add(Qi(1,0))).toVar(),l=Ju(t,i.add(Qi(2,0))).toVar(),d=Ju(t,i.add(Qi(0,2))).toVar(),c=Ju(t,i.add(Qi(0,1))).toVar(),h=Ju(t,i.sub(Qi(0,1))).toVar(),p=Ju(t,i.sub(Qi(0,2))).toVar(),g=no(ua(ji(2).mul(o).sub(a),n)).toVar(),m=no(ua(ji(2).mul(u).sub(l),n)).toVar(),f=no(ua(ji(2).mul(c).sub(d),n)).toVar(),y=no(ua(ji(2).mul(h).sub(p),n)).toVar(),x=wy(e,n,r).toVar(),b=g.lessThan(m).select(x.sub(wy(e.sub(Yi(ji(1).div(s.x),0)),o,r)),x.negate().add(wy(e.add(Yi(ji(1).div(s.x),0)),u,r))),T=f.lessThan(y).select(x.sub(wy(e.add(Yi(0,ji(1).div(s.y))),c,r)),x.negate().add(wy(e.sub(Yi(0,ji(1).div(s.y))),h,r)));return Qa(Ao(b,T))}));class Cy extends L{constructor(e,t,r=Float32Array){super(ArrayBuffer.isView(e)?e:new r(e*t),t),this.isStorageInstancedBufferAttribute=!0}}class My extends pe{constructor(e,t,r=Float32Array){super(ArrayBuffer.isView(e)?e:new r(e*t),t),this.isStorageBufferAttribute=!0}}class Py extends js{static get type(){return"PointUVNode"}constructor(){super("vec2"),this.isPointUVNode=!0}generate(){return"vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y )"}}const Ly=Ui(Py),Fy=new E,By=new a;class Iy extends js{static get type(){return"SceneNode"}constructor(e=Iy.BACKGROUND_BLURRINESS,t=null){super(),this.scope=e,this.scene=t}setup(e){const t=this.scope,r=null!==this.scene?this.scene:e.scene;let s;return t===Iy.BACKGROUND_BLURRINESS?s=yd("backgroundBlurriness","float",r):t===Iy.BACKGROUND_INTENSITY?s=yd("backgroundIntensity","float",r):t===Iy.BACKGROUND_ROTATION?s=Zn("mat4").label("backgroundRotation").setGroup(Kn).onRenderUpdate((()=>{const e=r.background;return null!==e&&e.isTexture&&e.mapping!==Be?(Fy.copy(r.backgroundRotation),Fy.x*=-1,Fy.y*=-1,Fy.z*=-1,By.makeRotationFromEuler(Fy)):By.identity(),By})):console.error("THREE.SceneNode: Unknown scope:",t),s}}Iy.BACKGROUND_BLURRINESS="backgroundBlurriness",Iy.BACKGROUND_INTENSITY="backgroundIntensity",Iy.BACKGROUND_ROTATION="backgroundRotation";const Dy=Ui(Iy,Iy.BACKGROUND_BLURRINESS),Vy=Ui(Iy,Iy.BACKGROUND_INTENSITY),Uy=Ui(Iy,Iy.BACKGROUND_ROTATION);class Oy extends Yu{static get type(){return"StorageTextureNode"}constructor(e,t,r=null){super(e,t),this.storeNode=r,this.isStorageTextureNode=!0,this.access=Os.WRITE_ONLY}getInputType(){return"storageTexture"}setup(e){super.setup(e);const t=e.getNodeProperties(this);return t.storeNode=this.storeNode,t}setAccess(e){return this.access=e,this}generate(e,t){let r;return r=null!==this.storeNode?this.generateStore(e):super.generate(e,t),r}toReadWrite(){return this.setAccess(Os.READ_WRITE)}toReadOnly(){return this.setAccess(Os.READ_ONLY)}toWriteOnly(){return this.setAccess(Os.WRITE_ONLY)}generateStore(e){const t=e.getNodeProperties(this),{uvNode:r,storeNode:s,depthNode:i}=t,n=super.generate(e,"property"),a=r.build(e,"uvec2"),o=s.build(e,"vec4"),u=i?i.build(e,"int"):null,l=e.generateTextureStore(e,n,a,u,o);e.addLineFlowCode(l,this)}clone(){const e=super.clone();return e.storeNode=this.storeNode,e}}const ky=Vi(Oy).setParameterLength(1,3),Gy=ki((({texture:e,uv:t})=>{const r=1e-4,s=en().toVar();return Hi(t.x.lessThan(r),(()=>{s.assign(en(1,0,0))})).ElseIf(t.y.lessThan(r),(()=>{s.assign(en(0,1,0))})).ElseIf(t.z.lessThan(r),(()=>{s.assign(en(0,0,1))})).ElseIf(t.x.greaterThan(.9999),(()=>{s.assign(en(-1,0,0))})).ElseIf(t.y.greaterThan(.9999),(()=>{s.assign(en(0,-1,0))})).ElseIf(t.z.greaterThan(.9999),(()=>{s.assign(en(0,0,-1))})).Else((()=>{const r=.01,i=e.sample(t.add(en(-.01,0,0))).r.sub(e.sample(t.add(en(r,0,0))).r),n=e.sample(t.add(en(0,-.01,0))).r.sub(e.sample(t.add(en(0,r,0))).r),a=e.sample(t.add(en(0,0,-.01))).r.sub(e.sample(t.add(en(0,0,r))).r);s.assign(en(i,n,a))})),s.normalize()}));class zy extends Yu{static get type(){return"Texture3DNode"}constructor(e,t=null,r=null){super(e,t,r),this.isTexture3DNode=!0}getInputType(){return"texture3D"}getDefaultUV(){return en(.5,.5,.5)}setUpdateMatrix(){}setupUV(e,t){const r=this.value;return!e.isFlipY()||!0!==r.isRenderTargetTexture&&!0!==r.isFramebufferTexture||(t=this.sampler?t.flipY():t.setY(qi(ju(this,this.levelNode).y).sub(t.y).sub(1))),t}generateUV(e,t){return t.build(e,"vec3")}normal(e){return Gy({texture:this,uv:e})}}const Hy=Vi(zy).setParameterLength(1,3);class $y extends fd{static get type(){return"UserDataNode"}constructor(e,t,r=null){super(e,t,r),this.userData=r}updateReference(e){return this.reference=null!==this.userData?this.userData:e.object.userData,this.reference}}const Wy=new WeakMap;class jy extends Ks{static get type(){return"VelocityNode"}constructor(){super("vec2"),this.projectionMatrix=null,this.updateType=Vs.OBJECT,this.updateAfterType=Vs.OBJECT,this.previousModelWorldMatrix=Zn(new a),this.previousProjectionMatrix=Zn(new a).setGroup(Kn),this.previousCameraViewMatrix=Zn(new a)}setProjectionMatrix(e){this.projectionMatrix=e}update({frameId:e,camera:t,object:r}){const s=Xy(r);this.previousModelWorldMatrix.value.copy(s);const i=qy(t);i.frameId!==e&&(i.frameId=e,void 0===i.previousProjectionMatrix?(i.previousProjectionMatrix=new a,i.previousCameraViewMatrix=new a,i.currentProjectionMatrix=new a,i.currentCameraViewMatrix=new a,i.previousProjectionMatrix.copy(this.projectionMatrix||t.projectionMatrix),i.previousCameraViewMatrix.copy(t.matrixWorldInverse)):(i.previousProjectionMatrix.copy(i.currentProjectionMatrix),i.previousCameraViewMatrix.copy(i.currentCameraViewMatrix)),i.currentProjectionMatrix.copy(this.projectionMatrix||t.projectionMatrix),i.currentCameraViewMatrix.copy(t.matrixWorldInverse),this.previousProjectionMatrix.value.copy(i.previousProjectionMatrix),this.previousCameraViewMatrix.value.copy(i.previousCameraViewMatrix))}updateAfter({object:e}){Xy(e).copy(e.matrixWorld)}setup(){const e=null===this.projectionMatrix?ll:Zn(this.projectionMatrix),t=this.previousCameraViewMatrix.mul(this.previousModelWorldMatrix),r=e.mul(Ll).mul(Vl),s=this.previousProjectionMatrix.mul(t).mul(Ul),i=r.xy.div(r.w),n=s.xy.div(s.w);return ua(i,n)}}function qy(e){let t=Wy.get(e);return void 0===t&&(t={},Wy.set(e,t)),t}function Xy(e,t=0){const r=qy(e);let s=r[t];return void 0===s&&(r[t]=s=new a,r[t].copy(e.matrixWorld)),s}const Ky=Ui(jy),Yy=ki((([e,t])=>To(1,e.oneMinus().div(t)).oneMinus())).setLayout({name:"blendBurn",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),Qy=ki((([e,t])=>To(e.div(t.oneMinus()),1))).setLayout({name:"blendDodge",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),Zy=ki((([e,t])=>e.oneMinus().mul(t.oneMinus()).oneMinus())).setLayout({name:"blendScreen",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),Jy=ki((([e,t])=>Io(e.mul(2).mul(t),e.oneMinus().mul(2).mul(t.oneMinus()).oneMinus(),vo(.5,e)))).setLayout({name:"blendOverlay",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),ex=ki((([e,t])=>{const r=t.a.add(e.a.mul(t.a.oneMinus()));return nn(t.rgb.mul(t.a).add(e.rgb.mul(e.a).mul(t.a.oneMinus())).div(r),r)})).setLayout({name:"blendColor",type:"vec4",inputs:[{name:"base",type:"vec4"},{name:"blend",type:"vec4"}]}),tx=ki((([e])=>nn(e.rgb.mul(e.a),e.a)),{color:"vec4",return:"vec4"}),rx=ki((([e])=>(Hi(e.a.equal(0),(()=>nn(0))),nn(e.rgb.div(e.a),e.a))),{color:"vec4",return:"vec4"}),sx=ki((([e])=>ox(e.rgb))),ix=ki((([e,t=ji(1)])=>t.mix(ox(e.rgb),e.rgb))),nx=ki((([e,t=ji(1)])=>{const r=oa(e.r,e.g,e.b).div(3),s=e.r.max(e.g.max(e.b)),i=s.sub(r).mul(t).mul(-3);return Io(e.rgb,s,i)})),ax=ki((([e,t=ji(1)])=>{const r=en(.57735,.57735,.57735),s=t.cos();return en(e.rgb.mul(s).add(r.cross(e.rgb).mul(t.sin()).add(r.mul(wo(r,e.rgb).mul(s.oneMinus())))))})),ox=(e,t=en(c.getLuminanceCoefficients(new r)))=>wo(e,t),ux=ki((([e,t=en(1),s=en(0),i=en(1),n=ji(1),a=en(c.getLuminanceCoefficients(new r,ue))])=>{const o=e.rgb.dot(en(a)),u=_o(e.rgb.mul(t).add(s),0).toVar(),l=u.pow(i).toVar();return Hi(u.r.greaterThan(0),(()=>{u.r.assign(l.r)})),Hi(u.g.greaterThan(0),(()=>{u.g.assign(l.g)})),Hi(u.b.greaterThan(0),(()=>{u.b.assign(l.b)})),u.assign(o.add(u.sub(o).mul(n))),nn(u.rgb,e.a)}));class lx extends Ks{static get type(){return"PosterizeNode"}constructor(e,t){super(),this.sourceNode=e,this.stepsNode=t}setup(){const{sourceNode:e,stepsNode:t}=this;return e.mul(t).floor().div(t)}}const dx=Vi(lx).setParameterLength(2),cx=new t;class hx extends Yu{static get type(){return"PassTextureNode"}constructor(e,t){super(t),this.passNode=e,this.setUpdateMatrix(!1)}setup(e){return e.object.isQuadMesh&&this.passNode.build(e),super.setup(e)}clone(){return new this.constructor(this.passNode,this.value)}}class px extends hx{static get type(){return"PassMultipleTextureNode"}constructor(e,t,r=!1){super(e,null),this.textureName=t,this.previousTexture=r}updateTexture(){this.value=this.previousTexture?this.passNode.getPreviousTexture(this.textureName):this.passNode.getTexture(this.textureName)}setup(e){return this.updateTexture(),super.setup(e)}clone(){return new this.constructor(this.passNode,this.textureName,this.previousTexture)}}class gx extends Ks{static get type(){return"PassNode"}constructor(e,t,r,s={}){super("vec4"),this.scope=e,this.scene=t,this.camera=r,this.options=s,this._pixelRatio=1,this._width=1,this._height=1;const i=new V;i.isRenderTargetTexture=!0,i.name="depth";const n=new oe(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:de,...s});n.texture.name="output",n.depthTexture=i,this.renderTarget=n,this._textures={output:n.texture,depth:i},this._textureNodes={},this._linearDepthNodes={},this._viewZNodes={},this._previousTextures={},this._previousTextureNodes={},this._cameraNear=Zn(0),this._cameraFar=Zn(0),this._mrt=null,this._layers=null,this._resolution=1,this.isPassNode=!0,this.updateBeforeType=Vs.FRAME,this.global=!0}setResolution(e){return this._resolution=e,this}getResolution(){return this._resolution}setLayers(e){return this._layers=e,this}getLayers(){return this._layers}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}getTexture(e){let t=this._textures[e];if(void 0===t){t=this.renderTarget.texture.clone(),t.name=e,this._textures[e]=t,this.renderTarget.textures.push(t)}return t}getPreviousTexture(e){let t=this._previousTextures[e];return void 0===t&&(t=this.getTexture(e).clone(),this._previousTextures[e]=t),t}toggleTexture(e){const t=this._previousTextures[e];if(void 0!==t){const r=this._textures[e],s=this.renderTarget.textures.indexOf(r);this.renderTarget.textures[s]=t,this._textures[e]=t,this._previousTextures[e]=r,this._textureNodes[e].updateTexture(),this._previousTextureNodes[e].updateTexture()}}getTextureNode(e="output"){let t=this._textureNodes[e];return void 0===t&&(t=Bi(new px(this,e)),t.updateTexture(),this._textureNodes[e]=t),t}getPreviousTextureNode(e="output"){let t=this._previousTextureNodes[e];return void 0===t&&(void 0===this._textureNodes[e]&&this.getTextureNode(e),t=Bi(new px(this,e,!0)),t.updateTexture(),this._previousTextureNodes[e]=t),t}getViewZNode(e="depth"){let t=this._viewZNodes[e];if(void 0===t){const r=this._cameraNear,s=this._cameraFar;this._viewZNodes[e]=t=Fh(this.getTextureNode(e),r,s)}return t}getLinearDepthNode(e="depth"){let t=this._linearDepthNodes[e];if(void 0===t){const r=this._cameraNear,s=this._cameraFar,i=this.getViewZNode(e);this._linearDepthNodes[e]=t=Ph(i,r,s)}return t}setup({renderer:e}){return this.renderTarget.samples=void 0===this.options.samples?e.samples:this.options.samples,this.renderTarget.texture.type=e.getColorBufferType(),this.scope===gx.COLOR?this.getTextureNode():this.getLinearDepthNode()}updateBefore(e){const{renderer:t}=e,{scene:r}=this;let s,i;const n=t.getOutputRenderTarget();n&&!0===n.isXRRenderTarget?(i=1,s=t.xr.getCamera(),t.xr.updateCamera(s),cx.set(n.width,n.height)):(s=this.camera,i=t.getPixelRatio(),t.getSize(cx)),this._pixelRatio=i,this.setSize(cx.width,cx.height);const a=t.getRenderTarget(),o=t.getMRT(),u=s.layers.mask;this._cameraNear.value=s.near,this._cameraFar.value=s.far,null!==this._layers&&(s.layers.mask=this._layers.mask);for(const e in this._previousTextures)this.toggleTexture(e);t.setRenderTarget(this.renderTarget),t.setMRT(this._mrt),t.render(r,s),t.setRenderTarget(a),t.setMRT(o),s.layers.mask=u}setSize(e,t){this._width=e,this._height=t;const r=this._width*this._pixelRatio*this._resolution,s=this._height*this._pixelRatio*this._resolution;this.renderTarget.setSize(r,s)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget.dispose()}}gx.COLOR="color",gx.DEPTH="depth";class mx extends gx{static get type(){return"ToonOutlinePassNode"}constructor(e,t,r,s,i){super(gx.COLOR,e,t),this.colorNode=r,this.thicknessNode=s,this.alphaNode=i,this._materialCache=new WeakMap}updateBefore(e){const{renderer:t}=e,r=t.getRenderObjectFunction();t.setRenderObjectFunction(((e,r,s,i,n,a,o,u)=>{if((n.isMeshToonMaterial||n.isMeshToonNodeMaterial)&&!1===n.wireframe){const l=this._getOutlineMaterial(n);t.renderObject(e,r,s,i,l,a,o,u)}t.renderObject(e,r,s,i,n,a,o,u)})),super.updateBefore(e),t.setRenderObjectFunction(r)}_createMaterial(){const e=new Wh;e.isMeshToonOutlineMaterial=!0,e.name="Toon_Outline",e.side=S;const t=ql.negate(),r=ll.mul(Ll),s=ji(1),i=r.mul(nn(Vl,1)),n=r.mul(nn(Vl.add(t),1)),a=Qa(i.sub(n));return e.vertexNode=i.add(a.mul(this.thicknessNode).mul(i.w).mul(s)),e.colorNode=nn(this.colorNode,this.alphaNode),e}_getOutlineMaterial(e){let t=this._materialCache.get(e);return void 0===t&&(t=this._createMaterial(),this._materialCache.set(e,t)),t}}const fx=ki((([e,t])=>e.mul(t).clamp())).setLayout({name:"linearToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),yx=ki((([e,t])=>(e=e.mul(t)).div(e.add(1)).clamp())).setLayout({name:"reinhardToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),xx=ki((([e,t])=>{const r=(e=(e=e.mul(t)).sub(.004).max(0)).mul(e.mul(6.2).add(.5)),s=e.mul(e.mul(6.2).add(1.7)).add(.06);return r.div(s).pow(2.2)})).setLayout({name:"cineonToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),bx=ki((([e])=>{const t=e.mul(e.add(.0245786)).sub(90537e-9),r=e.mul(e.add(.432951).mul(.983729)).add(.238081);return t.div(r)})),Tx=ki((([e,t])=>{const r=dn(.59719,.35458,.04823,.076,.90834,.01566,.0284,.13383,.83777),s=dn(1.60475,-.53108,-.07367,-.10208,1.10813,-.00605,-.00327,-.07276,1.07602);return e=e.mul(t).div(.6),e=r.mul(e),e=bx(e),(e=s.mul(e)).clamp()})).setLayout({name:"acesFilmicToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),_x=dn(en(1.6605,-.1246,-.0182),en(-.5876,1.1329,-.1006),en(-.0728,-.0083,1.1187)),vx=dn(en(.6274,.0691,.0164),en(.3293,.9195,.088),en(.0433,.0113,.8956)),Nx=ki((([e])=>{const t=en(e).toVar(),r=en(t.mul(t)).toVar(),s=en(r.mul(r)).toVar();return ji(15.5).mul(s.mul(r)).sub(la(40.14,s.mul(t))).add(la(31.96,s).sub(la(6.868,r.mul(t))).add(la(.4298,r).add(la(.1191,t).sub(.00232))))})),Sx=ki((([e,t])=>{const r=en(e).toVar(),s=dn(en(.856627153315983,.137318972929847,.11189821299995),en(.0951212405381588,.761241990602591,.0767994186031903),en(.0482516061458583,.101439036467562,.811302368396859)),i=dn(en(1.1271005818144368,-.1413297634984383,-.14132976349843826),en(-.11060664309660323,1.157823702216272,-.11060664309660294),en(-.016493938717834573,-.016493938717834257,1.2519364065950405)),n=ji(-12.47393),a=ji(4.026069);return r.mulAssign(t),r.assign(vx.mul(r)),r.assign(s.mul(r)),r.assign(_o(r,1e-10)),r.assign(ja(r)),r.assign(r.sub(n).div(a.sub(n))),r.assign(Do(r,0,1)),r.assign(Nx(r)),r.assign(i.mul(r)),r.assign(Ro(_o(en(0),r),en(2.2))),r.assign(_x.mul(r)),r.assign(Do(r,0,1)),r})).setLayout({name:"agxToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),Ex=ki((([e,t])=>{const r=ji(.76),s=ji(.15);e=e.mul(t);const i=To(e.r,To(e.g,e.b)),n=Xo(i.lessThan(.08),i.sub(la(6.25,i.mul(i))),.04);e.subAssign(n);const a=_o(e.r,_o(e.g,e.b));Hi(a.lessThan(r),(()=>e));const o=ua(1,r),u=ua(1,o.mul(o).div(a.add(o.sub(r))));e.mulAssign(u.div(a));const l=ua(1,da(1,s.mul(a.sub(u)).add(1)));return Io(e,en(u),l)})).setLayout({name:"neutralToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]});class wx extends js{static get type(){return"CodeNode"}constructor(e="",t=[],r=""){super("code"),this.isCodeNode=!0,this.global=!0,this.code=e,this.includes=t,this.language=r}setIncludes(e){return this.includes=e,this}getIncludes(){return this.includes}generate(e){const t=this.getIncludes(e);for(const r of t)r.build(e);const r=e.getCodeFromNode(this,this.getNodeType(e));return r.code=this.code,r.code}serialize(e){super.serialize(e),e.code=this.code,e.language=this.language}deserialize(e){super.deserialize(e),this.code=e.code,this.language=e.language}}const Ax=Vi(wx).setParameterLength(1,3);class Rx extends wx{static get type(){return"FunctionNode"}constructor(e="",t=[],r=""){super(e,t,r)}getNodeType(e){return this.getNodeFunction(e).type}getInputs(e){return this.getNodeFunction(e).inputs}getNodeFunction(e){const t=e.getDataFromNode(this);let r=t.nodeFunction;return void 0===r&&(r=e.parser.parseFunction(this.code),t.nodeFunction=r),r}generate(e,t){super.generate(e);const r=this.getNodeFunction(e),s=r.name,i=r.type,n=e.getCodeFromNode(this,i);""!==s&&(n.name=s);const a=e.getPropertyName(n),o=this.getNodeFunction(e).getCode(a);return n.code=o+"\n","property"===t?a:e.format(`${a}()`,i,t)}}const Cx=(e,t=[],r="")=>{for(let e=0;es.call(...e);return i.functionNode=s,i};class Mx extends js{static get type(){return"ScriptableValueNode"}constructor(e=null){super(),this._value=e,this._cache=null,this.inputType=null,this.outputType=null,this.events=new o,this.isScriptableValueNode=!0}get isScriptableOutputNode(){return null!==this.outputType}set value(e){this._value!==e&&(this._cache&&"URL"===this.inputType&&this.value.value instanceof ArrayBuffer&&(URL.revokeObjectURL(this._cache),this._cache=null),this._value=e,this.events.dispatchEvent({type:"change"}),this.refresh())}get value(){return this._value}refresh(){this.events.dispatchEvent({type:"refresh"})}getValue(){const e=this.value;if(e&&null===this._cache&&"URL"===this.inputType&&e.value instanceof ArrayBuffer)this._cache=URL.createObjectURL(new Blob([e.value]));else if(e&&null!==e.value&&void 0!==e.value&&(("URL"===this.inputType||"String"===this.inputType)&&"string"==typeof e.value||"Number"===this.inputType&&"number"==typeof e.value||"Vector2"===this.inputType&&e.value.isVector2||"Vector3"===this.inputType&&e.value.isVector3||"Vector4"===this.inputType&&e.value.isVector4||"Color"===this.inputType&&e.value.isColor||"Matrix3"===this.inputType&&e.value.isMatrix3||"Matrix4"===this.inputType&&e.value.isMatrix4))return e.value;return this._cache||e}getNodeType(e){return this.value&&this.value.isNode?this.value.getNodeType(e):"float"}setup(){return this.value&&this.value.isNode?this.value:ji()}serialize(e){super.serialize(e),null!==this.value?"ArrayBuffer"===this.inputType?e.value=Fs(this.value):e.value=this.value?this.value.toJSON(e.meta).uuid:null:e.value=null,e.inputType=this.inputType,e.outputType=this.outputType}deserialize(e){super.deserialize(e);let t=null;null!==e.value&&(t="ArrayBuffer"===e.inputType?Bs(e.value):"Texture"===e.inputType?e.meta.textures[e.value]:e.meta.nodes[e.value]||null),this.value=t,this.inputType=e.inputType,this.outputType=e.outputType}}const Px=Vi(Mx).setParameterLength(1);class Lx extends Map{get(e,t=null,...r){if(this.has(e))return super.get(e);if(null!==t){const s=t(...r);return this.set(e,s),s}}}class Fx{constructor(e){this.scriptableNode=e}get parameters(){return this.scriptableNode.parameters}get layout(){return this.scriptableNode.getLayout()}getInputLayout(e){return this.scriptableNode.getInputLayout(e)}get(e){const t=this.parameters[e];return t?t.getValue():null}}const Bx=new Lx;class Ix extends js{static get type(){return"ScriptableNode"}constructor(e=null,t={}){super(),this.codeNode=e,this.parameters=t,this._local=new Lx,this._output=Px(null),this._outputs={},this._source=this.source,this._method=null,this._object=null,this._value=null,this._needsOutputUpdate=!0,this.onRefresh=this.onRefresh.bind(this),this.isScriptableNode=!0}get source(){return this.codeNode?this.codeNode.code:""}setLocal(e,t){return this._local.set(e,t)}getLocal(e){return this._local.get(e)}onRefresh(){this._refresh()}getInputLayout(e){for(const t of this.getLayout())if(t.inputType&&(t.id===e||t.name===e))return t}getOutputLayout(e){for(const t of this.getLayout())if(t.outputType&&(t.id===e||t.name===e))return t}setOutput(e,t){const r=this._outputs;return void 0===r[e]?r[e]=Px(t):r[e].value=t,this}getOutput(e){return this._outputs[e]}getParameter(e){return this.parameters[e]}setParameter(e,t){const r=this.parameters;return t&&t.isScriptableNode?(this.deleteParameter(e),r[e]=t,r[e].getDefaultOutput().events.addEventListener("refresh",this.onRefresh)):t&&t.isScriptableValueNode?(this.deleteParameter(e),r[e]=t,r[e].events.addEventListener("refresh",this.onRefresh)):void 0===r[e]?(r[e]=Px(t),r[e].events.addEventListener("refresh",this.onRefresh)):r[e].value=t,this}getValue(){return this.getDefaultOutput().getValue()}deleteParameter(e){let t=this.parameters[e];return t&&(t.isScriptableNode&&(t=t.getDefaultOutput()),t.events.removeEventListener("refresh",this.onRefresh)),this}clearParameters(){for(const e of Object.keys(this.parameters))this.deleteParameter(e);return this.needsUpdate=!0,this}call(e,...t){const r=this.getObject()[e];if("function"==typeof r)return r(...t)}async callAsync(e,...t){const r=this.getObject()[e];if("function"==typeof r)return"AsyncFunction"===r.constructor.name?await r(...t):r(...t)}getNodeType(e){return this.getDefaultOutputNode().getNodeType(e)}refresh(e=null){null!==e?this.getOutput(e).refresh():this._refresh()}getObject(){if(this.needsUpdate&&this.dispose(),null!==this._object)return this._object;const e=new Fx(this),t=Bx.get("THREE"),r=Bx.get("TSL"),s=this.getMethod(),i=[e,this._local,Bx,()=>this.refresh(),(e,t)=>this.setOutput(e,t),t,r];this._object=s(...i);const n=this._object.layout;if(n&&(!1===n.cache&&this._local.clear(),this._output.outputType=n.outputType||null,Array.isArray(n.elements)))for(const e of n.elements){const t=e.id||e.name;e.inputType&&(void 0===this.getParameter(t)&&this.setParameter(t,null),this.getParameter(t).inputType=e.inputType),e.outputType&&(void 0===this.getOutput(t)&&this.setOutput(t,null),this.getOutput(t).outputType=e.outputType)}return this._object}deserialize(e){super.deserialize(e);for(const e in this.parameters){let t=this.parameters[e];t.isScriptableNode&&(t=t.getDefaultOutput()),t.events.addEventListener("refresh",this.onRefresh)}}getLayout(){return this.getObject().layout}getDefaultOutputNode(){const e=this.getDefaultOutput().value;return e&&e.isNode?e:ji()}getDefaultOutput(){return this._exec()._output}getMethod(){if(this.needsUpdate&&this.dispose(),null!==this._method)return this._method;const e=["layout","init","main","dispose"].join(", "),t="\nreturn { ...output, "+e+" };",r="var "+e+"; var output = {};\n"+this.codeNode.code+t;return this._method=new Function(...["parameters","local","global","refresh","setOutput","THREE","TSL"],r),this._method}dispose(){null!==this._method&&(this._object&&"function"==typeof this._object.dispose&&this._object.dispose(),this._method=null,this._object=null,this._source=null,this._value=null,this._needsOutputUpdate=!0,this._output.value=null,this._outputs={})}setup(){return this.getDefaultOutputNode()}getCacheKey(e){const t=[xs(this.source),this.getDefaultOutputNode().getCacheKey(e)];for(const r in this.parameters)t.push(this.parameters[r].getCacheKey(e));return bs(t)}set needsUpdate(e){!0===e&&this.dispose()}get needsUpdate(){return this.source!==this._source}_exec(){return null===this.codeNode||(!0===this._needsOutputUpdate&&(this._value=this.call("main"),this._needsOutputUpdate=!1),this._output.value=this._value),this}_refresh(){this.needsUpdate=!0,this._exec(),this._output.refresh()}}const Dx=Vi(Ix).setParameterLength(1,2);function Vx(e){let t;const r=e.context.getViewZ;return void 0!==r&&(t=r(this)),(t||Gl.z).negate()}const Ux=ki((([e,t],r)=>{const s=Vx(r);return Oo(e,t,s)})),Ox=ki((([e],t)=>{const r=Vx(t);return e.mul(e,r,r).negate().exp().oneMinus()})),kx=ki((([e,t])=>nn(t.toFloat().mix(In.rgb,e.toVec3()),In.a)));let Gx=null,zx=null;class Hx extends js{static get type(){return"RangeNode"}constructor(e=ji(),t=ji()){super(),this.minNode=e,this.maxNode=t}getVectorLength(e){const t=e.getTypeLength(Ms(this.minNode.value)),r=e.getTypeLength(Ms(this.maxNode.value));return t>r?t:r}getNodeType(e){return e.object.count>1?e.getTypeFromLength(this.getVectorLength(e)):"float"}setup(e){const t=e.object;let r=null;if(t.count>1){const i=this.minNode.value,n=this.maxNode.value,a=e.getTypeLength(Ms(i)),o=e.getTypeLength(Ms(n));Gx=Gx||new s,zx=zx||new s,Gx.setScalar(0),zx.setScalar(0),1===a?Gx.setScalar(i):i.isColor?Gx.set(i.r,i.g,i.b,1):Gx.set(i.x,i.y,i.z||0,i.w||0),1===o?zx.setScalar(n):n.isColor?zx.set(n.r,n.g,n.b,1):zx.set(n.x,n.y,n.z||0,n.w||0);const l=4,d=l*t.count,c=new Float32Array(d);for(let e=0;eBi(new Wx(e,t)),qx=jx("numWorkgroups","uvec3"),Xx=jx("workgroupId","uvec3"),Kx=jx("globalId","uvec3"),Yx=jx("localId","uvec3"),Qx=jx("subgroupSize","uint");const Zx=Vi(class extends js{constructor(e){super(),this.scope=e}generate(e){const{scope:t}=this,{renderer:r}=e;!0===r.backend.isWebGLBackend?e.addFlowCode(`\t// ${t}Barrier \n`):e.addLineFlowCode(`${t}Barrier()`,this)}});class Jx extends qs{constructor(e,t){super(e,t),this.isWorkgroupInfoElementNode=!0}generate(e,t){let r;const s=e.context.assign;if(r=super.generate(e),!0!==s){const s=this.getNodeType(e);r=e.format(r,s,t)}return r}}class eb extends js{constructor(e,t,r=0){super(t),this.bufferType=t,this.bufferCount=r,this.isWorkgroupInfoNode=!0,this.elementType=t,this.scope=e}label(e){return this.name=e,this}setScope(e){return this.scope=e,this}getElementType(){return this.elementType}getInputType(){return`${this.scope}Array`}element(e){return Bi(new Jx(this,e))}generate(e){return e.getScopedArray(this.name||`${this.scope}Array_${this.id}`,this.scope.toLowerCase(),this.bufferType,this.bufferCount)}}class tb extends js{static get type(){return"AtomicFunctionNode"}constructor(e,t,r){super("uint"),this.method=e,this.pointerNode=t,this.valueNode=r,this.parents=!0}getInputType(e){return this.pointerNode.getNodeType(e)}getNodeType(e){return this.getInputType(e)}generate(e){const t=e.getNodeProperties(this),r=t.parents,s=this.method,i=this.getNodeType(e),n=this.getInputType(e),a=this.pointerNode,o=this.valueNode,u=[];u.push(`&${a.build(e,n)}`),null!==o&&u.push(o.build(e,n));const l=`${e.getMethod(s,i)}( ${u.join(", ")} )`;if(!(1===r.length&&!0===r[0].isStackNode))return void 0===t.constNode&&(t.constNode=Du(l,i).toConst()),t.constNode.build(e);e.addLineFlowCode(l,this)}}tb.ATOMIC_LOAD="atomicLoad",tb.ATOMIC_STORE="atomicStore",tb.ATOMIC_ADD="atomicAdd",tb.ATOMIC_SUB="atomicSub",tb.ATOMIC_MAX="atomicMax",tb.ATOMIC_MIN="atomicMin",tb.ATOMIC_AND="atomicAnd",tb.ATOMIC_OR="atomicOr",tb.ATOMIC_XOR="atomicXor";const rb=Vi(tb),sb=(e,t,r)=>rb(e,t,r).toStack();let ib;function nb(e){ib=ib||new WeakMap;let t=ib.get(e);return void 0===t&&ib.set(e,t={}),t}function ab(e){const t=nb(e);return t.shadowMatrix||(t.shadowMatrix=Zn("mat4").setGroup(Kn).onRenderUpdate((t=>(!0===e.castShadow&&!1!==t.renderer.shadowMap.enabled||e.shadow.updateMatrices(e),e.shadow.matrix))))}function ob(e,t=Ol){const r=ab(e).mul(t);return r.xyz.div(r.w)}function ub(e){const t=nb(e);return t.position||(t.position=Zn(new r).setGroup(Kn).onRenderUpdate(((t,r)=>r.value.setFromMatrixPosition(e.matrixWorld))))}function lb(e){const t=nb(e);return t.targetPosition||(t.targetPosition=Zn(new r).setGroup(Kn).onRenderUpdate(((t,r)=>r.value.setFromMatrixPosition(e.target.matrixWorld))))}function db(e){const t=nb(e);return t.viewPosition||(t.viewPosition=Zn(new r).setGroup(Kn).onRenderUpdate((({camera:t},s)=>{s.value=s.value||new r,s.value.setFromMatrixPosition(e.matrixWorld),s.value.applyMatrix4(t.matrixWorldInverse)})))}const cb=e=>cl.transformDirection(ub(e).sub(lb(e))),hb=(e,t)=>{for(const r of t)if(r.isAnalyticLightNode&&r.light.id===e)return r;return null},pb=new WeakMap,gb=[];class mb extends js{static get type(){return"LightsNode"}constructor(){super("vec3"),this.totalDiffuseNode=en().toVar(),this.totalSpecularNode=en().toVar(),this.outgoingLightNode=en().toVar(),this._lights=[],this._lightNodes=null,this._lightNodesHash=null,this.global=!0}customCacheKey(){const e=this._lights;for(let t=0;te.sort(((e,t)=>e.id-t.id)))(this._lights),i=e.renderer.library;for(const e of s)if(e.isNode)t.push(Bi(e));else{let s=null;if(null!==r&&(s=hb(e.id,r)),null===s){const r=i.getLightNodeClass(e.constructor);if(null===r){console.warn(`LightsNode.setupNodeLights: Light node not found for ${e.constructor.name}`);continue}let s=null;pb.has(e)?s=pb.get(e):(s=Bi(new r(e)),pb.set(e,s)),t.push(s)}}this._lightNodes=t}setupDirectLight(e,t,r){const{lightingModel:s,reflectedLight:i}=e.context;s.direct({...r,lightNode:t,reflectedLight:i},e)}setupDirectRectAreaLight(e,t,r){const{lightingModel:s,reflectedLight:i}=e.context;s.directRectArea({...r,lightNode:t,reflectedLight:i},e)}setupLights(e,t){for(const r of t)r.build(e)}getLightNodes(e){return null===this._lightNodes&&this.setupLightsNode(e),this._lightNodes}setup(e){const t=e.lightsNode;e.lightsNode=this;let r=this.outgoingLightNode;const s=e.context,i=s.lightingModel,n=e.getNodeProperties(this);if(i){const{totalDiffuseNode:t,totalSpecularNode:a}=this;s.outgoingLight=r;const o=e.addStack();n.nodes=o.nodes,i.start(e);const{backdrop:u,backdropAlpha:l}=s,{directDiffuse:d,directSpecular:c,indirectDiffuse:h,indirectSpecular:p}=s.reflectedLight;let g=d.add(h);null!==u&&(g=en(null!==l?l.mix(g,u):u),s.material.transparent=!0),t.assign(g),a.assign(c.add(p)),r.assign(t.add(a)),i.finish(e),r=r.bypass(e.removeStack())}else n.nodes=[];return e.lightsNode=t,r}setLights(e){return this._lights=e,this._lightNodes=null,this._lightNodesHash=null,this}getLights(){return this._lights}get hasLights(){return this._lights.length>0}}class fb extends js{static get type(){return"ShadowBaseNode"}constructor(e){super(),this.light=e,this.updateBeforeType=Vs.RENDER,this.isShadowBaseNode=!0}setupShadowPosition({context:e,material:t}){yb.assign(t.receivedShadowPositionNode||e.shadowPositionWorld||Ol)}}const yb=mn("vec3","shadowPositionWorld");function xb(t,r={}){return r.toneMapping=t.toneMapping,r.toneMappingExposure=t.toneMappingExposure,r.outputColorSpace=t.outputColorSpace,r.renderTarget=t.getRenderTarget(),r.activeCubeFace=t.getActiveCubeFace(),r.activeMipmapLevel=t.getActiveMipmapLevel(),r.renderObjectFunction=t.getRenderObjectFunction(),r.pixelRatio=t.getPixelRatio(),r.mrt=t.getMRT(),r.clearColor=t.getClearColor(r.clearColor||new e),r.clearAlpha=t.getClearAlpha(),r.autoClear=t.autoClear,r.scissorTest=t.getScissorTest(),r}function bb(e,t){return t=xb(e,t),e.setMRT(null),e.setRenderObjectFunction(null),e.setClearColor(0,1),e.autoClear=!0,t}function Tb(e,t){e.toneMapping=t.toneMapping,e.toneMappingExposure=t.toneMappingExposure,e.outputColorSpace=t.outputColorSpace,e.setRenderTarget(t.renderTarget,t.activeCubeFace,t.activeMipmapLevel),e.setRenderObjectFunction(t.renderObjectFunction),e.setPixelRatio(t.pixelRatio),e.setMRT(t.mrt),e.setClearColor(t.clearColor,t.clearAlpha),e.autoClear=t.autoClear,e.setScissorTest(t.scissorTest)}function _b(e,t={}){return t.background=e.background,t.backgroundNode=e.backgroundNode,t.overrideMaterial=e.overrideMaterial,t}function vb(e,t){return t=_b(e,t),e.background=null,e.backgroundNode=null,e.overrideMaterial=null,t}function Nb(e,t){e.background=t.background,e.backgroundNode=t.backgroundNode,e.overrideMaterial=t.overrideMaterial}function Sb(e,t,r){return r=vb(t,r=bb(e,r))}function Eb(e,t,r){Tb(e,r),Nb(t,r)}var wb=Object.freeze({__proto__:null,resetRendererAndSceneState:Sb,resetRendererState:bb,resetSceneState:vb,restoreRendererAndSceneState:Eb,restoreRendererState:Tb,restoreSceneState:Nb,saveRendererAndSceneState:function(e,t,r={}){return r=_b(t,r=xb(e,r))},saveRendererState:xb,saveSceneState:_b});const Ab=new WeakMap,Rb=ki((({depthTexture:e,shadowCoord:t,depthLayer:r})=>{let s=Zu(e,t.xy).label("t_basic");return e.isArrayTexture&&(s=s.depth(r)),s.compare(t.z)})),Cb=ki((({depthTexture:e,shadowCoord:t,shadow:r,depthLayer:s})=>{const i=(t,r)=>{let i=Zu(e,t);return e.isArrayTexture&&(i=i.depth(s)),i.compare(r)},n=yd("mapSize","vec2",r).setGroup(Kn),a=yd("radius","float",r).setGroup(Kn),o=Yi(1).div(n),u=o.x.negate().mul(a),l=o.y.negate().mul(a),d=o.x.mul(a),c=o.y.mul(a),h=u.div(2),p=l.div(2),g=d.div(2),m=c.div(2);return oa(i(t.xy.add(Yi(u,l)),t.z),i(t.xy.add(Yi(0,l)),t.z),i(t.xy.add(Yi(d,l)),t.z),i(t.xy.add(Yi(h,p)),t.z),i(t.xy.add(Yi(0,p)),t.z),i(t.xy.add(Yi(g,p)),t.z),i(t.xy.add(Yi(u,0)),t.z),i(t.xy.add(Yi(h,0)),t.z),i(t.xy,t.z),i(t.xy.add(Yi(g,0)),t.z),i(t.xy.add(Yi(d,0)),t.z),i(t.xy.add(Yi(h,m)),t.z),i(t.xy.add(Yi(0,m)),t.z),i(t.xy.add(Yi(g,m)),t.z),i(t.xy.add(Yi(u,c)),t.z),i(t.xy.add(Yi(0,c)),t.z),i(t.xy.add(Yi(d,c)),t.z)).mul(1/17)})),Mb=ki((({depthTexture:e,shadowCoord:t,shadow:r,depthLayer:s})=>{const i=(t,r)=>{let i=Zu(e,t);return e.isArrayTexture&&(i=i.depth(s)),i.compare(r)},n=yd("mapSize","vec2",r).setGroup(Kn),a=Yi(1).div(n),o=a.x,u=a.y,l=t.xy,d=Za(l.mul(n).add(.5));return l.subAssign(d.mul(a)),oa(i(l,t.z),i(l.add(Yi(o,0)),t.z),i(l.add(Yi(0,u)),t.z),i(l.add(a),t.z),Io(i(l.add(Yi(o.negate(),0)),t.z),i(l.add(Yi(o.mul(2),0)),t.z),d.x),Io(i(l.add(Yi(o.negate(),u)),t.z),i(l.add(Yi(o.mul(2),u)),t.z),d.x),Io(i(l.add(Yi(0,u.negate())),t.z),i(l.add(Yi(0,u.mul(2))),t.z),d.y),Io(i(l.add(Yi(o,u.negate())),t.z),i(l.add(Yi(o,u.mul(2))),t.z),d.y),Io(Io(i(l.add(Yi(o.negate(),u.negate())),t.z),i(l.add(Yi(o.mul(2),u.negate())),t.z),d.x),Io(i(l.add(Yi(o.negate(),u.mul(2))),t.z),i(l.add(Yi(o.mul(2),u.mul(2))),t.z),d.x),d.y)).mul(1/9)})),Pb=ki((({depthTexture:e,shadowCoord:t,depthLayer:r})=>{const s=ji(1).toVar();let i=Zu(e).sample(t.xy);e.isArrayTexture&&(i=i.depth(r)),i=i.rg;const n=vo(t.z,i.x);return Hi(n.notEqual(ji(1)),(()=>{const e=t.z.sub(i.x),r=_o(0,i.y.mul(i.y));let a=r.div(r.add(e.mul(e)));a=Do(ua(a,.3).div(.95-.3)),s.assign(Do(_o(n,a)))})),s})),Lb=ki((([e,t,r])=>{let s=Ol.sub(e).length();return s=s.sub(t).div(r.sub(t)),s=s.saturate(),s})),Fb=e=>{let t=Ab.get(e);if(void 0===t){const r=e.isPointLight?(e=>{const t=e.shadow.camera,r=yd("near","float",t).setGroup(Kn),s=yd("far","float",t).setGroup(Kn),i=bl(e);return Lb(i,r,s)})(e):null;t=new Wh,t.colorNode=nn(0,0,0,1),t.depthNode=r,t.isShadowPassMaterial=!0,t.name="ShadowMaterial",t.fog=!1,Ab.set(e,t)}return t},Bb=new zm,Ib=[],Db=(e,t,r,s)=>{Ib[0]=e,Ib[1]=t;let i=Bb.get(Ib);return void 0!==i&&i.shadowType===r&&i.useVelocity===s||(i=(i,n,a,o,u,l,...d)=>{(!0===i.castShadow||i.receiveShadow&&r===Ie)&&(s&&(Ls(i).useVelocity=!0),i.onBeforeShadow(e,i,a,t.camera,o,n.overrideMaterial,l),e.renderObject(i,n,a,o,u,l,...d),i.onAfterShadow(e,i,a,t.camera,o,n.overrideMaterial,l))},i.shadowType=r,i.useVelocity=s,Bb.set(Ib,i)),Ib[0]=null,Ib[1]=null,i},Vb=ki((({samples:e,radius:t,size:r,shadowPass:s,depthLayer:i})=>{const n=ji(0).toVar("meanVertical"),a=ji(0).toVar("squareMeanVertical"),o=e.lessThanEqual(ji(1)).select(ji(0),ji(2).div(e.sub(1))),u=e.lessThanEqual(ji(1)).select(ji(0),ji(-1));Zc({start:qi(0),end:qi(e),type:"int",condition:"<"},(({i:e})=>{const l=u.add(ji(e).mul(o));let d=s.sample(oa(mh.xy,Yi(0,l).mul(t)).div(r));s.value.isArrayTexture&&(d=d.depth(i)),d=d.x,n.addAssign(d),a.addAssign(d.mul(d))})),n.divAssign(e),a.divAssign(e);const l=qa(a.sub(n.mul(n)));return Yi(n,l)})),Ub=ki((({samples:e,radius:t,size:r,shadowPass:s,depthLayer:i})=>{const n=ji(0).toVar("meanHorizontal"),a=ji(0).toVar("squareMeanHorizontal"),o=e.lessThanEqual(ji(1)).select(ji(0),ji(2).div(e.sub(1))),u=e.lessThanEqual(ji(1)).select(ji(0),ji(-1));Zc({start:qi(0),end:qi(e),type:"int",condition:"<"},(({i:e})=>{const l=u.add(ji(e).mul(o));let d=s.sample(oa(mh.xy,Yi(l,0).mul(t)).div(r));s.value.isArrayTexture&&(d=d.depth(i)),n.addAssign(d.x),a.addAssign(oa(d.y.mul(d.y),d.x.mul(d.x)))})),n.divAssign(e),a.divAssign(e);const l=qa(a.sub(n.mul(n)));return Yi(n,l)})),Ob=[Rb,Cb,Mb,Pb];let kb;const Gb=new vy;class zb extends fb{static get type(){return"ShadowNode"}constructor(e,t=null){super(e),this.shadow=t||e.shadow,this.shadowMap=null,this.vsmShadowMapVertical=null,this.vsmShadowMapHorizontal=null,this.vsmMaterialVertical=null,this.vsmMaterialHorizontal=null,this._node=null,this._cameraFrameId=new WeakMap,this.isShadowNode=!0,this.depthLayer=0}setupShadowFilter(e,{filterFn:t,depthTexture:r,shadowCoord:s,shadow:i,depthLayer:n}){const a=s.x.greaterThanEqual(0).and(s.x.lessThanEqual(1)).and(s.y.greaterThanEqual(0)).and(s.y.lessThanEqual(1)).and(s.z.lessThanEqual(1)),o=t({depthTexture:r,shadowCoord:s,shadow:i,depthLayer:n});return a.select(o,ji(1))}setupShadowCoord(e,t){const{shadow:r}=this,{renderer:s}=e,i=yd("bias","float",r).setGroup(Kn);let n,a=t;if(r.camera.isOrthographicCamera||!0!==s.logarithmicDepthBuffer)a=a.xyz.div(a.w),n=a.z,s.coordinateSystem===d&&(n=n.mul(2).sub(1));else{const e=a.w;a=a.xy.div(e);const t=yd("near","float",r.camera).setGroup(Kn),s=yd("far","float",r.camera).setGroup(Kn);n=Bh(e.negate(),t,s)}return a=en(a.x,a.y.oneMinus(),n.add(i)),a}getShadowFilterFn(e){return Ob[e]}setupRenderTarget(e,t){const r=new V(e.mapSize.width,e.mapSize.height);r.name="ShadowDepthTexture",r.compareFunction=De;const s=t.createRenderTarget(e.mapSize.width,e.mapSize.height);return s.texture.name="ShadowMap",s.texture.type=e.mapType,s.depthTexture=r,{shadowMap:s,depthTexture:r}}setupShadow(e){const{renderer:t}=e,{light:r,shadow:s}=this,i=t.shadowMap.type,{depthTexture:n,shadowMap:a}=this.setupRenderTarget(s,e);if(s.camera.updateProjectionMatrix(),i===Ie&&!0!==s.isPointLightShadow){n.compareFunction=null,a.depth>1?(a._vsmShadowMapVertical||(a._vsmShadowMapVertical=e.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:Ve,type:de,depth:a.depth,depthBuffer:!1}),a._vsmShadowMapVertical.texture.name="VSMVertical"),this.vsmShadowMapVertical=a._vsmShadowMapVertical,a._vsmShadowMapHorizontal||(a._vsmShadowMapHorizontal=e.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:Ve,type:de,depth:a.depth,depthBuffer:!1}),a._vsmShadowMapHorizontal.texture.name="VSMHorizontal"),this.vsmShadowMapHorizontal=a._vsmShadowMapHorizontal):(this.vsmShadowMapVertical=e.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:Ve,type:de,depthBuffer:!1}),this.vsmShadowMapHorizontal=e.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:Ve,type:de,depthBuffer:!1}));let t=Zu(n);n.isArrayTexture&&(t=t.depth(this.depthLayer));let r=Zu(this.vsmShadowMapVertical.texture);n.isArrayTexture&&(r=r.depth(this.depthLayer));const i=yd("blurSamples","float",s).setGroup(Kn),o=yd("radius","float",s).setGroup(Kn),u=yd("mapSize","vec2",s).setGroup(Kn);let l=this.vsmMaterialVertical||(this.vsmMaterialVertical=new Wh);l.fragmentNode=Vb({samples:i,radius:o,size:u,shadowPass:t,depthLayer:this.depthLayer}).context(e.getSharedContext()),l.name="VSMVertical",l=this.vsmMaterialHorizontal||(this.vsmMaterialHorizontal=new Wh),l.fragmentNode=Ub({samples:i,radius:o,size:u,shadowPass:r,depthLayer:this.depthLayer}).context(e.getSharedContext()),l.name="VSMHorizontal"}const o=yd("intensity","float",s).setGroup(Kn),u=yd("normalBias","float",s).setGroup(Kn),l=ab(r).mul(yb.add(Zl.mul(u))),d=this.setupShadowCoord(e,l),c=s.filterNode||this.getShadowFilterFn(t.shadowMap.type)||null;if(null===c)throw new Error("THREE.WebGPURenderer: Shadow map type not supported yet.");const h=i===Ie&&!0!==s.isPointLightShadow?this.vsmShadowMapHorizontal.texture:n,p=this.setupShadowFilter(e,{filterFn:c,shadowTexture:a.texture,depthTexture:h,shadowCoord:d,shadow:s,depthLayer:this.depthLayer});let g=Zu(a.texture,d);n.isArrayTexture&&(g=g.depth(this.depthLayer));const m=Io(1,p.rgb.mix(g,1),o.mul(g.a)).toVar();return this.shadowMap=a,this.shadow.map=a,m}setup(e){if(!1!==e.renderer.shadowMap.enabled)return ki((()=>{let t=this._node;return this.setupShadowPosition(e),null===t&&(this._node=t=this.setupShadow(e)),e.material.shadowNode&&console.warn('THREE.NodeMaterial: ".shadowNode" is deprecated. Use ".castShadowNode" instead.'),e.material.receivedShadowNode&&(t=e.material.receivedShadowNode(t)),t}))()}renderShadow(e){const{shadow:t,shadowMap:r,light:s}=this,{renderer:i,scene:n}=e;t.updateMatrices(s),r.setSize(t.mapSize.width,t.mapSize.height,r.depth),i.render(n,t.camera)}updateShadow(e){const{shadowMap:t,light:r,shadow:s}=this,{renderer:i,scene:n,camera:a}=e,o=i.shadowMap.type,u=t.depthTexture.version;this._depthVersionCached=u;const l=s.camera.layers.mask;4294967294&s.camera.layers.mask||(s.camera.layers.mask=a.layers.mask);const d=i.getRenderObjectFunction(),c=i.getMRT(),h=!!c&&c.has("velocity");kb=Sb(i,n,kb),n.overrideMaterial=Fb(r),i.setRenderObjectFunction(Db(i,s,o,h)),i.setClearColor(0,0),i.setRenderTarget(t),this.renderShadow(e),i.setRenderObjectFunction(d),o===Ie&&!0!==s.isPointLightShadow&&this.vsmPass(i),s.camera.layers.mask=l,Eb(i,n,kb)}vsmPass(e){const{shadow:t}=this,r=this.shadowMap.depth;this.vsmShadowMapVertical.setSize(t.mapSize.width,t.mapSize.height,r),this.vsmShadowMapHorizontal.setSize(t.mapSize.width,t.mapSize.height,r),e.setRenderTarget(this.vsmShadowMapVertical),Gb.material=this.vsmMaterialVertical,Gb.render(e),e.setRenderTarget(this.vsmShadowMapHorizontal),Gb.material=this.vsmMaterialHorizontal,Gb.render(e)}dispose(){this.shadowMap.dispose(),this.shadowMap=null,null!==this.vsmShadowMapVertical&&(this.vsmShadowMapVertical.dispose(),this.vsmShadowMapVertical=null,this.vsmMaterialVertical.dispose(),this.vsmMaterialVertical=null),null!==this.vsmShadowMapHorizontal&&(this.vsmShadowMapHorizontal.dispose(),this.vsmShadowMapHorizontal=null,this.vsmMaterialHorizontal.dispose(),this.vsmMaterialHorizontal=null),super.dispose()}updateBefore(e){const{shadow:t}=this;let r=t.needsUpdate||t.autoUpdate;r&&(this._cameraFrameId[e.camera]===e.frameId&&(r=!1),this._cameraFrameId[e.camera]=e.frameId),r&&(this.updateShadow(e),this.shadowMap.depthTexture.version===this._depthVersionCached&&(t.needsUpdate=!1))}}const Hb=(e,t)=>Bi(new zb(e,t)),$b=new e,Wb=ki((([e,t])=>{const r=e.toVar(),s=no(r),i=da(1,_o(s.x,_o(s.y,s.z)));s.mulAssign(i),r.mulAssign(i.mul(t.mul(2).oneMinus()));const n=Yi(r.xy).toVar(),a=t.mul(1.5).oneMinus();return Hi(s.z.greaterThanEqual(a),(()=>{Hi(r.z.greaterThan(0),(()=>{n.x.assign(ua(4,r.x))}))})).ElseIf(s.x.greaterThanEqual(a),(()=>{const e=ao(r.x);n.x.assign(r.z.mul(e).add(e.mul(2)))})).ElseIf(s.y.greaterThanEqual(a),(()=>{const e=ao(r.y);n.x.assign(r.x.add(e.mul(2)).add(2)),n.y.assign(r.z.mul(e).sub(2))})),Yi(.125,.25).mul(n).add(Yi(.375,.75)).flipY()})).setLayout({name:"cubeToUV",type:"vec2",inputs:[{name:"pos",type:"vec3"},{name:"texelSizeY",type:"float"}]}),jb=ki((({depthTexture:e,bd3D:t,dp:r,texelSize:s})=>Zu(e,Wb(t,s.y)).compare(r))),qb=ki((({depthTexture:e,bd3D:t,dp:r,texelSize:s,shadow:i})=>{const n=yd("radius","float",i).setGroup(Kn),a=Yi(-1,1).mul(n).mul(s.y);return Zu(e,Wb(t.add(a.xyy),s.y)).compare(r).add(Zu(e,Wb(t.add(a.yyy),s.y)).compare(r)).add(Zu(e,Wb(t.add(a.xyx),s.y)).compare(r)).add(Zu(e,Wb(t.add(a.yyx),s.y)).compare(r)).add(Zu(e,Wb(t,s.y)).compare(r)).add(Zu(e,Wb(t.add(a.xxy),s.y)).compare(r)).add(Zu(e,Wb(t.add(a.yxy),s.y)).compare(r)).add(Zu(e,Wb(t.add(a.xxx),s.y)).compare(r)).add(Zu(e,Wb(t.add(a.yxx),s.y)).compare(r)).mul(1/9)})),Xb=ki((({filterFn:e,depthTexture:t,shadowCoord:r,shadow:s})=>{const i=r.xyz.toVar(),n=i.length(),a=Zn("float").setGroup(Kn).onRenderUpdate((()=>s.camera.near)),o=Zn("float").setGroup(Kn).onRenderUpdate((()=>s.camera.far)),u=yd("bias","float",s).setGroup(Kn),l=Zn(s.mapSize).setGroup(Kn),d=ji(1).toVar();return Hi(n.sub(o).lessThanEqual(0).and(n.sub(a).greaterThanEqual(0)),(()=>{const r=n.sub(a).div(o.sub(a)).toVar();r.addAssign(u);const c=i.normalize(),h=Yi(1).div(l.mul(Yi(4,2)));d.assign(e({depthTexture:t,bd3D:c,dp:r,texelSize:h,shadow:s}))})),d})),Kb=new s,Yb=new t,Qb=new t;class Zb extends zb{static get type(){return"PointShadowNode"}constructor(e,t=null){super(e,t)}getShadowFilterFn(e){return e===Ue?jb:qb}setupShadowCoord(e,t){return t}setupShadowFilter(e,{filterFn:t,shadowTexture:r,depthTexture:s,shadowCoord:i,shadow:n}){return Xb({filterFn:t,shadowTexture:r,depthTexture:s,shadowCoord:i,shadow:n})}renderShadow(e){const{shadow:t,shadowMap:r,light:s}=this,{renderer:i,scene:n}=e,a=t.getFrameExtents();Qb.copy(t.mapSize),Qb.multiply(a),r.setSize(Qb.width,Qb.height),Yb.copy(t.mapSize);const o=i.autoClear,u=i.getClearColor($b),l=i.getClearAlpha();i.autoClear=!1,i.setClearColor(t.clearColor,t.clearAlpha),i.clear();const d=t.getViewportCount();for(let e=0;eBi(new Zb(e,t));class eT extends nh{static get type(){return"AnalyticLightNode"}constructor(t=null){super(),this.light=t,this.color=new e,this.colorNode=t&&t.colorNode||Zn(this.color).setGroup(Kn),this.baseColorNode=null,this.shadowNode=null,this.shadowColorNode=null,this.isAnalyticLightNode=!0,this.updateType=Vs.FRAME}getHash(){return this.light.uuid}getLightVector(e){return db(this.light).sub(e.context.positionView||Gl)}setupDirect(){}setupDirectRectArea(){}setupShadowNode(){return Hb(this.light)}setupShadow(e){const{renderer:t}=e;if(!1===t.shadowMap.enabled)return;let r=this.shadowColorNode;if(null===r){const e=this.light.shadow.shadowNode;let t;t=void 0!==e?Bi(e):this.setupShadowNode(),this.shadowNode=t,this.shadowColorNode=r=this.colorNode.mul(t),this.baseColorNode=this.colorNode}this.colorNode=r}setup(e){this.colorNode=this.baseColorNode||this.colorNode,this.light.castShadow?e.object.receiveShadow&&this.setupShadow(e):null!==this.shadowNode&&(this.shadowNode.dispose(),this.shadowNode=null,this.shadowColorNode=null);const t=this.setupDirect(e),r=this.setupDirectRectArea(e);t&&e.lightsNode.setupDirectLight(e,this,t),r&&e.lightsNode.setupDirectRectAreaLight(e,this,r)}update(){const{light:e}=this;this.color.copy(e.color).multiplyScalar(e.intensity)}}const tT=ki((({lightDistance:e,cutoffDistance:t,decayExponent:r})=>{const s=e.pow(r).max(.01).reciprocal();return t.greaterThan(0).select(s.mul(e.div(t).pow4().oneMinus().clamp().pow2()),s)})),rT=({color:e,lightVector:t,cutoffDistance:r,decayExponent:s})=>{const i=t.normalize(),n=t.length(),a=tT({lightDistance:n,cutoffDistance:r,decayExponent:s});return{lightDirection:i,lightColor:e.mul(a)}};class sT extends eT{static get type(){return"PointLightNode"}constructor(e=null){super(e),this.cutoffDistanceNode=Zn(0).setGroup(Kn),this.decayExponentNode=Zn(2).setGroup(Kn)}update(e){const{light:t}=this;super.update(e),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}setupShadowNode(){return Jb(this.light)}setupDirect(e){return rT({color:this.colorNode,lightVector:this.getLightVector(e),cutoffDistance:this.cutoffDistanceNode,decayExponent:this.decayExponentNode})}}const iT=ki((([e=t()])=>{const t=e.mul(2),r=t.x.floor(),s=t.y.floor();return r.add(s).mod(2).sign()})),nT=ki((([e=$u()],{renderer:t,material:r})=>{const s=Bo(e.mul(2).sub(1));let i;if(r.alphaToCoverage&&t.samples>1){const e=ji(s.fwidth()).toVar();i=Oo(e.oneMinus(),e.add(1),s).oneMinus()}else i=Xo(s.greaterThan(1),0,1);return i})),aT=ki((([e,t,r])=>{const s=ji(r).toVar(),i=ji(t).toVar(),n=Ki(e).toVar();return Xo(n,i,s)})).setLayout({name:"mx_select",type:"float",inputs:[{name:"b",type:"bool"},{name:"t",type:"float"},{name:"f",type:"float"}]}),oT=ki((([e,t])=>{const r=Ki(t).toVar(),s=ji(e).toVar();return Xo(r,s.negate(),s)})).setLayout({name:"mx_negate_if",type:"float",inputs:[{name:"val",type:"float"},{name:"b",type:"bool"}]}),uT=ki((([e])=>{const t=ji(e).toVar();return qi(Ka(t))})).setLayout({name:"mx_floor",type:"int",inputs:[{name:"x",type:"float"}]}),lT=ki((([e,t])=>{const r=ji(e).toVar();return t.assign(uT(r)),r.sub(ji(t))})),dT=Wf([ki((([e,t,r,s,i,n])=>{const a=ji(n).toVar(),o=ji(i).toVar(),u=ji(s).toVar(),l=ji(r).toVar(),d=ji(t).toVar(),c=ji(e).toVar(),h=ji(ua(1,o)).toVar();return ua(1,a).mul(c.mul(h).add(d.mul(o))).add(a.mul(l.mul(h).add(u.mul(o))))})).setLayout({name:"mx_bilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"}]}),ki((([e,t,r,s,i,n])=>{const a=ji(n).toVar(),o=ji(i).toVar(),u=en(s).toVar(),l=en(r).toVar(),d=en(t).toVar(),c=en(e).toVar(),h=ji(ua(1,o)).toVar();return ua(1,a).mul(c.mul(h).add(d.mul(o))).add(a.mul(l.mul(h).add(u.mul(o))))})).setLayout({name:"mx_bilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"}]})]),cT=Wf([ki((([e,t,r,s,i,n,a,o,u,l,d])=>{const c=ji(d).toVar(),h=ji(l).toVar(),p=ji(u).toVar(),g=ji(o).toVar(),m=ji(a).toVar(),f=ji(n).toVar(),y=ji(i).toVar(),x=ji(s).toVar(),b=ji(r).toVar(),T=ji(t).toVar(),_=ji(e).toVar(),v=ji(ua(1,p)).toVar(),N=ji(ua(1,h)).toVar();return ji(ua(1,c)).toVar().mul(N.mul(_.mul(v).add(T.mul(p))).add(h.mul(b.mul(v).add(x.mul(p))))).add(c.mul(N.mul(y.mul(v).add(f.mul(p))).add(h.mul(m.mul(v).add(g.mul(p))))))})).setLayout({name:"mx_trilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"v4",type:"float"},{name:"v5",type:"float"},{name:"v6",type:"float"},{name:"v7",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),ki((([e,t,r,s,i,n,a,o,u,l,d])=>{const c=ji(d).toVar(),h=ji(l).toVar(),p=ji(u).toVar(),g=en(o).toVar(),m=en(a).toVar(),f=en(n).toVar(),y=en(i).toVar(),x=en(s).toVar(),b=en(r).toVar(),T=en(t).toVar(),_=en(e).toVar(),v=ji(ua(1,p)).toVar(),N=ji(ua(1,h)).toVar();return ji(ua(1,c)).toVar().mul(N.mul(_.mul(v).add(T.mul(p))).add(h.mul(b.mul(v).add(x.mul(p))))).add(c.mul(N.mul(y.mul(v).add(f.mul(p))).add(h.mul(m.mul(v).add(g.mul(p))))))})).setLayout({name:"mx_trilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"v4",type:"vec3"},{name:"v5",type:"vec3"},{name:"v6",type:"vec3"},{name:"v7",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]})]),hT=ki((([e,t,r])=>{const s=ji(r).toVar(),i=ji(t).toVar(),n=Xi(e).toVar(),a=Xi(n.bitAnd(Xi(7))).toVar(),o=ji(aT(a.lessThan(Xi(4)),i,s)).toVar(),u=ji(la(2,aT(a.lessThan(Xi(4)),s,i))).toVar();return oT(o,Ki(a.bitAnd(Xi(1)))).add(oT(u,Ki(a.bitAnd(Xi(2)))))})).setLayout({name:"mx_gradient_float_0",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"}]}),pT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=ji(t).toVar(),o=Xi(e).toVar(),u=Xi(o.bitAnd(Xi(15))).toVar(),l=ji(aT(u.lessThan(Xi(8)),a,n)).toVar(),d=ji(aT(u.lessThan(Xi(4)),n,aT(u.equal(Xi(12)).or(u.equal(Xi(14))),a,i))).toVar();return oT(l,Ki(u.bitAnd(Xi(1)))).add(oT(d,Ki(u.bitAnd(Xi(2)))))})).setLayout({name:"mx_gradient_float_1",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),gT=Wf([hT,pT]),mT=ki((([e,t,r])=>{const s=ji(r).toVar(),i=ji(t).toVar(),n=rn(e).toVar();return en(gT(n.x,i,s),gT(n.y,i,s),gT(n.z,i,s))})).setLayout({name:"mx_gradient_vec3_0",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"}]}),fT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=ji(t).toVar(),o=rn(e).toVar();return en(gT(o.x,a,n,i),gT(o.y,a,n,i),gT(o.z,a,n,i))})).setLayout({name:"mx_gradient_vec3_1",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),yT=Wf([mT,fT]),xT=ki((([e])=>{const t=ji(e).toVar();return la(.6616,t)})).setLayout({name:"mx_gradient_scale2d_0",type:"float",inputs:[{name:"v",type:"float"}]}),bT=ki((([e])=>{const t=ji(e).toVar();return la(.982,t)})).setLayout({name:"mx_gradient_scale3d_0",type:"float",inputs:[{name:"v",type:"float"}]}),TT=Wf([xT,ki((([e])=>{const t=en(e).toVar();return la(.6616,t)})).setLayout({name:"mx_gradient_scale2d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]})]),_T=Wf([bT,ki((([e])=>{const t=en(e).toVar();return la(.982,t)})).setLayout({name:"mx_gradient_scale3d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]})]),vT=ki((([e,t])=>{const r=qi(t).toVar(),s=Xi(e).toVar();return s.shiftLeft(r).bitOr(s.shiftRight(qi(32).sub(r)))})).setLayout({name:"mx_rotl32",type:"uint",inputs:[{name:"x",type:"uint"},{name:"k",type:"int"}]}),NT=ki((([e,t,r])=>{e.subAssign(r),e.bitXorAssign(vT(r,qi(4))),r.addAssign(t),t.subAssign(e),t.bitXorAssign(vT(e,qi(6))),e.addAssign(r),r.subAssign(t),r.bitXorAssign(vT(t,qi(8))),t.addAssign(e),e.subAssign(r),e.bitXorAssign(vT(r,qi(16))),r.addAssign(t),t.subAssign(e),t.bitXorAssign(vT(e,qi(19))),e.addAssign(r),r.subAssign(t),r.bitXorAssign(vT(t,qi(4))),t.addAssign(e)})),ST=ki((([e,t,r])=>{const s=Xi(r).toVar(),i=Xi(t).toVar(),n=Xi(e).toVar();return s.bitXorAssign(i),s.subAssign(vT(i,qi(14))),n.bitXorAssign(s),n.subAssign(vT(s,qi(11))),i.bitXorAssign(n),i.subAssign(vT(n,qi(25))),s.bitXorAssign(i),s.subAssign(vT(i,qi(16))),n.bitXorAssign(s),n.subAssign(vT(s,qi(4))),i.bitXorAssign(n),i.subAssign(vT(n,qi(14))),s.bitXorAssign(i),s.subAssign(vT(i,qi(24))),s})).setLayout({name:"mx_bjfinal",type:"uint",inputs:[{name:"a",type:"uint"},{name:"b",type:"uint"},{name:"c",type:"uint"}]}),ET=ki((([e])=>{const t=Xi(e).toVar();return ji(t).div(ji(Xi(qi(4294967295))))})).setLayout({name:"mx_bits_to_01",type:"float",inputs:[{name:"bits",type:"uint"}]}),wT=ki((([e])=>{const t=ji(e).toVar();return t.mul(t).mul(t).mul(t.mul(t.mul(6).sub(15)).add(10))})).setLayout({name:"mx_fade",type:"float",inputs:[{name:"t",type:"float"}]}),AT=Wf([ki((([e])=>{const t=qi(e).toVar(),r=Xi(Xi(1)).toVar(),s=Xi(Xi(qi(3735928559)).add(r.shiftLeft(Xi(2))).add(Xi(13))).toVar();return ST(s.add(Xi(t)),s,s)})).setLayout({name:"mx_hash_int_0",type:"uint",inputs:[{name:"x",type:"int"}]}),ki((([e,t])=>{const r=qi(t).toVar(),s=qi(e).toVar(),i=Xi(Xi(2)).toVar(),n=Xi().toVar(),a=Xi().toVar(),o=Xi().toVar();return n.assign(a.assign(o.assign(Xi(qi(3735928559)).add(i.shiftLeft(Xi(2))).add(Xi(13))))),n.addAssign(Xi(s)),a.addAssign(Xi(r)),ST(n,a,o)})).setLayout({name:"mx_hash_int_1",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),ki((([e,t,r])=>{const s=qi(r).toVar(),i=qi(t).toVar(),n=qi(e).toVar(),a=Xi(Xi(3)).toVar(),o=Xi().toVar(),u=Xi().toVar(),l=Xi().toVar();return o.assign(u.assign(l.assign(Xi(qi(3735928559)).add(a.shiftLeft(Xi(2))).add(Xi(13))))),o.addAssign(Xi(n)),u.addAssign(Xi(i)),l.addAssign(Xi(s)),ST(o,u,l)})).setLayout({name:"mx_hash_int_2",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),ki((([e,t,r,s])=>{const i=qi(s).toVar(),n=qi(r).toVar(),a=qi(t).toVar(),o=qi(e).toVar(),u=Xi(Xi(4)).toVar(),l=Xi().toVar(),d=Xi().toVar(),c=Xi().toVar();return l.assign(d.assign(c.assign(Xi(qi(3735928559)).add(u.shiftLeft(Xi(2))).add(Xi(13))))),l.addAssign(Xi(o)),d.addAssign(Xi(a)),c.addAssign(Xi(n)),NT(l,d,c),l.addAssign(Xi(i)),ST(l,d,c)})).setLayout({name:"mx_hash_int_3",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"}]}),ki((([e,t,r,s,i])=>{const n=qi(i).toVar(),a=qi(s).toVar(),o=qi(r).toVar(),u=qi(t).toVar(),l=qi(e).toVar(),d=Xi(Xi(5)).toVar(),c=Xi().toVar(),h=Xi().toVar(),p=Xi().toVar();return c.assign(h.assign(p.assign(Xi(qi(3735928559)).add(d.shiftLeft(Xi(2))).add(Xi(13))))),c.addAssign(Xi(l)),h.addAssign(Xi(u)),p.addAssign(Xi(o)),NT(c,h,p),c.addAssign(Xi(a)),h.addAssign(Xi(n)),ST(c,h,p)})).setLayout({name:"mx_hash_int_4",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"},{name:"yy",type:"int"}]})]),RT=Wf([ki((([e,t])=>{const r=qi(t).toVar(),s=qi(e).toVar(),i=Xi(AT(s,r)).toVar(),n=rn().toVar();return n.x.assign(i.bitAnd(qi(255))),n.y.assign(i.shiftRight(qi(8)).bitAnd(qi(255))),n.z.assign(i.shiftRight(qi(16)).bitAnd(qi(255))),n})).setLayout({name:"mx_hash_vec3_0",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),ki((([e,t,r])=>{const s=qi(r).toVar(),i=qi(t).toVar(),n=qi(e).toVar(),a=Xi(AT(n,i,s)).toVar(),o=rn().toVar();return o.x.assign(a.bitAnd(qi(255))),o.y.assign(a.shiftRight(qi(8)).bitAnd(qi(255))),o.z.assign(a.shiftRight(qi(16)).bitAnd(qi(255))),o})).setLayout({name:"mx_hash_vec3_1",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]})]),CT=Wf([ki((([e])=>{const t=Yi(e).toVar(),r=qi().toVar(),s=qi().toVar(),i=ji(lT(t.x,r)).toVar(),n=ji(lT(t.y,s)).toVar(),a=ji(wT(i)).toVar(),o=ji(wT(n)).toVar(),u=ji(dT(gT(AT(r,s),i,n),gT(AT(r.add(qi(1)),s),i.sub(1),n),gT(AT(r,s.add(qi(1))),i,n.sub(1)),gT(AT(r.add(qi(1)),s.add(qi(1))),i.sub(1),n.sub(1)),a,o)).toVar();return TT(u)})).setLayout({name:"mx_perlin_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"}]}),ki((([e])=>{const t=en(e).toVar(),r=qi().toVar(),s=qi().toVar(),i=qi().toVar(),n=ji(lT(t.x,r)).toVar(),a=ji(lT(t.y,s)).toVar(),o=ji(lT(t.z,i)).toVar(),u=ji(wT(n)).toVar(),l=ji(wT(a)).toVar(),d=ji(wT(o)).toVar(),c=ji(cT(gT(AT(r,s,i),n,a,o),gT(AT(r.add(qi(1)),s,i),n.sub(1),a,o),gT(AT(r,s.add(qi(1)),i),n,a.sub(1),o),gT(AT(r.add(qi(1)),s.add(qi(1)),i),n.sub(1),a.sub(1),o),gT(AT(r,s,i.add(qi(1))),n,a,o.sub(1)),gT(AT(r.add(qi(1)),s,i.add(qi(1))),n.sub(1),a,o.sub(1)),gT(AT(r,s.add(qi(1)),i.add(qi(1))),n,a.sub(1),o.sub(1)),gT(AT(r.add(qi(1)),s.add(qi(1)),i.add(qi(1))),n.sub(1),a.sub(1),o.sub(1)),u,l,d)).toVar();return _T(c)})).setLayout({name:"mx_perlin_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"}]})]),MT=Wf([ki((([e])=>{const t=Yi(e).toVar(),r=qi().toVar(),s=qi().toVar(),i=ji(lT(t.x,r)).toVar(),n=ji(lT(t.y,s)).toVar(),a=ji(wT(i)).toVar(),o=ji(wT(n)).toVar(),u=en(dT(yT(RT(r,s),i,n),yT(RT(r.add(qi(1)),s),i.sub(1),n),yT(RT(r,s.add(qi(1))),i,n.sub(1)),yT(RT(r.add(qi(1)),s.add(qi(1))),i.sub(1),n.sub(1)),a,o)).toVar();return TT(u)})).setLayout({name:"mx_perlin_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),ki((([e])=>{const t=en(e).toVar(),r=qi().toVar(),s=qi().toVar(),i=qi().toVar(),n=ji(lT(t.x,r)).toVar(),a=ji(lT(t.y,s)).toVar(),o=ji(lT(t.z,i)).toVar(),u=ji(wT(n)).toVar(),l=ji(wT(a)).toVar(),d=ji(wT(o)).toVar(),c=en(cT(yT(RT(r,s,i),n,a,o),yT(RT(r.add(qi(1)),s,i),n.sub(1),a,o),yT(RT(r,s.add(qi(1)),i),n,a.sub(1),o),yT(RT(r.add(qi(1)),s.add(qi(1)),i),n.sub(1),a.sub(1),o),yT(RT(r,s,i.add(qi(1))),n,a,o.sub(1)),yT(RT(r.add(qi(1)),s,i.add(qi(1))),n.sub(1),a,o.sub(1)),yT(RT(r,s.add(qi(1)),i.add(qi(1))),n,a.sub(1),o.sub(1)),yT(RT(r.add(qi(1)),s.add(qi(1)),i.add(qi(1))),n.sub(1),a.sub(1),o.sub(1)),u,l,d)).toVar();return _T(c)})).setLayout({name:"mx_perlin_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"}]})]),PT=Wf([ki((([e])=>{const t=ji(e).toVar(),r=qi(uT(t)).toVar();return ET(AT(r))})).setLayout({name:"mx_cell_noise_float_0",type:"float",inputs:[{name:"p",type:"float"}]}),ki((([e])=>{const t=Yi(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar();return ET(AT(r,s))})).setLayout({name:"mx_cell_noise_float_1",type:"float",inputs:[{name:"p",type:"vec2"}]}),ki((([e])=>{const t=en(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar(),i=qi(uT(t.z)).toVar();return ET(AT(r,s,i))})).setLayout({name:"mx_cell_noise_float_2",type:"float",inputs:[{name:"p",type:"vec3"}]}),ki((([e])=>{const t=nn(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar(),i=qi(uT(t.z)).toVar(),n=qi(uT(t.w)).toVar();return ET(AT(r,s,i,n))})).setLayout({name:"mx_cell_noise_float_3",type:"float",inputs:[{name:"p",type:"vec4"}]})]),LT=Wf([ki((([e])=>{const t=ji(e).toVar(),r=qi(uT(t)).toVar();return en(ET(AT(r,qi(0))),ET(AT(r,qi(1))),ET(AT(r,qi(2))))})).setLayout({name:"mx_cell_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"float"}]}),ki((([e])=>{const t=Yi(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar();return en(ET(AT(r,s,qi(0))),ET(AT(r,s,qi(1))),ET(AT(r,s,qi(2))))})).setLayout({name:"mx_cell_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),ki((([e])=>{const t=en(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar(),i=qi(uT(t.z)).toVar();return en(ET(AT(r,s,i,qi(0))),ET(AT(r,s,i,qi(1))),ET(AT(r,s,i,qi(2))))})).setLayout({name:"mx_cell_noise_vec3_2",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),ki((([e])=>{const t=nn(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar(),i=qi(uT(t.z)).toVar(),n=qi(uT(t.w)).toVar();return en(ET(AT(r,s,i,n,qi(0))),ET(AT(r,s,i,n,qi(1))),ET(AT(r,s,i,n,qi(2))))})).setLayout({name:"mx_cell_noise_vec3_3",type:"vec3",inputs:[{name:"p",type:"vec4"}]})]),FT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=qi(t).toVar(),o=en(e).toVar(),u=ji(0).toVar(),l=ji(1).toVar();return Zc(a,(()=>{u.addAssign(l.mul(CT(o))),l.mulAssign(i),o.mulAssign(n)})),u})).setLayout({name:"mx_fractal_noise_float",type:"float",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),BT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=qi(t).toVar(),o=en(e).toVar(),u=en(0).toVar(),l=ji(1).toVar();return Zc(a,(()=>{u.addAssign(l.mul(MT(o))),l.mulAssign(i),o.mulAssign(n)})),u})).setLayout({name:"mx_fractal_noise_vec3",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),IT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=qi(t).toVar(),o=en(e).toVar();return Yi(FT(o,a,n,i),FT(o.add(en(qi(19),qi(193),qi(17))),a,n,i))})).setLayout({name:"mx_fractal_noise_vec2",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),DT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=qi(t).toVar(),o=en(e).toVar(),u=en(BT(o,a,n,i)).toVar(),l=ji(FT(o.add(en(qi(19),qi(193),qi(17))),a,n,i)).toVar();return nn(u,l)})).setLayout({name:"mx_fractal_noise_vec4",type:"vec4",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),VT=Wf([ki((([e,t,r,s,i,n,a])=>{const o=qi(a).toVar(),u=ji(n).toVar(),l=qi(i).toVar(),d=qi(s).toVar(),c=qi(r).toVar(),h=qi(t).toVar(),p=Yi(e).toVar(),g=en(LT(Yi(h.add(d),c.add(l)))).toVar(),m=Yi(g.x,g.y).toVar();m.subAssign(.5),m.mulAssign(u),m.addAssign(.5);const f=Yi(Yi(ji(h),ji(c)).add(m)).toVar(),y=Yi(f.sub(p)).toVar();return Hi(o.equal(qi(2)),(()=>no(y.x).add(no(y.y)))),Hi(o.equal(qi(3)),(()=>_o(no(y.x),no(y.y)))),wo(y,y)})).setLayout({name:"mx_worley_distance_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),ki((([e,t,r,s,i,n,a,o,u])=>{const l=qi(u).toVar(),d=ji(o).toVar(),c=qi(a).toVar(),h=qi(n).toVar(),p=qi(i).toVar(),g=qi(s).toVar(),m=qi(r).toVar(),f=qi(t).toVar(),y=en(e).toVar(),x=en(LT(en(f.add(p),m.add(h),g.add(c)))).toVar();x.subAssign(.5),x.mulAssign(d),x.addAssign(.5);const b=en(en(ji(f),ji(m),ji(g)).add(x)).toVar(),T=en(b.sub(y)).toVar();return Hi(l.equal(qi(2)),(()=>no(T.x).add(no(T.y)).add(no(T.z)))),Hi(l.equal(qi(3)),(()=>_o(no(T.x),no(T.y),no(T.z)))),wo(T,T)})).setLayout({name:"mx_worley_distance_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"zoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]})]),UT=ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=Yi(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=Yi(lT(n.x,a),lT(n.y,o)).toVar(),l=ji(1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{const r=ji(VT(u,e,t,a,o,i,s)).toVar();l.assign(To(l,r))}))})),Hi(s.equal(qi(0)),(()=>{l.assign(qa(l))})),l})).setLayout({name:"mx_worley_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),OT=ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=Yi(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=Yi(lT(n.x,a),lT(n.y,o)).toVar(),l=Yi(1e6,1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{const r=ji(VT(u,e,t,a,o,i,s)).toVar();Hi(r.lessThan(l.x),(()=>{l.y.assign(l.x),l.x.assign(r)})).ElseIf(r.lessThan(l.y),(()=>{l.y.assign(r)}))}))})),Hi(s.equal(qi(0)),(()=>{l.assign(qa(l))})),l})).setLayout({name:"mx_worley_noise_vec2_0",type:"vec2",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),kT=ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=Yi(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=Yi(lT(n.x,a),lT(n.y,o)).toVar(),l=en(1e6,1e6,1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{const r=ji(VT(u,e,t,a,o,i,s)).toVar();Hi(r.lessThan(l.x),(()=>{l.z.assign(l.y),l.y.assign(l.x),l.x.assign(r)})).ElseIf(r.lessThan(l.y),(()=>{l.z.assign(l.y),l.y.assign(r)})).ElseIf(r.lessThan(l.z),(()=>{l.z.assign(r)}))}))})),Hi(s.equal(qi(0)),(()=>{l.assign(qa(l))})),l})).setLayout({name:"mx_worley_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),GT=Wf([UT,ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=en(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=qi().toVar(),l=en(lT(n.x,a),lT(n.y,o),lT(n.z,u)).toVar(),d=ji(1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{Zc({start:-1,end:qi(1),name:"z",condition:"<="},(({z:r})=>{const n=ji(VT(l,e,t,r,a,o,u,i,s)).toVar();d.assign(To(d,n))}))}))})),Hi(s.equal(qi(0)),(()=>{d.assign(qa(d))})),d})).setLayout({name:"mx_worley_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]})]),zT=Wf([OT,ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=en(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=qi().toVar(),l=en(lT(n.x,a),lT(n.y,o),lT(n.z,u)).toVar(),d=Yi(1e6,1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{Zc({start:-1,end:qi(1),name:"z",condition:"<="},(({z:r})=>{const n=ji(VT(l,e,t,r,a,o,u,i,s)).toVar();Hi(n.lessThan(d.x),(()=>{d.y.assign(d.x),d.x.assign(n)})).ElseIf(n.lessThan(d.y),(()=>{d.y.assign(n)}))}))}))})),Hi(s.equal(qi(0)),(()=>{d.assign(qa(d))})),d})).setLayout({name:"mx_worley_noise_vec2_1",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]})]),HT=Wf([kT,ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=en(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=qi().toVar(),l=en(lT(n.x,a),lT(n.y,o),lT(n.z,u)).toVar(),d=en(1e6,1e6,1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{Zc({start:-1,end:qi(1),name:"z",condition:"<="},(({z:r})=>{const n=ji(VT(l,e,t,r,a,o,u,i,s)).toVar();Hi(n.lessThan(d.x),(()=>{d.z.assign(d.y),d.y.assign(d.x),d.x.assign(n)})).ElseIf(n.lessThan(d.y),(()=>{d.z.assign(d.y),d.y.assign(n)})).ElseIf(n.lessThan(d.z),(()=>{d.z.assign(n)}))}))}))})),Hi(s.equal(qi(0)),(()=>{d.assign(qa(d))})),d})).setLayout({name:"mx_worley_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]})]),$T=ki((([e])=>{const t=e.y,r=e.z,s=en().toVar();return Hi(t.lessThan(1e-4),(()=>{s.assign(en(r,r,r))})).Else((()=>{let i=e.x;i=i.sub(Ka(i)).mul(6).toVar();const n=qi(mo(i)),a=i.sub(ji(n)),o=r.mul(t.oneMinus()),u=r.mul(t.mul(a).oneMinus()),l=r.mul(t.mul(a.oneMinus()).oneMinus());Hi(n.equal(qi(0)),(()=>{s.assign(en(r,l,o))})).ElseIf(n.equal(qi(1)),(()=>{s.assign(en(u,r,o))})).ElseIf(n.equal(qi(2)),(()=>{s.assign(en(o,r,l))})).ElseIf(n.equal(qi(3)),(()=>{s.assign(en(o,u,r))})).ElseIf(n.equal(qi(4)),(()=>{s.assign(en(l,o,r))})).Else((()=>{s.assign(en(r,o,u))}))})),s})).setLayout({name:"mx_hsvtorgb",type:"vec3",inputs:[{name:"hsv",type:"vec3"}]}),WT=ki((([e])=>{const t=en(e).toVar(),r=ji(t.x).toVar(),s=ji(t.y).toVar(),i=ji(t.z).toVar(),n=ji(To(r,To(s,i))).toVar(),a=ji(_o(r,_o(s,i))).toVar(),o=ji(a.sub(n)).toVar(),u=ji().toVar(),l=ji().toVar(),d=ji().toVar();return d.assign(a),Hi(a.greaterThan(0),(()=>{l.assign(o.div(a))})).Else((()=>{l.assign(0)})),Hi(l.lessThanEqual(0),(()=>{u.assign(0)})).Else((()=>{Hi(r.greaterThanEqual(a),(()=>{u.assign(s.sub(i).div(o))})).ElseIf(s.greaterThanEqual(a),(()=>{u.assign(oa(2,i.sub(r).div(o)))})).Else((()=>{u.assign(oa(4,r.sub(s).div(o)))})),u.mulAssign(1/6),Hi(u.lessThan(0),(()=>{u.addAssign(1)}))})),en(u,l,d)})).setLayout({name:"mx_rgbtohsv",type:"vec3",inputs:[{name:"c",type:"vec3"}]}),jT=ki((([e])=>{const t=en(e).toVar(),r=sn(ma(t,en(.04045))).toVar(),s=en(t.div(12.92)).toVar(),i=en(Ro(_o(t.add(en(.055)),en(0)).div(1.055),en(2.4))).toVar();return Io(s,i,r)})).setLayout({name:"mx_srgb_texture_to_lin_rec709",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),qT=(e,t)=>{e=ji(e),t=ji(t);const r=Yi(t.dFdx(),t.dFdy()).length().mul(.7071067811865476);return Oo(e.sub(r),e.add(r),t)},XT=(e,t,r,s)=>Io(e,t,r[s].clamp()),KT=(e,t,r,s,i)=>Io(e,t,qT(r,s[i])),YT=ki((([e,t,r])=>{const s=Qa(e).toVar(),i=ua(ji(.5).mul(t.sub(r)),Ol).div(s).toVar(),n=ua(ji(-.5).mul(t.sub(r)),Ol).div(s).toVar(),a=en().toVar();a.x=s.x.greaterThan(ji(0)).select(i.x,n.x),a.y=s.y.greaterThan(ji(0)).select(i.y,n.y),a.z=s.z.greaterThan(ji(0)).select(i.z,n.z);const o=To(a.x,a.y,a.z).toVar();return Ol.add(s.mul(o)).toVar().sub(r)})),QT=ki((([e,t])=>{const r=e.x,s=e.y,i=e.z;let n=t.element(0).mul(.886227);return n=n.add(t.element(1).mul(1.023328).mul(s)),n=n.add(t.element(2).mul(1.023328).mul(i)),n=n.add(t.element(3).mul(1.023328).mul(r)),n=n.add(t.element(4).mul(.858086).mul(r).mul(s)),n=n.add(t.element(5).mul(.858086).mul(s).mul(i)),n=n.add(t.element(6).mul(i.mul(i).mul(.743125).sub(.247708))),n=n.add(t.element(7).mul(.858086).mul(r).mul(i)),n=n.add(t.element(8).mul(.429043).mul(la(r,r).sub(la(s,s)))),n}));var ZT=Object.freeze({__proto__:null,BRDF_GGX:Bp,BRDF_Lambert:bp,BasicPointShadowFilter:jb,BasicShadowFilter:Rb,Break:Jc,Const:ru,Continue:()=>Du("continue").toStack(),DFGApprox:Ip,D_GGX:Pp,Discard:Vu,EPSILON:Ia,F_Schlick:xp,Fn:ki,INFINITY:Da,If:Hi,Loop:Zc,NodeAccess:Os,NodeShaderStage:Ds,NodeType:Us,NodeUpdateType:Vs,PCFShadowFilter:Cb,PCFSoftShadowFilter:Mb,PI:Va,PI2:Ua,PointShadowFilter:qb,Return:()=>Du("return").toStack(),Schlick_to_F0:Vp,ScriptableNodeResources:Bx,ShaderNode:Fi,Stack:$i,Switch:(...e)=>ni.Switch(...e),TBNViewMatrix:Bd,VSMShadowFilter:Pb,V_GGX_SmithCorrelated:Cp,Var:tu,abs:no,acesFilmicToneMapping:Tx,acos:so,add:oa,addMethodChaining:oi,addNodeElement:function(e){console.warn("THREE.TSL: AddNodeElement has been removed in favor of tree-shaking. Trying add",e)},agxToneMapping:Sx,all:Oa,alphaT:Rn,and:xa,anisotropy:Cn,anisotropyB:Pn,anisotropyT:Mn,any:ka,append:e=>(console.warn("THREE.TSL: append() has been renamed to Stack()."),$i(e)),array:ea,arrayBuffer:e=>Bi(new si(e,"ArrayBuffer")),asin:ro,assign:ra,atan:io,atan2:$o,atomicAdd:(e,t)=>sb(tb.ATOMIC_ADD,e,t),atomicAnd:(e,t)=>sb(tb.ATOMIC_AND,e,t),atomicFunc:sb,atomicLoad:e=>sb(tb.ATOMIC_LOAD,e,null),atomicMax:(e,t)=>sb(tb.ATOMIC_MAX,e,t),atomicMin:(e,t)=>sb(tb.ATOMIC_MIN,e,t),atomicOr:(e,t)=>sb(tb.ATOMIC_OR,e,t),atomicStore:(e,t)=>sb(tb.ATOMIC_STORE,e,t),atomicSub:(e,t)=>sb(tb.ATOMIC_SUB,e,t),atomicXor:(e,t)=>sb(tb.ATOMIC_XOR,e,t),attenuationColor:Hn,attenuationDistance:zn,attribute:Hu,attributeArray:(e,t="float")=>{let r,s;!0===t.isStruct?(r=t.layout.getLength(),s=ws("float")):(r=As(t),s=ws(t));const i=new My(e,r,s);return qc(i,t,e)},backgroundBlurriness:Dy,backgroundIntensity:Vy,backgroundRotation:Uy,batch:Hc,billboarding:Qf,bitAnd:va,bitNot:Na,bitOr:Sa,bitXor:Ea,bitangentGeometry:Rd,bitangentLocal:Cd,bitangentView:Md,bitangentWorld:Pd,bitcast:xo,blendBurn:Yy,blendColor:ex,blendDodge:Qy,blendOverlay:Jy,blendScreen:Zy,blur:Dg,bool:Ki,buffer:tl,bufferAttribute:_u,bumpMap:Hd,burn:(...e)=>(console.warn('THREE.TSL: "burn" has been renamed. Use "blendBurn" instead.'),Yy(e)),bvec2:Ji,bvec3:sn,bvec4:un,bypass:Pu,cache:Ru,call:ia,cameraFar:ul,cameraIndex:al,cameraNear:ol,cameraNormalMatrix:pl,cameraPosition:gl,cameraProjectionMatrix:ll,cameraProjectionMatrixInverse:dl,cameraViewMatrix:cl,cameraWorldMatrix:hl,cbrt:Fo,cdl:ux,ceil:Ya,checker:iT,cineonToneMapping:xx,clamp:Do,clearcoat:_n,clearcoatRoughness:vn,code:Ax,color:Wi,colorSpaceToWorking:hu,colorToDirection:e=>Bi(e).mul(2).sub(1),compute:wu,computeSkinning:(e,t=null)=>{const r=new Kc(e);return r.positionNode=qc(new L(e.geometry.getAttribute("position").array,3),"vec3").setPBO(!0).toReadOnly().element(Fc).toVar(),r.skinIndexNode=qc(new L(new Uint32Array(e.geometry.getAttribute("skinIndex").array),4),"uvec4").setPBO(!0).toReadOnly().element(Fc).toVar(),r.skinWeightNode=qc(new L(e.geometry.getAttribute("skinWeight").array,4),"vec4").setPBO(!0).toReadOnly().element(Fc).toVar(),r.bindMatrixNode=Zn(e.bindMatrix,"mat4"),r.bindMatrixInverseNode=Zn(e.bindMatrixInverse,"mat4"),r.boneMatricesNode=tl(e.skeleton.boneMatrices,"mat4",e.skeleton.bones.length),r.toPositionNode=t,Bi(r)},cond:Ko,context:Qo,convert:pn,convertColorSpace:(e,t,r)=>Bi(new du(Bi(e),t,r)),convertToTexture:(e,...t)=>e.isTextureNode?e:e.isPassNode?e.getTextureNode():Ey(e,...t),cos:eo,cross:Ao,cubeTexture:gd,cubeTextureBase:pd,cubeToUV:Wb,dFdx:co,dFdy:ho,dashSize:Dn,debug:Gu,decrement:Pa,decrementBefore:Ca,defaultBuildStages:Gs,defaultShaderStages:ks,defined:Pi,degrees:za,deltaTime:qf,densityFog:function(e,t){return console.warn('THREE.TSL: "densityFog( color, density )" is deprecated. Use "fog( color, densityFogFactor( density ) )" instead.'),kx(e,Ox(t))},densityFogFactor:Ox,depth:Dh,depthPass:(e,t,r)=>Bi(new gx(gx.DEPTH,e,t,r)),difference:Eo,diffuseColor:yn,directPointLight:rT,directionToColor:tp,dispersion:$n,distance:So,div:da,dodge:(...e)=>(console.warn('THREE.TSL: "dodge" has been renamed. Use "blendDodge" instead.'),Qy(e)),dot:wo,drawIndex:Vc,dynamicBufferAttribute:vu,element:hn,emissive:xn,equal:ha,equals:bo,equirectUV:np,exp:Ha,exp2:$a,expression:Du,faceDirection:Wl,faceForward:ko,faceforward:Wo,float:ji,floor:Ka,fog:kx,fract:Za,frameGroup:Xn,frameId:Xf,frontFacing:$l,fwidth:fo,gain:(e,t)=>e.lessThan(.5)?Of(e.mul(2),t).div(2):ua(1,Of(la(ua(1,e),2),t).div(2)),gapSize:Vn,getConstNodeType:Li,getCurrentStack:zi,getDirection:Lg,getDistanceAttenuation:tT,getGeometryRoughness:Ap,getNormalFromDepth:Ry,getParallaxCorrectNormal:YT,getRoughness:Rp,getScreenPosition:Ay,getShIrradianceAt:QT,getShadowMaterial:Fb,getShadowRenderObjectFunction:Db,getTextureIndex:If,getViewPosition:wy,globalId:Kx,glsl:(e,t)=>Ax(e,t,"glsl"),glslFn:(e,t)=>Cx(e,t,"glsl"),grayscale:sx,greaterThan:ma,greaterThanEqual:ya,hash:Uf,highpModelNormalViewMatrix:Il,highpModelViewMatrix:Bl,hue:ax,increment:Ma,incrementBefore:Ra,instance:Oc,instanceIndex:Fc,instancedArray:(e,t="float")=>{let r,s;!0===t.isStruct?(r=t.layout.getLength(),s=ws("float")):(r=As(t),s=ws(t));const i=new Cy(e,r,s);return qc(i,t,e)},instancedBufferAttribute:Nu,instancedDynamicBufferAttribute:Su,instancedMesh:Gc,int:qi,inverseSqrt:Xa,inversesqrt:jo,invocationLocalIndex:Dc,invocationSubgroupIndex:Ic,ior:On,iridescence:En,iridescenceIOR:wn,iridescenceThickness:An,ivec2:Qi,ivec3:tn,ivec4:an,js:(e,t)=>Ax(e,t,"js"),label:Zo,length:oo,lengthSq:Bo,lessThan:ga,lessThanEqual:fa,lightPosition:ub,lightProjectionUV:ob,lightShadowMatrix:ab,lightTargetDirection:cb,lightTargetPosition:lb,lightViewPosition:db,lightingContext:uh,lights:(e=[])=>Bi(new mb).setLights(e),linearDepth:Vh,linearToneMapping:fx,localId:Yx,log:Wa,log2:ja,logarithmicDepthToViewZ:(e,t,r)=>{const s=e.mul(Wa(r.div(t)));return ji(Math.E).pow(s).mul(t).negate()},loop:(...e)=>(console.warn("THREE.TSL: loop() has been renamed to Loop()."),Zc(...e)),luminance:ox,mat2:ln,mat3:dn,mat4:cn,matcapUV:Sm,materialAO:Rc,materialAlphaTest:jd,materialAnisotropy:cc,materialAnisotropyVector:Cc,materialAttenuationColor:bc,materialAttenuationDistance:xc,materialClearcoat:nc,materialClearcoatNormal:oc,materialClearcoatRoughness:ac,materialColor:qd,materialDispersion:wc,materialEmissive:Kd,materialEnvIntensity:nd,materialEnvRotation:ad,materialIOR:yc,materialIridescence:hc,materialIridescenceIOR:pc,materialIridescenceThickness:gc,materialLightMap:Ac,materialLineDashOffset:Sc,materialLineDashSize:_c,materialLineGapSize:vc,materialLineScale:Tc,materialLineWidth:Nc,materialMetalness:sc,materialNormal:ic,materialOpacity:Yd,materialPointSize:Ec,materialReference:Td,materialReflectivity:tc,materialRefractionRatio:id,materialRotation:uc,materialRoughness:rc,materialSheen:lc,materialSheenRoughness:dc,materialShininess:Xd,materialSpecular:Qd,materialSpecularColor:Jd,materialSpecularIntensity:Zd,materialSpecularStrength:ec,materialThickness:fc,materialTransmission:mc,max:_o,maxMipLevel:Xu,mediumpModelViewMatrix:Fl,metalness:Tn,min:To,mix:Io,mixElement:zo,mod:ca,modInt:Fa,modelDirection:Sl,modelNormalMatrix:Ml,modelPosition:wl,modelRadius:Cl,modelScale:Al,modelViewMatrix:Ll,modelViewPosition:Rl,modelViewProjection:Mc,modelWorldMatrix:El,modelWorldMatrixInverse:Pl,morphReference:ih,mrt:Vf,mul:la,mx_aastep:qT,mx_cell_noise_float:(e=$u())=>PT(e.convert("vec2|vec3")),mx_contrast:(e,t=1,r=.5)=>ji(e).sub(r).mul(t).add(r),mx_fractal_noise_float:(e=$u(),t=3,r=2,s=.5,i=1)=>FT(e,qi(t),r,s).mul(i),mx_fractal_noise_vec2:(e=$u(),t=3,r=2,s=.5,i=1)=>IT(e,qi(t),r,s).mul(i),mx_fractal_noise_vec3:(e=$u(),t=3,r=2,s=.5,i=1)=>BT(e,qi(t),r,s).mul(i),mx_fractal_noise_vec4:(e=$u(),t=3,r=2,s=.5,i=1)=>DT(e,qi(t),r,s).mul(i),mx_hsvtorgb:$T,mx_noise_float:(e=$u(),t=1,r=0)=>CT(e.convert("vec2|vec3")).mul(t).add(r),mx_noise_vec3:(e=$u(),t=1,r=0)=>MT(e.convert("vec2|vec3")).mul(t).add(r),mx_noise_vec4:(e=$u(),t=1,r=0)=>{e=e.convert("vec2|vec3");return nn(MT(e),CT(e.add(Yi(19,73)))).mul(t).add(r)},mx_ramplr:(e,t,r=$u())=>XT(e,t,r,"x"),mx_ramptb:(e,t,r=$u())=>XT(e,t,r,"y"),mx_rgbtohsv:WT,mx_safepower:(e,t=1)=>(e=ji(e)).abs().pow(t).mul(e.sign()),mx_splitlr:(e,t,r,s=$u())=>KT(e,t,r,s,"x"),mx_splittb:(e,t,r,s=$u())=>KT(e,t,r,s,"y"),mx_srgb_texture_to_lin_rec709:jT,mx_transform_uv:(e=1,t=0,r=$u())=>r.mul(e).add(t),mx_worley_noise_float:(e=$u(),t=1)=>GT(e.convert("vec2|vec3"),t,qi(1)),mx_worley_noise_vec2:(e=$u(),t=1)=>zT(e.convert("vec2|vec3"),t,qi(1)),mx_worley_noise_vec3:(e=$u(),t=1)=>HT(e.convert("vec2|vec3"),t,qi(1)),namespace:Cu,negate:uo,neutralToneMapping:Ex,nodeArray:Di,nodeImmutable:Ui,nodeObject:Bi,nodeObjects:Ii,nodeProxy:Vi,normalFlat:Xl,normalGeometry:jl,normalLocal:ql,normalMap:Od,normalView:Kl,normalWorld:Yl,normalize:Qa,not:Ta,notEqual:pa,numWorkgroups:qx,objectDirection:yl,objectGroup:Yn,objectPosition:bl,objectRadius:vl,objectScale:Tl,objectViewPosition:_l,objectWorldMatrix:xl,oneMinus:lo,or:ba,orthographicDepthToViewZ:(e,t,r)=>t.sub(r).mul(e).sub(t),oscSawtooth:(e=jf)=>e.fract(),oscSine:(e=jf)=>e.add(.75).mul(2*Math.PI).sin().mul(.5).add(.5),oscSquare:(e=jf)=>e.fract().round(),oscTriangle:(e=jf)=>e.add(.5).fract().mul(2).sub(1).abs(),output:In,outputStruct:Bf,overlay:(...e)=>(console.warn('THREE.TSL: "overlay" has been renamed. Use "blendOverlay" instead.'),Jy(e)),overloadingFn:Wf,parabola:Of,parallaxDirection:Id,parallaxUV:(e,t)=>e.sub(Id.mul(t)),parameter:(e,t)=>Bi(new Rf(e,t)),pass:(e,t,r)=>Bi(new gx(gx.COLOR,e,t,r)),passTexture:(e,t)=>Bi(new hx(e,t)),pcurve:(e,t,r)=>Ro(da(Ro(e,t),oa(Ro(e,t),Ro(ua(1,e),r))),1/t),perspectiveDepthToViewZ:Fh,pmremTexture:um,pointShadow:Jb,pointUV:Ly,pointWidth:Un,positionGeometry:Dl,positionLocal:Vl,positionPrevious:Ul,positionView:Gl,positionViewDirection:zl,positionWorld:Ol,positionWorldDirection:kl,posterize:dx,pow:Ro,pow2:Co,pow3:Mo,pow4:Po,premult:tx,property:mn,radians:Ga,rand:Go,range:$x,rangeFog:function(e,t,r){return console.warn('THREE.TSL: "rangeFog( color, near, far )" is deprecated. Use "fog( color, rangeFogFactor( near, far ) )" instead.'),kx(e,Ux(t,r))},rangeFogFactor:Ux,reciprocal:go,reference:yd,referenceBuffer:xd,reflect:No,reflectVector:ld,reflectView:od,reflector:e=>Bi(new yy(e)),refract:Uo,refractVector:dd,refractView:ud,reinhardToneMapping:yx,remainder:La,remap:Fu,remapClamp:Bu,renderGroup:Kn,renderOutput:Ou,rendererReference:fu,rotate:Rm,rotateUV:Kf,roughness:bn,round:po,rtt:Ey,sRGBTransferEOTF:ou,sRGBTransferOETF:uu,sampler:e=>(!0===e.isNode?e:Zu(e)).convert("sampler"),samplerComparison:e=>(!0===e.isNode?e:Zu(e)).convert("samplerComparison"),saturate:Vo,saturation:ix,screen:(...e)=>(console.warn('THREE.TSL: "screen" has been renamed. Use "blendScreen" instead.'),Zy(e)),screenCoordinate:mh,screenSize:gh,screenUV:ph,scriptable:Dx,scriptableValue:Px,select:Xo,setCurrentStack:Gi,shaderStages:zs,shadow:Hb,shadowPositionWorld:yb,shapeCircle:nT,sharedUniformGroup:qn,sheen:Nn,sheenRoughness:Sn,shiftLeft:wa,shiftRight:Aa,shininess:Bn,sign:ao,sin:Ja,sinc:(e,t)=>Ja(Va.mul(t.mul(e).sub(1))).div(Va.mul(t.mul(e).sub(1))),skinning:Yc,smoothstep:Oo,smoothstepElement:Ho,specularColor:Ln,specularF90:Fn,spherizeUV:Yf,split:(e,t)=>Bi(new Zs(Bi(e),t)),spritesheetUV:ey,sqrt:qa,stack:Mf,step:vo,storage:qc,storageBarrier:()=>Zx("storage").toStack(),storageObject:(e,t,r)=>(console.warn('THREE.TSL: "storageObject()" is deprecated. Use "storage().setPBO( true )" instead.'),qc(e,t,r).setPBO(!0)),storageTexture:ky,string:(e="")=>Bi(new si(e,"string")),struct:(e,t=null)=>{const r=new Pf(e,t),s=(...t)=>{let s=null;if(t.length>0)if(t[0].isNode){s={};const r=Object.keys(e);for(let e=0;eZx("texture").toStack(),textureBicubic:rg,textureCubeUV:Fg,textureLoad:Ju,textureSize:ju,textureStore:(e,t,r)=>{const s=ky(e,t,r);return null!==r&&s.toStack(),s},thickness:Gn,time:jf,timerDelta:(e=1)=>(console.warn('TSL: timerDelta() is deprecated. Use "deltaTime" instead.'),qf.mul(e)),timerGlobal:(e=1)=>(console.warn('TSL: timerGlobal() is deprecated. Use "time" instead.'),jf.mul(e)),timerLocal:(e=1)=>(console.warn('TSL: timerLocal() is deprecated. Use "time" instead.'),jf.mul(e)),toneMapping:xu,toneMappingExposure:bu,toonOutlinePass:(t,r,s=new e(0,0,0),i=.003,n=1)=>Bi(new mx(t,r,Bi(s),Bi(i),Bi(n))),transformDirection:Lo,transformNormal:ed,transformNormalToView:td,transformedBentNormalView:Dd,transformedBitangentView:Ld,transformedBitangentWorld:Fd,transformedClearcoatNormalView:Jl,transformedNormalView:Ql,transformedNormalWorld:Zl,transformedTangentView:Ed,transformedTangentWorld:wd,transmission:kn,transpose:yo,triNoise3D:zf,triplanarTexture:(...e)=>ry(...e),triplanarTextures:ry,trunc:mo,tslFn:(...e)=>(console.warn("THREE.TSL: tslFn() has been renamed to Fn()."),ki(...e)),uint:Xi,uniform:Zn,uniformArray:il,uniformCubeTexture:(e=cd)=>pd(e),uniformGroup:jn,uniformTexture:(e=Ku)=>Zu(e),uniforms:(e,t)=>(console.warn("THREE.TSL: uniforms() has been renamed to uniformArray()."),Bi(new sl(e,t))),unpremult:rx,userData:(e,t,r)=>Bi(new $y(e,t,r)),uv:$u,uvec2:Zi,uvec3:rn,uvec4:on,varying:nu,varyingProperty:fn,vec2:Yi,vec3:en,vec4:nn,vectorComponents:Hs,velocity:Ky,vertexColor:$h,vertexIndex:Lc,vertexStage:au,vibrance:nx,viewZToLogarithmicDepth:Bh,viewZToOrthographicDepth:Ph,viewZToPerspectiveDepth:Lh,viewport:fh,viewportBottomLeft:vh,viewportCoordinate:xh,viewportDepthTexture:Ch,viewportLinearDepth:Uh,viewportMipTexture:wh,viewportResolution:Th,viewportSafeUV:Zf,viewportSharedTexture:Zh,viewportSize:yh,viewportTexture:Eh,viewportTopLeft:_h,viewportUV:bh,wgsl:(e,t)=>Ax(e,t,"wgsl"),wgslFn:(e,t)=>Cx(e,t,"wgsl"),workgroupArray:(e,t)=>Bi(new eb("Workgroup",e,t)),workgroupBarrier:()=>Zx("workgroup").toStack(),workgroupId:Xx,workingToColorSpace:cu,xor:_a});const JT=new Af;class e_ extends qm{constructor(e,t){super(),this.renderer=e,this.nodes=t}update(e,t,r){const s=this.renderer,i=this.nodes.getBackgroundNode(e)||e.background;let n=!1;if(null===i)s._clearColor.getRGB(JT),JT.a=s._clearColor.a;else if(!0===i.isColor)i.getRGB(JT),JT.a=1,n=!0;else if(!0===i.isNode){const o=this.get(e),u=i;JT.copy(s._clearColor);let l=o.backgroundMesh;if(void 0===l){const c=Qo(nn(u).mul(Vy),{getUV:()=>Uy.mul(Yl),getTextureLevel:()=>Dy});let h=Mc;h=h.setZ(h.w);const p=new Wh;function g(){i.removeEventListener("dispose",g),l.material.dispose(),l.geometry.dispose()}p.name="Background.material",p.side=S,p.depthTest=!1,p.depthWrite=!1,p.allowOverride=!1,p.fog=!1,p.lights=!1,p.vertexNode=h,p.colorNode=c,o.backgroundMeshNode=c,o.backgroundMesh=l=new q(new Oe(1,32,32),p),l.frustumCulled=!1,l.name="Background.mesh",l.onBeforeRender=function(e,t,r){this.matrixWorld.copyPosition(r.matrixWorld)},i.addEventListener("dispose",g)}const d=u.getCacheKey();o.backgroundCacheKey!==d&&(o.backgroundMeshNode.node=nn(u).mul(Vy),o.backgroundMeshNode.needsUpdate=!0,l.material.needsUpdate=!0,o.backgroundCacheKey=d),t.unshift(l,l.geometry,l.material,0,0,null,null)}else console.error("THREE.Renderer: Unsupported background configuration.",i);const a=s.xr.getEnvironmentBlendMode();if("additive"===a?JT.set(0,0,0,1):"alpha-blend"===a&&JT.set(0,0,0,0),!0===s.autoClear||!0===n){const m=r.clearColorValue;m.r=JT.r,m.g=JT.g,m.b=JT.b,m.a=JT.a,!0!==s.backend.isWebGLBackend&&!0!==s.alpha||(m.r*=m.a,m.g*=m.a,m.b*=m.a),r.depthClearValue=s._clearDepth,r.stencilClearValue=s._clearStencil,r.clearColor=!0===s.autoClearColor,r.clearDepth=!0===s.autoClearDepth,r.clearStencil=!0===s.autoClearStencil}else r.clearColor=!1,r.clearDepth=!1,r.clearStencil=!1}}let t_=0;class r_{constructor(e="",t=[],r=0,s=[]){this.name=e,this.bindings=t,this.index=r,this.bindingsReference=s,this.id=t_++}}class s_{constructor(e,t,r,s,i,n,a,o,u,l=[]){this.vertexShader=e,this.fragmentShader=t,this.computeShader=r,this.transforms=l,this.nodeAttributes=s,this.bindings=i,this.updateNodes=n,this.updateBeforeNodes=a,this.updateAfterNodes=o,this.observer=u,this.usedTimes=0}createBindings(){const e=[];for(const t of this.bindings){if(!0!==t.bindings[0].groupNode.shared){const r=new r_(t.name,[],t.index,t);e.push(r);for(const e of t.bindings)r.bindings.push(e.clone())}else e.push(t)}return e}}class i_{constructor(e,t,r=null){this.isNodeAttribute=!0,this.name=e,this.type=t,this.node=r}}class n_{constructor(e,t,r){this.isNodeUniform=!0,this.name=e,this.type=t,this.node=r.getSelf()}get value(){return this.node.value}set value(e){this.node.value=e}get id(){return this.node.id}get groupNode(){return this.node.groupNode}}class a_{constructor(e,t,r=!1,s=null){this.isNodeVar=!0,this.name=e,this.type=t,this.readOnly=r,this.count=s}}class o_ extends a_{constructor(e,t,r=null,s=null){super(e,t),this.needsInterpolation=!1,this.isNodeVarying=!0,this.interpolationType=r,this.interpolationSampling=s}}class u_{constructor(e,t,r=""){this.name=e,this.type=t,this.code=r,Object.defineProperty(this,"isNodeCode",{value:!0})}}let l_=0;class d_{constructor(e=null){this.id=l_++,this.nodesData=new WeakMap,this.parent=e}getData(e){let t=this.nodesData.get(e);return void 0===t&&null!==this.parent&&(t=this.parent.getData(e)),t}setData(e,t){this.nodesData.set(e,t)}}class c_{constructor(e,t){this.name=e,this.members=t,this.output=!1}}class h_{constructor(e,t){this.name=e,this.value=t,this.boundary=0,this.itemSize=0,this.offset=0}setValue(e){this.value=e}getValue(){return this.value}}class p_ extends h_{constructor(e,t=0){super(e,t),this.isNumberUniform=!0,this.boundary=4,this.itemSize=1}}class g_ extends h_{constructor(e,r=new t){super(e,r),this.isVector2Uniform=!0,this.boundary=8,this.itemSize=2}}class m_ extends h_{constructor(e,t=new r){super(e,t),this.isVector3Uniform=!0,this.boundary=16,this.itemSize=3}}class f_ extends h_{constructor(e,t=new s){super(e,t),this.isVector4Uniform=!0,this.boundary=16,this.itemSize=4}}class y_ extends h_{constructor(t,r=new e){super(t,r),this.isColorUniform=!0,this.boundary=16,this.itemSize=3}}class x_ extends h_{constructor(e,t=new i){super(e,t),this.isMatrix2Uniform=!0,this.boundary=8,this.itemSize=4}}class b_ extends h_{constructor(e,t=new n){super(e,t),this.isMatrix3Uniform=!0,this.boundary=48,this.itemSize=12}}class T_ extends h_{constructor(e,t=new a){super(e,t),this.isMatrix4Uniform=!0,this.boundary=64,this.itemSize=16}}class __ extends p_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class v_ extends g_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class N_ extends m_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class S_ extends f_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class E_ extends y_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class w_ extends x_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class A_ extends b_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class R_ extends T_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}const C_=new WeakMap,M_=new Map([[Int8Array,"int"],[Int16Array,"int"],[Int32Array,"int"],[Uint8Array,"uint"],[Uint16Array,"uint"],[Uint32Array,"uint"],[Float32Array,"float"]]),P_=e=>/e/g.test(e)?String(e).replace(/\+/g,""):(e=Number(e))+(e%1?"":".0");class L_{constructor(e,t,r){this.object=e,this.material=e&&e.material||null,this.geometry=e&&e.geometry||null,this.renderer=t,this.parser=r,this.scene=null,this.camera=null,this.nodes=[],this.sequentialNodes=[],this.updateNodes=[],this.updateBeforeNodes=[],this.updateAfterNodes=[],this.hashNodes={},this.observer=null,this.lightsNode=null,this.environmentNode=null,this.fogNode=null,this.clippingContext=null,this.vertexShader=null,this.fragmentShader=null,this.computeShader=null,this.flowNodes={vertex:[],fragment:[],compute:[]},this.flowCode={vertex:"",fragment:"",compute:""},this.uniforms={vertex:[],fragment:[],compute:[],index:0},this.structs={vertex:[],fragment:[],compute:[],index:0},this.bindings={vertex:{},fragment:{},compute:{}},this.bindingsIndexes={},this.bindGroups=null,this.attributes=[],this.bufferAttributes=[],this.varyings=[],this.codes={},this.vars={},this.declarations={},this.flow={code:""},this.chaining=[],this.stack=Mf(),this.stacks=[],this.tab="\t",this.currentFunctionNode=null,this.context={material:this.material},this.cache=new d_,this.globalCache=this.cache,this.flowsData=new WeakMap,this.shaderStage=null,this.buildStage=null}getBindGroupsCache(){let e=C_.get(this.renderer);return void 0===e&&(e=new zm,C_.set(this.renderer,e)),e}createRenderTarget(e,t,r){return new oe(e,t,r)}createCubeRenderTarget(e,t){return new ap(e,t)}includes(e){return this.nodes.includes(e)}getOutputStructName(){}_getBindGroup(e,t){const r=this.getBindGroupsCache(),s=[];let i,n=!0;for(const e of t)s.push(e),n=n&&!0!==e.groupNode.shared;return n?(i=r.get(s),void 0===i&&(i=new r_(e,s,this.bindingsIndexes[e].group,s),r.set(s,i))):i=new r_(e,s,this.bindingsIndexes[e].group,s),i}getBindGroupArray(e,t){const r=this.bindings[t];let s=r[e];return void 0===s&&(void 0===this.bindingsIndexes[e]&&(this.bindingsIndexes[e]={binding:0,group:Object.keys(this.bindingsIndexes).length}),r[e]=s=[]),s}getBindings(){let e=this.bindGroups;if(null===e){const t={},r=this.bindings;for(const e of zs)for(const s in r[e]){const i=r[e][s];(t[s]||(t[s]=[])).push(...i)}e=[];for(const r in t){const s=t[r],i=this._getBindGroup(r,s);e.push(i)}this.bindGroups=e}return e}sortBindingGroups(){const e=this.getBindings();e.sort(((e,t)=>e.bindings[0].groupNode.order-t.bindings[0].groupNode.order));for(let t=0;t=0?`${Math.round(n)}u`:"0u";if("bool"===i)return n?"true":"false";if("color"===i)return`${this.getType("vec3")}( ${P_(n.r)}, ${P_(n.g)}, ${P_(n.b)} )`;const a=this.getTypeLength(i),o=this.getComponentType(i),u=e=>this.generateConst(o,e);if(2===a)return`${this.getType(i)}( ${u(n.x)}, ${u(n.y)} )`;if(3===a)return`${this.getType(i)}( ${u(n.x)}, ${u(n.y)}, ${u(n.z)} )`;if(4===a&&"mat2"!==i)return`${this.getType(i)}( ${u(n.x)}, ${u(n.y)}, ${u(n.z)}, ${u(n.w)} )`;if(a>=4&&n&&(n.isMatrix2||n.isMatrix3||n.isMatrix4))return`${this.getType(i)}( ${n.elements.map(u).join(", ")} )`;if(a>4)return`${this.getType(i)}()`;throw new Error(`NodeBuilder: Type '${i}' not found in generate constant attempt.`)}getType(e){return"color"===e?"vec3":e}hasGeometryAttribute(e){return this.geometry&&void 0!==this.geometry.getAttribute(e)}getAttribute(e,t){const r=this.attributes;for(const t of r)if(t.name===e)return t;const s=new i_(e,t);return this.registerDeclaration(s),r.push(s),s}getPropertyName(e){return e.name}isVector(e){return/vec\d/.test(e)}isMatrix(e){return/mat\d/.test(e)}isReference(e){return"void"===e||"property"===e||"sampler"===e||"samplerComparison"===e||"texture"===e||"cubeTexture"===e||"storageTexture"===e||"depthTexture"===e||"texture3D"===e}needsToWorkingColorSpace(){return!1}getComponentTypeFromTexture(e){const t=e.type;if(e.isDataTexture){if(t===_)return"int";if(t===T)return"uint"}return"float"}getElementType(e){return"mat2"===e?"vec2":"mat3"===e?"vec3":"mat4"===e?"vec4":this.getComponentType(e)}getComponentType(e){if("float"===(e=this.getVectorType(e))||"bool"===e||"int"===e||"uint"===e)return e;const t=/(b|i|u|)(vec|mat)([2-4])/.exec(e);return null===t?null:"b"===t[1]?"bool":"i"===t[1]?"int":"u"===t[1]?"uint":"float"}getVectorType(e){return"color"===e?"vec3":"texture"===e||"cubeTexture"===e||"storageTexture"===e||"texture3D"===e?"vec4":e}getTypeFromLength(e,t="float"){if(1===e)return t;let r=Es(e);const s="float"===t?"":t[0];return!0===/mat2/.test(t)&&(r=r.replace("vec","mat")),s+r}getTypeFromArray(e){return M_.get(e.constructor)}isInteger(e){return/int|uint|(i|u)vec/.test(e)}getTypeFromAttribute(e){let t=e;e.isInterleavedBufferAttribute&&(t=e.data);const r=t.array,s=e.itemSize,i=e.normalized;let n;return e instanceof ze||!0===i||(n=this.getTypeFromArray(r)),this.getTypeFromLength(s,n)}getTypeLength(e){const t=this.getVectorType(e),r=/vec([2-4])/.exec(t);return null!==r?Number(r[1]):"float"===t||"bool"===t||"int"===t||"uint"===t?1:!0===/mat2/.test(e)?4:!0===/mat3/.test(e)?9:!0===/mat4/.test(e)?16:0}getVectorFromMatrix(e){return e.replace("mat","vec")}changeComponentType(e,t){return this.getTypeFromLength(this.getTypeLength(e),t)}getIntegerType(e){const t=this.getComponentType(e);return"int"===t||"uint"===t?e:this.changeComponentType(e,"int")}addStack(){return this.stack=Mf(this.stack),this.stacks.push(zi()||this.stack),Gi(this.stack),this.stack}removeStack(){const e=this.stack;return this.stack=e.parent,Gi(this.stacks.pop()),e}getDataFromNode(e,t=this.shaderStage,r=null){let s=(r=null===r?e.isGlobal(this)?this.globalCache:this.cache:r).getData(e);return void 0===s&&(s={},r.setData(e,s)),void 0===s[t]&&(s[t]={}),s[t]}getNodeProperties(e,t="any"){const r=this.getDataFromNode(e,t);return r.properties||(r.properties={outputNode:null})}getBufferAttributeFromNode(e,t){const r=this.getDataFromNode(e);let s=r.bufferAttribute;if(void 0===s){const i=this.uniforms.index++;s=new i_("nodeAttribute"+i,t,e),this.bufferAttributes.push(s),r.bufferAttribute=s}return s}getStructTypeFromNode(e,t,r=null,s=this.shaderStage){const i=this.getDataFromNode(e,s,this.globalCache);let n=i.structType;if(void 0===n){const e=this.structs.index++;null===r&&(r="StructType"+e),n=new c_(r,t),this.structs[s].push(n),i.structType=n}return n}getOutputStructTypeFromNode(e,t){const r=this.getStructTypeFromNode(e,t,"OutputType","fragment");return r.output=!0,r}getUniformFromNode(e,t,r=this.shaderStage,s=null){const i=this.getDataFromNode(e,r,this.globalCache);let n=i.uniform;if(void 0===n){const a=this.uniforms.index++;n=new n_(s||"nodeUniform"+a,t,e),this.uniforms[r].push(n),this.registerDeclaration(n),i.uniform=n}return n}getArrayCount(e){let t=null;return e.isArrayNode?t=e.count:e.isVarNode&&e.node.isArrayNode&&(t=e.node.count),t}getVarFromNode(e,t=null,r=e.getNodeType(this),s=this.shaderStage,i=!1){const n=this.getDataFromNode(e,s);let a=n.variable;if(void 0===a){const o=i?"_const":"_var",u=this.vars[s]||(this.vars[s]=[]),l=this.vars[o]||(this.vars[o]=0);null===t&&(t=(i?"nodeConst":"nodeVar")+l,this.vars[o]++);const d=this.getArrayCount(e);a=new a_(t,r,i,d),i||u.push(a),this.registerDeclaration(a),n.variable=a}return a}isDeterministic(e){if(e.isMathNode)return this.isDeterministic(e.aNode)&&(!e.bNode||this.isDeterministic(e.bNode))&&(!e.cNode||this.isDeterministic(e.cNode));if(e.isOperatorNode)return this.isDeterministic(e.aNode)&&(!e.bNode||this.isDeterministic(e.bNode));if(e.isArrayNode){if(null!==e.values)for(const t of e.values)if(!this.isDeterministic(t))return!1;return!0}return!!e.isConstNode}getVaryingFromNode(e,t=null,r=e.getNodeType(this),s=null,i=null){const n=this.getDataFromNode(e,"any");let a=n.varying;if(void 0===a){const e=this.varyings,o=e.length;null===t&&(t="nodeVarying"+o),a=new o_(t,r,s,i),e.push(a),this.registerDeclaration(a),n.varying=a}return a}get namespace(){return this.context.namespace}getOutputNamespace(){return this.getNamespace("outputNode")}getNamespace(e=""){const t=this.namespace;let r;return r=t?e?t+"_"+e:t:e,r}registerDeclaration(e){const t=this.shaderStage,r=this.declarations[t]||(this.declarations[t]={}),s=this.getPropertyName(e);let i=1,n=s;for(;void 0!==r[n];)n=s+"_"+i++;i>1&&(e.name=n,console.warn(`THREE.TSL: Declaration name '${s}' of '${e.type}' already in use. Renamed to '${n}'.`)),r[n]=e}getCodeFromNode(e,t,r=this.shaderStage){const s=this.getDataFromNode(e);let i=s.code;if(void 0===i){const e=this.codes[r]||(this.codes[r]=[]),n=e.length;i=new u_("nodeCode"+n,t),e.push(i),s.code=i}return i}addFlowCodeHierarchy(e,t){const{flowCodes:r,flowCodeBlock:s}=this.getDataFromNode(e);let i=!0,n=t;for(;n;){if(!0===s.get(n)){i=!1;break}n=this.getDataFromNode(n).parentNodeBlock}if(i)for(const e of r)this.addLineFlowCode(e)}addLineFlowCodeBlock(e,t,r){const s=this.getDataFromNode(e),i=s.flowCodes||(s.flowCodes=[]),n=s.flowCodeBlock||(s.flowCodeBlock=new WeakMap);i.push(t),n.set(r,!0)}addLineFlowCode(e,t=null){return""===e||(null!==t&&this.context.nodeBlock&&this.addLineFlowCodeBlock(t,e,this.context.nodeBlock),e=this.tab+e,/;\s*$/.test(e)||(e+=";\n"),this.flow.code+=e),this}addFlowCode(e){return this.flow.code+=e,this}addFlowTab(){return this.tab+="\t",this}removeFlowTab(){return this.tab=this.tab.slice(0,-1),this}getFlowData(e){return this.flowsData.get(e)}flowNode(e){const t=e.getNodeType(this),r=this.flowChildNode(e,t);return this.flowsData.set(e,r),r}addInclude(e){null!==this.currentFunctionNode&&this.currentFunctionNode.includes.push(e)}buildFunctionNode(e){const t=new Rx,r=this.currentFunctionNode;return this.currentFunctionNode=t,t.code=this.buildFunctionCode(e),this.currentFunctionNode=r,t}flowShaderNode(e){const t=e.layout,r={[Symbol.iterator](){let e=0;const t=Object.values(this);return{next:()=>({value:t[e],done:e++>=t.length})}}};for(const e of t.inputs)r[e.name]=new Rf(e.type,e.name);e.layout=null;const s=e.call(r),i=this.flowStagesNode(s,t.type);return e.layout=t,i}flowStagesNode(e,t=null){const r=this.flow,s=this.vars,i=this.declarations,n=this.cache,a=this.buildStage,o=this.stack,u={code:""};this.flow=u,this.vars={},this.declarations={},this.cache=new d_,this.stack=Mf();for(const r of Gs)this.setBuildStage(r),u.result=e.build(this,t);return u.vars=this.getVars(this.shaderStage),this.flow=r,this.vars=s,this.declarations=i,this.cache=n,this.stack=o,this.setBuildStage(a),u}getFunctionOperator(){return null}buildFunctionCode(){console.warn("Abstract function.")}flowChildNode(e,t=null){const r=this.flow,s={code:""};return this.flow=s,s.result=e.build(this,t),this.flow=r,s}flowNodeFromShaderStage(e,t,r=null,s=null){const i=this.tab,n=this.cache,a=this.shaderStage,o=this.context;this.setShaderStage(e);const u={...this.context};delete u.nodeBlock,this.cache=this.globalCache,this.tab="\t",this.context=u;let l=null;if("generate"===this.buildStage){const i=this.flowChildNode(t,r);null!==s&&(i.code+=`${this.tab+s} = ${i.result};\n`),this.flowCode[e]=this.flowCode[e]+i.code,l=i}else l=t.build(this);return this.setShaderStage(a),this.cache=n,this.tab=i,this.context=o,l}getAttributesArray(){return this.attributes.concat(this.bufferAttributes)}getAttributes(){console.warn("Abstract function.")}getVaryings(){console.warn("Abstract function.")}getVar(e,t,r=null){return`${null!==r?this.generateArrayDeclaration(e,r):this.getType(e)} ${t}`}getVars(e){let t="";const r=this.vars[e];if(void 0!==r)for(const e of r)t+=`${this.getVar(e.type,e.name)}; `;return t}getUniforms(){console.warn("Abstract function.")}getCodes(e){const t=this.codes[e];let r="";if(void 0!==t)for(const e of t)r+=e.code+"\n";return r}getHash(){return this.vertexShader+this.fragmentShader+this.computeShader}setShaderStage(e){this.shaderStage=e}getShaderStage(){return this.shaderStage}setBuildStage(e){this.buildStage=e}getBuildStage(){return this.buildStage}buildCode(){console.warn("Abstract function.")}build(){const{object:e,material:t,renderer:r}=this;if(null!==t){let e=r.library.fromMaterial(t);null===e&&(console.error(`NodeMaterial: Material "${t.type}" is not compatible.`),e=new Wh),e.build(this)}else this.addFlow("compute",e);for(const e of Gs){this.setBuildStage(e),this.context.vertex&&this.context.vertex.isNode&&this.flowNodeFromShaderStage("vertex",this.context.vertex);for(const t of zs){this.setShaderStage(t);const r=this.flowNodes[t];for(const t of r)"generate"===e?this.flowNode(t):t.build(this)}}return this.setBuildStage(null),this.setShaderStage(null),this.buildCode(),this.buildUpdateNodes(),this}getNodeUniform(e,t){if("float"===t||"int"===t||"uint"===t)return new __(e);if("vec2"===t||"ivec2"===t||"uvec2"===t)return new v_(e);if("vec3"===t||"ivec3"===t||"uvec3"===t)return new N_(e);if("vec4"===t||"ivec4"===t||"uvec4"===t)return new S_(e);if("color"===t)return new E_(e);if("mat2"===t)return new w_(e);if("mat3"===t)return new A_(e);if("mat4"===t)return new R_(e);throw new Error(`Uniform "${t}" not declared.`)}format(e,t,r){if((t=this.getVectorType(t))===(r=this.getVectorType(r))||null===r||this.isReference(r))return e;const s=this.getTypeLength(t),i=this.getTypeLength(r);return 16===s&&9===i?`${this.getType(r)}( ${e}[ 0 ].xyz, ${e}[ 1 ].xyz, ${e}[ 2 ].xyz )`:9===s&&4===i?`${this.getType(r)}( ${e}[ 0 ].xy, ${e}[ 1 ].xy )`:s>4||i>4||0===i?e:s===i?`${this.getType(r)}( ${e} )`:s>i?(e="bool"===r?`all( ${e} )`:`${e}.${"xyz".slice(0,i)}`,this.format(e,this.getTypeFromLength(i,this.getComponentType(t)),r)):4===i&&s>1?`${this.getType(r)}( ${this.format(e,t,"vec3")}, 1.0 )`:2===s?`${this.getType(r)}( ${this.format(e,t,"vec2")}, 0.0 )`:(1===s&&i>1&&t!==this.getComponentType(r)&&(e=`${this.getType(this.getComponentType(r))}( ${e} )`),`${this.getType(r)}( ${e} )`)}getSignature(){return`// Three.js r${He} - Node System\n`}*[Symbol.iterator](){}createNodeMaterial(e="NodeMaterial"){throw new Error(`THREE.NodeBuilder: createNodeMaterial() was deprecated. Use new ${e}() instead.`)}}class F_{constructor(){this.time=0,this.deltaTime=0,this.frameId=0,this.renderId=0,this.updateMap=new WeakMap,this.updateBeforeMap=new WeakMap,this.updateAfterMap=new WeakMap,this.renderer=null,this.material=null,this.camera=null,this.object=null,this.scene=null}_getMaps(e,t){let r=e.get(t);return void 0===r&&(r={renderMap:new WeakMap,frameMap:new WeakMap},e.set(t,r)),r}updateBeforeNode(e){const t=e.getUpdateBeforeType(),r=e.updateReference(this);if(t===Vs.FRAME){const{frameMap:t}=this._getMaps(this.updateBeforeMap,r);t.get(r)!==this.frameId&&!1!==e.updateBefore(this)&&t.set(r,this.frameId)}else if(t===Vs.RENDER){const{renderMap:t}=this._getMaps(this.updateBeforeMap,r);t.get(r)!==this.renderId&&!1!==e.updateBefore(this)&&t.set(r,this.renderId)}else t===Vs.OBJECT&&e.updateBefore(this)}updateAfterNode(e){const t=e.getUpdateAfterType(),r=e.updateReference(this);if(t===Vs.FRAME){const{frameMap:t}=this._getMaps(this.updateAfterMap,r);t.get(r)!==this.frameId&&!1!==e.updateAfter(this)&&t.set(r,this.frameId)}else if(t===Vs.RENDER){const{renderMap:t}=this._getMaps(this.updateAfterMap,r);t.get(r)!==this.renderId&&!1!==e.updateAfter(this)&&t.set(r,this.renderId)}else t===Vs.OBJECT&&e.updateAfter(this)}updateNode(e){const t=e.getUpdateType(),r=e.updateReference(this);if(t===Vs.FRAME){const{frameMap:t}=this._getMaps(this.updateMap,r);t.get(r)!==this.frameId&&!1!==e.update(this)&&t.set(r,this.frameId)}else if(t===Vs.RENDER){const{renderMap:t}=this._getMaps(this.updateMap,r);t.get(r)!==this.renderId&&!1!==e.update(this)&&t.set(r,this.renderId)}else t===Vs.OBJECT&&e.update(this)}update(){this.frameId++,void 0===this.lastTime&&(this.lastTime=performance.now()),this.deltaTime=(performance.now()-this.lastTime)/1e3,this.lastTime=performance.now(),this.time+=this.deltaTime}}class B_{constructor(e,t,r=null,s="",i=!1){this.type=e,this.name=t,this.count=r,this.qualifier=s,this.isConst=i}}B_.isNodeFunctionInput=!0;class I_ extends eT{static get type(){return"DirectionalLightNode"}constructor(e=null){super(e)}setupDirect(){const e=this.colorNode;return{lightDirection:cb(this.light),lightColor:e}}}const D_=new a,V_=new a;let U_=null;class O_ extends eT{static get type(){return"RectAreaLightNode"}constructor(e=null){super(e),this.halfHeight=Zn(new r).setGroup(Kn),this.halfWidth=Zn(new r).setGroup(Kn),this.updateType=Vs.RENDER}update(e){super.update(e);const{light:t}=this,r=e.camera.matrixWorldInverse;V_.identity(),D_.copy(t.matrixWorld),D_.premultiply(r),V_.extractRotation(D_),this.halfWidth.value.set(.5*t.width,0,0),this.halfHeight.value.set(0,.5*t.height,0),this.halfWidth.value.applyMatrix4(V_),this.halfHeight.value.applyMatrix4(V_)}setupDirectRectArea(e){let t,r;e.isAvailable("float32Filterable")?(t=Zu(U_.LTC_FLOAT_1),r=Zu(U_.LTC_FLOAT_2)):(t=Zu(U_.LTC_HALF_1),r=Zu(U_.LTC_HALF_2));const{colorNode:s,light:i}=this;return{lightColor:s,lightPosition:db(i),halfWidth:this.halfWidth,halfHeight:this.halfHeight,ltc_1:t,ltc_2:r}}static setLTC(e){U_=e}}class k_ extends eT{static get type(){return"SpotLightNode"}constructor(e=null){super(e),this.coneCosNode=Zn(0).setGroup(Kn),this.penumbraCosNode=Zn(0).setGroup(Kn),this.cutoffDistanceNode=Zn(0).setGroup(Kn),this.decayExponentNode=Zn(0).setGroup(Kn),this.colorNode=Zn(this.color).setGroup(Kn)}update(e){super.update(e);const{light:t}=this;this.coneCosNode.value=Math.cos(t.angle),this.penumbraCosNode.value=Math.cos(t.angle*(1-t.penumbra)),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}getSpotAttenuation(e,t){const{coneCosNode:r,penumbraCosNode:s}=this;return Oo(r,s,t)}getLightCoord(e){const t=e.getNodeProperties(this);let r=t.projectionUV;return void 0===r&&(r=ob(this.light,e.context.positionWorld),t.projectionUV=r),r}setupDirect(e){const{colorNode:t,cutoffDistanceNode:r,decayExponentNode:s,light:i}=this,n=this.getLightVector(e),a=n.normalize(),o=a.dot(cb(i)),u=this.getSpotAttenuation(e,o),l=n.length(),d=tT({lightDistance:l,cutoffDistance:r,decayExponent:s});let c,h,p=t.mul(u).mul(d);if(i.colorNode?(h=this.getLightCoord(e),c=i.colorNode(h)):i.map&&(h=this.getLightCoord(e),c=Zu(i.map,h.xy).onRenderUpdate((()=>i.map))),c){p=h.mul(2).sub(1).abs().lessThan(1).all().select(p.mul(c),p)}return{lightColor:p,lightDirection:a}}}class G_ extends k_{static get type(){return"IESSpotLightNode"}getSpotAttenuation(e,t){const r=this.light.iesMap;let s=null;if(r&&!0===r.isTexture){const e=t.acos().mul(1/Math.PI);s=Zu(r,Yi(e,0),0).r}else s=super.getSpotAttenuation(t);return s}}const z_=ki((([e,t])=>{const r=e.abs().sub(t);return oo(_o(r,0)).add(To(_o(r.x,r.y),0))}));class H_ extends k_{static get type(){return"ProjectorLightNode"}update(e){super.update(e);const t=this.light;if(this.penumbraCosNode.value=Math.min(Math.cos(t.angle*(1-t.penumbra)),.99999),null===t.aspect){let e=1;null!==t.map&&(e=t.map.width/t.map.height),t.shadow.aspect=e}else t.shadow.aspect=t.aspect}getSpotAttenuation(e){const t=this.penumbraCosNode,r=this.getLightCoord(e),s=r.xyz.div(r.w),i=z_(s.xy.sub(Yi(.5)),Yi(.5)),n=da(-1,ua(1,so(t)).sub(1));return Vo(i.mul(-2).mul(n))}}class $_ extends eT{static get type(){return"AmbientLightNode"}constructor(e=null){super(e)}setup({context:e}){e.irradiance.addAssign(this.colorNode)}}class W_ extends eT{static get type(){return"HemisphereLightNode"}constructor(t=null){super(t),this.lightPositionNode=ub(t),this.lightDirectionNode=this.lightPositionNode.normalize(),this.groundColorNode=Zn(new e).setGroup(Kn)}update(e){const{light:t}=this;super.update(e),this.lightPositionNode.object3d=t,this.groundColorNode.value.copy(t.groundColor).multiplyScalar(t.intensity)}setup(e){const{colorNode:t,groundColorNode:r,lightDirectionNode:s}=this,i=Yl.dot(s).mul(.5).add(.5),n=Io(r,t,i);e.context.irradiance.addAssign(n)}}class j_ extends eT{static get type(){return"LightProbeNode"}constructor(e=null){super(e);const t=[];for(let e=0;e<9;e++)t.push(new r);this.lightProbe=il(t)}update(e){const{light:t}=this;super.update(e);for(let e=0;e<9;e++)this.lightProbe.array[e].copy(t.sh.coefficients[e]).multiplyScalar(t.intensity)}setup(e){const t=QT(Yl,this.lightProbe);e.context.irradiance.addAssign(t)}}class q_{parseFunction(){console.warn("Abstract function.")}}class X_{constructor(e,t,r="",s=""){this.type=e,this.inputs=t,this.name=r,this.precision=s}getCode(){console.warn("Abstract function.")}}X_.isNodeFunction=!0;const K_=/^\s*(highp|mediump|lowp)?\s*([a-z_0-9]+)\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)/i,Y_=/[a-z_0-9]+/gi,Q_="#pragma main";class Z_ extends X_{constructor(e){const{type:t,inputs:r,name:s,precision:i,inputsCode:n,blockCode:a,headerCode:o}=(e=>{const t=(e=e.trim()).indexOf(Q_),r=-1!==t?e.slice(t+12):e,s=r.match(K_);if(null!==s&&5===s.length){const i=s[4],n=[];let a=null;for(;null!==(a=Y_.exec(i));)n.push(a);const o=[];let u=0;for(;u0||e.backgroundBlurriness>0&&0===t.backgroundBlurriness;if(t.background!==r||s){const i=this.getCacheNode("background",r,(()=>{if(!0===r.isCubeTexture||r.mapping===Q||r.mapping===Z||r.mapping===ce){if(e.backgroundBlurriness>0||r.mapping===ce)return um(r);{let e;return e=!0===r.isCubeTexture?gd(r):Zu(r),cp(e)}}if(!0===r.isTexture)return Zu(r,ph.flipY()).setUpdateMatrix(!0);!0!==r.isColor&&console.error("WebGPUNodes: Unsupported background configuration.",r)}),s);t.backgroundNode=i,t.background=r,t.backgroundBlurriness=e.backgroundBlurriness}}else t.backgroundNode&&(delete t.backgroundNode,delete t.background)}getCacheNode(e,t,r,s=!1){const i=this.cacheLib[e]||(this.cacheLib[e]=new WeakMap);let n=i.get(t);return(void 0===n||s)&&(n=r(),i.set(t,n)),n}updateFog(e){const t=this.get(e),r=e.fog;if(r){if(t.fog!==r){const e=this.getCacheNode("fog",r,(()=>{if(r.isFogExp2){const e=yd("color","color",r).setGroup(Kn),t=yd("density","float",r).setGroup(Kn);return kx(e,Ox(t))}if(r.isFog){const e=yd("color","color",r).setGroup(Kn),t=yd("near","float",r).setGroup(Kn),s=yd("far","float",r).setGroup(Kn);return kx(e,Ux(t,s))}console.error("THREE.Renderer: Unsupported fog configuration.",r)}));t.fogNode=e,t.fog=r}}else delete t.fogNode,delete t.fog}updateEnvironment(e){const t=this.get(e),r=e.environment;if(r){if(t.environment!==r){const e=this.getCacheNode("environment",r,(()=>!0===r.isCubeTexture?gd(r):!0===r.isTexture?Zu(r):void console.error("Nodes: Unsupported environment configuration.",r)));t.environmentNode=e,t.environment=r}}else t.environmentNode&&(delete t.environmentNode,delete t.environment)}getNodeFrame(e=this.renderer,t=null,r=null,s=null,i=null){const n=this.nodeFrame;return n.renderer=e,n.scene=t,n.object=r,n.camera=s,n.material=i,n}getNodeFrameForRender(e){return this.getNodeFrame(e.renderer,e.scene,e.object,e.camera,e.material)}getOutputCacheKey(){const e=this.renderer;return e.toneMapping+","+e.currentColorSpace+","+e.xr.isPresenting}hasOutputChange(e){return ev.get(e)!==this.getOutputCacheKey()}getOutputNode(e){const t=this.renderer,r=this.getOutputCacheKey(),s=e.isArrayTexture?Hy(e,en(ph,nl("gl_ViewID_OVR"))).renderOutput(t.toneMapping,t.currentColorSpace):Zu(e,ph).renderOutput(t.toneMapping,t.currentColorSpace);return ev.set(e,r),s}updateBefore(e){const t=e.getNodeBuilderState();for(const r of t.updateBeforeNodes)this.getNodeFrameForRender(e).updateBeforeNode(r)}updateAfter(e){const t=e.getNodeBuilderState();for(const r of t.updateAfterNodes)this.getNodeFrameForRender(e).updateAfterNode(r)}updateForCompute(e){const t=this.getNodeFrame(),r=this.getForCompute(e);for(const e of r.updateNodes)t.updateNode(e)}updateForRender(e){const t=this.getNodeFrameForRender(e),r=e.getNodeBuilderState();for(const e of r.updateNodes)t.updateNode(e)}needsRefresh(e){const t=this.getNodeFrameForRender(e);return e.getMonitor().needsRefresh(e,t)}dispose(){super.dispose(),this.nodeFrame=new F_,this.nodeBuilderCache=new Map,this.cacheLib={}}}const iv=new Me;class nv{constructor(e=null){this.version=0,this.clipIntersection=null,this.cacheKey="",this.shadowPass=!1,this.viewNormalMatrix=new n,this.clippingGroupContexts=new WeakMap,this.intersectionPlanes=[],this.unionPlanes=[],this.parentVersion=null,null!==e&&(this.viewNormalMatrix=e.viewNormalMatrix,this.clippingGroupContexts=e.clippingGroupContexts,this.shadowPass=e.shadowPass,this.viewMatrix=e.viewMatrix)}projectPlanes(e,t,r){const s=e.length;for(let i=0;i0,alpha:!0,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:this.getFramebufferScaleFactor()},i=new XRWebGLLayer(e,s,r);this._glBaseLayer=i,e.updateRenderState({baseLayer:i}),t.setPixelRatio(1),t._setXRLayerSize(i.framebufferWidth,i.framebufferHeight),this._xrRenderTarget=new pv(i.framebufferWidth,i.framebufferHeight,{format:le,type:Ce,colorSpace:t.outputColorSpace,stencilBuffer:t.stencil,resolveDepthBuffer:!1===i.ignoreDepthValues,resolveStencilBuffer:!1===i.ignoreDepthValues}),this._xrRenderTarget._isOpaqueFramebuffer=!0,this._referenceSpace=await e.requestReferenceSpace(this.getReferenceSpaceType())}this.setFoveation(this.getFoveation()),t._animation.setAnimationLoop(this._onAnimationFrame),t._animation.setContext(e),t._animation.start(),this.isPresenting=!0,this.dispatchEvent({type:"sessionstart"})}}updateCamera(e){const t=this._session;if(null===t)return;const r=e.near,s=e.far,i=this._cameraXR,n=this._cameraL,a=this._cameraR;i.near=a.near=n.near=r,i.far=a.far=n.far=s,i.isMultiViewCamera=this._useMultiview,this._currentDepthNear===i.near&&this._currentDepthFar===i.far||(t.updateRenderState({depthNear:i.near,depthFar:i.far}),this._currentDepthNear=i.near,this._currentDepthFar=i.far),n.layers.mask=2|e.layers.mask,a.layers.mask=4|e.layers.mask,i.layers.mask=n.layers.mask|a.layers.mask;const o=e.parent,u=i.cameras;yv(i,o);for(let e=0;e=0&&(r[n]=null,t[n].disconnect(i))}for(let s=0;s=r.length){r.push(i),n=e;break}if(null===r[e]){r[e]=i,n=e;break}}if(-1===n)break}const a=t[n];a&&a.connect(i)}}function _v(e){return"quad"===e.type?this._glBinding.createQuadLayer({transform:new XRRigidTransform(e.translation,e.quaternion),width:e.width/2,height:e.height/2,space:this._referenceSpace,viewPixelWidth:e.pixelwidth,viewPixelHeight:e.pixelheight,clearOnAccess:!1}):this._glBinding.createCylinderLayer({transform:new XRRigidTransform(e.translation,e.quaternion),radius:e.radius,centralAngle:e.centralAngle,aspectRatio:e.aspectRatio,space:this._referenceSpace,viewPixelWidth:e.pixelwidth,viewPixelHeight:e.pixelheight,clearOnAccess:!1})}function vv(e,t){if(void 0===t)return;const r=this._cameraXR,i=this._renderer,n=i.backend,a=this._glBaseLayer,o=this.getReferenceSpace(),u=t.getViewerPose(o);if(this._xrFrame=t,null!==u){const e=u.views;null!==this._glBaseLayer&&n.setXRTarget(a.framebuffer);let t=!1;e.length!==r.cameras.length&&(r.cameras.length=0,t=!0);for(let i=0;i{await this.compileAsync(e,t);const s=this._renderLists.get(e,t),i=this._renderContexts.get(e,t,this._renderTarget),n=e.overrideMaterial||r.material,a=this._objects.get(r,n,e,t,s.lightsNode,i,i.clippingContext),{fragmentShader:o,vertexShader:u}=a.getNodeBuilderState();return{fragmentShader:o,vertexShader:u}}}}async init(){if(this._initialized)throw new Error("Renderer: Backend has already been initialized.");return null!==this._initPromise||(this._initPromise=new Promise((async(e,t)=>{let r=this.backend;try{await r.init(this)}catch(e){if(null===this._getFallback)return void t(e);try{this.backend=r=this._getFallback(e),await r.init(this)}catch(e){return void t(e)}}this._nodes=new sv(this,r),this._animation=new Gm(this._nodes,this.info),this._attributes=new Jm(r),this._background=new e_(this,this._nodes),this._geometries=new rf(this._attributes,this.info),this._textures=new wf(this,r,this.info),this._pipelines=new df(r,this._nodes),this._bindings=new cf(r,this._nodes,this._textures,this._attributes,this._pipelines,this.info),this._objects=new jm(this,this._nodes,this._geometries,this._pipelines,this._bindings,this.info),this._renderLists=new yf(this.lighting),this._bundles=new uv,this._renderContexts=new Sf,this._animation.start(),this._initialized=!0,e(this)}))),this._initPromise}get coordinateSystem(){return this.backend.coordinateSystem}async compileAsync(e,t,r=null){if(!0===this._isDeviceLost)return;!1===this._initialized&&await this.init();const s=this._nodes.nodeFrame,i=s.renderId,n=this._currentRenderContext,a=this._currentRenderObjectFunction,o=this._compilationPromises,u=!0===e.isScene?e:Nv;null===r&&(r=e);const l=this._renderTarget,d=this._renderContexts.get(r,t,l),c=this._activeMipmapLevel,h=[];this._currentRenderContext=d,this._currentRenderObjectFunction=this.renderObject,this._handleObjectFunction=this._createObjectPipeline,this._compilationPromises=h,s.renderId++,s.update(),d.depth=this.depth,d.stencil=this.stencil,d.clippingContext||(d.clippingContext=new nv),d.clippingContext.updateGlobal(u,t),u.onBeforeRender(this,e,t,l);const p=this._renderLists.get(e,t);if(p.begin(),this._projectObject(e,t,0,p,d.clippingContext),r!==e&&r.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&p.pushLight(e)})),p.finish(),null!==l){this._textures.updateRenderTarget(l,c);const e=this._textures.get(l);d.textures=e.textures,d.depthTexture=e.depthTexture}else d.textures=null,d.depthTexture=null;this._background.update(u,p,d);const g=p.opaque,m=p.transparent,f=p.transparentDoublePass,y=p.lightsNode;!0===this.opaque&&g.length>0&&this._renderObjects(g,t,u,y),!0===this.transparent&&m.length>0&&this._renderTransparents(m,f,t,u,y),s.renderId=i,this._currentRenderContext=n,this._currentRenderObjectFunction=a,this._compilationPromises=o,this._handleObjectFunction=this._renderObjectDirect,await Promise.all(h)}async renderAsync(e,t){!1===this._initialized&&await this.init(),this._renderScene(e,t)}async waitForGPU(){await this.backend.waitForGPU()}set highPrecision(e){!0===e?(this.overrideNodes.modelViewMatrix=Bl,this.overrideNodes.modelNormalViewMatrix=Il):this.highPrecision&&(this.overrideNodes.modelViewMatrix=null,this.overrideNodes.modelNormalViewMatrix=null)}get highPrecision(){return this.overrideNodes.modelViewMatrix===Bl&&this.overrideNodes.modelNormalViewMatrix===Il}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}getColorBufferType(){return this._colorBufferType}_onDeviceLost(e){let t=`THREE.WebGPURenderer: ${e.api} Device Lost:\n\nMessage: ${e.message}`;e.reason&&(t+=`\nReason: ${e.reason}`),console.error(t),this._isDeviceLost=!0}_renderBundle(e,t,r){const{bundleGroup:s,camera:i,renderList:n}=e,a=this._currentRenderContext,o=this._bundles.get(s,i),u=this.backend.get(o);void 0===u.renderContexts&&(u.renderContexts=new Set);const l=s.version!==u.version,d=!1===u.renderContexts.has(a)||l;if(u.renderContexts.add(a),d){this.backend.beginBundle(a),(void 0===u.renderObjects||l)&&(u.renderObjects=[]),this._currentRenderBundle=o;const{transparentDoublePass:e,transparent:d,opaque:c}=n;!0===this.opaque&&c.length>0&&this._renderObjects(c,i,t,r),!0===this.transparent&&d.length>0&&this._renderTransparents(d,e,i,t,r),this._currentRenderBundle=null,this.backend.finishBundle(a,o),u.version=s.version}else{const{renderObjects:e}=u;for(let t=0,r=e.length;t>=c,p.viewportValue.height>>=c,p.viewportValue.minDepth=b,p.viewportValue.maxDepth=T,p.viewport=!1===p.viewportValue.equals(Ev),p.scissorValue.copy(y).multiplyScalar(x).floor(),p.scissor=this._scissorTest&&!1===p.scissorValue.equals(Ev),p.scissorValue.width>>=c,p.scissorValue.height>>=c,p.clippingContext||(p.clippingContext=new nv),p.clippingContext.updateGlobal(u,t),u.onBeforeRender(this,e,t,h);const _=t.isArrayCamera?Av:wv;t.isArrayCamera||(Rv.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),_.setFromProjectionMatrix(Rv,g));const v=this._renderLists.get(e,t);if(v.begin(),this._projectObject(e,t,0,v,p.clippingContext),v.finish(),!0===this.sortObjects&&v.sort(this._opaqueSort,this._transparentSort),null!==h){this._textures.updateRenderTarget(h,c);const e=this._textures.get(h);p.textures=e.textures,p.depthTexture=e.depthTexture,p.width=e.width,p.height=e.height,p.renderTarget=h,p.depth=h.depthBuffer,p.stencil=h.stencilBuffer}else p.textures=null,p.depthTexture=null,p.width=this.domElement.width,p.height=this.domElement.height,p.depth=this.depth,p.stencil=this.stencil;p.width>>=c,p.height>>=c,p.activeCubeFace=d,p.activeMipmapLevel=c,p.occlusionQueryCount=v.occlusionQueryCount,this._background.update(u,v,p),p.camera=t,this.backend.beginRender(p);const{bundles:N,lightsNode:S,transparentDoublePass:E,transparent:w,opaque:A}=v;return N.length>0&&this._renderBundles(N,u,S),!0===this.opaque&&A.length>0&&this._renderObjects(A,t,u,S),!0===this.transparent&&w.length>0&&this._renderTransparents(w,E,t,u,S),this.backend.finishRender(p),i.renderId=n,this._currentRenderContext=a,this._currentRenderObjectFunction=o,null!==s&&(this.setRenderTarget(l,d,c),this._renderOutput(h)),u.onAfterRender(this,e,t,h),p}_setXRLayerSize(e,t){this._width=e,this._height=t,this.setViewport(0,0,e,t)}_renderOutput(e){const t=this._quad;this._nodes.hasOutputChange(e.texture)&&(t.material.fragmentNode=this._nodes.getOutputNode(e.texture),t.material.needsUpdate=!0);const r=this.autoClear,s=this.xr.enabled;this.autoClear=!1,this.xr.enabled=!1,this._renderScene(t,t.camera,!1),this.autoClear=r,this.xr.enabled=s}getMaxAnisotropy(){return this.backend.getMaxAnisotropy()}getActiveCubeFace(){return this._activeCubeFace}getActiveMipmapLevel(){return this._activeMipmapLevel}async setAnimationLoop(e){!1===this._initialized&&await this.init(),this._animation.setAnimationLoop(e)}async getArrayBufferAsync(e){return await this.backend.getArrayBufferAsync(e)}getContext(){return this.backend.getContext()}getPixelRatio(){return this._pixelRatio}getDrawingBufferSize(e){return e.set(this._width*this._pixelRatio,this._height*this._pixelRatio).floor()}getSize(e){return e.set(this._width,this._height)}setPixelRatio(e=1){this._pixelRatio!==e&&(this._pixelRatio=e,this.setSize(this._width,this._height,!1))}setDrawingBufferSize(e,t,r){this.xr&&this.xr.isPresenting||(this._width=e,this._height=t,this._pixelRatio=r,this.domElement.width=Math.floor(e*r),this.domElement.height=Math.floor(t*r),this.setViewport(0,0,e,t),this._initialized&&this.backend.updateSize())}setSize(e,t,r=!0){this.xr&&this.xr.isPresenting||(this._width=e,this._height=t,this.domElement.width=Math.floor(e*this._pixelRatio),this.domElement.height=Math.floor(t*this._pixelRatio),!0===r&&(this.domElement.style.width=e+"px",this.domElement.style.height=t+"px"),this.setViewport(0,0,e,t),this._initialized&&this.backend.updateSize())}setOpaqueSort(e){this._opaqueSort=e}setTransparentSort(e){this._transparentSort=e}getScissor(e){const t=this._scissor;return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e}setScissor(e,t,r,s){const i=this._scissor;e.isVector4?i.copy(e):i.set(e,t,r,s)}getScissorTest(){return this._scissorTest}setScissorTest(e){this._scissorTest=e,this.backend.setScissorTest(e)}getViewport(e){return e.copy(this._viewport)}setViewport(e,t,r,s,i=0,n=1){const a=this._viewport;e.isVector4?a.copy(e):a.set(e,t,r,s),a.minDepth=i,a.maxDepth=n}getClearColor(e){return e.copy(this._clearColor)}setClearColor(e,t=1){this._clearColor.set(e),this._clearColor.a=t}getClearAlpha(){return this._clearColor.a}setClearAlpha(e){this._clearColor.a=e}getClearDepth(){return this._clearDepth}setClearDepth(e){this._clearDepth=e}getClearStencil(){return this._clearStencil}setClearStencil(e){this._clearStencil=e}isOccluded(e){const t=this._currentRenderContext;return t&&this.backend.isOccluded(t,e)}clear(e=!0,t=!0,r=!0){if(!1===this._initialized)return console.warn("THREE.Renderer: .clear() called before the backend is initialized. Try using .clearAsync() instead."),this.clearAsync(e,t,r);const s=this._renderTarget||this._getFrameBufferTarget();let i=null;if(null!==s){this._textures.updateRenderTarget(s);const e=this._textures.get(s);i=this._renderContexts.getForClear(s),i.textures=e.textures,i.depthTexture=e.depthTexture,i.width=e.width,i.height=e.height,i.renderTarget=s,i.depth=s.depthBuffer,i.stencil=s.stencilBuffer,i.clearColorValue=this.backend.getClearColor(),i.activeCubeFace=this.getActiveCubeFace(),i.activeMipmapLevel=this.getActiveMipmapLevel()}this.backend.clear(e,t,r,i),null!==s&&null===this._renderTarget&&this._renderOutput(s)}clearColor(){return this.clear(!0,!1,!1)}clearDepth(){return this.clear(!1,!0,!1)}clearStencil(){return this.clear(!1,!1,!0)}async clearAsync(e=!0,t=!0,r=!0){!1===this._initialized&&await this.init(),this.clear(e,t,r)}async clearColorAsync(){this.clearAsync(!0,!1,!1)}async clearDepthAsync(){this.clearAsync(!1,!0,!1)}async clearStencilAsync(){this.clearAsync(!1,!1,!0)}get currentToneMapping(){return this.isOutputTarget?this.toneMapping:p}get currentColorSpace(){return this.isOutputTarget?this.outputColorSpace:ue}get isOutputTarget(){return this._renderTarget===this._outputRenderTarget||null===this._renderTarget}dispose(){this.info.dispose(),this.backend.dispose(),this._animation.dispose(),this._objects.dispose(),this._pipelines.dispose(),this._nodes.dispose(),this._bindings.dispose(),this._renderLists.dispose(),this._renderContexts.dispose(),this._textures.dispose(),null!==this._frameBufferTarget&&this._frameBufferTarget.dispose(),Object.values(this.backend.timestampQueryPool).forEach((e=>{null!==e&&e.dispose()})),this.setRenderTarget(null),this.setAnimationLoop(null)}setRenderTarget(e,t=0,r=0){this._renderTarget=e,this._activeCubeFace=t,this._activeMipmapLevel=r}getRenderTarget(){return this._renderTarget}setOutputRenderTarget(e){this._outputRenderTarget=e}getOutputRenderTarget(){return this._outputRenderTarget}_resetXRState(){this.backend.setXRTarget(null),this.setOutputRenderTarget(null),this.setRenderTarget(null),this._frameBufferTarget.dispose(),this._frameBufferTarget=null}setRenderObjectFunction(e){this._renderObjectFunction=e}getRenderObjectFunction(){return this._renderObjectFunction}compute(e){if(!0===this._isDeviceLost)return;if(!1===this._initialized)return console.warn("THREE.Renderer: .compute() called before the backend is initialized. Try using .computeAsync() instead."),this.computeAsync(e);const t=this._nodes.nodeFrame,r=t.renderId;this.info.calls++,this.info.compute.calls++,this.info.compute.frameCalls++,t.renderId=this.info.calls;const s=this.backend,i=this._pipelines,n=this._bindings,a=this._nodes,o=Array.isArray(e)?e:[e];if(void 0===o[0]||!0!==o[0].isComputeNode)throw new Error("THREE.Renderer: .compute() expects a ComputeNode.");s.beginCompute(e);for(const t of o){if(!1===i.has(t)){const e=()=>{t.removeEventListener("dispose",e),i.delete(t),n.delete(t),a.delete(t)};t.addEventListener("dispose",e);const r=t.onInitFunction;null!==r&&r.call(t,{renderer:this})}a.updateForCompute(t),n.updateForCompute(t);const r=n.getForCompute(t),o=i.getForCompute(t,r);s.compute(e,t,r,o)}s.finishCompute(e),t.renderId=r}async computeAsync(e){!1===this._initialized&&await this.init(),this.compute(e)}async hasFeatureAsync(e){return!1===this._initialized&&await this.init(),this.backend.hasFeature(e)}async resolveTimestampsAsync(e="render"){return!1===this._initialized&&await this.init(),this.backend.resolveTimestampsAsync(e)}hasFeature(e){return!1===this._initialized?(console.warn("THREE.Renderer: .hasFeature() called before the backend is initialized. Try using .hasFeatureAsync() instead."),!1):this.backend.hasFeature(e)}hasInitialized(){return this._initialized}async initTextureAsync(e){!1===this._initialized&&await this.init(),this._textures.updateTexture(e)}initTexture(e){!1===this._initialized&&console.warn("THREE.Renderer: .initTexture() called before the backend is initialized. Try using .initTextureAsync() instead."),this._textures.updateTexture(e)}copyFramebufferToTexture(e,t=null){if(null!==t)if(t.isVector2)t=Cv.set(t.x,t.y,e.image.width,e.image.height).floor();else{if(!t.isVector4)return void console.error("THREE.Renderer.copyFramebufferToTexture: Invalid rectangle.");t=Cv.copy(t).floor()}else t=Cv.set(0,0,e.image.width,e.image.height);let r,s=this._currentRenderContext;null!==s?r=s.renderTarget:(r=this._renderTarget||this._getFrameBufferTarget(),null!==r&&(this._textures.updateRenderTarget(r),s=this._textures.get(r))),this._textures.updateTexture(e,{renderTarget:r}),this.backend.copyFramebufferToTexture(e,s,t)}copyTextureToTexture(e,t,r=null,s=null,i=0,n=0){this._textures.updateTexture(e),this._textures.updateTexture(t),this.backend.copyTextureToTexture(e,t,r,s,i,n)}async readRenderTargetPixelsAsync(e,t,r,s,i,n=0,a=0){return this.backend.copyTextureToBuffer(e.textures[n],t,r,s,i,a)}_projectObject(e,t,r,s,i){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)r=e.renderOrder,e.isClippingGroup&&e.enabled&&(i=i.getGroupContext(e));else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)s.pushLight(e);else if(e.isSprite){const n=t.isArrayCamera?Av:wv;if(!e.frustumCulled||n.intersectsSprite(e,t)){!0===this.sortObjects&&Cv.setFromMatrixPosition(e.matrixWorld).applyMatrix4(Rv);const{geometry:t,material:n}=e;n.visible&&s.push(e,t,n,r,Cv.z,null,i)}}else if(e.isLineLoop)console.error("THREE.Renderer: Objects of type THREE.LineLoop are not supported. Please use THREE.Line or THREE.LineSegments.");else if(e.isMesh||e.isLine||e.isPoints){const n=t.isArrayCamera?Av:wv;if(!e.frustumCulled||n.intersectsObject(e,t)){const{geometry:t,material:n}=e;if(!0===this.sortObjects&&(null===t.boundingSphere&&t.computeBoundingSphere(),Cv.copy(t.boundingSphere.center).applyMatrix4(e.matrixWorld).applyMatrix4(Rv)),Array.isArray(n)){const a=t.groups;for(let o=0,u=a.length;o0){for(const{material:e}of t)e.side=S;this._renderObjects(t,r,s,i,"backSide");for(const{material:e}of t)e.side=je;this._renderObjects(e,r,s,i);for(const{material:e}of t)e.side=Se}else this._renderObjects(e,r,s,i)}_renderObjects(e,t,r,s,i=null){for(let n=0,a=e.length;n0,e.isShadowPassMaterial&&(e.side=null===i.shadowSide?i.side:i.shadowSide,i.depthNode&&i.depthNode.isNode&&(c=e.depthNode,e.depthNode=i.depthNode),i.castShadowNode&&i.castShadowNode.isNode&&(d=e.colorNode,e.colorNode=i.castShadowNode),i.castShadowPositionNode&&i.castShadowPositionNode.isNode&&(l=e.positionNode,e.positionNode=i.castShadowPositionNode)),i=e}!0===i.transparent&&i.side===Se&&!1===i.forceSinglePass?(i.side=S,this._handleObjectFunction(e,i,t,r,a,n,o,"backSide"),i.side=je,this._handleObjectFunction(e,i,t,r,a,n,o,u),i.side=Se):this._handleObjectFunction(e,i,t,r,a,n,o,u),void 0!==l&&(t.overrideMaterial.positionNode=l),void 0!==c&&(t.overrideMaterial.depthNode=c),void 0!==d&&(t.overrideMaterial.colorNode=d),e.onAfterRender(this,t,r,s,i,n)}_renderObjectDirect(e,t,r,s,i,n,a,o){const u=this._objects.get(e,t,r,s,i,this._currentRenderContext,a,o);u.drawRange=e.geometry.drawRange,u.group=n;const l=this._nodes.needsRefresh(u);if(l&&(this._nodes.updateBefore(u),this._geometries.updateForRender(u),this._nodes.updateForRender(u),this._bindings.updateForRender(u)),this._pipelines.updateForRender(u),null!==this._currentRenderBundle){this.backend.get(this._currentRenderBundle).renderObjects.push(u),u.bundle=this._currentRenderBundle.bundleGroup}this.backend.draw(u,this.info),l&&this._nodes.updateAfter(u)}_createObjectPipeline(e,t,r,s,i,n,a,o){const u=this._objects.get(e,t,r,s,i,this._currentRenderContext,a,o);u.drawRange=e.geometry.drawRange,u.group=n,this._nodes.updateBefore(u),this._geometries.updateForRender(u),this._nodes.updateForRender(u),this._bindings.updateForRender(u),this._pipelines.getForRender(u,this._compilationPromises),this._nodes.updateAfter(u)}get compile(){return this.compileAsync}}class Pv{constructor(e=""){this.name=e,this.visibility=0}setVisibility(e){this.visibility|=e}clone(){return Object.assign(new this.constructor,this)}}class Lv extends Pv{constructor(e,t=null){super(e),this.isBuffer=!0,this.bytesPerElement=Float32Array.BYTES_PER_ELEMENT,this._buffer=t}get byteLength(){return(e=this._buffer.byteLength)+(Zm-e%Zm)%Zm;var e}get buffer(){return this._buffer}update(){return!0}}class Fv extends Lv{constructor(e,t=null){super(e,t),this.isUniformBuffer=!0}}let Bv=0;class Iv extends Fv{constructor(e,t){super("UniformBuffer_"+Bv++,e?e.value:null),this.nodeUniform=e,this.groupNode=t}get buffer(){return this.nodeUniform.value}}class Dv extends Fv{constructor(e){super(e),this.isUniformsGroup=!0,this._values=null,this.uniforms=[]}addUniform(e){return this.uniforms.push(e),this}removeUniform(e){const t=this.uniforms.indexOf(e);return-1!==t&&this.uniforms.splice(t,1),this}get values(){return null===this._values&&(this._values=Array.from(this.buffer)),this._values}get buffer(){let e=this._buffer;if(null===e){const t=this.byteLength;e=new Float32Array(new ArrayBuffer(t)),this._buffer=e}return e}get byteLength(){const e=this.bytesPerElement;let t=0;for(let r=0,s=this.uniforms.length;r0?s:"";t=`${e.name} {\n\t${r} ${i.name}[${n}];\n};\n`}else{t=`${this.getVectorType(i.type)} ${this.getPropertyName(i,e)};`,n=!0}const a=i.node.precision;if(null!==a&&(t=Wv[a]+" "+t),n){t="\t"+t;const e=i.groupNode.name;(s[e]||(s[e]=[])).push(t)}else t="uniform "+t,r.push(t)}let i="";for(const t in s){const r=s[t];i+=this._getGLSLUniformStruct(e+"_"+t,r.join("\n"))+"\n"}return i+=r.join("\n"),i}getTypeFromAttribute(e){let t=super.getTypeFromAttribute(e);if(/^[iu]/.test(t)&&e.gpuType!==_){let r=e;e.isInterleavedBufferAttribute&&(r=e.data);const s=r.array;!1==(s instanceof Uint32Array||s instanceof Int32Array)&&(t=t.slice(1))}return t}getAttributes(e){let t="";if("vertex"===e||"compute"===e){const e=this.getAttributesArray();let r=0;for(const s of e)t+=`layout( location = ${r++} ) in ${s.type} ${s.name};\n`}return t}getStructMembers(e){const t=[];for(const r of e.members)t.push(`\t${r.type} ${r.name};`);return t.join("\n")}getStructs(e){const t=[],r=this.structs[e],s=[];for(const e of r)if(e.output)for(const t of e.members)s.push(`layout( location = ${t.index} ) out ${t.type} ${t.name};`);else{let r="struct "+e.name+" {\n";r+=this.getStructMembers(e),r+="\n};\n",t.push(r)}return 0===s.length&&s.push("layout( location = 0 ) out vec4 fragColor;"),"\n"+s.join("\n")+"\n\n"+t.join("\n")}getVaryings(e){let t="";const r=this.varyings;if("vertex"===e||"compute"===e)for(const s of r){"compute"===e&&(s.needsInterpolation=!0);const r=this.getType(s.type);if(s.needsInterpolation)if(s.interpolationType){t+=`${qv[s.interpolationType]||s.interpolationType} ${Xv[s.interpolationSampling]||""} out ${r} ${s.name};\n`}else{t+=`${r.includes("int")||r.includes("uv")||r.includes("iv")?"flat ":""}out ${r} ${s.name};\n`}else t+=`${r} ${s.name};\n`}else if("fragment"===e)for(const e of r)if(e.needsInterpolation){const r=this.getType(e.type);if(e.interpolationType){t+=`${qv[e.interpolationType]||e.interpolationType} ${Xv[e.interpolationSampling]||""} in ${r} ${e.name};\n`}else{t+=`${r.includes("int")||r.includes("uv")||r.includes("iv")?"flat ":""}in ${r} ${e.name};\n`}}for(const r of this.builtins[e])t+=`${r};\n`;return t}getVertexIndex(){return"uint( gl_VertexID )"}getInstanceIndex(){return"uint( gl_InstanceID )"}getInvocationLocalIndex(){return`uint( gl_InstanceID ) % ${this.object.workgroupSize.reduce(((e,t)=>e*t),1)}u`}getDrawIndex(){return this.renderer.backend.extensions.has("WEBGL_multi_draw")?"uint( gl_DrawID )":null}getFrontFacing(){return"gl_FrontFacing"}getFragCoord(){return"gl_FragCoord.xy"}getFragDepth(){return"gl_FragDepth"}enableExtension(e,t,r=this.shaderStage){const s=this.extensions[r]||(this.extensions[r]=new Map);!1===s.has(e)&&s.set(e,{name:e,behavior:t})}getExtensions(e){const t=[];if("vertex"===e){const t=this.renderer.backend.extensions;this.object.isBatchedMesh&&t.has("WEBGL_multi_draw")&&this.enableExtension("GL_ANGLE_multi_draw","require",e)}const r=this.extensions[e];if(void 0!==r)for(const{name:e,behavior:s}of r.values())t.push(`#extension ${e} : ${s}`);return t.join("\n")}getClipDistance(){return"gl_ClipDistance"}isAvailable(e){let t=jv[e];if(void 0===t){let r;switch(t=!1,e){case"float32Filterable":r="OES_texture_float_linear";break;case"clipDistance":r="WEBGL_clip_cull_distance"}if(void 0!==r){const e=this.renderer.backend.extensions;e.has(r)&&(e.get(r),t=!0)}jv[e]=t}return t}isFlipY(){return!0}enableHardwareClipping(e){this.enableExtension("GL_ANGLE_clip_cull_distance","require"),this.builtins.vertex.push(`out float gl_ClipDistance[ ${e} ]`)}enableMultiview(){this.enableExtension("GL_OVR_multiview2","require","fragment"),this.enableExtension("GL_OVR_multiview2","require","vertex"),this.builtins.vertex.push("layout(num_views = 2) in")}registerTransform(e,t){this.transforms.push({varyingName:e,attributeNode:t})}getTransforms(){const e=this.transforms;let t="";for(let r=0;r0&&(r+="\n"),r+=`\t// flow -> ${n}\n\t`),r+=`${s.code}\n\t`,e===i&&"compute"!==t&&(r+="// result\n\t","vertex"===t?(r+="gl_Position = ",r+=`${s.result};`):"fragment"===t&&(e.outputNode.isOutputStructNode||(r+="fragColor = ",r+=`${s.result};`)))}const n=e[t];n.extensions=this.getExtensions(t),n.uniforms=this.getUniforms(t),n.attributes=this.getAttributes(t),n.varyings=this.getVaryings(t),n.vars=this.getVars(t),n.structs=this.getStructs(t),n.codes=this.getCodes(t),n.transforms=this.getTransforms(t),n.flow=r}null!==this.material?(this.vertexShader=this._getGLSLVertexCode(e.vertex),this.fragmentShader=this._getGLSLFragmentCode(e.fragment)):this.computeShader=this._getGLSLVertexCode(e.compute)}getUniformFromNode(e,t,r,s=null){const i=super.getUniformFromNode(e,t,r,s),n=this.getDataFromNode(e,r,this.globalCache);let a=n.uniformGPU;if(void 0===a){const s=e.groupNode,o=s.name,u=this.getBindGroupArray(o,r);if("texture"===t)a=new Gv(i.name,i.node,s),u.push(a);else if("cubeTexture"===t)a=new zv(i.name,i.node,s),u.push(a);else if("texture3D"===t)a=new Hv(i.name,i.node,s),u.push(a);else if("buffer"===t){e.name=`NodeBuffer_${e.id}`,i.name=`buffer${e.id}`;const t=new Iv(e,s);t.name=e.name,u.push(t),a=t}else{const e=this.uniformGroups[r]||(this.uniformGroups[r]={});let n=e[o];void 0===n&&(n=new Uv(r+"_"+o,s),e[o]=n,u.push(n)),a=this.getNodeUniform(i,t),n.addUniform(a)}n.uniformGPU=a}return i}}let Qv=null,Zv=null;class Jv{constructor(e={}){this.parameters=Object.assign({},e),this.data=new WeakMap,this.renderer=null,this.domElement=null,this.timestampQueryPool={render:null,compute:null},this.trackTimestamp=!0===e.trackTimestamp}async init(e){this.renderer=e}get coordinateSystem(){}beginRender(){}finishRender(){}beginCompute(){}finishCompute(){}draw(){}compute(){}createProgram(){}destroyProgram(){}createBindings(){}updateBindings(){}updateBinding(){}createRenderPipeline(){}createComputePipeline(){}needsRenderUpdate(){}getRenderCacheKey(){}createNodeBuilder(){}createSampler(){}destroySampler(){}createDefaultTexture(){}createTexture(){}updateTexture(){}generateMipmaps(){}destroyTexture(){}async copyTextureToBuffer(){}copyTextureToTexture(){}copyFramebufferToTexture(){}createAttribute(){}createIndexAttribute(){}createStorageAttribute(){}updateAttribute(){}destroyAttribute(){}getContext(){}updateSize(){}updateViewport(){}isOccluded(){}async resolveTimestampsAsync(e="render"){if(!this.trackTimestamp)return void pt("WebGPURenderer: Timestamp tracking is disabled.");const t=this.timestampQueryPool[e];if(!t)return void pt(`WebGPURenderer: No timestamp query pool for type '${e}' found.`);const r=await t.resolveQueriesAsync();return this.renderer.info[e].timestamp=r,r}async waitForGPU(){}async getArrayBufferAsync(){}async hasFeatureAsync(){}hasFeature(){}getMaxAnisotropy(){}getDrawingBufferSize(){return Qv=Qv||new t,this.renderer.getDrawingBufferSize(Qv)}setScissorTest(){}getClearColor(){const e=this.renderer;return Zv=Zv||new Af,e.getClearColor(Zv),Zv.getRGB(Zv),Zv}getDomElement(){let e=this.domElement;return null===e&&(e=void 0!==this.parameters.canvas?this.parameters.canvas:gt(),"setAttribute"in e&&e.setAttribute("data-engine",`three.js r${He} webgpu`),this.domElement=e),e}set(e,t){this.data.set(e,t)}get(e){let t=this.data.get(e);return void 0===t&&(t={},this.data.set(e,t)),t}has(e){return this.data.has(e)}delete(e){this.data.delete(e)}dispose(){}}let eN,tN,rN=0;class sN{constructor(e,t){this.buffers=[e.bufferGPU,t],this.type=e.type,this.bufferType=e.bufferType,this.pbo=e.pbo,this.byteLength=e.byteLength,this.bytesPerElement=e.BYTES_PER_ELEMENT,this.version=e.version,this.isInteger=e.isInteger,this.activeBufferIndex=0,this.baseId=e.id}get id(){return`${this.baseId}|${this.activeBufferIndex}`}get bufferGPU(){return this.buffers[this.activeBufferIndex]}get transformBuffer(){return this.buffers[1^this.activeBufferIndex]}switchBuffers(){this.activeBufferIndex^=1}}class iN{constructor(e){this.backend=e}createAttribute(e,t){const r=this.backend,{gl:s}=r,i=e.array,n=e.usage||s.STATIC_DRAW,a=e.isInterleavedBufferAttribute?e.data:e,o=r.get(a);let u,l=o.bufferGPU;if(void 0===l&&(l=this._createBuffer(s,t,i,n),o.bufferGPU=l,o.bufferType=t,o.version=a.version),i instanceof Float32Array)u=s.FLOAT;else if(i instanceof Uint16Array)u=e.isFloat16BufferAttribute?s.HALF_FLOAT:s.UNSIGNED_SHORT;else if(i instanceof Int16Array)u=s.SHORT;else if(i instanceof Uint32Array)u=s.UNSIGNED_INT;else if(i instanceof Int32Array)u=s.INT;else if(i instanceof Int8Array)u=s.BYTE;else if(i instanceof Uint8Array)u=s.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLBackend: Unsupported buffer data format: "+i);u=s.UNSIGNED_BYTE}let d={bufferGPU:l,bufferType:t,type:u,byteLength:i.byteLength,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version,pbo:e.pbo,isInteger:u===s.INT||u===s.UNSIGNED_INT||e.gpuType===_,id:rN++};if(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute){const e=this._createBuffer(s,t,i,n);d=new sN(d,e)}r.set(e,d)}updateAttribute(e){const t=this.backend,{gl:r}=t,s=e.array,i=e.isInterleavedBufferAttribute?e.data:e,n=t.get(i),a=n.bufferType,o=e.isInterleavedBufferAttribute?e.data.updateRanges:e.updateRanges;if(r.bindBuffer(a,n.bufferGPU),0===o.length)r.bufferSubData(a,0,s);else{for(let e=0,t=o.length;e1?this.enable(s.SAMPLE_ALPHA_TO_COVERAGE):this.disable(s.SAMPLE_ALPHA_TO_COVERAGE),r>0&&this.currentClippingPlanes!==r){const e=12288;for(let t=0;t<8;t++)t{!function i(){const n=e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0);if(n===e.WAIT_FAILED)return e.deleteSync(t),void s();n!==e.TIMEOUT_EXPIRED?(e.deleteSync(t),r()):requestAnimationFrame(i)}()}))}}let oN,uN,lN,dN=!1;class cN{constructor(e){this.backend=e,this.gl=e.gl,this.extensions=e.extensions,this.defaultTextures={},!1===dN&&(this._init(),dN=!0)}_init(){const e=this.gl;oN={[Nr]:e.REPEAT,[vr]:e.CLAMP_TO_EDGE,[_r]:e.MIRRORED_REPEAT},uN={[v]:e.NEAREST,[Sr]:e.NEAREST_MIPMAP_NEAREST,[Ge]:e.NEAREST_MIPMAP_LINEAR,[K]:e.LINEAR,[ke]:e.LINEAR_MIPMAP_NEAREST,[D]:e.LINEAR_MIPMAP_LINEAR},lN={[Pr]:e.NEVER,[Mr]:e.ALWAYS,[De]:e.LESS,[Cr]:e.LEQUAL,[Rr]:e.EQUAL,[Ar]:e.GEQUAL,[wr]:e.GREATER,[Er]:e.NOTEQUAL}}getGLTextureType(e){const{gl:t}=this;let r;return r=!0===e.isCubeTexture?t.TEXTURE_CUBE_MAP:!0===e.isArrayTexture||!0===e.isDataArrayTexture||!0===e.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:!0===e.isData3DTexture?t.TEXTURE_3D:t.TEXTURE_2D,r}getInternalFormat(e,t,r,s,i=!1){const{gl:n,extensions:a}=this;if(null!==e){if(void 0!==n[e])return n[e];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+e+"'")}let o=t;if(t===n.RED&&(r===n.FLOAT&&(o=n.R32F),r===n.HALF_FLOAT&&(o=n.R16F),r===n.UNSIGNED_BYTE&&(o=n.R8),r===n.UNSIGNED_SHORT&&(o=n.R16),r===n.UNSIGNED_INT&&(o=n.R32UI),r===n.BYTE&&(o=n.R8I),r===n.SHORT&&(o=n.R16I),r===n.INT&&(o=n.R32I)),t===n.RED_INTEGER&&(r===n.UNSIGNED_BYTE&&(o=n.R8UI),r===n.UNSIGNED_SHORT&&(o=n.R16UI),r===n.UNSIGNED_INT&&(o=n.R32UI),r===n.BYTE&&(o=n.R8I),r===n.SHORT&&(o=n.R16I),r===n.INT&&(o=n.R32I)),t===n.RG&&(r===n.FLOAT&&(o=n.RG32F),r===n.HALF_FLOAT&&(o=n.RG16F),r===n.UNSIGNED_BYTE&&(o=n.RG8),r===n.UNSIGNED_SHORT&&(o=n.RG16),r===n.UNSIGNED_INT&&(o=n.RG32UI),r===n.BYTE&&(o=n.RG8I),r===n.SHORT&&(o=n.RG16I),r===n.INT&&(o=n.RG32I)),t===n.RG_INTEGER&&(r===n.UNSIGNED_BYTE&&(o=n.RG8UI),r===n.UNSIGNED_SHORT&&(o=n.RG16UI),r===n.UNSIGNED_INT&&(o=n.RG32UI),r===n.BYTE&&(o=n.RG8I),r===n.SHORT&&(o=n.RG16I),r===n.INT&&(o=n.RG32I)),t===n.RGB){const e=i?Lr:c.getTransfer(s);r===n.FLOAT&&(o=n.RGB32F),r===n.HALF_FLOAT&&(o=n.RGB16F),r===n.UNSIGNED_BYTE&&(o=n.RGB8),r===n.UNSIGNED_SHORT&&(o=n.RGB16),r===n.UNSIGNED_INT&&(o=n.RGB32UI),r===n.BYTE&&(o=n.RGB8I),r===n.SHORT&&(o=n.RGB16I),r===n.INT&&(o=n.RGB32I),r===n.UNSIGNED_BYTE&&(o=e===h?n.SRGB8:n.RGB8),r===n.UNSIGNED_SHORT_5_6_5&&(o=n.RGB565),r===n.UNSIGNED_SHORT_5_5_5_1&&(o=n.RGB5_A1),r===n.UNSIGNED_SHORT_4_4_4_4&&(o=n.RGB4),r===n.UNSIGNED_INT_5_9_9_9_REV&&(o=n.RGB9_E5)}if(t===n.RGB_INTEGER&&(r===n.UNSIGNED_BYTE&&(o=n.RGB8UI),r===n.UNSIGNED_SHORT&&(o=n.RGB16UI),r===n.UNSIGNED_INT&&(o=n.RGB32UI),r===n.BYTE&&(o=n.RGB8I),r===n.SHORT&&(o=n.RGB16I),r===n.INT&&(o=n.RGB32I)),t===n.RGBA){const e=i?Lr:c.getTransfer(s);r===n.FLOAT&&(o=n.RGBA32F),r===n.HALF_FLOAT&&(o=n.RGBA16F),r===n.UNSIGNED_BYTE&&(o=n.RGBA8),r===n.UNSIGNED_SHORT&&(o=n.RGBA16),r===n.UNSIGNED_INT&&(o=n.RGBA32UI),r===n.BYTE&&(o=n.RGBA8I),r===n.SHORT&&(o=n.RGBA16I),r===n.INT&&(o=n.RGBA32I),r===n.UNSIGNED_BYTE&&(o=e===h?n.SRGB8_ALPHA8:n.RGBA8),r===n.UNSIGNED_SHORT_4_4_4_4&&(o=n.RGBA4),r===n.UNSIGNED_SHORT_5_5_5_1&&(o=n.RGB5_A1)}return t===n.RGBA_INTEGER&&(r===n.UNSIGNED_BYTE&&(o=n.RGBA8UI),r===n.UNSIGNED_SHORT&&(o=n.RGBA16UI),r===n.UNSIGNED_INT&&(o=n.RGBA32UI),r===n.BYTE&&(o=n.RGBA8I),r===n.SHORT&&(o=n.RGBA16I),r===n.INT&&(o=n.RGBA32I)),t===n.DEPTH_COMPONENT&&(r===n.UNSIGNED_SHORT&&(o=n.DEPTH_COMPONENT16),r===n.UNSIGNED_INT&&(o=n.DEPTH_COMPONENT24),r===n.FLOAT&&(o=n.DEPTH_COMPONENT32F)),t===n.DEPTH_STENCIL&&r===n.UNSIGNED_INT_24_8&&(o=n.DEPTH24_STENCIL8),o!==n.R16F&&o!==n.R32F&&o!==n.RG16F&&o!==n.RG32F&&o!==n.RGBA16F&&o!==n.RGBA32F||a.get("EXT_color_buffer_float"),o}setTextureParameters(e,t){const{gl:r,extensions:s,backend:i}=this,n=c.getPrimaries(c.workingColorSpace),a=t.colorSpace===x?null:c.getPrimaries(t.colorSpace),o=t.colorSpace===x||n===a?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,t.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,t.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,o),r.texParameteri(e,r.TEXTURE_WRAP_S,oN[t.wrapS]),r.texParameteri(e,r.TEXTURE_WRAP_T,oN[t.wrapT]),e!==r.TEXTURE_3D&&e!==r.TEXTURE_2D_ARRAY||t.isArrayTexture||r.texParameteri(e,r.TEXTURE_WRAP_R,oN[t.wrapR]),r.texParameteri(e,r.TEXTURE_MAG_FILTER,uN[t.magFilter]);const u=void 0!==t.mipmaps&&t.mipmaps.length>0,l=t.minFilter===K&&u?D:t.minFilter;if(r.texParameteri(e,r.TEXTURE_MIN_FILTER,uN[l]),t.compareFunction&&(r.texParameteri(e,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(e,r.TEXTURE_COMPARE_FUNC,lN[t.compareFunction])),!0===s.has("EXT_texture_filter_anisotropic")){if(t.magFilter===v)return;if(t.minFilter!==Ge&&t.minFilter!==D)return;if(t.type===B&&!1===s.has("OES_texture_float_linear"))return;if(t.anisotropy>1){const n=s.get("EXT_texture_filter_anisotropic");r.texParameterf(e,n.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,i.getMaxAnisotropy()))}}}createDefaultTexture(e){const{gl:t,backend:r,defaultTextures:s}=this,i=this.getGLTextureType(e);let n=s[i];void 0===n&&(n=t.createTexture(),r.state.bindTexture(i,n),t.texParameteri(i,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(i,t.TEXTURE_MAG_FILTER,t.NEAREST),s[i]=n),r.set(e,{textureGPU:n,glTextureType:i,isDefault:!0})}createTexture(e,t){const{gl:r,backend:s}=this,{levels:i,width:n,height:a,depth:o}=t,u=s.utils.convert(e.format,e.colorSpace),l=s.utils.convert(e.type),d=this.getInternalFormat(e.internalFormat,u,l,e.colorSpace,e.isVideoTexture),c=r.createTexture(),h=this.getGLTextureType(e);s.state.bindTexture(h,c),this.setTextureParameters(h,e),e.isArrayTexture||e.isDataArrayTexture||e.isCompressedArrayTexture?r.texStorage3D(r.TEXTURE_2D_ARRAY,i,d,n,a,o):e.isData3DTexture?r.texStorage3D(r.TEXTURE_3D,i,d,n,a,o):e.isVideoTexture||r.texStorage2D(h,i,d,n,a),s.set(e,{textureGPU:c,glTextureType:h,glFormat:u,glType:l,glInternalFormat:d})}copyBufferToTexture(e,t){const{gl:r,backend:s}=this,{textureGPU:i,glTextureType:n,glFormat:a,glType:o}=s.get(t),{width:u,height:l}=t.source.data;r.bindBuffer(r.PIXEL_UNPACK_BUFFER,e),s.state.bindTexture(n,i),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.texSubImage2D(n,0,0,0,u,l,a,o,0),r.bindBuffer(r.PIXEL_UNPACK_BUFFER,null),s.state.unbindTexture()}updateTexture(e,t){const{gl:r}=this,{width:s,height:i}=t,{textureGPU:n,glTextureType:a,glFormat:o,glType:u,glInternalFormat:l}=this.backend.get(e);if(!e.isRenderTargetTexture&&void 0!==n)if(this.backend.state.bindTexture(a,n),this.setTextureParameters(a,e),e.isCompressedTexture){const s=e.mipmaps,i=t.image;for(let t=0;t0,c=t.renderTarget?t.renderTarget.height:this.backend.getDrawingBufferSize().y;if(d){const r=0!==a||0!==o;let d,h;if(!0===e.isDepthTexture?(d=s.DEPTH_BUFFER_BIT,h=s.DEPTH_ATTACHMENT,t.stencil&&(d|=s.STENCIL_BUFFER_BIT)):(d=s.COLOR_BUFFER_BIT,h=s.COLOR_ATTACHMENT0),r){const e=this.backend.get(t.renderTarget),r=e.framebuffers[t.getCacheKey()],h=e.msaaFrameBuffer;i.bindFramebuffer(s.DRAW_FRAMEBUFFER,r),i.bindFramebuffer(s.READ_FRAMEBUFFER,h);const p=c-o-l;s.blitFramebuffer(a,p,a+u,p+l,a,p,a+u,p+l,d,s.NEAREST),i.bindFramebuffer(s.READ_FRAMEBUFFER,r),i.bindTexture(s.TEXTURE_2D,n),s.copyTexSubImage2D(s.TEXTURE_2D,0,0,0,a,p,u,l),i.unbindTexture()}else{const e=s.createFramebuffer();i.bindFramebuffer(s.DRAW_FRAMEBUFFER,e),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,h,s.TEXTURE_2D,n,0),s.blitFramebuffer(0,0,u,l,0,0,u,l,d,s.NEAREST),s.deleteFramebuffer(e)}}else i.bindTexture(s.TEXTURE_2D,n),s.copyTexSubImage2D(s.TEXTURE_2D,0,0,0,a,c-l-o,u,l),i.unbindTexture();e.generateMipmaps&&this.generateMipmaps(e),this.backend._setFramebuffer(t)}setupRenderBufferStorage(e,t,r,s=!1){const{gl:i}=this,n=t.renderTarget,{depthTexture:a,depthBuffer:o,stencilBuffer:u,width:l,height:d}=n;if(i.bindRenderbuffer(i.RENDERBUFFER,e),o&&!u){let t=i.DEPTH_COMPONENT24;if(!0===s){this.extensions.get("WEBGL_multisampled_render_to_texture").renderbufferStorageMultisampleEXT(i.RENDERBUFFER,n.samples,t,l,d)}else r>0?(a&&a.isDepthTexture&&a.type===i.FLOAT&&(t=i.DEPTH_COMPONENT32F),i.renderbufferStorageMultisample(i.RENDERBUFFER,r,t,l,d)):i.renderbufferStorage(i.RENDERBUFFER,t,l,d);i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.RENDERBUFFER,e)}else o&&u&&(r>0?i.renderbufferStorageMultisample(i.RENDERBUFFER,r,i.DEPTH24_STENCIL8,l,d):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,l,d),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,e));i.bindRenderbuffer(i.RENDERBUFFER,null)}async copyTextureToBuffer(e,t,r,s,i,n){const{backend:a,gl:o}=this,{textureGPU:u,glFormat:l,glType:d}=this.backend.get(e),c=o.createFramebuffer();o.bindFramebuffer(o.READ_FRAMEBUFFER,c);const h=e.isCubeTexture?o.TEXTURE_CUBE_MAP_POSITIVE_X+n:o.TEXTURE_2D;o.framebufferTexture2D(o.READ_FRAMEBUFFER,o.COLOR_ATTACHMENT0,h,u,0);const p=this._getTypedArrayType(d),g=s*i*this._getBytesPerTexel(d,l),m=o.createBuffer();o.bindBuffer(o.PIXEL_PACK_BUFFER,m),o.bufferData(o.PIXEL_PACK_BUFFER,g,o.STREAM_READ),o.readPixels(t,r,s,i,l,d,0),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),await a.utils._clientWaitAsync();const f=new p(g/p.BYTES_PER_ELEMENT);return o.bindBuffer(o.PIXEL_PACK_BUFFER,m),o.getBufferSubData(o.PIXEL_PACK_BUFFER,0,f),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),o.deleteFramebuffer(c),f}_getTypedArrayType(e){const{gl:t}=this;if(e===t.UNSIGNED_BYTE)return Uint8Array;if(e===t.UNSIGNED_SHORT_4_4_4_4)return Uint16Array;if(e===t.UNSIGNED_SHORT_5_5_5_1)return Uint16Array;if(e===t.UNSIGNED_SHORT_5_6_5)return Uint16Array;if(e===t.UNSIGNED_SHORT)return Uint16Array;if(e===t.UNSIGNED_INT)return Uint32Array;if(e===t.HALF_FLOAT)return Uint16Array;if(e===t.FLOAT)return Float32Array;throw new Error(`Unsupported WebGL type: ${e}`)}_getBytesPerTexel(e,t){const{gl:r}=this;let s=0;return e===r.UNSIGNED_BYTE&&(s=1),e!==r.UNSIGNED_SHORT_4_4_4_4&&e!==r.UNSIGNED_SHORT_5_5_5_1&&e!==r.UNSIGNED_SHORT_5_6_5&&e!==r.UNSIGNED_SHORT&&e!==r.HALF_FLOAT||(s=2),e!==r.UNSIGNED_INT&&e!==r.FLOAT||(s=4),t===r.RGBA?4*s:t===r.RGB?3*s:t===r.ALPHA?s:void 0}}function hN(e){return e.isDataTexture?e.image.data:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?e:e.data}class pN{constructor(e){this.backend=e,this.gl=this.backend.gl,this.availableExtensions=this.gl.getSupportedExtensions(),this.extensions={}}get(e){let t=this.extensions[e];return void 0===t&&(t=this.gl.getExtension(e),this.extensions[e]=t),t}has(e){return this.availableExtensions.includes(e)}}class gN{constructor(e){this.backend=e,this.maxAnisotropy=null}getMaxAnisotropy(){if(null!==this.maxAnisotropy)return this.maxAnisotropy;const e=this.backend.gl,t=this.backend.extensions;if(!0===t.has("EXT_texture_filter_anisotropic")){const r=t.get("EXT_texture_filter_anisotropic");this.maxAnisotropy=e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else this.maxAnisotropy=0;return this.maxAnisotropy}}const mN={WEBGL_multi_draw:"WEBGL_multi_draw",WEBGL_compressed_texture_astc:"texture-compression-astc",WEBGL_compressed_texture_etc:"texture-compression-etc2",WEBGL_compressed_texture_etc1:"texture-compression-etc1",WEBGL_compressed_texture_pvrtc:"texture-compression-pvrtc",WEBKIT_WEBGL_compressed_texture_pvrtc:"texture-compression-pvrtc",WEBGL_compressed_texture_s3tc:"texture-compression-bc",EXT_texture_compression_bptc:"texture-compression-bptc",EXT_disjoint_timer_query_webgl2:"timestamp-query",OVR_multiview2:"OVR_multiview2"};class fN{constructor(e){this.gl=e.gl,this.extensions=e.extensions,this.info=e.renderer.info,this.mode=null,this.index=0,this.type=null,this.object=null}render(e,t){const{gl:r,mode:s,object:i,type:n,info:a,index:o}=this;0!==o?r.drawElements(s,t,n,e):r.drawArrays(s,e,t),a.update(i,t,1)}renderInstances(e,t,r){const{gl:s,mode:i,type:n,index:a,object:o,info:u}=this;0!==r&&(0!==a?s.drawElementsInstanced(i,t,n,e,r):s.drawArraysInstanced(i,e,t,r),u.update(o,t,r))}renderMultiDraw(e,t,r){const{extensions:s,mode:i,object:n,info:a}=this;if(0===r)return;const o=s.get("WEBGL_multi_draw");if(null===o)for(let s=0;sthis.maxQueries)return pt(`WebGPUTimestampQueryPool [${this.type}]: Maximum number of queries exceeded, when using trackTimestamp it is necessary to resolves the queries via renderer.resolveTimestampsAsync( THREE.TimestampQuery.${this.type.toUpperCase()} ).`),null;const t=this.currentQueryIndex;return this.currentQueryIndex+=2,this.queryStates.set(t,"inactive"),this.queryOffsets.set(e.id,t),t}beginQuery(e){if(!this.trackTimestamp||this.isDisposed)return;const t=this.queryOffsets.get(e.id);if(null==t)return;if(null!==this.activeQuery)return;const r=this.queries[t];if(r)try{"inactive"===this.queryStates.get(t)&&(this.gl.beginQuery(this.ext.TIME_ELAPSED_EXT,r),this.activeQuery=t,this.queryStates.set(t,"started"))}catch(e){console.error("Error in beginQuery:",e),this.activeQuery=null,this.queryStates.set(t,"inactive")}}endQuery(e){if(!this.trackTimestamp||this.isDisposed)return;const t=this.queryOffsets.get(e.id);if(null!=t&&this.activeQuery===t)try{this.gl.endQuery(this.ext.TIME_ELAPSED_EXT),this.queryStates.set(t,"ended"),this.activeQuery=null}catch(e){console.error("Error in endQuery:",e),this.queryStates.set(t,"inactive"),this.activeQuery=null}}async resolveQueriesAsync(){if(!this.trackTimestamp||this.pendingResolve)return this.lastValue;this.pendingResolve=!0;try{const e=[];for(const[t,r]of this.queryStates)if("ended"===r){const r=this.queries[t];e.push(this.resolveQuery(r))}if(0===e.length)return this.lastValue;const t=(await Promise.all(e)).reduce(((e,t)=>e+t),0);return this.lastValue=t,this.currentQueryIndex=0,this.queryOffsets.clear(),this.queryStates.clear(),this.activeQuery=null,t}catch(e){return console.error("Error resolving queries:",e),this.lastValue}finally{this.pendingResolve=!1}}async resolveQuery(e){return new Promise((t=>{if(this.isDisposed)return void t(this.lastValue);let r,s=!1;const i=e=>{s||(s=!0,r&&(clearTimeout(r),r=null),t(e))},n=()=>{if(this.isDisposed)i(this.lastValue);else try{if(this.gl.getParameter(this.ext.GPU_DISJOINT_EXT))return void i(this.lastValue);if(!this.gl.getQueryParameter(e,this.gl.QUERY_RESULT_AVAILABLE))return void(r=setTimeout(n,1));const s=this.gl.getQueryParameter(e,this.gl.QUERY_RESULT);t(Number(s)/1e6)}catch(e){console.error("Error checking query:",e),t(this.lastValue)}};n()}))}dispose(){if(!this.isDisposed&&(this.isDisposed=!0,this.trackTimestamp)){for(const e of this.queries)this.gl.deleteQuery(e);this.queries=[],this.queryStates.clear(),this.queryOffsets.clear(),this.lastValue=0,this.activeQuery=null}}}const bN=new t;class TN extends Jv{constructor(e={}){super(e),this.isWebGLBackend=!0,this.attributeUtils=null,this.extensions=null,this.capabilities=null,this.textureUtils=null,this.bufferRenderer=null,this.gl=null,this.state=null,this.utils=null,this.vaoCache={},this.transformFeedbackCache={},this.discard=!1,this.disjoint=null,this.parallel=null,this._currentContext=null,this._knownBindings=new WeakSet,this._supportsInvalidateFramebuffer="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),this._xrFramebuffer=null}init(e){super.init(e);const t=this.parameters,r={antialias:e.samples>0,alpha:!0,depth:e.depth,stencil:e.stencil},s=void 0!==t.context?t.context:e.domElement.getContext("webgl2",r);function i(t){t.preventDefault();const r={api:"WebGL",message:t.statusMessage||"Unknown reason",reason:null,originalEvent:t};e.onDeviceLost(r)}this._onContextLost=i,e.domElement.addEventListener("webglcontextlost",i,!1),this.gl=s,this.extensions=new pN(this),this.capabilities=new gN(this),this.attributeUtils=new iN(this),this.textureUtils=new cN(this),this.bufferRenderer=new fN(this),this.state=new nN(this),this.utils=new aN(this),this.extensions.get("EXT_color_buffer_float"),this.extensions.get("WEBGL_clip_cull_distance"),this.extensions.get("OES_texture_float_linear"),this.extensions.get("EXT_color_buffer_half_float"),this.extensions.get("WEBGL_multisampled_render_to_texture"),this.extensions.get("WEBGL_render_shared_exponent"),this.extensions.get("WEBGL_multi_draw"),this.extensions.get("OVR_multiview2"),this.disjoint=this.extensions.get("EXT_disjoint_timer_query_webgl2"),this.parallel=this.extensions.get("KHR_parallel_shader_compile")}get coordinateSystem(){return l}async getArrayBufferAsync(e){return await this.attributeUtils.getArrayBufferAsync(e)}async waitForGPU(){await this.utils._clientWaitAsync()}async makeXRCompatible(){!0!==this.gl.getContextAttributes().xrCompatible&&await this.gl.makeXRCompatible()}setXRTarget(e){this._xrFramebuffer=e}setXRRenderTargetTextures(e,t,r=null){const s=this.gl;if(this.set(e.texture,{textureGPU:t,glInternalFormat:s.RGBA8}),null!==r){const t=e.stencilBuffer?s.DEPTH24_STENCIL8:s.DEPTH_COMPONENT24;this.set(e.depthTexture,{textureGPU:r,glInternalFormat:t}),!0===this.extensions.has("WEBGL_multisampled_render_to_texture")&&!0===e._autoAllocateDepthBuffer&&!1===e.multiview&&console.warn("THREE.WebGLBackend: Render-to-texture extension was disabled because an external texture was provided"),e._autoAllocateDepthBuffer=!1}}initTimestampQuery(e){if(!this.disjoint||!this.trackTimestamp)return;const t=e.isComputeNode?"compute":"render";this.timestampQueryPool[t]||(this.timestampQueryPool[t]=new xN(this.gl,t,2048));const r=this.timestampQueryPool[t];null!==r.allocateQueriesForContext(e)&&r.beginQuery(e)}prepareTimestampBuffer(e){if(!this.disjoint||!this.trackTimestamp)return;const t=e.isComputeNode?"compute":"render";this.timestampQueryPool[t].endQuery(e)}getContext(){return this.gl}beginRender(e){const{state:t}=this,r=this.get(e);if(e.viewport)this.updateViewport(e);else{const{width:e,height:r}=this.getDrawingBufferSize(bN);t.viewport(0,0,e,r)}if(e.scissor){const{x:r,y:s,width:i,height:n}=e.scissorValue;t.scissor(r,e.height-n-s,i,n)}this.initTimestampQuery(e),r.previousContext=this._currentContext,this._currentContext=e,this._setFramebuffer(e),this.clear(e.clearColor,e.clearDepth,e.clearStencil,e,!1);const s=e.occlusionQueryCount;s>0&&(r.currentOcclusionQueries=r.occlusionQueries,r.currentOcclusionQueryObjects=r.occlusionQueryObjects,r.lastOcclusionObject=null,r.occlusionQueries=new Array(s),r.occlusionQueryObjects=new Array(s),r.occlusionQueryIndex=0)}finishRender(e){const{gl:t,state:r}=this,s=this.get(e),i=s.previousContext;r.resetVertexState();const n=e.occlusionQueryCount;n>0&&(n>s.occlusionQueryIndex&&t.endQuery(t.ANY_SAMPLES_PASSED),this.resolveOccludedAsync(e));const a=e.textures;if(null!==a)for(let e=0;e0&&!1===this._useMultisampledExtension(o)){const i=s.framebuffers[e.getCacheKey()];let n=t.COLOR_BUFFER_BIT;o.resolveDepthBuffer&&(o.depthBuffer&&(n|=t.DEPTH_BUFFER_BIT),o.stencilBuffer&&o.resolveStencilBuffer&&(n|=t.STENCIL_BUFFER_BIT));const a=s.msaaFrameBuffer,u=s.msaaRenderbuffers,l=e.textures,d=l.length>1;if(r.bindFramebuffer(t.READ_FRAMEBUFFER,a),r.bindFramebuffer(t.DRAW_FRAMEBUFFER,i),d)for(let e=0;e{let a=0;for(let t=0;t{t.isBatchedMesh?null!==t._multiDrawInstances?(pt("THREE.WebGLBackend: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),y.renderMultiDrawInstances(t._multiDrawStarts,t._multiDrawCounts,t._multiDrawCount,t._multiDrawInstances)):this.hasFeature("WEBGL_multi_draw")?y.renderMultiDraw(t._multiDrawStarts,t._multiDrawCounts,t._multiDrawCount):pt("THREE.WebGLRenderer: WEBGL_multi_draw not supported."):b>1?y.renderInstances(T,x,b):y.render(T,x)};if(!0===e.camera.isArrayCamera&&e.camera.cameras.length>0&&!1===e.camera.isMultiViewCamera){const r=this.get(e.camera),s=e.camera.cameras,i=e.getBindingGroup("cameraIndex").bindings[0];if(void 0===r.indexesGPU||r.indexesGPU.length!==s.length){const e=new Uint32Array([0,0,0,0]),t=[];for(let r=0,i=s.length;r{const i=this.parallel,n=()=>{r.getProgramParameter(a,i.COMPLETION_STATUS_KHR)?(this._completeCompile(e,s),t()):requestAnimationFrame(n)};n()}));t.push(i)}else this._completeCompile(e,s)}_handleSource(e,t){const r=e.split("\n"),s=[],i=Math.max(t-6,0),n=Math.min(t+6,r.length);for(let e=i;e":" "} ${i}: ${r[e]}`)}return s.join("\n")}_getShaderErrors(e,t,r){const s=e.getShaderParameter(t,e.COMPILE_STATUS),i=e.getShaderInfoLog(t).trim();if(s&&""===i)return"";const n=/ERROR: 0:(\d+)/.exec(i);if(n){const s=parseInt(n[1]);return r.toUpperCase()+"\n\n"+i+"\n\n"+this._handleSource(e.getShaderSource(t),s)}return i}_logProgramError(e,t,r){if(this.renderer.debug.checkShaderErrors){const s=this.gl,i=s.getProgramInfoLog(e).trim();if(!1===s.getProgramParameter(e,s.LINK_STATUS))if("function"==typeof this.renderer.debug.onShaderError)this.renderer.debug.onShaderError(s,e,r,t);else{const n=this._getShaderErrors(s,r,"vertex"),a=this._getShaderErrors(s,t,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(e,s.VALIDATE_STATUS)+"\n\nProgram Info Log: "+i+"\n"+n+"\n"+a)}else""!==i&&console.warn("THREE.WebGLProgram: Program Info Log:",i)}}_completeCompile(e,t){const{state:r,gl:s}=this,i=this.get(t),{programGPU:n,fragmentShader:a,vertexShader:o}=i;!1===s.getProgramParameter(n,s.LINK_STATUS)&&this._logProgramError(n,a,o),r.useProgram(n);const u=e.getBindings();this._setupBindings(u,n),this.set(t,{programGPU:n})}createComputePipeline(e,t){const{state:r,gl:s}=this,i={stage:"fragment",code:"#version 300 es\nprecision highp float;\nvoid main() {}"};this.createProgram(i);const{computeProgram:n}=e,a=s.createProgram(),o=this.get(i).shaderGPU,u=this.get(n).shaderGPU,l=n.transforms,d=[],c=[];for(let e=0;emN[t]===e)),r=this.extensions;for(let e=0;e1,h=!0===i.isXRRenderTarget,p=!0===h&&!0===i._hasExternalTextures;let g=n.msaaFrameBuffer,m=n.depthRenderbuffer;const f=this.extensions.get("WEBGL_multisampled_render_to_texture"),y=this.extensions.get("OVR_multiview2"),x=this._useMultisampledExtension(i),b=Tf(e);let T;if(l?(n.cubeFramebuffers||(n.cubeFramebuffers={}),T=n.cubeFramebuffers[b]):h&&!1===p?T=this._xrFramebuffer:(n.framebuffers||(n.framebuffers={}),T=n.framebuffers[b]),void 0===T){T=t.createFramebuffer(),r.bindFramebuffer(t.FRAMEBUFFER,T);const s=e.textures,o=[];if(l){n.cubeFramebuffers[b]=T;const{textureGPU:e}=this.get(s[0]),r=this.renderer._activeCubeFace;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+r,e,0)}else{n.framebuffers[b]=T;for(let r=0;r0&&!1===x&&!i.multiview){if(void 0===g){const s=[];g=t.createFramebuffer(),r.bindFramebuffer(t.FRAMEBUFFER,g);const i=[],l=e.textures;for(let r=0;r0&&!0===this.extensions.has("WEBGL_multisampled_render_to_texture")&&!1!==e._autoAllocateDepthBuffer}dispose(){const e=this.extensions.get("WEBGL_lose_context");e&&e.loseContext(),this.renderer.domElement.removeEventListener("webglcontextlost",this._onContextLost)}}const _N="point-list",vN="line-list",NN="line-strip",SN="triangle-list",EN="triangle-strip",wN="never",AN="less",RN="equal",CN="less-equal",MN="greater",PN="not-equal",LN="greater-equal",FN="always",BN="store",IN="load",DN="clear",VN="ccw",UN="none",ON="front",kN="back",GN="uint16",zN="uint32",HN="r8unorm",$N="r8snorm",WN="r8uint",jN="r8sint",qN="r16uint",XN="r16sint",KN="r16float",YN="rg8unorm",QN="rg8snorm",ZN="rg8uint",JN="rg8sint",eS="r32uint",tS="r32sint",rS="r32float",sS="rg16uint",iS="rg16sint",nS="rg16float",aS="rgba8unorm",oS="rgba8unorm-srgb",uS="rgba8snorm",lS="rgba8uint",dS="rgba8sint",cS="bgra8unorm",hS="bgra8unorm-srgb",pS="rgb9e5ufloat",gS="rgb10a2unorm",mS="rgb10a2unorm",fS="rg32uint",yS="rg32sint",xS="rg32float",bS="rgba16uint",TS="rgba16sint",_S="rgba16float",vS="rgba32uint",NS="rgba32sint",SS="rgba32float",ES="depth16unorm",wS="depth24plus",AS="depth24plus-stencil8",RS="depth32float",CS="depth32float-stencil8",MS="bc1-rgba-unorm",PS="bc1-rgba-unorm-srgb",LS="bc2-rgba-unorm",FS="bc2-rgba-unorm-srgb",BS="bc3-rgba-unorm",IS="bc3-rgba-unorm-srgb",DS="bc4-r-unorm",VS="bc4-r-snorm",US="bc5-rg-unorm",OS="bc5-rg-snorm",kS="bc6h-rgb-ufloat",GS="bc6h-rgb-float",zS="bc7-rgba-unorm",HS="bc7-rgba-srgb",$S="etc2-rgb8unorm",WS="etc2-rgb8unorm-srgb",jS="etc2-rgb8a1unorm",qS="etc2-rgb8a1unorm-srgb",XS="etc2-rgba8unorm",KS="etc2-rgba8unorm-srgb",YS="eac-r11unorm",QS="eac-r11snorm",ZS="eac-rg11unorm",JS="eac-rg11snorm",eE="astc-4x4-unorm",tE="astc-4x4-unorm-srgb",rE="astc-5x4-unorm",sE="astc-5x4-unorm-srgb",iE="astc-5x5-unorm",nE="astc-5x5-unorm-srgb",aE="astc-6x5-unorm",oE="astc-6x5-unorm-srgb",uE="astc-6x6-unorm",lE="astc-6x6-unorm-srgb",dE="astc-8x5-unorm",cE="astc-8x5-unorm-srgb",hE="astc-8x6-unorm",pE="astc-8x6-unorm-srgb",gE="astc-8x8-unorm",mE="astc-8x8-unorm-srgb",fE="astc-10x5-unorm",yE="astc-10x5-unorm-srgb",xE="astc-10x6-unorm",bE="astc-10x6-unorm-srgb",TE="astc-10x8-unorm",_E="astc-10x8-unorm-srgb",vE="astc-10x10-unorm",NE="astc-10x10-unorm-srgb",SE="astc-12x10-unorm",EE="astc-12x10-unorm-srgb",wE="astc-12x12-unorm",AE="astc-12x12-unorm-srgb",RE="clamp-to-edge",CE="repeat",ME="mirror-repeat",PE="linear",LE="nearest",FE="zero",BE="one",IE="src",DE="one-minus-src",VE="src-alpha",UE="one-minus-src-alpha",OE="dst",kE="one-minus-dst",GE="dst-alpha",zE="one-minus-dst-alpha",HE="src-alpha-saturated",$E="constant",WE="one-minus-constant",jE="add",qE="subtract",XE="reverse-subtract",KE="min",YE="max",QE=0,ZE=15,JE="keep",ew="zero",tw="replace",rw="invert",sw="increment-clamp",iw="decrement-clamp",nw="increment-wrap",aw="decrement-wrap",ow="storage",uw="read-only-storage",lw="write-only",dw="read-only",cw="read-write",hw="non-filtering",pw="comparison",gw="float",mw="unfilterable-float",fw="depth",yw="sint",xw="uint",bw="2d",Tw="3d",_w="2d",vw="2d-array",Nw="cube",Sw="3d",Ew="all",ww="vertex",Aw="instance",Rw={DepthClipControl:"depth-clip-control",Depth32FloatStencil8:"depth32float-stencil8",TextureCompressionBC:"texture-compression-bc",TextureCompressionETC2:"texture-compression-etc2",TextureCompressionASTC:"texture-compression-astc",TimestampQuery:"timestamp-query",IndirectFirstInstance:"indirect-first-instance",ShaderF16:"shader-f16",RG11B10UFloat:"rg11b10ufloat-renderable",BGRA8UNormStorage:"bgra8unorm-storage",Float32Filterable:"float32-filterable",ClipDistances:"clip-distances",DualSourceBlending:"dual-source-blending",Subgroups:"subgroups"};class Cw extends Pv{constructor(e,t){super(e),this.texture=t,this.version=t?t.version:0,this.isSampler=!0}}class Mw extends Cw{constructor(e,t,r){super(e,t?t.value:null),this.textureNode=t,this.groupNode=r}update(){this.texture=this.textureNode.value}}class Pw extends Lv{constructor(e,t){super(e,t?t.array:null),this.attribute=t,this.isStorageBuffer=!0}}let Lw=0;class Fw extends Pw{constructor(e,t){super("StorageBuffer_"+Lw++,e?e.value:null),this.nodeUniform=e,this.access=e?e.access:Os.READ_WRITE,this.groupNode=t}get buffer(){return this.nodeUniform.value}}class Bw extends qm{constructor(e){super(),this.device=e;this.mipmapSampler=e.createSampler({minFilter:PE}),this.flipYSampler=e.createSampler({minFilter:LE}),this.transferPipelines={},this.flipYPipelines={},this.mipmapVertexShaderModule=e.createShaderModule({label:"mipmapVertex",code:"\nstruct VarysStruct {\n\t@builtin( position ) Position: vec4,\n\t@location( 0 ) vTex : vec2\n};\n\n@vertex\nfn main( @builtin( vertex_index ) vertexIndex : u32 ) -> VarysStruct {\n\n\tvar Varys : VarysStruct;\n\n\tvar pos = array< vec2, 4 >(\n\t\tvec2( -1.0, 1.0 ),\n\t\tvec2( 1.0, 1.0 ),\n\t\tvec2( -1.0, -1.0 ),\n\t\tvec2( 1.0, -1.0 )\n\t);\n\n\tvar tex = array< vec2, 4 >(\n\t\tvec2( 0.0, 0.0 ),\n\t\tvec2( 1.0, 0.0 ),\n\t\tvec2( 0.0, 1.0 ),\n\t\tvec2( 1.0, 1.0 )\n\t);\n\n\tVarys.vTex = tex[ vertexIndex ];\n\tVarys.Position = vec4( pos[ vertexIndex ], 0.0, 1.0 );\n\n\treturn Varys;\n\n}\n"}),this.mipmapFragmentShaderModule=e.createShaderModule({label:"mipmapFragment",code:"\n@group( 0 ) @binding( 0 )\nvar imgSampler : sampler;\n\n@group( 0 ) @binding( 1 )\nvar img : texture_2d;\n\n@fragment\nfn main( @location( 0 ) vTex : vec2 ) -> @location( 0 ) vec4 {\n\n\treturn textureSample( img, imgSampler, vTex );\n\n}\n"}),this.flipYFragmentShaderModule=e.createShaderModule({label:"flipYFragment",code:"\n@group( 0 ) @binding( 0 )\nvar imgSampler : sampler;\n\n@group( 0 ) @binding( 1 )\nvar img : texture_2d;\n\n@fragment\nfn main( @location( 0 ) vTex : vec2 ) -> @location( 0 ) vec4 {\n\n\treturn textureSample( img, imgSampler, vec2( vTex.x, 1.0 - vTex.y ) );\n\n}\n"})}getTransferPipeline(e){let t=this.transferPipelines[e];return void 0===t&&(t=this.device.createRenderPipeline({label:`mipmap-${e}`,vertex:{module:this.mipmapVertexShaderModule,entryPoint:"main"},fragment:{module:this.mipmapFragmentShaderModule,entryPoint:"main",targets:[{format:e}]},primitive:{topology:EN,stripIndexFormat:zN},layout:"auto"}),this.transferPipelines[e]=t),t}getFlipYPipeline(e){let t=this.flipYPipelines[e];return void 0===t&&(t=this.device.createRenderPipeline({label:`flipY-${e}`,vertex:{module:this.mipmapVertexShaderModule,entryPoint:"main"},fragment:{module:this.flipYFragmentShaderModule,entryPoint:"main",targets:[{format:e}]},primitive:{topology:EN,stripIndexFormat:zN},layout:"auto"}),this.flipYPipelines[e]=t),t}flipY(e,t,r=0){const s=t.format,{width:i,height:n}=t.size,a=this.getTransferPipeline(s),o=this.getFlipYPipeline(s),u=this.device.createTexture({size:{width:i,height:n,depthOrArrayLayers:1},format:s,usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING}),l=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:_w,baseArrayLayer:r}),d=u.createView({baseMipLevel:0,mipLevelCount:1,dimension:_w,baseArrayLayer:0}),c=this.device.createCommandEncoder({}),h=(e,t,r)=>{const s=e.getBindGroupLayout(0),i=this.device.createBindGroup({layout:s,entries:[{binding:0,resource:this.flipYSampler},{binding:1,resource:t}]}),n=c.beginRenderPass({colorAttachments:[{view:r,loadOp:DN,storeOp:BN,clearValue:[0,0,0,0]}]});n.setPipeline(e),n.setBindGroup(0,i),n.draw(4,1,0,0),n.end()};h(a,l,d),h(o,d,l),this.device.queue.submit([c.finish()]),u.destroy()}generateMipmaps(e,t,r=0){const s=this.get(e);void 0===s.useCount&&(s.useCount=0,s.layers=[]);const i=s.layers[r]||this._mipmapCreateBundles(e,t,r),n=this.device.createCommandEncoder({});this._mipmapRunBundles(n,i),this.device.queue.submit([n.finish()]),0!==s.useCount&&(s.layers[r]=i),s.useCount++}_mipmapCreateBundles(e,t,r){const s=this.getTransferPipeline(t.format),i=s.getBindGroupLayout(0);let n=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:_w,baseArrayLayer:r});const a=[];for(let o=1;o1;for(let a=0;a]*\s*([a-z_0-9]+(?:<[\s\S]+?>)?)/i,kw=/([a-z_0-9]+)\s*:\s*([a-z_0-9]+(?:<[\s\S]+?>)?)/gi,Gw={f32:"float",i32:"int",u32:"uint",bool:"bool","vec2":"vec2","vec2":"ivec2","vec2":"uvec2","vec2":"bvec2",vec2f:"vec2",vec2i:"ivec2",vec2u:"uvec2",vec2b:"bvec2","vec3":"vec3","vec3":"ivec3","vec3":"uvec3","vec3":"bvec3",vec3f:"vec3",vec3i:"ivec3",vec3u:"uvec3",vec3b:"bvec3","vec4":"vec4","vec4":"ivec4","vec4":"uvec4","vec4":"bvec4",vec4f:"vec4",vec4i:"ivec4",vec4u:"uvec4",vec4b:"bvec4","mat2x2":"mat2",mat2x2f:"mat2","mat3x3":"mat3",mat3x3f:"mat3","mat4x4":"mat4",mat4x4f:"mat4",sampler:"sampler",texture_1d:"texture",texture_2d:"texture",texture_2d_array:"texture",texture_multisampled_2d:"cubeTexture",texture_depth_2d:"depthTexture",texture_depth_2d_array:"depthTexture",texture_depth_multisampled_2d:"depthTexture",texture_depth_cube:"depthTexture",texture_depth_cube_array:"depthTexture",texture_3d:"texture3D",texture_cube:"cubeTexture",texture_cube_array:"cubeTexture",texture_storage_1d:"storageTexture",texture_storage_2d:"storageTexture",texture_storage_2d_array:"storageTexture",texture_storage_3d:"storageTexture"};class zw extends X_{constructor(e){const{type:t,inputs:r,name:s,inputsCode:i,blockCode:n,outputType:a}=(e=>{const t=(e=e.trim()).match(Ow);if(null!==t&&4===t.length){const r=t[2],s=[];let i=null;for(;null!==(i=kw.exec(r));)s.push({name:i[1],type:i[2]});const n=[];for(let e=0;e "+this.outputType:"";return`fn ${e} ( ${this.inputsCode.trim()} ) ${t}`+this.blockCode}}class Hw extends q_{parseFunction(e){return new zw(e)}}const $w="undefined"!=typeof self?self.GPUShaderStage:{VERTEX:1,FRAGMENT:2,COMPUTE:4},Ww={[Os.READ_ONLY]:"read",[Os.WRITE_ONLY]:"write",[Os.READ_WRITE]:"read_write"},jw={[Nr]:"repeat",[vr]:"clamp",[_r]:"mirror"},qw={vertex:$w?$w.VERTEX:1,fragment:$w?$w.FRAGMENT:2,compute:$w?$w.COMPUTE:4},Xw={instance:!0,swizzleAssign:!1,storageBuffer:!0},Kw={"^^":"tsl_xor"},Yw={float:"f32",int:"i32",uint:"u32",bool:"bool",color:"vec3",vec2:"vec2",ivec2:"vec2",uvec2:"vec2",bvec2:"vec2",vec3:"vec3",ivec3:"vec3",uvec3:"vec3",bvec3:"vec3",vec4:"vec4",ivec4:"vec4",uvec4:"vec4",bvec4:"vec4",mat2:"mat2x2",mat3:"mat3x3",mat4:"mat4x4"},Qw={},Zw={tsl_xor:new wx("fn tsl_xor( a : bool, b : bool ) -> bool { return ( a || b ) && !( a && b ); }"),mod_float:new wx("fn tsl_mod_float( x : f32, y : f32 ) -> f32 { return x - y * floor( x / y ); }"),mod_vec2:new wx("fn tsl_mod_vec2( x : vec2f, y : vec2f ) -> vec2f { return x - y * floor( x / y ); }"),mod_vec3:new wx("fn tsl_mod_vec3( x : vec3f, y : vec3f ) -> vec3f { return x - y * floor( x / y ); }"),mod_vec4:new wx("fn tsl_mod_vec4( x : vec4f, y : vec4f ) -> vec4f { return x - y * floor( x / y ); }"),equals_bool:new wx("fn tsl_equals_bool( a : bool, b : bool ) -> bool { return a == b; }"),equals_bvec2:new wx("fn tsl_equals_bvec2( a : vec2f, b : vec2f ) -> vec2 { return vec2( a.x == b.x, a.y == b.y ); }"),equals_bvec3:new wx("fn tsl_equals_bvec3( a : vec3f, b : vec3f ) -> vec3 { return vec3( a.x == b.x, a.y == b.y, a.z == b.z ); }"),equals_bvec4:new wx("fn tsl_equals_bvec4( a : vec4f, b : vec4f ) -> vec4 { return vec4( a.x == b.x, a.y == b.y, a.z == b.z, a.w == b.w ); }"),repeatWrapping_float:new wx("fn tsl_repeatWrapping_float( coord: f32 ) -> f32 { return fract( coord ); }"),mirrorWrapping_float:new wx("fn tsl_mirrorWrapping_float( coord: f32 ) -> f32 { let mirrored = fract( coord * 0.5 ) * 2.0; return 1.0 - abs( 1.0 - mirrored ); }"),clampWrapping_float:new wx("fn tsl_clampWrapping_float( coord: f32 ) -> f32 { return clamp( coord, 0.0, 1.0 ); }"),biquadraticTexture:new wx("\nfn tsl_biquadraticTexture( map : texture_2d, coord : vec2f, iRes : vec2u, level : u32 ) -> vec4f {\n\n\tlet res = vec2f( iRes );\n\n\tlet uvScaled = coord * res;\n\tlet uvWrapping = ( ( uvScaled % res ) + res ) % res;\n\n\t// https://www.shadertoy.com/view/WtyXRy\n\n\tlet uv = uvWrapping - 0.5;\n\tlet iuv = floor( uv );\n\tlet f = fract( uv );\n\n\tlet rg1 = textureLoad( map, vec2u( iuv + vec2( 0.5, 0.5 ) ) % iRes, level );\n\tlet rg2 = textureLoad( map, vec2u( iuv + vec2( 1.5, 0.5 ) ) % iRes, level );\n\tlet rg3 = textureLoad( map, vec2u( iuv + vec2( 0.5, 1.5 ) ) % iRes, level );\n\tlet rg4 = textureLoad( map, vec2u( iuv + vec2( 1.5, 1.5 ) ) % iRes, level );\n\n\treturn mix( mix( rg1, rg2, f.x ), mix( rg3, rg4, f.x ), f.y );\n\n}\n")},Jw={dFdx:"dpdx",dFdy:"- dpdy",mod_float:"tsl_mod_float",mod_vec2:"tsl_mod_vec2",mod_vec3:"tsl_mod_vec3",mod_vec4:"tsl_mod_vec4",equals_bool:"tsl_equals_bool",equals_bvec2:"tsl_equals_bvec2",equals_bvec3:"tsl_equals_bvec3",equals_bvec4:"tsl_equals_bvec4",inversesqrt:"inverseSqrt",bitcast:"bitcast"};"undefined"!=typeof navigator&&/Windows/g.test(navigator.userAgent)&&(Zw.pow_float=new wx("fn tsl_pow_float( a : f32, b : f32 ) -> f32 { return select( -pow( -a, b ), pow( a, b ), a > 0.0 ); }"),Zw.pow_vec2=new wx("fn tsl_pow_vec2( a : vec2f, b : vec2f ) -> vec2f { return vec2f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ) ); }",[Zw.pow_float]),Zw.pow_vec3=new wx("fn tsl_pow_vec3( a : vec3f, b : vec3f ) -> vec3f { return vec3f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ) ); }",[Zw.pow_float]),Zw.pow_vec4=new wx("fn tsl_pow_vec4( a : vec4f, b : vec4f ) -> vec4f { return vec4f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ), tsl_pow_float( a.w, b.w ) ); }",[Zw.pow_float]),Jw.pow_float="tsl_pow_float",Jw.pow_vec2="tsl_pow_vec2",Jw.pow_vec3="tsl_pow_vec3",Jw.pow_vec4="tsl_pow_vec4");let eA="";!0!==("undefined"!=typeof navigator&&/Firefox|Deno/g.test(navigator.userAgent))&&(eA+="diagnostic( off, derivative_uniformity );\n");class tA extends L_{constructor(e,t){super(e,t,new Hw),this.uniformGroups={},this.builtins={},this.directives={},this.scopedArrays=new Map}needsToWorkingColorSpace(e){return!0===e.isVideoTexture&&e.colorSpace!==x}_generateTextureSample(e,t,r,s,i=this.shaderStage){return"fragment"===i?s?`textureSample( ${t}, ${t}_sampler, ${r}, ${s} )`:`textureSample( ${t}, ${t}_sampler, ${r} )`:this._generateTextureSampleLevel(e,t,r,"0",s)}_generateVideoSample(e,t,r=this.shaderStage){if("fragment"===r)return`textureSampleBaseClampToEdge( ${e}, ${e}_sampler, vec2( ${t}.x, 1.0 - ${t}.y ) )`;console.error(`WebGPURenderer: THREE.VideoTexture does not support ${r} shader.`)}_generateTextureSampleLevel(e,t,r,s,i){return!1===this.isUnfilterable(e)?`textureSampleLevel( ${t}, ${t}_sampler, ${r}, ${s} )`:this.isFilteredTexture(e)?this.generateFilteredTexture(e,t,r,s):this.generateTextureLod(e,t,r,i,s)}generateWrapFunction(e){const t=`tsl_coord_${jw[e.wrapS]}S_${jw[e.wrapT]}_${e.isData3DTexture?"3d":"2d"}T`;let r=Qw[t];if(void 0===r){const s=[],i=e.isData3DTexture?"vec3f":"vec2f";let n=`fn ${t}( coord : ${i} ) -> ${i} {\n\n\treturn ${i}(\n`;const a=(e,t)=>{e===Nr?(s.push(Zw.repeatWrapping_float),n+=`\t\ttsl_repeatWrapping_float( coord.${t} )`):e===vr?(s.push(Zw.clampWrapping_float),n+=`\t\ttsl_clampWrapping_float( coord.${t} )`):e===_r?(s.push(Zw.mirrorWrapping_float),n+=`\t\ttsl_mirrorWrapping_float( coord.${t} )`):(n+=`\t\tcoord.${t}`,console.warn(`WebGPURenderer: Unsupported texture wrap type "${e}" for vertex shader.`))};a(e.wrapS,"x"),n+=",\n",a(e.wrapT,"y"),e.isData3DTexture&&(n+=",\n",a(e.wrapR,"z")),n+="\n\t);\n\n}\n",Qw[t]=r=new wx(n,s)}return r.build(this),t}generateArrayDeclaration(e,t){return`array< ${this.getType(e)}, ${t} >`}generateTextureDimension(e,t,r){const s=this.getDataFromNode(e,this.shaderStage,this.globalCache);void 0===s.dimensionsSnippet&&(s.dimensionsSnippet={});let i=s.dimensionsSnippet[r];if(void 0===s.dimensionsSnippet[r]){let n,a;const{primarySamples:o}=this.renderer.backend.utils.getTextureSampleData(e),u=o>1;a=e.isData3DTexture?"vec3":"vec2",n=u||e.isVideoTexture||e.isStorageTexture?t:`${t}${r?`, u32( ${r} )`:""}`,i=new Jo(new Iu(`textureDimensions( ${n} )`,a)),s.dimensionsSnippet[r]=i,(e.isArrayTexture||e.isDataArrayTexture||e.isData3DTexture)&&(s.arrayLayerCount=new Jo(new Iu(`textureNumLayers(${t})`,"u32"))),e.isTextureCube&&(s.cubeFaceCount=new Jo(new Iu("6u","u32")))}return i.build(this)}generateFilteredTexture(e,t,r,s="0u"){this._include("biquadraticTexture");return`tsl_biquadraticTexture( ${t}, ${this.generateWrapFunction(e)}( ${r} ), ${this.generateTextureDimension(e,t,s)}, u32( ${s} ) )`}generateTextureLod(e,t,r,s,i="0u"){const n=this.generateWrapFunction(e),a=this.generateTextureDimension(e,t,i),o=e.isData3DTexture?"vec3":"vec2",u=`${o}( ${n}( ${r} ) * ${o}( ${a} ) )`;return this.generateTextureLoad(e,t,u,s,i)}generateTextureLoad(e,t,r,s,i="0u"){let n;return!0===e.isVideoTexture?n=`textureLoad( ${t}, ${r} )`:s?n=`textureLoad( ${t}, ${r}, ${s}, u32( ${i} ) )`:(n=`textureLoad( ${t}, ${r}, u32( ${i} ) )`,this.renderer.backend.compatibilityMode&&e.isDepthTexture&&(n+=".x")),n}generateTextureStore(e,t,r,s,i){let n;return n=s?`textureStore( ${t}, ${r}, ${s}, ${i} )`:`textureStore( ${t}, ${r}, ${i} )`,n}isSampleCompare(e){return!0===e.isDepthTexture&&null!==e.compareFunction}isUnfilterable(e){return"float"!==this.getComponentTypeFromTexture(e)||!this.isAvailable("float32Filterable")&&!0===e.isDataTexture&&e.type===B||!1===this.isSampleCompare(e)&&e.minFilter===v&&e.magFilter===v||this.renderer.backend.utils.getTextureSampleData(e).primarySamples>1}generateTexture(e,t,r,s,i=this.shaderStage){let n=null;return n=!0===e.isVideoTexture?this._generateVideoSample(t,r,i):this.isUnfilterable(e)?this.generateTextureLod(e,t,r,s,"0",i):this._generateTextureSample(e,t,r,s,i),n}generateTextureGrad(e,t,r,s,i,n=this.shaderStage){if("fragment"===n)return`textureSampleGrad( ${t}, ${t}_sampler, ${r}, ${s[0]}, ${s[1]} )`;console.error(`WebGPURenderer: THREE.TextureNode.gradient() does not support ${n} shader.`)}generateTextureCompare(e,t,r,s,i,n=this.shaderStage){if("fragment"===n)return!0===e.isDepthTexture&&!0===e.isArrayTexture?`textureSampleCompare( ${t}, ${t}_sampler, ${r}, ${i}, ${s} )`:`textureSampleCompare( ${t}, ${t}_sampler, ${r}, ${s} )`;console.error(`WebGPURenderer: THREE.DepthTexture.compareFunction() does not support ${n} shader.`)}generateTextureLevel(e,t,r,s,i,n=this.shaderStage){let a=null;return a=!0===e.isVideoTexture?this._generateVideoSample(t,r,n):this._generateTextureSampleLevel(e,t,r,s,i),a}generateTextureBias(e,t,r,s,i,n=this.shaderStage){if("fragment"===n)return`textureSampleBias( ${t}, ${t}_sampler, ${r}, ${s} )`;console.error(`WebGPURenderer: THREE.TextureNode.biasNode does not support ${n} shader.`)}getPropertyName(e,t=this.shaderStage){if(!0===e.isNodeVarying&&!0===e.needsInterpolation){if("vertex"===t)return`varyings.${e.name}`}else if(!0===e.isNodeUniform){const t=e.name,r=e.type;return"texture"===r||"cubeTexture"===r||"storageTexture"===r||"texture3D"===r?t:"buffer"===r||"storageBuffer"===r||"indirectStorageBuffer"===r?this.isCustomStruct(e)?t:t+".value":e.groupNode.name+"."+t}return super.getPropertyName(e)}getOutputStructName(){return"output"}getFunctionOperator(e){const t=Kw[e];return void 0!==t?(this._include(t),t):null}getNodeAccess(e,t){return"compute"!==t?Os.READ_ONLY:e.access}getStorageAccess(e,t){return Ww[this.getNodeAccess(e,t)]}getUniformFromNode(e,t,r,s=null){const i=super.getUniformFromNode(e,t,r,s),n=this.getDataFromNode(e,r,this.globalCache);if(void 0===n.uniformGPU){let a;const o=e.groupNode,u=o.name,l=this.getBindGroupArray(u,r);if("texture"===t||"cubeTexture"===t||"storageTexture"===t||"texture3D"===t){let s=null;const n=this.getNodeAccess(e,r);if("texture"===t||"storageTexture"===t?s=new Gv(i.name,i.node,o,n):"cubeTexture"===t?s=new zv(i.name,i.node,o,n):"texture3D"===t&&(s=new Hv(i.name,i.node,o,n)),s.store=!0===e.isStorageTextureNode,s.setVisibility(qw[r]),!1===this.isUnfilterable(e.value)&&!1===s.store){const e=new Mw(`${i.name}_sampler`,i.node,o);e.setVisibility(qw[r]),l.push(e,s),a=[e,s]}else l.push(s),a=[s]}else if("buffer"===t||"storageBuffer"===t||"indirectStorageBuffer"===t){const n=new("buffer"===t?Iv:Fw)(e,o);n.setVisibility(qw[r]),l.push(n),a=n,i.name=s||"NodeBuffer_"+i.id}else{const e=this.uniformGroups[r]||(this.uniformGroups[r]={});let s=e[u];void 0===s&&(s=new Uv(u,o),s.setVisibility(qw[r]),e[u]=s,l.push(s)),a=this.getNodeUniform(i,t),s.addUniform(a)}n.uniformGPU=a}return i}getBuiltin(e,t,r,s=this.shaderStage){const i=this.builtins[s]||(this.builtins[s]=new Map);return!1===i.has(e)&&i.set(e,{name:e,property:t,type:r}),t}hasBuiltin(e,t=this.shaderStage){return void 0!==this.builtins[t]&&this.builtins[t].has(e)}getVertexIndex(){return"vertex"===this.shaderStage?this.getBuiltin("vertex_index","vertexIndex","u32","attribute"):"vertexIndex"}buildFunctionCode(e){const t=e.layout,r=this.flowShaderNode(e),s=[];for(const e of t.inputs)s.push(e.name+" : "+this.getType(e.type));let i=`fn ${t.name}( ${s.join(", ")} ) -> ${this.getType(t.type)} {\n${r.vars}\n${r.code}\n`;return r.result&&(i+=`\treturn ${r.result};\n`),i+="\n}\n",i}getInstanceIndex(){return"vertex"===this.shaderStage?this.getBuiltin("instance_index","instanceIndex","u32","attribute"):"instanceIndex"}getInvocationLocalIndex(){return this.getBuiltin("local_invocation_index","invocationLocalIndex","u32","attribute")}getSubgroupSize(){return this.enableSubGroups(),this.getBuiltin("subgroup_size","subgroupSize","u32","attribute")}getInvocationSubgroupIndex(){return this.enableSubGroups(),this.getBuiltin("subgroup_invocation_id","invocationSubgroupIndex","u32","attribute")}getSubgroupIndex(){return this.enableSubGroups(),this.getBuiltin("subgroup_id","subgroupIndex","u32","attribute")}getDrawIndex(){return null}getFrontFacing(){return this.getBuiltin("front_facing","isFront","bool")}getFragCoord(){return this.getBuiltin("position","fragCoord","vec4")+".xy"}getFragDepth(){return"output."+this.getBuiltin("frag_depth","depth","f32","output")}getClipDistance(){return"varyings.hw_clip_distances"}isFlipY(){return!1}enableDirective(e,t=this.shaderStage){(this.directives[t]||(this.directives[t]=new Set)).add(e)}getDirectives(e){const t=[],r=this.directives[e];if(void 0!==r)for(const e of r)t.push(`enable ${e};`);return t.join("\n")}enableSubGroups(){this.enableDirective("subgroups")}enableSubgroupsF16(){this.enableDirective("subgroups-f16")}enableClipDistances(){this.enableDirective("clip_distances")}enableShaderF16(){this.enableDirective("f16")}enableDualSourceBlending(){this.enableDirective("dual_source_blending")}enableHardwareClipping(e){this.enableClipDistances(),this.getBuiltin("clip_distances","hw_clip_distances",`array`,"vertex")}getBuiltins(e){const t=[],r=this.builtins[e];if(void 0!==r)for(const{name:e,property:s,type:i}of r.values())t.push(`@builtin( ${e} ) ${s} : ${i}`);return t.join(",\n\t")}getScopedArray(e,t,r,s){return!1===this.scopedArrays.has(e)&&this.scopedArrays.set(e,{name:e,scope:t,bufferType:r,bufferCount:s}),e}getScopedArrays(e){if("compute"!==e)return;const t=[];for(const{name:e,scope:r,bufferType:s,bufferCount:i}of this.scopedArrays.values()){const n=this.getType(s);t.push(`var<${r}> ${e}: array< ${n}, ${i} >;`)}return t.join("\n")}getAttributes(e){const t=[];if("compute"===e&&(this.getBuiltin("global_invocation_id","globalId","vec3","attribute"),this.getBuiltin("workgroup_id","workgroupId","vec3","attribute"),this.getBuiltin("local_invocation_id","localId","vec3","attribute"),this.getBuiltin("num_workgroups","numWorkgroups","vec3","attribute"),this.renderer.hasFeature("subgroups")&&(this.enableDirective("subgroups",e),this.getBuiltin("subgroup_size","subgroupSize","u32","attribute"))),"vertex"===e||"compute"===e){const e=this.getBuiltins("attribute");e&&t.push(e);const r=this.getAttributesArray();for(let e=0,s=r.length;e"),t.push(`\t${s+r.name} : ${i}`)}return e.output&&t.push(`\t${this.getBuiltins("output")}`),t.join(",\n")}getStructs(e){let t="";const r=this.structs[e];if(r.length>0){const e=[];for(const t of r){let r=`struct ${t.name} {\n`;r+=this.getStructMembers(t),r+="\n};",e.push(r)}t="\n"+e.join("\n\n")+"\n"}return t}getVar(e,t,r=null){let s=`var ${t} : `;return s+=null!==r?this.generateArrayDeclaration(e,r):this.getType(e),s}getVars(e){const t=[],r=this.vars[e];if(void 0!==r)for(const e of r)t.push(`\t${this.getVar(e.type,e.name,e.count)};`);return`\n${t.join("\n")}\n`}getVaryings(e){const t=[];if("vertex"===e&&this.getBuiltin("position","Vertex","vec4","vertex"),"vertex"===e||"fragment"===e){const r=this.varyings,s=this.vars[e];for(let i=0;ir.value.itemSize;return s&&!i}getUniforms(e){const t=this.uniforms[e],r=[],s=[],i=[],n={};for(const i of t){const t=i.groupNode.name,a=this.bindingsIndexes[t];if("texture"===i.type||"cubeTexture"===i.type||"storageTexture"===i.type||"texture3D"===i.type){const t=i.node.value;let s;!1===this.isUnfilterable(t)&&!0!==i.node.isStorageTextureNode&&(this.isSampleCompare(t)?r.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${i.name}_sampler : sampler_comparison;`):r.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${i.name}_sampler : sampler;`));let n="";const{primarySamples:o}=this.renderer.backend.utils.getTextureSampleData(t);if(o>1&&(n="_multisampled"),!0===t.isCubeTexture)s="texture_cube";else if(!0===t.isDepthTexture)s=this.renderer.backend.compatibilityMode&&null===t.compareFunction?`texture${n}_2d`:`texture_depth${n}_2d${!0===t.isArrayTexture?"_array":""}`;else if(!0===t.isArrayTexture||!0===t.isDataArrayTexture||!0===t.isCompressedArrayTexture)s="texture_2d_array";else if(!0===t.isVideoTexture)s="texture_external";else if(!0===t.isData3DTexture)s="texture_3d";else if(!0===i.node.isStorageTextureNode){s=`texture_storage_2d<${Uw(t)}, ${this.getStorageAccess(i.node,e)}>`}else{s=`texture${n}_2d<${this.getComponentTypeFromTexture(t).charAt(0)}32>`}r.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${i.name} : ${s};`)}else if("buffer"===i.type||"storageBuffer"===i.type||"indirectStorageBuffer"===i.type){const t=i.node,r=this.getType(t.getNodeType(this)),n=t.bufferCount,o=n>0&&"buffer"===i.type?", "+n:"",u=t.isStorageBufferNode?`storage, ${this.getStorageAccess(t,e)}`:"uniform";if(this.isCustomStruct(i))s.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var<${u}> ${i.name} : ${r};`);else{const e=`\tvalue : array< ${t.isAtomic?`atomic<${r}>`:`${r}`}${o} >`;s.push(this._getWGSLStructBinding(i.name,e,u,a.binding++,a.group))}}else{const e=this.getType(this.getVectorType(i.type)),t=i.groupNode.name;(n[t]||(n[t]={index:a.binding++,id:a.group,snippets:[]})).snippets.push(`\t${i.name} : ${e}`)}}for(const e in n){const t=n[e];i.push(this._getWGSLStructBinding(e,t.snippets.join(",\n"),"uniform",t.index,t.id))}let a=r.join("\n");return a+=s.join("\n"),a+=i.join("\n"),a}buildCode(){const e=null!==this.material?{fragment:{},vertex:{}}:{compute:{}};this.sortBindingGroups();for(const t in e){this.shaderStage=t;const r=e[t];r.uniforms=this.getUniforms(t),r.attributes=this.getAttributes(t),r.varyings=this.getVaryings(t),r.structs=this.getStructs(t),r.vars=this.getVars(t),r.codes=this.getCodes(t),r.directives=this.getDirectives(t),r.scopedArrays=this.getScopedArrays(t);let s="// code\n\n";s+=this.flowCode[t];const i=this.flowNodes[t],n=i[i.length-1],a=n.outputNode,o=void 0!==a&&!0===a.isOutputStructNode;for(const e of i){const i=this.getFlowData(e),u=e.name;if(u&&(s.length>0&&(s+="\n"),s+=`\t// flow -> ${u}\n`),s+=`${i.code}\n\t`,e===n&&"compute"!==t)if(s+="// result\n\n\t","vertex"===t)s+=`varyings.Vertex = ${i.result};`;else if("fragment"===t)if(o)r.returnType=a.getNodeType(this),r.structs+="var output : "+r.returnType+";",s+=`return ${i.result};`;else{let e="\t@location(0) color: vec4";const t=this.getBuiltins("output");t&&(e+=",\n\t"+t),r.returnType="OutputStruct",r.structs+=this._getWGSLStruct("OutputStruct",e),r.structs+="\nvar output : OutputStruct;",s+=`output.color = ${i.result};\n\n\treturn output;`}}r.flow=s}this.shaderStage=null,null!==this.material?(this.vertexShader=this._getWGSLVertexCode(e.vertex),this.fragmentShader=this._getWGSLFragmentCode(e.fragment)):this.computeShader=this._getWGSLComputeCode(e.compute,(this.object.workgroupSize||[64]).join(", "))}getMethod(e,t=null){let r;return null!==t&&(r=this._getWGSLMethod(e+"_"+t)),void 0===r&&(r=this._getWGSLMethod(e)),r||e}getType(e){return Yw[e]||e}isAvailable(e){let t=Xw[e];return void 0===t&&("float32Filterable"===e?t=this.renderer.hasFeature("float32-filterable"):"clipDistance"===e&&(t=this.renderer.hasFeature("clip-distances")),Xw[e]=t),t}_getWGSLMethod(e){return void 0!==Zw[e]&&this._include(e),Jw[e]}_include(e){const t=Zw[e];return t.build(this),null!==this.currentFunctionNode&&this.currentFunctionNode.includes.push(t),t}_getWGSLVertexCode(e){return`${this.getSignature()}\n// directives\n${e.directives}\n\n// structs\n${e.structs}\n\n// uniforms\n${e.uniforms}\n\n// varyings\n${e.varyings}\nvar varyings : VaryingsStruct;\n\n// codes\n${e.codes}\n\n@vertex\nfn main( ${e.attributes} ) -> VaryingsStruct {\n\n\t// vars\n\t${e.vars}\n\n\t// flow\n\t${e.flow}\n\n\treturn varyings;\n\n}\n`}_getWGSLFragmentCode(e){return`${this.getSignature()}\n// global\n${eA}\n\n// structs\n${e.structs}\n\n// uniforms\n${e.uniforms}\n\n// codes\n${e.codes}\n\n@fragment\nfn main( ${e.varyings} ) -> ${e.returnType} {\n\n\t// vars\n\t${e.vars}\n\n\t// flow\n\t${e.flow}\n\n}\n`}_getWGSLComputeCode(e,t){return`${this.getSignature()}\n// directives\n${e.directives}\n\n// system\nvar instanceIndex : u32;\n\n// locals\n${e.scopedArrays}\n\n// structs\n${e.structs}\n\n// uniforms\n${e.uniforms}\n\n// codes\n${e.codes}\n\n@compute @workgroup_size( ${t} )\nfn main( ${e.attributes} ) {\n\n\t// system\n\tinstanceIndex = globalId.x + globalId.y * numWorkgroups.x * u32(${t}) + globalId.z * numWorkgroups.x * numWorkgroups.y * u32(${t});\n\n\t// vars\n\t${e.vars}\n\n\t// flow\n\t${e.flow}\n\n}\n`}_getWGSLStruct(e,t){return`\nstruct ${e} {\n${t}\n};`}_getWGSLStructBinding(e,t,r,s=0,i=0){const n=e+"Struct";return`${this._getWGSLStruct(n,t)}\n@binding( ${s} ) @group( ${i} )\nvar<${r}> ${e} : ${n};`}}class rA{constructor(e){this.backend=e}getCurrentDepthStencilFormat(e){let t;return null!==e.depthTexture?t=this.getTextureFormatGPU(e.depthTexture):e.depth&&e.stencil?t=AS:e.depth&&(t=wS),t}getTextureFormatGPU(e){return this.backend.get(e).format}getTextureSampleData(e){let t;if(e.isFramebufferTexture)t=1;else if(e.isDepthTexture&&!e.renderTarget){const e=this.backend.renderer,r=e.getRenderTarget();t=r?r.samples:e.samples}else e.renderTarget&&(t=e.renderTarget.samples);t=t||1;const r=t>1&&null!==e.renderTarget&&!0!==e.isDepthTexture&&!0!==e.isFramebufferTexture;return{samples:t,primarySamples:r?1:t,isMSAA:r}}getCurrentColorFormat(e){let t;return t=null!==e.textures?this.getTextureFormatGPU(e.textures[0]):this.getPreferredCanvasFormat(),t}getCurrentColorSpace(e){return null!==e.textures?e.textures[0].colorSpace:this.backend.renderer.outputColorSpace}getPrimitiveTopology(e,t){return e.isPoints?_N:e.isLineSegments||e.isMesh&&!0===t.wireframe?vN:e.isLine?NN:e.isMesh?SN:void 0}getSampleCount(e){let t=1;return e>1&&(t=Math.pow(2,Math.floor(Math.log2(e))),2===t&&(t=4)),t}getSampleCountRenderContext(e){return null!==e.textures?this.getSampleCount(e.sampleCount):this.getSampleCount(this.backend.renderer.samples)}getPreferredCanvasFormat(){const e=this.backend.parameters.outputType;if(void 0===e)return navigator.gpu.getPreferredCanvasFormat();if(e===Ce)return cS;if(e===de)return _S;throw new Error("Unsupported outputType")}}const sA=new Map([[Int8Array,["sint8","snorm8"]],[Uint8Array,["uint8","unorm8"]],[Int16Array,["sint16","snorm16"]],[Uint16Array,["uint16","unorm16"]],[Int32Array,["sint32","snorm32"]],[Uint32Array,["uint32","unorm32"]],[Float32Array,["float32"]]]),iA=new Map([[ze,["float16"]]]),nA=new Map([[Int32Array,"sint32"],[Int16Array,"sint32"],[Uint32Array,"uint32"],[Uint16Array,"uint32"],[Float32Array,"float32"]]);class aA{constructor(e){this.backend=e}createAttribute(e,t){const r=this._getBufferAttribute(e),s=this.backend,i=s.get(r);let n=i.buffer;if(void 0===n){const a=s.device;let o=r.array;if(!1===e.normalized)if(o.constructor===Int16Array||o.constructor===Int8Array)o=new Int32Array(o);else if((o.constructor===Uint16Array||o.constructor===Uint8Array)&&(o=new Uint32Array(o),t&GPUBufferUsage.INDEX))for(let e=0;e1&&(s.multisampled=!0,r.texture.isDepthTexture||(s.sampleType=mw)),r.texture.isDepthTexture)t.compatibilityMode&&null===r.texture.compareFunction?s.sampleType=mw:s.sampleType=fw;else if(r.texture.isDataTexture||r.texture.isDataArrayTexture||r.texture.isData3DTexture){const e=r.texture.type;e===_?s.sampleType=yw:e===T?s.sampleType=xw:e===B&&(this.backend.hasFeature("float32-filterable")?s.sampleType=gw:s.sampleType=mw)}r.isSampledCubeTexture?s.viewDimension=Nw:r.texture.isArrayTexture||r.texture.isDataArrayTexture||r.texture.isCompressedArrayTexture?s.viewDimension=vw:r.isSampledTexture3D&&(s.viewDimension=Sw),e.texture=s}else console.error(`WebGPUBindingUtils: Unsupported binding "${r}".`);s.push(e)}return r.createBindGroupLayout({entries:s})}createBindings(e,t,r,s=0){const{backend:i,bindGroupLayoutCache:n}=this,a=i.get(e);let o,u=n.get(e.bindingsReference);void 0===u&&(u=this.createBindingsLayout(e),n.set(e.bindingsReference,u)),r>0&&(void 0===a.groups&&(a.groups=[],a.versions=[]),a.versions[r]===s&&(o=a.groups[r])),void 0===o&&(o=this.createBindGroup(e,u),r>0&&(a.groups[r]=o,a.versions[r]=s)),a.group=o,a.layout=u}updateBinding(e){const t=this.backend,r=t.device,s=e.buffer,i=t.get(e).buffer;r.queue.writeBuffer(i,0,s,0)}createBindGroupIndex(e,t){const r=this.backend.device,s=GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,i=e[0],n=r.createBuffer({label:"bindingCameraIndex_"+i,size:16,usage:s});r.queue.writeBuffer(n,0,e,0);const a=[{binding:0,resource:{buffer:n}}];return r.createBindGroup({label:"bindGroupCameraIndex_"+i,layout:t,entries:a})}createBindGroup(e,t){const r=this.backend,s=r.device;let i=0;const n=[];for(const t of e.bindings){if(t.isUniformBuffer){const e=r.get(t);if(void 0===e.buffer){const r=t.byteLength,i=GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,n=s.createBuffer({label:"bindingBuffer_"+t.name,size:r,usage:i});e.buffer=n}n.push({binding:i,resource:{buffer:e.buffer}})}else if(t.isStorageBuffer){const e=r.get(t);if(void 0===e.buffer){const s=t.attribute;e.buffer=r.get(s).buffer}n.push({binding:i,resource:{buffer:e.buffer}})}else if(t.isSampler){const e=r.get(t.texture);n.push({binding:i,resource:e.sampler})}else if(t.isSampledTexture){const e=r.get(t.texture);let a;if(void 0!==e.externalTexture)a=s.importExternalTexture({source:e.externalTexture});else{const r=t.store?1:e.texture.mipLevelCount,s=`view-${e.texture.width}-${e.texture.height}-${r}`;if(a=e[s],void 0===a){const i=Ew;let n;n=t.isSampledCubeTexture?Nw:t.isSampledTexture3D?Sw:t.texture.isArrayTexture||t.texture.isDataArrayTexture||t.texture.isCompressedArrayTexture?vw:_w,a=e[s]=e.texture.createView({aspect:i,dimension:n,mipLevelCount:r})}}n.push({binding:i,resource:a})}i++}return s.createBindGroup({label:"bindGroup_"+e.name,layout:t,entries:n})}}class uA{constructor(e){this.backend=e,this._activePipelines=new WeakMap}setPipeline(e,t){this._activePipelines.get(e)!==t&&(e.setPipeline(t),this._activePipelines.set(e,t))}_getSampleCount(e){return this.backend.utils.getSampleCountRenderContext(e)}createRenderPipeline(e,t){const{object:r,material:s,geometry:i,pipeline:n}=e,{vertexProgram:a,fragmentProgram:o}=n,u=this.backend,l=u.device,d=u.utils,c=u.get(n),h=[];for(const t of e.getBindings()){const e=u.get(t);h.push(e.layout)}const p=u.attributeUtils.createShaderVertexBuffers(e);let g;s.blending===z||s.blending===O&&!1===s.transparent||(g=this._getBlending(s));let m={};!0===s.stencilWrite&&(m={compare:this._getStencilCompare(s),failOp:this._getStencilOperation(s.stencilFail),depthFailOp:this._getStencilOperation(s.stencilZFail),passOp:this._getStencilOperation(s.stencilZPass)});const f=this._getColorWriteMask(s),y=[];if(null!==e.context.textures){const t=e.context.textures;for(let e=0;e1},layout:l.createPipelineLayout({bindGroupLayouts:h})},E={},w=e.context.depth,A=e.context.stencil;if(!0!==w&&!0!==A||(!0===w&&(E.format=v,E.depthWriteEnabled=s.depthWrite,E.depthCompare=_),!0===A&&(E.stencilFront=m,E.stencilBack={},E.stencilReadMask=s.stencilFuncMask,E.stencilWriteMask=s.stencilWriteMask),!0===s.polygonOffset&&(E.depthBias=s.polygonOffsetUnits,E.depthBiasSlopeScale=s.polygonOffsetFactor,E.depthBiasClamp=0),S.depthStencil=E),null===t)c.pipeline=l.createRenderPipeline(S);else{const e=new Promise((e=>{l.createRenderPipelineAsync(S).then((t=>{c.pipeline=t,e()}))}));t.push(e)}}createBundleEncoder(e,t="renderBundleEncoder"){const r=this.backend,{utils:s,device:i}=r,n=s.getCurrentDepthStencilFormat(e),a={label:t,colorFormats:[s.getCurrentColorFormat(e)],depthStencilFormat:n,sampleCount:this._getSampleCount(e)};return i.createRenderBundleEncoder(a)}createComputePipeline(e,t){const r=this.backend,s=r.device,i=r.get(e.computeProgram).module,n=r.get(e),a=[];for(const e of t){const t=r.get(e);a.push(t.layout)}n.pipeline=s.createComputePipeline({compute:i,layout:s.createPipelineLayout({bindGroupLayouts:a})})}_getBlending(e){let t,r;const s=e.blending,i=e.blendSrc,n=e.blendDst,a=e.blendEquation;if(s===qe){const s=null!==e.blendSrcAlpha?e.blendSrcAlpha:i,o=null!==e.blendDstAlpha?e.blendDstAlpha:n,u=null!==e.blendEquationAlpha?e.blendEquationAlpha:a;t={srcFactor:this._getBlendFactor(i),dstFactor:this._getBlendFactor(n),operation:this._getBlendOperation(a)},r={srcFactor:this._getBlendFactor(s),dstFactor:this._getBlendFactor(o),operation:this._getBlendOperation(u)}}else{const i=(e,s,i,n)=>{t={srcFactor:e,dstFactor:s,operation:jE},r={srcFactor:i,dstFactor:n,operation:jE}};if(e.premultipliedAlpha)switch(s){case O:i(BE,UE,BE,UE);break;case Lt:i(BE,BE,BE,BE);break;case Pt:i(FE,DE,FE,BE);break;case Mt:i(FE,IE,FE,VE)}else switch(s){case O:i(VE,UE,BE,UE);break;case Lt:i(VE,BE,VE,BE);break;case Pt:i(FE,DE,FE,BE);break;case Mt:i(FE,IE,FE,IE)}}if(void 0!==t&&void 0!==r)return{color:t,alpha:r};console.error("THREE.WebGPURenderer: Invalid blending: ",s)}_getBlendFactor(e){let t;switch(e){case Ke:t=FE;break;case wt:t=BE;break;case Et:t=IE;break;case Tt:t=DE;break;case St:t=VE;break;case bt:t=UE;break;case vt:t=OE;break;case xt:t=kE;break;case _t:t=GE;break;case yt:t=zE;break;case Nt:t=HE;break;case 211:t=$E;break;case 212:t=WE;break;default:console.error("THREE.WebGPURenderer: Blend factor not supported.",e)}return t}_getStencilCompare(e){let t;const r=e.stencilFunc;switch(r){case kr:t=wN;break;case Or:t=FN;break;case Ur:t=AN;break;case Vr:t=CN;break;case Dr:t=RN;break;case Ir:t=LN;break;case Br:t=MN;break;case Fr:t=PN;break;default:console.error("THREE.WebGPURenderer: Invalid stencil function.",r)}return t}_getStencilOperation(e){let t;switch(e){case Xr:t=JE;break;case qr:t=ew;break;case jr:t=tw;break;case Wr:t=rw;break;case $r:t=sw;break;case Hr:t=iw;break;case zr:t=nw;break;case Gr:t=aw;break;default:console.error("THREE.WebGPURenderer: Invalid stencil operation.",t)}return t}_getBlendOperation(e){let t;switch(e){case Xe:t=jE;break;case ft:t=qE;break;case mt:t=XE;break;case Yr:t=KE;break;case Kr:t=YE;break;default:console.error("THREE.WebGPUPipelineUtils: Blend equation not supported.",e)}return t}_getPrimitiveState(e,t,r){const s={},i=this.backend.utils;switch(s.topology=i.getPrimitiveTopology(e,r),null!==t.index&&!0===e.isLine&&!0!==e.isLineSegments&&(s.stripIndexFormat=t.index.array instanceof Uint16Array?GN:zN),r.side){case je:s.frontFace=VN,s.cullMode=kN;break;case S:s.frontFace=VN,s.cullMode=ON;break;case Se:s.frontFace=VN,s.cullMode=UN;break;default:console.error("THREE.WebGPUPipelineUtils: Unknown material.side value.",r.side)}return s}_getColorWriteMask(e){return!0===e.colorWrite?ZE:QE}_getDepthCompare(e){let t;if(!1===e.depthTest)t=FN;else{const r=e.depthFunc;switch(r){case kt:t=wN;break;case Ot:t=FN;break;case Ut:t=AN;break;case Vt:t=CN;break;case Dt:t=RN;break;case It:t=LN;break;case Bt:t=MN;break;case Ft:t=PN;break;default:console.error("THREE.WebGPUPipelineUtils: Invalid depth function.",r)}}return t}}class lA extends yN{constructor(e,t,r=2048){super(r),this.device=e,this.type=t,this.querySet=this.device.createQuerySet({type:"timestamp",count:this.maxQueries,label:`queryset_global_timestamp_${t}`});const s=8*this.maxQueries;this.resolveBuffer=this.device.createBuffer({label:`buffer_timestamp_resolve_${t}`,size:s,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),this.resultBuffer=this.device.createBuffer({label:`buffer_timestamp_result_${t}`,size:s,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ})}allocateQueriesForContext(e){if(!this.trackTimestamp||this.isDisposed)return null;if(this.currentQueryIndex+2>this.maxQueries)return pt(`WebGPUTimestampQueryPool [${this.type}]: Maximum number of queries exceeded, when using trackTimestamp it is necessary to resolves the queries via renderer.resolveTimestampsAsync( THREE.TimestampQuery.${this.type.toUpperCase()} ).`),null;const t=this.currentQueryIndex;return this.currentQueryIndex+=2,this.queryOffsets.set(e.id,t),t}async resolveQueriesAsync(){if(!this.trackTimestamp||0===this.currentQueryIndex||this.isDisposed)return this.lastValue;if(this.pendingResolve)return this.pendingResolve;this.pendingResolve=this._resolveQueries();try{return await this.pendingResolve}finally{this.pendingResolve=null}}async _resolveQueries(){if(this.isDisposed)return this.lastValue;try{if("unmapped"!==this.resultBuffer.mapState)return this.lastValue;const e=new Map(this.queryOffsets),t=this.currentQueryIndex,r=8*t;this.currentQueryIndex=0,this.queryOffsets.clear();const s=this.device.createCommandEncoder();s.resolveQuerySet(this.querySet,0,t,this.resolveBuffer,0),s.copyBufferToBuffer(this.resolveBuffer,0,this.resultBuffer,0,r);const i=s.finish();if(this.device.queue.submit([i]),"unmapped"!==this.resultBuffer.mapState)return this.lastValue;if(await this.resultBuffer.mapAsync(GPUMapMode.READ,0,r),this.isDisposed)return"mapped"===this.resultBuffer.mapState&&this.resultBuffer.unmap(),this.lastValue;const n=new BigUint64Array(this.resultBuffer.getMappedRange(0,r));let a=0;for(const[,t]of e){const e=n[t],r=n[t+1];a+=Number(r-e)/1e6}return this.resultBuffer.unmap(),this.lastValue=a,a}catch(e){return console.error("Error resolving queries:",e),"mapped"===this.resultBuffer.mapState&&this.resultBuffer.unmap(),this.lastValue}}async dispose(){if(!this.isDisposed){if(this.isDisposed=!0,this.pendingResolve)try{await this.pendingResolve}catch(e){console.error("Error waiting for pending resolve:",e)}if(this.resultBuffer&&"mapped"===this.resultBuffer.mapState)try{this.resultBuffer.unmap()}catch(e){console.error("Error unmapping buffer:",e)}this.querySet&&(this.querySet.destroy(),this.querySet=null),this.resolveBuffer&&(this.resolveBuffer.destroy(),this.resolveBuffer=null),this.resultBuffer&&(this.resultBuffer.destroy(),this.resultBuffer=null),this.queryOffsets.clear(),this.pendingResolve=null}}}class dA extends Jv{constructor(e={}){super(e),this.isWebGPUBackend=!0,this.parameters.alpha=void 0===e.alpha||e.alpha,this.parameters.compatibilityMode=void 0!==e.compatibilityMode&&e.compatibilityMode,this.parameters.requiredLimits=void 0===e.requiredLimits?{}:e.requiredLimits,this.compatibilityMode=this.parameters.compatibilityMode,this.device=null,this.context=null,this.colorBuffer=null,this.defaultRenderPassdescriptor=null,this.utils=new rA(this),this.attributeUtils=new aA(this),this.bindingUtils=new oA(this),this.pipelineUtils=new uA(this),this.textureUtils=new Vw(this),this.occludedResolveCache=new Map}async init(e){await super.init(e);const t=this.parameters;let r;if(void 0===t.device){const e={powerPreference:t.powerPreference,featureLevel:t.compatibilityMode?"compatibility":void 0},s="undefined"!=typeof navigator?await navigator.gpu.requestAdapter(e):null;if(null===s)throw new Error("WebGPUBackend: Unable to create WebGPU adapter.");const i=Object.values(Rw),n=[];for(const e of i)s.features.has(e)&&n.push(e);const a={requiredFeatures:n,requiredLimits:t.requiredLimits};r=await s.requestDevice(a)}else r=t.device;r.lost.then((t=>{const r={api:"WebGPU",message:t.message||"Unknown reason",reason:t.reason||null,originalEvent:t};e.onDeviceLost(r)}));const s=void 0!==t.context?t.context:e.domElement.getContext("webgpu");this.device=r,this.context=s;const i=t.alpha?"premultiplied":"opaque";this.trackTimestamp=this.trackTimestamp&&this.hasFeature(Rw.TimestampQuery),this.context.configure({device:this.device,format:this.utils.getPreferredCanvasFormat(),usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,alphaMode:i}),this.updateSize()}get coordinateSystem(){return d}async getArrayBufferAsync(e){return await this.attributeUtils.getArrayBufferAsync(e)}getContext(){return this.context}_getDefaultRenderPassDescriptor(){let e=this.defaultRenderPassdescriptor;if(null===e){const t=this.renderer;e={colorAttachments:[{view:null}]},!0!==this.renderer.depth&&!0!==this.renderer.stencil||(e.depthStencilAttachment={view:this.textureUtils.getDepthBuffer(t.depth,t.stencil).createView()});const r=e.colorAttachments[0];this.renderer.samples>0?r.view=this.colorBuffer.createView():r.resolveTarget=void 0,this.defaultRenderPassdescriptor=e}const t=e.colorAttachments[0];return this.renderer.samples>0?t.resolveTarget=this.context.getCurrentTexture().createView():t.view=this.context.getCurrentTexture().createView(),e}_isRenderCameraDepthArray(e){return e.depthTexture&&e.depthTexture.image.depth>1&&e.camera.isArrayCamera}_getRenderPassDescriptor(e,t={}){const r=e.renderTarget,s=this.get(r);let i=s.descriptors;if(void 0===i||s.width!==r.width||s.height!==r.height||s.dimensions!==r.dimensions||s.activeMipmapLevel!==e.activeMipmapLevel||s.activeCubeFace!==e.activeCubeFace||s.samples!==r.samples){i={},s.descriptors=i;const e=()=>{r.removeEventListener("dispose",e),this.delete(r)};!1===r.hasEventListener("dispose",e)&&r.addEventListener("dispose",e)}const n=e.getCacheKey();let a=i[n];if(void 0===a){const t=e.textures,o=[];let u;const l=this._isRenderCameraDepthArray(e);for(let s=0;s1)if(!0===l){const t=e.camera.cameras;for(let e=0;e0&&(t.currentOcclusionQuerySet&&t.currentOcclusionQuerySet.destroy(),t.currentOcclusionQueryBuffer&&t.currentOcclusionQueryBuffer.destroy(),t.currentOcclusionQuerySet=t.occlusionQuerySet,t.currentOcclusionQueryBuffer=t.occlusionQueryBuffer,t.currentOcclusionQueryObjects=t.occlusionQueryObjects,i=r.createQuerySet({type:"occlusion",count:s,label:`occlusionQuerySet_${e.id}`}),t.occlusionQuerySet=i,t.occlusionQueryIndex=0,t.occlusionQueryObjects=new Array(s),t.lastOcclusionObject=null),n=null===e.textures?this._getDefaultRenderPassDescriptor():this._getRenderPassDescriptor(e,{loadOp:IN}),this.initTimestampQuery(e,n),n.occlusionQuerySet=i;const a=n.depthStencilAttachment;if(null!==e.textures){const t=n.colorAttachments;for(let r=0;r0&&t.currentPass.executeBundles(t.renderBundles),r>t.occlusionQueryIndex&&t.currentPass.endOcclusionQuery();const s=t.encoder;if(!0===this._isRenderCameraDepthArray(e)){const r=[];for(let e=0;e0){const s=8*r;let i=this.occludedResolveCache.get(s);void 0===i&&(i=this.device.createBuffer({size:s,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),this.occludedResolveCache.set(s,i));const n=this.device.createBuffer({size:s,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});t.encoder.resolveQuerySet(t.occlusionQuerySet,0,r,i,0),t.encoder.copyBufferToBuffer(i,0,n,0,s),t.occlusionQueryBuffer=n,this.resolveOccludedAsync(e)}if(this.device.queue.submit([t.encoder.finish()]),null!==e.textures){const t=e.textures;for(let e=0;ea?(u.x=Math.min(t.dispatchCount,a),u.y=Math.ceil(t.dispatchCount/a)):u.x=t.dispatchCount,i.dispatchWorkgroups(u.x,u.y,u.z)}finishCompute(e){const t=this.get(e);t.passEncoderGPU.end(),this.device.queue.submit([t.cmdEncoderGPU.finish()])}async waitForGPU(){await this.device.queue.onSubmittedWorkDone()}draw(e,t){const{object:r,material:s,context:i,pipeline:n}=e,a=e.getBindings(),o=this.get(i),u=this.get(n).pipeline,l=e.getIndex(),d=null!==l,c=e.getDrawParameters();if(null===c)return;const h=(t,r)=>{this.pipelineUtils.setPipeline(t,u),r.pipeline=u;const n=r.bindingGroups;for(let e=0,r=a.length;e{if(h(s,i),!0===r.isBatchedMesh){const e=r._multiDrawStarts,i=r._multiDrawCounts,n=r._multiDrawCount,a=r._multiDrawInstances;null!==a&&pt("THREE.WebGPUBackend: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.");for(let o=0;o1?0:o;!0===d?s.drawIndexed(i[o],n,e[o]/l.array.BYTES_PER_ELEMENT,0,u):s.draw(i[o],n,e[o],u),t.update(r,i[o],n)}}else if(!0===d){const{vertexCount:i,instanceCount:n,firstVertex:a}=c,o=e.getIndirect();if(null!==o){const e=this.get(o).buffer;s.drawIndexedIndirect(e,0)}else s.drawIndexed(i,n,a,0,0);t.update(r,i,n)}else{const{vertexCount:i,instanceCount:n,firstVertex:a}=c,o=e.getIndirect();if(null!==o){const e=this.get(o).buffer;s.drawIndirect(e,0)}else s.draw(i,n,a,0);t.update(r,i,n)}};if(e.camera.isArrayCamera&&e.camera.cameras.length>0){const t=this.get(e.camera),s=e.camera.cameras,n=e.getBindingGroup("cameraIndex");if(void 0===t.indexesGPU||t.indexesGPU.length!==s.length){const e=this.get(n),r=[],i=new Uint32Array([0,0,0,0]);for(let t=0,n=s.length;t(console.warn("THREE.WebGPURenderer: WebGPU is not available, running under WebGL2 backend."),new TN(e)));super(new t(e),e),this.library=new pA,this.isWebGPURenderer=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}}class mA extends ds{constructor(){super(),this.isBundleGroup=!0,this.type="BundleGroup",this.static=!0,this.version=0}set needsUpdate(e){!0===e&&this.version++}}class fA{constructor(e,t=nn(0,0,1,1)){this.renderer=e,this.outputNode=t,this.outputColorTransform=!0,this.needsUpdate=!0;const r=new Wh;r.name="PostProcessing",this._quadMesh=new vy(r)}render(){this._update();const e=this.renderer,t=e.toneMapping,r=e.outputColorSpace;e.toneMapping=p,e.outputColorSpace=ue;const s=e.xr.enabled;e.xr.enabled=!1,this._quadMesh.render(e),e.xr.enabled=s,e.toneMapping=t,e.outputColorSpace=r}dispose(){this._quadMesh.material.dispose()}_update(){if(!0===this.needsUpdate){const e=this.renderer,t=e.toneMapping,r=e.outputColorSpace;this._quadMesh.material.fragmentNode=!0===this.outputColorTransform?Ou(this.outputNode,t,r):this.outputNode.context({toneMapping:t,outputColorSpace:r}),this._quadMesh.material.needsUpdate=!0,this.needsUpdate=!1}}async renderAsync(){this._update();const e=this.renderer,t=e.toneMapping,r=e.outputColorSpace;e.toneMapping=p,e.outputColorSpace=ue;const s=e.xr.enabled;e.xr.enabled=!1,await this._quadMesh.renderAsync(e),e.xr.enabled=s,e.toneMapping=t,e.outputColorSpace=r}}class yA extends b{constructor(e=1,t=1){super(),this.image={width:e,height:t},this.magFilter=K,this.minFilter=K,this.isStorageTexture=!0}}class xA extends My{constructor(e,t){super(e,t,Uint32Array),this.isIndirectStorageBufferAttribute=!0}}class bA extends cs{constructor(e){super(e),this.textures={},this.nodes={}}load(e,t,r,s){const i=new hs(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,(r=>{try{t(this.parse(JSON.parse(r)))}catch(t){s?s(t):console.error(t),this.manager.itemError(e)}}),r,s)}parseNodes(e){const t={};if(void 0!==e){for(const r of e){const{uuid:e,type:s}=r;t[e]=this.createNodeFromType(s),t[e].uuid=e}const r={nodes:t,textures:this.textures};for(const s of e){s.meta=r;t[s.uuid].deserialize(s),delete s.meta}}return t}parse(e){const t=this.createNodeFromType(e.type);t.uuid=e.uuid;const r={nodes:this.parseNodes(e.nodes),textures:this.textures};return e.meta=r,t.deserialize(e),delete e.meta,t}setTextures(e){return this.textures=e,this}setNodes(e){return this.nodes=e,this}createNodeFromType(e){return void 0===this.nodes[e]?(console.error("THREE.NodeLoader: Node type not found:",e),ji()):Bi(new this.nodes[e])}}class TA extends ps{constructor(e){super(e),this.nodes={},this.nodeMaterials={}}parse(e){const t=super.parse(e),r=this.nodes,s=e.inputNodes;for(const e in s){const i=s[e];t[e]=r[i]}return t}setNodes(e){return this.nodes=e,this}setNodeMaterials(e){return this.nodeMaterials=e,this}createMaterialFromType(e){const t=this.nodeMaterials[e];return void 0!==t?new t:super.createMaterialFromType(e)}}class _A extends gs{constructor(e){super(e),this.nodes={},this.nodeMaterials={},this._nodesJSON=null}setNodes(e){return this.nodes=e,this}setNodeMaterials(e){return this.nodeMaterials=e,this}parse(e,t){this._nodesJSON=e.nodes;const r=super.parse(e,t);return this._nodesJSON=null,r}parseNodes(e,t){if(void 0!==e){const r=new bA;return r.setNodes(this.nodes),r.setTextures(t),r.parseNodes(e)}return{}}parseMaterials(e,t){const r={};if(void 0!==e){const s=this.parseNodes(this._nodesJSON,t),i=new TA;i.setTextures(t),i.setNodes(s),i.setNodeMaterials(this.nodeMaterials);for(let t=0,s=e.length;t0){const{width:r,height:s}=e.context;t.bufferWidth=r,t.bufferHeight=s}this.renderObjects.set(e,t)}return t}getAttributesData(e){const t={};for(const r in e){const s=e[r];t[r]={version:s.version}}return t}containsNode(e){const t=e.material;for(const e in t)if(t[e]&&t[e].isNode)return!0;return null!==e.renderer.overrideNodes.modelViewMatrix||null!==e.renderer.overrideNodes.modelNormalViewMatrix}getMaterialData(e){const t={};for(const r of this.refreshUniforms){const s=e[r];null!=s&&("object"==typeof s&&void 0!==s.clone?!0===s.isTexture?t[r]={id:s.id,version:s.version}:t[r]=s.clone():t[r]=s)}return t}equals(e){const{object:t,material:r,geometry:s}=e,i=this.getRenderObjectData(e);if(!0!==i.worldMatrix.equals(t.matrixWorld))return i.worldMatrix.copy(t.matrixWorld),!1;const n=i.material;for(const e in n){const t=n[e],s=r[e];if(void 0!==t.equals){if(!1===t.equals(s))return t.copy(s),!1}else if(!0===s.isTexture){if(t.id!==s.id||t.version!==s.version)return t.id=s.id,t.version=s.version,!1}else if(t!==s)return n[e]=s,!1}if(n.transmission>0){const{width:t,height:r}=e.context;if(i.bufferWidth!==t||i.bufferHeight!==r)return i.bufferWidth=t,i.bufferHeight=r,!1}const a=i.geometry,o=s.attributes,u=a.attributes,l=Object.keys(u),d=Object.keys(o);if(a.id!==s.id)return a.id=s.id,!1;if(l.length!==d.length)return i.geometry.attributes=this.getAttributesData(o),!1;for(const e of l){const t=u[e],r=o[e];if(void 0===r)return delete u[e],!1;if(t.version!==r.version)return t.version=r.version,!1}const c=s.index,h=a.indexVersion,p=c?c.version:null;if(h!==p)return a.indexVersion=p,!1;if(a.drawRange.start!==s.drawRange.start||a.drawRange.count!==s.drawRange.count)return a.drawRange.start=s.drawRange.start,a.drawRange.count=s.drawRange.count,!1;if(i.morphTargetInfluences){let e=!1;for(let r=0;r>>16,2246822507),r^=Math.imul(s^s>>>13,3266489909),s=Math.imul(s^s>>>16,2246822507),s^=Math.imul(r^r>>>13,3266489909),4294967296*(2097151&s)+(r>>>0)}const bs=e=>ys(e),xs=e=>ys(e),Ts=(...e)=>ys(e);function _s(e,t=!1){const r=[];!0===e.isNode&&(r.push(e.id),e=e.getSelf());for(const{property:s,childNode:i}of vs(e))r.push(ys(s.slice(0,-4)),i.getCacheKey(t));return ys(r)}function*vs(e,t=!1){for(const r in e){if(!0===r.startsWith("_"))continue;const s=e[r];if(!0===Array.isArray(s))for(let e=0;ee.charCodeAt(0))).buffer}var Is=Object.freeze({__proto__:null,arrayBufferToBase64:Fs,base64ToArrayBuffer:Bs,getByteBoundaryFromType:Cs,getCacheKey:_s,getDataFromObject:Ls,getLengthFromType:As,getMemoryLengthFromType:Rs,getNodeChildren:vs,getTypeFromLength:Es,getTypedArrayFromType:ws,getValueFromType:Ps,getValueType:Ms,hash:Ts,hashArray:xs,hashString:bs});const Ds={VERTEX:"vertex",FRAGMENT:"fragment"},Vs={NONE:"none",FRAME:"frame",RENDER:"render",OBJECT:"object"},Us={BOOLEAN:"bool",INTEGER:"int",FLOAT:"float",VECTOR2:"vec2",VECTOR3:"vec3",VECTOR4:"vec4",MATRIX2:"mat2",MATRIX3:"mat3",MATRIX4:"mat4"},Os={READ_ONLY:"readOnly",WRITE_ONLY:"writeOnly",READ_WRITE:"readWrite"},ks=["fragment","vertex"],Gs=["setup","analyze","generate"],zs=[...ks,"compute"],Hs=["x","y","z","w"],$s={analyze:"setup",generate:"analyze"};let Ws=0;class js extends o{static get type(){return"Node"}constructor(e=null){super(),this.nodeType=e,this.updateType=Vs.NONE,this.updateBeforeType=Vs.NONE,this.updateAfterType=Vs.NONE,this.uuid=u.generateUUID(),this.version=0,this.global=!1,this.parents=!1,this.isNode=!0,this._cacheKey=null,this._cacheKeyVersion=0,Object.defineProperty(this,"id",{value:Ws++})}set needsUpdate(e){!0===e&&this.version++}get type(){return this.constructor.type}onUpdate(e,t){return this.updateType=t,this.update=e.bind(this.getSelf()),this}onFrameUpdate(e){return this.onUpdate(e,Vs.FRAME)}onRenderUpdate(e){return this.onUpdate(e,Vs.RENDER)}onObjectUpdate(e){return this.onUpdate(e,Vs.OBJECT)}onReference(e){return this.updateReference=e.bind(this.getSelf()),this}getSelf(){return this.self||this}updateReference(){return this}isGlobal(){return this.global}*getChildren(){for(const{childNode:e}of vs(this))yield e}dispose(){this.dispatchEvent({type:"dispose"})}traverse(e){e(this);for(const t of this.getChildren())t.traverse(e)}getCacheKey(e=!1){return!0!==(e=e||this.version!==this._cacheKeyVersion)&&null!==this._cacheKey||(this._cacheKey=Ts(_s(this,e),this.customCacheKey()),this._cacheKeyVersion=this.version),this._cacheKey}customCacheKey(){return 0}getScope(){return this}getHash(){return this.uuid}getUpdateType(){return this.updateType}getUpdateBeforeType(){return this.updateBeforeType}getUpdateAfterType(){return this.updateAfterType}getElementType(e){const t=this.getNodeType(e);return e.getElementType(t)}getMemberType(){return"void"}getNodeType(e){const t=e.getNodeProperties(this);return t.outputNode?t.outputNode.getNodeType(e):this.nodeType}getShared(e){const t=this.getHash(e);return e.getNodeFromHash(t)||this}setup(e){const t=e.getNodeProperties(this);let r=0;for(const e of this.getChildren())t["node"+r++]=e;return t.outputNode||null}analyze(e,t=null){const r=e.increaseUsage(this);if(!0===this.parents){const r=e.getDataFromNode(this,"any");r.stages=r.stages||{},r.stages[e.shaderStage]=r.stages[e.shaderStage]||[],r.stages[e.shaderStage].push(t)}if(1===r){const t=e.getNodeProperties(this);for(const r of Object.values(t))r&&!0===r.isNode&&r.build(e,this)}}generate(e,t){const{outputNode:r}=e.getNodeProperties(this);if(r&&!0===r.isNode)return r.build(e,t)}updateBefore(){console.warn("Abstract function.")}updateAfter(){console.warn("Abstract function.")}update(){console.warn("Abstract function.")}build(e,t=null){const r=this.getShared(e);if(this!==r)return r.build(e,t);const s=e.getDataFromNode(this);s.buildStages=s.buildStages||{},s.buildStages[e.buildStage]=!0;const i=$s[e.buildStage];if(i&&!0!==s.buildStages[i]){const t=e.getBuildStage();e.setBuildStage(i),this.build(e),e.setBuildStage(t)}e.addNode(this),e.addChain(this);let n=null;const a=e.getBuildStage();if("setup"===a){this.updateReference(e);const t=e.getNodeProperties(this);if(!0!==t.initialized){t.initialized=!0,t.outputNode=this.setup(e)||t.outputNode||null;for(const r of Object.values(t))if(r&&!0===r.isNode){if(!0===r.parents){const t=e.getNodeProperties(r);t.parents=t.parents||[],t.parents.push(this)}r.build(e)}}n=t.outputNode}else if("analyze"===a)this.analyze(e,t);else if("generate"===a){if(1===this.generate.length){const r=this.getNodeType(e),s=e.getDataFromNode(this);n=s.snippet,void 0===n?void 0===s.generated?(s.generated=!0,n=this.generate(e)||"",s.snippet=n):(console.warn("THREE.Node: Recursion detected.",this),n=""):void 0!==s.flowCodes&&void 0!==e.context.nodeBlock&&e.addFlowCodeHierarchy(this,e.context.nodeBlock),n=e.format(n,r,t)}else n=this.generate(e,t)||""}return e.removeChain(this),e.addSequentialNode(this),n}getSerializeChildren(){return vs(this)}serialize(e){const t=this.getSerializeChildren(),r={};for(const{property:s,index:i,childNode:n}of t)void 0!==i?(void 0===r[s]&&(r[s]=Number.isInteger(i)?[]:{}),r[s][i]=n.toJSON(e.meta).uuid):r[s]=n.toJSON(e.meta).uuid;Object.keys(r).length>0&&(e.inputNodes=r)}deserialize(e){if(void 0!==e.inputNodes){const t=e.meta.nodes;for(const r in e.inputNodes)if(Array.isArray(e.inputNodes[r])){const s=[];for(const i of e.inputNodes[r])s.push(t[i]);this[r]=s}else if("object"==typeof e.inputNodes[r]){const s={};for(const i in e.inputNodes[r]){const n=e.inputNodes[r][i];s[i]=t[n]}this[r]=s}else{const s=e.inputNodes[r];this[r]=t[s]}}}toJSON(e){const{uuid:t,type:r}=this,s=void 0===e||"string"==typeof e;s&&(e={textures:{},images:{},nodes:{}});let i=e.nodes[t];function n(e){const t=[];for(const r in e){const s=e[r];delete s.metadata,t.push(s)}return t}if(void 0===i&&(i={uuid:t,type:r,meta:e,metadata:{version:4.7,type:"Node",generator:"Node.toJSON"}},!0!==s&&(e.nodes[i.uuid]=i),this.serialize(i),delete i.meta),s){const t=n(e.textures),r=n(e.images),s=n(e.nodes);t.length>0&&(i.textures=t),r.length>0&&(i.images=r),s.length>0&&(i.nodes=s)}return i}}class qs extends js{static get type(){return"ArrayElementNode"}constructor(e,t){super(),this.node=e,this.indexNode=t,this.isArrayElementNode=!0}getNodeType(e){return this.node.getElementType(e)}generate(e){const t=this.indexNode.getNodeType(e);return`${this.node.build(e)}[ ${this.indexNode.build(e,!e.isVector(t)&&e.isInteger(t)?t:"uint")} ]`}}class Xs extends js{static get type(){return"ConvertNode"}constructor(e,t){super(),this.node=e,this.convertTo=t}getNodeType(e){const t=this.node.getNodeType(e);let r=null;for(const s of this.convertTo.split("|"))null!==r&&e.getTypeLength(t)!==e.getTypeLength(s)||(r=s);return r}serialize(e){super.serialize(e),e.convertTo=this.convertTo}deserialize(e){super.deserialize(e),this.convertTo=e.convertTo}generate(e,t){const r=this.node,s=this.getNodeType(e),i=r.build(e,s);return e.format(i,s,t)}}class Ks extends js{static get type(){return"TempNode"}constructor(e=null){super(e),this.isTempNode=!0}hasDependencies(e){return e.getDataFromNode(this).usageCount>1}build(e,t){if("generate"===e.getBuildStage()){const r=e.getVectorType(this.getNodeType(e,t)),s=e.getDataFromNode(this);if(void 0!==s.propertyName)return e.format(s.propertyName,r,t);if("void"!==r&&"void"!==t&&this.hasDependencies(e)){const i=super.build(e,r),n=e.getVarFromNode(this,null,r),a=e.getPropertyName(n);return e.addLineFlowCode(`${a} = ${i}`,this),s.snippet=i,s.propertyName=a,e.format(s.propertyName,r,t)}}return super.build(e,t)}}class Ys extends Ks{static get type(){return"JoinNode"}constructor(e=[],t=null){super(t),this.nodes=e}getNodeType(e){return null!==this.nodeType?e.getVectorType(this.nodeType):e.getTypeFromLength(this.nodes.reduce(((t,r)=>t+e.getTypeLength(r.getNodeType(e))),0))}generate(e,t){const r=this.getNodeType(e),s=e.getTypeLength(r),i=this.nodes,n=e.getComponentType(r),a=[];let o=0;for(const t of i){if(o>=s){console.error(`THREE.TSL: Length of parameters exceeds maximum length of function '${r}()' type.`);break}let i,u=t.getNodeType(e),l=e.getTypeLength(u);o+l>s&&(console.error(`THREE.TSL: Length of '${r}()' data exceeds maximum length of output type.`),l=s-o,u=e.getTypeFromLength(l)),o+=l,i=t.build(e,u);const d=e.getComponentType(u);d!==n&&(i=e.format(i,d,n)),a.push(i)}const u=`${e.getType(r)}( ${a.join(", ")} )`;return e.format(u,r,t)}}const Qs=Hs.join("");class Zs extends js{static get type(){return"SplitNode"}constructor(e,t="x"){super(),this.node=e,this.components=t,this.isSplitNode=!0}getVectorLength(){let e=this.components.length;for(const t of this.components)e=Math.max(Hs.indexOf(t)+1,e);return e}getComponentType(e){return e.getComponentType(this.node.getNodeType(e))}getNodeType(e){return e.getTypeFromLength(this.components.length,this.getComponentType(e))}generate(e,t){const r=this.node,s=e.getTypeLength(r.getNodeType(e));let i=null;if(s>1){let n=null;this.getVectorLength()>=s&&(n=e.getTypeFromLength(this.getVectorLength(),this.getComponentType(e)));const a=r.build(e,n);i=this.components.length===s&&this.components===Qs.slice(0,this.components.length)?e.format(a,n,t):e.format(`${a}.${this.components}`,this.getNodeType(e),t)}else i=r.build(e,t);return i}serialize(e){super.serialize(e),e.components=this.components}deserialize(e){super.deserialize(e),this.components=e.components}}class Js extends Ks{static get type(){return"SetNode"}constructor(e,t,r){super(),this.sourceNode=e,this.components=t,this.targetNode=r}getNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{sourceNode:t,components:r,targetNode:s}=this,i=this.getNodeType(e),n=e.getComponentType(s.getNodeType(e)),a=e.getTypeFromLength(r.length,n),o=s.build(e,a),u=t.build(e,i),l=e.getTypeLength(i),d=[];for(let e=0;ee.replace(/r|s/g,"x").replace(/g|t/g,"y").replace(/b|p/g,"z").replace(/a|q/g,"w"),li=e=>ui(e).split("").sort().join(""),di={setup(e,t){const r=t.shift();return e(Ii(r),...t)},get(e,t,r){if("string"==typeof t&&void 0===e[t]){if(!0!==e.isStackNode&&"assign"===t)return(...e)=>(ni.assign(r,...e),r);if(ai.has(t)){const s=ai.get(t);return e.isStackNode?(...e)=>r.add(s(...e)):(...e)=>s(r,...e)}if("self"===t)return e;if(t.endsWith("Assign")&&ai.has(t.slice(0,t.length-6))){const s=ai.get(t.slice(0,t.length-6));return e.isStackNode?(...e)=>r.assign(e[0],s(...e)):(...e)=>r.assign(s(r,...e))}if(!0===/^[xyzwrgbastpq]{1,4}$/.test(t))return t=ui(t),Bi(new Zs(r,t));if(!0===/^set[XYZWRGBASTPQ]{1,4}$/.test(t))return t=li(t.slice(3).toLowerCase()),r=>Bi(new Js(e,t,Bi(r)));if(!0===/^flip[XYZWRGBASTPQ]{1,4}$/.test(t))return t=li(t.slice(4).toLowerCase()),()=>Bi(new ei(Bi(e),t));if("width"===t||"height"===t||"depth"===t)return"width"===t?t="x":"height"===t?t="y":"depth"===t&&(t="z"),Bi(new Zs(e,t));if(!0===/^\d+$/.test(t))return Bi(new qs(r,new si(Number(t),"uint")));if(!0===/^get$/.test(t))return e=>Bi(new ii(r,e))}return Reflect.get(e,t,r)},set:(e,t,r,s)=>"string"!=typeof t||void 0!==e[t]||!0!==/^[xyzwrgbastpq]{1,4}$/.test(t)&&"width"!==t&&"height"!==t&&"depth"!==t&&!0!==/^\d+$/.test(t)?Reflect.set(e,t,r,s):(s[t].assign(r),!0)},ci=new WeakMap,hi=new WeakMap,pi=function(e,t=null){for(const r in e)e[r]=Bi(e[r],t);return e},gi=function(e,t=null){const r=e.length;for(let s=0;sBi(null!==s?Object.assign(e,s):e);let n,a,o,u=t;function l(t){let r;return r=u?/[a-z]/i.test(u)?u+"()":u:e.type,void 0!==a&&t.lengtho?(console.error(`THREE.TSL: "${r}" parameter length exceeds limit.`),t.slice(0,o)):t}return null===t?n=(...t)=>i(new e(...Di(l(t)))):null!==r?(r=Bi(r),n=(...s)=>i(new e(t,...Di(l(s)),r))):n=(...r)=>i(new e(t,...Di(l(r)))),n.setParameterLength=(...e)=>(1===e.length?a=o=e[0]:2===e.length&&([a,o]=e),n),n.setName=e=>(u=e,n),n},fi=function(e,...t){return Bi(new e(...Di(t)))};class yi extends js{constructor(e,t){super(),this.shaderNode=e,this.inputNodes=t,this.isShaderCallNodeInternal=!0}getNodeType(e){return this.shaderNode.nodeType||this.getOutputNode(e).getNodeType(e)}getMemberType(e,t){return this.getOutputNode(e).getMemberType(e,t)}call(e){const{shaderNode:t,inputNodes:r}=this,s=e.getNodeProperties(t),i=t.namespace&&t.namespace===e.namespace?e.getNamespace("once"):"once";if(s[i])return s[i];let n=null;if(t.layout){let s=hi.get(e.constructor);void 0===s&&(s=new WeakMap,hi.set(e.constructor,s));let i=s.get(t);void 0===i&&(i=Bi(e.buildFunctionNode(t)),s.set(t,i)),e.addInclude(i),n=Bi(i.call(r))}else{const s=t.jsFunc,i=null!==r||s.length>1?s(r||[],e):s(e);n=Bi(i)}return t.once&&(s[i]=n),n}setupOutput(e){return e.addStack(),e.stack.outputNode=this.call(e),e.removeStack()}getOutputNode(e){const t=e.getNodeProperties(this),r=e.getOutputNamespace();return t[r]=t[r]||this.setupOutput(e),t[r]}build(e,t=null){let r=null;const s=e.getBuildStage(),i=e.getNodeProperties(this),n=e.getOutputNamespace(),a=this.getOutputNode(e);if("setup"===s){const t=e.getNamespace("initialized");!0!==i[t]&&(i[t]=!0,i[n]=this.getOutputNode(e),i[n].build(e)),r=i[n]}else"analyze"===s?a.build(e,t):"generate"===s&&(r=a.build(e,t)||"");return r}}class bi extends js{constructor(e,t){super(t),this.jsFunc=e,this.layout=null,this.global=!0,this.once=!1,this.namespace=null}setLayout(e){return this.layout=e,this}call(e=null){return Ii(e),Bi(new yi(this,e))}setup(){return this.call()}}const xi=[!1,!0],Ti=[0,1,2,3],_i=[-1,-2],vi=[.5,1.5,1/3,1e-6,1e6,Math.PI,2*Math.PI,1/Math.PI,2/Math.PI,1/(2*Math.PI),Math.PI/2],Ni=new Map;for(const e of xi)Ni.set(e,new si(e));const Si=new Map;for(const e of Ti)Si.set(e,new si(e,"uint"));const Ei=new Map([...Si].map((e=>new si(e.value,"int"))));for(const e of _i)Ei.set(e,new si(e,"int"));const wi=new Map([...Ei].map((e=>new si(e.value))));for(const e of vi)wi.set(e,new si(e));for(const e of vi)wi.set(-e,new si(-e));const Ai={bool:Ni,uint:Si,ints:Ei,float:wi},Ri=new Map([...Ni,...wi]),Ci=(e,t)=>Ri.has(e)?Ri.get(e):!0===e.isNode?e:new si(e,t),Mi=function(e,t=null){return(...r)=>{if((0===r.length||!["bool","float","int","uint"].includes(e)&&r.every((e=>"object"!=typeof e)))&&(r=[Ps(e,...r)]),1===r.length&&null!==t&&t.has(r[0]))return Bi(t.get(r[0]));if(1===r.length){const t=Ci(r[0],e);return(e=>{try{return e.getNodeType()}catch(e){return}})(t)===e?Bi(t):Bi(new Xs(t,e))}const s=r.map((e=>Ci(e)));return Bi(new Ys(s,e))}},Pi=e=>"object"==typeof e&&null!==e?e.value:e,Li=e=>null!=e?e.nodeType||e.convertTo||("string"==typeof e?e:null):null;function Fi(e,t){return new Proxy(new bi(e,t),di)}const Bi=(e,t=null)=>function(e,t=null){const r=Ms(e);if("node"===r){let t=ci.get(e);return void 0===t&&(t=new Proxy(e,di),ci.set(e,t),ci.set(t,t)),t}return null===t&&("float"===r||"boolean"===r)||r&&"shader"!==r&&"string"!==r?Bi(Ci(e,t)):"shader"===r?e.isFn?e:ki(e):e}(e,t),Ii=(e,t=null)=>new pi(e,t),Di=(e,t=null)=>new gi(e,t),Vi=(...e)=>new mi(...e),Ui=(...e)=>new fi(...e);let Oi=0;const ki=(e,t=null)=>{let r=null;null!==t&&("object"==typeof t?r=t.return:("string"==typeof t?r=t:console.error("THREE.TSL: Invalid layout type."),t=null));const s=new Fi(e,r),i=(...e)=>{let t;Ii(e);t=e[0]&&(e[0].isNode||Object.getPrototypeOf(e[0])!==Object.prototype)?[...e]:e[0];const i=s.call(t);return"void"===r&&i.toStack(),i};if(i.shaderNode=s,i.id=s.id,i.isFn=!0,i.getNodeType=(...e)=>s.getNodeType(...e),i.getCacheKey=(...e)=>s.getCacheKey(...e),i.setLayout=e=>(s.setLayout(e),i),i.once=(e=null)=>(s.once=!0,s.namespace=e,i),null!==t){if("object"!=typeof t.inputs){const e={name:"fn"+Oi++,type:r,inputs:[]};for(const r in t)"return"!==r&&e.inputs.push({name:r,type:t[r]});t=e}i.setLayout(t)}return i},Gi=e=>{ni=e},zi=()=>ni,Hi=(...e)=>ni.If(...e);function $i(e){return ni&&ni.add(e),e}oi("toStack",$i);const Wi=new Mi("color"),ji=new Mi("float",Ai.float),qi=new Mi("int",Ai.ints),Xi=new Mi("uint",Ai.uint),Ki=new Mi("bool",Ai.bool),Yi=new Mi("vec2"),Qi=new Mi("ivec2"),Zi=new Mi("uvec2"),Ji=new Mi("bvec2"),en=new Mi("vec3"),tn=new Mi("ivec3"),rn=new Mi("uvec3"),sn=new Mi("bvec3"),nn=new Mi("vec4"),an=new Mi("ivec4"),on=new Mi("uvec4"),un=new Mi("bvec4"),ln=new Mi("mat2"),dn=new Mi("mat3"),cn=new Mi("mat4");oi("toColor",Wi),oi("toFloat",ji),oi("toInt",qi),oi("toUint",Xi),oi("toBool",Ki),oi("toVec2",Yi),oi("toIVec2",Qi),oi("toUVec2",Zi),oi("toBVec2",Ji),oi("toVec3",en),oi("toIVec3",tn),oi("toUVec3",rn),oi("toBVec3",sn),oi("toVec4",nn),oi("toIVec4",an),oi("toUVec4",on),oi("toBVec4",un),oi("toMat2",ln),oi("toMat3",dn),oi("toMat4",cn);const hn=Vi(qs).setParameterLength(2),pn=(e,t)=>Bi(new Xs(Bi(e),t));oi("element",hn),oi("convert",pn);oi("append",(e=>(console.warn("THREE.TSL: .append() has been renamed to .toStack()."),$i(e))));class gn extends js{static get type(){return"PropertyNode"}constructor(e,t=null,r=!1){super(e),this.name=t,this.varying=r,this.isPropertyNode=!0,this.global=!0}getHash(e){return this.name||super.getHash(e)}generate(e){let t;return!0===this.varying?(t=e.getVaryingFromNode(this,this.name),t.needsInterpolation=!0):t=e.getVarFromNode(this,this.name),e.getPropertyName(t)}}const mn=(e,t)=>Bi(new gn(e,t)),fn=(e,t)=>Bi(new gn(e,t,!0)),yn=Ui(gn,"vec4","DiffuseColor"),bn=Ui(gn,"vec3","EmissiveColor"),xn=Ui(gn,"float","Roughness"),Tn=Ui(gn,"float","Metalness"),_n=Ui(gn,"float","Clearcoat"),vn=Ui(gn,"float","ClearcoatRoughness"),Nn=Ui(gn,"vec3","Sheen"),Sn=Ui(gn,"float","SheenRoughness"),En=Ui(gn,"float","Iridescence"),wn=Ui(gn,"float","IridescenceIOR"),An=Ui(gn,"float","IridescenceThickness"),Rn=Ui(gn,"float","AlphaT"),Cn=Ui(gn,"float","Anisotropy"),Mn=Ui(gn,"vec3","AnisotropyT"),Pn=Ui(gn,"vec3","AnisotropyB"),Ln=Ui(gn,"color","SpecularColor"),Fn=Ui(gn,"float","SpecularF90"),Bn=Ui(gn,"float","Shininess"),In=Ui(gn,"vec4","Output"),Dn=Ui(gn,"float","dashSize"),Vn=Ui(gn,"float","gapSize"),Un=Ui(gn,"float","pointWidth"),On=Ui(gn,"float","IOR"),kn=Ui(gn,"float","Transmission"),Gn=Ui(gn,"float","Thickness"),zn=Ui(gn,"float","AttenuationDistance"),Hn=Ui(gn,"color","AttenuationColor"),$n=Ui(gn,"float","Dispersion");class Wn extends js{static get type(){return"UniformGroupNode"}constructor(e,t=!1,r=1){super("string"),this.name=e,this.shared=t,this.order=r,this.isUniformGroup=!0}serialize(e){super.serialize(e),e.name=this.name,e.version=this.version,e.shared=this.shared}deserialize(e){super.deserialize(e),this.name=e.name,this.version=e.version,this.shared=e.shared}}const jn=e=>new Wn(e),qn=(e,t=0)=>new Wn(e,!0,t),Xn=qn("frame"),Kn=qn("render"),Yn=jn("object");class Qn extends ti{static get type(){return"UniformNode"}constructor(e,t=null){super(e,t),this.isUniformNode=!0,this.name="",this.groupNode=Yn}label(e){return this.name=e,this}setGroup(e){return this.groupNode=e,this}getGroup(){return this.groupNode}getUniformHash(e){return this.getHash(e)}onUpdate(e,t){const r=this.getSelf();return e=e.bind(r),super.onUpdate((t=>{const s=e(t,r);void 0!==s&&(this.value=s)}),t)}generate(e,t){const r=this.getNodeType(e),s=this.getUniformHash(e);let i=e.getNodeFromHash(s);void 0===i&&(e.setHashNode(this,s),i=this);const n=i.getInputType(e),a=e.getUniformFromNode(i,n,e.shaderStage,this.name||e.context.label),o=e.getPropertyName(a);return void 0!==e.context.label&&delete e.context.label,e.format(o,r,t)}}const Zn=(e,t)=>{const r=Li(t||e),s=e&&!0===e.isNode?e.node&&e.node.value||e.value:e;return Bi(new Qn(s,r))};class Jn extends Ks{static get type(){return"ArrayNode"}constructor(e,t,r=null){super(e),this.count=t,this.values=r,this.isArrayNode=!0}getNodeType(e){return null===this.nodeType&&(this.nodeType=this.values[0].getNodeType(e)),this.nodeType}getElementType(e){return this.getNodeType(e)}generate(e){const t=this.getNodeType(e);return e.generateArray(t,this.count,this.values)}}const ea=(...e)=>{let t;if(1===e.length){const r=e[0];t=new Jn(null,r.length,r)}else{const r=e[0],s=e[1];t=new Jn(r,s)}return Bi(t)};oi("toArray",((e,t)=>ea(Array(t).fill(e))));class ta extends Ks{static get type(){return"AssignNode"}constructor(e,t){super(),this.targetNode=e,this.sourceNode=t,this.isAssignNode=!0}hasDependencies(){return!1}getNodeType(e,t){return"void"!==t?this.targetNode.getNodeType(e):"void"}needsSplitAssign(e){const{targetNode:t}=this;if(!1===e.isAvailable("swizzleAssign")&&t.isSplitNode&&t.components.length>1){const r=e.getTypeLength(t.node.getNodeType(e));return Hs.join("").slice(0,r)!==t.components}return!1}setup(e){const{targetNode:t,sourceNode:r}=this,s=e.getNodeProperties(this);s.sourceNode=r,s.targetNode=t.context({assign:!0})}generate(e,t){const{targetNode:r,sourceNode:s}=e.getNodeProperties(this),i=this.needsSplitAssign(e),n=r.getNodeType(e),a=r.build(e),o=s.build(e,n),u=s.getNodeType(e),l=e.getDataFromNode(this);let d;if(!0===l.initialized)"void"!==t&&(d=a);else if(i){const s=e.getVarFromNode(this,null,n),i=e.getPropertyName(s);e.addLineFlowCode(`${i} = ${o}`,this);const u=r.node,l=u.node.context({assign:!0}).build(e);for(let t=0;t{const s=r.type;let i;return i="pointer"===s?"&"+t.build(e):t.build(e,s),i};if(Array.isArray(i)){if(i.length>s.length)console.error("THREE.TSL: The number of provided parameters exceeds the expected number of inputs in 'Fn()'."),i.length=s.length;else if(i.length(t=t.length>1||t[0]&&!0===t[0].isNode?Di(t):Ii(t[0]),Bi(new sa(Bi(e),t)));oi("call",ia);const na={"==":"equal","!=":"notEqual","<":"lessThan",">":"greaterThan","<=":"lessThanEqual",">=":"greaterThanEqual","%":"mod"};class aa extends Ks{static get type(){return"OperatorNode"}constructor(e,t,r,...s){if(super(),s.length>0){let i=new aa(e,t,r);for(let t=0;t>"===t||"<<"===t)return e.getIntegerType(i);if("!"===t||"&&"===t||"||"===t||"^^"===t)return"bool";if("=="===t||"!="===t||"<"===t||">"===t||"<="===t||">="===t){const t=Math.max(e.getTypeLength(i),e.getTypeLength(n));return t>1?`bvec${t}`:"bool"}if(e.isMatrix(i)){if("float"===n)return i;if(e.isVector(n))return e.getVectorFromMatrix(i);if(e.isMatrix(n))return i}else if(e.isMatrix(n)){if("float"===i)return n;if(e.isVector(i))return e.getVectorFromMatrix(n)}return e.getTypeLength(n)>e.getTypeLength(i)?n:i}generate(e,t){const r=this.op,{aNode:s,bNode:i}=this,n=this.getNodeType(e);let a=null,o=null;"void"!==n?(a=s.getNodeType(e),o=i?i.getNodeType(e):null,"<"===r||">"===r||"<="===r||">="===r||"=="===r||"!="===r?e.isVector(a)?o=a:e.isVector(o)?a=o:a!==o&&(a=o="float"):">>"===r||"<<"===r?(a=n,o=e.changeComponentType(o,"uint")):"%"===r?(a=n,o=e.isInteger(a)&&e.isInteger(o)?o:a):e.isMatrix(a)?"float"===o?o="float":e.isVector(o)?o=e.getVectorFromMatrix(a):e.isMatrix(o)||(a=o=n):a=e.isMatrix(o)?"float"===a?"float":e.isVector(a)?e.getVectorFromMatrix(o):o=n:o=n):a=o=n;const u=s.build(e,a),d=i?i.build(e,o):null,c=e.getFunctionOperator(r);if("void"!==t){const s=e.renderer.coordinateSystem===l;if("=="===r||"!="===r||"<"===r||">"===r||"<="===r||">="===r)return s&&e.isVector(a)?e.format(`${this.getOperatorMethod(e,t)}( ${u}, ${d} )`,n,t):e.format(`( ${u} ${r} ${d} )`,n,t);if("%"===r)return e.isInteger(o)?e.format(`( ${u} % ${d} )`,n,t):e.format(`${this.getOperatorMethod(e,n)}( ${u}, ${d} )`,n,t);if("!"===r||"~"===r)return e.format(`(${r}${u})`,a,t);if(c)return e.format(`${c}( ${u}, ${d} )`,n,t);if(e.isMatrix(a)&&"float"===o)return e.format(`( ${d} ${r} ${u} )`,n,t);if("float"===a&&e.isMatrix(o))return e.format(`${u} ${r} ${d}`,n,t);{let i=`( ${u} ${r} ${d} )`;return!s&&"bool"===n&&e.isVector(a)&&e.isVector(o)&&(i=`all${i}`),e.format(i,n,t)}}if("void"!==a)return c?e.format(`${c}( ${u}, ${d} )`,n,t):e.isMatrix(a)&&"float"===o?e.format(`${d} ${r} ${u}`,n,t):e.format(`${u} ${r} ${d}`,n,t)}serialize(e){super.serialize(e),e.op=this.op}deserialize(e){super.deserialize(e),this.op=e.op}}const oa=Vi(aa,"+").setParameterLength(2,1/0).setName("add"),ua=Vi(aa,"-").setParameterLength(2,1/0).setName("sub"),la=Vi(aa,"*").setParameterLength(2,1/0).setName("mul"),da=Vi(aa,"/").setParameterLength(2,1/0).setName("div"),ca=Vi(aa,"%").setParameterLength(2).setName("mod"),ha=Vi(aa,"==").setParameterLength(2).setName("equal"),pa=Vi(aa,"!=").setParameterLength(2).setName("notEqual"),ga=Vi(aa,"<").setParameterLength(2).setName("lessThan"),ma=Vi(aa,">").setParameterLength(2).setName("greaterThan"),fa=Vi(aa,"<=").setParameterLength(2).setName("lessThanEqual"),ya=Vi(aa,">=").setParameterLength(2).setName("greaterThanEqual"),ba=Vi(aa,"&&").setParameterLength(2,1/0).setName("and"),xa=Vi(aa,"||").setParameterLength(2,1/0).setName("or"),Ta=Vi(aa,"!").setParameterLength(1).setName("not"),_a=Vi(aa,"^^").setParameterLength(2).setName("xor"),va=Vi(aa,"&").setParameterLength(2).setName("bitAnd"),Na=Vi(aa,"~").setParameterLength(2).setName("bitNot"),Sa=Vi(aa,"|").setParameterLength(2).setName("bitOr"),Ea=Vi(aa,"^").setParameterLength(2).setName("bitXor"),wa=Vi(aa,"<<").setParameterLength(2).setName("shiftLeft"),Aa=Vi(aa,">>").setParameterLength(2).setName("shiftRight"),Ra=ki((([e])=>(e.addAssign(1),e))),Ca=ki((([e])=>(e.subAssign(1),e))),Ma=ki((([e])=>{const t=qi(e).toConst();return e.addAssign(1),t})),Pa=ki((([e])=>{const t=qi(e).toConst();return e.subAssign(1),t}));oi("add",oa),oi("sub",ua),oi("mul",la),oi("div",da),oi("mod",ca),oi("equal",ha),oi("notEqual",pa),oi("lessThan",ga),oi("greaterThan",ma),oi("lessThanEqual",fa),oi("greaterThanEqual",ya),oi("and",ba),oi("or",xa),oi("not",Ta),oi("xor",_a),oi("bitAnd",va),oi("bitNot",Na),oi("bitOr",Sa),oi("bitXor",Ea),oi("shiftLeft",wa),oi("shiftRight",Aa),oi("incrementBefore",Ra),oi("decrementBefore",Ca),oi("increment",Ma),oi("decrement",Pa);const La=(e,t)=>(console.warn('THREE.TSL: "remainder()" is deprecated. Use "mod( int( ... ) )" instead.'),ca(e,t)),Fa=(e,t)=>(console.warn('THREE.TSL: "modInt()" is deprecated. Use "mod( int( ... ) )" instead.'),ca(qi(e),qi(t)));oi("remainder",La),oi("modInt",Fa);class Ba extends Ks{static get type(){return"MathNode"}constructor(e,t,r=null,s=null){if(super(),(e===Ba.MAX||e===Ba.MIN)&&arguments.length>3){let i=new Ba(e,t,r);for(let t=2;tn&&i>a?t:n>a?r:a>i?s:t}getNodeType(e){const t=this.method;return t===Ba.LENGTH||t===Ba.DISTANCE||t===Ba.DOT?"float":t===Ba.CROSS?"vec3":t===Ba.ALL||t===Ba.ANY?"bool":t===Ba.EQUALS?e.changeComponentType(this.aNode.getNodeType(e),"bool"):this.getInputType(e)}setup(e){const{aNode:t,bNode:r,method:s}=this;let i=null;if(s===Ba.ONE_MINUS)i=ua(1,t);else if(s===Ba.RECIPROCAL)i=da(1,t);else if(s===Ba.DIFFERENCE)i=no(ua(t,r));else if(s===Ba.TRANSFORM_DIRECTION){let s=t,n=r;e.isMatrix(s.getNodeType(e))?n=nn(en(n),0):s=nn(en(s),0);const a=la(s,n).xyz;i=Qa(a)}return null!==i?i:super.setup(e)}generate(e,t){if(e.getNodeProperties(this).outputNode)return super.generate(e,t);let r=this.method;const s=this.getNodeType(e),i=this.getInputType(e),n=this.aNode,a=this.bNode,o=this.cNode,u=e.renderer.coordinateSystem;if(r===Ba.NEGATE)return e.format("( - "+n.build(e,i)+" )",s,t);{const c=[];return r===Ba.CROSS?c.push(n.build(e,s),a.build(e,s)):u===l&&r===Ba.STEP?c.push(n.build(e,1===e.getTypeLength(n.getNodeType(e))?"float":i),a.build(e,i)):u!==l||r!==Ba.MIN&&r!==Ba.MAX?r===Ba.REFRACT?c.push(n.build(e,i),a.build(e,i),o.build(e,"float")):r===Ba.MIX?c.push(n.build(e,i),a.build(e,i),o.build(e,1===e.getTypeLength(o.getNodeType(e))?"float":i)):(u===d&&r===Ba.ATAN&&null!==a&&(r="atan2"),"fragment"===e.shaderStage||r!==Ba.DFDX&&r!==Ba.DFDY||(console.warn(`THREE.TSL: '${r}' is not supported in the ${e.shaderStage} stage.`),r="/*"+r+"*/"),c.push(n.build(e,i)),null!==a&&c.push(a.build(e,i)),null!==o&&c.push(o.build(e,i))):c.push(n.build(e,i),a.build(e,1===e.getTypeLength(a.getNodeType(e))?"float":i)),e.format(`${e.getMethod(r,s)}( ${c.join(", ")} )`,s,t)}}serialize(e){super.serialize(e),e.method=this.method}deserialize(e){super.deserialize(e),this.method=e.method}}Ba.ALL="all",Ba.ANY="any",Ba.RADIANS="radians",Ba.DEGREES="degrees",Ba.EXP="exp",Ba.EXP2="exp2",Ba.LOG="log",Ba.LOG2="log2",Ba.SQRT="sqrt",Ba.INVERSE_SQRT="inversesqrt",Ba.FLOOR="floor",Ba.CEIL="ceil",Ba.NORMALIZE="normalize",Ba.FRACT="fract",Ba.SIN="sin",Ba.COS="cos",Ba.TAN="tan",Ba.ASIN="asin",Ba.ACOS="acos",Ba.ATAN="atan",Ba.ABS="abs",Ba.SIGN="sign",Ba.LENGTH="length",Ba.NEGATE="negate",Ba.ONE_MINUS="oneMinus",Ba.DFDX="dFdx",Ba.DFDY="dFdy",Ba.ROUND="round",Ba.RECIPROCAL="reciprocal",Ba.TRUNC="trunc",Ba.FWIDTH="fwidth",Ba.TRANSPOSE="transpose",Ba.BITCAST="bitcast",Ba.EQUALS="equals",Ba.MIN="min",Ba.MAX="max",Ba.STEP="step",Ba.REFLECT="reflect",Ba.DISTANCE="distance",Ba.DIFFERENCE="difference",Ba.DOT="dot",Ba.CROSS="cross",Ba.POW="pow",Ba.TRANSFORM_DIRECTION="transformDirection",Ba.MIX="mix",Ba.CLAMP="clamp",Ba.REFRACT="refract",Ba.SMOOTHSTEP="smoothstep",Ba.FACEFORWARD="faceforward";const Ia=ji(1e-6),Da=ji(1e6),Va=ji(Math.PI),Ua=ji(2*Math.PI),Oa=Vi(Ba,Ba.ALL).setParameterLength(1),ka=Vi(Ba,Ba.ANY).setParameterLength(1),Ga=Vi(Ba,Ba.RADIANS).setParameterLength(1),za=Vi(Ba,Ba.DEGREES).setParameterLength(1),Ha=Vi(Ba,Ba.EXP).setParameterLength(1),$a=Vi(Ba,Ba.EXP2).setParameterLength(1),Wa=Vi(Ba,Ba.LOG).setParameterLength(1),ja=Vi(Ba,Ba.LOG2).setParameterLength(1),qa=Vi(Ba,Ba.SQRT).setParameterLength(1),Xa=Vi(Ba,Ba.INVERSE_SQRT).setParameterLength(1),Ka=Vi(Ba,Ba.FLOOR).setParameterLength(1),Ya=Vi(Ba,Ba.CEIL).setParameterLength(1),Qa=Vi(Ba,Ba.NORMALIZE).setParameterLength(1),Za=Vi(Ba,Ba.FRACT).setParameterLength(1),Ja=Vi(Ba,Ba.SIN).setParameterLength(1),eo=Vi(Ba,Ba.COS).setParameterLength(1),to=Vi(Ba,Ba.TAN).setParameterLength(1),ro=Vi(Ba,Ba.ASIN).setParameterLength(1),so=Vi(Ba,Ba.ACOS).setParameterLength(1),io=Vi(Ba,Ba.ATAN).setParameterLength(1,2),no=Vi(Ba,Ba.ABS).setParameterLength(1),ao=Vi(Ba,Ba.SIGN).setParameterLength(1),oo=Vi(Ba,Ba.LENGTH).setParameterLength(1),uo=Vi(Ba,Ba.NEGATE).setParameterLength(1),lo=Vi(Ba,Ba.ONE_MINUS).setParameterLength(1),co=Vi(Ba,Ba.DFDX).setParameterLength(1),ho=Vi(Ba,Ba.DFDY).setParameterLength(1),po=Vi(Ba,Ba.ROUND).setParameterLength(1),go=Vi(Ba,Ba.RECIPROCAL).setParameterLength(1),mo=Vi(Ba,Ba.TRUNC).setParameterLength(1),fo=Vi(Ba,Ba.FWIDTH).setParameterLength(1),yo=Vi(Ba,Ba.TRANSPOSE).setParameterLength(1),bo=Vi(Ba,Ba.BITCAST).setParameterLength(2),xo=(e,t)=>(console.warn('THREE.TSL: "equals" is deprecated. Use "equal" inside a vector instead, like: "bvec*( equal( ... ) )"'),ha(e,t)),To=Vi(Ba,Ba.MIN).setParameterLength(2,1/0),_o=Vi(Ba,Ba.MAX).setParameterLength(2,1/0),vo=Vi(Ba,Ba.STEP).setParameterLength(2),No=Vi(Ba,Ba.REFLECT).setParameterLength(2),So=Vi(Ba,Ba.DISTANCE).setParameterLength(2),Eo=Vi(Ba,Ba.DIFFERENCE).setParameterLength(2),wo=Vi(Ba,Ba.DOT).setParameterLength(2),Ao=Vi(Ba,Ba.CROSS).setParameterLength(2),Ro=Vi(Ba,Ba.POW).setParameterLength(2),Co=Vi(Ba,Ba.POW,2).setParameterLength(1),Mo=Vi(Ba,Ba.POW,3).setParameterLength(1),Po=Vi(Ba,Ba.POW,4).setParameterLength(1),Lo=Vi(Ba,Ba.TRANSFORM_DIRECTION).setParameterLength(2),Fo=e=>la(ao(e),Ro(no(e),1/3)),Bo=e=>wo(e,e),Io=Vi(Ba,Ba.MIX).setParameterLength(3),Do=(e,t=0,r=1)=>Bi(new Ba(Ba.CLAMP,Bi(e),Bi(t),Bi(r))),Vo=e=>Do(e),Uo=Vi(Ba,Ba.REFRACT).setParameterLength(3),Oo=Vi(Ba,Ba.SMOOTHSTEP).setParameterLength(3),ko=Vi(Ba,Ba.FACEFORWARD).setParameterLength(3),Go=ki((([e])=>{const t=wo(e.xy,Yi(12.9898,78.233)),r=ca(t,Va);return Za(Ja(r).mul(43758.5453))})),zo=(e,t,r)=>Io(t,r,e),Ho=(e,t,r)=>Oo(t,r,e),$o=(e,t)=>(console.warn('THREE.TSL: "atan2" is overloaded. Use "atan" instead.'),io(e,t)),Wo=ko,jo=Xa;oi("all",Oa),oi("any",ka),oi("equals",xo),oi("radians",Ga),oi("degrees",za),oi("exp",Ha),oi("exp2",$a),oi("log",Wa),oi("log2",ja),oi("sqrt",qa),oi("inverseSqrt",Xa),oi("floor",Ka),oi("ceil",Ya),oi("normalize",Qa),oi("fract",Za),oi("sin",Ja),oi("cos",eo),oi("tan",to),oi("asin",ro),oi("acos",so),oi("atan",io),oi("abs",no),oi("sign",ao),oi("length",oo),oi("lengthSq",Bo),oi("negate",uo),oi("oneMinus",lo),oi("dFdx",co),oi("dFdy",ho),oi("round",po),oi("reciprocal",go),oi("trunc",mo),oi("fwidth",fo),oi("atan2",$o),oi("min",To),oi("max",_o),oi("step",vo),oi("reflect",No),oi("distance",So),oi("dot",wo),oi("cross",Ao),oi("pow",Ro),oi("pow2",Co),oi("pow3",Mo),oi("pow4",Po),oi("transformDirection",Lo),oi("mix",zo),oi("clamp",Do),oi("refract",Uo),oi("smoothstep",Ho),oi("faceForward",ko),oi("difference",Eo),oi("saturate",Vo),oi("cbrt",Fo),oi("transpose",yo),oi("rand",Go);class qo extends js{static get type(){return"ConditionalNode"}constructor(e,t,r=null){super(),this.condNode=e,this.ifNode=t,this.elseNode=r}getNodeType(e){const{ifNode:t,elseNode:r}=e.getNodeProperties(this);if(void 0===t)return this.setup(e),this.getNodeType(e);const s=t.getNodeType(e);if(null!==r){const t=r.getNodeType(e);if(e.getTypeLength(t)>e.getTypeLength(s))return t}return s}setup(e){const t=this.condNode.cache(),r=this.ifNode.cache(),s=this.elseNode?this.elseNode.cache():null,i=e.context.nodeBlock;e.getDataFromNode(r).parentNodeBlock=i,null!==s&&(e.getDataFromNode(s).parentNodeBlock=i);const n=e.getNodeProperties(this);n.condNode=t,n.ifNode=r.context({nodeBlock:r}),n.elseNode=s?s.context({nodeBlock:s}):null}generate(e,t){const r=this.getNodeType(e),s=e.getDataFromNode(this);if(void 0!==s.nodeProperty)return s.nodeProperty;const{condNode:i,ifNode:n,elseNode:a}=e.getNodeProperties(this),o=e.currentFunctionNode,u="void"!==t,l=u?mn(r).build(e):"";s.nodeProperty=l;const d=i.build(e,"bool");e.addFlowCode(`\n${e.tab}if ( ${d} ) {\n\n`).addFlowTab();let c=n.build(e,r);if(c&&(u?c=l+" = "+c+";":(c="return "+c+";",null===o&&(console.warn("THREE.TSL: Return statement used in an inline 'Fn()'. Define a layout struct to allow return values."),c="// "+c))),e.removeFlowTab().addFlowCode(e.tab+"\t"+c+"\n\n"+e.tab+"}"),null!==a){e.addFlowCode(" else {\n\n").addFlowTab();let t=a.build(e,r);t&&(u?t=l+" = "+t+";":(t="return "+t+";",null===o&&(console.warn("THREE.TSL: Return statement used in an inline 'Fn()'. Define a layout struct to allow return values."),t="// "+t))),e.removeFlowTab().addFlowCode(e.tab+"\t"+t+"\n\n"+e.tab+"}\n\n")}else e.addFlowCode("\n\n");return e.format(l,r,t)}}const Xo=Vi(qo).setParameterLength(2,3);oi("select",Xo);const Ko=(...e)=>(console.warn("THREE.TSL: cond() has been renamed to select()."),Xo(...e));oi("cond",Ko);class Yo extends js{static get type(){return"ContextNode"}constructor(e,t={}){super(),this.isContextNode=!0,this.node=e,this.value=t}getScope(){return this.node.getScope()}getNodeType(e){return this.node.getNodeType(e)}analyze(e){const t=e.getContext();e.setContext({...e.context,...this.value}),this.node.build(e),e.setContext(t)}setup(e){const t=e.getContext();e.setContext({...e.context,...this.value}),this.node.build(e),e.setContext(t)}generate(e,t){const r=e.getContext();e.setContext({...e.context,...this.value});const s=this.node.build(e,t);return e.setContext(r),s}}const Qo=Vi(Yo).setParameterLength(1,2),Zo=(e,t)=>Qo(e,{label:t});oi("context",Qo),oi("label",Zo);class Jo extends js{static get type(){return"VarNode"}constructor(e,t=null,r=!1){super(),this.node=e,this.name=t,this.global=!0,this.isVarNode=!0,this.readOnly=r,this.parents=!0}getMemberType(e,t){return this.node.getMemberType(e,t)}getElementType(e){return this.node.getElementType(e)}getNodeType(e){return this.node.getNodeType(e)}generate(e){const{node:t,name:r,readOnly:s}=this,{renderer:i}=e,n=!0===i.backend.isWebGPUBackend;let a=!1,o=!1;s&&(a=e.isDeterministic(t),o=n?s:a);const u=e.getVectorType(this.getNodeType(e)),l=t.build(e,u),d=e.getVarFromNode(this,r,u,void 0,o),c=e.getPropertyName(d);let h=c;if(o)if(n)h=a?`const ${c}`:`let ${c}`;else{const r=e.getArrayCount(t);h=`const ${e.getVar(d.type,c,r)}`}return e.addLineFlowCode(`${h} = ${l}`,this),c}}const eu=Vi(Jo),tu=(e,t=null)=>eu(e,t).toStack(),ru=(e,t=null)=>eu(e,t,!0).toStack();oi("toVar",tu),oi("toConst",ru);const su=e=>(console.warn('TSL: "temp( node )" is deprecated. Use "Var( node )" or "node.toVar()" instead.'),eu(e));oi("temp",su);class iu extends js{static get type(){return"VaryingNode"}constructor(e,t=null){super(),this.node=e,this.name=t,this.isVaryingNode=!0,this.interpolationType=null,this.interpolationSampling=null,this.global=!0}setInterpolation(e,t=null){return this.interpolationType=e,this.interpolationSampling=t,this}getHash(e){return this.name||super.getHash(e)}getNodeType(e){return this.node.getNodeType(e)}setupVarying(e){const t=e.getNodeProperties(this);let r=t.varying;if(void 0===r){const s=this.name,i=this.getNodeType(e),n=this.interpolationType,a=this.interpolationSampling;t.varying=r=e.getVaryingFromNode(this,s,i,n,a),t.node=this.node}return r.needsInterpolation||(r.needsInterpolation="fragment"===e.shaderStage),r}setup(e){this.setupVarying(e),e.flowNodeFromShaderStage(Ds.VERTEX,this.node)}analyze(e){this.setupVarying(e),e.flowNodeFromShaderStage(Ds.VERTEX,this.node)}generate(e){const t=e.getNodeProperties(this),r=this.setupVarying(e);if(void 0===t.propertyName){const s=this.getNodeType(e),i=e.getPropertyName(r,Ds.VERTEX);e.flowNodeFromShaderStage(Ds.VERTEX,this.node,s,i),t.propertyName=i}return e.getPropertyName(r)}}const nu=Vi(iu).setParameterLength(1,2),au=e=>nu(e);oi("toVarying",nu),oi("toVertexStage",au),oi("varying",((...e)=>(console.warn("THREE.TSL: .varying() has been renamed to .toVarying()."),nu(...e)))),oi("vertexStage",((...e)=>(console.warn("THREE.TSL: .vertexStage() has been renamed to .toVertexStage()."),nu(...e))));const ou=ki((([e])=>{const t=e.mul(.9478672986).add(.0521327014).pow(2.4),r=e.mul(.0773993808),s=e.lessThanEqual(.04045);return Io(t,r,s)})).setLayout({name:"sRGBTransferEOTF",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),uu=ki((([e])=>{const t=e.pow(.41666).mul(1.055).sub(.055),r=e.mul(12.92),s=e.lessThanEqual(.0031308);return Io(t,r,s)})).setLayout({name:"sRGBTransferOETF",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),lu="WorkingColorSpace";class du extends Ks{static get type(){return"ColorSpaceNode"}constructor(e,t,r){super("vec4"),this.colorNode=e,this.source=t,this.target=r}resolveColorSpace(e,t){return t===lu?c.workingColorSpace:"OutputColorSpace"===t?e.context.outputColorSpace||e.renderer.outputColorSpace:t}setup(e){const{colorNode:t}=this,r=this.resolveColorSpace(e,this.source),s=this.resolveColorSpace(e,this.target);let i=t;return!1!==c.enabled&&r!==s&&r&&s?(c.getTransfer(r)===h&&(i=nn(ou(i.rgb),i.a)),c.getPrimaries(r)!==c.getPrimaries(s)&&(i=nn(dn(c._getMatrix(new n,r,s)).mul(i.rgb),i.a)),c.getTransfer(s)===h&&(i=nn(uu(i.rgb),i.a)),i):i}}const cu=(e,t)=>Bi(new du(Bi(e),lu,t)),hu=(e,t)=>Bi(new du(Bi(e),t,lu));oi("workingToColorSpace",cu),oi("colorSpaceToWorking",hu);let pu=class extends qs{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),r=this.referenceNode.getNodeType(),s=this.getNodeType();return e.format(t,r,s)}};class gu extends js{static get type(){return"ReferenceBaseNode"}constructor(e,t,r=null,s=null){super(),this.property=e,this.uniformType=t,this.object=r,this.count=s,this.properties=e.split("."),this.reference=r,this.node=null,this.group=null,this.updateType=Vs.OBJECT}setGroup(e){return this.group=e,this}element(e){return Bi(new pu(this,Bi(e)))}setNodeType(e){const t=Zn(null,e).getSelf();null!==this.group&&t.setGroup(this.group),this.node=t}getNodeType(e){return null===this.node&&(this.updateReference(e),this.updateValue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let r=e[t[0]];for(let e=1;eBi(new mu(e,t,r));class yu extends Ks{static get type(){return"ToneMappingNode"}constructor(e,t=xu,r=null){super("vec3"),this.toneMapping=e,this.exposureNode=t,this.colorNode=r}customCacheKey(){return Ts(this.toneMapping)}setup(e){const t=this.colorNode||e.context.color,r=this.toneMapping;if(r===p)return t;let s=null;const i=e.renderer.library.getToneMappingFunction(r);return null!==i?s=nn(i(t.rgb,this.exposureNode),t.a):(console.error("ToneMappingNode: Unsupported Tone Mapping configuration.",r),s=t),s}}const bu=(e,t,r)=>Bi(new yu(e,Bi(t),Bi(r))),xu=fu("toneMappingExposure","float");oi("toneMapping",((e,t,r)=>bu(t,r,e)));class Tu extends ti{static get type(){return"BufferAttributeNode"}constructor(e,t=null,r=0,s=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferStride=r,this.bufferOffset=s,this.usage=g,this.instanced=!1,this.attribute=null,this.global=!0,e&&!0===e.isBufferAttribute&&(this.attribute=e,this.usage=e.usage,this.instanced=e.isInstancedBufferAttribute)}getHash(e){if(0===this.bufferStride&&0===this.bufferOffset){let t=e.globalCache.getData(this.value);return void 0===t&&(t={node:this},e.globalCache.setData(this.value,t)),t.node.uuid}return this.uuid}getNodeType(e){return null===this.bufferType&&(this.bufferType=e.getTypeFromAttribute(this.attribute)),this.bufferType}setup(e){if(null!==this.attribute)return;const t=this.getNodeType(e),r=this.value,s=e.getTypeLength(t),i=this.bufferStride||s,n=this.bufferOffset,a=!0===r.isInterleavedBuffer?r:new m(r,i),o=new f(a,s,n);a.setUsage(this.usage),this.attribute=o,this.attribute.isInstancedBufferAttribute=this.instanced}generate(e){const t=this.getNodeType(e),r=e.getBufferAttributeFromNode(this,t),s=e.getPropertyName(r);let i=null;if("vertex"===e.shaderStage||"compute"===e.shaderStage)this.name=s,i=s;else{i=nu(this).build(e,t)}return i}getInputType(){return"bufferAttribute"}setUsage(e){return this.usage=e,this.attribute&&!0===this.attribute.isBufferAttribute&&(this.attribute.usage=e),this}setInstanced(e){return this.instanced=e,this}}const _u=(e,t=null,r=0,s=0)=>Bi(new Tu(e,t,r,s)),vu=(e,t=null,r=0,s=0)=>_u(e,t,r,s).setUsage(y),Nu=(e,t=null,r=0,s=0)=>_u(e,t,r,s).setInstanced(!0),Su=(e,t=null,r=0,s=0)=>vu(e,t,r,s).setInstanced(!0);oi("toAttribute",(e=>_u(e.value)));class Eu extends js{static get type(){return"ComputeNode"}constructor(e,t,r=[64]){super("void"),this.isComputeNode=!0,this.computeNode=e,this.count=t,this.workgroupSize=r,this.dispatchCount=0,this.version=1,this.name="",this.updateBeforeType=Vs.OBJECT,this.onInitFunction=null,this.updateDispatchCount()}dispose(){this.dispatchEvent({type:"dispose"})}label(e){return this.name=e,this}updateDispatchCount(){const{count:e,workgroupSize:t}=this;let r=t[0];for(let e=1;eBi(new Eu(Bi(e),t,r));oi("compute",wu);class Au extends js{static get type(){return"CacheNode"}constructor(e,t=!0){super(),this.node=e,this.parent=t,this.isCacheNode=!0}getNodeType(e){const t=e.getCache(),r=e.getCacheFromNode(this,this.parent);e.setCache(r);const s=this.node.getNodeType(e);return e.setCache(t),s}build(e,...t){const r=e.getCache(),s=e.getCacheFromNode(this,this.parent);e.setCache(s);const i=this.node.build(e,...t);return e.setCache(r),i}}const Ru=(e,t)=>Bi(new Au(Bi(e),t)),Cu=(e,t)=>e.context({namespace:t});oi("cache",Ru);class Mu extends js{static get type(){return"BypassNode"}constructor(e,t){super(),this.isBypassNode=!0,this.outputNode=e,this.callNode=t}getNodeType(e){return this.outputNode.getNodeType(e)}generate(e){const t=this.callNode.build(e,"void");return""!==t&&e.addLineFlowCode(t,this),this.outputNode.build(e)}}const Pu=Vi(Mu).setParameterLength(2);oi("bypass",Pu);class Lu extends js{static get type(){return"RemapNode"}constructor(e,t,r,s=ji(0),i=ji(1)){super(),this.node=e,this.inLowNode=t,this.inHighNode=r,this.outLowNode=s,this.outHighNode=i,this.doClamp=!0}setup(){const{node:e,inLowNode:t,inHighNode:r,outLowNode:s,outHighNode:i,doClamp:n}=this;let a=e.sub(t).div(r.sub(t));return!0===n&&(a=a.clamp()),a.mul(i.sub(s)).add(s)}}const Fu=Vi(Lu,null,null,{doClamp:!1}).setParameterLength(3,5),Bu=Vi(Lu).setParameterLength(3,5);oi("remap",Fu),oi("remapClamp",Bu);class Iu extends js{static get type(){return"ExpressionNode"}constructor(e="",t="void"){super(t),this.snippet=e}generate(e,t){const r=this.getNodeType(e),s=this.snippet;if("void"!==r)return e.format(s,r,t);e.addLineFlowCode(s,this)}}const Du=Vi(Iu).setParameterLength(1,2),Vu=e=>(e?Xo(e,Du("discard")):Du("discard")).toStack();oi("discard",Vu);class Uu extends Ks{static get type(){return"RenderOutputNode"}constructor(e,t,r){super("vec4"),this.colorNode=e,this.toneMapping=t,this.outputColorSpace=r,this.isRenderOutputNode=!0}setup({context:e}){let t=this.colorNode||e.color;const r=(null!==this.toneMapping?this.toneMapping:e.toneMapping)||p,s=(null!==this.outputColorSpace?this.outputColorSpace:e.outputColorSpace)||b;return r!==p&&(t=t.toneMapping(r)),s!==b&&s!==c.workingColorSpace&&(t=t.workingToColorSpace(s)),t}}const Ou=(e,t=null,r=null)=>Bi(new Uu(Bi(e),t,r));oi("renderOutput",Ou);class ku extends Ks{static get type(){return"DebugNode"}constructor(e,t=null){super(),this.node=e,this.callback=t}getNodeType(e){return this.node.getNodeType(e)}setup(e){return this.node.build(e)}analyze(e){return this.node.build(e)}generate(e){const t=this.callback,r=this.node.build(e),s="--- TSL debug - "+e.shaderStage+" shader ---",i="-".repeat(s.length);let n="";return n+="// #"+s+"#\n",n+=e.flow.code.replace(/^\t/gm,"")+"\n",n+="/* ... */ "+r+" /* ... */\n",n+="// #"+i+"#\n",null!==t?t(e,n):console.log(n),r}}const Gu=(e,t=null)=>Bi(new ku(Bi(e),t));oi("debug",Gu);class zu extends js{static get type(){return"AttributeNode"}constructor(e,t=null){super(t),this.global=!0,this._attributeName=e}getHash(e){return this.getAttributeName(e)}getNodeType(e){let t=this.nodeType;if(null===t){const r=this.getAttributeName(e);if(e.hasGeometryAttribute(r)){const s=e.geometry.getAttribute(r);t=e.getTypeFromAttribute(s)}else t="float"}return t}setAttributeName(e){return this._attributeName=e,this}getAttributeName(){return this._attributeName}generate(e){const t=this.getAttributeName(e),r=this.getNodeType(e);if(!0===e.hasGeometryAttribute(t)){const s=e.geometry.getAttribute(t),i=e.getTypeFromAttribute(s),n=e.getAttribute(t,i);if("vertex"===e.shaderStage)return e.format(n.name,i,r);return nu(this).build(e,r)}return console.warn(`AttributeNode: Vertex attribute "${t}" not found on geometry.`),e.generateConst(r)}serialize(e){super.serialize(e),e.global=this.global,e._attributeName=this._attributeName}deserialize(e){super.deserialize(e),this.global=e.global,this._attributeName=e._attributeName}}const Hu=(e,t=null)=>Bi(new zu(e,t)),$u=(e=0)=>Hu("uv"+(e>0?e:""),"vec2");class Wu extends js{static get type(){return"TextureSizeNode"}constructor(e,t=null){super("uvec2"),this.isTextureSizeNode=!0,this.textureNode=e,this.levelNode=t}generate(e,t){const r=this.textureNode.build(e,"property"),s=null===this.levelNode?"0":this.levelNode.build(e,"int");return e.format(`${e.getMethod("textureDimensions")}( ${r}, ${s} )`,this.getNodeType(e),t)}}const ju=Vi(Wu).setParameterLength(1,2);class qu extends Qn{static get type(){return"MaxMipLevelNode"}constructor(e){super(0),this._textureNode=e,this.updateType=Vs.FRAME}get textureNode(){return this._textureNode}get texture(){return this._textureNode.value}update(){const e=this.texture,t=e.images,r=t&&t.length>0?t[0]&&t[0].image||t[0]:e.image;if(r&&void 0!==r.width){const{width:e,height:t}=r;this.value=Math.log2(Math.max(e,t))}}}const Xu=Vi(qu).setParameterLength(1),Ku=new x;class Yu extends Qn{static get type(){return"TextureNode"}constructor(e=Ku,t=null,r=null,s=null){super(e),this.isTextureNode=!0,this.uvNode=t,this.levelNode=r,this.biasNode=s,this.compareNode=null,this.depthNode=null,this.gradNode=null,this.sampler=!0,this.updateMatrix=!1,this.updateType=Vs.NONE,this.referenceNode=null,this._value=e,this._matrixUniform=null,this.setUpdateMatrix(null===t)}set value(e){this.referenceNode?this.referenceNode.value=e:this._value=e}get value(){return this.referenceNode?this.referenceNode.value:this._value}getUniformHash(){return this.value.uuid}getNodeType(){return!0===this.value.isDepthTexture?"float":this.value.type===T?"uvec4":this.value.type===_?"ivec4":"vec4"}getInputType(){return"texture"}getDefaultUV(){return $u(this.value.channel)}updateReference(){return this.value}getTransformedUV(e){return null===this._matrixUniform&&(this._matrixUniform=Zn(this.value.matrix)),this._matrixUniform.mul(en(e,1)).xy}setUpdateMatrix(e){return this.updateMatrix=e,this.updateType=e?Vs.OBJECT:Vs.NONE,this}setupUV(e,t){const r=this.value;return e.isFlipY()&&(r.image instanceof ImageBitmap&&!0===r.flipY||!0===r.isRenderTargetTexture||!0===r.isFramebufferTexture||!0===r.isDepthTexture)&&(t=this.sampler?t.flipY():t.setY(qi(ju(this,this.levelNode).y).sub(t.y).sub(1))),t}setup(e){const t=e.getNodeProperties(this);t.referenceNode=this.referenceNode;const r=this.value;if(!r||!0!==r.isTexture)throw new Error("THREE.TSL: `texture( value )` function expects a valid instance of THREE.Texture().");let s=this.uvNode;null!==s&&!0!==e.context.forceUVContext||!e.context.getUV||(s=e.context.getUV(this,e)),s||(s=this.getDefaultUV()),!0===this.updateMatrix&&(s=this.getTransformedUV(s)),s=this.setupUV(e,s);let i=this.levelNode;null===i&&e.context.getTextureLevel&&(i=e.context.getTextureLevel(this)),t.uvNode=s,t.levelNode=i,t.biasNode=this.biasNode,t.compareNode=this.compareNode,t.gradNode=this.gradNode,t.depthNode=this.depthNode}generateUV(e,t){return t.build(e,!0===this.sampler?"vec2":"ivec2")}generateSnippet(e,t,r,s,i,n,a,o){const u=this.value;let l;return l=s?e.generateTextureLevel(u,t,r,s,n):i?e.generateTextureBias(u,t,r,i,n):o?e.generateTextureGrad(u,t,r,o,n):a?e.generateTextureCompare(u,t,r,a,n):!1===this.sampler?e.generateTextureLoad(u,t,r,n):e.generateTexture(u,t,r,n),l}generate(e,t){const r=this.value,s=e.getNodeProperties(this),i=super.generate(e,"property");if(/^sampler/.test(t))return i+"_sampler";if(e.isReference(t))return i;{const n=e.getDataFromNode(this);let a=n.propertyName;if(void 0===a){const{uvNode:t,levelNode:r,biasNode:o,compareNode:u,depthNode:l,gradNode:d}=s,c=this.generateUV(e,t),h=r?r.build(e,"float"):null,p=o?o.build(e,"float"):null,g=l?l.build(e,"int"):null,m=u?u.build(e,"float"):null,f=d?[d[0].build(e,"vec2"),d[1].build(e,"vec2")]:null,y=e.getVarFromNode(this);a=e.getPropertyName(y);const b=this.generateSnippet(e,i,c,h,p,g,m,f);e.addLineFlowCode(`${a} = ${b}`,this),n.snippet=b,n.propertyName=a}let o=a;const u=this.getNodeType(e);return e.needsToWorkingColorSpace(r)&&(o=hu(Du(o,u),r.colorSpace).setup(e).build(e,u)),e.format(o,u,t)}}setSampler(e){return this.sampler=e,this}getSampler(){return this.sampler}uv(e){return console.warn("THREE.TextureNode: .uv() has been renamed. Use .sample() instead."),this.sample(e)}sample(e){const t=this.clone();return t.uvNode=Bi(e),t.referenceNode=this.getSelf(),Bi(t)}blur(e){const t=this.clone();t.biasNode=Bi(e).mul(Xu(t)),t.referenceNode=this.getSelf();const r=t.value;return!1===t.generateMipmaps&&(r&&!1===r.generateMipmaps||r.minFilter===v||r.magFilter===v)&&(console.warn("THREE.TSL: texture().blur() requires mipmaps and sampling. Use .generateMipmaps=true and .minFilter/.magFilter=THREE.LinearFilter in the Texture."),t.biasNode=null),Bi(t)}level(e){const t=this.clone();return t.levelNode=Bi(e),t.referenceNode=this.getSelf(),Bi(t)}size(e){return ju(this,e)}bias(e){const t=this.clone();return t.biasNode=Bi(e),t.referenceNode=this.getSelf(),Bi(t)}compare(e){const t=this.clone();return t.compareNode=Bi(e),t.referenceNode=this.getSelf(),Bi(t)}grad(e,t){const r=this.clone();return r.gradNode=[Bi(e),Bi(t)],r.referenceNode=this.getSelf(),Bi(r)}depth(e){const t=this.clone();return t.depthNode=Bi(e),t.referenceNode=this.getSelf(),Bi(t)}serialize(e){super.serialize(e),e.value=this.value.toJSON(e.meta).uuid,e.sampler=this.sampler,e.updateMatrix=this.updateMatrix,e.updateType=this.updateType}deserialize(e){super.deserialize(e),this.value=e.meta.textures[e.value],this.sampler=e.sampler,this.updateMatrix=e.updateMatrix,this.updateType=e.updateType}update(){const e=this.value,t=this._matrixUniform;null!==t&&(t.value=e.matrix),!0===e.matrixAutoUpdate&&e.updateMatrix()}clone(){const e=new this.constructor(this.value,this.uvNode,this.levelNode,this.biasNode);return e.sampler=this.sampler,e.depthNode=this.depthNode,e.compareNode=this.compareNode,e.gradNode=this.gradNode,e}}const Qu=Vi(Yu).setParameterLength(1,4).setName("texture"),Zu=(e=Ku,t=null,r=null,s=null)=>{let i;return e&&!0===e.isTextureNode?(i=Bi(e.clone()),i.referenceNode=e.getSelf(),null!==t&&(i.uvNode=Bi(t)),null!==r&&(i.levelNode=Bi(r)),null!==s&&(i.biasNode=Bi(s))):i=Qu(e,t,r,s),i},Ju=(...e)=>Zu(...e).setSampler(!1);class el extends Qn{static get type(){return"BufferNode"}constructor(e,t,r=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferCount=r}getElementType(e){return this.getNodeType(e)}getInputType(){return"buffer"}}const tl=(e,t,r)=>Bi(new el(e,t,r));class rl extends qs{static get type(){return"UniformArrayElementNode"}constructor(e,t){super(e,t),this.isArrayBufferElementNode=!0}generate(e){const t=super.generate(e),r=this.getNodeType(),s=this.node.getPaddedType();return e.format(t,s,r)}}class sl extends el{static get type(){return"UniformArrayNode"}constructor(e,t=null){super(null),this.array=e,this.elementType=null===t?Ms(e[0]):t,this.paddedType=this.getPaddedType(),this.updateType=Vs.RENDER,this.isArrayBufferNode=!0}getNodeType(){return this.paddedType}getElementType(){return this.elementType}getPaddedType(){const e=this.elementType;let t="vec4";return"mat2"===e?t="mat2":!0===/mat/.test(e)?t="mat4":"i"===e.charAt(0)?t="ivec4":"u"===e.charAt(0)&&(t="uvec4"),t}update(){const{array:e,value:t}=this,r=this.elementType;if("float"===r||"int"===r||"uint"===r)for(let r=0;rBi(new sl(e,t));const nl=Vi(class extends js{constructor(e){super("float"),this.name=e,this.isBuiltinNode=!0}generate(){return this.name}}).setParameterLength(1),al=Zn(0,"uint").label("u_cameraIndex").setGroup(qn("cameraIndex")).toVarying("v_cameraIndex"),ol=Zn("float").label("cameraNear").setGroup(Kn).onRenderUpdate((({camera:e})=>e.near)),ul=Zn("float").label("cameraFar").setGroup(Kn).onRenderUpdate((({camera:e})=>e.far)),ll=ki((({camera:e})=>{let t;if(e.isArrayCamera&&e.cameras.length>0){const r=[];for(const t of e.cameras)r.push(t.projectionMatrix);t=il(r).setGroup(Kn).label("cameraProjectionMatrices").element(e.isMultiViewCamera?nl("gl_ViewID_OVR"):al).toVar("cameraProjectionMatrix")}else t=Zn("mat4").label("cameraProjectionMatrix").setGroup(Kn).onRenderUpdate((({camera:e})=>e.projectionMatrix));return t})).once()(),dl=ki((({camera:e})=>{let t;if(e.isArrayCamera&&e.cameras.length>0){const r=[];for(const t of e.cameras)r.push(t.projectionMatrixInverse);t=il(r).setGroup(Kn).label("cameraProjectionMatricesInverse").element(e.isMultiViewCamera?nl("gl_ViewID_OVR"):al).toVar("cameraProjectionMatrixInverse")}else t=Zn("mat4").label("cameraProjectionMatrixInverse").setGroup(Kn).onRenderUpdate((({camera:e})=>e.projectionMatrixInverse));return t})).once()(),cl=ki((({camera:e})=>{let t;if(e.isArrayCamera&&e.cameras.length>0){const r=[];for(const t of e.cameras)r.push(t.matrixWorldInverse);t=il(r).setGroup(Kn).label("cameraViewMatrices").element(e.isMultiViewCamera?nl("gl_ViewID_OVR"):al).toVar("cameraViewMatrix")}else t=Zn("mat4").label("cameraViewMatrix").setGroup(Kn).onRenderUpdate((({camera:e})=>e.matrixWorldInverse));return t})).once()(),hl=Zn("mat4").label("cameraWorldMatrix").setGroup(Kn).onRenderUpdate((({camera:e})=>e.matrixWorld)),pl=Zn("mat3").label("cameraNormalMatrix").setGroup(Kn).onRenderUpdate((({camera:e})=>e.normalMatrix)),gl=Zn(new r).label("cameraPosition").setGroup(Kn).onRenderUpdate((({camera:e},t)=>t.value.setFromMatrixPosition(e.matrixWorld))),ml=new N;class fl extends js{static get type(){return"Object3DNode"}constructor(e,t=null){super(),this.scope=e,this.object3d=t,this.updateType=Vs.OBJECT,this.uniformNode=new Qn(null)}getNodeType(){const e=this.scope;return e===fl.WORLD_MATRIX?"mat4":e===fl.POSITION||e===fl.VIEW_POSITION||e===fl.DIRECTION||e===fl.SCALE?"vec3":e===fl.RADIUS?"float":void 0}update(e){const t=this.object3d,s=this.uniformNode,i=this.scope;if(i===fl.WORLD_MATRIX)s.value=t.matrixWorld;else if(i===fl.POSITION)s.value=s.value||new r,s.value.setFromMatrixPosition(t.matrixWorld);else if(i===fl.SCALE)s.value=s.value||new r,s.value.setFromMatrixScale(t.matrixWorld);else if(i===fl.DIRECTION)s.value=s.value||new r,t.getWorldDirection(s.value);else if(i===fl.VIEW_POSITION){const i=e.camera;s.value=s.value||new r,s.value.setFromMatrixPosition(t.matrixWorld),s.value.applyMatrix4(i.matrixWorldInverse)}else if(i===fl.RADIUS){const r=e.object.geometry;null===r.boundingSphere&&r.computeBoundingSphere(),ml.copy(r.boundingSphere).applyMatrix4(t.matrixWorld),s.value=ml.radius}}generate(e){const t=this.scope;return t===fl.WORLD_MATRIX?this.uniformNode.nodeType="mat4":t===fl.POSITION||t===fl.VIEW_POSITION||t===fl.DIRECTION||t===fl.SCALE?this.uniformNode.nodeType="vec3":t===fl.RADIUS&&(this.uniformNode.nodeType="float"),this.uniformNode.build(e)}serialize(e){super.serialize(e),e.scope=this.scope}deserialize(e){super.deserialize(e),this.scope=e.scope}}fl.WORLD_MATRIX="worldMatrix",fl.POSITION="position",fl.SCALE="scale",fl.VIEW_POSITION="viewPosition",fl.DIRECTION="direction",fl.RADIUS="radius";const yl=Vi(fl,fl.DIRECTION).setParameterLength(1),bl=Vi(fl,fl.WORLD_MATRIX).setParameterLength(1),xl=Vi(fl,fl.POSITION).setParameterLength(1),Tl=Vi(fl,fl.SCALE).setParameterLength(1),_l=Vi(fl,fl.VIEW_POSITION).setParameterLength(1),vl=Vi(fl,fl.RADIUS).setParameterLength(1);class Nl extends fl{static get type(){return"ModelNode"}constructor(e){super(e)}update(e){this.object3d=e.object,super.update(e)}}const Sl=Ui(Nl,Nl.DIRECTION),El=Ui(Nl,Nl.WORLD_MATRIX),wl=Ui(Nl,Nl.POSITION),Al=Ui(Nl,Nl.SCALE),Rl=Ui(Nl,Nl.VIEW_POSITION),Cl=Ui(Nl,Nl.RADIUS),Ml=Zn(new n).onObjectUpdate((({object:e},t)=>t.value.getNormalMatrix(e.matrixWorld))),Pl=Zn(new a).onObjectUpdate((({object:e},t)=>t.value.copy(e.matrixWorld).invert())),Ll=ki((e=>e.renderer.overrideNodes.modelViewMatrix||Fl)).once()().toVar("modelViewMatrix"),Fl=cl.mul(El),Bl=ki((e=>(e.context.isHighPrecisionModelViewMatrix=!0,Zn("mat4").onObjectUpdate((({object:e,camera:t})=>e.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,e.matrixWorld)))))).once()().toVar("highpModelViewMatrix"),Il=ki((e=>{const t=e.context.isHighPrecisionModelViewMatrix;return Zn("mat3").onObjectUpdate((({object:e,camera:r})=>(!0!==t&&e.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix))))})).once()().toVar("highpModelNormalViewMatrix"),Dl=Hu("position","vec3"),Vl=Dl.toVarying("positionLocal"),Ul=Dl.toVarying("positionPrevious"),Ol=ki((e=>El.mul(Vl).xyz.toVarying(e.getNamespace("v_positionWorld"))),"vec3").once("POSITION")(),kl=ki((e=>Vl.transformDirection(El).toVarying(e.getNamespace("v_positionWorldDirection")).normalize().toVar("positionWorldDirection")),"vec3").once("POSITION")(),Gl=ki((e=>e.context.setupPositionView().toVarying(e.getNamespace("v_positionView"))),"vec3").once("POSITION")(),zl=Gl.negate().toVarying("v_positionViewDirection").normalize().toVar("positionViewDirection");class Hl extends js{static get type(){return"FrontFacingNode"}constructor(){super("bool"),this.isFrontFacingNode=!0}generate(e){const{renderer:t,material:r}=e;return t.coordinateSystem===l&&r.side===S?"false":e.getFrontFacing()}}const $l=Ui(Hl),Wl=ji($l).mul(2).sub(1),jl=Hu("normal","vec3"),ql=ki((e=>!1===e.geometry.hasAttribute("normal")?(console.warn('THREE.TSL: Vertex attribute "normal" not found on geometry.'),en(0,1,0)):jl),"vec3").once()().toVar("normalLocal"),Xl=Gl.dFdx().cross(Gl.dFdy()).normalize().toVar("normalFlat"),Kl=ki((e=>{let t;return t=!0===e.material.flatShading?Xl:nu(td(ql),"v_normalView").normalize(),t}),"vec3").once()().toVar("normalView"),Yl=ki((e=>{let t=Kl.transformDirection(cl);return!0!==e.material.flatShading&&(t=nu(t,"v_normalWorld")),t}),"vec3").once()().normalize().toVar("normalWorld"),Ql=ki((e=>{let t=e.context.setupNormal().context({getUV:null});return!0!==e.material.flatShading&&(t=t.mul(Wl)),t}),"vec3").once()().toVar("transformedNormalView"),Zl=Ql.transformDirection(cl).toVar("transformedNormalWorld"),Jl=ki((e=>{let t=e.context.setupClearcoatNormal().context({getUV:null});return!0!==e.material.flatShading&&(t=t.mul(Wl)),t}),"vec3").once()().toVar("transformedClearcoatNormalView"),ed=ki((([e,t=El])=>{const r=dn(t),s=e.div(en(r[0].dot(r[0]),r[1].dot(r[1]),r[2].dot(r[2])));return r.mul(s).xyz})),td=ki((([e],t)=>{const r=t.renderer.overrideNodes.modelNormalViewMatrix;if(null!==r)return r.transformDirection(e);const s=Ml.mul(e);return cl.transformDirection(s)})),rd=new E,sd=new a,id=Zn(0).onReference((({material:e})=>e)).onObjectUpdate((({material:e})=>e.refractionRatio)),nd=Zn(1).onReference((({material:e})=>e)).onObjectUpdate((function({material:e,scene:t}){return e.envMap?e.envMapIntensity:t.environmentIntensity})),ad=Zn(new a).onReference((function(e){return e.material})).onObjectUpdate((function({material:e,scene:t}){const r=null!==t.environment&&null===e.envMap?t.environmentRotation:e.envMapRotation;return r?(rd.copy(r),sd.makeRotationFromEuler(rd)):sd.identity(),sd})),od=zl.negate().reflect(Ql),ud=zl.negate().refract(Ql,id),ld=od.transformDirection(cl).toVar("reflectVector"),dd=ud.transformDirection(cl).toVar("reflectVector"),cd=new w;class hd extends Yu{static get type(){return"CubeTextureNode"}constructor(e,t=null,r=null,s=null){super(e,t,r,s),this.isCubeTextureNode=!0}getInputType(){return"cubeTexture"}getDefaultUV(){const e=this.value;return e.mapping===A?ld:e.mapping===R?dd:(console.error('THREE.CubeTextureNode: Mapping "%s" not supported.',e.mapping),en(0,0,0))}setUpdateMatrix(){}setupUV(e,t){const r=this.value;return e.renderer.coordinateSystem!==d&&r.isRenderTargetTexture||(t=en(t.x.negate(),t.yz)),ad.mul(t)}generateUV(e,t){return t.build(e,"vec3")}}const pd=Vi(hd).setParameterLength(1,4).setName("cubeTexture"),gd=(e=cd,t=null,r=null,s=null)=>{let i;return e&&!0===e.isCubeTextureNode?(i=Bi(e.clone()),i.referenceNode=e.getSelf(),null!==t&&(i.uvNode=Bi(t)),null!==r&&(i.levelNode=Bi(r)),null!==s&&(i.biasNode=Bi(s))):i=pd(e,t,r,s),i};class md extends qs{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),r=this.referenceNode.getNodeType(),s=this.getNodeType();return e.format(t,r,s)}}class fd extends js{static get type(){return"ReferenceNode"}constructor(e,t,r=null,s=null){super(),this.property=e,this.uniformType=t,this.object=r,this.count=s,this.properties=e.split("."),this.reference=r,this.node=null,this.group=null,this.name=null,this.updateType=Vs.OBJECT}element(e){return Bi(new md(this,Bi(e)))}setGroup(e){return this.group=e,this}label(e){return this.name=e,this}setNodeType(e){let t=null;t=null!==this.count?tl(null,e,this.count):Array.isArray(this.getValueFromReference())?il(null,e):"texture"===e?Zu(null):"cubeTexture"===e?gd(null):Zn(null,e),null!==this.group&&t.setGroup(this.group),null!==this.name&&t.label(this.name),this.node=t.getSelf()}getNodeType(e){return null===this.node&&(this.updateReference(e),this.updateValue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let r=e[t[0]];for(let e=1;eBi(new fd(e,t,r)),bd=(e,t,r,s)=>Bi(new fd(e,t,s,r));class xd extends fd{static get type(){return"MaterialReferenceNode"}constructor(e,t,r=null){super(e,t,r),this.material=r,this.isMaterialReferenceNode=!0}updateReference(e){return this.reference=null!==this.material?this.material:e.material,this.reference}}const Td=(e,t,r=null)=>Bi(new xd(e,t,r)),_d=ki((e=>(!1===e.geometry.hasAttribute("tangent")&&e.geometry.computeTangents(),Hu("tangent","vec4"))))(),vd=_d.xyz.toVar("tangentLocal"),Nd=Ll.mul(nn(vd,0)).xyz.toVarying("v_tangentView").normalize().toVar("tangentView"),Sd=Nd.transformDirection(cl).toVarying("v_tangentWorld").normalize().toVar("tangentWorld"),Ed=Nd.toVar("transformedTangentView"),wd=Ed.transformDirection(cl).normalize().toVar("transformedTangentWorld"),Ad=ki((([e,t],r)=>{let s=e.mul(_d.w).xyz;return!0!==r.material.flatShading&&(s=nu(s,t)),s})).once(),Rd=Ad(jl.cross(_d),"v_bitangentGeometry").normalize().toVar("bitangentGeometry"),Cd=Ad(ql.cross(vd),"v_bitangentLocal").normalize().toVar("bitangentLocal"),Md=Ad(Kl.cross(Nd),"v_bitangentView").normalize().toVar("bitangentView"),Pd=Ad(Yl.cross(Sd),"v_bitangentWorld").normalize().toVar("bitangentWorld"),Ld=Ad(Ql.cross(Ed),"v_transformedBitangentView").normalize().toVar("transformedBitangentView"),Fd=Ld.transformDirection(cl).normalize().toVar("transformedBitangentWorld"),Bd=dn(Nd,Md,Kl),Id=zl.mul(Bd),Dd=(()=>{let e=Pn.cross(zl);return e=e.cross(Pn).normalize(),e=Io(e,Ql,Cn.mul(xn.oneMinus()).oneMinus().pow2().pow2()).normalize(),e})(),Vd=ki((e=>{const{eye_pos:t,surf_norm:r,mapN:s,uv:i}=e,n=t.dFdx(),a=t.dFdy(),o=i.dFdx(),u=i.dFdy(),l=r,d=a.cross(l),c=l.cross(n),h=d.mul(o.x).add(c.mul(u.x)),p=d.mul(o.y).add(c.mul(u.y)),g=h.dot(h).max(p.dot(p)),m=Wl.mul(g.inverseSqrt());return oa(h.mul(s.x,m),p.mul(s.y,m),l.mul(s.z)).normalize()}));class Ud extends Ks{static get type(){return"NormalMapNode"}constructor(e,t=null){super("vec3"),this.node=e,this.scaleNode=t,this.normalMapType=C}setup(e){const{normalMapType:t,scaleNode:r}=this;let s=this.node.mul(2).sub(1);null!==r&&(s=en(s.xy.mul(r),s.z));let i=null;if(t===M)i=td(s);else if(t===C){i=!0===e.hasGeometryAttribute("tangent")?Bd.mul(s).normalize():Vd({eye_pos:Gl,surf_norm:Kl,mapN:s,uv:$u()})}return i}}const Od=Vi(Ud).setParameterLength(1,2),kd=ki((({textureNode:e,bumpScale:t})=>{const r=t=>e.cache().context({getUV:e=>t(e.uvNode||$u()),forceUVContext:!0}),s=ji(r((e=>e)));return Yi(ji(r((e=>e.add(e.dFdx())))).sub(s),ji(r((e=>e.add(e.dFdy())))).sub(s)).mul(t)})),Gd=ki((e=>{const{surf_pos:t,surf_norm:r,dHdxy:s}=e,i=t.dFdx().normalize(),n=r,a=t.dFdy().normalize().cross(n),o=n.cross(i),u=i.dot(a).mul(Wl),l=u.sign().mul(s.x.mul(a).add(s.y.mul(o)));return u.abs().mul(r).sub(l).normalize()}));class zd extends Ks{static get type(){return"BumpMapNode"}constructor(e,t=null){super("vec3"),this.textureNode=e,this.scaleNode=t}setup(){const e=null!==this.scaleNode?this.scaleNode:1,t=kd({textureNode:this.textureNode,bumpScale:e});return Gd({surf_pos:Gl,surf_norm:Kl,dHdxy:t})}}const Hd=Vi(zd).setParameterLength(1,2),$d=new Map;class Wd extends js{static get type(){return"MaterialNode"}constructor(e){super(),this.scope=e}getCache(e,t){let r=$d.get(e);return void 0===r&&(r=Td(e,t),$d.set(e,r)),r}getFloat(e){return this.getCache(e,"float")}getColor(e){return this.getCache(e,"color")}getTexture(e){return this.getCache("map"===e?"map":e+"Map","texture")}setup(e){const t=e.context.material,r=this.scope;let s=null;if(r===Wd.COLOR){const e=void 0!==t.color?this.getColor(r):en();s=t.map&&!0===t.map.isTexture?e.mul(this.getTexture("map")):e}else if(r===Wd.OPACITY){const e=this.getFloat(r);s=t.alphaMap&&!0===t.alphaMap.isTexture?e.mul(this.getTexture("alpha")):e}else if(r===Wd.SPECULAR_STRENGTH)s=t.specularMap&&!0===t.specularMap.isTexture?this.getTexture("specular").r:ji(1);else if(r===Wd.SPECULAR_INTENSITY){const e=this.getFloat(r);s=t.specularIntensityMap&&!0===t.specularIntensityMap.isTexture?e.mul(this.getTexture(r).a):e}else if(r===Wd.SPECULAR_COLOR){const e=this.getColor(r);s=t.specularColorMap&&!0===t.specularColorMap.isTexture?e.mul(this.getTexture(r).rgb):e}else if(r===Wd.ROUGHNESS){const e=this.getFloat(r);s=t.roughnessMap&&!0===t.roughnessMap.isTexture?e.mul(this.getTexture(r).g):e}else if(r===Wd.METALNESS){const e=this.getFloat(r);s=t.metalnessMap&&!0===t.metalnessMap.isTexture?e.mul(this.getTexture(r).b):e}else if(r===Wd.EMISSIVE){const e=this.getFloat("emissiveIntensity"),i=this.getColor(r).mul(e);s=t.emissiveMap&&!0===t.emissiveMap.isTexture?i.mul(this.getTexture(r)):i}else if(r===Wd.NORMAL)t.normalMap?(s=Od(this.getTexture("normal"),this.getCache("normalScale","vec2")),s.normalMapType=t.normalMapType):s=t.bumpMap?Hd(this.getTexture("bump").r,this.getFloat("bumpScale")):Kl;else if(r===Wd.CLEARCOAT){const e=this.getFloat(r);s=t.clearcoatMap&&!0===t.clearcoatMap.isTexture?e.mul(this.getTexture(r).r):e}else if(r===Wd.CLEARCOAT_ROUGHNESS){const e=this.getFloat(r);s=t.clearcoatRoughnessMap&&!0===t.clearcoatRoughnessMap.isTexture?e.mul(this.getTexture(r).r):e}else if(r===Wd.CLEARCOAT_NORMAL)s=t.clearcoatNormalMap?Od(this.getTexture(r),this.getCache(r+"Scale","vec2")):Kl;else if(r===Wd.SHEEN){const e=this.getColor("sheenColor").mul(this.getFloat("sheen"));s=t.sheenColorMap&&!0===t.sheenColorMap.isTexture?e.mul(this.getTexture("sheenColor").rgb):e}else if(r===Wd.SHEEN_ROUGHNESS){const e=this.getFloat(r);s=t.sheenRoughnessMap&&!0===t.sheenRoughnessMap.isTexture?e.mul(this.getTexture(r).a):e,s=s.clamp(.07,1)}else if(r===Wd.ANISOTROPY)if(t.anisotropyMap&&!0===t.anisotropyMap.isTexture){const e=this.getTexture(r);s=ln(Cc.x,Cc.y,Cc.y.negate(),Cc.x).mul(e.rg.mul(2).sub(Yi(1)).normalize().mul(e.b))}else s=Cc;else if(r===Wd.IRIDESCENCE_THICKNESS){const e=yd("1","float",t.iridescenceThicknessRange);if(t.iridescenceThicknessMap){const i=yd("0","float",t.iridescenceThicknessRange);s=e.sub(i).mul(this.getTexture(r).g).add(i)}else s=e}else if(r===Wd.TRANSMISSION){const e=this.getFloat(r);s=t.transmissionMap?e.mul(this.getTexture(r).r):e}else if(r===Wd.THICKNESS){const e=this.getFloat(r);s=t.thicknessMap?e.mul(this.getTexture(r).g):e}else if(r===Wd.IOR)s=this.getFloat(r);else if(r===Wd.LIGHT_MAP)s=this.getTexture(r).rgb.mul(this.getFloat("lightMapIntensity"));else if(r===Wd.AO)s=this.getTexture(r).r.sub(1).mul(this.getFloat("aoMapIntensity")).add(1);else if(r===Wd.LINE_DASH_OFFSET)s=t.dashOffset?this.getFloat(r):ji(0);else{const t=this.getNodeType(e);s=this.getCache(r,t)}return s}}Wd.ALPHA_TEST="alphaTest",Wd.COLOR="color",Wd.OPACITY="opacity",Wd.SHININESS="shininess",Wd.SPECULAR="specular",Wd.SPECULAR_STRENGTH="specularStrength",Wd.SPECULAR_INTENSITY="specularIntensity",Wd.SPECULAR_COLOR="specularColor",Wd.REFLECTIVITY="reflectivity",Wd.ROUGHNESS="roughness",Wd.METALNESS="metalness",Wd.NORMAL="normal",Wd.CLEARCOAT="clearcoat",Wd.CLEARCOAT_ROUGHNESS="clearcoatRoughness",Wd.CLEARCOAT_NORMAL="clearcoatNormal",Wd.EMISSIVE="emissive",Wd.ROTATION="rotation",Wd.SHEEN="sheen",Wd.SHEEN_ROUGHNESS="sheenRoughness",Wd.ANISOTROPY="anisotropy",Wd.IRIDESCENCE="iridescence",Wd.IRIDESCENCE_IOR="iridescenceIOR",Wd.IRIDESCENCE_THICKNESS="iridescenceThickness",Wd.IOR="ior",Wd.TRANSMISSION="transmission",Wd.THICKNESS="thickness",Wd.ATTENUATION_DISTANCE="attenuationDistance",Wd.ATTENUATION_COLOR="attenuationColor",Wd.LINE_SCALE="scale",Wd.LINE_DASH_SIZE="dashSize",Wd.LINE_GAP_SIZE="gapSize",Wd.LINE_WIDTH="linewidth",Wd.LINE_DASH_OFFSET="dashOffset",Wd.POINT_SIZE="size",Wd.DISPERSION="dispersion",Wd.LIGHT_MAP="light",Wd.AO="ao";const jd=Ui(Wd,Wd.ALPHA_TEST),qd=Ui(Wd,Wd.COLOR),Xd=Ui(Wd,Wd.SHININESS),Kd=Ui(Wd,Wd.EMISSIVE),Yd=Ui(Wd,Wd.OPACITY),Qd=Ui(Wd,Wd.SPECULAR),Zd=Ui(Wd,Wd.SPECULAR_INTENSITY),Jd=Ui(Wd,Wd.SPECULAR_COLOR),ec=Ui(Wd,Wd.SPECULAR_STRENGTH),tc=Ui(Wd,Wd.REFLECTIVITY),rc=Ui(Wd,Wd.ROUGHNESS),sc=Ui(Wd,Wd.METALNESS),ic=Ui(Wd,Wd.NORMAL),nc=Ui(Wd,Wd.CLEARCOAT),ac=Ui(Wd,Wd.CLEARCOAT_ROUGHNESS),oc=Ui(Wd,Wd.CLEARCOAT_NORMAL),uc=Ui(Wd,Wd.ROTATION),lc=Ui(Wd,Wd.SHEEN),dc=Ui(Wd,Wd.SHEEN_ROUGHNESS),cc=Ui(Wd,Wd.ANISOTROPY),hc=Ui(Wd,Wd.IRIDESCENCE),pc=Ui(Wd,Wd.IRIDESCENCE_IOR),gc=Ui(Wd,Wd.IRIDESCENCE_THICKNESS),mc=Ui(Wd,Wd.TRANSMISSION),fc=Ui(Wd,Wd.THICKNESS),yc=Ui(Wd,Wd.IOR),bc=Ui(Wd,Wd.ATTENUATION_DISTANCE),xc=Ui(Wd,Wd.ATTENUATION_COLOR),Tc=Ui(Wd,Wd.LINE_SCALE),_c=Ui(Wd,Wd.LINE_DASH_SIZE),vc=Ui(Wd,Wd.LINE_GAP_SIZE),Nc=Ui(Wd,Wd.LINE_WIDTH),Sc=Ui(Wd,Wd.LINE_DASH_OFFSET),Ec=Ui(Wd,Wd.POINT_SIZE),wc=Ui(Wd,Wd.DISPERSION),Ac=Ui(Wd,Wd.LIGHT_MAP),Rc=Ui(Wd,Wd.AO),Cc=Zn(new t).onReference((function(e){return e.material})).onRenderUpdate((function({material:e}){this.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation))})),Mc=ki((e=>e.context.setupModelViewProjection()),"vec4").once()().toVarying("v_modelViewProjection");class Pc extends js{static get type(){return"IndexNode"}constructor(e){super("uint"),this.scope=e,this.isIndexNode=!0}generate(e){const t=this.getNodeType(e),r=this.scope;let s,i;if(r===Pc.VERTEX)s=e.getVertexIndex();else if(r===Pc.INSTANCE)s=e.getInstanceIndex();else if(r===Pc.DRAW)s=e.getDrawIndex();else if(r===Pc.INVOCATION_LOCAL)s=e.getInvocationLocalIndex();else if(r===Pc.INVOCATION_SUBGROUP)s=e.getInvocationSubgroupIndex();else{if(r!==Pc.SUBGROUP)throw new Error("THREE.IndexNode: Unknown scope: "+r);s=e.getSubgroupIndex()}if("vertex"===e.shaderStage||"compute"===e.shaderStage)i=s;else{i=nu(this).build(e,t)}return i}}Pc.VERTEX="vertex",Pc.INSTANCE="instance",Pc.SUBGROUP="subgroup",Pc.INVOCATION_LOCAL="invocationLocal",Pc.INVOCATION_SUBGROUP="invocationSubgroup",Pc.DRAW="draw";const Lc=Ui(Pc,Pc.VERTEX),Fc=Ui(Pc,Pc.INSTANCE),Bc=Ui(Pc,Pc.SUBGROUP),Ic=Ui(Pc,Pc.INVOCATION_SUBGROUP),Dc=Ui(Pc,Pc.INVOCATION_LOCAL),Vc=Ui(Pc,Pc.DRAW);class Uc extends js{static get type(){return"InstanceNode"}constructor(e,t,r=null){super("void"),this.count=e,this.instanceMatrix=t,this.instanceColor=r,this.instanceMatrixNode=null,this.instanceColorNode=null,this.updateType=Vs.FRAME,this.buffer=null,this.bufferColor=null}setup(e){const{count:t,instanceMatrix:r,instanceColor:s}=this;let{instanceMatrixNode:i,instanceColorNode:n}=this;if(null===i){if(t<=1e3)i=tl(r.array,"mat4",Math.max(t,1)).element(Fc);else{const e=new P(r.array,16,1);this.buffer=e;const t=r.usage===y?Su:Nu,s=[t(e,"vec4",16,0),t(e,"vec4",16,4),t(e,"vec4",16,8),t(e,"vec4",16,12)];i=cn(...s)}this.instanceMatrixNode=i}if(s&&null===n){const e=new L(s.array,3),t=s.usage===y?Su:Nu;this.bufferColor=e,n=en(t(e,"vec3",3,0)),this.instanceColorNode=n}const a=i.mul(Vl).xyz;if(Vl.assign(a),e.hasGeometryAttribute("normal")){const e=ed(ql,i);ql.assign(e)}null!==this.instanceColorNode&&fn("vec3","vInstanceColor").assign(this.instanceColorNode)}update(){this.instanceMatrix.usage!==y&&null!==this.buffer&&this.instanceMatrix.version!==this.buffer.version&&(this.buffer.version=this.instanceMatrix.version),this.instanceColor&&this.instanceColor.usage!==y&&null!==this.bufferColor&&this.instanceColor.version!==this.bufferColor.version&&(this.bufferColor.version=this.instanceColor.version)}}const Oc=Vi(Uc).setParameterLength(2,3);class kc extends Uc{static get type(){return"InstancedMeshNode"}constructor(e){const{count:t,instanceMatrix:r,instanceColor:s}=e;super(t,r,s),this.instancedMesh=e}}const Gc=Vi(kc).setParameterLength(1);class zc extends js{static get type(){return"BatchNode"}constructor(e){super("void"),this.batchMesh=e,this.batchingIdNode=null}setup(e){null===this.batchingIdNode&&(null===e.getDrawIndex()?this.batchingIdNode=Fc:this.batchingIdNode=Vc);const t=ki((([e])=>{const t=qi(ju(Ju(this.batchMesh._indirectTexture),0).x),r=qi(e).mod(t),s=qi(e).div(t);return Ju(this.batchMesh._indirectTexture,Qi(r,s)).x})).setLayout({name:"getIndirectIndex",type:"uint",inputs:[{name:"id",type:"int"}]}),r=t(qi(this.batchingIdNode)),s=this.batchMesh._matricesTexture,i=qi(ju(Ju(s),0).x),n=ji(r).mul(4).toInt().toVar(),a=n.mod(i),o=n.div(i),u=cn(Ju(s,Qi(a,o)),Ju(s,Qi(a.add(1),o)),Ju(s,Qi(a.add(2),o)),Ju(s,Qi(a.add(3),o))),l=this.batchMesh._colorsTexture;if(null!==l){const e=ki((([e])=>{const t=qi(ju(Ju(l),0).x),r=e,s=r.mod(t),i=r.div(t);return Ju(l,Qi(s,i)).rgb})).setLayout({name:"getBatchingColor",type:"vec3",inputs:[{name:"id",type:"int"}]}),t=e(r);fn("vec3","vBatchColor").assign(t)}const d=dn(u);Vl.assign(u.mul(Vl));const c=ql.div(en(d[0].dot(d[0]),d[1].dot(d[1]),d[2].dot(d[2]))),h=d.mul(c).xyz;ql.assign(h),e.hasGeometryAttribute("tangent")&&vd.mulAssign(d)}}const Hc=Vi(zc).setParameterLength(1);class $c extends qs{static get type(){return"StorageArrayElementNode"}constructor(e,t){super(e,t),this.isStorageArrayElementNode=!0}set storageBufferNode(e){this.node=e}get storageBufferNode(){return this.node}getMemberType(e,t){const r=this.storageBufferNode.structTypeNode;return r?r.getMemberType(e,t):"void"}setup(e){return!1===e.isAvailable("storageBuffer")&&!0===this.node.isPBO&&e.setupPBO(this.node),super.setup(e)}generate(e,t){let r;const s=e.context.assign;if(r=!1===e.isAvailable("storageBuffer")?!0!==this.node.isPBO||!0===s||!this.node.value.isInstancedBufferAttribute&&"compute"===e.shaderStage?this.node.build(e):e.generatePBO(this):super.generate(e),!0!==s){const s=this.getNodeType(e);r=e.format(r,s,t)}return r}}const Wc=Vi($c).setParameterLength(2);class jc extends el{static get type(){return"StorageBufferNode"}constructor(e,t=null,r=0){let s,i=null;t&&t.isStruct?(s="struct",i=t.layout,(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute)&&(r=e.count)):null===t&&(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute)?(s=Es(e.itemSize),r=e.count):s=t,super(e,s,r),this.isStorageBufferNode=!0,this.structTypeNode=i,this.access=Os.READ_WRITE,this.isAtomic=!1,this.isPBO=!1,this._attribute=null,this._varying=null,this.global=!0,!0!==e.isStorageBufferAttribute&&!0!==e.isStorageInstancedBufferAttribute&&(e.isInstancedBufferAttribute?e.isStorageInstancedBufferAttribute=!0:e.isStorageBufferAttribute=!0)}getHash(e){if(0===this.bufferCount){let t=e.globalCache.getData(this.value);return void 0===t&&(t={node:this},e.globalCache.setData(this.value,t)),t.node.uuid}return this.uuid}getInputType(){return this.value.isIndirectStorageBufferAttribute?"indirectStorageBuffer":"storageBuffer"}element(e){return Wc(this,e)}setPBO(e){return this.isPBO=e,this}getPBO(){return this.isPBO}setAccess(e){return this.access=e,this}toReadOnly(){return this.setAccess(Os.READ_ONLY)}setAtomic(e){return this.isAtomic=e,this}toAtomic(){return this.setAtomic(!0)}getAttributeData(){return null===this._attribute&&(this._attribute=_u(this.value),this._varying=nu(this._attribute)),{attribute:this._attribute,varying:this._varying}}getNodeType(e){if(null!==this.structTypeNode)return this.structTypeNode.getNodeType(e);if(e.isAvailable("storageBuffer")||e.isAvailable("indirectStorageBuffer"))return super.getNodeType(e);const{attribute:t}=this.getAttributeData();return t.getNodeType(e)}getMemberType(e,t){return null!==this.structTypeNode?this.structTypeNode.getMemberType(e,t):"void"}generate(e){if(null!==this.structTypeNode&&this.structTypeNode.build(e),e.isAvailable("storageBuffer")||e.isAvailable("indirectStorageBuffer"))return super.generate(e);const{attribute:t,varying:r}=this.getAttributeData(),s=r.build(e);return e.registerTransform(s,t),s}}const qc=(e,t=null,r=0)=>Bi(new jc(e,t,r)),Xc=new WeakMap;class Kc extends js{static get type(){return"SkinningNode"}constructor(e){super("void"),this.skinnedMesh=e,this.updateType=Vs.OBJECT,this.skinIndexNode=Hu("skinIndex","uvec4"),this.skinWeightNode=Hu("skinWeight","vec4"),this.bindMatrixNode=yd("bindMatrix","mat4"),this.bindMatrixInverseNode=yd("bindMatrixInverse","mat4"),this.boneMatricesNode=bd("skeleton.boneMatrices","mat4",e.skeleton.bones.length),this.positionNode=Vl,this.toPositionNode=Vl,this.previousBoneMatricesNode=null}getSkinnedPosition(e=this.boneMatricesNode,t=this.positionNode){const{skinIndexNode:r,skinWeightNode:s,bindMatrixNode:i,bindMatrixInverseNode:n}=this,a=e.element(r.x),o=e.element(r.y),u=e.element(r.z),l=e.element(r.w),d=i.mul(t),c=oa(a.mul(s.x).mul(d),o.mul(s.y).mul(d),u.mul(s.z).mul(d),l.mul(s.w).mul(d));return n.mul(c).xyz}getSkinnedNormal(e=this.boneMatricesNode,t=ql){const{skinIndexNode:r,skinWeightNode:s,bindMatrixNode:i,bindMatrixInverseNode:n}=this,a=e.element(r.x),o=e.element(r.y),u=e.element(r.z),l=e.element(r.w);let d=oa(s.x.mul(a),s.y.mul(o),s.z.mul(u),s.w.mul(l));return d=n.mul(d).mul(i),d.transformDirection(t).xyz}getPreviousSkinnedPosition(e){const t=e.object;return null===this.previousBoneMatricesNode&&(t.skeleton.previousBoneMatrices=new Float32Array(t.skeleton.boneMatrices),this.previousBoneMatricesNode=bd("skeleton.previousBoneMatrices","mat4",t.skeleton.bones.length)),this.getSkinnedPosition(this.previousBoneMatricesNode,Ul)}needsPreviousBoneMatrices(e){const t=e.renderer.getMRT();return t&&t.has("velocity")||!0===Ls(e.object).useVelocity}setup(e){this.needsPreviousBoneMatrices(e)&&Ul.assign(this.getPreviousSkinnedPosition(e));const t=this.getSkinnedPosition();if(this.toPositionNode&&this.toPositionNode.assign(t),e.hasGeometryAttribute("normal")){const t=this.getSkinnedNormal();ql.assign(t),e.hasGeometryAttribute("tangent")&&vd.assign(t)}return t}generate(e,t){if("void"!==t)return super.generate(e,t)}update(e){const t=e.object&&e.object.skeleton?e.object.skeleton:this.skinnedMesh.skeleton;Xc.get(t)!==e.frameId&&(Xc.set(t,e.frameId),null!==this.previousBoneMatricesNode&&t.previousBoneMatrices.set(t.boneMatrices),t.update())}}const Yc=e=>Bi(new Kc(e));class Qc extends js{static get type(){return"LoopNode"}constructor(e=[]){super(),this.params=e}getVarName(e){return String.fromCharCode("i".charCodeAt(0)+e)}getProperties(e){const t=e.getNodeProperties(this);if(void 0!==t.stackNode)return t;const r={};for(let e=0,t=this.params.length-1;eNumber(u)?">=":"<")),a)n=`while ( ${u} )`;else{const r={start:o,end:u},s=r.start,i=r.end;let a;const p=()=>c.includes("<")?"+=":"-=";if(null!=h)switch(typeof h){case"function":a=e.flowStagesNode(t.updateNode,"void").code.replace(/\t|;/g,"");break;case"number":a=l+" "+p()+" "+e.generateConst(d,h);break;case"string":a=l+" "+h;break;default:h.isNode?a=l+" "+p()+" "+h.build(e):(console.error("THREE.TSL: 'Loop( { update: ... } )' is not a function, string or number."),a="break /* invalid update */")}else h="int"===d||"uint"===d?c.includes("<")?"++":"--":p()+" 1.",a=l+" "+h;n=`for ( ${e.getVar(d,l)+" = "+s}; ${l+" "+c+" "+i}; ${a} )`}e.addFlowCode((0===s?"\n":"")+e.tab+n+" {\n\n").addFlowTab()}const i=s.build(e,"void"),n=t.returnsNode?t.returnsNode.build(e):"";e.removeFlowTab().addFlowCode("\n"+e.tab+i);for(let t=0,r=this.params.length-1;tBi(new Qc(Di(e,"int"))).toStack(),Jc=()=>Du("break").toStack(),eh=new WeakMap,th=new s,rh=ki((({bufferMap:e,influence:t,stride:r,width:s,depth:i,offset:n})=>{const a=qi(Lc).mul(r).add(n),o=a.div(s),u=a.sub(o.mul(s));return Ju(e,Qi(u,o)).depth(i).xyz.mul(t)}));class sh extends js{static get type(){return"MorphNode"}constructor(e){super("void"),this.mesh=e,this.morphBaseInfluence=Zn(1),this.updateType=Vs.OBJECT}setup(e){const{geometry:r}=e,s=void 0!==r.morphAttributes.position,i=r.hasAttribute("normal")&&void 0!==r.morphAttributes.normal,n=r.morphAttributes.position||r.morphAttributes.normal||r.morphAttributes.color,a=void 0!==n?n.length:0,{texture:o,stride:u,size:l}=function(e){const r=void 0!==e.morphAttributes.position,s=void 0!==e.morphAttributes.normal,i=void 0!==e.morphAttributes.color,n=e.morphAttributes.position||e.morphAttributes.normal||e.morphAttributes.color,a=void 0!==n?n.length:0;let o=eh.get(e);if(void 0===o||o.count!==a){void 0!==o&&o.texture.dispose();const u=e.morphAttributes.position||[],l=e.morphAttributes.normal||[],d=e.morphAttributes.color||[];let c=0;!0===r&&(c=1),!0===s&&(c=2),!0===i&&(c=3);let h=e.attributes.position.count*c,p=1;const g=4096;h>g&&(p=Math.ceil(h/g),h=g);const m=new Float32Array(h*p*4*a),f=new F(m,h,p,a);f.type=B,f.needsUpdate=!0;const y=4*c;for(let x=0;x{const t=ji(0).toVar();this.mesh.count>1&&null!==this.mesh.morphTexture&&void 0!==this.mesh.morphTexture?t.assign(Ju(this.mesh.morphTexture,Qi(qi(e).add(1),qi(Fc))).r):t.assign(yd("morphTargetInfluences","float").element(e).toVar()),Hi(t.notEqual(0),(()=>{!0===s&&Vl.addAssign(rh({bufferMap:o,influence:t,stride:u,width:d,depth:e,offset:qi(0)})),!0===i&&ql.addAssign(rh({bufferMap:o,influence:t,stride:u,width:d,depth:e,offset:qi(1)}))}))}))}update(){const e=this.morphBaseInfluence;this.mesh.geometry.morphTargetsRelative?e.value=1:e.value=1-this.mesh.morphTargetInfluences.reduce(((e,t)=>e+t),0)}}const ih=Vi(sh).setParameterLength(1);class nh extends js{static get type(){return"LightingNode"}constructor(){super("vec3"),this.isLightingNode=!0}}class ah extends nh{static get type(){return"AONode"}constructor(e=null){super(),this.aoNode=e}setup(e){e.context.ambientOcclusion.mulAssign(this.aoNode)}}class oh extends Yo{static get type(){return"LightingContextNode"}constructor(e,t=null,r=null,s=null){super(e),this.lightingModel=t,this.backdropNode=r,this.backdropAlphaNode=s,this._value=null}getContext(){const{backdropNode:e,backdropAlphaNode:t}=this,r={directDiffuse:en().toVar("directDiffuse"),directSpecular:en().toVar("directSpecular"),indirectDiffuse:en().toVar("indirectDiffuse"),indirectSpecular:en().toVar("indirectSpecular")};return{radiance:en().toVar("radiance"),irradiance:en().toVar("irradiance"),iblIrradiance:en().toVar("iblIrradiance"),ambientOcclusion:ji(1).toVar("ambientOcclusion"),reflectedLight:r,backdrop:e,backdropAlpha:t}}setup(e){return this.value=this._value||(this._value=this.getContext()),this.value.lightingModel=this.lightingModel||e.context.lightingModel,super.setup(e)}}const uh=Vi(oh);class lh extends nh{static get type(){return"IrradianceNode"}constructor(e){super(),this.node=e}setup(e){e.context.irradiance.addAssign(this.node)}}let dh,ch;class hh extends js{static get type(){return"ScreenNode"}constructor(e){super(),this.scope=e,this.isViewportNode=!0}getNodeType(){return this.scope===hh.VIEWPORT?"vec4":"vec2"}getUpdateType(){let e=Vs.NONE;return this.scope!==hh.SIZE&&this.scope!==hh.VIEWPORT||(e=Vs.RENDER),this.updateType=e,e}update({renderer:e}){const t=e.getRenderTarget();this.scope===hh.VIEWPORT?null!==t?ch.copy(t.viewport):(e.getViewport(ch),ch.multiplyScalar(e.getPixelRatio())):null!==t?(dh.width=t.width,dh.height=t.height):e.getDrawingBufferSize(dh)}setup(){const e=this.scope;let r=null;return r=e===hh.SIZE?Zn(dh||(dh=new t)):e===hh.VIEWPORT?Zn(ch||(ch=new s)):Yi(mh.div(gh)),r}generate(e){if(this.scope===hh.COORDINATE){let t=e.getFragCoord();if(e.isFlipY()){const r=e.getNodeProperties(gh).outputNode.build(e);t=`${e.getType("vec2")}( ${t}.x, ${r}.y - ${t}.y )`}return t}return super.generate(e)}}hh.COORDINATE="coordinate",hh.VIEWPORT="viewport",hh.SIZE="size",hh.UV="uv";const ph=Ui(hh,hh.UV),gh=Ui(hh,hh.SIZE),mh=Ui(hh,hh.COORDINATE),fh=Ui(hh,hh.VIEWPORT),yh=fh.zw,bh=mh.sub(fh.xy),xh=bh.div(yh),Th=ki((()=>(console.warn('THREE.TSL: "viewportResolution" is deprecated. Use "screenSize" instead.'),gh)),"vec2").once()(),_h=ki((()=>(console.warn('THREE.TSL: "viewportTopLeft" is deprecated. Use "screenUV" instead.'),ph)),"vec2").once()(),vh=ki((()=>(console.warn('THREE.TSL: "viewportBottomLeft" is deprecated. Use "screenUV.flipY()" instead.'),ph.flipY())),"vec2").once()(),Nh=new t;class Sh extends Yu{static get type(){return"ViewportTextureNode"}constructor(e=ph,t=null,r=null){null===r&&((r=new I).minFilter=D),super(r,e,t),this.generateMipmaps=!1,this.isOutputTextureNode=!0,this.updateBeforeType=Vs.FRAME}updateBefore(e){const t=e.renderer;t.getDrawingBufferSize(Nh);const r=this.value;r.image.width===Nh.width&&r.image.height===Nh.height||(r.image.width=Nh.width,r.image.height=Nh.height,r.needsUpdate=!0);const s=r.generateMipmaps;r.generateMipmaps=this.generateMipmaps,t.copyFramebufferToTexture(r),r.generateMipmaps=s}clone(){const e=new this.constructor(this.uvNode,this.levelNode,this.value);return e.generateMipmaps=this.generateMipmaps,e}}const Eh=Vi(Sh).setParameterLength(0,3),wh=Vi(Sh,null,null,{generateMipmaps:!0}).setParameterLength(0,3);let Ah=null;class Rh extends Sh{static get type(){return"ViewportDepthTextureNode"}constructor(e=ph,t=null){null===Ah&&(Ah=new V),super(e,t,Ah)}}const Ch=Vi(Rh).setParameterLength(0,2);class Mh extends js{static get type(){return"ViewportDepthNode"}constructor(e,t=null){super("float"),this.scope=e,this.valueNode=t,this.isViewportDepthNode=!0}generate(e){const{scope:t}=this;return t===Mh.DEPTH_BASE?e.getFragDepth():super.generate(e)}setup({camera:e}){const{scope:t}=this,r=this.valueNode;let s=null;if(t===Mh.DEPTH_BASE)null!==r&&(s=Ih().assign(r));else if(t===Mh.DEPTH)s=e.isPerspectiveCamera?Lh(Gl.z,ol,ul):Ph(Gl.z,ol,ul);else if(t===Mh.LINEAR_DEPTH)if(null!==r)if(e.isPerspectiveCamera){const e=Fh(r,ol,ul);s=Ph(e,ol,ul)}else s=r;else s=Ph(Gl.z,ol,ul);return s}}Mh.DEPTH_BASE="depthBase",Mh.DEPTH="depth",Mh.LINEAR_DEPTH="linearDepth";const Ph=(e,t,r)=>e.add(t).div(t.sub(r)),Lh=(e,t,r)=>t.add(e).mul(r).div(r.sub(t).mul(e)),Fh=(e,t,r)=>t.mul(r).div(r.sub(t).mul(e).sub(r)),Bh=(e,t,r)=>{t=t.max(1e-6).toVar();const s=ja(e.negate().div(t)),i=ja(r.div(t));return s.div(i)},Ih=Vi(Mh,Mh.DEPTH_BASE),Dh=Ui(Mh,Mh.DEPTH),Vh=Vi(Mh,Mh.LINEAR_DEPTH).setParameterLength(0,1),Uh=Vh(Ch());Dh.assign=e=>Ih(e);class Oh extends js{static get type(){return"ClippingNode"}constructor(e=Oh.DEFAULT){super(),this.scope=e}setup(e){super.setup(e);const t=e.clippingContext,{intersectionPlanes:r,unionPlanes:s}=t;return this.hardwareClipping=e.material.hardwareClipping,this.scope===Oh.ALPHA_TO_COVERAGE?this.setupAlphaToCoverage(r,s):this.scope===Oh.HARDWARE?this.setupHardwareClipping(s,e):this.setupDefault(r,s)}setupAlphaToCoverage(e,t){return ki((()=>{const r=ji().toVar("distanceToPlane"),s=ji().toVar("distanceToGradient"),i=ji(1).toVar("clipOpacity"),n=t.length;if(!1===this.hardwareClipping&&n>0){const e=il(t);Zc(n,(({i:t})=>{const n=e.element(t);r.assign(Gl.dot(n.xyz).negate().add(n.w)),s.assign(r.fwidth().div(2)),i.mulAssign(Oo(s.negate(),s,r))}))}const a=e.length;if(a>0){const t=il(e),n=ji(1).toVar("intersectionClipOpacity");Zc(a,(({i:e})=>{const i=t.element(e);r.assign(Gl.dot(i.xyz).negate().add(i.w)),s.assign(r.fwidth().div(2)),n.mulAssign(Oo(s.negate(),s,r).oneMinus())})),i.mulAssign(n.oneMinus())}yn.a.mulAssign(i),yn.a.equal(0).discard()}))()}setupDefault(e,t){return ki((()=>{const r=t.length;if(!1===this.hardwareClipping&&r>0){const e=il(t);Zc(r,(({i:t})=>{const r=e.element(t);Gl.dot(r.xyz).greaterThan(r.w).discard()}))}const s=e.length;if(s>0){const t=il(e),r=Ki(!0).toVar("clipped");Zc(s,(({i:e})=>{const s=t.element(e);r.assign(Gl.dot(s.xyz).greaterThan(s.w).and(r))})),r.discard()}}))()}setupHardwareClipping(e,t){const r=e.length;return t.enableHardwareClipping(r),ki((()=>{const s=il(e),i=nl(t.getClipDistance());Zc(r,(({i:e})=>{const t=s.element(e),r=Gl.dot(t.xyz).sub(t.w).negate();i.element(e).assign(r)}))}))()}}Oh.ALPHA_TO_COVERAGE="alphaToCoverage",Oh.DEFAULT="default",Oh.HARDWARE="hardware";const kh=ki((([e])=>Za(la(1e4,Ja(la(17,e.x).add(la(.1,e.y)))).mul(oa(.1,no(Ja(la(13,e.y).add(e.x)))))))),Gh=ki((([e])=>kh(Yi(kh(e.xy),e.z)))),zh=ki((([e])=>{const t=_o(oo(co(e.xyz)),oo(ho(e.xyz))),r=ji(1).div(ji(.05).mul(t)).toVar("pixScale"),s=Yi($a(Ka(ja(r))),$a(Ya(ja(r)))),i=Yi(Gh(Ka(s.x.mul(e.xyz))),Gh(Ka(s.y.mul(e.xyz)))),n=Za(ja(r)),a=oa(la(n.oneMinus(),i.x),la(n,i.y)),o=To(n,n.oneMinus()),u=en(a.mul(a).div(la(2,o).mul(ua(1,o))),a.sub(la(.5,o)).div(ua(1,o)),ua(1,ua(1,a).mul(ua(1,a)).div(la(2,o).mul(ua(1,o))))),l=a.lessThan(o.oneMinus()).select(a.lessThan(o).select(u.x,u.y),u.z);return Do(l,1e-6,1)})).setLayout({name:"getAlphaHashThreshold",type:"float",inputs:[{name:"position",type:"vec3"}]});class Hh extends zu{static get type(){return"VertexColorNode"}constructor(e){super(null,"vec4"),this.isVertexColorNode=!0,this.index=e}getAttributeName(){const e=this.index;return"color"+(e>0?e:"")}generate(e){const t=this.getAttributeName(e);let r;return r=!0===e.hasGeometryAttribute(t)?super.generate(e):e.generateConst(this.nodeType,new s(1,1,1,1)),r}serialize(e){super.serialize(e),e.index=this.index}deserialize(e){super.deserialize(e),this.index=e.index}}const $h=(e=0)=>Bi(new Hh(e)),Wh=ki((([e,t])=>To(1,e.oneMinus().div(t)).oneMinus())).setLayout({name:"blendBurn",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),jh=ki((([e,t])=>To(e.div(t.oneMinus()),1))).setLayout({name:"blendDodge",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),qh=ki((([e,t])=>e.oneMinus().mul(t.oneMinus()).oneMinus())).setLayout({name:"blendScreen",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),Xh=ki((([e,t])=>Io(e.mul(2).mul(t),e.oneMinus().mul(2).mul(t.oneMinus()).oneMinus(),vo(.5,e)))).setLayout({name:"blendOverlay",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),Kh=ki((([e,t])=>{const r=t.a.add(e.a.mul(t.a.oneMinus()));return nn(t.rgb.mul(t.a).add(e.rgb.mul(e.a).mul(t.a.oneMinus())).div(r),r)})).setLayout({name:"blendColor",type:"vec4",inputs:[{name:"base",type:"vec4"},{name:"blend",type:"vec4"}]}),Yh=ki((([e])=>nn(e.rgb.mul(e.a),e.a)),{color:"vec4",return:"vec4"}),Qh=ki((([e])=>(Hi(e.a.equal(0),(()=>nn(0))),nn(e.rgb.div(e.a),e.a))),{color:"vec4",return:"vec4"});class Zh extends U{static get type(){return"NodeMaterial"}get type(){return this.constructor.type}set type(e){}constructor(){super(),this.isNodeMaterial=!0,this.fog=!0,this.lights=!1,this.hardwareClipping=!1,this.lightsNode=null,this.envNode=null,this.aoNode=null,this.colorNode=null,this.normalNode=null,this.opacityNode=null,this.backdropNode=null,this.backdropAlphaNode=null,this.alphaTestNode=null,this.maskNode=null,this.positionNode=null,this.geometryNode=null,this.depthNode=null,this.receivedShadowPositionNode=null,this.castShadowPositionNode=null,this.receivedShadowNode=null,this.castShadowNode=null,this.outputNode=null,this.mrtNode=null,this.fragmentNode=null,this.vertexNode=null,Object.defineProperty(this,"shadowPositionNode",{get:()=>this.receivedShadowPositionNode,set:e=>{console.warn('THREE.NodeMaterial: ".shadowPositionNode" was renamed to ".receivedShadowPositionNode".'),this.receivedShadowPositionNode=e}})}customProgramCacheKey(){return this.type+_s(this)}build(e){this.setup(e)}setupObserver(e){return new fs(e)}setup(e){e.context.setupNormal=()=>this.setupNormal(e),e.context.setupPositionView=()=>this.setupPositionView(e),e.context.setupModelViewProjection=()=>this.setupModelViewProjection(e);const t=e.renderer,r=t.getRenderTarget();e.addStack();const s=this.setupVertex(e),i=this.vertexNode||s;let n;e.stack.outputNode=i,this.setupHardwareClipping(e),null!==this.geometryNode&&(e.stack.outputNode=e.stack.outputNode.bypass(this.geometryNode)),e.addFlow("vertex",e.removeStack()),e.addStack();const a=this.setupClipping(e);if(!0!==this.depthWrite&&!0!==this.depthTest||(null!==r?!0===r.depthBuffer&&this.setupDepth(e):!0===t.depth&&this.setupDepth(e)),null===this.fragmentNode){this.setupDiffuseColor(e),this.setupVariants(e);const s=this.setupLighting(e);null!==a&&e.stack.add(a);const i=nn(s,yn.a).max(0);n=this.setupOutput(e,i),In.assign(n);const o=null!==this.outputNode;if(o&&(n=this.outputNode),null!==r){const e=t.getMRT(),r=this.mrtNode;null!==e?(o&&In.assign(n),n=e,null!==r&&(n=e.merge(r))):null!==r&&(n=r)}}else{let t=this.fragmentNode;!0!==t.isOutputStructNode&&(t=nn(t)),n=this.setupOutput(e,t)}e.stack.outputNode=n,e.addFlow("fragment",e.removeStack()),e.observer=this.setupObserver(e)}setupClipping(e){if(null===e.clippingContext)return null;const{unionPlanes:t,intersectionPlanes:r}=e.clippingContext;let s=null;if(t.length>0||r.length>0){const t=e.renderer.samples;this.alphaToCoverage&&t>1?s=Bi(new Oh(Oh.ALPHA_TO_COVERAGE)):e.stack.add(Bi(new Oh))}return s}setupHardwareClipping(e){if(this.hardwareClipping=!1,null===e.clippingContext)return;const t=e.clippingContext.unionPlanes.length;t>0&&t<=8&&e.isAvailable("clipDistance")&&(e.stack.add(Bi(new Oh(Oh.HARDWARE))),this.hardwareClipping=!0)}setupDepth(e){const{renderer:t,camera:r}=e;let s=this.depthNode;if(null===s){const e=t.getMRT();e&&e.has("depth")?s=e.get("depth"):!0===t.logarithmicDepthBuffer&&(s=r.isPerspectiveCamera?Bh(Gl.z,ol,ul):Ph(Gl.z,ol,ul))}null!==s&&Dh.assign(s).toStack()}setupPositionView(){return Ll.mul(Vl).xyz}setupModelViewProjection(){return ll.mul(Gl)}setupVertex(e){return e.addStack(),this.setupPosition(e),e.context.vertex=e.removeStack(),Mc}setupPosition(e){const{object:t,geometry:r}=e;if((r.morphAttributes.position||r.morphAttributes.normal||r.morphAttributes.color)&&ih(t).toStack(),!0===t.isSkinnedMesh&&Yc(t).toStack(),this.displacementMap){const e=Td("displacementMap","texture"),t=Td("displacementScale","float"),r=Td("displacementBias","float");Vl.addAssign(ql.normalize().mul(e.x.mul(t).add(r)))}return t.isBatchedMesh&&Hc(t).toStack(),t.isInstancedMesh&&t.instanceMatrix&&!0===t.instanceMatrix.isInstancedBufferAttribute&&Gc(t).toStack(),null!==this.positionNode&&Vl.assign(Cu(this.positionNode,"POSITION")),Vl}setupDiffuseColor({object:e,geometry:t}){null!==this.maskNode&&Ki(this.maskNode).not().discard();let r=this.colorNode?nn(this.colorNode):qd;if(!0===this.vertexColors&&t.hasAttribute("color")&&(r=r.mul($h())),e.instanceColor){r=fn("vec3","vInstanceColor").mul(r)}if(e.isBatchedMesh&&e._colorsTexture){r=fn("vec3","vBatchColor").mul(r)}yn.assign(r);const s=this.opacityNode?ji(this.opacityNode):Yd;yn.a.assign(yn.a.mul(s));let i=null;(null!==this.alphaTestNode||this.alphaTest>0)&&(i=null!==this.alphaTestNode?ji(this.alphaTestNode):jd,yn.a.lessThanEqual(i).discard()),!0===this.alphaHash&&yn.a.lessThan(zh(Vl)).discard();!1===this.transparent&&this.blending===O&&!1===this.alphaToCoverage?yn.a.assign(1):null===i&&yn.a.lessThanEqual(0).discard()}setupVariants(){}setupOutgoingLight(){return!0===this.lights?en(0):yn.rgb}setupNormal(){return this.normalNode?en(this.normalNode):ic}setupEnvironment(){let e=null;return this.envNode?e=this.envNode:this.envMap&&(e=this.envMap.isCubeTexture?Td("envMap","cubeTexture"):Td("envMap","texture")),e}setupLightMap(e){let t=null;return e.material.lightMap&&(t=new lh(Ac)),t}setupLights(e){const t=[],r=this.setupEnvironment(e);r&&r.isLightingNode&&t.push(r);const s=this.setupLightMap(e);if(s&&s.isLightingNode&&t.push(s),null!==this.aoNode||e.material.aoMap){const e=null!==this.aoNode?this.aoNode:Rc;t.push(new ah(e))}let i=this.lightsNode||e.lightsNode;return t.length>0&&(i=e.renderer.lighting.createNode([...i.getLights(),...t])),i}setupLightingModel(){}setupLighting(e){const{material:t}=e,{backdropNode:r,backdropAlphaNode:s,emissiveNode:i}=this,n=!0===this.lights||null!==this.lightsNode?this.setupLights(e):null;let a=this.setupOutgoingLight(e);if(n&&n.getScope().hasLights){const t=this.setupLightingModel(e)||null;a=uh(n,t,r,s)}else null!==r&&(a=en(null!==s?Io(a,r,s):r));return(i&&!0===i.isNode||t.emissive&&!0===t.emissive.isColor)&&(bn.assign(en(i||Kd)),a=a.add(bn)),a}setupFog(e,t){const r=e.fogNode;return r&&(In.assign(t),t=nn(r)),t}setupPremultipliedAlpha(e,t){return Yh(t)}setupOutput(e,t){return!0===this.fog&&(t=this.setupFog(e,t)),!0===this.premultipliedAlpha&&(t=this.setupPremultipliedAlpha(e,t)),t}setDefaultValues(e){for(const t in e){const r=e[t];void 0===this[t]&&(this[t]=r,r&&r.clone&&(this[t]=r.clone()))}const t=Object.getOwnPropertyDescriptors(e.constructor.prototype);for(const e in t)void 0===Object.getOwnPropertyDescriptor(this.constructor.prototype,e)&&void 0!==t[e].get&&Object.defineProperty(this.constructor.prototype,e,t[e])}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{},nodes:{}});const r=U.prototype.toJSON.call(this,e),s=vs(this);r.inputNodes={};for(const{property:t,childNode:i}of s)r.inputNodes[t]=i.toJSON(e).uuid;function i(e){const t=[];for(const r in e){const s=e[r];delete s.metadata,t.push(s)}return t}if(t){const t=i(e.textures),s=i(e.images),n=i(e.nodes);t.length>0&&(r.textures=t),s.length>0&&(r.images=s),n.length>0&&(r.nodes=n)}return r}copy(e){return this.lightsNode=e.lightsNode,this.envNode=e.envNode,this.colorNode=e.colorNode,this.normalNode=e.normalNode,this.opacityNode=e.opacityNode,this.backdropNode=e.backdropNode,this.backdropAlphaNode=e.backdropAlphaNode,this.alphaTestNode=e.alphaTestNode,this.maskNode=e.maskNode,this.positionNode=e.positionNode,this.geometryNode=e.geometryNode,this.depthNode=e.depthNode,this.receivedShadowPositionNode=e.receivedShadowPositionNode,this.castShadowPositionNode=e.castShadowPositionNode,this.receivedShadowNode=e.receivedShadowNode,this.castShadowNode=e.castShadowNode,this.outputNode=e.outputNode,this.mrtNode=e.mrtNode,this.fragmentNode=e.fragmentNode,this.vertexNode=e.vertexNode,super.copy(e)}}const Jh=new k;class ep extends Zh{static get type(){return"LineBasicNodeMaterial"}constructor(e){super(),this.isLineBasicNodeMaterial=!0,this.setDefaultValues(Jh),this.setValues(e)}}const tp=new G;class rp extends Zh{static get type(){return"LineDashedNodeMaterial"}constructor(e){super(),this.isLineDashedNodeMaterial=!0,this.setDefaultValues(tp),this.dashOffset=0,this.offsetNode=null,this.dashScaleNode=null,this.dashSizeNode=null,this.gapSizeNode=null,this.setValues(e)}setupVariants(){const e=this.offsetNode?ji(this.offsetNode):Sc,t=this.dashScaleNode?ji(this.dashScaleNode):Tc,r=this.dashSizeNode?ji(this.dashSizeNode):_c,s=this.gapSizeNode?ji(this.gapSizeNode):vc;Dn.assign(r),Vn.assign(s);const i=nu(Hu("lineDistance").mul(t));(e?i.add(e):i).mod(Dn.add(Vn)).greaterThan(Dn).discard()}}let sp=null;class ip extends Sh{static get type(){return"ViewportSharedTextureNode"}constructor(e=ph,t=null){null===sp&&(sp=new I),super(e,t,sp)}updateReference(){return this}}const np=Vi(ip).setParameterLength(0,2),ap=new G;class op extends Zh{static get type(){return"Line2NodeMaterial"}constructor(e={}){super(),this.isLine2NodeMaterial=!0,this.setDefaultValues(ap),this.useColor=e.vertexColors,this.dashOffset=0,this.lineWidth=1,this.lineColorNode=null,this.offsetNode=null,this.dashScaleNode=null,this.dashSizeNode=null,this.gapSizeNode=null,this.blending=z,this._useDash=e.dashed,this._useAlphaToCoverage=!0,this._useWorldUnits=!1,this.setValues(e)}setup(e){const{renderer:t}=e,r=this._useAlphaToCoverage,s=this.useColor,i=this._useDash,n=this._useWorldUnits,a=ki((({start:e,end:t})=>{const r=ll.element(2).element(2),s=ll.element(3).element(2).mul(-.5).div(r).sub(e.z).div(t.z.sub(e.z));return nn(Io(e.xyz,t.xyz,s),t.w)})).setLayout({name:"trimSegment",type:"vec4",inputs:[{name:"start",type:"vec4"},{name:"end",type:"vec4"}]});this.vertexNode=ki((()=>{const e=Hu("instanceStart"),t=Hu("instanceEnd"),r=nn(Ll.mul(nn(e,1))).toVar("start"),s=nn(Ll.mul(nn(t,1))).toVar("end");if(i){const e=this.dashScaleNode?ji(this.dashScaleNode):Tc,t=this.offsetNode?ji(this.offsetNode):Sc,r=Hu("instanceDistanceStart"),s=Hu("instanceDistanceEnd");let i=Dl.y.lessThan(.5).select(e.mul(r),e.mul(s));i=i.add(t),fn("float","lineDistance").assign(i)}n&&(fn("vec3","worldStart").assign(r.xyz),fn("vec3","worldEnd").assign(s.xyz));const o=fh.z.div(fh.w),u=ll.element(2).element(3).equal(-1);Hi(u,(()=>{Hi(r.z.lessThan(0).and(s.z.greaterThan(0)),(()=>{s.assign(a({start:r,end:s}))})).ElseIf(s.z.lessThan(0).and(r.z.greaterThanEqual(0)),(()=>{r.assign(a({start:s,end:r}))}))}));const l=ll.mul(r),d=ll.mul(s),c=l.xyz.div(l.w),h=d.xyz.div(d.w),p=h.xy.sub(c.xy).toVar();p.x.assign(p.x.mul(o)),p.assign(p.normalize());const g=nn().toVar();if(n){const e=s.xyz.sub(r.xyz).normalize(),t=Io(r.xyz,s.xyz,.5).normalize(),n=e.cross(t).normalize(),a=e.cross(n),o=fn("vec4","worldPos");o.assign(Dl.y.lessThan(.5).select(r,s));const u=Nc.mul(.5);o.addAssign(nn(Dl.x.lessThan(0).select(n.mul(u),n.mul(u).negate()),0)),i||(o.addAssign(nn(Dl.y.lessThan(.5).select(e.mul(u).negate(),e.mul(u)),0)),o.addAssign(nn(a.mul(u),0)),Hi(Dl.y.greaterThan(1).or(Dl.y.lessThan(0)),(()=>{o.subAssign(nn(a.mul(2).mul(u),0))}))),g.assign(ll.mul(o));const l=en().toVar();l.assign(Dl.y.lessThan(.5).select(c,h)),g.z.assign(l.z.mul(g.w))}else{const e=Yi(p.y,p.x.negate()).toVar("offset");p.x.assign(p.x.div(o)),e.x.assign(e.x.div(o)),e.assign(Dl.x.lessThan(0).select(e.negate(),e)),Hi(Dl.y.lessThan(0),(()=>{e.assign(e.sub(p))})).ElseIf(Dl.y.greaterThan(1),(()=>{e.assign(e.add(p))})),e.assign(e.mul(Nc)),e.assign(e.div(fh.w)),g.assign(Dl.y.lessThan(.5).select(l,d)),e.assign(e.mul(g.w)),g.assign(g.add(nn(e,0,0)))}return g}))();const o=ki((({p1:e,p2:t,p3:r,p4:s})=>{const i=e.sub(r),n=s.sub(r),a=t.sub(e),o=i.dot(n),u=n.dot(a),l=i.dot(a),d=n.dot(n),c=a.dot(a).mul(d).sub(u.mul(u)),h=o.mul(u).sub(l.mul(d)).div(c).clamp(),p=o.add(u.mul(h)).div(d).clamp();return Yi(h,p)}));if(this.colorNode=ki((()=>{const e=$u();if(i){const t=this.dashSizeNode?ji(this.dashSizeNode):_c,r=this.gapSizeNode?ji(this.gapSizeNode):vc;Dn.assign(t),Vn.assign(r);const s=fn("float","lineDistance");e.y.lessThan(-1).or(e.y.greaterThan(1)).discard(),s.mod(Dn.add(Vn)).greaterThan(Dn).discard()}const a=ji(1).toVar("alpha");if(n){const e=fn("vec3","worldStart"),s=fn("vec3","worldEnd"),n=fn("vec4","worldPos").xyz.normalize().mul(1e5),u=s.sub(e),l=o({p1:e,p2:s,p3:en(0,0,0),p4:n}),d=e.add(u.mul(l.x)),c=n.mul(l.y),h=d.sub(c).length().div(Nc);if(!i)if(r&&t.samples>1){const e=h.fwidth();a.assign(Oo(e.negate().add(.5),e.add(.5),h).oneMinus())}else h.greaterThan(.5).discard()}else if(r&&t.samples>1){const t=e.x,r=e.y.greaterThan(0).select(e.y.sub(1),e.y.add(1)),s=t.mul(t).add(r.mul(r)),i=ji(s.fwidth()).toVar("dlen");Hi(e.y.abs().greaterThan(1),(()=>{a.assign(Oo(i.oneMinus(),i.add(1),s).oneMinus())}))}else Hi(e.y.abs().greaterThan(1),(()=>{const t=e.x,r=e.y.greaterThan(0).select(e.y.sub(1),e.y.add(1));t.mul(t).add(r.mul(r)).greaterThan(1).discard()}));let u;if(this.lineColorNode)u=this.lineColorNode;else if(s){const e=Hu("instanceColorStart"),t=Hu("instanceColorEnd");u=Dl.y.lessThan(.5).select(e,t).mul(qd)}else u=qd;return nn(u,a)}))(),this.transparent){const e=this.opacityNode?ji(this.opacityNode):Yd;this.outputNode=nn(this.colorNode.rgb.mul(e).add(np().rgb.mul(e.oneMinus())),this.colorNode.a)}super.setup(e)}get worldUnits(){return this._useWorldUnits}set worldUnits(e){this._useWorldUnits!==e&&(this._useWorldUnits=e,this.needsUpdate=!0)}get dashed(){return this._useDash}set dashed(e){this._useDash!==e&&(this._useDash=e,this.needsUpdate=!0)}get alphaToCoverage(){return this._useAlphaToCoverage}set alphaToCoverage(e){this._useAlphaToCoverage!==e&&(this._useAlphaToCoverage=e,this.needsUpdate=!0)}}const up=e=>Bi(e).mul(.5).add(.5),lp=new H;class dp extends Zh{static get type(){return"MeshNormalNodeMaterial"}constructor(e){super(),this.isMeshNormalNodeMaterial=!0,this.setDefaultValues(lp),this.setValues(e)}setupDiffuseColor(){const e=this.opacityNode?ji(this.opacityNode):Yd;yn.assign(hu(nn(up(Ql),e),$))}}class cp extends Ks{static get type(){return"EquirectUVNode"}constructor(e=kl){super("vec2"),this.dirNode=e}setup(){const e=this.dirNode,t=e.z.atan(e.x).mul(1/(2*Math.PI)).add(.5),r=e.y.clamp(-1,1).asin().mul(1/Math.PI).add(.5);return Yi(t,r)}}const hp=Vi(cp).setParameterLength(0,1);class pp extends W{constructor(e=1,t={}){super(e,t),this.isCubeRenderTarget=!0}fromEquirectangularTexture(e,t){const r=t.minFilter,s=t.generateMipmaps;t.generateMipmaps=!0,this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i=new j(5,5,5),n=hp(kl),a=new Zh;a.colorNode=Zu(t,n,0),a.side=S,a.blending=z;const o=new q(i,a),u=new X;u.add(o),t.minFilter===D&&(t.minFilter=K);const l=new Y(1,10,this),d=e.getMRT();return e.setMRT(null),l.update(e,u),e.setMRT(d),t.minFilter=r,t.currentGenerateMipmaps=s,o.geometry.dispose(),o.material.dispose(),this}}const gp=new WeakMap;class mp extends Ks{static get type(){return"CubeMapNode"}constructor(e){super("vec3"),this.envNode=e,this._cubeTexture=null,this._cubeTextureNode=gd(null);const t=new w;t.isRenderTargetTexture=!0,this._defaultTexture=t,this.updateBeforeType=Vs.RENDER}updateBefore(e){const{renderer:t,material:r}=e,s=this.envNode;if(s.isTextureNode||s.isMaterialReferenceNode){const e=s.isTextureNode?s.value:r[s.property];if(e&&e.isTexture){const r=e.mapping;if(r===Q||r===Z){if(gp.has(e)){const t=gp.get(e);yp(t,e.mapping),this._cubeTexture=t}else{const r=e.image;if(function(e){return null!=e&&e.height>0}(r)){const s=new pp(r.height);s.fromEquirectangularTexture(t,e),yp(s.texture,e.mapping),this._cubeTexture=s.texture,gp.set(e,s.texture),e.addEventListener("dispose",fp)}else this._cubeTexture=this._defaultTexture}this._cubeTextureNode.value=this._cubeTexture}else this._cubeTextureNode=this.envNode}}}setup(e){return this.updateBefore(e),this._cubeTextureNode}}function fp(e){const t=e.target;t.removeEventListener("dispose",fp);const r=gp.get(t);void 0!==r&&(gp.delete(t),r.dispose())}function yp(e,t){t===Q?e.mapping=A:t===Z&&(e.mapping=R)}const bp=Vi(mp).setParameterLength(1);class xp extends nh{static get type(){return"BasicEnvironmentNode"}constructor(e=null){super(),this.envNode=e}setup(e){e.context.environment=bp(this.envNode)}}class Tp extends nh{static get type(){return"BasicLightMapNode"}constructor(e=null){super(),this.lightMapNode=e}setup(e){const t=ji(1/Math.PI);e.context.irradianceLightMap=this.lightMapNode.mul(t)}}class _p{start(e){e.lightsNode.setupLights(e,e.lightsNode.getLightNodes(e)),this.indirect(e)}finish(){}direct(){}directRectArea(){}indirect(){}ambientOcclusion(){}}class vp extends _p{constructor(){super()}indirect({context:e}){const t=e.ambientOcclusion,r=e.reflectedLight,s=e.irradianceLightMap;r.indirectDiffuse.assign(nn(0)),s?r.indirectDiffuse.addAssign(s):r.indirectDiffuse.addAssign(nn(1,1,1,0)),r.indirectDiffuse.mulAssign(t),r.indirectDiffuse.mulAssign(yn.rgb)}finish(e){const{material:t,context:r}=e,s=r.outgoingLight,i=e.context.environment;if(i)switch(t.combine){case te:s.rgb.assign(Io(s.rgb,s.rgb.mul(i.rgb),ec.mul(tc)));break;case ee:s.rgb.assign(Io(s.rgb,i.rgb,ec.mul(tc)));break;case J:s.rgb.addAssign(i.rgb.mul(ec.mul(tc)));break;default:console.warn("THREE.BasicLightingModel: Unsupported .combine value:",t.combine)}}}const Np=new re;class Sp extends Zh{static get type(){return"MeshBasicNodeMaterial"}constructor(e){super(),this.isMeshBasicNodeMaterial=!0,this.lights=!0,this.setDefaultValues(Np),this.setValues(e)}setupNormal(){return Kl}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new xp(t):null}setupLightMap(e){let t=null;return e.material.lightMap&&(t=new Tp(Ac)),t}setupOutgoingLight(){return yn.rgb}setupLightingModel(){return new vp}}const Ep=ki((({f0:e,f90:t,dotVH:r})=>{const s=r.mul(-5.55473).sub(6.98316).mul(r).exp2();return e.mul(s.oneMinus()).add(t.mul(s))})),wp=ki((e=>e.diffuseColor.mul(1/Math.PI))),Ap=ki((({dotNH:e})=>Bn.mul(ji(.5)).add(1).mul(ji(1/Math.PI)).mul(e.pow(Bn)))),Rp=ki((({lightDirection:e})=>{const t=e.add(zl).normalize(),r=Ql.dot(t).clamp(),s=zl.dot(t).clamp(),i=Ep({f0:Ln,f90:1,dotVH:s}),n=ji(.25),a=Ap({dotNH:r});return i.mul(n).mul(a)}));class Cp extends vp{constructor(e=!0){super(),this.specular=e}direct({lightDirection:e,lightColor:t,reflectedLight:r}){const s=Ql.dot(e).clamp().mul(t);r.directDiffuse.addAssign(s.mul(wp({diffuseColor:yn.rgb}))),!0===this.specular&&r.directSpecular.addAssign(s.mul(Rp({lightDirection:e})).mul(ec))}indirect(e){const{ambientOcclusion:t,irradiance:r,reflectedLight:s}=e.context;s.indirectDiffuse.addAssign(r.mul(wp({diffuseColor:yn}))),s.indirectDiffuse.mulAssign(t)}}const Mp=new se;class Pp extends Zh{static get type(){return"MeshLambertNodeMaterial"}constructor(e){super(),this.isMeshLambertNodeMaterial=!0,this.lights=!0,this.setDefaultValues(Mp),this.setValues(e)}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new xp(t):null}setupLightingModel(){return new Cp(!1)}}const Lp=new ie;class Fp extends Zh{static get type(){return"MeshPhongNodeMaterial"}constructor(e){super(),this.isMeshPhongNodeMaterial=!0,this.lights=!0,this.shininessNode=null,this.specularNode=null,this.setDefaultValues(Lp),this.setValues(e)}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new xp(t):null}setupLightingModel(){return new Cp}setupVariants(){const e=(this.shininessNode?ji(this.shininessNode):Xd).max(1e-4);Bn.assign(e);const t=this.specularNode||Qd;Ln.assign(t)}copy(e){return this.shininessNode=e.shininessNode,this.specularNode=e.specularNode,super.copy(e)}}const Bp=ki((e=>{if(!1===e.geometry.hasAttribute("normal"))return ji(0);const t=Kl.dFdx().abs().max(Kl.dFdy().abs());return t.x.max(t.y).max(t.z)})),Ip=ki((e=>{const{roughness:t}=e,r=Bp();let s=t.max(.0525);return s=s.add(r),s=s.min(1),s})),Dp=ki((({alpha:e,dotNL:t,dotNV:r})=>{const s=e.pow2(),i=t.mul(s.add(s.oneMinus().mul(r.pow2())).sqrt()),n=r.mul(s.add(s.oneMinus().mul(t.pow2())).sqrt());return da(.5,i.add(n).max(Ia))})).setLayout({name:"V_GGX_SmithCorrelated",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNL",type:"float"},{name:"dotNV",type:"float"}]}),Vp=ki((({alphaT:e,alphaB:t,dotTV:r,dotBV:s,dotTL:i,dotBL:n,dotNV:a,dotNL:o})=>{const u=o.mul(en(e.mul(r),t.mul(s),a).length()),l=a.mul(en(e.mul(i),t.mul(n),o).length());return da(.5,u.add(l)).saturate()})).setLayout({name:"V_GGX_SmithCorrelated_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotTV",type:"float",qualifier:"in"},{name:"dotBV",type:"float",qualifier:"in"},{name:"dotTL",type:"float",qualifier:"in"},{name:"dotBL",type:"float",qualifier:"in"},{name:"dotNV",type:"float",qualifier:"in"},{name:"dotNL",type:"float",qualifier:"in"}]}),Up=ki((({alpha:e,dotNH:t})=>{const r=e.pow2(),s=t.pow2().mul(r.oneMinus()).oneMinus();return r.div(s.pow2()).mul(1/Math.PI)})).setLayout({name:"D_GGX",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNH",type:"float"}]}),Op=ji(1/Math.PI),kp=ki((({alphaT:e,alphaB:t,dotNH:r,dotTH:s,dotBH:i})=>{const n=e.mul(t),a=en(t.mul(s),e.mul(i),n.mul(r)),o=a.dot(a),u=n.div(o);return Op.mul(n.mul(u.pow2()))})).setLayout({name:"D_GGX_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotNH",type:"float",qualifier:"in"},{name:"dotTH",type:"float",qualifier:"in"},{name:"dotBH",type:"float",qualifier:"in"}]}),Gp=ki((e=>{const{lightDirection:t,f0:r,f90:s,roughness:i,f:n,USE_IRIDESCENCE:a,USE_ANISOTROPY:o}=e,u=e.normalView||Ql,l=i.pow2(),d=t.add(zl).normalize(),c=u.dot(t).clamp(),h=u.dot(zl).clamp(),p=u.dot(d).clamp(),g=zl.dot(d).clamp();let m,f,y=Ep({f0:r,f90:s,dotVH:g});if(Pi(a)&&(y=En.mix(y,n)),Pi(o)){const e=Mn.dot(t),r=Mn.dot(zl),s=Mn.dot(d),i=Pn.dot(t),n=Pn.dot(zl),a=Pn.dot(d);m=Vp({alphaT:Rn,alphaB:l,dotTV:r,dotBV:n,dotTL:e,dotBL:i,dotNV:h,dotNL:c}),f=kp({alphaT:Rn,alphaB:l,dotNH:p,dotTH:s,dotBH:a})}else m=Dp({alpha:l,dotNL:c,dotNV:h}),f=Up({alpha:l,dotNH:p});return y.mul(m).mul(f)})),zp=ki((({roughness:e,dotNV:t})=>{const r=nn(-1,-.0275,-.572,.022),s=nn(1,.0425,1.04,-.04),i=e.mul(r).add(s),n=i.x.mul(i.x).min(t.mul(-9.28).exp2()).mul(i.x).add(i.y);return Yi(-1.04,1.04).mul(n).add(i.zw)})).setLayout({name:"DFGApprox",type:"vec2",inputs:[{name:"roughness",type:"float"},{name:"dotNV",type:"vec3"}]}),Hp=ki((e=>{const{dotNV:t,specularColor:r,specularF90:s,roughness:i}=e,n=zp({dotNV:t,roughness:i});return r.mul(n.x).add(s.mul(n.y))})),$p=ki((({f:e,f90:t,dotVH:r})=>{const s=r.oneMinus().saturate(),i=s.mul(s),n=s.mul(i,i).clamp(0,.9999);return e.sub(en(t).mul(n)).div(n.oneMinus())})).setLayout({name:"Schlick_to_F0",type:"vec3",inputs:[{name:"f",type:"vec3"},{name:"f90",type:"float"},{name:"dotVH",type:"float"}]}),Wp=ki((({roughness:e,dotNH:t})=>{const r=e.pow2(),s=ji(1).div(r),i=t.pow2().oneMinus().max(.0078125);return ji(2).add(s).mul(i.pow(s.mul(.5))).div(2*Math.PI)})).setLayout({name:"D_Charlie",type:"float",inputs:[{name:"roughness",type:"float"},{name:"dotNH",type:"float"}]}),jp=ki((({dotNV:e,dotNL:t})=>ji(1).div(ji(4).mul(t.add(e).sub(t.mul(e)))))).setLayout({name:"V_Neubelt",type:"float",inputs:[{name:"dotNV",type:"float"},{name:"dotNL",type:"float"}]}),qp=ki((({lightDirection:e})=>{const t=e.add(zl).normalize(),r=Ql.dot(e).clamp(),s=Ql.dot(zl).clamp(),i=Ql.dot(t).clamp(),n=Wp({roughness:Sn,dotNH:i}),a=jp({dotNV:s,dotNL:r});return Nn.mul(n).mul(a)})),Xp=ki((({N:e,V:t,roughness:r})=>{const s=e.dot(t).saturate(),i=Yi(r,s.oneMinus().sqrt());return i.assign(i.mul(.984375).add(.0078125)),i})).setLayout({name:"LTC_Uv",type:"vec2",inputs:[{name:"N",type:"vec3"},{name:"V",type:"vec3"},{name:"roughness",type:"float"}]}),Kp=ki((({f:e})=>{const t=e.length();return _o(t.mul(t).add(e.z).div(t.add(1)),0)})).setLayout({name:"LTC_ClippedSphereFormFactor",type:"float",inputs:[{name:"f",type:"vec3"}]}),Yp=ki((({v1:e,v2:t})=>{const r=e.dot(t),s=r.abs().toVar(),i=s.mul(.0145206).add(.4965155).mul(s).add(.8543985).toVar(),n=s.add(4.1616724).mul(s).add(3.417594).toVar(),a=i.div(n),o=r.greaterThan(0).select(a,_o(r.mul(r).oneMinus(),1e-7).inverseSqrt().mul(.5).sub(a));return e.cross(t).mul(o)})).setLayout({name:"LTC_EdgeVectorFormFactor",type:"vec3",inputs:[{name:"v1",type:"vec3"},{name:"v2",type:"vec3"}]}),Qp=ki((({N:e,V:t,P:r,mInv:s,p0:i,p1:n,p2:a,p3:o})=>{const u=n.sub(i).toVar(),l=o.sub(i).toVar(),d=u.cross(l),c=en().toVar();return Hi(d.dot(r.sub(i)).greaterThanEqual(0),(()=>{const u=t.sub(e.mul(t.dot(e))).normalize(),l=e.cross(u).negate(),d=s.mul(dn(u,l,e).transpose()).toVar(),h=d.mul(i.sub(r)).normalize().toVar(),p=d.mul(n.sub(r)).normalize().toVar(),g=d.mul(a.sub(r)).normalize().toVar(),m=d.mul(o.sub(r)).normalize().toVar(),f=en(0).toVar();f.addAssign(Yp({v1:h,v2:p})),f.addAssign(Yp({v1:p,v2:g})),f.addAssign(Yp({v1:g,v2:m})),f.addAssign(Yp({v1:m,v2:h})),c.assign(en(Kp({f:f})))})),c})).setLayout({name:"LTC_Evaluate",type:"vec3",inputs:[{name:"N",type:"vec3"},{name:"V",type:"vec3"},{name:"P",type:"vec3"},{name:"mInv",type:"mat3"},{name:"p0",type:"vec3"},{name:"p1",type:"vec3"},{name:"p2",type:"vec3"},{name:"p3",type:"vec3"}]}),Zp=ki((({P:e,p0:t,p1:r,p2:s,p3:i})=>{const n=r.sub(t).toVar(),a=i.sub(t).toVar(),o=n.cross(a),u=en().toVar();return Hi(o.dot(e.sub(t)).greaterThanEqual(0),(()=>{const n=t.sub(e).normalize().toVar(),a=r.sub(e).normalize().toVar(),o=s.sub(e).normalize().toVar(),l=i.sub(e).normalize().toVar(),d=en(0).toVar();d.addAssign(Yp({v1:n,v2:a})),d.addAssign(Yp({v1:a,v2:o})),d.addAssign(Yp({v1:o,v2:l})),d.addAssign(Yp({v1:l,v2:n})),u.assign(en(Kp({f:d.abs()})))})),u})).setLayout({name:"LTC_Evaluate",type:"vec3",inputs:[{name:"P",type:"vec3"},{name:"p0",type:"vec3"},{name:"p1",type:"vec3"},{name:"p2",type:"vec3"},{name:"p3",type:"vec3"}]}),Jp=1/6,eg=e=>la(Jp,la(e,la(e,e.negate().add(3)).sub(3)).add(1)),tg=e=>la(Jp,la(e,la(e,la(3,e).sub(6))).add(4)),rg=e=>la(Jp,la(e,la(e,la(-3,e).add(3)).add(3)).add(1)),sg=e=>la(Jp,Ro(e,3)),ig=e=>eg(e).add(tg(e)),ng=e=>rg(e).add(sg(e)),ag=e=>oa(-1,tg(e).div(eg(e).add(tg(e)))),og=e=>oa(1,sg(e).div(rg(e).add(sg(e)))),ug=(e,t,r)=>{const s=e.uvNode,i=la(s,t.zw).add(.5),n=Ka(i),a=Za(i),o=ig(a.x),u=ng(a.x),l=ag(a.x),d=og(a.x),c=ag(a.y),h=og(a.y),p=Yi(n.x.add(l),n.y.add(c)).sub(.5).mul(t.xy),g=Yi(n.x.add(d),n.y.add(c)).sub(.5).mul(t.xy),m=Yi(n.x.add(l),n.y.add(h)).sub(.5).mul(t.xy),f=Yi(n.x.add(d),n.y.add(h)).sub(.5).mul(t.xy),y=ig(a.y).mul(oa(o.mul(e.sample(p).level(r)),u.mul(e.sample(g).level(r)))),b=ng(a.y).mul(oa(o.mul(e.sample(m).level(r)),u.mul(e.sample(f).level(r))));return y.add(b)},lg=ki((([e,t=ji(3)])=>{const r=Yi(e.size(qi(t))),s=Yi(e.size(qi(t.add(1)))),i=da(1,r),n=da(1,s),a=ug(e,nn(i,r),Ka(t)),o=ug(e,nn(n,s),Ya(t));return Za(t).mix(a,o)})),dg=ki((([e,t,r,s,i])=>{const n=en(Uo(t.negate(),Qa(e),da(1,s))),a=en(oo(i[0].xyz),oo(i[1].xyz),oo(i[2].xyz));return Qa(n).mul(r.mul(a))})).setLayout({name:"getVolumeTransmissionRay",type:"vec3",inputs:[{name:"n",type:"vec3"},{name:"v",type:"vec3"},{name:"thickness",type:"float"},{name:"ior",type:"float"},{name:"modelMatrix",type:"mat4"}]}),cg=ki((([e,t])=>e.mul(Do(t.mul(2).sub(2),0,1)))).setLayout({name:"applyIorToRoughness",type:"float",inputs:[{name:"roughness",type:"float"},{name:"ior",type:"float"}]}),hg=wh(),pg=wh(),gg=ki((([e,t,r],{material:s})=>{const i=(s.side===S?hg:pg).sample(e),n=ja(gh.x).mul(cg(t,r));return lg(i,n)})),mg=ki((([e,t,r])=>(Hi(r.notEqual(0),(()=>{const s=Wa(t).negate().div(r);return Ha(s.negate().mul(e))})),en(1)))).setLayout({name:"volumeAttenuation",type:"vec3",inputs:[{name:"transmissionDistance",type:"float"},{name:"attenuationColor",type:"vec3"},{name:"attenuationDistance",type:"float"}]}),fg=ki((([e,t,r,s,i,n,a,o,u,l,d,c,h,p,g])=>{let m,f;if(g){m=nn().toVar(),f=en().toVar();const i=d.sub(1).mul(g.mul(.025)),n=en(d.sub(i),d,d.add(i));Zc({start:0,end:3},(({i:i})=>{const d=n.element(i),g=dg(e,t,c,d,o),y=a.add(g),b=l.mul(u.mul(nn(y,1))),x=Yi(b.xy.div(b.w)).toVar();x.addAssign(1),x.divAssign(2),x.assign(Yi(x.x,x.y.oneMinus()));const T=gg(x,r,d);m.element(i).assign(T.element(i)),m.a.addAssign(T.a),f.element(i).assign(s.element(i).mul(mg(oo(g),h,p).element(i)))})),m.a.divAssign(3)}else{const i=dg(e,t,c,d,o),n=a.add(i),g=l.mul(u.mul(nn(n,1))),y=Yi(g.xy.div(g.w)).toVar();y.addAssign(1),y.divAssign(2),y.assign(Yi(y.x,y.y.oneMinus())),m=gg(y,r,d),f=s.mul(mg(oo(i),h,p))}const y=f.rgb.mul(m.rgb),b=e.dot(t).clamp(),x=en(Hp({dotNV:b,specularColor:i,specularF90:n,roughness:r})),T=f.r.add(f.g,f.b).div(3);return nn(x.oneMinus().mul(y),m.a.oneMinus().mul(T).oneMinus())})),yg=dn(3.2404542,-.969266,.0556434,-1.5371385,1.8760108,-.2040259,-.4985314,.041556,1.0572252),bg=(e,t)=>e.sub(t).div(e.add(t)).pow2(),xg=ki((({outsideIOR:e,eta2:t,cosTheta1:r,thinFilmThickness:s,baseF0:i})=>{const n=Io(e,t,Oo(0,.03,s)),a=e.div(n).pow2().mul(r.pow2().oneMinus()).oneMinus();Hi(a.lessThan(0),(()=>en(1)));const o=a.sqrt(),u=bg(n,e),l=Ep({f0:u,f90:1,dotVH:r}),d=l.oneMinus(),c=n.lessThan(e).select(Math.PI,0),h=ji(Math.PI).sub(c),p=(e=>{const t=e.sqrt();return en(1).add(t).div(en(1).sub(t))})(i.clamp(0,.9999)),g=bg(p,n.toVec3()),m=Ep({f0:g,f90:1,dotVH:o}),f=en(p.x.lessThan(n).select(Math.PI,0),p.y.lessThan(n).select(Math.PI,0),p.z.lessThan(n).select(Math.PI,0)),y=n.mul(s,o,2),b=en(h).add(f),x=l.mul(m).clamp(1e-5,.9999),T=x.sqrt(),_=d.pow2().mul(m).div(en(1).sub(x)),v=l.add(_).toVar(),N=_.sub(d).toVar();return Zc({start:1,end:2,condition:"<=",name:"m"},(({m:e})=>{N.mulAssign(T);const t=((e,t)=>{const r=e.mul(2*Math.PI*1e-9),s=en(54856e-17,44201e-17,52481e-17),i=en(1681e3,1795300,2208400),n=en(43278e5,93046e5,66121e5),a=ji(9747e-17*Math.sqrt(2*Math.PI*45282e5)).mul(r.mul(2239900).add(t.x).cos()).mul(r.pow2().mul(-45282e5).exp());let o=s.mul(n.mul(2*Math.PI).sqrt()).mul(i.mul(r).add(t).cos()).mul(r.pow2().negate().mul(n).exp());return o=en(o.x.add(a),o.y,o.z).div(1.0685e-7),yg.mul(o)})(ji(e).mul(y),ji(e).mul(b)).mul(2);v.addAssign(N.mul(t))})),v.max(en(0))})).setLayout({name:"evalIridescence",type:"vec3",inputs:[{name:"outsideIOR",type:"float"},{name:"eta2",type:"float"},{name:"cosTheta1",type:"float"},{name:"thinFilmThickness",type:"float"},{name:"baseF0",type:"vec3"}]}),Tg=ki((({normal:e,viewDir:t,roughness:r})=>{const s=e.dot(t).saturate(),i=r.pow2(),n=Xo(r.lessThan(.25),ji(-339.2).mul(i).add(ji(161.4).mul(r)).sub(25.9),ji(-8.48).mul(i).add(ji(14.3).mul(r)).sub(9.95)),a=Xo(r.lessThan(.25),ji(44).mul(i).sub(ji(23.7).mul(r)).add(3.26),ji(1.97).mul(i).sub(ji(3.27).mul(r)).add(.72));return Xo(r.lessThan(.25),0,ji(.1).mul(r).sub(.025)).add(n.mul(s).add(a).exp()).mul(1/Math.PI).saturate()})),_g=en(.04),vg=ji(1);class Ng extends _p{constructor(e=!1,t=!1,r=!1,s=!1,i=!1,n=!1){super(),this.clearcoat=e,this.sheen=t,this.iridescence=r,this.anisotropy=s,this.transmission=i,this.dispersion=n,this.clearcoatRadiance=null,this.clearcoatSpecularDirect=null,this.clearcoatSpecularIndirect=null,this.sheenSpecularDirect=null,this.sheenSpecularIndirect=null,this.iridescenceFresnel=null,this.iridescenceF0=null}start(e){if(!0===this.clearcoat&&(this.clearcoatRadiance=en().toVar("clearcoatRadiance"),this.clearcoatSpecularDirect=en().toVar("clearcoatSpecularDirect"),this.clearcoatSpecularIndirect=en().toVar("clearcoatSpecularIndirect")),!0===this.sheen&&(this.sheenSpecularDirect=en().toVar("sheenSpecularDirect"),this.sheenSpecularIndirect=en().toVar("sheenSpecularIndirect")),!0===this.iridescence){const e=Ql.dot(zl).clamp();this.iridescenceFresnel=xg({outsideIOR:ji(1),eta2:wn,cosTheta1:e,thinFilmThickness:An,baseF0:Ln}),this.iridescenceF0=$p({f:this.iridescenceFresnel,f90:1,dotVH:e})}if(!0===this.transmission){const t=Ol,r=gl.sub(Ol).normalize(),s=Zl,i=e.context;i.backdrop=fg(s,r,xn,yn,Ln,Fn,t,El,cl,ll,On,Gn,Hn,zn,this.dispersion?$n:null),i.backdropAlpha=kn,yn.a.mulAssign(Io(1,i.backdrop.a,kn))}super.start(e)}computeMultiscattering(e,t,r){const s=Ql.dot(zl).clamp(),i=zp({roughness:xn,dotNV:s}),n=(this.iridescenceF0?En.mix(Ln,this.iridescenceF0):Ln).mul(i.x).add(r.mul(i.y)),a=i.x.add(i.y).oneMinus(),o=Ln.add(Ln.oneMinus().mul(.047619)),u=n.mul(o).div(a.mul(o).oneMinus());e.addAssign(n),t.addAssign(u.mul(a))}direct({lightDirection:e,lightColor:t,reflectedLight:r}){const s=Ql.dot(e).clamp().mul(t);if(!0===this.sheen&&this.sheenSpecularDirect.addAssign(s.mul(qp({lightDirection:e}))),!0===this.clearcoat){const r=Jl.dot(e).clamp().mul(t);this.clearcoatSpecularDirect.addAssign(r.mul(Gp({lightDirection:e,f0:_g,f90:vg,roughness:vn,normalView:Jl})))}r.directDiffuse.addAssign(s.mul(wp({diffuseColor:yn.rgb}))),r.directSpecular.addAssign(s.mul(Gp({lightDirection:e,f0:Ln,f90:1,roughness:xn,iridescence:this.iridescence,f:this.iridescenceFresnel,USE_IRIDESCENCE:this.iridescence,USE_ANISOTROPY:this.anisotropy})))}directRectArea({lightColor:e,lightPosition:t,halfWidth:r,halfHeight:s,reflectedLight:i,ltc_1:n,ltc_2:a}){const o=t.add(r).sub(s),u=t.sub(r).sub(s),l=t.sub(r).add(s),d=t.add(r).add(s),c=Ql,h=zl,p=Gl.toVar(),g=Xp({N:c,V:h,roughness:xn}),m=n.sample(g).toVar(),f=a.sample(g).toVar(),y=dn(en(m.x,0,m.y),en(0,1,0),en(m.z,0,m.w)).toVar(),b=Ln.mul(f.x).add(Ln.oneMinus().mul(f.y)).toVar();i.directSpecular.addAssign(e.mul(b).mul(Qp({N:c,V:h,P:p,mInv:y,p0:o,p1:u,p2:l,p3:d}))),i.directDiffuse.addAssign(e.mul(yn).mul(Qp({N:c,V:h,P:p,mInv:dn(1,0,0,0,1,0,0,0,1),p0:o,p1:u,p2:l,p3:d})))}indirect(e){this.indirectDiffuse(e),this.indirectSpecular(e),this.ambientOcclusion(e)}indirectDiffuse(e){const{irradiance:t,reflectedLight:r}=e.context;r.indirectDiffuse.addAssign(t.mul(wp({diffuseColor:yn})))}indirectSpecular(e){const{radiance:t,iblIrradiance:r,reflectedLight:s}=e.context;if(!0===this.sheen&&this.sheenSpecularIndirect.addAssign(r.mul(Nn,Tg({normal:Ql,viewDir:zl,roughness:Sn}))),!0===this.clearcoat){const e=Jl.dot(zl).clamp(),t=Hp({dotNV:e,specularColor:_g,specularF90:vg,roughness:vn});this.clearcoatSpecularIndirect.addAssign(this.clearcoatRadiance.mul(t))}const i=en().toVar("singleScattering"),n=en().toVar("multiScattering"),a=r.mul(1/Math.PI);this.computeMultiscattering(i,n,Fn);const o=i.add(n),u=yn.mul(o.r.max(o.g).max(o.b).oneMinus());s.indirectSpecular.addAssign(t.mul(i)),s.indirectSpecular.addAssign(n.mul(a)),s.indirectDiffuse.addAssign(u.mul(a))}ambientOcclusion(e){const{ambientOcclusion:t,reflectedLight:r}=e.context,s=Ql.dot(zl).clamp().add(t),i=xn.mul(-16).oneMinus().negate().exp2(),n=t.sub(s.pow(i).oneMinus()).clamp();!0===this.clearcoat&&this.clearcoatSpecularIndirect.mulAssign(t),!0===this.sheen&&this.sheenSpecularIndirect.mulAssign(t),r.indirectDiffuse.mulAssign(t),r.indirectSpecular.mulAssign(n)}finish({context:e}){const{outgoingLight:t}=e;if(!0===this.clearcoat){const e=Jl.dot(zl).clamp(),r=Ep({dotVH:e,f0:_g,f90:vg}),s=t.mul(_n.mul(r).oneMinus()).add(this.clearcoatSpecularDirect.add(this.clearcoatSpecularIndirect).mul(_n));t.assign(s)}if(!0===this.sheen){const e=Nn.r.max(Nn.g).max(Nn.b).mul(.157).oneMinus(),r=t.mul(e).add(this.sheenSpecularDirect,this.sheenSpecularIndirect);t.assign(r)}}}const Sg=ji(1),Eg=ji(-2),wg=ji(.8),Ag=ji(-1),Rg=ji(.4),Cg=ji(2),Mg=ji(.305),Pg=ji(3),Lg=ji(.21),Fg=ji(4),Bg=ji(4),Ig=ji(16),Dg=ki((([e])=>{const t=en(no(e)).toVar(),r=ji(-1).toVar();return Hi(t.x.greaterThan(t.z),(()=>{Hi(t.x.greaterThan(t.y),(()=>{r.assign(Xo(e.x.greaterThan(0),0,3))})).Else((()=>{r.assign(Xo(e.y.greaterThan(0),1,4))}))})).Else((()=>{Hi(t.z.greaterThan(t.y),(()=>{r.assign(Xo(e.z.greaterThan(0),2,5))})).Else((()=>{r.assign(Xo(e.y.greaterThan(0),1,4))}))})),r})).setLayout({name:"getFace",type:"float",inputs:[{name:"direction",type:"vec3"}]}),Vg=ki((([e,t])=>{const r=Yi().toVar();return Hi(t.equal(0),(()=>{r.assign(Yi(e.z,e.y).div(no(e.x)))})).ElseIf(t.equal(1),(()=>{r.assign(Yi(e.x.negate(),e.z.negate()).div(no(e.y)))})).ElseIf(t.equal(2),(()=>{r.assign(Yi(e.x.negate(),e.y).div(no(e.z)))})).ElseIf(t.equal(3),(()=>{r.assign(Yi(e.z.negate(),e.y).div(no(e.x)))})).ElseIf(t.equal(4),(()=>{r.assign(Yi(e.x.negate(),e.z).div(no(e.y)))})).Else((()=>{r.assign(Yi(e.x,e.y).div(no(e.z)))})),la(.5,r.add(1))})).setLayout({name:"getUV",type:"vec2",inputs:[{name:"direction",type:"vec3"},{name:"face",type:"float"}]}),Ug=ki((([e])=>{const t=ji(0).toVar();return Hi(e.greaterThanEqual(wg),(()=>{t.assign(Sg.sub(e).mul(Ag.sub(Eg)).div(Sg.sub(wg)).add(Eg))})).ElseIf(e.greaterThanEqual(Rg),(()=>{t.assign(wg.sub(e).mul(Cg.sub(Ag)).div(wg.sub(Rg)).add(Ag))})).ElseIf(e.greaterThanEqual(Mg),(()=>{t.assign(Rg.sub(e).mul(Pg.sub(Cg)).div(Rg.sub(Mg)).add(Cg))})).ElseIf(e.greaterThanEqual(Lg),(()=>{t.assign(Mg.sub(e).mul(Fg.sub(Pg)).div(Mg.sub(Lg)).add(Pg))})).Else((()=>{t.assign(ji(-2).mul(ja(la(1.16,e))))})),t})).setLayout({name:"roughnessToMip",type:"float",inputs:[{name:"roughness",type:"float"}]}),Og=ki((([e,t])=>{const r=e.toVar();r.assign(la(2,r).sub(1));const s=en(r,1).toVar();return Hi(t.equal(0),(()=>{s.assign(s.zyx)})).ElseIf(t.equal(1),(()=>{s.assign(s.xzy),s.xz.mulAssign(-1)})).ElseIf(t.equal(2),(()=>{s.x.mulAssign(-1)})).ElseIf(t.equal(3),(()=>{s.assign(s.zyx),s.xz.mulAssign(-1)})).ElseIf(t.equal(4),(()=>{s.assign(s.xzy),s.xy.mulAssign(-1)})).ElseIf(t.equal(5),(()=>{s.z.mulAssign(-1)})),s})).setLayout({name:"getDirection",type:"vec3",inputs:[{name:"uv",type:"vec2"},{name:"face",type:"float"}]}),kg=ki((([e,t,r,s,i,n])=>{const a=ji(r),o=en(t),u=Do(Ug(a),Eg,n),l=Za(u),d=Ka(u),c=en(Gg(e,o,d,s,i,n)).toVar();return Hi(l.notEqual(0),(()=>{const t=en(Gg(e,o,d.add(1),s,i,n)).toVar();c.assign(Io(c,t,l))})),c})),Gg=ki((([e,t,r,s,i,n])=>{const a=ji(r).toVar(),o=en(t),u=ji(Dg(o)).toVar(),l=ji(_o(Bg.sub(a),0)).toVar();a.assign(_o(a,Bg));const d=ji($a(a)).toVar(),c=Yi(Vg(o,u).mul(d.sub(2)).add(1)).toVar();return Hi(u.greaterThan(2),(()=>{c.y.addAssign(d),u.subAssign(3)})),c.x.addAssign(u.mul(d)),c.x.addAssign(l.mul(la(3,Ig))),c.y.addAssign(la(4,$a(n).sub(d))),c.x.mulAssign(s),c.y.mulAssign(i),e.sample(c).grad(Yi(),Yi())})),zg=ki((({envMap:e,mipInt:t,outputDirection:r,theta:s,axis:i,CUBEUV_TEXEL_WIDTH:n,CUBEUV_TEXEL_HEIGHT:a,CUBEUV_MAX_MIP:o})=>{const u=eo(s),l=r.mul(u).add(i.cross(r).mul(Ja(s))).add(i.mul(i.dot(r).mul(u.oneMinus())));return Gg(e,l,t,n,a,o)})),Hg=ki((({n:e,latitudinal:t,poleAxis:r,outputDirection:s,weights:i,samples:n,dTheta:a,mipInt:o,envMap:u,CUBEUV_TEXEL_WIDTH:l,CUBEUV_TEXEL_HEIGHT:d,CUBEUV_MAX_MIP:c})=>{const h=en(Xo(t,r,Ao(r,s))).toVar();Hi(h.equal(en(0)),(()=>{h.assign(en(s.z,0,s.x.negate()))})),h.assign(Qa(h));const p=en().toVar();return p.addAssign(i.element(0).mul(zg({theta:0,axis:h,outputDirection:s,mipInt:o,envMap:u,CUBEUV_TEXEL_WIDTH:l,CUBEUV_TEXEL_HEIGHT:d,CUBEUV_MAX_MIP:c}))),Zc({start:qi(1),end:e},(({i:e})=>{Hi(e.greaterThanEqual(n),(()=>{Jc()}));const t=ji(a.mul(ji(e))).toVar();p.addAssign(i.element(e).mul(zg({theta:t.mul(-1),axis:h,outputDirection:s,mipInt:o,envMap:u,CUBEUV_TEXEL_WIDTH:l,CUBEUV_TEXEL_HEIGHT:d,CUBEUV_MAX_MIP:c}))),p.addAssign(i.element(e).mul(zg({theta:t,axis:h,outputDirection:s,mipInt:o,envMap:u,CUBEUV_TEXEL_WIDTH:l,CUBEUV_TEXEL_HEIGHT:d,CUBEUV_MAX_MIP:c})))})),nn(p,1)})),$g=[.125,.215,.35,.446,.526,.582],Wg=20,jg=new ne(-1,1,1,-1,0,1),qg=new ae(90,1),Xg=new e;let Kg=null,Yg=0,Qg=0;const Zg=(1+Math.sqrt(5))/2,Jg=1/Zg,em=[new r(-Zg,Jg,0),new r(Zg,Jg,0),new r(-Jg,0,Zg),new r(Jg,0,Zg),new r(0,Zg,-Jg),new r(0,Zg,Jg),new r(-1,1,-1),new r(1,1,-1),new r(-1,1,1),new r(1,1,1)],tm=new r,rm=new WeakMap,sm=[3,1,5,0,4,2],im=Og($u(),Hu("faceIndex")).normalize(),nm=en(im.x,im.y,im.z);class am{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._backgroundBox=null}get _hasInitialized(){return this._renderer.hasInitialized()}fromScene(e,t=0,r=.1,s=100,i={}){const{size:n=256,position:a=tm,renderTarget:o=null}=i;if(this._setSize(n),!1===this._hasInitialized){console.warn("THREE.PMREMGenerator: .fromScene() called before the backend is initialized. Try using .fromSceneAsync() instead.");const n=o||this._allocateTarget();return i.renderTarget=n,this.fromSceneAsync(e,t,r,s,i),n}Kg=this._renderer.getRenderTarget(),Yg=this._renderer.getActiveCubeFace(),Qg=this._renderer.getActiveMipmapLevel();const u=o||this._allocateTarget();return u.depthBuffer=!0,this._init(u),this._sceneToCubeUV(e,r,s,u,a),t>0&&this._blur(u,0,0,t),this._applyPMREM(u),this._cleanup(u),u}async fromSceneAsync(e,t=0,r=.1,s=100,i={}){return!1===this._hasInitialized&&await this._renderer.init(),this.fromScene(e,t,r,s,i)}fromEquirectangular(e,t=null){if(!1===this._hasInitialized){console.warn("THREE.PMREMGenerator: .fromEquirectangular() called before the backend is initialized. Try using .fromEquirectangularAsync() instead."),this._setSizeFromTexture(e);const r=t||this._allocateTarget();return this.fromEquirectangularAsync(e,r),r}return this._fromTexture(e,t)}async fromEquirectangularAsync(e,t=null){return!1===this._hasInitialized&&await this._renderer.init(),this._fromTexture(e,t)}fromCubemap(e,t=null){if(!1===this._hasInitialized){console.warn("THREE.PMREMGenerator: .fromCubemap() called before the backend is initialized. Try using .fromCubemapAsync() instead."),this._setSizeFromTexture(e);const r=t||this._allocateTarget();return this.fromCubemapAsync(e,t),r}return this._fromTexture(e,t)}async fromCubemapAsync(e,t=null){return!1===this._hasInitialized&&await this._renderer.init(),this._fromTexture(e,t)}async compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=dm(),await this._compileMaterial(this._cubemapMaterial))}async compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=cm(),await this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose(),null!==this._backgroundBox&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSizeFromTexture(e){e.mapping===A||e.mapping===R?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4)}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;ee-4?u=$g[o-e+4-1]:0===o&&(u=0),s.push(u);const l=1/(a-2),d=-l,c=1+l,h=[d,d,c,d,c,c,d,d,c,c,d,c],p=6,g=6,m=3,f=2,y=1,b=new Float32Array(m*g*p),x=new Float32Array(f*g*p),T=new Float32Array(y*g*p);for(let e=0;e2?0:-1,s=[t,r,0,t+2/3,r,0,t+2/3,r+1,0,t,r,0,t+2/3,r+1,0,t,r+1,0],i=sm[e];b.set(s,m*g*i),x.set(h,f*g*i);const n=[i,i,i,i,i,i];T.set(n,y*g*i)}const _=new he;_.setAttribute("position",new pe(b,m)),_.setAttribute("uv",new pe(x,f)),_.setAttribute("faceIndex",new pe(T,y)),t.push(_),i.push(new q(_,null)),n>4&&n--}return{lodPlanes:t,sizeLods:r,sigmas:s,lodMeshes:i}}(t)),this._blurMaterial=function(e,t,s){const i=il(new Array(Wg).fill(0)),n=Zn(new r(0,1,0)),a=Zn(0),o=ji(Wg),u=Zn(0),l=Zn(1),d=Zu(null),c=Zn(0),h=ji(1/t),p=ji(1/s),g=ji(e),m={n:o,latitudinal:u,weights:i,poleAxis:n,outputDirection:nm,dTheta:a,samples:l,envMap:d,mipInt:c,CUBEUV_TEXEL_WIDTH:h,CUBEUV_TEXEL_HEIGHT:p,CUBEUV_MAX_MIP:g},f=lm("blur");return f.fragmentNode=Hg({...m,latitudinal:u.equal(1)}),rm.set(f,m),f}(t,e.width,e.height)}}async _compileMaterial(e){const t=new q(this._lodPlanes[0],e);await this._renderer.compile(t,jg)}_sceneToCubeUV(e,t,r,s,i){const n=qg;n.near=t,n.far=r;const a=[1,1,1,1,-1,1],o=[1,-1,1,-1,1,-1],u=this._renderer,l=u.autoClear;u.getClearColor(Xg),u.autoClear=!1;let d=this._backgroundBox;if(null===d){const e=new re({name:"PMREM.Background",side:S,depthWrite:!1,depthTest:!1});d=new q(new j,e)}let c=!1;const h=e.background;h?h.isColor&&(d.material.color.copy(h),e.background=null,c=!0):(d.material.color.copy(Xg),c=!0),u.setRenderTarget(s),u.clear(),c&&u.render(d,n);for(let t=0;t<6;t++){const r=t%3;0===r?(n.up.set(0,a[t],0),n.position.set(i.x,i.y,i.z),n.lookAt(i.x+o[t],i.y,i.z)):1===r?(n.up.set(0,0,a[t]),n.position.set(i.x,i.y,i.z),n.lookAt(i.x,i.y+o[t],i.z)):(n.up.set(0,a[t],0),n.position.set(i.x,i.y,i.z),n.lookAt(i.x,i.y,i.z+o[t]));const l=this._cubeSize;um(s,r*l,t>2?l:0,l,l),u.render(e,n)}u.autoClear=l,e.background=h}_textureToCubeUV(e,t){const r=this._renderer,s=e.mapping===A||e.mapping===R;s?null===this._cubemapMaterial&&(this._cubemapMaterial=dm(e)):null===this._equirectMaterial&&(this._equirectMaterial=cm(e));const i=s?this._cubemapMaterial:this._equirectMaterial;i.fragmentNode.value=e;const n=this._lodMeshes[0];n.material=i;const a=this._cubeSize;um(t,0,0,3*a,2*a),r.setRenderTarget(t),r.render(n,jg)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;const s=this._lodPlanes.length;for(let t=1;tWg&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${g} samples when the maximum is set to 20`);const m=[];let f=0;for(let e=0;ey-4?s-y+4:0),4*(this._cubeSize-b),3*b,2*b),o.setRenderTarget(t),o.render(l,jg)}}function om(e,t){const r=new oe(e,t,{magFilter:K,minFilter:K,generateMipmaps:!1,type:de,format:le,colorSpace:ue});return r.texture.mapping=ce,r.texture.name="PMREM.cubeUv",r.texture.isPMREMTexture=!0,r.scissorTest=!0,r}function um(e,t,r,s,i){e.viewport.set(t,r,s,i),e.scissor.set(t,r,s,i)}function lm(e){const t=new Zh;return t.depthTest=!1,t.depthWrite=!1,t.blending=z,t.name=`PMREM_${e}`,t}function dm(e){const t=lm("cubemap");return t.fragmentNode=gd(e,nm),t}function cm(e){const t=lm("equirect");return t.fragmentNode=Zu(e,hp(nm),0),t}const hm=new WeakMap;function pm(e,t,r){const s=function(e){let t=hm.get(e);void 0===t&&(t=new WeakMap,hm.set(e,t));return t}(t);let i=s.get(e);if((void 0!==i?i.pmremVersion:-1)!==e.pmremVersion){const t=e.image;if(e.isCubeTexture){if(!function(e){if(null==e)return!1;let t=0;const r=6;for(let s=0;s0}(t))return null;i=r.fromEquirectangular(e,i)}i.pmremVersion=e.pmremVersion,s.set(e,i)}return i.texture}class gm extends Ks{static get type(){return"PMREMNode"}constructor(e,t=null,r=null){super("vec3"),this._value=e,this._pmrem=null,this.uvNode=t,this.levelNode=r,this._generator=null;const s=new x;s.isRenderTargetTexture=!0,this._texture=Zu(s),this._width=Zn(0),this._height=Zn(0),this._maxMip=Zn(0),this.updateBeforeType=Vs.RENDER}set value(e){this._value=e,this._pmrem=null}get value(){return this._value}updateFromTexture(e){const t=function(e){const t=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:r,maxMip:t}}(e.image.height);this._texture.value=e,this._width.value=t.texelWidth,this._height.value=t.texelHeight,this._maxMip.value=t.maxMip}updateBefore(e){let t=this._pmrem;const r=t?t.pmremVersion:-1,s=this._value;r!==s.pmremVersion&&(t=!0===s.isPMREMTexture?s:pm(s,e.renderer,this._generator),null!==t&&(this._pmrem=t,this.updateFromTexture(t)))}setup(e){null===this._generator&&(this._generator=new am(e.renderer)),this.updateBefore(e);let t=this.uvNode;null===t&&e.context.getUV&&(t=e.context.getUV(this)),t=ad.mul(en(t.x,t.y.negate(),t.z));let r=this.levelNode;return null===r&&e.context.getTextureLevel&&(r=e.context.getTextureLevel(this)),kg(this._texture,t,r,this._width,this._height,this._maxMip)}dispose(){super.dispose(),null!==this._generator&&this._generator.dispose()}}const mm=Vi(gm).setParameterLength(1,3),fm=new WeakMap;class ym extends nh{static get type(){return"EnvironmentNode"}constructor(e=null){super(),this.envNode=e}setup(e){const{material:t}=e;let r=this.envNode;if(r.isTextureNode||r.isMaterialReferenceNode){const e=r.isTextureNode?r.value:t[r.property];let s=fm.get(e);void 0===s&&(s=mm(e),fm.set(e,s)),r=s}const s=!0===t.useAnisotropy||t.anisotropy>0?Dd:Ql,i=r.context(bm(xn,s)).mul(nd),n=r.context(xm(Zl)).mul(Math.PI).mul(nd),a=Ru(i),o=Ru(n);e.context.radiance.addAssign(a),e.context.iblIrradiance.addAssign(o);const u=e.context.lightingModel.clearcoatRadiance;if(u){const e=r.context(bm(vn,Jl)).mul(nd),t=Ru(e);u.addAssign(t)}}}const bm=(e,t)=>{let r=null;return{getUV:()=>(null===r&&(r=zl.negate().reflect(t),r=e.mul(e).mix(r,t).normalize(),r=r.transformDirection(cl)),r),getTextureLevel:()=>e}},xm=e=>({getUV:()=>e,getTextureLevel:()=>ji(1)}),Tm=new ge;class _m extends Zh{static get type(){return"MeshStandardNodeMaterial"}constructor(e){super(),this.isMeshStandardNodeMaterial=!0,this.lights=!0,this.emissiveNode=null,this.metalnessNode=null,this.roughnessNode=null,this.setDefaultValues(Tm),this.setValues(e)}setupEnvironment(e){let t=super.setupEnvironment(e);return null===t&&e.environmentNode&&(t=e.environmentNode),t?new ym(t):null}setupLightingModel(){return new Ng}setupSpecular(){const e=Io(en(.04),yn.rgb,Tn);Ln.assign(e),Fn.assign(1)}setupVariants(){const e=this.metalnessNode?ji(this.metalnessNode):sc;Tn.assign(e);let t=this.roughnessNode?ji(this.roughnessNode):rc;t=Ip({roughness:t}),xn.assign(t),this.setupSpecular(),yn.assign(nn(yn.rgb.mul(e.oneMinus()),yn.a))}copy(e){return this.emissiveNode=e.emissiveNode,this.metalnessNode=e.metalnessNode,this.roughnessNode=e.roughnessNode,super.copy(e)}}const vm=new me;class Nm extends _m{static get type(){return"MeshPhysicalNodeMaterial"}constructor(e){super(),this.isMeshPhysicalNodeMaterial=!0,this.clearcoatNode=null,this.clearcoatRoughnessNode=null,this.clearcoatNormalNode=null,this.sheenNode=null,this.sheenRoughnessNode=null,this.iridescenceNode=null,this.iridescenceIORNode=null,this.iridescenceThicknessNode=null,this.specularIntensityNode=null,this.specularColorNode=null,this.iorNode=null,this.transmissionNode=null,this.thicknessNode=null,this.attenuationDistanceNode=null,this.attenuationColorNode=null,this.dispersionNode=null,this.anisotropyNode=null,this.setDefaultValues(vm),this.setValues(e)}get useClearcoat(){return this.clearcoat>0||null!==this.clearcoatNode}get useIridescence(){return this.iridescence>0||null!==this.iridescenceNode}get useSheen(){return this.sheen>0||null!==this.sheenNode}get useAnisotropy(){return this.anisotropy>0||null!==this.anisotropyNode}get useTransmission(){return this.transmission>0||null!==this.transmissionNode}get useDispersion(){return this.dispersion>0||null!==this.dispersionNode}setupSpecular(){const e=this.iorNode?ji(this.iorNode):yc;On.assign(e),Ln.assign(Io(To(Co(On.sub(1).div(On.add(1))).mul(Jd),en(1)).mul(Zd),yn.rgb,Tn)),Fn.assign(Io(Zd,1,Tn))}setupLightingModel(){return new Ng(this.useClearcoat,this.useSheen,this.useIridescence,this.useAnisotropy,this.useTransmission,this.useDispersion)}setupVariants(e){if(super.setupVariants(e),this.useClearcoat){const e=this.clearcoatNode?ji(this.clearcoatNode):nc,t=this.clearcoatRoughnessNode?ji(this.clearcoatRoughnessNode):ac;_n.assign(e),vn.assign(Ip({roughness:t}))}if(this.useSheen){const e=this.sheenNode?en(this.sheenNode):lc,t=this.sheenRoughnessNode?ji(this.sheenRoughnessNode):dc;Nn.assign(e),Sn.assign(t)}if(this.useIridescence){const e=this.iridescenceNode?ji(this.iridescenceNode):hc,t=this.iridescenceIORNode?ji(this.iridescenceIORNode):pc,r=this.iridescenceThicknessNode?ji(this.iridescenceThicknessNode):gc;En.assign(e),wn.assign(t),An.assign(r)}if(this.useAnisotropy){const e=(this.anisotropyNode?Yi(this.anisotropyNode):cc).toVar();Cn.assign(e.length()),Hi(Cn.equal(0),(()=>{e.assign(Yi(1,0))})).Else((()=>{e.divAssign(Yi(Cn)),Cn.assign(Cn.saturate())})),Rn.assign(Cn.pow2().mix(xn.pow2(),1)),Mn.assign(Bd[0].mul(e.x).add(Bd[1].mul(e.y))),Pn.assign(Bd[1].mul(e.x).sub(Bd[0].mul(e.y)))}if(this.useTransmission){const e=this.transmissionNode?ji(this.transmissionNode):mc,t=this.thicknessNode?ji(this.thicknessNode):fc,r=this.attenuationDistanceNode?ji(this.attenuationDistanceNode):bc,s=this.attenuationColorNode?en(this.attenuationColorNode):xc;if(kn.assign(e),Gn.assign(t),zn.assign(r),Hn.assign(s),this.useDispersion){const e=this.dispersionNode?ji(this.dispersionNode):wc;$n.assign(e)}}}setupClearcoatNormal(){return this.clearcoatNormalNode?en(this.clearcoatNormalNode):oc}setup(e){e.context.setupClearcoatNormal=()=>this.setupClearcoatNormal(e),super.setup(e)}copy(e){return this.clearcoatNode=e.clearcoatNode,this.clearcoatRoughnessNode=e.clearcoatRoughnessNode,this.clearcoatNormalNode=e.clearcoatNormalNode,this.sheenNode=e.sheenNode,this.sheenRoughnessNode=e.sheenRoughnessNode,this.iridescenceNode=e.iridescenceNode,this.iridescenceIORNode=e.iridescenceIORNode,this.iridescenceThicknessNode=e.iridescenceThicknessNode,this.specularIntensityNode=e.specularIntensityNode,this.specularColorNode=e.specularColorNode,this.transmissionNode=e.transmissionNode,this.thicknessNode=e.thicknessNode,this.attenuationDistanceNode=e.attenuationDistanceNode,this.attenuationColorNode=e.attenuationColorNode,this.dispersionNode=e.dispersionNode,this.anisotropyNode=e.anisotropyNode,super.copy(e)}}class Sm extends Ng{constructor(e=!1,t=!1,r=!1,s=!1,i=!1,n=!1,a=!1){super(e,t,r,s,i,n),this.useSSS=a}direct({lightDirection:e,lightColor:t,reflectedLight:r},s){if(!0===this.useSSS){const i=s.material,{thicknessColorNode:n,thicknessDistortionNode:a,thicknessAmbientNode:o,thicknessAttenuationNode:u,thicknessPowerNode:l,thicknessScaleNode:d}=i,c=e.add(Ql.mul(a)).normalize(),h=ji(zl.dot(c.negate()).saturate().pow(l).mul(d)),p=en(h.add(o).mul(n));r.directDiffuse.addAssign(p.mul(u.mul(t)))}super.direct({lightDirection:e,lightColor:t,reflectedLight:r},s)}}class Em extends Nm{static get type(){return"MeshSSSNodeMaterial"}constructor(e){super(e),this.thicknessColorNode=null,this.thicknessDistortionNode=ji(.1),this.thicknessAmbientNode=ji(0),this.thicknessAttenuationNode=ji(.1),this.thicknessPowerNode=ji(2),this.thicknessScaleNode=ji(10)}get useSSS(){return null!==this.thicknessColorNode}setupLightingModel(){return new Sm(this.useClearcoat,this.useSheen,this.useIridescence,this.useAnisotropy,this.useTransmission,this.useDispersion,this.useSSS)}copy(e){return this.thicknessColorNode=e.thicknessColorNode,this.thicknessDistortionNode=e.thicknessDistortionNode,this.thicknessAmbientNode=e.thicknessAmbientNode,this.thicknessAttenuationNode=e.thicknessAttenuationNode,this.thicknessPowerNode=e.thicknessPowerNode,this.thicknessScaleNode=e.thicknessScaleNode,super.copy(e)}}const wm=ki((({normal:e,lightDirection:t,builder:r})=>{const s=e.dot(t),i=Yi(s.mul(.5).add(.5),0);if(r.material.gradientMap){const e=Td("gradientMap","texture").context({getUV:()=>i});return en(e.r)}{const e=i.fwidth().mul(.5);return Io(en(.7),en(1),Oo(ji(.7).sub(e.x),ji(.7).add(e.x),i.x))}}));class Am extends _p{direct({lightDirection:e,lightColor:t,reflectedLight:r},s){const i=wm({normal:jl,lightDirection:e,builder:s}).mul(t);r.directDiffuse.addAssign(i.mul(wp({diffuseColor:yn.rgb})))}indirect(e){const{ambientOcclusion:t,irradiance:r,reflectedLight:s}=e.context;s.indirectDiffuse.addAssign(r.mul(wp({diffuseColor:yn}))),s.indirectDiffuse.mulAssign(t)}}const Rm=new fe;class Cm extends Zh{static get type(){return"MeshToonNodeMaterial"}constructor(e){super(),this.isMeshToonNodeMaterial=!0,this.lights=!0,this.setDefaultValues(Rm),this.setValues(e)}setupLightingModel(){return new Am}}class Mm extends Ks{static get type(){return"MatcapUVNode"}constructor(){super("vec2")}setup(){const e=en(zl.z,0,zl.x.negate()).normalize(),t=zl.cross(e);return Yi(e.dot(Ql),t.dot(Ql)).mul(.495).add(.5)}}const Pm=Ui(Mm),Lm=new ye;class Fm extends Zh{static get type(){return"MeshMatcapNodeMaterial"}constructor(e){super(),this.isMeshMatcapNodeMaterial=!0,this.setDefaultValues(Lm),this.setValues(e)}setupVariants(e){const t=Pm;let r;r=e.material.matcap?Td("matcap","texture").context({getUV:()=>t}):en(Io(.2,.8,t.y)),yn.rgb.mulAssign(r.rgb)}}class Bm extends Ks{static get type(){return"RotateNode"}constructor(e,t){super(),this.positionNode=e,this.rotationNode=t}getNodeType(e){return this.positionNode.getNodeType(e)}setup(e){const{rotationNode:t,positionNode:r}=this;if("vec2"===this.getNodeType(e)){const e=t.cos(),s=t.sin();return ln(e,s,s.negate(),e).mul(r)}{const e=t,s=cn(nn(1,0,0,0),nn(0,eo(e.x),Ja(e.x).negate(),0),nn(0,Ja(e.x),eo(e.x),0),nn(0,0,0,1)),i=cn(nn(eo(e.y),0,Ja(e.y),0),nn(0,1,0,0),nn(Ja(e.y).negate(),0,eo(e.y),0),nn(0,0,0,1)),n=cn(nn(eo(e.z),Ja(e.z).negate(),0,0),nn(Ja(e.z),eo(e.z),0,0),nn(0,0,1,0),nn(0,0,0,1));return s.mul(i).mul(n).mul(nn(r,1)).xyz}}}const Im=Vi(Bm).setParameterLength(2),Dm=new be;class Vm extends Zh{static get type(){return"SpriteNodeMaterial"}constructor(e){super(),this.isSpriteNodeMaterial=!0,this._useSizeAttenuation=!0,this.positionNode=null,this.rotationNode=null,this.scaleNode=null,this.transparent=!0,this.setDefaultValues(Dm),this.setValues(e)}setupPositionView(e){const{object:t,camera:r}=e,s=this.sizeAttenuation,{positionNode:i,rotationNode:n,scaleNode:a}=this,o=Ll.mul(en(i||0));let u=Yi(El[0].xyz.length(),El[1].xyz.length());if(null!==a&&(u=u.mul(Yi(a))),!1===s)if(r.isPerspectiveCamera)u=u.mul(o.z.negate());else{const e=ji(2).div(ll.element(1).element(1));u=u.mul(e.mul(2))}let l=Dl.xy;if(t.center&&!0===t.center.isVector2){const e=((e,t,r)=>Bi(new gu(e,t,r)))("center","vec2",t);l=l.sub(e.sub(.5))}l=l.mul(u);const d=ji(n||uc),c=Im(l,d);return nn(o.xy.add(c),o.zw)}copy(e){return this.positionNode=e.positionNode,this.rotationNode=e.rotationNode,this.scaleNode=e.scaleNode,super.copy(e)}get sizeAttenuation(){return this._useSizeAttenuation}set sizeAttenuation(e){this._useSizeAttenuation!==e&&(this._useSizeAttenuation=e,this.needsUpdate=!0)}}const Um=new xe;class Om extends Vm{static get type(){return"PointsNodeMaterial"}constructor(e){super(),this.sizeNode=null,this.isPointsNodeMaterial=!0,this.setDefaultValues(Um),this.setValues(e)}setupPositionView(){const{positionNode:e}=this;return Ll.mul(en(e||Vl)).xyz}setupVertex(e){const t=super.setupVertex(e);if(!0!==e.material.isNodeMaterial)return t;const{rotationNode:r,scaleNode:s,sizeNode:i}=this,n=Dl.xy.toVar(),a=fh.z.div(fh.w);if(r&&r.isNode){const e=ji(r);n.assign(Im(n,e))}let o=null!==i?Yi(i):Ec;return!0===this.sizeAttenuation&&(o=o.mul(o.div(Gl.z.negate()))),s&&s.isNode&&(o=o.mul(Yi(s))),n.mulAssign(o.mul(2)),n.assign(n.div(fh.z)),n.y.assign(n.y.mul(a)),n.assign(n.mul(t.w)),t.addAssign(nn(n,0,0)),t}get alphaToCoverage(){return this._useAlphaToCoverage}set alphaToCoverage(e){this._useAlphaToCoverage!==e&&(this._useAlphaToCoverage=e,this.needsUpdate=!0)}}class km extends _p{constructor(){super(),this.shadowNode=ji(1).toVar("shadowMask")}direct({lightNode:e}){null!==e.shadowNode&&this.shadowNode.mulAssign(e.shadowNode)}finish({context:e}){yn.a.mulAssign(this.shadowNode.oneMinus()),e.outgoingLight.rgb.assign(yn.rgb)}}const Gm=new Te;class zm extends Zh{static get type(){return"ShadowNodeMaterial"}constructor(e){super(),this.isShadowNodeMaterial=!0,this.lights=!0,this.transparent=!0,this.setDefaultValues(Gm),this.setValues(e)}setupLightingModel(){return new km}}const Hm=mn("vec3"),$m=mn("vec3"),Wm=mn("vec3");class jm extends _p{constructor(){super()}start(e){const{material:t,context:r}=e,s=mn("vec3"),i=mn("vec3");Hi(gl.sub(Ol).length().greaterThan(Cl.mul(2)),(()=>{s.assign(gl),i.assign(Ol)})).Else((()=>{s.assign(Ol),i.assign(gl)}));const n=i.sub(s),a=Zn("int").onRenderUpdate((({material:e})=>e.steps)),o=n.length().div(a).toVar(),u=n.normalize().toVar(),l=ji(0).toVar(),d=en(1).toVar();t.offsetNode&&l.addAssign(t.offsetNode.mul(o)),Zc(a,(()=>{const i=s.add(u.mul(l)),n=cl.mul(nn(i,1)).xyz;let a;null!==t.depthNode&&($m.assign(Vh(Lh(n.z,ol,ul))),r.sceneDepthNode=Vh(t.depthNode).toVar()),r.positionWorld=i,r.shadowPositionWorld=i,r.positionView=n,Hm.assign(0),t.scatteringNode&&(a=t.scatteringNode({positionRay:i})),super.start(e),a&&Hm.mulAssign(a);const c=Hm.mul(.01).negate().mul(o).exp();d.mulAssign(c),l.addAssign(o)})),Wm.addAssign(d.saturate().oneMinus())}scatteringLight(e,t){const r=t.context.sceneDepthNode;r?Hi(r.greaterThanEqual($m),(()=>{Hm.addAssign(e)})):Hm.addAssign(e)}direct({lightNode:e,lightColor:t},r){if(void 0===e.light.distance)return;const s=t.xyz.toVar();s.mulAssign(e.shadowNode),this.scatteringLight(s,r)}directRectArea({lightColor:e,lightPosition:t,halfWidth:r,halfHeight:s},i){const n=t.add(r).sub(s),a=t.sub(r).sub(s),o=t.sub(r).add(s),u=t.add(r).add(s),l=i.context.positionView,d=e.xyz.mul(Zp({P:l,p0:n,p1:a,p2:o,p3:u})).pow(1.5);this.scatteringLight(d,i)}finish(e){e.context.outgoingLight.assign(Wm)}}class qm extends Zh{static get type(){return"VolumeNodeMaterial"}constructor(e){super(),this.isVolumeNodeMaterial=!0,this.steps=25,this.offsetNode=null,this.scatteringNode=null,this.lights=!0,this.transparent=!0,this.side=S,this.depthTest=!1,this.depthWrite=!1,this.setValues(e)}setupLightingModel(){return new jm}}class Xm{constructor(e,t){this.nodes=e,this.info=t,this._context="undefined"!=typeof self?self:null,this._animationLoop=null,this._requestId=null}start(){const e=(t,r)=>{this._requestId=this._context.requestAnimationFrame(e),!0===this.info.autoReset&&this.info.reset(),this.nodes.nodeFrame.update(),this.info.frame=this.nodes.nodeFrame.frameId,null!==this._animationLoop&&this._animationLoop(t,r)};e()}stop(){this._context.cancelAnimationFrame(this._requestId),this._requestId=null}getAnimationLoop(){return this._animationLoop}setAnimationLoop(e){this._animationLoop=e}getContext(){return this._context}setContext(e){this._context=e}dispose(){this.stop()}}class Km{constructor(){this.weakMap=new WeakMap}get(e){let t=this.weakMap;for(let r=0;r{this.dispose()},this.onGeometryDispose=()=>{this.attributes=null,this.attributesId=null},this.material.addEventListener("dispose",this.onMaterialDispose),this.geometry.addEventListener("dispose",this.onGeometryDispose)}updateClipping(e){this.clippingContext=e}get clippingNeedsUpdate(){return null!==this.clippingContext&&this.clippingContext.cacheKey!==this.clippingContextCacheKey&&(this.clippingContextCacheKey=this.clippingContext.cacheKey,!0)}get hardwareClippingPlanes(){return!0===this.material.hardwareClipping?this.clippingContext.unionClippingCount:0}getNodeBuilderState(){return this._nodeBuilderState||(this._nodeBuilderState=this._nodes.getForRender(this))}getMonitor(){return this._monitor||(this._monitor=this.getNodeBuilderState().observer)}getBindings(){return this._bindings||(this._bindings=this.getNodeBuilderState().createBindings())}getBindingGroup(e){for(const t of this.getBindings())if(t.name===e)return t}getIndex(){return this._geometries.getIndex(this)}getIndirect(){return this._geometries.getIndirect(this)}getChainArray(){return[this.object,this.material,this.context,this.lightsNode]}setGeometry(e){this.geometry=e,this.attributes=null,this.attributesId=null}getAttributes(){if(null!==this.attributes)return this.attributes;const e=this.getNodeBuilderState().nodeAttributes,t=this.geometry,r=[],s=new Set,i={};for(const n of e){let e;if(n.node&&n.node.attribute?e=n.node.attribute:(e=t.getAttribute(n.name),i[n.name]=e.version),void 0===e)continue;r.push(e);const a=e.isInterleavedBufferAttribute?e.data:e;s.add(a)}return this.attributes=r,this.attributesId=i,this.vertexBuffers=Array.from(s.values()),r}getVertexBuffers(){return null===this.vertexBuffers&&this.getAttributes(),this.vertexBuffers}getDrawParameters(){const{object:e,material:t,geometry:r,group:s,drawRange:i}=this,n=this.drawParams||(this.drawParams={vertexCount:0,firstVertex:0,instanceCount:0,firstInstance:0}),a=this.getIndex(),o=null!==a;let u=1;if(!0===r.isInstancedBufferGeometry?u=r.instanceCount:void 0!==e.count&&(u=Math.max(0,e.count)),0===u)return null;if(n.instanceCount=u,!0===e.isBatchedMesh)return n;let l=1;!0!==t.wireframe||e.isPoints||e.isLineSegments||e.isLine||e.isLineLoop||(l=2);let d=i.start*l,c=(i.start+i.count)*l;null!==s&&(d=Math.max(d,s.start*l),c=Math.min(c,(s.start+s.count)*l));const h=r.attributes.position;let p=1/0;o?p=a.count:null!=h&&(p=h.count),d=Math.max(d,0),c=Math.min(c,p);const g=c-d;return g<0||g===1/0?null:(n.vertexCount=g,n.firstVertex=d,n)}getGeometryCacheKey(){const{geometry:e}=this;let t="";for(const r of Object.keys(e.attributes).sort()){const s=e.attributes[r];t+=r+",",s.data&&(t+=s.data.stride+","),s.offset&&(t+=s.offset+","),s.itemSize&&(t+=s.itemSize+","),s.normalized&&(t+="n,")}for(const r of Object.keys(e.morphAttributes).sort()){const s=e.morphAttributes[r];t+="morph-"+r+",";for(let e=0,r=s.length;e1&&(r+=e.uuid+","),r+=e.receiveShadow+",",bs(r)}get needsGeometryUpdate(){if(this.geometry.id!==this.object.geometry.id)return!0;if(null!==this.attributes){const e=this.attributesId;for(const t in e){const r=this.geometry.getAttribute(t);if(void 0===r||e[t]!==r.id)return!0}}return!1}get needsUpdate(){return this.initialNodesCacheKey!==this.getDynamicCacheKey()||this.clippingNeedsUpdate}getDynamicCacheKey(){let e=0;return!0!==this.material.isShadowPassMaterial&&(e=this._nodes.getCacheKey(this.scene,this.lightsNode)),this.camera.isArrayCamera&&(e=Ts(e,this.camera.cameras.length)),this.object.receiveShadow&&(e=Ts(e,1)),e}getCacheKey(){return this.getMaterialCacheKey()+this.getDynamicCacheKey()}dispose(){this.material.removeEventListener("dispose",this.onMaterialDispose),this.geometry.removeEventListener("dispose",this.onGeometryDispose),this.onDispose()}}const Zm=[];class Jm{constructor(e,t,r,s,i,n){this.renderer=e,this.nodes=t,this.geometries=r,this.pipelines=s,this.bindings=i,this.info=n,this.chainMaps={}}get(e,t,r,s,i,n,a,o){const u=this.getChainMap(o);Zm[0]=e,Zm[1]=t,Zm[2]=n,Zm[3]=i;let l=u.get(Zm);return void 0===l?(l=this.createRenderObject(this.nodes,this.geometries,this.renderer,e,t,r,s,i,n,a,o),u.set(Zm,l)):(l.updateClipping(a),l.needsGeometryUpdate&&l.setGeometry(e.geometry),(l.version!==t.version||l.needsUpdate)&&(l.initialCacheKey!==l.getCacheKey()?(l.dispose(),l=this.get(e,t,r,s,i,n,a,o)):l.version=t.version)),Zm.length=0,l}getChainMap(e="default"){return this.chainMaps[e]||(this.chainMaps[e]=new Km)}dispose(){this.chainMaps={}}createRenderObject(e,t,r,s,i,n,a,o,u,l,d){const c=this.getChainMap(d),h=new Qm(e,t,r,s,i,n,a,o,u,l);return h.onDispose=()=>{this.pipelines.delete(h),this.bindings.delete(h),this.nodes.delete(h),c.delete(h.getChainArray())},h}}class ef{constructor(){this.data=new WeakMap}get(e){let t=this.data.get(e);return void 0===t&&(t={},this.data.set(e,t)),t}delete(e){let t=null;return this.data.has(e)&&(t=this.data.get(e),this.data.delete(e)),t}has(e){return this.data.has(e)}dispose(){this.data=new WeakMap}}const tf=1,rf=2,sf=3,nf=4,af=16;class of extends ef{constructor(e){super(),this.backend=e}delete(e){const t=super.delete(e);return null!==t&&this.backend.destroyAttribute(e),t}update(e,t){const r=this.get(e);if(void 0===r.version)t===tf?this.backend.createAttribute(e):t===rf?this.backend.createIndexAttribute(e):t===sf?this.backend.createStorageAttribute(e):t===nf&&this.backend.createIndirectStorageAttribute(e),r.version=this._getBufferAttribute(e).version;else{const t=this._getBufferAttribute(e);(r.version{this.info.memory.geometries--;const s=t.index,i=e.getAttributes();null!==s&&this.attributes.delete(s);for(const e of i)this.attributes.delete(e);const n=this.wireframes.get(t);void 0!==n&&this.attributes.delete(n),t.removeEventListener("dispose",r)};t.addEventListener("dispose",r)}updateAttributes(e){const t=e.getAttributes();for(const e of t)e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute?this.updateAttribute(e,sf):this.updateAttribute(e,tf);const r=this.getIndex(e);null!==r&&this.updateAttribute(r,rf);const s=e.geometry.indirect;null!==s&&this.updateAttribute(s,nf)}updateAttribute(e,t){const r=this.info.render.calls;e.isInterleavedBufferAttribute?void 0===this.attributeCall.get(e)?(this.attributes.update(e,t),this.attributeCall.set(e,r)):this.attributeCall.get(e.data)!==r&&(this.attributes.update(e,t),this.attributeCall.set(e.data,r),this.attributeCall.set(e,r)):this.attributeCall.get(e)!==r&&(this.attributes.update(e,t),this.attributeCall.set(e,r))}getIndirect(e){return e.geometry.indirect}getIndex(e){const{geometry:t,material:r}=e;let s=t.index;if(!0===r.wireframe){const e=this.wireframes;let r=e.get(t);void 0===r?(r=lf(t),e.set(t,r)):r.version!==uf(t)&&(this.attributes.delete(r),r=lf(t),e.set(t,r)),s=r}return s}}class cf{constructor(){this.autoReset=!0,this.frame=0,this.calls=0,this.render={calls:0,frameCalls:0,drawCalls:0,triangles:0,points:0,lines:0,timestamp:0},this.compute={calls:0,frameCalls:0,timestamp:0},this.memory={geometries:0,textures:0}}update(e,t,r){this.render.drawCalls++,e.isMesh||e.isSprite?this.render.triangles+=r*(t/3):e.isPoints?this.render.points+=r*t:e.isLineSegments?this.render.lines+=r*(t/2):e.isLine?this.render.lines+=r*(t-1):console.error("THREE.WebGPUInfo: Unknown object type.")}reset(){this.render.drawCalls=0,this.render.frameCalls=0,this.compute.frameCalls=0,this.render.triangles=0,this.render.points=0,this.render.lines=0}dispose(){this.reset(),this.calls=0,this.render.calls=0,this.compute.calls=0,this.render.timestamp=0,this.compute.timestamp=0,this.memory.geometries=0,this.memory.textures=0}}class hf{constructor(e){this.cacheKey=e,this.usedTimes=0}}class pf extends hf{constructor(e,t,r){super(e),this.vertexProgram=t,this.fragmentProgram=r}}class gf extends hf{constructor(e,t){super(e),this.computeProgram=t,this.isComputePipeline=!0}}let mf=0;class ff{constructor(e,t,r,s=null,i=null){this.id=mf++,this.code=e,this.stage=t,this.name=r,this.transforms=s,this.attributes=i,this.usedTimes=0}}class yf extends ef{constructor(e,t){super(),this.backend=e,this.nodes=t,this.bindings=null,this.caches=new Map,this.programs={vertex:new Map,fragment:new Map,compute:new Map}}getForCompute(e,t){const{backend:r}=this,s=this.get(e);if(this._needsComputeUpdate(e)){const i=s.pipeline;i&&(i.usedTimes--,i.computeProgram.usedTimes--);const n=this.nodes.getForCompute(e);let a=this.programs.compute.get(n.computeShader);void 0===a&&(i&&0===i.computeProgram.usedTimes&&this._releaseProgram(i.computeProgram),a=new ff(n.computeShader,"compute",e.name,n.transforms,n.nodeAttributes),this.programs.compute.set(n.computeShader,a),r.createProgram(a));const o=this._getComputeCacheKey(e,a);let u=this.caches.get(o);void 0===u&&(i&&0===i.usedTimes&&this._releasePipeline(i),u=this._getComputePipeline(e,a,o,t)),u.usedTimes++,a.usedTimes++,s.version=e.version,s.pipeline=u}return s.pipeline}getForRender(e,t=null){const{backend:r}=this,s=this.get(e);if(this._needsRenderUpdate(e)){const i=s.pipeline;i&&(i.usedTimes--,i.vertexProgram.usedTimes--,i.fragmentProgram.usedTimes--);const n=e.getNodeBuilderState(),a=e.material?e.material.name:"";let o=this.programs.vertex.get(n.vertexShader);void 0===o&&(i&&0===i.vertexProgram.usedTimes&&this._releaseProgram(i.vertexProgram),o=new ff(n.vertexShader,"vertex",a),this.programs.vertex.set(n.vertexShader,o),r.createProgram(o));let u=this.programs.fragment.get(n.fragmentShader);void 0===u&&(i&&0===i.fragmentProgram.usedTimes&&this._releaseProgram(i.fragmentProgram),u=new ff(n.fragmentShader,"fragment",a),this.programs.fragment.set(n.fragmentShader,u),r.createProgram(u));const l=this._getRenderCacheKey(e,o,u);let d=this.caches.get(l);void 0===d?(i&&0===i.usedTimes&&this._releasePipeline(i),d=this._getRenderPipeline(e,o,u,l,t)):e.pipeline=d,d.usedTimes++,o.usedTimes++,u.usedTimes++,s.pipeline=d}return s.pipeline}delete(e){const t=this.get(e).pipeline;return t&&(t.usedTimes--,0===t.usedTimes&&this._releasePipeline(t),t.isComputePipeline?(t.computeProgram.usedTimes--,0===t.computeProgram.usedTimes&&this._releaseProgram(t.computeProgram)):(t.fragmentProgram.usedTimes--,t.vertexProgram.usedTimes--,0===t.vertexProgram.usedTimes&&this._releaseProgram(t.vertexProgram),0===t.fragmentProgram.usedTimes&&this._releaseProgram(t.fragmentProgram))),super.delete(e)}dispose(){super.dispose(),this.caches=new Map,this.programs={vertex:new Map,fragment:new Map,compute:new Map}}updateForRender(e){this.getForRender(e)}_getComputePipeline(e,t,r,s){r=r||this._getComputeCacheKey(e,t);let i=this.caches.get(r);return void 0===i&&(i=new gf(r,t),this.caches.set(r,i),this.backend.createComputePipeline(i,s)),i}_getRenderPipeline(e,t,r,s,i){s=s||this._getRenderCacheKey(e,t,r);let n=this.caches.get(s);return void 0===n&&(n=new pf(s,t,r),this.caches.set(s,n),e.pipeline=n,this.backend.createRenderPipeline(e,i)),n}_getComputeCacheKey(e,t){return e.id+","+t.id}_getRenderCacheKey(e,t,r){return t.id+","+r.id+","+this.backend.getRenderCacheKey(e)}_releasePipeline(e){this.caches.delete(e.cacheKey)}_releaseProgram(e){const t=e.code,r=e.stage;this.programs[r].delete(t)}_needsComputeUpdate(e){const t=this.get(e);return void 0===t.pipeline||t.version!==e.version}_needsRenderUpdate(e){return void 0===this.get(e).pipeline||this.backend.needsRenderUpdate(e)}}class bf extends ef{constructor(e,t,r,s,i,n){super(),this.backend=e,this.textures=r,this.pipelines=i,this.attributes=s,this.nodes=t,this.info=n,this.pipelines.bindings=this}getForRender(e){const t=e.getBindings();for(const e of t){const r=this.get(e);void 0===r.bindGroup&&(this._init(e),this.backend.createBindings(e,t,0),r.bindGroup=e)}return t}getForCompute(e){const t=this.nodes.getForCompute(e).bindings;for(const e of t){const r=this.get(e);void 0===r.bindGroup&&(this._init(e),this.backend.createBindings(e,t,0),r.bindGroup=e)}return t}updateForCompute(e){this._updateBindings(this.getForCompute(e))}updateForRender(e){this._updateBindings(this.getForRender(e))}_updateBindings(e){for(const t of e)this._update(t,e)}_init(e){for(const t of e.bindings)if(t.isSampledTexture)this.textures.updateTexture(t.texture);else if(t.isStorageBuffer){const e=t.attribute,r=e.isIndirectStorageBufferAttribute?nf:sf;this.attributes.update(e,r)}}_update(e,t){const{backend:r}=this;let s=!1,i=!0,n=0,a=0;for(const t of e.bindings){if(t.isNodeUniformsGroup){if(!1===this.nodes.updateGroup(t))continue}if(t.isStorageBuffer){const e=t.attribute,r=e.isIndirectStorageBufferAttribute?nf:sf;this.attributes.update(e,r)}if(t.isUniformBuffer){t.update()&&r.updateBinding(t)}else if(t.isSampler)t.update();else if(t.isSampledTexture){const e=this.textures.get(t.texture);t.needsBindingsUpdate(e.generation)&&(s=!0);const o=t.update(),u=t.texture;o&&this.textures.updateTexture(u);const l=r.get(u);if(void 0!==l.externalTexture||e.isDefaultTexture?i=!1:(n=10*n+u.id,a+=u.version),!0===r.isWebGPUBackend&&void 0===l.texture&&void 0===l.externalTexture&&(console.error("Bindings._update: binding should be available:",t,o,u,t.textureNode.value,s),this.textures.updateTexture(u),s=!0),!0===u.isStorageTexture){const e=this.get(u);!0===t.store?e.needsMipmap=!0:this.textures.needsMipmaps(u)&&!0===e.needsMipmap&&(this.backend.generateMipmaps(u),e.needsMipmap=!1)}}}!0===s&&this.backend.updateBindings(e,t,i?n:0,a)}}function xf(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?e.z-t.z:e.id-t.id}function Tf(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function _f(e){return(e.transmission>0||e.transmissionNode)&&e.side===Se&&!1===e.forceSinglePass}class vf{constructor(e,t,r){this.renderItems=[],this.renderItemsIndex=0,this.opaque=[],this.transparentDoublePass=[],this.transparent=[],this.bundles=[],this.lightsNode=e.getNode(t,r),this.lightsArray=[],this.scene=t,this.camera=r,this.occlusionQueryCount=0}begin(){return this.renderItemsIndex=0,this.opaque.length=0,this.transparentDoublePass.length=0,this.transparent.length=0,this.bundles.length=0,this.lightsArray.length=0,this.occlusionQueryCount=0,this}getNextRenderItem(e,t,r,s,i,n,a){let o=this.renderItems[this.renderItemsIndex];return void 0===o?(o={id:e.id,object:e,geometry:t,material:r,groupOrder:s,renderOrder:e.renderOrder,z:i,group:n,clippingContext:a},this.renderItems[this.renderItemsIndex]=o):(o.id=e.id,o.object=e,o.geometry=t,o.material=r,o.groupOrder=s,o.renderOrder=e.renderOrder,o.z=i,o.group=n,o.clippingContext=a),this.renderItemsIndex++,o}push(e,t,r,s,i,n,a){const o=this.getNextRenderItem(e,t,r,s,i,n,a);!0===e.occlusionTest&&this.occlusionQueryCount++,!0===r.transparent||r.transmission>0?(_f(r)&&this.transparentDoublePass.push(o),this.transparent.push(o)):this.opaque.push(o)}unshift(e,t,r,s,i,n,a){const o=this.getNextRenderItem(e,t,r,s,i,n,a);!0===r.transparent||r.transmission>0?(_f(r)&&this.transparentDoublePass.unshift(o),this.transparent.unshift(o)):this.opaque.unshift(o)}pushBundle(e){this.bundles.push(e)}pushLight(e){this.lightsArray.push(e)}sort(e,t){this.opaque.length>1&&this.opaque.sort(e||xf),this.transparentDoublePass.length>1&&this.transparentDoublePass.sort(t||Tf),this.transparent.length>1&&this.transparent.sort(t||Tf)}finish(){this.lightsNode.setLights(this.lightsArray);for(let e=this.renderItemsIndex,t=this.renderItems.length;e>t,u=a.height>>t;let l=e.depthTexture||i[t];const d=!0===e.depthBuffer||!0===e.stencilBuffer;let c=!1;void 0===l&&d&&(l=new V,l.format=e.stencilBuffer?we:Ae,l.type=e.stencilBuffer?Re:T,l.image.width=o,l.image.height=u,l.image.depth=a.depth,l.isArrayTexture=!0===e.multiview&&a.depth>1,i[t]=l),r.width===a.width&&a.height===r.height||(c=!0,l&&(l.needsUpdate=!0,l.image.width=o,l.image.height=u,l.image.depth=l.isArrayTexture?l.image.depth:1)),r.width=a.width,r.height=a.height,r.textures=n,r.depthTexture=l||null,r.depth=e.depthBuffer,r.stencil=e.stencilBuffer,r.renderTarget=e,r.sampleCount!==s&&(c=!0,l&&(l.needsUpdate=!0),r.sampleCount=s);const h={sampleCount:s};if(!0!==e.isXRRenderTarget){for(let e=0;e{e.removeEventListener("dispose",t);for(let e=0;e0){const s=e.image;if(void 0===s)console.warn("THREE.Renderer: Texture marked for update but image is undefined.");else if(!1===s.complete)console.warn("THREE.Renderer: Texture marked for update but image is incomplete.");else{if(e.images){const r=[];for(const t of e.images)r.push(t);t.images=r}else t.image=s;void 0!==r.isDefaultTexture&&!0!==r.isDefaultTexture||(i.createTexture(e,t),r.isDefaultTexture=!1,r.generation=e.version),!0===e.source.dataReady&&i.updateTexture(e,t),t.needsMipmaps&&0===e.mipmaps.length&&i.generateMipmaps(e)}}else i.createDefaultTexture(e),r.isDefaultTexture=!0,r.generation=e.version}if(!0!==r.initialized){r.initialized=!0,r.generation=e.version,this.info.memory.textures++;const t=()=>{e.removeEventListener("dispose",t),this._destroyTexture(e)};e.addEventListener("dispose",t)}r.version=e.version}getSize(e,t=Lf){let r=e.images?e.images[0]:e.image;return r?(void 0!==r.image&&(r=r.image),t.width=r.width||1,t.height=r.height||1,t.depth=e.isCubeTexture?6:r.depth||1):t.width=t.height=t.depth=1,t}getMipLevels(e,t,r){let s;return s=e.isCompressedTexture?e.mipmaps?e.mipmaps.length:1:Math.floor(Math.log2(Math.max(t,r)))+1,s}needsMipmaps(e){return!0===e.isCompressedTexture||e.generateMipmaps}_destroyTexture(e){!0===this.has(e)&&(this.backend.destroySampler(e),this.backend.destroyTexture(e),this.delete(e),this.info.memory.textures--)}}class Bf extends e{constructor(e,t,r,s=1){super(e,t,r),this.a=s}set(e,t,r,s=1){return this.a=s,super.set(e,t,r)}copy(e){return void 0!==e.a&&(this.a=e.a),super.copy(e)}clone(){return new this.constructor(this.r,this.g,this.b,this.a)}}class If extends gn{static get type(){return"ParameterNode"}constructor(e,t=null){super(e,t),this.isParameterNode=!0}getHash(){return this.uuid}generate(){return this.name}}class Df extends js{static get type(){return"StackNode"}constructor(e=null){super(),this.nodes=[],this.outputNode=null,this.parent=e,this._currentCond=null,this._expressionNode=null,this.isStackNode=!0}getNodeType(e){return this.outputNode?this.outputNode.getNodeType(e):"void"}getMemberType(e,t){return this.outputNode?this.outputNode.getMemberType(e,t):"void"}add(e){return this.nodes.push(e),this}If(e,t){const r=new Fi(t);return this._currentCond=Xo(e,r),this.add(this._currentCond)}ElseIf(e,t){const r=new Fi(t),s=Xo(e,r);return this._currentCond.elseNode=s,this._currentCond=s,this}Else(e){return this._currentCond.elseNode=new Fi(e),this}Switch(e){return this._expressionNode=Bi(e),this}Case(...e){const t=[];if(!(e.length>=2))throw new Error("TSL: Invalid parameter length. Case() requires at least two parameters.");for(let r=0;r"string"==typeof t?{name:e,type:t,atomic:!1}:{name:e,type:t.type,atomic:t.atomic||!1}))),this.name=t,this.isStructLayoutNode=!0}getLength(){const e=Float32Array.BYTES_PER_ELEMENT;let t=0;for(const r of this.membersLayout){const s=r.type,i=Rs(s)*e,n=t%8,a=n%Cs(s),o=n+a;t+=a,0!==o&&8-oe.name===t));return r?r.type:"void"}getNodeType(e){return e.getStructTypeFromNode(this,this.membersLayout,this.name).name}setup(e){e.addInclude(this)}generate(e){return this.getNodeType(e)}}class Of extends js{static get type(){return"StructNode"}constructor(e,t){super("vec3"),this.structLayoutNode=e,this.values=t,this.isStructNode=!0}getNodeType(e){return this.structLayoutNode.getNodeType(e)}getMemberType(e,t){return this.structLayoutNode.getMemberType(e,t)}generate(e){const t=e.getVarFromNode(this),r=t.type,s=e.getPropertyName(t);return e.addLineFlowCode(`${s} = ${e.generateStruct(r,this.structLayoutNode.membersLayout,this.values)}`,this),t.name}}class kf extends js{static get type(){return"OutputStructNode"}constructor(...e){super(),this.members=e,this.isOutputStructNode=!0}getNodeType(e){const t=e.getNodeProperties(this);if(void 0===t.membersLayout){const r=this.members,s=[];for(let t=0;t{const t=e.toUint().mul(747796405).add(2891336453),r=t.shiftRight(t.shiftRight(28).add(4)).bitXor(t).mul(277803737);return r.shiftRight(22).bitXor(r).toFloat().mul(1/2**32)})),jf=(e,t)=>Ro(la(4,e.mul(ua(1,e))),t),qf=ki((([e])=>e.fract().sub(.5).abs())).setLayout({name:"tri",type:"float",inputs:[{name:"x",type:"float"}]}),Xf=ki((([e])=>en(qf(e.z.add(qf(e.y.mul(1)))),qf(e.z.add(qf(e.x.mul(1)))),qf(e.y.add(qf(e.x.mul(1))))))).setLayout({name:"tri3",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),Kf=ki((([e,t,r])=>{const s=en(e).toVar(),i=ji(1.4).toVar(),n=ji(0).toVar(),a=en(s).toVar();return Zc({start:ji(0),end:ji(3),type:"float",condition:"<="},(()=>{const e=en(Xf(a.mul(2))).toVar();s.addAssign(e.add(r.mul(ji(.1).mul(t)))),a.mulAssign(1.8),i.mulAssign(1.5),s.mulAssign(1.2);const o=ji(qf(s.z.add(qf(s.x.add(qf(s.y)))))).toVar();n.addAssign(o.div(i)),a.addAssign(.14)})),n})).setLayout({name:"triNoise3D",type:"float",inputs:[{name:"position",type:"vec3"},{name:"speed",type:"float"},{name:"time",type:"float"}]});class Yf extends js{static get type(){return"FunctionOverloadingNode"}constructor(e=[],...t){super(),this.functionNodes=e,this.parametersNodes=t,this._candidateFnCall=null,this.global=!0}getNodeType(){return this.functionNodes[0].shaderNode.layout.type}setup(e){const t=this.parametersNodes;let r=this._candidateFnCall;if(null===r){let s=null,i=-1;for(const r of this.functionNodes){const n=r.shaderNode.layout;if(null===n)throw new Error("FunctionOverloadingNode: FunctionNode must be a layout.");const a=n.inputs;if(t.length===a.length){let n=0;for(let r=0;ri&&(s=r,i=n)}}this._candidateFnCall=r=s(...t)}return r}}const Qf=Vi(Yf),Zf=e=>(...t)=>Qf(e,...t),Jf=Zn(0).setGroup(Kn).onRenderUpdate((e=>e.time)),ey=Zn(0).setGroup(Kn).onRenderUpdate((e=>e.deltaTime)),ty=Zn(0,"uint").setGroup(Kn).onRenderUpdate((e=>e.frameId)),ry=ki((([e,t,r=Yi(.5)])=>Im(e.sub(r),t).add(r))),sy=ki((([e,t,r=Yi(.5)])=>{const s=e.sub(r),i=s.dot(s),n=i.mul(i).mul(t);return e.add(s.mul(n))})),iy=ki((({position:e=null,horizontal:t=!0,vertical:r=!1})=>{let s;null!==e?(s=El.toVar(),s[3][0]=e.x,s[3][1]=e.y,s[3][2]=e.z):s=El;const i=cl.mul(s);return Pi(t)&&(i[0][0]=El[0].length(),i[0][1]=0,i[0][2]=0),Pi(r)&&(i[1][0]=0,i[1][1]=El[1].length(),i[1][2]=0),i[2][0]=0,i[2][1]=0,i[2][2]=1,ll.mul(i).mul(Vl)})),ny=ki((([e=null])=>{const t=Vh();return Vh(Ch(e)).sub(t).lessThan(0).select(ph,e)}));class ay extends js{static get type(){return"SpriteSheetUVNode"}constructor(e,t=$u(),r=ji(0)){super("vec2"),this.countNode=e,this.uvNode=t,this.frameNode=r}setup(){const{frameNode:e,uvNode:t,countNode:r}=this,{width:s,height:i}=r,n=e.mod(s.mul(i)).floor(),a=n.mod(s),o=i.sub(n.add(1).div(s).ceil()),u=r.reciprocal(),l=Yi(a,o);return t.add(l).mul(u)}}const oy=Vi(ay).setParameterLength(3);class uy extends js{static get type(){return"TriplanarTexturesNode"}constructor(e,t=null,r=null,s=ji(1),i=Vl,n=ql){super("vec4"),this.textureXNode=e,this.textureYNode=t,this.textureZNode=r,this.scaleNode=s,this.positionNode=i,this.normalNode=n}setup(){const{textureXNode:e,textureYNode:t,textureZNode:r,scaleNode:s,positionNode:i,normalNode:n}=this;let a=n.abs().normalize();a=a.div(a.dot(en(1)));const o=i.yz.mul(s),u=i.zx.mul(s),l=i.xy.mul(s),d=e.value,c=null!==t?t.value:d,h=null!==r?r.value:d,p=Zu(d,o).mul(a.x),g=Zu(c,u).mul(a.y),m=Zu(h,l).mul(a.z);return oa(p,g,m)}}const ly=Vi(uy).setParameterLength(1,6),dy=new Me,cy=new r,hy=new r,py=new r,gy=new a,my=new r(0,0,-1),fy=new s,yy=new r,by=new r,xy=new s,Ty=new t,_y=new oe,vy=ph.flipX();_y.depthTexture=new V(1,1);let Ny=!1;class Sy extends Yu{static get type(){return"ReflectorNode"}constructor(e={}){super(e.defaultTexture||_y.texture,vy),this._reflectorBaseNode=e.reflector||new Ey(this,e),this._depthNode=null,this.setUpdateMatrix(!1)}get reflector(){return this._reflectorBaseNode}get target(){return this._reflectorBaseNode.target}getDepthNode(){if(null===this._depthNode){if(!0!==this._reflectorBaseNode.depth)throw new Error("THREE.ReflectorNode: Depth node can only be requested when the reflector is created with { depth: true }. ");this._depthNode=Bi(new Sy({defaultTexture:_y.depthTexture,reflector:this._reflectorBaseNode}))}return this._depthNode}setup(e){return e.object.isQuadMesh||this._reflectorBaseNode.build(e),super.setup(e)}clone(){const e=new this.constructor(this.reflectorNode);return e._reflectorBaseNode=this._reflectorBaseNode,e}dispose(){super.dispose(),this._reflectorBaseNode.dispose()}}class Ey extends js{static get type(){return"ReflectorBaseNode"}constructor(e,t={}){super();const{target:r=new Pe,resolution:s=1,generateMipmaps:i=!1,bounces:n=!0,depth:a=!1}=t;this.textureNode=e,this.target=r,this.resolution=s,this.generateMipmaps=i,this.bounces=n,this.depth=a,this.updateBeforeType=n?Vs.RENDER:Vs.FRAME,this.virtualCameras=new WeakMap,this.renderTargets=new Map,this.forceUpdate=!1,this.hasOutput=!1}_updateResolution(e,t){const r=this.resolution;t.getDrawingBufferSize(Ty),e.setSize(Math.round(Ty.width*r),Math.round(Ty.height*r))}setup(e){return this._updateResolution(_y,e.renderer),super.setup(e)}dispose(){super.dispose();for(const e of this.renderTargets.values())e.dispose()}getVirtualCamera(e){let t=this.virtualCameras.get(e);return void 0===t&&(t=e.clone(),this.virtualCameras.set(e,t)),t}getRenderTarget(e){let t=this.renderTargets.get(e);return void 0===t&&(t=new oe(0,0,{type:de}),!0===this.generateMipmaps&&(t.texture.minFilter=Le,t.texture.generateMipmaps=!0),!0===this.depth&&(t.depthTexture=new V),this.renderTargets.set(e,t)),t}updateBefore(e){if(!1===this.bounces&&Ny)return!1;Ny=!0;const{scene:t,camera:r,renderer:s,material:i}=e,{target:n}=this,a=this.getVirtualCamera(r),o=this.getRenderTarget(a);s.getDrawingBufferSize(Ty),this._updateResolution(o,s),hy.setFromMatrixPosition(n.matrixWorld),py.setFromMatrixPosition(r.matrixWorld),gy.extractRotation(n.matrixWorld),cy.set(0,0,1),cy.applyMatrix4(gy),yy.subVectors(hy,py);let u=!1;if(!0===yy.dot(cy)>0&&!1===this.forceUpdate){if(!1===this.hasOutput)return void(Ny=!1);u=!0}yy.reflect(cy).negate(),yy.add(hy),gy.extractRotation(r.matrixWorld),my.set(0,0,-1),my.applyMatrix4(gy),my.add(py),by.subVectors(hy,my),by.reflect(cy).negate(),by.add(hy),a.coordinateSystem=r.coordinateSystem,a.position.copy(yy),a.up.set(0,1,0),a.up.applyMatrix4(gy),a.up.reflect(cy),a.lookAt(by),a.near=r.near,a.far=r.far,a.updateMatrixWorld(),a.projectionMatrix.copy(r.projectionMatrix),dy.setFromNormalAndCoplanarPoint(cy,hy),dy.applyMatrix4(a.matrixWorldInverse),fy.set(dy.normal.x,dy.normal.y,dy.normal.z,dy.constant);const l=a.projectionMatrix;xy.x=(Math.sign(fy.x)+l.elements[8])/l.elements[0],xy.y=(Math.sign(fy.y)+l.elements[9])/l.elements[5],xy.z=-1,xy.w=(1+l.elements[10])/l.elements[14],fy.multiplyScalar(1/fy.dot(xy));l.elements[2]=fy.x,l.elements[6]=fy.y,l.elements[10]=s.coordinateSystem===d?fy.z-0:fy.z+1-0,l.elements[14]=fy.w,this.textureNode.value=o.texture,!0===this.depth&&(this.textureNode.getDepthNode().value=o.depthTexture),i.visible=!1;const c=s.getRenderTarget(),h=s.getMRT(),p=s.autoClear;s.setMRT(null),s.setRenderTarget(o),s.autoClear=!0,u?(s.clear(),this.hasOutput=!1):(s.render(t,a),this.hasOutput=!0),s.setMRT(h),s.setRenderTarget(c),s.autoClear=p,i.visible=!0,Ny=!1,this.forceUpdate=!1}}const wy=new ne(-1,1,1,-1,0,1);class Ay extends he{constructor(e=!1){super();const t=!1===e?[0,-1,0,1,2,1]:[0,2,0,0,2,0];this.setAttribute("position",new Fe([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Fe(t,2))}}const Ry=new Ay;class Cy extends q{constructor(e=null){super(Ry,e),this.camera=wy,this.isQuadMesh=!0}async renderAsync(e){return e.renderAsync(this,wy)}render(e){e.render(this,wy)}}const My=new t;class Py extends Yu{static get type(){return"RTTNode"}constructor(e,t=null,r=null,s={type:de}){const i=new oe(t,r,s);super(i.texture,$u()),this.node=e,this.width=t,this.height=r,this.pixelRatio=1,this.renderTarget=i,this.textureNeedsUpdate=!0,this.autoUpdate=!0,this._rttNode=null,this._quadMesh=new Cy(new Zh),this.updateBeforeType=Vs.RENDER}get autoSize(){return null===this.width}setup(e){return this._rttNode=this.node.context(e.getSharedContext()),this._quadMesh.material.name="RTT",this._quadMesh.material.needsUpdate=!0,super.setup(e)}setSize(e,t){this.width=e,this.height=t;const r=e*this.pixelRatio,s=t*this.pixelRatio;this.renderTarget.setSize(r,s),this.textureNeedsUpdate=!0}setPixelRatio(e){this.pixelRatio=e,this.setSize(this.width,this.height)}updateBefore({renderer:e}){if(!1===this.textureNeedsUpdate&&!1===this.autoUpdate)return;if(this.textureNeedsUpdate=!1,!0===this.autoSize){this.pixelRatio=e.getPixelRatio();const t=e.getSize(My);this.setSize(t.width,t.height)}this._quadMesh.material.fragmentNode=this._rttNode;const t=e.getRenderTarget();e.setRenderTarget(this.renderTarget),this._quadMesh.render(e),e.setRenderTarget(t)}clone(){const e=new Yu(this.value,this.uvNode,this.levelNode);return e.sampler=this.sampler,e.referenceNode=this,e}}const Ly=(e,...t)=>Bi(new Py(Bi(e),...t)),Fy=ki((([e,t,r],s)=>{let i;s.renderer.coordinateSystem===d?(e=Yi(e.x,e.y.oneMinus()).mul(2).sub(1),i=nn(en(e,t),1)):i=nn(en(e.x,e.y.oneMinus(),t).mul(2).sub(1),1);const n=nn(r.mul(i));return n.xyz.div(n.w)})),By=ki((([e,t])=>{const r=t.mul(nn(e,1)),s=r.xy.div(r.w).mul(.5).add(.5).toVar();return Yi(s.x,s.y.oneMinus())})),Iy=ki((([e,t,r])=>{const s=ju(Ju(t)),i=Qi(e.mul(s)).toVar(),n=Ju(t,i).toVar(),a=Ju(t,i.sub(Qi(2,0))).toVar(),o=Ju(t,i.sub(Qi(1,0))).toVar(),u=Ju(t,i.add(Qi(1,0))).toVar(),l=Ju(t,i.add(Qi(2,0))).toVar(),d=Ju(t,i.add(Qi(0,2))).toVar(),c=Ju(t,i.add(Qi(0,1))).toVar(),h=Ju(t,i.sub(Qi(0,1))).toVar(),p=Ju(t,i.sub(Qi(0,2))).toVar(),g=no(ua(ji(2).mul(o).sub(a),n)).toVar(),m=no(ua(ji(2).mul(u).sub(l),n)).toVar(),f=no(ua(ji(2).mul(c).sub(d),n)).toVar(),y=no(ua(ji(2).mul(h).sub(p),n)).toVar(),b=Fy(e,n,r).toVar(),x=g.lessThan(m).select(b.sub(Fy(e.sub(Yi(ji(1).div(s.x),0)),o,r)),b.negate().add(Fy(e.add(Yi(ji(1).div(s.x),0)),u,r))),T=f.lessThan(y).select(b.sub(Fy(e.add(Yi(0,ji(1).div(s.y))),c,r)),b.negate().add(Fy(e.sub(Yi(0,ji(1).div(s.y))),h,r)));return Qa(Ao(x,T))}));class Dy extends L{constructor(e,t,r=Float32Array){super(ArrayBuffer.isView(e)?e:new r(e*t),t),this.isStorageInstancedBufferAttribute=!0}}class Vy extends pe{constructor(e,t,r=Float32Array){super(ArrayBuffer.isView(e)?e:new r(e*t),t),this.isStorageBufferAttribute=!0}}class Uy extends js{static get type(){return"PointUVNode"}constructor(){super("vec2"),this.isPointUVNode=!0}generate(){return"vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y )"}}const Oy=Ui(Uy),ky=new E,Gy=new a;class zy extends js{static get type(){return"SceneNode"}constructor(e=zy.BACKGROUND_BLURRINESS,t=null){super(),this.scope=e,this.scene=t}setup(e){const t=this.scope,r=null!==this.scene?this.scene:e.scene;let s;return t===zy.BACKGROUND_BLURRINESS?s=yd("backgroundBlurriness","float",r):t===zy.BACKGROUND_INTENSITY?s=yd("backgroundIntensity","float",r):t===zy.BACKGROUND_ROTATION?s=Zn("mat4").label("backgroundRotation").setGroup(Kn).onRenderUpdate((()=>{const e=r.background;return null!==e&&e.isTexture&&e.mapping!==Be?(ky.copy(r.backgroundRotation),ky.x*=-1,ky.y*=-1,ky.z*=-1,Gy.makeRotationFromEuler(ky)):Gy.identity(),Gy})):console.error("THREE.SceneNode: Unknown scope:",t),s}}zy.BACKGROUND_BLURRINESS="backgroundBlurriness",zy.BACKGROUND_INTENSITY="backgroundIntensity",zy.BACKGROUND_ROTATION="backgroundRotation";const Hy=Ui(zy,zy.BACKGROUND_BLURRINESS),$y=Ui(zy,zy.BACKGROUND_INTENSITY),Wy=Ui(zy,zy.BACKGROUND_ROTATION);class jy extends Yu{static get type(){return"StorageTextureNode"}constructor(e,t,r=null){super(e,t),this.storeNode=r,this.isStorageTextureNode=!0,this.access=Os.WRITE_ONLY}getInputType(){return"storageTexture"}setup(e){super.setup(e);const t=e.getNodeProperties(this);return t.storeNode=this.storeNode,t}setAccess(e){return this.access=e,this}generate(e,t){let r;return r=null!==this.storeNode?this.generateStore(e):super.generate(e,t),r}toReadWrite(){return this.setAccess(Os.READ_WRITE)}toReadOnly(){return this.setAccess(Os.READ_ONLY)}toWriteOnly(){return this.setAccess(Os.WRITE_ONLY)}generateStore(e){const t=e.getNodeProperties(this),{uvNode:r,storeNode:s,depthNode:i}=t,n=super.generate(e,"property"),a=r.build(e,"uvec2"),o=s.build(e,"vec4"),u=i?i.build(e,"int"):null,l=e.generateTextureStore(e,n,a,u,o);e.addLineFlowCode(l,this)}clone(){const e=super.clone();return e.storeNode=this.storeNode,e}}const qy=Vi(jy).setParameterLength(1,3),Xy=ki((({texture:e,uv:t})=>{const r=1e-4,s=en().toVar();return Hi(t.x.lessThan(r),(()=>{s.assign(en(1,0,0))})).ElseIf(t.y.lessThan(r),(()=>{s.assign(en(0,1,0))})).ElseIf(t.z.lessThan(r),(()=>{s.assign(en(0,0,1))})).ElseIf(t.x.greaterThan(.9999),(()=>{s.assign(en(-1,0,0))})).ElseIf(t.y.greaterThan(.9999),(()=>{s.assign(en(0,-1,0))})).ElseIf(t.z.greaterThan(.9999),(()=>{s.assign(en(0,0,-1))})).Else((()=>{const r=.01,i=e.sample(t.add(en(-.01,0,0))).r.sub(e.sample(t.add(en(r,0,0))).r),n=e.sample(t.add(en(0,-.01,0))).r.sub(e.sample(t.add(en(0,r,0))).r),a=e.sample(t.add(en(0,0,-.01))).r.sub(e.sample(t.add(en(0,0,r))).r);s.assign(en(i,n,a))})),s.normalize()}));class Ky extends Yu{static get type(){return"Texture3DNode"}constructor(e,t=null,r=null){super(e,t,r),this.isTexture3DNode=!0}getInputType(){return"texture3D"}getDefaultUV(){return en(.5,.5,.5)}setUpdateMatrix(){}setupUV(e,t){const r=this.value;return!e.isFlipY()||!0!==r.isRenderTargetTexture&&!0!==r.isFramebufferTexture||(t=this.sampler?t.flipY():t.setY(qi(ju(this,this.levelNode).y).sub(t.y).sub(1))),t}generateUV(e,t){return t.build(e,"vec3")}normal(e){return Xy({texture:this,uv:e})}}const Yy=Vi(Ky).setParameterLength(1,3);class Qy extends fd{static get type(){return"UserDataNode"}constructor(e,t,r=null){super(e,t,r),this.userData=r}updateReference(e){return this.reference=null!==this.userData?this.userData:e.object.userData,this.reference}}const Zy=new WeakMap;class Jy extends Ks{static get type(){return"VelocityNode"}constructor(){super("vec2"),this.projectionMatrix=null,this.updateType=Vs.OBJECT,this.updateAfterType=Vs.OBJECT,this.previousModelWorldMatrix=Zn(new a),this.previousProjectionMatrix=Zn(new a).setGroup(Kn),this.previousCameraViewMatrix=Zn(new a)}setProjectionMatrix(e){this.projectionMatrix=e}update({frameId:e,camera:t,object:r}){const s=tb(r);this.previousModelWorldMatrix.value.copy(s);const i=eb(t);i.frameId!==e&&(i.frameId=e,void 0===i.previousProjectionMatrix?(i.previousProjectionMatrix=new a,i.previousCameraViewMatrix=new a,i.currentProjectionMatrix=new a,i.currentCameraViewMatrix=new a,i.previousProjectionMatrix.copy(this.projectionMatrix||t.projectionMatrix),i.previousCameraViewMatrix.copy(t.matrixWorldInverse)):(i.previousProjectionMatrix.copy(i.currentProjectionMatrix),i.previousCameraViewMatrix.copy(i.currentCameraViewMatrix)),i.currentProjectionMatrix.copy(this.projectionMatrix||t.projectionMatrix),i.currentCameraViewMatrix.copy(t.matrixWorldInverse),this.previousProjectionMatrix.value.copy(i.previousProjectionMatrix),this.previousCameraViewMatrix.value.copy(i.previousCameraViewMatrix))}updateAfter({object:e}){tb(e).copy(e.matrixWorld)}setup(){const e=null===this.projectionMatrix?ll:Zn(this.projectionMatrix),t=this.previousCameraViewMatrix.mul(this.previousModelWorldMatrix),r=e.mul(Ll).mul(Vl),s=this.previousProjectionMatrix.mul(t).mul(Ul),i=r.xy.div(r.w),n=s.xy.div(s.w);return ua(i,n)}}function eb(e){let t=Zy.get(e);return void 0===t&&(t={},Zy.set(e,t)),t}function tb(e,t=0){const r=eb(e);let s=r[t];return void 0===s&&(r[t]=s=new a,r[t].copy(e.matrixWorld)),s}const rb=Ui(Jy),sb=ki((([e])=>ob(e.rgb))),ib=ki((([e,t=ji(1)])=>t.mix(ob(e.rgb),e.rgb))),nb=ki((([e,t=ji(1)])=>{const r=oa(e.r,e.g,e.b).div(3),s=e.r.max(e.g.max(e.b)),i=s.sub(r).mul(t).mul(-3);return Io(e.rgb,s,i)})),ab=ki((([e,t=ji(1)])=>{const r=en(.57735,.57735,.57735),s=t.cos();return en(e.rgb.mul(s).add(r.cross(e.rgb).mul(t.sin()).add(r.mul(wo(r,e.rgb).mul(s.oneMinus())))))})),ob=(e,t=en(c.getLuminanceCoefficients(new r)))=>wo(e,t),ub=ki((([e,t=en(1),s=en(0),i=en(1),n=ji(1),a=en(c.getLuminanceCoefficients(new r,ue))])=>{const o=e.rgb.dot(en(a)),u=_o(e.rgb.mul(t).add(s),0).toVar(),l=u.pow(i).toVar();return Hi(u.r.greaterThan(0),(()=>{u.r.assign(l.r)})),Hi(u.g.greaterThan(0),(()=>{u.g.assign(l.g)})),Hi(u.b.greaterThan(0),(()=>{u.b.assign(l.b)})),u.assign(o.add(u.sub(o).mul(n))),nn(u.rgb,e.a)}));class lb extends Ks{static get type(){return"PosterizeNode"}constructor(e,t){super(),this.sourceNode=e,this.stepsNode=t}setup(){const{sourceNode:e,stepsNode:t}=this;return e.mul(t).floor().div(t)}}const db=Vi(lb).setParameterLength(2),cb=new t;class hb extends Yu{static get type(){return"PassTextureNode"}constructor(e,t){super(t),this.passNode=e,this.setUpdateMatrix(!1)}setup(e){return e.object.isQuadMesh&&this.passNode.build(e),super.setup(e)}clone(){return new this.constructor(this.passNode,this.value)}}class pb extends hb{static get type(){return"PassMultipleTextureNode"}constructor(e,t,r=!1){super(e,null),this.textureName=t,this.previousTexture=r}updateTexture(){this.value=this.previousTexture?this.passNode.getPreviousTexture(this.textureName):this.passNode.getTexture(this.textureName)}setup(e){return this.updateTexture(),super.setup(e)}clone(){return new this.constructor(this.passNode,this.textureName,this.previousTexture)}}class gb extends Ks{static get type(){return"PassNode"}constructor(e,t,r,s={}){super("vec4"),this.scope=e,this.scene=t,this.camera=r,this.options=s,this._pixelRatio=1,this._width=1,this._height=1;const i=new V;i.isRenderTargetTexture=!0,i.name="depth";const n=new oe(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:de,...s});n.texture.name="output",n.depthTexture=i,this.renderTarget=n,this._textures={output:n.texture,depth:i},this._textureNodes={},this._linearDepthNodes={},this._viewZNodes={},this._previousTextures={},this._previousTextureNodes={},this._cameraNear=Zn(0),this._cameraFar=Zn(0),this._mrt=null,this._layers=null,this._resolution=1,this.isPassNode=!0,this.updateBeforeType=Vs.FRAME,this.global=!0}setResolution(e){return this._resolution=e,this}getResolution(){return this._resolution}setLayers(e){return this._layers=e,this}getLayers(){return this._layers}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}getTexture(e){let t=this._textures[e];if(void 0===t){t=this.renderTarget.texture.clone(),t.name=e,this._textures[e]=t,this.renderTarget.textures.push(t)}return t}getPreviousTexture(e){let t=this._previousTextures[e];return void 0===t&&(t=this.getTexture(e).clone(),this._previousTextures[e]=t),t}toggleTexture(e){const t=this._previousTextures[e];if(void 0!==t){const r=this._textures[e],s=this.renderTarget.textures.indexOf(r);this.renderTarget.textures[s]=t,this._textures[e]=t,this._previousTextures[e]=r,this._textureNodes[e].updateTexture(),this._previousTextureNodes[e].updateTexture()}}getTextureNode(e="output"){let t=this._textureNodes[e];return void 0===t&&(t=Bi(new pb(this,e)),t.updateTexture(),this._textureNodes[e]=t),t}getPreviousTextureNode(e="output"){let t=this._previousTextureNodes[e];return void 0===t&&(void 0===this._textureNodes[e]&&this.getTextureNode(e),t=Bi(new pb(this,e,!0)),t.updateTexture(),this._previousTextureNodes[e]=t),t}getViewZNode(e="depth"){let t=this._viewZNodes[e];if(void 0===t){const r=this._cameraNear,s=this._cameraFar;this._viewZNodes[e]=t=Fh(this.getTextureNode(e),r,s)}return t}getLinearDepthNode(e="depth"){let t=this._linearDepthNodes[e];if(void 0===t){const r=this._cameraNear,s=this._cameraFar,i=this.getViewZNode(e);this._linearDepthNodes[e]=t=Ph(i,r,s)}return t}setup({renderer:e}){return this.renderTarget.samples=void 0===this.options.samples?e.samples:this.options.samples,this.renderTarget.texture.type=e.getColorBufferType(),this.scope===gb.COLOR?this.getTextureNode():this.getLinearDepthNode()}updateBefore(e){const{renderer:t}=e,{scene:r}=this;let s,i;const n=t.getOutputRenderTarget();n&&!0===n.isXRRenderTarget?(i=1,s=t.xr.getCamera(),t.xr.updateCamera(s),cb.set(n.width,n.height)):(s=this.camera,i=t.getPixelRatio(),t.getSize(cb)),this._pixelRatio=i,this.setSize(cb.width,cb.height);const a=t.getRenderTarget(),o=t.getMRT(),u=s.layers.mask;this._cameraNear.value=s.near,this._cameraFar.value=s.far,null!==this._layers&&(s.layers.mask=this._layers.mask);for(const e in this._previousTextures)this.toggleTexture(e);t.setRenderTarget(this.renderTarget),t.setMRT(this._mrt),t.render(r,s),t.setRenderTarget(a),t.setMRT(o),s.layers.mask=u}setSize(e,t){this._width=e,this._height=t;const r=this._width*this._pixelRatio*this._resolution,s=this._height*this._pixelRatio*this._resolution;this.renderTarget.setSize(r,s)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget.dispose()}}gb.COLOR="color",gb.DEPTH="depth";class mb extends gb{static get type(){return"ToonOutlinePassNode"}constructor(e,t,r,s,i){super(gb.COLOR,e,t),this.colorNode=r,this.thicknessNode=s,this.alphaNode=i,this._materialCache=new WeakMap}updateBefore(e){const{renderer:t}=e,r=t.getRenderObjectFunction();t.setRenderObjectFunction(((e,r,s,i,n,a,o,u)=>{if((n.isMeshToonMaterial||n.isMeshToonNodeMaterial)&&!1===n.wireframe){const l=this._getOutlineMaterial(n);t.renderObject(e,r,s,i,l,a,o,u)}t.renderObject(e,r,s,i,n,a,o,u)})),super.updateBefore(e),t.setRenderObjectFunction(r)}_createMaterial(){const e=new Zh;e.isMeshToonOutlineMaterial=!0,e.name="Toon_Outline",e.side=S;const t=ql.negate(),r=ll.mul(Ll),s=ji(1),i=r.mul(nn(Vl,1)),n=r.mul(nn(Vl.add(t),1)),a=Qa(i.sub(n));return e.vertexNode=i.add(a.mul(this.thicknessNode).mul(i.w).mul(s)),e.colorNode=nn(this.colorNode,this.alphaNode),e}_getOutlineMaterial(e){let t=this._materialCache.get(e);return void 0===t&&(t=this._createMaterial(),this._materialCache.set(e,t)),t}}const fb=ki((([e,t])=>e.mul(t).clamp())).setLayout({name:"linearToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),yb=ki((([e,t])=>(e=e.mul(t)).div(e.add(1)).clamp())).setLayout({name:"reinhardToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),bb=ki((([e,t])=>{const r=(e=(e=e.mul(t)).sub(.004).max(0)).mul(e.mul(6.2).add(.5)),s=e.mul(e.mul(6.2).add(1.7)).add(.06);return r.div(s).pow(2.2)})).setLayout({name:"cineonToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),xb=ki((([e])=>{const t=e.mul(e.add(.0245786)).sub(90537e-9),r=e.mul(e.add(.432951).mul(.983729)).add(.238081);return t.div(r)})),Tb=ki((([e,t])=>{const r=dn(.59719,.35458,.04823,.076,.90834,.01566,.0284,.13383,.83777),s=dn(1.60475,-.53108,-.07367,-.10208,1.10813,-.00605,-.00327,-.07276,1.07602);return e=e.mul(t).div(.6),e=r.mul(e),e=xb(e),(e=s.mul(e)).clamp()})).setLayout({name:"acesFilmicToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),_b=dn(en(1.6605,-.1246,-.0182),en(-.5876,1.1329,-.1006),en(-.0728,-.0083,1.1187)),vb=dn(en(.6274,.0691,.0164),en(.3293,.9195,.088),en(.0433,.0113,.8956)),Nb=ki((([e])=>{const t=en(e).toVar(),r=en(t.mul(t)).toVar(),s=en(r.mul(r)).toVar();return ji(15.5).mul(s.mul(r)).sub(la(40.14,s.mul(t))).add(la(31.96,s).sub(la(6.868,r.mul(t))).add(la(.4298,r).add(la(.1191,t).sub(.00232))))})),Sb=ki((([e,t])=>{const r=en(e).toVar(),s=dn(en(.856627153315983,.137318972929847,.11189821299995),en(.0951212405381588,.761241990602591,.0767994186031903),en(.0482516061458583,.101439036467562,.811302368396859)),i=dn(en(1.1271005818144368,-.1413297634984383,-.14132976349843826),en(-.11060664309660323,1.157823702216272,-.11060664309660294),en(-.016493938717834573,-.016493938717834257,1.2519364065950405)),n=ji(-12.47393),a=ji(4.026069);return r.mulAssign(t),r.assign(vb.mul(r)),r.assign(s.mul(r)),r.assign(_o(r,1e-10)),r.assign(ja(r)),r.assign(r.sub(n).div(a.sub(n))),r.assign(Do(r,0,1)),r.assign(Nb(r)),r.assign(i.mul(r)),r.assign(Ro(_o(en(0),r),en(2.2))),r.assign(_b.mul(r)),r.assign(Do(r,0,1)),r})).setLayout({name:"agxToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),Eb=ki((([e,t])=>{const r=ji(.76),s=ji(.15);e=e.mul(t);const i=To(e.r,To(e.g,e.b)),n=Xo(i.lessThan(.08),i.sub(la(6.25,i.mul(i))),.04);e.subAssign(n);const a=_o(e.r,_o(e.g,e.b));Hi(a.lessThan(r),(()=>e));const o=ua(1,r),u=ua(1,o.mul(o).div(a.add(o.sub(r))));e.mulAssign(u.div(a));const l=ua(1,da(1,s.mul(a.sub(u)).add(1)));return Io(e,en(u),l)})).setLayout({name:"neutralToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]});class wb extends js{static get type(){return"CodeNode"}constructor(e="",t=[],r=""){super("code"),this.isCodeNode=!0,this.global=!0,this.code=e,this.includes=t,this.language=r}setIncludes(e){return this.includes=e,this}getIncludes(){return this.includes}generate(e){const t=this.getIncludes(e);for(const r of t)r.build(e);const r=e.getCodeFromNode(this,this.getNodeType(e));return r.code=this.code,r.code}serialize(e){super.serialize(e),e.code=this.code,e.language=this.language}deserialize(e){super.deserialize(e),this.code=e.code,this.language=e.language}}const Ab=Vi(wb).setParameterLength(1,3);class Rb extends wb{static get type(){return"FunctionNode"}constructor(e="",t=[],r=""){super(e,t,r)}getNodeType(e){return this.getNodeFunction(e).type}getInputs(e){return this.getNodeFunction(e).inputs}getNodeFunction(e){const t=e.getDataFromNode(this);let r=t.nodeFunction;return void 0===r&&(r=e.parser.parseFunction(this.code),t.nodeFunction=r),r}generate(e,t){super.generate(e);const r=this.getNodeFunction(e),s=r.name,i=r.type,n=e.getCodeFromNode(this,i);""!==s&&(n.name=s);const a=e.getPropertyName(n),o=this.getNodeFunction(e).getCode(a);return n.code=o+"\n","property"===t?a:e.format(`${a}()`,i,t)}}const Cb=(e,t=[],r="")=>{for(let e=0;es.call(...e);return i.functionNode=s,i};class Mb extends js{static get type(){return"ScriptableValueNode"}constructor(e=null){super(),this._value=e,this._cache=null,this.inputType=null,this.outputType=null,this.events=new o,this.isScriptableValueNode=!0}get isScriptableOutputNode(){return null!==this.outputType}set value(e){this._value!==e&&(this._cache&&"URL"===this.inputType&&this.value.value instanceof ArrayBuffer&&(URL.revokeObjectURL(this._cache),this._cache=null),this._value=e,this.events.dispatchEvent({type:"change"}),this.refresh())}get value(){return this._value}refresh(){this.events.dispatchEvent({type:"refresh"})}getValue(){const e=this.value;if(e&&null===this._cache&&"URL"===this.inputType&&e.value instanceof ArrayBuffer)this._cache=URL.createObjectURL(new Blob([e.value]));else if(e&&null!==e.value&&void 0!==e.value&&(("URL"===this.inputType||"String"===this.inputType)&&"string"==typeof e.value||"Number"===this.inputType&&"number"==typeof e.value||"Vector2"===this.inputType&&e.value.isVector2||"Vector3"===this.inputType&&e.value.isVector3||"Vector4"===this.inputType&&e.value.isVector4||"Color"===this.inputType&&e.value.isColor||"Matrix3"===this.inputType&&e.value.isMatrix3||"Matrix4"===this.inputType&&e.value.isMatrix4))return e.value;return this._cache||e}getNodeType(e){return this.value&&this.value.isNode?this.value.getNodeType(e):"float"}setup(){return this.value&&this.value.isNode?this.value:ji()}serialize(e){super.serialize(e),null!==this.value?"ArrayBuffer"===this.inputType?e.value=Fs(this.value):e.value=this.value?this.value.toJSON(e.meta).uuid:null:e.value=null,e.inputType=this.inputType,e.outputType=this.outputType}deserialize(e){super.deserialize(e);let t=null;null!==e.value&&(t="ArrayBuffer"===e.inputType?Bs(e.value):"Texture"===e.inputType?e.meta.textures[e.value]:e.meta.nodes[e.value]||null),this.value=t,this.inputType=e.inputType,this.outputType=e.outputType}}const Pb=Vi(Mb).setParameterLength(1);class Lb extends Map{get(e,t=null,...r){if(this.has(e))return super.get(e);if(null!==t){const s=t(...r);return this.set(e,s),s}}}class Fb{constructor(e){this.scriptableNode=e}get parameters(){return this.scriptableNode.parameters}get layout(){return this.scriptableNode.getLayout()}getInputLayout(e){return this.scriptableNode.getInputLayout(e)}get(e){const t=this.parameters[e];return t?t.getValue():null}}const Bb=new Lb;class Ib extends js{static get type(){return"ScriptableNode"}constructor(e=null,t={}){super(),this.codeNode=e,this.parameters=t,this._local=new Lb,this._output=Pb(null),this._outputs={},this._source=this.source,this._method=null,this._object=null,this._value=null,this._needsOutputUpdate=!0,this.onRefresh=this.onRefresh.bind(this),this.isScriptableNode=!0}get source(){return this.codeNode?this.codeNode.code:""}setLocal(e,t){return this._local.set(e,t)}getLocal(e){return this._local.get(e)}onRefresh(){this._refresh()}getInputLayout(e){for(const t of this.getLayout())if(t.inputType&&(t.id===e||t.name===e))return t}getOutputLayout(e){for(const t of this.getLayout())if(t.outputType&&(t.id===e||t.name===e))return t}setOutput(e,t){const r=this._outputs;return void 0===r[e]?r[e]=Pb(t):r[e].value=t,this}getOutput(e){return this._outputs[e]}getParameter(e){return this.parameters[e]}setParameter(e,t){const r=this.parameters;return t&&t.isScriptableNode?(this.deleteParameter(e),r[e]=t,r[e].getDefaultOutput().events.addEventListener("refresh",this.onRefresh)):t&&t.isScriptableValueNode?(this.deleteParameter(e),r[e]=t,r[e].events.addEventListener("refresh",this.onRefresh)):void 0===r[e]?(r[e]=Pb(t),r[e].events.addEventListener("refresh",this.onRefresh)):r[e].value=t,this}getValue(){return this.getDefaultOutput().getValue()}deleteParameter(e){let t=this.parameters[e];return t&&(t.isScriptableNode&&(t=t.getDefaultOutput()),t.events.removeEventListener("refresh",this.onRefresh)),this}clearParameters(){for(const e of Object.keys(this.parameters))this.deleteParameter(e);return this.needsUpdate=!0,this}call(e,...t){const r=this.getObject()[e];if("function"==typeof r)return r(...t)}async callAsync(e,...t){const r=this.getObject()[e];if("function"==typeof r)return"AsyncFunction"===r.constructor.name?await r(...t):r(...t)}getNodeType(e){return this.getDefaultOutputNode().getNodeType(e)}refresh(e=null){null!==e?this.getOutput(e).refresh():this._refresh()}getObject(){if(this.needsUpdate&&this.dispose(),null!==this._object)return this._object;const e=new Fb(this),t=Bb.get("THREE"),r=Bb.get("TSL"),s=this.getMethod(),i=[e,this._local,Bb,()=>this.refresh(),(e,t)=>this.setOutput(e,t),t,r];this._object=s(...i);const n=this._object.layout;if(n&&(!1===n.cache&&this._local.clear(),this._output.outputType=n.outputType||null,Array.isArray(n.elements)))for(const e of n.elements){const t=e.id||e.name;e.inputType&&(void 0===this.getParameter(t)&&this.setParameter(t,null),this.getParameter(t).inputType=e.inputType),e.outputType&&(void 0===this.getOutput(t)&&this.setOutput(t,null),this.getOutput(t).outputType=e.outputType)}return this._object}deserialize(e){super.deserialize(e);for(const e in this.parameters){let t=this.parameters[e];t.isScriptableNode&&(t=t.getDefaultOutput()),t.events.addEventListener("refresh",this.onRefresh)}}getLayout(){return this.getObject().layout}getDefaultOutputNode(){const e=this.getDefaultOutput().value;return e&&e.isNode?e:ji()}getDefaultOutput(){return this._exec()._output}getMethod(){if(this.needsUpdate&&this.dispose(),null!==this._method)return this._method;const e=["layout","init","main","dispose"].join(", "),t="\nreturn { ...output, "+e+" };",r="var "+e+"; var output = {};\n"+this.codeNode.code+t;return this._method=new Function(...["parameters","local","global","refresh","setOutput","THREE","TSL"],r),this._method}dispose(){null!==this._method&&(this._object&&"function"==typeof this._object.dispose&&this._object.dispose(),this._method=null,this._object=null,this._source=null,this._value=null,this._needsOutputUpdate=!0,this._output.value=null,this._outputs={})}setup(){return this.getDefaultOutputNode()}getCacheKey(e){const t=[bs(this.source),this.getDefaultOutputNode().getCacheKey(e)];for(const r in this.parameters)t.push(this.parameters[r].getCacheKey(e));return xs(t)}set needsUpdate(e){!0===e&&this.dispose()}get needsUpdate(){return this.source!==this._source}_exec(){return null===this.codeNode||(!0===this._needsOutputUpdate&&(this._value=this.call("main"),this._needsOutputUpdate=!1),this._output.value=this._value),this}_refresh(){this.needsUpdate=!0,this._exec(),this._output.refresh()}}const Db=Vi(Ib).setParameterLength(1,2);function Vb(e){let t;const r=e.context.getViewZ;return void 0!==r&&(t=r(this)),(t||Gl.z).negate()}const Ub=ki((([e,t],r)=>{const s=Vb(r);return Oo(e,t,s)})),Ob=ki((([e],t)=>{const r=Vb(t);return e.mul(e,r,r).negate().exp().oneMinus()})),kb=ki((([e,t])=>nn(t.toFloat().mix(In.rgb,e.toVec3()),In.a)));let Gb=null,zb=null;class Hb extends js{static get type(){return"RangeNode"}constructor(e=ji(),t=ji()){super(),this.minNode=e,this.maxNode=t}getVectorLength(e){const t=e.getTypeLength(Ms(this.minNode.value)),r=e.getTypeLength(Ms(this.maxNode.value));return t>r?t:r}getNodeType(e){return e.object.count>1?e.getTypeFromLength(this.getVectorLength(e)):"float"}setup(e){const t=e.object;let r=null;if(t.count>1){const i=this.minNode.value,n=this.maxNode.value,a=e.getTypeLength(Ms(i)),o=e.getTypeLength(Ms(n));Gb=Gb||new s,zb=zb||new s,Gb.setScalar(0),zb.setScalar(0),1===a?Gb.setScalar(i):i.isColor?Gb.set(i.r,i.g,i.b,1):Gb.set(i.x,i.y,i.z||0,i.w||0),1===o?zb.setScalar(n):n.isColor?zb.set(n.r,n.g,n.b,1):zb.set(n.x,n.y,n.z||0,n.w||0);const l=4,d=l*t.count,c=new Float32Array(d);for(let e=0;eBi(new Wb(e,t)),qb=jb("numWorkgroups","uvec3"),Xb=jb("workgroupId","uvec3"),Kb=jb("globalId","uvec3"),Yb=jb("localId","uvec3"),Qb=jb("subgroupSize","uint");const Zb=Vi(class extends js{constructor(e){super(),this.scope=e}generate(e){const{scope:t}=this,{renderer:r}=e;!0===r.backend.isWebGLBackend?e.addFlowCode(`\t// ${t}Barrier \n`):e.addLineFlowCode(`${t}Barrier()`,this)}});class Jb extends qs{constructor(e,t){super(e,t),this.isWorkgroupInfoElementNode=!0}generate(e,t){let r;const s=e.context.assign;if(r=super.generate(e),!0!==s){const s=this.getNodeType(e);r=e.format(r,s,t)}return r}}class ex extends js{constructor(e,t,r=0){super(t),this.bufferType=t,this.bufferCount=r,this.isWorkgroupInfoNode=!0,this.elementType=t,this.scope=e}label(e){return this.name=e,this}setScope(e){return this.scope=e,this}getElementType(){return this.elementType}getInputType(){return`${this.scope}Array`}element(e){return Bi(new Jb(this,e))}generate(e){return e.getScopedArray(this.name||`${this.scope}Array_${this.id}`,this.scope.toLowerCase(),this.bufferType,this.bufferCount)}}class tx extends js{static get type(){return"AtomicFunctionNode"}constructor(e,t,r){super("uint"),this.method=e,this.pointerNode=t,this.valueNode=r,this.parents=!0}getInputType(e){return this.pointerNode.getNodeType(e)}getNodeType(e){return this.getInputType(e)}generate(e){const t=e.getNodeProperties(this),r=t.parents,s=this.method,i=this.getNodeType(e),n=this.getInputType(e),a=this.pointerNode,o=this.valueNode,u=[];u.push(`&${a.build(e,n)}`),null!==o&&u.push(o.build(e,n));const l=`${e.getMethod(s,i)}( ${u.join(", ")} )`;if(!(1===r.length&&!0===r[0].isStackNode))return void 0===t.constNode&&(t.constNode=Du(l,i).toConst()),t.constNode.build(e);e.addLineFlowCode(l,this)}}tx.ATOMIC_LOAD="atomicLoad",tx.ATOMIC_STORE="atomicStore",tx.ATOMIC_ADD="atomicAdd",tx.ATOMIC_SUB="atomicSub",tx.ATOMIC_MAX="atomicMax",tx.ATOMIC_MIN="atomicMin",tx.ATOMIC_AND="atomicAnd",tx.ATOMIC_OR="atomicOr",tx.ATOMIC_XOR="atomicXor";const rx=Vi(tx),sx=(e,t,r)=>rx(e,t,r).toStack();let ix;function nx(e){ix=ix||new WeakMap;let t=ix.get(e);return void 0===t&&ix.set(e,t={}),t}function ax(e){const t=nx(e);return t.shadowMatrix||(t.shadowMatrix=Zn("mat4").setGroup(Kn).onRenderUpdate((t=>(!0===e.castShadow&&!1!==t.renderer.shadowMap.enabled||e.shadow.updateMatrices(e),e.shadow.matrix))))}function ox(e,t=Ol){const r=ax(e).mul(t);return r.xyz.div(r.w)}function ux(e){const t=nx(e);return t.position||(t.position=Zn(new r).setGroup(Kn).onRenderUpdate(((t,r)=>r.value.setFromMatrixPosition(e.matrixWorld))))}function lx(e){const t=nx(e);return t.targetPosition||(t.targetPosition=Zn(new r).setGroup(Kn).onRenderUpdate(((t,r)=>r.value.setFromMatrixPosition(e.target.matrixWorld))))}function dx(e){const t=nx(e);return t.viewPosition||(t.viewPosition=Zn(new r).setGroup(Kn).onRenderUpdate((({camera:t},s)=>{s.value=s.value||new r,s.value.setFromMatrixPosition(e.matrixWorld),s.value.applyMatrix4(t.matrixWorldInverse)})))}const cx=e=>cl.transformDirection(ux(e).sub(lx(e))),hx=(e,t)=>{for(const r of t)if(r.isAnalyticLightNode&&r.light.id===e)return r;return null},px=new WeakMap,gx=[];class mx extends js{static get type(){return"LightsNode"}constructor(){super("vec3"),this.totalDiffuseNode=en().toVar(),this.totalSpecularNode=en().toVar(),this.outgoingLightNode=en().toVar(),this._lights=[],this._lightNodes=null,this._lightNodesHash=null,this.global=!0}customCacheKey(){const e=this._lights;for(let t=0;te.sort(((e,t)=>e.id-t.id)))(this._lights),i=e.renderer.library;for(const e of s)if(e.isNode)t.push(Bi(e));else{let s=null;if(null!==r&&(s=hx(e.id,r)),null===s){const r=i.getLightNodeClass(e.constructor);if(null===r){console.warn(`LightsNode.setupNodeLights: Light node not found for ${e.constructor.name}`);continue}let s=null;px.has(e)?s=px.get(e):(s=Bi(new r(e)),px.set(e,s)),t.push(s)}}this._lightNodes=t}setupDirectLight(e,t,r){const{lightingModel:s,reflectedLight:i}=e.context;s.direct({...r,lightNode:t,reflectedLight:i},e)}setupDirectRectAreaLight(e,t,r){const{lightingModel:s,reflectedLight:i}=e.context;s.directRectArea({...r,lightNode:t,reflectedLight:i},e)}setupLights(e,t){for(const r of t)r.build(e)}getLightNodes(e){return null===this._lightNodes&&this.setupLightsNode(e),this._lightNodes}setup(e){const t=e.lightsNode;e.lightsNode=this;let r=this.outgoingLightNode;const s=e.context,i=s.lightingModel,n=e.getNodeProperties(this);if(i){const{totalDiffuseNode:t,totalSpecularNode:a}=this;s.outgoingLight=r;const o=e.addStack();n.nodes=o.nodes,i.start(e);const{backdrop:u,backdropAlpha:l}=s,{directDiffuse:d,directSpecular:c,indirectDiffuse:h,indirectSpecular:p}=s.reflectedLight;let g=d.add(h);null!==u&&(g=en(null!==l?l.mix(g,u):u),s.material.transparent=!0),t.assign(g),a.assign(c.add(p)),r.assign(t.add(a)),i.finish(e),r=r.bypass(e.removeStack())}else n.nodes=[];return e.lightsNode=t,r}setLights(e){return this._lights=e,this._lightNodes=null,this._lightNodesHash=null,this}getLights(){return this._lights}get hasLights(){return this._lights.length>0}}class fx extends js{static get type(){return"ShadowBaseNode"}constructor(e){super(),this.light=e,this.updateBeforeType=Vs.RENDER,this.isShadowBaseNode=!0}setupShadowPosition({context:e,material:t}){yx.assign(t.receivedShadowPositionNode||e.shadowPositionWorld||Ol)}}const yx=mn("vec3","shadowPositionWorld");function bx(t,r={}){return r.toneMapping=t.toneMapping,r.toneMappingExposure=t.toneMappingExposure,r.outputColorSpace=t.outputColorSpace,r.renderTarget=t.getRenderTarget(),r.activeCubeFace=t.getActiveCubeFace(),r.activeMipmapLevel=t.getActiveMipmapLevel(),r.renderObjectFunction=t.getRenderObjectFunction(),r.pixelRatio=t.getPixelRatio(),r.mrt=t.getMRT(),r.clearColor=t.getClearColor(r.clearColor||new e),r.clearAlpha=t.getClearAlpha(),r.autoClear=t.autoClear,r.scissorTest=t.getScissorTest(),r}function xx(e,t){return t=bx(e,t),e.setMRT(null),e.setRenderObjectFunction(null),e.setClearColor(0,1),e.autoClear=!0,t}function Tx(e,t){e.toneMapping=t.toneMapping,e.toneMappingExposure=t.toneMappingExposure,e.outputColorSpace=t.outputColorSpace,e.setRenderTarget(t.renderTarget,t.activeCubeFace,t.activeMipmapLevel),e.setRenderObjectFunction(t.renderObjectFunction),e.setPixelRatio(t.pixelRatio),e.setMRT(t.mrt),e.setClearColor(t.clearColor,t.clearAlpha),e.autoClear=t.autoClear,e.setScissorTest(t.scissorTest)}function _x(e,t={}){return t.background=e.background,t.backgroundNode=e.backgroundNode,t.overrideMaterial=e.overrideMaterial,t}function vx(e,t){return t=_x(e,t),e.background=null,e.backgroundNode=null,e.overrideMaterial=null,t}function Nx(e,t){e.background=t.background,e.backgroundNode=t.backgroundNode,e.overrideMaterial=t.overrideMaterial}function Sx(e,t,r){return r=vx(t,r=xx(e,r))}function Ex(e,t,r){Tx(e,r),Nx(t,r)}var wx=Object.freeze({__proto__:null,resetRendererAndSceneState:Sx,resetRendererState:xx,resetSceneState:vx,restoreRendererAndSceneState:Ex,restoreRendererState:Tx,restoreSceneState:Nx,saveRendererAndSceneState:function(e,t,r={}){return r=_x(t,r=bx(e,r))},saveRendererState:bx,saveSceneState:_x});const Ax=new WeakMap,Rx=ki((({depthTexture:e,shadowCoord:t,depthLayer:r})=>{let s=Zu(e,t.xy).label("t_basic");return e.isArrayTexture&&(s=s.depth(r)),s.compare(t.z)})),Cx=ki((({depthTexture:e,shadowCoord:t,shadow:r,depthLayer:s})=>{const i=(t,r)=>{let i=Zu(e,t);return e.isArrayTexture&&(i=i.depth(s)),i.compare(r)},n=yd("mapSize","vec2",r).setGroup(Kn),a=yd("radius","float",r).setGroup(Kn),o=Yi(1).div(n),u=o.x.negate().mul(a),l=o.y.negate().mul(a),d=o.x.mul(a),c=o.y.mul(a),h=u.div(2),p=l.div(2),g=d.div(2),m=c.div(2);return oa(i(t.xy.add(Yi(u,l)),t.z),i(t.xy.add(Yi(0,l)),t.z),i(t.xy.add(Yi(d,l)),t.z),i(t.xy.add(Yi(h,p)),t.z),i(t.xy.add(Yi(0,p)),t.z),i(t.xy.add(Yi(g,p)),t.z),i(t.xy.add(Yi(u,0)),t.z),i(t.xy.add(Yi(h,0)),t.z),i(t.xy,t.z),i(t.xy.add(Yi(g,0)),t.z),i(t.xy.add(Yi(d,0)),t.z),i(t.xy.add(Yi(h,m)),t.z),i(t.xy.add(Yi(0,m)),t.z),i(t.xy.add(Yi(g,m)),t.z),i(t.xy.add(Yi(u,c)),t.z),i(t.xy.add(Yi(0,c)),t.z),i(t.xy.add(Yi(d,c)),t.z)).mul(1/17)})),Mx=ki((({depthTexture:e,shadowCoord:t,shadow:r,depthLayer:s})=>{const i=(t,r)=>{let i=Zu(e,t);return e.isArrayTexture&&(i=i.depth(s)),i.compare(r)},n=yd("mapSize","vec2",r).setGroup(Kn),a=Yi(1).div(n),o=a.x,u=a.y,l=t.xy,d=Za(l.mul(n).add(.5));return l.subAssign(d.mul(a)),oa(i(l,t.z),i(l.add(Yi(o,0)),t.z),i(l.add(Yi(0,u)),t.z),i(l.add(a),t.z),Io(i(l.add(Yi(o.negate(),0)),t.z),i(l.add(Yi(o.mul(2),0)),t.z),d.x),Io(i(l.add(Yi(o.negate(),u)),t.z),i(l.add(Yi(o.mul(2),u)),t.z),d.x),Io(i(l.add(Yi(0,u.negate())),t.z),i(l.add(Yi(0,u.mul(2))),t.z),d.y),Io(i(l.add(Yi(o,u.negate())),t.z),i(l.add(Yi(o,u.mul(2))),t.z),d.y),Io(Io(i(l.add(Yi(o.negate(),u.negate())),t.z),i(l.add(Yi(o.mul(2),u.negate())),t.z),d.x),Io(i(l.add(Yi(o.negate(),u.mul(2))),t.z),i(l.add(Yi(o.mul(2),u.mul(2))),t.z),d.x),d.y)).mul(1/9)})),Px=ki((({depthTexture:e,shadowCoord:t,depthLayer:r})=>{const s=ji(1).toVar();let i=Zu(e).sample(t.xy);e.isArrayTexture&&(i=i.depth(r)),i=i.rg;const n=vo(t.z,i.x);return Hi(n.notEqual(ji(1)),(()=>{const e=t.z.sub(i.x),r=_o(0,i.y.mul(i.y));let a=r.div(r.add(e.mul(e)));a=Do(ua(a,.3).div(.95-.3)),s.assign(Do(_o(n,a)))})),s})),Lx=ki((([e,t,r])=>{let s=Ol.sub(e).length();return s=s.sub(t).div(r.sub(t)),s=s.saturate(),s})),Fx=e=>{let t=Ax.get(e);if(void 0===t){const r=e.isPointLight?(e=>{const t=e.shadow.camera,r=yd("near","float",t).setGroup(Kn),s=yd("far","float",t).setGroup(Kn),i=xl(e);return Lx(i,r,s)})(e):null;t=new Zh,t.colorNode=nn(0,0,0,1),t.depthNode=r,t.isShadowPassMaterial=!0,t.name="ShadowMaterial",t.fog=!1,Ax.set(e,t)}return t},Bx=new Km,Ix=[],Dx=(e,t,r,s)=>{Ix[0]=e,Ix[1]=t;let i=Bx.get(Ix);return void 0!==i&&i.shadowType===r&&i.useVelocity===s||(i=(i,n,a,o,u,l,...d)=>{(!0===i.castShadow||i.receiveShadow&&r===Ie)&&(s&&(Ls(i).useVelocity=!0),i.onBeforeShadow(e,i,a,t.camera,o,n.overrideMaterial,l),e.renderObject(i,n,a,o,u,l,...d),i.onAfterShadow(e,i,a,t.camera,o,n.overrideMaterial,l))},i.shadowType=r,i.useVelocity=s,Bx.set(Ix,i)),Ix[0]=null,Ix[1]=null,i},Vx=ki((({samples:e,radius:t,size:r,shadowPass:s,depthLayer:i})=>{const n=ji(0).toVar("meanVertical"),a=ji(0).toVar("squareMeanVertical"),o=e.lessThanEqual(ji(1)).select(ji(0),ji(2).div(e.sub(1))),u=e.lessThanEqual(ji(1)).select(ji(0),ji(-1));Zc({start:qi(0),end:qi(e),type:"int",condition:"<"},(({i:e})=>{const l=u.add(ji(e).mul(o));let d=s.sample(oa(mh.xy,Yi(0,l).mul(t)).div(r));s.value.isArrayTexture&&(d=d.depth(i)),d=d.x,n.addAssign(d),a.addAssign(d.mul(d))})),n.divAssign(e),a.divAssign(e);const l=qa(a.sub(n.mul(n)));return Yi(n,l)})),Ux=ki((({samples:e,radius:t,size:r,shadowPass:s,depthLayer:i})=>{const n=ji(0).toVar("meanHorizontal"),a=ji(0).toVar("squareMeanHorizontal"),o=e.lessThanEqual(ji(1)).select(ji(0),ji(2).div(e.sub(1))),u=e.lessThanEqual(ji(1)).select(ji(0),ji(-1));Zc({start:qi(0),end:qi(e),type:"int",condition:"<"},(({i:e})=>{const l=u.add(ji(e).mul(o));let d=s.sample(oa(mh.xy,Yi(l,0).mul(t)).div(r));s.value.isArrayTexture&&(d=d.depth(i)),n.addAssign(d.x),a.addAssign(oa(d.y.mul(d.y),d.x.mul(d.x)))})),n.divAssign(e),a.divAssign(e);const l=qa(a.sub(n.mul(n)));return Yi(n,l)})),Ox=[Rx,Cx,Mx,Px];let kx;const Gx=new Cy;class zx extends fx{static get type(){return"ShadowNode"}constructor(e,t=null){super(e),this.shadow=t||e.shadow,this.shadowMap=null,this.vsmShadowMapVertical=null,this.vsmShadowMapHorizontal=null,this.vsmMaterialVertical=null,this.vsmMaterialHorizontal=null,this._node=null,this._cameraFrameId=new WeakMap,this.isShadowNode=!0,this.depthLayer=0}setupShadowFilter(e,{filterFn:t,depthTexture:r,shadowCoord:s,shadow:i,depthLayer:n}){const a=s.x.greaterThanEqual(0).and(s.x.lessThanEqual(1)).and(s.y.greaterThanEqual(0)).and(s.y.lessThanEqual(1)).and(s.z.lessThanEqual(1)),o=t({depthTexture:r,shadowCoord:s,shadow:i,depthLayer:n});return a.select(o,ji(1))}setupShadowCoord(e,t){const{shadow:r}=this,{renderer:s}=e,i=yd("bias","float",r).setGroup(Kn);let n,a=t;if(r.camera.isOrthographicCamera||!0!==s.logarithmicDepthBuffer)a=a.xyz.div(a.w),n=a.z,s.coordinateSystem===d&&(n=n.mul(2).sub(1));else{const e=a.w;a=a.xy.div(e);const t=yd("near","float",r.camera).setGroup(Kn),s=yd("far","float",r.camera).setGroup(Kn);n=Bh(e.negate(),t,s)}return a=en(a.x,a.y.oneMinus(),n.add(i)),a}getShadowFilterFn(e){return Ox[e]}setupRenderTarget(e,t){const r=new V(e.mapSize.width,e.mapSize.height);r.name="ShadowDepthTexture",r.compareFunction=De;const s=t.createRenderTarget(e.mapSize.width,e.mapSize.height);return s.texture.name="ShadowMap",s.texture.type=e.mapType,s.depthTexture=r,{shadowMap:s,depthTexture:r}}setupShadow(e){const{renderer:t}=e,{light:r,shadow:s}=this,i=t.shadowMap.type,{depthTexture:n,shadowMap:a}=this.setupRenderTarget(s,e);if(s.camera.updateProjectionMatrix(),i===Ie&&!0!==s.isPointLightShadow){n.compareFunction=null,a.depth>1?(a._vsmShadowMapVertical||(a._vsmShadowMapVertical=e.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:Ve,type:de,depth:a.depth,depthBuffer:!1}),a._vsmShadowMapVertical.texture.name="VSMVertical"),this.vsmShadowMapVertical=a._vsmShadowMapVertical,a._vsmShadowMapHorizontal||(a._vsmShadowMapHorizontal=e.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:Ve,type:de,depth:a.depth,depthBuffer:!1}),a._vsmShadowMapHorizontal.texture.name="VSMHorizontal"),this.vsmShadowMapHorizontal=a._vsmShadowMapHorizontal):(this.vsmShadowMapVertical=e.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:Ve,type:de,depthBuffer:!1}),this.vsmShadowMapHorizontal=e.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:Ve,type:de,depthBuffer:!1}));let t=Zu(n);n.isArrayTexture&&(t=t.depth(this.depthLayer));let r=Zu(this.vsmShadowMapVertical.texture);n.isArrayTexture&&(r=r.depth(this.depthLayer));const i=yd("blurSamples","float",s).setGroup(Kn),o=yd("radius","float",s).setGroup(Kn),u=yd("mapSize","vec2",s).setGroup(Kn);let l=this.vsmMaterialVertical||(this.vsmMaterialVertical=new Zh);l.fragmentNode=Vx({samples:i,radius:o,size:u,shadowPass:t,depthLayer:this.depthLayer}).context(e.getSharedContext()),l.name="VSMVertical",l=this.vsmMaterialHorizontal||(this.vsmMaterialHorizontal=new Zh),l.fragmentNode=Ux({samples:i,radius:o,size:u,shadowPass:r,depthLayer:this.depthLayer}).context(e.getSharedContext()),l.name="VSMHorizontal"}const o=yd("intensity","float",s).setGroup(Kn),u=yd("normalBias","float",s).setGroup(Kn),l=ax(r).mul(yx.add(Zl.mul(u))),d=this.setupShadowCoord(e,l),c=s.filterNode||this.getShadowFilterFn(t.shadowMap.type)||null;if(null===c)throw new Error("THREE.WebGPURenderer: Shadow map type not supported yet.");const h=i===Ie&&!0!==s.isPointLightShadow?this.vsmShadowMapHorizontal.texture:n,p=this.setupShadowFilter(e,{filterFn:c,shadowTexture:a.texture,depthTexture:h,shadowCoord:d,shadow:s,depthLayer:this.depthLayer});let g=Zu(a.texture,d);n.isArrayTexture&&(g=g.depth(this.depthLayer));const m=Io(1,p.rgb.mix(g,1),o.mul(g.a)).toVar();return this.shadowMap=a,this.shadow.map=a,m}setup(e){if(!1!==e.renderer.shadowMap.enabled)return ki((()=>{let t=this._node;return this.setupShadowPosition(e),null===t&&(this._node=t=this.setupShadow(e)),e.material.shadowNode&&console.warn('THREE.NodeMaterial: ".shadowNode" is deprecated. Use ".castShadowNode" instead.'),e.material.receivedShadowNode&&(t=e.material.receivedShadowNode(t)),t}))()}renderShadow(e){const{shadow:t,shadowMap:r,light:s}=this,{renderer:i,scene:n}=e;t.updateMatrices(s),r.setSize(t.mapSize.width,t.mapSize.height,r.depth),i.render(n,t.camera)}updateShadow(e){const{shadowMap:t,light:r,shadow:s}=this,{renderer:i,scene:n,camera:a}=e,o=i.shadowMap.type,u=t.depthTexture.version;this._depthVersionCached=u;const l=s.camera.layers.mask;4294967294&s.camera.layers.mask||(s.camera.layers.mask=a.layers.mask);const d=i.getRenderObjectFunction(),c=i.getMRT(),h=!!c&&c.has("velocity");kx=Sx(i,n,kx),n.overrideMaterial=Fx(r),i.setRenderObjectFunction(Dx(i,s,o,h)),i.setClearColor(0,0),i.setRenderTarget(t),this.renderShadow(e),i.setRenderObjectFunction(d),o===Ie&&!0!==s.isPointLightShadow&&this.vsmPass(i),s.camera.layers.mask=l,Ex(i,n,kx)}vsmPass(e){const{shadow:t}=this,r=this.shadowMap.depth;this.vsmShadowMapVertical.setSize(t.mapSize.width,t.mapSize.height,r),this.vsmShadowMapHorizontal.setSize(t.mapSize.width,t.mapSize.height,r),e.setRenderTarget(this.vsmShadowMapVertical),Gx.material=this.vsmMaterialVertical,Gx.render(e),e.setRenderTarget(this.vsmShadowMapHorizontal),Gx.material=this.vsmMaterialHorizontal,Gx.render(e)}dispose(){this.shadowMap.dispose(),this.shadowMap=null,null!==this.vsmShadowMapVertical&&(this.vsmShadowMapVertical.dispose(),this.vsmShadowMapVertical=null,this.vsmMaterialVertical.dispose(),this.vsmMaterialVertical=null),null!==this.vsmShadowMapHorizontal&&(this.vsmShadowMapHorizontal.dispose(),this.vsmShadowMapHorizontal=null,this.vsmMaterialHorizontal.dispose(),this.vsmMaterialHorizontal=null),super.dispose()}updateBefore(e){const{shadow:t}=this;let r=t.needsUpdate||t.autoUpdate;r&&(this._cameraFrameId[e.camera]===e.frameId&&(r=!1),this._cameraFrameId[e.camera]=e.frameId),r&&(this.updateShadow(e),this.shadowMap.depthTexture.version===this._depthVersionCached&&(t.needsUpdate=!1))}}const Hx=(e,t)=>Bi(new zx(e,t)),$x=new e,Wx=ki((([e,t])=>{const r=e.toVar(),s=no(r),i=da(1,_o(s.x,_o(s.y,s.z)));s.mulAssign(i),r.mulAssign(i.mul(t.mul(2).oneMinus()));const n=Yi(r.xy).toVar(),a=t.mul(1.5).oneMinus();return Hi(s.z.greaterThanEqual(a),(()=>{Hi(r.z.greaterThan(0),(()=>{n.x.assign(ua(4,r.x))}))})).ElseIf(s.x.greaterThanEqual(a),(()=>{const e=ao(r.x);n.x.assign(r.z.mul(e).add(e.mul(2)))})).ElseIf(s.y.greaterThanEqual(a),(()=>{const e=ao(r.y);n.x.assign(r.x.add(e.mul(2)).add(2)),n.y.assign(r.z.mul(e).sub(2))})),Yi(.125,.25).mul(n).add(Yi(.375,.75)).flipY()})).setLayout({name:"cubeToUV",type:"vec2",inputs:[{name:"pos",type:"vec3"},{name:"texelSizeY",type:"float"}]}),jx=ki((({depthTexture:e,bd3D:t,dp:r,texelSize:s})=>Zu(e,Wx(t,s.y)).compare(r))),qx=ki((({depthTexture:e,bd3D:t,dp:r,texelSize:s,shadow:i})=>{const n=yd("radius","float",i).setGroup(Kn),a=Yi(-1,1).mul(n).mul(s.y);return Zu(e,Wx(t.add(a.xyy),s.y)).compare(r).add(Zu(e,Wx(t.add(a.yyy),s.y)).compare(r)).add(Zu(e,Wx(t.add(a.xyx),s.y)).compare(r)).add(Zu(e,Wx(t.add(a.yyx),s.y)).compare(r)).add(Zu(e,Wx(t,s.y)).compare(r)).add(Zu(e,Wx(t.add(a.xxy),s.y)).compare(r)).add(Zu(e,Wx(t.add(a.yxy),s.y)).compare(r)).add(Zu(e,Wx(t.add(a.xxx),s.y)).compare(r)).add(Zu(e,Wx(t.add(a.yxx),s.y)).compare(r)).mul(1/9)})),Xx=ki((({filterFn:e,depthTexture:t,shadowCoord:r,shadow:s})=>{const i=r.xyz.toVar(),n=i.length(),a=Zn("float").setGroup(Kn).onRenderUpdate((()=>s.camera.near)),o=Zn("float").setGroup(Kn).onRenderUpdate((()=>s.camera.far)),u=yd("bias","float",s).setGroup(Kn),l=Zn(s.mapSize).setGroup(Kn),d=ji(1).toVar();return Hi(n.sub(o).lessThanEqual(0).and(n.sub(a).greaterThanEqual(0)),(()=>{const r=n.sub(a).div(o.sub(a)).toVar();r.addAssign(u);const c=i.normalize(),h=Yi(1).div(l.mul(Yi(4,2)));d.assign(e({depthTexture:t,bd3D:c,dp:r,texelSize:h,shadow:s}))})),d})),Kx=new s,Yx=new t,Qx=new t;class Zx extends zx{static get type(){return"PointShadowNode"}constructor(e,t=null){super(e,t)}getShadowFilterFn(e){return e===Ue?jx:qx}setupShadowCoord(e,t){return t}setupShadowFilter(e,{filterFn:t,shadowTexture:r,depthTexture:s,shadowCoord:i,shadow:n}){return Xx({filterFn:t,shadowTexture:r,depthTexture:s,shadowCoord:i,shadow:n})}renderShadow(e){const{shadow:t,shadowMap:r,light:s}=this,{renderer:i,scene:n}=e,a=t.getFrameExtents();Qx.copy(t.mapSize),Qx.multiply(a),r.setSize(Qx.width,Qx.height),Yx.copy(t.mapSize);const o=i.autoClear,u=i.getClearColor($x),l=i.getClearAlpha();i.autoClear=!1,i.setClearColor(t.clearColor,t.clearAlpha),i.clear();const d=t.getViewportCount();for(let e=0;eBi(new Zx(e,t));class eT extends nh{static get type(){return"AnalyticLightNode"}constructor(t=null){super(),this.light=t,this.color=new e,this.colorNode=t&&t.colorNode||Zn(this.color).setGroup(Kn),this.baseColorNode=null,this.shadowNode=null,this.shadowColorNode=null,this.isAnalyticLightNode=!0,this.updateType=Vs.FRAME}getHash(){return this.light.uuid}getLightVector(e){return dx(this.light).sub(e.context.positionView||Gl)}setupDirect(){}setupDirectRectArea(){}setupShadowNode(){return Hx(this.light)}setupShadow(e){const{renderer:t}=e;if(!1===t.shadowMap.enabled)return;let r=this.shadowColorNode;if(null===r){const e=this.light.shadow.shadowNode;let t;t=void 0!==e?Bi(e):this.setupShadowNode(),this.shadowNode=t,this.shadowColorNode=r=this.colorNode.mul(t),this.baseColorNode=this.colorNode}this.colorNode=r}setup(e){this.colorNode=this.baseColorNode||this.colorNode,this.light.castShadow?e.object.receiveShadow&&this.setupShadow(e):null!==this.shadowNode&&(this.shadowNode.dispose(),this.shadowNode=null,this.shadowColorNode=null);const t=this.setupDirect(e),r=this.setupDirectRectArea(e);t&&e.lightsNode.setupDirectLight(e,this,t),r&&e.lightsNode.setupDirectRectAreaLight(e,this,r)}update(){const{light:e}=this;this.color.copy(e.color).multiplyScalar(e.intensity)}}const tT=ki((({lightDistance:e,cutoffDistance:t,decayExponent:r})=>{const s=e.pow(r).max(.01).reciprocal();return t.greaterThan(0).select(s.mul(e.div(t).pow4().oneMinus().clamp().pow2()),s)})),rT=({color:e,lightVector:t,cutoffDistance:r,decayExponent:s})=>{const i=t.normalize(),n=t.length(),a=tT({lightDistance:n,cutoffDistance:r,decayExponent:s});return{lightDirection:i,lightColor:e.mul(a)}};class sT extends eT{static get type(){return"PointLightNode"}constructor(e=null){super(e),this.cutoffDistanceNode=Zn(0).setGroup(Kn),this.decayExponentNode=Zn(2).setGroup(Kn)}update(e){const{light:t}=this;super.update(e),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}setupShadowNode(){return Jx(this.light)}setupDirect(e){return rT({color:this.colorNode,lightVector:this.getLightVector(e),cutoffDistance:this.cutoffDistanceNode,decayExponent:this.decayExponentNode})}}const iT=ki((([e=t()])=>{const t=e.mul(2),r=t.x.floor(),s=t.y.floor();return r.add(s).mod(2).sign()})),nT=ki((([e=$u()],{renderer:t,material:r})=>{const s=Bo(e.mul(2).sub(1));let i;if(r.alphaToCoverage&&t.samples>1){const e=ji(s.fwidth()).toVar();i=Oo(e.oneMinus(),e.add(1),s).oneMinus()}else i=Xo(s.greaterThan(1),0,1);return i})),aT=ki((([e,t,r])=>{const s=ji(r).toVar(),i=ji(t).toVar(),n=Ki(e).toVar();return Xo(n,i,s)})).setLayout({name:"mx_select",type:"float",inputs:[{name:"b",type:"bool"},{name:"t",type:"float"},{name:"f",type:"float"}]}),oT=ki((([e,t])=>{const r=Ki(t).toVar(),s=ji(e).toVar();return Xo(r,s.negate(),s)})).setLayout({name:"mx_negate_if",type:"float",inputs:[{name:"val",type:"float"},{name:"b",type:"bool"}]}),uT=ki((([e])=>{const t=ji(e).toVar();return qi(Ka(t))})).setLayout({name:"mx_floor",type:"int",inputs:[{name:"x",type:"float"}]}),lT=ki((([e,t])=>{const r=ji(e).toVar();return t.assign(uT(r)),r.sub(ji(t))})),dT=Zf([ki((([e,t,r,s,i,n])=>{const a=ji(n).toVar(),o=ji(i).toVar(),u=ji(s).toVar(),l=ji(r).toVar(),d=ji(t).toVar(),c=ji(e).toVar(),h=ji(ua(1,o)).toVar();return ua(1,a).mul(c.mul(h).add(d.mul(o))).add(a.mul(l.mul(h).add(u.mul(o))))})).setLayout({name:"mx_bilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"}]}),ki((([e,t,r,s,i,n])=>{const a=ji(n).toVar(),o=ji(i).toVar(),u=en(s).toVar(),l=en(r).toVar(),d=en(t).toVar(),c=en(e).toVar(),h=ji(ua(1,o)).toVar();return ua(1,a).mul(c.mul(h).add(d.mul(o))).add(a.mul(l.mul(h).add(u.mul(o))))})).setLayout({name:"mx_bilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"}]})]),cT=Zf([ki((([e,t,r,s,i,n,a,o,u,l,d])=>{const c=ji(d).toVar(),h=ji(l).toVar(),p=ji(u).toVar(),g=ji(o).toVar(),m=ji(a).toVar(),f=ji(n).toVar(),y=ji(i).toVar(),b=ji(s).toVar(),x=ji(r).toVar(),T=ji(t).toVar(),_=ji(e).toVar(),v=ji(ua(1,p)).toVar(),N=ji(ua(1,h)).toVar();return ji(ua(1,c)).toVar().mul(N.mul(_.mul(v).add(T.mul(p))).add(h.mul(x.mul(v).add(b.mul(p))))).add(c.mul(N.mul(y.mul(v).add(f.mul(p))).add(h.mul(m.mul(v).add(g.mul(p))))))})).setLayout({name:"mx_trilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"v4",type:"float"},{name:"v5",type:"float"},{name:"v6",type:"float"},{name:"v7",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),ki((([e,t,r,s,i,n,a,o,u,l,d])=>{const c=ji(d).toVar(),h=ji(l).toVar(),p=ji(u).toVar(),g=en(o).toVar(),m=en(a).toVar(),f=en(n).toVar(),y=en(i).toVar(),b=en(s).toVar(),x=en(r).toVar(),T=en(t).toVar(),_=en(e).toVar(),v=ji(ua(1,p)).toVar(),N=ji(ua(1,h)).toVar();return ji(ua(1,c)).toVar().mul(N.mul(_.mul(v).add(T.mul(p))).add(h.mul(x.mul(v).add(b.mul(p))))).add(c.mul(N.mul(y.mul(v).add(f.mul(p))).add(h.mul(m.mul(v).add(g.mul(p))))))})).setLayout({name:"mx_trilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"v4",type:"vec3"},{name:"v5",type:"vec3"},{name:"v6",type:"vec3"},{name:"v7",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]})]),hT=ki((([e,t,r])=>{const s=ji(r).toVar(),i=ji(t).toVar(),n=Xi(e).toVar(),a=Xi(n.bitAnd(Xi(7))).toVar(),o=ji(aT(a.lessThan(Xi(4)),i,s)).toVar(),u=ji(la(2,aT(a.lessThan(Xi(4)),s,i))).toVar();return oT(o,Ki(a.bitAnd(Xi(1)))).add(oT(u,Ki(a.bitAnd(Xi(2)))))})).setLayout({name:"mx_gradient_float_0",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"}]}),pT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=ji(t).toVar(),o=Xi(e).toVar(),u=Xi(o.bitAnd(Xi(15))).toVar(),l=ji(aT(u.lessThan(Xi(8)),a,n)).toVar(),d=ji(aT(u.lessThan(Xi(4)),n,aT(u.equal(Xi(12)).or(u.equal(Xi(14))),a,i))).toVar();return oT(l,Ki(u.bitAnd(Xi(1)))).add(oT(d,Ki(u.bitAnd(Xi(2)))))})).setLayout({name:"mx_gradient_float_1",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),gT=Zf([hT,pT]),mT=ki((([e,t,r])=>{const s=ji(r).toVar(),i=ji(t).toVar(),n=rn(e).toVar();return en(gT(n.x,i,s),gT(n.y,i,s),gT(n.z,i,s))})).setLayout({name:"mx_gradient_vec3_0",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"}]}),fT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=ji(t).toVar(),o=rn(e).toVar();return en(gT(o.x,a,n,i),gT(o.y,a,n,i),gT(o.z,a,n,i))})).setLayout({name:"mx_gradient_vec3_1",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),yT=Zf([mT,fT]),bT=ki((([e])=>{const t=ji(e).toVar();return la(.6616,t)})).setLayout({name:"mx_gradient_scale2d_0",type:"float",inputs:[{name:"v",type:"float"}]}),xT=ki((([e])=>{const t=ji(e).toVar();return la(.982,t)})).setLayout({name:"mx_gradient_scale3d_0",type:"float",inputs:[{name:"v",type:"float"}]}),TT=Zf([bT,ki((([e])=>{const t=en(e).toVar();return la(.6616,t)})).setLayout({name:"mx_gradient_scale2d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]})]),_T=Zf([xT,ki((([e])=>{const t=en(e).toVar();return la(.982,t)})).setLayout({name:"mx_gradient_scale3d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]})]),vT=ki((([e,t])=>{const r=qi(t).toVar(),s=Xi(e).toVar();return s.shiftLeft(r).bitOr(s.shiftRight(qi(32).sub(r)))})).setLayout({name:"mx_rotl32",type:"uint",inputs:[{name:"x",type:"uint"},{name:"k",type:"int"}]}),NT=ki((([e,t,r])=>{e.subAssign(r),e.bitXorAssign(vT(r,qi(4))),r.addAssign(t),t.subAssign(e),t.bitXorAssign(vT(e,qi(6))),e.addAssign(r),r.subAssign(t),r.bitXorAssign(vT(t,qi(8))),t.addAssign(e),e.subAssign(r),e.bitXorAssign(vT(r,qi(16))),r.addAssign(t),t.subAssign(e),t.bitXorAssign(vT(e,qi(19))),e.addAssign(r),r.subAssign(t),r.bitXorAssign(vT(t,qi(4))),t.addAssign(e)})),ST=ki((([e,t,r])=>{const s=Xi(r).toVar(),i=Xi(t).toVar(),n=Xi(e).toVar();return s.bitXorAssign(i),s.subAssign(vT(i,qi(14))),n.bitXorAssign(s),n.subAssign(vT(s,qi(11))),i.bitXorAssign(n),i.subAssign(vT(n,qi(25))),s.bitXorAssign(i),s.subAssign(vT(i,qi(16))),n.bitXorAssign(s),n.subAssign(vT(s,qi(4))),i.bitXorAssign(n),i.subAssign(vT(n,qi(14))),s.bitXorAssign(i),s.subAssign(vT(i,qi(24))),s})).setLayout({name:"mx_bjfinal",type:"uint",inputs:[{name:"a",type:"uint"},{name:"b",type:"uint"},{name:"c",type:"uint"}]}),ET=ki((([e])=>{const t=Xi(e).toVar();return ji(t).div(ji(Xi(qi(4294967295))))})).setLayout({name:"mx_bits_to_01",type:"float",inputs:[{name:"bits",type:"uint"}]}),wT=ki((([e])=>{const t=ji(e).toVar();return t.mul(t).mul(t).mul(t.mul(t.mul(6).sub(15)).add(10))})).setLayout({name:"mx_fade",type:"float",inputs:[{name:"t",type:"float"}]}),AT=Zf([ki((([e])=>{const t=qi(e).toVar(),r=Xi(Xi(1)).toVar(),s=Xi(Xi(qi(3735928559)).add(r.shiftLeft(Xi(2))).add(Xi(13))).toVar();return ST(s.add(Xi(t)),s,s)})).setLayout({name:"mx_hash_int_0",type:"uint",inputs:[{name:"x",type:"int"}]}),ki((([e,t])=>{const r=qi(t).toVar(),s=qi(e).toVar(),i=Xi(Xi(2)).toVar(),n=Xi().toVar(),a=Xi().toVar(),o=Xi().toVar();return n.assign(a.assign(o.assign(Xi(qi(3735928559)).add(i.shiftLeft(Xi(2))).add(Xi(13))))),n.addAssign(Xi(s)),a.addAssign(Xi(r)),ST(n,a,o)})).setLayout({name:"mx_hash_int_1",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),ki((([e,t,r])=>{const s=qi(r).toVar(),i=qi(t).toVar(),n=qi(e).toVar(),a=Xi(Xi(3)).toVar(),o=Xi().toVar(),u=Xi().toVar(),l=Xi().toVar();return o.assign(u.assign(l.assign(Xi(qi(3735928559)).add(a.shiftLeft(Xi(2))).add(Xi(13))))),o.addAssign(Xi(n)),u.addAssign(Xi(i)),l.addAssign(Xi(s)),ST(o,u,l)})).setLayout({name:"mx_hash_int_2",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),ki((([e,t,r,s])=>{const i=qi(s).toVar(),n=qi(r).toVar(),a=qi(t).toVar(),o=qi(e).toVar(),u=Xi(Xi(4)).toVar(),l=Xi().toVar(),d=Xi().toVar(),c=Xi().toVar();return l.assign(d.assign(c.assign(Xi(qi(3735928559)).add(u.shiftLeft(Xi(2))).add(Xi(13))))),l.addAssign(Xi(o)),d.addAssign(Xi(a)),c.addAssign(Xi(n)),NT(l,d,c),l.addAssign(Xi(i)),ST(l,d,c)})).setLayout({name:"mx_hash_int_3",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"}]}),ki((([e,t,r,s,i])=>{const n=qi(i).toVar(),a=qi(s).toVar(),o=qi(r).toVar(),u=qi(t).toVar(),l=qi(e).toVar(),d=Xi(Xi(5)).toVar(),c=Xi().toVar(),h=Xi().toVar(),p=Xi().toVar();return c.assign(h.assign(p.assign(Xi(qi(3735928559)).add(d.shiftLeft(Xi(2))).add(Xi(13))))),c.addAssign(Xi(l)),h.addAssign(Xi(u)),p.addAssign(Xi(o)),NT(c,h,p),c.addAssign(Xi(a)),h.addAssign(Xi(n)),ST(c,h,p)})).setLayout({name:"mx_hash_int_4",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"},{name:"yy",type:"int"}]})]),RT=Zf([ki((([e,t])=>{const r=qi(t).toVar(),s=qi(e).toVar(),i=Xi(AT(s,r)).toVar(),n=rn().toVar();return n.x.assign(i.bitAnd(qi(255))),n.y.assign(i.shiftRight(qi(8)).bitAnd(qi(255))),n.z.assign(i.shiftRight(qi(16)).bitAnd(qi(255))),n})).setLayout({name:"mx_hash_vec3_0",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),ki((([e,t,r])=>{const s=qi(r).toVar(),i=qi(t).toVar(),n=qi(e).toVar(),a=Xi(AT(n,i,s)).toVar(),o=rn().toVar();return o.x.assign(a.bitAnd(qi(255))),o.y.assign(a.shiftRight(qi(8)).bitAnd(qi(255))),o.z.assign(a.shiftRight(qi(16)).bitAnd(qi(255))),o})).setLayout({name:"mx_hash_vec3_1",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]})]),CT=Zf([ki((([e])=>{const t=Yi(e).toVar(),r=qi().toVar(),s=qi().toVar(),i=ji(lT(t.x,r)).toVar(),n=ji(lT(t.y,s)).toVar(),a=ji(wT(i)).toVar(),o=ji(wT(n)).toVar(),u=ji(dT(gT(AT(r,s),i,n),gT(AT(r.add(qi(1)),s),i.sub(1),n),gT(AT(r,s.add(qi(1))),i,n.sub(1)),gT(AT(r.add(qi(1)),s.add(qi(1))),i.sub(1),n.sub(1)),a,o)).toVar();return TT(u)})).setLayout({name:"mx_perlin_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"}]}),ki((([e])=>{const t=en(e).toVar(),r=qi().toVar(),s=qi().toVar(),i=qi().toVar(),n=ji(lT(t.x,r)).toVar(),a=ji(lT(t.y,s)).toVar(),o=ji(lT(t.z,i)).toVar(),u=ji(wT(n)).toVar(),l=ji(wT(a)).toVar(),d=ji(wT(o)).toVar(),c=ji(cT(gT(AT(r,s,i),n,a,o),gT(AT(r.add(qi(1)),s,i),n.sub(1),a,o),gT(AT(r,s.add(qi(1)),i),n,a.sub(1),o),gT(AT(r.add(qi(1)),s.add(qi(1)),i),n.sub(1),a.sub(1),o),gT(AT(r,s,i.add(qi(1))),n,a,o.sub(1)),gT(AT(r.add(qi(1)),s,i.add(qi(1))),n.sub(1),a,o.sub(1)),gT(AT(r,s.add(qi(1)),i.add(qi(1))),n,a.sub(1),o.sub(1)),gT(AT(r.add(qi(1)),s.add(qi(1)),i.add(qi(1))),n.sub(1),a.sub(1),o.sub(1)),u,l,d)).toVar();return _T(c)})).setLayout({name:"mx_perlin_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"}]})]),MT=Zf([ki((([e])=>{const t=Yi(e).toVar(),r=qi().toVar(),s=qi().toVar(),i=ji(lT(t.x,r)).toVar(),n=ji(lT(t.y,s)).toVar(),a=ji(wT(i)).toVar(),o=ji(wT(n)).toVar(),u=en(dT(yT(RT(r,s),i,n),yT(RT(r.add(qi(1)),s),i.sub(1),n),yT(RT(r,s.add(qi(1))),i,n.sub(1)),yT(RT(r.add(qi(1)),s.add(qi(1))),i.sub(1),n.sub(1)),a,o)).toVar();return TT(u)})).setLayout({name:"mx_perlin_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),ki((([e])=>{const t=en(e).toVar(),r=qi().toVar(),s=qi().toVar(),i=qi().toVar(),n=ji(lT(t.x,r)).toVar(),a=ji(lT(t.y,s)).toVar(),o=ji(lT(t.z,i)).toVar(),u=ji(wT(n)).toVar(),l=ji(wT(a)).toVar(),d=ji(wT(o)).toVar(),c=en(cT(yT(RT(r,s,i),n,a,o),yT(RT(r.add(qi(1)),s,i),n.sub(1),a,o),yT(RT(r,s.add(qi(1)),i),n,a.sub(1),o),yT(RT(r.add(qi(1)),s.add(qi(1)),i),n.sub(1),a.sub(1),o),yT(RT(r,s,i.add(qi(1))),n,a,o.sub(1)),yT(RT(r.add(qi(1)),s,i.add(qi(1))),n.sub(1),a,o.sub(1)),yT(RT(r,s.add(qi(1)),i.add(qi(1))),n,a.sub(1),o.sub(1)),yT(RT(r.add(qi(1)),s.add(qi(1)),i.add(qi(1))),n.sub(1),a.sub(1),o.sub(1)),u,l,d)).toVar();return _T(c)})).setLayout({name:"mx_perlin_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"}]})]),PT=Zf([ki((([e])=>{const t=ji(e).toVar(),r=qi(uT(t)).toVar();return ET(AT(r))})).setLayout({name:"mx_cell_noise_float_0",type:"float",inputs:[{name:"p",type:"float"}]}),ki((([e])=>{const t=Yi(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar();return ET(AT(r,s))})).setLayout({name:"mx_cell_noise_float_1",type:"float",inputs:[{name:"p",type:"vec2"}]}),ki((([e])=>{const t=en(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar(),i=qi(uT(t.z)).toVar();return ET(AT(r,s,i))})).setLayout({name:"mx_cell_noise_float_2",type:"float",inputs:[{name:"p",type:"vec3"}]}),ki((([e])=>{const t=nn(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar(),i=qi(uT(t.z)).toVar(),n=qi(uT(t.w)).toVar();return ET(AT(r,s,i,n))})).setLayout({name:"mx_cell_noise_float_3",type:"float",inputs:[{name:"p",type:"vec4"}]})]),LT=Zf([ki((([e])=>{const t=ji(e).toVar(),r=qi(uT(t)).toVar();return en(ET(AT(r,qi(0))),ET(AT(r,qi(1))),ET(AT(r,qi(2))))})).setLayout({name:"mx_cell_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"float"}]}),ki((([e])=>{const t=Yi(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar();return en(ET(AT(r,s,qi(0))),ET(AT(r,s,qi(1))),ET(AT(r,s,qi(2))))})).setLayout({name:"mx_cell_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),ki((([e])=>{const t=en(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar(),i=qi(uT(t.z)).toVar();return en(ET(AT(r,s,i,qi(0))),ET(AT(r,s,i,qi(1))),ET(AT(r,s,i,qi(2))))})).setLayout({name:"mx_cell_noise_vec3_2",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),ki((([e])=>{const t=nn(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar(),i=qi(uT(t.z)).toVar(),n=qi(uT(t.w)).toVar();return en(ET(AT(r,s,i,n,qi(0))),ET(AT(r,s,i,n,qi(1))),ET(AT(r,s,i,n,qi(2))))})).setLayout({name:"mx_cell_noise_vec3_3",type:"vec3",inputs:[{name:"p",type:"vec4"}]})]),FT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=qi(t).toVar(),o=en(e).toVar(),u=ji(0).toVar(),l=ji(1).toVar();return Zc(a,(()=>{u.addAssign(l.mul(CT(o))),l.mulAssign(i),o.mulAssign(n)})),u})).setLayout({name:"mx_fractal_noise_float",type:"float",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),BT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=qi(t).toVar(),o=en(e).toVar(),u=en(0).toVar(),l=ji(1).toVar();return Zc(a,(()=>{u.addAssign(l.mul(MT(o))),l.mulAssign(i),o.mulAssign(n)})),u})).setLayout({name:"mx_fractal_noise_vec3",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),IT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=qi(t).toVar(),o=en(e).toVar();return Yi(FT(o,a,n,i),FT(o.add(en(qi(19),qi(193),qi(17))),a,n,i))})).setLayout({name:"mx_fractal_noise_vec2",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),DT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=qi(t).toVar(),o=en(e).toVar(),u=en(BT(o,a,n,i)).toVar(),l=ji(FT(o.add(en(qi(19),qi(193),qi(17))),a,n,i)).toVar();return nn(u,l)})).setLayout({name:"mx_fractal_noise_vec4",type:"vec4",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),VT=Zf([ki((([e,t,r,s,i,n,a])=>{const o=qi(a).toVar(),u=ji(n).toVar(),l=qi(i).toVar(),d=qi(s).toVar(),c=qi(r).toVar(),h=qi(t).toVar(),p=Yi(e).toVar(),g=en(LT(Yi(h.add(d),c.add(l)))).toVar(),m=Yi(g.x,g.y).toVar();m.subAssign(.5),m.mulAssign(u),m.addAssign(.5);const f=Yi(Yi(ji(h),ji(c)).add(m)).toVar(),y=Yi(f.sub(p)).toVar();return Hi(o.equal(qi(2)),(()=>no(y.x).add(no(y.y)))),Hi(o.equal(qi(3)),(()=>_o(no(y.x),no(y.y)))),wo(y,y)})).setLayout({name:"mx_worley_distance_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),ki((([e,t,r,s,i,n,a,o,u])=>{const l=qi(u).toVar(),d=ji(o).toVar(),c=qi(a).toVar(),h=qi(n).toVar(),p=qi(i).toVar(),g=qi(s).toVar(),m=qi(r).toVar(),f=qi(t).toVar(),y=en(e).toVar(),b=en(LT(en(f.add(p),m.add(h),g.add(c)))).toVar();b.subAssign(.5),b.mulAssign(d),b.addAssign(.5);const x=en(en(ji(f),ji(m),ji(g)).add(b)).toVar(),T=en(x.sub(y)).toVar();return Hi(l.equal(qi(2)),(()=>no(T.x).add(no(T.y)).add(no(T.z)))),Hi(l.equal(qi(3)),(()=>_o(no(T.x),no(T.y),no(T.z)))),wo(T,T)})).setLayout({name:"mx_worley_distance_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"zoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]})]),UT=ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=Yi(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=Yi(lT(n.x,a),lT(n.y,o)).toVar(),l=ji(1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{const r=ji(VT(u,e,t,a,o,i,s)).toVar();l.assign(To(l,r))}))})),Hi(s.equal(qi(0)),(()=>{l.assign(qa(l))})),l})).setLayout({name:"mx_worley_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),OT=ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=Yi(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=Yi(lT(n.x,a),lT(n.y,o)).toVar(),l=Yi(1e6,1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{const r=ji(VT(u,e,t,a,o,i,s)).toVar();Hi(r.lessThan(l.x),(()=>{l.y.assign(l.x),l.x.assign(r)})).ElseIf(r.lessThan(l.y),(()=>{l.y.assign(r)}))}))})),Hi(s.equal(qi(0)),(()=>{l.assign(qa(l))})),l})).setLayout({name:"mx_worley_noise_vec2_0",type:"vec2",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),kT=ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=Yi(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=Yi(lT(n.x,a),lT(n.y,o)).toVar(),l=en(1e6,1e6,1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{const r=ji(VT(u,e,t,a,o,i,s)).toVar();Hi(r.lessThan(l.x),(()=>{l.z.assign(l.y),l.y.assign(l.x),l.x.assign(r)})).ElseIf(r.lessThan(l.y),(()=>{l.z.assign(l.y),l.y.assign(r)})).ElseIf(r.lessThan(l.z),(()=>{l.z.assign(r)}))}))})),Hi(s.equal(qi(0)),(()=>{l.assign(qa(l))})),l})).setLayout({name:"mx_worley_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),GT=Zf([UT,ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=en(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=qi().toVar(),l=en(lT(n.x,a),lT(n.y,o),lT(n.z,u)).toVar(),d=ji(1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{Zc({start:-1,end:qi(1),name:"z",condition:"<="},(({z:r})=>{const n=ji(VT(l,e,t,r,a,o,u,i,s)).toVar();d.assign(To(d,n))}))}))})),Hi(s.equal(qi(0)),(()=>{d.assign(qa(d))})),d})).setLayout({name:"mx_worley_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]})]),zT=Zf([OT,ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=en(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=qi().toVar(),l=en(lT(n.x,a),lT(n.y,o),lT(n.z,u)).toVar(),d=Yi(1e6,1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{Zc({start:-1,end:qi(1),name:"z",condition:"<="},(({z:r})=>{const n=ji(VT(l,e,t,r,a,o,u,i,s)).toVar();Hi(n.lessThan(d.x),(()=>{d.y.assign(d.x),d.x.assign(n)})).ElseIf(n.lessThan(d.y),(()=>{d.y.assign(n)}))}))}))})),Hi(s.equal(qi(0)),(()=>{d.assign(qa(d))})),d})).setLayout({name:"mx_worley_noise_vec2_1",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]})]),HT=Zf([kT,ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=en(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=qi().toVar(),l=en(lT(n.x,a),lT(n.y,o),lT(n.z,u)).toVar(),d=en(1e6,1e6,1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{Zc({start:-1,end:qi(1),name:"z",condition:"<="},(({z:r})=>{const n=ji(VT(l,e,t,r,a,o,u,i,s)).toVar();Hi(n.lessThan(d.x),(()=>{d.z.assign(d.y),d.y.assign(d.x),d.x.assign(n)})).ElseIf(n.lessThan(d.y),(()=>{d.z.assign(d.y),d.y.assign(n)})).ElseIf(n.lessThan(d.z),(()=>{d.z.assign(n)}))}))}))})),Hi(s.equal(qi(0)),(()=>{d.assign(qa(d))})),d})).setLayout({name:"mx_worley_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]})]),$T=ki((([e])=>{const t=e.y,r=e.z,s=en().toVar();return Hi(t.lessThan(1e-4),(()=>{s.assign(en(r,r,r))})).Else((()=>{let i=e.x;i=i.sub(Ka(i)).mul(6).toVar();const n=qi(mo(i)),a=i.sub(ji(n)),o=r.mul(t.oneMinus()),u=r.mul(t.mul(a).oneMinus()),l=r.mul(t.mul(a.oneMinus()).oneMinus());Hi(n.equal(qi(0)),(()=>{s.assign(en(r,l,o))})).ElseIf(n.equal(qi(1)),(()=>{s.assign(en(u,r,o))})).ElseIf(n.equal(qi(2)),(()=>{s.assign(en(o,r,l))})).ElseIf(n.equal(qi(3)),(()=>{s.assign(en(o,u,r))})).ElseIf(n.equal(qi(4)),(()=>{s.assign(en(l,o,r))})).Else((()=>{s.assign(en(r,o,u))}))})),s})).setLayout({name:"mx_hsvtorgb",type:"vec3",inputs:[{name:"hsv",type:"vec3"}]}),WT=ki((([e])=>{const t=en(e).toVar(),r=ji(t.x).toVar(),s=ji(t.y).toVar(),i=ji(t.z).toVar(),n=ji(To(r,To(s,i))).toVar(),a=ji(_o(r,_o(s,i))).toVar(),o=ji(a.sub(n)).toVar(),u=ji().toVar(),l=ji().toVar(),d=ji().toVar();return d.assign(a),Hi(a.greaterThan(0),(()=>{l.assign(o.div(a))})).Else((()=>{l.assign(0)})),Hi(l.lessThanEqual(0),(()=>{u.assign(0)})).Else((()=>{Hi(r.greaterThanEqual(a),(()=>{u.assign(s.sub(i).div(o))})).ElseIf(s.greaterThanEqual(a),(()=>{u.assign(oa(2,i.sub(r).div(o)))})).Else((()=>{u.assign(oa(4,r.sub(s).div(o)))})),u.mulAssign(1/6),Hi(u.lessThan(0),(()=>{u.addAssign(1)}))})),en(u,l,d)})).setLayout({name:"mx_rgbtohsv",type:"vec3",inputs:[{name:"c",type:"vec3"}]}),jT=ki((([e])=>{const t=en(e).toVar(),r=sn(ma(t,en(.04045))).toVar(),s=en(t.div(12.92)).toVar(),i=en(Ro(_o(t.add(en(.055)),en(0)).div(1.055),en(2.4))).toVar();return Io(s,i,r)})).setLayout({name:"mx_srgb_texture_to_lin_rec709",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),qT=(e,t)=>{e=ji(e),t=ji(t);const r=Yi(t.dFdx(),t.dFdy()).length().mul(.7071067811865476);return Oo(e.sub(r),e.add(r),t)},XT=(e,t,r,s)=>Io(e,t,r[s].clamp()),KT=(e,t,r,s,i)=>Io(e,t,qT(r,s[i])),YT=ki((([e,t,r])=>{const s=Qa(e).toVar(),i=ua(ji(.5).mul(t.sub(r)),Ol).div(s).toVar(),n=ua(ji(-.5).mul(t.sub(r)),Ol).div(s).toVar(),a=en().toVar();a.x=s.x.greaterThan(ji(0)).select(i.x,n.x),a.y=s.y.greaterThan(ji(0)).select(i.y,n.y),a.z=s.z.greaterThan(ji(0)).select(i.z,n.z);const o=To(a.x,a.y,a.z).toVar();return Ol.add(s.mul(o)).toVar().sub(r)})),QT=ki((([e,t])=>{const r=e.x,s=e.y,i=e.z;let n=t.element(0).mul(.886227);return n=n.add(t.element(1).mul(1.023328).mul(s)),n=n.add(t.element(2).mul(1.023328).mul(i)),n=n.add(t.element(3).mul(1.023328).mul(r)),n=n.add(t.element(4).mul(.858086).mul(r).mul(s)),n=n.add(t.element(5).mul(.858086).mul(s).mul(i)),n=n.add(t.element(6).mul(i.mul(i).mul(.743125).sub(.247708))),n=n.add(t.element(7).mul(.858086).mul(r).mul(i)),n=n.add(t.element(8).mul(.429043).mul(la(r,r).sub(la(s,s)))),n}));var ZT=Object.freeze({__proto__:null,BRDF_GGX:Gp,BRDF_Lambert:wp,BasicPointShadowFilter:jx,BasicShadowFilter:Rx,Break:Jc,Const:ru,Continue:()=>Du("continue").toStack(),DFGApprox:zp,D_GGX:Up,Discard:Vu,EPSILON:Ia,F_Schlick:Ep,Fn:ki,INFINITY:Da,If:Hi,Loop:Zc,NodeAccess:Os,NodeShaderStage:Ds,NodeType:Us,NodeUpdateType:Vs,PCFShadowFilter:Cx,PCFSoftShadowFilter:Mx,PI:Va,PI2:Ua,PointShadowFilter:qx,Return:()=>Du("return").toStack(),Schlick_to_F0:$p,ScriptableNodeResources:Bb,ShaderNode:Fi,Stack:$i,Switch:(...e)=>ni.Switch(...e),TBNViewMatrix:Bd,VSMShadowFilter:Px,V_GGX_SmithCorrelated:Dp,Var:tu,abs:no,acesFilmicToneMapping:Tb,acos:so,add:oa,addMethodChaining:oi,addNodeElement:function(e){console.warn("THREE.TSL: AddNodeElement has been removed in favor of tree-shaking. Trying add",e)},agxToneMapping:Sb,all:Oa,alphaT:Rn,and:ba,anisotropy:Cn,anisotropyB:Pn,anisotropyT:Mn,any:ka,append:e=>(console.warn("THREE.TSL: append() has been renamed to Stack()."),$i(e)),array:ea,arrayBuffer:e=>Bi(new si(e,"ArrayBuffer")),asin:ro,assign:ra,atan:io,atan2:$o,atomicAdd:(e,t)=>sx(tx.ATOMIC_ADD,e,t),atomicAnd:(e,t)=>sx(tx.ATOMIC_AND,e,t),atomicFunc:sx,atomicLoad:e=>sx(tx.ATOMIC_LOAD,e,null),atomicMax:(e,t)=>sx(tx.ATOMIC_MAX,e,t),atomicMin:(e,t)=>sx(tx.ATOMIC_MIN,e,t),atomicOr:(e,t)=>sx(tx.ATOMIC_OR,e,t),atomicStore:(e,t)=>sx(tx.ATOMIC_STORE,e,t),atomicSub:(e,t)=>sx(tx.ATOMIC_SUB,e,t),atomicXor:(e,t)=>sx(tx.ATOMIC_XOR,e,t),attenuationColor:Hn,attenuationDistance:zn,attribute:Hu,attributeArray:(e,t="float")=>{let r,s;!0===t.isStruct?(r=t.layout.getLength(),s=ws("float")):(r=As(t),s=ws(t));const i=new Vy(e,r,s);return qc(i,t,e)},backgroundBlurriness:Hy,backgroundIntensity:$y,backgroundRotation:Wy,batch:Hc,billboarding:iy,bitAnd:va,bitNot:Na,bitOr:Sa,bitXor:Ea,bitangentGeometry:Rd,bitangentLocal:Cd,bitangentView:Md,bitangentWorld:Pd,bitcast:bo,blendBurn:Wh,blendColor:Kh,blendDodge:jh,blendOverlay:Xh,blendScreen:qh,blur:Hg,bool:Ki,buffer:tl,bufferAttribute:_u,bumpMap:Hd,burn:(...e)=>(console.warn('THREE.TSL: "burn" has been renamed. Use "blendBurn" instead.'),Wh(e)),bvec2:Ji,bvec3:sn,bvec4:un,bypass:Pu,cache:Ru,call:ia,cameraFar:ul,cameraIndex:al,cameraNear:ol,cameraNormalMatrix:pl,cameraPosition:gl,cameraProjectionMatrix:ll,cameraProjectionMatrixInverse:dl,cameraViewMatrix:cl,cameraWorldMatrix:hl,cbrt:Fo,cdl:ub,ceil:Ya,checker:iT,cineonToneMapping:bb,clamp:Do,clearcoat:_n,clearcoatRoughness:vn,code:Ab,color:Wi,colorSpaceToWorking:hu,colorToDirection:e=>Bi(e).mul(2).sub(1),compute:wu,computeSkinning:(e,t=null)=>{const r=new Kc(e);return r.positionNode=qc(new L(e.geometry.getAttribute("position").array,3),"vec3").setPBO(!0).toReadOnly().element(Fc).toVar(),r.skinIndexNode=qc(new L(new Uint32Array(e.geometry.getAttribute("skinIndex").array),4),"uvec4").setPBO(!0).toReadOnly().element(Fc).toVar(),r.skinWeightNode=qc(new L(e.geometry.getAttribute("skinWeight").array,4),"vec4").setPBO(!0).toReadOnly().element(Fc).toVar(),r.bindMatrixNode=Zn(e.bindMatrix,"mat4"),r.bindMatrixInverseNode=Zn(e.bindMatrixInverse,"mat4"),r.boneMatricesNode=tl(e.skeleton.boneMatrices,"mat4",e.skeleton.bones.length),r.toPositionNode=t,Bi(r)},cond:Ko,context:Qo,convert:pn,convertColorSpace:(e,t,r)=>Bi(new du(Bi(e),t,r)),convertToTexture:(e,...t)=>e.isTextureNode?e:e.isPassNode?e.getTextureNode():Ly(e,...t),cos:eo,cross:Ao,cubeTexture:gd,cubeTextureBase:pd,cubeToUV:Wx,dFdx:co,dFdy:ho,dashSize:Dn,debug:Gu,decrement:Pa,decrementBefore:Ca,defaultBuildStages:Gs,defaultShaderStages:ks,defined:Pi,degrees:za,deltaTime:ey,densityFog:function(e,t){return console.warn('THREE.TSL: "densityFog( color, density )" is deprecated. Use "fog( color, densityFogFactor( density ) )" instead.'),kb(e,Ob(t))},densityFogFactor:Ob,depth:Dh,depthPass:(e,t,r)=>Bi(new gb(gb.DEPTH,e,t,r)),difference:Eo,diffuseColor:yn,directPointLight:rT,directionToColor:up,dispersion:$n,distance:So,div:da,dodge:(...e)=>(console.warn('THREE.TSL: "dodge" has been renamed. Use "blendDodge" instead.'),jh(e)),dot:wo,drawIndex:Vc,dynamicBufferAttribute:vu,element:hn,emissive:bn,equal:ha,equals:xo,equirectUV:hp,exp:Ha,exp2:$a,expression:Du,faceDirection:Wl,faceForward:ko,faceforward:Wo,float:ji,floor:Ka,fog:kb,fract:Za,frameGroup:Xn,frameId:ty,frontFacing:$l,fwidth:fo,gain:(e,t)=>e.lessThan(.5)?jf(e.mul(2),t).div(2):ua(1,jf(la(ua(1,e),2),t).div(2)),gapSize:Vn,getConstNodeType:Li,getCurrentStack:zi,getDirection:Og,getDistanceAttenuation:tT,getGeometryRoughness:Bp,getNormalFromDepth:Iy,getParallaxCorrectNormal:YT,getRoughness:Ip,getScreenPosition:By,getShIrradianceAt:QT,getShadowMaterial:Fx,getShadowRenderObjectFunction:Dx,getTextureIndex:zf,getViewPosition:Fy,globalId:Kb,glsl:(e,t)=>Ab(e,t,"glsl"),glslFn:(e,t)=>Cb(e,t,"glsl"),grayscale:sb,greaterThan:ma,greaterThanEqual:ya,hash:Wf,highpModelNormalViewMatrix:Il,highpModelViewMatrix:Bl,hue:ab,increment:Ma,incrementBefore:Ra,instance:Oc,instanceIndex:Fc,instancedArray:(e,t="float")=>{let r,s;!0===t.isStruct?(r=t.layout.getLength(),s=ws("float")):(r=As(t),s=ws(t));const i=new Dy(e,r,s);return qc(i,t,e)},instancedBufferAttribute:Nu,instancedDynamicBufferAttribute:Su,instancedMesh:Gc,int:qi,inverseSqrt:Xa,inversesqrt:jo,invocationLocalIndex:Dc,invocationSubgroupIndex:Ic,ior:On,iridescence:En,iridescenceIOR:wn,iridescenceThickness:An,ivec2:Qi,ivec3:tn,ivec4:an,js:(e,t)=>Ab(e,t,"js"),label:Zo,length:oo,lengthSq:Bo,lessThan:ga,lessThanEqual:fa,lightPosition:ux,lightProjectionUV:ox,lightShadowMatrix:ax,lightTargetDirection:cx,lightTargetPosition:lx,lightViewPosition:dx,lightingContext:uh,lights:(e=[])=>Bi(new mx).setLights(e),linearDepth:Vh,linearToneMapping:fb,localId:Yb,log:Wa,log2:ja,logarithmicDepthToViewZ:(e,t,r)=>{const s=e.mul(Wa(r.div(t)));return ji(Math.E).pow(s).mul(t).negate()},loop:(...e)=>(console.warn("THREE.TSL: loop() has been renamed to Loop()."),Zc(...e)),luminance:ob,mat2:ln,mat3:dn,mat4:cn,matcapUV:Pm,materialAO:Rc,materialAlphaTest:jd,materialAnisotropy:cc,materialAnisotropyVector:Cc,materialAttenuationColor:xc,materialAttenuationDistance:bc,materialClearcoat:nc,materialClearcoatNormal:oc,materialClearcoatRoughness:ac,materialColor:qd,materialDispersion:wc,materialEmissive:Kd,materialEnvIntensity:nd,materialEnvRotation:ad,materialIOR:yc,materialIridescence:hc,materialIridescenceIOR:pc,materialIridescenceThickness:gc,materialLightMap:Ac,materialLineDashOffset:Sc,materialLineDashSize:_c,materialLineGapSize:vc,materialLineScale:Tc,materialLineWidth:Nc,materialMetalness:sc,materialNormal:ic,materialOpacity:Yd,materialPointSize:Ec,materialReference:Td,materialReflectivity:tc,materialRefractionRatio:id,materialRotation:uc,materialRoughness:rc,materialSheen:lc,materialSheenRoughness:dc,materialShininess:Xd,materialSpecular:Qd,materialSpecularColor:Jd,materialSpecularIntensity:Zd,materialSpecularStrength:ec,materialThickness:fc,materialTransmission:mc,max:_o,maxMipLevel:Xu,mediumpModelViewMatrix:Fl,metalness:Tn,min:To,mix:Io,mixElement:zo,mod:ca,modInt:Fa,modelDirection:Sl,modelNormalMatrix:Ml,modelPosition:wl,modelRadius:Cl,modelScale:Al,modelViewMatrix:Ll,modelViewPosition:Rl,modelViewProjection:Mc,modelWorldMatrix:El,modelWorldMatrixInverse:Pl,morphReference:ih,mrt:$f,mul:la,mx_aastep:qT,mx_cell_noise_float:(e=$u())=>PT(e.convert("vec2|vec3")),mx_contrast:(e,t=1,r=.5)=>ji(e).sub(r).mul(t).add(r),mx_fractal_noise_float:(e=$u(),t=3,r=2,s=.5,i=1)=>FT(e,qi(t),r,s).mul(i),mx_fractal_noise_vec2:(e=$u(),t=3,r=2,s=.5,i=1)=>IT(e,qi(t),r,s).mul(i),mx_fractal_noise_vec3:(e=$u(),t=3,r=2,s=.5,i=1)=>BT(e,qi(t),r,s).mul(i),mx_fractal_noise_vec4:(e=$u(),t=3,r=2,s=.5,i=1)=>DT(e,qi(t),r,s).mul(i),mx_hsvtorgb:$T,mx_noise_float:(e=$u(),t=1,r=0)=>CT(e.convert("vec2|vec3")).mul(t).add(r),mx_noise_vec3:(e=$u(),t=1,r=0)=>MT(e.convert("vec2|vec3")).mul(t).add(r),mx_noise_vec4:(e=$u(),t=1,r=0)=>{e=e.convert("vec2|vec3");return nn(MT(e),CT(e.add(Yi(19,73)))).mul(t).add(r)},mx_ramplr:(e,t,r=$u())=>XT(e,t,r,"x"),mx_ramptb:(e,t,r=$u())=>XT(e,t,r,"y"),mx_rgbtohsv:WT,mx_safepower:(e,t=1)=>(e=ji(e)).abs().pow(t).mul(e.sign()),mx_splitlr:(e,t,r,s=$u())=>KT(e,t,r,s,"x"),mx_splittb:(e,t,r,s=$u())=>KT(e,t,r,s,"y"),mx_srgb_texture_to_lin_rec709:jT,mx_transform_uv:(e=1,t=0,r=$u())=>r.mul(e).add(t),mx_worley_noise_float:(e=$u(),t=1)=>GT(e.convert("vec2|vec3"),t,qi(1)),mx_worley_noise_vec2:(e=$u(),t=1)=>zT(e.convert("vec2|vec3"),t,qi(1)),mx_worley_noise_vec3:(e=$u(),t=1)=>HT(e.convert("vec2|vec3"),t,qi(1)),namespace:Cu,negate:uo,neutralToneMapping:Eb,nodeArray:Di,nodeImmutable:Ui,nodeObject:Bi,nodeObjects:Ii,nodeProxy:Vi,normalFlat:Xl,normalGeometry:jl,normalLocal:ql,normalMap:Od,normalView:Kl,normalWorld:Yl,normalize:Qa,not:Ta,notEqual:pa,numWorkgroups:qb,objectDirection:yl,objectGroup:Yn,objectPosition:xl,objectRadius:vl,objectScale:Tl,objectViewPosition:_l,objectWorldMatrix:bl,oneMinus:lo,or:xa,orthographicDepthToViewZ:(e,t,r)=>t.sub(r).mul(e).sub(t),oscSawtooth:(e=Jf)=>e.fract(),oscSine:(e=Jf)=>e.add(.75).mul(2*Math.PI).sin().mul(.5).add(.5),oscSquare:(e=Jf)=>e.fract().round(),oscTriangle:(e=Jf)=>e.add(.5).fract().mul(2).sub(1).abs(),output:In,outputStruct:Gf,overlay:(...e)=>(console.warn('THREE.TSL: "overlay" has been renamed. Use "blendOverlay" instead.'),Xh(e)),overloadingFn:Zf,parabola:jf,parallaxDirection:Id,parallaxUV:(e,t)=>e.sub(Id.mul(t)),parameter:(e,t)=>Bi(new If(e,t)),pass:(e,t,r)=>Bi(new gb(gb.COLOR,e,t,r)),passTexture:(e,t)=>Bi(new hb(e,t)),pcurve:(e,t,r)=>Ro(da(Ro(e,t),oa(Ro(e,t),Ro(ua(1,e),r))),1/t),perspectiveDepthToViewZ:Fh,pmremTexture:mm,pointShadow:Jx,pointUV:Oy,pointWidth:Un,positionGeometry:Dl,positionLocal:Vl,positionPrevious:Ul,positionView:Gl,positionViewDirection:zl,positionWorld:Ol,positionWorldDirection:kl,posterize:db,pow:Ro,pow2:Co,pow3:Mo,pow4:Po,premultiplyAlpha:Yh,property:mn,radians:Ga,rand:Go,range:$b,rangeFog:function(e,t,r){return console.warn('THREE.TSL: "rangeFog( color, near, far )" is deprecated. Use "fog( color, rangeFogFactor( near, far ) )" instead.'),kb(e,Ub(t,r))},rangeFogFactor:Ub,reciprocal:go,reference:yd,referenceBuffer:bd,reflect:No,reflectVector:ld,reflectView:od,reflector:e=>Bi(new Sy(e)),refract:Uo,refractVector:dd,refractView:ud,reinhardToneMapping:yb,remainder:La,remap:Fu,remapClamp:Bu,renderGroup:Kn,renderOutput:Ou,rendererReference:fu,rotate:Im,rotateUV:ry,roughness:xn,round:po,rtt:Ly,sRGBTransferEOTF:ou,sRGBTransferOETF:uu,sampler:e=>(!0===e.isNode?e:Zu(e)).convert("sampler"),samplerComparison:e=>(!0===e.isNode?e:Zu(e)).convert("samplerComparison"),saturate:Vo,saturation:ib,screen:(...e)=>(console.warn('THREE.TSL: "screen" has been renamed. Use "blendScreen" instead.'),qh(e)),screenCoordinate:mh,screenSize:gh,screenUV:ph,scriptable:Db,scriptableValue:Pb,select:Xo,setCurrentStack:Gi,shaderStages:zs,shadow:Hx,shadowPositionWorld:yx,shapeCircle:nT,sharedUniformGroup:qn,sheen:Nn,sheenRoughness:Sn,shiftLeft:wa,shiftRight:Aa,shininess:Bn,sign:ao,sin:Ja,sinc:(e,t)=>Ja(Va.mul(t.mul(e).sub(1))).div(Va.mul(t.mul(e).sub(1))),skinning:Yc,smoothstep:Oo,smoothstepElement:Ho,specularColor:Ln,specularF90:Fn,spherizeUV:sy,split:(e,t)=>Bi(new Zs(Bi(e),t)),spritesheetUV:oy,sqrt:qa,stack:Vf,step:vo,storage:qc,storageBarrier:()=>Zb("storage").toStack(),storageObject:(e,t,r)=>(console.warn('THREE.TSL: "storageObject()" is deprecated. Use "storage().setPBO( true )" instead.'),qc(e,t,r).setPBO(!0)),storageTexture:qy,string:(e="")=>Bi(new si(e,"string")),struct:(e,t=null)=>{const r=new Uf(e,t),s=(...t)=>{let s=null;if(t.length>0)if(t[0].isNode){s={};const r=Object.keys(e);for(let e=0;eZb("texture").toStack(),textureBicubic:lg,textureCubeUV:kg,textureLoad:Ju,textureSize:ju,textureStore:(e,t,r)=>{const s=qy(e,t,r);return null!==r&&s.toStack(),s},thickness:Gn,time:Jf,timerDelta:(e=1)=>(console.warn('TSL: timerDelta() is deprecated. Use "deltaTime" instead.'),ey.mul(e)),timerGlobal:(e=1)=>(console.warn('TSL: timerGlobal() is deprecated. Use "time" instead.'),Jf.mul(e)),timerLocal:(e=1)=>(console.warn('TSL: timerLocal() is deprecated. Use "time" instead.'),Jf.mul(e)),toneMapping:bu,toneMappingExposure:xu,toonOutlinePass:(t,r,s=new e(0,0,0),i=.003,n=1)=>Bi(new mb(t,r,Bi(s),Bi(i),Bi(n))),transformDirection:Lo,transformNormal:ed,transformNormalToView:td,transformedBentNormalView:Dd,transformedBitangentView:Ld,transformedBitangentWorld:Fd,transformedClearcoatNormalView:Jl,transformedNormalView:Ql,transformedNormalWorld:Zl,transformedTangentView:Ed,transformedTangentWorld:wd,transmission:kn,transpose:yo,triNoise3D:Kf,triplanarTexture:(...e)=>ly(...e),triplanarTextures:ly,trunc:mo,tslFn:(...e)=>(console.warn("THREE.TSL: tslFn() has been renamed to Fn()."),ki(...e)),uint:Xi,uniform:Zn,uniformArray:il,uniformCubeTexture:(e=cd)=>pd(e),uniformGroup:jn,uniformTexture:(e=Ku)=>Zu(e),uniforms:(e,t)=>(console.warn("THREE.TSL: uniforms() has been renamed to uniformArray()."),Bi(new sl(e,t))),unpremultiplyAlpha:Qh,userData:(e,t,r)=>Bi(new Qy(e,t,r)),uv:$u,uvec2:Zi,uvec3:rn,uvec4:on,varying:nu,varyingProperty:fn,vec2:Yi,vec3:en,vec4:nn,vectorComponents:Hs,velocity:rb,vertexColor:$h,vertexIndex:Lc,vertexStage:au,vibrance:nb,viewZToLogarithmicDepth:Bh,viewZToOrthographicDepth:Ph,viewZToPerspectiveDepth:Lh,viewport:fh,viewportBottomLeft:vh,viewportCoordinate:bh,viewportDepthTexture:Ch,viewportLinearDepth:Uh,viewportMipTexture:wh,viewportResolution:Th,viewportSafeUV:ny,viewportSharedTexture:np,viewportSize:yh,viewportTexture:Eh,viewportTopLeft:_h,viewportUV:xh,wgsl:(e,t)=>Ab(e,t,"wgsl"),wgslFn:(e,t)=>Cb(e,t,"wgsl"),workgroupArray:(e,t)=>Bi(new ex("Workgroup",e,t)),workgroupBarrier:()=>Zb("workgroup").toStack(),workgroupId:Xb,workingToColorSpace:cu,xor:_a});const JT=new Bf;class e_ extends ef{constructor(e,t){super(),this.renderer=e,this.nodes=t}update(e,t,r){const s=this.renderer,i=this.nodes.getBackgroundNode(e)||e.background;let n=!1;if(null===i)s._clearColor.getRGB(JT),JT.a=s._clearColor.a;else if(!0===i.isColor)i.getRGB(JT),JT.a=1,n=!0;else if(!0===i.isNode){const o=this.get(e),u=i;JT.copy(s._clearColor);let l=o.backgroundMesh;if(void 0===l){const c=Qo(nn(u).mul($y),{getUV:()=>Wy.mul(Yl),getTextureLevel:()=>Hy});let h=Mc;h=h.setZ(h.w);const p=new Zh;function g(){i.removeEventListener("dispose",g),l.material.dispose(),l.geometry.dispose()}p.name="Background.material",p.side=S,p.depthTest=!1,p.depthWrite=!1,p.allowOverride=!1,p.fog=!1,p.lights=!1,p.vertexNode=h,p.colorNode=c,o.backgroundMeshNode=c,o.backgroundMesh=l=new q(new Oe(1,32,32),p),l.frustumCulled=!1,l.name="Background.mesh",l.onBeforeRender=function(e,t,r){this.matrixWorld.copyPosition(r.matrixWorld)},i.addEventListener("dispose",g)}const d=u.getCacheKey();o.backgroundCacheKey!==d&&(o.backgroundMeshNode.node=nn(u).mul($y),o.backgroundMeshNode.needsUpdate=!0,l.material.needsUpdate=!0,o.backgroundCacheKey=d),t.unshift(l,l.geometry,l.material,0,0,null,null)}else console.error("THREE.Renderer: Unsupported background configuration.",i);const a=s.xr.getEnvironmentBlendMode();if("additive"===a?JT.set(0,0,0,1):"alpha-blend"===a&&JT.set(0,0,0,0),!0===s.autoClear||!0===n){const m=r.clearColorValue;m.r=JT.r,m.g=JT.g,m.b=JT.b,m.a=JT.a,!0!==s.backend.isWebGLBackend&&!0!==s.alpha||(m.r*=m.a,m.g*=m.a,m.b*=m.a),r.depthClearValue=s._clearDepth,r.stencilClearValue=s._clearStencil,r.clearColor=!0===s.autoClearColor,r.clearDepth=!0===s.autoClearDepth,r.clearStencil=!0===s.autoClearStencil}else r.clearColor=!1,r.clearDepth=!1,r.clearStencil=!1}}let t_=0;class r_{constructor(e="",t=[],r=0,s=[]){this.name=e,this.bindings=t,this.index=r,this.bindingsReference=s,this.id=t_++}}class s_{constructor(e,t,r,s,i,n,a,o,u,l=[]){this.vertexShader=e,this.fragmentShader=t,this.computeShader=r,this.transforms=l,this.nodeAttributes=s,this.bindings=i,this.updateNodes=n,this.updateBeforeNodes=a,this.updateAfterNodes=o,this.observer=u,this.usedTimes=0}createBindings(){const e=[];for(const t of this.bindings){if(!0!==t.bindings[0].groupNode.shared){const r=new r_(t.name,[],t.index,t);e.push(r);for(const e of t.bindings)r.bindings.push(e.clone())}else e.push(t)}return e}}class i_{constructor(e,t,r=null){this.isNodeAttribute=!0,this.name=e,this.type=t,this.node=r}}class n_{constructor(e,t,r){this.isNodeUniform=!0,this.name=e,this.type=t,this.node=r.getSelf()}get value(){return this.node.value}set value(e){this.node.value=e}get id(){return this.node.id}get groupNode(){return this.node.groupNode}}class a_{constructor(e,t,r=!1,s=null){this.isNodeVar=!0,this.name=e,this.type=t,this.readOnly=r,this.count=s}}class o_ extends a_{constructor(e,t,r=null,s=null){super(e,t),this.needsInterpolation=!1,this.isNodeVarying=!0,this.interpolationType=r,this.interpolationSampling=s}}class u_{constructor(e,t,r=""){this.name=e,this.type=t,this.code=r,Object.defineProperty(this,"isNodeCode",{value:!0})}}let l_=0;class d_{constructor(e=null){this.id=l_++,this.nodesData=new WeakMap,this.parent=e}getData(e){let t=this.nodesData.get(e);return void 0===t&&null!==this.parent&&(t=this.parent.getData(e)),t}setData(e,t){this.nodesData.set(e,t)}}class c_{constructor(e,t){this.name=e,this.members=t,this.output=!1}}class h_{constructor(e,t){this.name=e,this.value=t,this.boundary=0,this.itemSize=0,this.offset=0}setValue(e){this.value=e}getValue(){return this.value}}class p_ extends h_{constructor(e,t=0){super(e,t),this.isNumberUniform=!0,this.boundary=4,this.itemSize=1}}class g_ extends h_{constructor(e,r=new t){super(e,r),this.isVector2Uniform=!0,this.boundary=8,this.itemSize=2}}class m_ extends h_{constructor(e,t=new r){super(e,t),this.isVector3Uniform=!0,this.boundary=16,this.itemSize=3}}class f_ extends h_{constructor(e,t=new s){super(e,t),this.isVector4Uniform=!0,this.boundary=16,this.itemSize=4}}class y_ extends h_{constructor(t,r=new e){super(t,r),this.isColorUniform=!0,this.boundary=16,this.itemSize=3}}class b_ extends h_{constructor(e,t=new i){super(e,t),this.isMatrix2Uniform=!0,this.boundary=8,this.itemSize=4}}class x_ extends h_{constructor(e,t=new n){super(e,t),this.isMatrix3Uniform=!0,this.boundary=48,this.itemSize=12}}class T_ extends h_{constructor(e,t=new a){super(e,t),this.isMatrix4Uniform=!0,this.boundary=64,this.itemSize=16}}class __ extends p_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class v_ extends g_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class N_ extends m_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class S_ extends f_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class E_ extends y_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class w_ extends b_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class A_ extends x_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class R_ extends T_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}const C_=new WeakMap,M_=new Map([[Int8Array,"int"],[Int16Array,"int"],[Int32Array,"int"],[Uint8Array,"uint"],[Uint16Array,"uint"],[Uint32Array,"uint"],[Float32Array,"float"]]),P_=e=>/e/g.test(e)?String(e).replace(/\+/g,""):(e=Number(e))+(e%1?"":".0");class L_{constructor(e,t,r){this.object=e,this.material=e&&e.material||null,this.geometry=e&&e.geometry||null,this.renderer=t,this.parser=r,this.scene=null,this.camera=null,this.nodes=[],this.sequentialNodes=[],this.updateNodes=[],this.updateBeforeNodes=[],this.updateAfterNodes=[],this.hashNodes={},this.observer=null,this.lightsNode=null,this.environmentNode=null,this.fogNode=null,this.clippingContext=null,this.vertexShader=null,this.fragmentShader=null,this.computeShader=null,this.flowNodes={vertex:[],fragment:[],compute:[]},this.flowCode={vertex:"",fragment:"",compute:""},this.uniforms={vertex:[],fragment:[],compute:[],index:0},this.structs={vertex:[],fragment:[],compute:[],index:0},this.bindings={vertex:{},fragment:{},compute:{}},this.bindingsIndexes={},this.bindGroups=null,this.attributes=[],this.bufferAttributes=[],this.varyings=[],this.codes={},this.vars={},this.declarations={},this.flow={code:""},this.chaining=[],this.stack=Vf(),this.stacks=[],this.tab="\t",this.currentFunctionNode=null,this.context={material:this.material},this.cache=new d_,this.globalCache=this.cache,this.flowsData=new WeakMap,this.shaderStage=null,this.buildStage=null}getBindGroupsCache(){let e=C_.get(this.renderer);return void 0===e&&(e=new Km,C_.set(this.renderer,e)),e}createRenderTarget(e,t,r){return new oe(e,t,r)}createCubeRenderTarget(e,t){return new pp(e,t)}includes(e){return this.nodes.includes(e)}getOutputStructName(){}_getBindGroup(e,t){const r=this.getBindGroupsCache(),s=[];let i,n=!0;for(const e of t)s.push(e),n=n&&!0!==e.groupNode.shared;return n?(i=r.get(s),void 0===i&&(i=new r_(e,s,this.bindingsIndexes[e].group,s),r.set(s,i))):i=new r_(e,s,this.bindingsIndexes[e].group,s),i}getBindGroupArray(e,t){const r=this.bindings[t];let s=r[e];return void 0===s&&(void 0===this.bindingsIndexes[e]&&(this.bindingsIndexes[e]={binding:0,group:Object.keys(this.bindingsIndexes).length}),r[e]=s=[]),s}getBindings(){let e=this.bindGroups;if(null===e){const t={},r=this.bindings;for(const e of zs)for(const s in r[e]){const i=r[e][s];(t[s]||(t[s]=[])).push(...i)}e=[];for(const r in t){const s=t[r],i=this._getBindGroup(r,s);e.push(i)}this.bindGroups=e}return e}sortBindingGroups(){const e=this.getBindings();e.sort(((e,t)=>e.bindings[0].groupNode.order-t.bindings[0].groupNode.order));for(let t=0;t=0?`${Math.round(n)}u`:"0u";if("bool"===i)return n?"true":"false";if("color"===i)return`${this.getType("vec3")}( ${P_(n.r)}, ${P_(n.g)}, ${P_(n.b)} )`;const a=this.getTypeLength(i),o=this.getComponentType(i),u=e=>this.generateConst(o,e);if(2===a)return`${this.getType(i)}( ${u(n.x)}, ${u(n.y)} )`;if(3===a)return`${this.getType(i)}( ${u(n.x)}, ${u(n.y)}, ${u(n.z)} )`;if(4===a&&"mat2"!==i)return`${this.getType(i)}( ${u(n.x)}, ${u(n.y)}, ${u(n.z)}, ${u(n.w)} )`;if(a>=4&&n&&(n.isMatrix2||n.isMatrix3||n.isMatrix4))return`${this.getType(i)}( ${n.elements.map(u).join(", ")} )`;if(a>4)return`${this.getType(i)}()`;throw new Error(`NodeBuilder: Type '${i}' not found in generate constant attempt.`)}getType(e){return"color"===e?"vec3":e}hasGeometryAttribute(e){return this.geometry&&void 0!==this.geometry.getAttribute(e)}getAttribute(e,t){const r=this.attributes;for(const t of r)if(t.name===e)return t;const s=new i_(e,t);return this.registerDeclaration(s),r.push(s),s}getPropertyName(e){return e.name}isVector(e){return/vec\d/.test(e)}isMatrix(e){return/mat\d/.test(e)}isReference(e){return"void"===e||"property"===e||"sampler"===e||"samplerComparison"===e||"texture"===e||"cubeTexture"===e||"storageTexture"===e||"depthTexture"===e||"texture3D"===e}needsToWorkingColorSpace(){return!1}getComponentTypeFromTexture(e){const t=e.type;if(e.isDataTexture){if(t===_)return"int";if(t===T)return"uint"}return"float"}getElementType(e){return"mat2"===e?"vec2":"mat3"===e?"vec3":"mat4"===e?"vec4":this.getComponentType(e)}getComponentType(e){if("float"===(e=this.getVectorType(e))||"bool"===e||"int"===e||"uint"===e)return e;const t=/(b|i|u|)(vec|mat)([2-4])/.exec(e);return null===t?null:"b"===t[1]?"bool":"i"===t[1]?"int":"u"===t[1]?"uint":"float"}getVectorType(e){return"color"===e?"vec3":"texture"===e||"cubeTexture"===e||"storageTexture"===e||"texture3D"===e?"vec4":e}getTypeFromLength(e,t="float"){if(1===e)return t;let r=Es(e);const s="float"===t?"":t[0];return!0===/mat2/.test(t)&&(r=r.replace("vec","mat")),s+r}getTypeFromArray(e){return M_.get(e.constructor)}isInteger(e){return/int|uint|(i|u)vec/.test(e)}getTypeFromAttribute(e){let t=e;e.isInterleavedBufferAttribute&&(t=e.data);const r=t.array,s=e.itemSize,i=e.normalized;let n;return e instanceof ze||!0===i||(n=this.getTypeFromArray(r)),this.getTypeFromLength(s,n)}getTypeLength(e){const t=this.getVectorType(e),r=/vec([2-4])/.exec(t);return null!==r?Number(r[1]):"float"===t||"bool"===t||"int"===t||"uint"===t?1:!0===/mat2/.test(e)?4:!0===/mat3/.test(e)?9:!0===/mat4/.test(e)?16:0}getVectorFromMatrix(e){return e.replace("mat","vec")}changeComponentType(e,t){return this.getTypeFromLength(this.getTypeLength(e),t)}getIntegerType(e){const t=this.getComponentType(e);return"int"===t||"uint"===t?e:this.changeComponentType(e,"int")}addStack(){return this.stack=Vf(this.stack),this.stacks.push(zi()||this.stack),Gi(this.stack),this.stack}removeStack(){const e=this.stack;return this.stack=e.parent,Gi(this.stacks.pop()),e}getDataFromNode(e,t=this.shaderStage,r=null){let s=(r=null===r?e.isGlobal(this)?this.globalCache:this.cache:r).getData(e);return void 0===s&&(s={},r.setData(e,s)),void 0===s[t]&&(s[t]={}),s[t]}getNodeProperties(e,t="any"){const r=this.getDataFromNode(e,t);return r.properties||(r.properties={outputNode:null})}getBufferAttributeFromNode(e,t){const r=this.getDataFromNode(e);let s=r.bufferAttribute;if(void 0===s){const i=this.uniforms.index++;s=new i_("nodeAttribute"+i,t,e),this.bufferAttributes.push(s),r.bufferAttribute=s}return s}getStructTypeFromNode(e,t,r=null,s=this.shaderStage){const i=this.getDataFromNode(e,s,this.globalCache);let n=i.structType;if(void 0===n){const e=this.structs.index++;null===r&&(r="StructType"+e),n=new c_(r,t),this.structs[s].push(n),i.structType=n}return n}getOutputStructTypeFromNode(e,t){const r=this.getStructTypeFromNode(e,t,"OutputType","fragment");return r.output=!0,r}getUniformFromNode(e,t,r=this.shaderStage,s=null){const i=this.getDataFromNode(e,r,this.globalCache);let n=i.uniform;if(void 0===n){const a=this.uniforms.index++;n=new n_(s||"nodeUniform"+a,t,e),this.uniforms[r].push(n),this.registerDeclaration(n),i.uniform=n}return n}getArrayCount(e){let t=null;return e.isArrayNode?t=e.count:e.isVarNode&&e.node.isArrayNode&&(t=e.node.count),t}getVarFromNode(e,t=null,r=e.getNodeType(this),s=this.shaderStage,i=!1){const n=this.getDataFromNode(e,s);let a=n.variable;if(void 0===a){const o=i?"_const":"_var",u=this.vars[s]||(this.vars[s]=[]),l=this.vars[o]||(this.vars[o]=0);null===t&&(t=(i?"nodeConst":"nodeVar")+l,this.vars[o]++);const d=this.getArrayCount(e);a=new a_(t,r,i,d),i||u.push(a),this.registerDeclaration(a),n.variable=a}return a}isDeterministic(e){if(e.isMathNode)return this.isDeterministic(e.aNode)&&(!e.bNode||this.isDeterministic(e.bNode))&&(!e.cNode||this.isDeterministic(e.cNode));if(e.isOperatorNode)return this.isDeterministic(e.aNode)&&(!e.bNode||this.isDeterministic(e.bNode));if(e.isArrayNode){if(null!==e.values)for(const t of e.values)if(!this.isDeterministic(t))return!1;return!0}return!!e.isConstNode}getVaryingFromNode(e,t=null,r=e.getNodeType(this),s=null,i=null){const n=this.getDataFromNode(e,"any");let a=n.varying;if(void 0===a){const e=this.varyings,o=e.length;null===t&&(t="nodeVarying"+o),a=new o_(t,r,s,i),e.push(a),this.registerDeclaration(a),n.varying=a}return a}get namespace(){return this.context.namespace}getOutputNamespace(){return this.getNamespace("outputNode")}getNamespace(e=""){const t=this.namespace;let r;return r=t?e?t+"_"+e:t:e,r}registerDeclaration(e){const t=this.shaderStage,r=this.declarations[t]||(this.declarations[t]={}),s=this.getPropertyName(e);let i=1,n=s;for(;void 0!==r[n];)n=s+"_"+i++;i>1&&(e.name=n,console.warn(`THREE.TSL: Declaration name '${s}' of '${e.type}' already in use. Renamed to '${n}'.`)),r[n]=e}getCodeFromNode(e,t,r=this.shaderStage){const s=this.getDataFromNode(e);let i=s.code;if(void 0===i){const e=this.codes[r]||(this.codes[r]=[]),n=e.length;i=new u_("nodeCode"+n,t),e.push(i),s.code=i}return i}addFlowCodeHierarchy(e,t){const{flowCodes:r,flowCodeBlock:s}=this.getDataFromNode(e);let i=!0,n=t;for(;n;){if(!0===s.get(n)){i=!1;break}n=this.getDataFromNode(n).parentNodeBlock}if(i)for(const e of r)this.addLineFlowCode(e)}addLineFlowCodeBlock(e,t,r){const s=this.getDataFromNode(e),i=s.flowCodes||(s.flowCodes=[]),n=s.flowCodeBlock||(s.flowCodeBlock=new WeakMap);i.push(t),n.set(r,!0)}addLineFlowCode(e,t=null){return""===e||(null!==t&&this.context.nodeBlock&&this.addLineFlowCodeBlock(t,e,this.context.nodeBlock),e=this.tab+e,/;\s*$/.test(e)||(e+=";\n"),this.flow.code+=e),this}addFlowCode(e){return this.flow.code+=e,this}addFlowTab(){return this.tab+="\t",this}removeFlowTab(){return this.tab=this.tab.slice(0,-1),this}getFlowData(e){return this.flowsData.get(e)}flowNode(e){const t=e.getNodeType(this),r=this.flowChildNode(e,t);return this.flowsData.set(e,r),r}addInclude(e){null!==this.currentFunctionNode&&this.currentFunctionNode.includes.push(e)}buildFunctionNode(e){const t=new Rb,r=this.currentFunctionNode;return this.currentFunctionNode=t,t.code=this.buildFunctionCode(e),this.currentFunctionNode=r,t}flowShaderNode(e){const t=e.layout,r={[Symbol.iterator](){let e=0;const t=Object.values(this);return{next:()=>({value:t[e],done:e++>=t.length})}}};for(const e of t.inputs)r[e.name]=new If(e.type,e.name);e.layout=null;const s=e.call(r),i=this.flowStagesNode(s,t.type);return e.layout=t,i}flowStagesNode(e,t=null){const r=this.flow,s=this.vars,i=this.declarations,n=this.cache,a=this.buildStage,o=this.stack,u={code:""};this.flow=u,this.vars={},this.declarations={},this.cache=new d_,this.stack=Vf();for(const r of Gs)this.setBuildStage(r),u.result=e.build(this,t);return u.vars=this.getVars(this.shaderStage),this.flow=r,this.vars=s,this.declarations=i,this.cache=n,this.stack=o,this.setBuildStage(a),u}getFunctionOperator(){return null}buildFunctionCode(){console.warn("Abstract function.")}flowChildNode(e,t=null){const r=this.flow,s={code:""};return this.flow=s,s.result=e.build(this,t),this.flow=r,s}flowNodeFromShaderStage(e,t,r=null,s=null){const i=this.tab,n=this.cache,a=this.shaderStage,o=this.context;this.setShaderStage(e);const u={...this.context};delete u.nodeBlock,this.cache=this.globalCache,this.tab="\t",this.context=u;let l=null;if("generate"===this.buildStage){const i=this.flowChildNode(t,r);null!==s&&(i.code+=`${this.tab+s} = ${i.result};\n`),this.flowCode[e]=this.flowCode[e]+i.code,l=i}else l=t.build(this);return this.setShaderStage(a),this.cache=n,this.tab=i,this.context=o,l}getAttributesArray(){return this.attributes.concat(this.bufferAttributes)}getAttributes(){console.warn("Abstract function.")}getVaryings(){console.warn("Abstract function.")}getVar(e,t,r=null){return`${null!==r?this.generateArrayDeclaration(e,r):this.getType(e)} ${t}`}getVars(e){let t="";const r=this.vars[e];if(void 0!==r)for(const e of r)t+=`${this.getVar(e.type,e.name)}; `;return t}getUniforms(){console.warn("Abstract function.")}getCodes(e){const t=this.codes[e];let r="";if(void 0!==t)for(const e of t)r+=e.code+"\n";return r}getHash(){return this.vertexShader+this.fragmentShader+this.computeShader}setShaderStage(e){this.shaderStage=e}getShaderStage(){return this.shaderStage}setBuildStage(e){this.buildStage=e}getBuildStage(){return this.buildStage}buildCode(){console.warn("Abstract function.")}build(){const{object:e,material:t,renderer:r}=this;if(null!==t){let e=r.library.fromMaterial(t);null===e&&(console.error(`NodeMaterial: Material "${t.type}" is not compatible.`),e=new Zh),e.build(this)}else this.addFlow("compute",e);for(const e of Gs){this.setBuildStage(e),this.context.vertex&&this.context.vertex.isNode&&this.flowNodeFromShaderStage("vertex",this.context.vertex);for(const t of zs){this.setShaderStage(t);const r=this.flowNodes[t];for(const t of r)"generate"===e?this.flowNode(t):t.build(this)}}return this.setBuildStage(null),this.setShaderStage(null),this.buildCode(),this.buildUpdateNodes(),this}getNodeUniform(e,t){if("float"===t||"int"===t||"uint"===t)return new __(e);if("vec2"===t||"ivec2"===t||"uvec2"===t)return new v_(e);if("vec3"===t||"ivec3"===t||"uvec3"===t)return new N_(e);if("vec4"===t||"ivec4"===t||"uvec4"===t)return new S_(e);if("color"===t)return new E_(e);if("mat2"===t)return new w_(e);if("mat3"===t)return new A_(e);if("mat4"===t)return new R_(e);throw new Error(`Uniform "${t}" not declared.`)}format(e,t,r){if((t=this.getVectorType(t))===(r=this.getVectorType(r))||null===r||this.isReference(r))return e;const s=this.getTypeLength(t),i=this.getTypeLength(r);return 16===s&&9===i?`${this.getType(r)}( ${e}[ 0 ].xyz, ${e}[ 1 ].xyz, ${e}[ 2 ].xyz )`:9===s&&4===i?`${this.getType(r)}( ${e}[ 0 ].xy, ${e}[ 1 ].xy )`:s>4||i>4||0===i?e:s===i?`${this.getType(r)}( ${e} )`:s>i?(e="bool"===r?`all( ${e} )`:`${e}.${"xyz".slice(0,i)}`,this.format(e,this.getTypeFromLength(i,this.getComponentType(t)),r)):4===i&&s>1?`${this.getType(r)}( ${this.format(e,t,"vec3")}, 1.0 )`:2===s?`${this.getType(r)}( ${this.format(e,t,"vec2")}, 0.0 )`:(1===s&&i>1&&t!==this.getComponentType(r)&&(e=`${this.getType(this.getComponentType(r))}( ${e} )`),`${this.getType(r)}( ${e} )`)}getSignature(){return`// Three.js r${He} - Node System\n`}*[Symbol.iterator](){}createNodeMaterial(e="NodeMaterial"){throw new Error(`THREE.NodeBuilder: createNodeMaterial() was deprecated. Use new ${e}() instead.`)}}class F_{constructor(){this.time=0,this.deltaTime=0,this.frameId=0,this.renderId=0,this.updateMap=new WeakMap,this.updateBeforeMap=new WeakMap,this.updateAfterMap=new WeakMap,this.renderer=null,this.material=null,this.camera=null,this.object=null,this.scene=null}_getMaps(e,t){let r=e.get(t);return void 0===r&&(r={renderMap:new WeakMap,frameMap:new WeakMap},e.set(t,r)),r}updateBeforeNode(e){const t=e.getUpdateBeforeType(),r=e.updateReference(this);if(t===Vs.FRAME){const{frameMap:t}=this._getMaps(this.updateBeforeMap,r);t.get(r)!==this.frameId&&!1!==e.updateBefore(this)&&t.set(r,this.frameId)}else if(t===Vs.RENDER){const{renderMap:t}=this._getMaps(this.updateBeforeMap,r);t.get(r)!==this.renderId&&!1!==e.updateBefore(this)&&t.set(r,this.renderId)}else t===Vs.OBJECT&&e.updateBefore(this)}updateAfterNode(e){const t=e.getUpdateAfterType(),r=e.updateReference(this);if(t===Vs.FRAME){const{frameMap:t}=this._getMaps(this.updateAfterMap,r);t.get(r)!==this.frameId&&!1!==e.updateAfter(this)&&t.set(r,this.frameId)}else if(t===Vs.RENDER){const{renderMap:t}=this._getMaps(this.updateAfterMap,r);t.get(r)!==this.renderId&&!1!==e.updateAfter(this)&&t.set(r,this.renderId)}else t===Vs.OBJECT&&e.updateAfter(this)}updateNode(e){const t=e.getUpdateType(),r=e.updateReference(this);if(t===Vs.FRAME){const{frameMap:t}=this._getMaps(this.updateMap,r);t.get(r)!==this.frameId&&!1!==e.update(this)&&t.set(r,this.frameId)}else if(t===Vs.RENDER){const{renderMap:t}=this._getMaps(this.updateMap,r);t.get(r)!==this.renderId&&!1!==e.update(this)&&t.set(r,this.renderId)}else t===Vs.OBJECT&&e.update(this)}update(){this.frameId++,void 0===this.lastTime&&(this.lastTime=performance.now()),this.deltaTime=(performance.now()-this.lastTime)/1e3,this.lastTime=performance.now(),this.time+=this.deltaTime}}class B_{constructor(e,t,r=null,s="",i=!1){this.type=e,this.name=t,this.count=r,this.qualifier=s,this.isConst=i}}B_.isNodeFunctionInput=!0;class I_ extends eT{static get type(){return"DirectionalLightNode"}constructor(e=null){super(e)}setupDirect(){const e=this.colorNode;return{lightDirection:cx(this.light),lightColor:e}}}const D_=new a,V_=new a;let U_=null;class O_ extends eT{static get type(){return"RectAreaLightNode"}constructor(e=null){super(e),this.halfHeight=Zn(new r).setGroup(Kn),this.halfWidth=Zn(new r).setGroup(Kn),this.updateType=Vs.RENDER}update(e){super.update(e);const{light:t}=this,r=e.camera.matrixWorldInverse;V_.identity(),D_.copy(t.matrixWorld),D_.premultiply(r),V_.extractRotation(D_),this.halfWidth.value.set(.5*t.width,0,0),this.halfHeight.value.set(0,.5*t.height,0),this.halfWidth.value.applyMatrix4(V_),this.halfHeight.value.applyMatrix4(V_)}setupDirectRectArea(e){let t,r;e.isAvailable("float32Filterable")?(t=Zu(U_.LTC_FLOAT_1),r=Zu(U_.LTC_FLOAT_2)):(t=Zu(U_.LTC_HALF_1),r=Zu(U_.LTC_HALF_2));const{colorNode:s,light:i}=this;return{lightColor:s,lightPosition:dx(i),halfWidth:this.halfWidth,halfHeight:this.halfHeight,ltc_1:t,ltc_2:r}}static setLTC(e){U_=e}}class k_ extends eT{static get type(){return"SpotLightNode"}constructor(e=null){super(e),this.coneCosNode=Zn(0).setGroup(Kn),this.penumbraCosNode=Zn(0).setGroup(Kn),this.cutoffDistanceNode=Zn(0).setGroup(Kn),this.decayExponentNode=Zn(0).setGroup(Kn),this.colorNode=Zn(this.color).setGroup(Kn)}update(e){super.update(e);const{light:t}=this;this.coneCosNode.value=Math.cos(t.angle),this.penumbraCosNode.value=Math.cos(t.angle*(1-t.penumbra)),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}getSpotAttenuation(e,t){const{coneCosNode:r,penumbraCosNode:s}=this;return Oo(r,s,t)}getLightCoord(e){const t=e.getNodeProperties(this);let r=t.projectionUV;return void 0===r&&(r=ox(this.light,e.context.positionWorld),t.projectionUV=r),r}setupDirect(e){const{colorNode:t,cutoffDistanceNode:r,decayExponentNode:s,light:i}=this,n=this.getLightVector(e),a=n.normalize(),o=a.dot(cx(i)),u=this.getSpotAttenuation(e,o),l=n.length(),d=tT({lightDistance:l,cutoffDistance:r,decayExponent:s});let c,h,p=t.mul(u).mul(d);if(i.colorNode?(h=this.getLightCoord(e),c=i.colorNode(h)):i.map&&(h=this.getLightCoord(e),c=Zu(i.map,h.xy).onRenderUpdate((()=>i.map))),c){p=h.mul(2).sub(1).abs().lessThan(1).all().select(p.mul(c),p)}return{lightColor:p,lightDirection:a}}}class G_ extends k_{static get type(){return"IESSpotLightNode"}getSpotAttenuation(e,t){const r=this.light.iesMap;let s=null;if(r&&!0===r.isTexture){const e=t.acos().mul(1/Math.PI);s=Zu(r,Yi(e,0),0).r}else s=super.getSpotAttenuation(t);return s}}const z_=ki((([e,t])=>{const r=e.abs().sub(t);return oo(_o(r,0)).add(To(_o(r.x,r.y),0))}));class H_ extends k_{static get type(){return"ProjectorLightNode"}update(e){super.update(e);const t=this.light;if(this.penumbraCosNode.value=Math.min(Math.cos(t.angle*(1-t.penumbra)),.99999),null===t.aspect){let e=1;null!==t.map&&(e=t.map.width/t.map.height),t.shadow.aspect=e}else t.shadow.aspect=t.aspect}getSpotAttenuation(e){const t=this.penumbraCosNode,r=this.getLightCoord(e),s=r.xyz.div(r.w),i=z_(s.xy.sub(Yi(.5)),Yi(.5)),n=da(-1,ua(1,so(t)).sub(1));return Vo(i.mul(-2).mul(n))}}class $_ extends eT{static get type(){return"AmbientLightNode"}constructor(e=null){super(e)}setup({context:e}){e.irradiance.addAssign(this.colorNode)}}class W_ extends eT{static get type(){return"HemisphereLightNode"}constructor(t=null){super(t),this.lightPositionNode=ux(t),this.lightDirectionNode=this.lightPositionNode.normalize(),this.groundColorNode=Zn(new e).setGroup(Kn)}update(e){const{light:t}=this;super.update(e),this.lightPositionNode.object3d=t,this.groundColorNode.value.copy(t.groundColor).multiplyScalar(t.intensity)}setup(e){const{colorNode:t,groundColorNode:r,lightDirectionNode:s}=this,i=Yl.dot(s).mul(.5).add(.5),n=Io(r,t,i);e.context.irradiance.addAssign(n)}}class j_ extends eT{static get type(){return"LightProbeNode"}constructor(e=null){super(e);const t=[];for(let e=0;e<9;e++)t.push(new r);this.lightProbe=il(t)}update(e){const{light:t}=this;super.update(e);for(let e=0;e<9;e++)this.lightProbe.array[e].copy(t.sh.coefficients[e]).multiplyScalar(t.intensity)}setup(e){const t=QT(Yl,this.lightProbe);e.context.irradiance.addAssign(t)}}class q_{parseFunction(){console.warn("Abstract function.")}}class X_{constructor(e,t,r="",s=""){this.type=e,this.inputs=t,this.name=r,this.precision=s}getCode(){console.warn("Abstract function.")}}X_.isNodeFunction=!0;const K_=/^\s*(highp|mediump|lowp)?\s*([a-z_0-9]+)\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)/i,Y_=/[a-z_0-9]+/gi,Q_="#pragma main";class Z_ extends X_{constructor(e){const{type:t,inputs:r,name:s,precision:i,inputsCode:n,blockCode:a,headerCode:o}=(e=>{const t=(e=e.trim()).indexOf(Q_),r=-1!==t?e.slice(t+12):e,s=r.match(K_);if(null!==s&&5===s.length){const i=s[4],n=[];let a=null;for(;null!==(a=Y_.exec(i));)n.push(a);const o=[];let u=0;for(;u0||e.backgroundBlurriness>0&&0===t.backgroundBlurriness;if(t.background!==r||s){const i=this.getCacheNode("background",r,(()=>{if(!0===r.isCubeTexture||r.mapping===Q||r.mapping===Z||r.mapping===ce){if(e.backgroundBlurriness>0||r.mapping===ce)return mm(r);{let e;return e=!0===r.isCubeTexture?gd(r):Zu(r),bp(e)}}if(!0===r.isTexture)return Zu(r,ph.flipY()).setUpdateMatrix(!0);!0!==r.isColor&&console.error("WebGPUNodes: Unsupported background configuration.",r)}),s);t.backgroundNode=i,t.background=r,t.backgroundBlurriness=e.backgroundBlurriness}}else t.backgroundNode&&(delete t.backgroundNode,delete t.background)}getCacheNode(e,t,r,s=!1){const i=this.cacheLib[e]||(this.cacheLib[e]=new WeakMap);let n=i.get(t);return(void 0===n||s)&&(n=r(),i.set(t,n)),n}updateFog(e){const t=this.get(e),r=e.fog;if(r){if(t.fog!==r){const e=this.getCacheNode("fog",r,(()=>{if(r.isFogExp2){const e=yd("color","color",r).setGroup(Kn),t=yd("density","float",r).setGroup(Kn);return kb(e,Ob(t))}if(r.isFog){const e=yd("color","color",r).setGroup(Kn),t=yd("near","float",r).setGroup(Kn),s=yd("far","float",r).setGroup(Kn);return kb(e,Ub(t,s))}console.error("THREE.Renderer: Unsupported fog configuration.",r)}));t.fogNode=e,t.fog=r}}else delete t.fogNode,delete t.fog}updateEnvironment(e){const t=this.get(e),r=e.environment;if(r){if(t.environment!==r){const e=this.getCacheNode("environment",r,(()=>!0===r.isCubeTexture?gd(r):!0===r.isTexture?Zu(r):void console.error("Nodes: Unsupported environment configuration.",r)));t.environmentNode=e,t.environment=r}}else t.environmentNode&&(delete t.environmentNode,delete t.environment)}getNodeFrame(e=this.renderer,t=null,r=null,s=null,i=null){const n=this.nodeFrame;return n.renderer=e,n.scene=t,n.object=r,n.camera=s,n.material=i,n}getNodeFrameForRender(e){return this.getNodeFrame(e.renderer,e.scene,e.object,e.camera,e.material)}getOutputCacheKey(){const e=this.renderer;return e.toneMapping+","+e.currentColorSpace+","+e.xr.isPresenting}hasOutputChange(e){return ev.get(e)!==this.getOutputCacheKey()}getOutputNode(e){const t=this.renderer,r=this.getOutputCacheKey(),s=e.isArrayTexture?Yy(e,en(ph,nl("gl_ViewID_OVR"))).renderOutput(t.toneMapping,t.currentColorSpace):Zu(e,ph).renderOutput(t.toneMapping,t.currentColorSpace);return ev.set(e,r),s}updateBefore(e){const t=e.getNodeBuilderState();for(const r of t.updateBeforeNodes)this.getNodeFrameForRender(e).updateBeforeNode(r)}updateAfter(e){const t=e.getNodeBuilderState();for(const r of t.updateAfterNodes)this.getNodeFrameForRender(e).updateAfterNode(r)}updateForCompute(e){const t=this.getNodeFrame(),r=this.getForCompute(e);for(const e of r.updateNodes)t.updateNode(e)}updateForRender(e){const t=this.getNodeFrameForRender(e),r=e.getNodeBuilderState();for(const e of r.updateNodes)t.updateNode(e)}needsRefresh(e){const t=this.getNodeFrameForRender(e);return e.getMonitor().needsRefresh(e,t)}dispose(){super.dispose(),this.nodeFrame=new F_,this.nodeBuilderCache=new Map,this.cacheLib={}}}const iv=new Me;class nv{constructor(e=null){this.version=0,this.clipIntersection=null,this.cacheKey="",this.shadowPass=!1,this.viewNormalMatrix=new n,this.clippingGroupContexts=new WeakMap,this.intersectionPlanes=[],this.unionPlanes=[],this.parentVersion=null,null!==e&&(this.viewNormalMatrix=e.viewNormalMatrix,this.clippingGroupContexts=e.clippingGroupContexts,this.shadowPass=e.shadowPass,this.viewMatrix=e.viewMatrix)}projectPlanes(e,t,r){const s=e.length;for(let i=0;i0,alpha:!0,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:this.getFramebufferScaleFactor()},i=new XRWebGLLayer(e,s,r);this._glBaseLayer=i,e.updateRenderState({baseLayer:i}),t.setPixelRatio(1),t._setXRLayerSize(i.framebufferWidth,i.framebufferHeight),this._xrRenderTarget=new pv(i.framebufferWidth,i.framebufferHeight,{format:le,type:Ce,colorSpace:t.outputColorSpace,stencilBuffer:t.stencil,resolveDepthBuffer:!1===i.ignoreDepthValues,resolveStencilBuffer:!1===i.ignoreDepthValues}),this._xrRenderTarget._isOpaqueFramebuffer=!0,this._referenceSpace=await e.requestReferenceSpace(this.getReferenceSpaceType())}this.setFoveation(this.getFoveation()),t._animation.setAnimationLoop(this._onAnimationFrame),t._animation.setContext(e),t._animation.start(),this.isPresenting=!0,this.dispatchEvent({type:"sessionstart"})}}updateCamera(e){const t=this._session;if(null===t)return;const r=e.near,s=e.far,i=this._cameraXR,n=this._cameraL,a=this._cameraR;i.near=a.near=n.near=r,i.far=a.far=n.far=s,i.isMultiViewCamera=this._useMultiview,this._currentDepthNear===i.near&&this._currentDepthFar===i.far||(t.updateRenderState({depthNear:i.near,depthFar:i.far}),this._currentDepthNear=i.near,this._currentDepthFar=i.far),n.layers.mask=2|e.layers.mask,a.layers.mask=4|e.layers.mask,i.layers.mask=n.layers.mask|a.layers.mask;const o=e.parent,u=i.cameras;yv(i,o);for(let e=0;e=0&&(r[n]=null,t[n].disconnect(i))}for(let s=0;s=r.length){r.push(i),n=e;break}if(null===r[e]){r[e]=i,n=e;break}}if(-1===n)break}const a=t[n];a&&a.connect(i)}}function _v(e){return"quad"===e.type?this._glBinding.createQuadLayer({transform:new XRRigidTransform(e.translation,e.quaternion),width:e.width/2,height:e.height/2,space:this._referenceSpace,viewPixelWidth:e.pixelwidth,viewPixelHeight:e.pixelheight,clearOnAccess:!1}):this._glBinding.createCylinderLayer({transform:new XRRigidTransform(e.translation,e.quaternion),radius:e.radius,centralAngle:e.centralAngle,aspectRatio:e.aspectRatio,space:this._referenceSpace,viewPixelWidth:e.pixelwidth,viewPixelHeight:e.pixelheight,clearOnAccess:!1})}function vv(e,t){if(void 0===t)return;const r=this._cameraXR,i=this._renderer,n=i.backend,a=this._glBaseLayer,o=this.getReferenceSpace(),u=t.getViewerPose(o);if(this._xrFrame=t,null!==u){const e=u.views;null!==this._glBaseLayer&&n.setXRTarget(a.framebuffer);let t=!1;e.length!==r.cameras.length&&(r.cameras.length=0,t=!0);for(let i=0;i{await this.compileAsync(e,t);const s=this._renderLists.get(e,t),i=this._renderContexts.get(e,t,this._renderTarget),n=e.overrideMaterial||r.material,a=this._objects.get(r,n,e,t,s.lightsNode,i,i.clippingContext),{fragmentShader:o,vertexShader:u}=a.getNodeBuilderState();return{fragmentShader:o,vertexShader:u}}}}async init(){if(this._initialized)throw new Error("Renderer: Backend has already been initialized.");return null!==this._initPromise||(this._initPromise=new Promise((async(e,t)=>{let r=this.backend;try{await r.init(this)}catch(e){if(null===this._getFallback)return void t(e);try{this.backend=r=this._getFallback(e),await r.init(this)}catch(e){return void t(e)}}this._nodes=new sv(this,r),this._animation=new Xm(this._nodes,this.info),this._attributes=new of(r),this._background=new e_(this,this._nodes),this._geometries=new df(this._attributes,this.info),this._textures=new Ff(this,r,this.info),this._pipelines=new yf(r,this._nodes),this._bindings=new bf(r,this._nodes,this._textures,this._attributes,this._pipelines,this.info),this._objects=new Jm(this,this._nodes,this._geometries,this._pipelines,this._bindings,this.info),this._renderLists=new Sf(this.lighting),this._bundles=new uv,this._renderContexts=new Pf,this._animation.start(),this._initialized=!0,e(this)}))),this._initPromise}get coordinateSystem(){return this.backend.coordinateSystem}async compileAsync(e,t,r=null){if(!0===this._isDeviceLost)return;!1===this._initialized&&await this.init();const s=this._nodes.nodeFrame,i=s.renderId,n=this._currentRenderContext,a=this._currentRenderObjectFunction,o=this._compilationPromises,u=!0===e.isScene?e:Nv;null===r&&(r=e);const l=this._renderTarget,d=this._renderContexts.get(r,t,l),c=this._activeMipmapLevel,h=[];this._currentRenderContext=d,this._currentRenderObjectFunction=this.renderObject,this._handleObjectFunction=this._createObjectPipeline,this._compilationPromises=h,s.renderId++,s.update(),d.depth=this.depth,d.stencil=this.stencil,d.clippingContext||(d.clippingContext=new nv),d.clippingContext.updateGlobal(u,t),u.onBeforeRender(this,e,t,l);const p=this._renderLists.get(e,t);if(p.begin(),this._projectObject(e,t,0,p,d.clippingContext),r!==e&&r.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&p.pushLight(e)})),p.finish(),null!==l){this._textures.updateRenderTarget(l,c);const e=this._textures.get(l);d.textures=e.textures,d.depthTexture=e.depthTexture}else d.textures=null,d.depthTexture=null;this._background.update(u,p,d);const g=p.opaque,m=p.transparent,f=p.transparentDoublePass,y=p.lightsNode;!0===this.opaque&&g.length>0&&this._renderObjects(g,t,u,y),!0===this.transparent&&m.length>0&&this._renderTransparents(m,f,t,u,y),s.renderId=i,this._currentRenderContext=n,this._currentRenderObjectFunction=a,this._compilationPromises=o,this._handleObjectFunction=this._renderObjectDirect,await Promise.all(h)}async renderAsync(e,t){!1===this._initialized&&await this.init(),this._renderScene(e,t)}async waitForGPU(){await this.backend.waitForGPU()}set highPrecision(e){!0===e?(this.overrideNodes.modelViewMatrix=Bl,this.overrideNodes.modelNormalViewMatrix=Il):this.highPrecision&&(this.overrideNodes.modelViewMatrix=null,this.overrideNodes.modelNormalViewMatrix=null)}get highPrecision(){return this.overrideNodes.modelViewMatrix===Bl&&this.overrideNodes.modelNormalViewMatrix===Il}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}getColorBufferType(){return this._colorBufferType}_onDeviceLost(e){let t=`THREE.WebGPURenderer: ${e.api} Device Lost:\n\nMessage: ${e.message}`;e.reason&&(t+=`\nReason: ${e.reason}`),console.error(t),this._isDeviceLost=!0}_renderBundle(e,t,r){const{bundleGroup:s,camera:i,renderList:n}=e,a=this._currentRenderContext,o=this._bundles.get(s,i),u=this.backend.get(o);void 0===u.renderContexts&&(u.renderContexts=new Set);const l=s.version!==u.version,d=!1===u.renderContexts.has(a)||l;if(u.renderContexts.add(a),d){this.backend.beginBundle(a),(void 0===u.renderObjects||l)&&(u.renderObjects=[]),this._currentRenderBundle=o;const{transparentDoublePass:e,transparent:d,opaque:c}=n;!0===this.opaque&&c.length>0&&this._renderObjects(c,i,t,r),!0===this.transparent&&d.length>0&&this._renderTransparents(d,e,i,t,r),this._currentRenderBundle=null,this.backend.finishBundle(a,o),u.version=s.version}else{const{renderObjects:e}=u;for(let t=0,r=e.length;t>=c,p.viewportValue.height>>=c,p.viewportValue.minDepth=x,p.viewportValue.maxDepth=T,p.viewport=!1===p.viewportValue.equals(Ev),p.scissorValue.copy(y).multiplyScalar(b).floor(),p.scissor=this._scissorTest&&!1===p.scissorValue.equals(Ev),p.scissorValue.width>>=c,p.scissorValue.height>>=c,p.clippingContext||(p.clippingContext=new nv),p.clippingContext.updateGlobal(u,t),u.onBeforeRender(this,e,t,h);const _=t.isArrayCamera?Av:wv;t.isArrayCamera||(Rv.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),_.setFromProjectionMatrix(Rv,g));const v=this._renderLists.get(e,t);if(v.begin(),this._projectObject(e,t,0,v,p.clippingContext),v.finish(),!0===this.sortObjects&&v.sort(this._opaqueSort,this._transparentSort),null!==h){this._textures.updateRenderTarget(h,c);const e=this._textures.get(h);p.textures=e.textures,p.depthTexture=e.depthTexture,p.width=e.width,p.height=e.height,p.renderTarget=h,p.depth=h.depthBuffer,p.stencil=h.stencilBuffer}else p.textures=null,p.depthTexture=null,p.width=this.domElement.width,p.height=this.domElement.height,p.depth=this.depth,p.stencil=this.stencil;p.width>>=c,p.height>>=c,p.activeCubeFace=d,p.activeMipmapLevel=c,p.occlusionQueryCount=v.occlusionQueryCount,this._background.update(u,v,p),p.camera=t,this.backend.beginRender(p);const{bundles:N,lightsNode:S,transparentDoublePass:E,transparent:w,opaque:A}=v;return N.length>0&&this._renderBundles(N,u,S),!0===this.opaque&&A.length>0&&this._renderObjects(A,t,u,S),!0===this.transparent&&w.length>0&&this._renderTransparents(w,E,t,u,S),this.backend.finishRender(p),i.renderId=n,this._currentRenderContext=a,this._currentRenderObjectFunction=o,null!==s&&(this.setRenderTarget(l,d,c),this._renderOutput(h)),u.onAfterRender(this,e,t,h),p}_setXRLayerSize(e,t){this._width=e,this._height=t,this.setViewport(0,0,e,t)}_renderOutput(e){const t=this._quad;this._nodes.hasOutputChange(e.texture)&&(t.material.fragmentNode=this._nodes.getOutputNode(e.texture),t.material.needsUpdate=!0);const r=this.autoClear,s=this.xr.enabled;this.autoClear=!1,this.xr.enabled=!1,this._renderScene(t,t.camera,!1),this.autoClear=r,this.xr.enabled=s}getMaxAnisotropy(){return this.backend.getMaxAnisotropy()}getActiveCubeFace(){return this._activeCubeFace}getActiveMipmapLevel(){return this._activeMipmapLevel}async setAnimationLoop(e){!1===this._initialized&&await this.init(),this._animation.setAnimationLoop(e)}async getArrayBufferAsync(e){return await this.backend.getArrayBufferAsync(e)}getContext(){return this.backend.getContext()}getPixelRatio(){return this._pixelRatio}getDrawingBufferSize(e){return e.set(this._width*this._pixelRatio,this._height*this._pixelRatio).floor()}getSize(e){return e.set(this._width,this._height)}setPixelRatio(e=1){this._pixelRatio!==e&&(this._pixelRatio=e,this.setSize(this._width,this._height,!1))}setDrawingBufferSize(e,t,r){this.xr&&this.xr.isPresenting||(this._width=e,this._height=t,this._pixelRatio=r,this.domElement.width=Math.floor(e*r),this.domElement.height=Math.floor(t*r),this.setViewport(0,0,e,t),this._initialized&&this.backend.updateSize())}setSize(e,t,r=!0){this.xr&&this.xr.isPresenting||(this._width=e,this._height=t,this.domElement.width=Math.floor(e*this._pixelRatio),this.domElement.height=Math.floor(t*this._pixelRatio),!0===r&&(this.domElement.style.width=e+"px",this.domElement.style.height=t+"px"),this.setViewport(0,0,e,t),this._initialized&&this.backend.updateSize())}setOpaqueSort(e){this._opaqueSort=e}setTransparentSort(e){this._transparentSort=e}getScissor(e){const t=this._scissor;return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e}setScissor(e,t,r,s){const i=this._scissor;e.isVector4?i.copy(e):i.set(e,t,r,s)}getScissorTest(){return this._scissorTest}setScissorTest(e){this._scissorTest=e,this.backend.setScissorTest(e)}getViewport(e){return e.copy(this._viewport)}setViewport(e,t,r,s,i=0,n=1){const a=this._viewport;e.isVector4?a.copy(e):a.set(e,t,r,s),a.minDepth=i,a.maxDepth=n}getClearColor(e){return e.copy(this._clearColor)}setClearColor(e,t=1){this._clearColor.set(e),this._clearColor.a=t}getClearAlpha(){return this._clearColor.a}setClearAlpha(e){this._clearColor.a=e}getClearDepth(){return this._clearDepth}setClearDepth(e){this._clearDepth=e}getClearStencil(){return this._clearStencil}setClearStencil(e){this._clearStencil=e}isOccluded(e){const t=this._currentRenderContext;return t&&this.backend.isOccluded(t,e)}clear(e=!0,t=!0,r=!0){if(!1===this._initialized)return console.warn("THREE.Renderer: .clear() called before the backend is initialized. Try using .clearAsync() instead."),this.clearAsync(e,t,r);const s=this._renderTarget||this._getFrameBufferTarget();let i=null;if(null!==s){this._textures.updateRenderTarget(s);const e=this._textures.get(s);i=this._renderContexts.getForClear(s),i.textures=e.textures,i.depthTexture=e.depthTexture,i.width=e.width,i.height=e.height,i.renderTarget=s,i.depth=s.depthBuffer,i.stencil=s.stencilBuffer,i.clearColorValue=this.backend.getClearColor(),i.activeCubeFace=this.getActiveCubeFace(),i.activeMipmapLevel=this.getActiveMipmapLevel()}this.backend.clear(e,t,r,i),null!==s&&null===this._renderTarget&&this._renderOutput(s)}clearColor(){return this.clear(!0,!1,!1)}clearDepth(){return this.clear(!1,!0,!1)}clearStencil(){return this.clear(!1,!1,!0)}async clearAsync(e=!0,t=!0,r=!0){!1===this._initialized&&await this.init(),this.clear(e,t,r)}async clearColorAsync(){this.clearAsync(!0,!1,!1)}async clearDepthAsync(){this.clearAsync(!1,!0,!1)}async clearStencilAsync(){this.clearAsync(!1,!1,!0)}get currentToneMapping(){return this.isOutputTarget?this.toneMapping:p}get currentColorSpace(){return this.isOutputTarget?this.outputColorSpace:ue}get isOutputTarget(){return this._renderTarget===this._outputRenderTarget||null===this._renderTarget}dispose(){this.info.dispose(),this.backend.dispose(),this._animation.dispose(),this._objects.dispose(),this._pipelines.dispose(),this._nodes.dispose(),this._bindings.dispose(),this._renderLists.dispose(),this._renderContexts.dispose(),this._textures.dispose(),null!==this._frameBufferTarget&&this._frameBufferTarget.dispose(),Object.values(this.backend.timestampQueryPool).forEach((e=>{null!==e&&e.dispose()})),this.setRenderTarget(null),this.setAnimationLoop(null)}setRenderTarget(e,t=0,r=0){this._renderTarget=e,this._activeCubeFace=t,this._activeMipmapLevel=r}getRenderTarget(){return this._renderTarget}setOutputRenderTarget(e){this._outputRenderTarget=e}getOutputRenderTarget(){return this._outputRenderTarget}_resetXRState(){this.backend.setXRTarget(null),this.setOutputRenderTarget(null),this.setRenderTarget(null),this._frameBufferTarget.dispose(),this._frameBufferTarget=null}setRenderObjectFunction(e){this._renderObjectFunction=e}getRenderObjectFunction(){return this._renderObjectFunction}compute(e){if(!0===this._isDeviceLost)return;if(!1===this._initialized)return console.warn("THREE.Renderer: .compute() called before the backend is initialized. Try using .computeAsync() instead."),this.computeAsync(e);const t=this._nodes.nodeFrame,r=t.renderId;this.info.calls++,this.info.compute.calls++,this.info.compute.frameCalls++,t.renderId=this.info.calls;const s=this.backend,i=this._pipelines,n=this._bindings,a=this._nodes,o=Array.isArray(e)?e:[e];if(void 0===o[0]||!0!==o[0].isComputeNode)throw new Error("THREE.Renderer: .compute() expects a ComputeNode.");s.beginCompute(e);for(const t of o){if(!1===i.has(t)){const e=()=>{t.removeEventListener("dispose",e),i.delete(t),n.delete(t),a.delete(t)};t.addEventListener("dispose",e);const r=t.onInitFunction;null!==r&&r.call(t,{renderer:this})}a.updateForCompute(t),n.updateForCompute(t);const r=n.getForCompute(t),o=i.getForCompute(t,r);s.compute(e,t,r,o)}s.finishCompute(e),t.renderId=r}async computeAsync(e){!1===this._initialized&&await this.init(),this.compute(e)}async hasFeatureAsync(e){return!1===this._initialized&&await this.init(),this.backend.hasFeature(e)}async resolveTimestampsAsync(e="render"){return!1===this._initialized&&await this.init(),this.backend.resolveTimestampsAsync(e)}hasFeature(e){return!1===this._initialized?(console.warn("THREE.Renderer: .hasFeature() called before the backend is initialized. Try using .hasFeatureAsync() instead."),!1):this.backend.hasFeature(e)}hasInitialized(){return this._initialized}async initTextureAsync(e){!1===this._initialized&&await this.init(),this._textures.updateTexture(e)}initTexture(e){!1===this._initialized&&console.warn("THREE.Renderer: .initTexture() called before the backend is initialized. Try using .initTextureAsync() instead."),this._textures.updateTexture(e)}copyFramebufferToTexture(e,t=null){if(null!==t)if(t.isVector2)t=Cv.set(t.x,t.y,e.image.width,e.image.height).floor();else{if(!t.isVector4)return void console.error("THREE.Renderer.copyFramebufferToTexture: Invalid rectangle.");t=Cv.copy(t).floor()}else t=Cv.set(0,0,e.image.width,e.image.height);let r,s=this._currentRenderContext;null!==s?r=s.renderTarget:(r=this._renderTarget||this._getFrameBufferTarget(),null!==r&&(this._textures.updateRenderTarget(r),s=this._textures.get(r))),this._textures.updateTexture(e,{renderTarget:r}),this.backend.copyFramebufferToTexture(e,s,t)}copyTextureToTexture(e,t,r=null,s=null,i=0,n=0){this._textures.updateTexture(e),this._textures.updateTexture(t),this.backend.copyTextureToTexture(e,t,r,s,i,n)}async readRenderTargetPixelsAsync(e,t,r,s,i,n=0,a=0){return this.backend.copyTextureToBuffer(e.textures[n],t,r,s,i,a)}_projectObject(e,t,r,s,i){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)r=e.renderOrder,e.isClippingGroup&&e.enabled&&(i=i.getGroupContext(e));else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)s.pushLight(e);else if(e.isSprite){const n=t.isArrayCamera?Av:wv;if(!e.frustumCulled||n.intersectsSprite(e,t)){!0===this.sortObjects&&Cv.setFromMatrixPosition(e.matrixWorld).applyMatrix4(Rv);const{geometry:t,material:n}=e;n.visible&&s.push(e,t,n,r,Cv.z,null,i)}}else if(e.isLineLoop)console.error("THREE.Renderer: Objects of type THREE.LineLoop are not supported. Please use THREE.Line or THREE.LineSegments.");else if(e.isMesh||e.isLine||e.isPoints){const n=t.isArrayCamera?Av:wv;if(!e.frustumCulled||n.intersectsObject(e,t)){const{geometry:t,material:n}=e;if(!0===this.sortObjects&&(null===t.boundingSphere&&t.computeBoundingSphere(),Cv.copy(t.boundingSphere.center).applyMatrix4(e.matrixWorld).applyMatrix4(Rv)),Array.isArray(n)){const a=t.groups;for(let o=0,u=a.length;o0){for(const{material:e}of t)e.side=S;this._renderObjects(t,r,s,i,"backSide");for(const{material:e}of t)e.side=je;this._renderObjects(e,r,s,i);for(const{material:e}of t)e.side=Se}else this._renderObjects(e,r,s,i)}_renderObjects(e,t,r,s,i=null){for(let n=0,a=e.length;n0,e.isShadowPassMaterial&&(e.side=null===i.shadowSide?i.side:i.shadowSide,i.depthNode&&i.depthNode.isNode&&(c=e.depthNode,e.depthNode=i.depthNode),i.castShadowNode&&i.castShadowNode.isNode&&(d=e.colorNode,e.colorNode=i.castShadowNode),i.castShadowPositionNode&&i.castShadowPositionNode.isNode&&(l=e.positionNode,e.positionNode=i.castShadowPositionNode)),i=e}!0===i.transparent&&i.side===Se&&!1===i.forceSinglePass?(i.side=S,this._handleObjectFunction(e,i,t,r,a,n,o,"backSide"),i.side=je,this._handleObjectFunction(e,i,t,r,a,n,o,u),i.side=Se):this._handleObjectFunction(e,i,t,r,a,n,o,u),void 0!==l&&(t.overrideMaterial.positionNode=l),void 0!==c&&(t.overrideMaterial.depthNode=c),void 0!==d&&(t.overrideMaterial.colorNode=d),e.onAfterRender(this,t,r,s,i,n)}_renderObjectDirect(e,t,r,s,i,n,a,o){const u=this._objects.get(e,t,r,s,i,this._currentRenderContext,a,o);u.drawRange=e.geometry.drawRange,u.group=n;const l=this._nodes.needsRefresh(u);if(l&&(this._nodes.updateBefore(u),this._geometries.updateForRender(u),this._nodes.updateForRender(u),this._bindings.updateForRender(u)),this._pipelines.updateForRender(u),null!==this._currentRenderBundle){this.backend.get(this._currentRenderBundle).renderObjects.push(u),u.bundle=this._currentRenderBundle.bundleGroup}this.backend.draw(u,this.info),l&&this._nodes.updateAfter(u)}_createObjectPipeline(e,t,r,s,i,n,a,o){const u=this._objects.get(e,t,r,s,i,this._currentRenderContext,a,o);u.drawRange=e.geometry.drawRange,u.group=n,this._nodes.updateBefore(u),this._geometries.updateForRender(u),this._nodes.updateForRender(u),this._bindings.updateForRender(u),this._pipelines.getForRender(u,this._compilationPromises),this._nodes.updateAfter(u)}get compile(){return this.compileAsync}}class Pv{constructor(e=""){this.name=e,this.visibility=0}setVisibility(e){this.visibility|=e}clone(){return Object.assign(new this.constructor,this)}}class Lv extends Pv{constructor(e,t=null){super(e),this.isBuffer=!0,this.bytesPerElement=Float32Array.BYTES_PER_ELEMENT,this._buffer=t}get byteLength(){return(e=this._buffer.byteLength)+(af-e%af)%af;var e}get buffer(){return this._buffer}update(){return!0}}class Fv extends Lv{constructor(e,t=null){super(e,t),this.isUniformBuffer=!0}}let Bv=0;class Iv extends Fv{constructor(e,t){super("UniformBuffer_"+Bv++,e?e.value:null),this.nodeUniform=e,this.groupNode=t}get buffer(){return this.nodeUniform.value}}class Dv extends Fv{constructor(e){super(e),this.isUniformsGroup=!0,this._values=null,this.uniforms=[]}addUniform(e){return this.uniforms.push(e),this}removeUniform(e){const t=this.uniforms.indexOf(e);return-1!==t&&this.uniforms.splice(t,1),this}get values(){return null===this._values&&(this._values=Array.from(this.buffer)),this._values}get buffer(){let e=this._buffer;if(null===e){const t=this.byteLength;e=new Float32Array(new ArrayBuffer(t)),this._buffer=e}return e}get byteLength(){const e=this.bytesPerElement;let t=0;for(let r=0,s=this.uniforms.length;r0?s:"";t=`${e.name} {\n\t${r} ${i.name}[${n}];\n};\n`}else{t=`${this.getVectorType(i.type)} ${this.getPropertyName(i,e)};`,n=!0}const a=i.node.precision;if(null!==a&&(t=Wv[a]+" "+t),n){t="\t"+t;const e=i.groupNode.name;(s[e]||(s[e]=[])).push(t)}else t="uniform "+t,r.push(t)}let i="";for(const t in s){const r=s[t];i+=this._getGLSLUniformStruct(e+"_"+t,r.join("\n"))+"\n"}return i+=r.join("\n"),i}getTypeFromAttribute(e){let t=super.getTypeFromAttribute(e);if(/^[iu]/.test(t)&&e.gpuType!==_){let r=e;e.isInterleavedBufferAttribute&&(r=e.data);const s=r.array;!1==(s instanceof Uint32Array||s instanceof Int32Array)&&(t=t.slice(1))}return t}getAttributes(e){let t="";if("vertex"===e||"compute"===e){const e=this.getAttributesArray();let r=0;for(const s of e)t+=`layout( location = ${r++} ) in ${s.type} ${s.name};\n`}return t}getStructMembers(e){const t=[];for(const r of e.members)t.push(`\t${r.type} ${r.name};`);return t.join("\n")}getStructs(e){const t=[],r=this.structs[e],s=[];for(const e of r)if(e.output)for(const t of e.members)s.push(`layout( location = ${t.index} ) out ${t.type} ${t.name};`);else{let r="struct "+e.name+" {\n";r+=this.getStructMembers(e),r+="\n};\n",t.push(r)}return 0===s.length&&s.push("layout( location = 0 ) out vec4 fragColor;"),"\n"+s.join("\n")+"\n\n"+t.join("\n")}getVaryings(e){let t="";const r=this.varyings;if("vertex"===e||"compute"===e)for(const s of r){"compute"===e&&(s.needsInterpolation=!0);const r=this.getType(s.type);if(s.needsInterpolation)if(s.interpolationType){t+=`${qv[s.interpolationType]||s.interpolationType} ${Xv[s.interpolationSampling]||""} out ${r} ${s.name};\n`}else{t+=`${r.includes("int")||r.includes("uv")||r.includes("iv")?"flat ":""}out ${r} ${s.name};\n`}else t+=`${r} ${s.name};\n`}else if("fragment"===e)for(const e of r)if(e.needsInterpolation){const r=this.getType(e.type);if(e.interpolationType){t+=`${qv[e.interpolationType]||e.interpolationType} ${Xv[e.interpolationSampling]||""} in ${r} ${e.name};\n`}else{t+=`${r.includes("int")||r.includes("uv")||r.includes("iv")?"flat ":""}in ${r} ${e.name};\n`}}for(const r of this.builtins[e])t+=`${r};\n`;return t}getVertexIndex(){return"uint( gl_VertexID )"}getInstanceIndex(){return"uint( gl_InstanceID )"}getInvocationLocalIndex(){return`uint( gl_InstanceID ) % ${this.object.workgroupSize.reduce(((e,t)=>e*t),1)}u`}getDrawIndex(){return this.renderer.backend.extensions.has("WEBGL_multi_draw")?"uint( gl_DrawID )":null}getFrontFacing(){return"gl_FrontFacing"}getFragCoord(){return"gl_FragCoord.xy"}getFragDepth(){return"gl_FragDepth"}enableExtension(e,t,r=this.shaderStage){const s=this.extensions[r]||(this.extensions[r]=new Map);!1===s.has(e)&&s.set(e,{name:e,behavior:t})}getExtensions(e){const t=[];if("vertex"===e){const t=this.renderer.backend.extensions;this.object.isBatchedMesh&&t.has("WEBGL_multi_draw")&&this.enableExtension("GL_ANGLE_multi_draw","require",e)}const r=this.extensions[e];if(void 0!==r)for(const{name:e,behavior:s}of r.values())t.push(`#extension ${e} : ${s}`);return t.join("\n")}getClipDistance(){return"gl_ClipDistance"}isAvailable(e){let t=jv[e];if(void 0===t){let r;switch(t=!1,e){case"float32Filterable":r="OES_texture_float_linear";break;case"clipDistance":r="WEBGL_clip_cull_distance"}if(void 0!==r){const e=this.renderer.backend.extensions;e.has(r)&&(e.get(r),t=!0)}jv[e]=t}return t}isFlipY(){return!0}enableHardwareClipping(e){this.enableExtension("GL_ANGLE_clip_cull_distance","require"),this.builtins.vertex.push(`out float gl_ClipDistance[ ${e} ]`)}enableMultiview(){this.enableExtension("GL_OVR_multiview2","require","fragment"),this.enableExtension("GL_OVR_multiview2","require","vertex"),this.builtins.vertex.push("layout(num_views = 2) in")}registerTransform(e,t){this.transforms.push({varyingName:e,attributeNode:t})}getTransforms(){const e=this.transforms;let t="";for(let r=0;r0&&(r+="\n"),r+=`\t// flow -> ${n}\n\t`),r+=`${s.code}\n\t`,e===i&&"compute"!==t&&(r+="// result\n\t","vertex"===t?(r+="gl_Position = ",r+=`${s.result};`):"fragment"===t&&(e.outputNode.isOutputStructNode||(r+="fragColor = ",r+=`${s.result};`)))}const n=e[t];n.extensions=this.getExtensions(t),n.uniforms=this.getUniforms(t),n.attributes=this.getAttributes(t),n.varyings=this.getVaryings(t),n.vars=this.getVars(t),n.structs=this.getStructs(t),n.codes=this.getCodes(t),n.transforms=this.getTransforms(t),n.flow=r}null!==this.material?(this.vertexShader=this._getGLSLVertexCode(e.vertex),this.fragmentShader=this._getGLSLFragmentCode(e.fragment)):this.computeShader=this._getGLSLVertexCode(e.compute)}getUniformFromNode(e,t,r,s=null){const i=super.getUniformFromNode(e,t,r,s),n=this.getDataFromNode(e,r,this.globalCache);let a=n.uniformGPU;if(void 0===a){const s=e.groupNode,o=s.name,u=this.getBindGroupArray(o,r);if("texture"===t)a=new Gv(i.name,i.node,s),u.push(a);else if("cubeTexture"===t)a=new zv(i.name,i.node,s),u.push(a);else if("texture3D"===t)a=new Hv(i.name,i.node,s),u.push(a);else if("buffer"===t){e.name=`NodeBuffer_${e.id}`,i.name=`buffer${e.id}`;const t=new Iv(e,s);t.name=e.name,u.push(t),a=t}else{const e=this.uniformGroups[r]||(this.uniformGroups[r]={});let n=e[o];void 0===n&&(n=new Uv(r+"_"+o,s),e[o]=n,u.push(n)),a=this.getNodeUniform(i,t),n.addUniform(a)}n.uniformGPU=a}return i}}let Qv=null,Zv=null;class Jv{constructor(e={}){this.parameters=Object.assign({},e),this.data=new WeakMap,this.renderer=null,this.domElement=null,this.timestampQueryPool={render:null,compute:null},this.trackTimestamp=!0===e.trackTimestamp}async init(e){this.renderer=e}get coordinateSystem(){}beginRender(){}finishRender(){}beginCompute(){}finishCompute(){}draw(){}compute(){}createProgram(){}destroyProgram(){}createBindings(){}updateBindings(){}updateBinding(){}createRenderPipeline(){}createComputePipeline(){}needsRenderUpdate(){}getRenderCacheKey(){}createNodeBuilder(){}createSampler(){}destroySampler(){}createDefaultTexture(){}createTexture(){}updateTexture(){}generateMipmaps(){}destroyTexture(){}async copyTextureToBuffer(){}copyTextureToTexture(){}copyFramebufferToTexture(){}createAttribute(){}createIndexAttribute(){}createStorageAttribute(){}updateAttribute(){}destroyAttribute(){}getContext(){}updateSize(){}updateViewport(){}isOccluded(){}async resolveTimestampsAsync(e="render"){if(!this.trackTimestamp)return void pt("WebGPURenderer: Timestamp tracking is disabled.");const t=this.timestampQueryPool[e];if(!t)return void pt(`WebGPURenderer: No timestamp query pool for type '${e}' found.`);const r=await t.resolveQueriesAsync();return this.renderer.info[e].timestamp=r,r}async waitForGPU(){}async getArrayBufferAsync(){}async hasFeatureAsync(){}hasFeature(){}getMaxAnisotropy(){}getDrawingBufferSize(){return Qv=Qv||new t,this.renderer.getDrawingBufferSize(Qv)}setScissorTest(){}getClearColor(){const e=this.renderer;return Zv=Zv||new Bf,e.getClearColor(Zv),Zv.getRGB(Zv),Zv}getDomElement(){let e=this.domElement;return null===e&&(e=void 0!==this.parameters.canvas?this.parameters.canvas:gt(),"setAttribute"in e&&e.setAttribute("data-engine",`three.js r${He} webgpu`),this.domElement=e),e}set(e,t){this.data.set(e,t)}get(e){let t=this.data.get(e);return void 0===t&&(t={},this.data.set(e,t)),t}has(e){return this.data.has(e)}delete(e){this.data.delete(e)}dispose(){}}let eN,tN,rN=0;class sN{constructor(e,t){this.buffers=[e.bufferGPU,t],this.type=e.type,this.bufferType=e.bufferType,this.pbo=e.pbo,this.byteLength=e.byteLength,this.bytesPerElement=e.BYTES_PER_ELEMENT,this.version=e.version,this.isInteger=e.isInteger,this.activeBufferIndex=0,this.baseId=e.id}get id(){return`${this.baseId}|${this.activeBufferIndex}`}get bufferGPU(){return this.buffers[this.activeBufferIndex]}get transformBuffer(){return this.buffers[1^this.activeBufferIndex]}switchBuffers(){this.activeBufferIndex^=1}}class iN{constructor(e){this.backend=e}createAttribute(e,t){const r=this.backend,{gl:s}=r,i=e.array,n=e.usage||s.STATIC_DRAW,a=e.isInterleavedBufferAttribute?e.data:e,o=r.get(a);let u,l=o.bufferGPU;if(void 0===l&&(l=this._createBuffer(s,t,i,n),o.bufferGPU=l,o.bufferType=t,o.version=a.version),i instanceof Float32Array)u=s.FLOAT;else if(i instanceof Uint16Array)u=e.isFloat16BufferAttribute?s.HALF_FLOAT:s.UNSIGNED_SHORT;else if(i instanceof Int16Array)u=s.SHORT;else if(i instanceof Uint32Array)u=s.UNSIGNED_INT;else if(i instanceof Int32Array)u=s.INT;else if(i instanceof Int8Array)u=s.BYTE;else if(i instanceof Uint8Array)u=s.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLBackend: Unsupported buffer data format: "+i);u=s.UNSIGNED_BYTE}let d={bufferGPU:l,bufferType:t,type:u,byteLength:i.byteLength,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version,pbo:e.pbo,isInteger:u===s.INT||u===s.UNSIGNED_INT||e.gpuType===_,id:rN++};if(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute){const e=this._createBuffer(s,t,i,n);d=new sN(d,e)}r.set(e,d)}updateAttribute(e){const t=this.backend,{gl:r}=t,s=e.array,i=e.isInterleavedBufferAttribute?e.data:e,n=t.get(i),a=n.bufferType,o=e.isInterleavedBufferAttribute?e.data.updateRanges:e.updateRanges;if(r.bindBuffer(a,n.bufferGPU),0===o.length)r.bufferSubData(a,0,s);else{for(let e=0,t=o.length;e1?this.enable(s.SAMPLE_ALPHA_TO_COVERAGE):this.disable(s.SAMPLE_ALPHA_TO_COVERAGE),r>0&&this.currentClippingPlanes!==r){const e=12288;for(let t=0;t<8;t++)t{!function i(){const n=e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0);if(n===e.WAIT_FAILED)return e.deleteSync(t),void s();n!==e.TIMEOUT_EXPIRED?(e.deleteSync(t),r()):requestAnimationFrame(i)}()}))}}let oN,uN,lN,dN=!1;class cN{constructor(e){this.backend=e,this.gl=e.gl,this.extensions=e.extensions,this.defaultTextures={},!1===dN&&(this._init(),dN=!0)}_init(){const e=this.gl;oN={[Nr]:e.REPEAT,[vr]:e.CLAMP_TO_EDGE,[_r]:e.MIRRORED_REPEAT},uN={[v]:e.NEAREST,[Sr]:e.NEAREST_MIPMAP_NEAREST,[Ge]:e.NEAREST_MIPMAP_LINEAR,[K]:e.LINEAR,[ke]:e.LINEAR_MIPMAP_NEAREST,[D]:e.LINEAR_MIPMAP_LINEAR},lN={[Pr]:e.NEVER,[Mr]:e.ALWAYS,[De]:e.LESS,[Cr]:e.LEQUAL,[Rr]:e.EQUAL,[Ar]:e.GEQUAL,[wr]:e.GREATER,[Er]:e.NOTEQUAL}}getGLTextureType(e){const{gl:t}=this;let r;return r=!0===e.isCubeTexture?t.TEXTURE_CUBE_MAP:!0===e.isArrayTexture||!0===e.isDataArrayTexture||!0===e.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:!0===e.isData3DTexture?t.TEXTURE_3D:t.TEXTURE_2D,r}getInternalFormat(e,t,r,s,i=!1){const{gl:n,extensions:a}=this;if(null!==e){if(void 0!==n[e])return n[e];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+e+"'")}let o=t;if(t===n.RED&&(r===n.FLOAT&&(o=n.R32F),r===n.HALF_FLOAT&&(o=n.R16F),r===n.UNSIGNED_BYTE&&(o=n.R8),r===n.UNSIGNED_SHORT&&(o=n.R16),r===n.UNSIGNED_INT&&(o=n.R32UI),r===n.BYTE&&(o=n.R8I),r===n.SHORT&&(o=n.R16I),r===n.INT&&(o=n.R32I)),t===n.RED_INTEGER&&(r===n.UNSIGNED_BYTE&&(o=n.R8UI),r===n.UNSIGNED_SHORT&&(o=n.R16UI),r===n.UNSIGNED_INT&&(o=n.R32UI),r===n.BYTE&&(o=n.R8I),r===n.SHORT&&(o=n.R16I),r===n.INT&&(o=n.R32I)),t===n.RG&&(r===n.FLOAT&&(o=n.RG32F),r===n.HALF_FLOAT&&(o=n.RG16F),r===n.UNSIGNED_BYTE&&(o=n.RG8),r===n.UNSIGNED_SHORT&&(o=n.RG16),r===n.UNSIGNED_INT&&(o=n.RG32UI),r===n.BYTE&&(o=n.RG8I),r===n.SHORT&&(o=n.RG16I),r===n.INT&&(o=n.RG32I)),t===n.RG_INTEGER&&(r===n.UNSIGNED_BYTE&&(o=n.RG8UI),r===n.UNSIGNED_SHORT&&(o=n.RG16UI),r===n.UNSIGNED_INT&&(o=n.RG32UI),r===n.BYTE&&(o=n.RG8I),r===n.SHORT&&(o=n.RG16I),r===n.INT&&(o=n.RG32I)),t===n.RGB){const e=i?Lr:c.getTransfer(s);r===n.FLOAT&&(o=n.RGB32F),r===n.HALF_FLOAT&&(o=n.RGB16F),r===n.UNSIGNED_BYTE&&(o=n.RGB8),r===n.UNSIGNED_SHORT&&(o=n.RGB16),r===n.UNSIGNED_INT&&(o=n.RGB32UI),r===n.BYTE&&(o=n.RGB8I),r===n.SHORT&&(o=n.RGB16I),r===n.INT&&(o=n.RGB32I),r===n.UNSIGNED_BYTE&&(o=e===h?n.SRGB8:n.RGB8),r===n.UNSIGNED_SHORT_5_6_5&&(o=n.RGB565),r===n.UNSIGNED_SHORT_5_5_5_1&&(o=n.RGB5_A1),r===n.UNSIGNED_SHORT_4_4_4_4&&(o=n.RGB4),r===n.UNSIGNED_INT_5_9_9_9_REV&&(o=n.RGB9_E5)}if(t===n.RGB_INTEGER&&(r===n.UNSIGNED_BYTE&&(o=n.RGB8UI),r===n.UNSIGNED_SHORT&&(o=n.RGB16UI),r===n.UNSIGNED_INT&&(o=n.RGB32UI),r===n.BYTE&&(o=n.RGB8I),r===n.SHORT&&(o=n.RGB16I),r===n.INT&&(o=n.RGB32I)),t===n.RGBA){const e=i?Lr:c.getTransfer(s);r===n.FLOAT&&(o=n.RGBA32F),r===n.HALF_FLOAT&&(o=n.RGBA16F),r===n.UNSIGNED_BYTE&&(o=n.RGBA8),r===n.UNSIGNED_SHORT&&(o=n.RGBA16),r===n.UNSIGNED_INT&&(o=n.RGBA32UI),r===n.BYTE&&(o=n.RGBA8I),r===n.SHORT&&(o=n.RGBA16I),r===n.INT&&(o=n.RGBA32I),r===n.UNSIGNED_BYTE&&(o=e===h?n.SRGB8_ALPHA8:n.RGBA8),r===n.UNSIGNED_SHORT_4_4_4_4&&(o=n.RGBA4),r===n.UNSIGNED_SHORT_5_5_5_1&&(o=n.RGB5_A1)}return t===n.RGBA_INTEGER&&(r===n.UNSIGNED_BYTE&&(o=n.RGBA8UI),r===n.UNSIGNED_SHORT&&(o=n.RGBA16UI),r===n.UNSIGNED_INT&&(o=n.RGBA32UI),r===n.BYTE&&(o=n.RGBA8I),r===n.SHORT&&(o=n.RGBA16I),r===n.INT&&(o=n.RGBA32I)),t===n.DEPTH_COMPONENT&&(r===n.UNSIGNED_SHORT&&(o=n.DEPTH_COMPONENT16),r===n.UNSIGNED_INT&&(o=n.DEPTH_COMPONENT24),r===n.FLOAT&&(o=n.DEPTH_COMPONENT32F)),t===n.DEPTH_STENCIL&&r===n.UNSIGNED_INT_24_8&&(o=n.DEPTH24_STENCIL8),o!==n.R16F&&o!==n.R32F&&o!==n.RG16F&&o!==n.RG32F&&o!==n.RGBA16F&&o!==n.RGBA32F||a.get("EXT_color_buffer_float"),o}setTextureParameters(e,t){const{gl:r,extensions:s,backend:i}=this,n=c.getPrimaries(c.workingColorSpace),a=t.colorSpace===b?null:c.getPrimaries(t.colorSpace),o=t.colorSpace===b||n===a?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,t.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,t.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,o),r.texParameteri(e,r.TEXTURE_WRAP_S,oN[t.wrapS]),r.texParameteri(e,r.TEXTURE_WRAP_T,oN[t.wrapT]),e!==r.TEXTURE_3D&&e!==r.TEXTURE_2D_ARRAY||t.isArrayTexture||r.texParameteri(e,r.TEXTURE_WRAP_R,oN[t.wrapR]),r.texParameteri(e,r.TEXTURE_MAG_FILTER,uN[t.magFilter]);const u=void 0!==t.mipmaps&&t.mipmaps.length>0,l=t.minFilter===K&&u?D:t.minFilter;if(r.texParameteri(e,r.TEXTURE_MIN_FILTER,uN[l]),t.compareFunction&&(r.texParameteri(e,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(e,r.TEXTURE_COMPARE_FUNC,lN[t.compareFunction])),!0===s.has("EXT_texture_filter_anisotropic")){if(t.magFilter===v)return;if(t.minFilter!==Ge&&t.minFilter!==D)return;if(t.type===B&&!1===s.has("OES_texture_float_linear"))return;if(t.anisotropy>1){const n=s.get("EXT_texture_filter_anisotropic");r.texParameterf(e,n.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,i.getMaxAnisotropy()))}}}createDefaultTexture(e){const{gl:t,backend:r,defaultTextures:s}=this,i=this.getGLTextureType(e);let n=s[i];void 0===n&&(n=t.createTexture(),r.state.bindTexture(i,n),t.texParameteri(i,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(i,t.TEXTURE_MAG_FILTER,t.NEAREST),s[i]=n),r.set(e,{textureGPU:n,glTextureType:i,isDefault:!0})}createTexture(e,t){const{gl:r,backend:s}=this,{levels:i,width:n,height:a,depth:o}=t,u=s.utils.convert(e.format,e.colorSpace),l=s.utils.convert(e.type),d=this.getInternalFormat(e.internalFormat,u,l,e.colorSpace,e.isVideoTexture),c=r.createTexture(),h=this.getGLTextureType(e);s.state.bindTexture(h,c),this.setTextureParameters(h,e),e.isArrayTexture||e.isDataArrayTexture||e.isCompressedArrayTexture?r.texStorage3D(r.TEXTURE_2D_ARRAY,i,d,n,a,o):e.isData3DTexture?r.texStorage3D(r.TEXTURE_3D,i,d,n,a,o):e.isVideoTexture||r.texStorage2D(h,i,d,n,a),s.set(e,{textureGPU:c,glTextureType:h,glFormat:u,glType:l,glInternalFormat:d})}copyBufferToTexture(e,t){const{gl:r,backend:s}=this,{textureGPU:i,glTextureType:n,glFormat:a,glType:o}=s.get(t),{width:u,height:l}=t.source.data;r.bindBuffer(r.PIXEL_UNPACK_BUFFER,e),s.state.bindTexture(n,i),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.texSubImage2D(n,0,0,0,u,l,a,o,0),r.bindBuffer(r.PIXEL_UNPACK_BUFFER,null),s.state.unbindTexture()}updateTexture(e,t){const{gl:r}=this,{width:s,height:i}=t,{textureGPU:n,glTextureType:a,glFormat:o,glType:u,glInternalFormat:l}=this.backend.get(e);if(!e.isRenderTargetTexture&&void 0!==n)if(this.backend.state.bindTexture(a,n),this.setTextureParameters(a,e),e.isCompressedTexture){const s=e.mipmaps,i=t.image;for(let t=0;t0,c=t.renderTarget?t.renderTarget.height:this.backend.getDrawingBufferSize().y;if(d){const r=0!==a||0!==o;let d,h;if(!0===e.isDepthTexture?(d=s.DEPTH_BUFFER_BIT,h=s.DEPTH_ATTACHMENT,t.stencil&&(d|=s.STENCIL_BUFFER_BIT)):(d=s.COLOR_BUFFER_BIT,h=s.COLOR_ATTACHMENT0),r){const e=this.backend.get(t.renderTarget),r=e.framebuffers[t.getCacheKey()],h=e.msaaFrameBuffer;i.bindFramebuffer(s.DRAW_FRAMEBUFFER,r),i.bindFramebuffer(s.READ_FRAMEBUFFER,h);const p=c-o-l;s.blitFramebuffer(a,p,a+u,p+l,a,p,a+u,p+l,d,s.NEAREST),i.bindFramebuffer(s.READ_FRAMEBUFFER,r),i.bindTexture(s.TEXTURE_2D,n),s.copyTexSubImage2D(s.TEXTURE_2D,0,0,0,a,p,u,l),i.unbindTexture()}else{const e=s.createFramebuffer();i.bindFramebuffer(s.DRAW_FRAMEBUFFER,e),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,h,s.TEXTURE_2D,n,0),s.blitFramebuffer(0,0,u,l,0,0,u,l,d,s.NEAREST),s.deleteFramebuffer(e)}}else i.bindTexture(s.TEXTURE_2D,n),s.copyTexSubImage2D(s.TEXTURE_2D,0,0,0,a,c-l-o,u,l),i.unbindTexture();e.generateMipmaps&&this.generateMipmaps(e),this.backend._setFramebuffer(t)}setupRenderBufferStorage(e,t,r,s=!1){const{gl:i}=this,n=t.renderTarget,{depthTexture:a,depthBuffer:o,stencilBuffer:u,width:l,height:d}=n;if(i.bindRenderbuffer(i.RENDERBUFFER,e),o&&!u){let t=i.DEPTH_COMPONENT24;if(!0===s){this.extensions.get("WEBGL_multisampled_render_to_texture").renderbufferStorageMultisampleEXT(i.RENDERBUFFER,n.samples,t,l,d)}else r>0?(a&&a.isDepthTexture&&a.type===i.FLOAT&&(t=i.DEPTH_COMPONENT32F),i.renderbufferStorageMultisample(i.RENDERBUFFER,r,t,l,d)):i.renderbufferStorage(i.RENDERBUFFER,t,l,d);i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.RENDERBUFFER,e)}else o&&u&&(r>0?i.renderbufferStorageMultisample(i.RENDERBUFFER,r,i.DEPTH24_STENCIL8,l,d):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,l,d),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,e));i.bindRenderbuffer(i.RENDERBUFFER,null)}async copyTextureToBuffer(e,t,r,s,i,n){const{backend:a,gl:o}=this,{textureGPU:u,glFormat:l,glType:d}=this.backend.get(e),c=o.createFramebuffer();o.bindFramebuffer(o.READ_FRAMEBUFFER,c);const h=e.isCubeTexture?o.TEXTURE_CUBE_MAP_POSITIVE_X+n:o.TEXTURE_2D;o.framebufferTexture2D(o.READ_FRAMEBUFFER,o.COLOR_ATTACHMENT0,h,u,0);const p=this._getTypedArrayType(d),g=s*i*this._getBytesPerTexel(d,l),m=o.createBuffer();o.bindBuffer(o.PIXEL_PACK_BUFFER,m),o.bufferData(o.PIXEL_PACK_BUFFER,g,o.STREAM_READ),o.readPixels(t,r,s,i,l,d,0),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),await a.utils._clientWaitAsync();const f=new p(g/p.BYTES_PER_ELEMENT);return o.bindBuffer(o.PIXEL_PACK_BUFFER,m),o.getBufferSubData(o.PIXEL_PACK_BUFFER,0,f),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),o.deleteFramebuffer(c),f}_getTypedArrayType(e){const{gl:t}=this;if(e===t.UNSIGNED_BYTE)return Uint8Array;if(e===t.UNSIGNED_SHORT_4_4_4_4)return Uint16Array;if(e===t.UNSIGNED_SHORT_5_5_5_1)return Uint16Array;if(e===t.UNSIGNED_SHORT_5_6_5)return Uint16Array;if(e===t.UNSIGNED_SHORT)return Uint16Array;if(e===t.UNSIGNED_INT)return Uint32Array;if(e===t.HALF_FLOAT)return Uint16Array;if(e===t.FLOAT)return Float32Array;throw new Error(`Unsupported WebGL type: ${e}`)}_getBytesPerTexel(e,t){const{gl:r}=this;let s=0;return e===r.UNSIGNED_BYTE&&(s=1),e!==r.UNSIGNED_SHORT_4_4_4_4&&e!==r.UNSIGNED_SHORT_5_5_5_1&&e!==r.UNSIGNED_SHORT_5_6_5&&e!==r.UNSIGNED_SHORT&&e!==r.HALF_FLOAT||(s=2),e!==r.UNSIGNED_INT&&e!==r.FLOAT||(s=4),t===r.RGBA?4*s:t===r.RGB?3*s:t===r.ALPHA?s:void 0}}function hN(e){return e.isDataTexture?e.image.data:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?e:e.data}class pN{constructor(e){this.backend=e,this.gl=this.backend.gl,this.availableExtensions=this.gl.getSupportedExtensions(),this.extensions={}}get(e){let t=this.extensions[e];return void 0===t&&(t=this.gl.getExtension(e),this.extensions[e]=t),t}has(e){return this.availableExtensions.includes(e)}}class gN{constructor(e){this.backend=e,this.maxAnisotropy=null}getMaxAnisotropy(){if(null!==this.maxAnisotropy)return this.maxAnisotropy;const e=this.backend.gl,t=this.backend.extensions;if(!0===t.has("EXT_texture_filter_anisotropic")){const r=t.get("EXT_texture_filter_anisotropic");this.maxAnisotropy=e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else this.maxAnisotropy=0;return this.maxAnisotropy}}const mN={WEBGL_multi_draw:"WEBGL_multi_draw",WEBGL_compressed_texture_astc:"texture-compression-astc",WEBGL_compressed_texture_etc:"texture-compression-etc2",WEBGL_compressed_texture_etc1:"texture-compression-etc1",WEBGL_compressed_texture_pvrtc:"texture-compression-pvrtc",WEBKIT_WEBGL_compressed_texture_pvrtc:"texture-compression-pvrtc",WEBGL_compressed_texture_s3tc:"texture-compression-bc",EXT_texture_compression_bptc:"texture-compression-bptc",EXT_disjoint_timer_query_webgl2:"timestamp-query",OVR_multiview2:"OVR_multiview2"};class fN{constructor(e){this.gl=e.gl,this.extensions=e.extensions,this.info=e.renderer.info,this.mode=null,this.index=0,this.type=null,this.object=null}render(e,t){const{gl:r,mode:s,object:i,type:n,info:a,index:o}=this;0!==o?r.drawElements(s,t,n,e):r.drawArrays(s,e,t),a.update(i,t,1)}renderInstances(e,t,r){const{gl:s,mode:i,type:n,index:a,object:o,info:u}=this;0!==r&&(0!==a?s.drawElementsInstanced(i,t,n,e,r):s.drawArraysInstanced(i,e,t,r),u.update(o,t,r))}renderMultiDraw(e,t,r){const{extensions:s,mode:i,object:n,info:a}=this;if(0===r)return;const o=s.get("WEBGL_multi_draw");if(null===o)for(let s=0;sthis.maxQueries)return pt(`WebGPUTimestampQueryPool [${this.type}]: Maximum number of queries exceeded, when using trackTimestamp it is necessary to resolves the queries via renderer.resolveTimestampsAsync( THREE.TimestampQuery.${this.type.toUpperCase()} ).`),null;const t=this.currentQueryIndex;return this.currentQueryIndex+=2,this.queryStates.set(t,"inactive"),this.queryOffsets.set(e.id,t),t}beginQuery(e){if(!this.trackTimestamp||this.isDisposed)return;const t=this.queryOffsets.get(e.id);if(null==t)return;if(null!==this.activeQuery)return;const r=this.queries[t];if(r)try{"inactive"===this.queryStates.get(t)&&(this.gl.beginQuery(this.ext.TIME_ELAPSED_EXT,r),this.activeQuery=t,this.queryStates.set(t,"started"))}catch(e){console.error("Error in beginQuery:",e),this.activeQuery=null,this.queryStates.set(t,"inactive")}}endQuery(e){if(!this.trackTimestamp||this.isDisposed)return;const t=this.queryOffsets.get(e.id);if(null!=t&&this.activeQuery===t)try{this.gl.endQuery(this.ext.TIME_ELAPSED_EXT),this.queryStates.set(t,"ended"),this.activeQuery=null}catch(e){console.error("Error in endQuery:",e),this.queryStates.set(t,"inactive"),this.activeQuery=null}}async resolveQueriesAsync(){if(!this.trackTimestamp||this.pendingResolve)return this.lastValue;this.pendingResolve=!0;try{const e=[];for(const[t,r]of this.queryStates)if("ended"===r){const r=this.queries[t];e.push(this.resolveQuery(r))}if(0===e.length)return this.lastValue;const t=(await Promise.all(e)).reduce(((e,t)=>e+t),0);return this.lastValue=t,this.currentQueryIndex=0,this.queryOffsets.clear(),this.queryStates.clear(),this.activeQuery=null,t}catch(e){return console.error("Error resolving queries:",e),this.lastValue}finally{this.pendingResolve=!1}}async resolveQuery(e){return new Promise((t=>{if(this.isDisposed)return void t(this.lastValue);let r,s=!1;const i=e=>{s||(s=!0,r&&(clearTimeout(r),r=null),t(e))},n=()=>{if(this.isDisposed)i(this.lastValue);else try{if(this.gl.getParameter(this.ext.GPU_DISJOINT_EXT))return void i(this.lastValue);if(!this.gl.getQueryParameter(e,this.gl.QUERY_RESULT_AVAILABLE))return void(r=setTimeout(n,1));const s=this.gl.getQueryParameter(e,this.gl.QUERY_RESULT);t(Number(s)/1e6)}catch(e){console.error("Error checking query:",e),t(this.lastValue)}};n()}))}dispose(){if(!this.isDisposed&&(this.isDisposed=!0,this.trackTimestamp)){for(const e of this.queries)this.gl.deleteQuery(e);this.queries=[],this.queryStates.clear(),this.queryOffsets.clear(),this.lastValue=0,this.activeQuery=null}}}const xN=new t;class TN extends Jv{constructor(e={}){super(e),this.isWebGLBackend=!0,this.attributeUtils=null,this.extensions=null,this.capabilities=null,this.textureUtils=null,this.bufferRenderer=null,this.gl=null,this.state=null,this.utils=null,this.vaoCache={},this.transformFeedbackCache={},this.discard=!1,this.disjoint=null,this.parallel=null,this._currentContext=null,this._knownBindings=new WeakSet,this._supportsInvalidateFramebuffer="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),this._xrFramebuffer=null}init(e){super.init(e);const t=this.parameters,r={antialias:e.samples>0,alpha:!0,depth:e.depth,stencil:e.stencil},s=void 0!==t.context?t.context:e.domElement.getContext("webgl2",r);function i(t){t.preventDefault();const r={api:"WebGL",message:t.statusMessage||"Unknown reason",reason:null,originalEvent:t};e.onDeviceLost(r)}this._onContextLost=i,e.domElement.addEventListener("webglcontextlost",i,!1),this.gl=s,this.extensions=new pN(this),this.capabilities=new gN(this),this.attributeUtils=new iN(this),this.textureUtils=new cN(this),this.bufferRenderer=new fN(this),this.state=new nN(this),this.utils=new aN(this),this.extensions.get("EXT_color_buffer_float"),this.extensions.get("WEBGL_clip_cull_distance"),this.extensions.get("OES_texture_float_linear"),this.extensions.get("EXT_color_buffer_half_float"),this.extensions.get("WEBGL_multisampled_render_to_texture"),this.extensions.get("WEBGL_render_shared_exponent"),this.extensions.get("WEBGL_multi_draw"),this.extensions.get("OVR_multiview2"),this.disjoint=this.extensions.get("EXT_disjoint_timer_query_webgl2"),this.parallel=this.extensions.get("KHR_parallel_shader_compile")}get coordinateSystem(){return l}async getArrayBufferAsync(e){return await this.attributeUtils.getArrayBufferAsync(e)}async waitForGPU(){await this.utils._clientWaitAsync()}async makeXRCompatible(){!0!==this.gl.getContextAttributes().xrCompatible&&await this.gl.makeXRCompatible()}setXRTarget(e){this._xrFramebuffer=e}setXRRenderTargetTextures(e,t,r=null){const s=this.gl;if(this.set(e.texture,{textureGPU:t,glInternalFormat:s.RGBA8}),null!==r){const t=e.stencilBuffer?s.DEPTH24_STENCIL8:s.DEPTH_COMPONENT24;this.set(e.depthTexture,{textureGPU:r,glInternalFormat:t}),!0===this.extensions.has("WEBGL_multisampled_render_to_texture")&&!0===e._autoAllocateDepthBuffer&&!1===e.multiview&&console.warn("THREE.WebGLBackend: Render-to-texture extension was disabled because an external texture was provided"),e._autoAllocateDepthBuffer=!1}}initTimestampQuery(e){if(!this.disjoint||!this.trackTimestamp)return;const t=e.isComputeNode?"compute":"render";this.timestampQueryPool[t]||(this.timestampQueryPool[t]=new bN(this.gl,t,2048));const r=this.timestampQueryPool[t];null!==r.allocateQueriesForContext(e)&&r.beginQuery(e)}prepareTimestampBuffer(e){if(!this.disjoint||!this.trackTimestamp)return;const t=e.isComputeNode?"compute":"render";this.timestampQueryPool[t].endQuery(e)}getContext(){return this.gl}beginRender(e){const{state:t}=this,r=this.get(e);if(e.viewport)this.updateViewport(e);else{const{width:e,height:r}=this.getDrawingBufferSize(xN);t.viewport(0,0,e,r)}if(e.scissor){const{x:r,y:s,width:i,height:n}=e.scissorValue;t.scissor(r,e.height-n-s,i,n)}this.initTimestampQuery(e),r.previousContext=this._currentContext,this._currentContext=e,this._setFramebuffer(e),this.clear(e.clearColor,e.clearDepth,e.clearStencil,e,!1);const s=e.occlusionQueryCount;s>0&&(r.currentOcclusionQueries=r.occlusionQueries,r.currentOcclusionQueryObjects=r.occlusionQueryObjects,r.lastOcclusionObject=null,r.occlusionQueries=new Array(s),r.occlusionQueryObjects=new Array(s),r.occlusionQueryIndex=0)}finishRender(e){const{gl:t,state:r}=this,s=this.get(e),i=s.previousContext;r.resetVertexState();const n=e.occlusionQueryCount;n>0&&(n>s.occlusionQueryIndex&&t.endQuery(t.ANY_SAMPLES_PASSED),this.resolveOccludedAsync(e));const a=e.textures;if(null!==a)for(let e=0;e0&&!1===this._useMultisampledExtension(o)){const i=s.framebuffers[e.getCacheKey()];let n=t.COLOR_BUFFER_BIT;o.resolveDepthBuffer&&(o.depthBuffer&&(n|=t.DEPTH_BUFFER_BIT),o.stencilBuffer&&o.resolveStencilBuffer&&(n|=t.STENCIL_BUFFER_BIT));const a=s.msaaFrameBuffer,u=s.msaaRenderbuffers,l=e.textures,d=l.length>1;if(r.bindFramebuffer(t.READ_FRAMEBUFFER,a),r.bindFramebuffer(t.DRAW_FRAMEBUFFER,i),d)for(let e=0;e{let a=0;for(let t=0;t{t.isBatchedMesh?null!==t._multiDrawInstances?(pt("THREE.WebGLBackend: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),b.renderMultiDrawInstances(t._multiDrawStarts,t._multiDrawCounts,t._multiDrawCount,t._multiDrawInstances)):this.hasFeature("WEBGL_multi_draw")?b.renderMultiDraw(t._multiDrawStarts,t._multiDrawCounts,t._multiDrawCount):pt("THREE.WebGLRenderer: WEBGL_multi_draw not supported."):T>1?b.renderInstances(_,x,T):b.render(_,x)};if(!0===e.camera.isArrayCamera&&e.camera.cameras.length>0&&!1===e.camera.isMultiViewCamera){const r=this.get(e.camera),s=e.camera.cameras,i=e.getBindingGroup("cameraIndex").bindings[0];if(void 0===r.indexesGPU||r.indexesGPU.length!==s.length){const e=new Uint32Array([0,0,0,0]),t=[];for(let r=0,i=s.length;r{const i=this.parallel,n=()=>{r.getProgramParameter(a,i.COMPLETION_STATUS_KHR)?(this._completeCompile(e,s),t()):requestAnimationFrame(n)};n()}));t.push(i)}else this._completeCompile(e,s)}_handleSource(e,t){const r=e.split("\n"),s=[],i=Math.max(t-6,0),n=Math.min(t+6,r.length);for(let e=i;e":" "} ${i}: ${r[e]}`)}return s.join("\n")}_getShaderErrors(e,t,r){const s=e.getShaderParameter(t,e.COMPILE_STATUS),i=e.getShaderInfoLog(t).trim();if(s&&""===i)return"";const n=/ERROR: 0:(\d+)/.exec(i);if(n){const s=parseInt(n[1]);return r.toUpperCase()+"\n\n"+i+"\n\n"+this._handleSource(e.getShaderSource(t),s)}return i}_logProgramError(e,t,r){if(this.renderer.debug.checkShaderErrors){const s=this.gl,i=s.getProgramInfoLog(e).trim();if(!1===s.getProgramParameter(e,s.LINK_STATUS))if("function"==typeof this.renderer.debug.onShaderError)this.renderer.debug.onShaderError(s,e,r,t);else{const n=this._getShaderErrors(s,r,"vertex"),a=this._getShaderErrors(s,t,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(e,s.VALIDATE_STATUS)+"\n\nProgram Info Log: "+i+"\n"+n+"\n"+a)}else""!==i&&console.warn("THREE.WebGLProgram: Program Info Log:",i)}}_completeCompile(e,t){const{state:r,gl:s}=this,i=this.get(t),{programGPU:n,fragmentShader:a,vertexShader:o}=i;!1===s.getProgramParameter(n,s.LINK_STATUS)&&this._logProgramError(n,a,o),r.useProgram(n);const u=e.getBindings();this._setupBindings(u,n),this.set(t,{programGPU:n})}createComputePipeline(e,t){const{state:r,gl:s}=this,i={stage:"fragment",code:"#version 300 es\nprecision highp float;\nvoid main() {}"};this.createProgram(i);const{computeProgram:n}=e,a=s.createProgram(),o=this.get(i).shaderGPU,u=this.get(n).shaderGPU,l=n.transforms,d=[],c=[];for(let e=0;emN[t]===e)),r=this.extensions;for(let e=0;e1,h=!0===i.isXRRenderTarget,p=!0===h&&!0===i._hasExternalTextures;let g=n.msaaFrameBuffer,m=n.depthRenderbuffer;const f=this.extensions.get("WEBGL_multisampled_render_to_texture"),y=this.extensions.get("OVR_multiview2"),b=this._useMultisampledExtension(i),x=Af(e);let T;if(l?(n.cubeFramebuffers||(n.cubeFramebuffers={}),T=n.cubeFramebuffers[x]):h&&!1===p?T=this._xrFramebuffer:(n.framebuffers||(n.framebuffers={}),T=n.framebuffers[x]),void 0===T){T=t.createFramebuffer(),r.bindFramebuffer(t.FRAMEBUFFER,T);const s=e.textures,o=[];if(l){n.cubeFramebuffers[x]=T;const{textureGPU:e}=this.get(s[0]),r=this.renderer._activeCubeFace;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+r,e,0)}else{n.framebuffers[x]=T;for(let r=0;r0&&!1===b&&!i.multiview){if(void 0===g){const s=[];g=t.createFramebuffer(),r.bindFramebuffer(t.FRAMEBUFFER,g);const i=[],l=e.textures;for(let r=0;r0&&!0===this.extensions.has("WEBGL_multisampled_render_to_texture")&&!1!==e._autoAllocateDepthBuffer}dispose(){const e=this.extensions.get("WEBGL_lose_context");e&&e.loseContext(),this.renderer.domElement.removeEventListener("webglcontextlost",this._onContextLost)}}const _N="point-list",vN="line-list",NN="line-strip",SN="triangle-list",EN="triangle-strip",wN="never",AN="less",RN="equal",CN="less-equal",MN="greater",PN="not-equal",LN="greater-equal",FN="always",BN="store",IN="load",DN="clear",VN="ccw",UN="none",ON="front",kN="back",GN="uint16",zN="uint32",HN="r8unorm",$N="r8snorm",WN="r8uint",jN="r8sint",qN="r16uint",XN="r16sint",KN="r16float",YN="rg8unorm",QN="rg8snorm",ZN="rg8uint",JN="rg8sint",eS="r32uint",tS="r32sint",rS="r32float",sS="rg16uint",iS="rg16sint",nS="rg16float",aS="rgba8unorm",oS="rgba8unorm-srgb",uS="rgba8snorm",lS="rgba8uint",dS="rgba8sint",cS="bgra8unorm",hS="bgra8unorm-srgb",pS="rgb9e5ufloat",gS="rgb10a2unorm",mS="rgb10a2unorm",fS="rg32uint",yS="rg32sint",bS="rg32float",xS="rgba16uint",TS="rgba16sint",_S="rgba16float",vS="rgba32uint",NS="rgba32sint",SS="rgba32float",ES="depth16unorm",wS="depth24plus",AS="depth24plus-stencil8",RS="depth32float",CS="depth32float-stencil8",MS="bc1-rgba-unorm",PS="bc1-rgba-unorm-srgb",LS="bc2-rgba-unorm",FS="bc2-rgba-unorm-srgb",BS="bc3-rgba-unorm",IS="bc3-rgba-unorm-srgb",DS="bc4-r-unorm",VS="bc4-r-snorm",US="bc5-rg-unorm",OS="bc5-rg-snorm",kS="bc6h-rgb-ufloat",GS="bc6h-rgb-float",zS="bc7-rgba-unorm",HS="bc7-rgba-srgb",$S="etc2-rgb8unorm",WS="etc2-rgb8unorm-srgb",jS="etc2-rgb8a1unorm",qS="etc2-rgb8a1unorm-srgb",XS="etc2-rgba8unorm",KS="etc2-rgba8unorm-srgb",YS="eac-r11unorm",QS="eac-r11snorm",ZS="eac-rg11unorm",JS="eac-rg11snorm",eE="astc-4x4-unorm",tE="astc-4x4-unorm-srgb",rE="astc-5x4-unorm",sE="astc-5x4-unorm-srgb",iE="astc-5x5-unorm",nE="astc-5x5-unorm-srgb",aE="astc-6x5-unorm",oE="astc-6x5-unorm-srgb",uE="astc-6x6-unorm",lE="astc-6x6-unorm-srgb",dE="astc-8x5-unorm",cE="astc-8x5-unorm-srgb",hE="astc-8x6-unorm",pE="astc-8x6-unorm-srgb",gE="astc-8x8-unorm",mE="astc-8x8-unorm-srgb",fE="astc-10x5-unorm",yE="astc-10x5-unorm-srgb",bE="astc-10x6-unorm",xE="astc-10x6-unorm-srgb",TE="astc-10x8-unorm",_E="astc-10x8-unorm-srgb",vE="astc-10x10-unorm",NE="astc-10x10-unorm-srgb",SE="astc-12x10-unorm",EE="astc-12x10-unorm-srgb",wE="astc-12x12-unorm",AE="astc-12x12-unorm-srgb",RE="clamp-to-edge",CE="repeat",ME="mirror-repeat",PE="linear",LE="nearest",FE="zero",BE="one",IE="src",DE="one-minus-src",VE="src-alpha",UE="one-minus-src-alpha",OE="dst",kE="one-minus-dst",GE="dst-alpha",zE="one-minus-dst-alpha",HE="src-alpha-saturated",$E="constant",WE="one-minus-constant",jE="add",qE="subtract",XE="reverse-subtract",KE="min",YE="max",QE=0,ZE=15,JE="keep",ew="zero",tw="replace",rw="invert",sw="increment-clamp",iw="decrement-clamp",nw="increment-wrap",aw="decrement-wrap",ow="storage",uw="read-only-storage",lw="write-only",dw="read-only",cw="read-write",hw="non-filtering",pw="comparison",gw="float",mw="unfilterable-float",fw="depth",yw="sint",bw="uint",xw="2d",Tw="3d",_w="2d",vw="2d-array",Nw="cube",Sw="3d",Ew="all",ww="vertex",Aw="instance",Rw={DepthClipControl:"depth-clip-control",Depth32FloatStencil8:"depth32float-stencil8",TextureCompressionBC:"texture-compression-bc",TextureCompressionETC2:"texture-compression-etc2",TextureCompressionASTC:"texture-compression-astc",TimestampQuery:"timestamp-query",IndirectFirstInstance:"indirect-first-instance",ShaderF16:"shader-f16",RG11B10UFloat:"rg11b10ufloat-renderable",BGRA8UNormStorage:"bgra8unorm-storage",Float32Filterable:"float32-filterable",ClipDistances:"clip-distances",DualSourceBlending:"dual-source-blending",Subgroups:"subgroups"};class Cw extends Pv{constructor(e,t){super(e),this.texture=t,this.version=t?t.version:0,this.isSampler=!0}}class Mw extends Cw{constructor(e,t,r){super(e,t?t.value:null),this.textureNode=t,this.groupNode=r}update(){this.texture=this.textureNode.value}}class Pw extends Lv{constructor(e,t){super(e,t?t.array:null),this.attribute=t,this.isStorageBuffer=!0}}let Lw=0;class Fw extends Pw{constructor(e,t){super("StorageBuffer_"+Lw++,e?e.value:null),this.nodeUniform=e,this.access=e?e.access:Os.READ_WRITE,this.groupNode=t}get buffer(){return this.nodeUniform.value}}class Bw extends ef{constructor(e){super(),this.device=e;this.mipmapSampler=e.createSampler({minFilter:PE}),this.flipYSampler=e.createSampler({minFilter:LE}),this.transferPipelines={},this.flipYPipelines={},this.mipmapVertexShaderModule=e.createShaderModule({label:"mipmapVertex",code:"\nstruct VarysStruct {\n\t@builtin( position ) Position: vec4,\n\t@location( 0 ) vTex : vec2\n};\n\n@vertex\nfn main( @builtin( vertex_index ) vertexIndex : u32 ) -> VarysStruct {\n\n\tvar Varys : VarysStruct;\n\n\tvar pos = array< vec2, 4 >(\n\t\tvec2( -1.0, 1.0 ),\n\t\tvec2( 1.0, 1.0 ),\n\t\tvec2( -1.0, -1.0 ),\n\t\tvec2( 1.0, -1.0 )\n\t);\n\n\tvar tex = array< vec2, 4 >(\n\t\tvec2( 0.0, 0.0 ),\n\t\tvec2( 1.0, 0.0 ),\n\t\tvec2( 0.0, 1.0 ),\n\t\tvec2( 1.0, 1.0 )\n\t);\n\n\tVarys.vTex = tex[ vertexIndex ];\n\tVarys.Position = vec4( pos[ vertexIndex ], 0.0, 1.0 );\n\n\treturn Varys;\n\n}\n"}),this.mipmapFragmentShaderModule=e.createShaderModule({label:"mipmapFragment",code:"\n@group( 0 ) @binding( 0 )\nvar imgSampler : sampler;\n\n@group( 0 ) @binding( 1 )\nvar img : texture_2d;\n\n@fragment\nfn main( @location( 0 ) vTex : vec2 ) -> @location( 0 ) vec4 {\n\n\treturn textureSample( img, imgSampler, vTex );\n\n}\n"}),this.flipYFragmentShaderModule=e.createShaderModule({label:"flipYFragment",code:"\n@group( 0 ) @binding( 0 )\nvar imgSampler : sampler;\n\n@group( 0 ) @binding( 1 )\nvar img : texture_2d;\n\n@fragment\nfn main( @location( 0 ) vTex : vec2 ) -> @location( 0 ) vec4 {\n\n\treturn textureSample( img, imgSampler, vec2( vTex.x, 1.0 - vTex.y ) );\n\n}\n"})}getTransferPipeline(e){let t=this.transferPipelines[e];return void 0===t&&(t=this.device.createRenderPipeline({label:`mipmap-${e}`,vertex:{module:this.mipmapVertexShaderModule,entryPoint:"main"},fragment:{module:this.mipmapFragmentShaderModule,entryPoint:"main",targets:[{format:e}]},primitive:{topology:EN,stripIndexFormat:zN},layout:"auto"}),this.transferPipelines[e]=t),t}getFlipYPipeline(e){let t=this.flipYPipelines[e];return void 0===t&&(t=this.device.createRenderPipeline({label:`flipY-${e}`,vertex:{module:this.mipmapVertexShaderModule,entryPoint:"main"},fragment:{module:this.flipYFragmentShaderModule,entryPoint:"main",targets:[{format:e}]},primitive:{topology:EN,stripIndexFormat:zN},layout:"auto"}),this.flipYPipelines[e]=t),t}flipY(e,t,r=0){const s=t.format,{width:i,height:n}=t.size,a=this.getTransferPipeline(s),o=this.getFlipYPipeline(s),u=this.device.createTexture({size:{width:i,height:n,depthOrArrayLayers:1},format:s,usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING}),l=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:_w,baseArrayLayer:r}),d=u.createView({baseMipLevel:0,mipLevelCount:1,dimension:_w,baseArrayLayer:0}),c=this.device.createCommandEncoder({}),h=(e,t,r)=>{const s=e.getBindGroupLayout(0),i=this.device.createBindGroup({layout:s,entries:[{binding:0,resource:this.flipYSampler},{binding:1,resource:t}]}),n=c.beginRenderPass({colorAttachments:[{view:r,loadOp:DN,storeOp:BN,clearValue:[0,0,0,0]}]});n.setPipeline(e),n.setBindGroup(0,i),n.draw(4,1,0,0),n.end()};h(a,l,d),h(o,d,l),this.device.queue.submit([c.finish()]),u.destroy()}generateMipmaps(e,t,r=0){const s=this.get(e);void 0===s.useCount&&(s.useCount=0,s.layers=[]);const i=s.layers[r]||this._mipmapCreateBundles(e,t,r),n=this.device.createCommandEncoder({});this._mipmapRunBundles(n,i),this.device.queue.submit([n.finish()]),0!==s.useCount&&(s.layers[r]=i),s.useCount++}_mipmapCreateBundles(e,t,r){const s=this.getTransferPipeline(t.format),i=s.getBindGroupLayout(0);let n=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:_w,baseArrayLayer:r});const a=[];for(let o=1;o1;for(let a=0;a]*\s*([a-z_0-9]+(?:<[\s\S]+?>)?)/i,kw=/([a-z_0-9]+)\s*:\s*([a-z_0-9]+(?:<[\s\S]+?>)?)/gi,Gw={f32:"float",i32:"int",u32:"uint",bool:"bool","vec2":"vec2","vec2":"ivec2","vec2":"uvec2","vec2":"bvec2",vec2f:"vec2",vec2i:"ivec2",vec2u:"uvec2",vec2b:"bvec2","vec3":"vec3","vec3":"ivec3","vec3":"uvec3","vec3":"bvec3",vec3f:"vec3",vec3i:"ivec3",vec3u:"uvec3",vec3b:"bvec3","vec4":"vec4","vec4":"ivec4","vec4":"uvec4","vec4":"bvec4",vec4f:"vec4",vec4i:"ivec4",vec4u:"uvec4",vec4b:"bvec4","mat2x2":"mat2",mat2x2f:"mat2","mat3x3":"mat3",mat3x3f:"mat3","mat4x4":"mat4",mat4x4f:"mat4",sampler:"sampler",texture_1d:"texture",texture_2d:"texture",texture_2d_array:"texture",texture_multisampled_2d:"cubeTexture",texture_depth_2d:"depthTexture",texture_depth_2d_array:"depthTexture",texture_depth_multisampled_2d:"depthTexture",texture_depth_cube:"depthTexture",texture_depth_cube_array:"depthTexture",texture_3d:"texture3D",texture_cube:"cubeTexture",texture_cube_array:"cubeTexture",texture_storage_1d:"storageTexture",texture_storage_2d:"storageTexture",texture_storage_2d_array:"storageTexture",texture_storage_3d:"storageTexture"};class zw extends X_{constructor(e){const{type:t,inputs:r,name:s,inputsCode:i,blockCode:n,outputType:a}=(e=>{const t=(e=e.trim()).match(Ow);if(null!==t&&4===t.length){const r=t[2],s=[];let i=null;for(;null!==(i=kw.exec(r));)s.push({name:i[1],type:i[2]});const n=[];for(let e=0;e "+this.outputType:"";return`fn ${e} ( ${this.inputsCode.trim()} ) ${t}`+this.blockCode}}class Hw extends q_{parseFunction(e){return new zw(e)}}const $w="undefined"!=typeof self?self.GPUShaderStage:{VERTEX:1,FRAGMENT:2,COMPUTE:4},Ww={[Os.READ_ONLY]:"read",[Os.WRITE_ONLY]:"write",[Os.READ_WRITE]:"read_write"},jw={[Nr]:"repeat",[vr]:"clamp",[_r]:"mirror"},qw={vertex:$w?$w.VERTEX:1,fragment:$w?$w.FRAGMENT:2,compute:$w?$w.COMPUTE:4},Xw={instance:!0,swizzleAssign:!1,storageBuffer:!0},Kw={"^^":"tsl_xor"},Yw={float:"f32",int:"i32",uint:"u32",bool:"bool",color:"vec3",vec2:"vec2",ivec2:"vec2",uvec2:"vec2",bvec2:"vec2",vec3:"vec3",ivec3:"vec3",uvec3:"vec3",bvec3:"vec3",vec4:"vec4",ivec4:"vec4",uvec4:"vec4",bvec4:"vec4",mat2:"mat2x2",mat3:"mat3x3",mat4:"mat4x4"},Qw={},Zw={tsl_xor:new wb("fn tsl_xor( a : bool, b : bool ) -> bool { return ( a || b ) && !( a && b ); }"),mod_float:new wb("fn tsl_mod_float( x : f32, y : f32 ) -> f32 { return x - y * floor( x / y ); }"),mod_vec2:new wb("fn tsl_mod_vec2( x : vec2f, y : vec2f ) -> vec2f { return x - y * floor( x / y ); }"),mod_vec3:new wb("fn tsl_mod_vec3( x : vec3f, y : vec3f ) -> vec3f { return x - y * floor( x / y ); }"),mod_vec4:new wb("fn tsl_mod_vec4( x : vec4f, y : vec4f ) -> vec4f { return x - y * floor( x / y ); }"),equals_bool:new wb("fn tsl_equals_bool( a : bool, b : bool ) -> bool { return a == b; }"),equals_bvec2:new wb("fn tsl_equals_bvec2( a : vec2f, b : vec2f ) -> vec2 { return vec2( a.x == b.x, a.y == b.y ); }"),equals_bvec3:new wb("fn tsl_equals_bvec3( a : vec3f, b : vec3f ) -> vec3 { return vec3( a.x == b.x, a.y == b.y, a.z == b.z ); }"),equals_bvec4:new wb("fn tsl_equals_bvec4( a : vec4f, b : vec4f ) -> vec4 { return vec4( a.x == b.x, a.y == b.y, a.z == b.z, a.w == b.w ); }"),repeatWrapping_float:new wb("fn tsl_repeatWrapping_float( coord: f32 ) -> f32 { return fract( coord ); }"),mirrorWrapping_float:new wb("fn tsl_mirrorWrapping_float( coord: f32 ) -> f32 { let mirrored = fract( coord * 0.5 ) * 2.0; return 1.0 - abs( 1.0 - mirrored ); }"),clampWrapping_float:new wb("fn tsl_clampWrapping_float( coord: f32 ) -> f32 { return clamp( coord, 0.0, 1.0 ); }"),biquadraticTexture:new wb("\nfn tsl_biquadraticTexture( map : texture_2d, coord : vec2f, iRes : vec2u, level : u32 ) -> vec4f {\n\n\tlet res = vec2f( iRes );\n\n\tlet uvScaled = coord * res;\n\tlet uvWrapping = ( ( uvScaled % res ) + res ) % res;\n\n\t// https://www.shadertoy.com/view/WtyXRy\n\n\tlet uv = uvWrapping - 0.5;\n\tlet iuv = floor( uv );\n\tlet f = fract( uv );\n\n\tlet rg1 = textureLoad( map, vec2u( iuv + vec2( 0.5, 0.5 ) ) % iRes, level );\n\tlet rg2 = textureLoad( map, vec2u( iuv + vec2( 1.5, 0.5 ) ) % iRes, level );\n\tlet rg3 = textureLoad( map, vec2u( iuv + vec2( 0.5, 1.5 ) ) % iRes, level );\n\tlet rg4 = textureLoad( map, vec2u( iuv + vec2( 1.5, 1.5 ) ) % iRes, level );\n\n\treturn mix( mix( rg1, rg2, f.x ), mix( rg3, rg4, f.x ), f.y );\n\n}\n")},Jw={dFdx:"dpdx",dFdy:"- dpdy",mod_float:"tsl_mod_float",mod_vec2:"tsl_mod_vec2",mod_vec3:"tsl_mod_vec3",mod_vec4:"tsl_mod_vec4",equals_bool:"tsl_equals_bool",equals_bvec2:"tsl_equals_bvec2",equals_bvec3:"tsl_equals_bvec3",equals_bvec4:"tsl_equals_bvec4",inversesqrt:"inverseSqrt",bitcast:"bitcast"};"undefined"!=typeof navigator&&/Windows/g.test(navigator.userAgent)&&(Zw.pow_float=new wb("fn tsl_pow_float( a : f32, b : f32 ) -> f32 { return select( -pow( -a, b ), pow( a, b ), a > 0.0 ); }"),Zw.pow_vec2=new wb("fn tsl_pow_vec2( a : vec2f, b : vec2f ) -> vec2f { return vec2f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ) ); }",[Zw.pow_float]),Zw.pow_vec3=new wb("fn tsl_pow_vec3( a : vec3f, b : vec3f ) -> vec3f { return vec3f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ) ); }",[Zw.pow_float]),Zw.pow_vec4=new wb("fn tsl_pow_vec4( a : vec4f, b : vec4f ) -> vec4f { return vec4f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ), tsl_pow_float( a.w, b.w ) ); }",[Zw.pow_float]),Jw.pow_float="tsl_pow_float",Jw.pow_vec2="tsl_pow_vec2",Jw.pow_vec3="tsl_pow_vec3",Jw.pow_vec4="tsl_pow_vec4");let eA="";!0!==("undefined"!=typeof navigator&&/Firefox|Deno/g.test(navigator.userAgent))&&(eA+="diagnostic( off, derivative_uniformity );\n");class tA extends L_{constructor(e,t){super(e,t,new Hw),this.uniformGroups={},this.builtins={},this.directives={},this.scopedArrays=new Map}needsToWorkingColorSpace(e){return!0===e.isVideoTexture&&e.colorSpace!==b}_generateTextureSample(e,t,r,s,i=this.shaderStage){return"fragment"===i?s?`textureSample( ${t}, ${t}_sampler, ${r}, ${s} )`:`textureSample( ${t}, ${t}_sampler, ${r} )`:this._generateTextureSampleLevel(e,t,r,"0",s)}_generateVideoSample(e,t,r=this.shaderStage){if("fragment"===r)return`textureSampleBaseClampToEdge( ${e}, ${e}_sampler, vec2( ${t}.x, 1.0 - ${t}.y ) )`;console.error(`WebGPURenderer: THREE.VideoTexture does not support ${r} shader.`)}_generateTextureSampleLevel(e,t,r,s,i){return!1===this.isUnfilterable(e)?`textureSampleLevel( ${t}, ${t}_sampler, ${r}, ${s} )`:this.isFilteredTexture(e)?this.generateFilteredTexture(e,t,r,s):this.generateTextureLod(e,t,r,i,s)}generateWrapFunction(e){const t=`tsl_coord_${jw[e.wrapS]}S_${jw[e.wrapT]}_${e.isData3DTexture?"3d":"2d"}T`;let r=Qw[t];if(void 0===r){const s=[],i=e.isData3DTexture?"vec3f":"vec2f";let n=`fn ${t}( coord : ${i} ) -> ${i} {\n\n\treturn ${i}(\n`;const a=(e,t)=>{e===Nr?(s.push(Zw.repeatWrapping_float),n+=`\t\ttsl_repeatWrapping_float( coord.${t} )`):e===vr?(s.push(Zw.clampWrapping_float),n+=`\t\ttsl_clampWrapping_float( coord.${t} )`):e===_r?(s.push(Zw.mirrorWrapping_float),n+=`\t\ttsl_mirrorWrapping_float( coord.${t} )`):(n+=`\t\tcoord.${t}`,console.warn(`WebGPURenderer: Unsupported texture wrap type "${e}" for vertex shader.`))};a(e.wrapS,"x"),n+=",\n",a(e.wrapT,"y"),e.isData3DTexture&&(n+=",\n",a(e.wrapR,"z")),n+="\n\t);\n\n}\n",Qw[t]=r=new wb(n,s)}return r.build(this),t}generateArrayDeclaration(e,t){return`array< ${this.getType(e)}, ${t} >`}generateTextureDimension(e,t,r){const s=this.getDataFromNode(e,this.shaderStage,this.globalCache);void 0===s.dimensionsSnippet&&(s.dimensionsSnippet={});let i=s.dimensionsSnippet[r];if(void 0===s.dimensionsSnippet[r]){let n,a;const{primarySamples:o}=this.renderer.backend.utils.getTextureSampleData(e),u=o>1;a=e.isData3DTexture?"vec3":"vec2",n=u||e.isVideoTexture||e.isStorageTexture?t:`${t}${r?`, u32( ${r} )`:""}`,i=new Jo(new Iu(`textureDimensions( ${n} )`,a)),s.dimensionsSnippet[r]=i,(e.isArrayTexture||e.isDataArrayTexture||e.isData3DTexture)&&(s.arrayLayerCount=new Jo(new Iu(`textureNumLayers(${t})`,"u32"))),e.isTextureCube&&(s.cubeFaceCount=new Jo(new Iu("6u","u32")))}return i.build(this)}generateFilteredTexture(e,t,r,s="0u"){this._include("biquadraticTexture");return`tsl_biquadraticTexture( ${t}, ${this.generateWrapFunction(e)}( ${r} ), ${this.generateTextureDimension(e,t,s)}, u32( ${s} ) )`}generateTextureLod(e,t,r,s,i="0u"){const n=this.generateWrapFunction(e),a=this.generateTextureDimension(e,t,i),o=e.isData3DTexture?"vec3":"vec2",u=`${o}( ${n}( ${r} ) * ${o}( ${a} ) )`;return this.generateTextureLoad(e,t,u,s,i)}generateTextureLoad(e,t,r,s,i="0u"){let n;return!0===e.isVideoTexture?n=`textureLoad( ${t}, ${r} )`:s?n=`textureLoad( ${t}, ${r}, ${s}, u32( ${i} ) )`:(n=`textureLoad( ${t}, ${r}, u32( ${i} ) )`,this.renderer.backend.compatibilityMode&&e.isDepthTexture&&(n+=".x")),n}generateTextureStore(e,t,r,s,i){let n;return n=s?`textureStore( ${t}, ${r}, ${s}, ${i} )`:`textureStore( ${t}, ${r}, ${i} )`,n}isSampleCompare(e){return!0===e.isDepthTexture&&null!==e.compareFunction}isUnfilterable(e){return"float"!==this.getComponentTypeFromTexture(e)||!this.isAvailable("float32Filterable")&&!0===e.isDataTexture&&e.type===B||!1===this.isSampleCompare(e)&&e.minFilter===v&&e.magFilter===v||this.renderer.backend.utils.getTextureSampleData(e).primarySamples>1}generateTexture(e,t,r,s,i=this.shaderStage){let n=null;return n=!0===e.isVideoTexture?this._generateVideoSample(t,r,i):this.isUnfilterable(e)?this.generateTextureLod(e,t,r,s,"0",i):this._generateTextureSample(e,t,r,s,i),n}generateTextureGrad(e,t,r,s,i,n=this.shaderStage){if("fragment"===n)return`textureSampleGrad( ${t}, ${t}_sampler, ${r}, ${s[0]}, ${s[1]} )`;console.error(`WebGPURenderer: THREE.TextureNode.gradient() does not support ${n} shader.`)}generateTextureCompare(e,t,r,s,i,n=this.shaderStage){if("fragment"===n)return!0===e.isDepthTexture&&!0===e.isArrayTexture?`textureSampleCompare( ${t}, ${t}_sampler, ${r}, ${i}, ${s} )`:`textureSampleCompare( ${t}, ${t}_sampler, ${r}, ${s} )`;console.error(`WebGPURenderer: THREE.DepthTexture.compareFunction() does not support ${n} shader.`)}generateTextureLevel(e,t,r,s,i,n=this.shaderStage){let a=null;return a=!0===e.isVideoTexture?this._generateVideoSample(t,r,n):this._generateTextureSampleLevel(e,t,r,s,i),a}generateTextureBias(e,t,r,s,i,n=this.shaderStage){if("fragment"===n)return`textureSampleBias( ${t}, ${t}_sampler, ${r}, ${s} )`;console.error(`WebGPURenderer: THREE.TextureNode.biasNode does not support ${n} shader.`)}getPropertyName(e,t=this.shaderStage){if(!0===e.isNodeVarying&&!0===e.needsInterpolation){if("vertex"===t)return`varyings.${e.name}`}else if(!0===e.isNodeUniform){const t=e.name,r=e.type;return"texture"===r||"cubeTexture"===r||"storageTexture"===r||"texture3D"===r?t:"buffer"===r||"storageBuffer"===r||"indirectStorageBuffer"===r?this.isCustomStruct(e)?t:t+".value":e.groupNode.name+"."+t}return super.getPropertyName(e)}getOutputStructName(){return"output"}getFunctionOperator(e){const t=Kw[e];return void 0!==t?(this._include(t),t):null}getNodeAccess(e,t){return"compute"!==t?Os.READ_ONLY:e.access}getStorageAccess(e,t){return Ww[this.getNodeAccess(e,t)]}getUniformFromNode(e,t,r,s=null){const i=super.getUniformFromNode(e,t,r,s),n=this.getDataFromNode(e,r,this.globalCache);if(void 0===n.uniformGPU){let a;const o=e.groupNode,u=o.name,l=this.getBindGroupArray(u,r);if("texture"===t||"cubeTexture"===t||"storageTexture"===t||"texture3D"===t){let s=null;const n=this.getNodeAccess(e,r);if("texture"===t||"storageTexture"===t?s=new Gv(i.name,i.node,o,n):"cubeTexture"===t?s=new zv(i.name,i.node,o,n):"texture3D"===t&&(s=new Hv(i.name,i.node,o,n)),s.store=!0===e.isStorageTextureNode,s.setVisibility(qw[r]),!1===this.isUnfilterable(e.value)&&!1===s.store){const e=new Mw(`${i.name}_sampler`,i.node,o);e.setVisibility(qw[r]),l.push(e,s),a=[e,s]}else l.push(s),a=[s]}else if("buffer"===t||"storageBuffer"===t||"indirectStorageBuffer"===t){const n=new("buffer"===t?Iv:Fw)(e,o);n.setVisibility(qw[r]),l.push(n),a=n,i.name=s||"NodeBuffer_"+i.id}else{const e=this.uniformGroups[r]||(this.uniformGroups[r]={});let s=e[u];void 0===s&&(s=new Uv(u,o),s.setVisibility(qw[r]),e[u]=s,l.push(s)),a=this.getNodeUniform(i,t),s.addUniform(a)}n.uniformGPU=a}return i}getBuiltin(e,t,r,s=this.shaderStage){const i=this.builtins[s]||(this.builtins[s]=new Map);return!1===i.has(e)&&i.set(e,{name:e,property:t,type:r}),t}hasBuiltin(e,t=this.shaderStage){return void 0!==this.builtins[t]&&this.builtins[t].has(e)}getVertexIndex(){return"vertex"===this.shaderStage?this.getBuiltin("vertex_index","vertexIndex","u32","attribute"):"vertexIndex"}buildFunctionCode(e){const t=e.layout,r=this.flowShaderNode(e),s=[];for(const e of t.inputs)s.push(e.name+" : "+this.getType(e.type));let i=`fn ${t.name}( ${s.join(", ")} ) -> ${this.getType(t.type)} {\n${r.vars}\n${r.code}\n`;return r.result&&(i+=`\treturn ${r.result};\n`),i+="\n}\n",i}getInstanceIndex(){return"vertex"===this.shaderStage?this.getBuiltin("instance_index","instanceIndex","u32","attribute"):"instanceIndex"}getInvocationLocalIndex(){return this.getBuiltin("local_invocation_index","invocationLocalIndex","u32","attribute")}getSubgroupSize(){return this.enableSubGroups(),this.getBuiltin("subgroup_size","subgroupSize","u32","attribute")}getInvocationSubgroupIndex(){return this.enableSubGroups(),this.getBuiltin("subgroup_invocation_id","invocationSubgroupIndex","u32","attribute")}getSubgroupIndex(){return this.enableSubGroups(),this.getBuiltin("subgroup_id","subgroupIndex","u32","attribute")}getDrawIndex(){return null}getFrontFacing(){return this.getBuiltin("front_facing","isFront","bool")}getFragCoord(){return this.getBuiltin("position","fragCoord","vec4")+".xy"}getFragDepth(){return"output."+this.getBuiltin("frag_depth","depth","f32","output")}getClipDistance(){return"varyings.hw_clip_distances"}isFlipY(){return!1}enableDirective(e,t=this.shaderStage){(this.directives[t]||(this.directives[t]=new Set)).add(e)}getDirectives(e){const t=[],r=this.directives[e];if(void 0!==r)for(const e of r)t.push(`enable ${e};`);return t.join("\n")}enableSubGroups(){this.enableDirective("subgroups")}enableSubgroupsF16(){this.enableDirective("subgroups-f16")}enableClipDistances(){this.enableDirective("clip_distances")}enableShaderF16(){this.enableDirective("f16")}enableDualSourceBlending(){this.enableDirective("dual_source_blending")}enableHardwareClipping(e){this.enableClipDistances(),this.getBuiltin("clip_distances","hw_clip_distances",`array`,"vertex")}getBuiltins(e){const t=[],r=this.builtins[e];if(void 0!==r)for(const{name:e,property:s,type:i}of r.values())t.push(`@builtin( ${e} ) ${s} : ${i}`);return t.join(",\n\t")}getScopedArray(e,t,r,s){return!1===this.scopedArrays.has(e)&&this.scopedArrays.set(e,{name:e,scope:t,bufferType:r,bufferCount:s}),e}getScopedArrays(e){if("compute"!==e)return;const t=[];for(const{name:e,scope:r,bufferType:s,bufferCount:i}of this.scopedArrays.values()){const n=this.getType(s);t.push(`var<${r}> ${e}: array< ${n}, ${i} >;`)}return t.join("\n")}getAttributes(e){const t=[];if("compute"===e&&(this.getBuiltin("global_invocation_id","globalId","vec3","attribute"),this.getBuiltin("workgroup_id","workgroupId","vec3","attribute"),this.getBuiltin("local_invocation_id","localId","vec3","attribute"),this.getBuiltin("num_workgroups","numWorkgroups","vec3","attribute"),this.renderer.hasFeature("subgroups")&&(this.enableDirective("subgroups",e),this.getBuiltin("subgroup_size","subgroupSize","u32","attribute"))),"vertex"===e||"compute"===e){const e=this.getBuiltins("attribute");e&&t.push(e);const r=this.getAttributesArray();for(let e=0,s=r.length;e"),t.push(`\t${s+r.name} : ${i}`)}return e.output&&t.push(`\t${this.getBuiltins("output")}`),t.join(",\n")}getStructs(e){let t="";const r=this.structs[e];if(r.length>0){const e=[];for(const t of r){let r=`struct ${t.name} {\n`;r+=this.getStructMembers(t),r+="\n};",e.push(r)}t="\n"+e.join("\n\n")+"\n"}return t}getVar(e,t,r=null){let s=`var ${t} : `;return s+=null!==r?this.generateArrayDeclaration(e,r):this.getType(e),s}getVars(e){const t=[],r=this.vars[e];if(void 0!==r)for(const e of r)t.push(`\t${this.getVar(e.type,e.name,e.count)};`);return`\n${t.join("\n")}\n`}getVaryings(e){const t=[];if("vertex"===e&&this.getBuiltin("position","Vertex","vec4","vertex"),"vertex"===e||"fragment"===e){const r=this.varyings,s=this.vars[e];for(let i=0;ir.value.itemSize;return s&&!i}getUniforms(e){const t=this.uniforms[e],r=[],s=[],i=[],n={};for(const i of t){const t=i.groupNode.name,a=this.bindingsIndexes[t];if("texture"===i.type||"cubeTexture"===i.type||"storageTexture"===i.type||"texture3D"===i.type){const t=i.node.value;let s;!1===this.isUnfilterable(t)&&!0!==i.node.isStorageTextureNode&&(this.isSampleCompare(t)?r.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${i.name}_sampler : sampler_comparison;`):r.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${i.name}_sampler : sampler;`));let n="";const{primarySamples:o}=this.renderer.backend.utils.getTextureSampleData(t);if(o>1&&(n="_multisampled"),!0===t.isCubeTexture)s="texture_cube";else if(!0===t.isDepthTexture)s=this.renderer.backend.compatibilityMode&&null===t.compareFunction?`texture${n}_2d`:`texture_depth${n}_2d${!0===t.isArrayTexture?"_array":""}`;else if(!0===t.isArrayTexture||!0===t.isDataArrayTexture||!0===t.isCompressedArrayTexture)s="texture_2d_array";else if(!0===t.isVideoTexture)s="texture_external";else if(!0===t.isData3DTexture)s="texture_3d";else if(!0===i.node.isStorageTextureNode){s=`texture_storage_2d<${Uw(t)}, ${this.getStorageAccess(i.node,e)}>`}else{s=`texture${n}_2d<${this.getComponentTypeFromTexture(t).charAt(0)}32>`}r.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${i.name} : ${s};`)}else if("buffer"===i.type||"storageBuffer"===i.type||"indirectStorageBuffer"===i.type){const t=i.node,r=this.getType(t.getNodeType(this)),n=t.bufferCount,o=n>0&&"buffer"===i.type?", "+n:"",u=t.isStorageBufferNode?`storage, ${this.getStorageAccess(t,e)}`:"uniform";if(this.isCustomStruct(i))s.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var<${u}> ${i.name} : ${r};`);else{const e=`\tvalue : array< ${t.isAtomic?`atomic<${r}>`:`${r}`}${o} >`;s.push(this._getWGSLStructBinding(i.name,e,u,a.binding++,a.group))}}else{const e=this.getType(this.getVectorType(i.type)),t=i.groupNode.name;(n[t]||(n[t]={index:a.binding++,id:a.group,snippets:[]})).snippets.push(`\t${i.name} : ${e}`)}}for(const e in n){const t=n[e];i.push(this._getWGSLStructBinding(e,t.snippets.join(",\n"),"uniform",t.index,t.id))}let a=r.join("\n");return a+=s.join("\n"),a+=i.join("\n"),a}buildCode(){const e=null!==this.material?{fragment:{},vertex:{}}:{compute:{}};this.sortBindingGroups();for(const t in e){this.shaderStage=t;const r=e[t];r.uniforms=this.getUniforms(t),r.attributes=this.getAttributes(t),r.varyings=this.getVaryings(t),r.structs=this.getStructs(t),r.vars=this.getVars(t),r.codes=this.getCodes(t),r.directives=this.getDirectives(t),r.scopedArrays=this.getScopedArrays(t);let s="// code\n\n";s+=this.flowCode[t];const i=this.flowNodes[t],n=i[i.length-1],a=n.outputNode,o=void 0!==a&&!0===a.isOutputStructNode;for(const e of i){const i=this.getFlowData(e),u=e.name;if(u&&(s.length>0&&(s+="\n"),s+=`\t// flow -> ${u}\n`),s+=`${i.code}\n\t`,e===n&&"compute"!==t)if(s+="// result\n\n\t","vertex"===t)s+=`varyings.Vertex = ${i.result};`;else if("fragment"===t)if(o)r.returnType=a.getNodeType(this),r.structs+="var output : "+r.returnType+";",s+=`return ${i.result};`;else{let e="\t@location(0) color: vec4";const t=this.getBuiltins("output");t&&(e+=",\n\t"+t),r.returnType="OutputStruct",r.structs+=this._getWGSLStruct("OutputStruct",e),r.structs+="\nvar output : OutputStruct;",s+=`output.color = ${i.result};\n\n\treturn output;`}}r.flow=s}this.shaderStage=null,null!==this.material?(this.vertexShader=this._getWGSLVertexCode(e.vertex),this.fragmentShader=this._getWGSLFragmentCode(e.fragment)):this.computeShader=this._getWGSLComputeCode(e.compute,(this.object.workgroupSize||[64]).join(", "))}getMethod(e,t=null){let r;return null!==t&&(r=this._getWGSLMethod(e+"_"+t)),void 0===r&&(r=this._getWGSLMethod(e)),r||e}getType(e){return Yw[e]||e}isAvailable(e){let t=Xw[e];return void 0===t&&("float32Filterable"===e?t=this.renderer.hasFeature("float32-filterable"):"clipDistance"===e&&(t=this.renderer.hasFeature("clip-distances")),Xw[e]=t),t}_getWGSLMethod(e){return void 0!==Zw[e]&&this._include(e),Jw[e]}_include(e){const t=Zw[e];return t.build(this),null!==this.currentFunctionNode&&this.currentFunctionNode.includes.push(t),t}_getWGSLVertexCode(e){return`${this.getSignature()}\n// directives\n${e.directives}\n\n// structs\n${e.structs}\n\n// uniforms\n${e.uniforms}\n\n// varyings\n${e.varyings}\nvar varyings : VaryingsStruct;\n\n// codes\n${e.codes}\n\n@vertex\nfn main( ${e.attributes} ) -> VaryingsStruct {\n\n\t// vars\n\t${e.vars}\n\n\t// flow\n\t${e.flow}\n\n\treturn varyings;\n\n}\n`}_getWGSLFragmentCode(e){return`${this.getSignature()}\n// global\n${eA}\n\n// structs\n${e.structs}\n\n// uniforms\n${e.uniforms}\n\n// codes\n${e.codes}\n\n@fragment\nfn main( ${e.varyings} ) -> ${e.returnType} {\n\n\t// vars\n\t${e.vars}\n\n\t// flow\n\t${e.flow}\n\n}\n`}_getWGSLComputeCode(e,t){return`${this.getSignature()}\n// directives\n${e.directives}\n\n// system\nvar instanceIndex : u32;\n\n// locals\n${e.scopedArrays}\n\n// structs\n${e.structs}\n\n// uniforms\n${e.uniforms}\n\n// codes\n${e.codes}\n\n@compute @workgroup_size( ${t} )\nfn main( ${e.attributes} ) {\n\n\t// system\n\tinstanceIndex = globalId.x + globalId.y * numWorkgroups.x * u32(${t}) + globalId.z * numWorkgroups.x * numWorkgroups.y * u32(${t});\n\n\t// vars\n\t${e.vars}\n\n\t// flow\n\t${e.flow}\n\n}\n`}_getWGSLStruct(e,t){return`\nstruct ${e} {\n${t}\n};`}_getWGSLStructBinding(e,t,r,s=0,i=0){const n=e+"Struct";return`${this._getWGSLStruct(n,t)}\n@binding( ${s} ) @group( ${i} )\nvar<${r}> ${e} : ${n};`}}class rA{constructor(e){this.backend=e}getCurrentDepthStencilFormat(e){let t;return null!==e.depthTexture?t=this.getTextureFormatGPU(e.depthTexture):e.depth&&e.stencil?t=AS:e.depth&&(t=wS),t}getTextureFormatGPU(e){return this.backend.get(e).format}getTextureSampleData(e){let t;if(e.isFramebufferTexture)t=1;else if(e.isDepthTexture&&!e.renderTarget){const e=this.backend.renderer,r=e.getRenderTarget();t=r?r.samples:e.samples}else e.renderTarget&&(t=e.renderTarget.samples);t=t||1;const r=t>1&&null!==e.renderTarget&&!0!==e.isDepthTexture&&!0!==e.isFramebufferTexture;return{samples:t,primarySamples:r?1:t,isMSAA:r}}getCurrentColorFormat(e){let t;return t=null!==e.textures?this.getTextureFormatGPU(e.textures[0]):this.getPreferredCanvasFormat(),t}getCurrentColorSpace(e){return null!==e.textures?e.textures[0].colorSpace:this.backend.renderer.outputColorSpace}getPrimitiveTopology(e,t){return e.isPoints?_N:e.isLineSegments||e.isMesh&&!0===t.wireframe?vN:e.isLine?NN:e.isMesh?SN:void 0}getSampleCount(e){let t=1;return e>1&&(t=Math.pow(2,Math.floor(Math.log2(e))),2===t&&(t=4)),t}getSampleCountRenderContext(e){return null!==e.textures?this.getSampleCount(e.sampleCount):this.getSampleCount(this.backend.renderer.samples)}getPreferredCanvasFormat(){const e=this.backend.parameters.outputType;if(void 0===e)return navigator.gpu.getPreferredCanvasFormat();if(e===Ce)return cS;if(e===de)return _S;throw new Error("Unsupported outputType")}}const sA=new Map([[Int8Array,["sint8","snorm8"]],[Uint8Array,["uint8","unorm8"]],[Int16Array,["sint16","snorm16"]],[Uint16Array,["uint16","unorm16"]],[Int32Array,["sint32","snorm32"]],[Uint32Array,["uint32","unorm32"]],[Float32Array,["float32"]]]),iA=new Map([[ze,["float16"]]]),nA=new Map([[Int32Array,"sint32"],[Int16Array,"sint32"],[Uint32Array,"uint32"],[Uint16Array,"uint32"],[Float32Array,"float32"]]);class aA{constructor(e){this.backend=e}createAttribute(e,t){const r=this._getBufferAttribute(e),s=this.backend,i=s.get(r);let n=i.buffer;if(void 0===n){const a=s.device;let o=r.array;if(!1===e.normalized)if(o.constructor===Int16Array||o.constructor===Int8Array)o=new Int32Array(o);else if((o.constructor===Uint16Array||o.constructor===Uint8Array)&&(o=new Uint32Array(o),t&GPUBufferUsage.INDEX))for(let e=0;e1&&(s.multisampled=!0,r.texture.isDepthTexture||(s.sampleType=mw)),r.texture.isDepthTexture)t.compatibilityMode&&null===r.texture.compareFunction?s.sampleType=mw:s.sampleType=fw;else if(r.texture.isDataTexture||r.texture.isDataArrayTexture||r.texture.isData3DTexture){const e=r.texture.type;e===_?s.sampleType=yw:e===T?s.sampleType=bw:e===B&&(this.backend.hasFeature("float32-filterable")?s.sampleType=gw:s.sampleType=mw)}r.isSampledCubeTexture?s.viewDimension=Nw:r.texture.isArrayTexture||r.texture.isDataArrayTexture||r.texture.isCompressedArrayTexture?s.viewDimension=vw:r.isSampledTexture3D&&(s.viewDimension=Sw),e.texture=s}else console.error(`WebGPUBindingUtils: Unsupported binding "${r}".`);s.push(e)}return r.createBindGroupLayout({entries:s})}createBindings(e,t,r,s=0){const{backend:i,bindGroupLayoutCache:n}=this,a=i.get(e);let o,u=n.get(e.bindingsReference);void 0===u&&(u=this.createBindingsLayout(e),n.set(e.bindingsReference,u)),r>0&&(void 0===a.groups&&(a.groups=[],a.versions=[]),a.versions[r]===s&&(o=a.groups[r])),void 0===o&&(o=this.createBindGroup(e,u),r>0&&(a.groups[r]=o,a.versions[r]=s)),a.group=o,a.layout=u}updateBinding(e){const t=this.backend,r=t.device,s=e.buffer,i=t.get(e).buffer;r.queue.writeBuffer(i,0,s,0)}createBindGroupIndex(e,t){const r=this.backend.device,s=GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,i=e[0],n=r.createBuffer({label:"bindingCameraIndex_"+i,size:16,usage:s});r.queue.writeBuffer(n,0,e,0);const a=[{binding:0,resource:{buffer:n}}];return r.createBindGroup({label:"bindGroupCameraIndex_"+i,layout:t,entries:a})}createBindGroup(e,t){const r=this.backend,s=r.device;let i=0;const n=[];for(const t of e.bindings){if(t.isUniformBuffer){const e=r.get(t);if(void 0===e.buffer){const r=t.byteLength,i=GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,n=s.createBuffer({label:"bindingBuffer_"+t.name,size:r,usage:i});e.buffer=n}n.push({binding:i,resource:{buffer:e.buffer}})}else if(t.isStorageBuffer){const e=r.get(t);if(void 0===e.buffer){const s=t.attribute;e.buffer=r.get(s).buffer}n.push({binding:i,resource:{buffer:e.buffer}})}else if(t.isSampler){const e=r.get(t.texture);n.push({binding:i,resource:e.sampler})}else if(t.isSampledTexture){const e=r.get(t.texture);let a;if(void 0!==e.externalTexture)a=s.importExternalTexture({source:e.externalTexture});else{const r=t.store?1:e.texture.mipLevelCount,s=`view-${e.texture.width}-${e.texture.height}-${r}`;if(a=e[s],void 0===a){const i=Ew;let n;n=t.isSampledCubeTexture?Nw:t.isSampledTexture3D?Sw:t.texture.isArrayTexture||t.texture.isDataArrayTexture||t.texture.isCompressedArrayTexture?vw:_w,a=e[s]=e.texture.createView({aspect:i,dimension:n,mipLevelCount:r})}}n.push({binding:i,resource:a})}i++}return s.createBindGroup({label:"bindGroup_"+e.name,layout:t,entries:n})}}class uA{constructor(e){this.backend=e,this._activePipelines=new WeakMap}setPipeline(e,t){this._activePipelines.get(e)!==t&&(e.setPipeline(t),this._activePipelines.set(e,t))}_getSampleCount(e){return this.backend.utils.getSampleCountRenderContext(e)}createRenderPipeline(e,t){const{object:r,material:s,geometry:i,pipeline:n}=e,{vertexProgram:a,fragmentProgram:o}=n,u=this.backend,l=u.device,d=u.utils,c=u.get(n),h=[];for(const t of e.getBindings()){const e=u.get(t);h.push(e.layout)}const p=u.attributeUtils.createShaderVertexBuffers(e);let g;s.blending===z||s.blending===O&&!1===s.transparent||(g=this._getBlending(s));let m={};!0===s.stencilWrite&&(m={compare:this._getStencilCompare(s),failOp:this._getStencilOperation(s.stencilFail),depthFailOp:this._getStencilOperation(s.stencilZFail),passOp:this._getStencilOperation(s.stencilZPass)});const f=this._getColorWriteMask(s),y=[];if(null!==e.context.textures){const t=e.context.textures;for(let e=0;e1},layout:l.createPipelineLayout({bindGroupLayouts:h})},E={},w=e.context.depth,A=e.context.stencil;if(!0!==w&&!0!==A||(!0===w&&(E.format=v,E.depthWriteEnabled=s.depthWrite,E.depthCompare=_),!0===A&&(E.stencilFront=m,E.stencilBack={},E.stencilReadMask=s.stencilFuncMask,E.stencilWriteMask=s.stencilWriteMask),!0===s.polygonOffset&&(E.depthBias=s.polygonOffsetUnits,E.depthBiasSlopeScale=s.polygonOffsetFactor,E.depthBiasClamp=0),S.depthStencil=E),null===t)c.pipeline=l.createRenderPipeline(S);else{const e=new Promise((e=>{l.createRenderPipelineAsync(S).then((t=>{c.pipeline=t,e()}))}));t.push(e)}}createBundleEncoder(e,t="renderBundleEncoder"){const r=this.backend,{utils:s,device:i}=r,n=s.getCurrentDepthStencilFormat(e),a={label:t,colorFormats:[s.getCurrentColorFormat(e)],depthStencilFormat:n,sampleCount:this._getSampleCount(e)};return i.createRenderBundleEncoder(a)}createComputePipeline(e,t){const r=this.backend,s=r.device,i=r.get(e.computeProgram).module,n=r.get(e),a=[];for(const e of t){const t=r.get(e);a.push(t.layout)}n.pipeline=s.createComputePipeline({compute:i,layout:s.createPipelineLayout({bindGroupLayouts:a})})}_getBlending(e){let t,r;const s=e.blending,i=e.blendSrc,n=e.blendDst,a=e.blendEquation;if(s===qe){const s=null!==e.blendSrcAlpha?e.blendSrcAlpha:i,o=null!==e.blendDstAlpha?e.blendDstAlpha:n,u=null!==e.blendEquationAlpha?e.blendEquationAlpha:a;t={srcFactor:this._getBlendFactor(i),dstFactor:this._getBlendFactor(n),operation:this._getBlendOperation(a)},r={srcFactor:this._getBlendFactor(s),dstFactor:this._getBlendFactor(o),operation:this._getBlendOperation(u)}}else{const i=(e,s,i,n)=>{t={srcFactor:e,dstFactor:s,operation:jE},r={srcFactor:i,dstFactor:n,operation:jE}};if(e.premultipliedAlpha)switch(s){case O:i(BE,UE,BE,UE);break;case Lt:i(BE,BE,BE,BE);break;case Pt:i(FE,DE,FE,BE);break;case Mt:i(FE,IE,FE,VE)}else switch(s){case O:i(VE,UE,BE,UE);break;case Lt:i(VE,BE,VE,BE);break;case Pt:i(FE,DE,FE,BE);break;case Mt:i(FE,IE,FE,IE)}}if(void 0!==t&&void 0!==r)return{color:t,alpha:r};console.error("THREE.WebGPURenderer: Invalid blending: ",s)}_getBlendFactor(e){let t;switch(e){case Ke:t=FE;break;case wt:t=BE;break;case Et:t=IE;break;case Tt:t=DE;break;case St:t=VE;break;case xt:t=UE;break;case vt:t=OE;break;case bt:t=kE;break;case _t:t=GE;break;case yt:t=zE;break;case Nt:t=HE;break;case 211:t=$E;break;case 212:t=WE;break;default:console.error("THREE.WebGPURenderer: Blend factor not supported.",e)}return t}_getStencilCompare(e){let t;const r=e.stencilFunc;switch(r){case kr:t=wN;break;case Or:t=FN;break;case Ur:t=AN;break;case Vr:t=CN;break;case Dr:t=RN;break;case Ir:t=LN;break;case Br:t=MN;break;case Fr:t=PN;break;default:console.error("THREE.WebGPURenderer: Invalid stencil function.",r)}return t}_getStencilOperation(e){let t;switch(e){case Xr:t=JE;break;case qr:t=ew;break;case jr:t=tw;break;case Wr:t=rw;break;case $r:t=sw;break;case Hr:t=iw;break;case zr:t=nw;break;case Gr:t=aw;break;default:console.error("THREE.WebGPURenderer: Invalid stencil operation.",t)}return t}_getBlendOperation(e){let t;switch(e){case Xe:t=jE;break;case ft:t=qE;break;case mt:t=XE;break;case Yr:t=KE;break;case Kr:t=YE;break;default:console.error("THREE.WebGPUPipelineUtils: Blend equation not supported.",e)}return t}_getPrimitiveState(e,t,r){const s={},i=this.backend.utils;switch(s.topology=i.getPrimitiveTopology(e,r),null!==t.index&&!0===e.isLine&&!0!==e.isLineSegments&&(s.stripIndexFormat=t.index.array instanceof Uint16Array?GN:zN),r.side){case je:s.frontFace=VN,s.cullMode=kN;break;case S:s.frontFace=VN,s.cullMode=ON;break;case Se:s.frontFace=VN,s.cullMode=UN;break;default:console.error("THREE.WebGPUPipelineUtils: Unknown material.side value.",r.side)}return s}_getColorWriteMask(e){return!0===e.colorWrite?ZE:QE}_getDepthCompare(e){let t;if(!1===e.depthTest)t=FN;else{const r=e.depthFunc;switch(r){case kt:t=wN;break;case Ot:t=FN;break;case Ut:t=AN;break;case Vt:t=CN;break;case Dt:t=RN;break;case It:t=LN;break;case Bt:t=MN;break;case Ft:t=PN;break;default:console.error("THREE.WebGPUPipelineUtils: Invalid depth function.",r)}}return t}}class lA extends yN{constructor(e,t,r=2048){super(r),this.device=e,this.type=t,this.querySet=this.device.createQuerySet({type:"timestamp",count:this.maxQueries,label:`queryset_global_timestamp_${t}`});const s=8*this.maxQueries;this.resolveBuffer=this.device.createBuffer({label:`buffer_timestamp_resolve_${t}`,size:s,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),this.resultBuffer=this.device.createBuffer({label:`buffer_timestamp_result_${t}`,size:s,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ})}allocateQueriesForContext(e){if(!this.trackTimestamp||this.isDisposed)return null;if(this.currentQueryIndex+2>this.maxQueries)return pt(`WebGPUTimestampQueryPool [${this.type}]: Maximum number of queries exceeded, when using trackTimestamp it is necessary to resolves the queries via renderer.resolveTimestampsAsync( THREE.TimestampQuery.${this.type.toUpperCase()} ).`),null;const t=this.currentQueryIndex;return this.currentQueryIndex+=2,this.queryOffsets.set(e.id,t),t}async resolveQueriesAsync(){if(!this.trackTimestamp||0===this.currentQueryIndex||this.isDisposed)return this.lastValue;if(this.pendingResolve)return this.pendingResolve;this.pendingResolve=this._resolveQueries();try{return await this.pendingResolve}finally{this.pendingResolve=null}}async _resolveQueries(){if(this.isDisposed)return this.lastValue;try{if("unmapped"!==this.resultBuffer.mapState)return this.lastValue;const e=new Map(this.queryOffsets),t=this.currentQueryIndex,r=8*t;this.currentQueryIndex=0,this.queryOffsets.clear();const s=this.device.createCommandEncoder();s.resolveQuerySet(this.querySet,0,t,this.resolveBuffer,0),s.copyBufferToBuffer(this.resolveBuffer,0,this.resultBuffer,0,r);const i=s.finish();if(this.device.queue.submit([i]),"unmapped"!==this.resultBuffer.mapState)return this.lastValue;if(await this.resultBuffer.mapAsync(GPUMapMode.READ,0,r),this.isDisposed)return"mapped"===this.resultBuffer.mapState&&this.resultBuffer.unmap(),this.lastValue;const n=new BigUint64Array(this.resultBuffer.getMappedRange(0,r));let a=0;for(const[,t]of e){const e=n[t],r=n[t+1];a+=Number(r-e)/1e6}return this.resultBuffer.unmap(),this.lastValue=a,a}catch(e){return console.error("Error resolving queries:",e),"mapped"===this.resultBuffer.mapState&&this.resultBuffer.unmap(),this.lastValue}}async dispose(){if(!this.isDisposed){if(this.isDisposed=!0,this.pendingResolve)try{await this.pendingResolve}catch(e){console.error("Error waiting for pending resolve:",e)}if(this.resultBuffer&&"mapped"===this.resultBuffer.mapState)try{this.resultBuffer.unmap()}catch(e){console.error("Error unmapping buffer:",e)}this.querySet&&(this.querySet.destroy(),this.querySet=null),this.resolveBuffer&&(this.resolveBuffer.destroy(),this.resolveBuffer=null),this.resultBuffer&&(this.resultBuffer.destroy(),this.resultBuffer=null),this.queryOffsets.clear(),this.pendingResolve=null}}}class dA extends Jv{constructor(e={}){super(e),this.isWebGPUBackend=!0,this.parameters.alpha=void 0===e.alpha||e.alpha,this.parameters.compatibilityMode=void 0!==e.compatibilityMode&&e.compatibilityMode,this.parameters.requiredLimits=void 0===e.requiredLimits?{}:e.requiredLimits,this.compatibilityMode=this.parameters.compatibilityMode,this.device=null,this.context=null,this.colorBuffer=null,this.defaultRenderPassdescriptor=null,this.utils=new rA(this),this.attributeUtils=new aA(this),this.bindingUtils=new oA(this),this.pipelineUtils=new uA(this),this.textureUtils=new Vw(this),this.occludedResolveCache=new Map}async init(e){await super.init(e);const t=this.parameters;let r;if(void 0===t.device){const e={powerPreference:t.powerPreference,featureLevel:t.compatibilityMode?"compatibility":void 0},s="undefined"!=typeof navigator?await navigator.gpu.requestAdapter(e):null;if(null===s)throw new Error("WebGPUBackend: Unable to create WebGPU adapter.");const i=Object.values(Rw),n=[];for(const e of i)s.features.has(e)&&n.push(e);const a={requiredFeatures:n,requiredLimits:t.requiredLimits};r=await s.requestDevice(a)}else r=t.device;r.lost.then((t=>{const r={api:"WebGPU",message:t.message||"Unknown reason",reason:t.reason||null,originalEvent:t};e.onDeviceLost(r)}));const s=void 0!==t.context?t.context:e.domElement.getContext("webgpu");this.device=r,this.context=s;const i=t.alpha?"premultiplied":"opaque";this.trackTimestamp=this.trackTimestamp&&this.hasFeature(Rw.TimestampQuery),this.context.configure({device:this.device,format:this.utils.getPreferredCanvasFormat(),usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,alphaMode:i}),this.updateSize()}get coordinateSystem(){return d}async getArrayBufferAsync(e){return await this.attributeUtils.getArrayBufferAsync(e)}getContext(){return this.context}_getDefaultRenderPassDescriptor(){let e=this.defaultRenderPassdescriptor;if(null===e){const t=this.renderer;e={colorAttachments:[{view:null}]},!0!==this.renderer.depth&&!0!==this.renderer.stencil||(e.depthStencilAttachment={view:this.textureUtils.getDepthBuffer(t.depth,t.stencil).createView()});const r=e.colorAttachments[0];this.renderer.samples>0?r.view=this.colorBuffer.createView():r.resolveTarget=void 0,this.defaultRenderPassdescriptor=e}const t=e.colorAttachments[0];return this.renderer.samples>0?t.resolveTarget=this.context.getCurrentTexture().createView():t.view=this.context.getCurrentTexture().createView(),e}_isRenderCameraDepthArray(e){return e.depthTexture&&e.depthTexture.image.depth>1&&e.camera.isArrayCamera}_getRenderPassDescriptor(e,t={}){const r=e.renderTarget,s=this.get(r);let i=s.descriptors;if(void 0===i||s.width!==r.width||s.height!==r.height||s.dimensions!==r.dimensions||s.activeMipmapLevel!==e.activeMipmapLevel||s.activeCubeFace!==e.activeCubeFace||s.samples!==r.samples){i={},s.descriptors=i;const e=()=>{r.removeEventListener("dispose",e),this.delete(r)};!1===r.hasEventListener("dispose",e)&&r.addEventListener("dispose",e)}const n=e.getCacheKey();let a=i[n];if(void 0===a){const t=e.textures,o=[];let u;const l=this._isRenderCameraDepthArray(e);for(let s=0;s1)if(!0===l){const t=e.camera.cameras;for(let e=0;e0&&(t.currentOcclusionQuerySet&&t.currentOcclusionQuerySet.destroy(),t.currentOcclusionQueryBuffer&&t.currentOcclusionQueryBuffer.destroy(),t.currentOcclusionQuerySet=t.occlusionQuerySet,t.currentOcclusionQueryBuffer=t.occlusionQueryBuffer,t.currentOcclusionQueryObjects=t.occlusionQueryObjects,i=r.createQuerySet({type:"occlusion",count:s,label:`occlusionQuerySet_${e.id}`}),t.occlusionQuerySet=i,t.occlusionQueryIndex=0,t.occlusionQueryObjects=new Array(s),t.lastOcclusionObject=null),n=null===e.textures?this._getDefaultRenderPassDescriptor():this._getRenderPassDescriptor(e,{loadOp:IN}),this.initTimestampQuery(e,n),n.occlusionQuerySet=i;const a=n.depthStencilAttachment;if(null!==e.textures){const t=n.colorAttachments;for(let r=0;r0&&t.currentPass.executeBundles(t.renderBundles),r>t.occlusionQueryIndex&&t.currentPass.endOcclusionQuery();const s=t.encoder;if(!0===this._isRenderCameraDepthArray(e)){const r=[];for(let e=0;e0){const s=8*r;let i=this.occludedResolveCache.get(s);void 0===i&&(i=this.device.createBuffer({size:s,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),this.occludedResolveCache.set(s,i));const n=this.device.createBuffer({size:s,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});t.encoder.resolveQuerySet(t.occlusionQuerySet,0,r,i,0),t.encoder.copyBufferToBuffer(i,0,n,0,s),t.occlusionQueryBuffer=n,this.resolveOccludedAsync(e)}if(this.device.queue.submit([t.encoder.finish()]),null!==e.textures){const t=e.textures;for(let e=0;ea?(u.x=Math.min(t.dispatchCount,a),u.y=Math.ceil(t.dispatchCount/a)):u.x=t.dispatchCount,i.dispatchWorkgroups(u.x,u.y,u.z)}finishCompute(e){const t=this.get(e);t.passEncoderGPU.end(),this.device.queue.submit([t.cmdEncoderGPU.finish()])}async waitForGPU(){await this.device.queue.onSubmittedWorkDone()}draw(e,t){const{object:r,material:s,context:i,pipeline:n}=e,a=e.getBindings(),o=this.get(i),u=this.get(n).pipeline,l=e.getIndex(),d=null!==l,c=e.getDrawParameters();if(null===c)return;const h=(t,r)=>{this.pipelineUtils.setPipeline(t,u),r.pipeline=u;const n=r.bindingGroups;for(let e=0,r=a.length;e{if(h(s,i),!0===r.isBatchedMesh){const e=r._multiDrawStarts,i=r._multiDrawCounts,n=r._multiDrawCount,a=r._multiDrawInstances;null!==a&&pt("THREE.WebGPUBackend: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.");for(let o=0;o1?0:o;!0===d?s.drawIndexed(i[o],n,e[o]/l.array.BYTES_PER_ELEMENT,0,u):s.draw(i[o],n,e[o],u),t.update(r,i[o],n)}}else if(!0===d){const{vertexCount:i,instanceCount:n,firstVertex:a}=c,o=e.getIndirect();if(null!==o){const e=this.get(o).buffer;s.drawIndexedIndirect(e,0)}else s.drawIndexed(i,n,a,0,0);t.update(r,i,n)}else{const{vertexCount:i,instanceCount:n,firstVertex:a}=c,o=e.getIndirect();if(null!==o){const e=this.get(o).buffer;s.drawIndirect(e,0)}else s.draw(i,n,a,0);t.update(r,i,n)}};if(e.camera.isArrayCamera&&e.camera.cameras.length>0){const t=this.get(e.camera),s=e.camera.cameras,n=e.getBindingGroup("cameraIndex");if(void 0===t.indexesGPU||t.indexesGPU.length!==s.length){const e=this.get(n),r=[],i=new Uint32Array([0,0,0,0]);for(let t=0,n=s.length;t(console.warn("THREE.WebGPURenderer: WebGPU is not available, running under WebGL2 backend."),new TN(e)));super(new t(e),e),this.library=new pA,this.isWebGPURenderer=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}}class mA extends ds{constructor(){super(),this.isBundleGroup=!0,this.type="BundleGroup",this.static=!0,this.version=0}set needsUpdate(e){!0===e&&this.version++}}class fA{constructor(e,t=nn(0,0,1,1)){this.renderer=e,this.outputNode=t,this.outputColorTransform=!0,this.needsUpdate=!0;const r=new Zh;r.name="PostProcessing",this._quadMesh=new Cy(r)}render(){this._update();const e=this.renderer,t=e.toneMapping,r=e.outputColorSpace;e.toneMapping=p,e.outputColorSpace=ue;const s=e.xr.enabled;e.xr.enabled=!1,this._quadMesh.render(e),e.xr.enabled=s,e.toneMapping=t,e.outputColorSpace=r}dispose(){this._quadMesh.material.dispose()}_update(){if(!0===this.needsUpdate){const e=this.renderer,t=e.toneMapping,r=e.outputColorSpace;this._quadMesh.material.fragmentNode=!0===this.outputColorTransform?Ou(this.outputNode,t,r):this.outputNode.context({toneMapping:t,outputColorSpace:r}),this._quadMesh.material.needsUpdate=!0,this.needsUpdate=!1}}async renderAsync(){this._update();const e=this.renderer,t=e.toneMapping,r=e.outputColorSpace;e.toneMapping=p,e.outputColorSpace=ue;const s=e.xr.enabled;e.xr.enabled=!1,await this._quadMesh.renderAsync(e),e.xr.enabled=s,e.toneMapping=t,e.outputColorSpace=r}}class yA extends x{constructor(e=1,t=1){super(),this.image={width:e,height:t},this.magFilter=K,this.minFilter=K,this.isStorageTexture=!0}}class bA extends Vy{constructor(e,t){super(e,t,Uint32Array),this.isIndirectStorageBufferAttribute=!0}}class xA extends cs{constructor(e){super(e),this.textures={},this.nodes={}}load(e,t,r,s){const i=new hs(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,(r=>{try{t(this.parse(JSON.parse(r)))}catch(t){s?s(t):console.error(t),this.manager.itemError(e)}}),r,s)}parseNodes(e){const t={};if(void 0!==e){for(const r of e){const{uuid:e,type:s}=r;t[e]=this.createNodeFromType(s),t[e].uuid=e}const r={nodes:t,textures:this.textures};for(const s of e){s.meta=r;t[s.uuid].deserialize(s),delete s.meta}}return t}parse(e){const t=this.createNodeFromType(e.type);t.uuid=e.uuid;const r={nodes:this.parseNodes(e.nodes),textures:this.textures};return e.meta=r,t.deserialize(e),delete e.meta,t}setTextures(e){return this.textures=e,this}setNodes(e){return this.nodes=e,this}createNodeFromType(e){return void 0===this.nodes[e]?(console.error("THREE.NodeLoader: Node type not found:",e),ji()):Bi(new this.nodes[e])}}class TA extends ps{constructor(e){super(e),this.nodes={},this.nodeMaterials={}}parse(e){const t=super.parse(e),r=this.nodes,s=e.inputNodes;for(const e in s){const i=s[e];t[e]=r[i]}return t}setNodes(e){return this.nodes=e,this}setNodeMaterials(e){return this.nodeMaterials=e,this}createMaterialFromType(e){const t=this.nodeMaterials[e];return void 0!==t?new t:super.createMaterialFromType(e)}}class _A extends gs{constructor(e){super(e),this.nodes={},this.nodeMaterials={},this._nodesJSON=null}setNodes(e){return this.nodes=e,this}setNodeMaterials(e){return this.nodeMaterials=e,this}parse(e,t){this._nodesJSON=e.nodes;const r=super.parse(e,t);return this._nodesJSON=null,r}parseNodes(e,t){if(void 0!==e){const r=new xA;return r.setNodes(this.nodes),r.setTextures(t),r.parseNodes(e)}return{}}parseMaterials(e,t){const r={};if(void 0!==e){const s=this.parseNodes(this._nodesJSON,t),i=new TA;i.setTextures(t),i.setNodes(s),i.setNodeMaterials(this.nodeMaterials);for(let t=0,s=e.length;t nodeObject( new VertexColorNode( index ) ); +/** + * Represents a "Color Burn" blend mode. + * + * It's designed to darken the base layer's colors based on the color of the blend layer. + * It significantly increases the contrast of the base layer, making the colors more vibrant and saturated. + * The darker the color in the blend layer, the stronger the darkening and contrast effect on the base layer. + * + * @tsl + * @function + * @param {Node} base - The base color. + * @param {Node} blend - The blend color. A white (#ffffff) blend color does not alter the base color. + * @return {Node} The result. + */ +const blendBurn = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { + + return min$1( 1.0, base.oneMinus().div( blend ) ).oneMinus(); + +} ).setLayout( { + name: 'blendBurn', + type: 'vec3', + inputs: [ + { name: 'base', type: 'vec3' }, + { name: 'blend', type: 'vec3' } + ] +} ); + +/** + * Represents a "Color Dodge" blend mode. + * + * It's designed to lighten the base layer's colors based on the color of the blend layer. + * It significantly increases the brightness of the base layer, making the colors lighter and more vibrant. + * The brighter the color in the blend layer, the stronger the lightening and contrast effect on the base layer. + * + * @tsl + * @function + * @param {Node} base - The base color. + * @param {Node} blend - The blend color. A black (#000000) blend color does not alter the base color. + * @return {Node} The result. + */ +const blendDodge = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { + + return min$1( base.div( blend.oneMinus() ), 1.0 ); + +} ).setLayout( { + name: 'blendDodge', + type: 'vec3', + inputs: [ + { name: 'base', type: 'vec3' }, + { name: 'blend', type: 'vec3' } + ] +} ); + +/** + * Represents a "Screen" blend mode. + * + * Similar to `blendDodge()`, this mode also lightens the base layer's colors based on the color of the blend layer. + * The "Screen" blend mode is better for general brightening whereas the "Dodge" results in more subtle and nuanced + * effects. + * + * @tsl + * @function + * @param {Node} base - The base color. + * @param {Node} blend - The blend color. A black (#000000) blend color does not alter the base color. + * @return {Node} The result. + */ +const blendScreen = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { + + return base.oneMinus().mul( blend.oneMinus() ).oneMinus(); + +} ).setLayout( { + name: 'blendScreen', + type: 'vec3', + inputs: [ + { name: 'base', type: 'vec3' }, + { name: 'blend', type: 'vec3' } + ] +} ); + +/** + * Represents a "Overlay" blend mode. + * + * It's designed to increase the contrast of the base layer based on the color of the blend layer. + * It amplifies the existing colors and contrast in the base layer, making lighter areas lighter and darker areas darker. + * The color of the blend layer significantly influences the resulting contrast and color shift in the base layer. + * + * @tsl + * @function + * @param {Node} base - The base color. + * @param {Node} blend - The blend color + * @return {Node} The result. + */ +const blendOverlay = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { + + return mix( base.mul( 2.0 ).mul( blend ), base.oneMinus().mul( 2.0 ).mul( blend.oneMinus() ).oneMinus(), step( 0.5, base ) ); + +} ).setLayout( { + name: 'blendOverlay', + type: 'vec3', + inputs: [ + { name: 'base', type: 'vec3' }, + { name: 'blend', type: 'vec3' } + ] +} ); + +/** + * This function blends two color based on their alpha values by replicating the behavior of `THREE.NormalBlending`. + * It assumes both input colors have non-premultiplied alpha. + * + * @tsl + * @function + * @param {Node} base - The base color. + * @param {Node} blend - The blend color + * @return {Node} The result. + */ +const blendColor = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { + + const outAlpha = blend.a.add( base.a.mul( blend.a.oneMinus() ) ); + + return vec4( blend.rgb.mul( blend.a ).add( base.rgb.mul( base.a ).mul( blend.a.oneMinus() ) ).div( outAlpha ), outAlpha ); + +} ).setLayout( { + name: 'blendColor', + type: 'vec4', + inputs: [ + { name: 'base', type: 'vec4' }, + { name: 'blend', type: 'vec4' } + ] +} ); + +/** + * Premultiplies the RGB channels of a color by its alpha channel. + * + * This function is useful for converting a non-premultiplied alpha color + * into a premultiplied alpha format, where the RGB values are scaled + * by the alpha value. Premultiplied alpha is often used in graphics + * rendering for certain operations, such as compositing and image processing. + * + * @tsl + * @function + * @param {Node} color - The input color with non-premultiplied alpha. + * @return {Node} The color with premultiplied alpha. + */ +const premultiplyAlpha = /*@__PURE__*/ Fn( ( [ color ] ) => { + + return vec4( color.rgb.mul( color.a ), color.a ); + +}, { color: 'vec4', return: 'vec4' } ); + +/** + * Unpremultiplies the RGB channels of a color by its alpha channel. + * + * This function is useful for converting a premultiplied alpha color + * back into a non-premultiplied alpha format, where the RGB values are + * divided by the alpha value. Unpremultiplied alpha is often used in graphics + * rendering for certain operations, such as compositing and image processing. + * + * @tsl + * @function + * @param {Node} color - The input color with premultiplied alpha. + * @return {Node} The color with non-premultiplied alpha. + */ +const unpremultiplyAlpha = /*@__PURE__*/ Fn( ( [ color ] ) => { + + If( color.a.equal( 0.0 ), () => vec4( 0.0 ) ); + + return vec4( color.rgb.div( color.a ), color.a ); + +}, { color: 'vec4', return: 'vec4' } ); + + +// Deprecated + +/** + * @tsl + * @function + * @deprecated since r171. Use {@link blendBurn} instead. + * + * @param {...any} params + * @returns {Function} + */ +const burn = ( ...params ) => { // @deprecated, r171 + + console.warn( 'THREE.TSL: "burn" has been renamed. Use "blendBurn" instead.' ); + return blendBurn( params ); + +}; + +/** + * @tsl + * @function + * @deprecated since r171. Use {@link blendDodge} instead. + * + * @param {...any} params + * @returns {Function} + */ +const dodge = ( ...params ) => { // @deprecated, r171 + + console.warn( 'THREE.TSL: "dodge" has been renamed. Use "blendDodge" instead.' ); + return blendDodge( params ); + +}; + +/** + * @tsl + * @function + * @deprecated since r171. Use {@link blendScreen} instead. + * + * @param {...any} params + * @returns {Function} + */ +const screen = ( ...params ) => { // @deprecated, r171 + + console.warn( 'THREE.TSL: "screen" has been renamed. Use "blendScreen" instead.' ); + return blendScreen( params ); + +}; + +/** + * @tsl + * @function + * @deprecated since r171. Use {@link blendOverlay} instead. + * + * @param {...any} params + * @returns {Function} + */ +const overlay = ( ...params ) => { // @deprecated, r171 + + console.warn( 'THREE.TSL: "overlay" has been renamed. Use "blendOverlay" instead.' ); + return blendOverlay( params ); + +}; + /** * Base class for all node materials. * @@ -18629,6 +18861,19 @@ class NodeMaterial extends Material { } + /** + * Setups premultiplied alpha. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {Node} outputNode - The existing output node. + * @return {Node} The output node. + */ + setupPremultipliedAlpha( builder, outputNode ) { + + return premultiplyAlpha( outputNode ); + + } + /** * Setups the output node. * @@ -18646,6 +18891,14 @@ class NodeMaterial extends Material { } + // PREMULTIPLIED ALPHA + + if ( this.premultipliedAlpha === true ) { + + outputNode = this.setupPremultipliedAlpha( builder, outputNode ); + + } + return outputNode; } @@ -25986,6 +26239,16 @@ class RenderObject { */ this.attributes = null; + /** + * An object holding the version of the + * attributes. The keys are the attribute names + * and the values are the attribute versions. + * + * @type {?Object} + * @default null + */ + this.attributesId = null; + /** * A reference to a render pipeline the render * object is processed with. @@ -26105,7 +26368,7 @@ class RenderObject { /** * An event listener which is executed when `dispose()` is called on - * the render object's material. + * the material of this render object. * * @method */ @@ -26115,7 +26378,23 @@ class RenderObject { }; + /** + * An event listener which is executed when `dispose()` is called on + * the geometry of this render object. + * + * @method + */ + this.onGeometryDispose = () => { + + // clear geometry cache attributes + + this.attributes = null; + this.attributesId = null; + + }; + this.material.addEventListener( 'dispose', this.onMaterialDispose ); + this.geometry.addEventListener( 'dispose', this.onGeometryDispose ); } @@ -26254,6 +26533,7 @@ class RenderObject { this.geometry = geometry; this.attributes = null; + this.attributesId = null; } @@ -26273,9 +26553,25 @@ class RenderObject { const attributes = []; const vertexBuffers = new Set(); + const attributesId = {}; + for ( const nodeAttribute of nodeAttributes ) { - const attribute = nodeAttribute.node && nodeAttribute.node.attribute ? nodeAttribute.node.attribute : geometry.getAttribute( nodeAttribute.name ); + let attribute; + + if ( nodeAttribute.node && nodeAttribute.node.attribute ) { + + // node attribute + attribute = nodeAttribute.node.attribute; + + } else { + + // geometry attribute + attribute = geometry.getAttribute( nodeAttribute.name ); + + attributesId[ nodeAttribute.name ] = attribute.version; + + } if ( attribute === undefined ) continue; @@ -26287,6 +26583,7 @@ class RenderObject { } this.attributes = attributes; + this.attributesId = attributesId; this.vertexBuffers = Array.from( vertexBuffers.values() ); return attributes; @@ -26551,7 +26848,27 @@ class RenderObject { */ get needsGeometryUpdate() { - return this.geometry.id !== this.object.geometry.id; + if ( this.geometry.id !== this.object.geometry.id ) return true; + + if ( this.attributes !== null ) { + + const attributesId = this.attributesId; + + for ( const name in attributesId ) { + + const attribute = this.geometry.getAttribute( name ); + + if ( attribute === undefined || attributesId[ name ] !== attribute.id ) { + + return true; + + } + + } + + } + + return false; } @@ -26629,6 +26946,7 @@ class RenderObject { dispose() { this.material.removeEventListener( 'dispose', this.onMaterialDispose ); + this.geometry.removeEventListener( 'dispose', this.onGeometryDispose ); this.onDispose(); @@ -33550,238 +33868,6 @@ function getPreviousMatrix( object, index = 0 ) { */ const velocity = /*@__PURE__*/ nodeImmutable( VelocityNode ); -/** - * Represents a "Color Burn" blend mode. - * - * It's designed to darken the base layer's colors based on the color of the blend layer. - * It significantly increases the contrast of the base layer, making the colors more vibrant and saturated. - * The darker the color in the blend layer, the stronger the darkening and contrast effect on the base layer. - * - * @tsl - * @function - * @param {Node} base - The base color. - * @param {Node} blend - The blend color. A white (#ffffff) blend color does not alter the base color. - * @return {Node} The result. - */ -const blendBurn = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { - - return min$1( 1.0, base.oneMinus().div( blend ) ).oneMinus(); - -} ).setLayout( { - name: 'blendBurn', - type: 'vec3', - inputs: [ - { name: 'base', type: 'vec3' }, - { name: 'blend', type: 'vec3' } - ] -} ); - -/** - * Represents a "Color Dodge" blend mode. - * - * It's designed to lighten the base layer's colors based on the color of the blend layer. - * It significantly increases the brightness of the base layer, making the colors lighter and more vibrant. - * The brighter the color in the blend layer, the stronger the lightening and contrast effect on the base layer. - * - * @tsl - * @function - * @param {Node} base - The base color. - * @param {Node} blend - The blend color. A black (#000000) blend color does not alter the base color. - * @return {Node} The result. - */ -const blendDodge = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { - - return min$1( base.div( blend.oneMinus() ), 1.0 ); - -} ).setLayout( { - name: 'blendDodge', - type: 'vec3', - inputs: [ - { name: 'base', type: 'vec3' }, - { name: 'blend', type: 'vec3' } - ] -} ); - -/** - * Represents a "Screen" blend mode. - * - * Similar to `blendDodge()`, this mode also lightens the base layer's colors based on the color of the blend layer. - * The "Screen" blend mode is better for general brightening whereas the "Dodge" results in more subtle and nuanced - * effects. - * - * @tsl - * @function - * @param {Node} base - The base color. - * @param {Node} blend - The blend color. A black (#000000) blend color does not alter the base color. - * @return {Node} The result. - */ -const blendScreen = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { - - return base.oneMinus().mul( blend.oneMinus() ).oneMinus(); - -} ).setLayout( { - name: 'blendScreen', - type: 'vec3', - inputs: [ - { name: 'base', type: 'vec3' }, - { name: 'blend', type: 'vec3' } - ] -} ); - -/** - * Represents a "Overlay" blend mode. - * - * It's designed to increase the contrast of the base layer based on the color of the blend layer. - * It amplifies the existing colors and contrast in the base layer, making lighter areas lighter and darker areas darker. - * The color of the blend layer significantly influences the resulting contrast and color shift in the base layer. - * - * @tsl - * @function - * @param {Node} base - The base color. - * @param {Node} blend - The blend color - * @return {Node} The result. - */ -const blendOverlay = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { - - return mix( base.mul( 2.0 ).mul( blend ), base.oneMinus().mul( 2.0 ).mul( blend.oneMinus() ).oneMinus(), step( 0.5, base ) ); - -} ).setLayout( { - name: 'blendOverlay', - type: 'vec3', - inputs: [ - { name: 'base', type: 'vec3' }, - { name: 'blend', type: 'vec3' } - ] -} ); - -/** - * This function blends two color based on their alpha values by replicating the behavior of `THREE.NormalBlending`. - * It assumes both input colors have non-premultiplied alpha. - * - * @tsl - * @function - * @param {Node} base - The base color. - * @param {Node} blend - The blend color - * @return {Node} The result. - */ -const blendColor = /*@__PURE__*/ Fn( ( [ base, blend ] ) => { - - const outAlpha = blend.a.add( base.a.mul( blend.a.oneMinus() ) ); - - return vec4( blend.rgb.mul( blend.a ).add( base.rgb.mul( base.a ).mul( blend.a.oneMinus() ) ).div( outAlpha ), outAlpha ); - -} ).setLayout( { - name: 'blendColor', - type: 'vec4', - inputs: [ - { name: 'base', type: 'vec4' }, - { name: 'blend', type: 'vec4' } - ] -} ); - -/** - * Premultiplies the RGB channels of a color by its alpha channel. - * - * This function is useful for converting a non-premultiplied alpha color - * into a premultiplied alpha format, where the RGB values are scaled - * by the alpha value. Premultiplied alpha is often used in graphics - * rendering for certain operations, such as compositing and image processing. - * - * @tsl - * @function - * @param {Node} color - The input color with non-premultiplied alpha. - * @return {Node} The color with premultiplied alpha. - */ -const premult = /*@__PURE__*/ Fn( ( [ color ] ) => { - - return vec4( color.rgb.mul( color.a ), color.a ); - -}, { color: 'vec4', return: 'vec4' } ); - -/** - * Unpremultiplies the RGB channels of a color by its alpha channel. - * - * This function is useful for converting a premultiplied alpha color - * back into a non-premultiplied alpha format, where the RGB values are - * divided by the alpha value. Unpremultiplied alpha is often used in graphics - * rendering for certain operations, such as compositing and image processing. - * - * @tsl - * @function - * @param {Node} color - The input color with premultiplied alpha. - * @return {Node} The color with non-premultiplied alpha. - */ -const unpremult = /*@__PURE__*/ Fn( ( [ color ] ) => { - - If( color.a.equal( 0.0 ), () => vec4( 0.0 ) ); - - return vec4( color.rgb.div( color.a ), color.a ); - -}, { color: 'vec4', return: 'vec4' } ); - - -// Deprecated - -/** - * @tsl - * @function - * @deprecated since r171. Use {@link blendBurn} instead. - * - * @param {...any} params - * @returns {Function} - */ -const burn = ( ...params ) => { // @deprecated, r171 - - console.warn( 'THREE.TSL: "burn" has been renamed. Use "blendBurn" instead.' ); - return blendBurn( params ); - -}; - -/** - * @tsl - * @function - * @deprecated since r171. Use {@link blendDodge} instead. - * - * @param {...any} params - * @returns {Function} - */ -const dodge = ( ...params ) => { // @deprecated, r171 - - console.warn( 'THREE.TSL: "dodge" has been renamed. Use "blendDodge" instead.' ); - return blendDodge( params ); - -}; - -/** - * @tsl - * @function - * @deprecated since r171. Use {@link blendScreen} instead. - * - * @param {...any} params - * @returns {Function} - */ -const screen = ( ...params ) => { // @deprecated, r171 - - console.warn( 'THREE.TSL: "screen" has been renamed. Use "blendScreen" instead.' ); - return blendScreen( params ); - -}; - -/** - * @tsl - * @function - * @deprecated since r171. Use {@link blendOverlay} instead. - * - * @param {...any} params - * @returns {Function} - */ -const overlay = ( ...params ) => { // @deprecated, r171 - - console.warn( 'THREE.TSL: "overlay" has been renamed. Use "blendOverlay" instead.' ); - return blendOverlay( params ); - -}; - /** * Computes a grayscale value for the given RGB color value. * @@ -41996,7 +42082,7 @@ var TSL = /*#__PURE__*/Object.freeze({ pow2: pow2, pow3: pow3, pow4: pow4, - premult: premult, + premultiplyAlpha: premultiplyAlpha, property: property, radians: radians, rand: rand, @@ -42119,7 +42205,7 @@ var TSL = /*#__PURE__*/Object.freeze({ uniformGroup: uniformGroup, uniformTexture: uniformTexture, uniforms: uniforms, - unpremult: unpremult, + unpremultiplyAlpha: unpremultiplyAlpha, userData: userData, uv: uv, uvec2: uvec2, @@ -61573,7 +61659,7 @@ class WebGLBackend extends Backend { if ( vaoGPU === undefined ) { - this._createVao( attributes ); + this.vaoCache[ vaoKey ] = this._createVao( attributes ); } else { @@ -61609,7 +61695,7 @@ class WebGLBackend extends Backend { const dualAttributeData = transformBuffers[ i ]; - if ( dualAttributeData.pbo ) { + if ( dualAttributeData.pbo && this.has( dualAttributeData.pbo ) ) { this.textureUtils.copyBufferToTexture( dualAttributeData.transformBuffer, dualAttributeData.pbo ); @@ -61691,28 +61777,23 @@ class WebGLBackend extends Backend { // vertex state - const renderObjectData = this.get( renderObject ); + const attributes = renderObject.getAttributes(); + const attributesData = this.get( attributes ); - let vaoGPU = renderObjectData.staticVao; + let vaoGPU = attributesData.vaoGPU; - if ( vaoGPU === undefined || renderObjectData.geometryId !== renderObject.geometry.id ) { + if ( vaoGPU === undefined ) { - const vaoKey = this._getVaoKey( renderObject.getAttributes() ); + const vaoKey = this._getVaoKey( attributes ); vaoGPU = this.vaoCache[ vaoKey ]; if ( vaoGPU === undefined ) { - let staticVao; - - ( { vaoGPU, staticVao } = this._createVao( renderObject.getAttributes() ) ); - - if ( staticVao ) { + vaoGPU = this._createVao( attributes ); - renderObjectData.staticVao = vaoGPU; - renderObjectData.geometryId = renderObject.geometry.id; - - } + this.vaoCache[ vaoKey ] = vaoGPU; + attributesData.vaoGPU = vaoGPU; } @@ -63012,9 +63093,6 @@ class WebGLBackend extends Backend { const { gl } = this; const vaoGPU = gl.createVertexArray(); - let key = ''; - - let staticVao = true; gl.bindVertexArray( vaoGPU ); @@ -63023,13 +63101,9 @@ class WebGLBackend extends Backend { const attribute = attributes[ i ]; const attributeData = this.get( attribute ); - key += ':' + attributeData.id; - gl.bindBuffer( gl.ARRAY_BUFFER, attributeData.bufferGPU ); gl.enableVertexAttribArray( i ); - if ( attribute.isStorageBufferAttribute || attribute.isStorageInstancedBufferAttribute ) staticVao = false; - let stride, offset; if ( attribute.isInterleavedBufferAttribute === true ) { @@ -63068,9 +63142,7 @@ class WebGLBackend extends Backend { gl.bindBuffer( gl.ARRAY_BUFFER, null ); - this.vaoCache[ key ] = vaoGPU; - - return { vaoGPU, staticVao }; + return vaoGPU; } diff --git a/build/three.webgpu.nodes.min.js b/build/three.webgpu.nodes.min.js index 76471bcca5c7b4..2fdb4b253748f9 100644 --- a/build/three.webgpu.nodes.min.js +++ b/build/three.webgpu.nodes.min.js @@ -3,4 +3,4 @@ * Copyright 2010-2025 Three.js Authors * SPDX-License-Identifier: MIT */ -import{Color as e,Vector2 as t,Vector3 as r,Vector4 as s,Matrix2 as i,Matrix3 as n,Matrix4 as a,EventDispatcher as o,MathUtils as u,WebGLCoordinateSystem as l,WebGPUCoordinateSystem as d,ColorManagement as c,SRGBTransfer as h,NoToneMapping as p,StaticDrawUsage as g,InterleavedBuffer as m,InterleavedBufferAttribute as f,DynamicDrawUsage as y,NoColorSpace as x,Texture as b,UnsignedIntType as T,IntType as _,NearestFilter as v,Sphere as N,BackSide as S,Euler as E,CubeTexture as w,CubeReflectionMapping as A,CubeRefractionMapping as R,TangentSpaceNormalMap as C,ObjectSpaceNormalMap as M,InstancedInterleavedBuffer as P,InstancedBufferAttribute as F,DataArrayTexture as L,FloatType as B,FramebufferTexture as I,LinearMipmapLinearFilter as D,DepthTexture as V,Material as U,NormalBlending as O,LineBasicMaterial as k,LineDashedMaterial as G,NoBlending as z,MeshNormalMaterial as H,SRGBColorSpace as $,WebGLCubeRenderTarget as W,BoxGeometry as j,Mesh as q,Scene as X,LinearFilter as K,CubeCamera as Y,EquirectangularReflectionMapping as Q,EquirectangularRefractionMapping as Z,AddOperation as J,MixOperation as ee,MultiplyOperation as te,MeshBasicMaterial as re,MeshLambertMaterial as se,MeshPhongMaterial as ie,OrthographicCamera as ne,PerspectiveCamera as ae,RenderTarget as oe,LinearSRGBColorSpace as ue,RGBAFormat as le,HalfFloatType as de,CubeUVReflectionMapping as ce,BufferGeometry as he,BufferAttribute as pe,MeshStandardMaterial as ge,MeshPhysicalMaterial as me,MeshToonMaterial as fe,MeshMatcapMaterial as ye,SpriteMaterial as xe,PointsMaterial as be,ShadowMaterial as Te,Uint32BufferAttribute as _e,Uint16BufferAttribute as ve,arrayNeedsUint32 as Ne,DoubleSide as Se,Camera as Ee,DepthStencilFormat as we,DepthFormat as Ae,UnsignedInt248Type as Re,UnsignedByteType as Ce,Plane as Me,Object3D as Pe,LinearMipMapLinearFilter as Fe,Float32BufferAttribute as Le,UVMapping as Be,VSMShadowMap as Ie,LessCompare as De,RGFormat as Ve,BasicShadowMap as Ue,SphereGeometry as Oe,LinearMipmapNearestFilter as ke,NearestMipmapLinearFilter as Ge,Float16BufferAttribute as ze,REVISION as He,ArrayCamera as $e,PlaneGeometry as We,FrontSide as je,CustomBlending as qe,AddEquation as Xe,ZeroFactor as Ke,CylinderGeometry as Ye,Quaternion as Qe,WebXRController as Ze,RAD2DEG as Je,PCFShadowMap as et,FrustumArray as tt,Frustum as rt,DataTexture as st,RedIntegerFormat as it,RedFormat as nt,ShortType as at,ByteType as ot,UnsignedShortType as ut,RGIntegerFormat as lt,RGBIntegerFormat as dt,RGBFormat as ct,RGBAIntegerFormat as ht,warnOnce as pt,createCanvasElement as gt,ReverseSubtractEquation as mt,SubtractEquation as ft,OneMinusDstAlphaFactor as yt,OneMinusDstColorFactor as xt,OneMinusSrcAlphaFactor as bt,OneMinusSrcColorFactor as Tt,DstAlphaFactor as _t,DstColorFactor as vt,SrcAlphaSaturateFactor as Nt,SrcAlphaFactor as St,SrcColorFactor as Et,OneFactor as wt,CullFaceNone as At,CullFaceBack as Rt,CullFaceFront as Ct,MultiplyBlending as Mt,SubtractiveBlending as Pt,AdditiveBlending as Ft,NotEqualDepth as Lt,GreaterDepth as Bt,GreaterEqualDepth as It,EqualDepth as Dt,LessEqualDepth as Vt,LessDepth as Ut,AlwaysDepth as Ot,NeverDepth as kt,UnsignedShort4444Type as Gt,UnsignedShort5551Type as zt,UnsignedInt5999Type as Ht,AlphaFormat as $t,RGB_S3TC_DXT1_Format as Wt,RGBA_S3TC_DXT1_Format as jt,RGBA_S3TC_DXT3_Format as qt,RGBA_S3TC_DXT5_Format as Xt,RGB_PVRTC_4BPPV1_Format as Kt,RGB_PVRTC_2BPPV1_Format as Yt,RGBA_PVRTC_4BPPV1_Format as Qt,RGBA_PVRTC_2BPPV1_Format as Zt,RGB_ETC1_Format as Jt,RGB_ETC2_Format as er,RGBA_ETC2_EAC_Format as tr,RGBA_ASTC_4x4_Format as rr,RGBA_ASTC_5x4_Format as sr,RGBA_ASTC_5x5_Format as ir,RGBA_ASTC_6x5_Format as nr,RGBA_ASTC_6x6_Format as ar,RGBA_ASTC_8x5_Format as or,RGBA_ASTC_8x6_Format as ur,RGBA_ASTC_8x8_Format as lr,RGBA_ASTC_10x5_Format as dr,RGBA_ASTC_10x6_Format as cr,RGBA_ASTC_10x8_Format as hr,RGBA_ASTC_10x10_Format as pr,RGBA_ASTC_12x10_Format as gr,RGBA_ASTC_12x12_Format as mr,RGBA_BPTC_Format as fr,RED_RGTC1_Format as yr,SIGNED_RED_RGTC1_Format as xr,RED_GREEN_RGTC2_Format as br,SIGNED_RED_GREEN_RGTC2_Format as Tr,MirroredRepeatWrapping as _r,ClampToEdgeWrapping as vr,RepeatWrapping as Nr,NearestMipmapNearestFilter as Sr,NotEqualCompare as Er,GreaterCompare as wr,GreaterEqualCompare as Ar,EqualCompare as Rr,LessEqualCompare as Cr,AlwaysCompare as Mr,NeverCompare as Pr,LinearTransfer as Fr,NotEqualStencilFunc as Lr,GreaterStencilFunc as Br,GreaterEqualStencilFunc as Ir,EqualStencilFunc as Dr,LessEqualStencilFunc as Vr,LessStencilFunc as Ur,AlwaysStencilFunc as Or,NeverStencilFunc as kr,DecrementWrapStencilOp as Gr,IncrementWrapStencilOp as zr,DecrementStencilOp as Hr,IncrementStencilOp as $r,InvertStencilOp as Wr,ReplaceStencilOp as jr,ZeroStencilOp as qr,KeepStencilOp as Xr,MaxEquation as Kr,MinEquation as Yr,SpotLight as Qr,PointLight as Zr,DirectionalLight as Jr,RectAreaLight as es,AmbientLight as ts,HemisphereLight as rs,LightProbe as ss,LinearToneMapping as is,ReinhardToneMapping as ns,CineonToneMapping as as,ACESFilmicToneMapping as os,AgXToneMapping as us,NeutralToneMapping as ls,Group as ds,Loader as cs,FileLoader as hs,MaterialLoader as ps,ObjectLoader as gs}from"./three.core.min.js";export{AdditiveAnimationBlendMode,AnimationAction,AnimationClip,AnimationLoader,AnimationMixer,AnimationObjectGroup,AnimationUtils,ArcCurve,ArrowHelper,AttachedBindMode,Audio,AudioAnalyser,AudioContext,AudioListener,AudioLoader,AxesHelper,BasicDepthPacking,BatchedMesh,Bone,BooleanKeyframeTrack,Box2,Box3,Box3Helper,BoxHelper,BufferGeometryLoader,Cache,CameraHelper,CanvasTexture,CapsuleGeometry,CatmullRomCurve3,CircleGeometry,Clock,ColorKeyframeTrack,CompressedArrayTexture,CompressedCubeTexture,CompressedTexture,CompressedTextureLoader,ConeGeometry,ConstantAlphaFactor,ConstantColorFactor,Controls,CubeTextureLoader,CubicBezierCurve,CubicBezierCurve3,CubicInterpolant,CullFaceFrontBack,Curve,CurvePath,CustomToneMapping,Cylindrical,Data3DTexture,DataTextureLoader,DataUtils,DefaultLoadingManager,DetachedBindMode,DirectionalLightHelper,DiscreteInterpolant,DodecahedronGeometry,DynamicCopyUsage,DynamicReadUsage,EdgesGeometry,EllipseCurve,ExtrudeGeometry,Fog,FogExp2,GLBufferAttribute,GLSL1,GLSL3,GridHelper,HemisphereLightHelper,IcosahedronGeometry,ImageBitmapLoader,ImageLoader,ImageUtils,InstancedBufferGeometry,InstancedMesh,Int16BufferAttribute,Int32BufferAttribute,Int8BufferAttribute,Interpolant,InterpolateDiscrete,InterpolateLinear,InterpolateSmooth,InterpolationSamplingMode,InterpolationSamplingType,KeyframeTrack,LOD,LatheGeometry,Layers,Light,Line,Line3,LineCurve,LineCurve3,LineLoop,LineSegments,LinearInterpolant,LinearMipMapNearestFilter,LoaderUtils,LoadingManager,LoopOnce,LoopPingPong,LoopRepeat,MOUSE,MeshDepthMaterial,MeshDistanceMaterial,NearestMipMapLinearFilter,NearestMipMapNearestFilter,NormalAnimationBlendMode,NumberKeyframeTrack,OctahedronGeometry,OneMinusConstantAlphaFactor,OneMinusConstantColorFactor,PCFSoftShadowMap,Path,PlaneHelper,PointLightHelper,Points,PolarGridHelper,PolyhedronGeometry,PositionalAudio,PropertyBinding,PropertyMixer,QuadraticBezierCurve,QuadraticBezierCurve3,QuaternionKeyframeTrack,QuaternionLinearInterpolant,RGBADepthPacking,RGBDepthPacking,RGB_BPTC_SIGNED_Format,RGB_BPTC_UNSIGNED_Format,RGDepthPacking,RawShaderMaterial,Ray,Raycaster,RenderTarget3D,RingGeometry,ShaderMaterial,Shape,ShapeGeometry,ShapePath,ShapeUtils,Skeleton,SkeletonHelper,SkinnedMesh,Source,Spherical,SphericalHarmonics3,SplineCurve,SpotLightHelper,Sprite,StaticCopyUsage,StaticReadUsage,StereoCamera,StreamCopyUsage,StreamDrawUsage,StreamReadUsage,StringKeyframeTrack,TOUCH,TetrahedronGeometry,TextureLoader,TextureUtils,TimestampQuery,TorusGeometry,TorusKnotGeometry,Triangle,TriangleFanDrawMode,TriangleStripDrawMode,TrianglesDrawMode,TubeGeometry,Uint8BufferAttribute,Uint8ClampedBufferAttribute,Uniform,UniformsGroup,VectorKeyframeTrack,VideoFrameTexture,VideoTexture,WebGL3DRenderTarget,WebGLArrayRenderTarget,WebGLRenderTarget,WireframeGeometry,WrapAroundEnding,ZeroCurvatureEnding,ZeroSlopeEnding}from"./three.core.min.js";const ms=["alphaMap","alphaTest","anisotropy","anisotropyMap","anisotropyRotation","aoMap","aoMapIntensity","attenuationColor","attenuationDistance","bumpMap","clearcoat","clearcoatMap","clearcoatNormalMap","clearcoatNormalScale","clearcoatRoughness","color","dispersion","displacementMap","emissive","emissiveIntensity","emissiveMap","envMap","envMapIntensity","gradientMap","ior","iridescence","iridescenceIOR","iridescenceMap","iridescenceThicknessMap","lightMap","lightMapIntensity","map","matcap","metalness","metalnessMap","normalMap","normalScale","opacity","roughness","roughnessMap","sheen","sheenColor","sheenColorMap","sheenRoughnessMap","shininess","specular","specularColor","specularColorMap","specularIntensity","specularIntensityMap","specularMap","thickness","transmission","transmissionMap"];class fs{constructor(e){this.renderObjects=new WeakMap,this.hasNode=this.containsNode(e),this.hasAnimation=!0===e.object.isSkinnedMesh,this.refreshUniforms=ms,this.renderId=0}firstInitialization(e){return!1===this.renderObjects.has(e)&&(this.getRenderObjectData(e),!0)}needsVelocity(e){const t=e.getMRT();return null!==t&&t.has("velocity")}getRenderObjectData(e){let t=this.renderObjects.get(e);if(void 0===t){const{geometry:r,material:s,object:i}=e;if(t={material:this.getMaterialData(s),geometry:{id:r.id,attributes:this.getAttributesData(r.attributes),indexVersion:r.index?r.index.version:null,drawRange:{start:r.drawRange.start,count:r.drawRange.count}},worldMatrix:i.matrixWorld.clone()},i.center&&(t.center=i.center.clone()),i.morphTargetInfluences&&(t.morphTargetInfluences=i.morphTargetInfluences.slice()),null!==e.bundle&&(t.version=e.bundle.version),t.material.transmission>0){const{width:r,height:s}=e.context;t.bufferWidth=r,t.bufferHeight=s}this.renderObjects.set(e,t)}return t}getAttributesData(e){const t={};for(const r in e){const s=e[r];t[r]={version:s.version}}return t}containsNode(e){const t=e.material;for(const e in t)if(t[e]&&t[e].isNode)return!0;return null!==e.renderer.overrideNodes.modelViewMatrix||null!==e.renderer.overrideNodes.modelNormalViewMatrix}getMaterialData(e){const t={};for(const r of this.refreshUniforms){const s=e[r];null!=s&&("object"==typeof s&&void 0!==s.clone?!0===s.isTexture?t[r]={id:s.id,version:s.version}:t[r]=s.clone():t[r]=s)}return t}equals(e){const{object:t,material:r,geometry:s}=e,i=this.getRenderObjectData(e);if(!0!==i.worldMatrix.equals(t.matrixWorld))return i.worldMatrix.copy(t.matrixWorld),!1;const n=i.material;for(const e in n){const t=n[e],s=r[e];if(void 0!==t.equals){if(!1===t.equals(s))return t.copy(s),!1}else if(!0===s.isTexture){if(t.id!==s.id||t.version!==s.version)return t.id=s.id,t.version=s.version,!1}else if(t!==s)return n[e]=s,!1}if(n.transmission>0){const{width:t,height:r}=e.context;if(i.bufferWidth!==t||i.bufferHeight!==r)return i.bufferWidth=t,i.bufferHeight=r,!1}const a=i.geometry,o=s.attributes,u=a.attributes,l=Object.keys(u),d=Object.keys(o);if(a.id!==s.id)return a.id=s.id,!1;if(l.length!==d.length)return i.geometry.attributes=this.getAttributesData(o),!1;for(const e of l){const t=u[e],r=o[e];if(void 0===r)return delete u[e],!1;if(t.version!==r.version)return t.version=r.version,!1}const c=s.index,h=a.indexVersion,p=c?c.version:null;if(h!==p)return a.indexVersion=p,!1;if(a.drawRange.start!==s.drawRange.start||a.drawRange.count!==s.drawRange.count)return a.drawRange.start=s.drawRange.start,a.drawRange.count=s.drawRange.count,!1;if(i.morphTargetInfluences){let e=!1;for(let r=0;r>>16,2246822507),r^=Math.imul(s^s>>>13,3266489909),s=Math.imul(s^s>>>16,2246822507),s^=Math.imul(r^r>>>13,3266489909),4294967296*(2097151&s)+(r>>>0)}const xs=e=>ys(e),bs=e=>ys(e),Ts=(...e)=>ys(e);function _s(e,t=!1){const r=[];!0===e.isNode&&(r.push(e.id),e=e.getSelf());for(const{property:s,childNode:i}of vs(e))r.push(ys(s.slice(0,-4)),i.getCacheKey(t));return ys(r)}function*vs(e,t=!1){for(const r in e){if(!0===r.startsWith("_"))continue;const s=e[r];if(!0===Array.isArray(s))for(let e=0;ee.charCodeAt(0))).buffer}var Is=Object.freeze({__proto__:null,arrayBufferToBase64:Ls,base64ToArrayBuffer:Bs,getByteBoundaryFromType:Cs,getCacheKey:_s,getDataFromObject:Fs,getLengthFromType:As,getMemoryLengthFromType:Rs,getNodeChildren:vs,getTypeFromLength:Es,getTypedArrayFromType:ws,getValueFromType:Ps,getValueType:Ms,hash:Ts,hashArray:bs,hashString:xs});const Ds={VERTEX:"vertex",FRAGMENT:"fragment"},Vs={NONE:"none",FRAME:"frame",RENDER:"render",OBJECT:"object"},Us={BOOLEAN:"bool",INTEGER:"int",FLOAT:"float",VECTOR2:"vec2",VECTOR3:"vec3",VECTOR4:"vec4",MATRIX2:"mat2",MATRIX3:"mat3",MATRIX4:"mat4"},Os={READ_ONLY:"readOnly",WRITE_ONLY:"writeOnly",READ_WRITE:"readWrite"},ks=["fragment","vertex"],Gs=["setup","analyze","generate"],zs=[...ks,"compute"],Hs=["x","y","z","w"],$s={analyze:"setup",generate:"analyze"};let Ws=0;class js extends o{static get type(){return"Node"}constructor(e=null){super(),this.nodeType=e,this.updateType=Vs.NONE,this.updateBeforeType=Vs.NONE,this.updateAfterType=Vs.NONE,this.uuid=u.generateUUID(),this.version=0,this.global=!1,this.parents=!1,this.isNode=!0,this._cacheKey=null,this._cacheKeyVersion=0,Object.defineProperty(this,"id",{value:Ws++})}set needsUpdate(e){!0===e&&this.version++}get type(){return this.constructor.type}onUpdate(e,t){return this.updateType=t,this.update=e.bind(this.getSelf()),this}onFrameUpdate(e){return this.onUpdate(e,Vs.FRAME)}onRenderUpdate(e){return this.onUpdate(e,Vs.RENDER)}onObjectUpdate(e){return this.onUpdate(e,Vs.OBJECT)}onReference(e){return this.updateReference=e.bind(this.getSelf()),this}getSelf(){return this.self||this}updateReference(){return this}isGlobal(){return this.global}*getChildren(){for(const{childNode:e}of vs(this))yield e}dispose(){this.dispatchEvent({type:"dispose"})}traverse(e){e(this);for(const t of this.getChildren())t.traverse(e)}getCacheKey(e=!1){return!0!==(e=e||this.version!==this._cacheKeyVersion)&&null!==this._cacheKey||(this._cacheKey=Ts(_s(this,e),this.customCacheKey()),this._cacheKeyVersion=this.version),this._cacheKey}customCacheKey(){return 0}getScope(){return this}getHash(){return this.uuid}getUpdateType(){return this.updateType}getUpdateBeforeType(){return this.updateBeforeType}getUpdateAfterType(){return this.updateAfterType}getElementType(e){const t=this.getNodeType(e);return e.getElementType(t)}getMemberType(){return"void"}getNodeType(e){const t=e.getNodeProperties(this);return t.outputNode?t.outputNode.getNodeType(e):this.nodeType}getShared(e){const t=this.getHash(e);return e.getNodeFromHash(t)||this}setup(e){const t=e.getNodeProperties(this);let r=0;for(const e of this.getChildren())t["node"+r++]=e;return t.outputNode||null}analyze(e,t=null){const r=e.increaseUsage(this);if(!0===this.parents){const r=e.getDataFromNode(this,"any");r.stages=r.stages||{},r.stages[e.shaderStage]=r.stages[e.shaderStage]||[],r.stages[e.shaderStage].push(t)}if(1===r){const t=e.getNodeProperties(this);for(const r of Object.values(t))r&&!0===r.isNode&&r.build(e,this)}}generate(e,t){const{outputNode:r}=e.getNodeProperties(this);if(r&&!0===r.isNode)return r.build(e,t)}updateBefore(){console.warn("Abstract function.")}updateAfter(){console.warn("Abstract function.")}update(){console.warn("Abstract function.")}build(e,t=null){const r=this.getShared(e);if(this!==r)return r.build(e,t);const s=e.getDataFromNode(this);s.buildStages=s.buildStages||{},s.buildStages[e.buildStage]=!0;const i=$s[e.buildStage];if(i&&!0!==s.buildStages[i]){const t=e.getBuildStage();e.setBuildStage(i),this.build(e),e.setBuildStage(t)}e.addNode(this),e.addChain(this);let n=null;const a=e.getBuildStage();if("setup"===a){this.updateReference(e);const t=e.getNodeProperties(this);if(!0!==t.initialized){t.initialized=!0,t.outputNode=this.setup(e)||t.outputNode||null;for(const r of Object.values(t))if(r&&!0===r.isNode){if(!0===r.parents){const t=e.getNodeProperties(r);t.parents=t.parents||[],t.parents.push(this)}r.build(e)}}n=t.outputNode}else if("analyze"===a)this.analyze(e,t);else if("generate"===a){if(1===this.generate.length){const r=this.getNodeType(e),s=e.getDataFromNode(this);n=s.snippet,void 0===n?void 0===s.generated?(s.generated=!0,n=this.generate(e)||"",s.snippet=n):(console.warn("THREE.Node: Recursion detected.",this),n=""):void 0!==s.flowCodes&&void 0!==e.context.nodeBlock&&e.addFlowCodeHierarchy(this,e.context.nodeBlock),n=e.format(n,r,t)}else n=this.generate(e,t)||""}return e.removeChain(this),e.addSequentialNode(this),n}getSerializeChildren(){return vs(this)}serialize(e){const t=this.getSerializeChildren(),r={};for(const{property:s,index:i,childNode:n}of t)void 0!==i?(void 0===r[s]&&(r[s]=Number.isInteger(i)?[]:{}),r[s][i]=n.toJSON(e.meta).uuid):r[s]=n.toJSON(e.meta).uuid;Object.keys(r).length>0&&(e.inputNodes=r)}deserialize(e){if(void 0!==e.inputNodes){const t=e.meta.nodes;for(const r in e.inputNodes)if(Array.isArray(e.inputNodes[r])){const s=[];for(const i of e.inputNodes[r])s.push(t[i]);this[r]=s}else if("object"==typeof e.inputNodes[r]){const s={};for(const i in e.inputNodes[r]){const n=e.inputNodes[r][i];s[i]=t[n]}this[r]=s}else{const s=e.inputNodes[r];this[r]=t[s]}}}toJSON(e){const{uuid:t,type:r}=this,s=void 0===e||"string"==typeof e;s&&(e={textures:{},images:{},nodes:{}});let i=e.nodes[t];function n(e){const t=[];for(const r in e){const s=e[r];delete s.metadata,t.push(s)}return t}if(void 0===i&&(i={uuid:t,type:r,meta:e,metadata:{version:4.7,type:"Node",generator:"Node.toJSON"}},!0!==s&&(e.nodes[i.uuid]=i),this.serialize(i),delete i.meta),s){const t=n(e.textures),r=n(e.images),s=n(e.nodes);t.length>0&&(i.textures=t),r.length>0&&(i.images=r),s.length>0&&(i.nodes=s)}return i}}class qs extends js{static get type(){return"ArrayElementNode"}constructor(e,t){super(),this.node=e,this.indexNode=t,this.isArrayElementNode=!0}getNodeType(e){return this.node.getElementType(e)}generate(e){const t=this.indexNode.getNodeType(e);return`${this.node.build(e)}[ ${this.indexNode.build(e,!e.isVector(t)&&e.isInteger(t)?t:"uint")} ]`}}class Xs extends js{static get type(){return"ConvertNode"}constructor(e,t){super(),this.node=e,this.convertTo=t}getNodeType(e){const t=this.node.getNodeType(e);let r=null;for(const s of this.convertTo.split("|"))null!==r&&e.getTypeLength(t)!==e.getTypeLength(s)||(r=s);return r}serialize(e){super.serialize(e),e.convertTo=this.convertTo}deserialize(e){super.deserialize(e),this.convertTo=e.convertTo}generate(e,t){const r=this.node,s=this.getNodeType(e),i=r.build(e,s);return e.format(i,s,t)}}class Ks extends js{static get type(){return"TempNode"}constructor(e=null){super(e),this.isTempNode=!0}hasDependencies(e){return e.getDataFromNode(this).usageCount>1}build(e,t){if("generate"===e.getBuildStage()){const r=e.getVectorType(this.getNodeType(e,t)),s=e.getDataFromNode(this);if(void 0!==s.propertyName)return e.format(s.propertyName,r,t);if("void"!==r&&"void"!==t&&this.hasDependencies(e)){const i=super.build(e,r),n=e.getVarFromNode(this,null,r),a=e.getPropertyName(n);return e.addLineFlowCode(`${a} = ${i}`,this),s.snippet=i,s.propertyName=a,e.format(s.propertyName,r,t)}}return super.build(e,t)}}class Ys extends Ks{static get type(){return"JoinNode"}constructor(e=[],t=null){super(t),this.nodes=e}getNodeType(e){return null!==this.nodeType?e.getVectorType(this.nodeType):e.getTypeFromLength(this.nodes.reduce(((t,r)=>t+e.getTypeLength(r.getNodeType(e))),0))}generate(e,t){const r=this.getNodeType(e),s=e.getTypeLength(r),i=this.nodes,n=e.getComponentType(r),a=[];let o=0;for(const t of i){if(o>=s){console.error(`THREE.TSL: Length of parameters exceeds maximum length of function '${r}()' type.`);break}let i,u=t.getNodeType(e),l=e.getTypeLength(u);o+l>s&&(console.error(`THREE.TSL: Length of '${r}()' data exceeds maximum length of output type.`),l=s-o,u=e.getTypeFromLength(l)),o+=l,i=t.build(e,u);const d=e.getComponentType(u);d!==n&&(i=e.format(i,d,n)),a.push(i)}const u=`${e.getType(r)}( ${a.join(", ")} )`;return e.format(u,r,t)}}const Qs=Hs.join("");class Zs extends js{static get type(){return"SplitNode"}constructor(e,t="x"){super(),this.node=e,this.components=t,this.isSplitNode=!0}getVectorLength(){let e=this.components.length;for(const t of this.components)e=Math.max(Hs.indexOf(t)+1,e);return e}getComponentType(e){return e.getComponentType(this.node.getNodeType(e))}getNodeType(e){return e.getTypeFromLength(this.components.length,this.getComponentType(e))}generate(e,t){const r=this.node,s=e.getTypeLength(r.getNodeType(e));let i=null;if(s>1){let n=null;this.getVectorLength()>=s&&(n=e.getTypeFromLength(this.getVectorLength(),this.getComponentType(e)));const a=r.build(e,n);i=this.components.length===s&&this.components===Qs.slice(0,this.components.length)?e.format(a,n,t):e.format(`${a}.${this.components}`,this.getNodeType(e),t)}else i=r.build(e,t);return i}serialize(e){super.serialize(e),e.components=this.components}deserialize(e){super.deserialize(e),this.components=e.components}}class Js extends Ks{static get type(){return"SetNode"}constructor(e,t,r){super(),this.sourceNode=e,this.components=t,this.targetNode=r}getNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{sourceNode:t,components:r,targetNode:s}=this,i=this.getNodeType(e),n=e.getComponentType(s.getNodeType(e)),a=e.getTypeFromLength(r.length,n),o=s.build(e,a),u=t.build(e,i),l=e.getTypeLength(i),d=[];for(let e=0;ee.replace(/r|s/g,"x").replace(/g|t/g,"y").replace(/b|p/g,"z").replace(/a|q/g,"w"),li=e=>ui(e).split("").sort().join(""),di={setup(e,t){const r=t.shift();return e(Ii(r),...t)},get(e,t,r){if("string"==typeof t&&void 0===e[t]){if(!0!==e.isStackNode&&"assign"===t)return(...e)=>(ni.assign(r,...e),r);if(ai.has(t)){const s=ai.get(t);return e.isStackNode?(...e)=>r.add(s(...e)):(...e)=>s(r,...e)}if("self"===t)return e;if(t.endsWith("Assign")&&ai.has(t.slice(0,t.length-6))){const s=ai.get(t.slice(0,t.length-6));return e.isStackNode?(...e)=>r.assign(e[0],s(...e)):(...e)=>r.assign(s(r,...e))}if(!0===/^[xyzwrgbastpq]{1,4}$/.test(t))return t=ui(t),Bi(new Zs(r,t));if(!0===/^set[XYZWRGBASTPQ]{1,4}$/.test(t))return t=li(t.slice(3).toLowerCase()),r=>Bi(new Js(e,t,Bi(r)));if(!0===/^flip[XYZWRGBASTPQ]{1,4}$/.test(t))return t=li(t.slice(4).toLowerCase()),()=>Bi(new ei(Bi(e),t));if("width"===t||"height"===t||"depth"===t)return"width"===t?t="x":"height"===t?t="y":"depth"===t&&(t="z"),Bi(new Zs(e,t));if(!0===/^\d+$/.test(t))return Bi(new qs(r,new si(Number(t),"uint")));if(!0===/^get$/.test(t))return e=>Bi(new ii(r,e))}return Reflect.get(e,t,r)},set:(e,t,r,s)=>"string"!=typeof t||void 0!==e[t]||!0!==/^[xyzwrgbastpq]{1,4}$/.test(t)&&"width"!==t&&"height"!==t&&"depth"!==t&&!0!==/^\d+$/.test(t)?Reflect.set(e,t,r,s):(s[t].assign(r),!0)},ci=new WeakMap,hi=new WeakMap,pi=function(e,t=null){for(const r in e)e[r]=Bi(e[r],t);return e},gi=function(e,t=null){const r=e.length;for(let s=0;sBi(null!==s?Object.assign(e,s):e);let n,a,o,u=t;function l(t){let r;return r=u?/[a-z]/i.test(u)?u+"()":u:e.type,void 0!==a&&t.lengtho?(console.error(`THREE.TSL: "${r}" parameter length exceeds limit.`),t.slice(0,o)):t}return null===t?n=(...t)=>i(new e(...Di(l(t)))):null!==r?(r=Bi(r),n=(...s)=>i(new e(t,...Di(l(s)),r))):n=(...r)=>i(new e(t,...Di(l(r)))),n.setParameterLength=(...e)=>(1===e.length?a=o=e[0]:2===e.length&&([a,o]=e),n),n.setName=e=>(u=e,n),n},fi=function(e,...t){return Bi(new e(...Di(t)))};class yi extends js{constructor(e,t){super(),this.shaderNode=e,this.inputNodes=t,this.isShaderCallNodeInternal=!0}getNodeType(e){return this.shaderNode.nodeType||this.getOutputNode(e).getNodeType(e)}getMemberType(e,t){return this.getOutputNode(e).getMemberType(e,t)}call(e){const{shaderNode:t,inputNodes:r}=this,s=e.getNodeProperties(t),i=t.namespace&&t.namespace===e.namespace?e.getNamespace("once"):"once";if(s[i])return s[i];let n=null;if(t.layout){let s=hi.get(e.constructor);void 0===s&&(s=new WeakMap,hi.set(e.constructor,s));let i=s.get(t);void 0===i&&(i=Bi(e.buildFunctionNode(t)),s.set(t,i)),e.addInclude(i),n=Bi(i.call(r))}else{const s=t.jsFunc,i=null!==r||s.length>1?s(r||[],e):s(e);n=Bi(i)}return t.once&&(s[i]=n),n}setupOutput(e){return e.addStack(),e.stack.outputNode=this.call(e),e.removeStack()}getOutputNode(e){const t=e.getNodeProperties(this),r=e.getOutputNamespace();return t[r]=t[r]||this.setupOutput(e),t[r]}build(e,t=null){let r=null;const s=e.getBuildStage(),i=e.getNodeProperties(this),n=e.getOutputNamespace(),a=this.getOutputNode(e);if("setup"===s){const t=e.getNamespace("initialized");!0!==i[t]&&(i[t]=!0,i[n]=this.getOutputNode(e),i[n].build(e)),r=i[n]}else"analyze"===s?a.build(e,t):"generate"===s&&(r=a.build(e,t)||"");return r}}class xi extends js{constructor(e,t){super(t),this.jsFunc=e,this.layout=null,this.global=!0,this.once=!1,this.namespace=null}setLayout(e){return this.layout=e,this}call(e=null){return Ii(e),Bi(new yi(this,e))}setup(){return this.call()}}const bi=[!1,!0],Ti=[0,1,2,3],_i=[-1,-2],vi=[.5,1.5,1/3,1e-6,1e6,Math.PI,2*Math.PI,1/Math.PI,2/Math.PI,1/(2*Math.PI),Math.PI/2],Ni=new Map;for(const e of bi)Ni.set(e,new si(e));const Si=new Map;for(const e of Ti)Si.set(e,new si(e,"uint"));const Ei=new Map([...Si].map((e=>new si(e.value,"int"))));for(const e of _i)Ei.set(e,new si(e,"int"));const wi=new Map([...Ei].map((e=>new si(e.value))));for(const e of vi)wi.set(e,new si(e));for(const e of vi)wi.set(-e,new si(-e));const Ai={bool:Ni,uint:Si,ints:Ei,float:wi},Ri=new Map([...Ni,...wi]),Ci=(e,t)=>Ri.has(e)?Ri.get(e):!0===e.isNode?e:new si(e,t),Mi=function(e,t=null){return(...r)=>{if((0===r.length||!["bool","float","int","uint"].includes(e)&&r.every((e=>"object"!=typeof e)))&&(r=[Ps(e,...r)]),1===r.length&&null!==t&&t.has(r[0]))return Bi(t.get(r[0]));if(1===r.length){const t=Ci(r[0],e);return(e=>{try{return e.getNodeType()}catch(e){return}})(t)===e?Bi(t):Bi(new Xs(t,e))}const s=r.map((e=>Ci(e)));return Bi(new Ys(s,e))}},Pi=e=>"object"==typeof e&&null!==e?e.value:e,Fi=e=>null!=e?e.nodeType||e.convertTo||("string"==typeof e?e:null):null;function Li(e,t){return new Proxy(new xi(e,t),di)}const Bi=(e,t=null)=>function(e,t=null){const r=Ms(e);if("node"===r){let t=ci.get(e);return void 0===t&&(t=new Proxy(e,di),ci.set(e,t),ci.set(t,t)),t}return null===t&&("float"===r||"boolean"===r)||r&&"shader"!==r&&"string"!==r?Bi(Ci(e,t)):"shader"===r?e.isFn?e:ki(e):e}(e,t),Ii=(e,t=null)=>new pi(e,t),Di=(e,t=null)=>new gi(e,t),Vi=(...e)=>new mi(...e),Ui=(...e)=>new fi(...e);let Oi=0;const ki=(e,t=null)=>{let r=null;null!==t&&("object"==typeof t?r=t.return:("string"==typeof t?r=t:console.error("THREE.TSL: Invalid layout type."),t=null));const s=new Li(e,r),i=(...e)=>{let t;Ii(e);t=e[0]&&(e[0].isNode||Object.getPrototypeOf(e[0])!==Object.prototype)?[...e]:e[0];const i=s.call(t);return"void"===r&&i.toStack(),i};if(i.shaderNode=s,i.id=s.id,i.isFn=!0,i.getNodeType=(...e)=>s.getNodeType(...e),i.getCacheKey=(...e)=>s.getCacheKey(...e),i.setLayout=e=>(s.setLayout(e),i),i.once=(e=null)=>(s.once=!0,s.namespace=e,i),null!==t){if("object"!=typeof t.inputs){const e={name:"fn"+Oi++,type:r,inputs:[]};for(const r in t)"return"!==r&&e.inputs.push({name:r,type:t[r]});t=e}i.setLayout(t)}return i},Gi=e=>{ni=e},zi=()=>ni,Hi=(...e)=>ni.If(...e);function $i(e){return ni&&ni.add(e),e}oi("toStack",$i);const Wi=new Mi("color"),ji=new Mi("float",Ai.float),qi=new Mi("int",Ai.ints),Xi=new Mi("uint",Ai.uint),Ki=new Mi("bool",Ai.bool),Yi=new Mi("vec2"),Qi=new Mi("ivec2"),Zi=new Mi("uvec2"),Ji=new Mi("bvec2"),en=new Mi("vec3"),tn=new Mi("ivec3"),rn=new Mi("uvec3"),sn=new Mi("bvec3"),nn=new Mi("vec4"),an=new Mi("ivec4"),on=new Mi("uvec4"),un=new Mi("bvec4"),ln=new Mi("mat2"),dn=new Mi("mat3"),cn=new Mi("mat4");oi("toColor",Wi),oi("toFloat",ji),oi("toInt",qi),oi("toUint",Xi),oi("toBool",Ki),oi("toVec2",Yi),oi("toIVec2",Qi),oi("toUVec2",Zi),oi("toBVec2",Ji),oi("toVec3",en),oi("toIVec3",tn),oi("toUVec3",rn),oi("toBVec3",sn),oi("toVec4",nn),oi("toIVec4",an),oi("toUVec4",on),oi("toBVec4",un),oi("toMat2",ln),oi("toMat3",dn),oi("toMat4",cn);const hn=Vi(qs).setParameterLength(2),pn=(e,t)=>Bi(new Xs(Bi(e),t));oi("element",hn),oi("convert",pn);oi("append",(e=>(console.warn("THREE.TSL: .append() has been renamed to .toStack()."),$i(e))));class gn extends js{static get type(){return"PropertyNode"}constructor(e,t=null,r=!1){super(e),this.name=t,this.varying=r,this.isPropertyNode=!0,this.global=!0}getHash(e){return this.name||super.getHash(e)}generate(e){let t;return!0===this.varying?(t=e.getVaryingFromNode(this,this.name),t.needsInterpolation=!0):t=e.getVarFromNode(this,this.name),e.getPropertyName(t)}}const mn=(e,t)=>Bi(new gn(e,t)),fn=(e,t)=>Bi(new gn(e,t,!0)),yn=Ui(gn,"vec4","DiffuseColor"),xn=Ui(gn,"vec3","EmissiveColor"),bn=Ui(gn,"float","Roughness"),Tn=Ui(gn,"float","Metalness"),_n=Ui(gn,"float","Clearcoat"),vn=Ui(gn,"float","ClearcoatRoughness"),Nn=Ui(gn,"vec3","Sheen"),Sn=Ui(gn,"float","SheenRoughness"),En=Ui(gn,"float","Iridescence"),wn=Ui(gn,"float","IridescenceIOR"),An=Ui(gn,"float","IridescenceThickness"),Rn=Ui(gn,"float","AlphaT"),Cn=Ui(gn,"float","Anisotropy"),Mn=Ui(gn,"vec3","AnisotropyT"),Pn=Ui(gn,"vec3","AnisotropyB"),Fn=Ui(gn,"color","SpecularColor"),Ln=Ui(gn,"float","SpecularF90"),Bn=Ui(gn,"float","Shininess"),In=Ui(gn,"vec4","Output"),Dn=Ui(gn,"float","dashSize"),Vn=Ui(gn,"float","gapSize"),Un=Ui(gn,"float","pointWidth"),On=Ui(gn,"float","IOR"),kn=Ui(gn,"float","Transmission"),Gn=Ui(gn,"float","Thickness"),zn=Ui(gn,"float","AttenuationDistance"),Hn=Ui(gn,"color","AttenuationColor"),$n=Ui(gn,"float","Dispersion");class Wn extends js{static get type(){return"UniformGroupNode"}constructor(e,t=!1,r=1){super("string"),this.name=e,this.shared=t,this.order=r,this.isUniformGroup=!0}serialize(e){super.serialize(e),e.name=this.name,e.version=this.version,e.shared=this.shared}deserialize(e){super.deserialize(e),this.name=e.name,this.version=e.version,this.shared=e.shared}}const jn=e=>new Wn(e),qn=(e,t=0)=>new Wn(e,!0,t),Xn=qn("frame"),Kn=qn("render"),Yn=jn("object");class Qn extends ti{static get type(){return"UniformNode"}constructor(e,t=null){super(e,t),this.isUniformNode=!0,this.name="",this.groupNode=Yn}label(e){return this.name=e,this}setGroup(e){return this.groupNode=e,this}getGroup(){return this.groupNode}getUniformHash(e){return this.getHash(e)}onUpdate(e,t){const r=this.getSelf();return e=e.bind(r),super.onUpdate((t=>{const s=e(t,r);void 0!==s&&(this.value=s)}),t)}generate(e,t){const r=this.getNodeType(e),s=this.getUniformHash(e);let i=e.getNodeFromHash(s);void 0===i&&(e.setHashNode(this,s),i=this);const n=i.getInputType(e),a=e.getUniformFromNode(i,n,e.shaderStage,this.name||e.context.label),o=e.getPropertyName(a);return void 0!==e.context.label&&delete e.context.label,e.format(o,r,t)}}const Zn=(e,t)=>{const r=Fi(t||e),s=e&&!0===e.isNode?e.node&&e.node.value||e.value:e;return Bi(new Qn(s,r))};class Jn extends Ks{static get type(){return"ArrayNode"}constructor(e,t,r=null){super(e),this.count=t,this.values=r,this.isArrayNode=!0}getNodeType(e){return null===this.nodeType&&(this.nodeType=this.values[0].getNodeType(e)),this.nodeType}getElementType(e){return this.getNodeType(e)}generate(e){const t=this.getNodeType(e);return e.generateArray(t,this.count,this.values)}}const ea=(...e)=>{let t;if(1===e.length){const r=e[0];t=new Jn(null,r.length,r)}else{const r=e[0],s=e[1];t=new Jn(r,s)}return Bi(t)};oi("toArray",((e,t)=>ea(Array(t).fill(e))));class ta extends Ks{static get type(){return"AssignNode"}constructor(e,t){super(),this.targetNode=e,this.sourceNode=t,this.isAssignNode=!0}hasDependencies(){return!1}getNodeType(e,t){return"void"!==t?this.targetNode.getNodeType(e):"void"}needsSplitAssign(e){const{targetNode:t}=this;if(!1===e.isAvailable("swizzleAssign")&&t.isSplitNode&&t.components.length>1){const r=e.getTypeLength(t.node.getNodeType(e));return Hs.join("").slice(0,r)!==t.components}return!1}setup(e){const{targetNode:t,sourceNode:r}=this,s=e.getNodeProperties(this);s.sourceNode=r,s.targetNode=t.context({assign:!0})}generate(e,t){const{targetNode:r,sourceNode:s}=e.getNodeProperties(this),i=this.needsSplitAssign(e),n=r.getNodeType(e),a=r.build(e),o=s.build(e,n),u=s.getNodeType(e),l=e.getDataFromNode(this);let d;if(!0===l.initialized)"void"!==t&&(d=a);else if(i){const s=e.getVarFromNode(this,null,n),i=e.getPropertyName(s);e.addLineFlowCode(`${i} = ${o}`,this);const u=r.node,l=u.node.context({assign:!0}).build(e);for(let t=0;t{const s=r.type;let i;return i="pointer"===s?"&"+t.build(e):t.build(e,s),i};if(Array.isArray(i)){if(i.length>s.length)console.error("THREE.TSL: The number of provided parameters exceeds the expected number of inputs in 'Fn()'."),i.length=s.length;else if(i.length(t=t.length>1||t[0]&&!0===t[0].isNode?Di(t):Ii(t[0]),Bi(new sa(Bi(e),t)));oi("call",ia);const na={"==":"equal","!=":"notEqual","<":"lessThan",">":"greaterThan","<=":"lessThanEqual",">=":"greaterThanEqual","%":"mod"};class aa extends Ks{static get type(){return"OperatorNode"}constructor(e,t,r,...s){if(super(),s.length>0){let i=new aa(e,t,r);for(let t=0;t>"===t||"<<"===t)return e.getIntegerType(i);if("!"===t||"&&"===t||"||"===t||"^^"===t)return"bool";if("=="===t||"!="===t||"<"===t||">"===t||"<="===t||">="===t){const t=Math.max(e.getTypeLength(i),e.getTypeLength(n));return t>1?`bvec${t}`:"bool"}if(e.isMatrix(i)){if("float"===n)return i;if(e.isVector(n))return e.getVectorFromMatrix(i);if(e.isMatrix(n))return i}else if(e.isMatrix(n)){if("float"===i)return n;if(e.isVector(i))return e.getVectorFromMatrix(n)}return e.getTypeLength(n)>e.getTypeLength(i)?n:i}generate(e,t){const r=this.op,{aNode:s,bNode:i}=this,n=this.getNodeType(e);let a=null,o=null;"void"!==n?(a=s.getNodeType(e),o=i?i.getNodeType(e):null,"<"===r||">"===r||"<="===r||">="===r||"=="===r||"!="===r?e.isVector(a)?o=a:e.isVector(o)?a=o:a!==o&&(a=o="float"):">>"===r||"<<"===r?(a=n,o=e.changeComponentType(o,"uint")):"%"===r?(a=n,o=e.isInteger(a)&&e.isInteger(o)?o:a):e.isMatrix(a)?"float"===o?o="float":e.isVector(o)?o=e.getVectorFromMatrix(a):e.isMatrix(o)||(a=o=n):a=e.isMatrix(o)?"float"===a?"float":e.isVector(a)?e.getVectorFromMatrix(o):o=n:o=n):a=o=n;const u=s.build(e,a),d=i?i.build(e,o):null,c=e.getFunctionOperator(r);if("void"!==t){const s=e.renderer.coordinateSystem===l;if("=="===r||"!="===r||"<"===r||">"===r||"<="===r||">="===r)return s&&e.isVector(a)?e.format(`${this.getOperatorMethod(e,t)}( ${u}, ${d} )`,n,t):e.format(`( ${u} ${r} ${d} )`,n,t);if("%"===r)return e.isInteger(o)?e.format(`( ${u} % ${d} )`,n,t):e.format(`${this.getOperatorMethod(e,n)}( ${u}, ${d} )`,n,t);if("!"===r||"~"===r)return e.format(`(${r}${u})`,a,t);if(c)return e.format(`${c}( ${u}, ${d} )`,n,t);if(e.isMatrix(a)&&"float"===o)return e.format(`( ${d} ${r} ${u} )`,n,t);if("float"===a&&e.isMatrix(o))return e.format(`${u} ${r} ${d}`,n,t);{let i=`( ${u} ${r} ${d} )`;return!s&&"bool"===n&&e.isVector(a)&&e.isVector(o)&&(i=`all${i}`),e.format(i,n,t)}}if("void"!==a)return c?e.format(`${c}( ${u}, ${d} )`,n,t):e.isMatrix(a)&&"float"===o?e.format(`${d} ${r} ${u}`,n,t):e.format(`${u} ${r} ${d}`,n,t)}serialize(e){super.serialize(e),e.op=this.op}deserialize(e){super.deserialize(e),this.op=e.op}}const oa=Vi(aa,"+").setParameterLength(2,1/0).setName("add"),ua=Vi(aa,"-").setParameterLength(2,1/0).setName("sub"),la=Vi(aa,"*").setParameterLength(2,1/0).setName("mul"),da=Vi(aa,"/").setParameterLength(2,1/0).setName("div"),ca=Vi(aa,"%").setParameterLength(2).setName("mod"),ha=Vi(aa,"==").setParameterLength(2).setName("equal"),pa=Vi(aa,"!=").setParameterLength(2).setName("notEqual"),ga=Vi(aa,"<").setParameterLength(2).setName("lessThan"),ma=Vi(aa,">").setParameterLength(2).setName("greaterThan"),fa=Vi(aa,"<=").setParameterLength(2).setName("lessThanEqual"),ya=Vi(aa,">=").setParameterLength(2).setName("greaterThanEqual"),xa=Vi(aa,"&&").setParameterLength(2,1/0).setName("and"),ba=Vi(aa,"||").setParameterLength(2,1/0).setName("or"),Ta=Vi(aa,"!").setParameterLength(1).setName("not"),_a=Vi(aa,"^^").setParameterLength(2).setName("xor"),va=Vi(aa,"&").setParameterLength(2).setName("bitAnd"),Na=Vi(aa,"~").setParameterLength(2).setName("bitNot"),Sa=Vi(aa,"|").setParameterLength(2).setName("bitOr"),Ea=Vi(aa,"^").setParameterLength(2).setName("bitXor"),wa=Vi(aa,"<<").setParameterLength(2).setName("shiftLeft"),Aa=Vi(aa,">>").setParameterLength(2).setName("shiftRight"),Ra=ki((([e])=>(e.addAssign(1),e))),Ca=ki((([e])=>(e.subAssign(1),e))),Ma=ki((([e])=>{const t=qi(e).toConst();return e.addAssign(1),t})),Pa=ki((([e])=>{const t=qi(e).toConst();return e.subAssign(1),t}));oi("add",oa),oi("sub",ua),oi("mul",la),oi("div",da),oi("mod",ca),oi("equal",ha),oi("notEqual",pa),oi("lessThan",ga),oi("greaterThan",ma),oi("lessThanEqual",fa),oi("greaterThanEqual",ya),oi("and",xa),oi("or",ba),oi("not",Ta),oi("xor",_a),oi("bitAnd",va),oi("bitNot",Na),oi("bitOr",Sa),oi("bitXor",Ea),oi("shiftLeft",wa),oi("shiftRight",Aa),oi("incrementBefore",Ra),oi("decrementBefore",Ca),oi("increment",Ma),oi("decrement",Pa);const Fa=(e,t)=>(console.warn('THREE.TSL: "remainder()" is deprecated. Use "mod( int( ... ) )" instead.'),ca(e,t)),La=(e,t)=>(console.warn('THREE.TSL: "modInt()" is deprecated. Use "mod( int( ... ) )" instead.'),ca(qi(e),qi(t)));oi("remainder",Fa),oi("modInt",La);class Ba extends Ks{static get type(){return"MathNode"}constructor(e,t,r=null,s=null){if(super(),(e===Ba.MAX||e===Ba.MIN)&&arguments.length>3){let i=new Ba(e,t,r);for(let t=2;tn&&i>a?t:n>a?r:a>i?s:t}getNodeType(e){const t=this.method;return t===Ba.LENGTH||t===Ba.DISTANCE||t===Ba.DOT?"float":t===Ba.CROSS?"vec3":t===Ba.ALL||t===Ba.ANY?"bool":t===Ba.EQUALS?e.changeComponentType(this.aNode.getNodeType(e),"bool"):this.getInputType(e)}setup(e){const{aNode:t,bNode:r,method:s}=this;let i=null;if(s===Ba.ONE_MINUS)i=ua(1,t);else if(s===Ba.RECIPROCAL)i=da(1,t);else if(s===Ba.DIFFERENCE)i=no(ua(t,r));else if(s===Ba.TRANSFORM_DIRECTION){let s=t,n=r;e.isMatrix(s.getNodeType(e))?n=nn(en(n),0):s=nn(en(s),0);const a=la(s,n).xyz;i=Qa(a)}return null!==i?i:super.setup(e)}generate(e,t){if(e.getNodeProperties(this).outputNode)return super.generate(e,t);let r=this.method;const s=this.getNodeType(e),i=this.getInputType(e),n=this.aNode,a=this.bNode,o=this.cNode,u=e.renderer.coordinateSystem;if(r===Ba.NEGATE)return e.format("( - "+n.build(e,i)+" )",s,t);{const c=[];return r===Ba.CROSS?c.push(n.build(e,s),a.build(e,s)):u===l&&r===Ba.STEP?c.push(n.build(e,1===e.getTypeLength(n.getNodeType(e))?"float":i),a.build(e,i)):u!==l||r!==Ba.MIN&&r!==Ba.MAX?r===Ba.REFRACT?c.push(n.build(e,i),a.build(e,i),o.build(e,"float")):r===Ba.MIX?c.push(n.build(e,i),a.build(e,i),o.build(e,1===e.getTypeLength(o.getNodeType(e))?"float":i)):(u===d&&r===Ba.ATAN&&null!==a&&(r="atan2"),"fragment"===e.shaderStage||r!==Ba.DFDX&&r!==Ba.DFDY||(console.warn(`THREE.TSL: '${r}' is not supported in the ${e.shaderStage} stage.`),r="/*"+r+"*/"),c.push(n.build(e,i)),null!==a&&c.push(a.build(e,i)),null!==o&&c.push(o.build(e,i))):c.push(n.build(e,i),a.build(e,1===e.getTypeLength(a.getNodeType(e))?"float":i)),e.format(`${e.getMethod(r,s)}( ${c.join(", ")} )`,s,t)}}serialize(e){super.serialize(e),e.method=this.method}deserialize(e){super.deserialize(e),this.method=e.method}}Ba.ALL="all",Ba.ANY="any",Ba.RADIANS="radians",Ba.DEGREES="degrees",Ba.EXP="exp",Ba.EXP2="exp2",Ba.LOG="log",Ba.LOG2="log2",Ba.SQRT="sqrt",Ba.INVERSE_SQRT="inversesqrt",Ba.FLOOR="floor",Ba.CEIL="ceil",Ba.NORMALIZE="normalize",Ba.FRACT="fract",Ba.SIN="sin",Ba.COS="cos",Ba.TAN="tan",Ba.ASIN="asin",Ba.ACOS="acos",Ba.ATAN="atan",Ba.ABS="abs",Ba.SIGN="sign",Ba.LENGTH="length",Ba.NEGATE="negate",Ba.ONE_MINUS="oneMinus",Ba.DFDX="dFdx",Ba.DFDY="dFdy",Ba.ROUND="round",Ba.RECIPROCAL="reciprocal",Ba.TRUNC="trunc",Ba.FWIDTH="fwidth",Ba.TRANSPOSE="transpose",Ba.BITCAST="bitcast",Ba.EQUALS="equals",Ba.MIN="min",Ba.MAX="max",Ba.STEP="step",Ba.REFLECT="reflect",Ba.DISTANCE="distance",Ba.DIFFERENCE="difference",Ba.DOT="dot",Ba.CROSS="cross",Ba.POW="pow",Ba.TRANSFORM_DIRECTION="transformDirection",Ba.MIX="mix",Ba.CLAMP="clamp",Ba.REFRACT="refract",Ba.SMOOTHSTEP="smoothstep",Ba.FACEFORWARD="faceforward";const Ia=ji(1e-6),Da=ji(1e6),Va=ji(Math.PI),Ua=ji(2*Math.PI),Oa=Vi(Ba,Ba.ALL).setParameterLength(1),ka=Vi(Ba,Ba.ANY).setParameterLength(1),Ga=Vi(Ba,Ba.RADIANS).setParameterLength(1),za=Vi(Ba,Ba.DEGREES).setParameterLength(1),Ha=Vi(Ba,Ba.EXP).setParameterLength(1),$a=Vi(Ba,Ba.EXP2).setParameterLength(1),Wa=Vi(Ba,Ba.LOG).setParameterLength(1),ja=Vi(Ba,Ba.LOG2).setParameterLength(1),qa=Vi(Ba,Ba.SQRT).setParameterLength(1),Xa=Vi(Ba,Ba.INVERSE_SQRT).setParameterLength(1),Ka=Vi(Ba,Ba.FLOOR).setParameterLength(1),Ya=Vi(Ba,Ba.CEIL).setParameterLength(1),Qa=Vi(Ba,Ba.NORMALIZE).setParameterLength(1),Za=Vi(Ba,Ba.FRACT).setParameterLength(1),Ja=Vi(Ba,Ba.SIN).setParameterLength(1),eo=Vi(Ba,Ba.COS).setParameterLength(1),to=Vi(Ba,Ba.TAN).setParameterLength(1),ro=Vi(Ba,Ba.ASIN).setParameterLength(1),so=Vi(Ba,Ba.ACOS).setParameterLength(1),io=Vi(Ba,Ba.ATAN).setParameterLength(1,2),no=Vi(Ba,Ba.ABS).setParameterLength(1),ao=Vi(Ba,Ba.SIGN).setParameterLength(1),oo=Vi(Ba,Ba.LENGTH).setParameterLength(1),uo=Vi(Ba,Ba.NEGATE).setParameterLength(1),lo=Vi(Ba,Ba.ONE_MINUS).setParameterLength(1),co=Vi(Ba,Ba.DFDX).setParameterLength(1),ho=Vi(Ba,Ba.DFDY).setParameterLength(1),po=Vi(Ba,Ba.ROUND).setParameterLength(1),go=Vi(Ba,Ba.RECIPROCAL).setParameterLength(1),mo=Vi(Ba,Ba.TRUNC).setParameterLength(1),fo=Vi(Ba,Ba.FWIDTH).setParameterLength(1),yo=Vi(Ba,Ba.TRANSPOSE).setParameterLength(1),xo=Vi(Ba,Ba.BITCAST).setParameterLength(2),bo=(e,t)=>(console.warn('THREE.TSL: "equals" is deprecated. Use "equal" inside a vector instead, like: "bvec*( equal( ... ) )"'),ha(e,t)),To=Vi(Ba,Ba.MIN).setParameterLength(2,1/0),_o=Vi(Ba,Ba.MAX).setParameterLength(2,1/0),vo=Vi(Ba,Ba.STEP).setParameterLength(2),No=Vi(Ba,Ba.REFLECT).setParameterLength(2),So=Vi(Ba,Ba.DISTANCE).setParameterLength(2),Eo=Vi(Ba,Ba.DIFFERENCE).setParameterLength(2),wo=Vi(Ba,Ba.DOT).setParameterLength(2),Ao=Vi(Ba,Ba.CROSS).setParameterLength(2),Ro=Vi(Ba,Ba.POW).setParameterLength(2),Co=Vi(Ba,Ba.POW,2).setParameterLength(1),Mo=Vi(Ba,Ba.POW,3).setParameterLength(1),Po=Vi(Ba,Ba.POW,4).setParameterLength(1),Fo=Vi(Ba,Ba.TRANSFORM_DIRECTION).setParameterLength(2),Lo=e=>la(ao(e),Ro(no(e),1/3)),Bo=e=>wo(e,e),Io=Vi(Ba,Ba.MIX).setParameterLength(3),Do=(e,t=0,r=1)=>Bi(new Ba(Ba.CLAMP,Bi(e),Bi(t),Bi(r))),Vo=e=>Do(e),Uo=Vi(Ba,Ba.REFRACT).setParameterLength(3),Oo=Vi(Ba,Ba.SMOOTHSTEP).setParameterLength(3),ko=Vi(Ba,Ba.FACEFORWARD).setParameterLength(3),Go=ki((([e])=>{const t=wo(e.xy,Yi(12.9898,78.233)),r=ca(t,Va);return Za(Ja(r).mul(43758.5453))})),zo=(e,t,r)=>Io(t,r,e),Ho=(e,t,r)=>Oo(t,r,e),$o=(e,t)=>(console.warn('THREE.TSL: "atan2" is overloaded. Use "atan" instead.'),io(e,t)),Wo=ko,jo=Xa;oi("all",Oa),oi("any",ka),oi("equals",bo),oi("radians",Ga),oi("degrees",za),oi("exp",Ha),oi("exp2",$a),oi("log",Wa),oi("log2",ja),oi("sqrt",qa),oi("inverseSqrt",Xa),oi("floor",Ka),oi("ceil",Ya),oi("normalize",Qa),oi("fract",Za),oi("sin",Ja),oi("cos",eo),oi("tan",to),oi("asin",ro),oi("acos",so),oi("atan",io),oi("abs",no),oi("sign",ao),oi("length",oo),oi("lengthSq",Bo),oi("negate",uo),oi("oneMinus",lo),oi("dFdx",co),oi("dFdy",ho),oi("round",po),oi("reciprocal",go),oi("trunc",mo),oi("fwidth",fo),oi("atan2",$o),oi("min",To),oi("max",_o),oi("step",vo),oi("reflect",No),oi("distance",So),oi("dot",wo),oi("cross",Ao),oi("pow",Ro),oi("pow2",Co),oi("pow3",Mo),oi("pow4",Po),oi("transformDirection",Fo),oi("mix",zo),oi("clamp",Do),oi("refract",Uo),oi("smoothstep",Ho),oi("faceForward",ko),oi("difference",Eo),oi("saturate",Vo),oi("cbrt",Lo),oi("transpose",yo),oi("rand",Go);class qo extends js{static get type(){return"ConditionalNode"}constructor(e,t,r=null){super(),this.condNode=e,this.ifNode=t,this.elseNode=r}getNodeType(e){const{ifNode:t,elseNode:r}=e.getNodeProperties(this);if(void 0===t)return this.setup(e),this.getNodeType(e);const s=t.getNodeType(e);if(null!==r){const t=r.getNodeType(e);if(e.getTypeLength(t)>e.getTypeLength(s))return t}return s}setup(e){const t=this.condNode.cache(),r=this.ifNode.cache(),s=this.elseNode?this.elseNode.cache():null,i=e.context.nodeBlock;e.getDataFromNode(r).parentNodeBlock=i,null!==s&&(e.getDataFromNode(s).parentNodeBlock=i);const n=e.getNodeProperties(this);n.condNode=t,n.ifNode=r.context({nodeBlock:r}),n.elseNode=s?s.context({nodeBlock:s}):null}generate(e,t){const r=this.getNodeType(e),s=e.getDataFromNode(this);if(void 0!==s.nodeProperty)return s.nodeProperty;const{condNode:i,ifNode:n,elseNode:a}=e.getNodeProperties(this),o=e.currentFunctionNode,u="void"!==t,l=u?mn(r).build(e):"";s.nodeProperty=l;const d=i.build(e,"bool");e.addFlowCode(`\n${e.tab}if ( ${d} ) {\n\n`).addFlowTab();let c=n.build(e,r);if(c&&(u?c=l+" = "+c+";":(c="return "+c+";",null===o&&(console.warn("THREE.TSL: Return statement used in an inline 'Fn()'. Define a layout struct to allow return values."),c="// "+c))),e.removeFlowTab().addFlowCode(e.tab+"\t"+c+"\n\n"+e.tab+"}"),null!==a){e.addFlowCode(" else {\n\n").addFlowTab();let t=a.build(e,r);t&&(u?t=l+" = "+t+";":(t="return "+t+";",null===o&&(console.warn("THREE.TSL: Return statement used in an inline 'Fn()'. Define a layout struct to allow return values."),t="// "+t))),e.removeFlowTab().addFlowCode(e.tab+"\t"+t+"\n\n"+e.tab+"}\n\n")}else e.addFlowCode("\n\n");return e.format(l,r,t)}}const Xo=Vi(qo).setParameterLength(2,3);oi("select",Xo);const Ko=(...e)=>(console.warn("THREE.TSL: cond() has been renamed to select()."),Xo(...e));oi("cond",Ko);class Yo extends js{static get type(){return"ContextNode"}constructor(e,t={}){super(),this.isContextNode=!0,this.node=e,this.value=t}getScope(){return this.node.getScope()}getNodeType(e){return this.node.getNodeType(e)}analyze(e){const t=e.getContext();e.setContext({...e.context,...this.value}),this.node.build(e),e.setContext(t)}setup(e){const t=e.getContext();e.setContext({...e.context,...this.value}),this.node.build(e),e.setContext(t)}generate(e,t){const r=e.getContext();e.setContext({...e.context,...this.value});const s=this.node.build(e,t);return e.setContext(r),s}}const Qo=Vi(Yo).setParameterLength(1,2),Zo=(e,t)=>Qo(e,{label:t});oi("context",Qo),oi("label",Zo);class Jo extends js{static get type(){return"VarNode"}constructor(e,t=null,r=!1){super(),this.node=e,this.name=t,this.global=!0,this.isVarNode=!0,this.readOnly=r,this.parents=!0}getMemberType(e,t){return this.node.getMemberType(e,t)}getElementType(e){return this.node.getElementType(e)}getNodeType(e){return this.node.getNodeType(e)}generate(e){const{node:t,name:r,readOnly:s}=this,{renderer:i}=e,n=!0===i.backend.isWebGPUBackend;let a=!1,o=!1;s&&(a=e.isDeterministic(t),o=n?s:a);const u=e.getVectorType(this.getNodeType(e)),l=t.build(e,u),d=e.getVarFromNode(this,r,u,void 0,o),c=e.getPropertyName(d);let h=c;if(o)if(n)h=a?`const ${c}`:`let ${c}`;else{const r=e.getArrayCount(t);h=`const ${e.getVar(d.type,c,r)}`}return e.addLineFlowCode(`${h} = ${l}`,this),c}}const eu=Vi(Jo),tu=(e,t=null)=>eu(e,t).toStack(),ru=(e,t=null)=>eu(e,t,!0).toStack();oi("toVar",tu),oi("toConst",ru);const su=e=>(console.warn('TSL: "temp( node )" is deprecated. Use "Var( node )" or "node.toVar()" instead.'),eu(e));oi("temp",su);class iu extends js{static get type(){return"VaryingNode"}constructor(e,t=null){super(),this.node=e,this.name=t,this.isVaryingNode=!0,this.interpolationType=null,this.interpolationSampling=null,this.global=!0}setInterpolation(e,t=null){return this.interpolationType=e,this.interpolationSampling=t,this}getHash(e){return this.name||super.getHash(e)}getNodeType(e){return this.node.getNodeType(e)}setupVarying(e){const t=e.getNodeProperties(this);let r=t.varying;if(void 0===r){const s=this.name,i=this.getNodeType(e),n=this.interpolationType,a=this.interpolationSampling;t.varying=r=e.getVaryingFromNode(this,s,i,n,a),t.node=this.node}return r.needsInterpolation||(r.needsInterpolation="fragment"===e.shaderStage),r}setup(e){this.setupVarying(e),e.flowNodeFromShaderStage(Ds.VERTEX,this.node)}analyze(e){this.setupVarying(e),e.flowNodeFromShaderStage(Ds.VERTEX,this.node)}generate(e){const t=e.getNodeProperties(this),r=this.setupVarying(e);if(void 0===t.propertyName){const s=this.getNodeType(e),i=e.getPropertyName(r,Ds.VERTEX);e.flowNodeFromShaderStage(Ds.VERTEX,this.node,s,i),t.propertyName=i}return e.getPropertyName(r)}}const nu=Vi(iu).setParameterLength(1,2),au=e=>nu(e);oi("toVarying",nu),oi("toVertexStage",au),oi("varying",((...e)=>(console.warn("THREE.TSL: .varying() has been renamed to .toVarying()."),nu(...e)))),oi("vertexStage",((...e)=>(console.warn("THREE.TSL: .vertexStage() has been renamed to .toVertexStage()."),nu(...e))));const ou=ki((([e])=>{const t=e.mul(.9478672986).add(.0521327014).pow(2.4),r=e.mul(.0773993808),s=e.lessThanEqual(.04045);return Io(t,r,s)})).setLayout({name:"sRGBTransferEOTF",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),uu=ki((([e])=>{const t=e.pow(.41666).mul(1.055).sub(.055),r=e.mul(12.92),s=e.lessThanEqual(.0031308);return Io(t,r,s)})).setLayout({name:"sRGBTransferOETF",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),lu="WorkingColorSpace";class du extends Ks{static get type(){return"ColorSpaceNode"}constructor(e,t,r){super("vec4"),this.colorNode=e,this.source=t,this.target=r}resolveColorSpace(e,t){return t===lu?c.workingColorSpace:"OutputColorSpace"===t?e.context.outputColorSpace||e.renderer.outputColorSpace:t}setup(e){const{colorNode:t}=this,r=this.resolveColorSpace(e,this.source),s=this.resolveColorSpace(e,this.target);let i=t;return!1!==c.enabled&&r!==s&&r&&s?(c.getTransfer(r)===h&&(i=nn(ou(i.rgb),i.a)),c.getPrimaries(r)!==c.getPrimaries(s)&&(i=nn(dn(c._getMatrix(new n,r,s)).mul(i.rgb),i.a)),c.getTransfer(s)===h&&(i=nn(uu(i.rgb),i.a)),i):i}}const cu=(e,t)=>Bi(new du(Bi(e),lu,t)),hu=(e,t)=>Bi(new du(Bi(e),t,lu));oi("workingToColorSpace",cu),oi("colorSpaceToWorking",hu);let pu=class extends qs{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),r=this.referenceNode.getNodeType(),s=this.getNodeType();return e.format(t,r,s)}};class gu extends js{static get type(){return"ReferenceBaseNode"}constructor(e,t,r=null,s=null){super(),this.property=e,this.uniformType=t,this.object=r,this.count=s,this.properties=e.split("."),this.reference=r,this.node=null,this.group=null,this.updateType=Vs.OBJECT}setGroup(e){return this.group=e,this}element(e){return Bi(new pu(this,Bi(e)))}setNodeType(e){const t=Zn(null,e).getSelf();null!==this.group&&t.setGroup(this.group),this.node=t}getNodeType(e){return null===this.node&&(this.updateReference(e),this.updateValue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let r=e[t[0]];for(let e=1;eBi(new mu(e,t,r));class yu extends Ks{static get type(){return"ToneMappingNode"}constructor(e,t=bu,r=null){super("vec3"),this.toneMapping=e,this.exposureNode=t,this.colorNode=r}customCacheKey(){return Ts(this.toneMapping)}setup(e){const t=this.colorNode||e.context.color,r=this.toneMapping;if(r===p)return t;let s=null;const i=e.renderer.library.getToneMappingFunction(r);return null!==i?s=nn(i(t.rgb,this.exposureNode),t.a):(console.error("ToneMappingNode: Unsupported Tone Mapping configuration.",r),s=t),s}}const xu=(e,t,r)=>Bi(new yu(e,Bi(t),Bi(r))),bu=fu("toneMappingExposure","float");oi("toneMapping",((e,t,r)=>xu(t,r,e)));class Tu extends ti{static get type(){return"BufferAttributeNode"}constructor(e,t=null,r=0,s=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferStride=r,this.bufferOffset=s,this.usage=g,this.instanced=!1,this.attribute=null,this.global=!0,e&&!0===e.isBufferAttribute&&(this.attribute=e,this.usage=e.usage,this.instanced=e.isInstancedBufferAttribute)}getHash(e){if(0===this.bufferStride&&0===this.bufferOffset){let t=e.globalCache.getData(this.value);return void 0===t&&(t={node:this},e.globalCache.setData(this.value,t)),t.node.uuid}return this.uuid}getNodeType(e){return null===this.bufferType&&(this.bufferType=e.getTypeFromAttribute(this.attribute)),this.bufferType}setup(e){if(null!==this.attribute)return;const t=this.getNodeType(e),r=this.value,s=e.getTypeLength(t),i=this.bufferStride||s,n=this.bufferOffset,a=!0===r.isInterleavedBuffer?r:new m(r,i),o=new f(a,s,n);a.setUsage(this.usage),this.attribute=o,this.attribute.isInstancedBufferAttribute=this.instanced}generate(e){const t=this.getNodeType(e),r=e.getBufferAttributeFromNode(this,t),s=e.getPropertyName(r);let i=null;if("vertex"===e.shaderStage||"compute"===e.shaderStage)this.name=s,i=s;else{i=nu(this).build(e,t)}return i}getInputType(){return"bufferAttribute"}setUsage(e){return this.usage=e,this.attribute&&!0===this.attribute.isBufferAttribute&&(this.attribute.usage=e),this}setInstanced(e){return this.instanced=e,this}}const _u=(e,t=null,r=0,s=0)=>Bi(new Tu(e,t,r,s)),vu=(e,t=null,r=0,s=0)=>_u(e,t,r,s).setUsage(y),Nu=(e,t=null,r=0,s=0)=>_u(e,t,r,s).setInstanced(!0),Su=(e,t=null,r=0,s=0)=>vu(e,t,r,s).setInstanced(!0);oi("toAttribute",(e=>_u(e.value)));class Eu extends js{static get type(){return"ComputeNode"}constructor(e,t,r=[64]){super("void"),this.isComputeNode=!0,this.computeNode=e,this.count=t,this.workgroupSize=r,this.dispatchCount=0,this.version=1,this.name="",this.updateBeforeType=Vs.OBJECT,this.onInitFunction=null,this.updateDispatchCount()}dispose(){this.dispatchEvent({type:"dispose"})}label(e){return this.name=e,this}updateDispatchCount(){const{count:e,workgroupSize:t}=this;let r=t[0];for(let e=1;eBi(new Eu(Bi(e),t,r));oi("compute",wu);class Au extends js{static get type(){return"CacheNode"}constructor(e,t=!0){super(),this.node=e,this.parent=t,this.isCacheNode=!0}getNodeType(e){const t=e.getCache(),r=e.getCacheFromNode(this,this.parent);e.setCache(r);const s=this.node.getNodeType(e);return e.setCache(t),s}build(e,...t){const r=e.getCache(),s=e.getCacheFromNode(this,this.parent);e.setCache(s);const i=this.node.build(e,...t);return e.setCache(r),i}}const Ru=(e,t)=>Bi(new Au(Bi(e),t)),Cu=(e,t)=>e.context({namespace:t});oi("cache",Ru);class Mu extends js{static get type(){return"BypassNode"}constructor(e,t){super(),this.isBypassNode=!0,this.outputNode=e,this.callNode=t}getNodeType(e){return this.outputNode.getNodeType(e)}generate(e){const t=this.callNode.build(e,"void");return""!==t&&e.addLineFlowCode(t,this),this.outputNode.build(e)}}const Pu=Vi(Mu).setParameterLength(2);oi("bypass",Pu);class Fu extends js{static get type(){return"RemapNode"}constructor(e,t,r,s=ji(0),i=ji(1)){super(),this.node=e,this.inLowNode=t,this.inHighNode=r,this.outLowNode=s,this.outHighNode=i,this.doClamp=!0}setup(){const{node:e,inLowNode:t,inHighNode:r,outLowNode:s,outHighNode:i,doClamp:n}=this;let a=e.sub(t).div(r.sub(t));return!0===n&&(a=a.clamp()),a.mul(i.sub(s)).add(s)}}const Lu=Vi(Fu,null,null,{doClamp:!1}).setParameterLength(3,5),Bu=Vi(Fu).setParameterLength(3,5);oi("remap",Lu),oi("remapClamp",Bu);class Iu extends js{static get type(){return"ExpressionNode"}constructor(e="",t="void"){super(t),this.snippet=e}generate(e,t){const r=this.getNodeType(e),s=this.snippet;if("void"!==r)return e.format(s,r,t);e.addLineFlowCode(s,this)}}const Du=Vi(Iu).setParameterLength(1,2),Vu=e=>(e?Xo(e,Du("discard")):Du("discard")).toStack();oi("discard",Vu);class Uu extends Ks{static get type(){return"RenderOutputNode"}constructor(e,t,r){super("vec4"),this.colorNode=e,this.toneMapping=t,this.outputColorSpace=r,this.isRenderOutputNode=!0}setup({context:e}){let t=this.colorNode||e.color;const r=(null!==this.toneMapping?this.toneMapping:e.toneMapping)||p,s=(null!==this.outputColorSpace?this.outputColorSpace:e.outputColorSpace)||x;return r!==p&&(t=t.toneMapping(r)),s!==x&&s!==c.workingColorSpace&&(t=t.workingToColorSpace(s)),t}}const Ou=(e,t=null,r=null)=>Bi(new Uu(Bi(e),t,r));oi("renderOutput",Ou);class ku extends Ks{static get type(){return"DebugNode"}constructor(e,t=null){super(),this.node=e,this.callback=t}getNodeType(e){return this.node.getNodeType(e)}setup(e){return this.node.build(e)}analyze(e){return this.node.build(e)}generate(e){const t=this.callback,r=this.node.build(e),s="--- TSL debug - "+e.shaderStage+" shader ---",i="-".repeat(s.length);let n="";return n+="// #"+s+"#\n",n+=e.flow.code.replace(/^\t/gm,"")+"\n",n+="/* ... */ "+r+" /* ... */\n",n+="// #"+i+"#\n",null!==t?t(e,n):console.log(n),r}}const Gu=(e,t=null)=>Bi(new ku(Bi(e),t));oi("debug",Gu);class zu extends js{static get type(){return"AttributeNode"}constructor(e,t=null){super(t),this.global=!0,this._attributeName=e}getHash(e){return this.getAttributeName(e)}getNodeType(e){let t=this.nodeType;if(null===t){const r=this.getAttributeName(e);if(e.hasGeometryAttribute(r)){const s=e.geometry.getAttribute(r);t=e.getTypeFromAttribute(s)}else t="float"}return t}setAttributeName(e){return this._attributeName=e,this}getAttributeName(){return this._attributeName}generate(e){const t=this.getAttributeName(e),r=this.getNodeType(e);if(!0===e.hasGeometryAttribute(t)){const s=e.geometry.getAttribute(t),i=e.getTypeFromAttribute(s),n=e.getAttribute(t,i);if("vertex"===e.shaderStage)return e.format(n.name,i,r);return nu(this).build(e,r)}return console.warn(`AttributeNode: Vertex attribute "${t}" not found on geometry.`),e.generateConst(r)}serialize(e){super.serialize(e),e.global=this.global,e._attributeName=this._attributeName}deserialize(e){super.deserialize(e),this.global=e.global,this._attributeName=e._attributeName}}const Hu=(e,t=null)=>Bi(new zu(e,t)),$u=(e=0)=>Hu("uv"+(e>0?e:""),"vec2");class Wu extends js{static get type(){return"TextureSizeNode"}constructor(e,t=null){super("uvec2"),this.isTextureSizeNode=!0,this.textureNode=e,this.levelNode=t}generate(e,t){const r=this.textureNode.build(e,"property"),s=null===this.levelNode?"0":this.levelNode.build(e,"int");return e.format(`${e.getMethod("textureDimensions")}( ${r}, ${s} )`,this.getNodeType(e),t)}}const ju=Vi(Wu).setParameterLength(1,2);class qu extends Qn{static get type(){return"MaxMipLevelNode"}constructor(e){super(0),this._textureNode=e,this.updateType=Vs.FRAME}get textureNode(){return this._textureNode}get texture(){return this._textureNode.value}update(){const e=this.texture,t=e.images,r=t&&t.length>0?t[0]&&t[0].image||t[0]:e.image;if(r&&void 0!==r.width){const{width:e,height:t}=r;this.value=Math.log2(Math.max(e,t))}}}const Xu=Vi(qu).setParameterLength(1),Ku=new b;class Yu extends Qn{static get type(){return"TextureNode"}constructor(e=Ku,t=null,r=null,s=null){super(e),this.isTextureNode=!0,this.uvNode=t,this.levelNode=r,this.biasNode=s,this.compareNode=null,this.depthNode=null,this.gradNode=null,this.sampler=!0,this.updateMatrix=!1,this.updateType=Vs.NONE,this.referenceNode=null,this._value=e,this._matrixUniform=null,this.setUpdateMatrix(null===t)}set value(e){this.referenceNode?this.referenceNode.value=e:this._value=e}get value(){return this.referenceNode?this.referenceNode.value:this._value}getUniformHash(){return this.value.uuid}getNodeType(){return!0===this.value.isDepthTexture?"float":this.value.type===T?"uvec4":this.value.type===_?"ivec4":"vec4"}getInputType(){return"texture"}getDefaultUV(){return $u(this.value.channel)}updateReference(){return this.value}getTransformedUV(e){return null===this._matrixUniform&&(this._matrixUniform=Zn(this.value.matrix)),this._matrixUniform.mul(en(e,1)).xy}setUpdateMatrix(e){return this.updateMatrix=e,this.updateType=e?Vs.OBJECT:Vs.NONE,this}setupUV(e,t){const r=this.value;return e.isFlipY()&&(r.image instanceof ImageBitmap&&!0===r.flipY||!0===r.isRenderTargetTexture||!0===r.isFramebufferTexture||!0===r.isDepthTexture)&&(t=this.sampler?t.flipY():t.setY(qi(ju(this,this.levelNode).y).sub(t.y).sub(1))),t}setup(e){const t=e.getNodeProperties(this);t.referenceNode=this.referenceNode;const r=this.value;if(!r||!0!==r.isTexture)throw new Error("THREE.TSL: `texture( value )` function expects a valid instance of THREE.Texture().");let s=this.uvNode;null!==s&&!0!==e.context.forceUVContext||!e.context.getUV||(s=e.context.getUV(this,e)),s||(s=this.getDefaultUV()),!0===this.updateMatrix&&(s=this.getTransformedUV(s)),s=this.setupUV(e,s);let i=this.levelNode;null===i&&e.context.getTextureLevel&&(i=e.context.getTextureLevel(this)),t.uvNode=s,t.levelNode=i,t.biasNode=this.biasNode,t.compareNode=this.compareNode,t.gradNode=this.gradNode,t.depthNode=this.depthNode}generateUV(e,t){return t.build(e,!0===this.sampler?"vec2":"ivec2")}generateSnippet(e,t,r,s,i,n,a,o){const u=this.value;let l;return l=s?e.generateTextureLevel(u,t,r,s,n):i?e.generateTextureBias(u,t,r,i,n):o?e.generateTextureGrad(u,t,r,o,n):a?e.generateTextureCompare(u,t,r,a,n):!1===this.sampler?e.generateTextureLoad(u,t,r,n):e.generateTexture(u,t,r,n),l}generate(e,t){const r=this.value,s=e.getNodeProperties(this),i=super.generate(e,"property");if(/^sampler/.test(t))return i+"_sampler";if(e.isReference(t))return i;{const n=e.getDataFromNode(this);let a=n.propertyName;if(void 0===a){const{uvNode:t,levelNode:r,biasNode:o,compareNode:u,depthNode:l,gradNode:d}=s,c=this.generateUV(e,t),h=r?r.build(e,"float"):null,p=o?o.build(e,"float"):null,g=l?l.build(e,"int"):null,m=u?u.build(e,"float"):null,f=d?[d[0].build(e,"vec2"),d[1].build(e,"vec2")]:null,y=e.getVarFromNode(this);a=e.getPropertyName(y);const x=this.generateSnippet(e,i,c,h,p,g,m,f);e.addLineFlowCode(`${a} = ${x}`,this),n.snippet=x,n.propertyName=a}let o=a;const u=this.getNodeType(e);return e.needsToWorkingColorSpace(r)&&(o=hu(Du(o,u),r.colorSpace).setup(e).build(e,u)),e.format(o,u,t)}}setSampler(e){return this.sampler=e,this}getSampler(){return this.sampler}uv(e){return console.warn("THREE.TextureNode: .uv() has been renamed. Use .sample() instead."),this.sample(e)}sample(e){const t=this.clone();return t.uvNode=Bi(e),t.referenceNode=this.getSelf(),Bi(t)}blur(e){const t=this.clone();t.biasNode=Bi(e).mul(Xu(t)),t.referenceNode=this.getSelf();const r=t.value;return!1===t.generateMipmaps&&(r&&!1===r.generateMipmaps||r.minFilter===v||r.magFilter===v)&&(console.warn("THREE.TSL: texture().blur() requires mipmaps and sampling. Use .generateMipmaps=true and .minFilter/.magFilter=THREE.LinearFilter in the Texture."),t.biasNode=null),Bi(t)}level(e){const t=this.clone();return t.levelNode=Bi(e),t.referenceNode=this.getSelf(),Bi(t)}size(e){return ju(this,e)}bias(e){const t=this.clone();return t.biasNode=Bi(e),t.referenceNode=this.getSelf(),Bi(t)}compare(e){const t=this.clone();return t.compareNode=Bi(e),t.referenceNode=this.getSelf(),Bi(t)}grad(e,t){const r=this.clone();return r.gradNode=[Bi(e),Bi(t)],r.referenceNode=this.getSelf(),Bi(r)}depth(e){const t=this.clone();return t.depthNode=Bi(e),t.referenceNode=this.getSelf(),Bi(t)}serialize(e){super.serialize(e),e.value=this.value.toJSON(e.meta).uuid,e.sampler=this.sampler,e.updateMatrix=this.updateMatrix,e.updateType=this.updateType}deserialize(e){super.deserialize(e),this.value=e.meta.textures[e.value],this.sampler=e.sampler,this.updateMatrix=e.updateMatrix,this.updateType=e.updateType}update(){const e=this.value,t=this._matrixUniform;null!==t&&(t.value=e.matrix),!0===e.matrixAutoUpdate&&e.updateMatrix()}clone(){const e=new this.constructor(this.value,this.uvNode,this.levelNode,this.biasNode);return e.sampler=this.sampler,e.depthNode=this.depthNode,e.compareNode=this.compareNode,e.gradNode=this.gradNode,e}}const Qu=Vi(Yu).setParameterLength(1,4).setName("texture"),Zu=(e=Ku,t=null,r=null,s=null)=>{let i;return e&&!0===e.isTextureNode?(i=Bi(e.clone()),i.referenceNode=e.getSelf(),null!==t&&(i.uvNode=Bi(t)),null!==r&&(i.levelNode=Bi(r)),null!==s&&(i.biasNode=Bi(s))):i=Qu(e,t,r,s),i},Ju=(...e)=>Zu(...e).setSampler(!1);class el extends Qn{static get type(){return"BufferNode"}constructor(e,t,r=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferCount=r}getElementType(e){return this.getNodeType(e)}getInputType(){return"buffer"}}const tl=(e,t,r)=>Bi(new el(e,t,r));class rl extends qs{static get type(){return"UniformArrayElementNode"}constructor(e,t){super(e,t),this.isArrayBufferElementNode=!0}generate(e){const t=super.generate(e),r=this.getNodeType(),s=this.node.getPaddedType();return e.format(t,s,r)}}class sl extends el{static get type(){return"UniformArrayNode"}constructor(e,t=null){super(null),this.array=e,this.elementType=null===t?Ms(e[0]):t,this.paddedType=this.getPaddedType(),this.updateType=Vs.RENDER,this.isArrayBufferNode=!0}getNodeType(){return this.paddedType}getElementType(){return this.elementType}getPaddedType(){const e=this.elementType;let t="vec4";return"mat2"===e?t="mat2":!0===/mat/.test(e)?t="mat4":"i"===e.charAt(0)?t="ivec4":"u"===e.charAt(0)&&(t="uvec4"),t}update(){const{array:e,value:t}=this,r=this.elementType;if("float"===r||"int"===r||"uint"===r)for(let r=0;rBi(new sl(e,t));const nl=Vi(class extends js{constructor(e){super("float"),this.name=e,this.isBuiltinNode=!0}generate(){return this.name}}).setParameterLength(1),al=Zn(0,"uint").label("u_cameraIndex").setGroup(qn("cameraIndex")).toVarying("v_cameraIndex"),ol=Zn("float").label("cameraNear").setGroup(Kn).onRenderUpdate((({camera:e})=>e.near)),ul=Zn("float").label("cameraFar").setGroup(Kn).onRenderUpdate((({camera:e})=>e.far)),ll=ki((({camera:e})=>{let t;if(e.isArrayCamera&&e.cameras.length>0){const r=[];for(const t of e.cameras)r.push(t.projectionMatrix);t=il(r).setGroup(Kn).label("cameraProjectionMatrices").element(e.isMultiViewCamera?nl("gl_ViewID_OVR"):al).toVar("cameraProjectionMatrix")}else t=Zn("mat4").label("cameraProjectionMatrix").setGroup(Kn).onRenderUpdate((({camera:e})=>e.projectionMatrix));return t})).once()(),dl=ki((({camera:e})=>{let t;if(e.isArrayCamera&&e.cameras.length>0){const r=[];for(const t of e.cameras)r.push(t.projectionMatrixInverse);t=il(r).setGroup(Kn).label("cameraProjectionMatricesInverse").element(e.isMultiViewCamera?nl("gl_ViewID_OVR"):al).toVar("cameraProjectionMatrixInverse")}else t=Zn("mat4").label("cameraProjectionMatrixInverse").setGroup(Kn).onRenderUpdate((({camera:e})=>e.projectionMatrixInverse));return t})).once()(),cl=ki((({camera:e})=>{let t;if(e.isArrayCamera&&e.cameras.length>0){const r=[];for(const t of e.cameras)r.push(t.matrixWorldInverse);t=il(r).setGroup(Kn).label("cameraViewMatrices").element(e.isMultiViewCamera?nl("gl_ViewID_OVR"):al).toVar("cameraViewMatrix")}else t=Zn("mat4").label("cameraViewMatrix").setGroup(Kn).onRenderUpdate((({camera:e})=>e.matrixWorldInverse));return t})).once()(),hl=Zn("mat4").label("cameraWorldMatrix").setGroup(Kn).onRenderUpdate((({camera:e})=>e.matrixWorld)),pl=Zn("mat3").label("cameraNormalMatrix").setGroup(Kn).onRenderUpdate((({camera:e})=>e.normalMatrix)),gl=Zn(new r).label("cameraPosition").setGroup(Kn).onRenderUpdate((({camera:e},t)=>t.value.setFromMatrixPosition(e.matrixWorld))),ml=new N;class fl extends js{static get type(){return"Object3DNode"}constructor(e,t=null){super(),this.scope=e,this.object3d=t,this.updateType=Vs.OBJECT,this.uniformNode=new Qn(null)}getNodeType(){const e=this.scope;return e===fl.WORLD_MATRIX?"mat4":e===fl.POSITION||e===fl.VIEW_POSITION||e===fl.DIRECTION||e===fl.SCALE?"vec3":e===fl.RADIUS?"float":void 0}update(e){const t=this.object3d,s=this.uniformNode,i=this.scope;if(i===fl.WORLD_MATRIX)s.value=t.matrixWorld;else if(i===fl.POSITION)s.value=s.value||new r,s.value.setFromMatrixPosition(t.matrixWorld);else if(i===fl.SCALE)s.value=s.value||new r,s.value.setFromMatrixScale(t.matrixWorld);else if(i===fl.DIRECTION)s.value=s.value||new r,t.getWorldDirection(s.value);else if(i===fl.VIEW_POSITION){const i=e.camera;s.value=s.value||new r,s.value.setFromMatrixPosition(t.matrixWorld),s.value.applyMatrix4(i.matrixWorldInverse)}else if(i===fl.RADIUS){const r=e.object.geometry;null===r.boundingSphere&&r.computeBoundingSphere(),ml.copy(r.boundingSphere).applyMatrix4(t.matrixWorld),s.value=ml.radius}}generate(e){const t=this.scope;return t===fl.WORLD_MATRIX?this.uniformNode.nodeType="mat4":t===fl.POSITION||t===fl.VIEW_POSITION||t===fl.DIRECTION||t===fl.SCALE?this.uniformNode.nodeType="vec3":t===fl.RADIUS&&(this.uniformNode.nodeType="float"),this.uniformNode.build(e)}serialize(e){super.serialize(e),e.scope=this.scope}deserialize(e){super.deserialize(e),this.scope=e.scope}}fl.WORLD_MATRIX="worldMatrix",fl.POSITION="position",fl.SCALE="scale",fl.VIEW_POSITION="viewPosition",fl.DIRECTION="direction",fl.RADIUS="radius";const yl=Vi(fl,fl.DIRECTION).setParameterLength(1),xl=Vi(fl,fl.WORLD_MATRIX).setParameterLength(1),bl=Vi(fl,fl.POSITION).setParameterLength(1),Tl=Vi(fl,fl.SCALE).setParameterLength(1),_l=Vi(fl,fl.VIEW_POSITION).setParameterLength(1),vl=Vi(fl,fl.RADIUS).setParameterLength(1);class Nl extends fl{static get type(){return"ModelNode"}constructor(e){super(e)}update(e){this.object3d=e.object,super.update(e)}}const Sl=Ui(Nl,Nl.DIRECTION),El=Ui(Nl,Nl.WORLD_MATRIX),wl=Ui(Nl,Nl.POSITION),Al=Ui(Nl,Nl.SCALE),Rl=Ui(Nl,Nl.VIEW_POSITION),Cl=Ui(Nl,Nl.RADIUS),Ml=Zn(new n).onObjectUpdate((({object:e},t)=>t.value.getNormalMatrix(e.matrixWorld))),Pl=Zn(new a).onObjectUpdate((({object:e},t)=>t.value.copy(e.matrixWorld).invert())),Fl=ki((e=>e.renderer.overrideNodes.modelViewMatrix||Ll)).once()().toVar("modelViewMatrix"),Ll=cl.mul(El),Bl=ki((e=>(e.context.isHighPrecisionModelViewMatrix=!0,Zn("mat4").onObjectUpdate((({object:e,camera:t})=>e.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,e.matrixWorld)))))).once()().toVar("highpModelViewMatrix"),Il=ki((e=>{const t=e.context.isHighPrecisionModelViewMatrix;return Zn("mat3").onObjectUpdate((({object:e,camera:r})=>(!0!==t&&e.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix))))})).once()().toVar("highpModelNormalViewMatrix"),Dl=Hu("position","vec3"),Vl=Dl.toVarying("positionLocal"),Ul=Dl.toVarying("positionPrevious"),Ol=ki((e=>El.mul(Vl).xyz.toVarying(e.getNamespace("v_positionWorld"))),"vec3").once("POSITION")(),kl=ki((e=>Vl.transformDirection(El).toVarying(e.getNamespace("v_positionWorldDirection")).normalize().toVar("positionWorldDirection")),"vec3").once("POSITION")(),Gl=ki((e=>e.context.setupPositionView().toVarying(e.getNamespace("v_positionView"))),"vec3").once("POSITION")(),zl=Gl.negate().toVarying("v_positionViewDirection").normalize().toVar("positionViewDirection");class Hl extends js{static get type(){return"FrontFacingNode"}constructor(){super("bool"),this.isFrontFacingNode=!0}generate(e){const{renderer:t,material:r}=e;return t.coordinateSystem===l&&r.side===S?"false":e.getFrontFacing()}}const $l=Ui(Hl),Wl=ji($l).mul(2).sub(1),jl=Hu("normal","vec3"),ql=ki((e=>!1===e.geometry.hasAttribute("normal")?(console.warn('THREE.TSL: Vertex attribute "normal" not found on geometry.'),en(0,1,0)):jl),"vec3").once()().toVar("normalLocal"),Xl=Gl.dFdx().cross(Gl.dFdy()).normalize().toVar("normalFlat"),Kl=ki((e=>{let t;return t=!0===e.material.flatShading?Xl:nu(td(ql),"v_normalView").normalize(),t}),"vec3").once()().toVar("normalView"),Yl=ki((e=>{let t=Kl.transformDirection(cl);return!0!==e.material.flatShading&&(t=nu(t,"v_normalWorld")),t}),"vec3").once()().normalize().toVar("normalWorld"),Ql=ki((e=>{let t=e.context.setupNormal().context({getUV:null});return!0!==e.material.flatShading&&(t=t.mul(Wl)),t}),"vec3").once()().toVar("transformedNormalView"),Zl=Ql.transformDirection(cl).toVar("transformedNormalWorld"),Jl=ki((e=>{let t=e.context.setupClearcoatNormal().context({getUV:null});return!0!==e.material.flatShading&&(t=t.mul(Wl)),t}),"vec3").once()().toVar("transformedClearcoatNormalView"),ed=ki((([e,t=El])=>{const r=dn(t),s=e.div(en(r[0].dot(r[0]),r[1].dot(r[1]),r[2].dot(r[2])));return r.mul(s).xyz})),td=ki((([e],t)=>{const r=t.renderer.overrideNodes.modelNormalViewMatrix;if(null!==r)return r.transformDirection(e);const s=Ml.mul(e);return cl.transformDirection(s)})),rd=new E,sd=new a,id=Zn(0).onReference((({material:e})=>e)).onObjectUpdate((({material:e})=>e.refractionRatio)),nd=Zn(1).onReference((({material:e})=>e)).onObjectUpdate((function({material:e,scene:t}){return e.envMap?e.envMapIntensity:t.environmentIntensity})),ad=Zn(new a).onReference((function(e){return e.material})).onObjectUpdate((function({material:e,scene:t}){const r=null!==t.environment&&null===e.envMap?t.environmentRotation:e.envMapRotation;return r?(rd.copy(r),sd.makeRotationFromEuler(rd)):sd.identity(),sd})),od=zl.negate().reflect(Ql),ud=zl.negate().refract(Ql,id),ld=od.transformDirection(cl).toVar("reflectVector"),dd=ud.transformDirection(cl).toVar("reflectVector"),cd=new w;class hd extends Yu{static get type(){return"CubeTextureNode"}constructor(e,t=null,r=null,s=null){super(e,t,r,s),this.isCubeTextureNode=!0}getInputType(){return"cubeTexture"}getDefaultUV(){const e=this.value;return e.mapping===A?ld:e.mapping===R?dd:(console.error('THREE.CubeTextureNode: Mapping "%s" not supported.',e.mapping),en(0,0,0))}setUpdateMatrix(){}setupUV(e,t){const r=this.value;return e.renderer.coordinateSystem!==d&&r.isRenderTargetTexture||(t=en(t.x.negate(),t.yz)),ad.mul(t)}generateUV(e,t){return t.build(e,"vec3")}}const pd=Vi(hd).setParameterLength(1,4).setName("cubeTexture"),gd=(e=cd,t=null,r=null,s=null)=>{let i;return e&&!0===e.isCubeTextureNode?(i=Bi(e.clone()),i.referenceNode=e.getSelf(),null!==t&&(i.uvNode=Bi(t)),null!==r&&(i.levelNode=Bi(r)),null!==s&&(i.biasNode=Bi(s))):i=pd(e,t,r,s),i};class md extends qs{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),r=this.referenceNode.getNodeType(),s=this.getNodeType();return e.format(t,r,s)}}class fd extends js{static get type(){return"ReferenceNode"}constructor(e,t,r=null,s=null){super(),this.property=e,this.uniformType=t,this.object=r,this.count=s,this.properties=e.split("."),this.reference=r,this.node=null,this.group=null,this.name=null,this.updateType=Vs.OBJECT}element(e){return Bi(new md(this,Bi(e)))}setGroup(e){return this.group=e,this}label(e){return this.name=e,this}setNodeType(e){let t=null;t=null!==this.count?tl(null,e,this.count):Array.isArray(this.getValueFromReference())?il(null,e):"texture"===e?Zu(null):"cubeTexture"===e?gd(null):Zn(null,e),null!==this.group&&t.setGroup(this.group),null!==this.name&&t.label(this.name),this.node=t.getSelf()}getNodeType(e){return null===this.node&&(this.updateReference(e),this.updateValue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let r=e[t[0]];for(let e=1;eBi(new fd(e,t,r)),xd=(e,t,r,s)=>Bi(new fd(e,t,s,r));class bd extends fd{static get type(){return"MaterialReferenceNode"}constructor(e,t,r=null){super(e,t,r),this.material=r,this.isMaterialReferenceNode=!0}updateReference(e){return this.reference=null!==this.material?this.material:e.material,this.reference}}const Td=(e,t,r=null)=>Bi(new bd(e,t,r)),_d=ki((e=>(!1===e.geometry.hasAttribute("tangent")&&e.geometry.computeTangents(),Hu("tangent","vec4"))))(),vd=_d.xyz.toVar("tangentLocal"),Nd=Fl.mul(nn(vd,0)).xyz.toVarying("v_tangentView").normalize().toVar("tangentView"),Sd=Nd.transformDirection(cl).toVarying("v_tangentWorld").normalize().toVar("tangentWorld"),Ed=Nd.toVar("transformedTangentView"),wd=Ed.transformDirection(cl).normalize().toVar("transformedTangentWorld"),Ad=ki((([e,t],r)=>{let s=e.mul(_d.w).xyz;return!0!==r.material.flatShading&&(s=nu(s,t)),s})).once(),Rd=Ad(jl.cross(_d),"v_bitangentGeometry").normalize().toVar("bitangentGeometry"),Cd=Ad(ql.cross(vd),"v_bitangentLocal").normalize().toVar("bitangentLocal"),Md=Ad(Kl.cross(Nd),"v_bitangentView").normalize().toVar("bitangentView"),Pd=Ad(Yl.cross(Sd),"v_bitangentWorld").normalize().toVar("bitangentWorld"),Fd=Ad(Ql.cross(Ed),"v_transformedBitangentView").normalize().toVar("transformedBitangentView"),Ld=Fd.transformDirection(cl).normalize().toVar("transformedBitangentWorld"),Bd=dn(Nd,Md,Kl),Id=zl.mul(Bd),Dd=(()=>{let e=Pn.cross(zl);return e=e.cross(Pn).normalize(),e=Io(e,Ql,Cn.mul(bn.oneMinus()).oneMinus().pow2().pow2()).normalize(),e})(),Vd=ki((e=>{const{eye_pos:t,surf_norm:r,mapN:s,uv:i}=e,n=t.dFdx(),a=t.dFdy(),o=i.dFdx(),u=i.dFdy(),l=r,d=a.cross(l),c=l.cross(n),h=d.mul(o.x).add(c.mul(u.x)),p=d.mul(o.y).add(c.mul(u.y)),g=h.dot(h).max(p.dot(p)),m=Wl.mul(g.inverseSqrt());return oa(h.mul(s.x,m),p.mul(s.y,m),l.mul(s.z)).normalize()}));class Ud extends Ks{static get type(){return"NormalMapNode"}constructor(e,t=null){super("vec3"),this.node=e,this.scaleNode=t,this.normalMapType=C}setup(e){const{normalMapType:t,scaleNode:r}=this;let s=this.node.mul(2).sub(1);null!==r&&(s=en(s.xy.mul(r),s.z));let i=null;if(t===M)i=td(s);else if(t===C){i=!0===e.hasGeometryAttribute("tangent")?Bd.mul(s).normalize():Vd({eye_pos:Gl,surf_norm:Kl,mapN:s,uv:$u()})}return i}}const Od=Vi(Ud).setParameterLength(1,2),kd=ki((({textureNode:e,bumpScale:t})=>{const r=t=>e.cache().context({getUV:e=>t(e.uvNode||$u()),forceUVContext:!0}),s=ji(r((e=>e)));return Yi(ji(r((e=>e.add(e.dFdx())))).sub(s),ji(r((e=>e.add(e.dFdy())))).sub(s)).mul(t)})),Gd=ki((e=>{const{surf_pos:t,surf_norm:r,dHdxy:s}=e,i=t.dFdx().normalize(),n=r,a=t.dFdy().normalize().cross(n),o=n.cross(i),u=i.dot(a).mul(Wl),l=u.sign().mul(s.x.mul(a).add(s.y.mul(o)));return u.abs().mul(r).sub(l).normalize()}));class zd extends Ks{static get type(){return"BumpMapNode"}constructor(e,t=null){super("vec3"),this.textureNode=e,this.scaleNode=t}setup(){const e=null!==this.scaleNode?this.scaleNode:1,t=kd({textureNode:this.textureNode,bumpScale:e});return Gd({surf_pos:Gl,surf_norm:Kl,dHdxy:t})}}const Hd=Vi(zd).setParameterLength(1,2),$d=new Map;class Wd extends js{static get type(){return"MaterialNode"}constructor(e){super(),this.scope=e}getCache(e,t){let r=$d.get(e);return void 0===r&&(r=Td(e,t),$d.set(e,r)),r}getFloat(e){return this.getCache(e,"float")}getColor(e){return this.getCache(e,"color")}getTexture(e){return this.getCache("map"===e?"map":e+"Map","texture")}setup(e){const t=e.context.material,r=this.scope;let s=null;if(r===Wd.COLOR){const e=void 0!==t.color?this.getColor(r):en();s=t.map&&!0===t.map.isTexture?e.mul(this.getTexture("map")):e}else if(r===Wd.OPACITY){const e=this.getFloat(r);s=t.alphaMap&&!0===t.alphaMap.isTexture?e.mul(this.getTexture("alpha")):e}else if(r===Wd.SPECULAR_STRENGTH)s=t.specularMap&&!0===t.specularMap.isTexture?this.getTexture("specular").r:ji(1);else if(r===Wd.SPECULAR_INTENSITY){const e=this.getFloat(r);s=t.specularIntensityMap&&!0===t.specularIntensityMap.isTexture?e.mul(this.getTexture(r).a):e}else if(r===Wd.SPECULAR_COLOR){const e=this.getColor(r);s=t.specularColorMap&&!0===t.specularColorMap.isTexture?e.mul(this.getTexture(r).rgb):e}else if(r===Wd.ROUGHNESS){const e=this.getFloat(r);s=t.roughnessMap&&!0===t.roughnessMap.isTexture?e.mul(this.getTexture(r).g):e}else if(r===Wd.METALNESS){const e=this.getFloat(r);s=t.metalnessMap&&!0===t.metalnessMap.isTexture?e.mul(this.getTexture(r).b):e}else if(r===Wd.EMISSIVE){const e=this.getFloat("emissiveIntensity"),i=this.getColor(r).mul(e);s=t.emissiveMap&&!0===t.emissiveMap.isTexture?i.mul(this.getTexture(r)):i}else if(r===Wd.NORMAL)t.normalMap?(s=Od(this.getTexture("normal"),this.getCache("normalScale","vec2")),s.normalMapType=t.normalMapType):s=t.bumpMap?Hd(this.getTexture("bump").r,this.getFloat("bumpScale")):Kl;else if(r===Wd.CLEARCOAT){const e=this.getFloat(r);s=t.clearcoatMap&&!0===t.clearcoatMap.isTexture?e.mul(this.getTexture(r).r):e}else if(r===Wd.CLEARCOAT_ROUGHNESS){const e=this.getFloat(r);s=t.clearcoatRoughnessMap&&!0===t.clearcoatRoughnessMap.isTexture?e.mul(this.getTexture(r).r):e}else if(r===Wd.CLEARCOAT_NORMAL)s=t.clearcoatNormalMap?Od(this.getTexture(r),this.getCache(r+"Scale","vec2")):Kl;else if(r===Wd.SHEEN){const e=this.getColor("sheenColor").mul(this.getFloat("sheen"));s=t.sheenColorMap&&!0===t.sheenColorMap.isTexture?e.mul(this.getTexture("sheenColor").rgb):e}else if(r===Wd.SHEEN_ROUGHNESS){const e=this.getFloat(r);s=t.sheenRoughnessMap&&!0===t.sheenRoughnessMap.isTexture?e.mul(this.getTexture(r).a):e,s=s.clamp(.07,1)}else if(r===Wd.ANISOTROPY)if(t.anisotropyMap&&!0===t.anisotropyMap.isTexture){const e=this.getTexture(r);s=ln(Cc.x,Cc.y,Cc.y.negate(),Cc.x).mul(e.rg.mul(2).sub(Yi(1)).normalize().mul(e.b))}else s=Cc;else if(r===Wd.IRIDESCENCE_THICKNESS){const e=yd("1","float",t.iridescenceThicknessRange);if(t.iridescenceThicknessMap){const i=yd("0","float",t.iridescenceThicknessRange);s=e.sub(i).mul(this.getTexture(r).g).add(i)}else s=e}else if(r===Wd.TRANSMISSION){const e=this.getFloat(r);s=t.transmissionMap?e.mul(this.getTexture(r).r):e}else if(r===Wd.THICKNESS){const e=this.getFloat(r);s=t.thicknessMap?e.mul(this.getTexture(r).g):e}else if(r===Wd.IOR)s=this.getFloat(r);else if(r===Wd.LIGHT_MAP)s=this.getTexture(r).rgb.mul(this.getFloat("lightMapIntensity"));else if(r===Wd.AO)s=this.getTexture(r).r.sub(1).mul(this.getFloat("aoMapIntensity")).add(1);else if(r===Wd.LINE_DASH_OFFSET)s=t.dashOffset?this.getFloat(r):ji(0);else{const t=this.getNodeType(e);s=this.getCache(r,t)}return s}}Wd.ALPHA_TEST="alphaTest",Wd.COLOR="color",Wd.OPACITY="opacity",Wd.SHININESS="shininess",Wd.SPECULAR="specular",Wd.SPECULAR_STRENGTH="specularStrength",Wd.SPECULAR_INTENSITY="specularIntensity",Wd.SPECULAR_COLOR="specularColor",Wd.REFLECTIVITY="reflectivity",Wd.ROUGHNESS="roughness",Wd.METALNESS="metalness",Wd.NORMAL="normal",Wd.CLEARCOAT="clearcoat",Wd.CLEARCOAT_ROUGHNESS="clearcoatRoughness",Wd.CLEARCOAT_NORMAL="clearcoatNormal",Wd.EMISSIVE="emissive",Wd.ROTATION="rotation",Wd.SHEEN="sheen",Wd.SHEEN_ROUGHNESS="sheenRoughness",Wd.ANISOTROPY="anisotropy",Wd.IRIDESCENCE="iridescence",Wd.IRIDESCENCE_IOR="iridescenceIOR",Wd.IRIDESCENCE_THICKNESS="iridescenceThickness",Wd.IOR="ior",Wd.TRANSMISSION="transmission",Wd.THICKNESS="thickness",Wd.ATTENUATION_DISTANCE="attenuationDistance",Wd.ATTENUATION_COLOR="attenuationColor",Wd.LINE_SCALE="scale",Wd.LINE_DASH_SIZE="dashSize",Wd.LINE_GAP_SIZE="gapSize",Wd.LINE_WIDTH="linewidth",Wd.LINE_DASH_OFFSET="dashOffset",Wd.POINT_SIZE="size",Wd.DISPERSION="dispersion",Wd.LIGHT_MAP="light",Wd.AO="ao";const jd=Ui(Wd,Wd.ALPHA_TEST),qd=Ui(Wd,Wd.COLOR),Xd=Ui(Wd,Wd.SHININESS),Kd=Ui(Wd,Wd.EMISSIVE),Yd=Ui(Wd,Wd.OPACITY),Qd=Ui(Wd,Wd.SPECULAR),Zd=Ui(Wd,Wd.SPECULAR_INTENSITY),Jd=Ui(Wd,Wd.SPECULAR_COLOR),ec=Ui(Wd,Wd.SPECULAR_STRENGTH),tc=Ui(Wd,Wd.REFLECTIVITY),rc=Ui(Wd,Wd.ROUGHNESS),sc=Ui(Wd,Wd.METALNESS),ic=Ui(Wd,Wd.NORMAL),nc=Ui(Wd,Wd.CLEARCOAT),ac=Ui(Wd,Wd.CLEARCOAT_ROUGHNESS),oc=Ui(Wd,Wd.CLEARCOAT_NORMAL),uc=Ui(Wd,Wd.ROTATION),lc=Ui(Wd,Wd.SHEEN),dc=Ui(Wd,Wd.SHEEN_ROUGHNESS),cc=Ui(Wd,Wd.ANISOTROPY),hc=Ui(Wd,Wd.IRIDESCENCE),pc=Ui(Wd,Wd.IRIDESCENCE_IOR),gc=Ui(Wd,Wd.IRIDESCENCE_THICKNESS),mc=Ui(Wd,Wd.TRANSMISSION),fc=Ui(Wd,Wd.THICKNESS),yc=Ui(Wd,Wd.IOR),xc=Ui(Wd,Wd.ATTENUATION_DISTANCE),bc=Ui(Wd,Wd.ATTENUATION_COLOR),Tc=Ui(Wd,Wd.LINE_SCALE),_c=Ui(Wd,Wd.LINE_DASH_SIZE),vc=Ui(Wd,Wd.LINE_GAP_SIZE),Nc=Ui(Wd,Wd.LINE_WIDTH),Sc=Ui(Wd,Wd.LINE_DASH_OFFSET),Ec=Ui(Wd,Wd.POINT_SIZE),wc=Ui(Wd,Wd.DISPERSION),Ac=Ui(Wd,Wd.LIGHT_MAP),Rc=Ui(Wd,Wd.AO),Cc=Zn(new t).onReference((function(e){return e.material})).onRenderUpdate((function({material:e}){this.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation))})),Mc=ki((e=>e.context.setupModelViewProjection()),"vec4").once()().toVarying("v_modelViewProjection");class Pc extends js{static get type(){return"IndexNode"}constructor(e){super("uint"),this.scope=e,this.isIndexNode=!0}generate(e){const t=this.getNodeType(e),r=this.scope;let s,i;if(r===Pc.VERTEX)s=e.getVertexIndex();else if(r===Pc.INSTANCE)s=e.getInstanceIndex();else if(r===Pc.DRAW)s=e.getDrawIndex();else if(r===Pc.INVOCATION_LOCAL)s=e.getInvocationLocalIndex();else if(r===Pc.INVOCATION_SUBGROUP)s=e.getInvocationSubgroupIndex();else{if(r!==Pc.SUBGROUP)throw new Error("THREE.IndexNode: Unknown scope: "+r);s=e.getSubgroupIndex()}if("vertex"===e.shaderStage||"compute"===e.shaderStage)i=s;else{i=nu(this).build(e,t)}return i}}Pc.VERTEX="vertex",Pc.INSTANCE="instance",Pc.SUBGROUP="subgroup",Pc.INVOCATION_LOCAL="invocationLocal",Pc.INVOCATION_SUBGROUP="invocationSubgroup",Pc.DRAW="draw";const Fc=Ui(Pc,Pc.VERTEX),Lc=Ui(Pc,Pc.INSTANCE),Bc=Ui(Pc,Pc.SUBGROUP),Ic=Ui(Pc,Pc.INVOCATION_SUBGROUP),Dc=Ui(Pc,Pc.INVOCATION_LOCAL),Vc=Ui(Pc,Pc.DRAW);class Uc extends js{static get type(){return"InstanceNode"}constructor(e,t,r=null){super("void"),this.count=e,this.instanceMatrix=t,this.instanceColor=r,this.instanceMatrixNode=null,this.instanceColorNode=null,this.updateType=Vs.FRAME,this.buffer=null,this.bufferColor=null}setup(e){const{count:t,instanceMatrix:r,instanceColor:s}=this;let{instanceMatrixNode:i,instanceColorNode:n}=this;if(null===i){if(t<=1e3)i=tl(r.array,"mat4",Math.max(t,1)).element(Lc);else{const e=new P(r.array,16,1);this.buffer=e;const t=r.usage===y?Su:Nu,s=[t(e,"vec4",16,0),t(e,"vec4",16,4),t(e,"vec4",16,8),t(e,"vec4",16,12)];i=cn(...s)}this.instanceMatrixNode=i}if(s&&null===n){const e=new F(s.array,3),t=s.usage===y?Su:Nu;this.bufferColor=e,n=en(t(e,"vec3",3,0)),this.instanceColorNode=n}const a=i.mul(Vl).xyz;if(Vl.assign(a),e.hasGeometryAttribute("normal")){const e=ed(ql,i);ql.assign(e)}null!==this.instanceColorNode&&fn("vec3","vInstanceColor").assign(this.instanceColorNode)}update(){this.instanceMatrix.usage!==y&&null!==this.buffer&&this.instanceMatrix.version!==this.buffer.version&&(this.buffer.version=this.instanceMatrix.version),this.instanceColor&&this.instanceColor.usage!==y&&null!==this.bufferColor&&this.instanceColor.version!==this.bufferColor.version&&(this.bufferColor.version=this.instanceColor.version)}}const Oc=Vi(Uc).setParameterLength(2,3);class kc extends Uc{static get type(){return"InstancedMeshNode"}constructor(e){const{count:t,instanceMatrix:r,instanceColor:s}=e;super(t,r,s),this.instancedMesh=e}}const Gc=Vi(kc).setParameterLength(1);class zc extends js{static get type(){return"BatchNode"}constructor(e){super("void"),this.batchMesh=e,this.batchingIdNode=null}setup(e){null===this.batchingIdNode&&(null===e.getDrawIndex()?this.batchingIdNode=Lc:this.batchingIdNode=Vc);const t=ki((([e])=>{const t=qi(ju(Ju(this.batchMesh._indirectTexture),0).x),r=qi(e).mod(t),s=qi(e).div(t);return Ju(this.batchMesh._indirectTexture,Qi(r,s)).x})).setLayout({name:"getIndirectIndex",type:"uint",inputs:[{name:"id",type:"int"}]}),r=t(qi(this.batchingIdNode)),s=this.batchMesh._matricesTexture,i=qi(ju(Ju(s),0).x),n=ji(r).mul(4).toInt().toVar(),a=n.mod(i),o=n.div(i),u=cn(Ju(s,Qi(a,o)),Ju(s,Qi(a.add(1),o)),Ju(s,Qi(a.add(2),o)),Ju(s,Qi(a.add(3),o))),l=this.batchMesh._colorsTexture;if(null!==l){const e=ki((([e])=>{const t=qi(ju(Ju(l),0).x),r=e,s=r.mod(t),i=r.div(t);return Ju(l,Qi(s,i)).rgb})).setLayout({name:"getBatchingColor",type:"vec3",inputs:[{name:"id",type:"int"}]}),t=e(r);fn("vec3","vBatchColor").assign(t)}const d=dn(u);Vl.assign(u.mul(Vl));const c=ql.div(en(d[0].dot(d[0]),d[1].dot(d[1]),d[2].dot(d[2]))),h=d.mul(c).xyz;ql.assign(h),e.hasGeometryAttribute("tangent")&&vd.mulAssign(d)}}const Hc=Vi(zc).setParameterLength(1);class $c extends qs{static get type(){return"StorageArrayElementNode"}constructor(e,t){super(e,t),this.isStorageArrayElementNode=!0}set storageBufferNode(e){this.node=e}get storageBufferNode(){return this.node}getMemberType(e,t){const r=this.storageBufferNode.structTypeNode;return r?r.getMemberType(e,t):"void"}setup(e){return!1===e.isAvailable("storageBuffer")&&!0===this.node.isPBO&&e.setupPBO(this.node),super.setup(e)}generate(e,t){let r;const s=e.context.assign;if(r=!1===e.isAvailable("storageBuffer")?!0!==this.node.isPBO||!0===s||!this.node.value.isInstancedBufferAttribute&&"compute"===e.shaderStage?this.node.build(e):e.generatePBO(this):super.generate(e),!0!==s){const s=this.getNodeType(e);r=e.format(r,s,t)}return r}}const Wc=Vi($c).setParameterLength(2);class jc extends el{static get type(){return"StorageBufferNode"}constructor(e,t=null,r=0){let s,i=null;t&&t.isStruct?(s="struct",i=t.layout,(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute)&&(r=e.count)):null===t&&(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute)?(s=Es(e.itemSize),r=e.count):s=t,super(e,s,r),this.isStorageBufferNode=!0,this.structTypeNode=i,this.access=Os.READ_WRITE,this.isAtomic=!1,this.isPBO=!1,this._attribute=null,this._varying=null,this.global=!0,!0!==e.isStorageBufferAttribute&&!0!==e.isStorageInstancedBufferAttribute&&(e.isInstancedBufferAttribute?e.isStorageInstancedBufferAttribute=!0:e.isStorageBufferAttribute=!0)}getHash(e){if(0===this.bufferCount){let t=e.globalCache.getData(this.value);return void 0===t&&(t={node:this},e.globalCache.setData(this.value,t)),t.node.uuid}return this.uuid}getInputType(){return this.value.isIndirectStorageBufferAttribute?"indirectStorageBuffer":"storageBuffer"}element(e){return Wc(this,e)}setPBO(e){return this.isPBO=e,this}getPBO(){return this.isPBO}setAccess(e){return this.access=e,this}toReadOnly(){return this.setAccess(Os.READ_ONLY)}setAtomic(e){return this.isAtomic=e,this}toAtomic(){return this.setAtomic(!0)}getAttributeData(){return null===this._attribute&&(this._attribute=_u(this.value),this._varying=nu(this._attribute)),{attribute:this._attribute,varying:this._varying}}getNodeType(e){if(null!==this.structTypeNode)return this.structTypeNode.getNodeType(e);if(e.isAvailable("storageBuffer")||e.isAvailable("indirectStorageBuffer"))return super.getNodeType(e);const{attribute:t}=this.getAttributeData();return t.getNodeType(e)}getMemberType(e,t){return null!==this.structTypeNode?this.structTypeNode.getMemberType(e,t):"void"}generate(e){if(null!==this.structTypeNode&&this.structTypeNode.build(e),e.isAvailable("storageBuffer")||e.isAvailable("indirectStorageBuffer"))return super.generate(e);const{attribute:t,varying:r}=this.getAttributeData(),s=r.build(e);return e.registerTransform(s,t),s}}const qc=(e,t=null,r=0)=>Bi(new jc(e,t,r)),Xc=new WeakMap;class Kc extends js{static get type(){return"SkinningNode"}constructor(e){super("void"),this.skinnedMesh=e,this.updateType=Vs.OBJECT,this.skinIndexNode=Hu("skinIndex","uvec4"),this.skinWeightNode=Hu("skinWeight","vec4"),this.bindMatrixNode=yd("bindMatrix","mat4"),this.bindMatrixInverseNode=yd("bindMatrixInverse","mat4"),this.boneMatricesNode=xd("skeleton.boneMatrices","mat4",e.skeleton.bones.length),this.positionNode=Vl,this.toPositionNode=Vl,this.previousBoneMatricesNode=null}getSkinnedPosition(e=this.boneMatricesNode,t=this.positionNode){const{skinIndexNode:r,skinWeightNode:s,bindMatrixNode:i,bindMatrixInverseNode:n}=this,a=e.element(r.x),o=e.element(r.y),u=e.element(r.z),l=e.element(r.w),d=i.mul(t),c=oa(a.mul(s.x).mul(d),o.mul(s.y).mul(d),u.mul(s.z).mul(d),l.mul(s.w).mul(d));return n.mul(c).xyz}getSkinnedNormal(e=this.boneMatricesNode,t=ql){const{skinIndexNode:r,skinWeightNode:s,bindMatrixNode:i,bindMatrixInverseNode:n}=this,a=e.element(r.x),o=e.element(r.y),u=e.element(r.z),l=e.element(r.w);let d=oa(s.x.mul(a),s.y.mul(o),s.z.mul(u),s.w.mul(l));return d=n.mul(d).mul(i),d.transformDirection(t).xyz}getPreviousSkinnedPosition(e){const t=e.object;return null===this.previousBoneMatricesNode&&(t.skeleton.previousBoneMatrices=new Float32Array(t.skeleton.boneMatrices),this.previousBoneMatricesNode=xd("skeleton.previousBoneMatrices","mat4",t.skeleton.bones.length)),this.getSkinnedPosition(this.previousBoneMatricesNode,Ul)}needsPreviousBoneMatrices(e){const t=e.renderer.getMRT();return t&&t.has("velocity")||!0===Fs(e.object).useVelocity}setup(e){this.needsPreviousBoneMatrices(e)&&Ul.assign(this.getPreviousSkinnedPosition(e));const t=this.getSkinnedPosition();if(this.toPositionNode&&this.toPositionNode.assign(t),e.hasGeometryAttribute("normal")){const t=this.getSkinnedNormal();ql.assign(t),e.hasGeometryAttribute("tangent")&&vd.assign(t)}return t}generate(e,t){if("void"!==t)return super.generate(e,t)}update(e){const t=e.object&&e.object.skeleton?e.object.skeleton:this.skinnedMesh.skeleton;Xc.get(t)!==e.frameId&&(Xc.set(t,e.frameId),null!==this.previousBoneMatricesNode&&t.previousBoneMatrices.set(t.boneMatrices),t.update())}}const Yc=e=>Bi(new Kc(e));class Qc extends js{static get type(){return"LoopNode"}constructor(e=[]){super(),this.params=e}getVarName(e){return String.fromCharCode("i".charCodeAt(0)+e)}getProperties(e){const t=e.getNodeProperties(this);if(void 0!==t.stackNode)return t;const r={};for(let e=0,t=this.params.length-1;eNumber(u)?">=":"<")),a)n=`while ( ${u} )`;else{const r={start:o,end:u},s=r.start,i=r.end;let a;const p=()=>c.includes("<")?"+=":"-=";if(null!=h)switch(typeof h){case"function":a=e.flowStagesNode(t.updateNode,"void").code.replace(/\t|;/g,"");break;case"number":a=l+" "+p()+" "+e.generateConst(d,h);break;case"string":a=l+" "+h;break;default:h.isNode?a=l+" "+p()+" "+h.build(e):(console.error("THREE.TSL: 'Loop( { update: ... } )' is not a function, string or number."),a="break /* invalid update */")}else h="int"===d||"uint"===d?c.includes("<")?"++":"--":p()+" 1.",a=l+" "+h;n=`for ( ${e.getVar(d,l)+" = "+s}; ${l+" "+c+" "+i}; ${a} )`}e.addFlowCode((0===s?"\n":"")+e.tab+n+" {\n\n").addFlowTab()}const i=s.build(e,"void"),n=t.returnsNode?t.returnsNode.build(e):"";e.removeFlowTab().addFlowCode("\n"+e.tab+i);for(let t=0,r=this.params.length-1;tBi(new Qc(Di(e,"int"))).toStack(),Jc=()=>Du("break").toStack(),eh=new WeakMap,th=new s,rh=ki((({bufferMap:e,influence:t,stride:r,width:s,depth:i,offset:n})=>{const a=qi(Fc).mul(r).add(n),o=a.div(s),u=a.sub(o.mul(s));return Ju(e,Qi(u,o)).depth(i).xyz.mul(t)}));class sh extends js{static get type(){return"MorphNode"}constructor(e){super("void"),this.mesh=e,this.morphBaseInfluence=Zn(1),this.updateType=Vs.OBJECT}setup(e){const{geometry:r}=e,s=void 0!==r.morphAttributes.position,i=r.hasAttribute("normal")&&void 0!==r.morphAttributes.normal,n=r.morphAttributes.position||r.morphAttributes.normal||r.morphAttributes.color,a=void 0!==n?n.length:0,{texture:o,stride:u,size:l}=function(e){const r=void 0!==e.morphAttributes.position,s=void 0!==e.morphAttributes.normal,i=void 0!==e.morphAttributes.color,n=e.morphAttributes.position||e.morphAttributes.normal||e.morphAttributes.color,a=void 0!==n?n.length:0;let o=eh.get(e);if(void 0===o||o.count!==a){void 0!==o&&o.texture.dispose();const u=e.morphAttributes.position||[],l=e.morphAttributes.normal||[],d=e.morphAttributes.color||[];let c=0;!0===r&&(c=1),!0===s&&(c=2),!0===i&&(c=3);let h=e.attributes.position.count*c,p=1;const g=4096;h>g&&(p=Math.ceil(h/g),h=g);const m=new Float32Array(h*p*4*a),f=new L(m,h,p,a);f.type=B,f.needsUpdate=!0;const y=4*c;for(let b=0;b{const t=ji(0).toVar();this.mesh.count>1&&null!==this.mesh.morphTexture&&void 0!==this.mesh.morphTexture?t.assign(Ju(this.mesh.morphTexture,Qi(qi(e).add(1),qi(Lc))).r):t.assign(yd("morphTargetInfluences","float").element(e).toVar()),Hi(t.notEqual(0),(()=>{!0===s&&Vl.addAssign(rh({bufferMap:o,influence:t,stride:u,width:d,depth:e,offset:qi(0)})),!0===i&&ql.addAssign(rh({bufferMap:o,influence:t,stride:u,width:d,depth:e,offset:qi(1)}))}))}))}update(){const e=this.morphBaseInfluence;this.mesh.geometry.morphTargetsRelative?e.value=1:e.value=1-this.mesh.morphTargetInfluences.reduce(((e,t)=>e+t),0)}}const ih=Vi(sh).setParameterLength(1);class nh extends js{static get type(){return"LightingNode"}constructor(){super("vec3"),this.isLightingNode=!0}}class ah extends nh{static get type(){return"AONode"}constructor(e=null){super(),this.aoNode=e}setup(e){e.context.ambientOcclusion.mulAssign(this.aoNode)}}class oh extends Yo{static get type(){return"LightingContextNode"}constructor(e,t=null,r=null,s=null){super(e),this.lightingModel=t,this.backdropNode=r,this.backdropAlphaNode=s,this._value=null}getContext(){const{backdropNode:e,backdropAlphaNode:t}=this,r={directDiffuse:en().toVar("directDiffuse"),directSpecular:en().toVar("directSpecular"),indirectDiffuse:en().toVar("indirectDiffuse"),indirectSpecular:en().toVar("indirectSpecular")};return{radiance:en().toVar("radiance"),irradiance:en().toVar("irradiance"),iblIrradiance:en().toVar("iblIrradiance"),ambientOcclusion:ji(1).toVar("ambientOcclusion"),reflectedLight:r,backdrop:e,backdropAlpha:t}}setup(e){return this.value=this._value||(this._value=this.getContext()),this.value.lightingModel=this.lightingModel||e.context.lightingModel,super.setup(e)}}const uh=Vi(oh);class lh extends nh{static get type(){return"IrradianceNode"}constructor(e){super(),this.node=e}setup(e){e.context.irradiance.addAssign(this.node)}}let dh,ch;class hh extends js{static get type(){return"ScreenNode"}constructor(e){super(),this.scope=e,this.isViewportNode=!0}getNodeType(){return this.scope===hh.VIEWPORT?"vec4":"vec2"}getUpdateType(){let e=Vs.NONE;return this.scope!==hh.SIZE&&this.scope!==hh.VIEWPORT||(e=Vs.RENDER),this.updateType=e,e}update({renderer:e}){const t=e.getRenderTarget();this.scope===hh.VIEWPORT?null!==t?ch.copy(t.viewport):(e.getViewport(ch),ch.multiplyScalar(e.getPixelRatio())):null!==t?(dh.width=t.width,dh.height=t.height):e.getDrawingBufferSize(dh)}setup(){const e=this.scope;let r=null;return r=e===hh.SIZE?Zn(dh||(dh=new t)):e===hh.VIEWPORT?Zn(ch||(ch=new s)):Yi(mh.div(gh)),r}generate(e){if(this.scope===hh.COORDINATE){let t=e.getFragCoord();if(e.isFlipY()){const r=e.getNodeProperties(gh).outputNode.build(e);t=`${e.getType("vec2")}( ${t}.x, ${r}.y - ${t}.y )`}return t}return super.generate(e)}}hh.COORDINATE="coordinate",hh.VIEWPORT="viewport",hh.SIZE="size",hh.UV="uv";const ph=Ui(hh,hh.UV),gh=Ui(hh,hh.SIZE),mh=Ui(hh,hh.COORDINATE),fh=Ui(hh,hh.VIEWPORT),yh=fh.zw,xh=mh.sub(fh.xy),bh=xh.div(yh),Th=ki((()=>(console.warn('THREE.TSL: "viewportResolution" is deprecated. Use "screenSize" instead.'),gh)),"vec2").once()(),_h=ki((()=>(console.warn('THREE.TSL: "viewportTopLeft" is deprecated. Use "screenUV" instead.'),ph)),"vec2").once()(),vh=ki((()=>(console.warn('THREE.TSL: "viewportBottomLeft" is deprecated. Use "screenUV.flipY()" instead.'),ph.flipY())),"vec2").once()(),Nh=new t;class Sh extends Yu{static get type(){return"ViewportTextureNode"}constructor(e=ph,t=null,r=null){null===r&&((r=new I).minFilter=D),super(r,e,t),this.generateMipmaps=!1,this.isOutputTextureNode=!0,this.updateBeforeType=Vs.FRAME}updateBefore(e){const t=e.renderer;t.getDrawingBufferSize(Nh);const r=this.value;r.image.width===Nh.width&&r.image.height===Nh.height||(r.image.width=Nh.width,r.image.height=Nh.height,r.needsUpdate=!0);const s=r.generateMipmaps;r.generateMipmaps=this.generateMipmaps,t.copyFramebufferToTexture(r),r.generateMipmaps=s}clone(){const e=new this.constructor(this.uvNode,this.levelNode,this.value);return e.generateMipmaps=this.generateMipmaps,e}}const Eh=Vi(Sh).setParameterLength(0,3),wh=Vi(Sh,null,null,{generateMipmaps:!0}).setParameterLength(0,3);let Ah=null;class Rh extends Sh{static get type(){return"ViewportDepthTextureNode"}constructor(e=ph,t=null){null===Ah&&(Ah=new V),super(e,t,Ah)}}const Ch=Vi(Rh).setParameterLength(0,2);class Mh extends js{static get type(){return"ViewportDepthNode"}constructor(e,t=null){super("float"),this.scope=e,this.valueNode=t,this.isViewportDepthNode=!0}generate(e){const{scope:t}=this;return t===Mh.DEPTH_BASE?e.getFragDepth():super.generate(e)}setup({camera:e}){const{scope:t}=this,r=this.valueNode;let s=null;if(t===Mh.DEPTH_BASE)null!==r&&(s=Ih().assign(r));else if(t===Mh.DEPTH)s=e.isPerspectiveCamera?Fh(Gl.z,ol,ul):Ph(Gl.z,ol,ul);else if(t===Mh.LINEAR_DEPTH)if(null!==r)if(e.isPerspectiveCamera){const e=Lh(r,ol,ul);s=Ph(e,ol,ul)}else s=r;else s=Ph(Gl.z,ol,ul);return s}}Mh.DEPTH_BASE="depthBase",Mh.DEPTH="depth",Mh.LINEAR_DEPTH="linearDepth";const Ph=(e,t,r)=>e.add(t).div(t.sub(r)),Fh=(e,t,r)=>t.add(e).mul(r).div(r.sub(t).mul(e)),Lh=(e,t,r)=>t.mul(r).div(r.sub(t).mul(e).sub(r)),Bh=(e,t,r)=>{t=t.max(1e-6).toVar();const s=ja(e.negate().div(t)),i=ja(r.div(t));return s.div(i)},Ih=Vi(Mh,Mh.DEPTH_BASE),Dh=Ui(Mh,Mh.DEPTH),Vh=Vi(Mh,Mh.LINEAR_DEPTH).setParameterLength(0,1),Uh=Vh(Ch());Dh.assign=e=>Ih(e);class Oh extends js{static get type(){return"ClippingNode"}constructor(e=Oh.DEFAULT){super(),this.scope=e}setup(e){super.setup(e);const t=e.clippingContext,{intersectionPlanes:r,unionPlanes:s}=t;return this.hardwareClipping=e.material.hardwareClipping,this.scope===Oh.ALPHA_TO_COVERAGE?this.setupAlphaToCoverage(r,s):this.scope===Oh.HARDWARE?this.setupHardwareClipping(s,e):this.setupDefault(r,s)}setupAlphaToCoverage(e,t){return ki((()=>{const r=ji().toVar("distanceToPlane"),s=ji().toVar("distanceToGradient"),i=ji(1).toVar("clipOpacity"),n=t.length;if(!1===this.hardwareClipping&&n>0){const e=il(t);Zc(n,(({i:t})=>{const n=e.element(t);r.assign(Gl.dot(n.xyz).negate().add(n.w)),s.assign(r.fwidth().div(2)),i.mulAssign(Oo(s.negate(),s,r))}))}const a=e.length;if(a>0){const t=il(e),n=ji(1).toVar("intersectionClipOpacity");Zc(a,(({i:e})=>{const i=t.element(e);r.assign(Gl.dot(i.xyz).negate().add(i.w)),s.assign(r.fwidth().div(2)),n.mulAssign(Oo(s.negate(),s,r).oneMinus())})),i.mulAssign(n.oneMinus())}yn.a.mulAssign(i),yn.a.equal(0).discard()}))()}setupDefault(e,t){return ki((()=>{const r=t.length;if(!1===this.hardwareClipping&&r>0){const e=il(t);Zc(r,(({i:t})=>{const r=e.element(t);Gl.dot(r.xyz).greaterThan(r.w).discard()}))}const s=e.length;if(s>0){const t=il(e),r=Ki(!0).toVar("clipped");Zc(s,(({i:e})=>{const s=t.element(e);r.assign(Gl.dot(s.xyz).greaterThan(s.w).and(r))})),r.discard()}}))()}setupHardwareClipping(e,t){const r=e.length;return t.enableHardwareClipping(r),ki((()=>{const s=il(e),i=nl(t.getClipDistance());Zc(r,(({i:e})=>{const t=s.element(e),r=Gl.dot(t.xyz).sub(t.w).negate();i.element(e).assign(r)}))}))()}}Oh.ALPHA_TO_COVERAGE="alphaToCoverage",Oh.DEFAULT="default",Oh.HARDWARE="hardware";const kh=ki((([e])=>Za(la(1e4,Ja(la(17,e.x).add(la(.1,e.y)))).mul(oa(.1,no(Ja(la(13,e.y).add(e.x)))))))),Gh=ki((([e])=>kh(Yi(kh(e.xy),e.z)))),zh=ki((([e])=>{const t=_o(oo(co(e.xyz)),oo(ho(e.xyz))),r=ji(1).div(ji(.05).mul(t)).toVar("pixScale"),s=Yi($a(Ka(ja(r))),$a(Ya(ja(r)))),i=Yi(Gh(Ka(s.x.mul(e.xyz))),Gh(Ka(s.y.mul(e.xyz)))),n=Za(ja(r)),a=oa(la(n.oneMinus(),i.x),la(n,i.y)),o=To(n,n.oneMinus()),u=en(a.mul(a).div(la(2,o).mul(ua(1,o))),a.sub(la(.5,o)).div(ua(1,o)),ua(1,ua(1,a).mul(ua(1,a)).div(la(2,o).mul(ua(1,o))))),l=a.lessThan(o.oneMinus()).select(a.lessThan(o).select(u.x,u.y),u.z);return Do(l,1e-6,1)})).setLayout({name:"getAlphaHashThreshold",type:"float",inputs:[{name:"position",type:"vec3"}]});class Hh extends zu{static get type(){return"VertexColorNode"}constructor(e){super(null,"vec4"),this.isVertexColorNode=!0,this.index=e}getAttributeName(){const e=this.index;return"color"+(e>0?e:"")}generate(e){const t=this.getAttributeName(e);let r;return r=!0===e.hasGeometryAttribute(t)?super.generate(e):e.generateConst(this.nodeType,new s(1,1,1,1)),r}serialize(e){super.serialize(e),e.index=this.index}deserialize(e){super.deserialize(e),this.index=e.index}}const $h=(e=0)=>Bi(new Hh(e));class Wh extends U{static get type(){return"NodeMaterial"}get type(){return this.constructor.type}set type(e){}constructor(){super(),this.isNodeMaterial=!0,this.fog=!0,this.lights=!1,this.hardwareClipping=!1,this.lightsNode=null,this.envNode=null,this.aoNode=null,this.colorNode=null,this.normalNode=null,this.opacityNode=null,this.backdropNode=null,this.backdropAlphaNode=null,this.alphaTestNode=null,this.maskNode=null,this.positionNode=null,this.geometryNode=null,this.depthNode=null,this.receivedShadowPositionNode=null,this.castShadowPositionNode=null,this.receivedShadowNode=null,this.castShadowNode=null,this.outputNode=null,this.mrtNode=null,this.fragmentNode=null,this.vertexNode=null,Object.defineProperty(this,"shadowPositionNode",{get:()=>this.receivedShadowPositionNode,set:e=>{console.warn('THREE.NodeMaterial: ".shadowPositionNode" was renamed to ".receivedShadowPositionNode".'),this.receivedShadowPositionNode=e}})}customProgramCacheKey(){return this.type+_s(this)}build(e){this.setup(e)}setupObserver(e){return new fs(e)}setup(e){e.context.setupNormal=()=>this.setupNormal(e),e.context.setupPositionView=()=>this.setupPositionView(e),e.context.setupModelViewProjection=()=>this.setupModelViewProjection(e);const t=e.renderer,r=t.getRenderTarget();e.addStack();const s=this.setupVertex(e),i=this.vertexNode||s;let n;e.stack.outputNode=i,this.setupHardwareClipping(e),null!==this.geometryNode&&(e.stack.outputNode=e.stack.outputNode.bypass(this.geometryNode)),e.addFlow("vertex",e.removeStack()),e.addStack();const a=this.setupClipping(e);if(!0!==this.depthWrite&&!0!==this.depthTest||(null!==r?!0===r.depthBuffer&&this.setupDepth(e):!0===t.depth&&this.setupDepth(e)),null===this.fragmentNode){this.setupDiffuseColor(e),this.setupVariants(e);const s=this.setupLighting(e);null!==a&&e.stack.add(a);const i=nn(s,yn.a).max(0);n=this.setupOutput(e,i),In.assign(n);const o=null!==this.outputNode;if(o&&(n=this.outputNode),null!==r){const e=t.getMRT(),r=this.mrtNode;null!==e?(o&&In.assign(n),n=e,null!==r&&(n=e.merge(r))):null!==r&&(n=r)}}else{let t=this.fragmentNode;!0!==t.isOutputStructNode&&(t=nn(t)),n=this.setupOutput(e,t)}e.stack.outputNode=n,e.addFlow("fragment",e.removeStack()),e.observer=this.setupObserver(e)}setupClipping(e){if(null===e.clippingContext)return null;const{unionPlanes:t,intersectionPlanes:r}=e.clippingContext;let s=null;if(t.length>0||r.length>0){const t=e.renderer.samples;this.alphaToCoverage&&t>1?s=Bi(new Oh(Oh.ALPHA_TO_COVERAGE)):e.stack.add(Bi(new Oh))}return s}setupHardwareClipping(e){if(this.hardwareClipping=!1,null===e.clippingContext)return;const t=e.clippingContext.unionPlanes.length;t>0&&t<=8&&e.isAvailable("clipDistance")&&(e.stack.add(Bi(new Oh(Oh.HARDWARE))),this.hardwareClipping=!0)}setupDepth(e){const{renderer:t,camera:r}=e;let s=this.depthNode;if(null===s){const e=t.getMRT();e&&e.has("depth")?s=e.get("depth"):!0===t.logarithmicDepthBuffer&&(s=r.isPerspectiveCamera?Bh(Gl.z,ol,ul):Ph(Gl.z,ol,ul))}null!==s&&Dh.assign(s).toStack()}setupPositionView(){return Fl.mul(Vl).xyz}setupModelViewProjection(){return ll.mul(Gl)}setupVertex(e){return e.addStack(),this.setupPosition(e),e.context.vertex=e.removeStack(),Mc}setupPosition(e){const{object:t,geometry:r}=e;if((r.morphAttributes.position||r.morphAttributes.normal||r.morphAttributes.color)&&ih(t).toStack(),!0===t.isSkinnedMesh&&Yc(t).toStack(),this.displacementMap){const e=Td("displacementMap","texture"),t=Td("displacementScale","float"),r=Td("displacementBias","float");Vl.addAssign(ql.normalize().mul(e.x.mul(t).add(r)))}return t.isBatchedMesh&&Hc(t).toStack(),t.isInstancedMesh&&t.instanceMatrix&&!0===t.instanceMatrix.isInstancedBufferAttribute&&Gc(t).toStack(),null!==this.positionNode&&Vl.assign(Cu(this.positionNode,"POSITION")),Vl}setupDiffuseColor({object:e,geometry:t}){null!==this.maskNode&&Ki(this.maskNode).not().discard();let r=this.colorNode?nn(this.colorNode):qd;if(!0===this.vertexColors&&t.hasAttribute("color")&&(r=r.mul($h())),e.instanceColor){r=fn("vec3","vInstanceColor").mul(r)}if(e.isBatchedMesh&&e._colorsTexture){r=fn("vec3","vBatchColor").mul(r)}yn.assign(r);const s=this.opacityNode?ji(this.opacityNode):Yd;yn.a.assign(yn.a.mul(s));let i=null;(null!==this.alphaTestNode||this.alphaTest>0)&&(i=null!==this.alphaTestNode?ji(this.alphaTestNode):jd,yn.a.lessThanEqual(i).discard()),!0===this.alphaHash&&yn.a.lessThan(zh(Vl)).discard();!1===this.transparent&&this.blending===O&&!1===this.alphaToCoverage?yn.a.assign(1):null===i&&yn.a.lessThanEqual(0).discard()}setupVariants(){}setupOutgoingLight(){return!0===this.lights?en(0):yn.rgb}setupNormal(){return this.normalNode?en(this.normalNode):ic}setupEnvironment(){let e=null;return this.envNode?e=this.envNode:this.envMap&&(e=this.envMap.isCubeTexture?Td("envMap","cubeTexture"):Td("envMap","texture")),e}setupLightMap(e){let t=null;return e.material.lightMap&&(t=new lh(Ac)),t}setupLights(e){const t=[],r=this.setupEnvironment(e);r&&r.isLightingNode&&t.push(r);const s=this.setupLightMap(e);if(s&&s.isLightingNode&&t.push(s),null!==this.aoNode||e.material.aoMap){const e=null!==this.aoNode?this.aoNode:Rc;t.push(new ah(e))}let i=this.lightsNode||e.lightsNode;return t.length>0&&(i=e.renderer.lighting.createNode([...i.getLights(),...t])),i}setupLightingModel(){}setupLighting(e){const{material:t}=e,{backdropNode:r,backdropAlphaNode:s,emissiveNode:i}=this,n=!0===this.lights||null!==this.lightsNode?this.setupLights(e):null;let a=this.setupOutgoingLight(e);if(n&&n.getScope().hasLights){const t=this.setupLightingModel(e)||null;a=uh(n,t,r,s)}else null!==r&&(a=en(null!==s?Io(a,r,s):r));return(i&&!0===i.isNode||t.emissive&&!0===t.emissive.isColor)&&(xn.assign(en(i||Kd)),a=a.add(xn)),a}setupFog(e,t){const r=e.fogNode;return r&&(In.assign(t),t=nn(r)),t}setupOutput(e,t){return!0===this.fog&&(t=this.setupFog(e,t)),t}setDefaultValues(e){for(const t in e){const r=e[t];void 0===this[t]&&(this[t]=r,r&&r.clone&&(this[t]=r.clone()))}const t=Object.getOwnPropertyDescriptors(e.constructor.prototype);for(const e in t)void 0===Object.getOwnPropertyDescriptor(this.constructor.prototype,e)&&void 0!==t[e].get&&Object.defineProperty(this.constructor.prototype,e,t[e])}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{},nodes:{}});const r=U.prototype.toJSON.call(this,e),s=vs(this);r.inputNodes={};for(const{property:t,childNode:i}of s)r.inputNodes[t]=i.toJSON(e).uuid;function i(e){const t=[];for(const r in e){const s=e[r];delete s.metadata,t.push(s)}return t}if(t){const t=i(e.textures),s=i(e.images),n=i(e.nodes);t.length>0&&(r.textures=t),s.length>0&&(r.images=s),n.length>0&&(r.nodes=n)}return r}copy(e){return this.lightsNode=e.lightsNode,this.envNode=e.envNode,this.colorNode=e.colorNode,this.normalNode=e.normalNode,this.opacityNode=e.opacityNode,this.backdropNode=e.backdropNode,this.backdropAlphaNode=e.backdropAlphaNode,this.alphaTestNode=e.alphaTestNode,this.maskNode=e.maskNode,this.positionNode=e.positionNode,this.geometryNode=e.geometryNode,this.depthNode=e.depthNode,this.receivedShadowPositionNode=e.receivedShadowPositionNode,this.castShadowPositionNode=e.castShadowPositionNode,this.receivedShadowNode=e.receivedShadowNode,this.castShadowNode=e.castShadowNode,this.outputNode=e.outputNode,this.mrtNode=e.mrtNode,this.fragmentNode=e.fragmentNode,this.vertexNode=e.vertexNode,super.copy(e)}}const jh=new k;class qh extends Wh{static get type(){return"LineBasicNodeMaterial"}constructor(e){super(),this.isLineBasicNodeMaterial=!0,this.setDefaultValues(jh),this.setValues(e)}}const Xh=new G;class Kh extends Wh{static get type(){return"LineDashedNodeMaterial"}constructor(e){super(),this.isLineDashedNodeMaterial=!0,this.setDefaultValues(Xh),this.dashOffset=0,this.offsetNode=null,this.dashScaleNode=null,this.dashSizeNode=null,this.gapSizeNode=null,this.setValues(e)}setupVariants(){const e=this.offsetNode?ji(this.offsetNode):Sc,t=this.dashScaleNode?ji(this.dashScaleNode):Tc,r=this.dashSizeNode?ji(this.dashSizeNode):_c,s=this.gapSizeNode?ji(this.gapSizeNode):vc;Dn.assign(r),Vn.assign(s);const i=nu(Hu("lineDistance").mul(t));(e?i.add(e):i).mod(Dn.add(Vn)).greaterThan(Dn).discard()}}let Yh=null;class Qh extends Sh{static get type(){return"ViewportSharedTextureNode"}constructor(e=ph,t=null){null===Yh&&(Yh=new I),super(e,t,Yh)}updateReference(){return this}}const Zh=Vi(Qh).setParameterLength(0,2),Jh=new G;class ep extends Wh{static get type(){return"Line2NodeMaterial"}constructor(e={}){super(),this.isLine2NodeMaterial=!0,this.setDefaultValues(Jh),this.useColor=e.vertexColors,this.dashOffset=0,this.lineWidth=1,this.lineColorNode=null,this.offsetNode=null,this.dashScaleNode=null,this.dashSizeNode=null,this.gapSizeNode=null,this.blending=z,this._useDash=e.dashed,this._useAlphaToCoverage=!0,this._useWorldUnits=!1,this.setValues(e)}setup(e){const{renderer:t}=e,r=this._useAlphaToCoverage,s=this.useColor,i=this._useDash,n=this._useWorldUnits,a=ki((({start:e,end:t})=>{const r=ll.element(2).element(2),s=ll.element(3).element(2).mul(-.5).div(r).sub(e.z).div(t.z.sub(e.z));return nn(Io(e.xyz,t.xyz,s),t.w)})).setLayout({name:"trimSegment",type:"vec4",inputs:[{name:"start",type:"vec4"},{name:"end",type:"vec4"}]});this.vertexNode=ki((()=>{const e=Hu("instanceStart"),t=Hu("instanceEnd"),r=nn(Fl.mul(nn(e,1))).toVar("start"),s=nn(Fl.mul(nn(t,1))).toVar("end");if(i){const e=this.dashScaleNode?ji(this.dashScaleNode):Tc,t=this.offsetNode?ji(this.offsetNode):Sc,r=Hu("instanceDistanceStart"),s=Hu("instanceDistanceEnd");let i=Dl.y.lessThan(.5).select(e.mul(r),e.mul(s));i=i.add(t),fn("float","lineDistance").assign(i)}n&&(fn("vec3","worldStart").assign(r.xyz),fn("vec3","worldEnd").assign(s.xyz));const o=fh.z.div(fh.w),u=ll.element(2).element(3).equal(-1);Hi(u,(()=>{Hi(r.z.lessThan(0).and(s.z.greaterThan(0)),(()=>{s.assign(a({start:r,end:s}))})).ElseIf(s.z.lessThan(0).and(r.z.greaterThanEqual(0)),(()=>{r.assign(a({start:s,end:r}))}))}));const l=ll.mul(r),d=ll.mul(s),c=l.xyz.div(l.w),h=d.xyz.div(d.w),p=h.xy.sub(c.xy).toVar();p.x.assign(p.x.mul(o)),p.assign(p.normalize());const g=nn().toVar();if(n){const e=s.xyz.sub(r.xyz).normalize(),t=Io(r.xyz,s.xyz,.5).normalize(),n=e.cross(t).normalize(),a=e.cross(n),o=fn("vec4","worldPos");o.assign(Dl.y.lessThan(.5).select(r,s));const u=Nc.mul(.5);o.addAssign(nn(Dl.x.lessThan(0).select(n.mul(u),n.mul(u).negate()),0)),i||(o.addAssign(nn(Dl.y.lessThan(.5).select(e.mul(u).negate(),e.mul(u)),0)),o.addAssign(nn(a.mul(u),0)),Hi(Dl.y.greaterThan(1).or(Dl.y.lessThan(0)),(()=>{o.subAssign(nn(a.mul(2).mul(u),0))}))),g.assign(ll.mul(o));const l=en().toVar();l.assign(Dl.y.lessThan(.5).select(c,h)),g.z.assign(l.z.mul(g.w))}else{const e=Yi(p.y,p.x.negate()).toVar("offset");p.x.assign(p.x.div(o)),e.x.assign(e.x.div(o)),e.assign(Dl.x.lessThan(0).select(e.negate(),e)),Hi(Dl.y.lessThan(0),(()=>{e.assign(e.sub(p))})).ElseIf(Dl.y.greaterThan(1),(()=>{e.assign(e.add(p))})),e.assign(e.mul(Nc)),e.assign(e.div(fh.w)),g.assign(Dl.y.lessThan(.5).select(l,d)),e.assign(e.mul(g.w)),g.assign(g.add(nn(e,0,0)))}return g}))();const o=ki((({p1:e,p2:t,p3:r,p4:s})=>{const i=e.sub(r),n=s.sub(r),a=t.sub(e),o=i.dot(n),u=n.dot(a),l=i.dot(a),d=n.dot(n),c=a.dot(a).mul(d).sub(u.mul(u)),h=o.mul(u).sub(l.mul(d)).div(c).clamp(),p=o.add(u.mul(h)).div(d).clamp();return Yi(h,p)}));if(this.colorNode=ki((()=>{const e=$u();if(i){const t=this.dashSizeNode?ji(this.dashSizeNode):_c,r=this.gapSizeNode?ji(this.gapSizeNode):vc;Dn.assign(t),Vn.assign(r);const s=fn("float","lineDistance");e.y.lessThan(-1).or(e.y.greaterThan(1)).discard(),s.mod(Dn.add(Vn)).greaterThan(Dn).discard()}const a=ji(1).toVar("alpha");if(n){const e=fn("vec3","worldStart"),s=fn("vec3","worldEnd"),n=fn("vec4","worldPos").xyz.normalize().mul(1e5),u=s.sub(e),l=o({p1:e,p2:s,p3:en(0,0,0),p4:n}),d=e.add(u.mul(l.x)),c=n.mul(l.y),h=d.sub(c).length().div(Nc);if(!i)if(r&&t.samples>1){const e=h.fwidth();a.assign(Oo(e.negate().add(.5),e.add(.5),h).oneMinus())}else h.greaterThan(.5).discard()}else if(r&&t.samples>1){const t=e.x,r=e.y.greaterThan(0).select(e.y.sub(1),e.y.add(1)),s=t.mul(t).add(r.mul(r)),i=ji(s.fwidth()).toVar("dlen");Hi(e.y.abs().greaterThan(1),(()=>{a.assign(Oo(i.oneMinus(),i.add(1),s).oneMinus())}))}else Hi(e.y.abs().greaterThan(1),(()=>{const t=e.x,r=e.y.greaterThan(0).select(e.y.sub(1),e.y.add(1));t.mul(t).add(r.mul(r)).greaterThan(1).discard()}));let u;if(this.lineColorNode)u=this.lineColorNode;else if(s){const e=Hu("instanceColorStart"),t=Hu("instanceColorEnd");u=Dl.y.lessThan(.5).select(e,t).mul(qd)}else u=qd;return nn(u,a)}))(),this.transparent){const e=this.opacityNode?ji(this.opacityNode):Yd;this.outputNode=nn(this.colorNode.rgb.mul(e).add(Zh().rgb.mul(e.oneMinus())),this.colorNode.a)}super.setup(e)}get worldUnits(){return this._useWorldUnits}set worldUnits(e){this._useWorldUnits!==e&&(this._useWorldUnits=e,this.needsUpdate=!0)}get dashed(){return this._useDash}set dashed(e){this._useDash!==e&&(this._useDash=e,this.needsUpdate=!0)}get alphaToCoverage(){return this._useAlphaToCoverage}set alphaToCoverage(e){this._useAlphaToCoverage!==e&&(this._useAlphaToCoverage=e,this.needsUpdate=!0)}}const tp=e=>Bi(e).mul(.5).add(.5),rp=new H;class sp extends Wh{static get type(){return"MeshNormalNodeMaterial"}constructor(e){super(),this.isMeshNormalNodeMaterial=!0,this.setDefaultValues(rp),this.setValues(e)}setupDiffuseColor(){const e=this.opacityNode?ji(this.opacityNode):Yd;yn.assign(hu(nn(tp(Ql),e),$))}}class ip extends Ks{static get type(){return"EquirectUVNode"}constructor(e=kl){super("vec2"),this.dirNode=e}setup(){const e=this.dirNode,t=e.z.atan(e.x).mul(1/(2*Math.PI)).add(.5),r=e.y.clamp(-1,1).asin().mul(1/Math.PI).add(.5);return Yi(t,r)}}const np=Vi(ip).setParameterLength(0,1);class ap extends W{constructor(e=1,t={}){super(e,t),this.isCubeRenderTarget=!0}fromEquirectangularTexture(e,t){const r=t.minFilter,s=t.generateMipmaps;t.generateMipmaps=!0,this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i=new j(5,5,5),n=np(kl),a=new Wh;a.colorNode=Zu(t,n,0),a.side=S,a.blending=z;const o=new q(i,a),u=new X;u.add(o),t.minFilter===D&&(t.minFilter=K);const l=new Y(1,10,this),d=e.getMRT();return e.setMRT(null),l.update(e,u),e.setMRT(d),t.minFilter=r,t.currentGenerateMipmaps=s,o.geometry.dispose(),o.material.dispose(),this}}const op=new WeakMap;class up extends Ks{static get type(){return"CubeMapNode"}constructor(e){super("vec3"),this.envNode=e,this._cubeTexture=null,this._cubeTextureNode=gd(null);const t=new w;t.isRenderTargetTexture=!0,this._defaultTexture=t,this.updateBeforeType=Vs.RENDER}updateBefore(e){const{renderer:t,material:r}=e,s=this.envNode;if(s.isTextureNode||s.isMaterialReferenceNode){const e=s.isTextureNode?s.value:r[s.property];if(e&&e.isTexture){const r=e.mapping;if(r===Q||r===Z){if(op.has(e)){const t=op.get(e);dp(t,e.mapping),this._cubeTexture=t}else{const r=e.image;if(function(e){return null!=e&&e.height>0}(r)){const s=new ap(r.height);s.fromEquirectangularTexture(t,e),dp(s.texture,e.mapping),this._cubeTexture=s.texture,op.set(e,s.texture),e.addEventListener("dispose",lp)}else this._cubeTexture=this._defaultTexture}this._cubeTextureNode.value=this._cubeTexture}else this._cubeTextureNode=this.envNode}}}setup(e){return this.updateBefore(e),this._cubeTextureNode}}function lp(e){const t=e.target;t.removeEventListener("dispose",lp);const r=op.get(t);void 0!==r&&(op.delete(t),r.dispose())}function dp(e,t){t===Q?e.mapping=A:t===Z&&(e.mapping=R)}const cp=Vi(up).setParameterLength(1);class hp extends nh{static get type(){return"BasicEnvironmentNode"}constructor(e=null){super(),this.envNode=e}setup(e){e.context.environment=cp(this.envNode)}}class pp extends nh{static get type(){return"BasicLightMapNode"}constructor(e=null){super(),this.lightMapNode=e}setup(e){const t=ji(1/Math.PI);e.context.irradianceLightMap=this.lightMapNode.mul(t)}}class gp{start(e){e.lightsNode.setupLights(e,e.lightsNode.getLightNodes(e)),this.indirect(e)}finish(){}direct(){}directRectArea(){}indirect(){}ambientOcclusion(){}}class mp extends gp{constructor(){super()}indirect({context:e}){const t=e.ambientOcclusion,r=e.reflectedLight,s=e.irradianceLightMap;r.indirectDiffuse.assign(nn(0)),s?r.indirectDiffuse.addAssign(s):r.indirectDiffuse.addAssign(nn(1,1,1,0)),r.indirectDiffuse.mulAssign(t),r.indirectDiffuse.mulAssign(yn.rgb)}finish(e){const{material:t,context:r}=e,s=r.outgoingLight,i=e.context.environment;if(i)switch(t.combine){case te:s.rgb.assign(Io(s.rgb,s.rgb.mul(i.rgb),ec.mul(tc)));break;case ee:s.rgb.assign(Io(s.rgb,i.rgb,ec.mul(tc)));break;case J:s.rgb.addAssign(i.rgb.mul(ec.mul(tc)));break;default:console.warn("THREE.BasicLightingModel: Unsupported .combine value:",t.combine)}}}const fp=new re;class yp extends Wh{static get type(){return"MeshBasicNodeMaterial"}constructor(e){super(),this.isMeshBasicNodeMaterial=!0,this.lights=!0,this.setDefaultValues(fp),this.setValues(e)}setupNormal(){return Kl}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new hp(t):null}setupLightMap(e){let t=null;return e.material.lightMap&&(t=new pp(Ac)),t}setupOutgoingLight(){return yn.rgb}setupLightingModel(){return new mp}}const xp=ki((({f0:e,f90:t,dotVH:r})=>{const s=r.mul(-5.55473).sub(6.98316).mul(r).exp2();return e.mul(s.oneMinus()).add(t.mul(s))})),bp=ki((e=>e.diffuseColor.mul(1/Math.PI))),Tp=ki((({dotNH:e})=>Bn.mul(ji(.5)).add(1).mul(ji(1/Math.PI)).mul(e.pow(Bn)))),_p=ki((({lightDirection:e})=>{const t=e.add(zl).normalize(),r=Ql.dot(t).clamp(),s=zl.dot(t).clamp(),i=xp({f0:Fn,f90:1,dotVH:s}),n=ji(.25),a=Tp({dotNH:r});return i.mul(n).mul(a)}));class vp extends mp{constructor(e=!0){super(),this.specular=e}direct({lightDirection:e,lightColor:t,reflectedLight:r}){const s=Ql.dot(e).clamp().mul(t);r.directDiffuse.addAssign(s.mul(bp({diffuseColor:yn.rgb}))),!0===this.specular&&r.directSpecular.addAssign(s.mul(_p({lightDirection:e})).mul(ec))}indirect(e){const{ambientOcclusion:t,irradiance:r,reflectedLight:s}=e.context;s.indirectDiffuse.addAssign(r.mul(bp({diffuseColor:yn}))),s.indirectDiffuse.mulAssign(t)}}const Np=new se;class Sp extends Wh{static get type(){return"MeshLambertNodeMaterial"}constructor(e){super(),this.isMeshLambertNodeMaterial=!0,this.lights=!0,this.setDefaultValues(Np),this.setValues(e)}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new hp(t):null}setupLightingModel(){return new vp(!1)}}const Ep=new ie;class wp extends Wh{static get type(){return"MeshPhongNodeMaterial"}constructor(e){super(),this.isMeshPhongNodeMaterial=!0,this.lights=!0,this.shininessNode=null,this.specularNode=null,this.setDefaultValues(Ep),this.setValues(e)}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new hp(t):null}setupLightingModel(){return new vp}setupVariants(){const e=(this.shininessNode?ji(this.shininessNode):Xd).max(1e-4);Bn.assign(e);const t=this.specularNode||Qd;Fn.assign(t)}copy(e){return this.shininessNode=e.shininessNode,this.specularNode=e.specularNode,super.copy(e)}}const Ap=ki((e=>{if(!1===e.geometry.hasAttribute("normal"))return ji(0);const t=Kl.dFdx().abs().max(Kl.dFdy().abs());return t.x.max(t.y).max(t.z)})),Rp=ki((e=>{const{roughness:t}=e,r=Ap();let s=t.max(.0525);return s=s.add(r),s=s.min(1),s})),Cp=ki((({alpha:e,dotNL:t,dotNV:r})=>{const s=e.pow2(),i=t.mul(s.add(s.oneMinus().mul(r.pow2())).sqrt()),n=r.mul(s.add(s.oneMinus().mul(t.pow2())).sqrt());return da(.5,i.add(n).max(Ia))})).setLayout({name:"V_GGX_SmithCorrelated",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNL",type:"float"},{name:"dotNV",type:"float"}]}),Mp=ki((({alphaT:e,alphaB:t,dotTV:r,dotBV:s,dotTL:i,dotBL:n,dotNV:a,dotNL:o})=>{const u=o.mul(en(e.mul(r),t.mul(s),a).length()),l=a.mul(en(e.mul(i),t.mul(n),o).length());return da(.5,u.add(l)).saturate()})).setLayout({name:"V_GGX_SmithCorrelated_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotTV",type:"float",qualifier:"in"},{name:"dotBV",type:"float",qualifier:"in"},{name:"dotTL",type:"float",qualifier:"in"},{name:"dotBL",type:"float",qualifier:"in"},{name:"dotNV",type:"float",qualifier:"in"},{name:"dotNL",type:"float",qualifier:"in"}]}),Pp=ki((({alpha:e,dotNH:t})=>{const r=e.pow2(),s=t.pow2().mul(r.oneMinus()).oneMinus();return r.div(s.pow2()).mul(1/Math.PI)})).setLayout({name:"D_GGX",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNH",type:"float"}]}),Fp=ji(1/Math.PI),Lp=ki((({alphaT:e,alphaB:t,dotNH:r,dotTH:s,dotBH:i})=>{const n=e.mul(t),a=en(t.mul(s),e.mul(i),n.mul(r)),o=a.dot(a),u=n.div(o);return Fp.mul(n.mul(u.pow2()))})).setLayout({name:"D_GGX_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotNH",type:"float",qualifier:"in"},{name:"dotTH",type:"float",qualifier:"in"},{name:"dotBH",type:"float",qualifier:"in"}]}),Bp=ki((e=>{const{lightDirection:t,f0:r,f90:s,roughness:i,f:n,USE_IRIDESCENCE:a,USE_ANISOTROPY:o}=e,u=e.normalView||Ql,l=i.pow2(),d=t.add(zl).normalize(),c=u.dot(t).clamp(),h=u.dot(zl).clamp(),p=u.dot(d).clamp(),g=zl.dot(d).clamp();let m,f,y=xp({f0:r,f90:s,dotVH:g});if(Pi(a)&&(y=En.mix(y,n)),Pi(o)){const e=Mn.dot(t),r=Mn.dot(zl),s=Mn.dot(d),i=Pn.dot(t),n=Pn.dot(zl),a=Pn.dot(d);m=Mp({alphaT:Rn,alphaB:l,dotTV:r,dotBV:n,dotTL:e,dotBL:i,dotNV:h,dotNL:c}),f=Lp({alphaT:Rn,alphaB:l,dotNH:p,dotTH:s,dotBH:a})}else m=Cp({alpha:l,dotNL:c,dotNV:h}),f=Pp({alpha:l,dotNH:p});return y.mul(m).mul(f)})),Ip=ki((({roughness:e,dotNV:t})=>{const r=nn(-1,-.0275,-.572,.022),s=nn(1,.0425,1.04,-.04),i=e.mul(r).add(s),n=i.x.mul(i.x).min(t.mul(-9.28).exp2()).mul(i.x).add(i.y);return Yi(-1.04,1.04).mul(n).add(i.zw)})).setLayout({name:"DFGApprox",type:"vec2",inputs:[{name:"roughness",type:"float"},{name:"dotNV",type:"vec3"}]}),Dp=ki((e=>{const{dotNV:t,specularColor:r,specularF90:s,roughness:i}=e,n=Ip({dotNV:t,roughness:i});return r.mul(n.x).add(s.mul(n.y))})),Vp=ki((({f:e,f90:t,dotVH:r})=>{const s=r.oneMinus().saturate(),i=s.mul(s),n=s.mul(i,i).clamp(0,.9999);return e.sub(en(t).mul(n)).div(n.oneMinus())})).setLayout({name:"Schlick_to_F0",type:"vec3",inputs:[{name:"f",type:"vec3"},{name:"f90",type:"float"},{name:"dotVH",type:"float"}]}),Up=ki((({roughness:e,dotNH:t})=>{const r=e.pow2(),s=ji(1).div(r),i=t.pow2().oneMinus().max(.0078125);return ji(2).add(s).mul(i.pow(s.mul(.5))).div(2*Math.PI)})).setLayout({name:"D_Charlie",type:"float",inputs:[{name:"roughness",type:"float"},{name:"dotNH",type:"float"}]}),Op=ki((({dotNV:e,dotNL:t})=>ji(1).div(ji(4).mul(t.add(e).sub(t.mul(e)))))).setLayout({name:"V_Neubelt",type:"float",inputs:[{name:"dotNV",type:"float"},{name:"dotNL",type:"float"}]}),kp=ki((({lightDirection:e})=>{const t=e.add(zl).normalize(),r=Ql.dot(e).clamp(),s=Ql.dot(zl).clamp(),i=Ql.dot(t).clamp(),n=Up({roughness:Sn,dotNH:i}),a=Op({dotNV:s,dotNL:r});return Nn.mul(n).mul(a)})),Gp=ki((({N:e,V:t,roughness:r})=>{const s=e.dot(t).saturate(),i=Yi(r,s.oneMinus().sqrt());return i.assign(i.mul(.984375).add(.0078125)),i})).setLayout({name:"LTC_Uv",type:"vec2",inputs:[{name:"N",type:"vec3"},{name:"V",type:"vec3"},{name:"roughness",type:"float"}]}),zp=ki((({f:e})=>{const t=e.length();return _o(t.mul(t).add(e.z).div(t.add(1)),0)})).setLayout({name:"LTC_ClippedSphereFormFactor",type:"float",inputs:[{name:"f",type:"vec3"}]}),Hp=ki((({v1:e,v2:t})=>{const r=e.dot(t),s=r.abs().toVar(),i=s.mul(.0145206).add(.4965155).mul(s).add(.8543985).toVar(),n=s.add(4.1616724).mul(s).add(3.417594).toVar(),a=i.div(n),o=r.greaterThan(0).select(a,_o(r.mul(r).oneMinus(),1e-7).inverseSqrt().mul(.5).sub(a));return e.cross(t).mul(o)})).setLayout({name:"LTC_EdgeVectorFormFactor",type:"vec3",inputs:[{name:"v1",type:"vec3"},{name:"v2",type:"vec3"}]}),$p=ki((({N:e,V:t,P:r,mInv:s,p0:i,p1:n,p2:a,p3:o})=>{const u=n.sub(i).toVar(),l=o.sub(i).toVar(),d=u.cross(l),c=en().toVar();return Hi(d.dot(r.sub(i)).greaterThanEqual(0),(()=>{const u=t.sub(e.mul(t.dot(e))).normalize(),l=e.cross(u).negate(),d=s.mul(dn(u,l,e).transpose()).toVar(),h=d.mul(i.sub(r)).normalize().toVar(),p=d.mul(n.sub(r)).normalize().toVar(),g=d.mul(a.sub(r)).normalize().toVar(),m=d.mul(o.sub(r)).normalize().toVar(),f=en(0).toVar();f.addAssign(Hp({v1:h,v2:p})),f.addAssign(Hp({v1:p,v2:g})),f.addAssign(Hp({v1:g,v2:m})),f.addAssign(Hp({v1:m,v2:h})),c.assign(en(zp({f:f})))})),c})).setLayout({name:"LTC_Evaluate",type:"vec3",inputs:[{name:"N",type:"vec3"},{name:"V",type:"vec3"},{name:"P",type:"vec3"},{name:"mInv",type:"mat3"},{name:"p0",type:"vec3"},{name:"p1",type:"vec3"},{name:"p2",type:"vec3"},{name:"p3",type:"vec3"}]}),Wp=ki((({P:e,p0:t,p1:r,p2:s,p3:i})=>{const n=r.sub(t).toVar(),a=i.sub(t).toVar(),o=n.cross(a),u=en().toVar();return Hi(o.dot(e.sub(t)).greaterThanEqual(0),(()=>{const n=t.sub(e).normalize().toVar(),a=r.sub(e).normalize().toVar(),o=s.sub(e).normalize().toVar(),l=i.sub(e).normalize().toVar(),d=en(0).toVar();d.addAssign(Hp({v1:n,v2:a})),d.addAssign(Hp({v1:a,v2:o})),d.addAssign(Hp({v1:o,v2:l})),d.addAssign(Hp({v1:l,v2:n})),u.assign(en(zp({f:d.abs()})))})),u})).setLayout({name:"LTC_Evaluate",type:"vec3",inputs:[{name:"P",type:"vec3"},{name:"p0",type:"vec3"},{name:"p1",type:"vec3"},{name:"p2",type:"vec3"},{name:"p3",type:"vec3"}]}),jp=1/6,qp=e=>la(jp,la(e,la(e,e.negate().add(3)).sub(3)).add(1)),Xp=e=>la(jp,la(e,la(e,la(3,e).sub(6))).add(4)),Kp=e=>la(jp,la(e,la(e,la(-3,e).add(3)).add(3)).add(1)),Yp=e=>la(jp,Ro(e,3)),Qp=e=>qp(e).add(Xp(e)),Zp=e=>Kp(e).add(Yp(e)),Jp=e=>oa(-1,Xp(e).div(qp(e).add(Xp(e)))),eg=e=>oa(1,Yp(e).div(Kp(e).add(Yp(e)))),tg=(e,t,r)=>{const s=e.uvNode,i=la(s,t.zw).add(.5),n=Ka(i),a=Za(i),o=Qp(a.x),u=Zp(a.x),l=Jp(a.x),d=eg(a.x),c=Jp(a.y),h=eg(a.y),p=Yi(n.x.add(l),n.y.add(c)).sub(.5).mul(t.xy),g=Yi(n.x.add(d),n.y.add(c)).sub(.5).mul(t.xy),m=Yi(n.x.add(l),n.y.add(h)).sub(.5).mul(t.xy),f=Yi(n.x.add(d),n.y.add(h)).sub(.5).mul(t.xy),y=Qp(a.y).mul(oa(o.mul(e.sample(p).level(r)),u.mul(e.sample(g).level(r)))),x=Zp(a.y).mul(oa(o.mul(e.sample(m).level(r)),u.mul(e.sample(f).level(r))));return y.add(x)},rg=ki((([e,t=ji(3)])=>{const r=Yi(e.size(qi(t))),s=Yi(e.size(qi(t.add(1)))),i=da(1,r),n=da(1,s),a=tg(e,nn(i,r),Ka(t)),o=tg(e,nn(n,s),Ya(t));return Za(t).mix(a,o)})),sg=ki((([e,t,r,s,i])=>{const n=en(Uo(t.negate(),Qa(e),da(1,s))),a=en(oo(i[0].xyz),oo(i[1].xyz),oo(i[2].xyz));return Qa(n).mul(r.mul(a))})).setLayout({name:"getVolumeTransmissionRay",type:"vec3",inputs:[{name:"n",type:"vec3"},{name:"v",type:"vec3"},{name:"thickness",type:"float"},{name:"ior",type:"float"},{name:"modelMatrix",type:"mat4"}]}),ig=ki((([e,t])=>e.mul(Do(t.mul(2).sub(2),0,1)))).setLayout({name:"applyIorToRoughness",type:"float",inputs:[{name:"roughness",type:"float"},{name:"ior",type:"float"}]}),ng=wh(),ag=wh(),og=ki((([e,t,r],{material:s})=>{const i=(s.side===S?ng:ag).sample(e),n=ja(gh.x).mul(ig(t,r));return rg(i,n)})),ug=ki((([e,t,r])=>(Hi(r.notEqual(0),(()=>{const s=Wa(t).negate().div(r);return Ha(s.negate().mul(e))})),en(1)))).setLayout({name:"volumeAttenuation",type:"vec3",inputs:[{name:"transmissionDistance",type:"float"},{name:"attenuationColor",type:"vec3"},{name:"attenuationDistance",type:"float"}]}),lg=ki((([e,t,r,s,i,n,a,o,u,l,d,c,h,p,g])=>{let m,f;if(g){m=nn().toVar(),f=en().toVar();const i=d.sub(1).mul(g.mul(.025)),n=en(d.sub(i),d,d.add(i));Zc({start:0,end:3},(({i:i})=>{const d=n.element(i),g=sg(e,t,c,d,o),y=a.add(g),x=l.mul(u.mul(nn(y,1))),b=Yi(x.xy.div(x.w)).toVar();b.addAssign(1),b.divAssign(2),b.assign(Yi(b.x,b.y.oneMinus()));const T=og(b,r,d);m.element(i).assign(T.element(i)),m.a.addAssign(T.a),f.element(i).assign(s.element(i).mul(ug(oo(g),h,p).element(i)))})),m.a.divAssign(3)}else{const i=sg(e,t,c,d,o),n=a.add(i),g=l.mul(u.mul(nn(n,1))),y=Yi(g.xy.div(g.w)).toVar();y.addAssign(1),y.divAssign(2),y.assign(Yi(y.x,y.y.oneMinus())),m=og(y,r,d),f=s.mul(ug(oo(i),h,p))}const y=f.rgb.mul(m.rgb),x=e.dot(t).clamp(),b=en(Dp({dotNV:x,specularColor:i,specularF90:n,roughness:r})),T=f.r.add(f.g,f.b).div(3);return nn(b.oneMinus().mul(y),m.a.oneMinus().mul(T).oneMinus())})),dg=dn(3.2404542,-.969266,.0556434,-1.5371385,1.8760108,-.2040259,-.4985314,.041556,1.0572252),cg=(e,t)=>e.sub(t).div(e.add(t)).pow2(),hg=ki((({outsideIOR:e,eta2:t,cosTheta1:r,thinFilmThickness:s,baseF0:i})=>{const n=Io(e,t,Oo(0,.03,s)),a=e.div(n).pow2().mul(r.pow2().oneMinus()).oneMinus();Hi(a.lessThan(0),(()=>en(1)));const o=a.sqrt(),u=cg(n,e),l=xp({f0:u,f90:1,dotVH:r}),d=l.oneMinus(),c=n.lessThan(e).select(Math.PI,0),h=ji(Math.PI).sub(c),p=(e=>{const t=e.sqrt();return en(1).add(t).div(en(1).sub(t))})(i.clamp(0,.9999)),g=cg(p,n.toVec3()),m=xp({f0:g,f90:1,dotVH:o}),f=en(p.x.lessThan(n).select(Math.PI,0),p.y.lessThan(n).select(Math.PI,0),p.z.lessThan(n).select(Math.PI,0)),y=n.mul(s,o,2),x=en(h).add(f),b=l.mul(m).clamp(1e-5,.9999),T=b.sqrt(),_=d.pow2().mul(m).div(en(1).sub(b)),v=l.add(_).toVar(),N=_.sub(d).toVar();return Zc({start:1,end:2,condition:"<=",name:"m"},(({m:e})=>{N.mulAssign(T);const t=((e,t)=>{const r=e.mul(2*Math.PI*1e-9),s=en(54856e-17,44201e-17,52481e-17),i=en(1681e3,1795300,2208400),n=en(43278e5,93046e5,66121e5),a=ji(9747e-17*Math.sqrt(2*Math.PI*45282e5)).mul(r.mul(2239900).add(t.x).cos()).mul(r.pow2().mul(-45282e5).exp());let o=s.mul(n.mul(2*Math.PI).sqrt()).mul(i.mul(r).add(t).cos()).mul(r.pow2().negate().mul(n).exp());return o=en(o.x.add(a),o.y,o.z).div(1.0685e-7),dg.mul(o)})(ji(e).mul(y),ji(e).mul(x)).mul(2);v.addAssign(N.mul(t))})),v.max(en(0))})).setLayout({name:"evalIridescence",type:"vec3",inputs:[{name:"outsideIOR",type:"float"},{name:"eta2",type:"float"},{name:"cosTheta1",type:"float"},{name:"thinFilmThickness",type:"float"},{name:"baseF0",type:"vec3"}]}),pg=ki((({normal:e,viewDir:t,roughness:r})=>{const s=e.dot(t).saturate(),i=r.pow2(),n=Xo(r.lessThan(.25),ji(-339.2).mul(i).add(ji(161.4).mul(r)).sub(25.9),ji(-8.48).mul(i).add(ji(14.3).mul(r)).sub(9.95)),a=Xo(r.lessThan(.25),ji(44).mul(i).sub(ji(23.7).mul(r)).add(3.26),ji(1.97).mul(i).sub(ji(3.27).mul(r)).add(.72));return Xo(r.lessThan(.25),0,ji(.1).mul(r).sub(.025)).add(n.mul(s).add(a).exp()).mul(1/Math.PI).saturate()})),gg=en(.04),mg=ji(1);class fg extends gp{constructor(e=!1,t=!1,r=!1,s=!1,i=!1,n=!1){super(),this.clearcoat=e,this.sheen=t,this.iridescence=r,this.anisotropy=s,this.transmission=i,this.dispersion=n,this.clearcoatRadiance=null,this.clearcoatSpecularDirect=null,this.clearcoatSpecularIndirect=null,this.sheenSpecularDirect=null,this.sheenSpecularIndirect=null,this.iridescenceFresnel=null,this.iridescenceF0=null}start(e){if(!0===this.clearcoat&&(this.clearcoatRadiance=en().toVar("clearcoatRadiance"),this.clearcoatSpecularDirect=en().toVar("clearcoatSpecularDirect"),this.clearcoatSpecularIndirect=en().toVar("clearcoatSpecularIndirect")),!0===this.sheen&&(this.sheenSpecularDirect=en().toVar("sheenSpecularDirect"),this.sheenSpecularIndirect=en().toVar("sheenSpecularIndirect")),!0===this.iridescence){const e=Ql.dot(zl).clamp();this.iridescenceFresnel=hg({outsideIOR:ji(1),eta2:wn,cosTheta1:e,thinFilmThickness:An,baseF0:Fn}),this.iridescenceF0=Vp({f:this.iridescenceFresnel,f90:1,dotVH:e})}if(!0===this.transmission){const t=Ol,r=gl.sub(Ol).normalize(),s=Zl,i=e.context;i.backdrop=lg(s,r,bn,yn,Fn,Ln,t,El,cl,ll,On,Gn,Hn,zn,this.dispersion?$n:null),i.backdropAlpha=kn,yn.a.mulAssign(Io(1,i.backdrop.a,kn))}super.start(e)}computeMultiscattering(e,t,r){const s=Ql.dot(zl).clamp(),i=Ip({roughness:bn,dotNV:s}),n=(this.iridescenceF0?En.mix(Fn,this.iridescenceF0):Fn).mul(i.x).add(r.mul(i.y)),a=i.x.add(i.y).oneMinus(),o=Fn.add(Fn.oneMinus().mul(.047619)),u=n.mul(o).div(a.mul(o).oneMinus());e.addAssign(n),t.addAssign(u.mul(a))}direct({lightDirection:e,lightColor:t,reflectedLight:r}){const s=Ql.dot(e).clamp().mul(t);if(!0===this.sheen&&this.sheenSpecularDirect.addAssign(s.mul(kp({lightDirection:e}))),!0===this.clearcoat){const r=Jl.dot(e).clamp().mul(t);this.clearcoatSpecularDirect.addAssign(r.mul(Bp({lightDirection:e,f0:gg,f90:mg,roughness:vn,normalView:Jl})))}r.directDiffuse.addAssign(s.mul(bp({diffuseColor:yn.rgb}))),r.directSpecular.addAssign(s.mul(Bp({lightDirection:e,f0:Fn,f90:1,roughness:bn,iridescence:this.iridescence,f:this.iridescenceFresnel,USE_IRIDESCENCE:this.iridescence,USE_ANISOTROPY:this.anisotropy})))}directRectArea({lightColor:e,lightPosition:t,halfWidth:r,halfHeight:s,reflectedLight:i,ltc_1:n,ltc_2:a}){const o=t.add(r).sub(s),u=t.sub(r).sub(s),l=t.sub(r).add(s),d=t.add(r).add(s),c=Ql,h=zl,p=Gl.toVar(),g=Gp({N:c,V:h,roughness:bn}),m=n.sample(g).toVar(),f=a.sample(g).toVar(),y=dn(en(m.x,0,m.y),en(0,1,0),en(m.z,0,m.w)).toVar(),x=Fn.mul(f.x).add(Fn.oneMinus().mul(f.y)).toVar();i.directSpecular.addAssign(e.mul(x).mul($p({N:c,V:h,P:p,mInv:y,p0:o,p1:u,p2:l,p3:d}))),i.directDiffuse.addAssign(e.mul(yn).mul($p({N:c,V:h,P:p,mInv:dn(1,0,0,0,1,0,0,0,1),p0:o,p1:u,p2:l,p3:d})))}indirect(e){this.indirectDiffuse(e),this.indirectSpecular(e),this.ambientOcclusion(e)}indirectDiffuse(e){const{irradiance:t,reflectedLight:r}=e.context;r.indirectDiffuse.addAssign(t.mul(bp({diffuseColor:yn})))}indirectSpecular(e){const{radiance:t,iblIrradiance:r,reflectedLight:s}=e.context;if(!0===this.sheen&&this.sheenSpecularIndirect.addAssign(r.mul(Nn,pg({normal:Ql,viewDir:zl,roughness:Sn}))),!0===this.clearcoat){const e=Jl.dot(zl).clamp(),t=Dp({dotNV:e,specularColor:gg,specularF90:mg,roughness:vn});this.clearcoatSpecularIndirect.addAssign(this.clearcoatRadiance.mul(t))}const i=en().toVar("singleScattering"),n=en().toVar("multiScattering"),a=r.mul(1/Math.PI);this.computeMultiscattering(i,n,Ln);const o=i.add(n),u=yn.mul(o.r.max(o.g).max(o.b).oneMinus());s.indirectSpecular.addAssign(t.mul(i)),s.indirectSpecular.addAssign(n.mul(a)),s.indirectDiffuse.addAssign(u.mul(a))}ambientOcclusion(e){const{ambientOcclusion:t,reflectedLight:r}=e.context,s=Ql.dot(zl).clamp().add(t),i=bn.mul(-16).oneMinus().negate().exp2(),n=t.sub(s.pow(i).oneMinus()).clamp();!0===this.clearcoat&&this.clearcoatSpecularIndirect.mulAssign(t),!0===this.sheen&&this.sheenSpecularIndirect.mulAssign(t),r.indirectDiffuse.mulAssign(t),r.indirectSpecular.mulAssign(n)}finish({context:e}){const{outgoingLight:t}=e;if(!0===this.clearcoat){const e=Jl.dot(zl).clamp(),r=xp({dotVH:e,f0:gg,f90:mg}),s=t.mul(_n.mul(r).oneMinus()).add(this.clearcoatSpecularDirect.add(this.clearcoatSpecularIndirect).mul(_n));t.assign(s)}if(!0===this.sheen){const e=Nn.r.max(Nn.g).max(Nn.b).mul(.157).oneMinus(),r=t.mul(e).add(this.sheenSpecularDirect,this.sheenSpecularIndirect);t.assign(r)}}}const yg=ji(1),xg=ji(-2),bg=ji(.8),Tg=ji(-1),_g=ji(.4),vg=ji(2),Ng=ji(.305),Sg=ji(3),Eg=ji(.21),wg=ji(4),Ag=ji(4),Rg=ji(16),Cg=ki((([e])=>{const t=en(no(e)).toVar(),r=ji(-1).toVar();return Hi(t.x.greaterThan(t.z),(()=>{Hi(t.x.greaterThan(t.y),(()=>{r.assign(Xo(e.x.greaterThan(0),0,3))})).Else((()=>{r.assign(Xo(e.y.greaterThan(0),1,4))}))})).Else((()=>{Hi(t.z.greaterThan(t.y),(()=>{r.assign(Xo(e.z.greaterThan(0),2,5))})).Else((()=>{r.assign(Xo(e.y.greaterThan(0),1,4))}))})),r})).setLayout({name:"getFace",type:"float",inputs:[{name:"direction",type:"vec3"}]}),Mg=ki((([e,t])=>{const r=Yi().toVar();return Hi(t.equal(0),(()=>{r.assign(Yi(e.z,e.y).div(no(e.x)))})).ElseIf(t.equal(1),(()=>{r.assign(Yi(e.x.negate(),e.z.negate()).div(no(e.y)))})).ElseIf(t.equal(2),(()=>{r.assign(Yi(e.x.negate(),e.y).div(no(e.z)))})).ElseIf(t.equal(3),(()=>{r.assign(Yi(e.z.negate(),e.y).div(no(e.x)))})).ElseIf(t.equal(4),(()=>{r.assign(Yi(e.x.negate(),e.z).div(no(e.y)))})).Else((()=>{r.assign(Yi(e.x,e.y).div(no(e.z)))})),la(.5,r.add(1))})).setLayout({name:"getUV",type:"vec2",inputs:[{name:"direction",type:"vec3"},{name:"face",type:"float"}]}),Pg=ki((([e])=>{const t=ji(0).toVar();return Hi(e.greaterThanEqual(bg),(()=>{t.assign(yg.sub(e).mul(Tg.sub(xg)).div(yg.sub(bg)).add(xg))})).ElseIf(e.greaterThanEqual(_g),(()=>{t.assign(bg.sub(e).mul(vg.sub(Tg)).div(bg.sub(_g)).add(Tg))})).ElseIf(e.greaterThanEqual(Ng),(()=>{t.assign(_g.sub(e).mul(Sg.sub(vg)).div(_g.sub(Ng)).add(vg))})).ElseIf(e.greaterThanEqual(Eg),(()=>{t.assign(Ng.sub(e).mul(wg.sub(Sg)).div(Ng.sub(Eg)).add(Sg))})).Else((()=>{t.assign(ji(-2).mul(ja(la(1.16,e))))})),t})).setLayout({name:"roughnessToMip",type:"float",inputs:[{name:"roughness",type:"float"}]}),Fg=ki((([e,t])=>{const r=e.toVar();r.assign(la(2,r).sub(1));const s=en(r,1).toVar();return Hi(t.equal(0),(()=>{s.assign(s.zyx)})).ElseIf(t.equal(1),(()=>{s.assign(s.xzy),s.xz.mulAssign(-1)})).ElseIf(t.equal(2),(()=>{s.x.mulAssign(-1)})).ElseIf(t.equal(3),(()=>{s.assign(s.zyx),s.xz.mulAssign(-1)})).ElseIf(t.equal(4),(()=>{s.assign(s.xzy),s.xy.mulAssign(-1)})).ElseIf(t.equal(5),(()=>{s.z.mulAssign(-1)})),s})).setLayout({name:"getDirection",type:"vec3",inputs:[{name:"uv",type:"vec2"},{name:"face",type:"float"}]}),Lg=ki((([e,t,r,s,i,n])=>{const a=ji(r),o=en(t),u=Do(Pg(a),xg,n),l=Za(u),d=Ka(u),c=en(Bg(e,o,d,s,i,n)).toVar();return Hi(l.notEqual(0),(()=>{const t=en(Bg(e,o,d.add(1),s,i,n)).toVar();c.assign(Io(c,t,l))})),c})),Bg=ki((([e,t,r,s,i,n])=>{const a=ji(r).toVar(),o=en(t),u=ji(Cg(o)).toVar(),l=ji(_o(Ag.sub(a),0)).toVar();a.assign(_o(a,Ag));const d=ji($a(a)).toVar(),c=Yi(Mg(o,u).mul(d.sub(2)).add(1)).toVar();return Hi(u.greaterThan(2),(()=>{c.y.addAssign(d),u.subAssign(3)})),c.x.addAssign(u.mul(d)),c.x.addAssign(l.mul(la(3,Rg))),c.y.addAssign(la(4,$a(n).sub(d))),c.x.mulAssign(s),c.y.mulAssign(i),e.sample(c).grad(Yi(),Yi())})),Ig=ki((({envMap:e,mipInt:t,outputDirection:r,theta:s,axis:i,CUBEUV_TEXEL_WIDTH:n,CUBEUV_TEXEL_HEIGHT:a,CUBEUV_MAX_MIP:o})=>{const u=eo(s),l=r.mul(u).add(i.cross(r).mul(Ja(s))).add(i.mul(i.dot(r).mul(u.oneMinus())));return Bg(e,l,t,n,a,o)})),Dg=ki((({n:e,latitudinal:t,poleAxis:r,outputDirection:s,weights:i,samples:n,dTheta:a,mipInt:o,envMap:u,CUBEUV_TEXEL_WIDTH:l,CUBEUV_TEXEL_HEIGHT:d,CUBEUV_MAX_MIP:c})=>{const h=en(Xo(t,r,Ao(r,s))).toVar();Hi(h.equal(en(0)),(()=>{h.assign(en(s.z,0,s.x.negate()))})),h.assign(Qa(h));const p=en().toVar();return p.addAssign(i.element(0).mul(Ig({theta:0,axis:h,outputDirection:s,mipInt:o,envMap:u,CUBEUV_TEXEL_WIDTH:l,CUBEUV_TEXEL_HEIGHT:d,CUBEUV_MAX_MIP:c}))),Zc({start:qi(1),end:e},(({i:e})=>{Hi(e.greaterThanEqual(n),(()=>{Jc()}));const t=ji(a.mul(ji(e))).toVar();p.addAssign(i.element(e).mul(Ig({theta:t.mul(-1),axis:h,outputDirection:s,mipInt:o,envMap:u,CUBEUV_TEXEL_WIDTH:l,CUBEUV_TEXEL_HEIGHT:d,CUBEUV_MAX_MIP:c}))),p.addAssign(i.element(e).mul(Ig({theta:t,axis:h,outputDirection:s,mipInt:o,envMap:u,CUBEUV_TEXEL_WIDTH:l,CUBEUV_TEXEL_HEIGHT:d,CUBEUV_MAX_MIP:c})))})),nn(p,1)})),Vg=[.125,.215,.35,.446,.526,.582],Ug=20,Og=new ne(-1,1,1,-1,0,1),kg=new ae(90,1),Gg=new e;let zg=null,Hg=0,$g=0;const Wg=(1+Math.sqrt(5))/2,jg=1/Wg,qg=[new r(-Wg,jg,0),new r(Wg,jg,0),new r(-jg,0,Wg),new r(jg,0,Wg),new r(0,Wg,-jg),new r(0,Wg,jg),new r(-1,1,-1),new r(1,1,-1),new r(-1,1,1),new r(1,1,1)],Xg=new r,Kg=new WeakMap,Yg=[3,1,5,0,4,2],Qg=Fg($u(),Hu("faceIndex")).normalize(),Zg=en(Qg.x,Qg.y,Qg.z);class Jg{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._backgroundBox=null}get _hasInitialized(){return this._renderer.hasInitialized()}fromScene(e,t=0,r=.1,s=100,i={}){const{size:n=256,position:a=Xg,renderTarget:o=null}=i;if(this._setSize(n),!1===this._hasInitialized){console.warn("THREE.PMREMGenerator: .fromScene() called before the backend is initialized. Try using .fromSceneAsync() instead.");const n=o||this._allocateTarget();return i.renderTarget=n,this.fromSceneAsync(e,t,r,s,i),n}zg=this._renderer.getRenderTarget(),Hg=this._renderer.getActiveCubeFace(),$g=this._renderer.getActiveMipmapLevel();const u=o||this._allocateTarget();return u.depthBuffer=!0,this._init(u),this._sceneToCubeUV(e,r,s,u,a),t>0&&this._blur(u,0,0,t),this._applyPMREM(u),this._cleanup(u),u}async fromSceneAsync(e,t=0,r=.1,s=100,i={}){return!1===this._hasInitialized&&await this._renderer.init(),this.fromScene(e,t,r,s,i)}fromEquirectangular(e,t=null){if(!1===this._hasInitialized){console.warn("THREE.PMREMGenerator: .fromEquirectangular() called before the backend is initialized. Try using .fromEquirectangularAsync() instead."),this._setSizeFromTexture(e);const r=t||this._allocateTarget();return this.fromEquirectangularAsync(e,r),r}return this._fromTexture(e,t)}async fromEquirectangularAsync(e,t=null){return!1===this._hasInitialized&&await this._renderer.init(),this._fromTexture(e,t)}fromCubemap(e,t=null){if(!1===this._hasInitialized){console.warn("THREE.PMREMGenerator: .fromCubemap() called before the backend is initialized. Try using .fromCubemapAsync() instead."),this._setSizeFromTexture(e);const r=t||this._allocateTarget();return this.fromCubemapAsync(e,t),r}return this._fromTexture(e,t)}async fromCubemapAsync(e,t=null){return!1===this._hasInitialized&&await this._renderer.init(),this._fromTexture(e,t)}async compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=sm(),await this._compileMaterial(this._cubemapMaterial))}async compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=im(),await this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose(),null!==this._backgroundBox&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSizeFromTexture(e){e.mapping===A||e.mapping===R?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4)}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;ee-4?u=Vg[o-e+4-1]:0===o&&(u=0),s.push(u);const l=1/(a-2),d=-l,c=1+l,h=[d,d,c,d,c,c,d,d,c,c,d,c],p=6,g=6,m=3,f=2,y=1,x=new Float32Array(m*g*p),b=new Float32Array(f*g*p),T=new Float32Array(y*g*p);for(let e=0;e2?0:-1,s=[t,r,0,t+2/3,r,0,t+2/3,r+1,0,t,r,0,t+2/3,r+1,0,t,r+1,0],i=Yg[e];x.set(s,m*g*i),b.set(h,f*g*i);const n=[i,i,i,i,i,i];T.set(n,y*g*i)}const _=new he;_.setAttribute("position",new pe(x,m)),_.setAttribute("uv",new pe(b,f)),_.setAttribute("faceIndex",new pe(T,y)),t.push(_),i.push(new q(_,null)),n>4&&n--}return{lodPlanes:t,sizeLods:r,sigmas:s,lodMeshes:i}}(t)),this._blurMaterial=function(e,t,s){const i=il(new Array(Ug).fill(0)),n=Zn(new r(0,1,0)),a=Zn(0),o=ji(Ug),u=Zn(0),l=Zn(1),d=Zu(null),c=Zn(0),h=ji(1/t),p=ji(1/s),g=ji(e),m={n:o,latitudinal:u,weights:i,poleAxis:n,outputDirection:Zg,dTheta:a,samples:l,envMap:d,mipInt:c,CUBEUV_TEXEL_WIDTH:h,CUBEUV_TEXEL_HEIGHT:p,CUBEUV_MAX_MIP:g},f=rm("blur");return f.fragmentNode=Dg({...m,latitudinal:u.equal(1)}),Kg.set(f,m),f}(t,e.width,e.height)}}async _compileMaterial(e){const t=new q(this._lodPlanes[0],e);await this._renderer.compile(t,Og)}_sceneToCubeUV(e,t,r,s,i){const n=kg;n.near=t,n.far=r;const a=[1,1,1,1,-1,1],o=[1,-1,1,-1,1,-1],u=this._renderer,l=u.autoClear;u.getClearColor(Gg),u.autoClear=!1;let d=this._backgroundBox;if(null===d){const e=new re({name:"PMREM.Background",side:S,depthWrite:!1,depthTest:!1});d=new q(new j,e)}let c=!1;const h=e.background;h?h.isColor&&(d.material.color.copy(h),e.background=null,c=!0):(d.material.color.copy(Gg),c=!0),u.setRenderTarget(s),u.clear(),c&&u.render(d,n);for(let t=0;t<6;t++){const r=t%3;0===r?(n.up.set(0,a[t],0),n.position.set(i.x,i.y,i.z),n.lookAt(i.x+o[t],i.y,i.z)):1===r?(n.up.set(0,0,a[t]),n.position.set(i.x,i.y,i.z),n.lookAt(i.x,i.y+o[t],i.z)):(n.up.set(0,a[t],0),n.position.set(i.x,i.y,i.z),n.lookAt(i.x,i.y,i.z+o[t]));const l=this._cubeSize;tm(s,r*l,t>2?l:0,l,l),u.render(e,n)}u.autoClear=l,e.background=h}_textureToCubeUV(e,t){const r=this._renderer,s=e.mapping===A||e.mapping===R;s?null===this._cubemapMaterial&&(this._cubemapMaterial=sm(e)):null===this._equirectMaterial&&(this._equirectMaterial=im(e));const i=s?this._cubemapMaterial:this._equirectMaterial;i.fragmentNode.value=e;const n=this._lodMeshes[0];n.material=i;const a=this._cubeSize;tm(t,0,0,3*a,2*a),r.setRenderTarget(t),r.render(n,Og)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;const s=this._lodPlanes.length;for(let t=1;tUg&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${g} samples when the maximum is set to 20`);const m=[];let f=0;for(let e=0;ey-4?s-y+4:0),4*(this._cubeSize-x),3*x,2*x),o.setRenderTarget(t),o.render(l,Og)}}function em(e,t){const r=new oe(e,t,{magFilter:K,minFilter:K,generateMipmaps:!1,type:de,format:le,colorSpace:ue});return r.texture.mapping=ce,r.texture.name="PMREM.cubeUv",r.texture.isPMREMTexture=!0,r.scissorTest=!0,r}function tm(e,t,r,s,i){e.viewport.set(t,r,s,i),e.scissor.set(t,r,s,i)}function rm(e){const t=new Wh;return t.depthTest=!1,t.depthWrite=!1,t.blending=z,t.name=`PMREM_${e}`,t}function sm(e){const t=rm("cubemap");return t.fragmentNode=gd(e,Zg),t}function im(e){const t=rm("equirect");return t.fragmentNode=Zu(e,np(Zg),0),t}const nm=new WeakMap;function am(e,t,r){const s=function(e){let t=nm.get(e);void 0===t&&(t=new WeakMap,nm.set(e,t));return t}(t);let i=s.get(e);if((void 0!==i?i.pmremVersion:-1)!==e.pmremVersion){const t=e.image;if(e.isCubeTexture){if(!function(e){if(null==e)return!1;let t=0;const r=6;for(let s=0;s0}(t))return null;i=r.fromEquirectangular(e,i)}i.pmremVersion=e.pmremVersion,s.set(e,i)}return i.texture}class om extends Ks{static get type(){return"PMREMNode"}constructor(e,t=null,r=null){super("vec3"),this._value=e,this._pmrem=null,this.uvNode=t,this.levelNode=r,this._generator=null;const s=new b;s.isRenderTargetTexture=!0,this._texture=Zu(s),this._width=Zn(0),this._height=Zn(0),this._maxMip=Zn(0),this.updateBeforeType=Vs.RENDER}set value(e){this._value=e,this._pmrem=null}get value(){return this._value}updateFromTexture(e){const t=function(e){const t=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:r,maxMip:t}}(e.image.height);this._texture.value=e,this._width.value=t.texelWidth,this._height.value=t.texelHeight,this._maxMip.value=t.maxMip}updateBefore(e){let t=this._pmrem;const r=t?t.pmremVersion:-1,s=this._value;r!==s.pmremVersion&&(t=!0===s.isPMREMTexture?s:am(s,e.renderer,this._generator),null!==t&&(this._pmrem=t,this.updateFromTexture(t)))}setup(e){null===this._generator&&(this._generator=new Jg(e.renderer)),this.updateBefore(e);let t=this.uvNode;null===t&&e.context.getUV&&(t=e.context.getUV(this)),t=ad.mul(en(t.x,t.y.negate(),t.z));let r=this.levelNode;return null===r&&e.context.getTextureLevel&&(r=e.context.getTextureLevel(this)),Lg(this._texture,t,r,this._width,this._height,this._maxMip)}dispose(){super.dispose(),null!==this._generator&&this._generator.dispose()}}const um=Vi(om).setParameterLength(1,3),lm=new WeakMap;class dm extends nh{static get type(){return"EnvironmentNode"}constructor(e=null){super(),this.envNode=e}setup(e){const{material:t}=e;let r=this.envNode;if(r.isTextureNode||r.isMaterialReferenceNode){const e=r.isTextureNode?r.value:t[r.property];let s=lm.get(e);void 0===s&&(s=um(e),lm.set(e,s)),r=s}const s=!0===t.useAnisotropy||t.anisotropy>0?Dd:Ql,i=r.context(cm(bn,s)).mul(nd),n=r.context(hm(Zl)).mul(Math.PI).mul(nd),a=Ru(i),o=Ru(n);e.context.radiance.addAssign(a),e.context.iblIrradiance.addAssign(o);const u=e.context.lightingModel.clearcoatRadiance;if(u){const e=r.context(cm(vn,Jl)).mul(nd),t=Ru(e);u.addAssign(t)}}}const cm=(e,t)=>{let r=null;return{getUV:()=>(null===r&&(r=zl.negate().reflect(t),r=e.mul(e).mix(r,t).normalize(),r=r.transformDirection(cl)),r),getTextureLevel:()=>e}},hm=e=>({getUV:()=>e,getTextureLevel:()=>ji(1)}),pm=new ge;class gm extends Wh{static get type(){return"MeshStandardNodeMaterial"}constructor(e){super(),this.isMeshStandardNodeMaterial=!0,this.lights=!0,this.emissiveNode=null,this.metalnessNode=null,this.roughnessNode=null,this.setDefaultValues(pm),this.setValues(e)}setupEnvironment(e){let t=super.setupEnvironment(e);return null===t&&e.environmentNode&&(t=e.environmentNode),t?new dm(t):null}setupLightingModel(){return new fg}setupSpecular(){const e=Io(en(.04),yn.rgb,Tn);Fn.assign(e),Ln.assign(1)}setupVariants(){const e=this.metalnessNode?ji(this.metalnessNode):sc;Tn.assign(e);let t=this.roughnessNode?ji(this.roughnessNode):rc;t=Rp({roughness:t}),bn.assign(t),this.setupSpecular(),yn.assign(nn(yn.rgb.mul(e.oneMinus()),yn.a))}copy(e){return this.emissiveNode=e.emissiveNode,this.metalnessNode=e.metalnessNode,this.roughnessNode=e.roughnessNode,super.copy(e)}}const mm=new me;class fm extends gm{static get type(){return"MeshPhysicalNodeMaterial"}constructor(e){super(),this.isMeshPhysicalNodeMaterial=!0,this.clearcoatNode=null,this.clearcoatRoughnessNode=null,this.clearcoatNormalNode=null,this.sheenNode=null,this.sheenRoughnessNode=null,this.iridescenceNode=null,this.iridescenceIORNode=null,this.iridescenceThicknessNode=null,this.specularIntensityNode=null,this.specularColorNode=null,this.iorNode=null,this.transmissionNode=null,this.thicknessNode=null,this.attenuationDistanceNode=null,this.attenuationColorNode=null,this.dispersionNode=null,this.anisotropyNode=null,this.setDefaultValues(mm),this.setValues(e)}get useClearcoat(){return this.clearcoat>0||null!==this.clearcoatNode}get useIridescence(){return this.iridescence>0||null!==this.iridescenceNode}get useSheen(){return this.sheen>0||null!==this.sheenNode}get useAnisotropy(){return this.anisotropy>0||null!==this.anisotropyNode}get useTransmission(){return this.transmission>0||null!==this.transmissionNode}get useDispersion(){return this.dispersion>0||null!==this.dispersionNode}setupSpecular(){const e=this.iorNode?ji(this.iorNode):yc;On.assign(e),Fn.assign(Io(To(Co(On.sub(1).div(On.add(1))).mul(Jd),en(1)).mul(Zd),yn.rgb,Tn)),Ln.assign(Io(Zd,1,Tn))}setupLightingModel(){return new fg(this.useClearcoat,this.useSheen,this.useIridescence,this.useAnisotropy,this.useTransmission,this.useDispersion)}setupVariants(e){if(super.setupVariants(e),this.useClearcoat){const e=this.clearcoatNode?ji(this.clearcoatNode):nc,t=this.clearcoatRoughnessNode?ji(this.clearcoatRoughnessNode):ac;_n.assign(e),vn.assign(Rp({roughness:t}))}if(this.useSheen){const e=this.sheenNode?en(this.sheenNode):lc,t=this.sheenRoughnessNode?ji(this.sheenRoughnessNode):dc;Nn.assign(e),Sn.assign(t)}if(this.useIridescence){const e=this.iridescenceNode?ji(this.iridescenceNode):hc,t=this.iridescenceIORNode?ji(this.iridescenceIORNode):pc,r=this.iridescenceThicknessNode?ji(this.iridescenceThicknessNode):gc;En.assign(e),wn.assign(t),An.assign(r)}if(this.useAnisotropy){const e=(this.anisotropyNode?Yi(this.anisotropyNode):cc).toVar();Cn.assign(e.length()),Hi(Cn.equal(0),(()=>{e.assign(Yi(1,0))})).Else((()=>{e.divAssign(Yi(Cn)),Cn.assign(Cn.saturate())})),Rn.assign(Cn.pow2().mix(bn.pow2(),1)),Mn.assign(Bd[0].mul(e.x).add(Bd[1].mul(e.y))),Pn.assign(Bd[1].mul(e.x).sub(Bd[0].mul(e.y)))}if(this.useTransmission){const e=this.transmissionNode?ji(this.transmissionNode):mc,t=this.thicknessNode?ji(this.thicknessNode):fc,r=this.attenuationDistanceNode?ji(this.attenuationDistanceNode):xc,s=this.attenuationColorNode?en(this.attenuationColorNode):bc;if(kn.assign(e),Gn.assign(t),zn.assign(r),Hn.assign(s),this.useDispersion){const e=this.dispersionNode?ji(this.dispersionNode):wc;$n.assign(e)}}}setupClearcoatNormal(){return this.clearcoatNormalNode?en(this.clearcoatNormalNode):oc}setup(e){e.context.setupClearcoatNormal=()=>this.setupClearcoatNormal(e),super.setup(e)}copy(e){return this.clearcoatNode=e.clearcoatNode,this.clearcoatRoughnessNode=e.clearcoatRoughnessNode,this.clearcoatNormalNode=e.clearcoatNormalNode,this.sheenNode=e.sheenNode,this.sheenRoughnessNode=e.sheenRoughnessNode,this.iridescenceNode=e.iridescenceNode,this.iridescenceIORNode=e.iridescenceIORNode,this.iridescenceThicknessNode=e.iridescenceThicknessNode,this.specularIntensityNode=e.specularIntensityNode,this.specularColorNode=e.specularColorNode,this.transmissionNode=e.transmissionNode,this.thicknessNode=e.thicknessNode,this.attenuationDistanceNode=e.attenuationDistanceNode,this.attenuationColorNode=e.attenuationColorNode,this.dispersionNode=e.dispersionNode,this.anisotropyNode=e.anisotropyNode,super.copy(e)}}class ym extends fg{constructor(e=!1,t=!1,r=!1,s=!1,i=!1,n=!1,a=!1){super(e,t,r,s,i,n),this.useSSS=a}direct({lightDirection:e,lightColor:t,reflectedLight:r},s){if(!0===this.useSSS){const i=s.material,{thicknessColorNode:n,thicknessDistortionNode:a,thicknessAmbientNode:o,thicknessAttenuationNode:u,thicknessPowerNode:l,thicknessScaleNode:d}=i,c=e.add(Ql.mul(a)).normalize(),h=ji(zl.dot(c.negate()).saturate().pow(l).mul(d)),p=en(h.add(o).mul(n));r.directDiffuse.addAssign(p.mul(u.mul(t)))}super.direct({lightDirection:e,lightColor:t,reflectedLight:r},s)}}class xm extends fm{static get type(){return"MeshSSSNodeMaterial"}constructor(e){super(e),this.thicknessColorNode=null,this.thicknessDistortionNode=ji(.1),this.thicknessAmbientNode=ji(0),this.thicknessAttenuationNode=ji(.1),this.thicknessPowerNode=ji(2),this.thicknessScaleNode=ji(10)}get useSSS(){return null!==this.thicknessColorNode}setupLightingModel(){return new ym(this.useClearcoat,this.useSheen,this.useIridescence,this.useAnisotropy,this.useTransmission,this.useDispersion,this.useSSS)}copy(e){return this.thicknessColorNode=e.thicknessColorNode,this.thicknessDistortionNode=e.thicknessDistortionNode,this.thicknessAmbientNode=e.thicknessAmbientNode,this.thicknessAttenuationNode=e.thicknessAttenuationNode,this.thicknessPowerNode=e.thicknessPowerNode,this.thicknessScaleNode=e.thicknessScaleNode,super.copy(e)}}const bm=ki((({normal:e,lightDirection:t,builder:r})=>{const s=e.dot(t),i=Yi(s.mul(.5).add(.5),0);if(r.material.gradientMap){const e=Td("gradientMap","texture").context({getUV:()=>i});return en(e.r)}{const e=i.fwidth().mul(.5);return Io(en(.7),en(1),Oo(ji(.7).sub(e.x),ji(.7).add(e.x),i.x))}}));class Tm extends gp{direct({lightDirection:e,lightColor:t,reflectedLight:r},s){const i=bm({normal:jl,lightDirection:e,builder:s}).mul(t);r.directDiffuse.addAssign(i.mul(bp({diffuseColor:yn.rgb})))}indirect(e){const{ambientOcclusion:t,irradiance:r,reflectedLight:s}=e.context;s.indirectDiffuse.addAssign(r.mul(bp({diffuseColor:yn}))),s.indirectDiffuse.mulAssign(t)}}const _m=new fe;class vm extends Wh{static get type(){return"MeshToonNodeMaterial"}constructor(e){super(),this.isMeshToonNodeMaterial=!0,this.lights=!0,this.setDefaultValues(_m),this.setValues(e)}setupLightingModel(){return new Tm}}class Nm extends Ks{static get type(){return"MatcapUVNode"}constructor(){super("vec2")}setup(){const e=en(zl.z,0,zl.x.negate()).normalize(),t=zl.cross(e);return Yi(e.dot(Ql),t.dot(Ql)).mul(.495).add(.5)}}const Sm=Ui(Nm),Em=new ye;class wm extends Wh{static get type(){return"MeshMatcapNodeMaterial"}constructor(e){super(),this.isMeshMatcapNodeMaterial=!0,this.setDefaultValues(Em),this.setValues(e)}setupVariants(e){const t=Sm;let r;r=e.material.matcap?Td("matcap","texture").context({getUV:()=>t}):en(Io(.2,.8,t.y)),yn.rgb.mulAssign(r.rgb)}}class Am extends Ks{static get type(){return"RotateNode"}constructor(e,t){super(),this.positionNode=e,this.rotationNode=t}getNodeType(e){return this.positionNode.getNodeType(e)}setup(e){const{rotationNode:t,positionNode:r}=this;if("vec2"===this.getNodeType(e)){const e=t.cos(),s=t.sin();return ln(e,s,s.negate(),e).mul(r)}{const e=t,s=cn(nn(1,0,0,0),nn(0,eo(e.x),Ja(e.x).negate(),0),nn(0,Ja(e.x),eo(e.x),0),nn(0,0,0,1)),i=cn(nn(eo(e.y),0,Ja(e.y),0),nn(0,1,0,0),nn(Ja(e.y).negate(),0,eo(e.y),0),nn(0,0,0,1)),n=cn(nn(eo(e.z),Ja(e.z).negate(),0,0),nn(Ja(e.z),eo(e.z),0,0),nn(0,0,1,0),nn(0,0,0,1));return s.mul(i).mul(n).mul(nn(r,1)).xyz}}}const Rm=Vi(Am).setParameterLength(2),Cm=new xe;class Mm extends Wh{static get type(){return"SpriteNodeMaterial"}constructor(e){super(),this.isSpriteNodeMaterial=!0,this._useSizeAttenuation=!0,this.positionNode=null,this.rotationNode=null,this.scaleNode=null,this.transparent=!0,this.setDefaultValues(Cm),this.setValues(e)}setupPositionView(e){const{object:t,camera:r}=e,s=this.sizeAttenuation,{positionNode:i,rotationNode:n,scaleNode:a}=this,o=Fl.mul(en(i||0));let u=Yi(El[0].xyz.length(),El[1].xyz.length());if(null!==a&&(u=u.mul(Yi(a))),!1===s)if(r.isPerspectiveCamera)u=u.mul(o.z.negate());else{const e=ji(2).div(ll.element(1).element(1));u=u.mul(e.mul(2))}let l=Dl.xy;if(t.center&&!0===t.center.isVector2){const e=((e,t,r)=>Bi(new gu(e,t,r)))("center","vec2",t);l=l.sub(e.sub(.5))}l=l.mul(u);const d=ji(n||uc),c=Rm(l,d);return nn(o.xy.add(c),o.zw)}copy(e){return this.positionNode=e.positionNode,this.rotationNode=e.rotationNode,this.scaleNode=e.scaleNode,super.copy(e)}get sizeAttenuation(){return this._useSizeAttenuation}set sizeAttenuation(e){this._useSizeAttenuation!==e&&(this._useSizeAttenuation=e,this.needsUpdate=!0)}}const Pm=new be;class Fm extends Mm{static get type(){return"PointsNodeMaterial"}constructor(e){super(),this.sizeNode=null,this.isPointsNodeMaterial=!0,this.setDefaultValues(Pm),this.setValues(e)}setupPositionView(){const{positionNode:e}=this;return Fl.mul(en(e||Vl)).xyz}setupVertex(e){const t=super.setupVertex(e);if(!0!==e.material.isNodeMaterial)return t;const{rotationNode:r,scaleNode:s,sizeNode:i}=this,n=Dl.xy.toVar(),a=fh.z.div(fh.w);if(r&&r.isNode){const e=ji(r);n.assign(Rm(n,e))}let o=null!==i?Yi(i):Ec;return!0===this.sizeAttenuation&&(o=o.mul(o.div(Gl.z.negate()))),s&&s.isNode&&(o=o.mul(Yi(s))),n.mulAssign(o.mul(2)),n.assign(n.div(fh.z)),n.y.assign(n.y.mul(a)),n.assign(n.mul(t.w)),t.addAssign(nn(n,0,0)),t}get alphaToCoverage(){return this._useAlphaToCoverage}set alphaToCoverage(e){this._useAlphaToCoverage!==e&&(this._useAlphaToCoverage=e,this.needsUpdate=!0)}}class Lm extends gp{constructor(){super(),this.shadowNode=ji(1).toVar("shadowMask")}direct({lightNode:e}){null!==e.shadowNode&&this.shadowNode.mulAssign(e.shadowNode)}finish({context:e}){yn.a.mulAssign(this.shadowNode.oneMinus()),e.outgoingLight.rgb.assign(yn.rgb)}}const Bm=new Te;class Im extends Wh{static get type(){return"ShadowNodeMaterial"}constructor(e){super(),this.isShadowNodeMaterial=!0,this.lights=!0,this.transparent=!0,this.setDefaultValues(Bm),this.setValues(e)}setupLightingModel(){return new Lm}}const Dm=mn("vec3"),Vm=mn("vec3"),Um=mn("vec3");class Om extends gp{constructor(){super()}start(e){const{material:t,context:r}=e,s=mn("vec3"),i=mn("vec3");Hi(gl.sub(Ol).length().greaterThan(Cl.mul(2)),(()=>{s.assign(gl),i.assign(Ol)})).Else((()=>{s.assign(Ol),i.assign(gl)}));const n=i.sub(s),a=Zn("int").onRenderUpdate((({material:e})=>e.steps)),o=n.length().div(a).toVar(),u=n.normalize().toVar(),l=ji(0).toVar(),d=en(1).toVar();t.offsetNode&&l.addAssign(t.offsetNode.mul(o)),Zc(a,(()=>{const i=s.add(u.mul(l)),n=cl.mul(nn(i,1)).xyz;let a;null!==t.depthNode&&(Vm.assign(Vh(Fh(n.z,ol,ul))),r.sceneDepthNode=Vh(t.depthNode).toVar()),r.positionWorld=i,r.shadowPositionWorld=i,r.positionView=n,Dm.assign(0),t.scatteringNode&&(a=t.scatteringNode({positionRay:i})),super.start(e),a&&Dm.mulAssign(a);const c=Dm.mul(.01).negate().mul(o).exp();d.mulAssign(c),l.addAssign(o)})),Um.addAssign(d.saturate().oneMinus())}scatteringLight(e,t){const r=t.context.sceneDepthNode;r?Hi(r.greaterThanEqual(Vm),(()=>{Dm.addAssign(e)})):Dm.addAssign(e)}direct({lightNode:e,lightColor:t},r){if(void 0===e.light.distance)return;const s=t.xyz.toVar();s.mulAssign(e.shadowNode),this.scatteringLight(s,r)}directRectArea({lightColor:e,lightPosition:t,halfWidth:r,halfHeight:s},i){const n=t.add(r).sub(s),a=t.sub(r).sub(s),o=t.sub(r).add(s),u=t.add(r).add(s),l=i.context.positionView,d=e.xyz.mul(Wp({P:l,p0:n,p1:a,p2:o,p3:u})).pow(1.5);this.scatteringLight(d,i)}finish(e){e.context.outgoingLight.assign(Um)}}class km extends Wh{static get type(){return"VolumeNodeMaterial"}constructor(e){super(),this.isVolumeNodeMaterial=!0,this.steps=25,this.offsetNode=null,this.scatteringNode=null,this.lights=!0,this.transparent=!0,this.side=S,this.depthTest=!1,this.depthWrite=!1,this.setValues(e)}setupLightingModel(){return new Om}}class Gm{constructor(e,t){this.nodes=e,this.info=t,this._context="undefined"!=typeof self?self:null,this._animationLoop=null,this._requestId=null}start(){const e=(t,r)=>{this._requestId=this._context.requestAnimationFrame(e),!0===this.info.autoReset&&this.info.reset(),this.nodes.nodeFrame.update(),this.info.frame=this.nodes.nodeFrame.frameId,null!==this._animationLoop&&this._animationLoop(t,r)};e()}stop(){this._context.cancelAnimationFrame(this._requestId),this._requestId=null}getAnimationLoop(){return this._animationLoop}setAnimationLoop(e){this._animationLoop=e}getContext(){return this._context}setContext(e){this._context=e}dispose(){this.stop()}}class zm{constructor(){this.weakMap=new WeakMap}get(e){let t=this.weakMap;for(let r=0;r{this.dispose()},this.material.addEventListener("dispose",this.onMaterialDispose)}updateClipping(e){this.clippingContext=e}get clippingNeedsUpdate(){return null!==this.clippingContext&&this.clippingContext.cacheKey!==this.clippingContextCacheKey&&(this.clippingContextCacheKey=this.clippingContext.cacheKey,!0)}get hardwareClippingPlanes(){return!0===this.material.hardwareClipping?this.clippingContext.unionClippingCount:0}getNodeBuilderState(){return this._nodeBuilderState||(this._nodeBuilderState=this._nodes.getForRender(this))}getMonitor(){return this._monitor||(this._monitor=this.getNodeBuilderState().observer)}getBindings(){return this._bindings||(this._bindings=this.getNodeBuilderState().createBindings())}getBindingGroup(e){for(const t of this.getBindings())if(t.name===e)return t}getIndex(){return this._geometries.getIndex(this)}getIndirect(){return this._geometries.getIndirect(this)}getChainArray(){return[this.object,this.material,this.context,this.lightsNode]}setGeometry(e){this.geometry=e,this.attributes=null}getAttributes(){if(null!==this.attributes)return this.attributes;const e=this.getNodeBuilderState().nodeAttributes,t=this.geometry,r=[],s=new Set;for(const i of e){const e=i.node&&i.node.attribute?i.node.attribute:t.getAttribute(i.name);if(void 0===e)continue;r.push(e);const n=e.isInterleavedBufferAttribute?e.data:e;s.add(n)}return this.attributes=r,this.vertexBuffers=Array.from(s.values()),r}getVertexBuffers(){return null===this.vertexBuffers&&this.getAttributes(),this.vertexBuffers}getDrawParameters(){const{object:e,material:t,geometry:r,group:s,drawRange:i}=this,n=this.drawParams||(this.drawParams={vertexCount:0,firstVertex:0,instanceCount:0,firstInstance:0}),a=this.getIndex(),o=null!==a;let u=1;if(!0===r.isInstancedBufferGeometry?u=r.instanceCount:void 0!==e.count&&(u=Math.max(0,e.count)),0===u)return null;if(n.instanceCount=u,!0===e.isBatchedMesh)return n;let l=1;!0!==t.wireframe||e.isPoints||e.isLineSegments||e.isLine||e.isLineLoop||(l=2);let d=i.start*l,c=(i.start+i.count)*l;null!==s&&(d=Math.max(d,s.start*l),c=Math.min(c,(s.start+s.count)*l));const h=r.attributes.position;let p=1/0;o?p=a.count:null!=h&&(p=h.count),d=Math.max(d,0),c=Math.min(c,p);const g=c-d;return g<0||g===1/0?null:(n.vertexCount=g,n.firstVertex=d,n)}getGeometryCacheKey(){const{geometry:e}=this;let t="";for(const r of Object.keys(e.attributes).sort()){const s=e.attributes[r];t+=r+",",s.data&&(t+=s.data.stride+","),s.offset&&(t+=s.offset+","),s.itemSize&&(t+=s.itemSize+","),s.normalized&&(t+="n,")}for(const r of Object.keys(e.morphAttributes).sort()){const s=e.morphAttributes[r];t+="morph-"+r+",";for(let e=0,r=s.length;e1&&(r+=e.uuid+","),r+=e.receiveShadow+",",xs(r)}get needsGeometryUpdate(){return this.geometry.id!==this.object.geometry.id}get needsUpdate(){return this.initialNodesCacheKey!==this.getDynamicCacheKey()||this.clippingNeedsUpdate}getDynamicCacheKey(){let e=0;return!0!==this.material.isShadowPassMaterial&&(e=this._nodes.getCacheKey(this.scene,this.lightsNode)),this.camera.isArrayCamera&&(e=Ts(e,this.camera.cameras.length)),this.object.receiveShadow&&(e=Ts(e,1)),e}getCacheKey(){return this.getMaterialCacheKey()+this.getDynamicCacheKey()}dispose(){this.material.removeEventListener("dispose",this.onMaterialDispose),this.onDispose()}}const Wm=[];class jm{constructor(e,t,r,s,i,n){this.renderer=e,this.nodes=t,this.geometries=r,this.pipelines=s,this.bindings=i,this.info=n,this.chainMaps={}}get(e,t,r,s,i,n,a,o){const u=this.getChainMap(o);Wm[0]=e,Wm[1]=t,Wm[2]=n,Wm[3]=i;let l=u.get(Wm);return void 0===l?(l=this.createRenderObject(this.nodes,this.geometries,this.renderer,e,t,r,s,i,n,a,o),u.set(Wm,l)):(l.updateClipping(a),l.needsGeometryUpdate&&l.setGeometry(e.geometry),(l.version!==t.version||l.needsUpdate)&&(l.initialCacheKey!==l.getCacheKey()?(l.dispose(),l=this.get(e,t,r,s,i,n,a,o)):l.version=t.version)),Wm.length=0,l}getChainMap(e="default"){return this.chainMaps[e]||(this.chainMaps[e]=new zm)}dispose(){this.chainMaps={}}createRenderObject(e,t,r,s,i,n,a,o,u,l,d){const c=this.getChainMap(d),h=new $m(e,t,r,s,i,n,a,o,u,l);return h.onDispose=()=>{this.pipelines.delete(h),this.bindings.delete(h),this.nodes.delete(h),c.delete(h.getChainArray())},h}}class qm{constructor(){this.data=new WeakMap}get(e){let t=this.data.get(e);return void 0===t&&(t={},this.data.set(e,t)),t}delete(e){let t=null;return this.data.has(e)&&(t=this.data.get(e),this.data.delete(e)),t}has(e){return this.data.has(e)}dispose(){this.data=new WeakMap}}const Xm=1,Km=2,Ym=3,Qm=4,Zm=16;class Jm extends qm{constructor(e){super(),this.backend=e}delete(e){const t=super.delete(e);return null!==t&&this.backend.destroyAttribute(e),t}update(e,t){const r=this.get(e);if(void 0===r.version)t===Xm?this.backend.createAttribute(e):t===Km?this.backend.createIndexAttribute(e):t===Ym?this.backend.createStorageAttribute(e):t===Qm&&this.backend.createIndirectStorageAttribute(e),r.version=this._getBufferAttribute(e).version;else{const t=this._getBufferAttribute(e);(r.version{this.info.memory.geometries--;const s=t.index,i=e.getAttributes();null!==s&&this.attributes.delete(s);for(const e of i)this.attributes.delete(e);const n=this.wireframes.get(t);void 0!==n&&this.attributes.delete(n),t.removeEventListener("dispose",r)};t.addEventListener("dispose",r)}updateAttributes(e){const t=e.getAttributes();for(const e of t)e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute?this.updateAttribute(e,Ym):this.updateAttribute(e,Xm);const r=this.getIndex(e);null!==r&&this.updateAttribute(r,Km);const s=e.geometry.indirect;null!==s&&this.updateAttribute(s,Qm)}updateAttribute(e,t){const r=this.info.render.calls;e.isInterleavedBufferAttribute?void 0===this.attributeCall.get(e)?(this.attributes.update(e,t),this.attributeCall.set(e,r)):this.attributeCall.get(e.data)!==r&&(this.attributes.update(e,t),this.attributeCall.set(e.data,r),this.attributeCall.set(e,r)):this.attributeCall.get(e)!==r&&(this.attributes.update(e,t),this.attributeCall.set(e,r))}getIndirect(e){return e.geometry.indirect}getIndex(e){const{geometry:t,material:r}=e;let s=t.index;if(!0===r.wireframe){const e=this.wireframes;let r=e.get(t);void 0===r?(r=tf(t),e.set(t,r)):r.version!==ef(t)&&(this.attributes.delete(r),r=tf(t),e.set(t,r)),s=r}return s}}class sf{constructor(){this.autoReset=!0,this.frame=0,this.calls=0,this.render={calls:0,frameCalls:0,drawCalls:0,triangles:0,points:0,lines:0,timestamp:0},this.compute={calls:0,frameCalls:0,timestamp:0},this.memory={geometries:0,textures:0}}update(e,t,r){this.render.drawCalls++,e.isMesh||e.isSprite?this.render.triangles+=r*(t/3):e.isPoints?this.render.points+=r*t:e.isLineSegments?this.render.lines+=r*(t/2):e.isLine?this.render.lines+=r*(t-1):console.error("THREE.WebGPUInfo: Unknown object type.")}reset(){this.render.drawCalls=0,this.render.frameCalls=0,this.compute.frameCalls=0,this.render.triangles=0,this.render.points=0,this.render.lines=0}dispose(){this.reset(),this.calls=0,this.render.calls=0,this.compute.calls=0,this.render.timestamp=0,this.compute.timestamp=0,this.memory.geometries=0,this.memory.textures=0}}class nf{constructor(e){this.cacheKey=e,this.usedTimes=0}}class af extends nf{constructor(e,t,r){super(e),this.vertexProgram=t,this.fragmentProgram=r}}class of extends nf{constructor(e,t){super(e),this.computeProgram=t,this.isComputePipeline=!0}}let uf=0;class lf{constructor(e,t,r,s=null,i=null){this.id=uf++,this.code=e,this.stage=t,this.name=r,this.transforms=s,this.attributes=i,this.usedTimes=0}}class df extends qm{constructor(e,t){super(),this.backend=e,this.nodes=t,this.bindings=null,this.caches=new Map,this.programs={vertex:new Map,fragment:new Map,compute:new Map}}getForCompute(e,t){const{backend:r}=this,s=this.get(e);if(this._needsComputeUpdate(e)){const i=s.pipeline;i&&(i.usedTimes--,i.computeProgram.usedTimes--);const n=this.nodes.getForCompute(e);let a=this.programs.compute.get(n.computeShader);void 0===a&&(i&&0===i.computeProgram.usedTimes&&this._releaseProgram(i.computeProgram),a=new lf(n.computeShader,"compute",e.name,n.transforms,n.nodeAttributes),this.programs.compute.set(n.computeShader,a),r.createProgram(a));const o=this._getComputeCacheKey(e,a);let u=this.caches.get(o);void 0===u&&(i&&0===i.usedTimes&&this._releasePipeline(i),u=this._getComputePipeline(e,a,o,t)),u.usedTimes++,a.usedTimes++,s.version=e.version,s.pipeline=u}return s.pipeline}getForRender(e,t=null){const{backend:r}=this,s=this.get(e);if(this._needsRenderUpdate(e)){const i=s.pipeline;i&&(i.usedTimes--,i.vertexProgram.usedTimes--,i.fragmentProgram.usedTimes--);const n=e.getNodeBuilderState(),a=e.material?e.material.name:"";let o=this.programs.vertex.get(n.vertexShader);void 0===o&&(i&&0===i.vertexProgram.usedTimes&&this._releaseProgram(i.vertexProgram),o=new lf(n.vertexShader,"vertex",a),this.programs.vertex.set(n.vertexShader,o),r.createProgram(o));let u=this.programs.fragment.get(n.fragmentShader);void 0===u&&(i&&0===i.fragmentProgram.usedTimes&&this._releaseProgram(i.fragmentProgram),u=new lf(n.fragmentShader,"fragment",a),this.programs.fragment.set(n.fragmentShader,u),r.createProgram(u));const l=this._getRenderCacheKey(e,o,u);let d=this.caches.get(l);void 0===d?(i&&0===i.usedTimes&&this._releasePipeline(i),d=this._getRenderPipeline(e,o,u,l,t)):e.pipeline=d,d.usedTimes++,o.usedTimes++,u.usedTimes++,s.pipeline=d}return s.pipeline}delete(e){const t=this.get(e).pipeline;return t&&(t.usedTimes--,0===t.usedTimes&&this._releasePipeline(t),t.isComputePipeline?(t.computeProgram.usedTimes--,0===t.computeProgram.usedTimes&&this._releaseProgram(t.computeProgram)):(t.fragmentProgram.usedTimes--,t.vertexProgram.usedTimes--,0===t.vertexProgram.usedTimes&&this._releaseProgram(t.vertexProgram),0===t.fragmentProgram.usedTimes&&this._releaseProgram(t.fragmentProgram))),super.delete(e)}dispose(){super.dispose(),this.caches=new Map,this.programs={vertex:new Map,fragment:new Map,compute:new Map}}updateForRender(e){this.getForRender(e)}_getComputePipeline(e,t,r,s){r=r||this._getComputeCacheKey(e,t);let i=this.caches.get(r);return void 0===i&&(i=new of(r,t),this.caches.set(r,i),this.backend.createComputePipeline(i,s)),i}_getRenderPipeline(e,t,r,s,i){s=s||this._getRenderCacheKey(e,t,r);let n=this.caches.get(s);return void 0===n&&(n=new af(s,t,r),this.caches.set(s,n),e.pipeline=n,this.backend.createRenderPipeline(e,i)),n}_getComputeCacheKey(e,t){return e.id+","+t.id}_getRenderCacheKey(e,t,r){return t.id+","+r.id+","+this.backend.getRenderCacheKey(e)}_releasePipeline(e){this.caches.delete(e.cacheKey)}_releaseProgram(e){const t=e.code,r=e.stage;this.programs[r].delete(t)}_needsComputeUpdate(e){const t=this.get(e);return void 0===t.pipeline||t.version!==e.version}_needsRenderUpdate(e){return void 0===this.get(e).pipeline||this.backend.needsRenderUpdate(e)}}class cf extends qm{constructor(e,t,r,s,i,n){super(),this.backend=e,this.textures=r,this.pipelines=i,this.attributes=s,this.nodes=t,this.info=n,this.pipelines.bindings=this}getForRender(e){const t=e.getBindings();for(const e of t){const r=this.get(e);void 0===r.bindGroup&&(this._init(e),this.backend.createBindings(e,t,0),r.bindGroup=e)}return t}getForCompute(e){const t=this.nodes.getForCompute(e).bindings;for(const e of t){const r=this.get(e);void 0===r.bindGroup&&(this._init(e),this.backend.createBindings(e,t,0),r.bindGroup=e)}return t}updateForCompute(e){this._updateBindings(this.getForCompute(e))}updateForRender(e){this._updateBindings(this.getForRender(e))}_updateBindings(e){for(const t of e)this._update(t,e)}_init(e){for(const t of e.bindings)if(t.isSampledTexture)this.textures.updateTexture(t.texture);else if(t.isStorageBuffer){const e=t.attribute,r=e.isIndirectStorageBufferAttribute?Qm:Ym;this.attributes.update(e,r)}}_update(e,t){const{backend:r}=this;let s=!1,i=!0,n=0,a=0;for(const t of e.bindings){if(t.isNodeUniformsGroup){if(!1===this.nodes.updateGroup(t))continue}if(t.isStorageBuffer){const e=t.attribute,r=e.isIndirectStorageBufferAttribute?Qm:Ym;this.attributes.update(e,r)}if(t.isUniformBuffer){t.update()&&r.updateBinding(t)}else if(t.isSampler)t.update();else if(t.isSampledTexture){const e=this.textures.get(t.texture);t.needsBindingsUpdate(e.generation)&&(s=!0);const o=t.update(),u=t.texture;o&&this.textures.updateTexture(u);const l=r.get(u);if(void 0!==l.externalTexture||e.isDefaultTexture?i=!1:(n=10*n+u.id,a+=u.version),!0===r.isWebGPUBackend&&void 0===l.texture&&void 0===l.externalTexture&&(console.error("Bindings._update: binding should be available:",t,o,u,t.textureNode.value,s),this.textures.updateTexture(u),s=!0),!0===u.isStorageTexture){const e=this.get(u);!0===t.store?e.needsMipmap=!0:this.textures.needsMipmaps(u)&&!0===e.needsMipmap&&(this.backend.generateMipmaps(u),e.needsMipmap=!1)}}}!0===s&&this.backend.updateBindings(e,t,i?n:0,a)}}function hf(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?e.z-t.z:e.id-t.id}function pf(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function gf(e){return(e.transmission>0||e.transmissionNode)&&e.side===Se&&!1===e.forceSinglePass}class mf{constructor(e,t,r){this.renderItems=[],this.renderItemsIndex=0,this.opaque=[],this.transparentDoublePass=[],this.transparent=[],this.bundles=[],this.lightsNode=e.getNode(t,r),this.lightsArray=[],this.scene=t,this.camera=r,this.occlusionQueryCount=0}begin(){return this.renderItemsIndex=0,this.opaque.length=0,this.transparentDoublePass.length=0,this.transparent.length=0,this.bundles.length=0,this.lightsArray.length=0,this.occlusionQueryCount=0,this}getNextRenderItem(e,t,r,s,i,n,a){let o=this.renderItems[this.renderItemsIndex];return void 0===o?(o={id:e.id,object:e,geometry:t,material:r,groupOrder:s,renderOrder:e.renderOrder,z:i,group:n,clippingContext:a},this.renderItems[this.renderItemsIndex]=o):(o.id=e.id,o.object=e,o.geometry=t,o.material=r,o.groupOrder=s,o.renderOrder=e.renderOrder,o.z=i,o.group=n,o.clippingContext=a),this.renderItemsIndex++,o}push(e,t,r,s,i,n,a){const o=this.getNextRenderItem(e,t,r,s,i,n,a);!0===e.occlusionTest&&this.occlusionQueryCount++,!0===r.transparent||r.transmission>0?(gf(r)&&this.transparentDoublePass.push(o),this.transparent.push(o)):this.opaque.push(o)}unshift(e,t,r,s,i,n,a){const o=this.getNextRenderItem(e,t,r,s,i,n,a);!0===r.transparent||r.transmission>0?(gf(r)&&this.transparentDoublePass.unshift(o),this.transparent.unshift(o)):this.opaque.unshift(o)}pushBundle(e){this.bundles.push(e)}pushLight(e){this.lightsArray.push(e)}sort(e,t){this.opaque.length>1&&this.opaque.sort(e||hf),this.transparentDoublePass.length>1&&this.transparentDoublePass.sort(t||pf),this.transparent.length>1&&this.transparent.sort(t||pf)}finish(){this.lightsNode.setLights(this.lightsArray);for(let e=this.renderItemsIndex,t=this.renderItems.length;e>t,u=a.height>>t;let l=e.depthTexture||i[t];const d=!0===e.depthBuffer||!0===e.stencilBuffer;let c=!1;void 0===l&&d&&(l=new V,l.format=e.stencilBuffer?we:Ae,l.type=e.stencilBuffer?Re:T,l.image.width=o,l.image.height=u,l.image.depth=a.depth,l.isArrayTexture=!0===e.multiview&&a.depth>1,i[t]=l),r.width===a.width&&a.height===r.height||(c=!0,l&&(l.needsUpdate=!0,l.image.width=o,l.image.height=u,l.image.depth=l.isArrayTexture?l.image.depth:1)),r.width=a.width,r.height=a.height,r.textures=n,r.depthTexture=l||null,r.depth=e.depthBuffer,r.stencil=e.stencilBuffer,r.renderTarget=e,r.sampleCount!==s&&(c=!0,l&&(l.needsUpdate=!0),r.sampleCount=s);const h={sampleCount:s};if(!0!==e.isXRRenderTarget){for(let e=0;e{e.removeEventListener("dispose",t);for(let e=0;e0){const s=e.image;if(void 0===s)console.warn("THREE.Renderer: Texture marked for update but image is undefined.");else if(!1===s.complete)console.warn("THREE.Renderer: Texture marked for update but image is incomplete.");else{if(e.images){const r=[];for(const t of e.images)r.push(t);t.images=r}else t.image=s;void 0!==r.isDefaultTexture&&!0!==r.isDefaultTexture||(i.createTexture(e,t),r.isDefaultTexture=!1,r.generation=e.version),!0===e.source.dataReady&&i.updateTexture(e,t),t.needsMipmaps&&0===e.mipmaps.length&&i.generateMipmaps(e)}}else i.createDefaultTexture(e),r.isDefaultTexture=!0,r.generation=e.version}if(!0!==r.initialized){r.initialized=!0,r.generation=e.version,this.info.memory.textures++;const t=()=>{e.removeEventListener("dispose",t),this._destroyTexture(e)};e.addEventListener("dispose",t)}r.version=e.version}getSize(e,t=Ef){let r=e.images?e.images[0]:e.image;return r?(void 0!==r.image&&(r=r.image),t.width=r.width||1,t.height=r.height||1,t.depth=e.isCubeTexture?6:r.depth||1):t.width=t.height=t.depth=1,t}getMipLevels(e,t,r){let s;return s=e.isCompressedTexture?e.mipmaps?e.mipmaps.length:1:Math.floor(Math.log2(Math.max(t,r)))+1,s}needsMipmaps(e){return!0===e.isCompressedTexture||e.generateMipmaps}_destroyTexture(e){!0===this.has(e)&&(this.backend.destroySampler(e),this.backend.destroyTexture(e),this.delete(e),this.info.memory.textures--)}}class Af extends e{constructor(e,t,r,s=1){super(e,t,r),this.a=s}set(e,t,r,s=1){return this.a=s,super.set(e,t,r)}copy(e){return void 0!==e.a&&(this.a=e.a),super.copy(e)}clone(){return new this.constructor(this.r,this.g,this.b,this.a)}}class Rf extends gn{static get type(){return"ParameterNode"}constructor(e,t=null){super(e,t),this.isParameterNode=!0}getHash(){return this.uuid}generate(){return this.name}}class Cf extends js{static get type(){return"StackNode"}constructor(e=null){super(),this.nodes=[],this.outputNode=null,this.parent=e,this._currentCond=null,this._expressionNode=null,this.isStackNode=!0}getNodeType(e){return this.outputNode?this.outputNode.getNodeType(e):"void"}getMemberType(e,t){return this.outputNode?this.outputNode.getMemberType(e,t):"void"}add(e){return this.nodes.push(e),this}If(e,t){const r=new Li(t);return this._currentCond=Xo(e,r),this.add(this._currentCond)}ElseIf(e,t){const r=new Li(t),s=Xo(e,r);return this._currentCond.elseNode=s,this._currentCond=s,this}Else(e){return this._currentCond.elseNode=new Li(e),this}Switch(e){return this._expressionNode=Bi(e),this}Case(...e){const t=[];if(!(e.length>=2))throw new Error("TSL: Invalid parameter length. Case() requires at least two parameters.");for(let r=0;r"string"==typeof t?{name:e,type:t,atomic:!1}:{name:e,type:t.type,atomic:t.atomic||!1}))),this.name=t,this.isStructLayoutNode=!0}getLength(){const e=Float32Array.BYTES_PER_ELEMENT;let t=0;for(const r of this.membersLayout){const s=r.type,i=Rs(s)*e,n=t%8,a=n%Cs(s),o=n+a;t+=a,0!==o&&8-oe.name===t));return r?r.type:"void"}getNodeType(e){return e.getStructTypeFromNode(this,this.membersLayout,this.name).name}setup(e){e.addInclude(this)}generate(e){return this.getNodeType(e)}}class Ff extends js{static get type(){return"StructNode"}constructor(e,t){super("vec3"),this.structLayoutNode=e,this.values=t,this.isStructNode=!0}getNodeType(e){return this.structLayoutNode.getNodeType(e)}getMemberType(e,t){return this.structLayoutNode.getMemberType(e,t)}generate(e){const t=e.getVarFromNode(this),r=t.type,s=e.getPropertyName(t);return e.addLineFlowCode(`${s} = ${e.generateStruct(r,this.structLayoutNode.membersLayout,this.values)}`,this),t.name}}class Lf extends js{static get type(){return"OutputStructNode"}constructor(...e){super(),this.members=e,this.isOutputStructNode=!0}getNodeType(e){const t=e.getNodeProperties(this);if(void 0===t.membersLayout){const r=this.members,s=[];for(let t=0;t{const t=e.toUint().mul(747796405).add(2891336453),r=t.shiftRight(t.shiftRight(28).add(4)).bitXor(t).mul(277803737);return r.shiftRight(22).bitXor(r).toFloat().mul(1/2**32)})),Of=(e,t)=>Ro(la(4,e.mul(ua(1,e))),t),kf=ki((([e])=>e.fract().sub(.5).abs())).setLayout({name:"tri",type:"float",inputs:[{name:"x",type:"float"}]}),Gf=ki((([e])=>en(kf(e.z.add(kf(e.y.mul(1)))),kf(e.z.add(kf(e.x.mul(1)))),kf(e.y.add(kf(e.x.mul(1))))))).setLayout({name:"tri3",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),zf=ki((([e,t,r])=>{const s=en(e).toVar(),i=ji(1.4).toVar(),n=ji(0).toVar(),a=en(s).toVar();return Zc({start:ji(0),end:ji(3),type:"float",condition:"<="},(()=>{const e=en(Gf(a.mul(2))).toVar();s.addAssign(e.add(r.mul(ji(.1).mul(t)))),a.mulAssign(1.8),i.mulAssign(1.5),s.mulAssign(1.2);const o=ji(kf(s.z.add(kf(s.x.add(kf(s.y)))))).toVar();n.addAssign(o.div(i)),a.addAssign(.14)})),n})).setLayout({name:"triNoise3D",type:"float",inputs:[{name:"position",type:"vec3"},{name:"speed",type:"float"},{name:"time",type:"float"}]});class Hf extends js{static get type(){return"FunctionOverloadingNode"}constructor(e=[],...t){super(),this.functionNodes=e,this.parametersNodes=t,this._candidateFnCall=null,this.global=!0}getNodeType(){return this.functionNodes[0].shaderNode.layout.type}setup(e){const t=this.parametersNodes;let r=this._candidateFnCall;if(null===r){let s=null,i=-1;for(const r of this.functionNodes){const n=r.shaderNode.layout;if(null===n)throw new Error("FunctionOverloadingNode: FunctionNode must be a layout.");const a=n.inputs;if(t.length===a.length){let n=0;for(let r=0;ri&&(s=r,i=n)}}this._candidateFnCall=r=s(...t)}return r}}const $f=Vi(Hf),Wf=e=>(...t)=>$f(e,...t),jf=Zn(0).setGroup(Kn).onRenderUpdate((e=>e.time)),qf=Zn(0).setGroup(Kn).onRenderUpdate((e=>e.deltaTime)),Xf=Zn(0,"uint").setGroup(Kn).onRenderUpdate((e=>e.frameId)),Kf=ki((([e,t,r=Yi(.5)])=>Rm(e.sub(r),t).add(r))),Yf=ki((([e,t,r=Yi(.5)])=>{const s=e.sub(r),i=s.dot(s),n=i.mul(i).mul(t);return e.add(s.mul(n))})),Qf=ki((({position:e=null,horizontal:t=!0,vertical:r=!1})=>{let s;null!==e?(s=El.toVar(),s[3][0]=e.x,s[3][1]=e.y,s[3][2]=e.z):s=El;const i=cl.mul(s);return Pi(t)&&(i[0][0]=El[0].length(),i[0][1]=0,i[0][2]=0),Pi(r)&&(i[1][0]=0,i[1][1]=El[1].length(),i[1][2]=0),i[2][0]=0,i[2][1]=0,i[2][2]=1,ll.mul(i).mul(Vl)})),Zf=ki((([e=null])=>{const t=Vh();return Vh(Ch(e)).sub(t).lessThan(0).select(ph,e)}));class Jf extends js{static get type(){return"SpriteSheetUVNode"}constructor(e,t=$u(),r=ji(0)){super("vec2"),this.countNode=e,this.uvNode=t,this.frameNode=r}setup(){const{frameNode:e,uvNode:t,countNode:r}=this,{width:s,height:i}=r,n=e.mod(s.mul(i)).floor(),a=n.mod(s),o=i.sub(n.add(1).div(s).ceil()),u=r.reciprocal(),l=Yi(a,o);return t.add(l).mul(u)}}const ey=Vi(Jf).setParameterLength(3);class ty extends js{static get type(){return"TriplanarTexturesNode"}constructor(e,t=null,r=null,s=ji(1),i=Vl,n=ql){super("vec4"),this.textureXNode=e,this.textureYNode=t,this.textureZNode=r,this.scaleNode=s,this.positionNode=i,this.normalNode=n}setup(){const{textureXNode:e,textureYNode:t,textureZNode:r,scaleNode:s,positionNode:i,normalNode:n}=this;let a=n.abs().normalize();a=a.div(a.dot(en(1)));const o=i.yz.mul(s),u=i.zx.mul(s),l=i.xy.mul(s),d=e.value,c=null!==t?t.value:d,h=null!==r?r.value:d,p=Zu(d,o).mul(a.x),g=Zu(c,u).mul(a.y),m=Zu(h,l).mul(a.z);return oa(p,g,m)}}const ry=Vi(ty).setParameterLength(1,6),sy=new Me,iy=new r,ny=new r,ay=new r,oy=new a,uy=new r(0,0,-1),ly=new s,dy=new r,cy=new r,hy=new s,py=new t,gy=new oe,my=ph.flipX();gy.depthTexture=new V(1,1);let fy=!1;class yy extends Yu{static get type(){return"ReflectorNode"}constructor(e={}){super(e.defaultTexture||gy.texture,my),this._reflectorBaseNode=e.reflector||new xy(this,e),this._depthNode=null,this.setUpdateMatrix(!1)}get reflector(){return this._reflectorBaseNode}get target(){return this._reflectorBaseNode.target}getDepthNode(){if(null===this._depthNode){if(!0!==this._reflectorBaseNode.depth)throw new Error("THREE.ReflectorNode: Depth node can only be requested when the reflector is created with { depth: true }. ");this._depthNode=Bi(new yy({defaultTexture:gy.depthTexture,reflector:this._reflectorBaseNode}))}return this._depthNode}setup(e){return e.object.isQuadMesh||this._reflectorBaseNode.build(e),super.setup(e)}clone(){const e=new this.constructor(this.reflectorNode);return e._reflectorBaseNode=this._reflectorBaseNode,e}dispose(){super.dispose(),this._reflectorBaseNode.dispose()}}class xy extends js{static get type(){return"ReflectorBaseNode"}constructor(e,t={}){super();const{target:r=new Pe,resolution:s=1,generateMipmaps:i=!1,bounces:n=!0,depth:a=!1}=t;this.textureNode=e,this.target=r,this.resolution=s,this.generateMipmaps=i,this.bounces=n,this.depth=a,this.updateBeforeType=n?Vs.RENDER:Vs.FRAME,this.virtualCameras=new WeakMap,this.renderTargets=new Map,this.forceUpdate=!1,this.hasOutput=!1}_updateResolution(e,t){const r=this.resolution;t.getDrawingBufferSize(py),e.setSize(Math.round(py.width*r),Math.round(py.height*r))}setup(e){return this._updateResolution(gy,e.renderer),super.setup(e)}dispose(){super.dispose();for(const e of this.renderTargets.values())e.dispose()}getVirtualCamera(e){let t=this.virtualCameras.get(e);return void 0===t&&(t=e.clone(),this.virtualCameras.set(e,t)),t}getRenderTarget(e){let t=this.renderTargets.get(e);return void 0===t&&(t=new oe(0,0,{type:de}),!0===this.generateMipmaps&&(t.texture.minFilter=Fe,t.texture.generateMipmaps=!0),!0===this.depth&&(t.depthTexture=new V),this.renderTargets.set(e,t)),t}updateBefore(e){if(!1===this.bounces&&fy)return!1;fy=!0;const{scene:t,camera:r,renderer:s,material:i}=e,{target:n}=this,a=this.getVirtualCamera(r),o=this.getRenderTarget(a);s.getDrawingBufferSize(py),this._updateResolution(o,s),ny.setFromMatrixPosition(n.matrixWorld),ay.setFromMatrixPosition(r.matrixWorld),oy.extractRotation(n.matrixWorld),iy.set(0,0,1),iy.applyMatrix4(oy),dy.subVectors(ny,ay);let u=!1;if(!0===dy.dot(iy)>0&&!1===this.forceUpdate){if(!1===this.hasOutput)return void(fy=!1);u=!0}dy.reflect(iy).negate(),dy.add(ny),oy.extractRotation(r.matrixWorld),uy.set(0,0,-1),uy.applyMatrix4(oy),uy.add(ay),cy.subVectors(ny,uy),cy.reflect(iy).negate(),cy.add(ny),a.coordinateSystem=r.coordinateSystem,a.position.copy(dy),a.up.set(0,1,0),a.up.applyMatrix4(oy),a.up.reflect(iy),a.lookAt(cy),a.near=r.near,a.far=r.far,a.updateMatrixWorld(),a.projectionMatrix.copy(r.projectionMatrix),sy.setFromNormalAndCoplanarPoint(iy,ny),sy.applyMatrix4(a.matrixWorldInverse),ly.set(sy.normal.x,sy.normal.y,sy.normal.z,sy.constant);const l=a.projectionMatrix;hy.x=(Math.sign(ly.x)+l.elements[8])/l.elements[0],hy.y=(Math.sign(ly.y)+l.elements[9])/l.elements[5],hy.z=-1,hy.w=(1+l.elements[10])/l.elements[14],ly.multiplyScalar(1/ly.dot(hy));l.elements[2]=ly.x,l.elements[6]=ly.y,l.elements[10]=s.coordinateSystem===d?ly.z-0:ly.z+1-0,l.elements[14]=ly.w,this.textureNode.value=o.texture,!0===this.depth&&(this.textureNode.getDepthNode().value=o.depthTexture),i.visible=!1;const c=s.getRenderTarget(),h=s.getMRT(),p=s.autoClear;s.setMRT(null),s.setRenderTarget(o),s.autoClear=!0,u?(s.clear(),this.hasOutput=!1):(s.render(t,a),this.hasOutput=!0),s.setMRT(h),s.setRenderTarget(c),s.autoClear=p,i.visible=!0,fy=!1,this.forceUpdate=!1}}const by=new ne(-1,1,1,-1,0,1);class Ty extends he{constructor(e=!1){super();const t=!1===e?[0,-1,0,1,2,1]:[0,2,0,0,2,0];this.setAttribute("position",new Le([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Le(t,2))}}const _y=new Ty;class vy extends q{constructor(e=null){super(_y,e),this.camera=by,this.isQuadMesh=!0}async renderAsync(e){return e.renderAsync(this,by)}render(e){e.render(this,by)}}const Ny=new t;class Sy extends Yu{static get type(){return"RTTNode"}constructor(e,t=null,r=null,s={type:de}){const i=new oe(t,r,s);super(i.texture,$u()),this.node=e,this.width=t,this.height=r,this.pixelRatio=1,this.renderTarget=i,this.textureNeedsUpdate=!0,this.autoUpdate=!0,this._rttNode=null,this._quadMesh=new vy(new Wh),this.updateBeforeType=Vs.RENDER}get autoSize(){return null===this.width}setup(e){return this._rttNode=this.node.context(e.getSharedContext()),this._quadMesh.material.name="RTT",this._quadMesh.material.needsUpdate=!0,super.setup(e)}setSize(e,t){this.width=e,this.height=t;const r=e*this.pixelRatio,s=t*this.pixelRatio;this.renderTarget.setSize(r,s),this.textureNeedsUpdate=!0}setPixelRatio(e){this.pixelRatio=e,this.setSize(this.width,this.height)}updateBefore({renderer:e}){if(!1===this.textureNeedsUpdate&&!1===this.autoUpdate)return;if(this.textureNeedsUpdate=!1,!0===this.autoSize){this.pixelRatio=e.getPixelRatio();const t=e.getSize(Ny);this.setSize(t.width,t.height)}this._quadMesh.material.fragmentNode=this._rttNode;const t=e.getRenderTarget();e.setRenderTarget(this.renderTarget),this._quadMesh.render(e),e.setRenderTarget(t)}clone(){const e=new Yu(this.value,this.uvNode,this.levelNode);return e.sampler=this.sampler,e.referenceNode=this,e}}const Ey=(e,...t)=>Bi(new Sy(Bi(e),...t)),wy=ki((([e,t,r],s)=>{let i;s.renderer.coordinateSystem===d?(e=Yi(e.x,e.y.oneMinus()).mul(2).sub(1),i=nn(en(e,t),1)):i=nn(en(e.x,e.y.oneMinus(),t).mul(2).sub(1),1);const n=nn(r.mul(i));return n.xyz.div(n.w)})),Ay=ki((([e,t])=>{const r=t.mul(nn(e,1)),s=r.xy.div(r.w).mul(.5).add(.5).toVar();return Yi(s.x,s.y.oneMinus())})),Ry=ki((([e,t,r])=>{const s=ju(Ju(t)),i=Qi(e.mul(s)).toVar(),n=Ju(t,i).toVar(),a=Ju(t,i.sub(Qi(2,0))).toVar(),o=Ju(t,i.sub(Qi(1,0))).toVar(),u=Ju(t,i.add(Qi(1,0))).toVar(),l=Ju(t,i.add(Qi(2,0))).toVar(),d=Ju(t,i.add(Qi(0,2))).toVar(),c=Ju(t,i.add(Qi(0,1))).toVar(),h=Ju(t,i.sub(Qi(0,1))).toVar(),p=Ju(t,i.sub(Qi(0,2))).toVar(),g=no(ua(ji(2).mul(o).sub(a),n)).toVar(),m=no(ua(ji(2).mul(u).sub(l),n)).toVar(),f=no(ua(ji(2).mul(c).sub(d),n)).toVar(),y=no(ua(ji(2).mul(h).sub(p),n)).toVar(),x=wy(e,n,r).toVar(),b=g.lessThan(m).select(x.sub(wy(e.sub(Yi(ji(1).div(s.x),0)),o,r)),x.negate().add(wy(e.add(Yi(ji(1).div(s.x),0)),u,r))),T=f.lessThan(y).select(x.sub(wy(e.add(Yi(0,ji(1).div(s.y))),c,r)),x.negate().add(wy(e.sub(Yi(0,ji(1).div(s.y))),h,r)));return Qa(Ao(b,T))}));class Cy extends F{constructor(e,t,r=Float32Array){super(ArrayBuffer.isView(e)?e:new r(e*t),t),this.isStorageInstancedBufferAttribute=!0}}class My extends pe{constructor(e,t,r=Float32Array){super(ArrayBuffer.isView(e)?e:new r(e*t),t),this.isStorageBufferAttribute=!0}}class Py extends js{static get type(){return"PointUVNode"}constructor(){super("vec2"),this.isPointUVNode=!0}generate(){return"vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y )"}}const Fy=Ui(Py),Ly=new E,By=new a;class Iy extends js{static get type(){return"SceneNode"}constructor(e=Iy.BACKGROUND_BLURRINESS,t=null){super(),this.scope=e,this.scene=t}setup(e){const t=this.scope,r=null!==this.scene?this.scene:e.scene;let s;return t===Iy.BACKGROUND_BLURRINESS?s=yd("backgroundBlurriness","float",r):t===Iy.BACKGROUND_INTENSITY?s=yd("backgroundIntensity","float",r):t===Iy.BACKGROUND_ROTATION?s=Zn("mat4").label("backgroundRotation").setGroup(Kn).onRenderUpdate((()=>{const e=r.background;return null!==e&&e.isTexture&&e.mapping!==Be?(Ly.copy(r.backgroundRotation),Ly.x*=-1,Ly.y*=-1,Ly.z*=-1,By.makeRotationFromEuler(Ly)):By.identity(),By})):console.error("THREE.SceneNode: Unknown scope:",t),s}}Iy.BACKGROUND_BLURRINESS="backgroundBlurriness",Iy.BACKGROUND_INTENSITY="backgroundIntensity",Iy.BACKGROUND_ROTATION="backgroundRotation";const Dy=Ui(Iy,Iy.BACKGROUND_BLURRINESS),Vy=Ui(Iy,Iy.BACKGROUND_INTENSITY),Uy=Ui(Iy,Iy.BACKGROUND_ROTATION);class Oy extends Yu{static get type(){return"StorageTextureNode"}constructor(e,t,r=null){super(e,t),this.storeNode=r,this.isStorageTextureNode=!0,this.access=Os.WRITE_ONLY}getInputType(){return"storageTexture"}setup(e){super.setup(e);const t=e.getNodeProperties(this);return t.storeNode=this.storeNode,t}setAccess(e){return this.access=e,this}generate(e,t){let r;return r=null!==this.storeNode?this.generateStore(e):super.generate(e,t),r}toReadWrite(){return this.setAccess(Os.READ_WRITE)}toReadOnly(){return this.setAccess(Os.READ_ONLY)}toWriteOnly(){return this.setAccess(Os.WRITE_ONLY)}generateStore(e){const t=e.getNodeProperties(this),{uvNode:r,storeNode:s,depthNode:i}=t,n=super.generate(e,"property"),a=r.build(e,"uvec2"),o=s.build(e,"vec4"),u=i?i.build(e,"int"):null,l=e.generateTextureStore(e,n,a,u,o);e.addLineFlowCode(l,this)}clone(){const e=super.clone();return e.storeNode=this.storeNode,e}}const ky=Vi(Oy).setParameterLength(1,3),Gy=ki((({texture:e,uv:t})=>{const r=1e-4,s=en().toVar();return Hi(t.x.lessThan(r),(()=>{s.assign(en(1,0,0))})).ElseIf(t.y.lessThan(r),(()=>{s.assign(en(0,1,0))})).ElseIf(t.z.lessThan(r),(()=>{s.assign(en(0,0,1))})).ElseIf(t.x.greaterThan(.9999),(()=>{s.assign(en(-1,0,0))})).ElseIf(t.y.greaterThan(.9999),(()=>{s.assign(en(0,-1,0))})).ElseIf(t.z.greaterThan(.9999),(()=>{s.assign(en(0,0,-1))})).Else((()=>{const r=.01,i=e.sample(t.add(en(-.01,0,0))).r.sub(e.sample(t.add(en(r,0,0))).r),n=e.sample(t.add(en(0,-.01,0))).r.sub(e.sample(t.add(en(0,r,0))).r),a=e.sample(t.add(en(0,0,-.01))).r.sub(e.sample(t.add(en(0,0,r))).r);s.assign(en(i,n,a))})),s.normalize()}));class zy extends Yu{static get type(){return"Texture3DNode"}constructor(e,t=null,r=null){super(e,t,r),this.isTexture3DNode=!0}getInputType(){return"texture3D"}getDefaultUV(){return en(.5,.5,.5)}setUpdateMatrix(){}setupUV(e,t){const r=this.value;return!e.isFlipY()||!0!==r.isRenderTargetTexture&&!0!==r.isFramebufferTexture||(t=this.sampler?t.flipY():t.setY(qi(ju(this,this.levelNode).y).sub(t.y).sub(1))),t}generateUV(e,t){return t.build(e,"vec3")}normal(e){return Gy({texture:this,uv:e})}}const Hy=Vi(zy).setParameterLength(1,3);class $y extends fd{static get type(){return"UserDataNode"}constructor(e,t,r=null){super(e,t,r),this.userData=r}updateReference(e){return this.reference=null!==this.userData?this.userData:e.object.userData,this.reference}}const Wy=new WeakMap;class jy extends Ks{static get type(){return"VelocityNode"}constructor(){super("vec2"),this.projectionMatrix=null,this.updateType=Vs.OBJECT,this.updateAfterType=Vs.OBJECT,this.previousModelWorldMatrix=Zn(new a),this.previousProjectionMatrix=Zn(new a).setGroup(Kn),this.previousCameraViewMatrix=Zn(new a)}setProjectionMatrix(e){this.projectionMatrix=e}update({frameId:e,camera:t,object:r}){const s=Xy(r);this.previousModelWorldMatrix.value.copy(s);const i=qy(t);i.frameId!==e&&(i.frameId=e,void 0===i.previousProjectionMatrix?(i.previousProjectionMatrix=new a,i.previousCameraViewMatrix=new a,i.currentProjectionMatrix=new a,i.currentCameraViewMatrix=new a,i.previousProjectionMatrix.copy(this.projectionMatrix||t.projectionMatrix),i.previousCameraViewMatrix.copy(t.matrixWorldInverse)):(i.previousProjectionMatrix.copy(i.currentProjectionMatrix),i.previousCameraViewMatrix.copy(i.currentCameraViewMatrix)),i.currentProjectionMatrix.copy(this.projectionMatrix||t.projectionMatrix),i.currentCameraViewMatrix.copy(t.matrixWorldInverse),this.previousProjectionMatrix.value.copy(i.previousProjectionMatrix),this.previousCameraViewMatrix.value.copy(i.previousCameraViewMatrix))}updateAfter({object:e}){Xy(e).copy(e.matrixWorld)}setup(){const e=null===this.projectionMatrix?ll:Zn(this.projectionMatrix),t=this.previousCameraViewMatrix.mul(this.previousModelWorldMatrix),r=e.mul(Fl).mul(Vl),s=this.previousProjectionMatrix.mul(t).mul(Ul),i=r.xy.div(r.w),n=s.xy.div(s.w);return ua(i,n)}}function qy(e){let t=Wy.get(e);return void 0===t&&(t={},Wy.set(e,t)),t}function Xy(e,t=0){const r=qy(e);let s=r[t];return void 0===s&&(r[t]=s=new a,r[t].copy(e.matrixWorld)),s}const Ky=Ui(jy),Yy=ki((([e,t])=>To(1,e.oneMinus().div(t)).oneMinus())).setLayout({name:"blendBurn",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),Qy=ki((([e,t])=>To(e.div(t.oneMinus()),1))).setLayout({name:"blendDodge",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),Zy=ki((([e,t])=>e.oneMinus().mul(t.oneMinus()).oneMinus())).setLayout({name:"blendScreen",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),Jy=ki((([e,t])=>Io(e.mul(2).mul(t),e.oneMinus().mul(2).mul(t.oneMinus()).oneMinus(),vo(.5,e)))).setLayout({name:"blendOverlay",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),ex=ki((([e,t])=>{const r=t.a.add(e.a.mul(t.a.oneMinus()));return nn(t.rgb.mul(t.a).add(e.rgb.mul(e.a).mul(t.a.oneMinus())).div(r),r)})).setLayout({name:"blendColor",type:"vec4",inputs:[{name:"base",type:"vec4"},{name:"blend",type:"vec4"}]}),tx=ki((([e])=>nn(e.rgb.mul(e.a),e.a)),{color:"vec4",return:"vec4"}),rx=ki((([e])=>(Hi(e.a.equal(0),(()=>nn(0))),nn(e.rgb.div(e.a),e.a))),{color:"vec4",return:"vec4"}),sx=ki((([e])=>ox(e.rgb))),ix=ki((([e,t=ji(1)])=>t.mix(ox(e.rgb),e.rgb))),nx=ki((([e,t=ji(1)])=>{const r=oa(e.r,e.g,e.b).div(3),s=e.r.max(e.g.max(e.b)),i=s.sub(r).mul(t).mul(-3);return Io(e.rgb,s,i)})),ax=ki((([e,t=ji(1)])=>{const r=en(.57735,.57735,.57735),s=t.cos();return en(e.rgb.mul(s).add(r.cross(e.rgb).mul(t.sin()).add(r.mul(wo(r,e.rgb).mul(s.oneMinus())))))})),ox=(e,t=en(c.getLuminanceCoefficients(new r)))=>wo(e,t),ux=ki((([e,t=en(1),s=en(0),i=en(1),n=ji(1),a=en(c.getLuminanceCoefficients(new r,ue))])=>{const o=e.rgb.dot(en(a)),u=_o(e.rgb.mul(t).add(s),0).toVar(),l=u.pow(i).toVar();return Hi(u.r.greaterThan(0),(()=>{u.r.assign(l.r)})),Hi(u.g.greaterThan(0),(()=>{u.g.assign(l.g)})),Hi(u.b.greaterThan(0),(()=>{u.b.assign(l.b)})),u.assign(o.add(u.sub(o).mul(n))),nn(u.rgb,e.a)}));class lx extends Ks{static get type(){return"PosterizeNode"}constructor(e,t){super(),this.sourceNode=e,this.stepsNode=t}setup(){const{sourceNode:e,stepsNode:t}=this;return e.mul(t).floor().div(t)}}const dx=Vi(lx).setParameterLength(2),cx=new t;class hx extends Yu{static get type(){return"PassTextureNode"}constructor(e,t){super(t),this.passNode=e,this.setUpdateMatrix(!1)}setup(e){return e.object.isQuadMesh&&this.passNode.build(e),super.setup(e)}clone(){return new this.constructor(this.passNode,this.value)}}class px extends hx{static get type(){return"PassMultipleTextureNode"}constructor(e,t,r=!1){super(e,null),this.textureName=t,this.previousTexture=r}updateTexture(){this.value=this.previousTexture?this.passNode.getPreviousTexture(this.textureName):this.passNode.getTexture(this.textureName)}setup(e){return this.updateTexture(),super.setup(e)}clone(){return new this.constructor(this.passNode,this.textureName,this.previousTexture)}}class gx extends Ks{static get type(){return"PassNode"}constructor(e,t,r,s={}){super("vec4"),this.scope=e,this.scene=t,this.camera=r,this.options=s,this._pixelRatio=1,this._width=1,this._height=1;const i=new V;i.isRenderTargetTexture=!0,i.name="depth";const n=new oe(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:de,...s});n.texture.name="output",n.depthTexture=i,this.renderTarget=n,this._textures={output:n.texture,depth:i},this._textureNodes={},this._linearDepthNodes={},this._viewZNodes={},this._previousTextures={},this._previousTextureNodes={},this._cameraNear=Zn(0),this._cameraFar=Zn(0),this._mrt=null,this._layers=null,this._resolution=1,this.isPassNode=!0,this.updateBeforeType=Vs.FRAME,this.global=!0}setResolution(e){return this._resolution=e,this}getResolution(){return this._resolution}setLayers(e){return this._layers=e,this}getLayers(){return this._layers}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}getTexture(e){let t=this._textures[e];if(void 0===t){t=this.renderTarget.texture.clone(),t.name=e,this._textures[e]=t,this.renderTarget.textures.push(t)}return t}getPreviousTexture(e){let t=this._previousTextures[e];return void 0===t&&(t=this.getTexture(e).clone(),this._previousTextures[e]=t),t}toggleTexture(e){const t=this._previousTextures[e];if(void 0!==t){const r=this._textures[e],s=this.renderTarget.textures.indexOf(r);this.renderTarget.textures[s]=t,this._textures[e]=t,this._previousTextures[e]=r,this._textureNodes[e].updateTexture(),this._previousTextureNodes[e].updateTexture()}}getTextureNode(e="output"){let t=this._textureNodes[e];return void 0===t&&(t=Bi(new px(this,e)),t.updateTexture(),this._textureNodes[e]=t),t}getPreviousTextureNode(e="output"){let t=this._previousTextureNodes[e];return void 0===t&&(void 0===this._textureNodes[e]&&this.getTextureNode(e),t=Bi(new px(this,e,!0)),t.updateTexture(),this._previousTextureNodes[e]=t),t}getViewZNode(e="depth"){let t=this._viewZNodes[e];if(void 0===t){const r=this._cameraNear,s=this._cameraFar;this._viewZNodes[e]=t=Lh(this.getTextureNode(e),r,s)}return t}getLinearDepthNode(e="depth"){let t=this._linearDepthNodes[e];if(void 0===t){const r=this._cameraNear,s=this._cameraFar,i=this.getViewZNode(e);this._linearDepthNodes[e]=t=Ph(i,r,s)}return t}setup({renderer:e}){return this.renderTarget.samples=void 0===this.options.samples?e.samples:this.options.samples,this.renderTarget.texture.type=e.getColorBufferType(),this.scope===gx.COLOR?this.getTextureNode():this.getLinearDepthNode()}updateBefore(e){const{renderer:t}=e,{scene:r}=this;let s,i;const n=t.getOutputRenderTarget();n&&!0===n.isXRRenderTarget?(i=1,s=t.xr.getCamera(),t.xr.updateCamera(s),cx.set(n.width,n.height)):(s=this.camera,i=t.getPixelRatio(),t.getSize(cx)),this._pixelRatio=i,this.setSize(cx.width,cx.height);const a=t.getRenderTarget(),o=t.getMRT(),u=s.layers.mask;this._cameraNear.value=s.near,this._cameraFar.value=s.far,null!==this._layers&&(s.layers.mask=this._layers.mask);for(const e in this._previousTextures)this.toggleTexture(e);t.setRenderTarget(this.renderTarget),t.setMRT(this._mrt),t.render(r,s),t.setRenderTarget(a),t.setMRT(o),s.layers.mask=u}setSize(e,t){this._width=e,this._height=t;const r=this._width*this._pixelRatio*this._resolution,s=this._height*this._pixelRatio*this._resolution;this.renderTarget.setSize(r,s)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget.dispose()}}gx.COLOR="color",gx.DEPTH="depth";class mx extends gx{static get type(){return"ToonOutlinePassNode"}constructor(e,t,r,s,i){super(gx.COLOR,e,t),this.colorNode=r,this.thicknessNode=s,this.alphaNode=i,this._materialCache=new WeakMap}updateBefore(e){const{renderer:t}=e,r=t.getRenderObjectFunction();t.setRenderObjectFunction(((e,r,s,i,n,a,o,u)=>{if((n.isMeshToonMaterial||n.isMeshToonNodeMaterial)&&!1===n.wireframe){const l=this._getOutlineMaterial(n);t.renderObject(e,r,s,i,l,a,o,u)}t.renderObject(e,r,s,i,n,a,o,u)})),super.updateBefore(e),t.setRenderObjectFunction(r)}_createMaterial(){const e=new Wh;e.isMeshToonOutlineMaterial=!0,e.name="Toon_Outline",e.side=S;const t=ql.negate(),r=ll.mul(Fl),s=ji(1),i=r.mul(nn(Vl,1)),n=r.mul(nn(Vl.add(t),1)),a=Qa(i.sub(n));return e.vertexNode=i.add(a.mul(this.thicknessNode).mul(i.w).mul(s)),e.colorNode=nn(this.colorNode,this.alphaNode),e}_getOutlineMaterial(e){let t=this._materialCache.get(e);return void 0===t&&(t=this._createMaterial(),this._materialCache.set(e,t)),t}}const fx=ki((([e,t])=>e.mul(t).clamp())).setLayout({name:"linearToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),yx=ki((([e,t])=>(e=e.mul(t)).div(e.add(1)).clamp())).setLayout({name:"reinhardToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),xx=ki((([e,t])=>{const r=(e=(e=e.mul(t)).sub(.004).max(0)).mul(e.mul(6.2).add(.5)),s=e.mul(e.mul(6.2).add(1.7)).add(.06);return r.div(s).pow(2.2)})).setLayout({name:"cineonToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),bx=ki((([e])=>{const t=e.mul(e.add(.0245786)).sub(90537e-9),r=e.mul(e.add(.432951).mul(.983729)).add(.238081);return t.div(r)})),Tx=ki((([e,t])=>{const r=dn(.59719,.35458,.04823,.076,.90834,.01566,.0284,.13383,.83777),s=dn(1.60475,-.53108,-.07367,-.10208,1.10813,-.00605,-.00327,-.07276,1.07602);return e=e.mul(t).div(.6),e=r.mul(e),e=bx(e),(e=s.mul(e)).clamp()})).setLayout({name:"acesFilmicToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),_x=dn(en(1.6605,-.1246,-.0182),en(-.5876,1.1329,-.1006),en(-.0728,-.0083,1.1187)),vx=dn(en(.6274,.0691,.0164),en(.3293,.9195,.088),en(.0433,.0113,.8956)),Nx=ki((([e])=>{const t=en(e).toVar(),r=en(t.mul(t)).toVar(),s=en(r.mul(r)).toVar();return ji(15.5).mul(s.mul(r)).sub(la(40.14,s.mul(t))).add(la(31.96,s).sub(la(6.868,r.mul(t))).add(la(.4298,r).add(la(.1191,t).sub(.00232))))})),Sx=ki((([e,t])=>{const r=en(e).toVar(),s=dn(en(.856627153315983,.137318972929847,.11189821299995),en(.0951212405381588,.761241990602591,.0767994186031903),en(.0482516061458583,.101439036467562,.811302368396859)),i=dn(en(1.1271005818144368,-.1413297634984383,-.14132976349843826),en(-.11060664309660323,1.157823702216272,-.11060664309660294),en(-.016493938717834573,-.016493938717834257,1.2519364065950405)),n=ji(-12.47393),a=ji(4.026069);return r.mulAssign(t),r.assign(vx.mul(r)),r.assign(s.mul(r)),r.assign(_o(r,1e-10)),r.assign(ja(r)),r.assign(r.sub(n).div(a.sub(n))),r.assign(Do(r,0,1)),r.assign(Nx(r)),r.assign(i.mul(r)),r.assign(Ro(_o(en(0),r),en(2.2))),r.assign(_x.mul(r)),r.assign(Do(r,0,1)),r})).setLayout({name:"agxToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),Ex=ki((([e,t])=>{const r=ji(.76),s=ji(.15);e=e.mul(t);const i=To(e.r,To(e.g,e.b)),n=Xo(i.lessThan(.08),i.sub(la(6.25,i.mul(i))),.04);e.subAssign(n);const a=_o(e.r,_o(e.g,e.b));Hi(a.lessThan(r),(()=>e));const o=ua(1,r),u=ua(1,o.mul(o).div(a.add(o.sub(r))));e.mulAssign(u.div(a));const l=ua(1,da(1,s.mul(a.sub(u)).add(1)));return Io(e,en(u),l)})).setLayout({name:"neutralToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]});class wx extends js{static get type(){return"CodeNode"}constructor(e="",t=[],r=""){super("code"),this.isCodeNode=!0,this.global=!0,this.code=e,this.includes=t,this.language=r}setIncludes(e){return this.includes=e,this}getIncludes(){return this.includes}generate(e){const t=this.getIncludes(e);for(const r of t)r.build(e);const r=e.getCodeFromNode(this,this.getNodeType(e));return r.code=this.code,r.code}serialize(e){super.serialize(e),e.code=this.code,e.language=this.language}deserialize(e){super.deserialize(e),this.code=e.code,this.language=e.language}}const Ax=Vi(wx).setParameterLength(1,3);class Rx extends wx{static get type(){return"FunctionNode"}constructor(e="",t=[],r=""){super(e,t,r)}getNodeType(e){return this.getNodeFunction(e).type}getInputs(e){return this.getNodeFunction(e).inputs}getNodeFunction(e){const t=e.getDataFromNode(this);let r=t.nodeFunction;return void 0===r&&(r=e.parser.parseFunction(this.code),t.nodeFunction=r),r}generate(e,t){super.generate(e);const r=this.getNodeFunction(e),s=r.name,i=r.type,n=e.getCodeFromNode(this,i);""!==s&&(n.name=s);const a=e.getPropertyName(n),o=this.getNodeFunction(e).getCode(a);return n.code=o+"\n","property"===t?a:e.format(`${a}()`,i,t)}}const Cx=(e,t=[],r="")=>{for(let e=0;es.call(...e);return i.functionNode=s,i};class Mx extends js{static get type(){return"ScriptableValueNode"}constructor(e=null){super(),this._value=e,this._cache=null,this.inputType=null,this.outputType=null,this.events=new o,this.isScriptableValueNode=!0}get isScriptableOutputNode(){return null!==this.outputType}set value(e){this._value!==e&&(this._cache&&"URL"===this.inputType&&this.value.value instanceof ArrayBuffer&&(URL.revokeObjectURL(this._cache),this._cache=null),this._value=e,this.events.dispatchEvent({type:"change"}),this.refresh())}get value(){return this._value}refresh(){this.events.dispatchEvent({type:"refresh"})}getValue(){const e=this.value;if(e&&null===this._cache&&"URL"===this.inputType&&e.value instanceof ArrayBuffer)this._cache=URL.createObjectURL(new Blob([e.value]));else if(e&&null!==e.value&&void 0!==e.value&&(("URL"===this.inputType||"String"===this.inputType)&&"string"==typeof e.value||"Number"===this.inputType&&"number"==typeof e.value||"Vector2"===this.inputType&&e.value.isVector2||"Vector3"===this.inputType&&e.value.isVector3||"Vector4"===this.inputType&&e.value.isVector4||"Color"===this.inputType&&e.value.isColor||"Matrix3"===this.inputType&&e.value.isMatrix3||"Matrix4"===this.inputType&&e.value.isMatrix4))return e.value;return this._cache||e}getNodeType(e){return this.value&&this.value.isNode?this.value.getNodeType(e):"float"}setup(){return this.value&&this.value.isNode?this.value:ji()}serialize(e){super.serialize(e),null!==this.value?"ArrayBuffer"===this.inputType?e.value=Ls(this.value):e.value=this.value?this.value.toJSON(e.meta).uuid:null:e.value=null,e.inputType=this.inputType,e.outputType=this.outputType}deserialize(e){super.deserialize(e);let t=null;null!==e.value&&(t="ArrayBuffer"===e.inputType?Bs(e.value):"Texture"===e.inputType?e.meta.textures[e.value]:e.meta.nodes[e.value]||null),this.value=t,this.inputType=e.inputType,this.outputType=e.outputType}}const Px=Vi(Mx).setParameterLength(1);class Fx extends Map{get(e,t=null,...r){if(this.has(e))return super.get(e);if(null!==t){const s=t(...r);return this.set(e,s),s}}}class Lx{constructor(e){this.scriptableNode=e}get parameters(){return this.scriptableNode.parameters}get layout(){return this.scriptableNode.getLayout()}getInputLayout(e){return this.scriptableNode.getInputLayout(e)}get(e){const t=this.parameters[e];return t?t.getValue():null}}const Bx=new Fx;class Ix extends js{static get type(){return"ScriptableNode"}constructor(e=null,t={}){super(),this.codeNode=e,this.parameters=t,this._local=new Fx,this._output=Px(null),this._outputs={},this._source=this.source,this._method=null,this._object=null,this._value=null,this._needsOutputUpdate=!0,this.onRefresh=this.onRefresh.bind(this),this.isScriptableNode=!0}get source(){return this.codeNode?this.codeNode.code:""}setLocal(e,t){return this._local.set(e,t)}getLocal(e){return this._local.get(e)}onRefresh(){this._refresh()}getInputLayout(e){for(const t of this.getLayout())if(t.inputType&&(t.id===e||t.name===e))return t}getOutputLayout(e){for(const t of this.getLayout())if(t.outputType&&(t.id===e||t.name===e))return t}setOutput(e,t){const r=this._outputs;return void 0===r[e]?r[e]=Px(t):r[e].value=t,this}getOutput(e){return this._outputs[e]}getParameter(e){return this.parameters[e]}setParameter(e,t){const r=this.parameters;return t&&t.isScriptableNode?(this.deleteParameter(e),r[e]=t,r[e].getDefaultOutput().events.addEventListener("refresh",this.onRefresh)):t&&t.isScriptableValueNode?(this.deleteParameter(e),r[e]=t,r[e].events.addEventListener("refresh",this.onRefresh)):void 0===r[e]?(r[e]=Px(t),r[e].events.addEventListener("refresh",this.onRefresh)):r[e].value=t,this}getValue(){return this.getDefaultOutput().getValue()}deleteParameter(e){let t=this.parameters[e];return t&&(t.isScriptableNode&&(t=t.getDefaultOutput()),t.events.removeEventListener("refresh",this.onRefresh)),this}clearParameters(){for(const e of Object.keys(this.parameters))this.deleteParameter(e);return this.needsUpdate=!0,this}call(e,...t){const r=this.getObject()[e];if("function"==typeof r)return r(...t)}async callAsync(e,...t){const r=this.getObject()[e];if("function"==typeof r)return"AsyncFunction"===r.constructor.name?await r(...t):r(...t)}getNodeType(e){return this.getDefaultOutputNode().getNodeType(e)}refresh(e=null){null!==e?this.getOutput(e).refresh():this._refresh()}getObject(){if(this.needsUpdate&&this.dispose(),null!==this._object)return this._object;const e=new Lx(this),t=Bx.get("THREE"),r=Bx.get("TSL"),s=this.getMethod(),i=[e,this._local,Bx,()=>this.refresh(),(e,t)=>this.setOutput(e,t),t,r];this._object=s(...i);const n=this._object.layout;if(n&&(!1===n.cache&&this._local.clear(),this._output.outputType=n.outputType||null,Array.isArray(n.elements)))for(const e of n.elements){const t=e.id||e.name;e.inputType&&(void 0===this.getParameter(t)&&this.setParameter(t,null),this.getParameter(t).inputType=e.inputType),e.outputType&&(void 0===this.getOutput(t)&&this.setOutput(t,null),this.getOutput(t).outputType=e.outputType)}return this._object}deserialize(e){super.deserialize(e);for(const e in this.parameters){let t=this.parameters[e];t.isScriptableNode&&(t=t.getDefaultOutput()),t.events.addEventListener("refresh",this.onRefresh)}}getLayout(){return this.getObject().layout}getDefaultOutputNode(){const e=this.getDefaultOutput().value;return e&&e.isNode?e:ji()}getDefaultOutput(){return this._exec()._output}getMethod(){if(this.needsUpdate&&this.dispose(),null!==this._method)return this._method;const e=["layout","init","main","dispose"].join(", "),t="\nreturn { ...output, "+e+" };",r="var "+e+"; var output = {};\n"+this.codeNode.code+t;return this._method=new Function(...["parameters","local","global","refresh","setOutput","THREE","TSL"],r),this._method}dispose(){null!==this._method&&(this._object&&"function"==typeof this._object.dispose&&this._object.dispose(),this._method=null,this._object=null,this._source=null,this._value=null,this._needsOutputUpdate=!0,this._output.value=null,this._outputs={})}setup(){return this.getDefaultOutputNode()}getCacheKey(e){const t=[xs(this.source),this.getDefaultOutputNode().getCacheKey(e)];for(const r in this.parameters)t.push(this.parameters[r].getCacheKey(e));return bs(t)}set needsUpdate(e){!0===e&&this.dispose()}get needsUpdate(){return this.source!==this._source}_exec(){return null===this.codeNode||(!0===this._needsOutputUpdate&&(this._value=this.call("main"),this._needsOutputUpdate=!1),this._output.value=this._value),this}_refresh(){this.needsUpdate=!0,this._exec(),this._output.refresh()}}const Dx=Vi(Ix).setParameterLength(1,2);function Vx(e){let t;const r=e.context.getViewZ;return void 0!==r&&(t=r(this)),(t||Gl.z).negate()}const Ux=ki((([e,t],r)=>{const s=Vx(r);return Oo(e,t,s)})),Ox=ki((([e],t)=>{const r=Vx(t);return e.mul(e,r,r).negate().exp().oneMinus()})),kx=ki((([e,t])=>nn(t.toFloat().mix(In.rgb,e.toVec3()),In.a)));let Gx=null,zx=null;class Hx extends js{static get type(){return"RangeNode"}constructor(e=ji(),t=ji()){super(),this.minNode=e,this.maxNode=t}getVectorLength(e){const t=e.getTypeLength(Ms(this.minNode.value)),r=e.getTypeLength(Ms(this.maxNode.value));return t>r?t:r}getNodeType(e){return e.object.count>1?e.getTypeFromLength(this.getVectorLength(e)):"float"}setup(e){const t=e.object;let r=null;if(t.count>1){const i=this.minNode.value,n=this.maxNode.value,a=e.getTypeLength(Ms(i)),o=e.getTypeLength(Ms(n));Gx=Gx||new s,zx=zx||new s,Gx.setScalar(0),zx.setScalar(0),1===a?Gx.setScalar(i):i.isColor?Gx.set(i.r,i.g,i.b,1):Gx.set(i.x,i.y,i.z||0,i.w||0),1===o?zx.setScalar(n):n.isColor?zx.set(n.r,n.g,n.b,1):zx.set(n.x,n.y,n.z||0,n.w||0);const l=4,d=l*t.count,c=new Float32Array(d);for(let e=0;eBi(new Wx(e,t)),qx=jx("numWorkgroups","uvec3"),Xx=jx("workgroupId","uvec3"),Kx=jx("globalId","uvec3"),Yx=jx("localId","uvec3"),Qx=jx("subgroupSize","uint");const Zx=Vi(class extends js{constructor(e){super(),this.scope=e}generate(e){const{scope:t}=this,{renderer:r}=e;!0===r.backend.isWebGLBackend?e.addFlowCode(`\t// ${t}Barrier \n`):e.addLineFlowCode(`${t}Barrier()`,this)}});class Jx extends qs{constructor(e,t){super(e,t),this.isWorkgroupInfoElementNode=!0}generate(e,t){let r;const s=e.context.assign;if(r=super.generate(e),!0!==s){const s=this.getNodeType(e);r=e.format(r,s,t)}return r}}class eb extends js{constructor(e,t,r=0){super(t),this.bufferType=t,this.bufferCount=r,this.isWorkgroupInfoNode=!0,this.elementType=t,this.scope=e}label(e){return this.name=e,this}setScope(e){return this.scope=e,this}getElementType(){return this.elementType}getInputType(){return`${this.scope}Array`}element(e){return Bi(new Jx(this,e))}generate(e){return e.getScopedArray(this.name||`${this.scope}Array_${this.id}`,this.scope.toLowerCase(),this.bufferType,this.bufferCount)}}class tb extends js{static get type(){return"AtomicFunctionNode"}constructor(e,t,r){super("uint"),this.method=e,this.pointerNode=t,this.valueNode=r,this.parents=!0}getInputType(e){return this.pointerNode.getNodeType(e)}getNodeType(e){return this.getInputType(e)}generate(e){const t=e.getNodeProperties(this),r=t.parents,s=this.method,i=this.getNodeType(e),n=this.getInputType(e),a=this.pointerNode,o=this.valueNode,u=[];u.push(`&${a.build(e,n)}`),null!==o&&u.push(o.build(e,n));const l=`${e.getMethod(s,i)}( ${u.join(", ")} )`;if(!(1===r.length&&!0===r[0].isStackNode))return void 0===t.constNode&&(t.constNode=Du(l,i).toConst()),t.constNode.build(e);e.addLineFlowCode(l,this)}}tb.ATOMIC_LOAD="atomicLoad",tb.ATOMIC_STORE="atomicStore",tb.ATOMIC_ADD="atomicAdd",tb.ATOMIC_SUB="atomicSub",tb.ATOMIC_MAX="atomicMax",tb.ATOMIC_MIN="atomicMin",tb.ATOMIC_AND="atomicAnd",tb.ATOMIC_OR="atomicOr",tb.ATOMIC_XOR="atomicXor";const rb=Vi(tb),sb=(e,t,r)=>rb(e,t,r).toStack();let ib;function nb(e){ib=ib||new WeakMap;let t=ib.get(e);return void 0===t&&ib.set(e,t={}),t}function ab(e){const t=nb(e);return t.shadowMatrix||(t.shadowMatrix=Zn("mat4").setGroup(Kn).onRenderUpdate((t=>(!0===e.castShadow&&!1!==t.renderer.shadowMap.enabled||e.shadow.updateMatrices(e),e.shadow.matrix))))}function ob(e,t=Ol){const r=ab(e).mul(t);return r.xyz.div(r.w)}function ub(e){const t=nb(e);return t.position||(t.position=Zn(new r).setGroup(Kn).onRenderUpdate(((t,r)=>r.value.setFromMatrixPosition(e.matrixWorld))))}function lb(e){const t=nb(e);return t.targetPosition||(t.targetPosition=Zn(new r).setGroup(Kn).onRenderUpdate(((t,r)=>r.value.setFromMatrixPosition(e.target.matrixWorld))))}function db(e){const t=nb(e);return t.viewPosition||(t.viewPosition=Zn(new r).setGroup(Kn).onRenderUpdate((({camera:t},s)=>{s.value=s.value||new r,s.value.setFromMatrixPosition(e.matrixWorld),s.value.applyMatrix4(t.matrixWorldInverse)})))}const cb=e=>cl.transformDirection(ub(e).sub(lb(e))),hb=(e,t)=>{for(const r of t)if(r.isAnalyticLightNode&&r.light.id===e)return r;return null},pb=new WeakMap,gb=[];class mb extends js{static get type(){return"LightsNode"}constructor(){super("vec3"),this.totalDiffuseNode=en().toVar(),this.totalSpecularNode=en().toVar(),this.outgoingLightNode=en().toVar(),this._lights=[],this._lightNodes=null,this._lightNodesHash=null,this.global=!0}customCacheKey(){const e=this._lights;for(let t=0;te.sort(((e,t)=>e.id-t.id)))(this._lights),i=e.renderer.library;for(const e of s)if(e.isNode)t.push(Bi(e));else{let s=null;if(null!==r&&(s=hb(e.id,r)),null===s){const r=i.getLightNodeClass(e.constructor);if(null===r){console.warn(`LightsNode.setupNodeLights: Light node not found for ${e.constructor.name}`);continue}let s=null;pb.has(e)?s=pb.get(e):(s=Bi(new r(e)),pb.set(e,s)),t.push(s)}}this._lightNodes=t}setupDirectLight(e,t,r){const{lightingModel:s,reflectedLight:i}=e.context;s.direct({...r,lightNode:t,reflectedLight:i},e)}setupDirectRectAreaLight(e,t,r){const{lightingModel:s,reflectedLight:i}=e.context;s.directRectArea({...r,lightNode:t,reflectedLight:i},e)}setupLights(e,t){for(const r of t)r.build(e)}getLightNodes(e){return null===this._lightNodes&&this.setupLightsNode(e),this._lightNodes}setup(e){const t=e.lightsNode;e.lightsNode=this;let r=this.outgoingLightNode;const s=e.context,i=s.lightingModel,n=e.getNodeProperties(this);if(i){const{totalDiffuseNode:t,totalSpecularNode:a}=this;s.outgoingLight=r;const o=e.addStack();n.nodes=o.nodes,i.start(e);const{backdrop:u,backdropAlpha:l}=s,{directDiffuse:d,directSpecular:c,indirectDiffuse:h,indirectSpecular:p}=s.reflectedLight;let g=d.add(h);null!==u&&(g=en(null!==l?l.mix(g,u):u),s.material.transparent=!0),t.assign(g),a.assign(c.add(p)),r.assign(t.add(a)),i.finish(e),r=r.bypass(e.removeStack())}else n.nodes=[];return e.lightsNode=t,r}setLights(e){return this._lights=e,this._lightNodes=null,this._lightNodesHash=null,this}getLights(){return this._lights}get hasLights(){return this._lights.length>0}}class fb extends js{static get type(){return"ShadowBaseNode"}constructor(e){super(),this.light=e,this.updateBeforeType=Vs.RENDER,this.isShadowBaseNode=!0}setupShadowPosition({context:e,material:t}){yb.assign(t.receivedShadowPositionNode||e.shadowPositionWorld||Ol)}}const yb=mn("vec3","shadowPositionWorld");function xb(t,r={}){return r.toneMapping=t.toneMapping,r.toneMappingExposure=t.toneMappingExposure,r.outputColorSpace=t.outputColorSpace,r.renderTarget=t.getRenderTarget(),r.activeCubeFace=t.getActiveCubeFace(),r.activeMipmapLevel=t.getActiveMipmapLevel(),r.renderObjectFunction=t.getRenderObjectFunction(),r.pixelRatio=t.getPixelRatio(),r.mrt=t.getMRT(),r.clearColor=t.getClearColor(r.clearColor||new e),r.clearAlpha=t.getClearAlpha(),r.autoClear=t.autoClear,r.scissorTest=t.getScissorTest(),r}function bb(e,t){return t=xb(e,t),e.setMRT(null),e.setRenderObjectFunction(null),e.setClearColor(0,1),e.autoClear=!0,t}function Tb(e,t){e.toneMapping=t.toneMapping,e.toneMappingExposure=t.toneMappingExposure,e.outputColorSpace=t.outputColorSpace,e.setRenderTarget(t.renderTarget,t.activeCubeFace,t.activeMipmapLevel),e.setRenderObjectFunction(t.renderObjectFunction),e.setPixelRatio(t.pixelRatio),e.setMRT(t.mrt),e.setClearColor(t.clearColor,t.clearAlpha),e.autoClear=t.autoClear,e.setScissorTest(t.scissorTest)}function _b(e,t={}){return t.background=e.background,t.backgroundNode=e.backgroundNode,t.overrideMaterial=e.overrideMaterial,t}function vb(e,t){return t=_b(e,t),e.background=null,e.backgroundNode=null,e.overrideMaterial=null,t}function Nb(e,t){e.background=t.background,e.backgroundNode=t.backgroundNode,e.overrideMaterial=t.overrideMaterial}function Sb(e,t,r){return r=vb(t,r=bb(e,r))}function Eb(e,t,r){Tb(e,r),Nb(t,r)}var wb=Object.freeze({__proto__:null,resetRendererAndSceneState:Sb,resetRendererState:bb,resetSceneState:vb,restoreRendererAndSceneState:Eb,restoreRendererState:Tb,restoreSceneState:Nb,saveRendererAndSceneState:function(e,t,r={}){return r=_b(t,r=xb(e,r))},saveRendererState:xb,saveSceneState:_b});const Ab=new WeakMap,Rb=ki((({depthTexture:e,shadowCoord:t,depthLayer:r})=>{let s=Zu(e,t.xy).label("t_basic");return e.isArrayTexture&&(s=s.depth(r)),s.compare(t.z)})),Cb=ki((({depthTexture:e,shadowCoord:t,shadow:r,depthLayer:s})=>{const i=(t,r)=>{let i=Zu(e,t);return e.isArrayTexture&&(i=i.depth(s)),i.compare(r)},n=yd("mapSize","vec2",r).setGroup(Kn),a=yd("radius","float",r).setGroup(Kn),o=Yi(1).div(n),u=o.x.negate().mul(a),l=o.y.negate().mul(a),d=o.x.mul(a),c=o.y.mul(a),h=u.div(2),p=l.div(2),g=d.div(2),m=c.div(2);return oa(i(t.xy.add(Yi(u,l)),t.z),i(t.xy.add(Yi(0,l)),t.z),i(t.xy.add(Yi(d,l)),t.z),i(t.xy.add(Yi(h,p)),t.z),i(t.xy.add(Yi(0,p)),t.z),i(t.xy.add(Yi(g,p)),t.z),i(t.xy.add(Yi(u,0)),t.z),i(t.xy.add(Yi(h,0)),t.z),i(t.xy,t.z),i(t.xy.add(Yi(g,0)),t.z),i(t.xy.add(Yi(d,0)),t.z),i(t.xy.add(Yi(h,m)),t.z),i(t.xy.add(Yi(0,m)),t.z),i(t.xy.add(Yi(g,m)),t.z),i(t.xy.add(Yi(u,c)),t.z),i(t.xy.add(Yi(0,c)),t.z),i(t.xy.add(Yi(d,c)),t.z)).mul(1/17)})),Mb=ki((({depthTexture:e,shadowCoord:t,shadow:r,depthLayer:s})=>{const i=(t,r)=>{let i=Zu(e,t);return e.isArrayTexture&&(i=i.depth(s)),i.compare(r)},n=yd("mapSize","vec2",r).setGroup(Kn),a=Yi(1).div(n),o=a.x,u=a.y,l=t.xy,d=Za(l.mul(n).add(.5));return l.subAssign(d.mul(a)),oa(i(l,t.z),i(l.add(Yi(o,0)),t.z),i(l.add(Yi(0,u)),t.z),i(l.add(a),t.z),Io(i(l.add(Yi(o.negate(),0)),t.z),i(l.add(Yi(o.mul(2),0)),t.z),d.x),Io(i(l.add(Yi(o.negate(),u)),t.z),i(l.add(Yi(o.mul(2),u)),t.z),d.x),Io(i(l.add(Yi(0,u.negate())),t.z),i(l.add(Yi(0,u.mul(2))),t.z),d.y),Io(i(l.add(Yi(o,u.negate())),t.z),i(l.add(Yi(o,u.mul(2))),t.z),d.y),Io(Io(i(l.add(Yi(o.negate(),u.negate())),t.z),i(l.add(Yi(o.mul(2),u.negate())),t.z),d.x),Io(i(l.add(Yi(o.negate(),u.mul(2))),t.z),i(l.add(Yi(o.mul(2),u.mul(2))),t.z),d.x),d.y)).mul(1/9)})),Pb=ki((({depthTexture:e,shadowCoord:t,depthLayer:r})=>{const s=ji(1).toVar();let i=Zu(e).sample(t.xy);e.isArrayTexture&&(i=i.depth(r)),i=i.rg;const n=vo(t.z,i.x);return Hi(n.notEqual(ji(1)),(()=>{const e=t.z.sub(i.x),r=_o(0,i.y.mul(i.y));let a=r.div(r.add(e.mul(e)));a=Do(ua(a,.3).div(.95-.3)),s.assign(Do(_o(n,a)))})),s})),Fb=ki((([e,t,r])=>{let s=Ol.sub(e).length();return s=s.sub(t).div(r.sub(t)),s=s.saturate(),s})),Lb=e=>{let t=Ab.get(e);if(void 0===t){const r=e.isPointLight?(e=>{const t=e.shadow.camera,r=yd("near","float",t).setGroup(Kn),s=yd("far","float",t).setGroup(Kn),i=bl(e);return Fb(i,r,s)})(e):null;t=new Wh,t.colorNode=nn(0,0,0,1),t.depthNode=r,t.isShadowPassMaterial=!0,t.name="ShadowMaterial",t.fog=!1,Ab.set(e,t)}return t},Bb=new zm,Ib=[],Db=(e,t,r,s)=>{Ib[0]=e,Ib[1]=t;let i=Bb.get(Ib);return void 0!==i&&i.shadowType===r&&i.useVelocity===s||(i=(i,n,a,o,u,l,...d)=>{(!0===i.castShadow||i.receiveShadow&&r===Ie)&&(s&&(Fs(i).useVelocity=!0),i.onBeforeShadow(e,i,a,t.camera,o,n.overrideMaterial,l),e.renderObject(i,n,a,o,u,l,...d),i.onAfterShadow(e,i,a,t.camera,o,n.overrideMaterial,l))},i.shadowType=r,i.useVelocity=s,Bb.set(Ib,i)),Ib[0]=null,Ib[1]=null,i},Vb=ki((({samples:e,radius:t,size:r,shadowPass:s,depthLayer:i})=>{const n=ji(0).toVar("meanVertical"),a=ji(0).toVar("squareMeanVertical"),o=e.lessThanEqual(ji(1)).select(ji(0),ji(2).div(e.sub(1))),u=e.lessThanEqual(ji(1)).select(ji(0),ji(-1));Zc({start:qi(0),end:qi(e),type:"int",condition:"<"},(({i:e})=>{const l=u.add(ji(e).mul(o));let d=s.sample(oa(mh.xy,Yi(0,l).mul(t)).div(r));s.value.isArrayTexture&&(d=d.depth(i)),d=d.x,n.addAssign(d),a.addAssign(d.mul(d))})),n.divAssign(e),a.divAssign(e);const l=qa(a.sub(n.mul(n)));return Yi(n,l)})),Ub=ki((({samples:e,radius:t,size:r,shadowPass:s,depthLayer:i})=>{const n=ji(0).toVar("meanHorizontal"),a=ji(0).toVar("squareMeanHorizontal"),o=e.lessThanEqual(ji(1)).select(ji(0),ji(2).div(e.sub(1))),u=e.lessThanEqual(ji(1)).select(ji(0),ji(-1));Zc({start:qi(0),end:qi(e),type:"int",condition:"<"},(({i:e})=>{const l=u.add(ji(e).mul(o));let d=s.sample(oa(mh.xy,Yi(l,0).mul(t)).div(r));s.value.isArrayTexture&&(d=d.depth(i)),n.addAssign(d.x),a.addAssign(oa(d.y.mul(d.y),d.x.mul(d.x)))})),n.divAssign(e),a.divAssign(e);const l=qa(a.sub(n.mul(n)));return Yi(n,l)})),Ob=[Rb,Cb,Mb,Pb];let kb;const Gb=new vy;class zb extends fb{static get type(){return"ShadowNode"}constructor(e,t=null){super(e),this.shadow=t||e.shadow,this.shadowMap=null,this.vsmShadowMapVertical=null,this.vsmShadowMapHorizontal=null,this.vsmMaterialVertical=null,this.vsmMaterialHorizontal=null,this._node=null,this._cameraFrameId=new WeakMap,this.isShadowNode=!0,this.depthLayer=0}setupShadowFilter(e,{filterFn:t,depthTexture:r,shadowCoord:s,shadow:i,depthLayer:n}){const a=s.x.greaterThanEqual(0).and(s.x.lessThanEqual(1)).and(s.y.greaterThanEqual(0)).and(s.y.lessThanEqual(1)).and(s.z.lessThanEqual(1)),o=t({depthTexture:r,shadowCoord:s,shadow:i,depthLayer:n});return a.select(o,ji(1))}setupShadowCoord(e,t){const{shadow:r}=this,{renderer:s}=e,i=yd("bias","float",r).setGroup(Kn);let n,a=t;if(r.camera.isOrthographicCamera||!0!==s.logarithmicDepthBuffer)a=a.xyz.div(a.w),n=a.z,s.coordinateSystem===d&&(n=n.mul(2).sub(1));else{const e=a.w;a=a.xy.div(e);const t=yd("near","float",r.camera).setGroup(Kn),s=yd("far","float",r.camera).setGroup(Kn);n=Bh(e.negate(),t,s)}return a=en(a.x,a.y.oneMinus(),n.add(i)),a}getShadowFilterFn(e){return Ob[e]}setupRenderTarget(e,t){const r=new V(e.mapSize.width,e.mapSize.height);r.name="ShadowDepthTexture",r.compareFunction=De;const s=t.createRenderTarget(e.mapSize.width,e.mapSize.height);return s.texture.name="ShadowMap",s.texture.type=e.mapType,s.depthTexture=r,{shadowMap:s,depthTexture:r}}setupShadow(e){const{renderer:t}=e,{light:r,shadow:s}=this,i=t.shadowMap.type,{depthTexture:n,shadowMap:a}=this.setupRenderTarget(s,e);if(s.camera.updateProjectionMatrix(),i===Ie&&!0!==s.isPointLightShadow){n.compareFunction=null,a.depth>1?(a._vsmShadowMapVertical||(a._vsmShadowMapVertical=e.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:Ve,type:de,depth:a.depth,depthBuffer:!1}),a._vsmShadowMapVertical.texture.name="VSMVertical"),this.vsmShadowMapVertical=a._vsmShadowMapVertical,a._vsmShadowMapHorizontal||(a._vsmShadowMapHorizontal=e.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:Ve,type:de,depth:a.depth,depthBuffer:!1}),a._vsmShadowMapHorizontal.texture.name="VSMHorizontal"),this.vsmShadowMapHorizontal=a._vsmShadowMapHorizontal):(this.vsmShadowMapVertical=e.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:Ve,type:de,depthBuffer:!1}),this.vsmShadowMapHorizontal=e.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:Ve,type:de,depthBuffer:!1}));let t=Zu(n);n.isArrayTexture&&(t=t.depth(this.depthLayer));let r=Zu(this.vsmShadowMapVertical.texture);n.isArrayTexture&&(r=r.depth(this.depthLayer));const i=yd("blurSamples","float",s).setGroup(Kn),o=yd("radius","float",s).setGroup(Kn),u=yd("mapSize","vec2",s).setGroup(Kn);let l=this.vsmMaterialVertical||(this.vsmMaterialVertical=new Wh);l.fragmentNode=Vb({samples:i,radius:o,size:u,shadowPass:t,depthLayer:this.depthLayer}).context(e.getSharedContext()),l.name="VSMVertical",l=this.vsmMaterialHorizontal||(this.vsmMaterialHorizontal=new Wh),l.fragmentNode=Ub({samples:i,radius:o,size:u,shadowPass:r,depthLayer:this.depthLayer}).context(e.getSharedContext()),l.name="VSMHorizontal"}const o=yd("intensity","float",s).setGroup(Kn),u=yd("normalBias","float",s).setGroup(Kn),l=ab(r).mul(yb.add(Zl.mul(u))),d=this.setupShadowCoord(e,l),c=s.filterNode||this.getShadowFilterFn(t.shadowMap.type)||null;if(null===c)throw new Error("THREE.WebGPURenderer: Shadow map type not supported yet.");const h=i===Ie&&!0!==s.isPointLightShadow?this.vsmShadowMapHorizontal.texture:n,p=this.setupShadowFilter(e,{filterFn:c,shadowTexture:a.texture,depthTexture:h,shadowCoord:d,shadow:s,depthLayer:this.depthLayer});let g=Zu(a.texture,d);n.isArrayTexture&&(g=g.depth(this.depthLayer));const m=Io(1,p.rgb.mix(g,1),o.mul(g.a)).toVar();return this.shadowMap=a,this.shadow.map=a,m}setup(e){if(!1!==e.renderer.shadowMap.enabled)return ki((()=>{let t=this._node;return this.setupShadowPosition(e),null===t&&(this._node=t=this.setupShadow(e)),e.material.shadowNode&&console.warn('THREE.NodeMaterial: ".shadowNode" is deprecated. Use ".castShadowNode" instead.'),e.material.receivedShadowNode&&(t=e.material.receivedShadowNode(t)),t}))()}renderShadow(e){const{shadow:t,shadowMap:r,light:s}=this,{renderer:i,scene:n}=e;t.updateMatrices(s),r.setSize(t.mapSize.width,t.mapSize.height,r.depth),i.render(n,t.camera)}updateShadow(e){const{shadowMap:t,light:r,shadow:s}=this,{renderer:i,scene:n,camera:a}=e,o=i.shadowMap.type,u=t.depthTexture.version;this._depthVersionCached=u;const l=s.camera.layers.mask;4294967294&s.camera.layers.mask||(s.camera.layers.mask=a.layers.mask);const d=i.getRenderObjectFunction(),c=i.getMRT(),h=!!c&&c.has("velocity");kb=Sb(i,n,kb),n.overrideMaterial=Lb(r),i.setRenderObjectFunction(Db(i,s,o,h)),i.setClearColor(0,0),i.setRenderTarget(t),this.renderShadow(e),i.setRenderObjectFunction(d),o===Ie&&!0!==s.isPointLightShadow&&this.vsmPass(i),s.camera.layers.mask=l,Eb(i,n,kb)}vsmPass(e){const{shadow:t}=this,r=this.shadowMap.depth;this.vsmShadowMapVertical.setSize(t.mapSize.width,t.mapSize.height,r),this.vsmShadowMapHorizontal.setSize(t.mapSize.width,t.mapSize.height,r),e.setRenderTarget(this.vsmShadowMapVertical),Gb.material=this.vsmMaterialVertical,Gb.render(e),e.setRenderTarget(this.vsmShadowMapHorizontal),Gb.material=this.vsmMaterialHorizontal,Gb.render(e)}dispose(){this.shadowMap.dispose(),this.shadowMap=null,null!==this.vsmShadowMapVertical&&(this.vsmShadowMapVertical.dispose(),this.vsmShadowMapVertical=null,this.vsmMaterialVertical.dispose(),this.vsmMaterialVertical=null),null!==this.vsmShadowMapHorizontal&&(this.vsmShadowMapHorizontal.dispose(),this.vsmShadowMapHorizontal=null,this.vsmMaterialHorizontal.dispose(),this.vsmMaterialHorizontal=null),super.dispose()}updateBefore(e){const{shadow:t}=this;let r=t.needsUpdate||t.autoUpdate;r&&(this._cameraFrameId[e.camera]===e.frameId&&(r=!1),this._cameraFrameId[e.camera]=e.frameId),r&&(this.updateShadow(e),this.shadowMap.depthTexture.version===this._depthVersionCached&&(t.needsUpdate=!1))}}const Hb=(e,t)=>Bi(new zb(e,t)),$b=new e,Wb=ki((([e,t])=>{const r=e.toVar(),s=no(r),i=da(1,_o(s.x,_o(s.y,s.z)));s.mulAssign(i),r.mulAssign(i.mul(t.mul(2).oneMinus()));const n=Yi(r.xy).toVar(),a=t.mul(1.5).oneMinus();return Hi(s.z.greaterThanEqual(a),(()=>{Hi(r.z.greaterThan(0),(()=>{n.x.assign(ua(4,r.x))}))})).ElseIf(s.x.greaterThanEqual(a),(()=>{const e=ao(r.x);n.x.assign(r.z.mul(e).add(e.mul(2)))})).ElseIf(s.y.greaterThanEqual(a),(()=>{const e=ao(r.y);n.x.assign(r.x.add(e.mul(2)).add(2)),n.y.assign(r.z.mul(e).sub(2))})),Yi(.125,.25).mul(n).add(Yi(.375,.75)).flipY()})).setLayout({name:"cubeToUV",type:"vec2",inputs:[{name:"pos",type:"vec3"},{name:"texelSizeY",type:"float"}]}),jb=ki((({depthTexture:e,bd3D:t,dp:r,texelSize:s})=>Zu(e,Wb(t,s.y)).compare(r))),qb=ki((({depthTexture:e,bd3D:t,dp:r,texelSize:s,shadow:i})=>{const n=yd("radius","float",i).setGroup(Kn),a=Yi(-1,1).mul(n).mul(s.y);return Zu(e,Wb(t.add(a.xyy),s.y)).compare(r).add(Zu(e,Wb(t.add(a.yyy),s.y)).compare(r)).add(Zu(e,Wb(t.add(a.xyx),s.y)).compare(r)).add(Zu(e,Wb(t.add(a.yyx),s.y)).compare(r)).add(Zu(e,Wb(t,s.y)).compare(r)).add(Zu(e,Wb(t.add(a.xxy),s.y)).compare(r)).add(Zu(e,Wb(t.add(a.yxy),s.y)).compare(r)).add(Zu(e,Wb(t.add(a.xxx),s.y)).compare(r)).add(Zu(e,Wb(t.add(a.yxx),s.y)).compare(r)).mul(1/9)})),Xb=ki((({filterFn:e,depthTexture:t,shadowCoord:r,shadow:s})=>{const i=r.xyz.toVar(),n=i.length(),a=Zn("float").setGroup(Kn).onRenderUpdate((()=>s.camera.near)),o=Zn("float").setGroup(Kn).onRenderUpdate((()=>s.camera.far)),u=yd("bias","float",s).setGroup(Kn),l=Zn(s.mapSize).setGroup(Kn),d=ji(1).toVar();return Hi(n.sub(o).lessThanEqual(0).and(n.sub(a).greaterThanEqual(0)),(()=>{const r=n.sub(a).div(o.sub(a)).toVar();r.addAssign(u);const c=i.normalize(),h=Yi(1).div(l.mul(Yi(4,2)));d.assign(e({depthTexture:t,bd3D:c,dp:r,texelSize:h,shadow:s}))})),d})),Kb=new s,Yb=new t,Qb=new t;class Zb extends zb{static get type(){return"PointShadowNode"}constructor(e,t=null){super(e,t)}getShadowFilterFn(e){return e===Ue?jb:qb}setupShadowCoord(e,t){return t}setupShadowFilter(e,{filterFn:t,shadowTexture:r,depthTexture:s,shadowCoord:i,shadow:n}){return Xb({filterFn:t,shadowTexture:r,depthTexture:s,shadowCoord:i,shadow:n})}renderShadow(e){const{shadow:t,shadowMap:r,light:s}=this,{renderer:i,scene:n}=e,a=t.getFrameExtents();Qb.copy(t.mapSize),Qb.multiply(a),r.setSize(Qb.width,Qb.height),Yb.copy(t.mapSize);const o=i.autoClear,u=i.getClearColor($b),l=i.getClearAlpha();i.autoClear=!1,i.setClearColor(t.clearColor,t.clearAlpha),i.clear();const d=t.getViewportCount();for(let e=0;eBi(new Zb(e,t));class eT extends nh{static get type(){return"AnalyticLightNode"}constructor(t=null){super(),this.light=t,this.color=new e,this.colorNode=t&&t.colorNode||Zn(this.color).setGroup(Kn),this.baseColorNode=null,this.shadowNode=null,this.shadowColorNode=null,this.isAnalyticLightNode=!0,this.updateType=Vs.FRAME}getHash(){return this.light.uuid}getLightVector(e){return db(this.light).sub(e.context.positionView||Gl)}setupDirect(){}setupDirectRectArea(){}setupShadowNode(){return Hb(this.light)}setupShadow(e){const{renderer:t}=e;if(!1===t.shadowMap.enabled)return;let r=this.shadowColorNode;if(null===r){const e=this.light.shadow.shadowNode;let t;t=void 0!==e?Bi(e):this.setupShadowNode(),this.shadowNode=t,this.shadowColorNode=r=this.colorNode.mul(t),this.baseColorNode=this.colorNode}this.colorNode=r}setup(e){this.colorNode=this.baseColorNode||this.colorNode,this.light.castShadow?e.object.receiveShadow&&this.setupShadow(e):null!==this.shadowNode&&(this.shadowNode.dispose(),this.shadowNode=null,this.shadowColorNode=null);const t=this.setupDirect(e),r=this.setupDirectRectArea(e);t&&e.lightsNode.setupDirectLight(e,this,t),r&&e.lightsNode.setupDirectRectAreaLight(e,this,r)}update(){const{light:e}=this;this.color.copy(e.color).multiplyScalar(e.intensity)}}const tT=ki((({lightDistance:e,cutoffDistance:t,decayExponent:r})=>{const s=e.pow(r).max(.01).reciprocal();return t.greaterThan(0).select(s.mul(e.div(t).pow4().oneMinus().clamp().pow2()),s)})),rT=({color:e,lightVector:t,cutoffDistance:r,decayExponent:s})=>{const i=t.normalize(),n=t.length(),a=tT({lightDistance:n,cutoffDistance:r,decayExponent:s});return{lightDirection:i,lightColor:e.mul(a)}};class sT extends eT{static get type(){return"PointLightNode"}constructor(e=null){super(e),this.cutoffDistanceNode=Zn(0).setGroup(Kn),this.decayExponentNode=Zn(2).setGroup(Kn)}update(e){const{light:t}=this;super.update(e),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}setupShadowNode(){return Jb(this.light)}setupDirect(e){return rT({color:this.colorNode,lightVector:this.getLightVector(e),cutoffDistance:this.cutoffDistanceNode,decayExponent:this.decayExponentNode})}}const iT=ki((([e=t()])=>{const t=e.mul(2),r=t.x.floor(),s=t.y.floor();return r.add(s).mod(2).sign()})),nT=ki((([e=$u()],{renderer:t,material:r})=>{const s=Bo(e.mul(2).sub(1));let i;if(r.alphaToCoverage&&t.samples>1){const e=ji(s.fwidth()).toVar();i=Oo(e.oneMinus(),e.add(1),s).oneMinus()}else i=Xo(s.greaterThan(1),0,1);return i})),aT=ki((([e,t,r])=>{const s=ji(r).toVar(),i=ji(t).toVar(),n=Ki(e).toVar();return Xo(n,i,s)})).setLayout({name:"mx_select",type:"float",inputs:[{name:"b",type:"bool"},{name:"t",type:"float"},{name:"f",type:"float"}]}),oT=ki((([e,t])=>{const r=Ki(t).toVar(),s=ji(e).toVar();return Xo(r,s.negate(),s)})).setLayout({name:"mx_negate_if",type:"float",inputs:[{name:"val",type:"float"},{name:"b",type:"bool"}]}),uT=ki((([e])=>{const t=ji(e).toVar();return qi(Ka(t))})).setLayout({name:"mx_floor",type:"int",inputs:[{name:"x",type:"float"}]}),lT=ki((([e,t])=>{const r=ji(e).toVar();return t.assign(uT(r)),r.sub(ji(t))})),dT=Wf([ki((([e,t,r,s,i,n])=>{const a=ji(n).toVar(),o=ji(i).toVar(),u=ji(s).toVar(),l=ji(r).toVar(),d=ji(t).toVar(),c=ji(e).toVar(),h=ji(ua(1,o)).toVar();return ua(1,a).mul(c.mul(h).add(d.mul(o))).add(a.mul(l.mul(h).add(u.mul(o))))})).setLayout({name:"mx_bilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"}]}),ki((([e,t,r,s,i,n])=>{const a=ji(n).toVar(),o=ji(i).toVar(),u=en(s).toVar(),l=en(r).toVar(),d=en(t).toVar(),c=en(e).toVar(),h=ji(ua(1,o)).toVar();return ua(1,a).mul(c.mul(h).add(d.mul(o))).add(a.mul(l.mul(h).add(u.mul(o))))})).setLayout({name:"mx_bilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"}]})]),cT=Wf([ki((([e,t,r,s,i,n,a,o,u,l,d])=>{const c=ji(d).toVar(),h=ji(l).toVar(),p=ji(u).toVar(),g=ji(o).toVar(),m=ji(a).toVar(),f=ji(n).toVar(),y=ji(i).toVar(),x=ji(s).toVar(),b=ji(r).toVar(),T=ji(t).toVar(),_=ji(e).toVar(),v=ji(ua(1,p)).toVar(),N=ji(ua(1,h)).toVar();return ji(ua(1,c)).toVar().mul(N.mul(_.mul(v).add(T.mul(p))).add(h.mul(b.mul(v).add(x.mul(p))))).add(c.mul(N.mul(y.mul(v).add(f.mul(p))).add(h.mul(m.mul(v).add(g.mul(p))))))})).setLayout({name:"mx_trilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"v4",type:"float"},{name:"v5",type:"float"},{name:"v6",type:"float"},{name:"v7",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),ki((([e,t,r,s,i,n,a,o,u,l,d])=>{const c=ji(d).toVar(),h=ji(l).toVar(),p=ji(u).toVar(),g=en(o).toVar(),m=en(a).toVar(),f=en(n).toVar(),y=en(i).toVar(),x=en(s).toVar(),b=en(r).toVar(),T=en(t).toVar(),_=en(e).toVar(),v=ji(ua(1,p)).toVar(),N=ji(ua(1,h)).toVar();return ji(ua(1,c)).toVar().mul(N.mul(_.mul(v).add(T.mul(p))).add(h.mul(b.mul(v).add(x.mul(p))))).add(c.mul(N.mul(y.mul(v).add(f.mul(p))).add(h.mul(m.mul(v).add(g.mul(p))))))})).setLayout({name:"mx_trilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"v4",type:"vec3"},{name:"v5",type:"vec3"},{name:"v6",type:"vec3"},{name:"v7",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]})]),hT=ki((([e,t,r])=>{const s=ji(r).toVar(),i=ji(t).toVar(),n=Xi(e).toVar(),a=Xi(n.bitAnd(Xi(7))).toVar(),o=ji(aT(a.lessThan(Xi(4)),i,s)).toVar(),u=ji(la(2,aT(a.lessThan(Xi(4)),s,i))).toVar();return oT(o,Ki(a.bitAnd(Xi(1)))).add(oT(u,Ki(a.bitAnd(Xi(2)))))})).setLayout({name:"mx_gradient_float_0",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"}]}),pT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=ji(t).toVar(),o=Xi(e).toVar(),u=Xi(o.bitAnd(Xi(15))).toVar(),l=ji(aT(u.lessThan(Xi(8)),a,n)).toVar(),d=ji(aT(u.lessThan(Xi(4)),n,aT(u.equal(Xi(12)).or(u.equal(Xi(14))),a,i))).toVar();return oT(l,Ki(u.bitAnd(Xi(1)))).add(oT(d,Ki(u.bitAnd(Xi(2)))))})).setLayout({name:"mx_gradient_float_1",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),gT=Wf([hT,pT]),mT=ki((([e,t,r])=>{const s=ji(r).toVar(),i=ji(t).toVar(),n=rn(e).toVar();return en(gT(n.x,i,s),gT(n.y,i,s),gT(n.z,i,s))})).setLayout({name:"mx_gradient_vec3_0",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"}]}),fT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=ji(t).toVar(),o=rn(e).toVar();return en(gT(o.x,a,n,i),gT(o.y,a,n,i),gT(o.z,a,n,i))})).setLayout({name:"mx_gradient_vec3_1",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),yT=Wf([mT,fT]),xT=ki((([e])=>{const t=ji(e).toVar();return la(.6616,t)})).setLayout({name:"mx_gradient_scale2d_0",type:"float",inputs:[{name:"v",type:"float"}]}),bT=ki((([e])=>{const t=ji(e).toVar();return la(.982,t)})).setLayout({name:"mx_gradient_scale3d_0",type:"float",inputs:[{name:"v",type:"float"}]}),TT=Wf([xT,ki((([e])=>{const t=en(e).toVar();return la(.6616,t)})).setLayout({name:"mx_gradient_scale2d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]})]),_T=Wf([bT,ki((([e])=>{const t=en(e).toVar();return la(.982,t)})).setLayout({name:"mx_gradient_scale3d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]})]),vT=ki((([e,t])=>{const r=qi(t).toVar(),s=Xi(e).toVar();return s.shiftLeft(r).bitOr(s.shiftRight(qi(32).sub(r)))})).setLayout({name:"mx_rotl32",type:"uint",inputs:[{name:"x",type:"uint"},{name:"k",type:"int"}]}),NT=ki((([e,t,r])=>{e.subAssign(r),e.bitXorAssign(vT(r,qi(4))),r.addAssign(t),t.subAssign(e),t.bitXorAssign(vT(e,qi(6))),e.addAssign(r),r.subAssign(t),r.bitXorAssign(vT(t,qi(8))),t.addAssign(e),e.subAssign(r),e.bitXorAssign(vT(r,qi(16))),r.addAssign(t),t.subAssign(e),t.bitXorAssign(vT(e,qi(19))),e.addAssign(r),r.subAssign(t),r.bitXorAssign(vT(t,qi(4))),t.addAssign(e)})),ST=ki((([e,t,r])=>{const s=Xi(r).toVar(),i=Xi(t).toVar(),n=Xi(e).toVar();return s.bitXorAssign(i),s.subAssign(vT(i,qi(14))),n.bitXorAssign(s),n.subAssign(vT(s,qi(11))),i.bitXorAssign(n),i.subAssign(vT(n,qi(25))),s.bitXorAssign(i),s.subAssign(vT(i,qi(16))),n.bitXorAssign(s),n.subAssign(vT(s,qi(4))),i.bitXorAssign(n),i.subAssign(vT(n,qi(14))),s.bitXorAssign(i),s.subAssign(vT(i,qi(24))),s})).setLayout({name:"mx_bjfinal",type:"uint",inputs:[{name:"a",type:"uint"},{name:"b",type:"uint"},{name:"c",type:"uint"}]}),ET=ki((([e])=>{const t=Xi(e).toVar();return ji(t).div(ji(Xi(qi(4294967295))))})).setLayout({name:"mx_bits_to_01",type:"float",inputs:[{name:"bits",type:"uint"}]}),wT=ki((([e])=>{const t=ji(e).toVar();return t.mul(t).mul(t).mul(t.mul(t.mul(6).sub(15)).add(10))})).setLayout({name:"mx_fade",type:"float",inputs:[{name:"t",type:"float"}]}),AT=Wf([ki((([e])=>{const t=qi(e).toVar(),r=Xi(Xi(1)).toVar(),s=Xi(Xi(qi(3735928559)).add(r.shiftLeft(Xi(2))).add(Xi(13))).toVar();return ST(s.add(Xi(t)),s,s)})).setLayout({name:"mx_hash_int_0",type:"uint",inputs:[{name:"x",type:"int"}]}),ki((([e,t])=>{const r=qi(t).toVar(),s=qi(e).toVar(),i=Xi(Xi(2)).toVar(),n=Xi().toVar(),a=Xi().toVar(),o=Xi().toVar();return n.assign(a.assign(o.assign(Xi(qi(3735928559)).add(i.shiftLeft(Xi(2))).add(Xi(13))))),n.addAssign(Xi(s)),a.addAssign(Xi(r)),ST(n,a,o)})).setLayout({name:"mx_hash_int_1",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),ki((([e,t,r])=>{const s=qi(r).toVar(),i=qi(t).toVar(),n=qi(e).toVar(),a=Xi(Xi(3)).toVar(),o=Xi().toVar(),u=Xi().toVar(),l=Xi().toVar();return o.assign(u.assign(l.assign(Xi(qi(3735928559)).add(a.shiftLeft(Xi(2))).add(Xi(13))))),o.addAssign(Xi(n)),u.addAssign(Xi(i)),l.addAssign(Xi(s)),ST(o,u,l)})).setLayout({name:"mx_hash_int_2",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),ki((([e,t,r,s])=>{const i=qi(s).toVar(),n=qi(r).toVar(),a=qi(t).toVar(),o=qi(e).toVar(),u=Xi(Xi(4)).toVar(),l=Xi().toVar(),d=Xi().toVar(),c=Xi().toVar();return l.assign(d.assign(c.assign(Xi(qi(3735928559)).add(u.shiftLeft(Xi(2))).add(Xi(13))))),l.addAssign(Xi(o)),d.addAssign(Xi(a)),c.addAssign(Xi(n)),NT(l,d,c),l.addAssign(Xi(i)),ST(l,d,c)})).setLayout({name:"mx_hash_int_3",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"}]}),ki((([e,t,r,s,i])=>{const n=qi(i).toVar(),a=qi(s).toVar(),o=qi(r).toVar(),u=qi(t).toVar(),l=qi(e).toVar(),d=Xi(Xi(5)).toVar(),c=Xi().toVar(),h=Xi().toVar(),p=Xi().toVar();return c.assign(h.assign(p.assign(Xi(qi(3735928559)).add(d.shiftLeft(Xi(2))).add(Xi(13))))),c.addAssign(Xi(l)),h.addAssign(Xi(u)),p.addAssign(Xi(o)),NT(c,h,p),c.addAssign(Xi(a)),h.addAssign(Xi(n)),ST(c,h,p)})).setLayout({name:"mx_hash_int_4",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"},{name:"yy",type:"int"}]})]),RT=Wf([ki((([e,t])=>{const r=qi(t).toVar(),s=qi(e).toVar(),i=Xi(AT(s,r)).toVar(),n=rn().toVar();return n.x.assign(i.bitAnd(qi(255))),n.y.assign(i.shiftRight(qi(8)).bitAnd(qi(255))),n.z.assign(i.shiftRight(qi(16)).bitAnd(qi(255))),n})).setLayout({name:"mx_hash_vec3_0",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),ki((([e,t,r])=>{const s=qi(r).toVar(),i=qi(t).toVar(),n=qi(e).toVar(),a=Xi(AT(n,i,s)).toVar(),o=rn().toVar();return o.x.assign(a.bitAnd(qi(255))),o.y.assign(a.shiftRight(qi(8)).bitAnd(qi(255))),o.z.assign(a.shiftRight(qi(16)).bitAnd(qi(255))),o})).setLayout({name:"mx_hash_vec3_1",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]})]),CT=Wf([ki((([e])=>{const t=Yi(e).toVar(),r=qi().toVar(),s=qi().toVar(),i=ji(lT(t.x,r)).toVar(),n=ji(lT(t.y,s)).toVar(),a=ji(wT(i)).toVar(),o=ji(wT(n)).toVar(),u=ji(dT(gT(AT(r,s),i,n),gT(AT(r.add(qi(1)),s),i.sub(1),n),gT(AT(r,s.add(qi(1))),i,n.sub(1)),gT(AT(r.add(qi(1)),s.add(qi(1))),i.sub(1),n.sub(1)),a,o)).toVar();return TT(u)})).setLayout({name:"mx_perlin_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"}]}),ki((([e])=>{const t=en(e).toVar(),r=qi().toVar(),s=qi().toVar(),i=qi().toVar(),n=ji(lT(t.x,r)).toVar(),a=ji(lT(t.y,s)).toVar(),o=ji(lT(t.z,i)).toVar(),u=ji(wT(n)).toVar(),l=ji(wT(a)).toVar(),d=ji(wT(o)).toVar(),c=ji(cT(gT(AT(r,s,i),n,a,o),gT(AT(r.add(qi(1)),s,i),n.sub(1),a,o),gT(AT(r,s.add(qi(1)),i),n,a.sub(1),o),gT(AT(r.add(qi(1)),s.add(qi(1)),i),n.sub(1),a.sub(1),o),gT(AT(r,s,i.add(qi(1))),n,a,o.sub(1)),gT(AT(r.add(qi(1)),s,i.add(qi(1))),n.sub(1),a,o.sub(1)),gT(AT(r,s.add(qi(1)),i.add(qi(1))),n,a.sub(1),o.sub(1)),gT(AT(r.add(qi(1)),s.add(qi(1)),i.add(qi(1))),n.sub(1),a.sub(1),o.sub(1)),u,l,d)).toVar();return _T(c)})).setLayout({name:"mx_perlin_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"}]})]),MT=Wf([ki((([e])=>{const t=Yi(e).toVar(),r=qi().toVar(),s=qi().toVar(),i=ji(lT(t.x,r)).toVar(),n=ji(lT(t.y,s)).toVar(),a=ji(wT(i)).toVar(),o=ji(wT(n)).toVar(),u=en(dT(yT(RT(r,s),i,n),yT(RT(r.add(qi(1)),s),i.sub(1),n),yT(RT(r,s.add(qi(1))),i,n.sub(1)),yT(RT(r.add(qi(1)),s.add(qi(1))),i.sub(1),n.sub(1)),a,o)).toVar();return TT(u)})).setLayout({name:"mx_perlin_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),ki((([e])=>{const t=en(e).toVar(),r=qi().toVar(),s=qi().toVar(),i=qi().toVar(),n=ji(lT(t.x,r)).toVar(),a=ji(lT(t.y,s)).toVar(),o=ji(lT(t.z,i)).toVar(),u=ji(wT(n)).toVar(),l=ji(wT(a)).toVar(),d=ji(wT(o)).toVar(),c=en(cT(yT(RT(r,s,i),n,a,o),yT(RT(r.add(qi(1)),s,i),n.sub(1),a,o),yT(RT(r,s.add(qi(1)),i),n,a.sub(1),o),yT(RT(r.add(qi(1)),s.add(qi(1)),i),n.sub(1),a.sub(1),o),yT(RT(r,s,i.add(qi(1))),n,a,o.sub(1)),yT(RT(r.add(qi(1)),s,i.add(qi(1))),n.sub(1),a,o.sub(1)),yT(RT(r,s.add(qi(1)),i.add(qi(1))),n,a.sub(1),o.sub(1)),yT(RT(r.add(qi(1)),s.add(qi(1)),i.add(qi(1))),n.sub(1),a.sub(1),o.sub(1)),u,l,d)).toVar();return _T(c)})).setLayout({name:"mx_perlin_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"}]})]),PT=Wf([ki((([e])=>{const t=ji(e).toVar(),r=qi(uT(t)).toVar();return ET(AT(r))})).setLayout({name:"mx_cell_noise_float_0",type:"float",inputs:[{name:"p",type:"float"}]}),ki((([e])=>{const t=Yi(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar();return ET(AT(r,s))})).setLayout({name:"mx_cell_noise_float_1",type:"float",inputs:[{name:"p",type:"vec2"}]}),ki((([e])=>{const t=en(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar(),i=qi(uT(t.z)).toVar();return ET(AT(r,s,i))})).setLayout({name:"mx_cell_noise_float_2",type:"float",inputs:[{name:"p",type:"vec3"}]}),ki((([e])=>{const t=nn(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar(),i=qi(uT(t.z)).toVar(),n=qi(uT(t.w)).toVar();return ET(AT(r,s,i,n))})).setLayout({name:"mx_cell_noise_float_3",type:"float",inputs:[{name:"p",type:"vec4"}]})]),FT=Wf([ki((([e])=>{const t=ji(e).toVar(),r=qi(uT(t)).toVar();return en(ET(AT(r,qi(0))),ET(AT(r,qi(1))),ET(AT(r,qi(2))))})).setLayout({name:"mx_cell_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"float"}]}),ki((([e])=>{const t=Yi(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar();return en(ET(AT(r,s,qi(0))),ET(AT(r,s,qi(1))),ET(AT(r,s,qi(2))))})).setLayout({name:"mx_cell_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),ki((([e])=>{const t=en(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar(),i=qi(uT(t.z)).toVar();return en(ET(AT(r,s,i,qi(0))),ET(AT(r,s,i,qi(1))),ET(AT(r,s,i,qi(2))))})).setLayout({name:"mx_cell_noise_vec3_2",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),ki((([e])=>{const t=nn(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar(),i=qi(uT(t.z)).toVar(),n=qi(uT(t.w)).toVar();return en(ET(AT(r,s,i,n,qi(0))),ET(AT(r,s,i,n,qi(1))),ET(AT(r,s,i,n,qi(2))))})).setLayout({name:"mx_cell_noise_vec3_3",type:"vec3",inputs:[{name:"p",type:"vec4"}]})]),LT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=qi(t).toVar(),o=en(e).toVar(),u=ji(0).toVar(),l=ji(1).toVar();return Zc(a,(()=>{u.addAssign(l.mul(CT(o))),l.mulAssign(i),o.mulAssign(n)})),u})).setLayout({name:"mx_fractal_noise_float",type:"float",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),BT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=qi(t).toVar(),o=en(e).toVar(),u=en(0).toVar(),l=ji(1).toVar();return Zc(a,(()=>{u.addAssign(l.mul(MT(o))),l.mulAssign(i),o.mulAssign(n)})),u})).setLayout({name:"mx_fractal_noise_vec3",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),IT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=qi(t).toVar(),o=en(e).toVar();return Yi(LT(o,a,n,i),LT(o.add(en(qi(19),qi(193),qi(17))),a,n,i))})).setLayout({name:"mx_fractal_noise_vec2",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),DT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=qi(t).toVar(),o=en(e).toVar(),u=en(BT(o,a,n,i)).toVar(),l=ji(LT(o.add(en(qi(19),qi(193),qi(17))),a,n,i)).toVar();return nn(u,l)})).setLayout({name:"mx_fractal_noise_vec4",type:"vec4",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),VT=Wf([ki((([e,t,r,s,i,n,a])=>{const o=qi(a).toVar(),u=ji(n).toVar(),l=qi(i).toVar(),d=qi(s).toVar(),c=qi(r).toVar(),h=qi(t).toVar(),p=Yi(e).toVar(),g=en(FT(Yi(h.add(d),c.add(l)))).toVar(),m=Yi(g.x,g.y).toVar();m.subAssign(.5),m.mulAssign(u),m.addAssign(.5);const f=Yi(Yi(ji(h),ji(c)).add(m)).toVar(),y=Yi(f.sub(p)).toVar();return Hi(o.equal(qi(2)),(()=>no(y.x).add(no(y.y)))),Hi(o.equal(qi(3)),(()=>_o(no(y.x),no(y.y)))),wo(y,y)})).setLayout({name:"mx_worley_distance_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),ki((([e,t,r,s,i,n,a,o,u])=>{const l=qi(u).toVar(),d=ji(o).toVar(),c=qi(a).toVar(),h=qi(n).toVar(),p=qi(i).toVar(),g=qi(s).toVar(),m=qi(r).toVar(),f=qi(t).toVar(),y=en(e).toVar(),x=en(FT(en(f.add(p),m.add(h),g.add(c)))).toVar();x.subAssign(.5),x.mulAssign(d),x.addAssign(.5);const b=en(en(ji(f),ji(m),ji(g)).add(x)).toVar(),T=en(b.sub(y)).toVar();return Hi(l.equal(qi(2)),(()=>no(T.x).add(no(T.y)).add(no(T.z)))),Hi(l.equal(qi(3)),(()=>_o(no(T.x),no(T.y),no(T.z)))),wo(T,T)})).setLayout({name:"mx_worley_distance_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"zoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]})]),UT=ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=Yi(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=Yi(lT(n.x,a),lT(n.y,o)).toVar(),l=ji(1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{const r=ji(VT(u,e,t,a,o,i,s)).toVar();l.assign(To(l,r))}))})),Hi(s.equal(qi(0)),(()=>{l.assign(qa(l))})),l})).setLayout({name:"mx_worley_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),OT=ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=Yi(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=Yi(lT(n.x,a),lT(n.y,o)).toVar(),l=Yi(1e6,1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{const r=ji(VT(u,e,t,a,o,i,s)).toVar();Hi(r.lessThan(l.x),(()=>{l.y.assign(l.x),l.x.assign(r)})).ElseIf(r.lessThan(l.y),(()=>{l.y.assign(r)}))}))})),Hi(s.equal(qi(0)),(()=>{l.assign(qa(l))})),l})).setLayout({name:"mx_worley_noise_vec2_0",type:"vec2",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),kT=ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=Yi(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=Yi(lT(n.x,a),lT(n.y,o)).toVar(),l=en(1e6,1e6,1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{const r=ji(VT(u,e,t,a,o,i,s)).toVar();Hi(r.lessThan(l.x),(()=>{l.z.assign(l.y),l.y.assign(l.x),l.x.assign(r)})).ElseIf(r.lessThan(l.y),(()=>{l.z.assign(l.y),l.y.assign(r)})).ElseIf(r.lessThan(l.z),(()=>{l.z.assign(r)}))}))})),Hi(s.equal(qi(0)),(()=>{l.assign(qa(l))})),l})).setLayout({name:"mx_worley_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),GT=Wf([UT,ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=en(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=qi().toVar(),l=en(lT(n.x,a),lT(n.y,o),lT(n.z,u)).toVar(),d=ji(1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{Zc({start:-1,end:qi(1),name:"z",condition:"<="},(({z:r})=>{const n=ji(VT(l,e,t,r,a,o,u,i,s)).toVar();d.assign(To(d,n))}))}))})),Hi(s.equal(qi(0)),(()=>{d.assign(qa(d))})),d})).setLayout({name:"mx_worley_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]})]),zT=Wf([OT,ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=en(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=qi().toVar(),l=en(lT(n.x,a),lT(n.y,o),lT(n.z,u)).toVar(),d=Yi(1e6,1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{Zc({start:-1,end:qi(1),name:"z",condition:"<="},(({z:r})=>{const n=ji(VT(l,e,t,r,a,o,u,i,s)).toVar();Hi(n.lessThan(d.x),(()=>{d.y.assign(d.x),d.x.assign(n)})).ElseIf(n.lessThan(d.y),(()=>{d.y.assign(n)}))}))}))})),Hi(s.equal(qi(0)),(()=>{d.assign(qa(d))})),d})).setLayout({name:"mx_worley_noise_vec2_1",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]})]),HT=Wf([kT,ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=en(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=qi().toVar(),l=en(lT(n.x,a),lT(n.y,o),lT(n.z,u)).toVar(),d=en(1e6,1e6,1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{Zc({start:-1,end:qi(1),name:"z",condition:"<="},(({z:r})=>{const n=ji(VT(l,e,t,r,a,o,u,i,s)).toVar();Hi(n.lessThan(d.x),(()=>{d.z.assign(d.y),d.y.assign(d.x),d.x.assign(n)})).ElseIf(n.lessThan(d.y),(()=>{d.z.assign(d.y),d.y.assign(n)})).ElseIf(n.lessThan(d.z),(()=>{d.z.assign(n)}))}))}))})),Hi(s.equal(qi(0)),(()=>{d.assign(qa(d))})),d})).setLayout({name:"mx_worley_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]})]),$T=ki((([e])=>{const t=e.y,r=e.z,s=en().toVar();return Hi(t.lessThan(1e-4),(()=>{s.assign(en(r,r,r))})).Else((()=>{let i=e.x;i=i.sub(Ka(i)).mul(6).toVar();const n=qi(mo(i)),a=i.sub(ji(n)),o=r.mul(t.oneMinus()),u=r.mul(t.mul(a).oneMinus()),l=r.mul(t.mul(a.oneMinus()).oneMinus());Hi(n.equal(qi(0)),(()=>{s.assign(en(r,l,o))})).ElseIf(n.equal(qi(1)),(()=>{s.assign(en(u,r,o))})).ElseIf(n.equal(qi(2)),(()=>{s.assign(en(o,r,l))})).ElseIf(n.equal(qi(3)),(()=>{s.assign(en(o,u,r))})).ElseIf(n.equal(qi(4)),(()=>{s.assign(en(l,o,r))})).Else((()=>{s.assign(en(r,o,u))}))})),s})).setLayout({name:"mx_hsvtorgb",type:"vec3",inputs:[{name:"hsv",type:"vec3"}]}),WT=ki((([e])=>{const t=en(e).toVar(),r=ji(t.x).toVar(),s=ji(t.y).toVar(),i=ji(t.z).toVar(),n=ji(To(r,To(s,i))).toVar(),a=ji(_o(r,_o(s,i))).toVar(),o=ji(a.sub(n)).toVar(),u=ji().toVar(),l=ji().toVar(),d=ji().toVar();return d.assign(a),Hi(a.greaterThan(0),(()=>{l.assign(o.div(a))})).Else((()=>{l.assign(0)})),Hi(l.lessThanEqual(0),(()=>{u.assign(0)})).Else((()=>{Hi(r.greaterThanEqual(a),(()=>{u.assign(s.sub(i).div(o))})).ElseIf(s.greaterThanEqual(a),(()=>{u.assign(oa(2,i.sub(r).div(o)))})).Else((()=>{u.assign(oa(4,r.sub(s).div(o)))})),u.mulAssign(1/6),Hi(u.lessThan(0),(()=>{u.addAssign(1)}))})),en(u,l,d)})).setLayout({name:"mx_rgbtohsv",type:"vec3",inputs:[{name:"c",type:"vec3"}]}),jT=ki((([e])=>{const t=en(e).toVar(),r=sn(ma(t,en(.04045))).toVar(),s=en(t.div(12.92)).toVar(),i=en(Ro(_o(t.add(en(.055)),en(0)).div(1.055),en(2.4))).toVar();return Io(s,i,r)})).setLayout({name:"mx_srgb_texture_to_lin_rec709",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),qT=(e,t)=>{e=ji(e),t=ji(t);const r=Yi(t.dFdx(),t.dFdy()).length().mul(.7071067811865476);return Oo(e.sub(r),e.add(r),t)},XT=(e,t,r,s)=>Io(e,t,r[s].clamp()),KT=(e,t,r,s,i)=>Io(e,t,qT(r,s[i])),YT=ki((([e,t,r])=>{const s=Qa(e).toVar(),i=ua(ji(.5).mul(t.sub(r)),Ol).div(s).toVar(),n=ua(ji(-.5).mul(t.sub(r)),Ol).div(s).toVar(),a=en().toVar();a.x=s.x.greaterThan(ji(0)).select(i.x,n.x),a.y=s.y.greaterThan(ji(0)).select(i.y,n.y),a.z=s.z.greaterThan(ji(0)).select(i.z,n.z);const o=To(a.x,a.y,a.z).toVar();return Ol.add(s.mul(o)).toVar().sub(r)})),QT=ki((([e,t])=>{const r=e.x,s=e.y,i=e.z;let n=t.element(0).mul(.886227);return n=n.add(t.element(1).mul(1.023328).mul(s)),n=n.add(t.element(2).mul(1.023328).mul(i)),n=n.add(t.element(3).mul(1.023328).mul(r)),n=n.add(t.element(4).mul(.858086).mul(r).mul(s)),n=n.add(t.element(5).mul(.858086).mul(s).mul(i)),n=n.add(t.element(6).mul(i.mul(i).mul(.743125).sub(.247708))),n=n.add(t.element(7).mul(.858086).mul(r).mul(i)),n=n.add(t.element(8).mul(.429043).mul(la(r,r).sub(la(s,s)))),n}));var ZT=Object.freeze({__proto__:null,BRDF_GGX:Bp,BRDF_Lambert:bp,BasicPointShadowFilter:jb,BasicShadowFilter:Rb,Break:Jc,Const:ru,Continue:()=>Du("continue").toStack(),DFGApprox:Ip,D_GGX:Pp,Discard:Vu,EPSILON:Ia,F_Schlick:xp,Fn:ki,INFINITY:Da,If:Hi,Loop:Zc,NodeAccess:Os,NodeShaderStage:Ds,NodeType:Us,NodeUpdateType:Vs,PCFShadowFilter:Cb,PCFSoftShadowFilter:Mb,PI:Va,PI2:Ua,PointShadowFilter:qb,Return:()=>Du("return").toStack(),Schlick_to_F0:Vp,ScriptableNodeResources:Bx,ShaderNode:Li,Stack:$i,Switch:(...e)=>ni.Switch(...e),TBNViewMatrix:Bd,VSMShadowFilter:Pb,V_GGX_SmithCorrelated:Cp,Var:tu,abs:no,acesFilmicToneMapping:Tx,acos:so,add:oa,addMethodChaining:oi,addNodeElement:function(e){console.warn("THREE.TSL: AddNodeElement has been removed in favor of tree-shaking. Trying add",e)},agxToneMapping:Sx,all:Oa,alphaT:Rn,and:xa,anisotropy:Cn,anisotropyB:Pn,anisotropyT:Mn,any:ka,append:e=>(console.warn("THREE.TSL: append() has been renamed to Stack()."),$i(e)),array:ea,arrayBuffer:e=>Bi(new si(e,"ArrayBuffer")),asin:ro,assign:ra,atan:io,atan2:$o,atomicAdd:(e,t)=>sb(tb.ATOMIC_ADD,e,t),atomicAnd:(e,t)=>sb(tb.ATOMIC_AND,e,t),atomicFunc:sb,atomicLoad:e=>sb(tb.ATOMIC_LOAD,e,null),atomicMax:(e,t)=>sb(tb.ATOMIC_MAX,e,t),atomicMin:(e,t)=>sb(tb.ATOMIC_MIN,e,t),atomicOr:(e,t)=>sb(tb.ATOMIC_OR,e,t),atomicStore:(e,t)=>sb(tb.ATOMIC_STORE,e,t),atomicSub:(e,t)=>sb(tb.ATOMIC_SUB,e,t),atomicXor:(e,t)=>sb(tb.ATOMIC_XOR,e,t),attenuationColor:Hn,attenuationDistance:zn,attribute:Hu,attributeArray:(e,t="float")=>{let r,s;!0===t.isStruct?(r=t.layout.getLength(),s=ws("float")):(r=As(t),s=ws(t));const i=new My(e,r,s);return qc(i,t,e)},backgroundBlurriness:Dy,backgroundIntensity:Vy,backgroundRotation:Uy,batch:Hc,billboarding:Qf,bitAnd:va,bitNot:Na,bitOr:Sa,bitXor:Ea,bitangentGeometry:Rd,bitangentLocal:Cd,bitangentView:Md,bitangentWorld:Pd,bitcast:xo,blendBurn:Yy,blendColor:ex,blendDodge:Qy,blendOverlay:Jy,blendScreen:Zy,blur:Dg,bool:Ki,buffer:tl,bufferAttribute:_u,bumpMap:Hd,burn:(...e)=>(console.warn('THREE.TSL: "burn" has been renamed. Use "blendBurn" instead.'),Yy(e)),bvec2:Ji,bvec3:sn,bvec4:un,bypass:Pu,cache:Ru,call:ia,cameraFar:ul,cameraIndex:al,cameraNear:ol,cameraNormalMatrix:pl,cameraPosition:gl,cameraProjectionMatrix:ll,cameraProjectionMatrixInverse:dl,cameraViewMatrix:cl,cameraWorldMatrix:hl,cbrt:Lo,cdl:ux,ceil:Ya,checker:iT,cineonToneMapping:xx,clamp:Do,clearcoat:_n,clearcoatRoughness:vn,code:Ax,color:Wi,colorSpaceToWorking:hu,colorToDirection:e=>Bi(e).mul(2).sub(1),compute:wu,computeSkinning:(e,t=null)=>{const r=new Kc(e);return r.positionNode=qc(new F(e.geometry.getAttribute("position").array,3),"vec3").setPBO(!0).toReadOnly().element(Lc).toVar(),r.skinIndexNode=qc(new F(new Uint32Array(e.geometry.getAttribute("skinIndex").array),4),"uvec4").setPBO(!0).toReadOnly().element(Lc).toVar(),r.skinWeightNode=qc(new F(e.geometry.getAttribute("skinWeight").array,4),"vec4").setPBO(!0).toReadOnly().element(Lc).toVar(),r.bindMatrixNode=Zn(e.bindMatrix,"mat4"),r.bindMatrixInverseNode=Zn(e.bindMatrixInverse,"mat4"),r.boneMatricesNode=tl(e.skeleton.boneMatrices,"mat4",e.skeleton.bones.length),r.toPositionNode=t,Bi(r)},cond:Ko,context:Qo,convert:pn,convertColorSpace:(e,t,r)=>Bi(new du(Bi(e),t,r)),convertToTexture:(e,...t)=>e.isTextureNode?e:e.isPassNode?e.getTextureNode():Ey(e,...t),cos:eo,cross:Ao,cubeTexture:gd,cubeTextureBase:pd,cubeToUV:Wb,dFdx:co,dFdy:ho,dashSize:Dn,debug:Gu,decrement:Pa,decrementBefore:Ca,defaultBuildStages:Gs,defaultShaderStages:ks,defined:Pi,degrees:za,deltaTime:qf,densityFog:function(e,t){return console.warn('THREE.TSL: "densityFog( color, density )" is deprecated. Use "fog( color, densityFogFactor( density ) )" instead.'),kx(e,Ox(t))},densityFogFactor:Ox,depth:Dh,depthPass:(e,t,r)=>Bi(new gx(gx.DEPTH,e,t,r)),difference:Eo,diffuseColor:yn,directPointLight:rT,directionToColor:tp,dispersion:$n,distance:So,div:da,dodge:(...e)=>(console.warn('THREE.TSL: "dodge" has been renamed. Use "blendDodge" instead.'),Qy(e)),dot:wo,drawIndex:Vc,dynamicBufferAttribute:vu,element:hn,emissive:xn,equal:ha,equals:bo,equirectUV:np,exp:Ha,exp2:$a,expression:Du,faceDirection:Wl,faceForward:ko,faceforward:Wo,float:ji,floor:Ka,fog:kx,fract:Za,frameGroup:Xn,frameId:Xf,frontFacing:$l,fwidth:fo,gain:(e,t)=>e.lessThan(.5)?Of(e.mul(2),t).div(2):ua(1,Of(la(ua(1,e),2),t).div(2)),gapSize:Vn,getConstNodeType:Fi,getCurrentStack:zi,getDirection:Fg,getDistanceAttenuation:tT,getGeometryRoughness:Ap,getNormalFromDepth:Ry,getParallaxCorrectNormal:YT,getRoughness:Rp,getScreenPosition:Ay,getShIrradianceAt:QT,getShadowMaterial:Lb,getShadowRenderObjectFunction:Db,getTextureIndex:If,getViewPosition:wy,globalId:Kx,glsl:(e,t)=>Ax(e,t,"glsl"),glslFn:(e,t)=>Cx(e,t,"glsl"),grayscale:sx,greaterThan:ma,greaterThanEqual:ya,hash:Uf,highpModelNormalViewMatrix:Il,highpModelViewMatrix:Bl,hue:ax,increment:Ma,incrementBefore:Ra,instance:Oc,instanceIndex:Lc,instancedArray:(e,t="float")=>{let r,s;!0===t.isStruct?(r=t.layout.getLength(),s=ws("float")):(r=As(t),s=ws(t));const i=new Cy(e,r,s);return qc(i,t,e)},instancedBufferAttribute:Nu,instancedDynamicBufferAttribute:Su,instancedMesh:Gc,int:qi,inverseSqrt:Xa,inversesqrt:jo,invocationLocalIndex:Dc,invocationSubgroupIndex:Ic,ior:On,iridescence:En,iridescenceIOR:wn,iridescenceThickness:An,ivec2:Qi,ivec3:tn,ivec4:an,js:(e,t)=>Ax(e,t,"js"),label:Zo,length:oo,lengthSq:Bo,lessThan:ga,lessThanEqual:fa,lightPosition:ub,lightProjectionUV:ob,lightShadowMatrix:ab,lightTargetDirection:cb,lightTargetPosition:lb,lightViewPosition:db,lightingContext:uh,lights:(e=[])=>Bi(new mb).setLights(e),linearDepth:Vh,linearToneMapping:fx,localId:Yx,log:Wa,log2:ja,logarithmicDepthToViewZ:(e,t,r)=>{const s=e.mul(Wa(r.div(t)));return ji(Math.E).pow(s).mul(t).negate()},loop:(...e)=>(console.warn("THREE.TSL: loop() has been renamed to Loop()."),Zc(...e)),luminance:ox,mat2:ln,mat3:dn,mat4:cn,matcapUV:Sm,materialAO:Rc,materialAlphaTest:jd,materialAnisotropy:cc,materialAnisotropyVector:Cc,materialAttenuationColor:bc,materialAttenuationDistance:xc,materialClearcoat:nc,materialClearcoatNormal:oc,materialClearcoatRoughness:ac,materialColor:qd,materialDispersion:wc,materialEmissive:Kd,materialEnvIntensity:nd,materialEnvRotation:ad,materialIOR:yc,materialIridescence:hc,materialIridescenceIOR:pc,materialIridescenceThickness:gc,materialLightMap:Ac,materialLineDashOffset:Sc,materialLineDashSize:_c,materialLineGapSize:vc,materialLineScale:Tc,materialLineWidth:Nc,materialMetalness:sc,materialNormal:ic,materialOpacity:Yd,materialPointSize:Ec,materialReference:Td,materialReflectivity:tc,materialRefractionRatio:id,materialRotation:uc,materialRoughness:rc,materialSheen:lc,materialSheenRoughness:dc,materialShininess:Xd,materialSpecular:Qd,materialSpecularColor:Jd,materialSpecularIntensity:Zd,materialSpecularStrength:ec,materialThickness:fc,materialTransmission:mc,max:_o,maxMipLevel:Xu,mediumpModelViewMatrix:Ll,metalness:Tn,min:To,mix:Io,mixElement:zo,mod:ca,modInt:La,modelDirection:Sl,modelNormalMatrix:Ml,modelPosition:wl,modelRadius:Cl,modelScale:Al,modelViewMatrix:Fl,modelViewPosition:Rl,modelViewProjection:Mc,modelWorldMatrix:El,modelWorldMatrixInverse:Pl,morphReference:ih,mrt:Vf,mul:la,mx_aastep:qT,mx_cell_noise_float:(e=$u())=>PT(e.convert("vec2|vec3")),mx_contrast:(e,t=1,r=.5)=>ji(e).sub(r).mul(t).add(r),mx_fractal_noise_float:(e=$u(),t=3,r=2,s=.5,i=1)=>LT(e,qi(t),r,s).mul(i),mx_fractal_noise_vec2:(e=$u(),t=3,r=2,s=.5,i=1)=>IT(e,qi(t),r,s).mul(i),mx_fractal_noise_vec3:(e=$u(),t=3,r=2,s=.5,i=1)=>BT(e,qi(t),r,s).mul(i),mx_fractal_noise_vec4:(e=$u(),t=3,r=2,s=.5,i=1)=>DT(e,qi(t),r,s).mul(i),mx_hsvtorgb:$T,mx_noise_float:(e=$u(),t=1,r=0)=>CT(e.convert("vec2|vec3")).mul(t).add(r),mx_noise_vec3:(e=$u(),t=1,r=0)=>MT(e.convert("vec2|vec3")).mul(t).add(r),mx_noise_vec4:(e=$u(),t=1,r=0)=>{e=e.convert("vec2|vec3");return nn(MT(e),CT(e.add(Yi(19,73)))).mul(t).add(r)},mx_ramplr:(e,t,r=$u())=>XT(e,t,r,"x"),mx_ramptb:(e,t,r=$u())=>XT(e,t,r,"y"),mx_rgbtohsv:WT,mx_safepower:(e,t=1)=>(e=ji(e)).abs().pow(t).mul(e.sign()),mx_splitlr:(e,t,r,s=$u())=>KT(e,t,r,s,"x"),mx_splittb:(e,t,r,s=$u())=>KT(e,t,r,s,"y"),mx_srgb_texture_to_lin_rec709:jT,mx_transform_uv:(e=1,t=0,r=$u())=>r.mul(e).add(t),mx_worley_noise_float:(e=$u(),t=1)=>GT(e.convert("vec2|vec3"),t,qi(1)),mx_worley_noise_vec2:(e=$u(),t=1)=>zT(e.convert("vec2|vec3"),t,qi(1)),mx_worley_noise_vec3:(e=$u(),t=1)=>HT(e.convert("vec2|vec3"),t,qi(1)),namespace:Cu,negate:uo,neutralToneMapping:Ex,nodeArray:Di,nodeImmutable:Ui,nodeObject:Bi,nodeObjects:Ii,nodeProxy:Vi,normalFlat:Xl,normalGeometry:jl,normalLocal:ql,normalMap:Od,normalView:Kl,normalWorld:Yl,normalize:Qa,not:Ta,notEqual:pa,numWorkgroups:qx,objectDirection:yl,objectGroup:Yn,objectPosition:bl,objectRadius:vl,objectScale:Tl,objectViewPosition:_l,objectWorldMatrix:xl,oneMinus:lo,or:ba,orthographicDepthToViewZ:(e,t,r)=>t.sub(r).mul(e).sub(t),oscSawtooth:(e=jf)=>e.fract(),oscSine:(e=jf)=>e.add(.75).mul(2*Math.PI).sin().mul(.5).add(.5),oscSquare:(e=jf)=>e.fract().round(),oscTriangle:(e=jf)=>e.add(.5).fract().mul(2).sub(1).abs(),output:In,outputStruct:Bf,overlay:(...e)=>(console.warn('THREE.TSL: "overlay" has been renamed. Use "blendOverlay" instead.'),Jy(e)),overloadingFn:Wf,parabola:Of,parallaxDirection:Id,parallaxUV:(e,t)=>e.sub(Id.mul(t)),parameter:(e,t)=>Bi(new Rf(e,t)),pass:(e,t,r)=>Bi(new gx(gx.COLOR,e,t,r)),passTexture:(e,t)=>Bi(new hx(e,t)),pcurve:(e,t,r)=>Ro(da(Ro(e,t),oa(Ro(e,t),Ro(ua(1,e),r))),1/t),perspectiveDepthToViewZ:Lh,pmremTexture:um,pointShadow:Jb,pointUV:Fy,pointWidth:Un,positionGeometry:Dl,positionLocal:Vl,positionPrevious:Ul,positionView:Gl,positionViewDirection:zl,positionWorld:Ol,positionWorldDirection:kl,posterize:dx,pow:Ro,pow2:Co,pow3:Mo,pow4:Po,premult:tx,property:mn,radians:Ga,rand:Go,range:$x,rangeFog:function(e,t,r){return console.warn('THREE.TSL: "rangeFog( color, near, far )" is deprecated. Use "fog( color, rangeFogFactor( near, far ) )" instead.'),kx(e,Ux(t,r))},rangeFogFactor:Ux,reciprocal:go,reference:yd,referenceBuffer:xd,reflect:No,reflectVector:ld,reflectView:od,reflector:e=>Bi(new yy(e)),refract:Uo,refractVector:dd,refractView:ud,reinhardToneMapping:yx,remainder:Fa,remap:Lu,remapClamp:Bu,renderGroup:Kn,renderOutput:Ou,rendererReference:fu,rotate:Rm,rotateUV:Kf,roughness:bn,round:po,rtt:Ey,sRGBTransferEOTF:ou,sRGBTransferOETF:uu,sampler:e=>(!0===e.isNode?e:Zu(e)).convert("sampler"),samplerComparison:e=>(!0===e.isNode?e:Zu(e)).convert("samplerComparison"),saturate:Vo,saturation:ix,screen:(...e)=>(console.warn('THREE.TSL: "screen" has been renamed. Use "blendScreen" instead.'),Zy(e)),screenCoordinate:mh,screenSize:gh,screenUV:ph,scriptable:Dx,scriptableValue:Px,select:Xo,setCurrentStack:Gi,shaderStages:zs,shadow:Hb,shadowPositionWorld:yb,shapeCircle:nT,sharedUniformGroup:qn,sheen:Nn,sheenRoughness:Sn,shiftLeft:wa,shiftRight:Aa,shininess:Bn,sign:ao,sin:Ja,sinc:(e,t)=>Ja(Va.mul(t.mul(e).sub(1))).div(Va.mul(t.mul(e).sub(1))),skinning:Yc,smoothstep:Oo,smoothstepElement:Ho,specularColor:Fn,specularF90:Ln,spherizeUV:Yf,split:(e,t)=>Bi(new Zs(Bi(e),t)),spritesheetUV:ey,sqrt:qa,stack:Mf,step:vo,storage:qc,storageBarrier:()=>Zx("storage").toStack(),storageObject:(e,t,r)=>(console.warn('THREE.TSL: "storageObject()" is deprecated. Use "storage().setPBO( true )" instead.'),qc(e,t,r).setPBO(!0)),storageTexture:ky,string:(e="")=>Bi(new si(e,"string")),struct:(e,t=null)=>{const r=new Pf(e,t),s=(...t)=>{let s=null;if(t.length>0)if(t[0].isNode){s={};const r=Object.keys(e);for(let e=0;eZx("texture").toStack(),textureBicubic:rg,textureCubeUV:Lg,textureLoad:Ju,textureSize:ju,textureStore:(e,t,r)=>{const s=ky(e,t,r);return null!==r&&s.toStack(),s},thickness:Gn,time:jf,timerDelta:(e=1)=>(console.warn('TSL: timerDelta() is deprecated. Use "deltaTime" instead.'),qf.mul(e)),timerGlobal:(e=1)=>(console.warn('TSL: timerGlobal() is deprecated. Use "time" instead.'),jf.mul(e)),timerLocal:(e=1)=>(console.warn('TSL: timerLocal() is deprecated. Use "time" instead.'),jf.mul(e)),toneMapping:xu,toneMappingExposure:bu,toonOutlinePass:(t,r,s=new e(0,0,0),i=.003,n=1)=>Bi(new mx(t,r,Bi(s),Bi(i),Bi(n))),transformDirection:Fo,transformNormal:ed,transformNormalToView:td,transformedBentNormalView:Dd,transformedBitangentView:Fd,transformedBitangentWorld:Ld,transformedClearcoatNormalView:Jl,transformedNormalView:Ql,transformedNormalWorld:Zl,transformedTangentView:Ed,transformedTangentWorld:wd,transmission:kn,transpose:yo,triNoise3D:zf,triplanarTexture:(...e)=>ry(...e),triplanarTextures:ry,trunc:mo,tslFn:(...e)=>(console.warn("THREE.TSL: tslFn() has been renamed to Fn()."),ki(...e)),uint:Xi,uniform:Zn,uniformArray:il,uniformCubeTexture:(e=cd)=>pd(e),uniformGroup:jn,uniformTexture:(e=Ku)=>Zu(e),uniforms:(e,t)=>(console.warn("THREE.TSL: uniforms() has been renamed to uniformArray()."),Bi(new sl(e,t))),unpremult:rx,userData:(e,t,r)=>Bi(new $y(e,t,r)),uv:$u,uvec2:Zi,uvec3:rn,uvec4:on,varying:nu,varyingProperty:fn,vec2:Yi,vec3:en,vec4:nn,vectorComponents:Hs,velocity:Ky,vertexColor:$h,vertexIndex:Fc,vertexStage:au,vibrance:nx,viewZToLogarithmicDepth:Bh,viewZToOrthographicDepth:Ph,viewZToPerspectiveDepth:Fh,viewport:fh,viewportBottomLeft:vh,viewportCoordinate:xh,viewportDepthTexture:Ch,viewportLinearDepth:Uh,viewportMipTexture:wh,viewportResolution:Th,viewportSafeUV:Zf,viewportSharedTexture:Zh,viewportSize:yh,viewportTexture:Eh,viewportTopLeft:_h,viewportUV:bh,wgsl:(e,t)=>Ax(e,t,"wgsl"),wgslFn:(e,t)=>Cx(e,t,"wgsl"),workgroupArray:(e,t)=>Bi(new eb("Workgroup",e,t)),workgroupBarrier:()=>Zx("workgroup").toStack(),workgroupId:Xx,workingToColorSpace:cu,xor:_a});const JT=new Af;class e_ extends qm{constructor(e,t){super(),this.renderer=e,this.nodes=t}update(e,t,r){const s=this.renderer,i=this.nodes.getBackgroundNode(e)||e.background;let n=!1;if(null===i)s._clearColor.getRGB(JT),JT.a=s._clearColor.a;else if(!0===i.isColor)i.getRGB(JT),JT.a=1,n=!0;else if(!0===i.isNode){const o=this.get(e),u=i;JT.copy(s._clearColor);let l=o.backgroundMesh;if(void 0===l){const c=Qo(nn(u).mul(Vy),{getUV:()=>Uy.mul(Yl),getTextureLevel:()=>Dy});let h=Mc;h=h.setZ(h.w);const p=new Wh;function g(){i.removeEventListener("dispose",g),l.material.dispose(),l.geometry.dispose()}p.name="Background.material",p.side=S,p.depthTest=!1,p.depthWrite=!1,p.allowOverride=!1,p.fog=!1,p.lights=!1,p.vertexNode=h,p.colorNode=c,o.backgroundMeshNode=c,o.backgroundMesh=l=new q(new Oe(1,32,32),p),l.frustumCulled=!1,l.name="Background.mesh",l.onBeforeRender=function(e,t,r){this.matrixWorld.copyPosition(r.matrixWorld)},i.addEventListener("dispose",g)}const d=u.getCacheKey();o.backgroundCacheKey!==d&&(o.backgroundMeshNode.node=nn(u).mul(Vy),o.backgroundMeshNode.needsUpdate=!0,l.material.needsUpdate=!0,o.backgroundCacheKey=d),t.unshift(l,l.geometry,l.material,0,0,null,null)}else console.error("THREE.Renderer: Unsupported background configuration.",i);const a=s.xr.getEnvironmentBlendMode();if("additive"===a?JT.set(0,0,0,1):"alpha-blend"===a&&JT.set(0,0,0,0),!0===s.autoClear||!0===n){const m=r.clearColorValue;m.r=JT.r,m.g=JT.g,m.b=JT.b,m.a=JT.a,!0!==s.backend.isWebGLBackend&&!0!==s.alpha||(m.r*=m.a,m.g*=m.a,m.b*=m.a),r.depthClearValue=s._clearDepth,r.stencilClearValue=s._clearStencil,r.clearColor=!0===s.autoClearColor,r.clearDepth=!0===s.autoClearDepth,r.clearStencil=!0===s.autoClearStencil}else r.clearColor=!1,r.clearDepth=!1,r.clearStencil=!1}}let t_=0;class r_{constructor(e="",t=[],r=0,s=[]){this.name=e,this.bindings=t,this.index=r,this.bindingsReference=s,this.id=t_++}}class s_{constructor(e,t,r,s,i,n,a,o,u,l=[]){this.vertexShader=e,this.fragmentShader=t,this.computeShader=r,this.transforms=l,this.nodeAttributes=s,this.bindings=i,this.updateNodes=n,this.updateBeforeNodes=a,this.updateAfterNodes=o,this.observer=u,this.usedTimes=0}createBindings(){const e=[];for(const t of this.bindings){if(!0!==t.bindings[0].groupNode.shared){const r=new r_(t.name,[],t.index,t);e.push(r);for(const e of t.bindings)r.bindings.push(e.clone())}else e.push(t)}return e}}class i_{constructor(e,t,r=null){this.isNodeAttribute=!0,this.name=e,this.type=t,this.node=r}}class n_{constructor(e,t,r){this.isNodeUniform=!0,this.name=e,this.type=t,this.node=r.getSelf()}get value(){return this.node.value}set value(e){this.node.value=e}get id(){return this.node.id}get groupNode(){return this.node.groupNode}}class a_{constructor(e,t,r=!1,s=null){this.isNodeVar=!0,this.name=e,this.type=t,this.readOnly=r,this.count=s}}class o_ extends a_{constructor(e,t,r=null,s=null){super(e,t),this.needsInterpolation=!1,this.isNodeVarying=!0,this.interpolationType=r,this.interpolationSampling=s}}class u_{constructor(e,t,r=""){this.name=e,this.type=t,this.code=r,Object.defineProperty(this,"isNodeCode",{value:!0})}}let l_=0;class d_{constructor(e=null){this.id=l_++,this.nodesData=new WeakMap,this.parent=e}getData(e){let t=this.nodesData.get(e);return void 0===t&&null!==this.parent&&(t=this.parent.getData(e)),t}setData(e,t){this.nodesData.set(e,t)}}class c_{constructor(e,t){this.name=e,this.members=t,this.output=!1}}class h_{constructor(e,t){this.name=e,this.value=t,this.boundary=0,this.itemSize=0,this.offset=0}setValue(e){this.value=e}getValue(){return this.value}}class p_ extends h_{constructor(e,t=0){super(e,t),this.isNumberUniform=!0,this.boundary=4,this.itemSize=1}}class g_ extends h_{constructor(e,r=new t){super(e,r),this.isVector2Uniform=!0,this.boundary=8,this.itemSize=2}}class m_ extends h_{constructor(e,t=new r){super(e,t),this.isVector3Uniform=!0,this.boundary=16,this.itemSize=3}}class f_ extends h_{constructor(e,t=new s){super(e,t),this.isVector4Uniform=!0,this.boundary=16,this.itemSize=4}}class y_ extends h_{constructor(t,r=new e){super(t,r),this.isColorUniform=!0,this.boundary=16,this.itemSize=3}}class x_ extends h_{constructor(e,t=new i){super(e,t),this.isMatrix2Uniform=!0,this.boundary=8,this.itemSize=4}}class b_ extends h_{constructor(e,t=new n){super(e,t),this.isMatrix3Uniform=!0,this.boundary=48,this.itemSize=12}}class T_ extends h_{constructor(e,t=new a){super(e,t),this.isMatrix4Uniform=!0,this.boundary=64,this.itemSize=16}}class __ extends p_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class v_ extends g_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class N_ extends m_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class S_ extends f_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class E_ extends y_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class w_ extends x_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class A_ extends b_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class R_ extends T_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}const C_=new WeakMap,M_=new Map([[Int8Array,"int"],[Int16Array,"int"],[Int32Array,"int"],[Uint8Array,"uint"],[Uint16Array,"uint"],[Uint32Array,"uint"],[Float32Array,"float"]]),P_=e=>/e/g.test(e)?String(e).replace(/\+/g,""):(e=Number(e))+(e%1?"":".0");class F_{constructor(e,t,r){this.object=e,this.material=e&&e.material||null,this.geometry=e&&e.geometry||null,this.renderer=t,this.parser=r,this.scene=null,this.camera=null,this.nodes=[],this.sequentialNodes=[],this.updateNodes=[],this.updateBeforeNodes=[],this.updateAfterNodes=[],this.hashNodes={},this.observer=null,this.lightsNode=null,this.environmentNode=null,this.fogNode=null,this.clippingContext=null,this.vertexShader=null,this.fragmentShader=null,this.computeShader=null,this.flowNodes={vertex:[],fragment:[],compute:[]},this.flowCode={vertex:"",fragment:"",compute:""},this.uniforms={vertex:[],fragment:[],compute:[],index:0},this.structs={vertex:[],fragment:[],compute:[],index:0},this.bindings={vertex:{},fragment:{},compute:{}},this.bindingsIndexes={},this.bindGroups=null,this.attributes=[],this.bufferAttributes=[],this.varyings=[],this.codes={},this.vars={},this.declarations={},this.flow={code:""},this.chaining=[],this.stack=Mf(),this.stacks=[],this.tab="\t",this.currentFunctionNode=null,this.context={material:this.material},this.cache=new d_,this.globalCache=this.cache,this.flowsData=new WeakMap,this.shaderStage=null,this.buildStage=null}getBindGroupsCache(){let e=C_.get(this.renderer);return void 0===e&&(e=new zm,C_.set(this.renderer,e)),e}createRenderTarget(e,t,r){return new oe(e,t,r)}createCubeRenderTarget(e,t){return new ap(e,t)}includes(e){return this.nodes.includes(e)}getOutputStructName(){}_getBindGroup(e,t){const r=this.getBindGroupsCache(),s=[];let i,n=!0;for(const e of t)s.push(e),n=n&&!0!==e.groupNode.shared;return n?(i=r.get(s),void 0===i&&(i=new r_(e,s,this.bindingsIndexes[e].group,s),r.set(s,i))):i=new r_(e,s,this.bindingsIndexes[e].group,s),i}getBindGroupArray(e,t){const r=this.bindings[t];let s=r[e];return void 0===s&&(void 0===this.bindingsIndexes[e]&&(this.bindingsIndexes[e]={binding:0,group:Object.keys(this.bindingsIndexes).length}),r[e]=s=[]),s}getBindings(){let e=this.bindGroups;if(null===e){const t={},r=this.bindings;for(const e of zs)for(const s in r[e]){const i=r[e][s];(t[s]||(t[s]=[])).push(...i)}e=[];for(const r in t){const s=t[r],i=this._getBindGroup(r,s);e.push(i)}this.bindGroups=e}return e}sortBindingGroups(){const e=this.getBindings();e.sort(((e,t)=>e.bindings[0].groupNode.order-t.bindings[0].groupNode.order));for(let t=0;t=0?`${Math.round(n)}u`:"0u";if("bool"===i)return n?"true":"false";if("color"===i)return`${this.getType("vec3")}( ${P_(n.r)}, ${P_(n.g)}, ${P_(n.b)} )`;const a=this.getTypeLength(i),o=this.getComponentType(i),u=e=>this.generateConst(o,e);if(2===a)return`${this.getType(i)}( ${u(n.x)}, ${u(n.y)} )`;if(3===a)return`${this.getType(i)}( ${u(n.x)}, ${u(n.y)}, ${u(n.z)} )`;if(4===a&&"mat2"!==i)return`${this.getType(i)}( ${u(n.x)}, ${u(n.y)}, ${u(n.z)}, ${u(n.w)} )`;if(a>=4&&n&&(n.isMatrix2||n.isMatrix3||n.isMatrix4))return`${this.getType(i)}( ${n.elements.map(u).join(", ")} )`;if(a>4)return`${this.getType(i)}()`;throw new Error(`NodeBuilder: Type '${i}' not found in generate constant attempt.`)}getType(e){return"color"===e?"vec3":e}hasGeometryAttribute(e){return this.geometry&&void 0!==this.geometry.getAttribute(e)}getAttribute(e,t){const r=this.attributes;for(const t of r)if(t.name===e)return t;const s=new i_(e,t);return this.registerDeclaration(s),r.push(s),s}getPropertyName(e){return e.name}isVector(e){return/vec\d/.test(e)}isMatrix(e){return/mat\d/.test(e)}isReference(e){return"void"===e||"property"===e||"sampler"===e||"samplerComparison"===e||"texture"===e||"cubeTexture"===e||"storageTexture"===e||"depthTexture"===e||"texture3D"===e}needsToWorkingColorSpace(){return!1}getComponentTypeFromTexture(e){const t=e.type;if(e.isDataTexture){if(t===_)return"int";if(t===T)return"uint"}return"float"}getElementType(e){return"mat2"===e?"vec2":"mat3"===e?"vec3":"mat4"===e?"vec4":this.getComponentType(e)}getComponentType(e){if("float"===(e=this.getVectorType(e))||"bool"===e||"int"===e||"uint"===e)return e;const t=/(b|i|u|)(vec|mat)([2-4])/.exec(e);return null===t?null:"b"===t[1]?"bool":"i"===t[1]?"int":"u"===t[1]?"uint":"float"}getVectorType(e){return"color"===e?"vec3":"texture"===e||"cubeTexture"===e||"storageTexture"===e||"texture3D"===e?"vec4":e}getTypeFromLength(e,t="float"){if(1===e)return t;let r=Es(e);const s="float"===t?"":t[0];return!0===/mat2/.test(t)&&(r=r.replace("vec","mat")),s+r}getTypeFromArray(e){return M_.get(e.constructor)}isInteger(e){return/int|uint|(i|u)vec/.test(e)}getTypeFromAttribute(e){let t=e;e.isInterleavedBufferAttribute&&(t=e.data);const r=t.array,s=e.itemSize,i=e.normalized;let n;return e instanceof ze||!0===i||(n=this.getTypeFromArray(r)),this.getTypeFromLength(s,n)}getTypeLength(e){const t=this.getVectorType(e),r=/vec([2-4])/.exec(t);return null!==r?Number(r[1]):"float"===t||"bool"===t||"int"===t||"uint"===t?1:!0===/mat2/.test(e)?4:!0===/mat3/.test(e)?9:!0===/mat4/.test(e)?16:0}getVectorFromMatrix(e){return e.replace("mat","vec")}changeComponentType(e,t){return this.getTypeFromLength(this.getTypeLength(e),t)}getIntegerType(e){const t=this.getComponentType(e);return"int"===t||"uint"===t?e:this.changeComponentType(e,"int")}addStack(){return this.stack=Mf(this.stack),this.stacks.push(zi()||this.stack),Gi(this.stack),this.stack}removeStack(){const e=this.stack;return this.stack=e.parent,Gi(this.stacks.pop()),e}getDataFromNode(e,t=this.shaderStage,r=null){let s=(r=null===r?e.isGlobal(this)?this.globalCache:this.cache:r).getData(e);return void 0===s&&(s={},r.setData(e,s)),void 0===s[t]&&(s[t]={}),s[t]}getNodeProperties(e,t="any"){const r=this.getDataFromNode(e,t);return r.properties||(r.properties={outputNode:null})}getBufferAttributeFromNode(e,t){const r=this.getDataFromNode(e);let s=r.bufferAttribute;if(void 0===s){const i=this.uniforms.index++;s=new i_("nodeAttribute"+i,t,e),this.bufferAttributes.push(s),r.bufferAttribute=s}return s}getStructTypeFromNode(e,t,r=null,s=this.shaderStage){const i=this.getDataFromNode(e,s,this.globalCache);let n=i.structType;if(void 0===n){const e=this.structs.index++;null===r&&(r="StructType"+e),n=new c_(r,t),this.structs[s].push(n),i.structType=n}return n}getOutputStructTypeFromNode(e,t){const r=this.getStructTypeFromNode(e,t,"OutputType","fragment");return r.output=!0,r}getUniformFromNode(e,t,r=this.shaderStage,s=null){const i=this.getDataFromNode(e,r,this.globalCache);let n=i.uniform;if(void 0===n){const a=this.uniforms.index++;n=new n_(s||"nodeUniform"+a,t,e),this.uniforms[r].push(n),this.registerDeclaration(n),i.uniform=n}return n}getArrayCount(e){let t=null;return e.isArrayNode?t=e.count:e.isVarNode&&e.node.isArrayNode&&(t=e.node.count),t}getVarFromNode(e,t=null,r=e.getNodeType(this),s=this.shaderStage,i=!1){const n=this.getDataFromNode(e,s);let a=n.variable;if(void 0===a){const o=i?"_const":"_var",u=this.vars[s]||(this.vars[s]=[]),l=this.vars[o]||(this.vars[o]=0);null===t&&(t=(i?"nodeConst":"nodeVar")+l,this.vars[o]++);const d=this.getArrayCount(e);a=new a_(t,r,i,d),i||u.push(a),this.registerDeclaration(a),n.variable=a}return a}isDeterministic(e){if(e.isMathNode)return this.isDeterministic(e.aNode)&&(!e.bNode||this.isDeterministic(e.bNode))&&(!e.cNode||this.isDeterministic(e.cNode));if(e.isOperatorNode)return this.isDeterministic(e.aNode)&&(!e.bNode||this.isDeterministic(e.bNode));if(e.isArrayNode){if(null!==e.values)for(const t of e.values)if(!this.isDeterministic(t))return!1;return!0}return!!e.isConstNode}getVaryingFromNode(e,t=null,r=e.getNodeType(this),s=null,i=null){const n=this.getDataFromNode(e,"any");let a=n.varying;if(void 0===a){const e=this.varyings,o=e.length;null===t&&(t="nodeVarying"+o),a=new o_(t,r,s,i),e.push(a),this.registerDeclaration(a),n.varying=a}return a}get namespace(){return this.context.namespace}getOutputNamespace(){return this.getNamespace("outputNode")}getNamespace(e=""){const t=this.namespace;let r;return r=t?e?t+"_"+e:t:e,r}registerDeclaration(e){const t=this.shaderStage,r=this.declarations[t]||(this.declarations[t]={}),s=this.getPropertyName(e);let i=1,n=s;for(;void 0!==r[n];)n=s+"_"+i++;i>1&&(e.name=n,console.warn(`THREE.TSL: Declaration name '${s}' of '${e.type}' already in use. Renamed to '${n}'.`)),r[n]=e}getCodeFromNode(e,t,r=this.shaderStage){const s=this.getDataFromNode(e);let i=s.code;if(void 0===i){const e=this.codes[r]||(this.codes[r]=[]),n=e.length;i=new u_("nodeCode"+n,t),e.push(i),s.code=i}return i}addFlowCodeHierarchy(e,t){const{flowCodes:r,flowCodeBlock:s}=this.getDataFromNode(e);let i=!0,n=t;for(;n;){if(!0===s.get(n)){i=!1;break}n=this.getDataFromNode(n).parentNodeBlock}if(i)for(const e of r)this.addLineFlowCode(e)}addLineFlowCodeBlock(e,t,r){const s=this.getDataFromNode(e),i=s.flowCodes||(s.flowCodes=[]),n=s.flowCodeBlock||(s.flowCodeBlock=new WeakMap);i.push(t),n.set(r,!0)}addLineFlowCode(e,t=null){return""===e||(null!==t&&this.context.nodeBlock&&this.addLineFlowCodeBlock(t,e,this.context.nodeBlock),e=this.tab+e,/;\s*$/.test(e)||(e+=";\n"),this.flow.code+=e),this}addFlowCode(e){return this.flow.code+=e,this}addFlowTab(){return this.tab+="\t",this}removeFlowTab(){return this.tab=this.tab.slice(0,-1),this}getFlowData(e){return this.flowsData.get(e)}flowNode(e){const t=e.getNodeType(this),r=this.flowChildNode(e,t);return this.flowsData.set(e,r),r}addInclude(e){null!==this.currentFunctionNode&&this.currentFunctionNode.includes.push(e)}buildFunctionNode(e){const t=new Rx,r=this.currentFunctionNode;return this.currentFunctionNode=t,t.code=this.buildFunctionCode(e),this.currentFunctionNode=r,t}flowShaderNode(e){const t=e.layout,r={[Symbol.iterator](){let e=0;const t=Object.values(this);return{next:()=>({value:t[e],done:e++>=t.length})}}};for(const e of t.inputs)r[e.name]=new Rf(e.type,e.name);e.layout=null;const s=e.call(r),i=this.flowStagesNode(s,t.type);return e.layout=t,i}flowStagesNode(e,t=null){const r=this.flow,s=this.vars,i=this.declarations,n=this.cache,a=this.buildStage,o=this.stack,u={code:""};this.flow=u,this.vars={},this.declarations={},this.cache=new d_,this.stack=Mf();for(const r of Gs)this.setBuildStage(r),u.result=e.build(this,t);return u.vars=this.getVars(this.shaderStage),this.flow=r,this.vars=s,this.declarations=i,this.cache=n,this.stack=o,this.setBuildStage(a),u}getFunctionOperator(){return null}buildFunctionCode(){console.warn("Abstract function.")}flowChildNode(e,t=null){const r=this.flow,s={code:""};return this.flow=s,s.result=e.build(this,t),this.flow=r,s}flowNodeFromShaderStage(e,t,r=null,s=null){const i=this.tab,n=this.cache,a=this.shaderStage,o=this.context;this.setShaderStage(e);const u={...this.context};delete u.nodeBlock,this.cache=this.globalCache,this.tab="\t",this.context=u;let l=null;if("generate"===this.buildStage){const i=this.flowChildNode(t,r);null!==s&&(i.code+=`${this.tab+s} = ${i.result};\n`),this.flowCode[e]=this.flowCode[e]+i.code,l=i}else l=t.build(this);return this.setShaderStage(a),this.cache=n,this.tab=i,this.context=o,l}getAttributesArray(){return this.attributes.concat(this.bufferAttributes)}getAttributes(){console.warn("Abstract function.")}getVaryings(){console.warn("Abstract function.")}getVar(e,t,r=null){return`${null!==r?this.generateArrayDeclaration(e,r):this.getType(e)} ${t}`}getVars(e){let t="";const r=this.vars[e];if(void 0!==r)for(const e of r)t+=`${this.getVar(e.type,e.name)}; `;return t}getUniforms(){console.warn("Abstract function.")}getCodes(e){const t=this.codes[e];let r="";if(void 0!==t)for(const e of t)r+=e.code+"\n";return r}getHash(){return this.vertexShader+this.fragmentShader+this.computeShader}setShaderStage(e){this.shaderStage=e}getShaderStage(){return this.shaderStage}setBuildStage(e){this.buildStage=e}getBuildStage(){return this.buildStage}buildCode(){console.warn("Abstract function.")}build(){const{object:e,material:t,renderer:r}=this;if(null!==t){let e=r.library.fromMaterial(t);null===e&&(console.error(`NodeMaterial: Material "${t.type}" is not compatible.`),e=new Wh),e.build(this)}else this.addFlow("compute",e);for(const e of Gs){this.setBuildStage(e),this.context.vertex&&this.context.vertex.isNode&&this.flowNodeFromShaderStage("vertex",this.context.vertex);for(const t of zs){this.setShaderStage(t);const r=this.flowNodes[t];for(const t of r)"generate"===e?this.flowNode(t):t.build(this)}}return this.setBuildStage(null),this.setShaderStage(null),this.buildCode(),this.buildUpdateNodes(),this}getNodeUniform(e,t){if("float"===t||"int"===t||"uint"===t)return new __(e);if("vec2"===t||"ivec2"===t||"uvec2"===t)return new v_(e);if("vec3"===t||"ivec3"===t||"uvec3"===t)return new N_(e);if("vec4"===t||"ivec4"===t||"uvec4"===t)return new S_(e);if("color"===t)return new E_(e);if("mat2"===t)return new w_(e);if("mat3"===t)return new A_(e);if("mat4"===t)return new R_(e);throw new Error(`Uniform "${t}" not declared.`)}format(e,t,r){if((t=this.getVectorType(t))===(r=this.getVectorType(r))||null===r||this.isReference(r))return e;const s=this.getTypeLength(t),i=this.getTypeLength(r);return 16===s&&9===i?`${this.getType(r)}( ${e}[ 0 ].xyz, ${e}[ 1 ].xyz, ${e}[ 2 ].xyz )`:9===s&&4===i?`${this.getType(r)}( ${e}[ 0 ].xy, ${e}[ 1 ].xy )`:s>4||i>4||0===i?e:s===i?`${this.getType(r)}( ${e} )`:s>i?(e="bool"===r?`all( ${e} )`:`${e}.${"xyz".slice(0,i)}`,this.format(e,this.getTypeFromLength(i,this.getComponentType(t)),r)):4===i&&s>1?`${this.getType(r)}( ${this.format(e,t,"vec3")}, 1.0 )`:2===s?`${this.getType(r)}( ${this.format(e,t,"vec2")}, 0.0 )`:(1===s&&i>1&&t!==this.getComponentType(r)&&(e=`${this.getType(this.getComponentType(r))}( ${e} )`),`${this.getType(r)}( ${e} )`)}getSignature(){return`// Three.js r${He} - Node System\n`}*[Symbol.iterator](){}createNodeMaterial(e="NodeMaterial"){throw new Error(`THREE.NodeBuilder: createNodeMaterial() was deprecated. Use new ${e}() instead.`)}}class L_{constructor(){this.time=0,this.deltaTime=0,this.frameId=0,this.renderId=0,this.updateMap=new WeakMap,this.updateBeforeMap=new WeakMap,this.updateAfterMap=new WeakMap,this.renderer=null,this.material=null,this.camera=null,this.object=null,this.scene=null}_getMaps(e,t){let r=e.get(t);return void 0===r&&(r={renderMap:new WeakMap,frameMap:new WeakMap},e.set(t,r)),r}updateBeforeNode(e){const t=e.getUpdateBeforeType(),r=e.updateReference(this);if(t===Vs.FRAME){const{frameMap:t}=this._getMaps(this.updateBeforeMap,r);t.get(r)!==this.frameId&&!1!==e.updateBefore(this)&&t.set(r,this.frameId)}else if(t===Vs.RENDER){const{renderMap:t}=this._getMaps(this.updateBeforeMap,r);t.get(r)!==this.renderId&&!1!==e.updateBefore(this)&&t.set(r,this.renderId)}else t===Vs.OBJECT&&e.updateBefore(this)}updateAfterNode(e){const t=e.getUpdateAfterType(),r=e.updateReference(this);if(t===Vs.FRAME){const{frameMap:t}=this._getMaps(this.updateAfterMap,r);t.get(r)!==this.frameId&&!1!==e.updateAfter(this)&&t.set(r,this.frameId)}else if(t===Vs.RENDER){const{renderMap:t}=this._getMaps(this.updateAfterMap,r);t.get(r)!==this.renderId&&!1!==e.updateAfter(this)&&t.set(r,this.renderId)}else t===Vs.OBJECT&&e.updateAfter(this)}updateNode(e){const t=e.getUpdateType(),r=e.updateReference(this);if(t===Vs.FRAME){const{frameMap:t}=this._getMaps(this.updateMap,r);t.get(r)!==this.frameId&&!1!==e.update(this)&&t.set(r,this.frameId)}else if(t===Vs.RENDER){const{renderMap:t}=this._getMaps(this.updateMap,r);t.get(r)!==this.renderId&&!1!==e.update(this)&&t.set(r,this.renderId)}else t===Vs.OBJECT&&e.update(this)}update(){this.frameId++,void 0===this.lastTime&&(this.lastTime=performance.now()),this.deltaTime=(performance.now()-this.lastTime)/1e3,this.lastTime=performance.now(),this.time+=this.deltaTime}}class B_{constructor(e,t,r=null,s="",i=!1){this.type=e,this.name=t,this.count=r,this.qualifier=s,this.isConst=i}}B_.isNodeFunctionInput=!0;class I_ extends eT{static get type(){return"DirectionalLightNode"}constructor(e=null){super(e)}setupDirect(){const e=this.colorNode;return{lightDirection:cb(this.light),lightColor:e}}}const D_=new a,V_=new a;let U_=null;class O_ extends eT{static get type(){return"RectAreaLightNode"}constructor(e=null){super(e),this.halfHeight=Zn(new r).setGroup(Kn),this.halfWidth=Zn(new r).setGroup(Kn),this.updateType=Vs.RENDER}update(e){super.update(e);const{light:t}=this,r=e.camera.matrixWorldInverse;V_.identity(),D_.copy(t.matrixWorld),D_.premultiply(r),V_.extractRotation(D_),this.halfWidth.value.set(.5*t.width,0,0),this.halfHeight.value.set(0,.5*t.height,0),this.halfWidth.value.applyMatrix4(V_),this.halfHeight.value.applyMatrix4(V_)}setupDirectRectArea(e){let t,r;e.isAvailable("float32Filterable")?(t=Zu(U_.LTC_FLOAT_1),r=Zu(U_.LTC_FLOAT_2)):(t=Zu(U_.LTC_HALF_1),r=Zu(U_.LTC_HALF_2));const{colorNode:s,light:i}=this;return{lightColor:s,lightPosition:db(i),halfWidth:this.halfWidth,halfHeight:this.halfHeight,ltc_1:t,ltc_2:r}}static setLTC(e){U_=e}}class k_ extends eT{static get type(){return"SpotLightNode"}constructor(e=null){super(e),this.coneCosNode=Zn(0).setGroup(Kn),this.penumbraCosNode=Zn(0).setGroup(Kn),this.cutoffDistanceNode=Zn(0).setGroup(Kn),this.decayExponentNode=Zn(0).setGroup(Kn),this.colorNode=Zn(this.color).setGroup(Kn)}update(e){super.update(e);const{light:t}=this;this.coneCosNode.value=Math.cos(t.angle),this.penumbraCosNode.value=Math.cos(t.angle*(1-t.penumbra)),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}getSpotAttenuation(e,t){const{coneCosNode:r,penumbraCosNode:s}=this;return Oo(r,s,t)}getLightCoord(e){const t=e.getNodeProperties(this);let r=t.projectionUV;return void 0===r&&(r=ob(this.light,e.context.positionWorld),t.projectionUV=r),r}setupDirect(e){const{colorNode:t,cutoffDistanceNode:r,decayExponentNode:s,light:i}=this,n=this.getLightVector(e),a=n.normalize(),o=a.dot(cb(i)),u=this.getSpotAttenuation(e,o),l=n.length(),d=tT({lightDistance:l,cutoffDistance:r,decayExponent:s});let c,h,p=t.mul(u).mul(d);if(i.colorNode?(h=this.getLightCoord(e),c=i.colorNode(h)):i.map&&(h=this.getLightCoord(e),c=Zu(i.map,h.xy).onRenderUpdate((()=>i.map))),c){p=h.mul(2).sub(1).abs().lessThan(1).all().select(p.mul(c),p)}return{lightColor:p,lightDirection:a}}}class G_ extends k_{static get type(){return"IESSpotLightNode"}getSpotAttenuation(e,t){const r=this.light.iesMap;let s=null;if(r&&!0===r.isTexture){const e=t.acos().mul(1/Math.PI);s=Zu(r,Yi(e,0),0).r}else s=super.getSpotAttenuation(t);return s}}const z_=ki((([e,t])=>{const r=e.abs().sub(t);return oo(_o(r,0)).add(To(_o(r.x,r.y),0))}));class H_ extends k_{static get type(){return"ProjectorLightNode"}update(e){super.update(e);const t=this.light;if(this.penumbraCosNode.value=Math.min(Math.cos(t.angle*(1-t.penumbra)),.99999),null===t.aspect){let e=1;null!==t.map&&(e=t.map.width/t.map.height),t.shadow.aspect=e}else t.shadow.aspect=t.aspect}getSpotAttenuation(e){const t=this.penumbraCosNode,r=this.getLightCoord(e),s=r.xyz.div(r.w),i=z_(s.xy.sub(Yi(.5)),Yi(.5)),n=da(-1,ua(1,so(t)).sub(1));return Vo(i.mul(-2).mul(n))}}class $_ extends eT{static get type(){return"AmbientLightNode"}constructor(e=null){super(e)}setup({context:e}){e.irradiance.addAssign(this.colorNode)}}class W_ extends eT{static get type(){return"HemisphereLightNode"}constructor(t=null){super(t),this.lightPositionNode=ub(t),this.lightDirectionNode=this.lightPositionNode.normalize(),this.groundColorNode=Zn(new e).setGroup(Kn)}update(e){const{light:t}=this;super.update(e),this.lightPositionNode.object3d=t,this.groundColorNode.value.copy(t.groundColor).multiplyScalar(t.intensity)}setup(e){const{colorNode:t,groundColorNode:r,lightDirectionNode:s}=this,i=Yl.dot(s).mul(.5).add(.5),n=Io(r,t,i);e.context.irradiance.addAssign(n)}}class j_ extends eT{static get type(){return"LightProbeNode"}constructor(e=null){super(e);const t=[];for(let e=0;e<9;e++)t.push(new r);this.lightProbe=il(t)}update(e){const{light:t}=this;super.update(e);for(let e=0;e<9;e++)this.lightProbe.array[e].copy(t.sh.coefficients[e]).multiplyScalar(t.intensity)}setup(e){const t=QT(Yl,this.lightProbe);e.context.irradiance.addAssign(t)}}class q_{parseFunction(){console.warn("Abstract function.")}}class X_{constructor(e,t,r="",s=""){this.type=e,this.inputs=t,this.name=r,this.precision=s}getCode(){console.warn("Abstract function.")}}X_.isNodeFunction=!0;const K_=/^\s*(highp|mediump|lowp)?\s*([a-z_0-9]+)\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)/i,Y_=/[a-z_0-9]+/gi,Q_="#pragma main";class Z_ extends X_{constructor(e){const{type:t,inputs:r,name:s,precision:i,inputsCode:n,blockCode:a,headerCode:o}=(e=>{const t=(e=e.trim()).indexOf(Q_),r=-1!==t?e.slice(t+12):e,s=r.match(K_);if(null!==s&&5===s.length){const i=s[4],n=[];let a=null;for(;null!==(a=Y_.exec(i));)n.push(a);const o=[];let u=0;for(;u0||e.backgroundBlurriness>0&&0===t.backgroundBlurriness;if(t.background!==r||s){const i=this.getCacheNode("background",r,(()=>{if(!0===r.isCubeTexture||r.mapping===Q||r.mapping===Z||r.mapping===ce){if(e.backgroundBlurriness>0||r.mapping===ce)return um(r);{let e;return e=!0===r.isCubeTexture?gd(r):Zu(r),cp(e)}}if(!0===r.isTexture)return Zu(r,ph.flipY()).setUpdateMatrix(!0);!0!==r.isColor&&console.error("WebGPUNodes: Unsupported background configuration.",r)}),s);t.backgroundNode=i,t.background=r,t.backgroundBlurriness=e.backgroundBlurriness}}else t.backgroundNode&&(delete t.backgroundNode,delete t.background)}getCacheNode(e,t,r,s=!1){const i=this.cacheLib[e]||(this.cacheLib[e]=new WeakMap);let n=i.get(t);return(void 0===n||s)&&(n=r(),i.set(t,n)),n}updateFog(e){const t=this.get(e),r=e.fog;if(r){if(t.fog!==r){const e=this.getCacheNode("fog",r,(()=>{if(r.isFogExp2){const e=yd("color","color",r).setGroup(Kn),t=yd("density","float",r).setGroup(Kn);return kx(e,Ox(t))}if(r.isFog){const e=yd("color","color",r).setGroup(Kn),t=yd("near","float",r).setGroup(Kn),s=yd("far","float",r).setGroup(Kn);return kx(e,Ux(t,s))}console.error("THREE.Renderer: Unsupported fog configuration.",r)}));t.fogNode=e,t.fog=r}}else delete t.fogNode,delete t.fog}updateEnvironment(e){const t=this.get(e),r=e.environment;if(r){if(t.environment!==r){const e=this.getCacheNode("environment",r,(()=>!0===r.isCubeTexture?gd(r):!0===r.isTexture?Zu(r):void console.error("Nodes: Unsupported environment configuration.",r)));t.environmentNode=e,t.environment=r}}else t.environmentNode&&(delete t.environmentNode,delete t.environment)}getNodeFrame(e=this.renderer,t=null,r=null,s=null,i=null){const n=this.nodeFrame;return n.renderer=e,n.scene=t,n.object=r,n.camera=s,n.material=i,n}getNodeFrameForRender(e){return this.getNodeFrame(e.renderer,e.scene,e.object,e.camera,e.material)}getOutputCacheKey(){const e=this.renderer;return e.toneMapping+","+e.currentColorSpace+","+e.xr.isPresenting}hasOutputChange(e){return ev.get(e)!==this.getOutputCacheKey()}getOutputNode(e){const t=this.renderer,r=this.getOutputCacheKey(),s=e.isArrayTexture?Hy(e,en(ph,nl("gl_ViewID_OVR"))).renderOutput(t.toneMapping,t.currentColorSpace):Zu(e,ph).renderOutput(t.toneMapping,t.currentColorSpace);return ev.set(e,r),s}updateBefore(e){const t=e.getNodeBuilderState();for(const r of t.updateBeforeNodes)this.getNodeFrameForRender(e).updateBeforeNode(r)}updateAfter(e){const t=e.getNodeBuilderState();for(const r of t.updateAfterNodes)this.getNodeFrameForRender(e).updateAfterNode(r)}updateForCompute(e){const t=this.getNodeFrame(),r=this.getForCompute(e);for(const e of r.updateNodes)t.updateNode(e)}updateForRender(e){const t=this.getNodeFrameForRender(e),r=e.getNodeBuilderState();for(const e of r.updateNodes)t.updateNode(e)}needsRefresh(e){const t=this.getNodeFrameForRender(e);return e.getMonitor().needsRefresh(e,t)}dispose(){super.dispose(),this.nodeFrame=new L_,this.nodeBuilderCache=new Map,this.cacheLib={}}}const iv=new Me;class nv{constructor(e=null){this.version=0,this.clipIntersection=null,this.cacheKey="",this.shadowPass=!1,this.viewNormalMatrix=new n,this.clippingGroupContexts=new WeakMap,this.intersectionPlanes=[],this.unionPlanes=[],this.parentVersion=null,null!==e&&(this.viewNormalMatrix=e.viewNormalMatrix,this.clippingGroupContexts=e.clippingGroupContexts,this.shadowPass=e.shadowPass,this.viewMatrix=e.viewMatrix)}projectPlanes(e,t,r){const s=e.length;for(let i=0;i0,alpha:!0,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:this.getFramebufferScaleFactor()},i=new XRWebGLLayer(e,s,r);this._glBaseLayer=i,e.updateRenderState({baseLayer:i}),t.setPixelRatio(1),t._setXRLayerSize(i.framebufferWidth,i.framebufferHeight),this._xrRenderTarget=new pv(i.framebufferWidth,i.framebufferHeight,{format:le,type:Ce,colorSpace:t.outputColorSpace,stencilBuffer:t.stencil,resolveDepthBuffer:!1===i.ignoreDepthValues,resolveStencilBuffer:!1===i.ignoreDepthValues}),this._xrRenderTarget._isOpaqueFramebuffer=!0,this._referenceSpace=await e.requestReferenceSpace(this.getReferenceSpaceType())}this.setFoveation(this.getFoveation()),t._animation.setAnimationLoop(this._onAnimationFrame),t._animation.setContext(e),t._animation.start(),this.isPresenting=!0,this.dispatchEvent({type:"sessionstart"})}}updateCamera(e){const t=this._session;if(null===t)return;const r=e.near,s=e.far,i=this._cameraXR,n=this._cameraL,a=this._cameraR;i.near=a.near=n.near=r,i.far=a.far=n.far=s,i.isMultiViewCamera=this._useMultiview,this._currentDepthNear===i.near&&this._currentDepthFar===i.far||(t.updateRenderState({depthNear:i.near,depthFar:i.far}),this._currentDepthNear=i.near,this._currentDepthFar=i.far),n.layers.mask=2|e.layers.mask,a.layers.mask=4|e.layers.mask,i.layers.mask=n.layers.mask|a.layers.mask;const o=e.parent,u=i.cameras;yv(i,o);for(let e=0;e=0&&(r[n]=null,t[n].disconnect(i))}for(let s=0;s=r.length){r.push(i),n=e;break}if(null===r[e]){r[e]=i,n=e;break}}if(-1===n)break}const a=t[n];a&&a.connect(i)}}function _v(e){return"quad"===e.type?this._glBinding.createQuadLayer({transform:new XRRigidTransform(e.translation,e.quaternion),width:e.width/2,height:e.height/2,space:this._referenceSpace,viewPixelWidth:e.pixelwidth,viewPixelHeight:e.pixelheight,clearOnAccess:!1}):this._glBinding.createCylinderLayer({transform:new XRRigidTransform(e.translation,e.quaternion),radius:e.radius,centralAngle:e.centralAngle,aspectRatio:e.aspectRatio,space:this._referenceSpace,viewPixelWidth:e.pixelwidth,viewPixelHeight:e.pixelheight,clearOnAccess:!1})}function vv(e,t){if(void 0===t)return;const r=this._cameraXR,i=this._renderer,n=i.backend,a=this._glBaseLayer,o=this.getReferenceSpace(),u=t.getViewerPose(o);if(this._xrFrame=t,null!==u){const e=u.views;null!==this._glBaseLayer&&n.setXRTarget(a.framebuffer);let t=!1;e.length!==r.cameras.length&&(r.cameras.length=0,t=!0);for(let i=0;i{await this.compileAsync(e,t);const s=this._renderLists.get(e,t),i=this._renderContexts.get(e,t,this._renderTarget),n=e.overrideMaterial||r.material,a=this._objects.get(r,n,e,t,s.lightsNode,i,i.clippingContext),{fragmentShader:o,vertexShader:u}=a.getNodeBuilderState();return{fragmentShader:o,vertexShader:u}}}}async init(){if(this._initialized)throw new Error("Renderer: Backend has already been initialized.");return null!==this._initPromise||(this._initPromise=new Promise((async(e,t)=>{let r=this.backend;try{await r.init(this)}catch(e){if(null===this._getFallback)return void t(e);try{this.backend=r=this._getFallback(e),await r.init(this)}catch(e){return void t(e)}}this._nodes=new sv(this,r),this._animation=new Gm(this._nodes,this.info),this._attributes=new Jm(r),this._background=new e_(this,this._nodes),this._geometries=new rf(this._attributes,this.info),this._textures=new wf(this,r,this.info),this._pipelines=new df(r,this._nodes),this._bindings=new cf(r,this._nodes,this._textures,this._attributes,this._pipelines,this.info),this._objects=new jm(this,this._nodes,this._geometries,this._pipelines,this._bindings,this.info),this._renderLists=new yf(this.lighting),this._bundles=new uv,this._renderContexts=new Sf,this._animation.start(),this._initialized=!0,e(this)}))),this._initPromise}get coordinateSystem(){return this.backend.coordinateSystem}async compileAsync(e,t,r=null){if(!0===this._isDeviceLost)return;!1===this._initialized&&await this.init();const s=this._nodes.nodeFrame,i=s.renderId,n=this._currentRenderContext,a=this._currentRenderObjectFunction,o=this._compilationPromises,u=!0===e.isScene?e:Nv;null===r&&(r=e);const l=this._renderTarget,d=this._renderContexts.get(r,t,l),c=this._activeMipmapLevel,h=[];this._currentRenderContext=d,this._currentRenderObjectFunction=this.renderObject,this._handleObjectFunction=this._createObjectPipeline,this._compilationPromises=h,s.renderId++,s.update(),d.depth=this.depth,d.stencil=this.stencil,d.clippingContext||(d.clippingContext=new nv),d.clippingContext.updateGlobal(u,t),u.onBeforeRender(this,e,t,l);const p=this._renderLists.get(e,t);if(p.begin(),this._projectObject(e,t,0,p,d.clippingContext),r!==e&&r.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&p.pushLight(e)})),p.finish(),null!==l){this._textures.updateRenderTarget(l,c);const e=this._textures.get(l);d.textures=e.textures,d.depthTexture=e.depthTexture}else d.textures=null,d.depthTexture=null;this._background.update(u,p,d);const g=p.opaque,m=p.transparent,f=p.transparentDoublePass,y=p.lightsNode;!0===this.opaque&&g.length>0&&this._renderObjects(g,t,u,y),!0===this.transparent&&m.length>0&&this._renderTransparents(m,f,t,u,y),s.renderId=i,this._currentRenderContext=n,this._currentRenderObjectFunction=a,this._compilationPromises=o,this._handleObjectFunction=this._renderObjectDirect,await Promise.all(h)}async renderAsync(e,t){!1===this._initialized&&await this.init(),this._renderScene(e,t)}async waitForGPU(){await this.backend.waitForGPU()}set highPrecision(e){!0===e?(this.overrideNodes.modelViewMatrix=Bl,this.overrideNodes.modelNormalViewMatrix=Il):this.highPrecision&&(this.overrideNodes.modelViewMatrix=null,this.overrideNodes.modelNormalViewMatrix=null)}get highPrecision(){return this.overrideNodes.modelViewMatrix===Bl&&this.overrideNodes.modelNormalViewMatrix===Il}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}getColorBufferType(){return this._colorBufferType}_onDeviceLost(e){let t=`THREE.WebGPURenderer: ${e.api} Device Lost:\n\nMessage: ${e.message}`;e.reason&&(t+=`\nReason: ${e.reason}`),console.error(t),this._isDeviceLost=!0}_renderBundle(e,t,r){const{bundleGroup:s,camera:i,renderList:n}=e,a=this._currentRenderContext,o=this._bundles.get(s,i),u=this.backend.get(o);void 0===u.renderContexts&&(u.renderContexts=new Set);const l=s.version!==u.version,d=!1===u.renderContexts.has(a)||l;if(u.renderContexts.add(a),d){this.backend.beginBundle(a),(void 0===u.renderObjects||l)&&(u.renderObjects=[]),this._currentRenderBundle=o;const{transparentDoublePass:e,transparent:d,opaque:c}=n;!0===this.opaque&&c.length>0&&this._renderObjects(c,i,t,r),!0===this.transparent&&d.length>0&&this._renderTransparents(d,e,i,t,r),this._currentRenderBundle=null,this.backend.finishBundle(a,o),u.version=s.version}else{const{renderObjects:e}=u;for(let t=0,r=e.length;t>=c,p.viewportValue.height>>=c,p.viewportValue.minDepth=b,p.viewportValue.maxDepth=T,p.viewport=!1===p.viewportValue.equals(Ev),p.scissorValue.copy(y).multiplyScalar(x).floor(),p.scissor=this._scissorTest&&!1===p.scissorValue.equals(Ev),p.scissorValue.width>>=c,p.scissorValue.height>>=c,p.clippingContext||(p.clippingContext=new nv),p.clippingContext.updateGlobal(u,t),u.onBeforeRender(this,e,t,h);const _=t.isArrayCamera?Av:wv;t.isArrayCamera||(Rv.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),_.setFromProjectionMatrix(Rv,g));const v=this._renderLists.get(e,t);if(v.begin(),this._projectObject(e,t,0,v,p.clippingContext),v.finish(),!0===this.sortObjects&&v.sort(this._opaqueSort,this._transparentSort),null!==h){this._textures.updateRenderTarget(h,c);const e=this._textures.get(h);p.textures=e.textures,p.depthTexture=e.depthTexture,p.width=e.width,p.height=e.height,p.renderTarget=h,p.depth=h.depthBuffer,p.stencil=h.stencilBuffer}else p.textures=null,p.depthTexture=null,p.width=this.domElement.width,p.height=this.domElement.height,p.depth=this.depth,p.stencil=this.stencil;p.width>>=c,p.height>>=c,p.activeCubeFace=d,p.activeMipmapLevel=c,p.occlusionQueryCount=v.occlusionQueryCount,this._background.update(u,v,p),p.camera=t,this.backend.beginRender(p);const{bundles:N,lightsNode:S,transparentDoublePass:E,transparent:w,opaque:A}=v;return N.length>0&&this._renderBundles(N,u,S),!0===this.opaque&&A.length>0&&this._renderObjects(A,t,u,S),!0===this.transparent&&w.length>0&&this._renderTransparents(w,E,t,u,S),this.backend.finishRender(p),i.renderId=n,this._currentRenderContext=a,this._currentRenderObjectFunction=o,null!==s&&(this.setRenderTarget(l,d,c),this._renderOutput(h)),u.onAfterRender(this,e,t,h),p}_setXRLayerSize(e,t){this._width=e,this._height=t,this.setViewport(0,0,e,t)}_renderOutput(e){const t=this._quad;this._nodes.hasOutputChange(e.texture)&&(t.material.fragmentNode=this._nodes.getOutputNode(e.texture),t.material.needsUpdate=!0);const r=this.autoClear,s=this.xr.enabled;this.autoClear=!1,this.xr.enabled=!1,this._renderScene(t,t.camera,!1),this.autoClear=r,this.xr.enabled=s}getMaxAnisotropy(){return this.backend.getMaxAnisotropy()}getActiveCubeFace(){return this._activeCubeFace}getActiveMipmapLevel(){return this._activeMipmapLevel}async setAnimationLoop(e){!1===this._initialized&&await this.init(),this._animation.setAnimationLoop(e)}async getArrayBufferAsync(e){return await this.backend.getArrayBufferAsync(e)}getContext(){return this.backend.getContext()}getPixelRatio(){return this._pixelRatio}getDrawingBufferSize(e){return e.set(this._width*this._pixelRatio,this._height*this._pixelRatio).floor()}getSize(e){return e.set(this._width,this._height)}setPixelRatio(e=1){this._pixelRatio!==e&&(this._pixelRatio=e,this.setSize(this._width,this._height,!1))}setDrawingBufferSize(e,t,r){this.xr&&this.xr.isPresenting||(this._width=e,this._height=t,this._pixelRatio=r,this.domElement.width=Math.floor(e*r),this.domElement.height=Math.floor(t*r),this.setViewport(0,0,e,t),this._initialized&&this.backend.updateSize())}setSize(e,t,r=!0){this.xr&&this.xr.isPresenting||(this._width=e,this._height=t,this.domElement.width=Math.floor(e*this._pixelRatio),this.domElement.height=Math.floor(t*this._pixelRatio),!0===r&&(this.domElement.style.width=e+"px",this.domElement.style.height=t+"px"),this.setViewport(0,0,e,t),this._initialized&&this.backend.updateSize())}setOpaqueSort(e){this._opaqueSort=e}setTransparentSort(e){this._transparentSort=e}getScissor(e){const t=this._scissor;return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e}setScissor(e,t,r,s){const i=this._scissor;e.isVector4?i.copy(e):i.set(e,t,r,s)}getScissorTest(){return this._scissorTest}setScissorTest(e){this._scissorTest=e,this.backend.setScissorTest(e)}getViewport(e){return e.copy(this._viewport)}setViewport(e,t,r,s,i=0,n=1){const a=this._viewport;e.isVector4?a.copy(e):a.set(e,t,r,s),a.minDepth=i,a.maxDepth=n}getClearColor(e){return e.copy(this._clearColor)}setClearColor(e,t=1){this._clearColor.set(e),this._clearColor.a=t}getClearAlpha(){return this._clearColor.a}setClearAlpha(e){this._clearColor.a=e}getClearDepth(){return this._clearDepth}setClearDepth(e){this._clearDepth=e}getClearStencil(){return this._clearStencil}setClearStencil(e){this._clearStencil=e}isOccluded(e){const t=this._currentRenderContext;return t&&this.backend.isOccluded(t,e)}clear(e=!0,t=!0,r=!0){if(!1===this._initialized)return console.warn("THREE.Renderer: .clear() called before the backend is initialized. Try using .clearAsync() instead."),this.clearAsync(e,t,r);const s=this._renderTarget||this._getFrameBufferTarget();let i=null;if(null!==s){this._textures.updateRenderTarget(s);const e=this._textures.get(s);i=this._renderContexts.getForClear(s),i.textures=e.textures,i.depthTexture=e.depthTexture,i.width=e.width,i.height=e.height,i.renderTarget=s,i.depth=s.depthBuffer,i.stencil=s.stencilBuffer,i.clearColorValue=this.backend.getClearColor(),i.activeCubeFace=this.getActiveCubeFace(),i.activeMipmapLevel=this.getActiveMipmapLevel()}this.backend.clear(e,t,r,i),null!==s&&null===this._renderTarget&&this._renderOutput(s)}clearColor(){return this.clear(!0,!1,!1)}clearDepth(){return this.clear(!1,!0,!1)}clearStencil(){return this.clear(!1,!1,!0)}async clearAsync(e=!0,t=!0,r=!0){!1===this._initialized&&await this.init(),this.clear(e,t,r)}async clearColorAsync(){this.clearAsync(!0,!1,!1)}async clearDepthAsync(){this.clearAsync(!1,!0,!1)}async clearStencilAsync(){this.clearAsync(!1,!1,!0)}get currentToneMapping(){return this.isOutputTarget?this.toneMapping:p}get currentColorSpace(){return this.isOutputTarget?this.outputColorSpace:ue}get isOutputTarget(){return this._renderTarget===this._outputRenderTarget||null===this._renderTarget}dispose(){this.info.dispose(),this.backend.dispose(),this._animation.dispose(),this._objects.dispose(),this._pipelines.dispose(),this._nodes.dispose(),this._bindings.dispose(),this._renderLists.dispose(),this._renderContexts.dispose(),this._textures.dispose(),null!==this._frameBufferTarget&&this._frameBufferTarget.dispose(),Object.values(this.backend.timestampQueryPool).forEach((e=>{null!==e&&e.dispose()})),this.setRenderTarget(null),this.setAnimationLoop(null)}setRenderTarget(e,t=0,r=0){this._renderTarget=e,this._activeCubeFace=t,this._activeMipmapLevel=r}getRenderTarget(){return this._renderTarget}setOutputRenderTarget(e){this._outputRenderTarget=e}getOutputRenderTarget(){return this._outputRenderTarget}_resetXRState(){this.backend.setXRTarget(null),this.setOutputRenderTarget(null),this.setRenderTarget(null),this._frameBufferTarget.dispose(),this._frameBufferTarget=null}setRenderObjectFunction(e){this._renderObjectFunction=e}getRenderObjectFunction(){return this._renderObjectFunction}compute(e){if(!0===this._isDeviceLost)return;if(!1===this._initialized)return console.warn("THREE.Renderer: .compute() called before the backend is initialized. Try using .computeAsync() instead."),this.computeAsync(e);const t=this._nodes.nodeFrame,r=t.renderId;this.info.calls++,this.info.compute.calls++,this.info.compute.frameCalls++,t.renderId=this.info.calls;const s=this.backend,i=this._pipelines,n=this._bindings,a=this._nodes,o=Array.isArray(e)?e:[e];if(void 0===o[0]||!0!==o[0].isComputeNode)throw new Error("THREE.Renderer: .compute() expects a ComputeNode.");s.beginCompute(e);for(const t of o){if(!1===i.has(t)){const e=()=>{t.removeEventListener("dispose",e),i.delete(t),n.delete(t),a.delete(t)};t.addEventListener("dispose",e);const r=t.onInitFunction;null!==r&&r.call(t,{renderer:this})}a.updateForCompute(t),n.updateForCompute(t);const r=n.getForCompute(t),o=i.getForCompute(t,r);s.compute(e,t,r,o)}s.finishCompute(e),t.renderId=r}async computeAsync(e){!1===this._initialized&&await this.init(),this.compute(e)}async hasFeatureAsync(e){return!1===this._initialized&&await this.init(),this.backend.hasFeature(e)}async resolveTimestampsAsync(e="render"){return!1===this._initialized&&await this.init(),this.backend.resolveTimestampsAsync(e)}hasFeature(e){return!1===this._initialized?(console.warn("THREE.Renderer: .hasFeature() called before the backend is initialized. Try using .hasFeatureAsync() instead."),!1):this.backend.hasFeature(e)}hasInitialized(){return this._initialized}async initTextureAsync(e){!1===this._initialized&&await this.init(),this._textures.updateTexture(e)}initTexture(e){!1===this._initialized&&console.warn("THREE.Renderer: .initTexture() called before the backend is initialized. Try using .initTextureAsync() instead."),this._textures.updateTexture(e)}copyFramebufferToTexture(e,t=null){if(null!==t)if(t.isVector2)t=Cv.set(t.x,t.y,e.image.width,e.image.height).floor();else{if(!t.isVector4)return void console.error("THREE.Renderer.copyFramebufferToTexture: Invalid rectangle.");t=Cv.copy(t).floor()}else t=Cv.set(0,0,e.image.width,e.image.height);let r,s=this._currentRenderContext;null!==s?r=s.renderTarget:(r=this._renderTarget||this._getFrameBufferTarget(),null!==r&&(this._textures.updateRenderTarget(r),s=this._textures.get(r))),this._textures.updateTexture(e,{renderTarget:r}),this.backend.copyFramebufferToTexture(e,s,t)}copyTextureToTexture(e,t,r=null,s=null,i=0,n=0){this._textures.updateTexture(e),this._textures.updateTexture(t),this.backend.copyTextureToTexture(e,t,r,s,i,n)}async readRenderTargetPixelsAsync(e,t,r,s,i,n=0,a=0){return this.backend.copyTextureToBuffer(e.textures[n],t,r,s,i,a)}_projectObject(e,t,r,s,i){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)r=e.renderOrder,e.isClippingGroup&&e.enabled&&(i=i.getGroupContext(e));else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)s.pushLight(e);else if(e.isSprite){const n=t.isArrayCamera?Av:wv;if(!e.frustumCulled||n.intersectsSprite(e,t)){!0===this.sortObjects&&Cv.setFromMatrixPosition(e.matrixWorld).applyMatrix4(Rv);const{geometry:t,material:n}=e;n.visible&&s.push(e,t,n,r,Cv.z,null,i)}}else if(e.isLineLoop)console.error("THREE.Renderer: Objects of type THREE.LineLoop are not supported. Please use THREE.Line or THREE.LineSegments.");else if(e.isMesh||e.isLine||e.isPoints){const n=t.isArrayCamera?Av:wv;if(!e.frustumCulled||n.intersectsObject(e,t)){const{geometry:t,material:n}=e;if(!0===this.sortObjects&&(null===t.boundingSphere&&t.computeBoundingSphere(),Cv.copy(t.boundingSphere.center).applyMatrix4(e.matrixWorld).applyMatrix4(Rv)),Array.isArray(n)){const a=t.groups;for(let o=0,u=a.length;o0){for(const{material:e}of t)e.side=S;this._renderObjects(t,r,s,i,"backSide");for(const{material:e}of t)e.side=je;this._renderObjects(e,r,s,i);for(const{material:e}of t)e.side=Se}else this._renderObjects(e,r,s,i)}_renderObjects(e,t,r,s,i=null){for(let n=0,a=e.length;n0,e.isShadowPassMaterial&&(e.side=null===i.shadowSide?i.side:i.shadowSide,i.depthNode&&i.depthNode.isNode&&(c=e.depthNode,e.depthNode=i.depthNode),i.castShadowNode&&i.castShadowNode.isNode&&(d=e.colorNode,e.colorNode=i.castShadowNode),i.castShadowPositionNode&&i.castShadowPositionNode.isNode&&(l=e.positionNode,e.positionNode=i.castShadowPositionNode)),i=e}!0===i.transparent&&i.side===Se&&!1===i.forceSinglePass?(i.side=S,this._handleObjectFunction(e,i,t,r,a,n,o,"backSide"),i.side=je,this._handleObjectFunction(e,i,t,r,a,n,o,u),i.side=Se):this._handleObjectFunction(e,i,t,r,a,n,o,u),void 0!==l&&(t.overrideMaterial.positionNode=l),void 0!==c&&(t.overrideMaterial.depthNode=c),void 0!==d&&(t.overrideMaterial.colorNode=d),e.onAfterRender(this,t,r,s,i,n)}_renderObjectDirect(e,t,r,s,i,n,a,o){const u=this._objects.get(e,t,r,s,i,this._currentRenderContext,a,o);u.drawRange=e.geometry.drawRange,u.group=n;const l=this._nodes.needsRefresh(u);if(l&&(this._nodes.updateBefore(u),this._geometries.updateForRender(u),this._nodes.updateForRender(u),this._bindings.updateForRender(u)),this._pipelines.updateForRender(u),null!==this._currentRenderBundle){this.backend.get(this._currentRenderBundle).renderObjects.push(u),u.bundle=this._currentRenderBundle.bundleGroup}this.backend.draw(u,this.info),l&&this._nodes.updateAfter(u)}_createObjectPipeline(e,t,r,s,i,n,a,o){const u=this._objects.get(e,t,r,s,i,this._currentRenderContext,a,o);u.drawRange=e.geometry.drawRange,u.group=n,this._nodes.updateBefore(u),this._geometries.updateForRender(u),this._nodes.updateForRender(u),this._bindings.updateForRender(u),this._pipelines.getForRender(u,this._compilationPromises),this._nodes.updateAfter(u)}get compile(){return this.compileAsync}}class Pv{constructor(e=""){this.name=e,this.visibility=0}setVisibility(e){this.visibility|=e}clone(){return Object.assign(new this.constructor,this)}}class Fv extends Pv{constructor(e,t=null){super(e),this.isBuffer=!0,this.bytesPerElement=Float32Array.BYTES_PER_ELEMENT,this._buffer=t}get byteLength(){return(e=this._buffer.byteLength)+(Zm-e%Zm)%Zm;var e}get buffer(){return this._buffer}update(){return!0}}class Lv extends Fv{constructor(e,t=null){super(e,t),this.isUniformBuffer=!0}}let Bv=0;class Iv extends Lv{constructor(e,t){super("UniformBuffer_"+Bv++,e?e.value:null),this.nodeUniform=e,this.groupNode=t}get buffer(){return this.nodeUniform.value}}class Dv extends Lv{constructor(e){super(e),this.isUniformsGroup=!0,this._values=null,this.uniforms=[]}addUniform(e){return this.uniforms.push(e),this}removeUniform(e){const t=this.uniforms.indexOf(e);return-1!==t&&this.uniforms.splice(t,1),this}get values(){return null===this._values&&(this._values=Array.from(this.buffer)),this._values}get buffer(){let e=this._buffer;if(null===e){const t=this.byteLength;e=new Float32Array(new ArrayBuffer(t)),this._buffer=e}return e}get byteLength(){const e=this.bytesPerElement;let t=0;for(let r=0,s=this.uniforms.length;r0?s:"";t=`${e.name} {\n\t${r} ${i.name}[${n}];\n};\n`}else{t=`${this.getVectorType(i.type)} ${this.getPropertyName(i,e)};`,n=!0}const a=i.node.precision;if(null!==a&&(t=Wv[a]+" "+t),n){t="\t"+t;const e=i.groupNode.name;(s[e]||(s[e]=[])).push(t)}else t="uniform "+t,r.push(t)}let i="";for(const t in s){const r=s[t];i+=this._getGLSLUniformStruct(e+"_"+t,r.join("\n"))+"\n"}return i+=r.join("\n"),i}getTypeFromAttribute(e){let t=super.getTypeFromAttribute(e);if(/^[iu]/.test(t)&&e.gpuType!==_){let r=e;e.isInterleavedBufferAttribute&&(r=e.data);const s=r.array;!1==(s instanceof Uint32Array||s instanceof Int32Array)&&(t=t.slice(1))}return t}getAttributes(e){let t="";if("vertex"===e||"compute"===e){const e=this.getAttributesArray();let r=0;for(const s of e)t+=`layout( location = ${r++} ) in ${s.type} ${s.name};\n`}return t}getStructMembers(e){const t=[];for(const r of e.members)t.push(`\t${r.type} ${r.name};`);return t.join("\n")}getStructs(e){const t=[],r=this.structs[e],s=[];for(const e of r)if(e.output)for(const t of e.members)s.push(`layout( location = ${t.index} ) out ${t.type} ${t.name};`);else{let r="struct "+e.name+" {\n";r+=this.getStructMembers(e),r+="\n};\n",t.push(r)}return 0===s.length&&s.push("layout( location = 0 ) out vec4 fragColor;"),"\n"+s.join("\n")+"\n\n"+t.join("\n")}getVaryings(e){let t="";const r=this.varyings;if("vertex"===e||"compute"===e)for(const s of r){"compute"===e&&(s.needsInterpolation=!0);const r=this.getType(s.type);if(s.needsInterpolation)if(s.interpolationType){t+=`${qv[s.interpolationType]||s.interpolationType} ${Xv[s.interpolationSampling]||""} out ${r} ${s.name};\n`}else{t+=`${r.includes("int")||r.includes("uv")||r.includes("iv")?"flat ":""}out ${r} ${s.name};\n`}else t+=`${r} ${s.name};\n`}else if("fragment"===e)for(const e of r)if(e.needsInterpolation){const r=this.getType(e.type);if(e.interpolationType){t+=`${qv[e.interpolationType]||e.interpolationType} ${Xv[e.interpolationSampling]||""} in ${r} ${e.name};\n`}else{t+=`${r.includes("int")||r.includes("uv")||r.includes("iv")?"flat ":""}in ${r} ${e.name};\n`}}for(const r of this.builtins[e])t+=`${r};\n`;return t}getVertexIndex(){return"uint( gl_VertexID )"}getInstanceIndex(){return"uint( gl_InstanceID )"}getInvocationLocalIndex(){return`uint( gl_InstanceID ) % ${this.object.workgroupSize.reduce(((e,t)=>e*t),1)}u`}getDrawIndex(){return this.renderer.backend.extensions.has("WEBGL_multi_draw")?"uint( gl_DrawID )":null}getFrontFacing(){return"gl_FrontFacing"}getFragCoord(){return"gl_FragCoord.xy"}getFragDepth(){return"gl_FragDepth"}enableExtension(e,t,r=this.shaderStage){const s=this.extensions[r]||(this.extensions[r]=new Map);!1===s.has(e)&&s.set(e,{name:e,behavior:t})}getExtensions(e){const t=[];if("vertex"===e){const t=this.renderer.backend.extensions;this.object.isBatchedMesh&&t.has("WEBGL_multi_draw")&&this.enableExtension("GL_ANGLE_multi_draw","require",e)}const r=this.extensions[e];if(void 0!==r)for(const{name:e,behavior:s}of r.values())t.push(`#extension ${e} : ${s}`);return t.join("\n")}getClipDistance(){return"gl_ClipDistance"}isAvailable(e){let t=jv[e];if(void 0===t){let r;switch(t=!1,e){case"float32Filterable":r="OES_texture_float_linear";break;case"clipDistance":r="WEBGL_clip_cull_distance"}if(void 0!==r){const e=this.renderer.backend.extensions;e.has(r)&&(e.get(r),t=!0)}jv[e]=t}return t}isFlipY(){return!0}enableHardwareClipping(e){this.enableExtension("GL_ANGLE_clip_cull_distance","require"),this.builtins.vertex.push(`out float gl_ClipDistance[ ${e} ]`)}enableMultiview(){this.enableExtension("GL_OVR_multiview2","require","fragment"),this.enableExtension("GL_OVR_multiview2","require","vertex"),this.builtins.vertex.push("layout(num_views = 2) in")}registerTransform(e,t){this.transforms.push({varyingName:e,attributeNode:t})}getTransforms(){const e=this.transforms;let t="";for(let r=0;r0&&(r+="\n"),r+=`\t// flow -> ${n}\n\t`),r+=`${s.code}\n\t`,e===i&&"compute"!==t&&(r+="// result\n\t","vertex"===t?(r+="gl_Position = ",r+=`${s.result};`):"fragment"===t&&(e.outputNode.isOutputStructNode||(r+="fragColor = ",r+=`${s.result};`)))}const n=e[t];n.extensions=this.getExtensions(t),n.uniforms=this.getUniforms(t),n.attributes=this.getAttributes(t),n.varyings=this.getVaryings(t),n.vars=this.getVars(t),n.structs=this.getStructs(t),n.codes=this.getCodes(t),n.transforms=this.getTransforms(t),n.flow=r}null!==this.material?(this.vertexShader=this._getGLSLVertexCode(e.vertex),this.fragmentShader=this._getGLSLFragmentCode(e.fragment)):this.computeShader=this._getGLSLVertexCode(e.compute)}getUniformFromNode(e,t,r,s=null){const i=super.getUniformFromNode(e,t,r,s),n=this.getDataFromNode(e,r,this.globalCache);let a=n.uniformGPU;if(void 0===a){const s=e.groupNode,o=s.name,u=this.getBindGroupArray(o,r);if("texture"===t)a=new Gv(i.name,i.node,s),u.push(a);else if("cubeTexture"===t)a=new zv(i.name,i.node,s),u.push(a);else if("texture3D"===t)a=new Hv(i.name,i.node,s),u.push(a);else if("buffer"===t){e.name=`NodeBuffer_${e.id}`,i.name=`buffer${e.id}`;const t=new Iv(e,s);t.name=e.name,u.push(t),a=t}else{const e=this.uniformGroups[r]||(this.uniformGroups[r]={});let n=e[o];void 0===n&&(n=new Uv(r+"_"+o,s),e[o]=n,u.push(n)),a=this.getNodeUniform(i,t),n.addUniform(a)}n.uniformGPU=a}return i}}let Qv=null,Zv=null;class Jv{constructor(e={}){this.parameters=Object.assign({},e),this.data=new WeakMap,this.renderer=null,this.domElement=null,this.timestampQueryPool={render:null,compute:null},this.trackTimestamp=!0===e.trackTimestamp}async init(e){this.renderer=e}get coordinateSystem(){}beginRender(){}finishRender(){}beginCompute(){}finishCompute(){}draw(){}compute(){}createProgram(){}destroyProgram(){}createBindings(){}updateBindings(){}updateBinding(){}createRenderPipeline(){}createComputePipeline(){}needsRenderUpdate(){}getRenderCacheKey(){}createNodeBuilder(){}createSampler(){}destroySampler(){}createDefaultTexture(){}createTexture(){}updateTexture(){}generateMipmaps(){}destroyTexture(){}async copyTextureToBuffer(){}copyTextureToTexture(){}copyFramebufferToTexture(){}createAttribute(){}createIndexAttribute(){}createStorageAttribute(){}updateAttribute(){}destroyAttribute(){}getContext(){}updateSize(){}updateViewport(){}isOccluded(){}async resolveTimestampsAsync(e="render"){if(!this.trackTimestamp)return void pt("WebGPURenderer: Timestamp tracking is disabled.");const t=this.timestampQueryPool[e];if(!t)return void pt(`WebGPURenderer: No timestamp query pool for type '${e}' found.`);const r=await t.resolveQueriesAsync();return this.renderer.info[e].timestamp=r,r}async waitForGPU(){}async getArrayBufferAsync(){}async hasFeatureAsync(){}hasFeature(){}getMaxAnisotropy(){}getDrawingBufferSize(){return Qv=Qv||new t,this.renderer.getDrawingBufferSize(Qv)}setScissorTest(){}getClearColor(){const e=this.renderer;return Zv=Zv||new Af,e.getClearColor(Zv),Zv.getRGB(Zv),Zv}getDomElement(){let e=this.domElement;return null===e&&(e=void 0!==this.parameters.canvas?this.parameters.canvas:gt(),"setAttribute"in e&&e.setAttribute("data-engine",`three.js r${He} webgpu`),this.domElement=e),e}set(e,t){this.data.set(e,t)}get(e){let t=this.data.get(e);return void 0===t&&(t={},this.data.set(e,t)),t}has(e){return this.data.has(e)}delete(e){this.data.delete(e)}dispose(){}}let eN,tN,rN=0;class sN{constructor(e,t){this.buffers=[e.bufferGPU,t],this.type=e.type,this.bufferType=e.bufferType,this.pbo=e.pbo,this.byteLength=e.byteLength,this.bytesPerElement=e.BYTES_PER_ELEMENT,this.version=e.version,this.isInteger=e.isInteger,this.activeBufferIndex=0,this.baseId=e.id}get id(){return`${this.baseId}|${this.activeBufferIndex}`}get bufferGPU(){return this.buffers[this.activeBufferIndex]}get transformBuffer(){return this.buffers[1^this.activeBufferIndex]}switchBuffers(){this.activeBufferIndex^=1}}class iN{constructor(e){this.backend=e}createAttribute(e,t){const r=this.backend,{gl:s}=r,i=e.array,n=e.usage||s.STATIC_DRAW,a=e.isInterleavedBufferAttribute?e.data:e,o=r.get(a);let u,l=o.bufferGPU;if(void 0===l&&(l=this._createBuffer(s,t,i,n),o.bufferGPU=l,o.bufferType=t,o.version=a.version),i instanceof Float32Array)u=s.FLOAT;else if(i instanceof Uint16Array)u=e.isFloat16BufferAttribute?s.HALF_FLOAT:s.UNSIGNED_SHORT;else if(i instanceof Int16Array)u=s.SHORT;else if(i instanceof Uint32Array)u=s.UNSIGNED_INT;else if(i instanceof Int32Array)u=s.INT;else if(i instanceof Int8Array)u=s.BYTE;else if(i instanceof Uint8Array)u=s.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLBackend: Unsupported buffer data format: "+i);u=s.UNSIGNED_BYTE}let d={bufferGPU:l,bufferType:t,type:u,byteLength:i.byteLength,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version,pbo:e.pbo,isInteger:u===s.INT||u===s.UNSIGNED_INT||e.gpuType===_,id:rN++};if(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute){const e=this._createBuffer(s,t,i,n);d=new sN(d,e)}r.set(e,d)}updateAttribute(e){const t=this.backend,{gl:r}=t,s=e.array,i=e.isInterleavedBufferAttribute?e.data:e,n=t.get(i),a=n.bufferType,o=e.isInterleavedBufferAttribute?e.data.updateRanges:e.updateRanges;if(r.bindBuffer(a,n.bufferGPU),0===o.length)r.bufferSubData(a,0,s);else{for(let e=0,t=o.length;e1?this.enable(s.SAMPLE_ALPHA_TO_COVERAGE):this.disable(s.SAMPLE_ALPHA_TO_COVERAGE),r>0&&this.currentClippingPlanes!==r){const e=12288;for(let t=0;t<8;t++)t{!function i(){const n=e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0);if(n===e.WAIT_FAILED)return e.deleteSync(t),void s();n!==e.TIMEOUT_EXPIRED?(e.deleteSync(t),r()):requestAnimationFrame(i)}()}))}}let oN,uN,lN,dN=!1;class cN{constructor(e){this.backend=e,this.gl=e.gl,this.extensions=e.extensions,this.defaultTextures={},!1===dN&&(this._init(),dN=!0)}_init(){const e=this.gl;oN={[Nr]:e.REPEAT,[vr]:e.CLAMP_TO_EDGE,[_r]:e.MIRRORED_REPEAT},uN={[v]:e.NEAREST,[Sr]:e.NEAREST_MIPMAP_NEAREST,[Ge]:e.NEAREST_MIPMAP_LINEAR,[K]:e.LINEAR,[ke]:e.LINEAR_MIPMAP_NEAREST,[D]:e.LINEAR_MIPMAP_LINEAR},lN={[Pr]:e.NEVER,[Mr]:e.ALWAYS,[De]:e.LESS,[Cr]:e.LEQUAL,[Rr]:e.EQUAL,[Ar]:e.GEQUAL,[wr]:e.GREATER,[Er]:e.NOTEQUAL}}getGLTextureType(e){const{gl:t}=this;let r;return r=!0===e.isCubeTexture?t.TEXTURE_CUBE_MAP:!0===e.isArrayTexture||!0===e.isDataArrayTexture||!0===e.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:!0===e.isData3DTexture?t.TEXTURE_3D:t.TEXTURE_2D,r}getInternalFormat(e,t,r,s,i=!1){const{gl:n,extensions:a}=this;if(null!==e){if(void 0!==n[e])return n[e];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+e+"'")}let o=t;if(t===n.RED&&(r===n.FLOAT&&(o=n.R32F),r===n.HALF_FLOAT&&(o=n.R16F),r===n.UNSIGNED_BYTE&&(o=n.R8),r===n.UNSIGNED_SHORT&&(o=n.R16),r===n.UNSIGNED_INT&&(o=n.R32UI),r===n.BYTE&&(o=n.R8I),r===n.SHORT&&(o=n.R16I),r===n.INT&&(o=n.R32I)),t===n.RED_INTEGER&&(r===n.UNSIGNED_BYTE&&(o=n.R8UI),r===n.UNSIGNED_SHORT&&(o=n.R16UI),r===n.UNSIGNED_INT&&(o=n.R32UI),r===n.BYTE&&(o=n.R8I),r===n.SHORT&&(o=n.R16I),r===n.INT&&(o=n.R32I)),t===n.RG&&(r===n.FLOAT&&(o=n.RG32F),r===n.HALF_FLOAT&&(o=n.RG16F),r===n.UNSIGNED_BYTE&&(o=n.RG8),r===n.UNSIGNED_SHORT&&(o=n.RG16),r===n.UNSIGNED_INT&&(o=n.RG32UI),r===n.BYTE&&(o=n.RG8I),r===n.SHORT&&(o=n.RG16I),r===n.INT&&(o=n.RG32I)),t===n.RG_INTEGER&&(r===n.UNSIGNED_BYTE&&(o=n.RG8UI),r===n.UNSIGNED_SHORT&&(o=n.RG16UI),r===n.UNSIGNED_INT&&(o=n.RG32UI),r===n.BYTE&&(o=n.RG8I),r===n.SHORT&&(o=n.RG16I),r===n.INT&&(o=n.RG32I)),t===n.RGB){const e=i?Fr:c.getTransfer(s);r===n.FLOAT&&(o=n.RGB32F),r===n.HALF_FLOAT&&(o=n.RGB16F),r===n.UNSIGNED_BYTE&&(o=n.RGB8),r===n.UNSIGNED_SHORT&&(o=n.RGB16),r===n.UNSIGNED_INT&&(o=n.RGB32UI),r===n.BYTE&&(o=n.RGB8I),r===n.SHORT&&(o=n.RGB16I),r===n.INT&&(o=n.RGB32I),r===n.UNSIGNED_BYTE&&(o=e===h?n.SRGB8:n.RGB8),r===n.UNSIGNED_SHORT_5_6_5&&(o=n.RGB565),r===n.UNSIGNED_SHORT_5_5_5_1&&(o=n.RGB5_A1),r===n.UNSIGNED_SHORT_4_4_4_4&&(o=n.RGB4),r===n.UNSIGNED_INT_5_9_9_9_REV&&(o=n.RGB9_E5)}if(t===n.RGB_INTEGER&&(r===n.UNSIGNED_BYTE&&(o=n.RGB8UI),r===n.UNSIGNED_SHORT&&(o=n.RGB16UI),r===n.UNSIGNED_INT&&(o=n.RGB32UI),r===n.BYTE&&(o=n.RGB8I),r===n.SHORT&&(o=n.RGB16I),r===n.INT&&(o=n.RGB32I)),t===n.RGBA){const e=i?Fr:c.getTransfer(s);r===n.FLOAT&&(o=n.RGBA32F),r===n.HALF_FLOAT&&(o=n.RGBA16F),r===n.UNSIGNED_BYTE&&(o=n.RGBA8),r===n.UNSIGNED_SHORT&&(o=n.RGBA16),r===n.UNSIGNED_INT&&(o=n.RGBA32UI),r===n.BYTE&&(o=n.RGBA8I),r===n.SHORT&&(o=n.RGBA16I),r===n.INT&&(o=n.RGBA32I),r===n.UNSIGNED_BYTE&&(o=e===h?n.SRGB8_ALPHA8:n.RGBA8),r===n.UNSIGNED_SHORT_4_4_4_4&&(o=n.RGBA4),r===n.UNSIGNED_SHORT_5_5_5_1&&(o=n.RGB5_A1)}return t===n.RGBA_INTEGER&&(r===n.UNSIGNED_BYTE&&(o=n.RGBA8UI),r===n.UNSIGNED_SHORT&&(o=n.RGBA16UI),r===n.UNSIGNED_INT&&(o=n.RGBA32UI),r===n.BYTE&&(o=n.RGBA8I),r===n.SHORT&&(o=n.RGBA16I),r===n.INT&&(o=n.RGBA32I)),t===n.DEPTH_COMPONENT&&(r===n.UNSIGNED_SHORT&&(o=n.DEPTH_COMPONENT16),r===n.UNSIGNED_INT&&(o=n.DEPTH_COMPONENT24),r===n.FLOAT&&(o=n.DEPTH_COMPONENT32F)),t===n.DEPTH_STENCIL&&r===n.UNSIGNED_INT_24_8&&(o=n.DEPTH24_STENCIL8),o!==n.R16F&&o!==n.R32F&&o!==n.RG16F&&o!==n.RG32F&&o!==n.RGBA16F&&o!==n.RGBA32F||a.get("EXT_color_buffer_float"),o}setTextureParameters(e,t){const{gl:r,extensions:s,backend:i}=this,n=c.getPrimaries(c.workingColorSpace),a=t.colorSpace===x?null:c.getPrimaries(t.colorSpace),o=t.colorSpace===x||n===a?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,t.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,t.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,o),r.texParameteri(e,r.TEXTURE_WRAP_S,oN[t.wrapS]),r.texParameteri(e,r.TEXTURE_WRAP_T,oN[t.wrapT]),e!==r.TEXTURE_3D&&e!==r.TEXTURE_2D_ARRAY||t.isArrayTexture||r.texParameteri(e,r.TEXTURE_WRAP_R,oN[t.wrapR]),r.texParameteri(e,r.TEXTURE_MAG_FILTER,uN[t.magFilter]);const u=void 0!==t.mipmaps&&t.mipmaps.length>0,l=t.minFilter===K&&u?D:t.minFilter;if(r.texParameteri(e,r.TEXTURE_MIN_FILTER,uN[l]),t.compareFunction&&(r.texParameteri(e,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(e,r.TEXTURE_COMPARE_FUNC,lN[t.compareFunction])),!0===s.has("EXT_texture_filter_anisotropic")){if(t.magFilter===v)return;if(t.minFilter!==Ge&&t.minFilter!==D)return;if(t.type===B&&!1===s.has("OES_texture_float_linear"))return;if(t.anisotropy>1){const n=s.get("EXT_texture_filter_anisotropic");r.texParameterf(e,n.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,i.getMaxAnisotropy()))}}}createDefaultTexture(e){const{gl:t,backend:r,defaultTextures:s}=this,i=this.getGLTextureType(e);let n=s[i];void 0===n&&(n=t.createTexture(),r.state.bindTexture(i,n),t.texParameteri(i,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(i,t.TEXTURE_MAG_FILTER,t.NEAREST),s[i]=n),r.set(e,{textureGPU:n,glTextureType:i,isDefault:!0})}createTexture(e,t){const{gl:r,backend:s}=this,{levels:i,width:n,height:a,depth:o}=t,u=s.utils.convert(e.format,e.colorSpace),l=s.utils.convert(e.type),d=this.getInternalFormat(e.internalFormat,u,l,e.colorSpace,e.isVideoTexture),c=r.createTexture(),h=this.getGLTextureType(e);s.state.bindTexture(h,c),this.setTextureParameters(h,e),e.isArrayTexture||e.isDataArrayTexture||e.isCompressedArrayTexture?r.texStorage3D(r.TEXTURE_2D_ARRAY,i,d,n,a,o):e.isData3DTexture?r.texStorage3D(r.TEXTURE_3D,i,d,n,a,o):e.isVideoTexture||r.texStorage2D(h,i,d,n,a),s.set(e,{textureGPU:c,glTextureType:h,glFormat:u,glType:l,glInternalFormat:d})}copyBufferToTexture(e,t){const{gl:r,backend:s}=this,{textureGPU:i,glTextureType:n,glFormat:a,glType:o}=s.get(t),{width:u,height:l}=t.source.data;r.bindBuffer(r.PIXEL_UNPACK_BUFFER,e),s.state.bindTexture(n,i),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.texSubImage2D(n,0,0,0,u,l,a,o,0),r.bindBuffer(r.PIXEL_UNPACK_BUFFER,null),s.state.unbindTexture()}updateTexture(e,t){const{gl:r}=this,{width:s,height:i}=t,{textureGPU:n,glTextureType:a,glFormat:o,glType:u,glInternalFormat:l}=this.backend.get(e);if(!e.isRenderTargetTexture&&void 0!==n)if(this.backend.state.bindTexture(a,n),this.setTextureParameters(a,e),e.isCompressedTexture){const s=e.mipmaps,i=t.image;for(let t=0;t0,c=t.renderTarget?t.renderTarget.height:this.backend.getDrawingBufferSize().y;if(d){const r=0!==a||0!==o;let d,h;if(!0===e.isDepthTexture?(d=s.DEPTH_BUFFER_BIT,h=s.DEPTH_ATTACHMENT,t.stencil&&(d|=s.STENCIL_BUFFER_BIT)):(d=s.COLOR_BUFFER_BIT,h=s.COLOR_ATTACHMENT0),r){const e=this.backend.get(t.renderTarget),r=e.framebuffers[t.getCacheKey()],h=e.msaaFrameBuffer;i.bindFramebuffer(s.DRAW_FRAMEBUFFER,r),i.bindFramebuffer(s.READ_FRAMEBUFFER,h);const p=c-o-l;s.blitFramebuffer(a,p,a+u,p+l,a,p,a+u,p+l,d,s.NEAREST),i.bindFramebuffer(s.READ_FRAMEBUFFER,r),i.bindTexture(s.TEXTURE_2D,n),s.copyTexSubImage2D(s.TEXTURE_2D,0,0,0,a,p,u,l),i.unbindTexture()}else{const e=s.createFramebuffer();i.bindFramebuffer(s.DRAW_FRAMEBUFFER,e),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,h,s.TEXTURE_2D,n,0),s.blitFramebuffer(0,0,u,l,0,0,u,l,d,s.NEAREST),s.deleteFramebuffer(e)}}else i.bindTexture(s.TEXTURE_2D,n),s.copyTexSubImage2D(s.TEXTURE_2D,0,0,0,a,c-l-o,u,l),i.unbindTexture();e.generateMipmaps&&this.generateMipmaps(e),this.backend._setFramebuffer(t)}setupRenderBufferStorage(e,t,r,s=!1){const{gl:i}=this,n=t.renderTarget,{depthTexture:a,depthBuffer:o,stencilBuffer:u,width:l,height:d}=n;if(i.bindRenderbuffer(i.RENDERBUFFER,e),o&&!u){let t=i.DEPTH_COMPONENT24;if(!0===s){this.extensions.get("WEBGL_multisampled_render_to_texture").renderbufferStorageMultisampleEXT(i.RENDERBUFFER,n.samples,t,l,d)}else r>0?(a&&a.isDepthTexture&&a.type===i.FLOAT&&(t=i.DEPTH_COMPONENT32F),i.renderbufferStorageMultisample(i.RENDERBUFFER,r,t,l,d)):i.renderbufferStorage(i.RENDERBUFFER,t,l,d);i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.RENDERBUFFER,e)}else o&&u&&(r>0?i.renderbufferStorageMultisample(i.RENDERBUFFER,r,i.DEPTH24_STENCIL8,l,d):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,l,d),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,e));i.bindRenderbuffer(i.RENDERBUFFER,null)}async copyTextureToBuffer(e,t,r,s,i,n){const{backend:a,gl:o}=this,{textureGPU:u,glFormat:l,glType:d}=this.backend.get(e),c=o.createFramebuffer();o.bindFramebuffer(o.READ_FRAMEBUFFER,c);const h=e.isCubeTexture?o.TEXTURE_CUBE_MAP_POSITIVE_X+n:o.TEXTURE_2D;o.framebufferTexture2D(o.READ_FRAMEBUFFER,o.COLOR_ATTACHMENT0,h,u,0);const p=this._getTypedArrayType(d),g=s*i*this._getBytesPerTexel(d,l),m=o.createBuffer();o.bindBuffer(o.PIXEL_PACK_BUFFER,m),o.bufferData(o.PIXEL_PACK_BUFFER,g,o.STREAM_READ),o.readPixels(t,r,s,i,l,d,0),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),await a.utils._clientWaitAsync();const f=new p(g/p.BYTES_PER_ELEMENT);return o.bindBuffer(o.PIXEL_PACK_BUFFER,m),o.getBufferSubData(o.PIXEL_PACK_BUFFER,0,f),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),o.deleteFramebuffer(c),f}_getTypedArrayType(e){const{gl:t}=this;if(e===t.UNSIGNED_BYTE)return Uint8Array;if(e===t.UNSIGNED_SHORT_4_4_4_4)return Uint16Array;if(e===t.UNSIGNED_SHORT_5_5_5_1)return Uint16Array;if(e===t.UNSIGNED_SHORT_5_6_5)return Uint16Array;if(e===t.UNSIGNED_SHORT)return Uint16Array;if(e===t.UNSIGNED_INT)return Uint32Array;if(e===t.HALF_FLOAT)return Uint16Array;if(e===t.FLOAT)return Float32Array;throw new Error(`Unsupported WebGL type: ${e}`)}_getBytesPerTexel(e,t){const{gl:r}=this;let s=0;return e===r.UNSIGNED_BYTE&&(s=1),e!==r.UNSIGNED_SHORT_4_4_4_4&&e!==r.UNSIGNED_SHORT_5_5_5_1&&e!==r.UNSIGNED_SHORT_5_6_5&&e!==r.UNSIGNED_SHORT&&e!==r.HALF_FLOAT||(s=2),e!==r.UNSIGNED_INT&&e!==r.FLOAT||(s=4),t===r.RGBA?4*s:t===r.RGB?3*s:t===r.ALPHA?s:void 0}}function hN(e){return e.isDataTexture?e.image.data:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?e:e.data}class pN{constructor(e){this.backend=e,this.gl=this.backend.gl,this.availableExtensions=this.gl.getSupportedExtensions(),this.extensions={}}get(e){let t=this.extensions[e];return void 0===t&&(t=this.gl.getExtension(e),this.extensions[e]=t),t}has(e){return this.availableExtensions.includes(e)}}class gN{constructor(e){this.backend=e,this.maxAnisotropy=null}getMaxAnisotropy(){if(null!==this.maxAnisotropy)return this.maxAnisotropy;const e=this.backend.gl,t=this.backend.extensions;if(!0===t.has("EXT_texture_filter_anisotropic")){const r=t.get("EXT_texture_filter_anisotropic");this.maxAnisotropy=e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else this.maxAnisotropy=0;return this.maxAnisotropy}}const mN={WEBGL_multi_draw:"WEBGL_multi_draw",WEBGL_compressed_texture_astc:"texture-compression-astc",WEBGL_compressed_texture_etc:"texture-compression-etc2",WEBGL_compressed_texture_etc1:"texture-compression-etc1",WEBGL_compressed_texture_pvrtc:"texture-compression-pvrtc",WEBKIT_WEBGL_compressed_texture_pvrtc:"texture-compression-pvrtc",WEBGL_compressed_texture_s3tc:"texture-compression-bc",EXT_texture_compression_bptc:"texture-compression-bptc",EXT_disjoint_timer_query_webgl2:"timestamp-query",OVR_multiview2:"OVR_multiview2"};class fN{constructor(e){this.gl=e.gl,this.extensions=e.extensions,this.info=e.renderer.info,this.mode=null,this.index=0,this.type=null,this.object=null}render(e,t){const{gl:r,mode:s,object:i,type:n,info:a,index:o}=this;0!==o?r.drawElements(s,t,n,e):r.drawArrays(s,e,t),a.update(i,t,1)}renderInstances(e,t,r){const{gl:s,mode:i,type:n,index:a,object:o,info:u}=this;0!==r&&(0!==a?s.drawElementsInstanced(i,t,n,e,r):s.drawArraysInstanced(i,e,t,r),u.update(o,t,r))}renderMultiDraw(e,t,r){const{extensions:s,mode:i,object:n,info:a}=this;if(0===r)return;const o=s.get("WEBGL_multi_draw");if(null===o)for(let s=0;sthis.maxQueries)return pt(`WebGPUTimestampQueryPool [${this.type}]: Maximum number of queries exceeded, when using trackTimestamp it is necessary to resolves the queries via renderer.resolveTimestampsAsync( THREE.TimestampQuery.${this.type.toUpperCase()} ).`),null;const t=this.currentQueryIndex;return this.currentQueryIndex+=2,this.queryStates.set(t,"inactive"),this.queryOffsets.set(e.id,t),t}beginQuery(e){if(!this.trackTimestamp||this.isDisposed)return;const t=this.queryOffsets.get(e.id);if(null==t)return;if(null!==this.activeQuery)return;const r=this.queries[t];if(r)try{"inactive"===this.queryStates.get(t)&&(this.gl.beginQuery(this.ext.TIME_ELAPSED_EXT,r),this.activeQuery=t,this.queryStates.set(t,"started"))}catch(e){console.error("Error in beginQuery:",e),this.activeQuery=null,this.queryStates.set(t,"inactive")}}endQuery(e){if(!this.trackTimestamp||this.isDisposed)return;const t=this.queryOffsets.get(e.id);if(null!=t&&this.activeQuery===t)try{this.gl.endQuery(this.ext.TIME_ELAPSED_EXT),this.queryStates.set(t,"ended"),this.activeQuery=null}catch(e){console.error("Error in endQuery:",e),this.queryStates.set(t,"inactive"),this.activeQuery=null}}async resolveQueriesAsync(){if(!this.trackTimestamp||this.pendingResolve)return this.lastValue;this.pendingResolve=!0;try{const e=[];for(const[t,r]of this.queryStates)if("ended"===r){const r=this.queries[t];e.push(this.resolveQuery(r))}if(0===e.length)return this.lastValue;const t=(await Promise.all(e)).reduce(((e,t)=>e+t),0);return this.lastValue=t,this.currentQueryIndex=0,this.queryOffsets.clear(),this.queryStates.clear(),this.activeQuery=null,t}catch(e){return console.error("Error resolving queries:",e),this.lastValue}finally{this.pendingResolve=!1}}async resolveQuery(e){return new Promise((t=>{if(this.isDisposed)return void t(this.lastValue);let r,s=!1;const i=e=>{s||(s=!0,r&&(clearTimeout(r),r=null),t(e))},n=()=>{if(this.isDisposed)i(this.lastValue);else try{if(this.gl.getParameter(this.ext.GPU_DISJOINT_EXT))return void i(this.lastValue);if(!this.gl.getQueryParameter(e,this.gl.QUERY_RESULT_AVAILABLE))return void(r=setTimeout(n,1));const s=this.gl.getQueryParameter(e,this.gl.QUERY_RESULT);t(Number(s)/1e6)}catch(e){console.error("Error checking query:",e),t(this.lastValue)}};n()}))}dispose(){if(!this.isDisposed&&(this.isDisposed=!0,this.trackTimestamp)){for(const e of this.queries)this.gl.deleteQuery(e);this.queries=[],this.queryStates.clear(),this.queryOffsets.clear(),this.lastValue=0,this.activeQuery=null}}}const bN=new t;class TN extends Jv{constructor(e={}){super(e),this.isWebGLBackend=!0,this.attributeUtils=null,this.extensions=null,this.capabilities=null,this.textureUtils=null,this.bufferRenderer=null,this.gl=null,this.state=null,this.utils=null,this.vaoCache={},this.transformFeedbackCache={},this.discard=!1,this.disjoint=null,this.parallel=null,this._currentContext=null,this._knownBindings=new WeakSet,this._supportsInvalidateFramebuffer="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),this._xrFramebuffer=null}init(e){super.init(e);const t=this.parameters,r={antialias:e.samples>0,alpha:!0,depth:e.depth,stencil:e.stencil},s=void 0!==t.context?t.context:e.domElement.getContext("webgl2",r);function i(t){t.preventDefault();const r={api:"WebGL",message:t.statusMessage||"Unknown reason",reason:null,originalEvent:t};e.onDeviceLost(r)}this._onContextLost=i,e.domElement.addEventListener("webglcontextlost",i,!1),this.gl=s,this.extensions=new pN(this),this.capabilities=new gN(this),this.attributeUtils=new iN(this),this.textureUtils=new cN(this),this.bufferRenderer=new fN(this),this.state=new nN(this),this.utils=new aN(this),this.extensions.get("EXT_color_buffer_float"),this.extensions.get("WEBGL_clip_cull_distance"),this.extensions.get("OES_texture_float_linear"),this.extensions.get("EXT_color_buffer_half_float"),this.extensions.get("WEBGL_multisampled_render_to_texture"),this.extensions.get("WEBGL_render_shared_exponent"),this.extensions.get("WEBGL_multi_draw"),this.extensions.get("OVR_multiview2"),this.disjoint=this.extensions.get("EXT_disjoint_timer_query_webgl2"),this.parallel=this.extensions.get("KHR_parallel_shader_compile")}get coordinateSystem(){return l}async getArrayBufferAsync(e){return await this.attributeUtils.getArrayBufferAsync(e)}async waitForGPU(){await this.utils._clientWaitAsync()}async makeXRCompatible(){!0!==this.gl.getContextAttributes().xrCompatible&&await this.gl.makeXRCompatible()}setXRTarget(e){this._xrFramebuffer=e}setXRRenderTargetTextures(e,t,r=null){const s=this.gl;if(this.set(e.texture,{textureGPU:t,glInternalFormat:s.RGBA8}),null!==r){const t=e.stencilBuffer?s.DEPTH24_STENCIL8:s.DEPTH_COMPONENT24;this.set(e.depthTexture,{textureGPU:r,glInternalFormat:t}),!0===this.extensions.has("WEBGL_multisampled_render_to_texture")&&!0===e._autoAllocateDepthBuffer&&!1===e.multiview&&console.warn("THREE.WebGLBackend: Render-to-texture extension was disabled because an external texture was provided"),e._autoAllocateDepthBuffer=!1}}initTimestampQuery(e){if(!this.disjoint||!this.trackTimestamp)return;const t=e.isComputeNode?"compute":"render";this.timestampQueryPool[t]||(this.timestampQueryPool[t]=new xN(this.gl,t,2048));const r=this.timestampQueryPool[t];null!==r.allocateQueriesForContext(e)&&r.beginQuery(e)}prepareTimestampBuffer(e){if(!this.disjoint||!this.trackTimestamp)return;const t=e.isComputeNode?"compute":"render";this.timestampQueryPool[t].endQuery(e)}getContext(){return this.gl}beginRender(e){const{state:t}=this,r=this.get(e);if(e.viewport)this.updateViewport(e);else{const{width:e,height:r}=this.getDrawingBufferSize(bN);t.viewport(0,0,e,r)}if(e.scissor){const{x:r,y:s,width:i,height:n}=e.scissorValue;t.scissor(r,e.height-n-s,i,n)}this.initTimestampQuery(e),r.previousContext=this._currentContext,this._currentContext=e,this._setFramebuffer(e),this.clear(e.clearColor,e.clearDepth,e.clearStencil,e,!1);const s=e.occlusionQueryCount;s>0&&(r.currentOcclusionQueries=r.occlusionQueries,r.currentOcclusionQueryObjects=r.occlusionQueryObjects,r.lastOcclusionObject=null,r.occlusionQueries=new Array(s),r.occlusionQueryObjects=new Array(s),r.occlusionQueryIndex=0)}finishRender(e){const{gl:t,state:r}=this,s=this.get(e),i=s.previousContext;r.resetVertexState();const n=e.occlusionQueryCount;n>0&&(n>s.occlusionQueryIndex&&t.endQuery(t.ANY_SAMPLES_PASSED),this.resolveOccludedAsync(e));const a=e.textures;if(null!==a)for(let e=0;e0&&!1===this._useMultisampledExtension(o)){const i=s.framebuffers[e.getCacheKey()];let n=t.COLOR_BUFFER_BIT;o.resolveDepthBuffer&&(o.depthBuffer&&(n|=t.DEPTH_BUFFER_BIT),o.stencilBuffer&&o.resolveStencilBuffer&&(n|=t.STENCIL_BUFFER_BIT));const a=s.msaaFrameBuffer,u=s.msaaRenderbuffers,l=e.textures,d=l.length>1;if(r.bindFramebuffer(t.READ_FRAMEBUFFER,a),r.bindFramebuffer(t.DRAW_FRAMEBUFFER,i),d)for(let e=0;e{let a=0;for(let t=0;t{t.isBatchedMesh?null!==t._multiDrawInstances?(pt("THREE.WebGLBackend: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),y.renderMultiDrawInstances(t._multiDrawStarts,t._multiDrawCounts,t._multiDrawCount,t._multiDrawInstances)):this.hasFeature("WEBGL_multi_draw")?y.renderMultiDraw(t._multiDrawStarts,t._multiDrawCounts,t._multiDrawCount):pt("THREE.WebGLRenderer: WEBGL_multi_draw not supported."):b>1?y.renderInstances(T,x,b):y.render(T,x)};if(!0===e.camera.isArrayCamera&&e.camera.cameras.length>0&&!1===e.camera.isMultiViewCamera){const r=this.get(e.camera),s=e.camera.cameras,i=e.getBindingGroup("cameraIndex").bindings[0];if(void 0===r.indexesGPU||r.indexesGPU.length!==s.length){const e=new Uint32Array([0,0,0,0]),t=[];for(let r=0,i=s.length;r{const i=this.parallel,n=()=>{r.getProgramParameter(a,i.COMPLETION_STATUS_KHR)?(this._completeCompile(e,s),t()):requestAnimationFrame(n)};n()}));t.push(i)}else this._completeCompile(e,s)}_handleSource(e,t){const r=e.split("\n"),s=[],i=Math.max(t-6,0),n=Math.min(t+6,r.length);for(let e=i;e":" "} ${i}: ${r[e]}`)}return s.join("\n")}_getShaderErrors(e,t,r){const s=e.getShaderParameter(t,e.COMPILE_STATUS),i=e.getShaderInfoLog(t).trim();if(s&&""===i)return"";const n=/ERROR: 0:(\d+)/.exec(i);if(n){const s=parseInt(n[1]);return r.toUpperCase()+"\n\n"+i+"\n\n"+this._handleSource(e.getShaderSource(t),s)}return i}_logProgramError(e,t,r){if(this.renderer.debug.checkShaderErrors){const s=this.gl,i=s.getProgramInfoLog(e).trim();if(!1===s.getProgramParameter(e,s.LINK_STATUS))if("function"==typeof this.renderer.debug.onShaderError)this.renderer.debug.onShaderError(s,e,r,t);else{const n=this._getShaderErrors(s,r,"vertex"),a=this._getShaderErrors(s,t,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(e,s.VALIDATE_STATUS)+"\n\nProgram Info Log: "+i+"\n"+n+"\n"+a)}else""!==i&&console.warn("THREE.WebGLProgram: Program Info Log:",i)}}_completeCompile(e,t){const{state:r,gl:s}=this,i=this.get(t),{programGPU:n,fragmentShader:a,vertexShader:o}=i;!1===s.getProgramParameter(n,s.LINK_STATUS)&&this._logProgramError(n,a,o),r.useProgram(n);const u=e.getBindings();this._setupBindings(u,n),this.set(t,{programGPU:n})}createComputePipeline(e,t){const{state:r,gl:s}=this,i={stage:"fragment",code:"#version 300 es\nprecision highp float;\nvoid main() {}"};this.createProgram(i);const{computeProgram:n}=e,a=s.createProgram(),o=this.get(i).shaderGPU,u=this.get(n).shaderGPU,l=n.transforms,d=[],c=[];for(let e=0;emN[t]===e)),r=this.extensions;for(let e=0;e1,h=!0===i.isXRRenderTarget,p=!0===h&&!0===i._hasExternalTextures;let g=n.msaaFrameBuffer,m=n.depthRenderbuffer;const f=this.extensions.get("WEBGL_multisampled_render_to_texture"),y=this.extensions.get("OVR_multiview2"),x=this._useMultisampledExtension(i),b=Tf(e);let T;if(l?(n.cubeFramebuffers||(n.cubeFramebuffers={}),T=n.cubeFramebuffers[b]):h&&!1===p?T=this._xrFramebuffer:(n.framebuffers||(n.framebuffers={}),T=n.framebuffers[b]),void 0===T){T=t.createFramebuffer(),r.bindFramebuffer(t.FRAMEBUFFER,T);const s=e.textures,o=[];if(l){n.cubeFramebuffers[b]=T;const{textureGPU:e}=this.get(s[0]),r=this.renderer._activeCubeFace;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+r,e,0)}else{n.framebuffers[b]=T;for(let r=0;r0&&!1===x&&!i.multiview){if(void 0===g){const s=[];g=t.createFramebuffer(),r.bindFramebuffer(t.FRAMEBUFFER,g);const i=[],l=e.textures;for(let r=0;r0&&!0===this.extensions.has("WEBGL_multisampled_render_to_texture")&&!1!==e._autoAllocateDepthBuffer}dispose(){const e=this.extensions.get("WEBGL_lose_context");e&&e.loseContext(),this.renderer.domElement.removeEventListener("webglcontextlost",this._onContextLost)}}const _N="point-list",vN="line-list",NN="line-strip",SN="triangle-list",EN="triangle-strip",wN="never",AN="less",RN="equal",CN="less-equal",MN="greater",PN="not-equal",FN="greater-equal",LN="always",BN="store",IN="load",DN="clear",VN="ccw",UN="none",ON="front",kN="back",GN="uint16",zN="uint32",HN="r8unorm",$N="r8snorm",WN="r8uint",jN="r8sint",qN="r16uint",XN="r16sint",KN="r16float",YN="rg8unorm",QN="rg8snorm",ZN="rg8uint",JN="rg8sint",eS="r32uint",tS="r32sint",rS="r32float",sS="rg16uint",iS="rg16sint",nS="rg16float",aS="rgba8unorm",oS="rgba8unorm-srgb",uS="rgba8snorm",lS="rgba8uint",dS="rgba8sint",cS="bgra8unorm",hS="bgra8unorm-srgb",pS="rgb9e5ufloat",gS="rgb10a2unorm",mS="rgb10a2unorm",fS="rg32uint",yS="rg32sint",xS="rg32float",bS="rgba16uint",TS="rgba16sint",_S="rgba16float",vS="rgba32uint",NS="rgba32sint",SS="rgba32float",ES="depth16unorm",wS="depth24plus",AS="depth24plus-stencil8",RS="depth32float",CS="depth32float-stencil8",MS="bc1-rgba-unorm",PS="bc1-rgba-unorm-srgb",FS="bc2-rgba-unorm",LS="bc2-rgba-unorm-srgb",BS="bc3-rgba-unorm",IS="bc3-rgba-unorm-srgb",DS="bc4-r-unorm",VS="bc4-r-snorm",US="bc5-rg-unorm",OS="bc5-rg-snorm",kS="bc6h-rgb-ufloat",GS="bc6h-rgb-float",zS="bc7-rgba-unorm",HS="bc7-rgba-srgb",$S="etc2-rgb8unorm",WS="etc2-rgb8unorm-srgb",jS="etc2-rgb8a1unorm",qS="etc2-rgb8a1unorm-srgb",XS="etc2-rgba8unorm",KS="etc2-rgba8unorm-srgb",YS="eac-r11unorm",QS="eac-r11snorm",ZS="eac-rg11unorm",JS="eac-rg11snorm",eE="astc-4x4-unorm",tE="astc-4x4-unorm-srgb",rE="astc-5x4-unorm",sE="astc-5x4-unorm-srgb",iE="astc-5x5-unorm",nE="astc-5x5-unorm-srgb",aE="astc-6x5-unorm",oE="astc-6x5-unorm-srgb",uE="astc-6x6-unorm",lE="astc-6x6-unorm-srgb",dE="astc-8x5-unorm",cE="astc-8x5-unorm-srgb",hE="astc-8x6-unorm",pE="astc-8x6-unorm-srgb",gE="astc-8x8-unorm",mE="astc-8x8-unorm-srgb",fE="astc-10x5-unorm",yE="astc-10x5-unorm-srgb",xE="astc-10x6-unorm",bE="astc-10x6-unorm-srgb",TE="astc-10x8-unorm",_E="astc-10x8-unorm-srgb",vE="astc-10x10-unorm",NE="astc-10x10-unorm-srgb",SE="astc-12x10-unorm",EE="astc-12x10-unorm-srgb",wE="astc-12x12-unorm",AE="astc-12x12-unorm-srgb",RE="clamp-to-edge",CE="repeat",ME="mirror-repeat",PE="linear",FE="nearest",LE="zero",BE="one",IE="src",DE="one-minus-src",VE="src-alpha",UE="one-minus-src-alpha",OE="dst",kE="one-minus-dst",GE="dst-alpha",zE="one-minus-dst-alpha",HE="src-alpha-saturated",$E="constant",WE="one-minus-constant",jE="add",qE="subtract",XE="reverse-subtract",KE="min",YE="max",QE=0,ZE=15,JE="keep",ew="zero",tw="replace",rw="invert",sw="increment-clamp",iw="decrement-clamp",nw="increment-wrap",aw="decrement-wrap",ow="storage",uw="read-only-storage",lw="write-only",dw="read-only",cw="read-write",hw="non-filtering",pw="comparison",gw="float",mw="unfilterable-float",fw="depth",yw="sint",xw="uint",bw="2d",Tw="3d",_w="2d",vw="2d-array",Nw="cube",Sw="3d",Ew="all",ww="vertex",Aw="instance",Rw={DepthClipControl:"depth-clip-control",Depth32FloatStencil8:"depth32float-stencil8",TextureCompressionBC:"texture-compression-bc",TextureCompressionETC2:"texture-compression-etc2",TextureCompressionASTC:"texture-compression-astc",TimestampQuery:"timestamp-query",IndirectFirstInstance:"indirect-first-instance",ShaderF16:"shader-f16",RG11B10UFloat:"rg11b10ufloat-renderable",BGRA8UNormStorage:"bgra8unorm-storage",Float32Filterable:"float32-filterable",ClipDistances:"clip-distances",DualSourceBlending:"dual-source-blending",Subgroups:"subgroups"};class Cw extends Pv{constructor(e,t){super(e),this.texture=t,this.version=t?t.version:0,this.isSampler=!0}}class Mw extends Cw{constructor(e,t,r){super(e,t?t.value:null),this.textureNode=t,this.groupNode=r}update(){this.texture=this.textureNode.value}}class Pw extends Fv{constructor(e,t){super(e,t?t.array:null),this.attribute=t,this.isStorageBuffer=!0}}let Fw=0;class Lw extends Pw{constructor(e,t){super("StorageBuffer_"+Fw++,e?e.value:null),this.nodeUniform=e,this.access=e?e.access:Os.READ_WRITE,this.groupNode=t}get buffer(){return this.nodeUniform.value}}class Bw extends qm{constructor(e){super(),this.device=e;this.mipmapSampler=e.createSampler({minFilter:PE}),this.flipYSampler=e.createSampler({minFilter:FE}),this.transferPipelines={},this.flipYPipelines={},this.mipmapVertexShaderModule=e.createShaderModule({label:"mipmapVertex",code:"\nstruct VarysStruct {\n\t@builtin( position ) Position: vec4,\n\t@location( 0 ) vTex : vec2\n};\n\n@vertex\nfn main( @builtin( vertex_index ) vertexIndex : u32 ) -> VarysStruct {\n\n\tvar Varys : VarysStruct;\n\n\tvar pos = array< vec2, 4 >(\n\t\tvec2( -1.0, 1.0 ),\n\t\tvec2( 1.0, 1.0 ),\n\t\tvec2( -1.0, -1.0 ),\n\t\tvec2( 1.0, -1.0 )\n\t);\n\n\tvar tex = array< vec2, 4 >(\n\t\tvec2( 0.0, 0.0 ),\n\t\tvec2( 1.0, 0.0 ),\n\t\tvec2( 0.0, 1.0 ),\n\t\tvec2( 1.0, 1.0 )\n\t);\n\n\tVarys.vTex = tex[ vertexIndex ];\n\tVarys.Position = vec4( pos[ vertexIndex ], 0.0, 1.0 );\n\n\treturn Varys;\n\n}\n"}),this.mipmapFragmentShaderModule=e.createShaderModule({label:"mipmapFragment",code:"\n@group( 0 ) @binding( 0 )\nvar imgSampler : sampler;\n\n@group( 0 ) @binding( 1 )\nvar img : texture_2d;\n\n@fragment\nfn main( @location( 0 ) vTex : vec2 ) -> @location( 0 ) vec4 {\n\n\treturn textureSample( img, imgSampler, vTex );\n\n}\n"}),this.flipYFragmentShaderModule=e.createShaderModule({label:"flipYFragment",code:"\n@group( 0 ) @binding( 0 )\nvar imgSampler : sampler;\n\n@group( 0 ) @binding( 1 )\nvar img : texture_2d;\n\n@fragment\nfn main( @location( 0 ) vTex : vec2 ) -> @location( 0 ) vec4 {\n\n\treturn textureSample( img, imgSampler, vec2( vTex.x, 1.0 - vTex.y ) );\n\n}\n"})}getTransferPipeline(e){let t=this.transferPipelines[e];return void 0===t&&(t=this.device.createRenderPipeline({label:`mipmap-${e}`,vertex:{module:this.mipmapVertexShaderModule,entryPoint:"main"},fragment:{module:this.mipmapFragmentShaderModule,entryPoint:"main",targets:[{format:e}]},primitive:{topology:EN,stripIndexFormat:zN},layout:"auto"}),this.transferPipelines[e]=t),t}getFlipYPipeline(e){let t=this.flipYPipelines[e];return void 0===t&&(t=this.device.createRenderPipeline({label:`flipY-${e}`,vertex:{module:this.mipmapVertexShaderModule,entryPoint:"main"},fragment:{module:this.flipYFragmentShaderModule,entryPoint:"main",targets:[{format:e}]},primitive:{topology:EN,stripIndexFormat:zN},layout:"auto"}),this.flipYPipelines[e]=t),t}flipY(e,t,r=0){const s=t.format,{width:i,height:n}=t.size,a=this.getTransferPipeline(s),o=this.getFlipYPipeline(s),u=this.device.createTexture({size:{width:i,height:n,depthOrArrayLayers:1},format:s,usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING}),l=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:_w,baseArrayLayer:r}),d=u.createView({baseMipLevel:0,mipLevelCount:1,dimension:_w,baseArrayLayer:0}),c=this.device.createCommandEncoder({}),h=(e,t,r)=>{const s=e.getBindGroupLayout(0),i=this.device.createBindGroup({layout:s,entries:[{binding:0,resource:this.flipYSampler},{binding:1,resource:t}]}),n=c.beginRenderPass({colorAttachments:[{view:r,loadOp:DN,storeOp:BN,clearValue:[0,0,0,0]}]});n.setPipeline(e),n.setBindGroup(0,i),n.draw(4,1,0,0),n.end()};h(a,l,d),h(o,d,l),this.device.queue.submit([c.finish()]),u.destroy()}generateMipmaps(e,t,r=0){const s=this.get(e);void 0===s.useCount&&(s.useCount=0,s.layers=[]);const i=s.layers[r]||this._mipmapCreateBundles(e,t,r),n=this.device.createCommandEncoder({});this._mipmapRunBundles(n,i),this.device.queue.submit([n.finish()]),0!==s.useCount&&(s.layers[r]=i),s.useCount++}_mipmapCreateBundles(e,t,r){const s=this.getTransferPipeline(t.format),i=s.getBindGroupLayout(0);let n=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:_w,baseArrayLayer:r});const a=[];for(let o=1;o1;for(let a=0;a]*\s*([a-z_0-9]+(?:<[\s\S]+?>)?)/i,kw=/([a-z_0-9]+)\s*:\s*([a-z_0-9]+(?:<[\s\S]+?>)?)/gi,Gw={f32:"float",i32:"int",u32:"uint",bool:"bool","vec2":"vec2","vec2":"ivec2","vec2":"uvec2","vec2":"bvec2",vec2f:"vec2",vec2i:"ivec2",vec2u:"uvec2",vec2b:"bvec2","vec3":"vec3","vec3":"ivec3","vec3":"uvec3","vec3":"bvec3",vec3f:"vec3",vec3i:"ivec3",vec3u:"uvec3",vec3b:"bvec3","vec4":"vec4","vec4":"ivec4","vec4":"uvec4","vec4":"bvec4",vec4f:"vec4",vec4i:"ivec4",vec4u:"uvec4",vec4b:"bvec4","mat2x2":"mat2",mat2x2f:"mat2","mat3x3":"mat3",mat3x3f:"mat3","mat4x4":"mat4",mat4x4f:"mat4",sampler:"sampler",texture_1d:"texture",texture_2d:"texture",texture_2d_array:"texture",texture_multisampled_2d:"cubeTexture",texture_depth_2d:"depthTexture",texture_depth_2d_array:"depthTexture",texture_depth_multisampled_2d:"depthTexture",texture_depth_cube:"depthTexture",texture_depth_cube_array:"depthTexture",texture_3d:"texture3D",texture_cube:"cubeTexture",texture_cube_array:"cubeTexture",texture_storage_1d:"storageTexture",texture_storage_2d:"storageTexture",texture_storage_2d_array:"storageTexture",texture_storage_3d:"storageTexture"};class zw extends X_{constructor(e){const{type:t,inputs:r,name:s,inputsCode:i,blockCode:n,outputType:a}=(e=>{const t=(e=e.trim()).match(Ow);if(null!==t&&4===t.length){const r=t[2],s=[];let i=null;for(;null!==(i=kw.exec(r));)s.push({name:i[1],type:i[2]});const n=[];for(let e=0;e "+this.outputType:"";return`fn ${e} ( ${this.inputsCode.trim()} ) ${t}`+this.blockCode}}class Hw extends q_{parseFunction(e){return new zw(e)}}const $w="undefined"!=typeof self?self.GPUShaderStage:{VERTEX:1,FRAGMENT:2,COMPUTE:4},Ww={[Os.READ_ONLY]:"read",[Os.WRITE_ONLY]:"write",[Os.READ_WRITE]:"read_write"},jw={[Nr]:"repeat",[vr]:"clamp",[_r]:"mirror"},qw={vertex:$w?$w.VERTEX:1,fragment:$w?$w.FRAGMENT:2,compute:$w?$w.COMPUTE:4},Xw={instance:!0,swizzleAssign:!1,storageBuffer:!0},Kw={"^^":"tsl_xor"},Yw={float:"f32",int:"i32",uint:"u32",bool:"bool",color:"vec3",vec2:"vec2",ivec2:"vec2",uvec2:"vec2",bvec2:"vec2",vec3:"vec3",ivec3:"vec3",uvec3:"vec3",bvec3:"vec3",vec4:"vec4",ivec4:"vec4",uvec4:"vec4",bvec4:"vec4",mat2:"mat2x2",mat3:"mat3x3",mat4:"mat4x4"},Qw={},Zw={tsl_xor:new wx("fn tsl_xor( a : bool, b : bool ) -> bool { return ( a || b ) && !( a && b ); }"),mod_float:new wx("fn tsl_mod_float( x : f32, y : f32 ) -> f32 { return x - y * floor( x / y ); }"),mod_vec2:new wx("fn tsl_mod_vec2( x : vec2f, y : vec2f ) -> vec2f { return x - y * floor( x / y ); }"),mod_vec3:new wx("fn tsl_mod_vec3( x : vec3f, y : vec3f ) -> vec3f { return x - y * floor( x / y ); }"),mod_vec4:new wx("fn tsl_mod_vec4( x : vec4f, y : vec4f ) -> vec4f { return x - y * floor( x / y ); }"),equals_bool:new wx("fn tsl_equals_bool( a : bool, b : bool ) -> bool { return a == b; }"),equals_bvec2:new wx("fn tsl_equals_bvec2( a : vec2f, b : vec2f ) -> vec2 { return vec2( a.x == b.x, a.y == b.y ); }"),equals_bvec3:new wx("fn tsl_equals_bvec3( a : vec3f, b : vec3f ) -> vec3 { return vec3( a.x == b.x, a.y == b.y, a.z == b.z ); }"),equals_bvec4:new wx("fn tsl_equals_bvec4( a : vec4f, b : vec4f ) -> vec4 { return vec4( a.x == b.x, a.y == b.y, a.z == b.z, a.w == b.w ); }"),repeatWrapping_float:new wx("fn tsl_repeatWrapping_float( coord: f32 ) -> f32 { return fract( coord ); }"),mirrorWrapping_float:new wx("fn tsl_mirrorWrapping_float( coord: f32 ) -> f32 { let mirrored = fract( coord * 0.5 ) * 2.0; return 1.0 - abs( 1.0 - mirrored ); }"),clampWrapping_float:new wx("fn tsl_clampWrapping_float( coord: f32 ) -> f32 { return clamp( coord, 0.0, 1.0 ); }"),biquadraticTexture:new wx("\nfn tsl_biquadraticTexture( map : texture_2d, coord : vec2f, iRes : vec2u, level : u32 ) -> vec4f {\n\n\tlet res = vec2f( iRes );\n\n\tlet uvScaled = coord * res;\n\tlet uvWrapping = ( ( uvScaled % res ) + res ) % res;\n\n\t// https://www.shadertoy.com/view/WtyXRy\n\n\tlet uv = uvWrapping - 0.5;\n\tlet iuv = floor( uv );\n\tlet f = fract( uv );\n\n\tlet rg1 = textureLoad( map, vec2u( iuv + vec2( 0.5, 0.5 ) ) % iRes, level );\n\tlet rg2 = textureLoad( map, vec2u( iuv + vec2( 1.5, 0.5 ) ) % iRes, level );\n\tlet rg3 = textureLoad( map, vec2u( iuv + vec2( 0.5, 1.5 ) ) % iRes, level );\n\tlet rg4 = textureLoad( map, vec2u( iuv + vec2( 1.5, 1.5 ) ) % iRes, level );\n\n\treturn mix( mix( rg1, rg2, f.x ), mix( rg3, rg4, f.x ), f.y );\n\n}\n")},Jw={dFdx:"dpdx",dFdy:"- dpdy",mod_float:"tsl_mod_float",mod_vec2:"tsl_mod_vec2",mod_vec3:"tsl_mod_vec3",mod_vec4:"tsl_mod_vec4",equals_bool:"tsl_equals_bool",equals_bvec2:"tsl_equals_bvec2",equals_bvec3:"tsl_equals_bvec3",equals_bvec4:"tsl_equals_bvec4",inversesqrt:"inverseSqrt",bitcast:"bitcast"};"undefined"!=typeof navigator&&/Windows/g.test(navigator.userAgent)&&(Zw.pow_float=new wx("fn tsl_pow_float( a : f32, b : f32 ) -> f32 { return select( -pow( -a, b ), pow( a, b ), a > 0.0 ); }"),Zw.pow_vec2=new wx("fn tsl_pow_vec2( a : vec2f, b : vec2f ) -> vec2f { return vec2f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ) ); }",[Zw.pow_float]),Zw.pow_vec3=new wx("fn tsl_pow_vec3( a : vec3f, b : vec3f ) -> vec3f { return vec3f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ) ); }",[Zw.pow_float]),Zw.pow_vec4=new wx("fn tsl_pow_vec4( a : vec4f, b : vec4f ) -> vec4f { return vec4f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ), tsl_pow_float( a.w, b.w ) ); }",[Zw.pow_float]),Jw.pow_float="tsl_pow_float",Jw.pow_vec2="tsl_pow_vec2",Jw.pow_vec3="tsl_pow_vec3",Jw.pow_vec4="tsl_pow_vec4");let eA="";!0!==("undefined"!=typeof navigator&&/Firefox|Deno/g.test(navigator.userAgent))&&(eA+="diagnostic( off, derivative_uniformity );\n");class tA extends F_{constructor(e,t){super(e,t,new Hw),this.uniformGroups={},this.builtins={},this.directives={},this.scopedArrays=new Map}needsToWorkingColorSpace(e){return!0===e.isVideoTexture&&e.colorSpace!==x}_generateTextureSample(e,t,r,s,i=this.shaderStage){return"fragment"===i?s?`textureSample( ${t}, ${t}_sampler, ${r}, ${s} )`:`textureSample( ${t}, ${t}_sampler, ${r} )`:this._generateTextureSampleLevel(e,t,r,"0",s)}_generateVideoSample(e,t,r=this.shaderStage){if("fragment"===r)return`textureSampleBaseClampToEdge( ${e}, ${e}_sampler, vec2( ${t}.x, 1.0 - ${t}.y ) )`;console.error(`WebGPURenderer: THREE.VideoTexture does not support ${r} shader.`)}_generateTextureSampleLevel(e,t,r,s,i){return!1===this.isUnfilterable(e)?`textureSampleLevel( ${t}, ${t}_sampler, ${r}, ${s} )`:this.isFilteredTexture(e)?this.generateFilteredTexture(e,t,r,s):this.generateTextureLod(e,t,r,i,s)}generateWrapFunction(e){const t=`tsl_coord_${jw[e.wrapS]}S_${jw[e.wrapT]}_${e.isData3DTexture?"3d":"2d"}T`;let r=Qw[t];if(void 0===r){const s=[],i=e.isData3DTexture?"vec3f":"vec2f";let n=`fn ${t}( coord : ${i} ) -> ${i} {\n\n\treturn ${i}(\n`;const a=(e,t)=>{e===Nr?(s.push(Zw.repeatWrapping_float),n+=`\t\ttsl_repeatWrapping_float( coord.${t} )`):e===vr?(s.push(Zw.clampWrapping_float),n+=`\t\ttsl_clampWrapping_float( coord.${t} )`):e===_r?(s.push(Zw.mirrorWrapping_float),n+=`\t\ttsl_mirrorWrapping_float( coord.${t} )`):(n+=`\t\tcoord.${t}`,console.warn(`WebGPURenderer: Unsupported texture wrap type "${e}" for vertex shader.`))};a(e.wrapS,"x"),n+=",\n",a(e.wrapT,"y"),e.isData3DTexture&&(n+=",\n",a(e.wrapR,"z")),n+="\n\t);\n\n}\n",Qw[t]=r=new wx(n,s)}return r.build(this),t}generateArrayDeclaration(e,t){return`array< ${this.getType(e)}, ${t} >`}generateTextureDimension(e,t,r){const s=this.getDataFromNode(e,this.shaderStage,this.globalCache);void 0===s.dimensionsSnippet&&(s.dimensionsSnippet={});let i=s.dimensionsSnippet[r];if(void 0===s.dimensionsSnippet[r]){let n,a;const{primarySamples:o}=this.renderer.backend.utils.getTextureSampleData(e),u=o>1;a=e.isData3DTexture?"vec3":"vec2",n=u||e.isVideoTexture||e.isStorageTexture?t:`${t}${r?`, u32( ${r} )`:""}`,i=new Jo(new Iu(`textureDimensions( ${n} )`,a)),s.dimensionsSnippet[r]=i,(e.isArrayTexture||e.isDataArrayTexture||e.isData3DTexture)&&(s.arrayLayerCount=new Jo(new Iu(`textureNumLayers(${t})`,"u32"))),e.isTextureCube&&(s.cubeFaceCount=new Jo(new Iu("6u","u32")))}return i.build(this)}generateFilteredTexture(e,t,r,s="0u"){this._include("biquadraticTexture");return`tsl_biquadraticTexture( ${t}, ${this.generateWrapFunction(e)}( ${r} ), ${this.generateTextureDimension(e,t,s)}, u32( ${s} ) )`}generateTextureLod(e,t,r,s,i="0u"){const n=this.generateWrapFunction(e),a=this.generateTextureDimension(e,t,i),o=e.isData3DTexture?"vec3":"vec2",u=`${o}( ${n}( ${r} ) * ${o}( ${a} ) )`;return this.generateTextureLoad(e,t,u,s,i)}generateTextureLoad(e,t,r,s,i="0u"){let n;return!0===e.isVideoTexture?n=`textureLoad( ${t}, ${r} )`:s?n=`textureLoad( ${t}, ${r}, ${s}, u32( ${i} ) )`:(n=`textureLoad( ${t}, ${r}, u32( ${i} ) )`,this.renderer.backend.compatibilityMode&&e.isDepthTexture&&(n+=".x")),n}generateTextureStore(e,t,r,s,i){let n;return n=s?`textureStore( ${t}, ${r}, ${s}, ${i} )`:`textureStore( ${t}, ${r}, ${i} )`,n}isSampleCompare(e){return!0===e.isDepthTexture&&null!==e.compareFunction}isUnfilterable(e){return"float"!==this.getComponentTypeFromTexture(e)||!this.isAvailable("float32Filterable")&&!0===e.isDataTexture&&e.type===B||!1===this.isSampleCompare(e)&&e.minFilter===v&&e.magFilter===v||this.renderer.backend.utils.getTextureSampleData(e).primarySamples>1}generateTexture(e,t,r,s,i=this.shaderStage){let n=null;return n=!0===e.isVideoTexture?this._generateVideoSample(t,r,i):this.isUnfilterable(e)?this.generateTextureLod(e,t,r,s,"0",i):this._generateTextureSample(e,t,r,s,i),n}generateTextureGrad(e,t,r,s,i,n=this.shaderStage){if("fragment"===n)return`textureSampleGrad( ${t}, ${t}_sampler, ${r}, ${s[0]}, ${s[1]} )`;console.error(`WebGPURenderer: THREE.TextureNode.gradient() does not support ${n} shader.`)}generateTextureCompare(e,t,r,s,i,n=this.shaderStage){if("fragment"===n)return!0===e.isDepthTexture&&!0===e.isArrayTexture?`textureSampleCompare( ${t}, ${t}_sampler, ${r}, ${i}, ${s} )`:`textureSampleCompare( ${t}, ${t}_sampler, ${r}, ${s} )`;console.error(`WebGPURenderer: THREE.DepthTexture.compareFunction() does not support ${n} shader.`)}generateTextureLevel(e,t,r,s,i,n=this.shaderStage){let a=null;return a=!0===e.isVideoTexture?this._generateVideoSample(t,r,n):this._generateTextureSampleLevel(e,t,r,s,i),a}generateTextureBias(e,t,r,s,i,n=this.shaderStage){if("fragment"===n)return`textureSampleBias( ${t}, ${t}_sampler, ${r}, ${s} )`;console.error(`WebGPURenderer: THREE.TextureNode.biasNode does not support ${n} shader.`)}getPropertyName(e,t=this.shaderStage){if(!0===e.isNodeVarying&&!0===e.needsInterpolation){if("vertex"===t)return`varyings.${e.name}`}else if(!0===e.isNodeUniform){const t=e.name,r=e.type;return"texture"===r||"cubeTexture"===r||"storageTexture"===r||"texture3D"===r?t:"buffer"===r||"storageBuffer"===r||"indirectStorageBuffer"===r?this.isCustomStruct(e)?t:t+".value":e.groupNode.name+"."+t}return super.getPropertyName(e)}getOutputStructName(){return"output"}getFunctionOperator(e){const t=Kw[e];return void 0!==t?(this._include(t),t):null}getNodeAccess(e,t){return"compute"!==t?Os.READ_ONLY:e.access}getStorageAccess(e,t){return Ww[this.getNodeAccess(e,t)]}getUniformFromNode(e,t,r,s=null){const i=super.getUniformFromNode(e,t,r,s),n=this.getDataFromNode(e,r,this.globalCache);if(void 0===n.uniformGPU){let a;const o=e.groupNode,u=o.name,l=this.getBindGroupArray(u,r);if("texture"===t||"cubeTexture"===t||"storageTexture"===t||"texture3D"===t){let s=null;const n=this.getNodeAccess(e,r);if("texture"===t||"storageTexture"===t?s=new Gv(i.name,i.node,o,n):"cubeTexture"===t?s=new zv(i.name,i.node,o,n):"texture3D"===t&&(s=new Hv(i.name,i.node,o,n)),s.store=!0===e.isStorageTextureNode,s.setVisibility(qw[r]),!1===this.isUnfilterable(e.value)&&!1===s.store){const e=new Mw(`${i.name}_sampler`,i.node,o);e.setVisibility(qw[r]),l.push(e,s),a=[e,s]}else l.push(s),a=[s]}else if("buffer"===t||"storageBuffer"===t||"indirectStorageBuffer"===t){const n=new("buffer"===t?Iv:Lw)(e,o);n.setVisibility(qw[r]),l.push(n),a=n,i.name=s||"NodeBuffer_"+i.id}else{const e=this.uniformGroups[r]||(this.uniformGroups[r]={});let s=e[u];void 0===s&&(s=new Uv(u,o),s.setVisibility(qw[r]),e[u]=s,l.push(s)),a=this.getNodeUniform(i,t),s.addUniform(a)}n.uniformGPU=a}return i}getBuiltin(e,t,r,s=this.shaderStage){const i=this.builtins[s]||(this.builtins[s]=new Map);return!1===i.has(e)&&i.set(e,{name:e,property:t,type:r}),t}hasBuiltin(e,t=this.shaderStage){return void 0!==this.builtins[t]&&this.builtins[t].has(e)}getVertexIndex(){return"vertex"===this.shaderStage?this.getBuiltin("vertex_index","vertexIndex","u32","attribute"):"vertexIndex"}buildFunctionCode(e){const t=e.layout,r=this.flowShaderNode(e),s=[];for(const e of t.inputs)s.push(e.name+" : "+this.getType(e.type));let i=`fn ${t.name}( ${s.join(", ")} ) -> ${this.getType(t.type)} {\n${r.vars}\n${r.code}\n`;return r.result&&(i+=`\treturn ${r.result};\n`),i+="\n}\n",i}getInstanceIndex(){return"vertex"===this.shaderStage?this.getBuiltin("instance_index","instanceIndex","u32","attribute"):"instanceIndex"}getInvocationLocalIndex(){return this.getBuiltin("local_invocation_index","invocationLocalIndex","u32","attribute")}getSubgroupSize(){return this.enableSubGroups(),this.getBuiltin("subgroup_size","subgroupSize","u32","attribute")}getInvocationSubgroupIndex(){return this.enableSubGroups(),this.getBuiltin("subgroup_invocation_id","invocationSubgroupIndex","u32","attribute")}getSubgroupIndex(){return this.enableSubGroups(),this.getBuiltin("subgroup_id","subgroupIndex","u32","attribute")}getDrawIndex(){return null}getFrontFacing(){return this.getBuiltin("front_facing","isFront","bool")}getFragCoord(){return this.getBuiltin("position","fragCoord","vec4")+".xy"}getFragDepth(){return"output."+this.getBuiltin("frag_depth","depth","f32","output")}getClipDistance(){return"varyings.hw_clip_distances"}isFlipY(){return!1}enableDirective(e,t=this.shaderStage){(this.directives[t]||(this.directives[t]=new Set)).add(e)}getDirectives(e){const t=[],r=this.directives[e];if(void 0!==r)for(const e of r)t.push(`enable ${e};`);return t.join("\n")}enableSubGroups(){this.enableDirective("subgroups")}enableSubgroupsF16(){this.enableDirective("subgroups-f16")}enableClipDistances(){this.enableDirective("clip_distances")}enableShaderF16(){this.enableDirective("f16")}enableDualSourceBlending(){this.enableDirective("dual_source_blending")}enableHardwareClipping(e){this.enableClipDistances(),this.getBuiltin("clip_distances","hw_clip_distances",`array`,"vertex")}getBuiltins(e){const t=[],r=this.builtins[e];if(void 0!==r)for(const{name:e,property:s,type:i}of r.values())t.push(`@builtin( ${e} ) ${s} : ${i}`);return t.join(",\n\t")}getScopedArray(e,t,r,s){return!1===this.scopedArrays.has(e)&&this.scopedArrays.set(e,{name:e,scope:t,bufferType:r,bufferCount:s}),e}getScopedArrays(e){if("compute"!==e)return;const t=[];for(const{name:e,scope:r,bufferType:s,bufferCount:i}of this.scopedArrays.values()){const n=this.getType(s);t.push(`var<${r}> ${e}: array< ${n}, ${i} >;`)}return t.join("\n")}getAttributes(e){const t=[];if("compute"===e&&(this.getBuiltin("global_invocation_id","globalId","vec3","attribute"),this.getBuiltin("workgroup_id","workgroupId","vec3","attribute"),this.getBuiltin("local_invocation_id","localId","vec3","attribute"),this.getBuiltin("num_workgroups","numWorkgroups","vec3","attribute"),this.renderer.hasFeature("subgroups")&&(this.enableDirective("subgroups",e),this.getBuiltin("subgroup_size","subgroupSize","u32","attribute"))),"vertex"===e||"compute"===e){const e=this.getBuiltins("attribute");e&&t.push(e);const r=this.getAttributesArray();for(let e=0,s=r.length;e"),t.push(`\t${s+r.name} : ${i}`)}return e.output&&t.push(`\t${this.getBuiltins("output")}`),t.join(",\n")}getStructs(e){let t="";const r=this.structs[e];if(r.length>0){const e=[];for(const t of r){let r=`struct ${t.name} {\n`;r+=this.getStructMembers(t),r+="\n};",e.push(r)}t="\n"+e.join("\n\n")+"\n"}return t}getVar(e,t,r=null){let s=`var ${t} : `;return s+=null!==r?this.generateArrayDeclaration(e,r):this.getType(e),s}getVars(e){const t=[],r=this.vars[e];if(void 0!==r)for(const e of r)t.push(`\t${this.getVar(e.type,e.name,e.count)};`);return`\n${t.join("\n")}\n`}getVaryings(e){const t=[];if("vertex"===e&&this.getBuiltin("position","Vertex","vec4","vertex"),"vertex"===e||"fragment"===e){const r=this.varyings,s=this.vars[e];for(let i=0;ir.value.itemSize;return s&&!i}getUniforms(e){const t=this.uniforms[e],r=[],s=[],i=[],n={};for(const i of t){const t=i.groupNode.name,a=this.bindingsIndexes[t];if("texture"===i.type||"cubeTexture"===i.type||"storageTexture"===i.type||"texture3D"===i.type){const t=i.node.value;let s;!1===this.isUnfilterable(t)&&!0!==i.node.isStorageTextureNode&&(this.isSampleCompare(t)?r.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${i.name}_sampler : sampler_comparison;`):r.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${i.name}_sampler : sampler;`));let n="";const{primarySamples:o}=this.renderer.backend.utils.getTextureSampleData(t);if(o>1&&(n="_multisampled"),!0===t.isCubeTexture)s="texture_cube";else if(!0===t.isDepthTexture)s=this.renderer.backend.compatibilityMode&&null===t.compareFunction?`texture${n}_2d`:`texture_depth${n}_2d${!0===t.isArrayTexture?"_array":""}`;else if(!0===t.isArrayTexture||!0===t.isDataArrayTexture||!0===t.isCompressedArrayTexture)s="texture_2d_array";else if(!0===t.isVideoTexture)s="texture_external";else if(!0===t.isData3DTexture)s="texture_3d";else if(!0===i.node.isStorageTextureNode){s=`texture_storage_2d<${Uw(t)}, ${this.getStorageAccess(i.node,e)}>`}else{s=`texture${n}_2d<${this.getComponentTypeFromTexture(t).charAt(0)}32>`}r.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${i.name} : ${s};`)}else if("buffer"===i.type||"storageBuffer"===i.type||"indirectStorageBuffer"===i.type){const t=i.node,r=this.getType(t.getNodeType(this)),n=t.bufferCount,o=n>0&&"buffer"===i.type?", "+n:"",u=t.isStorageBufferNode?`storage, ${this.getStorageAccess(t,e)}`:"uniform";if(this.isCustomStruct(i))s.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var<${u}> ${i.name} : ${r};`);else{const e=`\tvalue : array< ${t.isAtomic?`atomic<${r}>`:`${r}`}${o} >`;s.push(this._getWGSLStructBinding(i.name,e,u,a.binding++,a.group))}}else{const e=this.getType(this.getVectorType(i.type)),t=i.groupNode.name;(n[t]||(n[t]={index:a.binding++,id:a.group,snippets:[]})).snippets.push(`\t${i.name} : ${e}`)}}for(const e in n){const t=n[e];i.push(this._getWGSLStructBinding(e,t.snippets.join(",\n"),"uniform",t.index,t.id))}let a=r.join("\n");return a+=s.join("\n"),a+=i.join("\n"),a}buildCode(){const e=null!==this.material?{fragment:{},vertex:{}}:{compute:{}};this.sortBindingGroups();for(const t in e){this.shaderStage=t;const r=e[t];r.uniforms=this.getUniforms(t),r.attributes=this.getAttributes(t),r.varyings=this.getVaryings(t),r.structs=this.getStructs(t),r.vars=this.getVars(t),r.codes=this.getCodes(t),r.directives=this.getDirectives(t),r.scopedArrays=this.getScopedArrays(t);let s="// code\n\n";s+=this.flowCode[t];const i=this.flowNodes[t],n=i[i.length-1],a=n.outputNode,o=void 0!==a&&!0===a.isOutputStructNode;for(const e of i){const i=this.getFlowData(e),u=e.name;if(u&&(s.length>0&&(s+="\n"),s+=`\t// flow -> ${u}\n`),s+=`${i.code}\n\t`,e===n&&"compute"!==t)if(s+="// result\n\n\t","vertex"===t)s+=`varyings.Vertex = ${i.result};`;else if("fragment"===t)if(o)r.returnType=a.getNodeType(this),r.structs+="var output : "+r.returnType+";",s+=`return ${i.result};`;else{let e="\t@location(0) color: vec4";const t=this.getBuiltins("output");t&&(e+=",\n\t"+t),r.returnType="OutputStruct",r.structs+=this._getWGSLStruct("OutputStruct",e),r.structs+="\nvar output : OutputStruct;",s+=`output.color = ${i.result};\n\n\treturn output;`}}r.flow=s}this.shaderStage=null,null!==this.material?(this.vertexShader=this._getWGSLVertexCode(e.vertex),this.fragmentShader=this._getWGSLFragmentCode(e.fragment)):this.computeShader=this._getWGSLComputeCode(e.compute,(this.object.workgroupSize||[64]).join(", "))}getMethod(e,t=null){let r;return null!==t&&(r=this._getWGSLMethod(e+"_"+t)),void 0===r&&(r=this._getWGSLMethod(e)),r||e}getType(e){return Yw[e]||e}isAvailable(e){let t=Xw[e];return void 0===t&&("float32Filterable"===e?t=this.renderer.hasFeature("float32-filterable"):"clipDistance"===e&&(t=this.renderer.hasFeature("clip-distances")),Xw[e]=t),t}_getWGSLMethod(e){return void 0!==Zw[e]&&this._include(e),Jw[e]}_include(e){const t=Zw[e];return t.build(this),null!==this.currentFunctionNode&&this.currentFunctionNode.includes.push(t),t}_getWGSLVertexCode(e){return`${this.getSignature()}\n// directives\n${e.directives}\n\n// structs\n${e.structs}\n\n// uniforms\n${e.uniforms}\n\n// varyings\n${e.varyings}\nvar varyings : VaryingsStruct;\n\n// codes\n${e.codes}\n\n@vertex\nfn main( ${e.attributes} ) -> VaryingsStruct {\n\n\t// vars\n\t${e.vars}\n\n\t// flow\n\t${e.flow}\n\n\treturn varyings;\n\n}\n`}_getWGSLFragmentCode(e){return`${this.getSignature()}\n// global\n${eA}\n\n// structs\n${e.structs}\n\n// uniforms\n${e.uniforms}\n\n// codes\n${e.codes}\n\n@fragment\nfn main( ${e.varyings} ) -> ${e.returnType} {\n\n\t// vars\n\t${e.vars}\n\n\t// flow\n\t${e.flow}\n\n}\n`}_getWGSLComputeCode(e,t){return`${this.getSignature()}\n// directives\n${e.directives}\n\n// system\nvar instanceIndex : u32;\n\n// locals\n${e.scopedArrays}\n\n// structs\n${e.structs}\n\n// uniforms\n${e.uniforms}\n\n// codes\n${e.codes}\n\n@compute @workgroup_size( ${t} )\nfn main( ${e.attributes} ) {\n\n\t// system\n\tinstanceIndex = globalId.x + globalId.y * numWorkgroups.x * u32(${t}) + globalId.z * numWorkgroups.x * numWorkgroups.y * u32(${t});\n\n\t// vars\n\t${e.vars}\n\n\t// flow\n\t${e.flow}\n\n}\n`}_getWGSLStruct(e,t){return`\nstruct ${e} {\n${t}\n};`}_getWGSLStructBinding(e,t,r,s=0,i=0){const n=e+"Struct";return`${this._getWGSLStruct(n,t)}\n@binding( ${s} ) @group( ${i} )\nvar<${r}> ${e} : ${n};`}}class rA{constructor(e){this.backend=e}getCurrentDepthStencilFormat(e){let t;return null!==e.depthTexture?t=this.getTextureFormatGPU(e.depthTexture):e.depth&&e.stencil?t=AS:e.depth&&(t=wS),t}getTextureFormatGPU(e){return this.backend.get(e).format}getTextureSampleData(e){let t;if(e.isFramebufferTexture)t=1;else if(e.isDepthTexture&&!e.renderTarget){const e=this.backend.renderer,r=e.getRenderTarget();t=r?r.samples:e.samples}else e.renderTarget&&(t=e.renderTarget.samples);t=t||1;const r=t>1&&null!==e.renderTarget&&!0!==e.isDepthTexture&&!0!==e.isFramebufferTexture;return{samples:t,primarySamples:r?1:t,isMSAA:r}}getCurrentColorFormat(e){let t;return t=null!==e.textures?this.getTextureFormatGPU(e.textures[0]):this.getPreferredCanvasFormat(),t}getCurrentColorSpace(e){return null!==e.textures?e.textures[0].colorSpace:this.backend.renderer.outputColorSpace}getPrimitiveTopology(e,t){return e.isPoints?_N:e.isLineSegments||e.isMesh&&!0===t.wireframe?vN:e.isLine?NN:e.isMesh?SN:void 0}getSampleCount(e){let t=1;return e>1&&(t=Math.pow(2,Math.floor(Math.log2(e))),2===t&&(t=4)),t}getSampleCountRenderContext(e){return null!==e.textures?this.getSampleCount(e.sampleCount):this.getSampleCount(this.backend.renderer.samples)}getPreferredCanvasFormat(){const e=this.backend.parameters.outputType;if(void 0===e)return navigator.gpu.getPreferredCanvasFormat();if(e===Ce)return cS;if(e===de)return _S;throw new Error("Unsupported outputType")}}const sA=new Map([[Int8Array,["sint8","snorm8"]],[Uint8Array,["uint8","unorm8"]],[Int16Array,["sint16","snorm16"]],[Uint16Array,["uint16","unorm16"]],[Int32Array,["sint32","snorm32"]],[Uint32Array,["uint32","unorm32"]],[Float32Array,["float32"]]]),iA=new Map([[ze,["float16"]]]),nA=new Map([[Int32Array,"sint32"],[Int16Array,"sint32"],[Uint32Array,"uint32"],[Uint16Array,"uint32"],[Float32Array,"float32"]]);class aA{constructor(e){this.backend=e}createAttribute(e,t){const r=this._getBufferAttribute(e),s=this.backend,i=s.get(r);let n=i.buffer;if(void 0===n){const a=s.device;let o=r.array;if(!1===e.normalized)if(o.constructor===Int16Array||o.constructor===Int8Array)o=new Int32Array(o);else if((o.constructor===Uint16Array||o.constructor===Uint8Array)&&(o=new Uint32Array(o),t&GPUBufferUsage.INDEX))for(let e=0;e1&&(s.multisampled=!0,r.texture.isDepthTexture||(s.sampleType=mw)),r.texture.isDepthTexture)t.compatibilityMode&&null===r.texture.compareFunction?s.sampleType=mw:s.sampleType=fw;else if(r.texture.isDataTexture||r.texture.isDataArrayTexture||r.texture.isData3DTexture){const e=r.texture.type;e===_?s.sampleType=yw:e===T?s.sampleType=xw:e===B&&(this.backend.hasFeature("float32-filterable")?s.sampleType=gw:s.sampleType=mw)}r.isSampledCubeTexture?s.viewDimension=Nw:r.texture.isArrayTexture||r.texture.isDataArrayTexture||r.texture.isCompressedArrayTexture?s.viewDimension=vw:r.isSampledTexture3D&&(s.viewDimension=Sw),e.texture=s}else console.error(`WebGPUBindingUtils: Unsupported binding "${r}".`);s.push(e)}return r.createBindGroupLayout({entries:s})}createBindings(e,t,r,s=0){const{backend:i,bindGroupLayoutCache:n}=this,a=i.get(e);let o,u=n.get(e.bindingsReference);void 0===u&&(u=this.createBindingsLayout(e),n.set(e.bindingsReference,u)),r>0&&(void 0===a.groups&&(a.groups=[],a.versions=[]),a.versions[r]===s&&(o=a.groups[r])),void 0===o&&(o=this.createBindGroup(e,u),r>0&&(a.groups[r]=o,a.versions[r]=s)),a.group=o,a.layout=u}updateBinding(e){const t=this.backend,r=t.device,s=e.buffer,i=t.get(e).buffer;r.queue.writeBuffer(i,0,s,0)}createBindGroupIndex(e,t){const r=this.backend.device,s=GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,i=e[0],n=r.createBuffer({label:"bindingCameraIndex_"+i,size:16,usage:s});r.queue.writeBuffer(n,0,e,0);const a=[{binding:0,resource:{buffer:n}}];return r.createBindGroup({label:"bindGroupCameraIndex_"+i,layout:t,entries:a})}createBindGroup(e,t){const r=this.backend,s=r.device;let i=0;const n=[];for(const t of e.bindings){if(t.isUniformBuffer){const e=r.get(t);if(void 0===e.buffer){const r=t.byteLength,i=GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,n=s.createBuffer({label:"bindingBuffer_"+t.name,size:r,usage:i});e.buffer=n}n.push({binding:i,resource:{buffer:e.buffer}})}else if(t.isStorageBuffer){const e=r.get(t);if(void 0===e.buffer){const s=t.attribute;e.buffer=r.get(s).buffer}n.push({binding:i,resource:{buffer:e.buffer}})}else if(t.isSampler){const e=r.get(t.texture);n.push({binding:i,resource:e.sampler})}else if(t.isSampledTexture){const e=r.get(t.texture);let a;if(void 0!==e.externalTexture)a=s.importExternalTexture({source:e.externalTexture});else{const r=t.store?1:e.texture.mipLevelCount,s=`view-${e.texture.width}-${e.texture.height}-${r}`;if(a=e[s],void 0===a){const i=Ew;let n;n=t.isSampledCubeTexture?Nw:t.isSampledTexture3D?Sw:t.texture.isArrayTexture||t.texture.isDataArrayTexture||t.texture.isCompressedArrayTexture?vw:_w,a=e[s]=e.texture.createView({aspect:i,dimension:n,mipLevelCount:r})}}n.push({binding:i,resource:a})}i++}return s.createBindGroup({label:"bindGroup_"+e.name,layout:t,entries:n})}}class uA{constructor(e){this.backend=e,this._activePipelines=new WeakMap}setPipeline(e,t){this._activePipelines.get(e)!==t&&(e.setPipeline(t),this._activePipelines.set(e,t))}_getSampleCount(e){return this.backend.utils.getSampleCountRenderContext(e)}createRenderPipeline(e,t){const{object:r,material:s,geometry:i,pipeline:n}=e,{vertexProgram:a,fragmentProgram:o}=n,u=this.backend,l=u.device,d=u.utils,c=u.get(n),h=[];for(const t of e.getBindings()){const e=u.get(t);h.push(e.layout)}const p=u.attributeUtils.createShaderVertexBuffers(e);let g;s.blending===z||s.blending===O&&!1===s.transparent||(g=this._getBlending(s));let m={};!0===s.stencilWrite&&(m={compare:this._getStencilCompare(s),failOp:this._getStencilOperation(s.stencilFail),depthFailOp:this._getStencilOperation(s.stencilZFail),passOp:this._getStencilOperation(s.stencilZPass)});const f=this._getColorWriteMask(s),y=[];if(null!==e.context.textures){const t=e.context.textures;for(let e=0;e1},layout:l.createPipelineLayout({bindGroupLayouts:h})},E={},w=e.context.depth,A=e.context.stencil;if(!0!==w&&!0!==A||(!0===w&&(E.format=v,E.depthWriteEnabled=s.depthWrite,E.depthCompare=_),!0===A&&(E.stencilFront=m,E.stencilBack={},E.stencilReadMask=s.stencilFuncMask,E.stencilWriteMask=s.stencilWriteMask),!0===s.polygonOffset&&(E.depthBias=s.polygonOffsetUnits,E.depthBiasSlopeScale=s.polygonOffsetFactor,E.depthBiasClamp=0),S.depthStencil=E),null===t)c.pipeline=l.createRenderPipeline(S);else{const e=new Promise((e=>{l.createRenderPipelineAsync(S).then((t=>{c.pipeline=t,e()}))}));t.push(e)}}createBundleEncoder(e,t="renderBundleEncoder"){const r=this.backend,{utils:s,device:i}=r,n=s.getCurrentDepthStencilFormat(e),a={label:t,colorFormats:[s.getCurrentColorFormat(e)],depthStencilFormat:n,sampleCount:this._getSampleCount(e)};return i.createRenderBundleEncoder(a)}createComputePipeline(e,t){const r=this.backend,s=r.device,i=r.get(e.computeProgram).module,n=r.get(e),a=[];for(const e of t){const t=r.get(e);a.push(t.layout)}n.pipeline=s.createComputePipeline({compute:i,layout:s.createPipelineLayout({bindGroupLayouts:a})})}_getBlending(e){let t,r;const s=e.blending,i=e.blendSrc,n=e.blendDst,a=e.blendEquation;if(s===qe){const s=null!==e.blendSrcAlpha?e.blendSrcAlpha:i,o=null!==e.blendDstAlpha?e.blendDstAlpha:n,u=null!==e.blendEquationAlpha?e.blendEquationAlpha:a;t={srcFactor:this._getBlendFactor(i),dstFactor:this._getBlendFactor(n),operation:this._getBlendOperation(a)},r={srcFactor:this._getBlendFactor(s),dstFactor:this._getBlendFactor(o),operation:this._getBlendOperation(u)}}else{const i=(e,s,i,n)=>{t={srcFactor:e,dstFactor:s,operation:jE},r={srcFactor:i,dstFactor:n,operation:jE}};if(e.premultipliedAlpha)switch(s){case O:i(BE,UE,BE,UE);break;case Ft:i(BE,BE,BE,BE);break;case Pt:i(LE,DE,LE,BE);break;case Mt:i(LE,IE,LE,VE)}else switch(s){case O:i(VE,UE,BE,UE);break;case Ft:i(VE,BE,VE,BE);break;case Pt:i(LE,DE,LE,BE);break;case Mt:i(LE,IE,LE,IE)}}if(void 0!==t&&void 0!==r)return{color:t,alpha:r};console.error("THREE.WebGPURenderer: Invalid blending: ",s)}_getBlendFactor(e){let t;switch(e){case Ke:t=LE;break;case wt:t=BE;break;case Et:t=IE;break;case Tt:t=DE;break;case St:t=VE;break;case bt:t=UE;break;case vt:t=OE;break;case xt:t=kE;break;case _t:t=GE;break;case yt:t=zE;break;case Nt:t=HE;break;case 211:t=$E;break;case 212:t=WE;break;default:console.error("THREE.WebGPURenderer: Blend factor not supported.",e)}return t}_getStencilCompare(e){let t;const r=e.stencilFunc;switch(r){case kr:t=wN;break;case Or:t=LN;break;case Ur:t=AN;break;case Vr:t=CN;break;case Dr:t=RN;break;case Ir:t=FN;break;case Br:t=MN;break;case Lr:t=PN;break;default:console.error("THREE.WebGPURenderer: Invalid stencil function.",r)}return t}_getStencilOperation(e){let t;switch(e){case Xr:t=JE;break;case qr:t=ew;break;case jr:t=tw;break;case Wr:t=rw;break;case $r:t=sw;break;case Hr:t=iw;break;case zr:t=nw;break;case Gr:t=aw;break;default:console.error("THREE.WebGPURenderer: Invalid stencil operation.",t)}return t}_getBlendOperation(e){let t;switch(e){case Xe:t=jE;break;case ft:t=qE;break;case mt:t=XE;break;case Yr:t=KE;break;case Kr:t=YE;break;default:console.error("THREE.WebGPUPipelineUtils: Blend equation not supported.",e)}return t}_getPrimitiveState(e,t,r){const s={},i=this.backend.utils;switch(s.topology=i.getPrimitiveTopology(e,r),null!==t.index&&!0===e.isLine&&!0!==e.isLineSegments&&(s.stripIndexFormat=t.index.array instanceof Uint16Array?GN:zN),r.side){case je:s.frontFace=VN,s.cullMode=kN;break;case S:s.frontFace=VN,s.cullMode=ON;break;case Se:s.frontFace=VN,s.cullMode=UN;break;default:console.error("THREE.WebGPUPipelineUtils: Unknown material.side value.",r.side)}return s}_getColorWriteMask(e){return!0===e.colorWrite?ZE:QE}_getDepthCompare(e){let t;if(!1===e.depthTest)t=LN;else{const r=e.depthFunc;switch(r){case kt:t=wN;break;case Ot:t=LN;break;case Ut:t=AN;break;case Vt:t=CN;break;case Dt:t=RN;break;case It:t=FN;break;case Bt:t=MN;break;case Lt:t=PN;break;default:console.error("THREE.WebGPUPipelineUtils: Invalid depth function.",r)}}return t}}class lA extends yN{constructor(e,t,r=2048){super(r),this.device=e,this.type=t,this.querySet=this.device.createQuerySet({type:"timestamp",count:this.maxQueries,label:`queryset_global_timestamp_${t}`});const s=8*this.maxQueries;this.resolveBuffer=this.device.createBuffer({label:`buffer_timestamp_resolve_${t}`,size:s,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),this.resultBuffer=this.device.createBuffer({label:`buffer_timestamp_result_${t}`,size:s,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ})}allocateQueriesForContext(e){if(!this.trackTimestamp||this.isDisposed)return null;if(this.currentQueryIndex+2>this.maxQueries)return pt(`WebGPUTimestampQueryPool [${this.type}]: Maximum number of queries exceeded, when using trackTimestamp it is necessary to resolves the queries via renderer.resolveTimestampsAsync( THREE.TimestampQuery.${this.type.toUpperCase()} ).`),null;const t=this.currentQueryIndex;return this.currentQueryIndex+=2,this.queryOffsets.set(e.id,t),t}async resolveQueriesAsync(){if(!this.trackTimestamp||0===this.currentQueryIndex||this.isDisposed)return this.lastValue;if(this.pendingResolve)return this.pendingResolve;this.pendingResolve=this._resolveQueries();try{return await this.pendingResolve}finally{this.pendingResolve=null}}async _resolveQueries(){if(this.isDisposed)return this.lastValue;try{if("unmapped"!==this.resultBuffer.mapState)return this.lastValue;const e=new Map(this.queryOffsets),t=this.currentQueryIndex,r=8*t;this.currentQueryIndex=0,this.queryOffsets.clear();const s=this.device.createCommandEncoder();s.resolveQuerySet(this.querySet,0,t,this.resolveBuffer,0),s.copyBufferToBuffer(this.resolveBuffer,0,this.resultBuffer,0,r);const i=s.finish();if(this.device.queue.submit([i]),"unmapped"!==this.resultBuffer.mapState)return this.lastValue;if(await this.resultBuffer.mapAsync(GPUMapMode.READ,0,r),this.isDisposed)return"mapped"===this.resultBuffer.mapState&&this.resultBuffer.unmap(),this.lastValue;const n=new BigUint64Array(this.resultBuffer.getMappedRange(0,r));let a=0;for(const[,t]of e){const e=n[t],r=n[t+1];a+=Number(r-e)/1e6}return this.resultBuffer.unmap(),this.lastValue=a,a}catch(e){return console.error("Error resolving queries:",e),"mapped"===this.resultBuffer.mapState&&this.resultBuffer.unmap(),this.lastValue}}async dispose(){if(!this.isDisposed){if(this.isDisposed=!0,this.pendingResolve)try{await this.pendingResolve}catch(e){console.error("Error waiting for pending resolve:",e)}if(this.resultBuffer&&"mapped"===this.resultBuffer.mapState)try{this.resultBuffer.unmap()}catch(e){console.error("Error unmapping buffer:",e)}this.querySet&&(this.querySet.destroy(),this.querySet=null),this.resolveBuffer&&(this.resolveBuffer.destroy(),this.resolveBuffer=null),this.resultBuffer&&(this.resultBuffer.destroy(),this.resultBuffer=null),this.queryOffsets.clear(),this.pendingResolve=null}}}class dA extends Jv{constructor(e={}){super(e),this.isWebGPUBackend=!0,this.parameters.alpha=void 0===e.alpha||e.alpha,this.parameters.compatibilityMode=void 0!==e.compatibilityMode&&e.compatibilityMode,this.parameters.requiredLimits=void 0===e.requiredLimits?{}:e.requiredLimits,this.compatibilityMode=this.parameters.compatibilityMode,this.device=null,this.context=null,this.colorBuffer=null,this.defaultRenderPassdescriptor=null,this.utils=new rA(this),this.attributeUtils=new aA(this),this.bindingUtils=new oA(this),this.pipelineUtils=new uA(this),this.textureUtils=new Vw(this),this.occludedResolveCache=new Map}async init(e){await super.init(e);const t=this.parameters;let r;if(void 0===t.device){const e={powerPreference:t.powerPreference,featureLevel:t.compatibilityMode?"compatibility":void 0},s="undefined"!=typeof navigator?await navigator.gpu.requestAdapter(e):null;if(null===s)throw new Error("WebGPUBackend: Unable to create WebGPU adapter.");const i=Object.values(Rw),n=[];for(const e of i)s.features.has(e)&&n.push(e);const a={requiredFeatures:n,requiredLimits:t.requiredLimits};r=await s.requestDevice(a)}else r=t.device;r.lost.then((t=>{const r={api:"WebGPU",message:t.message||"Unknown reason",reason:t.reason||null,originalEvent:t};e.onDeviceLost(r)}));const s=void 0!==t.context?t.context:e.domElement.getContext("webgpu");this.device=r,this.context=s;const i=t.alpha?"premultiplied":"opaque";this.trackTimestamp=this.trackTimestamp&&this.hasFeature(Rw.TimestampQuery),this.context.configure({device:this.device,format:this.utils.getPreferredCanvasFormat(),usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,alphaMode:i}),this.updateSize()}get coordinateSystem(){return d}async getArrayBufferAsync(e){return await this.attributeUtils.getArrayBufferAsync(e)}getContext(){return this.context}_getDefaultRenderPassDescriptor(){let e=this.defaultRenderPassdescriptor;if(null===e){const t=this.renderer;e={colorAttachments:[{view:null}]},!0!==this.renderer.depth&&!0!==this.renderer.stencil||(e.depthStencilAttachment={view:this.textureUtils.getDepthBuffer(t.depth,t.stencil).createView()});const r=e.colorAttachments[0];this.renderer.samples>0?r.view=this.colorBuffer.createView():r.resolveTarget=void 0,this.defaultRenderPassdescriptor=e}const t=e.colorAttachments[0];return this.renderer.samples>0?t.resolveTarget=this.context.getCurrentTexture().createView():t.view=this.context.getCurrentTexture().createView(),e}_isRenderCameraDepthArray(e){return e.depthTexture&&e.depthTexture.image.depth>1&&e.camera.isArrayCamera}_getRenderPassDescriptor(e,t={}){const r=e.renderTarget,s=this.get(r);let i=s.descriptors;if(void 0===i||s.width!==r.width||s.height!==r.height||s.dimensions!==r.dimensions||s.activeMipmapLevel!==e.activeMipmapLevel||s.activeCubeFace!==e.activeCubeFace||s.samples!==r.samples){i={},s.descriptors=i;const e=()=>{r.removeEventListener("dispose",e),this.delete(r)};!1===r.hasEventListener("dispose",e)&&r.addEventListener("dispose",e)}const n=e.getCacheKey();let a=i[n];if(void 0===a){const t=e.textures,o=[];let u;const l=this._isRenderCameraDepthArray(e);for(let s=0;s1)if(!0===l){const t=e.camera.cameras;for(let e=0;e0&&(t.currentOcclusionQuerySet&&t.currentOcclusionQuerySet.destroy(),t.currentOcclusionQueryBuffer&&t.currentOcclusionQueryBuffer.destroy(),t.currentOcclusionQuerySet=t.occlusionQuerySet,t.currentOcclusionQueryBuffer=t.occlusionQueryBuffer,t.currentOcclusionQueryObjects=t.occlusionQueryObjects,i=r.createQuerySet({type:"occlusion",count:s,label:`occlusionQuerySet_${e.id}`}),t.occlusionQuerySet=i,t.occlusionQueryIndex=0,t.occlusionQueryObjects=new Array(s),t.lastOcclusionObject=null),n=null===e.textures?this._getDefaultRenderPassDescriptor():this._getRenderPassDescriptor(e,{loadOp:IN}),this.initTimestampQuery(e,n),n.occlusionQuerySet=i;const a=n.depthStencilAttachment;if(null!==e.textures){const t=n.colorAttachments;for(let r=0;r0&&t.currentPass.executeBundles(t.renderBundles),r>t.occlusionQueryIndex&&t.currentPass.endOcclusionQuery();const s=t.encoder;if(!0===this._isRenderCameraDepthArray(e)){const r=[];for(let e=0;e0){const s=8*r;let i=this.occludedResolveCache.get(s);void 0===i&&(i=this.device.createBuffer({size:s,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),this.occludedResolveCache.set(s,i));const n=this.device.createBuffer({size:s,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});t.encoder.resolveQuerySet(t.occlusionQuerySet,0,r,i,0),t.encoder.copyBufferToBuffer(i,0,n,0,s),t.occlusionQueryBuffer=n,this.resolveOccludedAsync(e)}if(this.device.queue.submit([t.encoder.finish()]),null!==e.textures){const t=e.textures;for(let e=0;ea?(u.x=Math.min(t.dispatchCount,a),u.y=Math.ceil(t.dispatchCount/a)):u.x=t.dispatchCount,i.dispatchWorkgroups(u.x,u.y,u.z)}finishCompute(e){const t=this.get(e);t.passEncoderGPU.end(),this.device.queue.submit([t.cmdEncoderGPU.finish()])}async waitForGPU(){await this.device.queue.onSubmittedWorkDone()}draw(e,t){const{object:r,material:s,context:i,pipeline:n}=e,a=e.getBindings(),o=this.get(i),u=this.get(n).pipeline,l=e.getIndex(),d=null!==l,c=e.getDrawParameters();if(null===c)return;const h=(t,r)=>{this.pipelineUtils.setPipeline(t,u),r.pipeline=u;const n=r.bindingGroups;for(let e=0,r=a.length;e{if(h(s,i),!0===r.isBatchedMesh){const e=r._multiDrawStarts,i=r._multiDrawCounts,n=r._multiDrawCount,a=r._multiDrawInstances;null!==a&&pt("THREE.WebGPUBackend: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.");for(let o=0;o1?0:o;!0===d?s.drawIndexed(i[o],n,e[o]/l.array.BYTES_PER_ELEMENT,0,u):s.draw(i[o],n,e[o],u),t.update(r,i[o],n)}}else if(!0===d){const{vertexCount:i,instanceCount:n,firstVertex:a}=c,o=e.getIndirect();if(null!==o){const e=this.get(o).buffer;s.drawIndexedIndirect(e,0)}else s.drawIndexed(i,n,a,0,0);t.update(r,i,n)}else{const{vertexCount:i,instanceCount:n,firstVertex:a}=c,o=e.getIndirect();if(null!==o){const e=this.get(o).buffer;s.drawIndirect(e,0)}else s.draw(i,n,a,0);t.update(r,i,n)}};if(e.camera.isArrayCamera&&e.camera.cameras.length>0){const t=this.get(e.camera),s=e.camera.cameras,n=e.getBindingGroup("cameraIndex");if(void 0===t.indexesGPU||t.indexesGPU.length!==s.length){const e=this.get(n),r=[],i=new Uint32Array([0,0,0,0]);for(let t=0,n=s.length;t(console.warn("THREE.WebGPURenderer: WebGPU is not available, running under WebGL2 backend."),new TN(e)));super(new t(e),e),this.library=new pA,this.isWebGPURenderer=!0}}class mA extends ds{constructor(){super(),this.isBundleGroup=!0,this.type="BundleGroup",this.static=!0,this.version=0}set needsUpdate(e){!0===e&&this.version++}}class fA{constructor(e,t=nn(0,0,1,1)){this.renderer=e,this.outputNode=t,this.outputColorTransform=!0,this.needsUpdate=!0;const r=new Wh;r.name="PostProcessing",this._quadMesh=new vy(r)}render(){this._update();const e=this.renderer,t=e.toneMapping,r=e.outputColorSpace;e.toneMapping=p,e.outputColorSpace=ue;const s=e.xr.enabled;e.xr.enabled=!1,this._quadMesh.render(e),e.xr.enabled=s,e.toneMapping=t,e.outputColorSpace=r}dispose(){this._quadMesh.material.dispose()}_update(){if(!0===this.needsUpdate){const e=this.renderer,t=e.toneMapping,r=e.outputColorSpace;this._quadMesh.material.fragmentNode=!0===this.outputColorTransform?Ou(this.outputNode,t,r):this.outputNode.context({toneMapping:t,outputColorSpace:r}),this._quadMesh.material.needsUpdate=!0,this.needsUpdate=!1}}async renderAsync(){this._update();const e=this.renderer,t=e.toneMapping,r=e.outputColorSpace;e.toneMapping=p,e.outputColorSpace=ue;const s=e.xr.enabled;e.xr.enabled=!1,await this._quadMesh.renderAsync(e),e.xr.enabled=s,e.toneMapping=t,e.outputColorSpace=r}}class yA extends b{constructor(e=1,t=1){super(),this.image={width:e,height:t},this.magFilter=K,this.minFilter=K,this.isStorageTexture=!0}}class xA extends My{constructor(e,t){super(e,t,Uint32Array),this.isIndirectStorageBufferAttribute=!0}}class bA extends cs{constructor(e){super(e),this.textures={},this.nodes={}}load(e,t,r,s){const i=new hs(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,(r=>{try{t(this.parse(JSON.parse(r)))}catch(t){s?s(t):console.error(t),this.manager.itemError(e)}}),r,s)}parseNodes(e){const t={};if(void 0!==e){for(const r of e){const{uuid:e,type:s}=r;t[e]=this.createNodeFromType(s),t[e].uuid=e}const r={nodes:t,textures:this.textures};for(const s of e){s.meta=r;t[s.uuid].deserialize(s),delete s.meta}}return t}parse(e){const t=this.createNodeFromType(e.type);t.uuid=e.uuid;const r={nodes:this.parseNodes(e.nodes),textures:this.textures};return e.meta=r,t.deserialize(e),delete e.meta,t}setTextures(e){return this.textures=e,this}setNodes(e){return this.nodes=e,this}createNodeFromType(e){return void 0===this.nodes[e]?(console.error("THREE.NodeLoader: Node type not found:",e),ji()):Bi(new this.nodes[e])}}class TA extends ps{constructor(e){super(e),this.nodes={},this.nodeMaterials={}}parse(e){const t=super.parse(e),r=this.nodes,s=e.inputNodes;for(const e in s){const i=s[e];t[e]=r[i]}return t}setNodes(e){return this.nodes=e,this}setNodeMaterials(e){return this.nodeMaterials=e,this}createMaterialFromType(e){const t=this.nodeMaterials[e];return void 0!==t?new t:super.createMaterialFromType(e)}}class _A extends gs{constructor(e){super(e),this.nodes={},this.nodeMaterials={},this._nodesJSON=null}setNodes(e){return this.nodes=e,this}setNodeMaterials(e){return this.nodeMaterials=e,this}parse(e,t){this._nodesJSON=e.nodes;const r=super.parse(e,t);return this._nodesJSON=null,r}parseNodes(e,t){if(void 0!==e){const r=new bA;return r.setNodes(this.nodes),r.setTextures(t),r.parseNodes(e)}return{}}parseMaterials(e,t){const r={};if(void 0!==e){const s=this.parseNodes(this._nodesJSON,t),i=new TA;i.setTextures(t),i.setNodes(s),i.setNodeMaterials(this.nodeMaterials);for(let t=0,s=e.length;t0){const{width:r,height:s}=e.context;t.bufferWidth=r,t.bufferHeight=s}this.renderObjects.set(e,t)}return t}getAttributesData(e){const t={};for(const r in e){const s=e[r];t[r]={version:s.version}}return t}containsNode(e){const t=e.material;for(const e in t)if(t[e]&&t[e].isNode)return!0;return null!==e.renderer.overrideNodes.modelViewMatrix||null!==e.renderer.overrideNodes.modelNormalViewMatrix}getMaterialData(e){const t={};for(const r of this.refreshUniforms){const s=e[r];null!=s&&("object"==typeof s&&void 0!==s.clone?!0===s.isTexture?t[r]={id:s.id,version:s.version}:t[r]=s.clone():t[r]=s)}return t}equals(e){const{object:t,material:r,geometry:s}=e,i=this.getRenderObjectData(e);if(!0!==i.worldMatrix.equals(t.matrixWorld))return i.worldMatrix.copy(t.matrixWorld),!1;const n=i.material;for(const e in n){const t=n[e],s=r[e];if(void 0!==t.equals){if(!1===t.equals(s))return t.copy(s),!1}else if(!0===s.isTexture){if(t.id!==s.id||t.version!==s.version)return t.id=s.id,t.version=s.version,!1}else if(t!==s)return n[e]=s,!1}if(n.transmission>0){const{width:t,height:r}=e.context;if(i.bufferWidth!==t||i.bufferHeight!==r)return i.bufferWidth=t,i.bufferHeight=r,!1}const a=i.geometry,o=s.attributes,u=a.attributes,l=Object.keys(u),d=Object.keys(o);if(a.id!==s.id)return a.id=s.id,!1;if(l.length!==d.length)return i.geometry.attributes=this.getAttributesData(o),!1;for(const e of l){const t=u[e],r=o[e];if(void 0===r)return delete u[e],!1;if(t.version!==r.version)return t.version=r.version,!1}const c=s.index,h=a.indexVersion,p=c?c.version:null;if(h!==p)return a.indexVersion=p,!1;if(a.drawRange.start!==s.drawRange.start||a.drawRange.count!==s.drawRange.count)return a.drawRange.start=s.drawRange.start,a.drawRange.count=s.drawRange.count,!1;if(i.morphTargetInfluences){let e=!1;for(let r=0;r>>16,2246822507),r^=Math.imul(s^s>>>13,3266489909),s=Math.imul(s^s>>>16,2246822507),s^=Math.imul(r^r>>>13,3266489909),4294967296*(2097151&s)+(r>>>0)}const bs=e=>ys(e),xs=e=>ys(e),Ts=(...e)=>ys(e);function _s(e,t=!1){const r=[];!0===e.isNode&&(r.push(e.id),e=e.getSelf());for(const{property:s,childNode:i}of vs(e))r.push(ys(s.slice(0,-4)),i.getCacheKey(t));return ys(r)}function*vs(e,t=!1){for(const r in e){if(!0===r.startsWith("_"))continue;const s=e[r];if(!0===Array.isArray(s))for(let e=0;ee.charCodeAt(0))).buffer}var Is=Object.freeze({__proto__:null,arrayBufferToBase64:Ls,base64ToArrayBuffer:Bs,getByteBoundaryFromType:Cs,getCacheKey:_s,getDataFromObject:Fs,getLengthFromType:As,getMemoryLengthFromType:Rs,getNodeChildren:vs,getTypeFromLength:Es,getTypedArrayFromType:ws,getValueFromType:Ps,getValueType:Ms,hash:Ts,hashArray:xs,hashString:bs});const Ds={VERTEX:"vertex",FRAGMENT:"fragment"},Vs={NONE:"none",FRAME:"frame",RENDER:"render",OBJECT:"object"},Us={BOOLEAN:"bool",INTEGER:"int",FLOAT:"float",VECTOR2:"vec2",VECTOR3:"vec3",VECTOR4:"vec4",MATRIX2:"mat2",MATRIX3:"mat3",MATRIX4:"mat4"},Os={READ_ONLY:"readOnly",WRITE_ONLY:"writeOnly",READ_WRITE:"readWrite"},ks=["fragment","vertex"],Gs=["setup","analyze","generate"],zs=[...ks,"compute"],Hs=["x","y","z","w"],$s={analyze:"setup",generate:"analyze"};let Ws=0;class js extends o{static get type(){return"Node"}constructor(e=null){super(),this.nodeType=e,this.updateType=Vs.NONE,this.updateBeforeType=Vs.NONE,this.updateAfterType=Vs.NONE,this.uuid=u.generateUUID(),this.version=0,this.global=!1,this.parents=!1,this.isNode=!0,this._cacheKey=null,this._cacheKeyVersion=0,Object.defineProperty(this,"id",{value:Ws++})}set needsUpdate(e){!0===e&&this.version++}get type(){return this.constructor.type}onUpdate(e,t){return this.updateType=t,this.update=e.bind(this.getSelf()),this}onFrameUpdate(e){return this.onUpdate(e,Vs.FRAME)}onRenderUpdate(e){return this.onUpdate(e,Vs.RENDER)}onObjectUpdate(e){return this.onUpdate(e,Vs.OBJECT)}onReference(e){return this.updateReference=e.bind(this.getSelf()),this}getSelf(){return this.self||this}updateReference(){return this}isGlobal(){return this.global}*getChildren(){for(const{childNode:e}of vs(this))yield e}dispose(){this.dispatchEvent({type:"dispose"})}traverse(e){e(this);for(const t of this.getChildren())t.traverse(e)}getCacheKey(e=!1){return!0!==(e=e||this.version!==this._cacheKeyVersion)&&null!==this._cacheKey||(this._cacheKey=Ts(_s(this,e),this.customCacheKey()),this._cacheKeyVersion=this.version),this._cacheKey}customCacheKey(){return 0}getScope(){return this}getHash(){return this.uuid}getUpdateType(){return this.updateType}getUpdateBeforeType(){return this.updateBeforeType}getUpdateAfterType(){return this.updateAfterType}getElementType(e){const t=this.getNodeType(e);return e.getElementType(t)}getMemberType(){return"void"}getNodeType(e){const t=e.getNodeProperties(this);return t.outputNode?t.outputNode.getNodeType(e):this.nodeType}getShared(e){const t=this.getHash(e);return e.getNodeFromHash(t)||this}setup(e){const t=e.getNodeProperties(this);let r=0;for(const e of this.getChildren())t["node"+r++]=e;return t.outputNode||null}analyze(e,t=null){const r=e.increaseUsage(this);if(!0===this.parents){const r=e.getDataFromNode(this,"any");r.stages=r.stages||{},r.stages[e.shaderStage]=r.stages[e.shaderStage]||[],r.stages[e.shaderStage].push(t)}if(1===r){const t=e.getNodeProperties(this);for(const r of Object.values(t))r&&!0===r.isNode&&r.build(e,this)}}generate(e,t){const{outputNode:r}=e.getNodeProperties(this);if(r&&!0===r.isNode)return r.build(e,t)}updateBefore(){console.warn("Abstract function.")}updateAfter(){console.warn("Abstract function.")}update(){console.warn("Abstract function.")}build(e,t=null){const r=this.getShared(e);if(this!==r)return r.build(e,t);const s=e.getDataFromNode(this);s.buildStages=s.buildStages||{},s.buildStages[e.buildStage]=!0;const i=$s[e.buildStage];if(i&&!0!==s.buildStages[i]){const t=e.getBuildStage();e.setBuildStage(i),this.build(e),e.setBuildStage(t)}e.addNode(this),e.addChain(this);let n=null;const a=e.getBuildStage();if("setup"===a){this.updateReference(e);const t=e.getNodeProperties(this);if(!0!==t.initialized){t.initialized=!0,t.outputNode=this.setup(e)||t.outputNode||null;for(const r of Object.values(t))if(r&&!0===r.isNode){if(!0===r.parents){const t=e.getNodeProperties(r);t.parents=t.parents||[],t.parents.push(this)}r.build(e)}}n=t.outputNode}else if("analyze"===a)this.analyze(e,t);else if("generate"===a){if(1===this.generate.length){const r=this.getNodeType(e),s=e.getDataFromNode(this);n=s.snippet,void 0===n?void 0===s.generated?(s.generated=!0,n=this.generate(e)||"",s.snippet=n):(console.warn("THREE.Node: Recursion detected.",this),n=""):void 0!==s.flowCodes&&void 0!==e.context.nodeBlock&&e.addFlowCodeHierarchy(this,e.context.nodeBlock),n=e.format(n,r,t)}else n=this.generate(e,t)||""}return e.removeChain(this),e.addSequentialNode(this),n}getSerializeChildren(){return vs(this)}serialize(e){const t=this.getSerializeChildren(),r={};for(const{property:s,index:i,childNode:n}of t)void 0!==i?(void 0===r[s]&&(r[s]=Number.isInteger(i)?[]:{}),r[s][i]=n.toJSON(e.meta).uuid):r[s]=n.toJSON(e.meta).uuid;Object.keys(r).length>0&&(e.inputNodes=r)}deserialize(e){if(void 0!==e.inputNodes){const t=e.meta.nodes;for(const r in e.inputNodes)if(Array.isArray(e.inputNodes[r])){const s=[];for(const i of e.inputNodes[r])s.push(t[i]);this[r]=s}else if("object"==typeof e.inputNodes[r]){const s={};for(const i in e.inputNodes[r]){const n=e.inputNodes[r][i];s[i]=t[n]}this[r]=s}else{const s=e.inputNodes[r];this[r]=t[s]}}}toJSON(e){const{uuid:t,type:r}=this,s=void 0===e||"string"==typeof e;s&&(e={textures:{},images:{},nodes:{}});let i=e.nodes[t];function n(e){const t=[];for(const r in e){const s=e[r];delete s.metadata,t.push(s)}return t}if(void 0===i&&(i={uuid:t,type:r,meta:e,metadata:{version:4.7,type:"Node",generator:"Node.toJSON"}},!0!==s&&(e.nodes[i.uuid]=i),this.serialize(i),delete i.meta),s){const t=n(e.textures),r=n(e.images),s=n(e.nodes);t.length>0&&(i.textures=t),r.length>0&&(i.images=r),s.length>0&&(i.nodes=s)}return i}}class qs extends js{static get type(){return"ArrayElementNode"}constructor(e,t){super(),this.node=e,this.indexNode=t,this.isArrayElementNode=!0}getNodeType(e){return this.node.getElementType(e)}generate(e){const t=this.indexNode.getNodeType(e);return`${this.node.build(e)}[ ${this.indexNode.build(e,!e.isVector(t)&&e.isInteger(t)?t:"uint")} ]`}}class Xs extends js{static get type(){return"ConvertNode"}constructor(e,t){super(),this.node=e,this.convertTo=t}getNodeType(e){const t=this.node.getNodeType(e);let r=null;for(const s of this.convertTo.split("|"))null!==r&&e.getTypeLength(t)!==e.getTypeLength(s)||(r=s);return r}serialize(e){super.serialize(e),e.convertTo=this.convertTo}deserialize(e){super.deserialize(e),this.convertTo=e.convertTo}generate(e,t){const r=this.node,s=this.getNodeType(e),i=r.build(e,s);return e.format(i,s,t)}}class Ks extends js{static get type(){return"TempNode"}constructor(e=null){super(e),this.isTempNode=!0}hasDependencies(e){return e.getDataFromNode(this).usageCount>1}build(e,t){if("generate"===e.getBuildStage()){const r=e.getVectorType(this.getNodeType(e,t)),s=e.getDataFromNode(this);if(void 0!==s.propertyName)return e.format(s.propertyName,r,t);if("void"!==r&&"void"!==t&&this.hasDependencies(e)){const i=super.build(e,r),n=e.getVarFromNode(this,null,r),a=e.getPropertyName(n);return e.addLineFlowCode(`${a} = ${i}`,this),s.snippet=i,s.propertyName=a,e.format(s.propertyName,r,t)}}return super.build(e,t)}}class Ys extends Ks{static get type(){return"JoinNode"}constructor(e=[],t=null){super(t),this.nodes=e}getNodeType(e){return null!==this.nodeType?e.getVectorType(this.nodeType):e.getTypeFromLength(this.nodes.reduce(((t,r)=>t+e.getTypeLength(r.getNodeType(e))),0))}generate(e,t){const r=this.getNodeType(e),s=e.getTypeLength(r),i=this.nodes,n=e.getComponentType(r),a=[];let o=0;for(const t of i){if(o>=s){console.error(`THREE.TSL: Length of parameters exceeds maximum length of function '${r}()' type.`);break}let i,u=t.getNodeType(e),l=e.getTypeLength(u);o+l>s&&(console.error(`THREE.TSL: Length of '${r}()' data exceeds maximum length of output type.`),l=s-o,u=e.getTypeFromLength(l)),o+=l,i=t.build(e,u);const d=e.getComponentType(u);d!==n&&(i=e.format(i,d,n)),a.push(i)}const u=`${e.getType(r)}( ${a.join(", ")} )`;return e.format(u,r,t)}}const Qs=Hs.join("");class Zs extends js{static get type(){return"SplitNode"}constructor(e,t="x"){super(),this.node=e,this.components=t,this.isSplitNode=!0}getVectorLength(){let e=this.components.length;for(const t of this.components)e=Math.max(Hs.indexOf(t)+1,e);return e}getComponentType(e){return e.getComponentType(this.node.getNodeType(e))}getNodeType(e){return e.getTypeFromLength(this.components.length,this.getComponentType(e))}generate(e,t){const r=this.node,s=e.getTypeLength(r.getNodeType(e));let i=null;if(s>1){let n=null;this.getVectorLength()>=s&&(n=e.getTypeFromLength(this.getVectorLength(),this.getComponentType(e)));const a=r.build(e,n);i=this.components.length===s&&this.components===Qs.slice(0,this.components.length)?e.format(a,n,t):e.format(`${a}.${this.components}`,this.getNodeType(e),t)}else i=r.build(e,t);return i}serialize(e){super.serialize(e),e.components=this.components}deserialize(e){super.deserialize(e),this.components=e.components}}class Js extends Ks{static get type(){return"SetNode"}constructor(e,t,r){super(),this.sourceNode=e,this.components=t,this.targetNode=r}getNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{sourceNode:t,components:r,targetNode:s}=this,i=this.getNodeType(e),n=e.getComponentType(s.getNodeType(e)),a=e.getTypeFromLength(r.length,n),o=s.build(e,a),u=t.build(e,i),l=e.getTypeLength(i),d=[];for(let e=0;ee.replace(/r|s/g,"x").replace(/g|t/g,"y").replace(/b|p/g,"z").replace(/a|q/g,"w"),li=e=>ui(e).split("").sort().join(""),di={setup(e,t){const r=t.shift();return e(Ii(r),...t)},get(e,t,r){if("string"==typeof t&&void 0===e[t]){if(!0!==e.isStackNode&&"assign"===t)return(...e)=>(ni.assign(r,...e),r);if(ai.has(t)){const s=ai.get(t);return e.isStackNode?(...e)=>r.add(s(...e)):(...e)=>s(r,...e)}if("self"===t)return e;if(t.endsWith("Assign")&&ai.has(t.slice(0,t.length-6))){const s=ai.get(t.slice(0,t.length-6));return e.isStackNode?(...e)=>r.assign(e[0],s(...e)):(...e)=>r.assign(s(r,...e))}if(!0===/^[xyzwrgbastpq]{1,4}$/.test(t))return t=ui(t),Bi(new Zs(r,t));if(!0===/^set[XYZWRGBASTPQ]{1,4}$/.test(t))return t=li(t.slice(3).toLowerCase()),r=>Bi(new Js(e,t,Bi(r)));if(!0===/^flip[XYZWRGBASTPQ]{1,4}$/.test(t))return t=li(t.slice(4).toLowerCase()),()=>Bi(new ei(Bi(e),t));if("width"===t||"height"===t||"depth"===t)return"width"===t?t="x":"height"===t?t="y":"depth"===t&&(t="z"),Bi(new Zs(e,t));if(!0===/^\d+$/.test(t))return Bi(new qs(r,new si(Number(t),"uint")));if(!0===/^get$/.test(t))return e=>Bi(new ii(r,e))}return Reflect.get(e,t,r)},set:(e,t,r,s)=>"string"!=typeof t||void 0!==e[t]||!0!==/^[xyzwrgbastpq]{1,4}$/.test(t)&&"width"!==t&&"height"!==t&&"depth"!==t&&!0!==/^\d+$/.test(t)?Reflect.set(e,t,r,s):(s[t].assign(r),!0)},ci=new WeakMap,hi=new WeakMap,pi=function(e,t=null){for(const r in e)e[r]=Bi(e[r],t);return e},gi=function(e,t=null){const r=e.length;for(let s=0;sBi(null!==s?Object.assign(e,s):e);let n,a,o,u=t;function l(t){let r;return r=u?/[a-z]/i.test(u)?u+"()":u:e.type,void 0!==a&&t.lengtho?(console.error(`THREE.TSL: "${r}" parameter length exceeds limit.`),t.slice(0,o)):t}return null===t?n=(...t)=>i(new e(...Di(l(t)))):null!==r?(r=Bi(r),n=(...s)=>i(new e(t,...Di(l(s)),r))):n=(...r)=>i(new e(t,...Di(l(r)))),n.setParameterLength=(...e)=>(1===e.length?a=o=e[0]:2===e.length&&([a,o]=e),n),n.setName=e=>(u=e,n),n},fi=function(e,...t){return Bi(new e(...Di(t)))};class yi extends js{constructor(e,t){super(),this.shaderNode=e,this.inputNodes=t,this.isShaderCallNodeInternal=!0}getNodeType(e){return this.shaderNode.nodeType||this.getOutputNode(e).getNodeType(e)}getMemberType(e,t){return this.getOutputNode(e).getMemberType(e,t)}call(e){const{shaderNode:t,inputNodes:r}=this,s=e.getNodeProperties(t),i=t.namespace&&t.namespace===e.namespace?e.getNamespace("once"):"once";if(s[i])return s[i];let n=null;if(t.layout){let s=hi.get(e.constructor);void 0===s&&(s=new WeakMap,hi.set(e.constructor,s));let i=s.get(t);void 0===i&&(i=Bi(e.buildFunctionNode(t)),s.set(t,i)),e.addInclude(i),n=Bi(i.call(r))}else{const s=t.jsFunc,i=null!==r||s.length>1?s(r||[],e):s(e);n=Bi(i)}return t.once&&(s[i]=n),n}setupOutput(e){return e.addStack(),e.stack.outputNode=this.call(e),e.removeStack()}getOutputNode(e){const t=e.getNodeProperties(this),r=e.getOutputNamespace();return t[r]=t[r]||this.setupOutput(e),t[r]}build(e,t=null){let r=null;const s=e.getBuildStage(),i=e.getNodeProperties(this),n=e.getOutputNamespace(),a=this.getOutputNode(e);if("setup"===s){const t=e.getNamespace("initialized");!0!==i[t]&&(i[t]=!0,i[n]=this.getOutputNode(e),i[n].build(e)),r=i[n]}else"analyze"===s?a.build(e,t):"generate"===s&&(r=a.build(e,t)||"");return r}}class bi extends js{constructor(e,t){super(t),this.jsFunc=e,this.layout=null,this.global=!0,this.once=!1,this.namespace=null}setLayout(e){return this.layout=e,this}call(e=null){return Ii(e),Bi(new yi(this,e))}setup(){return this.call()}}const xi=[!1,!0],Ti=[0,1,2,3],_i=[-1,-2],vi=[.5,1.5,1/3,1e-6,1e6,Math.PI,2*Math.PI,1/Math.PI,2/Math.PI,1/(2*Math.PI),Math.PI/2],Ni=new Map;for(const e of xi)Ni.set(e,new si(e));const Si=new Map;for(const e of Ti)Si.set(e,new si(e,"uint"));const Ei=new Map([...Si].map((e=>new si(e.value,"int"))));for(const e of _i)Ei.set(e,new si(e,"int"));const wi=new Map([...Ei].map((e=>new si(e.value))));for(const e of vi)wi.set(e,new si(e));for(const e of vi)wi.set(-e,new si(-e));const Ai={bool:Ni,uint:Si,ints:Ei,float:wi},Ri=new Map([...Ni,...wi]),Ci=(e,t)=>Ri.has(e)?Ri.get(e):!0===e.isNode?e:new si(e,t),Mi=function(e,t=null){return(...r)=>{if((0===r.length||!["bool","float","int","uint"].includes(e)&&r.every((e=>"object"!=typeof e)))&&(r=[Ps(e,...r)]),1===r.length&&null!==t&&t.has(r[0]))return Bi(t.get(r[0]));if(1===r.length){const t=Ci(r[0],e);return(e=>{try{return e.getNodeType()}catch(e){return}})(t)===e?Bi(t):Bi(new Xs(t,e))}const s=r.map((e=>Ci(e)));return Bi(new Ys(s,e))}},Pi=e=>"object"==typeof e&&null!==e?e.value:e,Fi=e=>null!=e?e.nodeType||e.convertTo||("string"==typeof e?e:null):null;function Li(e,t){return new Proxy(new bi(e,t),di)}const Bi=(e,t=null)=>function(e,t=null){const r=Ms(e);if("node"===r){let t=ci.get(e);return void 0===t&&(t=new Proxy(e,di),ci.set(e,t),ci.set(t,t)),t}return null===t&&("float"===r||"boolean"===r)||r&&"shader"!==r&&"string"!==r?Bi(Ci(e,t)):"shader"===r?e.isFn?e:ki(e):e}(e,t),Ii=(e,t=null)=>new pi(e,t),Di=(e,t=null)=>new gi(e,t),Vi=(...e)=>new mi(...e),Ui=(...e)=>new fi(...e);let Oi=0;const ki=(e,t=null)=>{let r=null;null!==t&&("object"==typeof t?r=t.return:("string"==typeof t?r=t:console.error("THREE.TSL: Invalid layout type."),t=null));const s=new Li(e,r),i=(...e)=>{let t;Ii(e);t=e[0]&&(e[0].isNode||Object.getPrototypeOf(e[0])!==Object.prototype)?[...e]:e[0];const i=s.call(t);return"void"===r&&i.toStack(),i};if(i.shaderNode=s,i.id=s.id,i.isFn=!0,i.getNodeType=(...e)=>s.getNodeType(...e),i.getCacheKey=(...e)=>s.getCacheKey(...e),i.setLayout=e=>(s.setLayout(e),i),i.once=(e=null)=>(s.once=!0,s.namespace=e,i),null!==t){if("object"!=typeof t.inputs){const e={name:"fn"+Oi++,type:r,inputs:[]};for(const r in t)"return"!==r&&e.inputs.push({name:r,type:t[r]});t=e}i.setLayout(t)}return i},Gi=e=>{ni=e},zi=()=>ni,Hi=(...e)=>ni.If(...e);function $i(e){return ni&&ni.add(e),e}oi("toStack",$i);const Wi=new Mi("color"),ji=new Mi("float",Ai.float),qi=new Mi("int",Ai.ints),Xi=new Mi("uint",Ai.uint),Ki=new Mi("bool",Ai.bool),Yi=new Mi("vec2"),Qi=new Mi("ivec2"),Zi=new Mi("uvec2"),Ji=new Mi("bvec2"),en=new Mi("vec3"),tn=new Mi("ivec3"),rn=new Mi("uvec3"),sn=new Mi("bvec3"),nn=new Mi("vec4"),an=new Mi("ivec4"),on=new Mi("uvec4"),un=new Mi("bvec4"),ln=new Mi("mat2"),dn=new Mi("mat3"),cn=new Mi("mat4");oi("toColor",Wi),oi("toFloat",ji),oi("toInt",qi),oi("toUint",Xi),oi("toBool",Ki),oi("toVec2",Yi),oi("toIVec2",Qi),oi("toUVec2",Zi),oi("toBVec2",Ji),oi("toVec3",en),oi("toIVec3",tn),oi("toUVec3",rn),oi("toBVec3",sn),oi("toVec4",nn),oi("toIVec4",an),oi("toUVec4",on),oi("toBVec4",un),oi("toMat2",ln),oi("toMat3",dn),oi("toMat4",cn);const hn=Vi(qs).setParameterLength(2),pn=(e,t)=>Bi(new Xs(Bi(e),t));oi("element",hn),oi("convert",pn);oi("append",(e=>(console.warn("THREE.TSL: .append() has been renamed to .toStack()."),$i(e))));class gn extends js{static get type(){return"PropertyNode"}constructor(e,t=null,r=!1){super(e),this.name=t,this.varying=r,this.isPropertyNode=!0,this.global=!0}getHash(e){return this.name||super.getHash(e)}generate(e){let t;return!0===this.varying?(t=e.getVaryingFromNode(this,this.name),t.needsInterpolation=!0):t=e.getVarFromNode(this,this.name),e.getPropertyName(t)}}const mn=(e,t)=>Bi(new gn(e,t)),fn=(e,t)=>Bi(new gn(e,t,!0)),yn=Ui(gn,"vec4","DiffuseColor"),bn=Ui(gn,"vec3","EmissiveColor"),xn=Ui(gn,"float","Roughness"),Tn=Ui(gn,"float","Metalness"),_n=Ui(gn,"float","Clearcoat"),vn=Ui(gn,"float","ClearcoatRoughness"),Nn=Ui(gn,"vec3","Sheen"),Sn=Ui(gn,"float","SheenRoughness"),En=Ui(gn,"float","Iridescence"),wn=Ui(gn,"float","IridescenceIOR"),An=Ui(gn,"float","IridescenceThickness"),Rn=Ui(gn,"float","AlphaT"),Cn=Ui(gn,"float","Anisotropy"),Mn=Ui(gn,"vec3","AnisotropyT"),Pn=Ui(gn,"vec3","AnisotropyB"),Fn=Ui(gn,"color","SpecularColor"),Ln=Ui(gn,"float","SpecularF90"),Bn=Ui(gn,"float","Shininess"),In=Ui(gn,"vec4","Output"),Dn=Ui(gn,"float","dashSize"),Vn=Ui(gn,"float","gapSize"),Un=Ui(gn,"float","pointWidth"),On=Ui(gn,"float","IOR"),kn=Ui(gn,"float","Transmission"),Gn=Ui(gn,"float","Thickness"),zn=Ui(gn,"float","AttenuationDistance"),Hn=Ui(gn,"color","AttenuationColor"),$n=Ui(gn,"float","Dispersion");class Wn extends js{static get type(){return"UniformGroupNode"}constructor(e,t=!1,r=1){super("string"),this.name=e,this.shared=t,this.order=r,this.isUniformGroup=!0}serialize(e){super.serialize(e),e.name=this.name,e.version=this.version,e.shared=this.shared}deserialize(e){super.deserialize(e),this.name=e.name,this.version=e.version,this.shared=e.shared}}const jn=e=>new Wn(e),qn=(e,t=0)=>new Wn(e,!0,t),Xn=qn("frame"),Kn=qn("render"),Yn=jn("object");class Qn extends ti{static get type(){return"UniformNode"}constructor(e,t=null){super(e,t),this.isUniformNode=!0,this.name="",this.groupNode=Yn}label(e){return this.name=e,this}setGroup(e){return this.groupNode=e,this}getGroup(){return this.groupNode}getUniformHash(e){return this.getHash(e)}onUpdate(e,t){const r=this.getSelf();return e=e.bind(r),super.onUpdate((t=>{const s=e(t,r);void 0!==s&&(this.value=s)}),t)}generate(e,t){const r=this.getNodeType(e),s=this.getUniformHash(e);let i=e.getNodeFromHash(s);void 0===i&&(e.setHashNode(this,s),i=this);const n=i.getInputType(e),a=e.getUniformFromNode(i,n,e.shaderStage,this.name||e.context.label),o=e.getPropertyName(a);return void 0!==e.context.label&&delete e.context.label,e.format(o,r,t)}}const Zn=(e,t)=>{const r=Fi(t||e),s=e&&!0===e.isNode?e.node&&e.node.value||e.value:e;return Bi(new Qn(s,r))};class Jn extends Ks{static get type(){return"ArrayNode"}constructor(e,t,r=null){super(e),this.count=t,this.values=r,this.isArrayNode=!0}getNodeType(e){return null===this.nodeType&&(this.nodeType=this.values[0].getNodeType(e)),this.nodeType}getElementType(e){return this.getNodeType(e)}generate(e){const t=this.getNodeType(e);return e.generateArray(t,this.count,this.values)}}const ea=(...e)=>{let t;if(1===e.length){const r=e[0];t=new Jn(null,r.length,r)}else{const r=e[0],s=e[1];t=new Jn(r,s)}return Bi(t)};oi("toArray",((e,t)=>ea(Array(t).fill(e))));class ta extends Ks{static get type(){return"AssignNode"}constructor(e,t){super(),this.targetNode=e,this.sourceNode=t,this.isAssignNode=!0}hasDependencies(){return!1}getNodeType(e,t){return"void"!==t?this.targetNode.getNodeType(e):"void"}needsSplitAssign(e){const{targetNode:t}=this;if(!1===e.isAvailable("swizzleAssign")&&t.isSplitNode&&t.components.length>1){const r=e.getTypeLength(t.node.getNodeType(e));return Hs.join("").slice(0,r)!==t.components}return!1}setup(e){const{targetNode:t,sourceNode:r}=this,s=e.getNodeProperties(this);s.sourceNode=r,s.targetNode=t.context({assign:!0})}generate(e,t){const{targetNode:r,sourceNode:s}=e.getNodeProperties(this),i=this.needsSplitAssign(e),n=r.getNodeType(e),a=r.build(e),o=s.build(e,n),u=s.getNodeType(e),l=e.getDataFromNode(this);let d;if(!0===l.initialized)"void"!==t&&(d=a);else if(i){const s=e.getVarFromNode(this,null,n),i=e.getPropertyName(s);e.addLineFlowCode(`${i} = ${o}`,this);const u=r.node,l=u.node.context({assign:!0}).build(e);for(let t=0;t{const s=r.type;let i;return i="pointer"===s?"&"+t.build(e):t.build(e,s),i};if(Array.isArray(i)){if(i.length>s.length)console.error("THREE.TSL: The number of provided parameters exceeds the expected number of inputs in 'Fn()'."),i.length=s.length;else if(i.length(t=t.length>1||t[0]&&!0===t[0].isNode?Di(t):Ii(t[0]),Bi(new sa(Bi(e),t)));oi("call",ia);const na={"==":"equal","!=":"notEqual","<":"lessThan",">":"greaterThan","<=":"lessThanEqual",">=":"greaterThanEqual","%":"mod"};class aa extends Ks{static get type(){return"OperatorNode"}constructor(e,t,r,...s){if(super(),s.length>0){let i=new aa(e,t,r);for(let t=0;t>"===t||"<<"===t)return e.getIntegerType(i);if("!"===t||"&&"===t||"||"===t||"^^"===t)return"bool";if("=="===t||"!="===t||"<"===t||">"===t||"<="===t||">="===t){const t=Math.max(e.getTypeLength(i),e.getTypeLength(n));return t>1?`bvec${t}`:"bool"}if(e.isMatrix(i)){if("float"===n)return i;if(e.isVector(n))return e.getVectorFromMatrix(i);if(e.isMatrix(n))return i}else if(e.isMatrix(n)){if("float"===i)return n;if(e.isVector(i))return e.getVectorFromMatrix(n)}return e.getTypeLength(n)>e.getTypeLength(i)?n:i}generate(e,t){const r=this.op,{aNode:s,bNode:i}=this,n=this.getNodeType(e);let a=null,o=null;"void"!==n?(a=s.getNodeType(e),o=i?i.getNodeType(e):null,"<"===r||">"===r||"<="===r||">="===r||"=="===r||"!="===r?e.isVector(a)?o=a:e.isVector(o)?a=o:a!==o&&(a=o="float"):">>"===r||"<<"===r?(a=n,o=e.changeComponentType(o,"uint")):"%"===r?(a=n,o=e.isInteger(a)&&e.isInteger(o)?o:a):e.isMatrix(a)?"float"===o?o="float":e.isVector(o)?o=e.getVectorFromMatrix(a):e.isMatrix(o)||(a=o=n):a=e.isMatrix(o)?"float"===a?"float":e.isVector(a)?e.getVectorFromMatrix(o):o=n:o=n):a=o=n;const u=s.build(e,a),d=i?i.build(e,o):null,c=e.getFunctionOperator(r);if("void"!==t){const s=e.renderer.coordinateSystem===l;if("=="===r||"!="===r||"<"===r||">"===r||"<="===r||">="===r)return s&&e.isVector(a)?e.format(`${this.getOperatorMethod(e,t)}( ${u}, ${d} )`,n,t):e.format(`( ${u} ${r} ${d} )`,n,t);if("%"===r)return e.isInteger(o)?e.format(`( ${u} % ${d} )`,n,t):e.format(`${this.getOperatorMethod(e,n)}( ${u}, ${d} )`,n,t);if("!"===r||"~"===r)return e.format(`(${r}${u})`,a,t);if(c)return e.format(`${c}( ${u}, ${d} )`,n,t);if(e.isMatrix(a)&&"float"===o)return e.format(`( ${d} ${r} ${u} )`,n,t);if("float"===a&&e.isMatrix(o))return e.format(`${u} ${r} ${d}`,n,t);{let i=`( ${u} ${r} ${d} )`;return!s&&"bool"===n&&e.isVector(a)&&e.isVector(o)&&(i=`all${i}`),e.format(i,n,t)}}if("void"!==a)return c?e.format(`${c}( ${u}, ${d} )`,n,t):e.isMatrix(a)&&"float"===o?e.format(`${d} ${r} ${u}`,n,t):e.format(`${u} ${r} ${d}`,n,t)}serialize(e){super.serialize(e),e.op=this.op}deserialize(e){super.deserialize(e),this.op=e.op}}const oa=Vi(aa,"+").setParameterLength(2,1/0).setName("add"),ua=Vi(aa,"-").setParameterLength(2,1/0).setName("sub"),la=Vi(aa,"*").setParameterLength(2,1/0).setName("mul"),da=Vi(aa,"/").setParameterLength(2,1/0).setName("div"),ca=Vi(aa,"%").setParameterLength(2).setName("mod"),ha=Vi(aa,"==").setParameterLength(2).setName("equal"),pa=Vi(aa,"!=").setParameterLength(2).setName("notEqual"),ga=Vi(aa,"<").setParameterLength(2).setName("lessThan"),ma=Vi(aa,">").setParameterLength(2).setName("greaterThan"),fa=Vi(aa,"<=").setParameterLength(2).setName("lessThanEqual"),ya=Vi(aa,">=").setParameterLength(2).setName("greaterThanEqual"),ba=Vi(aa,"&&").setParameterLength(2,1/0).setName("and"),xa=Vi(aa,"||").setParameterLength(2,1/0).setName("or"),Ta=Vi(aa,"!").setParameterLength(1).setName("not"),_a=Vi(aa,"^^").setParameterLength(2).setName("xor"),va=Vi(aa,"&").setParameterLength(2).setName("bitAnd"),Na=Vi(aa,"~").setParameterLength(2).setName("bitNot"),Sa=Vi(aa,"|").setParameterLength(2).setName("bitOr"),Ea=Vi(aa,"^").setParameterLength(2).setName("bitXor"),wa=Vi(aa,"<<").setParameterLength(2).setName("shiftLeft"),Aa=Vi(aa,">>").setParameterLength(2).setName("shiftRight"),Ra=ki((([e])=>(e.addAssign(1),e))),Ca=ki((([e])=>(e.subAssign(1),e))),Ma=ki((([e])=>{const t=qi(e).toConst();return e.addAssign(1),t})),Pa=ki((([e])=>{const t=qi(e).toConst();return e.subAssign(1),t}));oi("add",oa),oi("sub",ua),oi("mul",la),oi("div",da),oi("mod",ca),oi("equal",ha),oi("notEqual",pa),oi("lessThan",ga),oi("greaterThan",ma),oi("lessThanEqual",fa),oi("greaterThanEqual",ya),oi("and",ba),oi("or",xa),oi("not",Ta),oi("xor",_a),oi("bitAnd",va),oi("bitNot",Na),oi("bitOr",Sa),oi("bitXor",Ea),oi("shiftLeft",wa),oi("shiftRight",Aa),oi("incrementBefore",Ra),oi("decrementBefore",Ca),oi("increment",Ma),oi("decrement",Pa);const Fa=(e,t)=>(console.warn('THREE.TSL: "remainder()" is deprecated. Use "mod( int( ... ) )" instead.'),ca(e,t)),La=(e,t)=>(console.warn('THREE.TSL: "modInt()" is deprecated. Use "mod( int( ... ) )" instead.'),ca(qi(e),qi(t)));oi("remainder",Fa),oi("modInt",La);class Ba extends Ks{static get type(){return"MathNode"}constructor(e,t,r=null,s=null){if(super(),(e===Ba.MAX||e===Ba.MIN)&&arguments.length>3){let i=new Ba(e,t,r);for(let t=2;tn&&i>a?t:n>a?r:a>i?s:t}getNodeType(e){const t=this.method;return t===Ba.LENGTH||t===Ba.DISTANCE||t===Ba.DOT?"float":t===Ba.CROSS?"vec3":t===Ba.ALL||t===Ba.ANY?"bool":t===Ba.EQUALS?e.changeComponentType(this.aNode.getNodeType(e),"bool"):this.getInputType(e)}setup(e){const{aNode:t,bNode:r,method:s}=this;let i=null;if(s===Ba.ONE_MINUS)i=ua(1,t);else if(s===Ba.RECIPROCAL)i=da(1,t);else if(s===Ba.DIFFERENCE)i=no(ua(t,r));else if(s===Ba.TRANSFORM_DIRECTION){let s=t,n=r;e.isMatrix(s.getNodeType(e))?n=nn(en(n),0):s=nn(en(s),0);const a=la(s,n).xyz;i=Qa(a)}return null!==i?i:super.setup(e)}generate(e,t){if(e.getNodeProperties(this).outputNode)return super.generate(e,t);let r=this.method;const s=this.getNodeType(e),i=this.getInputType(e),n=this.aNode,a=this.bNode,o=this.cNode,u=e.renderer.coordinateSystem;if(r===Ba.NEGATE)return e.format("( - "+n.build(e,i)+" )",s,t);{const c=[];return r===Ba.CROSS?c.push(n.build(e,s),a.build(e,s)):u===l&&r===Ba.STEP?c.push(n.build(e,1===e.getTypeLength(n.getNodeType(e))?"float":i),a.build(e,i)):u!==l||r!==Ba.MIN&&r!==Ba.MAX?r===Ba.REFRACT?c.push(n.build(e,i),a.build(e,i),o.build(e,"float")):r===Ba.MIX?c.push(n.build(e,i),a.build(e,i),o.build(e,1===e.getTypeLength(o.getNodeType(e))?"float":i)):(u===d&&r===Ba.ATAN&&null!==a&&(r="atan2"),"fragment"===e.shaderStage||r!==Ba.DFDX&&r!==Ba.DFDY||(console.warn(`THREE.TSL: '${r}' is not supported in the ${e.shaderStage} stage.`),r="/*"+r+"*/"),c.push(n.build(e,i)),null!==a&&c.push(a.build(e,i)),null!==o&&c.push(o.build(e,i))):c.push(n.build(e,i),a.build(e,1===e.getTypeLength(a.getNodeType(e))?"float":i)),e.format(`${e.getMethod(r,s)}( ${c.join(", ")} )`,s,t)}}serialize(e){super.serialize(e),e.method=this.method}deserialize(e){super.deserialize(e),this.method=e.method}}Ba.ALL="all",Ba.ANY="any",Ba.RADIANS="radians",Ba.DEGREES="degrees",Ba.EXP="exp",Ba.EXP2="exp2",Ba.LOG="log",Ba.LOG2="log2",Ba.SQRT="sqrt",Ba.INVERSE_SQRT="inversesqrt",Ba.FLOOR="floor",Ba.CEIL="ceil",Ba.NORMALIZE="normalize",Ba.FRACT="fract",Ba.SIN="sin",Ba.COS="cos",Ba.TAN="tan",Ba.ASIN="asin",Ba.ACOS="acos",Ba.ATAN="atan",Ba.ABS="abs",Ba.SIGN="sign",Ba.LENGTH="length",Ba.NEGATE="negate",Ba.ONE_MINUS="oneMinus",Ba.DFDX="dFdx",Ba.DFDY="dFdy",Ba.ROUND="round",Ba.RECIPROCAL="reciprocal",Ba.TRUNC="trunc",Ba.FWIDTH="fwidth",Ba.TRANSPOSE="transpose",Ba.BITCAST="bitcast",Ba.EQUALS="equals",Ba.MIN="min",Ba.MAX="max",Ba.STEP="step",Ba.REFLECT="reflect",Ba.DISTANCE="distance",Ba.DIFFERENCE="difference",Ba.DOT="dot",Ba.CROSS="cross",Ba.POW="pow",Ba.TRANSFORM_DIRECTION="transformDirection",Ba.MIX="mix",Ba.CLAMP="clamp",Ba.REFRACT="refract",Ba.SMOOTHSTEP="smoothstep",Ba.FACEFORWARD="faceforward";const Ia=ji(1e-6),Da=ji(1e6),Va=ji(Math.PI),Ua=ji(2*Math.PI),Oa=Vi(Ba,Ba.ALL).setParameterLength(1),ka=Vi(Ba,Ba.ANY).setParameterLength(1),Ga=Vi(Ba,Ba.RADIANS).setParameterLength(1),za=Vi(Ba,Ba.DEGREES).setParameterLength(1),Ha=Vi(Ba,Ba.EXP).setParameterLength(1),$a=Vi(Ba,Ba.EXP2).setParameterLength(1),Wa=Vi(Ba,Ba.LOG).setParameterLength(1),ja=Vi(Ba,Ba.LOG2).setParameterLength(1),qa=Vi(Ba,Ba.SQRT).setParameterLength(1),Xa=Vi(Ba,Ba.INVERSE_SQRT).setParameterLength(1),Ka=Vi(Ba,Ba.FLOOR).setParameterLength(1),Ya=Vi(Ba,Ba.CEIL).setParameterLength(1),Qa=Vi(Ba,Ba.NORMALIZE).setParameterLength(1),Za=Vi(Ba,Ba.FRACT).setParameterLength(1),Ja=Vi(Ba,Ba.SIN).setParameterLength(1),eo=Vi(Ba,Ba.COS).setParameterLength(1),to=Vi(Ba,Ba.TAN).setParameterLength(1),ro=Vi(Ba,Ba.ASIN).setParameterLength(1),so=Vi(Ba,Ba.ACOS).setParameterLength(1),io=Vi(Ba,Ba.ATAN).setParameterLength(1,2),no=Vi(Ba,Ba.ABS).setParameterLength(1),ao=Vi(Ba,Ba.SIGN).setParameterLength(1),oo=Vi(Ba,Ba.LENGTH).setParameterLength(1),uo=Vi(Ba,Ba.NEGATE).setParameterLength(1),lo=Vi(Ba,Ba.ONE_MINUS).setParameterLength(1),co=Vi(Ba,Ba.DFDX).setParameterLength(1),ho=Vi(Ba,Ba.DFDY).setParameterLength(1),po=Vi(Ba,Ba.ROUND).setParameterLength(1),go=Vi(Ba,Ba.RECIPROCAL).setParameterLength(1),mo=Vi(Ba,Ba.TRUNC).setParameterLength(1),fo=Vi(Ba,Ba.FWIDTH).setParameterLength(1),yo=Vi(Ba,Ba.TRANSPOSE).setParameterLength(1),bo=Vi(Ba,Ba.BITCAST).setParameterLength(2),xo=(e,t)=>(console.warn('THREE.TSL: "equals" is deprecated. Use "equal" inside a vector instead, like: "bvec*( equal( ... ) )"'),ha(e,t)),To=Vi(Ba,Ba.MIN).setParameterLength(2,1/0),_o=Vi(Ba,Ba.MAX).setParameterLength(2,1/0),vo=Vi(Ba,Ba.STEP).setParameterLength(2),No=Vi(Ba,Ba.REFLECT).setParameterLength(2),So=Vi(Ba,Ba.DISTANCE).setParameterLength(2),Eo=Vi(Ba,Ba.DIFFERENCE).setParameterLength(2),wo=Vi(Ba,Ba.DOT).setParameterLength(2),Ao=Vi(Ba,Ba.CROSS).setParameterLength(2),Ro=Vi(Ba,Ba.POW).setParameterLength(2),Co=Vi(Ba,Ba.POW,2).setParameterLength(1),Mo=Vi(Ba,Ba.POW,3).setParameterLength(1),Po=Vi(Ba,Ba.POW,4).setParameterLength(1),Fo=Vi(Ba,Ba.TRANSFORM_DIRECTION).setParameterLength(2),Lo=e=>la(ao(e),Ro(no(e),1/3)),Bo=e=>wo(e,e),Io=Vi(Ba,Ba.MIX).setParameterLength(3),Do=(e,t=0,r=1)=>Bi(new Ba(Ba.CLAMP,Bi(e),Bi(t),Bi(r))),Vo=e=>Do(e),Uo=Vi(Ba,Ba.REFRACT).setParameterLength(3),Oo=Vi(Ba,Ba.SMOOTHSTEP).setParameterLength(3),ko=Vi(Ba,Ba.FACEFORWARD).setParameterLength(3),Go=ki((([e])=>{const t=wo(e.xy,Yi(12.9898,78.233)),r=ca(t,Va);return Za(Ja(r).mul(43758.5453))})),zo=(e,t,r)=>Io(t,r,e),Ho=(e,t,r)=>Oo(t,r,e),$o=(e,t)=>(console.warn('THREE.TSL: "atan2" is overloaded. Use "atan" instead.'),io(e,t)),Wo=ko,jo=Xa;oi("all",Oa),oi("any",ka),oi("equals",xo),oi("radians",Ga),oi("degrees",za),oi("exp",Ha),oi("exp2",$a),oi("log",Wa),oi("log2",ja),oi("sqrt",qa),oi("inverseSqrt",Xa),oi("floor",Ka),oi("ceil",Ya),oi("normalize",Qa),oi("fract",Za),oi("sin",Ja),oi("cos",eo),oi("tan",to),oi("asin",ro),oi("acos",so),oi("atan",io),oi("abs",no),oi("sign",ao),oi("length",oo),oi("lengthSq",Bo),oi("negate",uo),oi("oneMinus",lo),oi("dFdx",co),oi("dFdy",ho),oi("round",po),oi("reciprocal",go),oi("trunc",mo),oi("fwidth",fo),oi("atan2",$o),oi("min",To),oi("max",_o),oi("step",vo),oi("reflect",No),oi("distance",So),oi("dot",wo),oi("cross",Ao),oi("pow",Ro),oi("pow2",Co),oi("pow3",Mo),oi("pow4",Po),oi("transformDirection",Fo),oi("mix",zo),oi("clamp",Do),oi("refract",Uo),oi("smoothstep",Ho),oi("faceForward",ko),oi("difference",Eo),oi("saturate",Vo),oi("cbrt",Lo),oi("transpose",yo),oi("rand",Go);class qo extends js{static get type(){return"ConditionalNode"}constructor(e,t,r=null){super(),this.condNode=e,this.ifNode=t,this.elseNode=r}getNodeType(e){const{ifNode:t,elseNode:r}=e.getNodeProperties(this);if(void 0===t)return this.setup(e),this.getNodeType(e);const s=t.getNodeType(e);if(null!==r){const t=r.getNodeType(e);if(e.getTypeLength(t)>e.getTypeLength(s))return t}return s}setup(e){const t=this.condNode.cache(),r=this.ifNode.cache(),s=this.elseNode?this.elseNode.cache():null,i=e.context.nodeBlock;e.getDataFromNode(r).parentNodeBlock=i,null!==s&&(e.getDataFromNode(s).parentNodeBlock=i);const n=e.getNodeProperties(this);n.condNode=t,n.ifNode=r.context({nodeBlock:r}),n.elseNode=s?s.context({nodeBlock:s}):null}generate(e,t){const r=this.getNodeType(e),s=e.getDataFromNode(this);if(void 0!==s.nodeProperty)return s.nodeProperty;const{condNode:i,ifNode:n,elseNode:a}=e.getNodeProperties(this),o=e.currentFunctionNode,u="void"!==t,l=u?mn(r).build(e):"";s.nodeProperty=l;const d=i.build(e,"bool");e.addFlowCode(`\n${e.tab}if ( ${d} ) {\n\n`).addFlowTab();let c=n.build(e,r);if(c&&(u?c=l+" = "+c+";":(c="return "+c+";",null===o&&(console.warn("THREE.TSL: Return statement used in an inline 'Fn()'. Define a layout struct to allow return values."),c="// "+c))),e.removeFlowTab().addFlowCode(e.tab+"\t"+c+"\n\n"+e.tab+"}"),null!==a){e.addFlowCode(" else {\n\n").addFlowTab();let t=a.build(e,r);t&&(u?t=l+" = "+t+";":(t="return "+t+";",null===o&&(console.warn("THREE.TSL: Return statement used in an inline 'Fn()'. Define a layout struct to allow return values."),t="// "+t))),e.removeFlowTab().addFlowCode(e.tab+"\t"+t+"\n\n"+e.tab+"}\n\n")}else e.addFlowCode("\n\n");return e.format(l,r,t)}}const Xo=Vi(qo).setParameterLength(2,3);oi("select",Xo);const Ko=(...e)=>(console.warn("THREE.TSL: cond() has been renamed to select()."),Xo(...e));oi("cond",Ko);class Yo extends js{static get type(){return"ContextNode"}constructor(e,t={}){super(),this.isContextNode=!0,this.node=e,this.value=t}getScope(){return this.node.getScope()}getNodeType(e){return this.node.getNodeType(e)}analyze(e){const t=e.getContext();e.setContext({...e.context,...this.value}),this.node.build(e),e.setContext(t)}setup(e){const t=e.getContext();e.setContext({...e.context,...this.value}),this.node.build(e),e.setContext(t)}generate(e,t){const r=e.getContext();e.setContext({...e.context,...this.value});const s=this.node.build(e,t);return e.setContext(r),s}}const Qo=Vi(Yo).setParameterLength(1,2),Zo=(e,t)=>Qo(e,{label:t});oi("context",Qo),oi("label",Zo);class Jo extends js{static get type(){return"VarNode"}constructor(e,t=null,r=!1){super(),this.node=e,this.name=t,this.global=!0,this.isVarNode=!0,this.readOnly=r,this.parents=!0}getMemberType(e,t){return this.node.getMemberType(e,t)}getElementType(e){return this.node.getElementType(e)}getNodeType(e){return this.node.getNodeType(e)}generate(e){const{node:t,name:r,readOnly:s}=this,{renderer:i}=e,n=!0===i.backend.isWebGPUBackend;let a=!1,o=!1;s&&(a=e.isDeterministic(t),o=n?s:a);const u=e.getVectorType(this.getNodeType(e)),l=t.build(e,u),d=e.getVarFromNode(this,r,u,void 0,o),c=e.getPropertyName(d);let h=c;if(o)if(n)h=a?`const ${c}`:`let ${c}`;else{const r=e.getArrayCount(t);h=`const ${e.getVar(d.type,c,r)}`}return e.addLineFlowCode(`${h} = ${l}`,this),c}}const eu=Vi(Jo),tu=(e,t=null)=>eu(e,t).toStack(),ru=(e,t=null)=>eu(e,t,!0).toStack();oi("toVar",tu),oi("toConst",ru);const su=e=>(console.warn('TSL: "temp( node )" is deprecated. Use "Var( node )" or "node.toVar()" instead.'),eu(e));oi("temp",su);class iu extends js{static get type(){return"VaryingNode"}constructor(e,t=null){super(),this.node=e,this.name=t,this.isVaryingNode=!0,this.interpolationType=null,this.interpolationSampling=null,this.global=!0}setInterpolation(e,t=null){return this.interpolationType=e,this.interpolationSampling=t,this}getHash(e){return this.name||super.getHash(e)}getNodeType(e){return this.node.getNodeType(e)}setupVarying(e){const t=e.getNodeProperties(this);let r=t.varying;if(void 0===r){const s=this.name,i=this.getNodeType(e),n=this.interpolationType,a=this.interpolationSampling;t.varying=r=e.getVaryingFromNode(this,s,i,n,a),t.node=this.node}return r.needsInterpolation||(r.needsInterpolation="fragment"===e.shaderStage),r}setup(e){this.setupVarying(e),e.flowNodeFromShaderStage(Ds.VERTEX,this.node)}analyze(e){this.setupVarying(e),e.flowNodeFromShaderStage(Ds.VERTEX,this.node)}generate(e){const t=e.getNodeProperties(this),r=this.setupVarying(e);if(void 0===t.propertyName){const s=this.getNodeType(e),i=e.getPropertyName(r,Ds.VERTEX);e.flowNodeFromShaderStage(Ds.VERTEX,this.node,s,i),t.propertyName=i}return e.getPropertyName(r)}}const nu=Vi(iu).setParameterLength(1,2),au=e=>nu(e);oi("toVarying",nu),oi("toVertexStage",au),oi("varying",((...e)=>(console.warn("THREE.TSL: .varying() has been renamed to .toVarying()."),nu(...e)))),oi("vertexStage",((...e)=>(console.warn("THREE.TSL: .vertexStage() has been renamed to .toVertexStage()."),nu(...e))));const ou=ki((([e])=>{const t=e.mul(.9478672986).add(.0521327014).pow(2.4),r=e.mul(.0773993808),s=e.lessThanEqual(.04045);return Io(t,r,s)})).setLayout({name:"sRGBTransferEOTF",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),uu=ki((([e])=>{const t=e.pow(.41666).mul(1.055).sub(.055),r=e.mul(12.92),s=e.lessThanEqual(.0031308);return Io(t,r,s)})).setLayout({name:"sRGBTransferOETF",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),lu="WorkingColorSpace";class du extends Ks{static get type(){return"ColorSpaceNode"}constructor(e,t,r){super("vec4"),this.colorNode=e,this.source=t,this.target=r}resolveColorSpace(e,t){return t===lu?c.workingColorSpace:"OutputColorSpace"===t?e.context.outputColorSpace||e.renderer.outputColorSpace:t}setup(e){const{colorNode:t}=this,r=this.resolveColorSpace(e,this.source),s=this.resolveColorSpace(e,this.target);let i=t;return!1!==c.enabled&&r!==s&&r&&s?(c.getTransfer(r)===h&&(i=nn(ou(i.rgb),i.a)),c.getPrimaries(r)!==c.getPrimaries(s)&&(i=nn(dn(c._getMatrix(new n,r,s)).mul(i.rgb),i.a)),c.getTransfer(s)===h&&(i=nn(uu(i.rgb),i.a)),i):i}}const cu=(e,t)=>Bi(new du(Bi(e),lu,t)),hu=(e,t)=>Bi(new du(Bi(e),t,lu));oi("workingToColorSpace",cu),oi("colorSpaceToWorking",hu);let pu=class extends qs{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),r=this.referenceNode.getNodeType(),s=this.getNodeType();return e.format(t,r,s)}};class gu extends js{static get type(){return"ReferenceBaseNode"}constructor(e,t,r=null,s=null){super(),this.property=e,this.uniformType=t,this.object=r,this.count=s,this.properties=e.split("."),this.reference=r,this.node=null,this.group=null,this.updateType=Vs.OBJECT}setGroup(e){return this.group=e,this}element(e){return Bi(new pu(this,Bi(e)))}setNodeType(e){const t=Zn(null,e).getSelf();null!==this.group&&t.setGroup(this.group),this.node=t}getNodeType(e){return null===this.node&&(this.updateReference(e),this.updateValue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let r=e[t[0]];for(let e=1;eBi(new mu(e,t,r));class yu extends Ks{static get type(){return"ToneMappingNode"}constructor(e,t=xu,r=null){super("vec3"),this.toneMapping=e,this.exposureNode=t,this.colorNode=r}customCacheKey(){return Ts(this.toneMapping)}setup(e){const t=this.colorNode||e.context.color,r=this.toneMapping;if(r===p)return t;let s=null;const i=e.renderer.library.getToneMappingFunction(r);return null!==i?s=nn(i(t.rgb,this.exposureNode),t.a):(console.error("ToneMappingNode: Unsupported Tone Mapping configuration.",r),s=t),s}}const bu=(e,t,r)=>Bi(new yu(e,Bi(t),Bi(r))),xu=fu("toneMappingExposure","float");oi("toneMapping",((e,t,r)=>bu(t,r,e)));class Tu extends ti{static get type(){return"BufferAttributeNode"}constructor(e,t=null,r=0,s=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferStride=r,this.bufferOffset=s,this.usage=g,this.instanced=!1,this.attribute=null,this.global=!0,e&&!0===e.isBufferAttribute&&(this.attribute=e,this.usage=e.usage,this.instanced=e.isInstancedBufferAttribute)}getHash(e){if(0===this.bufferStride&&0===this.bufferOffset){let t=e.globalCache.getData(this.value);return void 0===t&&(t={node:this},e.globalCache.setData(this.value,t)),t.node.uuid}return this.uuid}getNodeType(e){return null===this.bufferType&&(this.bufferType=e.getTypeFromAttribute(this.attribute)),this.bufferType}setup(e){if(null!==this.attribute)return;const t=this.getNodeType(e),r=this.value,s=e.getTypeLength(t),i=this.bufferStride||s,n=this.bufferOffset,a=!0===r.isInterleavedBuffer?r:new m(r,i),o=new f(a,s,n);a.setUsage(this.usage),this.attribute=o,this.attribute.isInstancedBufferAttribute=this.instanced}generate(e){const t=this.getNodeType(e),r=e.getBufferAttributeFromNode(this,t),s=e.getPropertyName(r);let i=null;if("vertex"===e.shaderStage||"compute"===e.shaderStage)this.name=s,i=s;else{i=nu(this).build(e,t)}return i}getInputType(){return"bufferAttribute"}setUsage(e){return this.usage=e,this.attribute&&!0===this.attribute.isBufferAttribute&&(this.attribute.usage=e),this}setInstanced(e){return this.instanced=e,this}}const _u=(e,t=null,r=0,s=0)=>Bi(new Tu(e,t,r,s)),vu=(e,t=null,r=0,s=0)=>_u(e,t,r,s).setUsage(y),Nu=(e,t=null,r=0,s=0)=>_u(e,t,r,s).setInstanced(!0),Su=(e,t=null,r=0,s=0)=>vu(e,t,r,s).setInstanced(!0);oi("toAttribute",(e=>_u(e.value)));class Eu extends js{static get type(){return"ComputeNode"}constructor(e,t,r=[64]){super("void"),this.isComputeNode=!0,this.computeNode=e,this.count=t,this.workgroupSize=r,this.dispatchCount=0,this.version=1,this.name="",this.updateBeforeType=Vs.OBJECT,this.onInitFunction=null,this.updateDispatchCount()}dispose(){this.dispatchEvent({type:"dispose"})}label(e){return this.name=e,this}updateDispatchCount(){const{count:e,workgroupSize:t}=this;let r=t[0];for(let e=1;eBi(new Eu(Bi(e),t,r));oi("compute",wu);class Au extends js{static get type(){return"CacheNode"}constructor(e,t=!0){super(),this.node=e,this.parent=t,this.isCacheNode=!0}getNodeType(e){const t=e.getCache(),r=e.getCacheFromNode(this,this.parent);e.setCache(r);const s=this.node.getNodeType(e);return e.setCache(t),s}build(e,...t){const r=e.getCache(),s=e.getCacheFromNode(this,this.parent);e.setCache(s);const i=this.node.build(e,...t);return e.setCache(r),i}}const Ru=(e,t)=>Bi(new Au(Bi(e),t)),Cu=(e,t)=>e.context({namespace:t});oi("cache",Ru);class Mu extends js{static get type(){return"BypassNode"}constructor(e,t){super(),this.isBypassNode=!0,this.outputNode=e,this.callNode=t}getNodeType(e){return this.outputNode.getNodeType(e)}generate(e){const t=this.callNode.build(e,"void");return""!==t&&e.addLineFlowCode(t,this),this.outputNode.build(e)}}const Pu=Vi(Mu).setParameterLength(2);oi("bypass",Pu);class Fu extends js{static get type(){return"RemapNode"}constructor(e,t,r,s=ji(0),i=ji(1)){super(),this.node=e,this.inLowNode=t,this.inHighNode=r,this.outLowNode=s,this.outHighNode=i,this.doClamp=!0}setup(){const{node:e,inLowNode:t,inHighNode:r,outLowNode:s,outHighNode:i,doClamp:n}=this;let a=e.sub(t).div(r.sub(t));return!0===n&&(a=a.clamp()),a.mul(i.sub(s)).add(s)}}const Lu=Vi(Fu,null,null,{doClamp:!1}).setParameterLength(3,5),Bu=Vi(Fu).setParameterLength(3,5);oi("remap",Lu),oi("remapClamp",Bu);class Iu extends js{static get type(){return"ExpressionNode"}constructor(e="",t="void"){super(t),this.snippet=e}generate(e,t){const r=this.getNodeType(e),s=this.snippet;if("void"!==r)return e.format(s,r,t);e.addLineFlowCode(s,this)}}const Du=Vi(Iu).setParameterLength(1,2),Vu=e=>(e?Xo(e,Du("discard")):Du("discard")).toStack();oi("discard",Vu);class Uu extends Ks{static get type(){return"RenderOutputNode"}constructor(e,t,r){super("vec4"),this.colorNode=e,this.toneMapping=t,this.outputColorSpace=r,this.isRenderOutputNode=!0}setup({context:e}){let t=this.colorNode||e.color;const r=(null!==this.toneMapping?this.toneMapping:e.toneMapping)||p,s=(null!==this.outputColorSpace?this.outputColorSpace:e.outputColorSpace)||b;return r!==p&&(t=t.toneMapping(r)),s!==b&&s!==c.workingColorSpace&&(t=t.workingToColorSpace(s)),t}}const Ou=(e,t=null,r=null)=>Bi(new Uu(Bi(e),t,r));oi("renderOutput",Ou);class ku extends Ks{static get type(){return"DebugNode"}constructor(e,t=null){super(),this.node=e,this.callback=t}getNodeType(e){return this.node.getNodeType(e)}setup(e){return this.node.build(e)}analyze(e){return this.node.build(e)}generate(e){const t=this.callback,r=this.node.build(e),s="--- TSL debug - "+e.shaderStage+" shader ---",i="-".repeat(s.length);let n="";return n+="// #"+s+"#\n",n+=e.flow.code.replace(/^\t/gm,"")+"\n",n+="/* ... */ "+r+" /* ... */\n",n+="// #"+i+"#\n",null!==t?t(e,n):console.log(n),r}}const Gu=(e,t=null)=>Bi(new ku(Bi(e),t));oi("debug",Gu);class zu extends js{static get type(){return"AttributeNode"}constructor(e,t=null){super(t),this.global=!0,this._attributeName=e}getHash(e){return this.getAttributeName(e)}getNodeType(e){let t=this.nodeType;if(null===t){const r=this.getAttributeName(e);if(e.hasGeometryAttribute(r)){const s=e.geometry.getAttribute(r);t=e.getTypeFromAttribute(s)}else t="float"}return t}setAttributeName(e){return this._attributeName=e,this}getAttributeName(){return this._attributeName}generate(e){const t=this.getAttributeName(e),r=this.getNodeType(e);if(!0===e.hasGeometryAttribute(t)){const s=e.geometry.getAttribute(t),i=e.getTypeFromAttribute(s),n=e.getAttribute(t,i);if("vertex"===e.shaderStage)return e.format(n.name,i,r);return nu(this).build(e,r)}return console.warn(`AttributeNode: Vertex attribute "${t}" not found on geometry.`),e.generateConst(r)}serialize(e){super.serialize(e),e.global=this.global,e._attributeName=this._attributeName}deserialize(e){super.deserialize(e),this.global=e.global,this._attributeName=e._attributeName}}const Hu=(e,t=null)=>Bi(new zu(e,t)),$u=(e=0)=>Hu("uv"+(e>0?e:""),"vec2");class Wu extends js{static get type(){return"TextureSizeNode"}constructor(e,t=null){super("uvec2"),this.isTextureSizeNode=!0,this.textureNode=e,this.levelNode=t}generate(e,t){const r=this.textureNode.build(e,"property"),s=null===this.levelNode?"0":this.levelNode.build(e,"int");return e.format(`${e.getMethod("textureDimensions")}( ${r}, ${s} )`,this.getNodeType(e),t)}}const ju=Vi(Wu).setParameterLength(1,2);class qu extends Qn{static get type(){return"MaxMipLevelNode"}constructor(e){super(0),this._textureNode=e,this.updateType=Vs.FRAME}get textureNode(){return this._textureNode}get texture(){return this._textureNode.value}update(){const e=this.texture,t=e.images,r=t&&t.length>0?t[0]&&t[0].image||t[0]:e.image;if(r&&void 0!==r.width){const{width:e,height:t}=r;this.value=Math.log2(Math.max(e,t))}}}const Xu=Vi(qu).setParameterLength(1),Ku=new x;class Yu extends Qn{static get type(){return"TextureNode"}constructor(e=Ku,t=null,r=null,s=null){super(e),this.isTextureNode=!0,this.uvNode=t,this.levelNode=r,this.biasNode=s,this.compareNode=null,this.depthNode=null,this.gradNode=null,this.sampler=!0,this.updateMatrix=!1,this.updateType=Vs.NONE,this.referenceNode=null,this._value=e,this._matrixUniform=null,this.setUpdateMatrix(null===t)}set value(e){this.referenceNode?this.referenceNode.value=e:this._value=e}get value(){return this.referenceNode?this.referenceNode.value:this._value}getUniformHash(){return this.value.uuid}getNodeType(){return!0===this.value.isDepthTexture?"float":this.value.type===T?"uvec4":this.value.type===_?"ivec4":"vec4"}getInputType(){return"texture"}getDefaultUV(){return $u(this.value.channel)}updateReference(){return this.value}getTransformedUV(e){return null===this._matrixUniform&&(this._matrixUniform=Zn(this.value.matrix)),this._matrixUniform.mul(en(e,1)).xy}setUpdateMatrix(e){return this.updateMatrix=e,this.updateType=e?Vs.OBJECT:Vs.NONE,this}setupUV(e,t){const r=this.value;return e.isFlipY()&&(r.image instanceof ImageBitmap&&!0===r.flipY||!0===r.isRenderTargetTexture||!0===r.isFramebufferTexture||!0===r.isDepthTexture)&&(t=this.sampler?t.flipY():t.setY(qi(ju(this,this.levelNode).y).sub(t.y).sub(1))),t}setup(e){const t=e.getNodeProperties(this);t.referenceNode=this.referenceNode;const r=this.value;if(!r||!0!==r.isTexture)throw new Error("THREE.TSL: `texture( value )` function expects a valid instance of THREE.Texture().");let s=this.uvNode;null!==s&&!0!==e.context.forceUVContext||!e.context.getUV||(s=e.context.getUV(this,e)),s||(s=this.getDefaultUV()),!0===this.updateMatrix&&(s=this.getTransformedUV(s)),s=this.setupUV(e,s);let i=this.levelNode;null===i&&e.context.getTextureLevel&&(i=e.context.getTextureLevel(this)),t.uvNode=s,t.levelNode=i,t.biasNode=this.biasNode,t.compareNode=this.compareNode,t.gradNode=this.gradNode,t.depthNode=this.depthNode}generateUV(e,t){return t.build(e,!0===this.sampler?"vec2":"ivec2")}generateSnippet(e,t,r,s,i,n,a,o){const u=this.value;let l;return l=s?e.generateTextureLevel(u,t,r,s,n):i?e.generateTextureBias(u,t,r,i,n):o?e.generateTextureGrad(u,t,r,o,n):a?e.generateTextureCompare(u,t,r,a,n):!1===this.sampler?e.generateTextureLoad(u,t,r,n):e.generateTexture(u,t,r,n),l}generate(e,t){const r=this.value,s=e.getNodeProperties(this),i=super.generate(e,"property");if(/^sampler/.test(t))return i+"_sampler";if(e.isReference(t))return i;{const n=e.getDataFromNode(this);let a=n.propertyName;if(void 0===a){const{uvNode:t,levelNode:r,biasNode:o,compareNode:u,depthNode:l,gradNode:d}=s,c=this.generateUV(e,t),h=r?r.build(e,"float"):null,p=o?o.build(e,"float"):null,g=l?l.build(e,"int"):null,m=u?u.build(e,"float"):null,f=d?[d[0].build(e,"vec2"),d[1].build(e,"vec2")]:null,y=e.getVarFromNode(this);a=e.getPropertyName(y);const b=this.generateSnippet(e,i,c,h,p,g,m,f);e.addLineFlowCode(`${a} = ${b}`,this),n.snippet=b,n.propertyName=a}let o=a;const u=this.getNodeType(e);return e.needsToWorkingColorSpace(r)&&(o=hu(Du(o,u),r.colorSpace).setup(e).build(e,u)),e.format(o,u,t)}}setSampler(e){return this.sampler=e,this}getSampler(){return this.sampler}uv(e){return console.warn("THREE.TextureNode: .uv() has been renamed. Use .sample() instead."),this.sample(e)}sample(e){const t=this.clone();return t.uvNode=Bi(e),t.referenceNode=this.getSelf(),Bi(t)}blur(e){const t=this.clone();t.biasNode=Bi(e).mul(Xu(t)),t.referenceNode=this.getSelf();const r=t.value;return!1===t.generateMipmaps&&(r&&!1===r.generateMipmaps||r.minFilter===v||r.magFilter===v)&&(console.warn("THREE.TSL: texture().blur() requires mipmaps and sampling. Use .generateMipmaps=true and .minFilter/.magFilter=THREE.LinearFilter in the Texture."),t.biasNode=null),Bi(t)}level(e){const t=this.clone();return t.levelNode=Bi(e),t.referenceNode=this.getSelf(),Bi(t)}size(e){return ju(this,e)}bias(e){const t=this.clone();return t.biasNode=Bi(e),t.referenceNode=this.getSelf(),Bi(t)}compare(e){const t=this.clone();return t.compareNode=Bi(e),t.referenceNode=this.getSelf(),Bi(t)}grad(e,t){const r=this.clone();return r.gradNode=[Bi(e),Bi(t)],r.referenceNode=this.getSelf(),Bi(r)}depth(e){const t=this.clone();return t.depthNode=Bi(e),t.referenceNode=this.getSelf(),Bi(t)}serialize(e){super.serialize(e),e.value=this.value.toJSON(e.meta).uuid,e.sampler=this.sampler,e.updateMatrix=this.updateMatrix,e.updateType=this.updateType}deserialize(e){super.deserialize(e),this.value=e.meta.textures[e.value],this.sampler=e.sampler,this.updateMatrix=e.updateMatrix,this.updateType=e.updateType}update(){const e=this.value,t=this._matrixUniform;null!==t&&(t.value=e.matrix),!0===e.matrixAutoUpdate&&e.updateMatrix()}clone(){const e=new this.constructor(this.value,this.uvNode,this.levelNode,this.biasNode);return e.sampler=this.sampler,e.depthNode=this.depthNode,e.compareNode=this.compareNode,e.gradNode=this.gradNode,e}}const Qu=Vi(Yu).setParameterLength(1,4).setName("texture"),Zu=(e=Ku,t=null,r=null,s=null)=>{let i;return e&&!0===e.isTextureNode?(i=Bi(e.clone()),i.referenceNode=e.getSelf(),null!==t&&(i.uvNode=Bi(t)),null!==r&&(i.levelNode=Bi(r)),null!==s&&(i.biasNode=Bi(s))):i=Qu(e,t,r,s),i},Ju=(...e)=>Zu(...e).setSampler(!1);class el extends Qn{static get type(){return"BufferNode"}constructor(e,t,r=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferCount=r}getElementType(e){return this.getNodeType(e)}getInputType(){return"buffer"}}const tl=(e,t,r)=>Bi(new el(e,t,r));class rl extends qs{static get type(){return"UniformArrayElementNode"}constructor(e,t){super(e,t),this.isArrayBufferElementNode=!0}generate(e){const t=super.generate(e),r=this.getNodeType(),s=this.node.getPaddedType();return e.format(t,s,r)}}class sl extends el{static get type(){return"UniformArrayNode"}constructor(e,t=null){super(null),this.array=e,this.elementType=null===t?Ms(e[0]):t,this.paddedType=this.getPaddedType(),this.updateType=Vs.RENDER,this.isArrayBufferNode=!0}getNodeType(){return this.paddedType}getElementType(){return this.elementType}getPaddedType(){const e=this.elementType;let t="vec4";return"mat2"===e?t="mat2":!0===/mat/.test(e)?t="mat4":"i"===e.charAt(0)?t="ivec4":"u"===e.charAt(0)&&(t="uvec4"),t}update(){const{array:e,value:t}=this,r=this.elementType;if("float"===r||"int"===r||"uint"===r)for(let r=0;rBi(new sl(e,t));const nl=Vi(class extends js{constructor(e){super("float"),this.name=e,this.isBuiltinNode=!0}generate(){return this.name}}).setParameterLength(1),al=Zn(0,"uint").label("u_cameraIndex").setGroup(qn("cameraIndex")).toVarying("v_cameraIndex"),ol=Zn("float").label("cameraNear").setGroup(Kn).onRenderUpdate((({camera:e})=>e.near)),ul=Zn("float").label("cameraFar").setGroup(Kn).onRenderUpdate((({camera:e})=>e.far)),ll=ki((({camera:e})=>{let t;if(e.isArrayCamera&&e.cameras.length>0){const r=[];for(const t of e.cameras)r.push(t.projectionMatrix);t=il(r).setGroup(Kn).label("cameraProjectionMatrices").element(e.isMultiViewCamera?nl("gl_ViewID_OVR"):al).toVar("cameraProjectionMatrix")}else t=Zn("mat4").label("cameraProjectionMatrix").setGroup(Kn).onRenderUpdate((({camera:e})=>e.projectionMatrix));return t})).once()(),dl=ki((({camera:e})=>{let t;if(e.isArrayCamera&&e.cameras.length>0){const r=[];for(const t of e.cameras)r.push(t.projectionMatrixInverse);t=il(r).setGroup(Kn).label("cameraProjectionMatricesInverse").element(e.isMultiViewCamera?nl("gl_ViewID_OVR"):al).toVar("cameraProjectionMatrixInverse")}else t=Zn("mat4").label("cameraProjectionMatrixInverse").setGroup(Kn).onRenderUpdate((({camera:e})=>e.projectionMatrixInverse));return t})).once()(),cl=ki((({camera:e})=>{let t;if(e.isArrayCamera&&e.cameras.length>0){const r=[];for(const t of e.cameras)r.push(t.matrixWorldInverse);t=il(r).setGroup(Kn).label("cameraViewMatrices").element(e.isMultiViewCamera?nl("gl_ViewID_OVR"):al).toVar("cameraViewMatrix")}else t=Zn("mat4").label("cameraViewMatrix").setGroup(Kn).onRenderUpdate((({camera:e})=>e.matrixWorldInverse));return t})).once()(),hl=Zn("mat4").label("cameraWorldMatrix").setGroup(Kn).onRenderUpdate((({camera:e})=>e.matrixWorld)),pl=Zn("mat3").label("cameraNormalMatrix").setGroup(Kn).onRenderUpdate((({camera:e})=>e.normalMatrix)),gl=Zn(new r).label("cameraPosition").setGroup(Kn).onRenderUpdate((({camera:e},t)=>t.value.setFromMatrixPosition(e.matrixWorld))),ml=new N;class fl extends js{static get type(){return"Object3DNode"}constructor(e,t=null){super(),this.scope=e,this.object3d=t,this.updateType=Vs.OBJECT,this.uniformNode=new Qn(null)}getNodeType(){const e=this.scope;return e===fl.WORLD_MATRIX?"mat4":e===fl.POSITION||e===fl.VIEW_POSITION||e===fl.DIRECTION||e===fl.SCALE?"vec3":e===fl.RADIUS?"float":void 0}update(e){const t=this.object3d,s=this.uniformNode,i=this.scope;if(i===fl.WORLD_MATRIX)s.value=t.matrixWorld;else if(i===fl.POSITION)s.value=s.value||new r,s.value.setFromMatrixPosition(t.matrixWorld);else if(i===fl.SCALE)s.value=s.value||new r,s.value.setFromMatrixScale(t.matrixWorld);else if(i===fl.DIRECTION)s.value=s.value||new r,t.getWorldDirection(s.value);else if(i===fl.VIEW_POSITION){const i=e.camera;s.value=s.value||new r,s.value.setFromMatrixPosition(t.matrixWorld),s.value.applyMatrix4(i.matrixWorldInverse)}else if(i===fl.RADIUS){const r=e.object.geometry;null===r.boundingSphere&&r.computeBoundingSphere(),ml.copy(r.boundingSphere).applyMatrix4(t.matrixWorld),s.value=ml.radius}}generate(e){const t=this.scope;return t===fl.WORLD_MATRIX?this.uniformNode.nodeType="mat4":t===fl.POSITION||t===fl.VIEW_POSITION||t===fl.DIRECTION||t===fl.SCALE?this.uniformNode.nodeType="vec3":t===fl.RADIUS&&(this.uniformNode.nodeType="float"),this.uniformNode.build(e)}serialize(e){super.serialize(e),e.scope=this.scope}deserialize(e){super.deserialize(e),this.scope=e.scope}}fl.WORLD_MATRIX="worldMatrix",fl.POSITION="position",fl.SCALE="scale",fl.VIEW_POSITION="viewPosition",fl.DIRECTION="direction",fl.RADIUS="radius";const yl=Vi(fl,fl.DIRECTION).setParameterLength(1),bl=Vi(fl,fl.WORLD_MATRIX).setParameterLength(1),xl=Vi(fl,fl.POSITION).setParameterLength(1),Tl=Vi(fl,fl.SCALE).setParameterLength(1),_l=Vi(fl,fl.VIEW_POSITION).setParameterLength(1),vl=Vi(fl,fl.RADIUS).setParameterLength(1);class Nl extends fl{static get type(){return"ModelNode"}constructor(e){super(e)}update(e){this.object3d=e.object,super.update(e)}}const Sl=Ui(Nl,Nl.DIRECTION),El=Ui(Nl,Nl.WORLD_MATRIX),wl=Ui(Nl,Nl.POSITION),Al=Ui(Nl,Nl.SCALE),Rl=Ui(Nl,Nl.VIEW_POSITION),Cl=Ui(Nl,Nl.RADIUS),Ml=Zn(new n).onObjectUpdate((({object:e},t)=>t.value.getNormalMatrix(e.matrixWorld))),Pl=Zn(new a).onObjectUpdate((({object:e},t)=>t.value.copy(e.matrixWorld).invert())),Fl=ki((e=>e.renderer.overrideNodes.modelViewMatrix||Ll)).once()().toVar("modelViewMatrix"),Ll=cl.mul(El),Bl=ki((e=>(e.context.isHighPrecisionModelViewMatrix=!0,Zn("mat4").onObjectUpdate((({object:e,camera:t})=>e.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,e.matrixWorld)))))).once()().toVar("highpModelViewMatrix"),Il=ki((e=>{const t=e.context.isHighPrecisionModelViewMatrix;return Zn("mat3").onObjectUpdate((({object:e,camera:r})=>(!0!==t&&e.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix))))})).once()().toVar("highpModelNormalViewMatrix"),Dl=Hu("position","vec3"),Vl=Dl.toVarying("positionLocal"),Ul=Dl.toVarying("positionPrevious"),Ol=ki((e=>El.mul(Vl).xyz.toVarying(e.getNamespace("v_positionWorld"))),"vec3").once("POSITION")(),kl=ki((e=>Vl.transformDirection(El).toVarying(e.getNamespace("v_positionWorldDirection")).normalize().toVar("positionWorldDirection")),"vec3").once("POSITION")(),Gl=ki((e=>e.context.setupPositionView().toVarying(e.getNamespace("v_positionView"))),"vec3").once("POSITION")(),zl=Gl.negate().toVarying("v_positionViewDirection").normalize().toVar("positionViewDirection");class Hl extends js{static get type(){return"FrontFacingNode"}constructor(){super("bool"),this.isFrontFacingNode=!0}generate(e){const{renderer:t,material:r}=e;return t.coordinateSystem===l&&r.side===S?"false":e.getFrontFacing()}}const $l=Ui(Hl),Wl=ji($l).mul(2).sub(1),jl=Hu("normal","vec3"),ql=ki((e=>!1===e.geometry.hasAttribute("normal")?(console.warn('THREE.TSL: Vertex attribute "normal" not found on geometry.'),en(0,1,0)):jl),"vec3").once()().toVar("normalLocal"),Xl=Gl.dFdx().cross(Gl.dFdy()).normalize().toVar("normalFlat"),Kl=ki((e=>{let t;return t=!0===e.material.flatShading?Xl:nu(td(ql),"v_normalView").normalize(),t}),"vec3").once()().toVar("normalView"),Yl=ki((e=>{let t=Kl.transformDirection(cl);return!0!==e.material.flatShading&&(t=nu(t,"v_normalWorld")),t}),"vec3").once()().normalize().toVar("normalWorld"),Ql=ki((e=>{let t=e.context.setupNormal().context({getUV:null});return!0!==e.material.flatShading&&(t=t.mul(Wl)),t}),"vec3").once()().toVar("transformedNormalView"),Zl=Ql.transformDirection(cl).toVar("transformedNormalWorld"),Jl=ki((e=>{let t=e.context.setupClearcoatNormal().context({getUV:null});return!0!==e.material.flatShading&&(t=t.mul(Wl)),t}),"vec3").once()().toVar("transformedClearcoatNormalView"),ed=ki((([e,t=El])=>{const r=dn(t),s=e.div(en(r[0].dot(r[0]),r[1].dot(r[1]),r[2].dot(r[2])));return r.mul(s).xyz})),td=ki((([e],t)=>{const r=t.renderer.overrideNodes.modelNormalViewMatrix;if(null!==r)return r.transformDirection(e);const s=Ml.mul(e);return cl.transformDirection(s)})),rd=new E,sd=new a,id=Zn(0).onReference((({material:e})=>e)).onObjectUpdate((({material:e})=>e.refractionRatio)),nd=Zn(1).onReference((({material:e})=>e)).onObjectUpdate((function({material:e,scene:t}){return e.envMap?e.envMapIntensity:t.environmentIntensity})),ad=Zn(new a).onReference((function(e){return e.material})).onObjectUpdate((function({material:e,scene:t}){const r=null!==t.environment&&null===e.envMap?t.environmentRotation:e.envMapRotation;return r?(rd.copy(r),sd.makeRotationFromEuler(rd)):sd.identity(),sd})),od=zl.negate().reflect(Ql),ud=zl.negate().refract(Ql,id),ld=od.transformDirection(cl).toVar("reflectVector"),dd=ud.transformDirection(cl).toVar("reflectVector"),cd=new w;class hd extends Yu{static get type(){return"CubeTextureNode"}constructor(e,t=null,r=null,s=null){super(e,t,r,s),this.isCubeTextureNode=!0}getInputType(){return"cubeTexture"}getDefaultUV(){const e=this.value;return e.mapping===A?ld:e.mapping===R?dd:(console.error('THREE.CubeTextureNode: Mapping "%s" not supported.',e.mapping),en(0,0,0))}setUpdateMatrix(){}setupUV(e,t){const r=this.value;return e.renderer.coordinateSystem!==d&&r.isRenderTargetTexture||(t=en(t.x.negate(),t.yz)),ad.mul(t)}generateUV(e,t){return t.build(e,"vec3")}}const pd=Vi(hd).setParameterLength(1,4).setName("cubeTexture"),gd=(e=cd,t=null,r=null,s=null)=>{let i;return e&&!0===e.isCubeTextureNode?(i=Bi(e.clone()),i.referenceNode=e.getSelf(),null!==t&&(i.uvNode=Bi(t)),null!==r&&(i.levelNode=Bi(r)),null!==s&&(i.biasNode=Bi(s))):i=pd(e,t,r,s),i};class md extends qs{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),r=this.referenceNode.getNodeType(),s=this.getNodeType();return e.format(t,r,s)}}class fd extends js{static get type(){return"ReferenceNode"}constructor(e,t,r=null,s=null){super(),this.property=e,this.uniformType=t,this.object=r,this.count=s,this.properties=e.split("."),this.reference=r,this.node=null,this.group=null,this.name=null,this.updateType=Vs.OBJECT}element(e){return Bi(new md(this,Bi(e)))}setGroup(e){return this.group=e,this}label(e){return this.name=e,this}setNodeType(e){let t=null;t=null!==this.count?tl(null,e,this.count):Array.isArray(this.getValueFromReference())?il(null,e):"texture"===e?Zu(null):"cubeTexture"===e?gd(null):Zn(null,e),null!==this.group&&t.setGroup(this.group),null!==this.name&&t.label(this.name),this.node=t.getSelf()}getNodeType(e){return null===this.node&&(this.updateReference(e),this.updateValue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let r=e[t[0]];for(let e=1;eBi(new fd(e,t,r)),bd=(e,t,r,s)=>Bi(new fd(e,t,s,r));class xd extends fd{static get type(){return"MaterialReferenceNode"}constructor(e,t,r=null){super(e,t,r),this.material=r,this.isMaterialReferenceNode=!0}updateReference(e){return this.reference=null!==this.material?this.material:e.material,this.reference}}const Td=(e,t,r=null)=>Bi(new xd(e,t,r)),_d=ki((e=>(!1===e.geometry.hasAttribute("tangent")&&e.geometry.computeTangents(),Hu("tangent","vec4"))))(),vd=_d.xyz.toVar("tangentLocal"),Nd=Fl.mul(nn(vd,0)).xyz.toVarying("v_tangentView").normalize().toVar("tangentView"),Sd=Nd.transformDirection(cl).toVarying("v_tangentWorld").normalize().toVar("tangentWorld"),Ed=Nd.toVar("transformedTangentView"),wd=Ed.transformDirection(cl).normalize().toVar("transformedTangentWorld"),Ad=ki((([e,t],r)=>{let s=e.mul(_d.w).xyz;return!0!==r.material.flatShading&&(s=nu(s,t)),s})).once(),Rd=Ad(jl.cross(_d),"v_bitangentGeometry").normalize().toVar("bitangentGeometry"),Cd=Ad(ql.cross(vd),"v_bitangentLocal").normalize().toVar("bitangentLocal"),Md=Ad(Kl.cross(Nd),"v_bitangentView").normalize().toVar("bitangentView"),Pd=Ad(Yl.cross(Sd),"v_bitangentWorld").normalize().toVar("bitangentWorld"),Fd=Ad(Ql.cross(Ed),"v_transformedBitangentView").normalize().toVar("transformedBitangentView"),Ld=Fd.transformDirection(cl).normalize().toVar("transformedBitangentWorld"),Bd=dn(Nd,Md,Kl),Id=zl.mul(Bd),Dd=(()=>{let e=Pn.cross(zl);return e=e.cross(Pn).normalize(),e=Io(e,Ql,Cn.mul(xn.oneMinus()).oneMinus().pow2().pow2()).normalize(),e})(),Vd=ki((e=>{const{eye_pos:t,surf_norm:r,mapN:s,uv:i}=e,n=t.dFdx(),a=t.dFdy(),o=i.dFdx(),u=i.dFdy(),l=r,d=a.cross(l),c=l.cross(n),h=d.mul(o.x).add(c.mul(u.x)),p=d.mul(o.y).add(c.mul(u.y)),g=h.dot(h).max(p.dot(p)),m=Wl.mul(g.inverseSqrt());return oa(h.mul(s.x,m),p.mul(s.y,m),l.mul(s.z)).normalize()}));class Ud extends Ks{static get type(){return"NormalMapNode"}constructor(e,t=null){super("vec3"),this.node=e,this.scaleNode=t,this.normalMapType=C}setup(e){const{normalMapType:t,scaleNode:r}=this;let s=this.node.mul(2).sub(1);null!==r&&(s=en(s.xy.mul(r),s.z));let i=null;if(t===M)i=td(s);else if(t===C){i=!0===e.hasGeometryAttribute("tangent")?Bd.mul(s).normalize():Vd({eye_pos:Gl,surf_norm:Kl,mapN:s,uv:$u()})}return i}}const Od=Vi(Ud).setParameterLength(1,2),kd=ki((({textureNode:e,bumpScale:t})=>{const r=t=>e.cache().context({getUV:e=>t(e.uvNode||$u()),forceUVContext:!0}),s=ji(r((e=>e)));return Yi(ji(r((e=>e.add(e.dFdx())))).sub(s),ji(r((e=>e.add(e.dFdy())))).sub(s)).mul(t)})),Gd=ki((e=>{const{surf_pos:t,surf_norm:r,dHdxy:s}=e,i=t.dFdx().normalize(),n=r,a=t.dFdy().normalize().cross(n),o=n.cross(i),u=i.dot(a).mul(Wl),l=u.sign().mul(s.x.mul(a).add(s.y.mul(o)));return u.abs().mul(r).sub(l).normalize()}));class zd extends Ks{static get type(){return"BumpMapNode"}constructor(e,t=null){super("vec3"),this.textureNode=e,this.scaleNode=t}setup(){const e=null!==this.scaleNode?this.scaleNode:1,t=kd({textureNode:this.textureNode,bumpScale:e});return Gd({surf_pos:Gl,surf_norm:Kl,dHdxy:t})}}const Hd=Vi(zd).setParameterLength(1,2),$d=new Map;class Wd extends js{static get type(){return"MaterialNode"}constructor(e){super(),this.scope=e}getCache(e,t){let r=$d.get(e);return void 0===r&&(r=Td(e,t),$d.set(e,r)),r}getFloat(e){return this.getCache(e,"float")}getColor(e){return this.getCache(e,"color")}getTexture(e){return this.getCache("map"===e?"map":e+"Map","texture")}setup(e){const t=e.context.material,r=this.scope;let s=null;if(r===Wd.COLOR){const e=void 0!==t.color?this.getColor(r):en();s=t.map&&!0===t.map.isTexture?e.mul(this.getTexture("map")):e}else if(r===Wd.OPACITY){const e=this.getFloat(r);s=t.alphaMap&&!0===t.alphaMap.isTexture?e.mul(this.getTexture("alpha")):e}else if(r===Wd.SPECULAR_STRENGTH)s=t.specularMap&&!0===t.specularMap.isTexture?this.getTexture("specular").r:ji(1);else if(r===Wd.SPECULAR_INTENSITY){const e=this.getFloat(r);s=t.specularIntensityMap&&!0===t.specularIntensityMap.isTexture?e.mul(this.getTexture(r).a):e}else if(r===Wd.SPECULAR_COLOR){const e=this.getColor(r);s=t.specularColorMap&&!0===t.specularColorMap.isTexture?e.mul(this.getTexture(r).rgb):e}else if(r===Wd.ROUGHNESS){const e=this.getFloat(r);s=t.roughnessMap&&!0===t.roughnessMap.isTexture?e.mul(this.getTexture(r).g):e}else if(r===Wd.METALNESS){const e=this.getFloat(r);s=t.metalnessMap&&!0===t.metalnessMap.isTexture?e.mul(this.getTexture(r).b):e}else if(r===Wd.EMISSIVE){const e=this.getFloat("emissiveIntensity"),i=this.getColor(r).mul(e);s=t.emissiveMap&&!0===t.emissiveMap.isTexture?i.mul(this.getTexture(r)):i}else if(r===Wd.NORMAL)t.normalMap?(s=Od(this.getTexture("normal"),this.getCache("normalScale","vec2")),s.normalMapType=t.normalMapType):s=t.bumpMap?Hd(this.getTexture("bump").r,this.getFloat("bumpScale")):Kl;else if(r===Wd.CLEARCOAT){const e=this.getFloat(r);s=t.clearcoatMap&&!0===t.clearcoatMap.isTexture?e.mul(this.getTexture(r).r):e}else if(r===Wd.CLEARCOAT_ROUGHNESS){const e=this.getFloat(r);s=t.clearcoatRoughnessMap&&!0===t.clearcoatRoughnessMap.isTexture?e.mul(this.getTexture(r).r):e}else if(r===Wd.CLEARCOAT_NORMAL)s=t.clearcoatNormalMap?Od(this.getTexture(r),this.getCache(r+"Scale","vec2")):Kl;else if(r===Wd.SHEEN){const e=this.getColor("sheenColor").mul(this.getFloat("sheen"));s=t.sheenColorMap&&!0===t.sheenColorMap.isTexture?e.mul(this.getTexture("sheenColor").rgb):e}else if(r===Wd.SHEEN_ROUGHNESS){const e=this.getFloat(r);s=t.sheenRoughnessMap&&!0===t.sheenRoughnessMap.isTexture?e.mul(this.getTexture(r).a):e,s=s.clamp(.07,1)}else if(r===Wd.ANISOTROPY)if(t.anisotropyMap&&!0===t.anisotropyMap.isTexture){const e=this.getTexture(r);s=ln(Cc.x,Cc.y,Cc.y.negate(),Cc.x).mul(e.rg.mul(2).sub(Yi(1)).normalize().mul(e.b))}else s=Cc;else if(r===Wd.IRIDESCENCE_THICKNESS){const e=yd("1","float",t.iridescenceThicknessRange);if(t.iridescenceThicknessMap){const i=yd("0","float",t.iridescenceThicknessRange);s=e.sub(i).mul(this.getTexture(r).g).add(i)}else s=e}else if(r===Wd.TRANSMISSION){const e=this.getFloat(r);s=t.transmissionMap?e.mul(this.getTexture(r).r):e}else if(r===Wd.THICKNESS){const e=this.getFloat(r);s=t.thicknessMap?e.mul(this.getTexture(r).g):e}else if(r===Wd.IOR)s=this.getFloat(r);else if(r===Wd.LIGHT_MAP)s=this.getTexture(r).rgb.mul(this.getFloat("lightMapIntensity"));else if(r===Wd.AO)s=this.getTexture(r).r.sub(1).mul(this.getFloat("aoMapIntensity")).add(1);else if(r===Wd.LINE_DASH_OFFSET)s=t.dashOffset?this.getFloat(r):ji(0);else{const t=this.getNodeType(e);s=this.getCache(r,t)}return s}}Wd.ALPHA_TEST="alphaTest",Wd.COLOR="color",Wd.OPACITY="opacity",Wd.SHININESS="shininess",Wd.SPECULAR="specular",Wd.SPECULAR_STRENGTH="specularStrength",Wd.SPECULAR_INTENSITY="specularIntensity",Wd.SPECULAR_COLOR="specularColor",Wd.REFLECTIVITY="reflectivity",Wd.ROUGHNESS="roughness",Wd.METALNESS="metalness",Wd.NORMAL="normal",Wd.CLEARCOAT="clearcoat",Wd.CLEARCOAT_ROUGHNESS="clearcoatRoughness",Wd.CLEARCOAT_NORMAL="clearcoatNormal",Wd.EMISSIVE="emissive",Wd.ROTATION="rotation",Wd.SHEEN="sheen",Wd.SHEEN_ROUGHNESS="sheenRoughness",Wd.ANISOTROPY="anisotropy",Wd.IRIDESCENCE="iridescence",Wd.IRIDESCENCE_IOR="iridescenceIOR",Wd.IRIDESCENCE_THICKNESS="iridescenceThickness",Wd.IOR="ior",Wd.TRANSMISSION="transmission",Wd.THICKNESS="thickness",Wd.ATTENUATION_DISTANCE="attenuationDistance",Wd.ATTENUATION_COLOR="attenuationColor",Wd.LINE_SCALE="scale",Wd.LINE_DASH_SIZE="dashSize",Wd.LINE_GAP_SIZE="gapSize",Wd.LINE_WIDTH="linewidth",Wd.LINE_DASH_OFFSET="dashOffset",Wd.POINT_SIZE="size",Wd.DISPERSION="dispersion",Wd.LIGHT_MAP="light",Wd.AO="ao";const jd=Ui(Wd,Wd.ALPHA_TEST),qd=Ui(Wd,Wd.COLOR),Xd=Ui(Wd,Wd.SHININESS),Kd=Ui(Wd,Wd.EMISSIVE),Yd=Ui(Wd,Wd.OPACITY),Qd=Ui(Wd,Wd.SPECULAR),Zd=Ui(Wd,Wd.SPECULAR_INTENSITY),Jd=Ui(Wd,Wd.SPECULAR_COLOR),ec=Ui(Wd,Wd.SPECULAR_STRENGTH),tc=Ui(Wd,Wd.REFLECTIVITY),rc=Ui(Wd,Wd.ROUGHNESS),sc=Ui(Wd,Wd.METALNESS),ic=Ui(Wd,Wd.NORMAL),nc=Ui(Wd,Wd.CLEARCOAT),ac=Ui(Wd,Wd.CLEARCOAT_ROUGHNESS),oc=Ui(Wd,Wd.CLEARCOAT_NORMAL),uc=Ui(Wd,Wd.ROTATION),lc=Ui(Wd,Wd.SHEEN),dc=Ui(Wd,Wd.SHEEN_ROUGHNESS),cc=Ui(Wd,Wd.ANISOTROPY),hc=Ui(Wd,Wd.IRIDESCENCE),pc=Ui(Wd,Wd.IRIDESCENCE_IOR),gc=Ui(Wd,Wd.IRIDESCENCE_THICKNESS),mc=Ui(Wd,Wd.TRANSMISSION),fc=Ui(Wd,Wd.THICKNESS),yc=Ui(Wd,Wd.IOR),bc=Ui(Wd,Wd.ATTENUATION_DISTANCE),xc=Ui(Wd,Wd.ATTENUATION_COLOR),Tc=Ui(Wd,Wd.LINE_SCALE),_c=Ui(Wd,Wd.LINE_DASH_SIZE),vc=Ui(Wd,Wd.LINE_GAP_SIZE),Nc=Ui(Wd,Wd.LINE_WIDTH),Sc=Ui(Wd,Wd.LINE_DASH_OFFSET),Ec=Ui(Wd,Wd.POINT_SIZE),wc=Ui(Wd,Wd.DISPERSION),Ac=Ui(Wd,Wd.LIGHT_MAP),Rc=Ui(Wd,Wd.AO),Cc=Zn(new t).onReference((function(e){return e.material})).onRenderUpdate((function({material:e}){this.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation))})),Mc=ki((e=>e.context.setupModelViewProjection()),"vec4").once()().toVarying("v_modelViewProjection");class Pc extends js{static get type(){return"IndexNode"}constructor(e){super("uint"),this.scope=e,this.isIndexNode=!0}generate(e){const t=this.getNodeType(e),r=this.scope;let s,i;if(r===Pc.VERTEX)s=e.getVertexIndex();else if(r===Pc.INSTANCE)s=e.getInstanceIndex();else if(r===Pc.DRAW)s=e.getDrawIndex();else if(r===Pc.INVOCATION_LOCAL)s=e.getInvocationLocalIndex();else if(r===Pc.INVOCATION_SUBGROUP)s=e.getInvocationSubgroupIndex();else{if(r!==Pc.SUBGROUP)throw new Error("THREE.IndexNode: Unknown scope: "+r);s=e.getSubgroupIndex()}if("vertex"===e.shaderStage||"compute"===e.shaderStage)i=s;else{i=nu(this).build(e,t)}return i}}Pc.VERTEX="vertex",Pc.INSTANCE="instance",Pc.SUBGROUP="subgroup",Pc.INVOCATION_LOCAL="invocationLocal",Pc.INVOCATION_SUBGROUP="invocationSubgroup",Pc.DRAW="draw";const Fc=Ui(Pc,Pc.VERTEX),Lc=Ui(Pc,Pc.INSTANCE),Bc=Ui(Pc,Pc.SUBGROUP),Ic=Ui(Pc,Pc.INVOCATION_SUBGROUP),Dc=Ui(Pc,Pc.INVOCATION_LOCAL),Vc=Ui(Pc,Pc.DRAW);class Uc extends js{static get type(){return"InstanceNode"}constructor(e,t,r=null){super("void"),this.count=e,this.instanceMatrix=t,this.instanceColor=r,this.instanceMatrixNode=null,this.instanceColorNode=null,this.updateType=Vs.FRAME,this.buffer=null,this.bufferColor=null}setup(e){const{count:t,instanceMatrix:r,instanceColor:s}=this;let{instanceMatrixNode:i,instanceColorNode:n}=this;if(null===i){if(t<=1e3)i=tl(r.array,"mat4",Math.max(t,1)).element(Lc);else{const e=new P(r.array,16,1);this.buffer=e;const t=r.usage===y?Su:Nu,s=[t(e,"vec4",16,0),t(e,"vec4",16,4),t(e,"vec4",16,8),t(e,"vec4",16,12)];i=cn(...s)}this.instanceMatrixNode=i}if(s&&null===n){const e=new F(s.array,3),t=s.usage===y?Su:Nu;this.bufferColor=e,n=en(t(e,"vec3",3,0)),this.instanceColorNode=n}const a=i.mul(Vl).xyz;if(Vl.assign(a),e.hasGeometryAttribute("normal")){const e=ed(ql,i);ql.assign(e)}null!==this.instanceColorNode&&fn("vec3","vInstanceColor").assign(this.instanceColorNode)}update(){this.instanceMatrix.usage!==y&&null!==this.buffer&&this.instanceMatrix.version!==this.buffer.version&&(this.buffer.version=this.instanceMatrix.version),this.instanceColor&&this.instanceColor.usage!==y&&null!==this.bufferColor&&this.instanceColor.version!==this.bufferColor.version&&(this.bufferColor.version=this.instanceColor.version)}}const Oc=Vi(Uc).setParameterLength(2,3);class kc extends Uc{static get type(){return"InstancedMeshNode"}constructor(e){const{count:t,instanceMatrix:r,instanceColor:s}=e;super(t,r,s),this.instancedMesh=e}}const Gc=Vi(kc).setParameterLength(1);class zc extends js{static get type(){return"BatchNode"}constructor(e){super("void"),this.batchMesh=e,this.batchingIdNode=null}setup(e){null===this.batchingIdNode&&(null===e.getDrawIndex()?this.batchingIdNode=Lc:this.batchingIdNode=Vc);const t=ki((([e])=>{const t=qi(ju(Ju(this.batchMesh._indirectTexture),0).x),r=qi(e).mod(t),s=qi(e).div(t);return Ju(this.batchMesh._indirectTexture,Qi(r,s)).x})).setLayout({name:"getIndirectIndex",type:"uint",inputs:[{name:"id",type:"int"}]}),r=t(qi(this.batchingIdNode)),s=this.batchMesh._matricesTexture,i=qi(ju(Ju(s),0).x),n=ji(r).mul(4).toInt().toVar(),a=n.mod(i),o=n.div(i),u=cn(Ju(s,Qi(a,o)),Ju(s,Qi(a.add(1),o)),Ju(s,Qi(a.add(2),o)),Ju(s,Qi(a.add(3),o))),l=this.batchMesh._colorsTexture;if(null!==l){const e=ki((([e])=>{const t=qi(ju(Ju(l),0).x),r=e,s=r.mod(t),i=r.div(t);return Ju(l,Qi(s,i)).rgb})).setLayout({name:"getBatchingColor",type:"vec3",inputs:[{name:"id",type:"int"}]}),t=e(r);fn("vec3","vBatchColor").assign(t)}const d=dn(u);Vl.assign(u.mul(Vl));const c=ql.div(en(d[0].dot(d[0]),d[1].dot(d[1]),d[2].dot(d[2]))),h=d.mul(c).xyz;ql.assign(h),e.hasGeometryAttribute("tangent")&&vd.mulAssign(d)}}const Hc=Vi(zc).setParameterLength(1);class $c extends qs{static get type(){return"StorageArrayElementNode"}constructor(e,t){super(e,t),this.isStorageArrayElementNode=!0}set storageBufferNode(e){this.node=e}get storageBufferNode(){return this.node}getMemberType(e,t){const r=this.storageBufferNode.structTypeNode;return r?r.getMemberType(e,t):"void"}setup(e){return!1===e.isAvailable("storageBuffer")&&!0===this.node.isPBO&&e.setupPBO(this.node),super.setup(e)}generate(e,t){let r;const s=e.context.assign;if(r=!1===e.isAvailable("storageBuffer")?!0!==this.node.isPBO||!0===s||!this.node.value.isInstancedBufferAttribute&&"compute"===e.shaderStage?this.node.build(e):e.generatePBO(this):super.generate(e),!0!==s){const s=this.getNodeType(e);r=e.format(r,s,t)}return r}}const Wc=Vi($c).setParameterLength(2);class jc extends el{static get type(){return"StorageBufferNode"}constructor(e,t=null,r=0){let s,i=null;t&&t.isStruct?(s="struct",i=t.layout,(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute)&&(r=e.count)):null===t&&(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute)?(s=Es(e.itemSize),r=e.count):s=t,super(e,s,r),this.isStorageBufferNode=!0,this.structTypeNode=i,this.access=Os.READ_WRITE,this.isAtomic=!1,this.isPBO=!1,this._attribute=null,this._varying=null,this.global=!0,!0!==e.isStorageBufferAttribute&&!0!==e.isStorageInstancedBufferAttribute&&(e.isInstancedBufferAttribute?e.isStorageInstancedBufferAttribute=!0:e.isStorageBufferAttribute=!0)}getHash(e){if(0===this.bufferCount){let t=e.globalCache.getData(this.value);return void 0===t&&(t={node:this},e.globalCache.setData(this.value,t)),t.node.uuid}return this.uuid}getInputType(){return this.value.isIndirectStorageBufferAttribute?"indirectStorageBuffer":"storageBuffer"}element(e){return Wc(this,e)}setPBO(e){return this.isPBO=e,this}getPBO(){return this.isPBO}setAccess(e){return this.access=e,this}toReadOnly(){return this.setAccess(Os.READ_ONLY)}setAtomic(e){return this.isAtomic=e,this}toAtomic(){return this.setAtomic(!0)}getAttributeData(){return null===this._attribute&&(this._attribute=_u(this.value),this._varying=nu(this._attribute)),{attribute:this._attribute,varying:this._varying}}getNodeType(e){if(null!==this.structTypeNode)return this.structTypeNode.getNodeType(e);if(e.isAvailable("storageBuffer")||e.isAvailable("indirectStorageBuffer"))return super.getNodeType(e);const{attribute:t}=this.getAttributeData();return t.getNodeType(e)}getMemberType(e,t){return null!==this.structTypeNode?this.structTypeNode.getMemberType(e,t):"void"}generate(e){if(null!==this.structTypeNode&&this.structTypeNode.build(e),e.isAvailable("storageBuffer")||e.isAvailable("indirectStorageBuffer"))return super.generate(e);const{attribute:t,varying:r}=this.getAttributeData(),s=r.build(e);return e.registerTransform(s,t),s}}const qc=(e,t=null,r=0)=>Bi(new jc(e,t,r)),Xc=new WeakMap;class Kc extends js{static get type(){return"SkinningNode"}constructor(e){super("void"),this.skinnedMesh=e,this.updateType=Vs.OBJECT,this.skinIndexNode=Hu("skinIndex","uvec4"),this.skinWeightNode=Hu("skinWeight","vec4"),this.bindMatrixNode=yd("bindMatrix","mat4"),this.bindMatrixInverseNode=yd("bindMatrixInverse","mat4"),this.boneMatricesNode=bd("skeleton.boneMatrices","mat4",e.skeleton.bones.length),this.positionNode=Vl,this.toPositionNode=Vl,this.previousBoneMatricesNode=null}getSkinnedPosition(e=this.boneMatricesNode,t=this.positionNode){const{skinIndexNode:r,skinWeightNode:s,bindMatrixNode:i,bindMatrixInverseNode:n}=this,a=e.element(r.x),o=e.element(r.y),u=e.element(r.z),l=e.element(r.w),d=i.mul(t),c=oa(a.mul(s.x).mul(d),o.mul(s.y).mul(d),u.mul(s.z).mul(d),l.mul(s.w).mul(d));return n.mul(c).xyz}getSkinnedNormal(e=this.boneMatricesNode,t=ql){const{skinIndexNode:r,skinWeightNode:s,bindMatrixNode:i,bindMatrixInverseNode:n}=this,a=e.element(r.x),o=e.element(r.y),u=e.element(r.z),l=e.element(r.w);let d=oa(s.x.mul(a),s.y.mul(o),s.z.mul(u),s.w.mul(l));return d=n.mul(d).mul(i),d.transformDirection(t).xyz}getPreviousSkinnedPosition(e){const t=e.object;return null===this.previousBoneMatricesNode&&(t.skeleton.previousBoneMatrices=new Float32Array(t.skeleton.boneMatrices),this.previousBoneMatricesNode=bd("skeleton.previousBoneMatrices","mat4",t.skeleton.bones.length)),this.getSkinnedPosition(this.previousBoneMatricesNode,Ul)}needsPreviousBoneMatrices(e){const t=e.renderer.getMRT();return t&&t.has("velocity")||!0===Fs(e.object).useVelocity}setup(e){this.needsPreviousBoneMatrices(e)&&Ul.assign(this.getPreviousSkinnedPosition(e));const t=this.getSkinnedPosition();if(this.toPositionNode&&this.toPositionNode.assign(t),e.hasGeometryAttribute("normal")){const t=this.getSkinnedNormal();ql.assign(t),e.hasGeometryAttribute("tangent")&&vd.assign(t)}return t}generate(e,t){if("void"!==t)return super.generate(e,t)}update(e){const t=e.object&&e.object.skeleton?e.object.skeleton:this.skinnedMesh.skeleton;Xc.get(t)!==e.frameId&&(Xc.set(t,e.frameId),null!==this.previousBoneMatricesNode&&t.previousBoneMatrices.set(t.boneMatrices),t.update())}}const Yc=e=>Bi(new Kc(e));class Qc extends js{static get type(){return"LoopNode"}constructor(e=[]){super(),this.params=e}getVarName(e){return String.fromCharCode("i".charCodeAt(0)+e)}getProperties(e){const t=e.getNodeProperties(this);if(void 0!==t.stackNode)return t;const r={};for(let e=0,t=this.params.length-1;eNumber(u)?">=":"<")),a)n=`while ( ${u} )`;else{const r={start:o,end:u},s=r.start,i=r.end;let a;const p=()=>c.includes("<")?"+=":"-=";if(null!=h)switch(typeof h){case"function":a=e.flowStagesNode(t.updateNode,"void").code.replace(/\t|;/g,"");break;case"number":a=l+" "+p()+" "+e.generateConst(d,h);break;case"string":a=l+" "+h;break;default:h.isNode?a=l+" "+p()+" "+h.build(e):(console.error("THREE.TSL: 'Loop( { update: ... } )' is not a function, string or number."),a="break /* invalid update */")}else h="int"===d||"uint"===d?c.includes("<")?"++":"--":p()+" 1.",a=l+" "+h;n=`for ( ${e.getVar(d,l)+" = "+s}; ${l+" "+c+" "+i}; ${a} )`}e.addFlowCode((0===s?"\n":"")+e.tab+n+" {\n\n").addFlowTab()}const i=s.build(e,"void"),n=t.returnsNode?t.returnsNode.build(e):"";e.removeFlowTab().addFlowCode("\n"+e.tab+i);for(let t=0,r=this.params.length-1;tBi(new Qc(Di(e,"int"))).toStack(),Jc=()=>Du("break").toStack(),eh=new WeakMap,th=new s,rh=ki((({bufferMap:e,influence:t,stride:r,width:s,depth:i,offset:n})=>{const a=qi(Fc).mul(r).add(n),o=a.div(s),u=a.sub(o.mul(s));return Ju(e,Qi(u,o)).depth(i).xyz.mul(t)}));class sh extends js{static get type(){return"MorphNode"}constructor(e){super("void"),this.mesh=e,this.morphBaseInfluence=Zn(1),this.updateType=Vs.OBJECT}setup(e){const{geometry:r}=e,s=void 0!==r.morphAttributes.position,i=r.hasAttribute("normal")&&void 0!==r.morphAttributes.normal,n=r.morphAttributes.position||r.morphAttributes.normal||r.morphAttributes.color,a=void 0!==n?n.length:0,{texture:o,stride:u,size:l}=function(e){const r=void 0!==e.morphAttributes.position,s=void 0!==e.morphAttributes.normal,i=void 0!==e.morphAttributes.color,n=e.morphAttributes.position||e.morphAttributes.normal||e.morphAttributes.color,a=void 0!==n?n.length:0;let o=eh.get(e);if(void 0===o||o.count!==a){void 0!==o&&o.texture.dispose();const u=e.morphAttributes.position||[],l=e.morphAttributes.normal||[],d=e.morphAttributes.color||[];let c=0;!0===r&&(c=1),!0===s&&(c=2),!0===i&&(c=3);let h=e.attributes.position.count*c,p=1;const g=4096;h>g&&(p=Math.ceil(h/g),h=g);const m=new Float32Array(h*p*4*a),f=new L(m,h,p,a);f.type=B,f.needsUpdate=!0;const y=4*c;for(let x=0;x{const t=ji(0).toVar();this.mesh.count>1&&null!==this.mesh.morphTexture&&void 0!==this.mesh.morphTexture?t.assign(Ju(this.mesh.morphTexture,Qi(qi(e).add(1),qi(Lc))).r):t.assign(yd("morphTargetInfluences","float").element(e).toVar()),Hi(t.notEqual(0),(()=>{!0===s&&Vl.addAssign(rh({bufferMap:o,influence:t,stride:u,width:d,depth:e,offset:qi(0)})),!0===i&&ql.addAssign(rh({bufferMap:o,influence:t,stride:u,width:d,depth:e,offset:qi(1)}))}))}))}update(){const e=this.morphBaseInfluence;this.mesh.geometry.morphTargetsRelative?e.value=1:e.value=1-this.mesh.morphTargetInfluences.reduce(((e,t)=>e+t),0)}}const ih=Vi(sh).setParameterLength(1);class nh extends js{static get type(){return"LightingNode"}constructor(){super("vec3"),this.isLightingNode=!0}}class ah extends nh{static get type(){return"AONode"}constructor(e=null){super(),this.aoNode=e}setup(e){e.context.ambientOcclusion.mulAssign(this.aoNode)}}class oh extends Yo{static get type(){return"LightingContextNode"}constructor(e,t=null,r=null,s=null){super(e),this.lightingModel=t,this.backdropNode=r,this.backdropAlphaNode=s,this._value=null}getContext(){const{backdropNode:e,backdropAlphaNode:t}=this,r={directDiffuse:en().toVar("directDiffuse"),directSpecular:en().toVar("directSpecular"),indirectDiffuse:en().toVar("indirectDiffuse"),indirectSpecular:en().toVar("indirectSpecular")};return{radiance:en().toVar("radiance"),irradiance:en().toVar("irradiance"),iblIrradiance:en().toVar("iblIrradiance"),ambientOcclusion:ji(1).toVar("ambientOcclusion"),reflectedLight:r,backdrop:e,backdropAlpha:t}}setup(e){return this.value=this._value||(this._value=this.getContext()),this.value.lightingModel=this.lightingModel||e.context.lightingModel,super.setup(e)}}const uh=Vi(oh);class lh extends nh{static get type(){return"IrradianceNode"}constructor(e){super(),this.node=e}setup(e){e.context.irradiance.addAssign(this.node)}}let dh,ch;class hh extends js{static get type(){return"ScreenNode"}constructor(e){super(),this.scope=e,this.isViewportNode=!0}getNodeType(){return this.scope===hh.VIEWPORT?"vec4":"vec2"}getUpdateType(){let e=Vs.NONE;return this.scope!==hh.SIZE&&this.scope!==hh.VIEWPORT||(e=Vs.RENDER),this.updateType=e,e}update({renderer:e}){const t=e.getRenderTarget();this.scope===hh.VIEWPORT?null!==t?ch.copy(t.viewport):(e.getViewport(ch),ch.multiplyScalar(e.getPixelRatio())):null!==t?(dh.width=t.width,dh.height=t.height):e.getDrawingBufferSize(dh)}setup(){const e=this.scope;let r=null;return r=e===hh.SIZE?Zn(dh||(dh=new t)):e===hh.VIEWPORT?Zn(ch||(ch=new s)):Yi(mh.div(gh)),r}generate(e){if(this.scope===hh.COORDINATE){let t=e.getFragCoord();if(e.isFlipY()){const r=e.getNodeProperties(gh).outputNode.build(e);t=`${e.getType("vec2")}( ${t}.x, ${r}.y - ${t}.y )`}return t}return super.generate(e)}}hh.COORDINATE="coordinate",hh.VIEWPORT="viewport",hh.SIZE="size",hh.UV="uv";const ph=Ui(hh,hh.UV),gh=Ui(hh,hh.SIZE),mh=Ui(hh,hh.COORDINATE),fh=Ui(hh,hh.VIEWPORT),yh=fh.zw,bh=mh.sub(fh.xy),xh=bh.div(yh),Th=ki((()=>(console.warn('THREE.TSL: "viewportResolution" is deprecated. Use "screenSize" instead.'),gh)),"vec2").once()(),_h=ki((()=>(console.warn('THREE.TSL: "viewportTopLeft" is deprecated. Use "screenUV" instead.'),ph)),"vec2").once()(),vh=ki((()=>(console.warn('THREE.TSL: "viewportBottomLeft" is deprecated. Use "screenUV.flipY()" instead.'),ph.flipY())),"vec2").once()(),Nh=new t;class Sh extends Yu{static get type(){return"ViewportTextureNode"}constructor(e=ph,t=null,r=null){null===r&&((r=new I).minFilter=D),super(r,e,t),this.generateMipmaps=!1,this.isOutputTextureNode=!0,this.updateBeforeType=Vs.FRAME}updateBefore(e){const t=e.renderer;t.getDrawingBufferSize(Nh);const r=this.value;r.image.width===Nh.width&&r.image.height===Nh.height||(r.image.width=Nh.width,r.image.height=Nh.height,r.needsUpdate=!0);const s=r.generateMipmaps;r.generateMipmaps=this.generateMipmaps,t.copyFramebufferToTexture(r),r.generateMipmaps=s}clone(){const e=new this.constructor(this.uvNode,this.levelNode,this.value);return e.generateMipmaps=this.generateMipmaps,e}}const Eh=Vi(Sh).setParameterLength(0,3),wh=Vi(Sh,null,null,{generateMipmaps:!0}).setParameterLength(0,3);let Ah=null;class Rh extends Sh{static get type(){return"ViewportDepthTextureNode"}constructor(e=ph,t=null){null===Ah&&(Ah=new V),super(e,t,Ah)}}const Ch=Vi(Rh).setParameterLength(0,2);class Mh extends js{static get type(){return"ViewportDepthNode"}constructor(e,t=null){super("float"),this.scope=e,this.valueNode=t,this.isViewportDepthNode=!0}generate(e){const{scope:t}=this;return t===Mh.DEPTH_BASE?e.getFragDepth():super.generate(e)}setup({camera:e}){const{scope:t}=this,r=this.valueNode;let s=null;if(t===Mh.DEPTH_BASE)null!==r&&(s=Ih().assign(r));else if(t===Mh.DEPTH)s=e.isPerspectiveCamera?Fh(Gl.z,ol,ul):Ph(Gl.z,ol,ul);else if(t===Mh.LINEAR_DEPTH)if(null!==r)if(e.isPerspectiveCamera){const e=Lh(r,ol,ul);s=Ph(e,ol,ul)}else s=r;else s=Ph(Gl.z,ol,ul);return s}}Mh.DEPTH_BASE="depthBase",Mh.DEPTH="depth",Mh.LINEAR_DEPTH="linearDepth";const Ph=(e,t,r)=>e.add(t).div(t.sub(r)),Fh=(e,t,r)=>t.add(e).mul(r).div(r.sub(t).mul(e)),Lh=(e,t,r)=>t.mul(r).div(r.sub(t).mul(e).sub(r)),Bh=(e,t,r)=>{t=t.max(1e-6).toVar();const s=ja(e.negate().div(t)),i=ja(r.div(t));return s.div(i)},Ih=Vi(Mh,Mh.DEPTH_BASE),Dh=Ui(Mh,Mh.DEPTH),Vh=Vi(Mh,Mh.LINEAR_DEPTH).setParameterLength(0,1),Uh=Vh(Ch());Dh.assign=e=>Ih(e);class Oh extends js{static get type(){return"ClippingNode"}constructor(e=Oh.DEFAULT){super(),this.scope=e}setup(e){super.setup(e);const t=e.clippingContext,{intersectionPlanes:r,unionPlanes:s}=t;return this.hardwareClipping=e.material.hardwareClipping,this.scope===Oh.ALPHA_TO_COVERAGE?this.setupAlphaToCoverage(r,s):this.scope===Oh.HARDWARE?this.setupHardwareClipping(s,e):this.setupDefault(r,s)}setupAlphaToCoverage(e,t){return ki((()=>{const r=ji().toVar("distanceToPlane"),s=ji().toVar("distanceToGradient"),i=ji(1).toVar("clipOpacity"),n=t.length;if(!1===this.hardwareClipping&&n>0){const e=il(t);Zc(n,(({i:t})=>{const n=e.element(t);r.assign(Gl.dot(n.xyz).negate().add(n.w)),s.assign(r.fwidth().div(2)),i.mulAssign(Oo(s.negate(),s,r))}))}const a=e.length;if(a>0){const t=il(e),n=ji(1).toVar("intersectionClipOpacity");Zc(a,(({i:e})=>{const i=t.element(e);r.assign(Gl.dot(i.xyz).negate().add(i.w)),s.assign(r.fwidth().div(2)),n.mulAssign(Oo(s.negate(),s,r).oneMinus())})),i.mulAssign(n.oneMinus())}yn.a.mulAssign(i),yn.a.equal(0).discard()}))()}setupDefault(e,t){return ki((()=>{const r=t.length;if(!1===this.hardwareClipping&&r>0){const e=il(t);Zc(r,(({i:t})=>{const r=e.element(t);Gl.dot(r.xyz).greaterThan(r.w).discard()}))}const s=e.length;if(s>0){const t=il(e),r=Ki(!0).toVar("clipped");Zc(s,(({i:e})=>{const s=t.element(e);r.assign(Gl.dot(s.xyz).greaterThan(s.w).and(r))})),r.discard()}}))()}setupHardwareClipping(e,t){const r=e.length;return t.enableHardwareClipping(r),ki((()=>{const s=il(e),i=nl(t.getClipDistance());Zc(r,(({i:e})=>{const t=s.element(e),r=Gl.dot(t.xyz).sub(t.w).negate();i.element(e).assign(r)}))}))()}}Oh.ALPHA_TO_COVERAGE="alphaToCoverage",Oh.DEFAULT="default",Oh.HARDWARE="hardware";const kh=ki((([e])=>Za(la(1e4,Ja(la(17,e.x).add(la(.1,e.y)))).mul(oa(.1,no(Ja(la(13,e.y).add(e.x)))))))),Gh=ki((([e])=>kh(Yi(kh(e.xy),e.z)))),zh=ki((([e])=>{const t=_o(oo(co(e.xyz)),oo(ho(e.xyz))),r=ji(1).div(ji(.05).mul(t)).toVar("pixScale"),s=Yi($a(Ka(ja(r))),$a(Ya(ja(r)))),i=Yi(Gh(Ka(s.x.mul(e.xyz))),Gh(Ka(s.y.mul(e.xyz)))),n=Za(ja(r)),a=oa(la(n.oneMinus(),i.x),la(n,i.y)),o=To(n,n.oneMinus()),u=en(a.mul(a).div(la(2,o).mul(ua(1,o))),a.sub(la(.5,o)).div(ua(1,o)),ua(1,ua(1,a).mul(ua(1,a)).div(la(2,o).mul(ua(1,o))))),l=a.lessThan(o.oneMinus()).select(a.lessThan(o).select(u.x,u.y),u.z);return Do(l,1e-6,1)})).setLayout({name:"getAlphaHashThreshold",type:"float",inputs:[{name:"position",type:"vec3"}]});class Hh extends zu{static get type(){return"VertexColorNode"}constructor(e){super(null,"vec4"),this.isVertexColorNode=!0,this.index=e}getAttributeName(){const e=this.index;return"color"+(e>0?e:"")}generate(e){const t=this.getAttributeName(e);let r;return r=!0===e.hasGeometryAttribute(t)?super.generate(e):e.generateConst(this.nodeType,new s(1,1,1,1)),r}serialize(e){super.serialize(e),e.index=this.index}deserialize(e){super.deserialize(e),this.index=e.index}}const $h=(e=0)=>Bi(new Hh(e)),Wh=ki((([e,t])=>To(1,e.oneMinus().div(t)).oneMinus())).setLayout({name:"blendBurn",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),jh=ki((([e,t])=>To(e.div(t.oneMinus()),1))).setLayout({name:"blendDodge",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),qh=ki((([e,t])=>e.oneMinus().mul(t.oneMinus()).oneMinus())).setLayout({name:"blendScreen",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),Xh=ki((([e,t])=>Io(e.mul(2).mul(t),e.oneMinus().mul(2).mul(t.oneMinus()).oneMinus(),vo(.5,e)))).setLayout({name:"blendOverlay",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),Kh=ki((([e,t])=>{const r=t.a.add(e.a.mul(t.a.oneMinus()));return nn(t.rgb.mul(t.a).add(e.rgb.mul(e.a).mul(t.a.oneMinus())).div(r),r)})).setLayout({name:"blendColor",type:"vec4",inputs:[{name:"base",type:"vec4"},{name:"blend",type:"vec4"}]}),Yh=ki((([e])=>nn(e.rgb.mul(e.a),e.a)),{color:"vec4",return:"vec4"}),Qh=ki((([e])=>(Hi(e.a.equal(0),(()=>nn(0))),nn(e.rgb.div(e.a),e.a))),{color:"vec4",return:"vec4"});class Zh extends U{static get type(){return"NodeMaterial"}get type(){return this.constructor.type}set type(e){}constructor(){super(),this.isNodeMaterial=!0,this.fog=!0,this.lights=!1,this.hardwareClipping=!1,this.lightsNode=null,this.envNode=null,this.aoNode=null,this.colorNode=null,this.normalNode=null,this.opacityNode=null,this.backdropNode=null,this.backdropAlphaNode=null,this.alphaTestNode=null,this.maskNode=null,this.positionNode=null,this.geometryNode=null,this.depthNode=null,this.receivedShadowPositionNode=null,this.castShadowPositionNode=null,this.receivedShadowNode=null,this.castShadowNode=null,this.outputNode=null,this.mrtNode=null,this.fragmentNode=null,this.vertexNode=null,Object.defineProperty(this,"shadowPositionNode",{get:()=>this.receivedShadowPositionNode,set:e=>{console.warn('THREE.NodeMaterial: ".shadowPositionNode" was renamed to ".receivedShadowPositionNode".'),this.receivedShadowPositionNode=e}})}customProgramCacheKey(){return this.type+_s(this)}build(e){this.setup(e)}setupObserver(e){return new fs(e)}setup(e){e.context.setupNormal=()=>this.setupNormal(e),e.context.setupPositionView=()=>this.setupPositionView(e),e.context.setupModelViewProjection=()=>this.setupModelViewProjection(e);const t=e.renderer,r=t.getRenderTarget();e.addStack();const s=this.setupVertex(e),i=this.vertexNode||s;let n;e.stack.outputNode=i,this.setupHardwareClipping(e),null!==this.geometryNode&&(e.stack.outputNode=e.stack.outputNode.bypass(this.geometryNode)),e.addFlow("vertex",e.removeStack()),e.addStack();const a=this.setupClipping(e);if(!0!==this.depthWrite&&!0!==this.depthTest||(null!==r?!0===r.depthBuffer&&this.setupDepth(e):!0===t.depth&&this.setupDepth(e)),null===this.fragmentNode){this.setupDiffuseColor(e),this.setupVariants(e);const s=this.setupLighting(e);null!==a&&e.stack.add(a);const i=nn(s,yn.a).max(0);n=this.setupOutput(e,i),In.assign(n);const o=null!==this.outputNode;if(o&&(n=this.outputNode),null!==r){const e=t.getMRT(),r=this.mrtNode;null!==e?(o&&In.assign(n),n=e,null!==r&&(n=e.merge(r))):null!==r&&(n=r)}}else{let t=this.fragmentNode;!0!==t.isOutputStructNode&&(t=nn(t)),n=this.setupOutput(e,t)}e.stack.outputNode=n,e.addFlow("fragment",e.removeStack()),e.observer=this.setupObserver(e)}setupClipping(e){if(null===e.clippingContext)return null;const{unionPlanes:t,intersectionPlanes:r}=e.clippingContext;let s=null;if(t.length>0||r.length>0){const t=e.renderer.samples;this.alphaToCoverage&&t>1?s=Bi(new Oh(Oh.ALPHA_TO_COVERAGE)):e.stack.add(Bi(new Oh))}return s}setupHardwareClipping(e){if(this.hardwareClipping=!1,null===e.clippingContext)return;const t=e.clippingContext.unionPlanes.length;t>0&&t<=8&&e.isAvailable("clipDistance")&&(e.stack.add(Bi(new Oh(Oh.HARDWARE))),this.hardwareClipping=!0)}setupDepth(e){const{renderer:t,camera:r}=e;let s=this.depthNode;if(null===s){const e=t.getMRT();e&&e.has("depth")?s=e.get("depth"):!0===t.logarithmicDepthBuffer&&(s=r.isPerspectiveCamera?Bh(Gl.z,ol,ul):Ph(Gl.z,ol,ul))}null!==s&&Dh.assign(s).toStack()}setupPositionView(){return Fl.mul(Vl).xyz}setupModelViewProjection(){return ll.mul(Gl)}setupVertex(e){return e.addStack(),this.setupPosition(e),e.context.vertex=e.removeStack(),Mc}setupPosition(e){const{object:t,geometry:r}=e;if((r.morphAttributes.position||r.morphAttributes.normal||r.morphAttributes.color)&&ih(t).toStack(),!0===t.isSkinnedMesh&&Yc(t).toStack(),this.displacementMap){const e=Td("displacementMap","texture"),t=Td("displacementScale","float"),r=Td("displacementBias","float");Vl.addAssign(ql.normalize().mul(e.x.mul(t).add(r)))}return t.isBatchedMesh&&Hc(t).toStack(),t.isInstancedMesh&&t.instanceMatrix&&!0===t.instanceMatrix.isInstancedBufferAttribute&&Gc(t).toStack(),null!==this.positionNode&&Vl.assign(Cu(this.positionNode,"POSITION")),Vl}setupDiffuseColor({object:e,geometry:t}){null!==this.maskNode&&Ki(this.maskNode).not().discard();let r=this.colorNode?nn(this.colorNode):qd;if(!0===this.vertexColors&&t.hasAttribute("color")&&(r=r.mul($h())),e.instanceColor){r=fn("vec3","vInstanceColor").mul(r)}if(e.isBatchedMesh&&e._colorsTexture){r=fn("vec3","vBatchColor").mul(r)}yn.assign(r);const s=this.opacityNode?ji(this.opacityNode):Yd;yn.a.assign(yn.a.mul(s));let i=null;(null!==this.alphaTestNode||this.alphaTest>0)&&(i=null!==this.alphaTestNode?ji(this.alphaTestNode):jd,yn.a.lessThanEqual(i).discard()),!0===this.alphaHash&&yn.a.lessThan(zh(Vl)).discard();!1===this.transparent&&this.blending===O&&!1===this.alphaToCoverage?yn.a.assign(1):null===i&&yn.a.lessThanEqual(0).discard()}setupVariants(){}setupOutgoingLight(){return!0===this.lights?en(0):yn.rgb}setupNormal(){return this.normalNode?en(this.normalNode):ic}setupEnvironment(){let e=null;return this.envNode?e=this.envNode:this.envMap&&(e=this.envMap.isCubeTexture?Td("envMap","cubeTexture"):Td("envMap","texture")),e}setupLightMap(e){let t=null;return e.material.lightMap&&(t=new lh(Ac)),t}setupLights(e){const t=[],r=this.setupEnvironment(e);r&&r.isLightingNode&&t.push(r);const s=this.setupLightMap(e);if(s&&s.isLightingNode&&t.push(s),null!==this.aoNode||e.material.aoMap){const e=null!==this.aoNode?this.aoNode:Rc;t.push(new ah(e))}let i=this.lightsNode||e.lightsNode;return t.length>0&&(i=e.renderer.lighting.createNode([...i.getLights(),...t])),i}setupLightingModel(){}setupLighting(e){const{material:t}=e,{backdropNode:r,backdropAlphaNode:s,emissiveNode:i}=this,n=!0===this.lights||null!==this.lightsNode?this.setupLights(e):null;let a=this.setupOutgoingLight(e);if(n&&n.getScope().hasLights){const t=this.setupLightingModel(e)||null;a=uh(n,t,r,s)}else null!==r&&(a=en(null!==s?Io(a,r,s):r));return(i&&!0===i.isNode||t.emissive&&!0===t.emissive.isColor)&&(bn.assign(en(i||Kd)),a=a.add(bn)),a}setupFog(e,t){const r=e.fogNode;return r&&(In.assign(t),t=nn(r)),t}setupPremultipliedAlpha(e,t){return Yh(t)}setupOutput(e,t){return!0===this.fog&&(t=this.setupFog(e,t)),!0===this.premultipliedAlpha&&(t=this.setupPremultipliedAlpha(e,t)),t}setDefaultValues(e){for(const t in e){const r=e[t];void 0===this[t]&&(this[t]=r,r&&r.clone&&(this[t]=r.clone()))}const t=Object.getOwnPropertyDescriptors(e.constructor.prototype);for(const e in t)void 0===Object.getOwnPropertyDescriptor(this.constructor.prototype,e)&&void 0!==t[e].get&&Object.defineProperty(this.constructor.prototype,e,t[e])}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{},nodes:{}});const r=U.prototype.toJSON.call(this,e),s=vs(this);r.inputNodes={};for(const{property:t,childNode:i}of s)r.inputNodes[t]=i.toJSON(e).uuid;function i(e){const t=[];for(const r in e){const s=e[r];delete s.metadata,t.push(s)}return t}if(t){const t=i(e.textures),s=i(e.images),n=i(e.nodes);t.length>0&&(r.textures=t),s.length>0&&(r.images=s),n.length>0&&(r.nodes=n)}return r}copy(e){return this.lightsNode=e.lightsNode,this.envNode=e.envNode,this.colorNode=e.colorNode,this.normalNode=e.normalNode,this.opacityNode=e.opacityNode,this.backdropNode=e.backdropNode,this.backdropAlphaNode=e.backdropAlphaNode,this.alphaTestNode=e.alphaTestNode,this.maskNode=e.maskNode,this.positionNode=e.positionNode,this.geometryNode=e.geometryNode,this.depthNode=e.depthNode,this.receivedShadowPositionNode=e.receivedShadowPositionNode,this.castShadowPositionNode=e.castShadowPositionNode,this.receivedShadowNode=e.receivedShadowNode,this.castShadowNode=e.castShadowNode,this.outputNode=e.outputNode,this.mrtNode=e.mrtNode,this.fragmentNode=e.fragmentNode,this.vertexNode=e.vertexNode,super.copy(e)}}const Jh=new k;class ep extends Zh{static get type(){return"LineBasicNodeMaterial"}constructor(e){super(),this.isLineBasicNodeMaterial=!0,this.setDefaultValues(Jh),this.setValues(e)}}const tp=new G;class rp extends Zh{static get type(){return"LineDashedNodeMaterial"}constructor(e){super(),this.isLineDashedNodeMaterial=!0,this.setDefaultValues(tp),this.dashOffset=0,this.offsetNode=null,this.dashScaleNode=null,this.dashSizeNode=null,this.gapSizeNode=null,this.setValues(e)}setupVariants(){const e=this.offsetNode?ji(this.offsetNode):Sc,t=this.dashScaleNode?ji(this.dashScaleNode):Tc,r=this.dashSizeNode?ji(this.dashSizeNode):_c,s=this.gapSizeNode?ji(this.gapSizeNode):vc;Dn.assign(r),Vn.assign(s);const i=nu(Hu("lineDistance").mul(t));(e?i.add(e):i).mod(Dn.add(Vn)).greaterThan(Dn).discard()}}let sp=null;class ip extends Sh{static get type(){return"ViewportSharedTextureNode"}constructor(e=ph,t=null){null===sp&&(sp=new I),super(e,t,sp)}updateReference(){return this}}const np=Vi(ip).setParameterLength(0,2),ap=new G;class op extends Zh{static get type(){return"Line2NodeMaterial"}constructor(e={}){super(),this.isLine2NodeMaterial=!0,this.setDefaultValues(ap),this.useColor=e.vertexColors,this.dashOffset=0,this.lineWidth=1,this.lineColorNode=null,this.offsetNode=null,this.dashScaleNode=null,this.dashSizeNode=null,this.gapSizeNode=null,this.blending=z,this._useDash=e.dashed,this._useAlphaToCoverage=!0,this._useWorldUnits=!1,this.setValues(e)}setup(e){const{renderer:t}=e,r=this._useAlphaToCoverage,s=this.useColor,i=this._useDash,n=this._useWorldUnits,a=ki((({start:e,end:t})=>{const r=ll.element(2).element(2),s=ll.element(3).element(2).mul(-.5).div(r).sub(e.z).div(t.z.sub(e.z));return nn(Io(e.xyz,t.xyz,s),t.w)})).setLayout({name:"trimSegment",type:"vec4",inputs:[{name:"start",type:"vec4"},{name:"end",type:"vec4"}]});this.vertexNode=ki((()=>{const e=Hu("instanceStart"),t=Hu("instanceEnd"),r=nn(Fl.mul(nn(e,1))).toVar("start"),s=nn(Fl.mul(nn(t,1))).toVar("end");if(i){const e=this.dashScaleNode?ji(this.dashScaleNode):Tc,t=this.offsetNode?ji(this.offsetNode):Sc,r=Hu("instanceDistanceStart"),s=Hu("instanceDistanceEnd");let i=Dl.y.lessThan(.5).select(e.mul(r),e.mul(s));i=i.add(t),fn("float","lineDistance").assign(i)}n&&(fn("vec3","worldStart").assign(r.xyz),fn("vec3","worldEnd").assign(s.xyz));const o=fh.z.div(fh.w),u=ll.element(2).element(3).equal(-1);Hi(u,(()=>{Hi(r.z.lessThan(0).and(s.z.greaterThan(0)),(()=>{s.assign(a({start:r,end:s}))})).ElseIf(s.z.lessThan(0).and(r.z.greaterThanEqual(0)),(()=>{r.assign(a({start:s,end:r}))}))}));const l=ll.mul(r),d=ll.mul(s),c=l.xyz.div(l.w),h=d.xyz.div(d.w),p=h.xy.sub(c.xy).toVar();p.x.assign(p.x.mul(o)),p.assign(p.normalize());const g=nn().toVar();if(n){const e=s.xyz.sub(r.xyz).normalize(),t=Io(r.xyz,s.xyz,.5).normalize(),n=e.cross(t).normalize(),a=e.cross(n),o=fn("vec4","worldPos");o.assign(Dl.y.lessThan(.5).select(r,s));const u=Nc.mul(.5);o.addAssign(nn(Dl.x.lessThan(0).select(n.mul(u),n.mul(u).negate()),0)),i||(o.addAssign(nn(Dl.y.lessThan(.5).select(e.mul(u).negate(),e.mul(u)),0)),o.addAssign(nn(a.mul(u),0)),Hi(Dl.y.greaterThan(1).or(Dl.y.lessThan(0)),(()=>{o.subAssign(nn(a.mul(2).mul(u),0))}))),g.assign(ll.mul(o));const l=en().toVar();l.assign(Dl.y.lessThan(.5).select(c,h)),g.z.assign(l.z.mul(g.w))}else{const e=Yi(p.y,p.x.negate()).toVar("offset");p.x.assign(p.x.div(o)),e.x.assign(e.x.div(o)),e.assign(Dl.x.lessThan(0).select(e.negate(),e)),Hi(Dl.y.lessThan(0),(()=>{e.assign(e.sub(p))})).ElseIf(Dl.y.greaterThan(1),(()=>{e.assign(e.add(p))})),e.assign(e.mul(Nc)),e.assign(e.div(fh.w)),g.assign(Dl.y.lessThan(.5).select(l,d)),e.assign(e.mul(g.w)),g.assign(g.add(nn(e,0,0)))}return g}))();const o=ki((({p1:e,p2:t,p3:r,p4:s})=>{const i=e.sub(r),n=s.sub(r),a=t.sub(e),o=i.dot(n),u=n.dot(a),l=i.dot(a),d=n.dot(n),c=a.dot(a).mul(d).sub(u.mul(u)),h=o.mul(u).sub(l.mul(d)).div(c).clamp(),p=o.add(u.mul(h)).div(d).clamp();return Yi(h,p)}));if(this.colorNode=ki((()=>{const e=$u();if(i){const t=this.dashSizeNode?ji(this.dashSizeNode):_c,r=this.gapSizeNode?ji(this.gapSizeNode):vc;Dn.assign(t),Vn.assign(r);const s=fn("float","lineDistance");e.y.lessThan(-1).or(e.y.greaterThan(1)).discard(),s.mod(Dn.add(Vn)).greaterThan(Dn).discard()}const a=ji(1).toVar("alpha");if(n){const e=fn("vec3","worldStart"),s=fn("vec3","worldEnd"),n=fn("vec4","worldPos").xyz.normalize().mul(1e5),u=s.sub(e),l=o({p1:e,p2:s,p3:en(0,0,0),p4:n}),d=e.add(u.mul(l.x)),c=n.mul(l.y),h=d.sub(c).length().div(Nc);if(!i)if(r&&t.samples>1){const e=h.fwidth();a.assign(Oo(e.negate().add(.5),e.add(.5),h).oneMinus())}else h.greaterThan(.5).discard()}else if(r&&t.samples>1){const t=e.x,r=e.y.greaterThan(0).select(e.y.sub(1),e.y.add(1)),s=t.mul(t).add(r.mul(r)),i=ji(s.fwidth()).toVar("dlen");Hi(e.y.abs().greaterThan(1),(()=>{a.assign(Oo(i.oneMinus(),i.add(1),s).oneMinus())}))}else Hi(e.y.abs().greaterThan(1),(()=>{const t=e.x,r=e.y.greaterThan(0).select(e.y.sub(1),e.y.add(1));t.mul(t).add(r.mul(r)).greaterThan(1).discard()}));let u;if(this.lineColorNode)u=this.lineColorNode;else if(s){const e=Hu("instanceColorStart"),t=Hu("instanceColorEnd");u=Dl.y.lessThan(.5).select(e,t).mul(qd)}else u=qd;return nn(u,a)}))(),this.transparent){const e=this.opacityNode?ji(this.opacityNode):Yd;this.outputNode=nn(this.colorNode.rgb.mul(e).add(np().rgb.mul(e.oneMinus())),this.colorNode.a)}super.setup(e)}get worldUnits(){return this._useWorldUnits}set worldUnits(e){this._useWorldUnits!==e&&(this._useWorldUnits=e,this.needsUpdate=!0)}get dashed(){return this._useDash}set dashed(e){this._useDash!==e&&(this._useDash=e,this.needsUpdate=!0)}get alphaToCoverage(){return this._useAlphaToCoverage}set alphaToCoverage(e){this._useAlphaToCoverage!==e&&(this._useAlphaToCoverage=e,this.needsUpdate=!0)}}const up=e=>Bi(e).mul(.5).add(.5),lp=new H;class dp extends Zh{static get type(){return"MeshNormalNodeMaterial"}constructor(e){super(),this.isMeshNormalNodeMaterial=!0,this.setDefaultValues(lp),this.setValues(e)}setupDiffuseColor(){const e=this.opacityNode?ji(this.opacityNode):Yd;yn.assign(hu(nn(up(Ql),e),$))}}class cp extends Ks{static get type(){return"EquirectUVNode"}constructor(e=kl){super("vec2"),this.dirNode=e}setup(){const e=this.dirNode,t=e.z.atan(e.x).mul(1/(2*Math.PI)).add(.5),r=e.y.clamp(-1,1).asin().mul(1/Math.PI).add(.5);return Yi(t,r)}}const hp=Vi(cp).setParameterLength(0,1);class pp extends W{constructor(e=1,t={}){super(e,t),this.isCubeRenderTarget=!0}fromEquirectangularTexture(e,t){const r=t.minFilter,s=t.generateMipmaps;t.generateMipmaps=!0,this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i=new j(5,5,5),n=hp(kl),a=new Zh;a.colorNode=Zu(t,n,0),a.side=S,a.blending=z;const o=new q(i,a),u=new X;u.add(o),t.minFilter===D&&(t.minFilter=K);const l=new Y(1,10,this),d=e.getMRT();return e.setMRT(null),l.update(e,u),e.setMRT(d),t.minFilter=r,t.currentGenerateMipmaps=s,o.geometry.dispose(),o.material.dispose(),this}}const gp=new WeakMap;class mp extends Ks{static get type(){return"CubeMapNode"}constructor(e){super("vec3"),this.envNode=e,this._cubeTexture=null,this._cubeTextureNode=gd(null);const t=new w;t.isRenderTargetTexture=!0,this._defaultTexture=t,this.updateBeforeType=Vs.RENDER}updateBefore(e){const{renderer:t,material:r}=e,s=this.envNode;if(s.isTextureNode||s.isMaterialReferenceNode){const e=s.isTextureNode?s.value:r[s.property];if(e&&e.isTexture){const r=e.mapping;if(r===Q||r===Z){if(gp.has(e)){const t=gp.get(e);yp(t,e.mapping),this._cubeTexture=t}else{const r=e.image;if(function(e){return null!=e&&e.height>0}(r)){const s=new pp(r.height);s.fromEquirectangularTexture(t,e),yp(s.texture,e.mapping),this._cubeTexture=s.texture,gp.set(e,s.texture),e.addEventListener("dispose",fp)}else this._cubeTexture=this._defaultTexture}this._cubeTextureNode.value=this._cubeTexture}else this._cubeTextureNode=this.envNode}}}setup(e){return this.updateBefore(e),this._cubeTextureNode}}function fp(e){const t=e.target;t.removeEventListener("dispose",fp);const r=gp.get(t);void 0!==r&&(gp.delete(t),r.dispose())}function yp(e,t){t===Q?e.mapping=A:t===Z&&(e.mapping=R)}const bp=Vi(mp).setParameterLength(1);class xp extends nh{static get type(){return"BasicEnvironmentNode"}constructor(e=null){super(),this.envNode=e}setup(e){e.context.environment=bp(this.envNode)}}class Tp extends nh{static get type(){return"BasicLightMapNode"}constructor(e=null){super(),this.lightMapNode=e}setup(e){const t=ji(1/Math.PI);e.context.irradianceLightMap=this.lightMapNode.mul(t)}}class _p{start(e){e.lightsNode.setupLights(e,e.lightsNode.getLightNodes(e)),this.indirect(e)}finish(){}direct(){}directRectArea(){}indirect(){}ambientOcclusion(){}}class vp extends _p{constructor(){super()}indirect({context:e}){const t=e.ambientOcclusion,r=e.reflectedLight,s=e.irradianceLightMap;r.indirectDiffuse.assign(nn(0)),s?r.indirectDiffuse.addAssign(s):r.indirectDiffuse.addAssign(nn(1,1,1,0)),r.indirectDiffuse.mulAssign(t),r.indirectDiffuse.mulAssign(yn.rgb)}finish(e){const{material:t,context:r}=e,s=r.outgoingLight,i=e.context.environment;if(i)switch(t.combine){case te:s.rgb.assign(Io(s.rgb,s.rgb.mul(i.rgb),ec.mul(tc)));break;case ee:s.rgb.assign(Io(s.rgb,i.rgb,ec.mul(tc)));break;case J:s.rgb.addAssign(i.rgb.mul(ec.mul(tc)));break;default:console.warn("THREE.BasicLightingModel: Unsupported .combine value:",t.combine)}}}const Np=new re;class Sp extends Zh{static get type(){return"MeshBasicNodeMaterial"}constructor(e){super(),this.isMeshBasicNodeMaterial=!0,this.lights=!0,this.setDefaultValues(Np),this.setValues(e)}setupNormal(){return Kl}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new xp(t):null}setupLightMap(e){let t=null;return e.material.lightMap&&(t=new Tp(Ac)),t}setupOutgoingLight(){return yn.rgb}setupLightingModel(){return new vp}}const Ep=ki((({f0:e,f90:t,dotVH:r})=>{const s=r.mul(-5.55473).sub(6.98316).mul(r).exp2();return e.mul(s.oneMinus()).add(t.mul(s))})),wp=ki((e=>e.diffuseColor.mul(1/Math.PI))),Ap=ki((({dotNH:e})=>Bn.mul(ji(.5)).add(1).mul(ji(1/Math.PI)).mul(e.pow(Bn)))),Rp=ki((({lightDirection:e})=>{const t=e.add(zl).normalize(),r=Ql.dot(t).clamp(),s=zl.dot(t).clamp(),i=Ep({f0:Fn,f90:1,dotVH:s}),n=ji(.25),a=Ap({dotNH:r});return i.mul(n).mul(a)}));class Cp extends vp{constructor(e=!0){super(),this.specular=e}direct({lightDirection:e,lightColor:t,reflectedLight:r}){const s=Ql.dot(e).clamp().mul(t);r.directDiffuse.addAssign(s.mul(wp({diffuseColor:yn.rgb}))),!0===this.specular&&r.directSpecular.addAssign(s.mul(Rp({lightDirection:e})).mul(ec))}indirect(e){const{ambientOcclusion:t,irradiance:r,reflectedLight:s}=e.context;s.indirectDiffuse.addAssign(r.mul(wp({diffuseColor:yn}))),s.indirectDiffuse.mulAssign(t)}}const Mp=new se;class Pp extends Zh{static get type(){return"MeshLambertNodeMaterial"}constructor(e){super(),this.isMeshLambertNodeMaterial=!0,this.lights=!0,this.setDefaultValues(Mp),this.setValues(e)}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new xp(t):null}setupLightingModel(){return new Cp(!1)}}const Fp=new ie;class Lp extends Zh{static get type(){return"MeshPhongNodeMaterial"}constructor(e){super(),this.isMeshPhongNodeMaterial=!0,this.lights=!0,this.shininessNode=null,this.specularNode=null,this.setDefaultValues(Fp),this.setValues(e)}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new xp(t):null}setupLightingModel(){return new Cp}setupVariants(){const e=(this.shininessNode?ji(this.shininessNode):Xd).max(1e-4);Bn.assign(e);const t=this.specularNode||Qd;Fn.assign(t)}copy(e){return this.shininessNode=e.shininessNode,this.specularNode=e.specularNode,super.copy(e)}}const Bp=ki((e=>{if(!1===e.geometry.hasAttribute("normal"))return ji(0);const t=Kl.dFdx().abs().max(Kl.dFdy().abs());return t.x.max(t.y).max(t.z)})),Ip=ki((e=>{const{roughness:t}=e,r=Bp();let s=t.max(.0525);return s=s.add(r),s=s.min(1),s})),Dp=ki((({alpha:e,dotNL:t,dotNV:r})=>{const s=e.pow2(),i=t.mul(s.add(s.oneMinus().mul(r.pow2())).sqrt()),n=r.mul(s.add(s.oneMinus().mul(t.pow2())).sqrt());return da(.5,i.add(n).max(Ia))})).setLayout({name:"V_GGX_SmithCorrelated",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNL",type:"float"},{name:"dotNV",type:"float"}]}),Vp=ki((({alphaT:e,alphaB:t,dotTV:r,dotBV:s,dotTL:i,dotBL:n,dotNV:a,dotNL:o})=>{const u=o.mul(en(e.mul(r),t.mul(s),a).length()),l=a.mul(en(e.mul(i),t.mul(n),o).length());return da(.5,u.add(l)).saturate()})).setLayout({name:"V_GGX_SmithCorrelated_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotTV",type:"float",qualifier:"in"},{name:"dotBV",type:"float",qualifier:"in"},{name:"dotTL",type:"float",qualifier:"in"},{name:"dotBL",type:"float",qualifier:"in"},{name:"dotNV",type:"float",qualifier:"in"},{name:"dotNL",type:"float",qualifier:"in"}]}),Up=ki((({alpha:e,dotNH:t})=>{const r=e.pow2(),s=t.pow2().mul(r.oneMinus()).oneMinus();return r.div(s.pow2()).mul(1/Math.PI)})).setLayout({name:"D_GGX",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNH",type:"float"}]}),Op=ji(1/Math.PI),kp=ki((({alphaT:e,alphaB:t,dotNH:r,dotTH:s,dotBH:i})=>{const n=e.mul(t),a=en(t.mul(s),e.mul(i),n.mul(r)),o=a.dot(a),u=n.div(o);return Op.mul(n.mul(u.pow2()))})).setLayout({name:"D_GGX_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotNH",type:"float",qualifier:"in"},{name:"dotTH",type:"float",qualifier:"in"},{name:"dotBH",type:"float",qualifier:"in"}]}),Gp=ki((e=>{const{lightDirection:t,f0:r,f90:s,roughness:i,f:n,USE_IRIDESCENCE:a,USE_ANISOTROPY:o}=e,u=e.normalView||Ql,l=i.pow2(),d=t.add(zl).normalize(),c=u.dot(t).clamp(),h=u.dot(zl).clamp(),p=u.dot(d).clamp(),g=zl.dot(d).clamp();let m,f,y=Ep({f0:r,f90:s,dotVH:g});if(Pi(a)&&(y=En.mix(y,n)),Pi(o)){const e=Mn.dot(t),r=Mn.dot(zl),s=Mn.dot(d),i=Pn.dot(t),n=Pn.dot(zl),a=Pn.dot(d);m=Vp({alphaT:Rn,alphaB:l,dotTV:r,dotBV:n,dotTL:e,dotBL:i,dotNV:h,dotNL:c}),f=kp({alphaT:Rn,alphaB:l,dotNH:p,dotTH:s,dotBH:a})}else m=Dp({alpha:l,dotNL:c,dotNV:h}),f=Up({alpha:l,dotNH:p});return y.mul(m).mul(f)})),zp=ki((({roughness:e,dotNV:t})=>{const r=nn(-1,-.0275,-.572,.022),s=nn(1,.0425,1.04,-.04),i=e.mul(r).add(s),n=i.x.mul(i.x).min(t.mul(-9.28).exp2()).mul(i.x).add(i.y);return Yi(-1.04,1.04).mul(n).add(i.zw)})).setLayout({name:"DFGApprox",type:"vec2",inputs:[{name:"roughness",type:"float"},{name:"dotNV",type:"vec3"}]}),Hp=ki((e=>{const{dotNV:t,specularColor:r,specularF90:s,roughness:i}=e,n=zp({dotNV:t,roughness:i});return r.mul(n.x).add(s.mul(n.y))})),$p=ki((({f:e,f90:t,dotVH:r})=>{const s=r.oneMinus().saturate(),i=s.mul(s),n=s.mul(i,i).clamp(0,.9999);return e.sub(en(t).mul(n)).div(n.oneMinus())})).setLayout({name:"Schlick_to_F0",type:"vec3",inputs:[{name:"f",type:"vec3"},{name:"f90",type:"float"},{name:"dotVH",type:"float"}]}),Wp=ki((({roughness:e,dotNH:t})=>{const r=e.pow2(),s=ji(1).div(r),i=t.pow2().oneMinus().max(.0078125);return ji(2).add(s).mul(i.pow(s.mul(.5))).div(2*Math.PI)})).setLayout({name:"D_Charlie",type:"float",inputs:[{name:"roughness",type:"float"},{name:"dotNH",type:"float"}]}),jp=ki((({dotNV:e,dotNL:t})=>ji(1).div(ji(4).mul(t.add(e).sub(t.mul(e)))))).setLayout({name:"V_Neubelt",type:"float",inputs:[{name:"dotNV",type:"float"},{name:"dotNL",type:"float"}]}),qp=ki((({lightDirection:e})=>{const t=e.add(zl).normalize(),r=Ql.dot(e).clamp(),s=Ql.dot(zl).clamp(),i=Ql.dot(t).clamp(),n=Wp({roughness:Sn,dotNH:i}),a=jp({dotNV:s,dotNL:r});return Nn.mul(n).mul(a)})),Xp=ki((({N:e,V:t,roughness:r})=>{const s=e.dot(t).saturate(),i=Yi(r,s.oneMinus().sqrt());return i.assign(i.mul(.984375).add(.0078125)),i})).setLayout({name:"LTC_Uv",type:"vec2",inputs:[{name:"N",type:"vec3"},{name:"V",type:"vec3"},{name:"roughness",type:"float"}]}),Kp=ki((({f:e})=>{const t=e.length();return _o(t.mul(t).add(e.z).div(t.add(1)),0)})).setLayout({name:"LTC_ClippedSphereFormFactor",type:"float",inputs:[{name:"f",type:"vec3"}]}),Yp=ki((({v1:e,v2:t})=>{const r=e.dot(t),s=r.abs().toVar(),i=s.mul(.0145206).add(.4965155).mul(s).add(.8543985).toVar(),n=s.add(4.1616724).mul(s).add(3.417594).toVar(),a=i.div(n),o=r.greaterThan(0).select(a,_o(r.mul(r).oneMinus(),1e-7).inverseSqrt().mul(.5).sub(a));return e.cross(t).mul(o)})).setLayout({name:"LTC_EdgeVectorFormFactor",type:"vec3",inputs:[{name:"v1",type:"vec3"},{name:"v2",type:"vec3"}]}),Qp=ki((({N:e,V:t,P:r,mInv:s,p0:i,p1:n,p2:a,p3:o})=>{const u=n.sub(i).toVar(),l=o.sub(i).toVar(),d=u.cross(l),c=en().toVar();return Hi(d.dot(r.sub(i)).greaterThanEqual(0),(()=>{const u=t.sub(e.mul(t.dot(e))).normalize(),l=e.cross(u).negate(),d=s.mul(dn(u,l,e).transpose()).toVar(),h=d.mul(i.sub(r)).normalize().toVar(),p=d.mul(n.sub(r)).normalize().toVar(),g=d.mul(a.sub(r)).normalize().toVar(),m=d.mul(o.sub(r)).normalize().toVar(),f=en(0).toVar();f.addAssign(Yp({v1:h,v2:p})),f.addAssign(Yp({v1:p,v2:g})),f.addAssign(Yp({v1:g,v2:m})),f.addAssign(Yp({v1:m,v2:h})),c.assign(en(Kp({f:f})))})),c})).setLayout({name:"LTC_Evaluate",type:"vec3",inputs:[{name:"N",type:"vec3"},{name:"V",type:"vec3"},{name:"P",type:"vec3"},{name:"mInv",type:"mat3"},{name:"p0",type:"vec3"},{name:"p1",type:"vec3"},{name:"p2",type:"vec3"},{name:"p3",type:"vec3"}]}),Zp=ki((({P:e,p0:t,p1:r,p2:s,p3:i})=>{const n=r.sub(t).toVar(),a=i.sub(t).toVar(),o=n.cross(a),u=en().toVar();return Hi(o.dot(e.sub(t)).greaterThanEqual(0),(()=>{const n=t.sub(e).normalize().toVar(),a=r.sub(e).normalize().toVar(),o=s.sub(e).normalize().toVar(),l=i.sub(e).normalize().toVar(),d=en(0).toVar();d.addAssign(Yp({v1:n,v2:a})),d.addAssign(Yp({v1:a,v2:o})),d.addAssign(Yp({v1:o,v2:l})),d.addAssign(Yp({v1:l,v2:n})),u.assign(en(Kp({f:d.abs()})))})),u})).setLayout({name:"LTC_Evaluate",type:"vec3",inputs:[{name:"P",type:"vec3"},{name:"p0",type:"vec3"},{name:"p1",type:"vec3"},{name:"p2",type:"vec3"},{name:"p3",type:"vec3"}]}),Jp=1/6,eg=e=>la(Jp,la(e,la(e,e.negate().add(3)).sub(3)).add(1)),tg=e=>la(Jp,la(e,la(e,la(3,e).sub(6))).add(4)),rg=e=>la(Jp,la(e,la(e,la(-3,e).add(3)).add(3)).add(1)),sg=e=>la(Jp,Ro(e,3)),ig=e=>eg(e).add(tg(e)),ng=e=>rg(e).add(sg(e)),ag=e=>oa(-1,tg(e).div(eg(e).add(tg(e)))),og=e=>oa(1,sg(e).div(rg(e).add(sg(e)))),ug=(e,t,r)=>{const s=e.uvNode,i=la(s,t.zw).add(.5),n=Ka(i),a=Za(i),o=ig(a.x),u=ng(a.x),l=ag(a.x),d=og(a.x),c=ag(a.y),h=og(a.y),p=Yi(n.x.add(l),n.y.add(c)).sub(.5).mul(t.xy),g=Yi(n.x.add(d),n.y.add(c)).sub(.5).mul(t.xy),m=Yi(n.x.add(l),n.y.add(h)).sub(.5).mul(t.xy),f=Yi(n.x.add(d),n.y.add(h)).sub(.5).mul(t.xy),y=ig(a.y).mul(oa(o.mul(e.sample(p).level(r)),u.mul(e.sample(g).level(r)))),b=ng(a.y).mul(oa(o.mul(e.sample(m).level(r)),u.mul(e.sample(f).level(r))));return y.add(b)},lg=ki((([e,t=ji(3)])=>{const r=Yi(e.size(qi(t))),s=Yi(e.size(qi(t.add(1)))),i=da(1,r),n=da(1,s),a=ug(e,nn(i,r),Ka(t)),o=ug(e,nn(n,s),Ya(t));return Za(t).mix(a,o)})),dg=ki((([e,t,r,s,i])=>{const n=en(Uo(t.negate(),Qa(e),da(1,s))),a=en(oo(i[0].xyz),oo(i[1].xyz),oo(i[2].xyz));return Qa(n).mul(r.mul(a))})).setLayout({name:"getVolumeTransmissionRay",type:"vec3",inputs:[{name:"n",type:"vec3"},{name:"v",type:"vec3"},{name:"thickness",type:"float"},{name:"ior",type:"float"},{name:"modelMatrix",type:"mat4"}]}),cg=ki((([e,t])=>e.mul(Do(t.mul(2).sub(2),0,1)))).setLayout({name:"applyIorToRoughness",type:"float",inputs:[{name:"roughness",type:"float"},{name:"ior",type:"float"}]}),hg=wh(),pg=wh(),gg=ki((([e,t,r],{material:s})=>{const i=(s.side===S?hg:pg).sample(e),n=ja(gh.x).mul(cg(t,r));return lg(i,n)})),mg=ki((([e,t,r])=>(Hi(r.notEqual(0),(()=>{const s=Wa(t).negate().div(r);return Ha(s.negate().mul(e))})),en(1)))).setLayout({name:"volumeAttenuation",type:"vec3",inputs:[{name:"transmissionDistance",type:"float"},{name:"attenuationColor",type:"vec3"},{name:"attenuationDistance",type:"float"}]}),fg=ki((([e,t,r,s,i,n,a,o,u,l,d,c,h,p,g])=>{let m,f;if(g){m=nn().toVar(),f=en().toVar();const i=d.sub(1).mul(g.mul(.025)),n=en(d.sub(i),d,d.add(i));Zc({start:0,end:3},(({i:i})=>{const d=n.element(i),g=dg(e,t,c,d,o),y=a.add(g),b=l.mul(u.mul(nn(y,1))),x=Yi(b.xy.div(b.w)).toVar();x.addAssign(1),x.divAssign(2),x.assign(Yi(x.x,x.y.oneMinus()));const T=gg(x,r,d);m.element(i).assign(T.element(i)),m.a.addAssign(T.a),f.element(i).assign(s.element(i).mul(mg(oo(g),h,p).element(i)))})),m.a.divAssign(3)}else{const i=dg(e,t,c,d,o),n=a.add(i),g=l.mul(u.mul(nn(n,1))),y=Yi(g.xy.div(g.w)).toVar();y.addAssign(1),y.divAssign(2),y.assign(Yi(y.x,y.y.oneMinus())),m=gg(y,r,d),f=s.mul(mg(oo(i),h,p))}const y=f.rgb.mul(m.rgb),b=e.dot(t).clamp(),x=en(Hp({dotNV:b,specularColor:i,specularF90:n,roughness:r})),T=f.r.add(f.g,f.b).div(3);return nn(x.oneMinus().mul(y),m.a.oneMinus().mul(T).oneMinus())})),yg=dn(3.2404542,-.969266,.0556434,-1.5371385,1.8760108,-.2040259,-.4985314,.041556,1.0572252),bg=(e,t)=>e.sub(t).div(e.add(t)).pow2(),xg=ki((({outsideIOR:e,eta2:t,cosTheta1:r,thinFilmThickness:s,baseF0:i})=>{const n=Io(e,t,Oo(0,.03,s)),a=e.div(n).pow2().mul(r.pow2().oneMinus()).oneMinus();Hi(a.lessThan(0),(()=>en(1)));const o=a.sqrt(),u=bg(n,e),l=Ep({f0:u,f90:1,dotVH:r}),d=l.oneMinus(),c=n.lessThan(e).select(Math.PI,0),h=ji(Math.PI).sub(c),p=(e=>{const t=e.sqrt();return en(1).add(t).div(en(1).sub(t))})(i.clamp(0,.9999)),g=bg(p,n.toVec3()),m=Ep({f0:g,f90:1,dotVH:o}),f=en(p.x.lessThan(n).select(Math.PI,0),p.y.lessThan(n).select(Math.PI,0),p.z.lessThan(n).select(Math.PI,0)),y=n.mul(s,o,2),b=en(h).add(f),x=l.mul(m).clamp(1e-5,.9999),T=x.sqrt(),_=d.pow2().mul(m).div(en(1).sub(x)),v=l.add(_).toVar(),N=_.sub(d).toVar();return Zc({start:1,end:2,condition:"<=",name:"m"},(({m:e})=>{N.mulAssign(T);const t=((e,t)=>{const r=e.mul(2*Math.PI*1e-9),s=en(54856e-17,44201e-17,52481e-17),i=en(1681e3,1795300,2208400),n=en(43278e5,93046e5,66121e5),a=ji(9747e-17*Math.sqrt(2*Math.PI*45282e5)).mul(r.mul(2239900).add(t.x).cos()).mul(r.pow2().mul(-45282e5).exp());let o=s.mul(n.mul(2*Math.PI).sqrt()).mul(i.mul(r).add(t).cos()).mul(r.pow2().negate().mul(n).exp());return o=en(o.x.add(a),o.y,o.z).div(1.0685e-7),yg.mul(o)})(ji(e).mul(y),ji(e).mul(b)).mul(2);v.addAssign(N.mul(t))})),v.max(en(0))})).setLayout({name:"evalIridescence",type:"vec3",inputs:[{name:"outsideIOR",type:"float"},{name:"eta2",type:"float"},{name:"cosTheta1",type:"float"},{name:"thinFilmThickness",type:"float"},{name:"baseF0",type:"vec3"}]}),Tg=ki((({normal:e,viewDir:t,roughness:r})=>{const s=e.dot(t).saturate(),i=r.pow2(),n=Xo(r.lessThan(.25),ji(-339.2).mul(i).add(ji(161.4).mul(r)).sub(25.9),ji(-8.48).mul(i).add(ji(14.3).mul(r)).sub(9.95)),a=Xo(r.lessThan(.25),ji(44).mul(i).sub(ji(23.7).mul(r)).add(3.26),ji(1.97).mul(i).sub(ji(3.27).mul(r)).add(.72));return Xo(r.lessThan(.25),0,ji(.1).mul(r).sub(.025)).add(n.mul(s).add(a).exp()).mul(1/Math.PI).saturate()})),_g=en(.04),vg=ji(1);class Ng extends _p{constructor(e=!1,t=!1,r=!1,s=!1,i=!1,n=!1){super(),this.clearcoat=e,this.sheen=t,this.iridescence=r,this.anisotropy=s,this.transmission=i,this.dispersion=n,this.clearcoatRadiance=null,this.clearcoatSpecularDirect=null,this.clearcoatSpecularIndirect=null,this.sheenSpecularDirect=null,this.sheenSpecularIndirect=null,this.iridescenceFresnel=null,this.iridescenceF0=null}start(e){if(!0===this.clearcoat&&(this.clearcoatRadiance=en().toVar("clearcoatRadiance"),this.clearcoatSpecularDirect=en().toVar("clearcoatSpecularDirect"),this.clearcoatSpecularIndirect=en().toVar("clearcoatSpecularIndirect")),!0===this.sheen&&(this.sheenSpecularDirect=en().toVar("sheenSpecularDirect"),this.sheenSpecularIndirect=en().toVar("sheenSpecularIndirect")),!0===this.iridescence){const e=Ql.dot(zl).clamp();this.iridescenceFresnel=xg({outsideIOR:ji(1),eta2:wn,cosTheta1:e,thinFilmThickness:An,baseF0:Fn}),this.iridescenceF0=$p({f:this.iridescenceFresnel,f90:1,dotVH:e})}if(!0===this.transmission){const t=Ol,r=gl.sub(Ol).normalize(),s=Zl,i=e.context;i.backdrop=fg(s,r,xn,yn,Fn,Ln,t,El,cl,ll,On,Gn,Hn,zn,this.dispersion?$n:null),i.backdropAlpha=kn,yn.a.mulAssign(Io(1,i.backdrop.a,kn))}super.start(e)}computeMultiscattering(e,t,r){const s=Ql.dot(zl).clamp(),i=zp({roughness:xn,dotNV:s}),n=(this.iridescenceF0?En.mix(Fn,this.iridescenceF0):Fn).mul(i.x).add(r.mul(i.y)),a=i.x.add(i.y).oneMinus(),o=Fn.add(Fn.oneMinus().mul(.047619)),u=n.mul(o).div(a.mul(o).oneMinus());e.addAssign(n),t.addAssign(u.mul(a))}direct({lightDirection:e,lightColor:t,reflectedLight:r}){const s=Ql.dot(e).clamp().mul(t);if(!0===this.sheen&&this.sheenSpecularDirect.addAssign(s.mul(qp({lightDirection:e}))),!0===this.clearcoat){const r=Jl.dot(e).clamp().mul(t);this.clearcoatSpecularDirect.addAssign(r.mul(Gp({lightDirection:e,f0:_g,f90:vg,roughness:vn,normalView:Jl})))}r.directDiffuse.addAssign(s.mul(wp({diffuseColor:yn.rgb}))),r.directSpecular.addAssign(s.mul(Gp({lightDirection:e,f0:Fn,f90:1,roughness:xn,iridescence:this.iridescence,f:this.iridescenceFresnel,USE_IRIDESCENCE:this.iridescence,USE_ANISOTROPY:this.anisotropy})))}directRectArea({lightColor:e,lightPosition:t,halfWidth:r,halfHeight:s,reflectedLight:i,ltc_1:n,ltc_2:a}){const o=t.add(r).sub(s),u=t.sub(r).sub(s),l=t.sub(r).add(s),d=t.add(r).add(s),c=Ql,h=zl,p=Gl.toVar(),g=Xp({N:c,V:h,roughness:xn}),m=n.sample(g).toVar(),f=a.sample(g).toVar(),y=dn(en(m.x,0,m.y),en(0,1,0),en(m.z,0,m.w)).toVar(),b=Fn.mul(f.x).add(Fn.oneMinus().mul(f.y)).toVar();i.directSpecular.addAssign(e.mul(b).mul(Qp({N:c,V:h,P:p,mInv:y,p0:o,p1:u,p2:l,p3:d}))),i.directDiffuse.addAssign(e.mul(yn).mul(Qp({N:c,V:h,P:p,mInv:dn(1,0,0,0,1,0,0,0,1),p0:o,p1:u,p2:l,p3:d})))}indirect(e){this.indirectDiffuse(e),this.indirectSpecular(e),this.ambientOcclusion(e)}indirectDiffuse(e){const{irradiance:t,reflectedLight:r}=e.context;r.indirectDiffuse.addAssign(t.mul(wp({diffuseColor:yn})))}indirectSpecular(e){const{radiance:t,iblIrradiance:r,reflectedLight:s}=e.context;if(!0===this.sheen&&this.sheenSpecularIndirect.addAssign(r.mul(Nn,Tg({normal:Ql,viewDir:zl,roughness:Sn}))),!0===this.clearcoat){const e=Jl.dot(zl).clamp(),t=Hp({dotNV:e,specularColor:_g,specularF90:vg,roughness:vn});this.clearcoatSpecularIndirect.addAssign(this.clearcoatRadiance.mul(t))}const i=en().toVar("singleScattering"),n=en().toVar("multiScattering"),a=r.mul(1/Math.PI);this.computeMultiscattering(i,n,Ln);const o=i.add(n),u=yn.mul(o.r.max(o.g).max(o.b).oneMinus());s.indirectSpecular.addAssign(t.mul(i)),s.indirectSpecular.addAssign(n.mul(a)),s.indirectDiffuse.addAssign(u.mul(a))}ambientOcclusion(e){const{ambientOcclusion:t,reflectedLight:r}=e.context,s=Ql.dot(zl).clamp().add(t),i=xn.mul(-16).oneMinus().negate().exp2(),n=t.sub(s.pow(i).oneMinus()).clamp();!0===this.clearcoat&&this.clearcoatSpecularIndirect.mulAssign(t),!0===this.sheen&&this.sheenSpecularIndirect.mulAssign(t),r.indirectDiffuse.mulAssign(t),r.indirectSpecular.mulAssign(n)}finish({context:e}){const{outgoingLight:t}=e;if(!0===this.clearcoat){const e=Jl.dot(zl).clamp(),r=Ep({dotVH:e,f0:_g,f90:vg}),s=t.mul(_n.mul(r).oneMinus()).add(this.clearcoatSpecularDirect.add(this.clearcoatSpecularIndirect).mul(_n));t.assign(s)}if(!0===this.sheen){const e=Nn.r.max(Nn.g).max(Nn.b).mul(.157).oneMinus(),r=t.mul(e).add(this.sheenSpecularDirect,this.sheenSpecularIndirect);t.assign(r)}}}const Sg=ji(1),Eg=ji(-2),wg=ji(.8),Ag=ji(-1),Rg=ji(.4),Cg=ji(2),Mg=ji(.305),Pg=ji(3),Fg=ji(.21),Lg=ji(4),Bg=ji(4),Ig=ji(16),Dg=ki((([e])=>{const t=en(no(e)).toVar(),r=ji(-1).toVar();return Hi(t.x.greaterThan(t.z),(()=>{Hi(t.x.greaterThan(t.y),(()=>{r.assign(Xo(e.x.greaterThan(0),0,3))})).Else((()=>{r.assign(Xo(e.y.greaterThan(0),1,4))}))})).Else((()=>{Hi(t.z.greaterThan(t.y),(()=>{r.assign(Xo(e.z.greaterThan(0),2,5))})).Else((()=>{r.assign(Xo(e.y.greaterThan(0),1,4))}))})),r})).setLayout({name:"getFace",type:"float",inputs:[{name:"direction",type:"vec3"}]}),Vg=ki((([e,t])=>{const r=Yi().toVar();return Hi(t.equal(0),(()=>{r.assign(Yi(e.z,e.y).div(no(e.x)))})).ElseIf(t.equal(1),(()=>{r.assign(Yi(e.x.negate(),e.z.negate()).div(no(e.y)))})).ElseIf(t.equal(2),(()=>{r.assign(Yi(e.x.negate(),e.y).div(no(e.z)))})).ElseIf(t.equal(3),(()=>{r.assign(Yi(e.z.negate(),e.y).div(no(e.x)))})).ElseIf(t.equal(4),(()=>{r.assign(Yi(e.x.negate(),e.z).div(no(e.y)))})).Else((()=>{r.assign(Yi(e.x,e.y).div(no(e.z)))})),la(.5,r.add(1))})).setLayout({name:"getUV",type:"vec2",inputs:[{name:"direction",type:"vec3"},{name:"face",type:"float"}]}),Ug=ki((([e])=>{const t=ji(0).toVar();return Hi(e.greaterThanEqual(wg),(()=>{t.assign(Sg.sub(e).mul(Ag.sub(Eg)).div(Sg.sub(wg)).add(Eg))})).ElseIf(e.greaterThanEqual(Rg),(()=>{t.assign(wg.sub(e).mul(Cg.sub(Ag)).div(wg.sub(Rg)).add(Ag))})).ElseIf(e.greaterThanEqual(Mg),(()=>{t.assign(Rg.sub(e).mul(Pg.sub(Cg)).div(Rg.sub(Mg)).add(Cg))})).ElseIf(e.greaterThanEqual(Fg),(()=>{t.assign(Mg.sub(e).mul(Lg.sub(Pg)).div(Mg.sub(Fg)).add(Pg))})).Else((()=>{t.assign(ji(-2).mul(ja(la(1.16,e))))})),t})).setLayout({name:"roughnessToMip",type:"float",inputs:[{name:"roughness",type:"float"}]}),Og=ki((([e,t])=>{const r=e.toVar();r.assign(la(2,r).sub(1));const s=en(r,1).toVar();return Hi(t.equal(0),(()=>{s.assign(s.zyx)})).ElseIf(t.equal(1),(()=>{s.assign(s.xzy),s.xz.mulAssign(-1)})).ElseIf(t.equal(2),(()=>{s.x.mulAssign(-1)})).ElseIf(t.equal(3),(()=>{s.assign(s.zyx),s.xz.mulAssign(-1)})).ElseIf(t.equal(4),(()=>{s.assign(s.xzy),s.xy.mulAssign(-1)})).ElseIf(t.equal(5),(()=>{s.z.mulAssign(-1)})),s})).setLayout({name:"getDirection",type:"vec3",inputs:[{name:"uv",type:"vec2"},{name:"face",type:"float"}]}),kg=ki((([e,t,r,s,i,n])=>{const a=ji(r),o=en(t),u=Do(Ug(a),Eg,n),l=Za(u),d=Ka(u),c=en(Gg(e,o,d,s,i,n)).toVar();return Hi(l.notEqual(0),(()=>{const t=en(Gg(e,o,d.add(1),s,i,n)).toVar();c.assign(Io(c,t,l))})),c})),Gg=ki((([e,t,r,s,i,n])=>{const a=ji(r).toVar(),o=en(t),u=ji(Dg(o)).toVar(),l=ji(_o(Bg.sub(a),0)).toVar();a.assign(_o(a,Bg));const d=ji($a(a)).toVar(),c=Yi(Vg(o,u).mul(d.sub(2)).add(1)).toVar();return Hi(u.greaterThan(2),(()=>{c.y.addAssign(d),u.subAssign(3)})),c.x.addAssign(u.mul(d)),c.x.addAssign(l.mul(la(3,Ig))),c.y.addAssign(la(4,$a(n).sub(d))),c.x.mulAssign(s),c.y.mulAssign(i),e.sample(c).grad(Yi(),Yi())})),zg=ki((({envMap:e,mipInt:t,outputDirection:r,theta:s,axis:i,CUBEUV_TEXEL_WIDTH:n,CUBEUV_TEXEL_HEIGHT:a,CUBEUV_MAX_MIP:o})=>{const u=eo(s),l=r.mul(u).add(i.cross(r).mul(Ja(s))).add(i.mul(i.dot(r).mul(u.oneMinus())));return Gg(e,l,t,n,a,o)})),Hg=ki((({n:e,latitudinal:t,poleAxis:r,outputDirection:s,weights:i,samples:n,dTheta:a,mipInt:o,envMap:u,CUBEUV_TEXEL_WIDTH:l,CUBEUV_TEXEL_HEIGHT:d,CUBEUV_MAX_MIP:c})=>{const h=en(Xo(t,r,Ao(r,s))).toVar();Hi(h.equal(en(0)),(()=>{h.assign(en(s.z,0,s.x.negate()))})),h.assign(Qa(h));const p=en().toVar();return p.addAssign(i.element(0).mul(zg({theta:0,axis:h,outputDirection:s,mipInt:o,envMap:u,CUBEUV_TEXEL_WIDTH:l,CUBEUV_TEXEL_HEIGHT:d,CUBEUV_MAX_MIP:c}))),Zc({start:qi(1),end:e},(({i:e})=>{Hi(e.greaterThanEqual(n),(()=>{Jc()}));const t=ji(a.mul(ji(e))).toVar();p.addAssign(i.element(e).mul(zg({theta:t.mul(-1),axis:h,outputDirection:s,mipInt:o,envMap:u,CUBEUV_TEXEL_WIDTH:l,CUBEUV_TEXEL_HEIGHT:d,CUBEUV_MAX_MIP:c}))),p.addAssign(i.element(e).mul(zg({theta:t,axis:h,outputDirection:s,mipInt:o,envMap:u,CUBEUV_TEXEL_WIDTH:l,CUBEUV_TEXEL_HEIGHT:d,CUBEUV_MAX_MIP:c})))})),nn(p,1)})),$g=[.125,.215,.35,.446,.526,.582],Wg=20,jg=new ne(-1,1,1,-1,0,1),qg=new ae(90,1),Xg=new e;let Kg=null,Yg=0,Qg=0;const Zg=(1+Math.sqrt(5))/2,Jg=1/Zg,em=[new r(-Zg,Jg,0),new r(Zg,Jg,0),new r(-Jg,0,Zg),new r(Jg,0,Zg),new r(0,Zg,-Jg),new r(0,Zg,Jg),new r(-1,1,-1),new r(1,1,-1),new r(-1,1,1),new r(1,1,1)],tm=new r,rm=new WeakMap,sm=[3,1,5,0,4,2],im=Og($u(),Hu("faceIndex")).normalize(),nm=en(im.x,im.y,im.z);class am{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._backgroundBox=null}get _hasInitialized(){return this._renderer.hasInitialized()}fromScene(e,t=0,r=.1,s=100,i={}){const{size:n=256,position:a=tm,renderTarget:o=null}=i;if(this._setSize(n),!1===this._hasInitialized){console.warn("THREE.PMREMGenerator: .fromScene() called before the backend is initialized. Try using .fromSceneAsync() instead.");const n=o||this._allocateTarget();return i.renderTarget=n,this.fromSceneAsync(e,t,r,s,i),n}Kg=this._renderer.getRenderTarget(),Yg=this._renderer.getActiveCubeFace(),Qg=this._renderer.getActiveMipmapLevel();const u=o||this._allocateTarget();return u.depthBuffer=!0,this._init(u),this._sceneToCubeUV(e,r,s,u,a),t>0&&this._blur(u,0,0,t),this._applyPMREM(u),this._cleanup(u),u}async fromSceneAsync(e,t=0,r=.1,s=100,i={}){return!1===this._hasInitialized&&await this._renderer.init(),this.fromScene(e,t,r,s,i)}fromEquirectangular(e,t=null){if(!1===this._hasInitialized){console.warn("THREE.PMREMGenerator: .fromEquirectangular() called before the backend is initialized. Try using .fromEquirectangularAsync() instead."),this._setSizeFromTexture(e);const r=t||this._allocateTarget();return this.fromEquirectangularAsync(e,r),r}return this._fromTexture(e,t)}async fromEquirectangularAsync(e,t=null){return!1===this._hasInitialized&&await this._renderer.init(),this._fromTexture(e,t)}fromCubemap(e,t=null){if(!1===this._hasInitialized){console.warn("THREE.PMREMGenerator: .fromCubemap() called before the backend is initialized. Try using .fromCubemapAsync() instead."),this._setSizeFromTexture(e);const r=t||this._allocateTarget();return this.fromCubemapAsync(e,t),r}return this._fromTexture(e,t)}async fromCubemapAsync(e,t=null){return!1===this._hasInitialized&&await this._renderer.init(),this._fromTexture(e,t)}async compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=dm(),await this._compileMaterial(this._cubemapMaterial))}async compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=cm(),await this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose(),null!==this._backgroundBox&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSizeFromTexture(e){e.mapping===A||e.mapping===R?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4)}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;ee-4?u=$g[o-e+4-1]:0===o&&(u=0),s.push(u);const l=1/(a-2),d=-l,c=1+l,h=[d,d,c,d,c,c,d,d,c,c,d,c],p=6,g=6,m=3,f=2,y=1,b=new Float32Array(m*g*p),x=new Float32Array(f*g*p),T=new Float32Array(y*g*p);for(let e=0;e2?0:-1,s=[t,r,0,t+2/3,r,0,t+2/3,r+1,0,t,r,0,t+2/3,r+1,0,t,r+1,0],i=sm[e];b.set(s,m*g*i),x.set(h,f*g*i);const n=[i,i,i,i,i,i];T.set(n,y*g*i)}const _=new he;_.setAttribute("position",new pe(b,m)),_.setAttribute("uv",new pe(x,f)),_.setAttribute("faceIndex",new pe(T,y)),t.push(_),i.push(new q(_,null)),n>4&&n--}return{lodPlanes:t,sizeLods:r,sigmas:s,lodMeshes:i}}(t)),this._blurMaterial=function(e,t,s){const i=il(new Array(Wg).fill(0)),n=Zn(new r(0,1,0)),a=Zn(0),o=ji(Wg),u=Zn(0),l=Zn(1),d=Zu(null),c=Zn(0),h=ji(1/t),p=ji(1/s),g=ji(e),m={n:o,latitudinal:u,weights:i,poleAxis:n,outputDirection:nm,dTheta:a,samples:l,envMap:d,mipInt:c,CUBEUV_TEXEL_WIDTH:h,CUBEUV_TEXEL_HEIGHT:p,CUBEUV_MAX_MIP:g},f=lm("blur");return f.fragmentNode=Hg({...m,latitudinal:u.equal(1)}),rm.set(f,m),f}(t,e.width,e.height)}}async _compileMaterial(e){const t=new q(this._lodPlanes[0],e);await this._renderer.compile(t,jg)}_sceneToCubeUV(e,t,r,s,i){const n=qg;n.near=t,n.far=r;const a=[1,1,1,1,-1,1],o=[1,-1,1,-1,1,-1],u=this._renderer,l=u.autoClear;u.getClearColor(Xg),u.autoClear=!1;let d=this._backgroundBox;if(null===d){const e=new re({name:"PMREM.Background",side:S,depthWrite:!1,depthTest:!1});d=new q(new j,e)}let c=!1;const h=e.background;h?h.isColor&&(d.material.color.copy(h),e.background=null,c=!0):(d.material.color.copy(Xg),c=!0),u.setRenderTarget(s),u.clear(),c&&u.render(d,n);for(let t=0;t<6;t++){const r=t%3;0===r?(n.up.set(0,a[t],0),n.position.set(i.x,i.y,i.z),n.lookAt(i.x+o[t],i.y,i.z)):1===r?(n.up.set(0,0,a[t]),n.position.set(i.x,i.y,i.z),n.lookAt(i.x,i.y+o[t],i.z)):(n.up.set(0,a[t],0),n.position.set(i.x,i.y,i.z),n.lookAt(i.x,i.y,i.z+o[t]));const l=this._cubeSize;um(s,r*l,t>2?l:0,l,l),u.render(e,n)}u.autoClear=l,e.background=h}_textureToCubeUV(e,t){const r=this._renderer,s=e.mapping===A||e.mapping===R;s?null===this._cubemapMaterial&&(this._cubemapMaterial=dm(e)):null===this._equirectMaterial&&(this._equirectMaterial=cm(e));const i=s?this._cubemapMaterial:this._equirectMaterial;i.fragmentNode.value=e;const n=this._lodMeshes[0];n.material=i;const a=this._cubeSize;um(t,0,0,3*a,2*a),r.setRenderTarget(t),r.render(n,jg)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;const s=this._lodPlanes.length;for(let t=1;tWg&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${g} samples when the maximum is set to 20`);const m=[];let f=0;for(let e=0;ey-4?s-y+4:0),4*(this._cubeSize-b),3*b,2*b),o.setRenderTarget(t),o.render(l,jg)}}function om(e,t){const r=new oe(e,t,{magFilter:K,minFilter:K,generateMipmaps:!1,type:de,format:le,colorSpace:ue});return r.texture.mapping=ce,r.texture.name="PMREM.cubeUv",r.texture.isPMREMTexture=!0,r.scissorTest=!0,r}function um(e,t,r,s,i){e.viewport.set(t,r,s,i),e.scissor.set(t,r,s,i)}function lm(e){const t=new Zh;return t.depthTest=!1,t.depthWrite=!1,t.blending=z,t.name=`PMREM_${e}`,t}function dm(e){const t=lm("cubemap");return t.fragmentNode=gd(e,nm),t}function cm(e){const t=lm("equirect");return t.fragmentNode=Zu(e,hp(nm),0),t}const hm=new WeakMap;function pm(e,t,r){const s=function(e){let t=hm.get(e);void 0===t&&(t=new WeakMap,hm.set(e,t));return t}(t);let i=s.get(e);if((void 0!==i?i.pmremVersion:-1)!==e.pmremVersion){const t=e.image;if(e.isCubeTexture){if(!function(e){if(null==e)return!1;let t=0;const r=6;for(let s=0;s0}(t))return null;i=r.fromEquirectangular(e,i)}i.pmremVersion=e.pmremVersion,s.set(e,i)}return i.texture}class gm extends Ks{static get type(){return"PMREMNode"}constructor(e,t=null,r=null){super("vec3"),this._value=e,this._pmrem=null,this.uvNode=t,this.levelNode=r,this._generator=null;const s=new x;s.isRenderTargetTexture=!0,this._texture=Zu(s),this._width=Zn(0),this._height=Zn(0),this._maxMip=Zn(0),this.updateBeforeType=Vs.RENDER}set value(e){this._value=e,this._pmrem=null}get value(){return this._value}updateFromTexture(e){const t=function(e){const t=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:r,maxMip:t}}(e.image.height);this._texture.value=e,this._width.value=t.texelWidth,this._height.value=t.texelHeight,this._maxMip.value=t.maxMip}updateBefore(e){let t=this._pmrem;const r=t?t.pmremVersion:-1,s=this._value;r!==s.pmremVersion&&(t=!0===s.isPMREMTexture?s:pm(s,e.renderer,this._generator),null!==t&&(this._pmrem=t,this.updateFromTexture(t)))}setup(e){null===this._generator&&(this._generator=new am(e.renderer)),this.updateBefore(e);let t=this.uvNode;null===t&&e.context.getUV&&(t=e.context.getUV(this)),t=ad.mul(en(t.x,t.y.negate(),t.z));let r=this.levelNode;return null===r&&e.context.getTextureLevel&&(r=e.context.getTextureLevel(this)),kg(this._texture,t,r,this._width,this._height,this._maxMip)}dispose(){super.dispose(),null!==this._generator&&this._generator.dispose()}}const mm=Vi(gm).setParameterLength(1,3),fm=new WeakMap;class ym extends nh{static get type(){return"EnvironmentNode"}constructor(e=null){super(),this.envNode=e}setup(e){const{material:t}=e;let r=this.envNode;if(r.isTextureNode||r.isMaterialReferenceNode){const e=r.isTextureNode?r.value:t[r.property];let s=fm.get(e);void 0===s&&(s=mm(e),fm.set(e,s)),r=s}const s=!0===t.useAnisotropy||t.anisotropy>0?Dd:Ql,i=r.context(bm(xn,s)).mul(nd),n=r.context(xm(Zl)).mul(Math.PI).mul(nd),a=Ru(i),o=Ru(n);e.context.radiance.addAssign(a),e.context.iblIrradiance.addAssign(o);const u=e.context.lightingModel.clearcoatRadiance;if(u){const e=r.context(bm(vn,Jl)).mul(nd),t=Ru(e);u.addAssign(t)}}}const bm=(e,t)=>{let r=null;return{getUV:()=>(null===r&&(r=zl.negate().reflect(t),r=e.mul(e).mix(r,t).normalize(),r=r.transformDirection(cl)),r),getTextureLevel:()=>e}},xm=e=>({getUV:()=>e,getTextureLevel:()=>ji(1)}),Tm=new ge;class _m extends Zh{static get type(){return"MeshStandardNodeMaterial"}constructor(e){super(),this.isMeshStandardNodeMaterial=!0,this.lights=!0,this.emissiveNode=null,this.metalnessNode=null,this.roughnessNode=null,this.setDefaultValues(Tm),this.setValues(e)}setupEnvironment(e){let t=super.setupEnvironment(e);return null===t&&e.environmentNode&&(t=e.environmentNode),t?new ym(t):null}setupLightingModel(){return new Ng}setupSpecular(){const e=Io(en(.04),yn.rgb,Tn);Fn.assign(e),Ln.assign(1)}setupVariants(){const e=this.metalnessNode?ji(this.metalnessNode):sc;Tn.assign(e);let t=this.roughnessNode?ji(this.roughnessNode):rc;t=Ip({roughness:t}),xn.assign(t),this.setupSpecular(),yn.assign(nn(yn.rgb.mul(e.oneMinus()),yn.a))}copy(e){return this.emissiveNode=e.emissiveNode,this.metalnessNode=e.metalnessNode,this.roughnessNode=e.roughnessNode,super.copy(e)}}const vm=new me;class Nm extends _m{static get type(){return"MeshPhysicalNodeMaterial"}constructor(e){super(),this.isMeshPhysicalNodeMaterial=!0,this.clearcoatNode=null,this.clearcoatRoughnessNode=null,this.clearcoatNormalNode=null,this.sheenNode=null,this.sheenRoughnessNode=null,this.iridescenceNode=null,this.iridescenceIORNode=null,this.iridescenceThicknessNode=null,this.specularIntensityNode=null,this.specularColorNode=null,this.iorNode=null,this.transmissionNode=null,this.thicknessNode=null,this.attenuationDistanceNode=null,this.attenuationColorNode=null,this.dispersionNode=null,this.anisotropyNode=null,this.setDefaultValues(vm),this.setValues(e)}get useClearcoat(){return this.clearcoat>0||null!==this.clearcoatNode}get useIridescence(){return this.iridescence>0||null!==this.iridescenceNode}get useSheen(){return this.sheen>0||null!==this.sheenNode}get useAnisotropy(){return this.anisotropy>0||null!==this.anisotropyNode}get useTransmission(){return this.transmission>0||null!==this.transmissionNode}get useDispersion(){return this.dispersion>0||null!==this.dispersionNode}setupSpecular(){const e=this.iorNode?ji(this.iorNode):yc;On.assign(e),Fn.assign(Io(To(Co(On.sub(1).div(On.add(1))).mul(Jd),en(1)).mul(Zd),yn.rgb,Tn)),Ln.assign(Io(Zd,1,Tn))}setupLightingModel(){return new Ng(this.useClearcoat,this.useSheen,this.useIridescence,this.useAnisotropy,this.useTransmission,this.useDispersion)}setupVariants(e){if(super.setupVariants(e),this.useClearcoat){const e=this.clearcoatNode?ji(this.clearcoatNode):nc,t=this.clearcoatRoughnessNode?ji(this.clearcoatRoughnessNode):ac;_n.assign(e),vn.assign(Ip({roughness:t}))}if(this.useSheen){const e=this.sheenNode?en(this.sheenNode):lc,t=this.sheenRoughnessNode?ji(this.sheenRoughnessNode):dc;Nn.assign(e),Sn.assign(t)}if(this.useIridescence){const e=this.iridescenceNode?ji(this.iridescenceNode):hc,t=this.iridescenceIORNode?ji(this.iridescenceIORNode):pc,r=this.iridescenceThicknessNode?ji(this.iridescenceThicknessNode):gc;En.assign(e),wn.assign(t),An.assign(r)}if(this.useAnisotropy){const e=(this.anisotropyNode?Yi(this.anisotropyNode):cc).toVar();Cn.assign(e.length()),Hi(Cn.equal(0),(()=>{e.assign(Yi(1,0))})).Else((()=>{e.divAssign(Yi(Cn)),Cn.assign(Cn.saturate())})),Rn.assign(Cn.pow2().mix(xn.pow2(),1)),Mn.assign(Bd[0].mul(e.x).add(Bd[1].mul(e.y))),Pn.assign(Bd[1].mul(e.x).sub(Bd[0].mul(e.y)))}if(this.useTransmission){const e=this.transmissionNode?ji(this.transmissionNode):mc,t=this.thicknessNode?ji(this.thicknessNode):fc,r=this.attenuationDistanceNode?ji(this.attenuationDistanceNode):bc,s=this.attenuationColorNode?en(this.attenuationColorNode):xc;if(kn.assign(e),Gn.assign(t),zn.assign(r),Hn.assign(s),this.useDispersion){const e=this.dispersionNode?ji(this.dispersionNode):wc;$n.assign(e)}}}setupClearcoatNormal(){return this.clearcoatNormalNode?en(this.clearcoatNormalNode):oc}setup(e){e.context.setupClearcoatNormal=()=>this.setupClearcoatNormal(e),super.setup(e)}copy(e){return this.clearcoatNode=e.clearcoatNode,this.clearcoatRoughnessNode=e.clearcoatRoughnessNode,this.clearcoatNormalNode=e.clearcoatNormalNode,this.sheenNode=e.sheenNode,this.sheenRoughnessNode=e.sheenRoughnessNode,this.iridescenceNode=e.iridescenceNode,this.iridescenceIORNode=e.iridescenceIORNode,this.iridescenceThicknessNode=e.iridescenceThicknessNode,this.specularIntensityNode=e.specularIntensityNode,this.specularColorNode=e.specularColorNode,this.transmissionNode=e.transmissionNode,this.thicknessNode=e.thicknessNode,this.attenuationDistanceNode=e.attenuationDistanceNode,this.attenuationColorNode=e.attenuationColorNode,this.dispersionNode=e.dispersionNode,this.anisotropyNode=e.anisotropyNode,super.copy(e)}}class Sm extends Ng{constructor(e=!1,t=!1,r=!1,s=!1,i=!1,n=!1,a=!1){super(e,t,r,s,i,n),this.useSSS=a}direct({lightDirection:e,lightColor:t,reflectedLight:r},s){if(!0===this.useSSS){const i=s.material,{thicknessColorNode:n,thicknessDistortionNode:a,thicknessAmbientNode:o,thicknessAttenuationNode:u,thicknessPowerNode:l,thicknessScaleNode:d}=i,c=e.add(Ql.mul(a)).normalize(),h=ji(zl.dot(c.negate()).saturate().pow(l).mul(d)),p=en(h.add(o).mul(n));r.directDiffuse.addAssign(p.mul(u.mul(t)))}super.direct({lightDirection:e,lightColor:t,reflectedLight:r},s)}}class Em extends Nm{static get type(){return"MeshSSSNodeMaterial"}constructor(e){super(e),this.thicknessColorNode=null,this.thicknessDistortionNode=ji(.1),this.thicknessAmbientNode=ji(0),this.thicknessAttenuationNode=ji(.1),this.thicknessPowerNode=ji(2),this.thicknessScaleNode=ji(10)}get useSSS(){return null!==this.thicknessColorNode}setupLightingModel(){return new Sm(this.useClearcoat,this.useSheen,this.useIridescence,this.useAnisotropy,this.useTransmission,this.useDispersion,this.useSSS)}copy(e){return this.thicknessColorNode=e.thicknessColorNode,this.thicknessDistortionNode=e.thicknessDistortionNode,this.thicknessAmbientNode=e.thicknessAmbientNode,this.thicknessAttenuationNode=e.thicknessAttenuationNode,this.thicknessPowerNode=e.thicknessPowerNode,this.thicknessScaleNode=e.thicknessScaleNode,super.copy(e)}}const wm=ki((({normal:e,lightDirection:t,builder:r})=>{const s=e.dot(t),i=Yi(s.mul(.5).add(.5),0);if(r.material.gradientMap){const e=Td("gradientMap","texture").context({getUV:()=>i});return en(e.r)}{const e=i.fwidth().mul(.5);return Io(en(.7),en(1),Oo(ji(.7).sub(e.x),ji(.7).add(e.x),i.x))}}));class Am extends _p{direct({lightDirection:e,lightColor:t,reflectedLight:r},s){const i=wm({normal:jl,lightDirection:e,builder:s}).mul(t);r.directDiffuse.addAssign(i.mul(wp({diffuseColor:yn.rgb})))}indirect(e){const{ambientOcclusion:t,irradiance:r,reflectedLight:s}=e.context;s.indirectDiffuse.addAssign(r.mul(wp({diffuseColor:yn}))),s.indirectDiffuse.mulAssign(t)}}const Rm=new fe;class Cm extends Zh{static get type(){return"MeshToonNodeMaterial"}constructor(e){super(),this.isMeshToonNodeMaterial=!0,this.lights=!0,this.setDefaultValues(Rm),this.setValues(e)}setupLightingModel(){return new Am}}class Mm extends Ks{static get type(){return"MatcapUVNode"}constructor(){super("vec2")}setup(){const e=en(zl.z,0,zl.x.negate()).normalize(),t=zl.cross(e);return Yi(e.dot(Ql),t.dot(Ql)).mul(.495).add(.5)}}const Pm=Ui(Mm),Fm=new ye;class Lm extends Zh{static get type(){return"MeshMatcapNodeMaterial"}constructor(e){super(),this.isMeshMatcapNodeMaterial=!0,this.setDefaultValues(Fm),this.setValues(e)}setupVariants(e){const t=Pm;let r;r=e.material.matcap?Td("matcap","texture").context({getUV:()=>t}):en(Io(.2,.8,t.y)),yn.rgb.mulAssign(r.rgb)}}class Bm extends Ks{static get type(){return"RotateNode"}constructor(e,t){super(),this.positionNode=e,this.rotationNode=t}getNodeType(e){return this.positionNode.getNodeType(e)}setup(e){const{rotationNode:t,positionNode:r}=this;if("vec2"===this.getNodeType(e)){const e=t.cos(),s=t.sin();return ln(e,s,s.negate(),e).mul(r)}{const e=t,s=cn(nn(1,0,0,0),nn(0,eo(e.x),Ja(e.x).negate(),0),nn(0,Ja(e.x),eo(e.x),0),nn(0,0,0,1)),i=cn(nn(eo(e.y),0,Ja(e.y),0),nn(0,1,0,0),nn(Ja(e.y).negate(),0,eo(e.y),0),nn(0,0,0,1)),n=cn(nn(eo(e.z),Ja(e.z).negate(),0,0),nn(Ja(e.z),eo(e.z),0,0),nn(0,0,1,0),nn(0,0,0,1));return s.mul(i).mul(n).mul(nn(r,1)).xyz}}}const Im=Vi(Bm).setParameterLength(2),Dm=new be;class Vm extends Zh{static get type(){return"SpriteNodeMaterial"}constructor(e){super(),this.isSpriteNodeMaterial=!0,this._useSizeAttenuation=!0,this.positionNode=null,this.rotationNode=null,this.scaleNode=null,this.transparent=!0,this.setDefaultValues(Dm),this.setValues(e)}setupPositionView(e){const{object:t,camera:r}=e,s=this.sizeAttenuation,{positionNode:i,rotationNode:n,scaleNode:a}=this,o=Fl.mul(en(i||0));let u=Yi(El[0].xyz.length(),El[1].xyz.length());if(null!==a&&(u=u.mul(Yi(a))),!1===s)if(r.isPerspectiveCamera)u=u.mul(o.z.negate());else{const e=ji(2).div(ll.element(1).element(1));u=u.mul(e.mul(2))}let l=Dl.xy;if(t.center&&!0===t.center.isVector2){const e=((e,t,r)=>Bi(new gu(e,t,r)))("center","vec2",t);l=l.sub(e.sub(.5))}l=l.mul(u);const d=ji(n||uc),c=Im(l,d);return nn(o.xy.add(c),o.zw)}copy(e){return this.positionNode=e.positionNode,this.rotationNode=e.rotationNode,this.scaleNode=e.scaleNode,super.copy(e)}get sizeAttenuation(){return this._useSizeAttenuation}set sizeAttenuation(e){this._useSizeAttenuation!==e&&(this._useSizeAttenuation=e,this.needsUpdate=!0)}}const Um=new xe;class Om extends Vm{static get type(){return"PointsNodeMaterial"}constructor(e){super(),this.sizeNode=null,this.isPointsNodeMaterial=!0,this.setDefaultValues(Um),this.setValues(e)}setupPositionView(){const{positionNode:e}=this;return Fl.mul(en(e||Vl)).xyz}setupVertex(e){const t=super.setupVertex(e);if(!0!==e.material.isNodeMaterial)return t;const{rotationNode:r,scaleNode:s,sizeNode:i}=this,n=Dl.xy.toVar(),a=fh.z.div(fh.w);if(r&&r.isNode){const e=ji(r);n.assign(Im(n,e))}let o=null!==i?Yi(i):Ec;return!0===this.sizeAttenuation&&(o=o.mul(o.div(Gl.z.negate()))),s&&s.isNode&&(o=o.mul(Yi(s))),n.mulAssign(o.mul(2)),n.assign(n.div(fh.z)),n.y.assign(n.y.mul(a)),n.assign(n.mul(t.w)),t.addAssign(nn(n,0,0)),t}get alphaToCoverage(){return this._useAlphaToCoverage}set alphaToCoverage(e){this._useAlphaToCoverage!==e&&(this._useAlphaToCoverage=e,this.needsUpdate=!0)}}class km extends _p{constructor(){super(),this.shadowNode=ji(1).toVar("shadowMask")}direct({lightNode:e}){null!==e.shadowNode&&this.shadowNode.mulAssign(e.shadowNode)}finish({context:e}){yn.a.mulAssign(this.shadowNode.oneMinus()),e.outgoingLight.rgb.assign(yn.rgb)}}const Gm=new Te;class zm extends Zh{static get type(){return"ShadowNodeMaterial"}constructor(e){super(),this.isShadowNodeMaterial=!0,this.lights=!0,this.transparent=!0,this.setDefaultValues(Gm),this.setValues(e)}setupLightingModel(){return new km}}const Hm=mn("vec3"),$m=mn("vec3"),Wm=mn("vec3");class jm extends _p{constructor(){super()}start(e){const{material:t,context:r}=e,s=mn("vec3"),i=mn("vec3");Hi(gl.sub(Ol).length().greaterThan(Cl.mul(2)),(()=>{s.assign(gl),i.assign(Ol)})).Else((()=>{s.assign(Ol),i.assign(gl)}));const n=i.sub(s),a=Zn("int").onRenderUpdate((({material:e})=>e.steps)),o=n.length().div(a).toVar(),u=n.normalize().toVar(),l=ji(0).toVar(),d=en(1).toVar();t.offsetNode&&l.addAssign(t.offsetNode.mul(o)),Zc(a,(()=>{const i=s.add(u.mul(l)),n=cl.mul(nn(i,1)).xyz;let a;null!==t.depthNode&&($m.assign(Vh(Fh(n.z,ol,ul))),r.sceneDepthNode=Vh(t.depthNode).toVar()),r.positionWorld=i,r.shadowPositionWorld=i,r.positionView=n,Hm.assign(0),t.scatteringNode&&(a=t.scatteringNode({positionRay:i})),super.start(e),a&&Hm.mulAssign(a);const c=Hm.mul(.01).negate().mul(o).exp();d.mulAssign(c),l.addAssign(o)})),Wm.addAssign(d.saturate().oneMinus())}scatteringLight(e,t){const r=t.context.sceneDepthNode;r?Hi(r.greaterThanEqual($m),(()=>{Hm.addAssign(e)})):Hm.addAssign(e)}direct({lightNode:e,lightColor:t},r){if(void 0===e.light.distance)return;const s=t.xyz.toVar();s.mulAssign(e.shadowNode),this.scatteringLight(s,r)}directRectArea({lightColor:e,lightPosition:t,halfWidth:r,halfHeight:s},i){const n=t.add(r).sub(s),a=t.sub(r).sub(s),o=t.sub(r).add(s),u=t.add(r).add(s),l=i.context.positionView,d=e.xyz.mul(Zp({P:l,p0:n,p1:a,p2:o,p3:u})).pow(1.5);this.scatteringLight(d,i)}finish(e){e.context.outgoingLight.assign(Wm)}}class qm extends Zh{static get type(){return"VolumeNodeMaterial"}constructor(e){super(),this.isVolumeNodeMaterial=!0,this.steps=25,this.offsetNode=null,this.scatteringNode=null,this.lights=!0,this.transparent=!0,this.side=S,this.depthTest=!1,this.depthWrite=!1,this.setValues(e)}setupLightingModel(){return new jm}}class Xm{constructor(e,t){this.nodes=e,this.info=t,this._context="undefined"!=typeof self?self:null,this._animationLoop=null,this._requestId=null}start(){const e=(t,r)=>{this._requestId=this._context.requestAnimationFrame(e),!0===this.info.autoReset&&this.info.reset(),this.nodes.nodeFrame.update(),this.info.frame=this.nodes.nodeFrame.frameId,null!==this._animationLoop&&this._animationLoop(t,r)};e()}stop(){this._context.cancelAnimationFrame(this._requestId),this._requestId=null}getAnimationLoop(){return this._animationLoop}setAnimationLoop(e){this._animationLoop=e}getContext(){return this._context}setContext(e){this._context=e}dispose(){this.stop()}}class Km{constructor(){this.weakMap=new WeakMap}get(e){let t=this.weakMap;for(let r=0;r{this.dispose()},this.onGeometryDispose=()=>{this.attributes=null,this.attributesId=null},this.material.addEventListener("dispose",this.onMaterialDispose),this.geometry.addEventListener("dispose",this.onGeometryDispose)}updateClipping(e){this.clippingContext=e}get clippingNeedsUpdate(){return null!==this.clippingContext&&this.clippingContext.cacheKey!==this.clippingContextCacheKey&&(this.clippingContextCacheKey=this.clippingContext.cacheKey,!0)}get hardwareClippingPlanes(){return!0===this.material.hardwareClipping?this.clippingContext.unionClippingCount:0}getNodeBuilderState(){return this._nodeBuilderState||(this._nodeBuilderState=this._nodes.getForRender(this))}getMonitor(){return this._monitor||(this._monitor=this.getNodeBuilderState().observer)}getBindings(){return this._bindings||(this._bindings=this.getNodeBuilderState().createBindings())}getBindingGroup(e){for(const t of this.getBindings())if(t.name===e)return t}getIndex(){return this._geometries.getIndex(this)}getIndirect(){return this._geometries.getIndirect(this)}getChainArray(){return[this.object,this.material,this.context,this.lightsNode]}setGeometry(e){this.geometry=e,this.attributes=null,this.attributesId=null}getAttributes(){if(null!==this.attributes)return this.attributes;const e=this.getNodeBuilderState().nodeAttributes,t=this.geometry,r=[],s=new Set,i={};for(const n of e){let e;if(n.node&&n.node.attribute?e=n.node.attribute:(e=t.getAttribute(n.name),i[n.name]=e.version),void 0===e)continue;r.push(e);const a=e.isInterleavedBufferAttribute?e.data:e;s.add(a)}return this.attributes=r,this.attributesId=i,this.vertexBuffers=Array.from(s.values()),r}getVertexBuffers(){return null===this.vertexBuffers&&this.getAttributes(),this.vertexBuffers}getDrawParameters(){const{object:e,material:t,geometry:r,group:s,drawRange:i}=this,n=this.drawParams||(this.drawParams={vertexCount:0,firstVertex:0,instanceCount:0,firstInstance:0}),a=this.getIndex(),o=null!==a;let u=1;if(!0===r.isInstancedBufferGeometry?u=r.instanceCount:void 0!==e.count&&(u=Math.max(0,e.count)),0===u)return null;if(n.instanceCount=u,!0===e.isBatchedMesh)return n;let l=1;!0!==t.wireframe||e.isPoints||e.isLineSegments||e.isLine||e.isLineLoop||(l=2);let d=i.start*l,c=(i.start+i.count)*l;null!==s&&(d=Math.max(d,s.start*l),c=Math.min(c,(s.start+s.count)*l));const h=r.attributes.position;let p=1/0;o?p=a.count:null!=h&&(p=h.count),d=Math.max(d,0),c=Math.min(c,p);const g=c-d;return g<0||g===1/0?null:(n.vertexCount=g,n.firstVertex=d,n)}getGeometryCacheKey(){const{geometry:e}=this;let t="";for(const r of Object.keys(e.attributes).sort()){const s=e.attributes[r];t+=r+",",s.data&&(t+=s.data.stride+","),s.offset&&(t+=s.offset+","),s.itemSize&&(t+=s.itemSize+","),s.normalized&&(t+="n,")}for(const r of Object.keys(e.morphAttributes).sort()){const s=e.morphAttributes[r];t+="morph-"+r+",";for(let e=0,r=s.length;e1&&(r+=e.uuid+","),r+=e.receiveShadow+",",bs(r)}get needsGeometryUpdate(){if(this.geometry.id!==this.object.geometry.id)return!0;if(null!==this.attributes){const e=this.attributesId;for(const t in e){const r=this.geometry.getAttribute(t);if(void 0===r||e[t]!==r.id)return!0}}return!1}get needsUpdate(){return this.initialNodesCacheKey!==this.getDynamicCacheKey()||this.clippingNeedsUpdate}getDynamicCacheKey(){let e=0;return!0!==this.material.isShadowPassMaterial&&(e=this._nodes.getCacheKey(this.scene,this.lightsNode)),this.camera.isArrayCamera&&(e=Ts(e,this.camera.cameras.length)),this.object.receiveShadow&&(e=Ts(e,1)),e}getCacheKey(){return this.getMaterialCacheKey()+this.getDynamicCacheKey()}dispose(){this.material.removeEventListener("dispose",this.onMaterialDispose),this.geometry.removeEventListener("dispose",this.onGeometryDispose),this.onDispose()}}const Zm=[];class Jm{constructor(e,t,r,s,i,n){this.renderer=e,this.nodes=t,this.geometries=r,this.pipelines=s,this.bindings=i,this.info=n,this.chainMaps={}}get(e,t,r,s,i,n,a,o){const u=this.getChainMap(o);Zm[0]=e,Zm[1]=t,Zm[2]=n,Zm[3]=i;let l=u.get(Zm);return void 0===l?(l=this.createRenderObject(this.nodes,this.geometries,this.renderer,e,t,r,s,i,n,a,o),u.set(Zm,l)):(l.updateClipping(a),l.needsGeometryUpdate&&l.setGeometry(e.geometry),(l.version!==t.version||l.needsUpdate)&&(l.initialCacheKey!==l.getCacheKey()?(l.dispose(),l=this.get(e,t,r,s,i,n,a,o)):l.version=t.version)),Zm.length=0,l}getChainMap(e="default"){return this.chainMaps[e]||(this.chainMaps[e]=new Km)}dispose(){this.chainMaps={}}createRenderObject(e,t,r,s,i,n,a,o,u,l,d){const c=this.getChainMap(d),h=new Qm(e,t,r,s,i,n,a,o,u,l);return h.onDispose=()=>{this.pipelines.delete(h),this.bindings.delete(h),this.nodes.delete(h),c.delete(h.getChainArray())},h}}class ef{constructor(){this.data=new WeakMap}get(e){let t=this.data.get(e);return void 0===t&&(t={},this.data.set(e,t)),t}delete(e){let t=null;return this.data.has(e)&&(t=this.data.get(e),this.data.delete(e)),t}has(e){return this.data.has(e)}dispose(){this.data=new WeakMap}}const tf=1,rf=2,sf=3,nf=4,af=16;class of extends ef{constructor(e){super(),this.backend=e}delete(e){const t=super.delete(e);return null!==t&&this.backend.destroyAttribute(e),t}update(e,t){const r=this.get(e);if(void 0===r.version)t===tf?this.backend.createAttribute(e):t===rf?this.backend.createIndexAttribute(e):t===sf?this.backend.createStorageAttribute(e):t===nf&&this.backend.createIndirectStorageAttribute(e),r.version=this._getBufferAttribute(e).version;else{const t=this._getBufferAttribute(e);(r.version{this.info.memory.geometries--;const s=t.index,i=e.getAttributes();null!==s&&this.attributes.delete(s);for(const e of i)this.attributes.delete(e);const n=this.wireframes.get(t);void 0!==n&&this.attributes.delete(n),t.removeEventListener("dispose",r)};t.addEventListener("dispose",r)}updateAttributes(e){const t=e.getAttributes();for(const e of t)e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute?this.updateAttribute(e,sf):this.updateAttribute(e,tf);const r=this.getIndex(e);null!==r&&this.updateAttribute(r,rf);const s=e.geometry.indirect;null!==s&&this.updateAttribute(s,nf)}updateAttribute(e,t){const r=this.info.render.calls;e.isInterleavedBufferAttribute?void 0===this.attributeCall.get(e)?(this.attributes.update(e,t),this.attributeCall.set(e,r)):this.attributeCall.get(e.data)!==r&&(this.attributes.update(e,t),this.attributeCall.set(e.data,r),this.attributeCall.set(e,r)):this.attributeCall.get(e)!==r&&(this.attributes.update(e,t),this.attributeCall.set(e,r))}getIndirect(e){return e.geometry.indirect}getIndex(e){const{geometry:t,material:r}=e;let s=t.index;if(!0===r.wireframe){const e=this.wireframes;let r=e.get(t);void 0===r?(r=lf(t),e.set(t,r)):r.version!==uf(t)&&(this.attributes.delete(r),r=lf(t),e.set(t,r)),s=r}return s}}class cf{constructor(){this.autoReset=!0,this.frame=0,this.calls=0,this.render={calls:0,frameCalls:0,drawCalls:0,triangles:0,points:0,lines:0,timestamp:0},this.compute={calls:0,frameCalls:0,timestamp:0},this.memory={geometries:0,textures:0}}update(e,t,r){this.render.drawCalls++,e.isMesh||e.isSprite?this.render.triangles+=r*(t/3):e.isPoints?this.render.points+=r*t:e.isLineSegments?this.render.lines+=r*(t/2):e.isLine?this.render.lines+=r*(t-1):console.error("THREE.WebGPUInfo: Unknown object type.")}reset(){this.render.drawCalls=0,this.render.frameCalls=0,this.compute.frameCalls=0,this.render.triangles=0,this.render.points=0,this.render.lines=0}dispose(){this.reset(),this.calls=0,this.render.calls=0,this.compute.calls=0,this.render.timestamp=0,this.compute.timestamp=0,this.memory.geometries=0,this.memory.textures=0}}class hf{constructor(e){this.cacheKey=e,this.usedTimes=0}}class pf extends hf{constructor(e,t,r){super(e),this.vertexProgram=t,this.fragmentProgram=r}}class gf extends hf{constructor(e,t){super(e),this.computeProgram=t,this.isComputePipeline=!0}}let mf=0;class ff{constructor(e,t,r,s=null,i=null){this.id=mf++,this.code=e,this.stage=t,this.name=r,this.transforms=s,this.attributes=i,this.usedTimes=0}}class yf extends ef{constructor(e,t){super(),this.backend=e,this.nodes=t,this.bindings=null,this.caches=new Map,this.programs={vertex:new Map,fragment:new Map,compute:new Map}}getForCompute(e,t){const{backend:r}=this,s=this.get(e);if(this._needsComputeUpdate(e)){const i=s.pipeline;i&&(i.usedTimes--,i.computeProgram.usedTimes--);const n=this.nodes.getForCompute(e);let a=this.programs.compute.get(n.computeShader);void 0===a&&(i&&0===i.computeProgram.usedTimes&&this._releaseProgram(i.computeProgram),a=new ff(n.computeShader,"compute",e.name,n.transforms,n.nodeAttributes),this.programs.compute.set(n.computeShader,a),r.createProgram(a));const o=this._getComputeCacheKey(e,a);let u=this.caches.get(o);void 0===u&&(i&&0===i.usedTimes&&this._releasePipeline(i),u=this._getComputePipeline(e,a,o,t)),u.usedTimes++,a.usedTimes++,s.version=e.version,s.pipeline=u}return s.pipeline}getForRender(e,t=null){const{backend:r}=this,s=this.get(e);if(this._needsRenderUpdate(e)){const i=s.pipeline;i&&(i.usedTimes--,i.vertexProgram.usedTimes--,i.fragmentProgram.usedTimes--);const n=e.getNodeBuilderState(),a=e.material?e.material.name:"";let o=this.programs.vertex.get(n.vertexShader);void 0===o&&(i&&0===i.vertexProgram.usedTimes&&this._releaseProgram(i.vertexProgram),o=new ff(n.vertexShader,"vertex",a),this.programs.vertex.set(n.vertexShader,o),r.createProgram(o));let u=this.programs.fragment.get(n.fragmentShader);void 0===u&&(i&&0===i.fragmentProgram.usedTimes&&this._releaseProgram(i.fragmentProgram),u=new ff(n.fragmentShader,"fragment",a),this.programs.fragment.set(n.fragmentShader,u),r.createProgram(u));const l=this._getRenderCacheKey(e,o,u);let d=this.caches.get(l);void 0===d?(i&&0===i.usedTimes&&this._releasePipeline(i),d=this._getRenderPipeline(e,o,u,l,t)):e.pipeline=d,d.usedTimes++,o.usedTimes++,u.usedTimes++,s.pipeline=d}return s.pipeline}delete(e){const t=this.get(e).pipeline;return t&&(t.usedTimes--,0===t.usedTimes&&this._releasePipeline(t),t.isComputePipeline?(t.computeProgram.usedTimes--,0===t.computeProgram.usedTimes&&this._releaseProgram(t.computeProgram)):(t.fragmentProgram.usedTimes--,t.vertexProgram.usedTimes--,0===t.vertexProgram.usedTimes&&this._releaseProgram(t.vertexProgram),0===t.fragmentProgram.usedTimes&&this._releaseProgram(t.fragmentProgram))),super.delete(e)}dispose(){super.dispose(),this.caches=new Map,this.programs={vertex:new Map,fragment:new Map,compute:new Map}}updateForRender(e){this.getForRender(e)}_getComputePipeline(e,t,r,s){r=r||this._getComputeCacheKey(e,t);let i=this.caches.get(r);return void 0===i&&(i=new gf(r,t),this.caches.set(r,i),this.backend.createComputePipeline(i,s)),i}_getRenderPipeline(e,t,r,s,i){s=s||this._getRenderCacheKey(e,t,r);let n=this.caches.get(s);return void 0===n&&(n=new pf(s,t,r),this.caches.set(s,n),e.pipeline=n,this.backend.createRenderPipeline(e,i)),n}_getComputeCacheKey(e,t){return e.id+","+t.id}_getRenderCacheKey(e,t,r){return t.id+","+r.id+","+this.backend.getRenderCacheKey(e)}_releasePipeline(e){this.caches.delete(e.cacheKey)}_releaseProgram(e){const t=e.code,r=e.stage;this.programs[r].delete(t)}_needsComputeUpdate(e){const t=this.get(e);return void 0===t.pipeline||t.version!==e.version}_needsRenderUpdate(e){return void 0===this.get(e).pipeline||this.backend.needsRenderUpdate(e)}}class bf extends ef{constructor(e,t,r,s,i,n){super(),this.backend=e,this.textures=r,this.pipelines=i,this.attributes=s,this.nodes=t,this.info=n,this.pipelines.bindings=this}getForRender(e){const t=e.getBindings();for(const e of t){const r=this.get(e);void 0===r.bindGroup&&(this._init(e),this.backend.createBindings(e,t,0),r.bindGroup=e)}return t}getForCompute(e){const t=this.nodes.getForCompute(e).bindings;for(const e of t){const r=this.get(e);void 0===r.bindGroup&&(this._init(e),this.backend.createBindings(e,t,0),r.bindGroup=e)}return t}updateForCompute(e){this._updateBindings(this.getForCompute(e))}updateForRender(e){this._updateBindings(this.getForRender(e))}_updateBindings(e){for(const t of e)this._update(t,e)}_init(e){for(const t of e.bindings)if(t.isSampledTexture)this.textures.updateTexture(t.texture);else if(t.isStorageBuffer){const e=t.attribute,r=e.isIndirectStorageBufferAttribute?nf:sf;this.attributes.update(e,r)}}_update(e,t){const{backend:r}=this;let s=!1,i=!0,n=0,a=0;for(const t of e.bindings){if(t.isNodeUniformsGroup){if(!1===this.nodes.updateGroup(t))continue}if(t.isStorageBuffer){const e=t.attribute,r=e.isIndirectStorageBufferAttribute?nf:sf;this.attributes.update(e,r)}if(t.isUniformBuffer){t.update()&&r.updateBinding(t)}else if(t.isSampler)t.update();else if(t.isSampledTexture){const e=this.textures.get(t.texture);t.needsBindingsUpdate(e.generation)&&(s=!0);const o=t.update(),u=t.texture;o&&this.textures.updateTexture(u);const l=r.get(u);if(void 0!==l.externalTexture||e.isDefaultTexture?i=!1:(n=10*n+u.id,a+=u.version),!0===r.isWebGPUBackend&&void 0===l.texture&&void 0===l.externalTexture&&(console.error("Bindings._update: binding should be available:",t,o,u,t.textureNode.value,s),this.textures.updateTexture(u),s=!0),!0===u.isStorageTexture){const e=this.get(u);!0===t.store?e.needsMipmap=!0:this.textures.needsMipmaps(u)&&!0===e.needsMipmap&&(this.backend.generateMipmaps(u),e.needsMipmap=!1)}}}!0===s&&this.backend.updateBindings(e,t,i?n:0,a)}}function xf(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?e.z-t.z:e.id-t.id}function Tf(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function _f(e){return(e.transmission>0||e.transmissionNode)&&e.side===Se&&!1===e.forceSinglePass}class vf{constructor(e,t,r){this.renderItems=[],this.renderItemsIndex=0,this.opaque=[],this.transparentDoublePass=[],this.transparent=[],this.bundles=[],this.lightsNode=e.getNode(t,r),this.lightsArray=[],this.scene=t,this.camera=r,this.occlusionQueryCount=0}begin(){return this.renderItemsIndex=0,this.opaque.length=0,this.transparentDoublePass.length=0,this.transparent.length=0,this.bundles.length=0,this.lightsArray.length=0,this.occlusionQueryCount=0,this}getNextRenderItem(e,t,r,s,i,n,a){let o=this.renderItems[this.renderItemsIndex];return void 0===o?(o={id:e.id,object:e,geometry:t,material:r,groupOrder:s,renderOrder:e.renderOrder,z:i,group:n,clippingContext:a},this.renderItems[this.renderItemsIndex]=o):(o.id=e.id,o.object=e,o.geometry=t,o.material=r,o.groupOrder=s,o.renderOrder=e.renderOrder,o.z=i,o.group=n,o.clippingContext=a),this.renderItemsIndex++,o}push(e,t,r,s,i,n,a){const o=this.getNextRenderItem(e,t,r,s,i,n,a);!0===e.occlusionTest&&this.occlusionQueryCount++,!0===r.transparent||r.transmission>0?(_f(r)&&this.transparentDoublePass.push(o),this.transparent.push(o)):this.opaque.push(o)}unshift(e,t,r,s,i,n,a){const o=this.getNextRenderItem(e,t,r,s,i,n,a);!0===r.transparent||r.transmission>0?(_f(r)&&this.transparentDoublePass.unshift(o),this.transparent.unshift(o)):this.opaque.unshift(o)}pushBundle(e){this.bundles.push(e)}pushLight(e){this.lightsArray.push(e)}sort(e,t){this.opaque.length>1&&this.opaque.sort(e||xf),this.transparentDoublePass.length>1&&this.transparentDoublePass.sort(t||Tf),this.transparent.length>1&&this.transparent.sort(t||Tf)}finish(){this.lightsNode.setLights(this.lightsArray);for(let e=this.renderItemsIndex,t=this.renderItems.length;e>t,u=a.height>>t;let l=e.depthTexture||i[t];const d=!0===e.depthBuffer||!0===e.stencilBuffer;let c=!1;void 0===l&&d&&(l=new V,l.format=e.stencilBuffer?we:Ae,l.type=e.stencilBuffer?Re:T,l.image.width=o,l.image.height=u,l.image.depth=a.depth,l.isArrayTexture=!0===e.multiview&&a.depth>1,i[t]=l),r.width===a.width&&a.height===r.height||(c=!0,l&&(l.needsUpdate=!0,l.image.width=o,l.image.height=u,l.image.depth=l.isArrayTexture?l.image.depth:1)),r.width=a.width,r.height=a.height,r.textures=n,r.depthTexture=l||null,r.depth=e.depthBuffer,r.stencil=e.stencilBuffer,r.renderTarget=e,r.sampleCount!==s&&(c=!0,l&&(l.needsUpdate=!0),r.sampleCount=s);const h={sampleCount:s};if(!0!==e.isXRRenderTarget){for(let e=0;e{e.removeEventListener("dispose",t);for(let e=0;e0){const s=e.image;if(void 0===s)console.warn("THREE.Renderer: Texture marked for update but image is undefined.");else if(!1===s.complete)console.warn("THREE.Renderer: Texture marked for update but image is incomplete.");else{if(e.images){const r=[];for(const t of e.images)r.push(t);t.images=r}else t.image=s;void 0!==r.isDefaultTexture&&!0!==r.isDefaultTexture||(i.createTexture(e,t),r.isDefaultTexture=!1,r.generation=e.version),!0===e.source.dataReady&&i.updateTexture(e,t),t.needsMipmaps&&0===e.mipmaps.length&&i.generateMipmaps(e)}}else i.createDefaultTexture(e),r.isDefaultTexture=!0,r.generation=e.version}if(!0!==r.initialized){r.initialized=!0,r.generation=e.version,this.info.memory.textures++;const t=()=>{e.removeEventListener("dispose",t),this._destroyTexture(e)};e.addEventListener("dispose",t)}r.version=e.version}getSize(e,t=Ff){let r=e.images?e.images[0]:e.image;return r?(void 0!==r.image&&(r=r.image),t.width=r.width||1,t.height=r.height||1,t.depth=e.isCubeTexture?6:r.depth||1):t.width=t.height=t.depth=1,t}getMipLevels(e,t,r){let s;return s=e.isCompressedTexture?e.mipmaps?e.mipmaps.length:1:Math.floor(Math.log2(Math.max(t,r)))+1,s}needsMipmaps(e){return!0===e.isCompressedTexture||e.generateMipmaps}_destroyTexture(e){!0===this.has(e)&&(this.backend.destroySampler(e),this.backend.destroyTexture(e),this.delete(e),this.info.memory.textures--)}}class Bf extends e{constructor(e,t,r,s=1){super(e,t,r),this.a=s}set(e,t,r,s=1){return this.a=s,super.set(e,t,r)}copy(e){return void 0!==e.a&&(this.a=e.a),super.copy(e)}clone(){return new this.constructor(this.r,this.g,this.b,this.a)}}class If extends gn{static get type(){return"ParameterNode"}constructor(e,t=null){super(e,t),this.isParameterNode=!0}getHash(){return this.uuid}generate(){return this.name}}class Df extends js{static get type(){return"StackNode"}constructor(e=null){super(),this.nodes=[],this.outputNode=null,this.parent=e,this._currentCond=null,this._expressionNode=null,this.isStackNode=!0}getNodeType(e){return this.outputNode?this.outputNode.getNodeType(e):"void"}getMemberType(e,t){return this.outputNode?this.outputNode.getMemberType(e,t):"void"}add(e){return this.nodes.push(e),this}If(e,t){const r=new Li(t);return this._currentCond=Xo(e,r),this.add(this._currentCond)}ElseIf(e,t){const r=new Li(t),s=Xo(e,r);return this._currentCond.elseNode=s,this._currentCond=s,this}Else(e){return this._currentCond.elseNode=new Li(e),this}Switch(e){return this._expressionNode=Bi(e),this}Case(...e){const t=[];if(!(e.length>=2))throw new Error("TSL: Invalid parameter length. Case() requires at least two parameters.");for(let r=0;r"string"==typeof t?{name:e,type:t,atomic:!1}:{name:e,type:t.type,atomic:t.atomic||!1}))),this.name=t,this.isStructLayoutNode=!0}getLength(){const e=Float32Array.BYTES_PER_ELEMENT;let t=0;for(const r of this.membersLayout){const s=r.type,i=Rs(s)*e,n=t%8,a=n%Cs(s),o=n+a;t+=a,0!==o&&8-oe.name===t));return r?r.type:"void"}getNodeType(e){return e.getStructTypeFromNode(this,this.membersLayout,this.name).name}setup(e){e.addInclude(this)}generate(e){return this.getNodeType(e)}}class Of extends js{static get type(){return"StructNode"}constructor(e,t){super("vec3"),this.structLayoutNode=e,this.values=t,this.isStructNode=!0}getNodeType(e){return this.structLayoutNode.getNodeType(e)}getMemberType(e,t){return this.structLayoutNode.getMemberType(e,t)}generate(e){const t=e.getVarFromNode(this),r=t.type,s=e.getPropertyName(t);return e.addLineFlowCode(`${s} = ${e.generateStruct(r,this.structLayoutNode.membersLayout,this.values)}`,this),t.name}}class kf extends js{static get type(){return"OutputStructNode"}constructor(...e){super(),this.members=e,this.isOutputStructNode=!0}getNodeType(e){const t=e.getNodeProperties(this);if(void 0===t.membersLayout){const r=this.members,s=[];for(let t=0;t{const t=e.toUint().mul(747796405).add(2891336453),r=t.shiftRight(t.shiftRight(28).add(4)).bitXor(t).mul(277803737);return r.shiftRight(22).bitXor(r).toFloat().mul(1/2**32)})),jf=(e,t)=>Ro(la(4,e.mul(ua(1,e))),t),qf=ki((([e])=>e.fract().sub(.5).abs())).setLayout({name:"tri",type:"float",inputs:[{name:"x",type:"float"}]}),Xf=ki((([e])=>en(qf(e.z.add(qf(e.y.mul(1)))),qf(e.z.add(qf(e.x.mul(1)))),qf(e.y.add(qf(e.x.mul(1))))))).setLayout({name:"tri3",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),Kf=ki((([e,t,r])=>{const s=en(e).toVar(),i=ji(1.4).toVar(),n=ji(0).toVar(),a=en(s).toVar();return Zc({start:ji(0),end:ji(3),type:"float",condition:"<="},(()=>{const e=en(Xf(a.mul(2))).toVar();s.addAssign(e.add(r.mul(ji(.1).mul(t)))),a.mulAssign(1.8),i.mulAssign(1.5),s.mulAssign(1.2);const o=ji(qf(s.z.add(qf(s.x.add(qf(s.y)))))).toVar();n.addAssign(o.div(i)),a.addAssign(.14)})),n})).setLayout({name:"triNoise3D",type:"float",inputs:[{name:"position",type:"vec3"},{name:"speed",type:"float"},{name:"time",type:"float"}]});class Yf extends js{static get type(){return"FunctionOverloadingNode"}constructor(e=[],...t){super(),this.functionNodes=e,this.parametersNodes=t,this._candidateFnCall=null,this.global=!0}getNodeType(){return this.functionNodes[0].shaderNode.layout.type}setup(e){const t=this.parametersNodes;let r=this._candidateFnCall;if(null===r){let s=null,i=-1;for(const r of this.functionNodes){const n=r.shaderNode.layout;if(null===n)throw new Error("FunctionOverloadingNode: FunctionNode must be a layout.");const a=n.inputs;if(t.length===a.length){let n=0;for(let r=0;ri&&(s=r,i=n)}}this._candidateFnCall=r=s(...t)}return r}}const Qf=Vi(Yf),Zf=e=>(...t)=>Qf(e,...t),Jf=Zn(0).setGroup(Kn).onRenderUpdate((e=>e.time)),ey=Zn(0).setGroup(Kn).onRenderUpdate((e=>e.deltaTime)),ty=Zn(0,"uint").setGroup(Kn).onRenderUpdate((e=>e.frameId)),ry=ki((([e,t,r=Yi(.5)])=>Im(e.sub(r),t).add(r))),sy=ki((([e,t,r=Yi(.5)])=>{const s=e.sub(r),i=s.dot(s),n=i.mul(i).mul(t);return e.add(s.mul(n))})),iy=ki((({position:e=null,horizontal:t=!0,vertical:r=!1})=>{let s;null!==e?(s=El.toVar(),s[3][0]=e.x,s[3][1]=e.y,s[3][2]=e.z):s=El;const i=cl.mul(s);return Pi(t)&&(i[0][0]=El[0].length(),i[0][1]=0,i[0][2]=0),Pi(r)&&(i[1][0]=0,i[1][1]=El[1].length(),i[1][2]=0),i[2][0]=0,i[2][1]=0,i[2][2]=1,ll.mul(i).mul(Vl)})),ny=ki((([e=null])=>{const t=Vh();return Vh(Ch(e)).sub(t).lessThan(0).select(ph,e)}));class ay extends js{static get type(){return"SpriteSheetUVNode"}constructor(e,t=$u(),r=ji(0)){super("vec2"),this.countNode=e,this.uvNode=t,this.frameNode=r}setup(){const{frameNode:e,uvNode:t,countNode:r}=this,{width:s,height:i}=r,n=e.mod(s.mul(i)).floor(),a=n.mod(s),o=i.sub(n.add(1).div(s).ceil()),u=r.reciprocal(),l=Yi(a,o);return t.add(l).mul(u)}}const oy=Vi(ay).setParameterLength(3);class uy extends js{static get type(){return"TriplanarTexturesNode"}constructor(e,t=null,r=null,s=ji(1),i=Vl,n=ql){super("vec4"),this.textureXNode=e,this.textureYNode=t,this.textureZNode=r,this.scaleNode=s,this.positionNode=i,this.normalNode=n}setup(){const{textureXNode:e,textureYNode:t,textureZNode:r,scaleNode:s,positionNode:i,normalNode:n}=this;let a=n.abs().normalize();a=a.div(a.dot(en(1)));const o=i.yz.mul(s),u=i.zx.mul(s),l=i.xy.mul(s),d=e.value,c=null!==t?t.value:d,h=null!==r?r.value:d,p=Zu(d,o).mul(a.x),g=Zu(c,u).mul(a.y),m=Zu(h,l).mul(a.z);return oa(p,g,m)}}const ly=Vi(uy).setParameterLength(1,6),dy=new Me,cy=new r,hy=new r,py=new r,gy=new a,my=new r(0,0,-1),fy=new s,yy=new r,by=new r,xy=new s,Ty=new t,_y=new oe,vy=ph.flipX();_y.depthTexture=new V(1,1);let Ny=!1;class Sy extends Yu{static get type(){return"ReflectorNode"}constructor(e={}){super(e.defaultTexture||_y.texture,vy),this._reflectorBaseNode=e.reflector||new Ey(this,e),this._depthNode=null,this.setUpdateMatrix(!1)}get reflector(){return this._reflectorBaseNode}get target(){return this._reflectorBaseNode.target}getDepthNode(){if(null===this._depthNode){if(!0!==this._reflectorBaseNode.depth)throw new Error("THREE.ReflectorNode: Depth node can only be requested when the reflector is created with { depth: true }. ");this._depthNode=Bi(new Sy({defaultTexture:_y.depthTexture,reflector:this._reflectorBaseNode}))}return this._depthNode}setup(e){return e.object.isQuadMesh||this._reflectorBaseNode.build(e),super.setup(e)}clone(){const e=new this.constructor(this.reflectorNode);return e._reflectorBaseNode=this._reflectorBaseNode,e}dispose(){super.dispose(),this._reflectorBaseNode.dispose()}}class Ey extends js{static get type(){return"ReflectorBaseNode"}constructor(e,t={}){super();const{target:r=new Pe,resolution:s=1,generateMipmaps:i=!1,bounces:n=!0,depth:a=!1}=t;this.textureNode=e,this.target=r,this.resolution=s,this.generateMipmaps=i,this.bounces=n,this.depth=a,this.updateBeforeType=n?Vs.RENDER:Vs.FRAME,this.virtualCameras=new WeakMap,this.renderTargets=new Map,this.forceUpdate=!1,this.hasOutput=!1}_updateResolution(e,t){const r=this.resolution;t.getDrawingBufferSize(Ty),e.setSize(Math.round(Ty.width*r),Math.round(Ty.height*r))}setup(e){return this._updateResolution(_y,e.renderer),super.setup(e)}dispose(){super.dispose();for(const e of this.renderTargets.values())e.dispose()}getVirtualCamera(e){let t=this.virtualCameras.get(e);return void 0===t&&(t=e.clone(),this.virtualCameras.set(e,t)),t}getRenderTarget(e){let t=this.renderTargets.get(e);return void 0===t&&(t=new oe(0,0,{type:de}),!0===this.generateMipmaps&&(t.texture.minFilter=Fe,t.texture.generateMipmaps=!0),!0===this.depth&&(t.depthTexture=new V),this.renderTargets.set(e,t)),t}updateBefore(e){if(!1===this.bounces&&Ny)return!1;Ny=!0;const{scene:t,camera:r,renderer:s,material:i}=e,{target:n}=this,a=this.getVirtualCamera(r),o=this.getRenderTarget(a);s.getDrawingBufferSize(Ty),this._updateResolution(o,s),hy.setFromMatrixPosition(n.matrixWorld),py.setFromMatrixPosition(r.matrixWorld),gy.extractRotation(n.matrixWorld),cy.set(0,0,1),cy.applyMatrix4(gy),yy.subVectors(hy,py);let u=!1;if(!0===yy.dot(cy)>0&&!1===this.forceUpdate){if(!1===this.hasOutput)return void(Ny=!1);u=!0}yy.reflect(cy).negate(),yy.add(hy),gy.extractRotation(r.matrixWorld),my.set(0,0,-1),my.applyMatrix4(gy),my.add(py),by.subVectors(hy,my),by.reflect(cy).negate(),by.add(hy),a.coordinateSystem=r.coordinateSystem,a.position.copy(yy),a.up.set(0,1,0),a.up.applyMatrix4(gy),a.up.reflect(cy),a.lookAt(by),a.near=r.near,a.far=r.far,a.updateMatrixWorld(),a.projectionMatrix.copy(r.projectionMatrix),dy.setFromNormalAndCoplanarPoint(cy,hy),dy.applyMatrix4(a.matrixWorldInverse),fy.set(dy.normal.x,dy.normal.y,dy.normal.z,dy.constant);const l=a.projectionMatrix;xy.x=(Math.sign(fy.x)+l.elements[8])/l.elements[0],xy.y=(Math.sign(fy.y)+l.elements[9])/l.elements[5],xy.z=-1,xy.w=(1+l.elements[10])/l.elements[14],fy.multiplyScalar(1/fy.dot(xy));l.elements[2]=fy.x,l.elements[6]=fy.y,l.elements[10]=s.coordinateSystem===d?fy.z-0:fy.z+1-0,l.elements[14]=fy.w,this.textureNode.value=o.texture,!0===this.depth&&(this.textureNode.getDepthNode().value=o.depthTexture),i.visible=!1;const c=s.getRenderTarget(),h=s.getMRT(),p=s.autoClear;s.setMRT(null),s.setRenderTarget(o),s.autoClear=!0,u?(s.clear(),this.hasOutput=!1):(s.render(t,a),this.hasOutput=!0),s.setMRT(h),s.setRenderTarget(c),s.autoClear=p,i.visible=!0,Ny=!1,this.forceUpdate=!1}}const wy=new ne(-1,1,1,-1,0,1);class Ay extends he{constructor(e=!1){super();const t=!1===e?[0,-1,0,1,2,1]:[0,2,0,0,2,0];this.setAttribute("position",new Le([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Le(t,2))}}const Ry=new Ay;class Cy extends q{constructor(e=null){super(Ry,e),this.camera=wy,this.isQuadMesh=!0}async renderAsync(e){return e.renderAsync(this,wy)}render(e){e.render(this,wy)}}const My=new t;class Py extends Yu{static get type(){return"RTTNode"}constructor(e,t=null,r=null,s={type:de}){const i=new oe(t,r,s);super(i.texture,$u()),this.node=e,this.width=t,this.height=r,this.pixelRatio=1,this.renderTarget=i,this.textureNeedsUpdate=!0,this.autoUpdate=!0,this._rttNode=null,this._quadMesh=new Cy(new Zh),this.updateBeforeType=Vs.RENDER}get autoSize(){return null===this.width}setup(e){return this._rttNode=this.node.context(e.getSharedContext()),this._quadMesh.material.name="RTT",this._quadMesh.material.needsUpdate=!0,super.setup(e)}setSize(e,t){this.width=e,this.height=t;const r=e*this.pixelRatio,s=t*this.pixelRatio;this.renderTarget.setSize(r,s),this.textureNeedsUpdate=!0}setPixelRatio(e){this.pixelRatio=e,this.setSize(this.width,this.height)}updateBefore({renderer:e}){if(!1===this.textureNeedsUpdate&&!1===this.autoUpdate)return;if(this.textureNeedsUpdate=!1,!0===this.autoSize){this.pixelRatio=e.getPixelRatio();const t=e.getSize(My);this.setSize(t.width,t.height)}this._quadMesh.material.fragmentNode=this._rttNode;const t=e.getRenderTarget();e.setRenderTarget(this.renderTarget),this._quadMesh.render(e),e.setRenderTarget(t)}clone(){const e=new Yu(this.value,this.uvNode,this.levelNode);return e.sampler=this.sampler,e.referenceNode=this,e}}const Fy=(e,...t)=>Bi(new Py(Bi(e),...t)),Ly=ki((([e,t,r],s)=>{let i;s.renderer.coordinateSystem===d?(e=Yi(e.x,e.y.oneMinus()).mul(2).sub(1),i=nn(en(e,t),1)):i=nn(en(e.x,e.y.oneMinus(),t).mul(2).sub(1),1);const n=nn(r.mul(i));return n.xyz.div(n.w)})),By=ki((([e,t])=>{const r=t.mul(nn(e,1)),s=r.xy.div(r.w).mul(.5).add(.5).toVar();return Yi(s.x,s.y.oneMinus())})),Iy=ki((([e,t,r])=>{const s=ju(Ju(t)),i=Qi(e.mul(s)).toVar(),n=Ju(t,i).toVar(),a=Ju(t,i.sub(Qi(2,0))).toVar(),o=Ju(t,i.sub(Qi(1,0))).toVar(),u=Ju(t,i.add(Qi(1,0))).toVar(),l=Ju(t,i.add(Qi(2,0))).toVar(),d=Ju(t,i.add(Qi(0,2))).toVar(),c=Ju(t,i.add(Qi(0,1))).toVar(),h=Ju(t,i.sub(Qi(0,1))).toVar(),p=Ju(t,i.sub(Qi(0,2))).toVar(),g=no(ua(ji(2).mul(o).sub(a),n)).toVar(),m=no(ua(ji(2).mul(u).sub(l),n)).toVar(),f=no(ua(ji(2).mul(c).sub(d),n)).toVar(),y=no(ua(ji(2).mul(h).sub(p),n)).toVar(),b=Ly(e,n,r).toVar(),x=g.lessThan(m).select(b.sub(Ly(e.sub(Yi(ji(1).div(s.x),0)),o,r)),b.negate().add(Ly(e.add(Yi(ji(1).div(s.x),0)),u,r))),T=f.lessThan(y).select(b.sub(Ly(e.add(Yi(0,ji(1).div(s.y))),c,r)),b.negate().add(Ly(e.sub(Yi(0,ji(1).div(s.y))),h,r)));return Qa(Ao(x,T))}));class Dy extends F{constructor(e,t,r=Float32Array){super(ArrayBuffer.isView(e)?e:new r(e*t),t),this.isStorageInstancedBufferAttribute=!0}}class Vy extends pe{constructor(e,t,r=Float32Array){super(ArrayBuffer.isView(e)?e:new r(e*t),t),this.isStorageBufferAttribute=!0}}class Uy extends js{static get type(){return"PointUVNode"}constructor(){super("vec2"),this.isPointUVNode=!0}generate(){return"vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y )"}}const Oy=Ui(Uy),ky=new E,Gy=new a;class zy extends js{static get type(){return"SceneNode"}constructor(e=zy.BACKGROUND_BLURRINESS,t=null){super(),this.scope=e,this.scene=t}setup(e){const t=this.scope,r=null!==this.scene?this.scene:e.scene;let s;return t===zy.BACKGROUND_BLURRINESS?s=yd("backgroundBlurriness","float",r):t===zy.BACKGROUND_INTENSITY?s=yd("backgroundIntensity","float",r):t===zy.BACKGROUND_ROTATION?s=Zn("mat4").label("backgroundRotation").setGroup(Kn).onRenderUpdate((()=>{const e=r.background;return null!==e&&e.isTexture&&e.mapping!==Be?(ky.copy(r.backgroundRotation),ky.x*=-1,ky.y*=-1,ky.z*=-1,Gy.makeRotationFromEuler(ky)):Gy.identity(),Gy})):console.error("THREE.SceneNode: Unknown scope:",t),s}}zy.BACKGROUND_BLURRINESS="backgroundBlurriness",zy.BACKGROUND_INTENSITY="backgroundIntensity",zy.BACKGROUND_ROTATION="backgroundRotation";const Hy=Ui(zy,zy.BACKGROUND_BLURRINESS),$y=Ui(zy,zy.BACKGROUND_INTENSITY),Wy=Ui(zy,zy.BACKGROUND_ROTATION);class jy extends Yu{static get type(){return"StorageTextureNode"}constructor(e,t,r=null){super(e,t),this.storeNode=r,this.isStorageTextureNode=!0,this.access=Os.WRITE_ONLY}getInputType(){return"storageTexture"}setup(e){super.setup(e);const t=e.getNodeProperties(this);return t.storeNode=this.storeNode,t}setAccess(e){return this.access=e,this}generate(e,t){let r;return r=null!==this.storeNode?this.generateStore(e):super.generate(e,t),r}toReadWrite(){return this.setAccess(Os.READ_WRITE)}toReadOnly(){return this.setAccess(Os.READ_ONLY)}toWriteOnly(){return this.setAccess(Os.WRITE_ONLY)}generateStore(e){const t=e.getNodeProperties(this),{uvNode:r,storeNode:s,depthNode:i}=t,n=super.generate(e,"property"),a=r.build(e,"uvec2"),o=s.build(e,"vec4"),u=i?i.build(e,"int"):null,l=e.generateTextureStore(e,n,a,u,o);e.addLineFlowCode(l,this)}clone(){const e=super.clone();return e.storeNode=this.storeNode,e}}const qy=Vi(jy).setParameterLength(1,3),Xy=ki((({texture:e,uv:t})=>{const r=1e-4,s=en().toVar();return Hi(t.x.lessThan(r),(()=>{s.assign(en(1,0,0))})).ElseIf(t.y.lessThan(r),(()=>{s.assign(en(0,1,0))})).ElseIf(t.z.lessThan(r),(()=>{s.assign(en(0,0,1))})).ElseIf(t.x.greaterThan(.9999),(()=>{s.assign(en(-1,0,0))})).ElseIf(t.y.greaterThan(.9999),(()=>{s.assign(en(0,-1,0))})).ElseIf(t.z.greaterThan(.9999),(()=>{s.assign(en(0,0,-1))})).Else((()=>{const r=.01,i=e.sample(t.add(en(-.01,0,0))).r.sub(e.sample(t.add(en(r,0,0))).r),n=e.sample(t.add(en(0,-.01,0))).r.sub(e.sample(t.add(en(0,r,0))).r),a=e.sample(t.add(en(0,0,-.01))).r.sub(e.sample(t.add(en(0,0,r))).r);s.assign(en(i,n,a))})),s.normalize()}));class Ky extends Yu{static get type(){return"Texture3DNode"}constructor(e,t=null,r=null){super(e,t,r),this.isTexture3DNode=!0}getInputType(){return"texture3D"}getDefaultUV(){return en(.5,.5,.5)}setUpdateMatrix(){}setupUV(e,t){const r=this.value;return!e.isFlipY()||!0!==r.isRenderTargetTexture&&!0!==r.isFramebufferTexture||(t=this.sampler?t.flipY():t.setY(qi(ju(this,this.levelNode).y).sub(t.y).sub(1))),t}generateUV(e,t){return t.build(e,"vec3")}normal(e){return Xy({texture:this,uv:e})}}const Yy=Vi(Ky).setParameterLength(1,3);class Qy extends fd{static get type(){return"UserDataNode"}constructor(e,t,r=null){super(e,t,r),this.userData=r}updateReference(e){return this.reference=null!==this.userData?this.userData:e.object.userData,this.reference}}const Zy=new WeakMap;class Jy extends Ks{static get type(){return"VelocityNode"}constructor(){super("vec2"),this.projectionMatrix=null,this.updateType=Vs.OBJECT,this.updateAfterType=Vs.OBJECT,this.previousModelWorldMatrix=Zn(new a),this.previousProjectionMatrix=Zn(new a).setGroup(Kn),this.previousCameraViewMatrix=Zn(new a)}setProjectionMatrix(e){this.projectionMatrix=e}update({frameId:e,camera:t,object:r}){const s=tb(r);this.previousModelWorldMatrix.value.copy(s);const i=eb(t);i.frameId!==e&&(i.frameId=e,void 0===i.previousProjectionMatrix?(i.previousProjectionMatrix=new a,i.previousCameraViewMatrix=new a,i.currentProjectionMatrix=new a,i.currentCameraViewMatrix=new a,i.previousProjectionMatrix.copy(this.projectionMatrix||t.projectionMatrix),i.previousCameraViewMatrix.copy(t.matrixWorldInverse)):(i.previousProjectionMatrix.copy(i.currentProjectionMatrix),i.previousCameraViewMatrix.copy(i.currentCameraViewMatrix)),i.currentProjectionMatrix.copy(this.projectionMatrix||t.projectionMatrix),i.currentCameraViewMatrix.copy(t.matrixWorldInverse),this.previousProjectionMatrix.value.copy(i.previousProjectionMatrix),this.previousCameraViewMatrix.value.copy(i.previousCameraViewMatrix))}updateAfter({object:e}){tb(e).copy(e.matrixWorld)}setup(){const e=null===this.projectionMatrix?ll:Zn(this.projectionMatrix),t=this.previousCameraViewMatrix.mul(this.previousModelWorldMatrix),r=e.mul(Fl).mul(Vl),s=this.previousProjectionMatrix.mul(t).mul(Ul),i=r.xy.div(r.w),n=s.xy.div(s.w);return ua(i,n)}}function eb(e){let t=Zy.get(e);return void 0===t&&(t={},Zy.set(e,t)),t}function tb(e,t=0){const r=eb(e);let s=r[t];return void 0===s&&(r[t]=s=new a,r[t].copy(e.matrixWorld)),s}const rb=Ui(Jy),sb=ki((([e])=>ob(e.rgb))),ib=ki((([e,t=ji(1)])=>t.mix(ob(e.rgb),e.rgb))),nb=ki((([e,t=ji(1)])=>{const r=oa(e.r,e.g,e.b).div(3),s=e.r.max(e.g.max(e.b)),i=s.sub(r).mul(t).mul(-3);return Io(e.rgb,s,i)})),ab=ki((([e,t=ji(1)])=>{const r=en(.57735,.57735,.57735),s=t.cos();return en(e.rgb.mul(s).add(r.cross(e.rgb).mul(t.sin()).add(r.mul(wo(r,e.rgb).mul(s.oneMinus())))))})),ob=(e,t=en(c.getLuminanceCoefficients(new r)))=>wo(e,t),ub=ki((([e,t=en(1),s=en(0),i=en(1),n=ji(1),a=en(c.getLuminanceCoefficients(new r,ue))])=>{const o=e.rgb.dot(en(a)),u=_o(e.rgb.mul(t).add(s),0).toVar(),l=u.pow(i).toVar();return Hi(u.r.greaterThan(0),(()=>{u.r.assign(l.r)})),Hi(u.g.greaterThan(0),(()=>{u.g.assign(l.g)})),Hi(u.b.greaterThan(0),(()=>{u.b.assign(l.b)})),u.assign(o.add(u.sub(o).mul(n))),nn(u.rgb,e.a)}));class lb extends Ks{static get type(){return"PosterizeNode"}constructor(e,t){super(),this.sourceNode=e,this.stepsNode=t}setup(){const{sourceNode:e,stepsNode:t}=this;return e.mul(t).floor().div(t)}}const db=Vi(lb).setParameterLength(2),cb=new t;class hb extends Yu{static get type(){return"PassTextureNode"}constructor(e,t){super(t),this.passNode=e,this.setUpdateMatrix(!1)}setup(e){return e.object.isQuadMesh&&this.passNode.build(e),super.setup(e)}clone(){return new this.constructor(this.passNode,this.value)}}class pb extends hb{static get type(){return"PassMultipleTextureNode"}constructor(e,t,r=!1){super(e,null),this.textureName=t,this.previousTexture=r}updateTexture(){this.value=this.previousTexture?this.passNode.getPreviousTexture(this.textureName):this.passNode.getTexture(this.textureName)}setup(e){return this.updateTexture(),super.setup(e)}clone(){return new this.constructor(this.passNode,this.textureName,this.previousTexture)}}class gb extends Ks{static get type(){return"PassNode"}constructor(e,t,r,s={}){super("vec4"),this.scope=e,this.scene=t,this.camera=r,this.options=s,this._pixelRatio=1,this._width=1,this._height=1;const i=new V;i.isRenderTargetTexture=!0,i.name="depth";const n=new oe(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:de,...s});n.texture.name="output",n.depthTexture=i,this.renderTarget=n,this._textures={output:n.texture,depth:i},this._textureNodes={},this._linearDepthNodes={},this._viewZNodes={},this._previousTextures={},this._previousTextureNodes={},this._cameraNear=Zn(0),this._cameraFar=Zn(0),this._mrt=null,this._layers=null,this._resolution=1,this.isPassNode=!0,this.updateBeforeType=Vs.FRAME,this.global=!0}setResolution(e){return this._resolution=e,this}getResolution(){return this._resolution}setLayers(e){return this._layers=e,this}getLayers(){return this._layers}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}getTexture(e){let t=this._textures[e];if(void 0===t){t=this.renderTarget.texture.clone(),t.name=e,this._textures[e]=t,this.renderTarget.textures.push(t)}return t}getPreviousTexture(e){let t=this._previousTextures[e];return void 0===t&&(t=this.getTexture(e).clone(),this._previousTextures[e]=t),t}toggleTexture(e){const t=this._previousTextures[e];if(void 0!==t){const r=this._textures[e],s=this.renderTarget.textures.indexOf(r);this.renderTarget.textures[s]=t,this._textures[e]=t,this._previousTextures[e]=r,this._textureNodes[e].updateTexture(),this._previousTextureNodes[e].updateTexture()}}getTextureNode(e="output"){let t=this._textureNodes[e];return void 0===t&&(t=Bi(new pb(this,e)),t.updateTexture(),this._textureNodes[e]=t),t}getPreviousTextureNode(e="output"){let t=this._previousTextureNodes[e];return void 0===t&&(void 0===this._textureNodes[e]&&this.getTextureNode(e),t=Bi(new pb(this,e,!0)),t.updateTexture(),this._previousTextureNodes[e]=t),t}getViewZNode(e="depth"){let t=this._viewZNodes[e];if(void 0===t){const r=this._cameraNear,s=this._cameraFar;this._viewZNodes[e]=t=Lh(this.getTextureNode(e),r,s)}return t}getLinearDepthNode(e="depth"){let t=this._linearDepthNodes[e];if(void 0===t){const r=this._cameraNear,s=this._cameraFar,i=this.getViewZNode(e);this._linearDepthNodes[e]=t=Ph(i,r,s)}return t}setup({renderer:e}){return this.renderTarget.samples=void 0===this.options.samples?e.samples:this.options.samples,this.renderTarget.texture.type=e.getColorBufferType(),this.scope===gb.COLOR?this.getTextureNode():this.getLinearDepthNode()}updateBefore(e){const{renderer:t}=e,{scene:r}=this;let s,i;const n=t.getOutputRenderTarget();n&&!0===n.isXRRenderTarget?(i=1,s=t.xr.getCamera(),t.xr.updateCamera(s),cb.set(n.width,n.height)):(s=this.camera,i=t.getPixelRatio(),t.getSize(cb)),this._pixelRatio=i,this.setSize(cb.width,cb.height);const a=t.getRenderTarget(),o=t.getMRT(),u=s.layers.mask;this._cameraNear.value=s.near,this._cameraFar.value=s.far,null!==this._layers&&(s.layers.mask=this._layers.mask);for(const e in this._previousTextures)this.toggleTexture(e);t.setRenderTarget(this.renderTarget),t.setMRT(this._mrt),t.render(r,s),t.setRenderTarget(a),t.setMRT(o),s.layers.mask=u}setSize(e,t){this._width=e,this._height=t;const r=this._width*this._pixelRatio*this._resolution,s=this._height*this._pixelRatio*this._resolution;this.renderTarget.setSize(r,s)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget.dispose()}}gb.COLOR="color",gb.DEPTH="depth";class mb extends gb{static get type(){return"ToonOutlinePassNode"}constructor(e,t,r,s,i){super(gb.COLOR,e,t),this.colorNode=r,this.thicknessNode=s,this.alphaNode=i,this._materialCache=new WeakMap}updateBefore(e){const{renderer:t}=e,r=t.getRenderObjectFunction();t.setRenderObjectFunction(((e,r,s,i,n,a,o,u)=>{if((n.isMeshToonMaterial||n.isMeshToonNodeMaterial)&&!1===n.wireframe){const l=this._getOutlineMaterial(n);t.renderObject(e,r,s,i,l,a,o,u)}t.renderObject(e,r,s,i,n,a,o,u)})),super.updateBefore(e),t.setRenderObjectFunction(r)}_createMaterial(){const e=new Zh;e.isMeshToonOutlineMaterial=!0,e.name="Toon_Outline",e.side=S;const t=ql.negate(),r=ll.mul(Fl),s=ji(1),i=r.mul(nn(Vl,1)),n=r.mul(nn(Vl.add(t),1)),a=Qa(i.sub(n));return e.vertexNode=i.add(a.mul(this.thicknessNode).mul(i.w).mul(s)),e.colorNode=nn(this.colorNode,this.alphaNode),e}_getOutlineMaterial(e){let t=this._materialCache.get(e);return void 0===t&&(t=this._createMaterial(),this._materialCache.set(e,t)),t}}const fb=ki((([e,t])=>e.mul(t).clamp())).setLayout({name:"linearToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),yb=ki((([e,t])=>(e=e.mul(t)).div(e.add(1)).clamp())).setLayout({name:"reinhardToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),bb=ki((([e,t])=>{const r=(e=(e=e.mul(t)).sub(.004).max(0)).mul(e.mul(6.2).add(.5)),s=e.mul(e.mul(6.2).add(1.7)).add(.06);return r.div(s).pow(2.2)})).setLayout({name:"cineonToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),xb=ki((([e])=>{const t=e.mul(e.add(.0245786)).sub(90537e-9),r=e.mul(e.add(.432951).mul(.983729)).add(.238081);return t.div(r)})),Tb=ki((([e,t])=>{const r=dn(.59719,.35458,.04823,.076,.90834,.01566,.0284,.13383,.83777),s=dn(1.60475,-.53108,-.07367,-.10208,1.10813,-.00605,-.00327,-.07276,1.07602);return e=e.mul(t).div(.6),e=r.mul(e),e=xb(e),(e=s.mul(e)).clamp()})).setLayout({name:"acesFilmicToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),_b=dn(en(1.6605,-.1246,-.0182),en(-.5876,1.1329,-.1006),en(-.0728,-.0083,1.1187)),vb=dn(en(.6274,.0691,.0164),en(.3293,.9195,.088),en(.0433,.0113,.8956)),Nb=ki((([e])=>{const t=en(e).toVar(),r=en(t.mul(t)).toVar(),s=en(r.mul(r)).toVar();return ji(15.5).mul(s.mul(r)).sub(la(40.14,s.mul(t))).add(la(31.96,s).sub(la(6.868,r.mul(t))).add(la(.4298,r).add(la(.1191,t).sub(.00232))))})),Sb=ki((([e,t])=>{const r=en(e).toVar(),s=dn(en(.856627153315983,.137318972929847,.11189821299995),en(.0951212405381588,.761241990602591,.0767994186031903),en(.0482516061458583,.101439036467562,.811302368396859)),i=dn(en(1.1271005818144368,-.1413297634984383,-.14132976349843826),en(-.11060664309660323,1.157823702216272,-.11060664309660294),en(-.016493938717834573,-.016493938717834257,1.2519364065950405)),n=ji(-12.47393),a=ji(4.026069);return r.mulAssign(t),r.assign(vb.mul(r)),r.assign(s.mul(r)),r.assign(_o(r,1e-10)),r.assign(ja(r)),r.assign(r.sub(n).div(a.sub(n))),r.assign(Do(r,0,1)),r.assign(Nb(r)),r.assign(i.mul(r)),r.assign(Ro(_o(en(0),r),en(2.2))),r.assign(_b.mul(r)),r.assign(Do(r,0,1)),r})).setLayout({name:"agxToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),Eb=ki((([e,t])=>{const r=ji(.76),s=ji(.15);e=e.mul(t);const i=To(e.r,To(e.g,e.b)),n=Xo(i.lessThan(.08),i.sub(la(6.25,i.mul(i))),.04);e.subAssign(n);const a=_o(e.r,_o(e.g,e.b));Hi(a.lessThan(r),(()=>e));const o=ua(1,r),u=ua(1,o.mul(o).div(a.add(o.sub(r))));e.mulAssign(u.div(a));const l=ua(1,da(1,s.mul(a.sub(u)).add(1)));return Io(e,en(u),l)})).setLayout({name:"neutralToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]});class wb extends js{static get type(){return"CodeNode"}constructor(e="",t=[],r=""){super("code"),this.isCodeNode=!0,this.global=!0,this.code=e,this.includes=t,this.language=r}setIncludes(e){return this.includes=e,this}getIncludes(){return this.includes}generate(e){const t=this.getIncludes(e);for(const r of t)r.build(e);const r=e.getCodeFromNode(this,this.getNodeType(e));return r.code=this.code,r.code}serialize(e){super.serialize(e),e.code=this.code,e.language=this.language}deserialize(e){super.deserialize(e),this.code=e.code,this.language=e.language}}const Ab=Vi(wb).setParameterLength(1,3);class Rb extends wb{static get type(){return"FunctionNode"}constructor(e="",t=[],r=""){super(e,t,r)}getNodeType(e){return this.getNodeFunction(e).type}getInputs(e){return this.getNodeFunction(e).inputs}getNodeFunction(e){const t=e.getDataFromNode(this);let r=t.nodeFunction;return void 0===r&&(r=e.parser.parseFunction(this.code),t.nodeFunction=r),r}generate(e,t){super.generate(e);const r=this.getNodeFunction(e),s=r.name,i=r.type,n=e.getCodeFromNode(this,i);""!==s&&(n.name=s);const a=e.getPropertyName(n),o=this.getNodeFunction(e).getCode(a);return n.code=o+"\n","property"===t?a:e.format(`${a}()`,i,t)}}const Cb=(e,t=[],r="")=>{for(let e=0;es.call(...e);return i.functionNode=s,i};class Mb extends js{static get type(){return"ScriptableValueNode"}constructor(e=null){super(),this._value=e,this._cache=null,this.inputType=null,this.outputType=null,this.events=new o,this.isScriptableValueNode=!0}get isScriptableOutputNode(){return null!==this.outputType}set value(e){this._value!==e&&(this._cache&&"URL"===this.inputType&&this.value.value instanceof ArrayBuffer&&(URL.revokeObjectURL(this._cache),this._cache=null),this._value=e,this.events.dispatchEvent({type:"change"}),this.refresh())}get value(){return this._value}refresh(){this.events.dispatchEvent({type:"refresh"})}getValue(){const e=this.value;if(e&&null===this._cache&&"URL"===this.inputType&&e.value instanceof ArrayBuffer)this._cache=URL.createObjectURL(new Blob([e.value]));else if(e&&null!==e.value&&void 0!==e.value&&(("URL"===this.inputType||"String"===this.inputType)&&"string"==typeof e.value||"Number"===this.inputType&&"number"==typeof e.value||"Vector2"===this.inputType&&e.value.isVector2||"Vector3"===this.inputType&&e.value.isVector3||"Vector4"===this.inputType&&e.value.isVector4||"Color"===this.inputType&&e.value.isColor||"Matrix3"===this.inputType&&e.value.isMatrix3||"Matrix4"===this.inputType&&e.value.isMatrix4))return e.value;return this._cache||e}getNodeType(e){return this.value&&this.value.isNode?this.value.getNodeType(e):"float"}setup(){return this.value&&this.value.isNode?this.value:ji()}serialize(e){super.serialize(e),null!==this.value?"ArrayBuffer"===this.inputType?e.value=Ls(this.value):e.value=this.value?this.value.toJSON(e.meta).uuid:null:e.value=null,e.inputType=this.inputType,e.outputType=this.outputType}deserialize(e){super.deserialize(e);let t=null;null!==e.value&&(t="ArrayBuffer"===e.inputType?Bs(e.value):"Texture"===e.inputType?e.meta.textures[e.value]:e.meta.nodes[e.value]||null),this.value=t,this.inputType=e.inputType,this.outputType=e.outputType}}const Pb=Vi(Mb).setParameterLength(1);class Fb extends Map{get(e,t=null,...r){if(this.has(e))return super.get(e);if(null!==t){const s=t(...r);return this.set(e,s),s}}}class Lb{constructor(e){this.scriptableNode=e}get parameters(){return this.scriptableNode.parameters}get layout(){return this.scriptableNode.getLayout()}getInputLayout(e){return this.scriptableNode.getInputLayout(e)}get(e){const t=this.parameters[e];return t?t.getValue():null}}const Bb=new Fb;class Ib extends js{static get type(){return"ScriptableNode"}constructor(e=null,t={}){super(),this.codeNode=e,this.parameters=t,this._local=new Fb,this._output=Pb(null),this._outputs={},this._source=this.source,this._method=null,this._object=null,this._value=null,this._needsOutputUpdate=!0,this.onRefresh=this.onRefresh.bind(this),this.isScriptableNode=!0}get source(){return this.codeNode?this.codeNode.code:""}setLocal(e,t){return this._local.set(e,t)}getLocal(e){return this._local.get(e)}onRefresh(){this._refresh()}getInputLayout(e){for(const t of this.getLayout())if(t.inputType&&(t.id===e||t.name===e))return t}getOutputLayout(e){for(const t of this.getLayout())if(t.outputType&&(t.id===e||t.name===e))return t}setOutput(e,t){const r=this._outputs;return void 0===r[e]?r[e]=Pb(t):r[e].value=t,this}getOutput(e){return this._outputs[e]}getParameter(e){return this.parameters[e]}setParameter(e,t){const r=this.parameters;return t&&t.isScriptableNode?(this.deleteParameter(e),r[e]=t,r[e].getDefaultOutput().events.addEventListener("refresh",this.onRefresh)):t&&t.isScriptableValueNode?(this.deleteParameter(e),r[e]=t,r[e].events.addEventListener("refresh",this.onRefresh)):void 0===r[e]?(r[e]=Pb(t),r[e].events.addEventListener("refresh",this.onRefresh)):r[e].value=t,this}getValue(){return this.getDefaultOutput().getValue()}deleteParameter(e){let t=this.parameters[e];return t&&(t.isScriptableNode&&(t=t.getDefaultOutput()),t.events.removeEventListener("refresh",this.onRefresh)),this}clearParameters(){for(const e of Object.keys(this.parameters))this.deleteParameter(e);return this.needsUpdate=!0,this}call(e,...t){const r=this.getObject()[e];if("function"==typeof r)return r(...t)}async callAsync(e,...t){const r=this.getObject()[e];if("function"==typeof r)return"AsyncFunction"===r.constructor.name?await r(...t):r(...t)}getNodeType(e){return this.getDefaultOutputNode().getNodeType(e)}refresh(e=null){null!==e?this.getOutput(e).refresh():this._refresh()}getObject(){if(this.needsUpdate&&this.dispose(),null!==this._object)return this._object;const e=new Lb(this),t=Bb.get("THREE"),r=Bb.get("TSL"),s=this.getMethod(),i=[e,this._local,Bb,()=>this.refresh(),(e,t)=>this.setOutput(e,t),t,r];this._object=s(...i);const n=this._object.layout;if(n&&(!1===n.cache&&this._local.clear(),this._output.outputType=n.outputType||null,Array.isArray(n.elements)))for(const e of n.elements){const t=e.id||e.name;e.inputType&&(void 0===this.getParameter(t)&&this.setParameter(t,null),this.getParameter(t).inputType=e.inputType),e.outputType&&(void 0===this.getOutput(t)&&this.setOutput(t,null),this.getOutput(t).outputType=e.outputType)}return this._object}deserialize(e){super.deserialize(e);for(const e in this.parameters){let t=this.parameters[e];t.isScriptableNode&&(t=t.getDefaultOutput()),t.events.addEventListener("refresh",this.onRefresh)}}getLayout(){return this.getObject().layout}getDefaultOutputNode(){const e=this.getDefaultOutput().value;return e&&e.isNode?e:ji()}getDefaultOutput(){return this._exec()._output}getMethod(){if(this.needsUpdate&&this.dispose(),null!==this._method)return this._method;const e=["layout","init","main","dispose"].join(", "),t="\nreturn { ...output, "+e+" };",r="var "+e+"; var output = {};\n"+this.codeNode.code+t;return this._method=new Function(...["parameters","local","global","refresh","setOutput","THREE","TSL"],r),this._method}dispose(){null!==this._method&&(this._object&&"function"==typeof this._object.dispose&&this._object.dispose(),this._method=null,this._object=null,this._source=null,this._value=null,this._needsOutputUpdate=!0,this._output.value=null,this._outputs={})}setup(){return this.getDefaultOutputNode()}getCacheKey(e){const t=[bs(this.source),this.getDefaultOutputNode().getCacheKey(e)];for(const r in this.parameters)t.push(this.parameters[r].getCacheKey(e));return xs(t)}set needsUpdate(e){!0===e&&this.dispose()}get needsUpdate(){return this.source!==this._source}_exec(){return null===this.codeNode||(!0===this._needsOutputUpdate&&(this._value=this.call("main"),this._needsOutputUpdate=!1),this._output.value=this._value),this}_refresh(){this.needsUpdate=!0,this._exec(),this._output.refresh()}}const Db=Vi(Ib).setParameterLength(1,2);function Vb(e){let t;const r=e.context.getViewZ;return void 0!==r&&(t=r(this)),(t||Gl.z).negate()}const Ub=ki((([e,t],r)=>{const s=Vb(r);return Oo(e,t,s)})),Ob=ki((([e],t)=>{const r=Vb(t);return e.mul(e,r,r).negate().exp().oneMinus()})),kb=ki((([e,t])=>nn(t.toFloat().mix(In.rgb,e.toVec3()),In.a)));let Gb=null,zb=null;class Hb extends js{static get type(){return"RangeNode"}constructor(e=ji(),t=ji()){super(),this.minNode=e,this.maxNode=t}getVectorLength(e){const t=e.getTypeLength(Ms(this.minNode.value)),r=e.getTypeLength(Ms(this.maxNode.value));return t>r?t:r}getNodeType(e){return e.object.count>1?e.getTypeFromLength(this.getVectorLength(e)):"float"}setup(e){const t=e.object;let r=null;if(t.count>1){const i=this.minNode.value,n=this.maxNode.value,a=e.getTypeLength(Ms(i)),o=e.getTypeLength(Ms(n));Gb=Gb||new s,zb=zb||new s,Gb.setScalar(0),zb.setScalar(0),1===a?Gb.setScalar(i):i.isColor?Gb.set(i.r,i.g,i.b,1):Gb.set(i.x,i.y,i.z||0,i.w||0),1===o?zb.setScalar(n):n.isColor?zb.set(n.r,n.g,n.b,1):zb.set(n.x,n.y,n.z||0,n.w||0);const l=4,d=l*t.count,c=new Float32Array(d);for(let e=0;eBi(new Wb(e,t)),qb=jb("numWorkgroups","uvec3"),Xb=jb("workgroupId","uvec3"),Kb=jb("globalId","uvec3"),Yb=jb("localId","uvec3"),Qb=jb("subgroupSize","uint");const Zb=Vi(class extends js{constructor(e){super(),this.scope=e}generate(e){const{scope:t}=this,{renderer:r}=e;!0===r.backend.isWebGLBackend?e.addFlowCode(`\t// ${t}Barrier \n`):e.addLineFlowCode(`${t}Barrier()`,this)}});class Jb extends qs{constructor(e,t){super(e,t),this.isWorkgroupInfoElementNode=!0}generate(e,t){let r;const s=e.context.assign;if(r=super.generate(e),!0!==s){const s=this.getNodeType(e);r=e.format(r,s,t)}return r}}class ex extends js{constructor(e,t,r=0){super(t),this.bufferType=t,this.bufferCount=r,this.isWorkgroupInfoNode=!0,this.elementType=t,this.scope=e}label(e){return this.name=e,this}setScope(e){return this.scope=e,this}getElementType(){return this.elementType}getInputType(){return`${this.scope}Array`}element(e){return Bi(new Jb(this,e))}generate(e){return e.getScopedArray(this.name||`${this.scope}Array_${this.id}`,this.scope.toLowerCase(),this.bufferType,this.bufferCount)}}class tx extends js{static get type(){return"AtomicFunctionNode"}constructor(e,t,r){super("uint"),this.method=e,this.pointerNode=t,this.valueNode=r,this.parents=!0}getInputType(e){return this.pointerNode.getNodeType(e)}getNodeType(e){return this.getInputType(e)}generate(e){const t=e.getNodeProperties(this),r=t.parents,s=this.method,i=this.getNodeType(e),n=this.getInputType(e),a=this.pointerNode,o=this.valueNode,u=[];u.push(`&${a.build(e,n)}`),null!==o&&u.push(o.build(e,n));const l=`${e.getMethod(s,i)}( ${u.join(", ")} )`;if(!(1===r.length&&!0===r[0].isStackNode))return void 0===t.constNode&&(t.constNode=Du(l,i).toConst()),t.constNode.build(e);e.addLineFlowCode(l,this)}}tx.ATOMIC_LOAD="atomicLoad",tx.ATOMIC_STORE="atomicStore",tx.ATOMIC_ADD="atomicAdd",tx.ATOMIC_SUB="atomicSub",tx.ATOMIC_MAX="atomicMax",tx.ATOMIC_MIN="atomicMin",tx.ATOMIC_AND="atomicAnd",tx.ATOMIC_OR="atomicOr",tx.ATOMIC_XOR="atomicXor";const rx=Vi(tx),sx=(e,t,r)=>rx(e,t,r).toStack();let ix;function nx(e){ix=ix||new WeakMap;let t=ix.get(e);return void 0===t&&ix.set(e,t={}),t}function ax(e){const t=nx(e);return t.shadowMatrix||(t.shadowMatrix=Zn("mat4").setGroup(Kn).onRenderUpdate((t=>(!0===e.castShadow&&!1!==t.renderer.shadowMap.enabled||e.shadow.updateMatrices(e),e.shadow.matrix))))}function ox(e,t=Ol){const r=ax(e).mul(t);return r.xyz.div(r.w)}function ux(e){const t=nx(e);return t.position||(t.position=Zn(new r).setGroup(Kn).onRenderUpdate(((t,r)=>r.value.setFromMatrixPosition(e.matrixWorld))))}function lx(e){const t=nx(e);return t.targetPosition||(t.targetPosition=Zn(new r).setGroup(Kn).onRenderUpdate(((t,r)=>r.value.setFromMatrixPosition(e.target.matrixWorld))))}function dx(e){const t=nx(e);return t.viewPosition||(t.viewPosition=Zn(new r).setGroup(Kn).onRenderUpdate((({camera:t},s)=>{s.value=s.value||new r,s.value.setFromMatrixPosition(e.matrixWorld),s.value.applyMatrix4(t.matrixWorldInverse)})))}const cx=e=>cl.transformDirection(ux(e).sub(lx(e))),hx=(e,t)=>{for(const r of t)if(r.isAnalyticLightNode&&r.light.id===e)return r;return null},px=new WeakMap,gx=[];class mx extends js{static get type(){return"LightsNode"}constructor(){super("vec3"),this.totalDiffuseNode=en().toVar(),this.totalSpecularNode=en().toVar(),this.outgoingLightNode=en().toVar(),this._lights=[],this._lightNodes=null,this._lightNodesHash=null,this.global=!0}customCacheKey(){const e=this._lights;for(let t=0;te.sort(((e,t)=>e.id-t.id)))(this._lights),i=e.renderer.library;for(const e of s)if(e.isNode)t.push(Bi(e));else{let s=null;if(null!==r&&(s=hx(e.id,r)),null===s){const r=i.getLightNodeClass(e.constructor);if(null===r){console.warn(`LightsNode.setupNodeLights: Light node not found for ${e.constructor.name}`);continue}let s=null;px.has(e)?s=px.get(e):(s=Bi(new r(e)),px.set(e,s)),t.push(s)}}this._lightNodes=t}setupDirectLight(e,t,r){const{lightingModel:s,reflectedLight:i}=e.context;s.direct({...r,lightNode:t,reflectedLight:i},e)}setupDirectRectAreaLight(e,t,r){const{lightingModel:s,reflectedLight:i}=e.context;s.directRectArea({...r,lightNode:t,reflectedLight:i},e)}setupLights(e,t){for(const r of t)r.build(e)}getLightNodes(e){return null===this._lightNodes&&this.setupLightsNode(e),this._lightNodes}setup(e){const t=e.lightsNode;e.lightsNode=this;let r=this.outgoingLightNode;const s=e.context,i=s.lightingModel,n=e.getNodeProperties(this);if(i){const{totalDiffuseNode:t,totalSpecularNode:a}=this;s.outgoingLight=r;const o=e.addStack();n.nodes=o.nodes,i.start(e);const{backdrop:u,backdropAlpha:l}=s,{directDiffuse:d,directSpecular:c,indirectDiffuse:h,indirectSpecular:p}=s.reflectedLight;let g=d.add(h);null!==u&&(g=en(null!==l?l.mix(g,u):u),s.material.transparent=!0),t.assign(g),a.assign(c.add(p)),r.assign(t.add(a)),i.finish(e),r=r.bypass(e.removeStack())}else n.nodes=[];return e.lightsNode=t,r}setLights(e){return this._lights=e,this._lightNodes=null,this._lightNodesHash=null,this}getLights(){return this._lights}get hasLights(){return this._lights.length>0}}class fx extends js{static get type(){return"ShadowBaseNode"}constructor(e){super(),this.light=e,this.updateBeforeType=Vs.RENDER,this.isShadowBaseNode=!0}setupShadowPosition({context:e,material:t}){yx.assign(t.receivedShadowPositionNode||e.shadowPositionWorld||Ol)}}const yx=mn("vec3","shadowPositionWorld");function bx(t,r={}){return r.toneMapping=t.toneMapping,r.toneMappingExposure=t.toneMappingExposure,r.outputColorSpace=t.outputColorSpace,r.renderTarget=t.getRenderTarget(),r.activeCubeFace=t.getActiveCubeFace(),r.activeMipmapLevel=t.getActiveMipmapLevel(),r.renderObjectFunction=t.getRenderObjectFunction(),r.pixelRatio=t.getPixelRatio(),r.mrt=t.getMRT(),r.clearColor=t.getClearColor(r.clearColor||new e),r.clearAlpha=t.getClearAlpha(),r.autoClear=t.autoClear,r.scissorTest=t.getScissorTest(),r}function xx(e,t){return t=bx(e,t),e.setMRT(null),e.setRenderObjectFunction(null),e.setClearColor(0,1),e.autoClear=!0,t}function Tx(e,t){e.toneMapping=t.toneMapping,e.toneMappingExposure=t.toneMappingExposure,e.outputColorSpace=t.outputColorSpace,e.setRenderTarget(t.renderTarget,t.activeCubeFace,t.activeMipmapLevel),e.setRenderObjectFunction(t.renderObjectFunction),e.setPixelRatio(t.pixelRatio),e.setMRT(t.mrt),e.setClearColor(t.clearColor,t.clearAlpha),e.autoClear=t.autoClear,e.setScissorTest(t.scissorTest)}function _x(e,t={}){return t.background=e.background,t.backgroundNode=e.backgroundNode,t.overrideMaterial=e.overrideMaterial,t}function vx(e,t){return t=_x(e,t),e.background=null,e.backgroundNode=null,e.overrideMaterial=null,t}function Nx(e,t){e.background=t.background,e.backgroundNode=t.backgroundNode,e.overrideMaterial=t.overrideMaterial}function Sx(e,t,r){return r=vx(t,r=xx(e,r))}function Ex(e,t,r){Tx(e,r),Nx(t,r)}var wx=Object.freeze({__proto__:null,resetRendererAndSceneState:Sx,resetRendererState:xx,resetSceneState:vx,restoreRendererAndSceneState:Ex,restoreRendererState:Tx,restoreSceneState:Nx,saveRendererAndSceneState:function(e,t,r={}){return r=_x(t,r=bx(e,r))},saveRendererState:bx,saveSceneState:_x});const Ax=new WeakMap,Rx=ki((({depthTexture:e,shadowCoord:t,depthLayer:r})=>{let s=Zu(e,t.xy).label("t_basic");return e.isArrayTexture&&(s=s.depth(r)),s.compare(t.z)})),Cx=ki((({depthTexture:e,shadowCoord:t,shadow:r,depthLayer:s})=>{const i=(t,r)=>{let i=Zu(e,t);return e.isArrayTexture&&(i=i.depth(s)),i.compare(r)},n=yd("mapSize","vec2",r).setGroup(Kn),a=yd("radius","float",r).setGroup(Kn),o=Yi(1).div(n),u=o.x.negate().mul(a),l=o.y.negate().mul(a),d=o.x.mul(a),c=o.y.mul(a),h=u.div(2),p=l.div(2),g=d.div(2),m=c.div(2);return oa(i(t.xy.add(Yi(u,l)),t.z),i(t.xy.add(Yi(0,l)),t.z),i(t.xy.add(Yi(d,l)),t.z),i(t.xy.add(Yi(h,p)),t.z),i(t.xy.add(Yi(0,p)),t.z),i(t.xy.add(Yi(g,p)),t.z),i(t.xy.add(Yi(u,0)),t.z),i(t.xy.add(Yi(h,0)),t.z),i(t.xy,t.z),i(t.xy.add(Yi(g,0)),t.z),i(t.xy.add(Yi(d,0)),t.z),i(t.xy.add(Yi(h,m)),t.z),i(t.xy.add(Yi(0,m)),t.z),i(t.xy.add(Yi(g,m)),t.z),i(t.xy.add(Yi(u,c)),t.z),i(t.xy.add(Yi(0,c)),t.z),i(t.xy.add(Yi(d,c)),t.z)).mul(1/17)})),Mx=ki((({depthTexture:e,shadowCoord:t,shadow:r,depthLayer:s})=>{const i=(t,r)=>{let i=Zu(e,t);return e.isArrayTexture&&(i=i.depth(s)),i.compare(r)},n=yd("mapSize","vec2",r).setGroup(Kn),a=Yi(1).div(n),o=a.x,u=a.y,l=t.xy,d=Za(l.mul(n).add(.5));return l.subAssign(d.mul(a)),oa(i(l,t.z),i(l.add(Yi(o,0)),t.z),i(l.add(Yi(0,u)),t.z),i(l.add(a),t.z),Io(i(l.add(Yi(o.negate(),0)),t.z),i(l.add(Yi(o.mul(2),0)),t.z),d.x),Io(i(l.add(Yi(o.negate(),u)),t.z),i(l.add(Yi(o.mul(2),u)),t.z),d.x),Io(i(l.add(Yi(0,u.negate())),t.z),i(l.add(Yi(0,u.mul(2))),t.z),d.y),Io(i(l.add(Yi(o,u.negate())),t.z),i(l.add(Yi(o,u.mul(2))),t.z),d.y),Io(Io(i(l.add(Yi(o.negate(),u.negate())),t.z),i(l.add(Yi(o.mul(2),u.negate())),t.z),d.x),Io(i(l.add(Yi(o.negate(),u.mul(2))),t.z),i(l.add(Yi(o.mul(2),u.mul(2))),t.z),d.x),d.y)).mul(1/9)})),Px=ki((({depthTexture:e,shadowCoord:t,depthLayer:r})=>{const s=ji(1).toVar();let i=Zu(e).sample(t.xy);e.isArrayTexture&&(i=i.depth(r)),i=i.rg;const n=vo(t.z,i.x);return Hi(n.notEqual(ji(1)),(()=>{const e=t.z.sub(i.x),r=_o(0,i.y.mul(i.y));let a=r.div(r.add(e.mul(e)));a=Do(ua(a,.3).div(.95-.3)),s.assign(Do(_o(n,a)))})),s})),Fx=ki((([e,t,r])=>{let s=Ol.sub(e).length();return s=s.sub(t).div(r.sub(t)),s=s.saturate(),s})),Lx=e=>{let t=Ax.get(e);if(void 0===t){const r=e.isPointLight?(e=>{const t=e.shadow.camera,r=yd("near","float",t).setGroup(Kn),s=yd("far","float",t).setGroup(Kn),i=xl(e);return Fx(i,r,s)})(e):null;t=new Zh,t.colorNode=nn(0,0,0,1),t.depthNode=r,t.isShadowPassMaterial=!0,t.name="ShadowMaterial",t.fog=!1,Ax.set(e,t)}return t},Bx=new Km,Ix=[],Dx=(e,t,r,s)=>{Ix[0]=e,Ix[1]=t;let i=Bx.get(Ix);return void 0!==i&&i.shadowType===r&&i.useVelocity===s||(i=(i,n,a,o,u,l,...d)=>{(!0===i.castShadow||i.receiveShadow&&r===Ie)&&(s&&(Fs(i).useVelocity=!0),i.onBeforeShadow(e,i,a,t.camera,o,n.overrideMaterial,l),e.renderObject(i,n,a,o,u,l,...d),i.onAfterShadow(e,i,a,t.camera,o,n.overrideMaterial,l))},i.shadowType=r,i.useVelocity=s,Bx.set(Ix,i)),Ix[0]=null,Ix[1]=null,i},Vx=ki((({samples:e,radius:t,size:r,shadowPass:s,depthLayer:i})=>{const n=ji(0).toVar("meanVertical"),a=ji(0).toVar("squareMeanVertical"),o=e.lessThanEqual(ji(1)).select(ji(0),ji(2).div(e.sub(1))),u=e.lessThanEqual(ji(1)).select(ji(0),ji(-1));Zc({start:qi(0),end:qi(e),type:"int",condition:"<"},(({i:e})=>{const l=u.add(ji(e).mul(o));let d=s.sample(oa(mh.xy,Yi(0,l).mul(t)).div(r));s.value.isArrayTexture&&(d=d.depth(i)),d=d.x,n.addAssign(d),a.addAssign(d.mul(d))})),n.divAssign(e),a.divAssign(e);const l=qa(a.sub(n.mul(n)));return Yi(n,l)})),Ux=ki((({samples:e,radius:t,size:r,shadowPass:s,depthLayer:i})=>{const n=ji(0).toVar("meanHorizontal"),a=ji(0).toVar("squareMeanHorizontal"),o=e.lessThanEqual(ji(1)).select(ji(0),ji(2).div(e.sub(1))),u=e.lessThanEqual(ji(1)).select(ji(0),ji(-1));Zc({start:qi(0),end:qi(e),type:"int",condition:"<"},(({i:e})=>{const l=u.add(ji(e).mul(o));let d=s.sample(oa(mh.xy,Yi(l,0).mul(t)).div(r));s.value.isArrayTexture&&(d=d.depth(i)),n.addAssign(d.x),a.addAssign(oa(d.y.mul(d.y),d.x.mul(d.x)))})),n.divAssign(e),a.divAssign(e);const l=qa(a.sub(n.mul(n)));return Yi(n,l)})),Ox=[Rx,Cx,Mx,Px];let kx;const Gx=new Cy;class zx extends fx{static get type(){return"ShadowNode"}constructor(e,t=null){super(e),this.shadow=t||e.shadow,this.shadowMap=null,this.vsmShadowMapVertical=null,this.vsmShadowMapHorizontal=null,this.vsmMaterialVertical=null,this.vsmMaterialHorizontal=null,this._node=null,this._cameraFrameId=new WeakMap,this.isShadowNode=!0,this.depthLayer=0}setupShadowFilter(e,{filterFn:t,depthTexture:r,shadowCoord:s,shadow:i,depthLayer:n}){const a=s.x.greaterThanEqual(0).and(s.x.lessThanEqual(1)).and(s.y.greaterThanEqual(0)).and(s.y.lessThanEqual(1)).and(s.z.lessThanEqual(1)),o=t({depthTexture:r,shadowCoord:s,shadow:i,depthLayer:n});return a.select(o,ji(1))}setupShadowCoord(e,t){const{shadow:r}=this,{renderer:s}=e,i=yd("bias","float",r).setGroup(Kn);let n,a=t;if(r.camera.isOrthographicCamera||!0!==s.logarithmicDepthBuffer)a=a.xyz.div(a.w),n=a.z,s.coordinateSystem===d&&(n=n.mul(2).sub(1));else{const e=a.w;a=a.xy.div(e);const t=yd("near","float",r.camera).setGroup(Kn),s=yd("far","float",r.camera).setGroup(Kn);n=Bh(e.negate(),t,s)}return a=en(a.x,a.y.oneMinus(),n.add(i)),a}getShadowFilterFn(e){return Ox[e]}setupRenderTarget(e,t){const r=new V(e.mapSize.width,e.mapSize.height);r.name="ShadowDepthTexture",r.compareFunction=De;const s=t.createRenderTarget(e.mapSize.width,e.mapSize.height);return s.texture.name="ShadowMap",s.texture.type=e.mapType,s.depthTexture=r,{shadowMap:s,depthTexture:r}}setupShadow(e){const{renderer:t}=e,{light:r,shadow:s}=this,i=t.shadowMap.type,{depthTexture:n,shadowMap:a}=this.setupRenderTarget(s,e);if(s.camera.updateProjectionMatrix(),i===Ie&&!0!==s.isPointLightShadow){n.compareFunction=null,a.depth>1?(a._vsmShadowMapVertical||(a._vsmShadowMapVertical=e.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:Ve,type:de,depth:a.depth,depthBuffer:!1}),a._vsmShadowMapVertical.texture.name="VSMVertical"),this.vsmShadowMapVertical=a._vsmShadowMapVertical,a._vsmShadowMapHorizontal||(a._vsmShadowMapHorizontal=e.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:Ve,type:de,depth:a.depth,depthBuffer:!1}),a._vsmShadowMapHorizontal.texture.name="VSMHorizontal"),this.vsmShadowMapHorizontal=a._vsmShadowMapHorizontal):(this.vsmShadowMapVertical=e.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:Ve,type:de,depthBuffer:!1}),this.vsmShadowMapHorizontal=e.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:Ve,type:de,depthBuffer:!1}));let t=Zu(n);n.isArrayTexture&&(t=t.depth(this.depthLayer));let r=Zu(this.vsmShadowMapVertical.texture);n.isArrayTexture&&(r=r.depth(this.depthLayer));const i=yd("blurSamples","float",s).setGroup(Kn),o=yd("radius","float",s).setGroup(Kn),u=yd("mapSize","vec2",s).setGroup(Kn);let l=this.vsmMaterialVertical||(this.vsmMaterialVertical=new Zh);l.fragmentNode=Vx({samples:i,radius:o,size:u,shadowPass:t,depthLayer:this.depthLayer}).context(e.getSharedContext()),l.name="VSMVertical",l=this.vsmMaterialHorizontal||(this.vsmMaterialHorizontal=new Zh),l.fragmentNode=Ux({samples:i,radius:o,size:u,shadowPass:r,depthLayer:this.depthLayer}).context(e.getSharedContext()),l.name="VSMHorizontal"}const o=yd("intensity","float",s).setGroup(Kn),u=yd("normalBias","float",s).setGroup(Kn),l=ax(r).mul(yx.add(Zl.mul(u))),d=this.setupShadowCoord(e,l),c=s.filterNode||this.getShadowFilterFn(t.shadowMap.type)||null;if(null===c)throw new Error("THREE.WebGPURenderer: Shadow map type not supported yet.");const h=i===Ie&&!0!==s.isPointLightShadow?this.vsmShadowMapHorizontal.texture:n,p=this.setupShadowFilter(e,{filterFn:c,shadowTexture:a.texture,depthTexture:h,shadowCoord:d,shadow:s,depthLayer:this.depthLayer});let g=Zu(a.texture,d);n.isArrayTexture&&(g=g.depth(this.depthLayer));const m=Io(1,p.rgb.mix(g,1),o.mul(g.a)).toVar();return this.shadowMap=a,this.shadow.map=a,m}setup(e){if(!1!==e.renderer.shadowMap.enabled)return ki((()=>{let t=this._node;return this.setupShadowPosition(e),null===t&&(this._node=t=this.setupShadow(e)),e.material.shadowNode&&console.warn('THREE.NodeMaterial: ".shadowNode" is deprecated. Use ".castShadowNode" instead.'),e.material.receivedShadowNode&&(t=e.material.receivedShadowNode(t)),t}))()}renderShadow(e){const{shadow:t,shadowMap:r,light:s}=this,{renderer:i,scene:n}=e;t.updateMatrices(s),r.setSize(t.mapSize.width,t.mapSize.height,r.depth),i.render(n,t.camera)}updateShadow(e){const{shadowMap:t,light:r,shadow:s}=this,{renderer:i,scene:n,camera:a}=e,o=i.shadowMap.type,u=t.depthTexture.version;this._depthVersionCached=u;const l=s.camera.layers.mask;4294967294&s.camera.layers.mask||(s.camera.layers.mask=a.layers.mask);const d=i.getRenderObjectFunction(),c=i.getMRT(),h=!!c&&c.has("velocity");kx=Sx(i,n,kx),n.overrideMaterial=Lx(r),i.setRenderObjectFunction(Dx(i,s,o,h)),i.setClearColor(0,0),i.setRenderTarget(t),this.renderShadow(e),i.setRenderObjectFunction(d),o===Ie&&!0!==s.isPointLightShadow&&this.vsmPass(i),s.camera.layers.mask=l,Ex(i,n,kx)}vsmPass(e){const{shadow:t}=this,r=this.shadowMap.depth;this.vsmShadowMapVertical.setSize(t.mapSize.width,t.mapSize.height,r),this.vsmShadowMapHorizontal.setSize(t.mapSize.width,t.mapSize.height,r),e.setRenderTarget(this.vsmShadowMapVertical),Gx.material=this.vsmMaterialVertical,Gx.render(e),e.setRenderTarget(this.vsmShadowMapHorizontal),Gx.material=this.vsmMaterialHorizontal,Gx.render(e)}dispose(){this.shadowMap.dispose(),this.shadowMap=null,null!==this.vsmShadowMapVertical&&(this.vsmShadowMapVertical.dispose(),this.vsmShadowMapVertical=null,this.vsmMaterialVertical.dispose(),this.vsmMaterialVertical=null),null!==this.vsmShadowMapHorizontal&&(this.vsmShadowMapHorizontal.dispose(),this.vsmShadowMapHorizontal=null,this.vsmMaterialHorizontal.dispose(),this.vsmMaterialHorizontal=null),super.dispose()}updateBefore(e){const{shadow:t}=this;let r=t.needsUpdate||t.autoUpdate;r&&(this._cameraFrameId[e.camera]===e.frameId&&(r=!1),this._cameraFrameId[e.camera]=e.frameId),r&&(this.updateShadow(e),this.shadowMap.depthTexture.version===this._depthVersionCached&&(t.needsUpdate=!1))}}const Hx=(e,t)=>Bi(new zx(e,t)),$x=new e,Wx=ki((([e,t])=>{const r=e.toVar(),s=no(r),i=da(1,_o(s.x,_o(s.y,s.z)));s.mulAssign(i),r.mulAssign(i.mul(t.mul(2).oneMinus()));const n=Yi(r.xy).toVar(),a=t.mul(1.5).oneMinus();return Hi(s.z.greaterThanEqual(a),(()=>{Hi(r.z.greaterThan(0),(()=>{n.x.assign(ua(4,r.x))}))})).ElseIf(s.x.greaterThanEqual(a),(()=>{const e=ao(r.x);n.x.assign(r.z.mul(e).add(e.mul(2)))})).ElseIf(s.y.greaterThanEqual(a),(()=>{const e=ao(r.y);n.x.assign(r.x.add(e.mul(2)).add(2)),n.y.assign(r.z.mul(e).sub(2))})),Yi(.125,.25).mul(n).add(Yi(.375,.75)).flipY()})).setLayout({name:"cubeToUV",type:"vec2",inputs:[{name:"pos",type:"vec3"},{name:"texelSizeY",type:"float"}]}),jx=ki((({depthTexture:e,bd3D:t,dp:r,texelSize:s})=>Zu(e,Wx(t,s.y)).compare(r))),qx=ki((({depthTexture:e,bd3D:t,dp:r,texelSize:s,shadow:i})=>{const n=yd("radius","float",i).setGroup(Kn),a=Yi(-1,1).mul(n).mul(s.y);return Zu(e,Wx(t.add(a.xyy),s.y)).compare(r).add(Zu(e,Wx(t.add(a.yyy),s.y)).compare(r)).add(Zu(e,Wx(t.add(a.xyx),s.y)).compare(r)).add(Zu(e,Wx(t.add(a.yyx),s.y)).compare(r)).add(Zu(e,Wx(t,s.y)).compare(r)).add(Zu(e,Wx(t.add(a.xxy),s.y)).compare(r)).add(Zu(e,Wx(t.add(a.yxy),s.y)).compare(r)).add(Zu(e,Wx(t.add(a.xxx),s.y)).compare(r)).add(Zu(e,Wx(t.add(a.yxx),s.y)).compare(r)).mul(1/9)})),Xx=ki((({filterFn:e,depthTexture:t,shadowCoord:r,shadow:s})=>{const i=r.xyz.toVar(),n=i.length(),a=Zn("float").setGroup(Kn).onRenderUpdate((()=>s.camera.near)),o=Zn("float").setGroup(Kn).onRenderUpdate((()=>s.camera.far)),u=yd("bias","float",s).setGroup(Kn),l=Zn(s.mapSize).setGroup(Kn),d=ji(1).toVar();return Hi(n.sub(o).lessThanEqual(0).and(n.sub(a).greaterThanEqual(0)),(()=>{const r=n.sub(a).div(o.sub(a)).toVar();r.addAssign(u);const c=i.normalize(),h=Yi(1).div(l.mul(Yi(4,2)));d.assign(e({depthTexture:t,bd3D:c,dp:r,texelSize:h,shadow:s}))})),d})),Kx=new s,Yx=new t,Qx=new t;class Zx extends zx{static get type(){return"PointShadowNode"}constructor(e,t=null){super(e,t)}getShadowFilterFn(e){return e===Ue?jx:qx}setupShadowCoord(e,t){return t}setupShadowFilter(e,{filterFn:t,shadowTexture:r,depthTexture:s,shadowCoord:i,shadow:n}){return Xx({filterFn:t,shadowTexture:r,depthTexture:s,shadowCoord:i,shadow:n})}renderShadow(e){const{shadow:t,shadowMap:r,light:s}=this,{renderer:i,scene:n}=e,a=t.getFrameExtents();Qx.copy(t.mapSize),Qx.multiply(a),r.setSize(Qx.width,Qx.height),Yx.copy(t.mapSize);const o=i.autoClear,u=i.getClearColor($x),l=i.getClearAlpha();i.autoClear=!1,i.setClearColor(t.clearColor,t.clearAlpha),i.clear();const d=t.getViewportCount();for(let e=0;eBi(new Zx(e,t));class eT extends nh{static get type(){return"AnalyticLightNode"}constructor(t=null){super(),this.light=t,this.color=new e,this.colorNode=t&&t.colorNode||Zn(this.color).setGroup(Kn),this.baseColorNode=null,this.shadowNode=null,this.shadowColorNode=null,this.isAnalyticLightNode=!0,this.updateType=Vs.FRAME}getHash(){return this.light.uuid}getLightVector(e){return dx(this.light).sub(e.context.positionView||Gl)}setupDirect(){}setupDirectRectArea(){}setupShadowNode(){return Hx(this.light)}setupShadow(e){const{renderer:t}=e;if(!1===t.shadowMap.enabled)return;let r=this.shadowColorNode;if(null===r){const e=this.light.shadow.shadowNode;let t;t=void 0!==e?Bi(e):this.setupShadowNode(),this.shadowNode=t,this.shadowColorNode=r=this.colorNode.mul(t),this.baseColorNode=this.colorNode}this.colorNode=r}setup(e){this.colorNode=this.baseColorNode||this.colorNode,this.light.castShadow?e.object.receiveShadow&&this.setupShadow(e):null!==this.shadowNode&&(this.shadowNode.dispose(),this.shadowNode=null,this.shadowColorNode=null);const t=this.setupDirect(e),r=this.setupDirectRectArea(e);t&&e.lightsNode.setupDirectLight(e,this,t),r&&e.lightsNode.setupDirectRectAreaLight(e,this,r)}update(){const{light:e}=this;this.color.copy(e.color).multiplyScalar(e.intensity)}}const tT=ki((({lightDistance:e,cutoffDistance:t,decayExponent:r})=>{const s=e.pow(r).max(.01).reciprocal();return t.greaterThan(0).select(s.mul(e.div(t).pow4().oneMinus().clamp().pow2()),s)})),rT=({color:e,lightVector:t,cutoffDistance:r,decayExponent:s})=>{const i=t.normalize(),n=t.length(),a=tT({lightDistance:n,cutoffDistance:r,decayExponent:s});return{lightDirection:i,lightColor:e.mul(a)}};class sT extends eT{static get type(){return"PointLightNode"}constructor(e=null){super(e),this.cutoffDistanceNode=Zn(0).setGroup(Kn),this.decayExponentNode=Zn(2).setGroup(Kn)}update(e){const{light:t}=this;super.update(e),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}setupShadowNode(){return Jx(this.light)}setupDirect(e){return rT({color:this.colorNode,lightVector:this.getLightVector(e),cutoffDistance:this.cutoffDistanceNode,decayExponent:this.decayExponentNode})}}const iT=ki((([e=t()])=>{const t=e.mul(2),r=t.x.floor(),s=t.y.floor();return r.add(s).mod(2).sign()})),nT=ki((([e=$u()],{renderer:t,material:r})=>{const s=Bo(e.mul(2).sub(1));let i;if(r.alphaToCoverage&&t.samples>1){const e=ji(s.fwidth()).toVar();i=Oo(e.oneMinus(),e.add(1),s).oneMinus()}else i=Xo(s.greaterThan(1),0,1);return i})),aT=ki((([e,t,r])=>{const s=ji(r).toVar(),i=ji(t).toVar(),n=Ki(e).toVar();return Xo(n,i,s)})).setLayout({name:"mx_select",type:"float",inputs:[{name:"b",type:"bool"},{name:"t",type:"float"},{name:"f",type:"float"}]}),oT=ki((([e,t])=>{const r=Ki(t).toVar(),s=ji(e).toVar();return Xo(r,s.negate(),s)})).setLayout({name:"mx_negate_if",type:"float",inputs:[{name:"val",type:"float"},{name:"b",type:"bool"}]}),uT=ki((([e])=>{const t=ji(e).toVar();return qi(Ka(t))})).setLayout({name:"mx_floor",type:"int",inputs:[{name:"x",type:"float"}]}),lT=ki((([e,t])=>{const r=ji(e).toVar();return t.assign(uT(r)),r.sub(ji(t))})),dT=Zf([ki((([e,t,r,s,i,n])=>{const a=ji(n).toVar(),o=ji(i).toVar(),u=ji(s).toVar(),l=ji(r).toVar(),d=ji(t).toVar(),c=ji(e).toVar(),h=ji(ua(1,o)).toVar();return ua(1,a).mul(c.mul(h).add(d.mul(o))).add(a.mul(l.mul(h).add(u.mul(o))))})).setLayout({name:"mx_bilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"}]}),ki((([e,t,r,s,i,n])=>{const a=ji(n).toVar(),o=ji(i).toVar(),u=en(s).toVar(),l=en(r).toVar(),d=en(t).toVar(),c=en(e).toVar(),h=ji(ua(1,o)).toVar();return ua(1,a).mul(c.mul(h).add(d.mul(o))).add(a.mul(l.mul(h).add(u.mul(o))))})).setLayout({name:"mx_bilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"}]})]),cT=Zf([ki((([e,t,r,s,i,n,a,o,u,l,d])=>{const c=ji(d).toVar(),h=ji(l).toVar(),p=ji(u).toVar(),g=ji(o).toVar(),m=ji(a).toVar(),f=ji(n).toVar(),y=ji(i).toVar(),b=ji(s).toVar(),x=ji(r).toVar(),T=ji(t).toVar(),_=ji(e).toVar(),v=ji(ua(1,p)).toVar(),N=ji(ua(1,h)).toVar();return ji(ua(1,c)).toVar().mul(N.mul(_.mul(v).add(T.mul(p))).add(h.mul(x.mul(v).add(b.mul(p))))).add(c.mul(N.mul(y.mul(v).add(f.mul(p))).add(h.mul(m.mul(v).add(g.mul(p))))))})).setLayout({name:"mx_trilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"v4",type:"float"},{name:"v5",type:"float"},{name:"v6",type:"float"},{name:"v7",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),ki((([e,t,r,s,i,n,a,o,u,l,d])=>{const c=ji(d).toVar(),h=ji(l).toVar(),p=ji(u).toVar(),g=en(o).toVar(),m=en(a).toVar(),f=en(n).toVar(),y=en(i).toVar(),b=en(s).toVar(),x=en(r).toVar(),T=en(t).toVar(),_=en(e).toVar(),v=ji(ua(1,p)).toVar(),N=ji(ua(1,h)).toVar();return ji(ua(1,c)).toVar().mul(N.mul(_.mul(v).add(T.mul(p))).add(h.mul(x.mul(v).add(b.mul(p))))).add(c.mul(N.mul(y.mul(v).add(f.mul(p))).add(h.mul(m.mul(v).add(g.mul(p))))))})).setLayout({name:"mx_trilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"v4",type:"vec3"},{name:"v5",type:"vec3"},{name:"v6",type:"vec3"},{name:"v7",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]})]),hT=ki((([e,t,r])=>{const s=ji(r).toVar(),i=ji(t).toVar(),n=Xi(e).toVar(),a=Xi(n.bitAnd(Xi(7))).toVar(),o=ji(aT(a.lessThan(Xi(4)),i,s)).toVar(),u=ji(la(2,aT(a.lessThan(Xi(4)),s,i))).toVar();return oT(o,Ki(a.bitAnd(Xi(1)))).add(oT(u,Ki(a.bitAnd(Xi(2)))))})).setLayout({name:"mx_gradient_float_0",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"}]}),pT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=ji(t).toVar(),o=Xi(e).toVar(),u=Xi(o.bitAnd(Xi(15))).toVar(),l=ji(aT(u.lessThan(Xi(8)),a,n)).toVar(),d=ji(aT(u.lessThan(Xi(4)),n,aT(u.equal(Xi(12)).or(u.equal(Xi(14))),a,i))).toVar();return oT(l,Ki(u.bitAnd(Xi(1)))).add(oT(d,Ki(u.bitAnd(Xi(2)))))})).setLayout({name:"mx_gradient_float_1",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),gT=Zf([hT,pT]),mT=ki((([e,t,r])=>{const s=ji(r).toVar(),i=ji(t).toVar(),n=rn(e).toVar();return en(gT(n.x,i,s),gT(n.y,i,s),gT(n.z,i,s))})).setLayout({name:"mx_gradient_vec3_0",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"}]}),fT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=ji(t).toVar(),o=rn(e).toVar();return en(gT(o.x,a,n,i),gT(o.y,a,n,i),gT(o.z,a,n,i))})).setLayout({name:"mx_gradient_vec3_1",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),yT=Zf([mT,fT]),bT=ki((([e])=>{const t=ji(e).toVar();return la(.6616,t)})).setLayout({name:"mx_gradient_scale2d_0",type:"float",inputs:[{name:"v",type:"float"}]}),xT=ki((([e])=>{const t=ji(e).toVar();return la(.982,t)})).setLayout({name:"mx_gradient_scale3d_0",type:"float",inputs:[{name:"v",type:"float"}]}),TT=Zf([bT,ki((([e])=>{const t=en(e).toVar();return la(.6616,t)})).setLayout({name:"mx_gradient_scale2d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]})]),_T=Zf([xT,ki((([e])=>{const t=en(e).toVar();return la(.982,t)})).setLayout({name:"mx_gradient_scale3d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]})]),vT=ki((([e,t])=>{const r=qi(t).toVar(),s=Xi(e).toVar();return s.shiftLeft(r).bitOr(s.shiftRight(qi(32).sub(r)))})).setLayout({name:"mx_rotl32",type:"uint",inputs:[{name:"x",type:"uint"},{name:"k",type:"int"}]}),NT=ki((([e,t,r])=>{e.subAssign(r),e.bitXorAssign(vT(r,qi(4))),r.addAssign(t),t.subAssign(e),t.bitXorAssign(vT(e,qi(6))),e.addAssign(r),r.subAssign(t),r.bitXorAssign(vT(t,qi(8))),t.addAssign(e),e.subAssign(r),e.bitXorAssign(vT(r,qi(16))),r.addAssign(t),t.subAssign(e),t.bitXorAssign(vT(e,qi(19))),e.addAssign(r),r.subAssign(t),r.bitXorAssign(vT(t,qi(4))),t.addAssign(e)})),ST=ki((([e,t,r])=>{const s=Xi(r).toVar(),i=Xi(t).toVar(),n=Xi(e).toVar();return s.bitXorAssign(i),s.subAssign(vT(i,qi(14))),n.bitXorAssign(s),n.subAssign(vT(s,qi(11))),i.bitXorAssign(n),i.subAssign(vT(n,qi(25))),s.bitXorAssign(i),s.subAssign(vT(i,qi(16))),n.bitXorAssign(s),n.subAssign(vT(s,qi(4))),i.bitXorAssign(n),i.subAssign(vT(n,qi(14))),s.bitXorAssign(i),s.subAssign(vT(i,qi(24))),s})).setLayout({name:"mx_bjfinal",type:"uint",inputs:[{name:"a",type:"uint"},{name:"b",type:"uint"},{name:"c",type:"uint"}]}),ET=ki((([e])=>{const t=Xi(e).toVar();return ji(t).div(ji(Xi(qi(4294967295))))})).setLayout({name:"mx_bits_to_01",type:"float",inputs:[{name:"bits",type:"uint"}]}),wT=ki((([e])=>{const t=ji(e).toVar();return t.mul(t).mul(t).mul(t.mul(t.mul(6).sub(15)).add(10))})).setLayout({name:"mx_fade",type:"float",inputs:[{name:"t",type:"float"}]}),AT=Zf([ki((([e])=>{const t=qi(e).toVar(),r=Xi(Xi(1)).toVar(),s=Xi(Xi(qi(3735928559)).add(r.shiftLeft(Xi(2))).add(Xi(13))).toVar();return ST(s.add(Xi(t)),s,s)})).setLayout({name:"mx_hash_int_0",type:"uint",inputs:[{name:"x",type:"int"}]}),ki((([e,t])=>{const r=qi(t).toVar(),s=qi(e).toVar(),i=Xi(Xi(2)).toVar(),n=Xi().toVar(),a=Xi().toVar(),o=Xi().toVar();return n.assign(a.assign(o.assign(Xi(qi(3735928559)).add(i.shiftLeft(Xi(2))).add(Xi(13))))),n.addAssign(Xi(s)),a.addAssign(Xi(r)),ST(n,a,o)})).setLayout({name:"mx_hash_int_1",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),ki((([e,t,r])=>{const s=qi(r).toVar(),i=qi(t).toVar(),n=qi(e).toVar(),a=Xi(Xi(3)).toVar(),o=Xi().toVar(),u=Xi().toVar(),l=Xi().toVar();return o.assign(u.assign(l.assign(Xi(qi(3735928559)).add(a.shiftLeft(Xi(2))).add(Xi(13))))),o.addAssign(Xi(n)),u.addAssign(Xi(i)),l.addAssign(Xi(s)),ST(o,u,l)})).setLayout({name:"mx_hash_int_2",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),ki((([e,t,r,s])=>{const i=qi(s).toVar(),n=qi(r).toVar(),a=qi(t).toVar(),o=qi(e).toVar(),u=Xi(Xi(4)).toVar(),l=Xi().toVar(),d=Xi().toVar(),c=Xi().toVar();return l.assign(d.assign(c.assign(Xi(qi(3735928559)).add(u.shiftLeft(Xi(2))).add(Xi(13))))),l.addAssign(Xi(o)),d.addAssign(Xi(a)),c.addAssign(Xi(n)),NT(l,d,c),l.addAssign(Xi(i)),ST(l,d,c)})).setLayout({name:"mx_hash_int_3",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"}]}),ki((([e,t,r,s,i])=>{const n=qi(i).toVar(),a=qi(s).toVar(),o=qi(r).toVar(),u=qi(t).toVar(),l=qi(e).toVar(),d=Xi(Xi(5)).toVar(),c=Xi().toVar(),h=Xi().toVar(),p=Xi().toVar();return c.assign(h.assign(p.assign(Xi(qi(3735928559)).add(d.shiftLeft(Xi(2))).add(Xi(13))))),c.addAssign(Xi(l)),h.addAssign(Xi(u)),p.addAssign(Xi(o)),NT(c,h,p),c.addAssign(Xi(a)),h.addAssign(Xi(n)),ST(c,h,p)})).setLayout({name:"mx_hash_int_4",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"},{name:"yy",type:"int"}]})]),RT=Zf([ki((([e,t])=>{const r=qi(t).toVar(),s=qi(e).toVar(),i=Xi(AT(s,r)).toVar(),n=rn().toVar();return n.x.assign(i.bitAnd(qi(255))),n.y.assign(i.shiftRight(qi(8)).bitAnd(qi(255))),n.z.assign(i.shiftRight(qi(16)).bitAnd(qi(255))),n})).setLayout({name:"mx_hash_vec3_0",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),ki((([e,t,r])=>{const s=qi(r).toVar(),i=qi(t).toVar(),n=qi(e).toVar(),a=Xi(AT(n,i,s)).toVar(),o=rn().toVar();return o.x.assign(a.bitAnd(qi(255))),o.y.assign(a.shiftRight(qi(8)).bitAnd(qi(255))),o.z.assign(a.shiftRight(qi(16)).bitAnd(qi(255))),o})).setLayout({name:"mx_hash_vec3_1",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]})]),CT=Zf([ki((([e])=>{const t=Yi(e).toVar(),r=qi().toVar(),s=qi().toVar(),i=ji(lT(t.x,r)).toVar(),n=ji(lT(t.y,s)).toVar(),a=ji(wT(i)).toVar(),o=ji(wT(n)).toVar(),u=ji(dT(gT(AT(r,s),i,n),gT(AT(r.add(qi(1)),s),i.sub(1),n),gT(AT(r,s.add(qi(1))),i,n.sub(1)),gT(AT(r.add(qi(1)),s.add(qi(1))),i.sub(1),n.sub(1)),a,o)).toVar();return TT(u)})).setLayout({name:"mx_perlin_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"}]}),ki((([e])=>{const t=en(e).toVar(),r=qi().toVar(),s=qi().toVar(),i=qi().toVar(),n=ji(lT(t.x,r)).toVar(),a=ji(lT(t.y,s)).toVar(),o=ji(lT(t.z,i)).toVar(),u=ji(wT(n)).toVar(),l=ji(wT(a)).toVar(),d=ji(wT(o)).toVar(),c=ji(cT(gT(AT(r,s,i),n,a,o),gT(AT(r.add(qi(1)),s,i),n.sub(1),a,o),gT(AT(r,s.add(qi(1)),i),n,a.sub(1),o),gT(AT(r.add(qi(1)),s.add(qi(1)),i),n.sub(1),a.sub(1),o),gT(AT(r,s,i.add(qi(1))),n,a,o.sub(1)),gT(AT(r.add(qi(1)),s,i.add(qi(1))),n.sub(1),a,o.sub(1)),gT(AT(r,s.add(qi(1)),i.add(qi(1))),n,a.sub(1),o.sub(1)),gT(AT(r.add(qi(1)),s.add(qi(1)),i.add(qi(1))),n.sub(1),a.sub(1),o.sub(1)),u,l,d)).toVar();return _T(c)})).setLayout({name:"mx_perlin_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"}]})]),MT=Zf([ki((([e])=>{const t=Yi(e).toVar(),r=qi().toVar(),s=qi().toVar(),i=ji(lT(t.x,r)).toVar(),n=ji(lT(t.y,s)).toVar(),a=ji(wT(i)).toVar(),o=ji(wT(n)).toVar(),u=en(dT(yT(RT(r,s),i,n),yT(RT(r.add(qi(1)),s),i.sub(1),n),yT(RT(r,s.add(qi(1))),i,n.sub(1)),yT(RT(r.add(qi(1)),s.add(qi(1))),i.sub(1),n.sub(1)),a,o)).toVar();return TT(u)})).setLayout({name:"mx_perlin_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),ki((([e])=>{const t=en(e).toVar(),r=qi().toVar(),s=qi().toVar(),i=qi().toVar(),n=ji(lT(t.x,r)).toVar(),a=ji(lT(t.y,s)).toVar(),o=ji(lT(t.z,i)).toVar(),u=ji(wT(n)).toVar(),l=ji(wT(a)).toVar(),d=ji(wT(o)).toVar(),c=en(cT(yT(RT(r,s,i),n,a,o),yT(RT(r.add(qi(1)),s,i),n.sub(1),a,o),yT(RT(r,s.add(qi(1)),i),n,a.sub(1),o),yT(RT(r.add(qi(1)),s.add(qi(1)),i),n.sub(1),a.sub(1),o),yT(RT(r,s,i.add(qi(1))),n,a,o.sub(1)),yT(RT(r.add(qi(1)),s,i.add(qi(1))),n.sub(1),a,o.sub(1)),yT(RT(r,s.add(qi(1)),i.add(qi(1))),n,a.sub(1),o.sub(1)),yT(RT(r.add(qi(1)),s.add(qi(1)),i.add(qi(1))),n.sub(1),a.sub(1),o.sub(1)),u,l,d)).toVar();return _T(c)})).setLayout({name:"mx_perlin_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"}]})]),PT=Zf([ki((([e])=>{const t=ji(e).toVar(),r=qi(uT(t)).toVar();return ET(AT(r))})).setLayout({name:"mx_cell_noise_float_0",type:"float",inputs:[{name:"p",type:"float"}]}),ki((([e])=>{const t=Yi(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar();return ET(AT(r,s))})).setLayout({name:"mx_cell_noise_float_1",type:"float",inputs:[{name:"p",type:"vec2"}]}),ki((([e])=>{const t=en(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar(),i=qi(uT(t.z)).toVar();return ET(AT(r,s,i))})).setLayout({name:"mx_cell_noise_float_2",type:"float",inputs:[{name:"p",type:"vec3"}]}),ki((([e])=>{const t=nn(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar(),i=qi(uT(t.z)).toVar(),n=qi(uT(t.w)).toVar();return ET(AT(r,s,i,n))})).setLayout({name:"mx_cell_noise_float_3",type:"float",inputs:[{name:"p",type:"vec4"}]})]),FT=Zf([ki((([e])=>{const t=ji(e).toVar(),r=qi(uT(t)).toVar();return en(ET(AT(r,qi(0))),ET(AT(r,qi(1))),ET(AT(r,qi(2))))})).setLayout({name:"mx_cell_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"float"}]}),ki((([e])=>{const t=Yi(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar();return en(ET(AT(r,s,qi(0))),ET(AT(r,s,qi(1))),ET(AT(r,s,qi(2))))})).setLayout({name:"mx_cell_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),ki((([e])=>{const t=en(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar(),i=qi(uT(t.z)).toVar();return en(ET(AT(r,s,i,qi(0))),ET(AT(r,s,i,qi(1))),ET(AT(r,s,i,qi(2))))})).setLayout({name:"mx_cell_noise_vec3_2",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),ki((([e])=>{const t=nn(e).toVar(),r=qi(uT(t.x)).toVar(),s=qi(uT(t.y)).toVar(),i=qi(uT(t.z)).toVar(),n=qi(uT(t.w)).toVar();return en(ET(AT(r,s,i,n,qi(0))),ET(AT(r,s,i,n,qi(1))),ET(AT(r,s,i,n,qi(2))))})).setLayout({name:"mx_cell_noise_vec3_3",type:"vec3",inputs:[{name:"p",type:"vec4"}]})]),LT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=qi(t).toVar(),o=en(e).toVar(),u=ji(0).toVar(),l=ji(1).toVar();return Zc(a,(()=>{u.addAssign(l.mul(CT(o))),l.mulAssign(i),o.mulAssign(n)})),u})).setLayout({name:"mx_fractal_noise_float",type:"float",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),BT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=qi(t).toVar(),o=en(e).toVar(),u=en(0).toVar(),l=ji(1).toVar();return Zc(a,(()=>{u.addAssign(l.mul(MT(o))),l.mulAssign(i),o.mulAssign(n)})),u})).setLayout({name:"mx_fractal_noise_vec3",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),IT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=qi(t).toVar(),o=en(e).toVar();return Yi(LT(o,a,n,i),LT(o.add(en(qi(19),qi(193),qi(17))),a,n,i))})).setLayout({name:"mx_fractal_noise_vec2",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),DT=ki((([e,t,r,s])=>{const i=ji(s).toVar(),n=ji(r).toVar(),a=qi(t).toVar(),o=en(e).toVar(),u=en(BT(o,a,n,i)).toVar(),l=ji(LT(o.add(en(qi(19),qi(193),qi(17))),a,n,i)).toVar();return nn(u,l)})).setLayout({name:"mx_fractal_noise_vec4",type:"vec4",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),VT=Zf([ki((([e,t,r,s,i,n,a])=>{const o=qi(a).toVar(),u=ji(n).toVar(),l=qi(i).toVar(),d=qi(s).toVar(),c=qi(r).toVar(),h=qi(t).toVar(),p=Yi(e).toVar(),g=en(FT(Yi(h.add(d),c.add(l)))).toVar(),m=Yi(g.x,g.y).toVar();m.subAssign(.5),m.mulAssign(u),m.addAssign(.5);const f=Yi(Yi(ji(h),ji(c)).add(m)).toVar(),y=Yi(f.sub(p)).toVar();return Hi(o.equal(qi(2)),(()=>no(y.x).add(no(y.y)))),Hi(o.equal(qi(3)),(()=>_o(no(y.x),no(y.y)))),wo(y,y)})).setLayout({name:"mx_worley_distance_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),ki((([e,t,r,s,i,n,a,o,u])=>{const l=qi(u).toVar(),d=ji(o).toVar(),c=qi(a).toVar(),h=qi(n).toVar(),p=qi(i).toVar(),g=qi(s).toVar(),m=qi(r).toVar(),f=qi(t).toVar(),y=en(e).toVar(),b=en(FT(en(f.add(p),m.add(h),g.add(c)))).toVar();b.subAssign(.5),b.mulAssign(d),b.addAssign(.5);const x=en(en(ji(f),ji(m),ji(g)).add(b)).toVar(),T=en(x.sub(y)).toVar();return Hi(l.equal(qi(2)),(()=>no(T.x).add(no(T.y)).add(no(T.z)))),Hi(l.equal(qi(3)),(()=>_o(no(T.x),no(T.y),no(T.z)))),wo(T,T)})).setLayout({name:"mx_worley_distance_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"zoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]})]),UT=ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=Yi(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=Yi(lT(n.x,a),lT(n.y,o)).toVar(),l=ji(1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{const r=ji(VT(u,e,t,a,o,i,s)).toVar();l.assign(To(l,r))}))})),Hi(s.equal(qi(0)),(()=>{l.assign(qa(l))})),l})).setLayout({name:"mx_worley_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),OT=ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=Yi(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=Yi(lT(n.x,a),lT(n.y,o)).toVar(),l=Yi(1e6,1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{const r=ji(VT(u,e,t,a,o,i,s)).toVar();Hi(r.lessThan(l.x),(()=>{l.y.assign(l.x),l.x.assign(r)})).ElseIf(r.lessThan(l.y),(()=>{l.y.assign(r)}))}))})),Hi(s.equal(qi(0)),(()=>{l.assign(qa(l))})),l})).setLayout({name:"mx_worley_noise_vec2_0",type:"vec2",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),kT=ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=Yi(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=Yi(lT(n.x,a),lT(n.y,o)).toVar(),l=en(1e6,1e6,1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{const r=ji(VT(u,e,t,a,o,i,s)).toVar();Hi(r.lessThan(l.x),(()=>{l.z.assign(l.y),l.y.assign(l.x),l.x.assign(r)})).ElseIf(r.lessThan(l.y),(()=>{l.z.assign(l.y),l.y.assign(r)})).ElseIf(r.lessThan(l.z),(()=>{l.z.assign(r)}))}))})),Hi(s.equal(qi(0)),(()=>{l.assign(qa(l))})),l})).setLayout({name:"mx_worley_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),GT=Zf([UT,ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=en(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=qi().toVar(),l=en(lT(n.x,a),lT(n.y,o),lT(n.z,u)).toVar(),d=ji(1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{Zc({start:-1,end:qi(1),name:"z",condition:"<="},(({z:r})=>{const n=ji(VT(l,e,t,r,a,o,u,i,s)).toVar();d.assign(To(d,n))}))}))})),Hi(s.equal(qi(0)),(()=>{d.assign(qa(d))})),d})).setLayout({name:"mx_worley_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]})]),zT=Zf([OT,ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=en(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=qi().toVar(),l=en(lT(n.x,a),lT(n.y,o),lT(n.z,u)).toVar(),d=Yi(1e6,1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{Zc({start:-1,end:qi(1),name:"z",condition:"<="},(({z:r})=>{const n=ji(VT(l,e,t,r,a,o,u,i,s)).toVar();Hi(n.lessThan(d.x),(()=>{d.y.assign(d.x),d.x.assign(n)})).ElseIf(n.lessThan(d.y),(()=>{d.y.assign(n)}))}))}))})),Hi(s.equal(qi(0)),(()=>{d.assign(qa(d))})),d})).setLayout({name:"mx_worley_noise_vec2_1",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]})]),HT=Zf([kT,ki((([e,t,r])=>{const s=qi(r).toVar(),i=ji(t).toVar(),n=en(e).toVar(),a=qi().toVar(),o=qi().toVar(),u=qi().toVar(),l=en(lT(n.x,a),lT(n.y,o),lT(n.z,u)).toVar(),d=en(1e6,1e6,1e6).toVar();return Zc({start:-1,end:qi(1),name:"x",condition:"<="},(({x:e})=>{Zc({start:-1,end:qi(1),name:"y",condition:"<="},(({y:t})=>{Zc({start:-1,end:qi(1),name:"z",condition:"<="},(({z:r})=>{const n=ji(VT(l,e,t,r,a,o,u,i,s)).toVar();Hi(n.lessThan(d.x),(()=>{d.z.assign(d.y),d.y.assign(d.x),d.x.assign(n)})).ElseIf(n.lessThan(d.y),(()=>{d.z.assign(d.y),d.y.assign(n)})).ElseIf(n.lessThan(d.z),(()=>{d.z.assign(n)}))}))}))})),Hi(s.equal(qi(0)),(()=>{d.assign(qa(d))})),d})).setLayout({name:"mx_worley_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]})]),$T=ki((([e])=>{const t=e.y,r=e.z,s=en().toVar();return Hi(t.lessThan(1e-4),(()=>{s.assign(en(r,r,r))})).Else((()=>{let i=e.x;i=i.sub(Ka(i)).mul(6).toVar();const n=qi(mo(i)),a=i.sub(ji(n)),o=r.mul(t.oneMinus()),u=r.mul(t.mul(a).oneMinus()),l=r.mul(t.mul(a.oneMinus()).oneMinus());Hi(n.equal(qi(0)),(()=>{s.assign(en(r,l,o))})).ElseIf(n.equal(qi(1)),(()=>{s.assign(en(u,r,o))})).ElseIf(n.equal(qi(2)),(()=>{s.assign(en(o,r,l))})).ElseIf(n.equal(qi(3)),(()=>{s.assign(en(o,u,r))})).ElseIf(n.equal(qi(4)),(()=>{s.assign(en(l,o,r))})).Else((()=>{s.assign(en(r,o,u))}))})),s})).setLayout({name:"mx_hsvtorgb",type:"vec3",inputs:[{name:"hsv",type:"vec3"}]}),WT=ki((([e])=>{const t=en(e).toVar(),r=ji(t.x).toVar(),s=ji(t.y).toVar(),i=ji(t.z).toVar(),n=ji(To(r,To(s,i))).toVar(),a=ji(_o(r,_o(s,i))).toVar(),o=ji(a.sub(n)).toVar(),u=ji().toVar(),l=ji().toVar(),d=ji().toVar();return d.assign(a),Hi(a.greaterThan(0),(()=>{l.assign(o.div(a))})).Else((()=>{l.assign(0)})),Hi(l.lessThanEqual(0),(()=>{u.assign(0)})).Else((()=>{Hi(r.greaterThanEqual(a),(()=>{u.assign(s.sub(i).div(o))})).ElseIf(s.greaterThanEqual(a),(()=>{u.assign(oa(2,i.sub(r).div(o)))})).Else((()=>{u.assign(oa(4,r.sub(s).div(o)))})),u.mulAssign(1/6),Hi(u.lessThan(0),(()=>{u.addAssign(1)}))})),en(u,l,d)})).setLayout({name:"mx_rgbtohsv",type:"vec3",inputs:[{name:"c",type:"vec3"}]}),jT=ki((([e])=>{const t=en(e).toVar(),r=sn(ma(t,en(.04045))).toVar(),s=en(t.div(12.92)).toVar(),i=en(Ro(_o(t.add(en(.055)),en(0)).div(1.055),en(2.4))).toVar();return Io(s,i,r)})).setLayout({name:"mx_srgb_texture_to_lin_rec709",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),qT=(e,t)=>{e=ji(e),t=ji(t);const r=Yi(t.dFdx(),t.dFdy()).length().mul(.7071067811865476);return Oo(e.sub(r),e.add(r),t)},XT=(e,t,r,s)=>Io(e,t,r[s].clamp()),KT=(e,t,r,s,i)=>Io(e,t,qT(r,s[i])),YT=ki((([e,t,r])=>{const s=Qa(e).toVar(),i=ua(ji(.5).mul(t.sub(r)),Ol).div(s).toVar(),n=ua(ji(-.5).mul(t.sub(r)),Ol).div(s).toVar(),a=en().toVar();a.x=s.x.greaterThan(ji(0)).select(i.x,n.x),a.y=s.y.greaterThan(ji(0)).select(i.y,n.y),a.z=s.z.greaterThan(ji(0)).select(i.z,n.z);const o=To(a.x,a.y,a.z).toVar();return Ol.add(s.mul(o)).toVar().sub(r)})),QT=ki((([e,t])=>{const r=e.x,s=e.y,i=e.z;let n=t.element(0).mul(.886227);return n=n.add(t.element(1).mul(1.023328).mul(s)),n=n.add(t.element(2).mul(1.023328).mul(i)),n=n.add(t.element(3).mul(1.023328).mul(r)),n=n.add(t.element(4).mul(.858086).mul(r).mul(s)),n=n.add(t.element(5).mul(.858086).mul(s).mul(i)),n=n.add(t.element(6).mul(i.mul(i).mul(.743125).sub(.247708))),n=n.add(t.element(7).mul(.858086).mul(r).mul(i)),n=n.add(t.element(8).mul(.429043).mul(la(r,r).sub(la(s,s)))),n}));var ZT=Object.freeze({__proto__:null,BRDF_GGX:Gp,BRDF_Lambert:wp,BasicPointShadowFilter:jx,BasicShadowFilter:Rx,Break:Jc,Const:ru,Continue:()=>Du("continue").toStack(),DFGApprox:zp,D_GGX:Up,Discard:Vu,EPSILON:Ia,F_Schlick:Ep,Fn:ki,INFINITY:Da,If:Hi,Loop:Zc,NodeAccess:Os,NodeShaderStage:Ds,NodeType:Us,NodeUpdateType:Vs,PCFShadowFilter:Cx,PCFSoftShadowFilter:Mx,PI:Va,PI2:Ua,PointShadowFilter:qx,Return:()=>Du("return").toStack(),Schlick_to_F0:$p,ScriptableNodeResources:Bb,ShaderNode:Li,Stack:$i,Switch:(...e)=>ni.Switch(...e),TBNViewMatrix:Bd,VSMShadowFilter:Px,V_GGX_SmithCorrelated:Dp,Var:tu,abs:no,acesFilmicToneMapping:Tb,acos:so,add:oa,addMethodChaining:oi,addNodeElement:function(e){console.warn("THREE.TSL: AddNodeElement has been removed in favor of tree-shaking. Trying add",e)},agxToneMapping:Sb,all:Oa,alphaT:Rn,and:ba,anisotropy:Cn,anisotropyB:Pn,anisotropyT:Mn,any:ka,append:e=>(console.warn("THREE.TSL: append() has been renamed to Stack()."),$i(e)),array:ea,arrayBuffer:e=>Bi(new si(e,"ArrayBuffer")),asin:ro,assign:ra,atan:io,atan2:$o,atomicAdd:(e,t)=>sx(tx.ATOMIC_ADD,e,t),atomicAnd:(e,t)=>sx(tx.ATOMIC_AND,e,t),atomicFunc:sx,atomicLoad:e=>sx(tx.ATOMIC_LOAD,e,null),atomicMax:(e,t)=>sx(tx.ATOMIC_MAX,e,t),atomicMin:(e,t)=>sx(tx.ATOMIC_MIN,e,t),atomicOr:(e,t)=>sx(tx.ATOMIC_OR,e,t),atomicStore:(e,t)=>sx(tx.ATOMIC_STORE,e,t),atomicSub:(e,t)=>sx(tx.ATOMIC_SUB,e,t),atomicXor:(e,t)=>sx(tx.ATOMIC_XOR,e,t),attenuationColor:Hn,attenuationDistance:zn,attribute:Hu,attributeArray:(e,t="float")=>{let r,s;!0===t.isStruct?(r=t.layout.getLength(),s=ws("float")):(r=As(t),s=ws(t));const i=new Vy(e,r,s);return qc(i,t,e)},backgroundBlurriness:Hy,backgroundIntensity:$y,backgroundRotation:Wy,batch:Hc,billboarding:iy,bitAnd:va,bitNot:Na,bitOr:Sa,bitXor:Ea,bitangentGeometry:Rd,bitangentLocal:Cd,bitangentView:Md,bitangentWorld:Pd,bitcast:bo,blendBurn:Wh,blendColor:Kh,blendDodge:jh,blendOverlay:Xh,blendScreen:qh,blur:Hg,bool:Ki,buffer:tl,bufferAttribute:_u,bumpMap:Hd,burn:(...e)=>(console.warn('THREE.TSL: "burn" has been renamed. Use "blendBurn" instead.'),Wh(e)),bvec2:Ji,bvec3:sn,bvec4:un,bypass:Pu,cache:Ru,call:ia,cameraFar:ul,cameraIndex:al,cameraNear:ol,cameraNormalMatrix:pl,cameraPosition:gl,cameraProjectionMatrix:ll,cameraProjectionMatrixInverse:dl,cameraViewMatrix:cl,cameraWorldMatrix:hl,cbrt:Lo,cdl:ub,ceil:Ya,checker:iT,cineonToneMapping:bb,clamp:Do,clearcoat:_n,clearcoatRoughness:vn,code:Ab,color:Wi,colorSpaceToWorking:hu,colorToDirection:e=>Bi(e).mul(2).sub(1),compute:wu,computeSkinning:(e,t=null)=>{const r=new Kc(e);return r.positionNode=qc(new F(e.geometry.getAttribute("position").array,3),"vec3").setPBO(!0).toReadOnly().element(Lc).toVar(),r.skinIndexNode=qc(new F(new Uint32Array(e.geometry.getAttribute("skinIndex").array),4),"uvec4").setPBO(!0).toReadOnly().element(Lc).toVar(),r.skinWeightNode=qc(new F(e.geometry.getAttribute("skinWeight").array,4),"vec4").setPBO(!0).toReadOnly().element(Lc).toVar(),r.bindMatrixNode=Zn(e.bindMatrix,"mat4"),r.bindMatrixInverseNode=Zn(e.bindMatrixInverse,"mat4"),r.boneMatricesNode=tl(e.skeleton.boneMatrices,"mat4",e.skeleton.bones.length),r.toPositionNode=t,Bi(r)},cond:Ko,context:Qo,convert:pn,convertColorSpace:(e,t,r)=>Bi(new du(Bi(e),t,r)),convertToTexture:(e,...t)=>e.isTextureNode?e:e.isPassNode?e.getTextureNode():Fy(e,...t),cos:eo,cross:Ao,cubeTexture:gd,cubeTextureBase:pd,cubeToUV:Wx,dFdx:co,dFdy:ho,dashSize:Dn,debug:Gu,decrement:Pa,decrementBefore:Ca,defaultBuildStages:Gs,defaultShaderStages:ks,defined:Pi,degrees:za,deltaTime:ey,densityFog:function(e,t){return console.warn('THREE.TSL: "densityFog( color, density )" is deprecated. Use "fog( color, densityFogFactor( density ) )" instead.'),kb(e,Ob(t))},densityFogFactor:Ob,depth:Dh,depthPass:(e,t,r)=>Bi(new gb(gb.DEPTH,e,t,r)),difference:Eo,diffuseColor:yn,directPointLight:rT,directionToColor:up,dispersion:$n,distance:So,div:da,dodge:(...e)=>(console.warn('THREE.TSL: "dodge" has been renamed. Use "blendDodge" instead.'),jh(e)),dot:wo,drawIndex:Vc,dynamicBufferAttribute:vu,element:hn,emissive:bn,equal:ha,equals:xo,equirectUV:hp,exp:Ha,exp2:$a,expression:Du,faceDirection:Wl,faceForward:ko,faceforward:Wo,float:ji,floor:Ka,fog:kb,fract:Za,frameGroup:Xn,frameId:ty,frontFacing:$l,fwidth:fo,gain:(e,t)=>e.lessThan(.5)?jf(e.mul(2),t).div(2):ua(1,jf(la(ua(1,e),2),t).div(2)),gapSize:Vn,getConstNodeType:Fi,getCurrentStack:zi,getDirection:Og,getDistanceAttenuation:tT,getGeometryRoughness:Bp,getNormalFromDepth:Iy,getParallaxCorrectNormal:YT,getRoughness:Ip,getScreenPosition:By,getShIrradianceAt:QT,getShadowMaterial:Lx,getShadowRenderObjectFunction:Dx,getTextureIndex:zf,getViewPosition:Ly,globalId:Kb,glsl:(e,t)=>Ab(e,t,"glsl"),glslFn:(e,t)=>Cb(e,t,"glsl"),grayscale:sb,greaterThan:ma,greaterThanEqual:ya,hash:Wf,highpModelNormalViewMatrix:Il,highpModelViewMatrix:Bl,hue:ab,increment:Ma,incrementBefore:Ra,instance:Oc,instanceIndex:Lc,instancedArray:(e,t="float")=>{let r,s;!0===t.isStruct?(r=t.layout.getLength(),s=ws("float")):(r=As(t),s=ws(t));const i=new Dy(e,r,s);return qc(i,t,e)},instancedBufferAttribute:Nu,instancedDynamicBufferAttribute:Su,instancedMesh:Gc,int:qi,inverseSqrt:Xa,inversesqrt:jo,invocationLocalIndex:Dc,invocationSubgroupIndex:Ic,ior:On,iridescence:En,iridescenceIOR:wn,iridescenceThickness:An,ivec2:Qi,ivec3:tn,ivec4:an,js:(e,t)=>Ab(e,t,"js"),label:Zo,length:oo,lengthSq:Bo,lessThan:ga,lessThanEqual:fa,lightPosition:ux,lightProjectionUV:ox,lightShadowMatrix:ax,lightTargetDirection:cx,lightTargetPosition:lx,lightViewPosition:dx,lightingContext:uh,lights:(e=[])=>Bi(new mx).setLights(e),linearDepth:Vh,linearToneMapping:fb,localId:Yb,log:Wa,log2:ja,logarithmicDepthToViewZ:(e,t,r)=>{const s=e.mul(Wa(r.div(t)));return ji(Math.E).pow(s).mul(t).negate()},loop:(...e)=>(console.warn("THREE.TSL: loop() has been renamed to Loop()."),Zc(...e)),luminance:ob,mat2:ln,mat3:dn,mat4:cn,matcapUV:Pm,materialAO:Rc,materialAlphaTest:jd,materialAnisotropy:cc,materialAnisotropyVector:Cc,materialAttenuationColor:xc,materialAttenuationDistance:bc,materialClearcoat:nc,materialClearcoatNormal:oc,materialClearcoatRoughness:ac,materialColor:qd,materialDispersion:wc,materialEmissive:Kd,materialEnvIntensity:nd,materialEnvRotation:ad,materialIOR:yc,materialIridescence:hc,materialIridescenceIOR:pc,materialIridescenceThickness:gc,materialLightMap:Ac,materialLineDashOffset:Sc,materialLineDashSize:_c,materialLineGapSize:vc,materialLineScale:Tc,materialLineWidth:Nc,materialMetalness:sc,materialNormal:ic,materialOpacity:Yd,materialPointSize:Ec,materialReference:Td,materialReflectivity:tc,materialRefractionRatio:id,materialRotation:uc,materialRoughness:rc,materialSheen:lc,materialSheenRoughness:dc,materialShininess:Xd,materialSpecular:Qd,materialSpecularColor:Jd,materialSpecularIntensity:Zd,materialSpecularStrength:ec,materialThickness:fc,materialTransmission:mc,max:_o,maxMipLevel:Xu,mediumpModelViewMatrix:Ll,metalness:Tn,min:To,mix:Io,mixElement:zo,mod:ca,modInt:La,modelDirection:Sl,modelNormalMatrix:Ml,modelPosition:wl,modelRadius:Cl,modelScale:Al,modelViewMatrix:Fl,modelViewPosition:Rl,modelViewProjection:Mc,modelWorldMatrix:El,modelWorldMatrixInverse:Pl,morphReference:ih,mrt:$f,mul:la,mx_aastep:qT,mx_cell_noise_float:(e=$u())=>PT(e.convert("vec2|vec3")),mx_contrast:(e,t=1,r=.5)=>ji(e).sub(r).mul(t).add(r),mx_fractal_noise_float:(e=$u(),t=3,r=2,s=.5,i=1)=>LT(e,qi(t),r,s).mul(i),mx_fractal_noise_vec2:(e=$u(),t=3,r=2,s=.5,i=1)=>IT(e,qi(t),r,s).mul(i),mx_fractal_noise_vec3:(e=$u(),t=3,r=2,s=.5,i=1)=>BT(e,qi(t),r,s).mul(i),mx_fractal_noise_vec4:(e=$u(),t=3,r=2,s=.5,i=1)=>DT(e,qi(t),r,s).mul(i),mx_hsvtorgb:$T,mx_noise_float:(e=$u(),t=1,r=0)=>CT(e.convert("vec2|vec3")).mul(t).add(r),mx_noise_vec3:(e=$u(),t=1,r=0)=>MT(e.convert("vec2|vec3")).mul(t).add(r),mx_noise_vec4:(e=$u(),t=1,r=0)=>{e=e.convert("vec2|vec3");return nn(MT(e),CT(e.add(Yi(19,73)))).mul(t).add(r)},mx_ramplr:(e,t,r=$u())=>XT(e,t,r,"x"),mx_ramptb:(e,t,r=$u())=>XT(e,t,r,"y"),mx_rgbtohsv:WT,mx_safepower:(e,t=1)=>(e=ji(e)).abs().pow(t).mul(e.sign()),mx_splitlr:(e,t,r,s=$u())=>KT(e,t,r,s,"x"),mx_splittb:(e,t,r,s=$u())=>KT(e,t,r,s,"y"),mx_srgb_texture_to_lin_rec709:jT,mx_transform_uv:(e=1,t=0,r=$u())=>r.mul(e).add(t),mx_worley_noise_float:(e=$u(),t=1)=>GT(e.convert("vec2|vec3"),t,qi(1)),mx_worley_noise_vec2:(e=$u(),t=1)=>zT(e.convert("vec2|vec3"),t,qi(1)),mx_worley_noise_vec3:(e=$u(),t=1)=>HT(e.convert("vec2|vec3"),t,qi(1)),namespace:Cu,negate:uo,neutralToneMapping:Eb,nodeArray:Di,nodeImmutable:Ui,nodeObject:Bi,nodeObjects:Ii,nodeProxy:Vi,normalFlat:Xl,normalGeometry:jl,normalLocal:ql,normalMap:Od,normalView:Kl,normalWorld:Yl,normalize:Qa,not:Ta,notEqual:pa,numWorkgroups:qb,objectDirection:yl,objectGroup:Yn,objectPosition:xl,objectRadius:vl,objectScale:Tl,objectViewPosition:_l,objectWorldMatrix:bl,oneMinus:lo,or:xa,orthographicDepthToViewZ:(e,t,r)=>t.sub(r).mul(e).sub(t),oscSawtooth:(e=Jf)=>e.fract(),oscSine:(e=Jf)=>e.add(.75).mul(2*Math.PI).sin().mul(.5).add(.5),oscSquare:(e=Jf)=>e.fract().round(),oscTriangle:(e=Jf)=>e.add(.5).fract().mul(2).sub(1).abs(),output:In,outputStruct:Gf,overlay:(...e)=>(console.warn('THREE.TSL: "overlay" has been renamed. Use "blendOverlay" instead.'),Xh(e)),overloadingFn:Zf,parabola:jf,parallaxDirection:Id,parallaxUV:(e,t)=>e.sub(Id.mul(t)),parameter:(e,t)=>Bi(new If(e,t)),pass:(e,t,r)=>Bi(new gb(gb.COLOR,e,t,r)),passTexture:(e,t)=>Bi(new hb(e,t)),pcurve:(e,t,r)=>Ro(da(Ro(e,t),oa(Ro(e,t),Ro(ua(1,e),r))),1/t),perspectiveDepthToViewZ:Lh,pmremTexture:mm,pointShadow:Jx,pointUV:Oy,pointWidth:Un,positionGeometry:Dl,positionLocal:Vl,positionPrevious:Ul,positionView:Gl,positionViewDirection:zl,positionWorld:Ol,positionWorldDirection:kl,posterize:db,pow:Ro,pow2:Co,pow3:Mo,pow4:Po,premultiplyAlpha:Yh,property:mn,radians:Ga,rand:Go,range:$b,rangeFog:function(e,t,r){return console.warn('THREE.TSL: "rangeFog( color, near, far )" is deprecated. Use "fog( color, rangeFogFactor( near, far ) )" instead.'),kb(e,Ub(t,r))},rangeFogFactor:Ub,reciprocal:go,reference:yd,referenceBuffer:bd,reflect:No,reflectVector:ld,reflectView:od,reflector:e=>Bi(new Sy(e)),refract:Uo,refractVector:dd,refractView:ud,reinhardToneMapping:yb,remainder:Fa,remap:Lu,remapClamp:Bu,renderGroup:Kn,renderOutput:Ou,rendererReference:fu,rotate:Im,rotateUV:ry,roughness:xn,round:po,rtt:Fy,sRGBTransferEOTF:ou,sRGBTransferOETF:uu,sampler:e=>(!0===e.isNode?e:Zu(e)).convert("sampler"),samplerComparison:e=>(!0===e.isNode?e:Zu(e)).convert("samplerComparison"),saturate:Vo,saturation:ib,screen:(...e)=>(console.warn('THREE.TSL: "screen" has been renamed. Use "blendScreen" instead.'),qh(e)),screenCoordinate:mh,screenSize:gh,screenUV:ph,scriptable:Db,scriptableValue:Pb,select:Xo,setCurrentStack:Gi,shaderStages:zs,shadow:Hx,shadowPositionWorld:yx,shapeCircle:nT,sharedUniformGroup:qn,sheen:Nn,sheenRoughness:Sn,shiftLeft:wa,shiftRight:Aa,shininess:Bn,sign:ao,sin:Ja,sinc:(e,t)=>Ja(Va.mul(t.mul(e).sub(1))).div(Va.mul(t.mul(e).sub(1))),skinning:Yc,smoothstep:Oo,smoothstepElement:Ho,specularColor:Fn,specularF90:Ln,spherizeUV:sy,split:(e,t)=>Bi(new Zs(Bi(e),t)),spritesheetUV:oy,sqrt:qa,stack:Vf,step:vo,storage:qc,storageBarrier:()=>Zb("storage").toStack(),storageObject:(e,t,r)=>(console.warn('THREE.TSL: "storageObject()" is deprecated. Use "storage().setPBO( true )" instead.'),qc(e,t,r).setPBO(!0)),storageTexture:qy,string:(e="")=>Bi(new si(e,"string")),struct:(e,t=null)=>{const r=new Uf(e,t),s=(...t)=>{let s=null;if(t.length>0)if(t[0].isNode){s={};const r=Object.keys(e);for(let e=0;eZb("texture").toStack(),textureBicubic:lg,textureCubeUV:kg,textureLoad:Ju,textureSize:ju,textureStore:(e,t,r)=>{const s=qy(e,t,r);return null!==r&&s.toStack(),s},thickness:Gn,time:Jf,timerDelta:(e=1)=>(console.warn('TSL: timerDelta() is deprecated. Use "deltaTime" instead.'),ey.mul(e)),timerGlobal:(e=1)=>(console.warn('TSL: timerGlobal() is deprecated. Use "time" instead.'),Jf.mul(e)),timerLocal:(e=1)=>(console.warn('TSL: timerLocal() is deprecated. Use "time" instead.'),Jf.mul(e)),toneMapping:bu,toneMappingExposure:xu,toonOutlinePass:(t,r,s=new e(0,0,0),i=.003,n=1)=>Bi(new mb(t,r,Bi(s),Bi(i),Bi(n))),transformDirection:Fo,transformNormal:ed,transformNormalToView:td,transformedBentNormalView:Dd,transformedBitangentView:Fd,transformedBitangentWorld:Ld,transformedClearcoatNormalView:Jl,transformedNormalView:Ql,transformedNormalWorld:Zl,transformedTangentView:Ed,transformedTangentWorld:wd,transmission:kn,transpose:yo,triNoise3D:Kf,triplanarTexture:(...e)=>ly(...e),triplanarTextures:ly,trunc:mo,tslFn:(...e)=>(console.warn("THREE.TSL: tslFn() has been renamed to Fn()."),ki(...e)),uint:Xi,uniform:Zn,uniformArray:il,uniformCubeTexture:(e=cd)=>pd(e),uniformGroup:jn,uniformTexture:(e=Ku)=>Zu(e),uniforms:(e,t)=>(console.warn("THREE.TSL: uniforms() has been renamed to uniformArray()."),Bi(new sl(e,t))),unpremultiplyAlpha:Qh,userData:(e,t,r)=>Bi(new Qy(e,t,r)),uv:$u,uvec2:Zi,uvec3:rn,uvec4:on,varying:nu,varyingProperty:fn,vec2:Yi,vec3:en,vec4:nn,vectorComponents:Hs,velocity:rb,vertexColor:$h,vertexIndex:Fc,vertexStage:au,vibrance:nb,viewZToLogarithmicDepth:Bh,viewZToOrthographicDepth:Ph,viewZToPerspectiveDepth:Fh,viewport:fh,viewportBottomLeft:vh,viewportCoordinate:bh,viewportDepthTexture:Ch,viewportLinearDepth:Uh,viewportMipTexture:wh,viewportResolution:Th,viewportSafeUV:ny,viewportSharedTexture:np,viewportSize:yh,viewportTexture:Eh,viewportTopLeft:_h,viewportUV:xh,wgsl:(e,t)=>Ab(e,t,"wgsl"),wgslFn:(e,t)=>Cb(e,t,"wgsl"),workgroupArray:(e,t)=>Bi(new ex("Workgroup",e,t)),workgroupBarrier:()=>Zb("workgroup").toStack(),workgroupId:Xb,workingToColorSpace:cu,xor:_a});const JT=new Bf;class e_ extends ef{constructor(e,t){super(),this.renderer=e,this.nodes=t}update(e,t,r){const s=this.renderer,i=this.nodes.getBackgroundNode(e)||e.background;let n=!1;if(null===i)s._clearColor.getRGB(JT),JT.a=s._clearColor.a;else if(!0===i.isColor)i.getRGB(JT),JT.a=1,n=!0;else if(!0===i.isNode){const o=this.get(e),u=i;JT.copy(s._clearColor);let l=o.backgroundMesh;if(void 0===l){const c=Qo(nn(u).mul($y),{getUV:()=>Wy.mul(Yl),getTextureLevel:()=>Hy});let h=Mc;h=h.setZ(h.w);const p=new Zh;function g(){i.removeEventListener("dispose",g),l.material.dispose(),l.geometry.dispose()}p.name="Background.material",p.side=S,p.depthTest=!1,p.depthWrite=!1,p.allowOverride=!1,p.fog=!1,p.lights=!1,p.vertexNode=h,p.colorNode=c,o.backgroundMeshNode=c,o.backgroundMesh=l=new q(new Oe(1,32,32),p),l.frustumCulled=!1,l.name="Background.mesh",l.onBeforeRender=function(e,t,r){this.matrixWorld.copyPosition(r.matrixWorld)},i.addEventListener("dispose",g)}const d=u.getCacheKey();o.backgroundCacheKey!==d&&(o.backgroundMeshNode.node=nn(u).mul($y),o.backgroundMeshNode.needsUpdate=!0,l.material.needsUpdate=!0,o.backgroundCacheKey=d),t.unshift(l,l.geometry,l.material,0,0,null,null)}else console.error("THREE.Renderer: Unsupported background configuration.",i);const a=s.xr.getEnvironmentBlendMode();if("additive"===a?JT.set(0,0,0,1):"alpha-blend"===a&&JT.set(0,0,0,0),!0===s.autoClear||!0===n){const m=r.clearColorValue;m.r=JT.r,m.g=JT.g,m.b=JT.b,m.a=JT.a,!0!==s.backend.isWebGLBackend&&!0!==s.alpha||(m.r*=m.a,m.g*=m.a,m.b*=m.a),r.depthClearValue=s._clearDepth,r.stencilClearValue=s._clearStencil,r.clearColor=!0===s.autoClearColor,r.clearDepth=!0===s.autoClearDepth,r.clearStencil=!0===s.autoClearStencil}else r.clearColor=!1,r.clearDepth=!1,r.clearStencil=!1}}let t_=0;class r_{constructor(e="",t=[],r=0,s=[]){this.name=e,this.bindings=t,this.index=r,this.bindingsReference=s,this.id=t_++}}class s_{constructor(e,t,r,s,i,n,a,o,u,l=[]){this.vertexShader=e,this.fragmentShader=t,this.computeShader=r,this.transforms=l,this.nodeAttributes=s,this.bindings=i,this.updateNodes=n,this.updateBeforeNodes=a,this.updateAfterNodes=o,this.observer=u,this.usedTimes=0}createBindings(){const e=[];for(const t of this.bindings){if(!0!==t.bindings[0].groupNode.shared){const r=new r_(t.name,[],t.index,t);e.push(r);for(const e of t.bindings)r.bindings.push(e.clone())}else e.push(t)}return e}}class i_{constructor(e,t,r=null){this.isNodeAttribute=!0,this.name=e,this.type=t,this.node=r}}class n_{constructor(e,t,r){this.isNodeUniform=!0,this.name=e,this.type=t,this.node=r.getSelf()}get value(){return this.node.value}set value(e){this.node.value=e}get id(){return this.node.id}get groupNode(){return this.node.groupNode}}class a_{constructor(e,t,r=!1,s=null){this.isNodeVar=!0,this.name=e,this.type=t,this.readOnly=r,this.count=s}}class o_ extends a_{constructor(e,t,r=null,s=null){super(e,t),this.needsInterpolation=!1,this.isNodeVarying=!0,this.interpolationType=r,this.interpolationSampling=s}}class u_{constructor(e,t,r=""){this.name=e,this.type=t,this.code=r,Object.defineProperty(this,"isNodeCode",{value:!0})}}let l_=0;class d_{constructor(e=null){this.id=l_++,this.nodesData=new WeakMap,this.parent=e}getData(e){let t=this.nodesData.get(e);return void 0===t&&null!==this.parent&&(t=this.parent.getData(e)),t}setData(e,t){this.nodesData.set(e,t)}}class c_{constructor(e,t){this.name=e,this.members=t,this.output=!1}}class h_{constructor(e,t){this.name=e,this.value=t,this.boundary=0,this.itemSize=0,this.offset=0}setValue(e){this.value=e}getValue(){return this.value}}class p_ extends h_{constructor(e,t=0){super(e,t),this.isNumberUniform=!0,this.boundary=4,this.itemSize=1}}class g_ extends h_{constructor(e,r=new t){super(e,r),this.isVector2Uniform=!0,this.boundary=8,this.itemSize=2}}class m_ extends h_{constructor(e,t=new r){super(e,t),this.isVector3Uniform=!0,this.boundary=16,this.itemSize=3}}class f_ extends h_{constructor(e,t=new s){super(e,t),this.isVector4Uniform=!0,this.boundary=16,this.itemSize=4}}class y_ extends h_{constructor(t,r=new e){super(t,r),this.isColorUniform=!0,this.boundary=16,this.itemSize=3}}class b_ extends h_{constructor(e,t=new i){super(e,t),this.isMatrix2Uniform=!0,this.boundary=8,this.itemSize=4}}class x_ extends h_{constructor(e,t=new n){super(e,t),this.isMatrix3Uniform=!0,this.boundary=48,this.itemSize=12}}class T_ extends h_{constructor(e,t=new a){super(e,t),this.isMatrix4Uniform=!0,this.boundary=64,this.itemSize=16}}class __ extends p_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class v_ extends g_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class N_ extends m_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class S_ extends f_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class E_ extends y_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class w_ extends b_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class A_ extends x_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class R_ extends T_{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}const C_=new WeakMap,M_=new Map([[Int8Array,"int"],[Int16Array,"int"],[Int32Array,"int"],[Uint8Array,"uint"],[Uint16Array,"uint"],[Uint32Array,"uint"],[Float32Array,"float"]]),P_=e=>/e/g.test(e)?String(e).replace(/\+/g,""):(e=Number(e))+(e%1?"":".0");class F_{constructor(e,t,r){this.object=e,this.material=e&&e.material||null,this.geometry=e&&e.geometry||null,this.renderer=t,this.parser=r,this.scene=null,this.camera=null,this.nodes=[],this.sequentialNodes=[],this.updateNodes=[],this.updateBeforeNodes=[],this.updateAfterNodes=[],this.hashNodes={},this.observer=null,this.lightsNode=null,this.environmentNode=null,this.fogNode=null,this.clippingContext=null,this.vertexShader=null,this.fragmentShader=null,this.computeShader=null,this.flowNodes={vertex:[],fragment:[],compute:[]},this.flowCode={vertex:"",fragment:"",compute:""},this.uniforms={vertex:[],fragment:[],compute:[],index:0},this.structs={vertex:[],fragment:[],compute:[],index:0},this.bindings={vertex:{},fragment:{},compute:{}},this.bindingsIndexes={},this.bindGroups=null,this.attributes=[],this.bufferAttributes=[],this.varyings=[],this.codes={},this.vars={},this.declarations={},this.flow={code:""},this.chaining=[],this.stack=Vf(),this.stacks=[],this.tab="\t",this.currentFunctionNode=null,this.context={material:this.material},this.cache=new d_,this.globalCache=this.cache,this.flowsData=new WeakMap,this.shaderStage=null,this.buildStage=null}getBindGroupsCache(){let e=C_.get(this.renderer);return void 0===e&&(e=new Km,C_.set(this.renderer,e)),e}createRenderTarget(e,t,r){return new oe(e,t,r)}createCubeRenderTarget(e,t){return new pp(e,t)}includes(e){return this.nodes.includes(e)}getOutputStructName(){}_getBindGroup(e,t){const r=this.getBindGroupsCache(),s=[];let i,n=!0;for(const e of t)s.push(e),n=n&&!0!==e.groupNode.shared;return n?(i=r.get(s),void 0===i&&(i=new r_(e,s,this.bindingsIndexes[e].group,s),r.set(s,i))):i=new r_(e,s,this.bindingsIndexes[e].group,s),i}getBindGroupArray(e,t){const r=this.bindings[t];let s=r[e];return void 0===s&&(void 0===this.bindingsIndexes[e]&&(this.bindingsIndexes[e]={binding:0,group:Object.keys(this.bindingsIndexes).length}),r[e]=s=[]),s}getBindings(){let e=this.bindGroups;if(null===e){const t={},r=this.bindings;for(const e of zs)for(const s in r[e]){const i=r[e][s];(t[s]||(t[s]=[])).push(...i)}e=[];for(const r in t){const s=t[r],i=this._getBindGroup(r,s);e.push(i)}this.bindGroups=e}return e}sortBindingGroups(){const e=this.getBindings();e.sort(((e,t)=>e.bindings[0].groupNode.order-t.bindings[0].groupNode.order));for(let t=0;t=0?`${Math.round(n)}u`:"0u";if("bool"===i)return n?"true":"false";if("color"===i)return`${this.getType("vec3")}( ${P_(n.r)}, ${P_(n.g)}, ${P_(n.b)} )`;const a=this.getTypeLength(i),o=this.getComponentType(i),u=e=>this.generateConst(o,e);if(2===a)return`${this.getType(i)}( ${u(n.x)}, ${u(n.y)} )`;if(3===a)return`${this.getType(i)}( ${u(n.x)}, ${u(n.y)}, ${u(n.z)} )`;if(4===a&&"mat2"!==i)return`${this.getType(i)}( ${u(n.x)}, ${u(n.y)}, ${u(n.z)}, ${u(n.w)} )`;if(a>=4&&n&&(n.isMatrix2||n.isMatrix3||n.isMatrix4))return`${this.getType(i)}( ${n.elements.map(u).join(", ")} )`;if(a>4)return`${this.getType(i)}()`;throw new Error(`NodeBuilder: Type '${i}' not found in generate constant attempt.`)}getType(e){return"color"===e?"vec3":e}hasGeometryAttribute(e){return this.geometry&&void 0!==this.geometry.getAttribute(e)}getAttribute(e,t){const r=this.attributes;for(const t of r)if(t.name===e)return t;const s=new i_(e,t);return this.registerDeclaration(s),r.push(s),s}getPropertyName(e){return e.name}isVector(e){return/vec\d/.test(e)}isMatrix(e){return/mat\d/.test(e)}isReference(e){return"void"===e||"property"===e||"sampler"===e||"samplerComparison"===e||"texture"===e||"cubeTexture"===e||"storageTexture"===e||"depthTexture"===e||"texture3D"===e}needsToWorkingColorSpace(){return!1}getComponentTypeFromTexture(e){const t=e.type;if(e.isDataTexture){if(t===_)return"int";if(t===T)return"uint"}return"float"}getElementType(e){return"mat2"===e?"vec2":"mat3"===e?"vec3":"mat4"===e?"vec4":this.getComponentType(e)}getComponentType(e){if("float"===(e=this.getVectorType(e))||"bool"===e||"int"===e||"uint"===e)return e;const t=/(b|i|u|)(vec|mat)([2-4])/.exec(e);return null===t?null:"b"===t[1]?"bool":"i"===t[1]?"int":"u"===t[1]?"uint":"float"}getVectorType(e){return"color"===e?"vec3":"texture"===e||"cubeTexture"===e||"storageTexture"===e||"texture3D"===e?"vec4":e}getTypeFromLength(e,t="float"){if(1===e)return t;let r=Es(e);const s="float"===t?"":t[0];return!0===/mat2/.test(t)&&(r=r.replace("vec","mat")),s+r}getTypeFromArray(e){return M_.get(e.constructor)}isInteger(e){return/int|uint|(i|u)vec/.test(e)}getTypeFromAttribute(e){let t=e;e.isInterleavedBufferAttribute&&(t=e.data);const r=t.array,s=e.itemSize,i=e.normalized;let n;return e instanceof ze||!0===i||(n=this.getTypeFromArray(r)),this.getTypeFromLength(s,n)}getTypeLength(e){const t=this.getVectorType(e),r=/vec([2-4])/.exec(t);return null!==r?Number(r[1]):"float"===t||"bool"===t||"int"===t||"uint"===t?1:!0===/mat2/.test(e)?4:!0===/mat3/.test(e)?9:!0===/mat4/.test(e)?16:0}getVectorFromMatrix(e){return e.replace("mat","vec")}changeComponentType(e,t){return this.getTypeFromLength(this.getTypeLength(e),t)}getIntegerType(e){const t=this.getComponentType(e);return"int"===t||"uint"===t?e:this.changeComponentType(e,"int")}addStack(){return this.stack=Vf(this.stack),this.stacks.push(zi()||this.stack),Gi(this.stack),this.stack}removeStack(){const e=this.stack;return this.stack=e.parent,Gi(this.stacks.pop()),e}getDataFromNode(e,t=this.shaderStage,r=null){let s=(r=null===r?e.isGlobal(this)?this.globalCache:this.cache:r).getData(e);return void 0===s&&(s={},r.setData(e,s)),void 0===s[t]&&(s[t]={}),s[t]}getNodeProperties(e,t="any"){const r=this.getDataFromNode(e,t);return r.properties||(r.properties={outputNode:null})}getBufferAttributeFromNode(e,t){const r=this.getDataFromNode(e);let s=r.bufferAttribute;if(void 0===s){const i=this.uniforms.index++;s=new i_("nodeAttribute"+i,t,e),this.bufferAttributes.push(s),r.bufferAttribute=s}return s}getStructTypeFromNode(e,t,r=null,s=this.shaderStage){const i=this.getDataFromNode(e,s,this.globalCache);let n=i.structType;if(void 0===n){const e=this.structs.index++;null===r&&(r="StructType"+e),n=new c_(r,t),this.structs[s].push(n),i.structType=n}return n}getOutputStructTypeFromNode(e,t){const r=this.getStructTypeFromNode(e,t,"OutputType","fragment");return r.output=!0,r}getUniformFromNode(e,t,r=this.shaderStage,s=null){const i=this.getDataFromNode(e,r,this.globalCache);let n=i.uniform;if(void 0===n){const a=this.uniforms.index++;n=new n_(s||"nodeUniform"+a,t,e),this.uniforms[r].push(n),this.registerDeclaration(n),i.uniform=n}return n}getArrayCount(e){let t=null;return e.isArrayNode?t=e.count:e.isVarNode&&e.node.isArrayNode&&(t=e.node.count),t}getVarFromNode(e,t=null,r=e.getNodeType(this),s=this.shaderStage,i=!1){const n=this.getDataFromNode(e,s);let a=n.variable;if(void 0===a){const o=i?"_const":"_var",u=this.vars[s]||(this.vars[s]=[]),l=this.vars[o]||(this.vars[o]=0);null===t&&(t=(i?"nodeConst":"nodeVar")+l,this.vars[o]++);const d=this.getArrayCount(e);a=new a_(t,r,i,d),i||u.push(a),this.registerDeclaration(a),n.variable=a}return a}isDeterministic(e){if(e.isMathNode)return this.isDeterministic(e.aNode)&&(!e.bNode||this.isDeterministic(e.bNode))&&(!e.cNode||this.isDeterministic(e.cNode));if(e.isOperatorNode)return this.isDeterministic(e.aNode)&&(!e.bNode||this.isDeterministic(e.bNode));if(e.isArrayNode){if(null!==e.values)for(const t of e.values)if(!this.isDeterministic(t))return!1;return!0}return!!e.isConstNode}getVaryingFromNode(e,t=null,r=e.getNodeType(this),s=null,i=null){const n=this.getDataFromNode(e,"any");let a=n.varying;if(void 0===a){const e=this.varyings,o=e.length;null===t&&(t="nodeVarying"+o),a=new o_(t,r,s,i),e.push(a),this.registerDeclaration(a),n.varying=a}return a}get namespace(){return this.context.namespace}getOutputNamespace(){return this.getNamespace("outputNode")}getNamespace(e=""){const t=this.namespace;let r;return r=t?e?t+"_"+e:t:e,r}registerDeclaration(e){const t=this.shaderStage,r=this.declarations[t]||(this.declarations[t]={}),s=this.getPropertyName(e);let i=1,n=s;for(;void 0!==r[n];)n=s+"_"+i++;i>1&&(e.name=n,console.warn(`THREE.TSL: Declaration name '${s}' of '${e.type}' already in use. Renamed to '${n}'.`)),r[n]=e}getCodeFromNode(e,t,r=this.shaderStage){const s=this.getDataFromNode(e);let i=s.code;if(void 0===i){const e=this.codes[r]||(this.codes[r]=[]),n=e.length;i=new u_("nodeCode"+n,t),e.push(i),s.code=i}return i}addFlowCodeHierarchy(e,t){const{flowCodes:r,flowCodeBlock:s}=this.getDataFromNode(e);let i=!0,n=t;for(;n;){if(!0===s.get(n)){i=!1;break}n=this.getDataFromNode(n).parentNodeBlock}if(i)for(const e of r)this.addLineFlowCode(e)}addLineFlowCodeBlock(e,t,r){const s=this.getDataFromNode(e),i=s.flowCodes||(s.flowCodes=[]),n=s.flowCodeBlock||(s.flowCodeBlock=new WeakMap);i.push(t),n.set(r,!0)}addLineFlowCode(e,t=null){return""===e||(null!==t&&this.context.nodeBlock&&this.addLineFlowCodeBlock(t,e,this.context.nodeBlock),e=this.tab+e,/;\s*$/.test(e)||(e+=";\n"),this.flow.code+=e),this}addFlowCode(e){return this.flow.code+=e,this}addFlowTab(){return this.tab+="\t",this}removeFlowTab(){return this.tab=this.tab.slice(0,-1),this}getFlowData(e){return this.flowsData.get(e)}flowNode(e){const t=e.getNodeType(this),r=this.flowChildNode(e,t);return this.flowsData.set(e,r),r}addInclude(e){null!==this.currentFunctionNode&&this.currentFunctionNode.includes.push(e)}buildFunctionNode(e){const t=new Rb,r=this.currentFunctionNode;return this.currentFunctionNode=t,t.code=this.buildFunctionCode(e),this.currentFunctionNode=r,t}flowShaderNode(e){const t=e.layout,r={[Symbol.iterator](){let e=0;const t=Object.values(this);return{next:()=>({value:t[e],done:e++>=t.length})}}};for(const e of t.inputs)r[e.name]=new If(e.type,e.name);e.layout=null;const s=e.call(r),i=this.flowStagesNode(s,t.type);return e.layout=t,i}flowStagesNode(e,t=null){const r=this.flow,s=this.vars,i=this.declarations,n=this.cache,a=this.buildStage,o=this.stack,u={code:""};this.flow=u,this.vars={},this.declarations={},this.cache=new d_,this.stack=Vf();for(const r of Gs)this.setBuildStage(r),u.result=e.build(this,t);return u.vars=this.getVars(this.shaderStage),this.flow=r,this.vars=s,this.declarations=i,this.cache=n,this.stack=o,this.setBuildStage(a),u}getFunctionOperator(){return null}buildFunctionCode(){console.warn("Abstract function.")}flowChildNode(e,t=null){const r=this.flow,s={code:""};return this.flow=s,s.result=e.build(this,t),this.flow=r,s}flowNodeFromShaderStage(e,t,r=null,s=null){const i=this.tab,n=this.cache,a=this.shaderStage,o=this.context;this.setShaderStage(e);const u={...this.context};delete u.nodeBlock,this.cache=this.globalCache,this.tab="\t",this.context=u;let l=null;if("generate"===this.buildStage){const i=this.flowChildNode(t,r);null!==s&&(i.code+=`${this.tab+s} = ${i.result};\n`),this.flowCode[e]=this.flowCode[e]+i.code,l=i}else l=t.build(this);return this.setShaderStage(a),this.cache=n,this.tab=i,this.context=o,l}getAttributesArray(){return this.attributes.concat(this.bufferAttributes)}getAttributes(){console.warn("Abstract function.")}getVaryings(){console.warn("Abstract function.")}getVar(e,t,r=null){return`${null!==r?this.generateArrayDeclaration(e,r):this.getType(e)} ${t}`}getVars(e){let t="";const r=this.vars[e];if(void 0!==r)for(const e of r)t+=`${this.getVar(e.type,e.name)}; `;return t}getUniforms(){console.warn("Abstract function.")}getCodes(e){const t=this.codes[e];let r="";if(void 0!==t)for(const e of t)r+=e.code+"\n";return r}getHash(){return this.vertexShader+this.fragmentShader+this.computeShader}setShaderStage(e){this.shaderStage=e}getShaderStage(){return this.shaderStage}setBuildStage(e){this.buildStage=e}getBuildStage(){return this.buildStage}buildCode(){console.warn("Abstract function.")}build(){const{object:e,material:t,renderer:r}=this;if(null!==t){let e=r.library.fromMaterial(t);null===e&&(console.error(`NodeMaterial: Material "${t.type}" is not compatible.`),e=new Zh),e.build(this)}else this.addFlow("compute",e);for(const e of Gs){this.setBuildStage(e),this.context.vertex&&this.context.vertex.isNode&&this.flowNodeFromShaderStage("vertex",this.context.vertex);for(const t of zs){this.setShaderStage(t);const r=this.flowNodes[t];for(const t of r)"generate"===e?this.flowNode(t):t.build(this)}}return this.setBuildStage(null),this.setShaderStage(null),this.buildCode(),this.buildUpdateNodes(),this}getNodeUniform(e,t){if("float"===t||"int"===t||"uint"===t)return new __(e);if("vec2"===t||"ivec2"===t||"uvec2"===t)return new v_(e);if("vec3"===t||"ivec3"===t||"uvec3"===t)return new N_(e);if("vec4"===t||"ivec4"===t||"uvec4"===t)return new S_(e);if("color"===t)return new E_(e);if("mat2"===t)return new w_(e);if("mat3"===t)return new A_(e);if("mat4"===t)return new R_(e);throw new Error(`Uniform "${t}" not declared.`)}format(e,t,r){if((t=this.getVectorType(t))===(r=this.getVectorType(r))||null===r||this.isReference(r))return e;const s=this.getTypeLength(t),i=this.getTypeLength(r);return 16===s&&9===i?`${this.getType(r)}( ${e}[ 0 ].xyz, ${e}[ 1 ].xyz, ${e}[ 2 ].xyz )`:9===s&&4===i?`${this.getType(r)}( ${e}[ 0 ].xy, ${e}[ 1 ].xy )`:s>4||i>4||0===i?e:s===i?`${this.getType(r)}( ${e} )`:s>i?(e="bool"===r?`all( ${e} )`:`${e}.${"xyz".slice(0,i)}`,this.format(e,this.getTypeFromLength(i,this.getComponentType(t)),r)):4===i&&s>1?`${this.getType(r)}( ${this.format(e,t,"vec3")}, 1.0 )`:2===s?`${this.getType(r)}( ${this.format(e,t,"vec2")}, 0.0 )`:(1===s&&i>1&&t!==this.getComponentType(r)&&(e=`${this.getType(this.getComponentType(r))}( ${e} )`),`${this.getType(r)}( ${e} )`)}getSignature(){return`// Three.js r${He} - Node System\n`}*[Symbol.iterator](){}createNodeMaterial(e="NodeMaterial"){throw new Error(`THREE.NodeBuilder: createNodeMaterial() was deprecated. Use new ${e}() instead.`)}}class L_{constructor(){this.time=0,this.deltaTime=0,this.frameId=0,this.renderId=0,this.updateMap=new WeakMap,this.updateBeforeMap=new WeakMap,this.updateAfterMap=new WeakMap,this.renderer=null,this.material=null,this.camera=null,this.object=null,this.scene=null}_getMaps(e,t){let r=e.get(t);return void 0===r&&(r={renderMap:new WeakMap,frameMap:new WeakMap},e.set(t,r)),r}updateBeforeNode(e){const t=e.getUpdateBeforeType(),r=e.updateReference(this);if(t===Vs.FRAME){const{frameMap:t}=this._getMaps(this.updateBeforeMap,r);t.get(r)!==this.frameId&&!1!==e.updateBefore(this)&&t.set(r,this.frameId)}else if(t===Vs.RENDER){const{renderMap:t}=this._getMaps(this.updateBeforeMap,r);t.get(r)!==this.renderId&&!1!==e.updateBefore(this)&&t.set(r,this.renderId)}else t===Vs.OBJECT&&e.updateBefore(this)}updateAfterNode(e){const t=e.getUpdateAfterType(),r=e.updateReference(this);if(t===Vs.FRAME){const{frameMap:t}=this._getMaps(this.updateAfterMap,r);t.get(r)!==this.frameId&&!1!==e.updateAfter(this)&&t.set(r,this.frameId)}else if(t===Vs.RENDER){const{renderMap:t}=this._getMaps(this.updateAfterMap,r);t.get(r)!==this.renderId&&!1!==e.updateAfter(this)&&t.set(r,this.renderId)}else t===Vs.OBJECT&&e.updateAfter(this)}updateNode(e){const t=e.getUpdateType(),r=e.updateReference(this);if(t===Vs.FRAME){const{frameMap:t}=this._getMaps(this.updateMap,r);t.get(r)!==this.frameId&&!1!==e.update(this)&&t.set(r,this.frameId)}else if(t===Vs.RENDER){const{renderMap:t}=this._getMaps(this.updateMap,r);t.get(r)!==this.renderId&&!1!==e.update(this)&&t.set(r,this.renderId)}else t===Vs.OBJECT&&e.update(this)}update(){this.frameId++,void 0===this.lastTime&&(this.lastTime=performance.now()),this.deltaTime=(performance.now()-this.lastTime)/1e3,this.lastTime=performance.now(),this.time+=this.deltaTime}}class B_{constructor(e,t,r=null,s="",i=!1){this.type=e,this.name=t,this.count=r,this.qualifier=s,this.isConst=i}}B_.isNodeFunctionInput=!0;class I_ extends eT{static get type(){return"DirectionalLightNode"}constructor(e=null){super(e)}setupDirect(){const e=this.colorNode;return{lightDirection:cx(this.light),lightColor:e}}}const D_=new a,V_=new a;let U_=null;class O_ extends eT{static get type(){return"RectAreaLightNode"}constructor(e=null){super(e),this.halfHeight=Zn(new r).setGroup(Kn),this.halfWidth=Zn(new r).setGroup(Kn),this.updateType=Vs.RENDER}update(e){super.update(e);const{light:t}=this,r=e.camera.matrixWorldInverse;V_.identity(),D_.copy(t.matrixWorld),D_.premultiply(r),V_.extractRotation(D_),this.halfWidth.value.set(.5*t.width,0,0),this.halfHeight.value.set(0,.5*t.height,0),this.halfWidth.value.applyMatrix4(V_),this.halfHeight.value.applyMatrix4(V_)}setupDirectRectArea(e){let t,r;e.isAvailable("float32Filterable")?(t=Zu(U_.LTC_FLOAT_1),r=Zu(U_.LTC_FLOAT_2)):(t=Zu(U_.LTC_HALF_1),r=Zu(U_.LTC_HALF_2));const{colorNode:s,light:i}=this;return{lightColor:s,lightPosition:dx(i),halfWidth:this.halfWidth,halfHeight:this.halfHeight,ltc_1:t,ltc_2:r}}static setLTC(e){U_=e}}class k_ extends eT{static get type(){return"SpotLightNode"}constructor(e=null){super(e),this.coneCosNode=Zn(0).setGroup(Kn),this.penumbraCosNode=Zn(0).setGroup(Kn),this.cutoffDistanceNode=Zn(0).setGroup(Kn),this.decayExponentNode=Zn(0).setGroup(Kn),this.colorNode=Zn(this.color).setGroup(Kn)}update(e){super.update(e);const{light:t}=this;this.coneCosNode.value=Math.cos(t.angle),this.penumbraCosNode.value=Math.cos(t.angle*(1-t.penumbra)),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}getSpotAttenuation(e,t){const{coneCosNode:r,penumbraCosNode:s}=this;return Oo(r,s,t)}getLightCoord(e){const t=e.getNodeProperties(this);let r=t.projectionUV;return void 0===r&&(r=ox(this.light,e.context.positionWorld),t.projectionUV=r),r}setupDirect(e){const{colorNode:t,cutoffDistanceNode:r,decayExponentNode:s,light:i}=this,n=this.getLightVector(e),a=n.normalize(),o=a.dot(cx(i)),u=this.getSpotAttenuation(e,o),l=n.length(),d=tT({lightDistance:l,cutoffDistance:r,decayExponent:s});let c,h,p=t.mul(u).mul(d);if(i.colorNode?(h=this.getLightCoord(e),c=i.colorNode(h)):i.map&&(h=this.getLightCoord(e),c=Zu(i.map,h.xy).onRenderUpdate((()=>i.map))),c){p=h.mul(2).sub(1).abs().lessThan(1).all().select(p.mul(c),p)}return{lightColor:p,lightDirection:a}}}class G_ extends k_{static get type(){return"IESSpotLightNode"}getSpotAttenuation(e,t){const r=this.light.iesMap;let s=null;if(r&&!0===r.isTexture){const e=t.acos().mul(1/Math.PI);s=Zu(r,Yi(e,0),0).r}else s=super.getSpotAttenuation(t);return s}}const z_=ki((([e,t])=>{const r=e.abs().sub(t);return oo(_o(r,0)).add(To(_o(r.x,r.y),0))}));class H_ extends k_{static get type(){return"ProjectorLightNode"}update(e){super.update(e);const t=this.light;if(this.penumbraCosNode.value=Math.min(Math.cos(t.angle*(1-t.penumbra)),.99999),null===t.aspect){let e=1;null!==t.map&&(e=t.map.width/t.map.height),t.shadow.aspect=e}else t.shadow.aspect=t.aspect}getSpotAttenuation(e){const t=this.penumbraCosNode,r=this.getLightCoord(e),s=r.xyz.div(r.w),i=z_(s.xy.sub(Yi(.5)),Yi(.5)),n=da(-1,ua(1,so(t)).sub(1));return Vo(i.mul(-2).mul(n))}}class $_ extends eT{static get type(){return"AmbientLightNode"}constructor(e=null){super(e)}setup({context:e}){e.irradiance.addAssign(this.colorNode)}}class W_ extends eT{static get type(){return"HemisphereLightNode"}constructor(t=null){super(t),this.lightPositionNode=ux(t),this.lightDirectionNode=this.lightPositionNode.normalize(),this.groundColorNode=Zn(new e).setGroup(Kn)}update(e){const{light:t}=this;super.update(e),this.lightPositionNode.object3d=t,this.groundColorNode.value.copy(t.groundColor).multiplyScalar(t.intensity)}setup(e){const{colorNode:t,groundColorNode:r,lightDirectionNode:s}=this,i=Yl.dot(s).mul(.5).add(.5),n=Io(r,t,i);e.context.irradiance.addAssign(n)}}class j_ extends eT{static get type(){return"LightProbeNode"}constructor(e=null){super(e);const t=[];for(let e=0;e<9;e++)t.push(new r);this.lightProbe=il(t)}update(e){const{light:t}=this;super.update(e);for(let e=0;e<9;e++)this.lightProbe.array[e].copy(t.sh.coefficients[e]).multiplyScalar(t.intensity)}setup(e){const t=QT(Yl,this.lightProbe);e.context.irradiance.addAssign(t)}}class q_{parseFunction(){console.warn("Abstract function.")}}class X_{constructor(e,t,r="",s=""){this.type=e,this.inputs=t,this.name=r,this.precision=s}getCode(){console.warn("Abstract function.")}}X_.isNodeFunction=!0;const K_=/^\s*(highp|mediump|lowp)?\s*([a-z_0-9]+)\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)/i,Y_=/[a-z_0-9]+/gi,Q_="#pragma main";class Z_ extends X_{constructor(e){const{type:t,inputs:r,name:s,precision:i,inputsCode:n,blockCode:a,headerCode:o}=(e=>{const t=(e=e.trim()).indexOf(Q_),r=-1!==t?e.slice(t+12):e,s=r.match(K_);if(null!==s&&5===s.length){const i=s[4],n=[];let a=null;for(;null!==(a=Y_.exec(i));)n.push(a);const o=[];let u=0;for(;u0||e.backgroundBlurriness>0&&0===t.backgroundBlurriness;if(t.background!==r||s){const i=this.getCacheNode("background",r,(()=>{if(!0===r.isCubeTexture||r.mapping===Q||r.mapping===Z||r.mapping===ce){if(e.backgroundBlurriness>0||r.mapping===ce)return mm(r);{let e;return e=!0===r.isCubeTexture?gd(r):Zu(r),bp(e)}}if(!0===r.isTexture)return Zu(r,ph.flipY()).setUpdateMatrix(!0);!0!==r.isColor&&console.error("WebGPUNodes: Unsupported background configuration.",r)}),s);t.backgroundNode=i,t.background=r,t.backgroundBlurriness=e.backgroundBlurriness}}else t.backgroundNode&&(delete t.backgroundNode,delete t.background)}getCacheNode(e,t,r,s=!1){const i=this.cacheLib[e]||(this.cacheLib[e]=new WeakMap);let n=i.get(t);return(void 0===n||s)&&(n=r(),i.set(t,n)),n}updateFog(e){const t=this.get(e),r=e.fog;if(r){if(t.fog!==r){const e=this.getCacheNode("fog",r,(()=>{if(r.isFogExp2){const e=yd("color","color",r).setGroup(Kn),t=yd("density","float",r).setGroup(Kn);return kb(e,Ob(t))}if(r.isFog){const e=yd("color","color",r).setGroup(Kn),t=yd("near","float",r).setGroup(Kn),s=yd("far","float",r).setGroup(Kn);return kb(e,Ub(t,s))}console.error("THREE.Renderer: Unsupported fog configuration.",r)}));t.fogNode=e,t.fog=r}}else delete t.fogNode,delete t.fog}updateEnvironment(e){const t=this.get(e),r=e.environment;if(r){if(t.environment!==r){const e=this.getCacheNode("environment",r,(()=>!0===r.isCubeTexture?gd(r):!0===r.isTexture?Zu(r):void console.error("Nodes: Unsupported environment configuration.",r)));t.environmentNode=e,t.environment=r}}else t.environmentNode&&(delete t.environmentNode,delete t.environment)}getNodeFrame(e=this.renderer,t=null,r=null,s=null,i=null){const n=this.nodeFrame;return n.renderer=e,n.scene=t,n.object=r,n.camera=s,n.material=i,n}getNodeFrameForRender(e){return this.getNodeFrame(e.renderer,e.scene,e.object,e.camera,e.material)}getOutputCacheKey(){const e=this.renderer;return e.toneMapping+","+e.currentColorSpace+","+e.xr.isPresenting}hasOutputChange(e){return ev.get(e)!==this.getOutputCacheKey()}getOutputNode(e){const t=this.renderer,r=this.getOutputCacheKey(),s=e.isArrayTexture?Yy(e,en(ph,nl("gl_ViewID_OVR"))).renderOutput(t.toneMapping,t.currentColorSpace):Zu(e,ph).renderOutput(t.toneMapping,t.currentColorSpace);return ev.set(e,r),s}updateBefore(e){const t=e.getNodeBuilderState();for(const r of t.updateBeforeNodes)this.getNodeFrameForRender(e).updateBeforeNode(r)}updateAfter(e){const t=e.getNodeBuilderState();for(const r of t.updateAfterNodes)this.getNodeFrameForRender(e).updateAfterNode(r)}updateForCompute(e){const t=this.getNodeFrame(),r=this.getForCompute(e);for(const e of r.updateNodes)t.updateNode(e)}updateForRender(e){const t=this.getNodeFrameForRender(e),r=e.getNodeBuilderState();for(const e of r.updateNodes)t.updateNode(e)}needsRefresh(e){const t=this.getNodeFrameForRender(e);return e.getMonitor().needsRefresh(e,t)}dispose(){super.dispose(),this.nodeFrame=new L_,this.nodeBuilderCache=new Map,this.cacheLib={}}}const iv=new Me;class nv{constructor(e=null){this.version=0,this.clipIntersection=null,this.cacheKey="",this.shadowPass=!1,this.viewNormalMatrix=new n,this.clippingGroupContexts=new WeakMap,this.intersectionPlanes=[],this.unionPlanes=[],this.parentVersion=null,null!==e&&(this.viewNormalMatrix=e.viewNormalMatrix,this.clippingGroupContexts=e.clippingGroupContexts,this.shadowPass=e.shadowPass,this.viewMatrix=e.viewMatrix)}projectPlanes(e,t,r){const s=e.length;for(let i=0;i0,alpha:!0,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:this.getFramebufferScaleFactor()},i=new XRWebGLLayer(e,s,r);this._glBaseLayer=i,e.updateRenderState({baseLayer:i}),t.setPixelRatio(1),t._setXRLayerSize(i.framebufferWidth,i.framebufferHeight),this._xrRenderTarget=new pv(i.framebufferWidth,i.framebufferHeight,{format:le,type:Ce,colorSpace:t.outputColorSpace,stencilBuffer:t.stencil,resolveDepthBuffer:!1===i.ignoreDepthValues,resolveStencilBuffer:!1===i.ignoreDepthValues}),this._xrRenderTarget._isOpaqueFramebuffer=!0,this._referenceSpace=await e.requestReferenceSpace(this.getReferenceSpaceType())}this.setFoveation(this.getFoveation()),t._animation.setAnimationLoop(this._onAnimationFrame),t._animation.setContext(e),t._animation.start(),this.isPresenting=!0,this.dispatchEvent({type:"sessionstart"})}}updateCamera(e){const t=this._session;if(null===t)return;const r=e.near,s=e.far,i=this._cameraXR,n=this._cameraL,a=this._cameraR;i.near=a.near=n.near=r,i.far=a.far=n.far=s,i.isMultiViewCamera=this._useMultiview,this._currentDepthNear===i.near&&this._currentDepthFar===i.far||(t.updateRenderState({depthNear:i.near,depthFar:i.far}),this._currentDepthNear=i.near,this._currentDepthFar=i.far),n.layers.mask=2|e.layers.mask,a.layers.mask=4|e.layers.mask,i.layers.mask=n.layers.mask|a.layers.mask;const o=e.parent,u=i.cameras;yv(i,o);for(let e=0;e=0&&(r[n]=null,t[n].disconnect(i))}for(let s=0;s=r.length){r.push(i),n=e;break}if(null===r[e]){r[e]=i,n=e;break}}if(-1===n)break}const a=t[n];a&&a.connect(i)}}function _v(e){return"quad"===e.type?this._glBinding.createQuadLayer({transform:new XRRigidTransform(e.translation,e.quaternion),width:e.width/2,height:e.height/2,space:this._referenceSpace,viewPixelWidth:e.pixelwidth,viewPixelHeight:e.pixelheight,clearOnAccess:!1}):this._glBinding.createCylinderLayer({transform:new XRRigidTransform(e.translation,e.quaternion),radius:e.radius,centralAngle:e.centralAngle,aspectRatio:e.aspectRatio,space:this._referenceSpace,viewPixelWidth:e.pixelwidth,viewPixelHeight:e.pixelheight,clearOnAccess:!1})}function vv(e,t){if(void 0===t)return;const r=this._cameraXR,i=this._renderer,n=i.backend,a=this._glBaseLayer,o=this.getReferenceSpace(),u=t.getViewerPose(o);if(this._xrFrame=t,null!==u){const e=u.views;null!==this._glBaseLayer&&n.setXRTarget(a.framebuffer);let t=!1;e.length!==r.cameras.length&&(r.cameras.length=0,t=!0);for(let i=0;i{await this.compileAsync(e,t);const s=this._renderLists.get(e,t),i=this._renderContexts.get(e,t,this._renderTarget),n=e.overrideMaterial||r.material,a=this._objects.get(r,n,e,t,s.lightsNode,i,i.clippingContext),{fragmentShader:o,vertexShader:u}=a.getNodeBuilderState();return{fragmentShader:o,vertexShader:u}}}}async init(){if(this._initialized)throw new Error("Renderer: Backend has already been initialized.");return null!==this._initPromise||(this._initPromise=new Promise((async(e,t)=>{let r=this.backend;try{await r.init(this)}catch(e){if(null===this._getFallback)return void t(e);try{this.backend=r=this._getFallback(e),await r.init(this)}catch(e){return void t(e)}}this._nodes=new sv(this,r),this._animation=new Xm(this._nodes,this.info),this._attributes=new of(r),this._background=new e_(this,this._nodes),this._geometries=new df(this._attributes,this.info),this._textures=new Lf(this,r,this.info),this._pipelines=new yf(r,this._nodes),this._bindings=new bf(r,this._nodes,this._textures,this._attributes,this._pipelines,this.info),this._objects=new Jm(this,this._nodes,this._geometries,this._pipelines,this._bindings,this.info),this._renderLists=new Sf(this.lighting),this._bundles=new uv,this._renderContexts=new Pf,this._animation.start(),this._initialized=!0,e(this)}))),this._initPromise}get coordinateSystem(){return this.backend.coordinateSystem}async compileAsync(e,t,r=null){if(!0===this._isDeviceLost)return;!1===this._initialized&&await this.init();const s=this._nodes.nodeFrame,i=s.renderId,n=this._currentRenderContext,a=this._currentRenderObjectFunction,o=this._compilationPromises,u=!0===e.isScene?e:Nv;null===r&&(r=e);const l=this._renderTarget,d=this._renderContexts.get(r,t,l),c=this._activeMipmapLevel,h=[];this._currentRenderContext=d,this._currentRenderObjectFunction=this.renderObject,this._handleObjectFunction=this._createObjectPipeline,this._compilationPromises=h,s.renderId++,s.update(),d.depth=this.depth,d.stencil=this.stencil,d.clippingContext||(d.clippingContext=new nv),d.clippingContext.updateGlobal(u,t),u.onBeforeRender(this,e,t,l);const p=this._renderLists.get(e,t);if(p.begin(),this._projectObject(e,t,0,p,d.clippingContext),r!==e&&r.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&p.pushLight(e)})),p.finish(),null!==l){this._textures.updateRenderTarget(l,c);const e=this._textures.get(l);d.textures=e.textures,d.depthTexture=e.depthTexture}else d.textures=null,d.depthTexture=null;this._background.update(u,p,d);const g=p.opaque,m=p.transparent,f=p.transparentDoublePass,y=p.lightsNode;!0===this.opaque&&g.length>0&&this._renderObjects(g,t,u,y),!0===this.transparent&&m.length>0&&this._renderTransparents(m,f,t,u,y),s.renderId=i,this._currentRenderContext=n,this._currentRenderObjectFunction=a,this._compilationPromises=o,this._handleObjectFunction=this._renderObjectDirect,await Promise.all(h)}async renderAsync(e,t){!1===this._initialized&&await this.init(),this._renderScene(e,t)}async waitForGPU(){await this.backend.waitForGPU()}set highPrecision(e){!0===e?(this.overrideNodes.modelViewMatrix=Bl,this.overrideNodes.modelNormalViewMatrix=Il):this.highPrecision&&(this.overrideNodes.modelViewMatrix=null,this.overrideNodes.modelNormalViewMatrix=null)}get highPrecision(){return this.overrideNodes.modelViewMatrix===Bl&&this.overrideNodes.modelNormalViewMatrix===Il}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}getColorBufferType(){return this._colorBufferType}_onDeviceLost(e){let t=`THREE.WebGPURenderer: ${e.api} Device Lost:\n\nMessage: ${e.message}`;e.reason&&(t+=`\nReason: ${e.reason}`),console.error(t),this._isDeviceLost=!0}_renderBundle(e,t,r){const{bundleGroup:s,camera:i,renderList:n}=e,a=this._currentRenderContext,o=this._bundles.get(s,i),u=this.backend.get(o);void 0===u.renderContexts&&(u.renderContexts=new Set);const l=s.version!==u.version,d=!1===u.renderContexts.has(a)||l;if(u.renderContexts.add(a),d){this.backend.beginBundle(a),(void 0===u.renderObjects||l)&&(u.renderObjects=[]),this._currentRenderBundle=o;const{transparentDoublePass:e,transparent:d,opaque:c}=n;!0===this.opaque&&c.length>0&&this._renderObjects(c,i,t,r),!0===this.transparent&&d.length>0&&this._renderTransparents(d,e,i,t,r),this._currentRenderBundle=null,this.backend.finishBundle(a,o),u.version=s.version}else{const{renderObjects:e}=u;for(let t=0,r=e.length;t>=c,p.viewportValue.height>>=c,p.viewportValue.minDepth=x,p.viewportValue.maxDepth=T,p.viewport=!1===p.viewportValue.equals(Ev),p.scissorValue.copy(y).multiplyScalar(b).floor(),p.scissor=this._scissorTest&&!1===p.scissorValue.equals(Ev),p.scissorValue.width>>=c,p.scissorValue.height>>=c,p.clippingContext||(p.clippingContext=new nv),p.clippingContext.updateGlobal(u,t),u.onBeforeRender(this,e,t,h);const _=t.isArrayCamera?Av:wv;t.isArrayCamera||(Rv.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),_.setFromProjectionMatrix(Rv,g));const v=this._renderLists.get(e,t);if(v.begin(),this._projectObject(e,t,0,v,p.clippingContext),v.finish(),!0===this.sortObjects&&v.sort(this._opaqueSort,this._transparentSort),null!==h){this._textures.updateRenderTarget(h,c);const e=this._textures.get(h);p.textures=e.textures,p.depthTexture=e.depthTexture,p.width=e.width,p.height=e.height,p.renderTarget=h,p.depth=h.depthBuffer,p.stencil=h.stencilBuffer}else p.textures=null,p.depthTexture=null,p.width=this.domElement.width,p.height=this.domElement.height,p.depth=this.depth,p.stencil=this.stencil;p.width>>=c,p.height>>=c,p.activeCubeFace=d,p.activeMipmapLevel=c,p.occlusionQueryCount=v.occlusionQueryCount,this._background.update(u,v,p),p.camera=t,this.backend.beginRender(p);const{bundles:N,lightsNode:S,transparentDoublePass:E,transparent:w,opaque:A}=v;return N.length>0&&this._renderBundles(N,u,S),!0===this.opaque&&A.length>0&&this._renderObjects(A,t,u,S),!0===this.transparent&&w.length>0&&this._renderTransparents(w,E,t,u,S),this.backend.finishRender(p),i.renderId=n,this._currentRenderContext=a,this._currentRenderObjectFunction=o,null!==s&&(this.setRenderTarget(l,d,c),this._renderOutput(h)),u.onAfterRender(this,e,t,h),p}_setXRLayerSize(e,t){this._width=e,this._height=t,this.setViewport(0,0,e,t)}_renderOutput(e){const t=this._quad;this._nodes.hasOutputChange(e.texture)&&(t.material.fragmentNode=this._nodes.getOutputNode(e.texture),t.material.needsUpdate=!0);const r=this.autoClear,s=this.xr.enabled;this.autoClear=!1,this.xr.enabled=!1,this._renderScene(t,t.camera,!1),this.autoClear=r,this.xr.enabled=s}getMaxAnisotropy(){return this.backend.getMaxAnisotropy()}getActiveCubeFace(){return this._activeCubeFace}getActiveMipmapLevel(){return this._activeMipmapLevel}async setAnimationLoop(e){!1===this._initialized&&await this.init(),this._animation.setAnimationLoop(e)}async getArrayBufferAsync(e){return await this.backend.getArrayBufferAsync(e)}getContext(){return this.backend.getContext()}getPixelRatio(){return this._pixelRatio}getDrawingBufferSize(e){return e.set(this._width*this._pixelRatio,this._height*this._pixelRatio).floor()}getSize(e){return e.set(this._width,this._height)}setPixelRatio(e=1){this._pixelRatio!==e&&(this._pixelRatio=e,this.setSize(this._width,this._height,!1))}setDrawingBufferSize(e,t,r){this.xr&&this.xr.isPresenting||(this._width=e,this._height=t,this._pixelRatio=r,this.domElement.width=Math.floor(e*r),this.domElement.height=Math.floor(t*r),this.setViewport(0,0,e,t),this._initialized&&this.backend.updateSize())}setSize(e,t,r=!0){this.xr&&this.xr.isPresenting||(this._width=e,this._height=t,this.domElement.width=Math.floor(e*this._pixelRatio),this.domElement.height=Math.floor(t*this._pixelRatio),!0===r&&(this.domElement.style.width=e+"px",this.domElement.style.height=t+"px"),this.setViewport(0,0,e,t),this._initialized&&this.backend.updateSize())}setOpaqueSort(e){this._opaqueSort=e}setTransparentSort(e){this._transparentSort=e}getScissor(e){const t=this._scissor;return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e}setScissor(e,t,r,s){const i=this._scissor;e.isVector4?i.copy(e):i.set(e,t,r,s)}getScissorTest(){return this._scissorTest}setScissorTest(e){this._scissorTest=e,this.backend.setScissorTest(e)}getViewport(e){return e.copy(this._viewport)}setViewport(e,t,r,s,i=0,n=1){const a=this._viewport;e.isVector4?a.copy(e):a.set(e,t,r,s),a.minDepth=i,a.maxDepth=n}getClearColor(e){return e.copy(this._clearColor)}setClearColor(e,t=1){this._clearColor.set(e),this._clearColor.a=t}getClearAlpha(){return this._clearColor.a}setClearAlpha(e){this._clearColor.a=e}getClearDepth(){return this._clearDepth}setClearDepth(e){this._clearDepth=e}getClearStencil(){return this._clearStencil}setClearStencil(e){this._clearStencil=e}isOccluded(e){const t=this._currentRenderContext;return t&&this.backend.isOccluded(t,e)}clear(e=!0,t=!0,r=!0){if(!1===this._initialized)return console.warn("THREE.Renderer: .clear() called before the backend is initialized. Try using .clearAsync() instead."),this.clearAsync(e,t,r);const s=this._renderTarget||this._getFrameBufferTarget();let i=null;if(null!==s){this._textures.updateRenderTarget(s);const e=this._textures.get(s);i=this._renderContexts.getForClear(s),i.textures=e.textures,i.depthTexture=e.depthTexture,i.width=e.width,i.height=e.height,i.renderTarget=s,i.depth=s.depthBuffer,i.stencil=s.stencilBuffer,i.clearColorValue=this.backend.getClearColor(),i.activeCubeFace=this.getActiveCubeFace(),i.activeMipmapLevel=this.getActiveMipmapLevel()}this.backend.clear(e,t,r,i),null!==s&&null===this._renderTarget&&this._renderOutput(s)}clearColor(){return this.clear(!0,!1,!1)}clearDepth(){return this.clear(!1,!0,!1)}clearStencil(){return this.clear(!1,!1,!0)}async clearAsync(e=!0,t=!0,r=!0){!1===this._initialized&&await this.init(),this.clear(e,t,r)}async clearColorAsync(){this.clearAsync(!0,!1,!1)}async clearDepthAsync(){this.clearAsync(!1,!0,!1)}async clearStencilAsync(){this.clearAsync(!1,!1,!0)}get currentToneMapping(){return this.isOutputTarget?this.toneMapping:p}get currentColorSpace(){return this.isOutputTarget?this.outputColorSpace:ue}get isOutputTarget(){return this._renderTarget===this._outputRenderTarget||null===this._renderTarget}dispose(){this.info.dispose(),this.backend.dispose(),this._animation.dispose(),this._objects.dispose(),this._pipelines.dispose(),this._nodes.dispose(),this._bindings.dispose(),this._renderLists.dispose(),this._renderContexts.dispose(),this._textures.dispose(),null!==this._frameBufferTarget&&this._frameBufferTarget.dispose(),Object.values(this.backend.timestampQueryPool).forEach((e=>{null!==e&&e.dispose()})),this.setRenderTarget(null),this.setAnimationLoop(null)}setRenderTarget(e,t=0,r=0){this._renderTarget=e,this._activeCubeFace=t,this._activeMipmapLevel=r}getRenderTarget(){return this._renderTarget}setOutputRenderTarget(e){this._outputRenderTarget=e}getOutputRenderTarget(){return this._outputRenderTarget}_resetXRState(){this.backend.setXRTarget(null),this.setOutputRenderTarget(null),this.setRenderTarget(null),this._frameBufferTarget.dispose(),this._frameBufferTarget=null}setRenderObjectFunction(e){this._renderObjectFunction=e}getRenderObjectFunction(){return this._renderObjectFunction}compute(e){if(!0===this._isDeviceLost)return;if(!1===this._initialized)return console.warn("THREE.Renderer: .compute() called before the backend is initialized. Try using .computeAsync() instead."),this.computeAsync(e);const t=this._nodes.nodeFrame,r=t.renderId;this.info.calls++,this.info.compute.calls++,this.info.compute.frameCalls++,t.renderId=this.info.calls;const s=this.backend,i=this._pipelines,n=this._bindings,a=this._nodes,o=Array.isArray(e)?e:[e];if(void 0===o[0]||!0!==o[0].isComputeNode)throw new Error("THREE.Renderer: .compute() expects a ComputeNode.");s.beginCompute(e);for(const t of o){if(!1===i.has(t)){const e=()=>{t.removeEventListener("dispose",e),i.delete(t),n.delete(t),a.delete(t)};t.addEventListener("dispose",e);const r=t.onInitFunction;null!==r&&r.call(t,{renderer:this})}a.updateForCompute(t),n.updateForCompute(t);const r=n.getForCompute(t),o=i.getForCompute(t,r);s.compute(e,t,r,o)}s.finishCompute(e),t.renderId=r}async computeAsync(e){!1===this._initialized&&await this.init(),this.compute(e)}async hasFeatureAsync(e){return!1===this._initialized&&await this.init(),this.backend.hasFeature(e)}async resolveTimestampsAsync(e="render"){return!1===this._initialized&&await this.init(),this.backend.resolveTimestampsAsync(e)}hasFeature(e){return!1===this._initialized?(console.warn("THREE.Renderer: .hasFeature() called before the backend is initialized. Try using .hasFeatureAsync() instead."),!1):this.backend.hasFeature(e)}hasInitialized(){return this._initialized}async initTextureAsync(e){!1===this._initialized&&await this.init(),this._textures.updateTexture(e)}initTexture(e){!1===this._initialized&&console.warn("THREE.Renderer: .initTexture() called before the backend is initialized. Try using .initTextureAsync() instead."),this._textures.updateTexture(e)}copyFramebufferToTexture(e,t=null){if(null!==t)if(t.isVector2)t=Cv.set(t.x,t.y,e.image.width,e.image.height).floor();else{if(!t.isVector4)return void console.error("THREE.Renderer.copyFramebufferToTexture: Invalid rectangle.");t=Cv.copy(t).floor()}else t=Cv.set(0,0,e.image.width,e.image.height);let r,s=this._currentRenderContext;null!==s?r=s.renderTarget:(r=this._renderTarget||this._getFrameBufferTarget(),null!==r&&(this._textures.updateRenderTarget(r),s=this._textures.get(r))),this._textures.updateTexture(e,{renderTarget:r}),this.backend.copyFramebufferToTexture(e,s,t)}copyTextureToTexture(e,t,r=null,s=null,i=0,n=0){this._textures.updateTexture(e),this._textures.updateTexture(t),this.backend.copyTextureToTexture(e,t,r,s,i,n)}async readRenderTargetPixelsAsync(e,t,r,s,i,n=0,a=0){return this.backend.copyTextureToBuffer(e.textures[n],t,r,s,i,a)}_projectObject(e,t,r,s,i){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)r=e.renderOrder,e.isClippingGroup&&e.enabled&&(i=i.getGroupContext(e));else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)s.pushLight(e);else if(e.isSprite){const n=t.isArrayCamera?Av:wv;if(!e.frustumCulled||n.intersectsSprite(e,t)){!0===this.sortObjects&&Cv.setFromMatrixPosition(e.matrixWorld).applyMatrix4(Rv);const{geometry:t,material:n}=e;n.visible&&s.push(e,t,n,r,Cv.z,null,i)}}else if(e.isLineLoop)console.error("THREE.Renderer: Objects of type THREE.LineLoop are not supported. Please use THREE.Line or THREE.LineSegments.");else if(e.isMesh||e.isLine||e.isPoints){const n=t.isArrayCamera?Av:wv;if(!e.frustumCulled||n.intersectsObject(e,t)){const{geometry:t,material:n}=e;if(!0===this.sortObjects&&(null===t.boundingSphere&&t.computeBoundingSphere(),Cv.copy(t.boundingSphere.center).applyMatrix4(e.matrixWorld).applyMatrix4(Rv)),Array.isArray(n)){const a=t.groups;for(let o=0,u=a.length;o0){for(const{material:e}of t)e.side=S;this._renderObjects(t,r,s,i,"backSide");for(const{material:e}of t)e.side=je;this._renderObjects(e,r,s,i);for(const{material:e}of t)e.side=Se}else this._renderObjects(e,r,s,i)}_renderObjects(e,t,r,s,i=null){for(let n=0,a=e.length;n0,e.isShadowPassMaterial&&(e.side=null===i.shadowSide?i.side:i.shadowSide,i.depthNode&&i.depthNode.isNode&&(c=e.depthNode,e.depthNode=i.depthNode),i.castShadowNode&&i.castShadowNode.isNode&&(d=e.colorNode,e.colorNode=i.castShadowNode),i.castShadowPositionNode&&i.castShadowPositionNode.isNode&&(l=e.positionNode,e.positionNode=i.castShadowPositionNode)),i=e}!0===i.transparent&&i.side===Se&&!1===i.forceSinglePass?(i.side=S,this._handleObjectFunction(e,i,t,r,a,n,o,"backSide"),i.side=je,this._handleObjectFunction(e,i,t,r,a,n,o,u),i.side=Se):this._handleObjectFunction(e,i,t,r,a,n,o,u),void 0!==l&&(t.overrideMaterial.positionNode=l),void 0!==c&&(t.overrideMaterial.depthNode=c),void 0!==d&&(t.overrideMaterial.colorNode=d),e.onAfterRender(this,t,r,s,i,n)}_renderObjectDirect(e,t,r,s,i,n,a,o){const u=this._objects.get(e,t,r,s,i,this._currentRenderContext,a,o);u.drawRange=e.geometry.drawRange,u.group=n;const l=this._nodes.needsRefresh(u);if(l&&(this._nodes.updateBefore(u),this._geometries.updateForRender(u),this._nodes.updateForRender(u),this._bindings.updateForRender(u)),this._pipelines.updateForRender(u),null!==this._currentRenderBundle){this.backend.get(this._currentRenderBundle).renderObjects.push(u),u.bundle=this._currentRenderBundle.bundleGroup}this.backend.draw(u,this.info),l&&this._nodes.updateAfter(u)}_createObjectPipeline(e,t,r,s,i,n,a,o){const u=this._objects.get(e,t,r,s,i,this._currentRenderContext,a,o);u.drawRange=e.geometry.drawRange,u.group=n,this._nodes.updateBefore(u),this._geometries.updateForRender(u),this._nodes.updateForRender(u),this._bindings.updateForRender(u),this._pipelines.getForRender(u,this._compilationPromises),this._nodes.updateAfter(u)}get compile(){return this.compileAsync}}class Pv{constructor(e=""){this.name=e,this.visibility=0}setVisibility(e){this.visibility|=e}clone(){return Object.assign(new this.constructor,this)}}class Fv extends Pv{constructor(e,t=null){super(e),this.isBuffer=!0,this.bytesPerElement=Float32Array.BYTES_PER_ELEMENT,this._buffer=t}get byteLength(){return(e=this._buffer.byteLength)+(af-e%af)%af;var e}get buffer(){return this._buffer}update(){return!0}}class Lv extends Fv{constructor(e,t=null){super(e,t),this.isUniformBuffer=!0}}let Bv=0;class Iv extends Lv{constructor(e,t){super("UniformBuffer_"+Bv++,e?e.value:null),this.nodeUniform=e,this.groupNode=t}get buffer(){return this.nodeUniform.value}}class Dv extends Lv{constructor(e){super(e),this.isUniformsGroup=!0,this._values=null,this.uniforms=[]}addUniform(e){return this.uniforms.push(e),this}removeUniform(e){const t=this.uniforms.indexOf(e);return-1!==t&&this.uniforms.splice(t,1),this}get values(){return null===this._values&&(this._values=Array.from(this.buffer)),this._values}get buffer(){let e=this._buffer;if(null===e){const t=this.byteLength;e=new Float32Array(new ArrayBuffer(t)),this._buffer=e}return e}get byteLength(){const e=this.bytesPerElement;let t=0;for(let r=0,s=this.uniforms.length;r0?s:"";t=`${e.name} {\n\t${r} ${i.name}[${n}];\n};\n`}else{t=`${this.getVectorType(i.type)} ${this.getPropertyName(i,e)};`,n=!0}const a=i.node.precision;if(null!==a&&(t=Wv[a]+" "+t),n){t="\t"+t;const e=i.groupNode.name;(s[e]||(s[e]=[])).push(t)}else t="uniform "+t,r.push(t)}let i="";for(const t in s){const r=s[t];i+=this._getGLSLUniformStruct(e+"_"+t,r.join("\n"))+"\n"}return i+=r.join("\n"),i}getTypeFromAttribute(e){let t=super.getTypeFromAttribute(e);if(/^[iu]/.test(t)&&e.gpuType!==_){let r=e;e.isInterleavedBufferAttribute&&(r=e.data);const s=r.array;!1==(s instanceof Uint32Array||s instanceof Int32Array)&&(t=t.slice(1))}return t}getAttributes(e){let t="";if("vertex"===e||"compute"===e){const e=this.getAttributesArray();let r=0;for(const s of e)t+=`layout( location = ${r++} ) in ${s.type} ${s.name};\n`}return t}getStructMembers(e){const t=[];for(const r of e.members)t.push(`\t${r.type} ${r.name};`);return t.join("\n")}getStructs(e){const t=[],r=this.structs[e],s=[];for(const e of r)if(e.output)for(const t of e.members)s.push(`layout( location = ${t.index} ) out ${t.type} ${t.name};`);else{let r="struct "+e.name+" {\n";r+=this.getStructMembers(e),r+="\n};\n",t.push(r)}return 0===s.length&&s.push("layout( location = 0 ) out vec4 fragColor;"),"\n"+s.join("\n")+"\n\n"+t.join("\n")}getVaryings(e){let t="";const r=this.varyings;if("vertex"===e||"compute"===e)for(const s of r){"compute"===e&&(s.needsInterpolation=!0);const r=this.getType(s.type);if(s.needsInterpolation)if(s.interpolationType){t+=`${qv[s.interpolationType]||s.interpolationType} ${Xv[s.interpolationSampling]||""} out ${r} ${s.name};\n`}else{t+=`${r.includes("int")||r.includes("uv")||r.includes("iv")?"flat ":""}out ${r} ${s.name};\n`}else t+=`${r} ${s.name};\n`}else if("fragment"===e)for(const e of r)if(e.needsInterpolation){const r=this.getType(e.type);if(e.interpolationType){t+=`${qv[e.interpolationType]||e.interpolationType} ${Xv[e.interpolationSampling]||""} in ${r} ${e.name};\n`}else{t+=`${r.includes("int")||r.includes("uv")||r.includes("iv")?"flat ":""}in ${r} ${e.name};\n`}}for(const r of this.builtins[e])t+=`${r};\n`;return t}getVertexIndex(){return"uint( gl_VertexID )"}getInstanceIndex(){return"uint( gl_InstanceID )"}getInvocationLocalIndex(){return`uint( gl_InstanceID ) % ${this.object.workgroupSize.reduce(((e,t)=>e*t),1)}u`}getDrawIndex(){return this.renderer.backend.extensions.has("WEBGL_multi_draw")?"uint( gl_DrawID )":null}getFrontFacing(){return"gl_FrontFacing"}getFragCoord(){return"gl_FragCoord.xy"}getFragDepth(){return"gl_FragDepth"}enableExtension(e,t,r=this.shaderStage){const s=this.extensions[r]||(this.extensions[r]=new Map);!1===s.has(e)&&s.set(e,{name:e,behavior:t})}getExtensions(e){const t=[];if("vertex"===e){const t=this.renderer.backend.extensions;this.object.isBatchedMesh&&t.has("WEBGL_multi_draw")&&this.enableExtension("GL_ANGLE_multi_draw","require",e)}const r=this.extensions[e];if(void 0!==r)for(const{name:e,behavior:s}of r.values())t.push(`#extension ${e} : ${s}`);return t.join("\n")}getClipDistance(){return"gl_ClipDistance"}isAvailable(e){let t=jv[e];if(void 0===t){let r;switch(t=!1,e){case"float32Filterable":r="OES_texture_float_linear";break;case"clipDistance":r="WEBGL_clip_cull_distance"}if(void 0!==r){const e=this.renderer.backend.extensions;e.has(r)&&(e.get(r),t=!0)}jv[e]=t}return t}isFlipY(){return!0}enableHardwareClipping(e){this.enableExtension("GL_ANGLE_clip_cull_distance","require"),this.builtins.vertex.push(`out float gl_ClipDistance[ ${e} ]`)}enableMultiview(){this.enableExtension("GL_OVR_multiview2","require","fragment"),this.enableExtension("GL_OVR_multiview2","require","vertex"),this.builtins.vertex.push("layout(num_views = 2) in")}registerTransform(e,t){this.transforms.push({varyingName:e,attributeNode:t})}getTransforms(){const e=this.transforms;let t="";for(let r=0;r0&&(r+="\n"),r+=`\t// flow -> ${n}\n\t`),r+=`${s.code}\n\t`,e===i&&"compute"!==t&&(r+="// result\n\t","vertex"===t?(r+="gl_Position = ",r+=`${s.result};`):"fragment"===t&&(e.outputNode.isOutputStructNode||(r+="fragColor = ",r+=`${s.result};`)))}const n=e[t];n.extensions=this.getExtensions(t),n.uniforms=this.getUniforms(t),n.attributes=this.getAttributes(t),n.varyings=this.getVaryings(t),n.vars=this.getVars(t),n.structs=this.getStructs(t),n.codes=this.getCodes(t),n.transforms=this.getTransforms(t),n.flow=r}null!==this.material?(this.vertexShader=this._getGLSLVertexCode(e.vertex),this.fragmentShader=this._getGLSLFragmentCode(e.fragment)):this.computeShader=this._getGLSLVertexCode(e.compute)}getUniformFromNode(e,t,r,s=null){const i=super.getUniformFromNode(e,t,r,s),n=this.getDataFromNode(e,r,this.globalCache);let a=n.uniformGPU;if(void 0===a){const s=e.groupNode,o=s.name,u=this.getBindGroupArray(o,r);if("texture"===t)a=new Gv(i.name,i.node,s),u.push(a);else if("cubeTexture"===t)a=new zv(i.name,i.node,s),u.push(a);else if("texture3D"===t)a=new Hv(i.name,i.node,s),u.push(a);else if("buffer"===t){e.name=`NodeBuffer_${e.id}`,i.name=`buffer${e.id}`;const t=new Iv(e,s);t.name=e.name,u.push(t),a=t}else{const e=this.uniformGroups[r]||(this.uniformGroups[r]={});let n=e[o];void 0===n&&(n=new Uv(r+"_"+o,s),e[o]=n,u.push(n)),a=this.getNodeUniform(i,t),n.addUniform(a)}n.uniformGPU=a}return i}}let Qv=null,Zv=null;class Jv{constructor(e={}){this.parameters=Object.assign({},e),this.data=new WeakMap,this.renderer=null,this.domElement=null,this.timestampQueryPool={render:null,compute:null},this.trackTimestamp=!0===e.trackTimestamp}async init(e){this.renderer=e}get coordinateSystem(){}beginRender(){}finishRender(){}beginCompute(){}finishCompute(){}draw(){}compute(){}createProgram(){}destroyProgram(){}createBindings(){}updateBindings(){}updateBinding(){}createRenderPipeline(){}createComputePipeline(){}needsRenderUpdate(){}getRenderCacheKey(){}createNodeBuilder(){}createSampler(){}destroySampler(){}createDefaultTexture(){}createTexture(){}updateTexture(){}generateMipmaps(){}destroyTexture(){}async copyTextureToBuffer(){}copyTextureToTexture(){}copyFramebufferToTexture(){}createAttribute(){}createIndexAttribute(){}createStorageAttribute(){}updateAttribute(){}destroyAttribute(){}getContext(){}updateSize(){}updateViewport(){}isOccluded(){}async resolveTimestampsAsync(e="render"){if(!this.trackTimestamp)return void pt("WebGPURenderer: Timestamp tracking is disabled.");const t=this.timestampQueryPool[e];if(!t)return void pt(`WebGPURenderer: No timestamp query pool for type '${e}' found.`);const r=await t.resolveQueriesAsync();return this.renderer.info[e].timestamp=r,r}async waitForGPU(){}async getArrayBufferAsync(){}async hasFeatureAsync(){}hasFeature(){}getMaxAnisotropy(){}getDrawingBufferSize(){return Qv=Qv||new t,this.renderer.getDrawingBufferSize(Qv)}setScissorTest(){}getClearColor(){const e=this.renderer;return Zv=Zv||new Bf,e.getClearColor(Zv),Zv.getRGB(Zv),Zv}getDomElement(){let e=this.domElement;return null===e&&(e=void 0!==this.parameters.canvas?this.parameters.canvas:gt(),"setAttribute"in e&&e.setAttribute("data-engine",`three.js r${He} webgpu`),this.domElement=e),e}set(e,t){this.data.set(e,t)}get(e){let t=this.data.get(e);return void 0===t&&(t={},this.data.set(e,t)),t}has(e){return this.data.has(e)}delete(e){this.data.delete(e)}dispose(){}}let eN,tN,rN=0;class sN{constructor(e,t){this.buffers=[e.bufferGPU,t],this.type=e.type,this.bufferType=e.bufferType,this.pbo=e.pbo,this.byteLength=e.byteLength,this.bytesPerElement=e.BYTES_PER_ELEMENT,this.version=e.version,this.isInteger=e.isInteger,this.activeBufferIndex=0,this.baseId=e.id}get id(){return`${this.baseId}|${this.activeBufferIndex}`}get bufferGPU(){return this.buffers[this.activeBufferIndex]}get transformBuffer(){return this.buffers[1^this.activeBufferIndex]}switchBuffers(){this.activeBufferIndex^=1}}class iN{constructor(e){this.backend=e}createAttribute(e,t){const r=this.backend,{gl:s}=r,i=e.array,n=e.usage||s.STATIC_DRAW,a=e.isInterleavedBufferAttribute?e.data:e,o=r.get(a);let u,l=o.bufferGPU;if(void 0===l&&(l=this._createBuffer(s,t,i,n),o.bufferGPU=l,o.bufferType=t,o.version=a.version),i instanceof Float32Array)u=s.FLOAT;else if(i instanceof Uint16Array)u=e.isFloat16BufferAttribute?s.HALF_FLOAT:s.UNSIGNED_SHORT;else if(i instanceof Int16Array)u=s.SHORT;else if(i instanceof Uint32Array)u=s.UNSIGNED_INT;else if(i instanceof Int32Array)u=s.INT;else if(i instanceof Int8Array)u=s.BYTE;else if(i instanceof Uint8Array)u=s.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLBackend: Unsupported buffer data format: "+i);u=s.UNSIGNED_BYTE}let d={bufferGPU:l,bufferType:t,type:u,byteLength:i.byteLength,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version,pbo:e.pbo,isInteger:u===s.INT||u===s.UNSIGNED_INT||e.gpuType===_,id:rN++};if(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute){const e=this._createBuffer(s,t,i,n);d=new sN(d,e)}r.set(e,d)}updateAttribute(e){const t=this.backend,{gl:r}=t,s=e.array,i=e.isInterleavedBufferAttribute?e.data:e,n=t.get(i),a=n.bufferType,o=e.isInterleavedBufferAttribute?e.data.updateRanges:e.updateRanges;if(r.bindBuffer(a,n.bufferGPU),0===o.length)r.bufferSubData(a,0,s);else{for(let e=0,t=o.length;e1?this.enable(s.SAMPLE_ALPHA_TO_COVERAGE):this.disable(s.SAMPLE_ALPHA_TO_COVERAGE),r>0&&this.currentClippingPlanes!==r){const e=12288;for(let t=0;t<8;t++)t{!function i(){const n=e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0);if(n===e.WAIT_FAILED)return e.deleteSync(t),void s();n!==e.TIMEOUT_EXPIRED?(e.deleteSync(t),r()):requestAnimationFrame(i)}()}))}}let oN,uN,lN,dN=!1;class cN{constructor(e){this.backend=e,this.gl=e.gl,this.extensions=e.extensions,this.defaultTextures={},!1===dN&&(this._init(),dN=!0)}_init(){const e=this.gl;oN={[Nr]:e.REPEAT,[vr]:e.CLAMP_TO_EDGE,[_r]:e.MIRRORED_REPEAT},uN={[v]:e.NEAREST,[Sr]:e.NEAREST_MIPMAP_NEAREST,[Ge]:e.NEAREST_MIPMAP_LINEAR,[K]:e.LINEAR,[ke]:e.LINEAR_MIPMAP_NEAREST,[D]:e.LINEAR_MIPMAP_LINEAR},lN={[Pr]:e.NEVER,[Mr]:e.ALWAYS,[De]:e.LESS,[Cr]:e.LEQUAL,[Rr]:e.EQUAL,[Ar]:e.GEQUAL,[wr]:e.GREATER,[Er]:e.NOTEQUAL}}getGLTextureType(e){const{gl:t}=this;let r;return r=!0===e.isCubeTexture?t.TEXTURE_CUBE_MAP:!0===e.isArrayTexture||!0===e.isDataArrayTexture||!0===e.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:!0===e.isData3DTexture?t.TEXTURE_3D:t.TEXTURE_2D,r}getInternalFormat(e,t,r,s,i=!1){const{gl:n,extensions:a}=this;if(null!==e){if(void 0!==n[e])return n[e];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+e+"'")}let o=t;if(t===n.RED&&(r===n.FLOAT&&(o=n.R32F),r===n.HALF_FLOAT&&(o=n.R16F),r===n.UNSIGNED_BYTE&&(o=n.R8),r===n.UNSIGNED_SHORT&&(o=n.R16),r===n.UNSIGNED_INT&&(o=n.R32UI),r===n.BYTE&&(o=n.R8I),r===n.SHORT&&(o=n.R16I),r===n.INT&&(o=n.R32I)),t===n.RED_INTEGER&&(r===n.UNSIGNED_BYTE&&(o=n.R8UI),r===n.UNSIGNED_SHORT&&(o=n.R16UI),r===n.UNSIGNED_INT&&(o=n.R32UI),r===n.BYTE&&(o=n.R8I),r===n.SHORT&&(o=n.R16I),r===n.INT&&(o=n.R32I)),t===n.RG&&(r===n.FLOAT&&(o=n.RG32F),r===n.HALF_FLOAT&&(o=n.RG16F),r===n.UNSIGNED_BYTE&&(o=n.RG8),r===n.UNSIGNED_SHORT&&(o=n.RG16),r===n.UNSIGNED_INT&&(o=n.RG32UI),r===n.BYTE&&(o=n.RG8I),r===n.SHORT&&(o=n.RG16I),r===n.INT&&(o=n.RG32I)),t===n.RG_INTEGER&&(r===n.UNSIGNED_BYTE&&(o=n.RG8UI),r===n.UNSIGNED_SHORT&&(o=n.RG16UI),r===n.UNSIGNED_INT&&(o=n.RG32UI),r===n.BYTE&&(o=n.RG8I),r===n.SHORT&&(o=n.RG16I),r===n.INT&&(o=n.RG32I)),t===n.RGB){const e=i?Fr:c.getTransfer(s);r===n.FLOAT&&(o=n.RGB32F),r===n.HALF_FLOAT&&(o=n.RGB16F),r===n.UNSIGNED_BYTE&&(o=n.RGB8),r===n.UNSIGNED_SHORT&&(o=n.RGB16),r===n.UNSIGNED_INT&&(o=n.RGB32UI),r===n.BYTE&&(o=n.RGB8I),r===n.SHORT&&(o=n.RGB16I),r===n.INT&&(o=n.RGB32I),r===n.UNSIGNED_BYTE&&(o=e===h?n.SRGB8:n.RGB8),r===n.UNSIGNED_SHORT_5_6_5&&(o=n.RGB565),r===n.UNSIGNED_SHORT_5_5_5_1&&(o=n.RGB5_A1),r===n.UNSIGNED_SHORT_4_4_4_4&&(o=n.RGB4),r===n.UNSIGNED_INT_5_9_9_9_REV&&(o=n.RGB9_E5)}if(t===n.RGB_INTEGER&&(r===n.UNSIGNED_BYTE&&(o=n.RGB8UI),r===n.UNSIGNED_SHORT&&(o=n.RGB16UI),r===n.UNSIGNED_INT&&(o=n.RGB32UI),r===n.BYTE&&(o=n.RGB8I),r===n.SHORT&&(o=n.RGB16I),r===n.INT&&(o=n.RGB32I)),t===n.RGBA){const e=i?Fr:c.getTransfer(s);r===n.FLOAT&&(o=n.RGBA32F),r===n.HALF_FLOAT&&(o=n.RGBA16F),r===n.UNSIGNED_BYTE&&(o=n.RGBA8),r===n.UNSIGNED_SHORT&&(o=n.RGBA16),r===n.UNSIGNED_INT&&(o=n.RGBA32UI),r===n.BYTE&&(o=n.RGBA8I),r===n.SHORT&&(o=n.RGBA16I),r===n.INT&&(o=n.RGBA32I),r===n.UNSIGNED_BYTE&&(o=e===h?n.SRGB8_ALPHA8:n.RGBA8),r===n.UNSIGNED_SHORT_4_4_4_4&&(o=n.RGBA4),r===n.UNSIGNED_SHORT_5_5_5_1&&(o=n.RGB5_A1)}return t===n.RGBA_INTEGER&&(r===n.UNSIGNED_BYTE&&(o=n.RGBA8UI),r===n.UNSIGNED_SHORT&&(o=n.RGBA16UI),r===n.UNSIGNED_INT&&(o=n.RGBA32UI),r===n.BYTE&&(o=n.RGBA8I),r===n.SHORT&&(o=n.RGBA16I),r===n.INT&&(o=n.RGBA32I)),t===n.DEPTH_COMPONENT&&(r===n.UNSIGNED_SHORT&&(o=n.DEPTH_COMPONENT16),r===n.UNSIGNED_INT&&(o=n.DEPTH_COMPONENT24),r===n.FLOAT&&(o=n.DEPTH_COMPONENT32F)),t===n.DEPTH_STENCIL&&r===n.UNSIGNED_INT_24_8&&(o=n.DEPTH24_STENCIL8),o!==n.R16F&&o!==n.R32F&&o!==n.RG16F&&o!==n.RG32F&&o!==n.RGBA16F&&o!==n.RGBA32F||a.get("EXT_color_buffer_float"),o}setTextureParameters(e,t){const{gl:r,extensions:s,backend:i}=this,n=c.getPrimaries(c.workingColorSpace),a=t.colorSpace===b?null:c.getPrimaries(t.colorSpace),o=t.colorSpace===b||n===a?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,t.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,t.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,o),r.texParameteri(e,r.TEXTURE_WRAP_S,oN[t.wrapS]),r.texParameteri(e,r.TEXTURE_WRAP_T,oN[t.wrapT]),e!==r.TEXTURE_3D&&e!==r.TEXTURE_2D_ARRAY||t.isArrayTexture||r.texParameteri(e,r.TEXTURE_WRAP_R,oN[t.wrapR]),r.texParameteri(e,r.TEXTURE_MAG_FILTER,uN[t.magFilter]);const u=void 0!==t.mipmaps&&t.mipmaps.length>0,l=t.minFilter===K&&u?D:t.minFilter;if(r.texParameteri(e,r.TEXTURE_MIN_FILTER,uN[l]),t.compareFunction&&(r.texParameteri(e,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(e,r.TEXTURE_COMPARE_FUNC,lN[t.compareFunction])),!0===s.has("EXT_texture_filter_anisotropic")){if(t.magFilter===v)return;if(t.minFilter!==Ge&&t.minFilter!==D)return;if(t.type===B&&!1===s.has("OES_texture_float_linear"))return;if(t.anisotropy>1){const n=s.get("EXT_texture_filter_anisotropic");r.texParameterf(e,n.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,i.getMaxAnisotropy()))}}}createDefaultTexture(e){const{gl:t,backend:r,defaultTextures:s}=this,i=this.getGLTextureType(e);let n=s[i];void 0===n&&(n=t.createTexture(),r.state.bindTexture(i,n),t.texParameteri(i,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(i,t.TEXTURE_MAG_FILTER,t.NEAREST),s[i]=n),r.set(e,{textureGPU:n,glTextureType:i,isDefault:!0})}createTexture(e,t){const{gl:r,backend:s}=this,{levels:i,width:n,height:a,depth:o}=t,u=s.utils.convert(e.format,e.colorSpace),l=s.utils.convert(e.type),d=this.getInternalFormat(e.internalFormat,u,l,e.colorSpace,e.isVideoTexture),c=r.createTexture(),h=this.getGLTextureType(e);s.state.bindTexture(h,c),this.setTextureParameters(h,e),e.isArrayTexture||e.isDataArrayTexture||e.isCompressedArrayTexture?r.texStorage3D(r.TEXTURE_2D_ARRAY,i,d,n,a,o):e.isData3DTexture?r.texStorage3D(r.TEXTURE_3D,i,d,n,a,o):e.isVideoTexture||r.texStorage2D(h,i,d,n,a),s.set(e,{textureGPU:c,glTextureType:h,glFormat:u,glType:l,glInternalFormat:d})}copyBufferToTexture(e,t){const{gl:r,backend:s}=this,{textureGPU:i,glTextureType:n,glFormat:a,glType:o}=s.get(t),{width:u,height:l}=t.source.data;r.bindBuffer(r.PIXEL_UNPACK_BUFFER,e),s.state.bindTexture(n,i),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.texSubImage2D(n,0,0,0,u,l,a,o,0),r.bindBuffer(r.PIXEL_UNPACK_BUFFER,null),s.state.unbindTexture()}updateTexture(e,t){const{gl:r}=this,{width:s,height:i}=t,{textureGPU:n,glTextureType:a,glFormat:o,glType:u,glInternalFormat:l}=this.backend.get(e);if(!e.isRenderTargetTexture&&void 0!==n)if(this.backend.state.bindTexture(a,n),this.setTextureParameters(a,e),e.isCompressedTexture){const s=e.mipmaps,i=t.image;for(let t=0;t0,c=t.renderTarget?t.renderTarget.height:this.backend.getDrawingBufferSize().y;if(d){const r=0!==a||0!==o;let d,h;if(!0===e.isDepthTexture?(d=s.DEPTH_BUFFER_BIT,h=s.DEPTH_ATTACHMENT,t.stencil&&(d|=s.STENCIL_BUFFER_BIT)):(d=s.COLOR_BUFFER_BIT,h=s.COLOR_ATTACHMENT0),r){const e=this.backend.get(t.renderTarget),r=e.framebuffers[t.getCacheKey()],h=e.msaaFrameBuffer;i.bindFramebuffer(s.DRAW_FRAMEBUFFER,r),i.bindFramebuffer(s.READ_FRAMEBUFFER,h);const p=c-o-l;s.blitFramebuffer(a,p,a+u,p+l,a,p,a+u,p+l,d,s.NEAREST),i.bindFramebuffer(s.READ_FRAMEBUFFER,r),i.bindTexture(s.TEXTURE_2D,n),s.copyTexSubImage2D(s.TEXTURE_2D,0,0,0,a,p,u,l),i.unbindTexture()}else{const e=s.createFramebuffer();i.bindFramebuffer(s.DRAW_FRAMEBUFFER,e),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,h,s.TEXTURE_2D,n,0),s.blitFramebuffer(0,0,u,l,0,0,u,l,d,s.NEAREST),s.deleteFramebuffer(e)}}else i.bindTexture(s.TEXTURE_2D,n),s.copyTexSubImage2D(s.TEXTURE_2D,0,0,0,a,c-l-o,u,l),i.unbindTexture();e.generateMipmaps&&this.generateMipmaps(e),this.backend._setFramebuffer(t)}setupRenderBufferStorage(e,t,r,s=!1){const{gl:i}=this,n=t.renderTarget,{depthTexture:a,depthBuffer:o,stencilBuffer:u,width:l,height:d}=n;if(i.bindRenderbuffer(i.RENDERBUFFER,e),o&&!u){let t=i.DEPTH_COMPONENT24;if(!0===s){this.extensions.get("WEBGL_multisampled_render_to_texture").renderbufferStorageMultisampleEXT(i.RENDERBUFFER,n.samples,t,l,d)}else r>0?(a&&a.isDepthTexture&&a.type===i.FLOAT&&(t=i.DEPTH_COMPONENT32F),i.renderbufferStorageMultisample(i.RENDERBUFFER,r,t,l,d)):i.renderbufferStorage(i.RENDERBUFFER,t,l,d);i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.RENDERBUFFER,e)}else o&&u&&(r>0?i.renderbufferStorageMultisample(i.RENDERBUFFER,r,i.DEPTH24_STENCIL8,l,d):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,l,d),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,e));i.bindRenderbuffer(i.RENDERBUFFER,null)}async copyTextureToBuffer(e,t,r,s,i,n){const{backend:a,gl:o}=this,{textureGPU:u,glFormat:l,glType:d}=this.backend.get(e),c=o.createFramebuffer();o.bindFramebuffer(o.READ_FRAMEBUFFER,c);const h=e.isCubeTexture?o.TEXTURE_CUBE_MAP_POSITIVE_X+n:o.TEXTURE_2D;o.framebufferTexture2D(o.READ_FRAMEBUFFER,o.COLOR_ATTACHMENT0,h,u,0);const p=this._getTypedArrayType(d),g=s*i*this._getBytesPerTexel(d,l),m=o.createBuffer();o.bindBuffer(o.PIXEL_PACK_BUFFER,m),o.bufferData(o.PIXEL_PACK_BUFFER,g,o.STREAM_READ),o.readPixels(t,r,s,i,l,d,0),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),await a.utils._clientWaitAsync();const f=new p(g/p.BYTES_PER_ELEMENT);return o.bindBuffer(o.PIXEL_PACK_BUFFER,m),o.getBufferSubData(o.PIXEL_PACK_BUFFER,0,f),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),o.deleteFramebuffer(c),f}_getTypedArrayType(e){const{gl:t}=this;if(e===t.UNSIGNED_BYTE)return Uint8Array;if(e===t.UNSIGNED_SHORT_4_4_4_4)return Uint16Array;if(e===t.UNSIGNED_SHORT_5_5_5_1)return Uint16Array;if(e===t.UNSIGNED_SHORT_5_6_5)return Uint16Array;if(e===t.UNSIGNED_SHORT)return Uint16Array;if(e===t.UNSIGNED_INT)return Uint32Array;if(e===t.HALF_FLOAT)return Uint16Array;if(e===t.FLOAT)return Float32Array;throw new Error(`Unsupported WebGL type: ${e}`)}_getBytesPerTexel(e,t){const{gl:r}=this;let s=0;return e===r.UNSIGNED_BYTE&&(s=1),e!==r.UNSIGNED_SHORT_4_4_4_4&&e!==r.UNSIGNED_SHORT_5_5_5_1&&e!==r.UNSIGNED_SHORT_5_6_5&&e!==r.UNSIGNED_SHORT&&e!==r.HALF_FLOAT||(s=2),e!==r.UNSIGNED_INT&&e!==r.FLOAT||(s=4),t===r.RGBA?4*s:t===r.RGB?3*s:t===r.ALPHA?s:void 0}}function hN(e){return e.isDataTexture?e.image.data:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?e:e.data}class pN{constructor(e){this.backend=e,this.gl=this.backend.gl,this.availableExtensions=this.gl.getSupportedExtensions(),this.extensions={}}get(e){let t=this.extensions[e];return void 0===t&&(t=this.gl.getExtension(e),this.extensions[e]=t),t}has(e){return this.availableExtensions.includes(e)}}class gN{constructor(e){this.backend=e,this.maxAnisotropy=null}getMaxAnisotropy(){if(null!==this.maxAnisotropy)return this.maxAnisotropy;const e=this.backend.gl,t=this.backend.extensions;if(!0===t.has("EXT_texture_filter_anisotropic")){const r=t.get("EXT_texture_filter_anisotropic");this.maxAnisotropy=e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else this.maxAnisotropy=0;return this.maxAnisotropy}}const mN={WEBGL_multi_draw:"WEBGL_multi_draw",WEBGL_compressed_texture_astc:"texture-compression-astc",WEBGL_compressed_texture_etc:"texture-compression-etc2",WEBGL_compressed_texture_etc1:"texture-compression-etc1",WEBGL_compressed_texture_pvrtc:"texture-compression-pvrtc",WEBKIT_WEBGL_compressed_texture_pvrtc:"texture-compression-pvrtc",WEBGL_compressed_texture_s3tc:"texture-compression-bc",EXT_texture_compression_bptc:"texture-compression-bptc",EXT_disjoint_timer_query_webgl2:"timestamp-query",OVR_multiview2:"OVR_multiview2"};class fN{constructor(e){this.gl=e.gl,this.extensions=e.extensions,this.info=e.renderer.info,this.mode=null,this.index=0,this.type=null,this.object=null}render(e,t){const{gl:r,mode:s,object:i,type:n,info:a,index:o}=this;0!==o?r.drawElements(s,t,n,e):r.drawArrays(s,e,t),a.update(i,t,1)}renderInstances(e,t,r){const{gl:s,mode:i,type:n,index:a,object:o,info:u}=this;0!==r&&(0!==a?s.drawElementsInstanced(i,t,n,e,r):s.drawArraysInstanced(i,e,t,r),u.update(o,t,r))}renderMultiDraw(e,t,r){const{extensions:s,mode:i,object:n,info:a}=this;if(0===r)return;const o=s.get("WEBGL_multi_draw");if(null===o)for(let s=0;sthis.maxQueries)return pt(`WebGPUTimestampQueryPool [${this.type}]: Maximum number of queries exceeded, when using trackTimestamp it is necessary to resolves the queries via renderer.resolveTimestampsAsync( THREE.TimestampQuery.${this.type.toUpperCase()} ).`),null;const t=this.currentQueryIndex;return this.currentQueryIndex+=2,this.queryStates.set(t,"inactive"),this.queryOffsets.set(e.id,t),t}beginQuery(e){if(!this.trackTimestamp||this.isDisposed)return;const t=this.queryOffsets.get(e.id);if(null==t)return;if(null!==this.activeQuery)return;const r=this.queries[t];if(r)try{"inactive"===this.queryStates.get(t)&&(this.gl.beginQuery(this.ext.TIME_ELAPSED_EXT,r),this.activeQuery=t,this.queryStates.set(t,"started"))}catch(e){console.error("Error in beginQuery:",e),this.activeQuery=null,this.queryStates.set(t,"inactive")}}endQuery(e){if(!this.trackTimestamp||this.isDisposed)return;const t=this.queryOffsets.get(e.id);if(null!=t&&this.activeQuery===t)try{this.gl.endQuery(this.ext.TIME_ELAPSED_EXT),this.queryStates.set(t,"ended"),this.activeQuery=null}catch(e){console.error("Error in endQuery:",e),this.queryStates.set(t,"inactive"),this.activeQuery=null}}async resolveQueriesAsync(){if(!this.trackTimestamp||this.pendingResolve)return this.lastValue;this.pendingResolve=!0;try{const e=[];for(const[t,r]of this.queryStates)if("ended"===r){const r=this.queries[t];e.push(this.resolveQuery(r))}if(0===e.length)return this.lastValue;const t=(await Promise.all(e)).reduce(((e,t)=>e+t),0);return this.lastValue=t,this.currentQueryIndex=0,this.queryOffsets.clear(),this.queryStates.clear(),this.activeQuery=null,t}catch(e){return console.error("Error resolving queries:",e),this.lastValue}finally{this.pendingResolve=!1}}async resolveQuery(e){return new Promise((t=>{if(this.isDisposed)return void t(this.lastValue);let r,s=!1;const i=e=>{s||(s=!0,r&&(clearTimeout(r),r=null),t(e))},n=()=>{if(this.isDisposed)i(this.lastValue);else try{if(this.gl.getParameter(this.ext.GPU_DISJOINT_EXT))return void i(this.lastValue);if(!this.gl.getQueryParameter(e,this.gl.QUERY_RESULT_AVAILABLE))return void(r=setTimeout(n,1));const s=this.gl.getQueryParameter(e,this.gl.QUERY_RESULT);t(Number(s)/1e6)}catch(e){console.error("Error checking query:",e),t(this.lastValue)}};n()}))}dispose(){if(!this.isDisposed&&(this.isDisposed=!0,this.trackTimestamp)){for(const e of this.queries)this.gl.deleteQuery(e);this.queries=[],this.queryStates.clear(),this.queryOffsets.clear(),this.lastValue=0,this.activeQuery=null}}}const xN=new t;class TN extends Jv{constructor(e={}){super(e),this.isWebGLBackend=!0,this.attributeUtils=null,this.extensions=null,this.capabilities=null,this.textureUtils=null,this.bufferRenderer=null,this.gl=null,this.state=null,this.utils=null,this.vaoCache={},this.transformFeedbackCache={},this.discard=!1,this.disjoint=null,this.parallel=null,this._currentContext=null,this._knownBindings=new WeakSet,this._supportsInvalidateFramebuffer="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),this._xrFramebuffer=null}init(e){super.init(e);const t=this.parameters,r={antialias:e.samples>0,alpha:!0,depth:e.depth,stencil:e.stencil},s=void 0!==t.context?t.context:e.domElement.getContext("webgl2",r);function i(t){t.preventDefault();const r={api:"WebGL",message:t.statusMessage||"Unknown reason",reason:null,originalEvent:t};e.onDeviceLost(r)}this._onContextLost=i,e.domElement.addEventListener("webglcontextlost",i,!1),this.gl=s,this.extensions=new pN(this),this.capabilities=new gN(this),this.attributeUtils=new iN(this),this.textureUtils=new cN(this),this.bufferRenderer=new fN(this),this.state=new nN(this),this.utils=new aN(this),this.extensions.get("EXT_color_buffer_float"),this.extensions.get("WEBGL_clip_cull_distance"),this.extensions.get("OES_texture_float_linear"),this.extensions.get("EXT_color_buffer_half_float"),this.extensions.get("WEBGL_multisampled_render_to_texture"),this.extensions.get("WEBGL_render_shared_exponent"),this.extensions.get("WEBGL_multi_draw"),this.extensions.get("OVR_multiview2"),this.disjoint=this.extensions.get("EXT_disjoint_timer_query_webgl2"),this.parallel=this.extensions.get("KHR_parallel_shader_compile")}get coordinateSystem(){return l}async getArrayBufferAsync(e){return await this.attributeUtils.getArrayBufferAsync(e)}async waitForGPU(){await this.utils._clientWaitAsync()}async makeXRCompatible(){!0!==this.gl.getContextAttributes().xrCompatible&&await this.gl.makeXRCompatible()}setXRTarget(e){this._xrFramebuffer=e}setXRRenderTargetTextures(e,t,r=null){const s=this.gl;if(this.set(e.texture,{textureGPU:t,glInternalFormat:s.RGBA8}),null!==r){const t=e.stencilBuffer?s.DEPTH24_STENCIL8:s.DEPTH_COMPONENT24;this.set(e.depthTexture,{textureGPU:r,glInternalFormat:t}),!0===this.extensions.has("WEBGL_multisampled_render_to_texture")&&!0===e._autoAllocateDepthBuffer&&!1===e.multiview&&console.warn("THREE.WebGLBackend: Render-to-texture extension was disabled because an external texture was provided"),e._autoAllocateDepthBuffer=!1}}initTimestampQuery(e){if(!this.disjoint||!this.trackTimestamp)return;const t=e.isComputeNode?"compute":"render";this.timestampQueryPool[t]||(this.timestampQueryPool[t]=new bN(this.gl,t,2048));const r=this.timestampQueryPool[t];null!==r.allocateQueriesForContext(e)&&r.beginQuery(e)}prepareTimestampBuffer(e){if(!this.disjoint||!this.trackTimestamp)return;const t=e.isComputeNode?"compute":"render";this.timestampQueryPool[t].endQuery(e)}getContext(){return this.gl}beginRender(e){const{state:t}=this,r=this.get(e);if(e.viewport)this.updateViewport(e);else{const{width:e,height:r}=this.getDrawingBufferSize(xN);t.viewport(0,0,e,r)}if(e.scissor){const{x:r,y:s,width:i,height:n}=e.scissorValue;t.scissor(r,e.height-n-s,i,n)}this.initTimestampQuery(e),r.previousContext=this._currentContext,this._currentContext=e,this._setFramebuffer(e),this.clear(e.clearColor,e.clearDepth,e.clearStencil,e,!1);const s=e.occlusionQueryCount;s>0&&(r.currentOcclusionQueries=r.occlusionQueries,r.currentOcclusionQueryObjects=r.occlusionQueryObjects,r.lastOcclusionObject=null,r.occlusionQueries=new Array(s),r.occlusionQueryObjects=new Array(s),r.occlusionQueryIndex=0)}finishRender(e){const{gl:t,state:r}=this,s=this.get(e),i=s.previousContext;r.resetVertexState();const n=e.occlusionQueryCount;n>0&&(n>s.occlusionQueryIndex&&t.endQuery(t.ANY_SAMPLES_PASSED),this.resolveOccludedAsync(e));const a=e.textures;if(null!==a)for(let e=0;e0&&!1===this._useMultisampledExtension(o)){const i=s.framebuffers[e.getCacheKey()];let n=t.COLOR_BUFFER_BIT;o.resolveDepthBuffer&&(o.depthBuffer&&(n|=t.DEPTH_BUFFER_BIT),o.stencilBuffer&&o.resolveStencilBuffer&&(n|=t.STENCIL_BUFFER_BIT));const a=s.msaaFrameBuffer,u=s.msaaRenderbuffers,l=e.textures,d=l.length>1;if(r.bindFramebuffer(t.READ_FRAMEBUFFER,a),r.bindFramebuffer(t.DRAW_FRAMEBUFFER,i),d)for(let e=0;e{let a=0;for(let t=0;t{t.isBatchedMesh?null!==t._multiDrawInstances?(pt("THREE.WebGLBackend: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),b.renderMultiDrawInstances(t._multiDrawStarts,t._multiDrawCounts,t._multiDrawCount,t._multiDrawInstances)):this.hasFeature("WEBGL_multi_draw")?b.renderMultiDraw(t._multiDrawStarts,t._multiDrawCounts,t._multiDrawCount):pt("THREE.WebGLRenderer: WEBGL_multi_draw not supported."):T>1?b.renderInstances(_,x,T):b.render(_,x)};if(!0===e.camera.isArrayCamera&&e.camera.cameras.length>0&&!1===e.camera.isMultiViewCamera){const r=this.get(e.camera),s=e.camera.cameras,i=e.getBindingGroup("cameraIndex").bindings[0];if(void 0===r.indexesGPU||r.indexesGPU.length!==s.length){const e=new Uint32Array([0,0,0,0]),t=[];for(let r=0,i=s.length;r{const i=this.parallel,n=()=>{r.getProgramParameter(a,i.COMPLETION_STATUS_KHR)?(this._completeCompile(e,s),t()):requestAnimationFrame(n)};n()}));t.push(i)}else this._completeCompile(e,s)}_handleSource(e,t){const r=e.split("\n"),s=[],i=Math.max(t-6,0),n=Math.min(t+6,r.length);for(let e=i;e":" "} ${i}: ${r[e]}`)}return s.join("\n")}_getShaderErrors(e,t,r){const s=e.getShaderParameter(t,e.COMPILE_STATUS),i=e.getShaderInfoLog(t).trim();if(s&&""===i)return"";const n=/ERROR: 0:(\d+)/.exec(i);if(n){const s=parseInt(n[1]);return r.toUpperCase()+"\n\n"+i+"\n\n"+this._handleSource(e.getShaderSource(t),s)}return i}_logProgramError(e,t,r){if(this.renderer.debug.checkShaderErrors){const s=this.gl,i=s.getProgramInfoLog(e).trim();if(!1===s.getProgramParameter(e,s.LINK_STATUS))if("function"==typeof this.renderer.debug.onShaderError)this.renderer.debug.onShaderError(s,e,r,t);else{const n=this._getShaderErrors(s,r,"vertex"),a=this._getShaderErrors(s,t,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(e,s.VALIDATE_STATUS)+"\n\nProgram Info Log: "+i+"\n"+n+"\n"+a)}else""!==i&&console.warn("THREE.WebGLProgram: Program Info Log:",i)}}_completeCompile(e,t){const{state:r,gl:s}=this,i=this.get(t),{programGPU:n,fragmentShader:a,vertexShader:o}=i;!1===s.getProgramParameter(n,s.LINK_STATUS)&&this._logProgramError(n,a,o),r.useProgram(n);const u=e.getBindings();this._setupBindings(u,n),this.set(t,{programGPU:n})}createComputePipeline(e,t){const{state:r,gl:s}=this,i={stage:"fragment",code:"#version 300 es\nprecision highp float;\nvoid main() {}"};this.createProgram(i);const{computeProgram:n}=e,a=s.createProgram(),o=this.get(i).shaderGPU,u=this.get(n).shaderGPU,l=n.transforms,d=[],c=[];for(let e=0;emN[t]===e)),r=this.extensions;for(let e=0;e1,h=!0===i.isXRRenderTarget,p=!0===h&&!0===i._hasExternalTextures;let g=n.msaaFrameBuffer,m=n.depthRenderbuffer;const f=this.extensions.get("WEBGL_multisampled_render_to_texture"),y=this.extensions.get("OVR_multiview2"),b=this._useMultisampledExtension(i),x=Af(e);let T;if(l?(n.cubeFramebuffers||(n.cubeFramebuffers={}),T=n.cubeFramebuffers[x]):h&&!1===p?T=this._xrFramebuffer:(n.framebuffers||(n.framebuffers={}),T=n.framebuffers[x]),void 0===T){T=t.createFramebuffer(),r.bindFramebuffer(t.FRAMEBUFFER,T);const s=e.textures,o=[];if(l){n.cubeFramebuffers[x]=T;const{textureGPU:e}=this.get(s[0]),r=this.renderer._activeCubeFace;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+r,e,0)}else{n.framebuffers[x]=T;for(let r=0;r0&&!1===b&&!i.multiview){if(void 0===g){const s=[];g=t.createFramebuffer(),r.bindFramebuffer(t.FRAMEBUFFER,g);const i=[],l=e.textures;for(let r=0;r0&&!0===this.extensions.has("WEBGL_multisampled_render_to_texture")&&!1!==e._autoAllocateDepthBuffer}dispose(){const e=this.extensions.get("WEBGL_lose_context");e&&e.loseContext(),this.renderer.domElement.removeEventListener("webglcontextlost",this._onContextLost)}}const _N="point-list",vN="line-list",NN="line-strip",SN="triangle-list",EN="triangle-strip",wN="never",AN="less",RN="equal",CN="less-equal",MN="greater",PN="not-equal",FN="greater-equal",LN="always",BN="store",IN="load",DN="clear",VN="ccw",UN="none",ON="front",kN="back",GN="uint16",zN="uint32",HN="r8unorm",$N="r8snorm",WN="r8uint",jN="r8sint",qN="r16uint",XN="r16sint",KN="r16float",YN="rg8unorm",QN="rg8snorm",ZN="rg8uint",JN="rg8sint",eS="r32uint",tS="r32sint",rS="r32float",sS="rg16uint",iS="rg16sint",nS="rg16float",aS="rgba8unorm",oS="rgba8unorm-srgb",uS="rgba8snorm",lS="rgba8uint",dS="rgba8sint",cS="bgra8unorm",hS="bgra8unorm-srgb",pS="rgb9e5ufloat",gS="rgb10a2unorm",mS="rgb10a2unorm",fS="rg32uint",yS="rg32sint",bS="rg32float",xS="rgba16uint",TS="rgba16sint",_S="rgba16float",vS="rgba32uint",NS="rgba32sint",SS="rgba32float",ES="depth16unorm",wS="depth24plus",AS="depth24plus-stencil8",RS="depth32float",CS="depth32float-stencil8",MS="bc1-rgba-unorm",PS="bc1-rgba-unorm-srgb",FS="bc2-rgba-unorm",LS="bc2-rgba-unorm-srgb",BS="bc3-rgba-unorm",IS="bc3-rgba-unorm-srgb",DS="bc4-r-unorm",VS="bc4-r-snorm",US="bc5-rg-unorm",OS="bc5-rg-snorm",kS="bc6h-rgb-ufloat",GS="bc6h-rgb-float",zS="bc7-rgba-unorm",HS="bc7-rgba-srgb",$S="etc2-rgb8unorm",WS="etc2-rgb8unorm-srgb",jS="etc2-rgb8a1unorm",qS="etc2-rgb8a1unorm-srgb",XS="etc2-rgba8unorm",KS="etc2-rgba8unorm-srgb",YS="eac-r11unorm",QS="eac-r11snorm",ZS="eac-rg11unorm",JS="eac-rg11snorm",eE="astc-4x4-unorm",tE="astc-4x4-unorm-srgb",rE="astc-5x4-unorm",sE="astc-5x4-unorm-srgb",iE="astc-5x5-unorm",nE="astc-5x5-unorm-srgb",aE="astc-6x5-unorm",oE="astc-6x5-unorm-srgb",uE="astc-6x6-unorm",lE="astc-6x6-unorm-srgb",dE="astc-8x5-unorm",cE="astc-8x5-unorm-srgb",hE="astc-8x6-unorm",pE="astc-8x6-unorm-srgb",gE="astc-8x8-unorm",mE="astc-8x8-unorm-srgb",fE="astc-10x5-unorm",yE="astc-10x5-unorm-srgb",bE="astc-10x6-unorm",xE="astc-10x6-unorm-srgb",TE="astc-10x8-unorm",_E="astc-10x8-unorm-srgb",vE="astc-10x10-unorm",NE="astc-10x10-unorm-srgb",SE="astc-12x10-unorm",EE="astc-12x10-unorm-srgb",wE="astc-12x12-unorm",AE="astc-12x12-unorm-srgb",RE="clamp-to-edge",CE="repeat",ME="mirror-repeat",PE="linear",FE="nearest",LE="zero",BE="one",IE="src",DE="one-minus-src",VE="src-alpha",UE="one-minus-src-alpha",OE="dst",kE="one-minus-dst",GE="dst-alpha",zE="one-minus-dst-alpha",HE="src-alpha-saturated",$E="constant",WE="one-minus-constant",jE="add",qE="subtract",XE="reverse-subtract",KE="min",YE="max",QE=0,ZE=15,JE="keep",ew="zero",tw="replace",rw="invert",sw="increment-clamp",iw="decrement-clamp",nw="increment-wrap",aw="decrement-wrap",ow="storage",uw="read-only-storage",lw="write-only",dw="read-only",cw="read-write",hw="non-filtering",pw="comparison",gw="float",mw="unfilterable-float",fw="depth",yw="sint",bw="uint",xw="2d",Tw="3d",_w="2d",vw="2d-array",Nw="cube",Sw="3d",Ew="all",ww="vertex",Aw="instance",Rw={DepthClipControl:"depth-clip-control",Depth32FloatStencil8:"depth32float-stencil8",TextureCompressionBC:"texture-compression-bc",TextureCompressionETC2:"texture-compression-etc2",TextureCompressionASTC:"texture-compression-astc",TimestampQuery:"timestamp-query",IndirectFirstInstance:"indirect-first-instance",ShaderF16:"shader-f16",RG11B10UFloat:"rg11b10ufloat-renderable",BGRA8UNormStorage:"bgra8unorm-storage",Float32Filterable:"float32-filterable",ClipDistances:"clip-distances",DualSourceBlending:"dual-source-blending",Subgroups:"subgroups"};class Cw extends Pv{constructor(e,t){super(e),this.texture=t,this.version=t?t.version:0,this.isSampler=!0}}class Mw extends Cw{constructor(e,t,r){super(e,t?t.value:null),this.textureNode=t,this.groupNode=r}update(){this.texture=this.textureNode.value}}class Pw extends Fv{constructor(e,t){super(e,t?t.array:null),this.attribute=t,this.isStorageBuffer=!0}}let Fw=0;class Lw extends Pw{constructor(e,t){super("StorageBuffer_"+Fw++,e?e.value:null),this.nodeUniform=e,this.access=e?e.access:Os.READ_WRITE,this.groupNode=t}get buffer(){return this.nodeUniform.value}}class Bw extends ef{constructor(e){super(),this.device=e;this.mipmapSampler=e.createSampler({minFilter:PE}),this.flipYSampler=e.createSampler({minFilter:FE}),this.transferPipelines={},this.flipYPipelines={},this.mipmapVertexShaderModule=e.createShaderModule({label:"mipmapVertex",code:"\nstruct VarysStruct {\n\t@builtin( position ) Position: vec4,\n\t@location( 0 ) vTex : vec2\n};\n\n@vertex\nfn main( @builtin( vertex_index ) vertexIndex : u32 ) -> VarysStruct {\n\n\tvar Varys : VarysStruct;\n\n\tvar pos = array< vec2, 4 >(\n\t\tvec2( -1.0, 1.0 ),\n\t\tvec2( 1.0, 1.0 ),\n\t\tvec2( -1.0, -1.0 ),\n\t\tvec2( 1.0, -1.0 )\n\t);\n\n\tvar tex = array< vec2, 4 >(\n\t\tvec2( 0.0, 0.0 ),\n\t\tvec2( 1.0, 0.0 ),\n\t\tvec2( 0.0, 1.0 ),\n\t\tvec2( 1.0, 1.0 )\n\t);\n\n\tVarys.vTex = tex[ vertexIndex ];\n\tVarys.Position = vec4( pos[ vertexIndex ], 0.0, 1.0 );\n\n\treturn Varys;\n\n}\n"}),this.mipmapFragmentShaderModule=e.createShaderModule({label:"mipmapFragment",code:"\n@group( 0 ) @binding( 0 )\nvar imgSampler : sampler;\n\n@group( 0 ) @binding( 1 )\nvar img : texture_2d;\n\n@fragment\nfn main( @location( 0 ) vTex : vec2 ) -> @location( 0 ) vec4 {\n\n\treturn textureSample( img, imgSampler, vTex );\n\n}\n"}),this.flipYFragmentShaderModule=e.createShaderModule({label:"flipYFragment",code:"\n@group( 0 ) @binding( 0 )\nvar imgSampler : sampler;\n\n@group( 0 ) @binding( 1 )\nvar img : texture_2d;\n\n@fragment\nfn main( @location( 0 ) vTex : vec2 ) -> @location( 0 ) vec4 {\n\n\treturn textureSample( img, imgSampler, vec2( vTex.x, 1.0 - vTex.y ) );\n\n}\n"})}getTransferPipeline(e){let t=this.transferPipelines[e];return void 0===t&&(t=this.device.createRenderPipeline({label:`mipmap-${e}`,vertex:{module:this.mipmapVertexShaderModule,entryPoint:"main"},fragment:{module:this.mipmapFragmentShaderModule,entryPoint:"main",targets:[{format:e}]},primitive:{topology:EN,stripIndexFormat:zN},layout:"auto"}),this.transferPipelines[e]=t),t}getFlipYPipeline(e){let t=this.flipYPipelines[e];return void 0===t&&(t=this.device.createRenderPipeline({label:`flipY-${e}`,vertex:{module:this.mipmapVertexShaderModule,entryPoint:"main"},fragment:{module:this.flipYFragmentShaderModule,entryPoint:"main",targets:[{format:e}]},primitive:{topology:EN,stripIndexFormat:zN},layout:"auto"}),this.flipYPipelines[e]=t),t}flipY(e,t,r=0){const s=t.format,{width:i,height:n}=t.size,a=this.getTransferPipeline(s),o=this.getFlipYPipeline(s),u=this.device.createTexture({size:{width:i,height:n,depthOrArrayLayers:1},format:s,usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING}),l=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:_w,baseArrayLayer:r}),d=u.createView({baseMipLevel:0,mipLevelCount:1,dimension:_w,baseArrayLayer:0}),c=this.device.createCommandEncoder({}),h=(e,t,r)=>{const s=e.getBindGroupLayout(0),i=this.device.createBindGroup({layout:s,entries:[{binding:0,resource:this.flipYSampler},{binding:1,resource:t}]}),n=c.beginRenderPass({colorAttachments:[{view:r,loadOp:DN,storeOp:BN,clearValue:[0,0,0,0]}]});n.setPipeline(e),n.setBindGroup(0,i),n.draw(4,1,0,0),n.end()};h(a,l,d),h(o,d,l),this.device.queue.submit([c.finish()]),u.destroy()}generateMipmaps(e,t,r=0){const s=this.get(e);void 0===s.useCount&&(s.useCount=0,s.layers=[]);const i=s.layers[r]||this._mipmapCreateBundles(e,t,r),n=this.device.createCommandEncoder({});this._mipmapRunBundles(n,i),this.device.queue.submit([n.finish()]),0!==s.useCount&&(s.layers[r]=i),s.useCount++}_mipmapCreateBundles(e,t,r){const s=this.getTransferPipeline(t.format),i=s.getBindGroupLayout(0);let n=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:_w,baseArrayLayer:r});const a=[];for(let o=1;o1;for(let a=0;a]*\s*([a-z_0-9]+(?:<[\s\S]+?>)?)/i,kw=/([a-z_0-9]+)\s*:\s*([a-z_0-9]+(?:<[\s\S]+?>)?)/gi,Gw={f32:"float",i32:"int",u32:"uint",bool:"bool","vec2":"vec2","vec2":"ivec2","vec2":"uvec2","vec2":"bvec2",vec2f:"vec2",vec2i:"ivec2",vec2u:"uvec2",vec2b:"bvec2","vec3":"vec3","vec3":"ivec3","vec3":"uvec3","vec3":"bvec3",vec3f:"vec3",vec3i:"ivec3",vec3u:"uvec3",vec3b:"bvec3","vec4":"vec4","vec4":"ivec4","vec4":"uvec4","vec4":"bvec4",vec4f:"vec4",vec4i:"ivec4",vec4u:"uvec4",vec4b:"bvec4","mat2x2":"mat2",mat2x2f:"mat2","mat3x3":"mat3",mat3x3f:"mat3","mat4x4":"mat4",mat4x4f:"mat4",sampler:"sampler",texture_1d:"texture",texture_2d:"texture",texture_2d_array:"texture",texture_multisampled_2d:"cubeTexture",texture_depth_2d:"depthTexture",texture_depth_2d_array:"depthTexture",texture_depth_multisampled_2d:"depthTexture",texture_depth_cube:"depthTexture",texture_depth_cube_array:"depthTexture",texture_3d:"texture3D",texture_cube:"cubeTexture",texture_cube_array:"cubeTexture",texture_storage_1d:"storageTexture",texture_storage_2d:"storageTexture",texture_storage_2d_array:"storageTexture",texture_storage_3d:"storageTexture"};class zw extends X_{constructor(e){const{type:t,inputs:r,name:s,inputsCode:i,blockCode:n,outputType:a}=(e=>{const t=(e=e.trim()).match(Ow);if(null!==t&&4===t.length){const r=t[2],s=[];let i=null;for(;null!==(i=kw.exec(r));)s.push({name:i[1],type:i[2]});const n=[];for(let e=0;e "+this.outputType:"";return`fn ${e} ( ${this.inputsCode.trim()} ) ${t}`+this.blockCode}}class Hw extends q_{parseFunction(e){return new zw(e)}}const $w="undefined"!=typeof self?self.GPUShaderStage:{VERTEX:1,FRAGMENT:2,COMPUTE:4},Ww={[Os.READ_ONLY]:"read",[Os.WRITE_ONLY]:"write",[Os.READ_WRITE]:"read_write"},jw={[Nr]:"repeat",[vr]:"clamp",[_r]:"mirror"},qw={vertex:$w?$w.VERTEX:1,fragment:$w?$w.FRAGMENT:2,compute:$w?$w.COMPUTE:4},Xw={instance:!0,swizzleAssign:!1,storageBuffer:!0},Kw={"^^":"tsl_xor"},Yw={float:"f32",int:"i32",uint:"u32",bool:"bool",color:"vec3",vec2:"vec2",ivec2:"vec2",uvec2:"vec2",bvec2:"vec2",vec3:"vec3",ivec3:"vec3",uvec3:"vec3",bvec3:"vec3",vec4:"vec4",ivec4:"vec4",uvec4:"vec4",bvec4:"vec4",mat2:"mat2x2",mat3:"mat3x3",mat4:"mat4x4"},Qw={},Zw={tsl_xor:new wb("fn tsl_xor( a : bool, b : bool ) -> bool { return ( a || b ) && !( a && b ); }"),mod_float:new wb("fn tsl_mod_float( x : f32, y : f32 ) -> f32 { return x - y * floor( x / y ); }"),mod_vec2:new wb("fn tsl_mod_vec2( x : vec2f, y : vec2f ) -> vec2f { return x - y * floor( x / y ); }"),mod_vec3:new wb("fn tsl_mod_vec3( x : vec3f, y : vec3f ) -> vec3f { return x - y * floor( x / y ); }"),mod_vec4:new wb("fn tsl_mod_vec4( x : vec4f, y : vec4f ) -> vec4f { return x - y * floor( x / y ); }"),equals_bool:new wb("fn tsl_equals_bool( a : bool, b : bool ) -> bool { return a == b; }"),equals_bvec2:new wb("fn tsl_equals_bvec2( a : vec2f, b : vec2f ) -> vec2 { return vec2( a.x == b.x, a.y == b.y ); }"),equals_bvec3:new wb("fn tsl_equals_bvec3( a : vec3f, b : vec3f ) -> vec3 { return vec3( a.x == b.x, a.y == b.y, a.z == b.z ); }"),equals_bvec4:new wb("fn tsl_equals_bvec4( a : vec4f, b : vec4f ) -> vec4 { return vec4( a.x == b.x, a.y == b.y, a.z == b.z, a.w == b.w ); }"),repeatWrapping_float:new wb("fn tsl_repeatWrapping_float( coord: f32 ) -> f32 { return fract( coord ); }"),mirrorWrapping_float:new wb("fn tsl_mirrorWrapping_float( coord: f32 ) -> f32 { let mirrored = fract( coord * 0.5 ) * 2.0; return 1.0 - abs( 1.0 - mirrored ); }"),clampWrapping_float:new wb("fn tsl_clampWrapping_float( coord: f32 ) -> f32 { return clamp( coord, 0.0, 1.0 ); }"),biquadraticTexture:new wb("\nfn tsl_biquadraticTexture( map : texture_2d, coord : vec2f, iRes : vec2u, level : u32 ) -> vec4f {\n\n\tlet res = vec2f( iRes );\n\n\tlet uvScaled = coord * res;\n\tlet uvWrapping = ( ( uvScaled % res ) + res ) % res;\n\n\t// https://www.shadertoy.com/view/WtyXRy\n\n\tlet uv = uvWrapping - 0.5;\n\tlet iuv = floor( uv );\n\tlet f = fract( uv );\n\n\tlet rg1 = textureLoad( map, vec2u( iuv + vec2( 0.5, 0.5 ) ) % iRes, level );\n\tlet rg2 = textureLoad( map, vec2u( iuv + vec2( 1.5, 0.5 ) ) % iRes, level );\n\tlet rg3 = textureLoad( map, vec2u( iuv + vec2( 0.5, 1.5 ) ) % iRes, level );\n\tlet rg4 = textureLoad( map, vec2u( iuv + vec2( 1.5, 1.5 ) ) % iRes, level );\n\n\treturn mix( mix( rg1, rg2, f.x ), mix( rg3, rg4, f.x ), f.y );\n\n}\n")},Jw={dFdx:"dpdx",dFdy:"- dpdy",mod_float:"tsl_mod_float",mod_vec2:"tsl_mod_vec2",mod_vec3:"tsl_mod_vec3",mod_vec4:"tsl_mod_vec4",equals_bool:"tsl_equals_bool",equals_bvec2:"tsl_equals_bvec2",equals_bvec3:"tsl_equals_bvec3",equals_bvec4:"tsl_equals_bvec4",inversesqrt:"inverseSqrt",bitcast:"bitcast"};"undefined"!=typeof navigator&&/Windows/g.test(navigator.userAgent)&&(Zw.pow_float=new wb("fn tsl_pow_float( a : f32, b : f32 ) -> f32 { return select( -pow( -a, b ), pow( a, b ), a > 0.0 ); }"),Zw.pow_vec2=new wb("fn tsl_pow_vec2( a : vec2f, b : vec2f ) -> vec2f { return vec2f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ) ); }",[Zw.pow_float]),Zw.pow_vec3=new wb("fn tsl_pow_vec3( a : vec3f, b : vec3f ) -> vec3f { return vec3f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ) ); }",[Zw.pow_float]),Zw.pow_vec4=new wb("fn tsl_pow_vec4( a : vec4f, b : vec4f ) -> vec4f { return vec4f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ), tsl_pow_float( a.w, b.w ) ); }",[Zw.pow_float]),Jw.pow_float="tsl_pow_float",Jw.pow_vec2="tsl_pow_vec2",Jw.pow_vec3="tsl_pow_vec3",Jw.pow_vec4="tsl_pow_vec4");let eA="";!0!==("undefined"!=typeof navigator&&/Firefox|Deno/g.test(navigator.userAgent))&&(eA+="diagnostic( off, derivative_uniformity );\n");class tA extends F_{constructor(e,t){super(e,t,new Hw),this.uniformGroups={},this.builtins={},this.directives={},this.scopedArrays=new Map}needsToWorkingColorSpace(e){return!0===e.isVideoTexture&&e.colorSpace!==b}_generateTextureSample(e,t,r,s,i=this.shaderStage){return"fragment"===i?s?`textureSample( ${t}, ${t}_sampler, ${r}, ${s} )`:`textureSample( ${t}, ${t}_sampler, ${r} )`:this._generateTextureSampleLevel(e,t,r,"0",s)}_generateVideoSample(e,t,r=this.shaderStage){if("fragment"===r)return`textureSampleBaseClampToEdge( ${e}, ${e}_sampler, vec2( ${t}.x, 1.0 - ${t}.y ) )`;console.error(`WebGPURenderer: THREE.VideoTexture does not support ${r} shader.`)}_generateTextureSampleLevel(e,t,r,s,i){return!1===this.isUnfilterable(e)?`textureSampleLevel( ${t}, ${t}_sampler, ${r}, ${s} )`:this.isFilteredTexture(e)?this.generateFilteredTexture(e,t,r,s):this.generateTextureLod(e,t,r,i,s)}generateWrapFunction(e){const t=`tsl_coord_${jw[e.wrapS]}S_${jw[e.wrapT]}_${e.isData3DTexture?"3d":"2d"}T`;let r=Qw[t];if(void 0===r){const s=[],i=e.isData3DTexture?"vec3f":"vec2f";let n=`fn ${t}( coord : ${i} ) -> ${i} {\n\n\treturn ${i}(\n`;const a=(e,t)=>{e===Nr?(s.push(Zw.repeatWrapping_float),n+=`\t\ttsl_repeatWrapping_float( coord.${t} )`):e===vr?(s.push(Zw.clampWrapping_float),n+=`\t\ttsl_clampWrapping_float( coord.${t} )`):e===_r?(s.push(Zw.mirrorWrapping_float),n+=`\t\ttsl_mirrorWrapping_float( coord.${t} )`):(n+=`\t\tcoord.${t}`,console.warn(`WebGPURenderer: Unsupported texture wrap type "${e}" for vertex shader.`))};a(e.wrapS,"x"),n+=",\n",a(e.wrapT,"y"),e.isData3DTexture&&(n+=",\n",a(e.wrapR,"z")),n+="\n\t);\n\n}\n",Qw[t]=r=new wb(n,s)}return r.build(this),t}generateArrayDeclaration(e,t){return`array< ${this.getType(e)}, ${t} >`}generateTextureDimension(e,t,r){const s=this.getDataFromNode(e,this.shaderStage,this.globalCache);void 0===s.dimensionsSnippet&&(s.dimensionsSnippet={});let i=s.dimensionsSnippet[r];if(void 0===s.dimensionsSnippet[r]){let n,a;const{primarySamples:o}=this.renderer.backend.utils.getTextureSampleData(e),u=o>1;a=e.isData3DTexture?"vec3":"vec2",n=u||e.isVideoTexture||e.isStorageTexture?t:`${t}${r?`, u32( ${r} )`:""}`,i=new Jo(new Iu(`textureDimensions( ${n} )`,a)),s.dimensionsSnippet[r]=i,(e.isArrayTexture||e.isDataArrayTexture||e.isData3DTexture)&&(s.arrayLayerCount=new Jo(new Iu(`textureNumLayers(${t})`,"u32"))),e.isTextureCube&&(s.cubeFaceCount=new Jo(new Iu("6u","u32")))}return i.build(this)}generateFilteredTexture(e,t,r,s="0u"){this._include("biquadraticTexture");return`tsl_biquadraticTexture( ${t}, ${this.generateWrapFunction(e)}( ${r} ), ${this.generateTextureDimension(e,t,s)}, u32( ${s} ) )`}generateTextureLod(e,t,r,s,i="0u"){const n=this.generateWrapFunction(e),a=this.generateTextureDimension(e,t,i),o=e.isData3DTexture?"vec3":"vec2",u=`${o}( ${n}( ${r} ) * ${o}( ${a} ) )`;return this.generateTextureLoad(e,t,u,s,i)}generateTextureLoad(e,t,r,s,i="0u"){let n;return!0===e.isVideoTexture?n=`textureLoad( ${t}, ${r} )`:s?n=`textureLoad( ${t}, ${r}, ${s}, u32( ${i} ) )`:(n=`textureLoad( ${t}, ${r}, u32( ${i} ) )`,this.renderer.backend.compatibilityMode&&e.isDepthTexture&&(n+=".x")),n}generateTextureStore(e,t,r,s,i){let n;return n=s?`textureStore( ${t}, ${r}, ${s}, ${i} )`:`textureStore( ${t}, ${r}, ${i} )`,n}isSampleCompare(e){return!0===e.isDepthTexture&&null!==e.compareFunction}isUnfilterable(e){return"float"!==this.getComponentTypeFromTexture(e)||!this.isAvailable("float32Filterable")&&!0===e.isDataTexture&&e.type===B||!1===this.isSampleCompare(e)&&e.minFilter===v&&e.magFilter===v||this.renderer.backend.utils.getTextureSampleData(e).primarySamples>1}generateTexture(e,t,r,s,i=this.shaderStage){let n=null;return n=!0===e.isVideoTexture?this._generateVideoSample(t,r,i):this.isUnfilterable(e)?this.generateTextureLod(e,t,r,s,"0",i):this._generateTextureSample(e,t,r,s,i),n}generateTextureGrad(e,t,r,s,i,n=this.shaderStage){if("fragment"===n)return`textureSampleGrad( ${t}, ${t}_sampler, ${r}, ${s[0]}, ${s[1]} )`;console.error(`WebGPURenderer: THREE.TextureNode.gradient() does not support ${n} shader.`)}generateTextureCompare(e,t,r,s,i,n=this.shaderStage){if("fragment"===n)return!0===e.isDepthTexture&&!0===e.isArrayTexture?`textureSampleCompare( ${t}, ${t}_sampler, ${r}, ${i}, ${s} )`:`textureSampleCompare( ${t}, ${t}_sampler, ${r}, ${s} )`;console.error(`WebGPURenderer: THREE.DepthTexture.compareFunction() does not support ${n} shader.`)}generateTextureLevel(e,t,r,s,i,n=this.shaderStage){let a=null;return a=!0===e.isVideoTexture?this._generateVideoSample(t,r,n):this._generateTextureSampleLevel(e,t,r,s,i),a}generateTextureBias(e,t,r,s,i,n=this.shaderStage){if("fragment"===n)return`textureSampleBias( ${t}, ${t}_sampler, ${r}, ${s} )`;console.error(`WebGPURenderer: THREE.TextureNode.biasNode does not support ${n} shader.`)}getPropertyName(e,t=this.shaderStage){if(!0===e.isNodeVarying&&!0===e.needsInterpolation){if("vertex"===t)return`varyings.${e.name}`}else if(!0===e.isNodeUniform){const t=e.name,r=e.type;return"texture"===r||"cubeTexture"===r||"storageTexture"===r||"texture3D"===r?t:"buffer"===r||"storageBuffer"===r||"indirectStorageBuffer"===r?this.isCustomStruct(e)?t:t+".value":e.groupNode.name+"."+t}return super.getPropertyName(e)}getOutputStructName(){return"output"}getFunctionOperator(e){const t=Kw[e];return void 0!==t?(this._include(t),t):null}getNodeAccess(e,t){return"compute"!==t?Os.READ_ONLY:e.access}getStorageAccess(e,t){return Ww[this.getNodeAccess(e,t)]}getUniformFromNode(e,t,r,s=null){const i=super.getUniformFromNode(e,t,r,s),n=this.getDataFromNode(e,r,this.globalCache);if(void 0===n.uniformGPU){let a;const o=e.groupNode,u=o.name,l=this.getBindGroupArray(u,r);if("texture"===t||"cubeTexture"===t||"storageTexture"===t||"texture3D"===t){let s=null;const n=this.getNodeAccess(e,r);if("texture"===t||"storageTexture"===t?s=new Gv(i.name,i.node,o,n):"cubeTexture"===t?s=new zv(i.name,i.node,o,n):"texture3D"===t&&(s=new Hv(i.name,i.node,o,n)),s.store=!0===e.isStorageTextureNode,s.setVisibility(qw[r]),!1===this.isUnfilterable(e.value)&&!1===s.store){const e=new Mw(`${i.name}_sampler`,i.node,o);e.setVisibility(qw[r]),l.push(e,s),a=[e,s]}else l.push(s),a=[s]}else if("buffer"===t||"storageBuffer"===t||"indirectStorageBuffer"===t){const n=new("buffer"===t?Iv:Lw)(e,o);n.setVisibility(qw[r]),l.push(n),a=n,i.name=s||"NodeBuffer_"+i.id}else{const e=this.uniformGroups[r]||(this.uniformGroups[r]={});let s=e[u];void 0===s&&(s=new Uv(u,o),s.setVisibility(qw[r]),e[u]=s,l.push(s)),a=this.getNodeUniform(i,t),s.addUniform(a)}n.uniformGPU=a}return i}getBuiltin(e,t,r,s=this.shaderStage){const i=this.builtins[s]||(this.builtins[s]=new Map);return!1===i.has(e)&&i.set(e,{name:e,property:t,type:r}),t}hasBuiltin(e,t=this.shaderStage){return void 0!==this.builtins[t]&&this.builtins[t].has(e)}getVertexIndex(){return"vertex"===this.shaderStage?this.getBuiltin("vertex_index","vertexIndex","u32","attribute"):"vertexIndex"}buildFunctionCode(e){const t=e.layout,r=this.flowShaderNode(e),s=[];for(const e of t.inputs)s.push(e.name+" : "+this.getType(e.type));let i=`fn ${t.name}( ${s.join(", ")} ) -> ${this.getType(t.type)} {\n${r.vars}\n${r.code}\n`;return r.result&&(i+=`\treturn ${r.result};\n`),i+="\n}\n",i}getInstanceIndex(){return"vertex"===this.shaderStage?this.getBuiltin("instance_index","instanceIndex","u32","attribute"):"instanceIndex"}getInvocationLocalIndex(){return this.getBuiltin("local_invocation_index","invocationLocalIndex","u32","attribute")}getSubgroupSize(){return this.enableSubGroups(),this.getBuiltin("subgroup_size","subgroupSize","u32","attribute")}getInvocationSubgroupIndex(){return this.enableSubGroups(),this.getBuiltin("subgroup_invocation_id","invocationSubgroupIndex","u32","attribute")}getSubgroupIndex(){return this.enableSubGroups(),this.getBuiltin("subgroup_id","subgroupIndex","u32","attribute")}getDrawIndex(){return null}getFrontFacing(){return this.getBuiltin("front_facing","isFront","bool")}getFragCoord(){return this.getBuiltin("position","fragCoord","vec4")+".xy"}getFragDepth(){return"output."+this.getBuiltin("frag_depth","depth","f32","output")}getClipDistance(){return"varyings.hw_clip_distances"}isFlipY(){return!1}enableDirective(e,t=this.shaderStage){(this.directives[t]||(this.directives[t]=new Set)).add(e)}getDirectives(e){const t=[],r=this.directives[e];if(void 0!==r)for(const e of r)t.push(`enable ${e};`);return t.join("\n")}enableSubGroups(){this.enableDirective("subgroups")}enableSubgroupsF16(){this.enableDirective("subgroups-f16")}enableClipDistances(){this.enableDirective("clip_distances")}enableShaderF16(){this.enableDirective("f16")}enableDualSourceBlending(){this.enableDirective("dual_source_blending")}enableHardwareClipping(e){this.enableClipDistances(),this.getBuiltin("clip_distances","hw_clip_distances",`array`,"vertex")}getBuiltins(e){const t=[],r=this.builtins[e];if(void 0!==r)for(const{name:e,property:s,type:i}of r.values())t.push(`@builtin( ${e} ) ${s} : ${i}`);return t.join(",\n\t")}getScopedArray(e,t,r,s){return!1===this.scopedArrays.has(e)&&this.scopedArrays.set(e,{name:e,scope:t,bufferType:r,bufferCount:s}),e}getScopedArrays(e){if("compute"!==e)return;const t=[];for(const{name:e,scope:r,bufferType:s,bufferCount:i}of this.scopedArrays.values()){const n=this.getType(s);t.push(`var<${r}> ${e}: array< ${n}, ${i} >;`)}return t.join("\n")}getAttributes(e){const t=[];if("compute"===e&&(this.getBuiltin("global_invocation_id","globalId","vec3","attribute"),this.getBuiltin("workgroup_id","workgroupId","vec3","attribute"),this.getBuiltin("local_invocation_id","localId","vec3","attribute"),this.getBuiltin("num_workgroups","numWorkgroups","vec3","attribute"),this.renderer.hasFeature("subgroups")&&(this.enableDirective("subgroups",e),this.getBuiltin("subgroup_size","subgroupSize","u32","attribute"))),"vertex"===e||"compute"===e){const e=this.getBuiltins("attribute");e&&t.push(e);const r=this.getAttributesArray();for(let e=0,s=r.length;e"),t.push(`\t${s+r.name} : ${i}`)}return e.output&&t.push(`\t${this.getBuiltins("output")}`),t.join(",\n")}getStructs(e){let t="";const r=this.structs[e];if(r.length>0){const e=[];for(const t of r){let r=`struct ${t.name} {\n`;r+=this.getStructMembers(t),r+="\n};",e.push(r)}t="\n"+e.join("\n\n")+"\n"}return t}getVar(e,t,r=null){let s=`var ${t} : `;return s+=null!==r?this.generateArrayDeclaration(e,r):this.getType(e),s}getVars(e){const t=[],r=this.vars[e];if(void 0!==r)for(const e of r)t.push(`\t${this.getVar(e.type,e.name,e.count)};`);return`\n${t.join("\n")}\n`}getVaryings(e){const t=[];if("vertex"===e&&this.getBuiltin("position","Vertex","vec4","vertex"),"vertex"===e||"fragment"===e){const r=this.varyings,s=this.vars[e];for(let i=0;ir.value.itemSize;return s&&!i}getUniforms(e){const t=this.uniforms[e],r=[],s=[],i=[],n={};for(const i of t){const t=i.groupNode.name,a=this.bindingsIndexes[t];if("texture"===i.type||"cubeTexture"===i.type||"storageTexture"===i.type||"texture3D"===i.type){const t=i.node.value;let s;!1===this.isUnfilterable(t)&&!0!==i.node.isStorageTextureNode&&(this.isSampleCompare(t)?r.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${i.name}_sampler : sampler_comparison;`):r.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${i.name}_sampler : sampler;`));let n="";const{primarySamples:o}=this.renderer.backend.utils.getTextureSampleData(t);if(o>1&&(n="_multisampled"),!0===t.isCubeTexture)s="texture_cube";else if(!0===t.isDepthTexture)s=this.renderer.backend.compatibilityMode&&null===t.compareFunction?`texture${n}_2d`:`texture_depth${n}_2d${!0===t.isArrayTexture?"_array":""}`;else if(!0===t.isArrayTexture||!0===t.isDataArrayTexture||!0===t.isCompressedArrayTexture)s="texture_2d_array";else if(!0===t.isVideoTexture)s="texture_external";else if(!0===t.isData3DTexture)s="texture_3d";else if(!0===i.node.isStorageTextureNode){s=`texture_storage_2d<${Uw(t)}, ${this.getStorageAccess(i.node,e)}>`}else{s=`texture${n}_2d<${this.getComponentTypeFromTexture(t).charAt(0)}32>`}r.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${i.name} : ${s};`)}else if("buffer"===i.type||"storageBuffer"===i.type||"indirectStorageBuffer"===i.type){const t=i.node,r=this.getType(t.getNodeType(this)),n=t.bufferCount,o=n>0&&"buffer"===i.type?", "+n:"",u=t.isStorageBufferNode?`storage, ${this.getStorageAccess(t,e)}`:"uniform";if(this.isCustomStruct(i))s.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var<${u}> ${i.name} : ${r};`);else{const e=`\tvalue : array< ${t.isAtomic?`atomic<${r}>`:`${r}`}${o} >`;s.push(this._getWGSLStructBinding(i.name,e,u,a.binding++,a.group))}}else{const e=this.getType(this.getVectorType(i.type)),t=i.groupNode.name;(n[t]||(n[t]={index:a.binding++,id:a.group,snippets:[]})).snippets.push(`\t${i.name} : ${e}`)}}for(const e in n){const t=n[e];i.push(this._getWGSLStructBinding(e,t.snippets.join(",\n"),"uniform",t.index,t.id))}let a=r.join("\n");return a+=s.join("\n"),a+=i.join("\n"),a}buildCode(){const e=null!==this.material?{fragment:{},vertex:{}}:{compute:{}};this.sortBindingGroups();for(const t in e){this.shaderStage=t;const r=e[t];r.uniforms=this.getUniforms(t),r.attributes=this.getAttributes(t),r.varyings=this.getVaryings(t),r.structs=this.getStructs(t),r.vars=this.getVars(t),r.codes=this.getCodes(t),r.directives=this.getDirectives(t),r.scopedArrays=this.getScopedArrays(t);let s="// code\n\n";s+=this.flowCode[t];const i=this.flowNodes[t],n=i[i.length-1],a=n.outputNode,o=void 0!==a&&!0===a.isOutputStructNode;for(const e of i){const i=this.getFlowData(e),u=e.name;if(u&&(s.length>0&&(s+="\n"),s+=`\t// flow -> ${u}\n`),s+=`${i.code}\n\t`,e===n&&"compute"!==t)if(s+="// result\n\n\t","vertex"===t)s+=`varyings.Vertex = ${i.result};`;else if("fragment"===t)if(o)r.returnType=a.getNodeType(this),r.structs+="var output : "+r.returnType+";",s+=`return ${i.result};`;else{let e="\t@location(0) color: vec4";const t=this.getBuiltins("output");t&&(e+=",\n\t"+t),r.returnType="OutputStruct",r.structs+=this._getWGSLStruct("OutputStruct",e),r.structs+="\nvar output : OutputStruct;",s+=`output.color = ${i.result};\n\n\treturn output;`}}r.flow=s}this.shaderStage=null,null!==this.material?(this.vertexShader=this._getWGSLVertexCode(e.vertex),this.fragmentShader=this._getWGSLFragmentCode(e.fragment)):this.computeShader=this._getWGSLComputeCode(e.compute,(this.object.workgroupSize||[64]).join(", "))}getMethod(e,t=null){let r;return null!==t&&(r=this._getWGSLMethod(e+"_"+t)),void 0===r&&(r=this._getWGSLMethod(e)),r||e}getType(e){return Yw[e]||e}isAvailable(e){let t=Xw[e];return void 0===t&&("float32Filterable"===e?t=this.renderer.hasFeature("float32-filterable"):"clipDistance"===e&&(t=this.renderer.hasFeature("clip-distances")),Xw[e]=t),t}_getWGSLMethod(e){return void 0!==Zw[e]&&this._include(e),Jw[e]}_include(e){const t=Zw[e];return t.build(this),null!==this.currentFunctionNode&&this.currentFunctionNode.includes.push(t),t}_getWGSLVertexCode(e){return`${this.getSignature()}\n// directives\n${e.directives}\n\n// structs\n${e.structs}\n\n// uniforms\n${e.uniforms}\n\n// varyings\n${e.varyings}\nvar varyings : VaryingsStruct;\n\n// codes\n${e.codes}\n\n@vertex\nfn main( ${e.attributes} ) -> VaryingsStruct {\n\n\t// vars\n\t${e.vars}\n\n\t// flow\n\t${e.flow}\n\n\treturn varyings;\n\n}\n`}_getWGSLFragmentCode(e){return`${this.getSignature()}\n// global\n${eA}\n\n// structs\n${e.structs}\n\n// uniforms\n${e.uniforms}\n\n// codes\n${e.codes}\n\n@fragment\nfn main( ${e.varyings} ) -> ${e.returnType} {\n\n\t// vars\n\t${e.vars}\n\n\t// flow\n\t${e.flow}\n\n}\n`}_getWGSLComputeCode(e,t){return`${this.getSignature()}\n// directives\n${e.directives}\n\n// system\nvar instanceIndex : u32;\n\n// locals\n${e.scopedArrays}\n\n// structs\n${e.structs}\n\n// uniforms\n${e.uniforms}\n\n// codes\n${e.codes}\n\n@compute @workgroup_size( ${t} )\nfn main( ${e.attributes} ) {\n\n\t// system\n\tinstanceIndex = globalId.x + globalId.y * numWorkgroups.x * u32(${t}) + globalId.z * numWorkgroups.x * numWorkgroups.y * u32(${t});\n\n\t// vars\n\t${e.vars}\n\n\t// flow\n\t${e.flow}\n\n}\n`}_getWGSLStruct(e,t){return`\nstruct ${e} {\n${t}\n};`}_getWGSLStructBinding(e,t,r,s=0,i=0){const n=e+"Struct";return`${this._getWGSLStruct(n,t)}\n@binding( ${s} ) @group( ${i} )\nvar<${r}> ${e} : ${n};`}}class rA{constructor(e){this.backend=e}getCurrentDepthStencilFormat(e){let t;return null!==e.depthTexture?t=this.getTextureFormatGPU(e.depthTexture):e.depth&&e.stencil?t=AS:e.depth&&(t=wS),t}getTextureFormatGPU(e){return this.backend.get(e).format}getTextureSampleData(e){let t;if(e.isFramebufferTexture)t=1;else if(e.isDepthTexture&&!e.renderTarget){const e=this.backend.renderer,r=e.getRenderTarget();t=r?r.samples:e.samples}else e.renderTarget&&(t=e.renderTarget.samples);t=t||1;const r=t>1&&null!==e.renderTarget&&!0!==e.isDepthTexture&&!0!==e.isFramebufferTexture;return{samples:t,primarySamples:r?1:t,isMSAA:r}}getCurrentColorFormat(e){let t;return t=null!==e.textures?this.getTextureFormatGPU(e.textures[0]):this.getPreferredCanvasFormat(),t}getCurrentColorSpace(e){return null!==e.textures?e.textures[0].colorSpace:this.backend.renderer.outputColorSpace}getPrimitiveTopology(e,t){return e.isPoints?_N:e.isLineSegments||e.isMesh&&!0===t.wireframe?vN:e.isLine?NN:e.isMesh?SN:void 0}getSampleCount(e){let t=1;return e>1&&(t=Math.pow(2,Math.floor(Math.log2(e))),2===t&&(t=4)),t}getSampleCountRenderContext(e){return null!==e.textures?this.getSampleCount(e.sampleCount):this.getSampleCount(this.backend.renderer.samples)}getPreferredCanvasFormat(){const e=this.backend.parameters.outputType;if(void 0===e)return navigator.gpu.getPreferredCanvasFormat();if(e===Ce)return cS;if(e===de)return _S;throw new Error("Unsupported outputType")}}const sA=new Map([[Int8Array,["sint8","snorm8"]],[Uint8Array,["uint8","unorm8"]],[Int16Array,["sint16","snorm16"]],[Uint16Array,["uint16","unorm16"]],[Int32Array,["sint32","snorm32"]],[Uint32Array,["uint32","unorm32"]],[Float32Array,["float32"]]]),iA=new Map([[ze,["float16"]]]),nA=new Map([[Int32Array,"sint32"],[Int16Array,"sint32"],[Uint32Array,"uint32"],[Uint16Array,"uint32"],[Float32Array,"float32"]]);class aA{constructor(e){this.backend=e}createAttribute(e,t){const r=this._getBufferAttribute(e),s=this.backend,i=s.get(r);let n=i.buffer;if(void 0===n){const a=s.device;let o=r.array;if(!1===e.normalized)if(o.constructor===Int16Array||o.constructor===Int8Array)o=new Int32Array(o);else if((o.constructor===Uint16Array||o.constructor===Uint8Array)&&(o=new Uint32Array(o),t&GPUBufferUsage.INDEX))for(let e=0;e1&&(s.multisampled=!0,r.texture.isDepthTexture||(s.sampleType=mw)),r.texture.isDepthTexture)t.compatibilityMode&&null===r.texture.compareFunction?s.sampleType=mw:s.sampleType=fw;else if(r.texture.isDataTexture||r.texture.isDataArrayTexture||r.texture.isData3DTexture){const e=r.texture.type;e===_?s.sampleType=yw:e===T?s.sampleType=bw:e===B&&(this.backend.hasFeature("float32-filterable")?s.sampleType=gw:s.sampleType=mw)}r.isSampledCubeTexture?s.viewDimension=Nw:r.texture.isArrayTexture||r.texture.isDataArrayTexture||r.texture.isCompressedArrayTexture?s.viewDimension=vw:r.isSampledTexture3D&&(s.viewDimension=Sw),e.texture=s}else console.error(`WebGPUBindingUtils: Unsupported binding "${r}".`);s.push(e)}return r.createBindGroupLayout({entries:s})}createBindings(e,t,r,s=0){const{backend:i,bindGroupLayoutCache:n}=this,a=i.get(e);let o,u=n.get(e.bindingsReference);void 0===u&&(u=this.createBindingsLayout(e),n.set(e.bindingsReference,u)),r>0&&(void 0===a.groups&&(a.groups=[],a.versions=[]),a.versions[r]===s&&(o=a.groups[r])),void 0===o&&(o=this.createBindGroup(e,u),r>0&&(a.groups[r]=o,a.versions[r]=s)),a.group=o,a.layout=u}updateBinding(e){const t=this.backend,r=t.device,s=e.buffer,i=t.get(e).buffer;r.queue.writeBuffer(i,0,s,0)}createBindGroupIndex(e,t){const r=this.backend.device,s=GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,i=e[0],n=r.createBuffer({label:"bindingCameraIndex_"+i,size:16,usage:s});r.queue.writeBuffer(n,0,e,0);const a=[{binding:0,resource:{buffer:n}}];return r.createBindGroup({label:"bindGroupCameraIndex_"+i,layout:t,entries:a})}createBindGroup(e,t){const r=this.backend,s=r.device;let i=0;const n=[];for(const t of e.bindings){if(t.isUniformBuffer){const e=r.get(t);if(void 0===e.buffer){const r=t.byteLength,i=GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,n=s.createBuffer({label:"bindingBuffer_"+t.name,size:r,usage:i});e.buffer=n}n.push({binding:i,resource:{buffer:e.buffer}})}else if(t.isStorageBuffer){const e=r.get(t);if(void 0===e.buffer){const s=t.attribute;e.buffer=r.get(s).buffer}n.push({binding:i,resource:{buffer:e.buffer}})}else if(t.isSampler){const e=r.get(t.texture);n.push({binding:i,resource:e.sampler})}else if(t.isSampledTexture){const e=r.get(t.texture);let a;if(void 0!==e.externalTexture)a=s.importExternalTexture({source:e.externalTexture});else{const r=t.store?1:e.texture.mipLevelCount,s=`view-${e.texture.width}-${e.texture.height}-${r}`;if(a=e[s],void 0===a){const i=Ew;let n;n=t.isSampledCubeTexture?Nw:t.isSampledTexture3D?Sw:t.texture.isArrayTexture||t.texture.isDataArrayTexture||t.texture.isCompressedArrayTexture?vw:_w,a=e[s]=e.texture.createView({aspect:i,dimension:n,mipLevelCount:r})}}n.push({binding:i,resource:a})}i++}return s.createBindGroup({label:"bindGroup_"+e.name,layout:t,entries:n})}}class uA{constructor(e){this.backend=e,this._activePipelines=new WeakMap}setPipeline(e,t){this._activePipelines.get(e)!==t&&(e.setPipeline(t),this._activePipelines.set(e,t))}_getSampleCount(e){return this.backend.utils.getSampleCountRenderContext(e)}createRenderPipeline(e,t){const{object:r,material:s,geometry:i,pipeline:n}=e,{vertexProgram:a,fragmentProgram:o}=n,u=this.backend,l=u.device,d=u.utils,c=u.get(n),h=[];for(const t of e.getBindings()){const e=u.get(t);h.push(e.layout)}const p=u.attributeUtils.createShaderVertexBuffers(e);let g;s.blending===z||s.blending===O&&!1===s.transparent||(g=this._getBlending(s));let m={};!0===s.stencilWrite&&(m={compare:this._getStencilCompare(s),failOp:this._getStencilOperation(s.stencilFail),depthFailOp:this._getStencilOperation(s.stencilZFail),passOp:this._getStencilOperation(s.stencilZPass)});const f=this._getColorWriteMask(s),y=[];if(null!==e.context.textures){const t=e.context.textures;for(let e=0;e1},layout:l.createPipelineLayout({bindGroupLayouts:h})},E={},w=e.context.depth,A=e.context.stencil;if(!0!==w&&!0!==A||(!0===w&&(E.format=v,E.depthWriteEnabled=s.depthWrite,E.depthCompare=_),!0===A&&(E.stencilFront=m,E.stencilBack={},E.stencilReadMask=s.stencilFuncMask,E.stencilWriteMask=s.stencilWriteMask),!0===s.polygonOffset&&(E.depthBias=s.polygonOffsetUnits,E.depthBiasSlopeScale=s.polygonOffsetFactor,E.depthBiasClamp=0),S.depthStencil=E),null===t)c.pipeline=l.createRenderPipeline(S);else{const e=new Promise((e=>{l.createRenderPipelineAsync(S).then((t=>{c.pipeline=t,e()}))}));t.push(e)}}createBundleEncoder(e,t="renderBundleEncoder"){const r=this.backend,{utils:s,device:i}=r,n=s.getCurrentDepthStencilFormat(e),a={label:t,colorFormats:[s.getCurrentColorFormat(e)],depthStencilFormat:n,sampleCount:this._getSampleCount(e)};return i.createRenderBundleEncoder(a)}createComputePipeline(e,t){const r=this.backend,s=r.device,i=r.get(e.computeProgram).module,n=r.get(e),a=[];for(const e of t){const t=r.get(e);a.push(t.layout)}n.pipeline=s.createComputePipeline({compute:i,layout:s.createPipelineLayout({bindGroupLayouts:a})})}_getBlending(e){let t,r;const s=e.blending,i=e.blendSrc,n=e.blendDst,a=e.blendEquation;if(s===qe){const s=null!==e.blendSrcAlpha?e.blendSrcAlpha:i,o=null!==e.blendDstAlpha?e.blendDstAlpha:n,u=null!==e.blendEquationAlpha?e.blendEquationAlpha:a;t={srcFactor:this._getBlendFactor(i),dstFactor:this._getBlendFactor(n),operation:this._getBlendOperation(a)},r={srcFactor:this._getBlendFactor(s),dstFactor:this._getBlendFactor(o),operation:this._getBlendOperation(u)}}else{const i=(e,s,i,n)=>{t={srcFactor:e,dstFactor:s,operation:jE},r={srcFactor:i,dstFactor:n,operation:jE}};if(e.premultipliedAlpha)switch(s){case O:i(BE,UE,BE,UE);break;case Ft:i(BE,BE,BE,BE);break;case Pt:i(LE,DE,LE,BE);break;case Mt:i(LE,IE,LE,VE)}else switch(s){case O:i(VE,UE,BE,UE);break;case Ft:i(VE,BE,VE,BE);break;case Pt:i(LE,DE,LE,BE);break;case Mt:i(LE,IE,LE,IE)}}if(void 0!==t&&void 0!==r)return{color:t,alpha:r};console.error("THREE.WebGPURenderer: Invalid blending: ",s)}_getBlendFactor(e){let t;switch(e){case Ke:t=LE;break;case wt:t=BE;break;case Et:t=IE;break;case Tt:t=DE;break;case St:t=VE;break;case xt:t=UE;break;case vt:t=OE;break;case bt:t=kE;break;case _t:t=GE;break;case yt:t=zE;break;case Nt:t=HE;break;case 211:t=$E;break;case 212:t=WE;break;default:console.error("THREE.WebGPURenderer: Blend factor not supported.",e)}return t}_getStencilCompare(e){let t;const r=e.stencilFunc;switch(r){case kr:t=wN;break;case Or:t=LN;break;case Ur:t=AN;break;case Vr:t=CN;break;case Dr:t=RN;break;case Ir:t=FN;break;case Br:t=MN;break;case Lr:t=PN;break;default:console.error("THREE.WebGPURenderer: Invalid stencil function.",r)}return t}_getStencilOperation(e){let t;switch(e){case Xr:t=JE;break;case qr:t=ew;break;case jr:t=tw;break;case Wr:t=rw;break;case $r:t=sw;break;case Hr:t=iw;break;case zr:t=nw;break;case Gr:t=aw;break;default:console.error("THREE.WebGPURenderer: Invalid stencil operation.",t)}return t}_getBlendOperation(e){let t;switch(e){case Xe:t=jE;break;case ft:t=qE;break;case mt:t=XE;break;case Yr:t=KE;break;case Kr:t=YE;break;default:console.error("THREE.WebGPUPipelineUtils: Blend equation not supported.",e)}return t}_getPrimitiveState(e,t,r){const s={},i=this.backend.utils;switch(s.topology=i.getPrimitiveTopology(e,r),null!==t.index&&!0===e.isLine&&!0!==e.isLineSegments&&(s.stripIndexFormat=t.index.array instanceof Uint16Array?GN:zN),r.side){case je:s.frontFace=VN,s.cullMode=kN;break;case S:s.frontFace=VN,s.cullMode=ON;break;case Se:s.frontFace=VN,s.cullMode=UN;break;default:console.error("THREE.WebGPUPipelineUtils: Unknown material.side value.",r.side)}return s}_getColorWriteMask(e){return!0===e.colorWrite?ZE:QE}_getDepthCompare(e){let t;if(!1===e.depthTest)t=LN;else{const r=e.depthFunc;switch(r){case kt:t=wN;break;case Ot:t=LN;break;case Ut:t=AN;break;case Vt:t=CN;break;case Dt:t=RN;break;case It:t=FN;break;case Bt:t=MN;break;case Lt:t=PN;break;default:console.error("THREE.WebGPUPipelineUtils: Invalid depth function.",r)}}return t}}class lA extends yN{constructor(e,t,r=2048){super(r),this.device=e,this.type=t,this.querySet=this.device.createQuerySet({type:"timestamp",count:this.maxQueries,label:`queryset_global_timestamp_${t}`});const s=8*this.maxQueries;this.resolveBuffer=this.device.createBuffer({label:`buffer_timestamp_resolve_${t}`,size:s,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),this.resultBuffer=this.device.createBuffer({label:`buffer_timestamp_result_${t}`,size:s,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ})}allocateQueriesForContext(e){if(!this.trackTimestamp||this.isDisposed)return null;if(this.currentQueryIndex+2>this.maxQueries)return pt(`WebGPUTimestampQueryPool [${this.type}]: Maximum number of queries exceeded, when using trackTimestamp it is necessary to resolves the queries via renderer.resolveTimestampsAsync( THREE.TimestampQuery.${this.type.toUpperCase()} ).`),null;const t=this.currentQueryIndex;return this.currentQueryIndex+=2,this.queryOffsets.set(e.id,t),t}async resolveQueriesAsync(){if(!this.trackTimestamp||0===this.currentQueryIndex||this.isDisposed)return this.lastValue;if(this.pendingResolve)return this.pendingResolve;this.pendingResolve=this._resolveQueries();try{return await this.pendingResolve}finally{this.pendingResolve=null}}async _resolveQueries(){if(this.isDisposed)return this.lastValue;try{if("unmapped"!==this.resultBuffer.mapState)return this.lastValue;const e=new Map(this.queryOffsets),t=this.currentQueryIndex,r=8*t;this.currentQueryIndex=0,this.queryOffsets.clear();const s=this.device.createCommandEncoder();s.resolveQuerySet(this.querySet,0,t,this.resolveBuffer,0),s.copyBufferToBuffer(this.resolveBuffer,0,this.resultBuffer,0,r);const i=s.finish();if(this.device.queue.submit([i]),"unmapped"!==this.resultBuffer.mapState)return this.lastValue;if(await this.resultBuffer.mapAsync(GPUMapMode.READ,0,r),this.isDisposed)return"mapped"===this.resultBuffer.mapState&&this.resultBuffer.unmap(),this.lastValue;const n=new BigUint64Array(this.resultBuffer.getMappedRange(0,r));let a=0;for(const[,t]of e){const e=n[t],r=n[t+1];a+=Number(r-e)/1e6}return this.resultBuffer.unmap(),this.lastValue=a,a}catch(e){return console.error("Error resolving queries:",e),"mapped"===this.resultBuffer.mapState&&this.resultBuffer.unmap(),this.lastValue}}async dispose(){if(!this.isDisposed){if(this.isDisposed=!0,this.pendingResolve)try{await this.pendingResolve}catch(e){console.error("Error waiting for pending resolve:",e)}if(this.resultBuffer&&"mapped"===this.resultBuffer.mapState)try{this.resultBuffer.unmap()}catch(e){console.error("Error unmapping buffer:",e)}this.querySet&&(this.querySet.destroy(),this.querySet=null),this.resolveBuffer&&(this.resolveBuffer.destroy(),this.resolveBuffer=null),this.resultBuffer&&(this.resultBuffer.destroy(),this.resultBuffer=null),this.queryOffsets.clear(),this.pendingResolve=null}}}class dA extends Jv{constructor(e={}){super(e),this.isWebGPUBackend=!0,this.parameters.alpha=void 0===e.alpha||e.alpha,this.parameters.compatibilityMode=void 0!==e.compatibilityMode&&e.compatibilityMode,this.parameters.requiredLimits=void 0===e.requiredLimits?{}:e.requiredLimits,this.compatibilityMode=this.parameters.compatibilityMode,this.device=null,this.context=null,this.colorBuffer=null,this.defaultRenderPassdescriptor=null,this.utils=new rA(this),this.attributeUtils=new aA(this),this.bindingUtils=new oA(this),this.pipelineUtils=new uA(this),this.textureUtils=new Vw(this),this.occludedResolveCache=new Map}async init(e){await super.init(e);const t=this.parameters;let r;if(void 0===t.device){const e={powerPreference:t.powerPreference,featureLevel:t.compatibilityMode?"compatibility":void 0},s="undefined"!=typeof navigator?await navigator.gpu.requestAdapter(e):null;if(null===s)throw new Error("WebGPUBackend: Unable to create WebGPU adapter.");const i=Object.values(Rw),n=[];for(const e of i)s.features.has(e)&&n.push(e);const a={requiredFeatures:n,requiredLimits:t.requiredLimits};r=await s.requestDevice(a)}else r=t.device;r.lost.then((t=>{const r={api:"WebGPU",message:t.message||"Unknown reason",reason:t.reason||null,originalEvent:t};e.onDeviceLost(r)}));const s=void 0!==t.context?t.context:e.domElement.getContext("webgpu");this.device=r,this.context=s;const i=t.alpha?"premultiplied":"opaque";this.trackTimestamp=this.trackTimestamp&&this.hasFeature(Rw.TimestampQuery),this.context.configure({device:this.device,format:this.utils.getPreferredCanvasFormat(),usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,alphaMode:i}),this.updateSize()}get coordinateSystem(){return d}async getArrayBufferAsync(e){return await this.attributeUtils.getArrayBufferAsync(e)}getContext(){return this.context}_getDefaultRenderPassDescriptor(){let e=this.defaultRenderPassdescriptor;if(null===e){const t=this.renderer;e={colorAttachments:[{view:null}]},!0!==this.renderer.depth&&!0!==this.renderer.stencil||(e.depthStencilAttachment={view:this.textureUtils.getDepthBuffer(t.depth,t.stencil).createView()});const r=e.colorAttachments[0];this.renderer.samples>0?r.view=this.colorBuffer.createView():r.resolveTarget=void 0,this.defaultRenderPassdescriptor=e}const t=e.colorAttachments[0];return this.renderer.samples>0?t.resolveTarget=this.context.getCurrentTexture().createView():t.view=this.context.getCurrentTexture().createView(),e}_isRenderCameraDepthArray(e){return e.depthTexture&&e.depthTexture.image.depth>1&&e.camera.isArrayCamera}_getRenderPassDescriptor(e,t={}){const r=e.renderTarget,s=this.get(r);let i=s.descriptors;if(void 0===i||s.width!==r.width||s.height!==r.height||s.dimensions!==r.dimensions||s.activeMipmapLevel!==e.activeMipmapLevel||s.activeCubeFace!==e.activeCubeFace||s.samples!==r.samples){i={},s.descriptors=i;const e=()=>{r.removeEventListener("dispose",e),this.delete(r)};!1===r.hasEventListener("dispose",e)&&r.addEventListener("dispose",e)}const n=e.getCacheKey();let a=i[n];if(void 0===a){const t=e.textures,o=[];let u;const l=this._isRenderCameraDepthArray(e);for(let s=0;s1)if(!0===l){const t=e.camera.cameras;for(let e=0;e0&&(t.currentOcclusionQuerySet&&t.currentOcclusionQuerySet.destroy(),t.currentOcclusionQueryBuffer&&t.currentOcclusionQueryBuffer.destroy(),t.currentOcclusionQuerySet=t.occlusionQuerySet,t.currentOcclusionQueryBuffer=t.occlusionQueryBuffer,t.currentOcclusionQueryObjects=t.occlusionQueryObjects,i=r.createQuerySet({type:"occlusion",count:s,label:`occlusionQuerySet_${e.id}`}),t.occlusionQuerySet=i,t.occlusionQueryIndex=0,t.occlusionQueryObjects=new Array(s),t.lastOcclusionObject=null),n=null===e.textures?this._getDefaultRenderPassDescriptor():this._getRenderPassDescriptor(e,{loadOp:IN}),this.initTimestampQuery(e,n),n.occlusionQuerySet=i;const a=n.depthStencilAttachment;if(null!==e.textures){const t=n.colorAttachments;for(let r=0;r0&&t.currentPass.executeBundles(t.renderBundles),r>t.occlusionQueryIndex&&t.currentPass.endOcclusionQuery();const s=t.encoder;if(!0===this._isRenderCameraDepthArray(e)){const r=[];for(let e=0;e0){const s=8*r;let i=this.occludedResolveCache.get(s);void 0===i&&(i=this.device.createBuffer({size:s,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),this.occludedResolveCache.set(s,i));const n=this.device.createBuffer({size:s,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});t.encoder.resolveQuerySet(t.occlusionQuerySet,0,r,i,0),t.encoder.copyBufferToBuffer(i,0,n,0,s),t.occlusionQueryBuffer=n,this.resolveOccludedAsync(e)}if(this.device.queue.submit([t.encoder.finish()]),null!==e.textures){const t=e.textures;for(let e=0;ea?(u.x=Math.min(t.dispatchCount,a),u.y=Math.ceil(t.dispatchCount/a)):u.x=t.dispatchCount,i.dispatchWorkgroups(u.x,u.y,u.z)}finishCompute(e){const t=this.get(e);t.passEncoderGPU.end(),this.device.queue.submit([t.cmdEncoderGPU.finish()])}async waitForGPU(){await this.device.queue.onSubmittedWorkDone()}draw(e,t){const{object:r,material:s,context:i,pipeline:n}=e,a=e.getBindings(),o=this.get(i),u=this.get(n).pipeline,l=e.getIndex(),d=null!==l,c=e.getDrawParameters();if(null===c)return;const h=(t,r)=>{this.pipelineUtils.setPipeline(t,u),r.pipeline=u;const n=r.bindingGroups;for(let e=0,r=a.length;e{if(h(s,i),!0===r.isBatchedMesh){const e=r._multiDrawStarts,i=r._multiDrawCounts,n=r._multiDrawCount,a=r._multiDrawInstances;null!==a&&pt("THREE.WebGPUBackend: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.");for(let o=0;o1?0:o;!0===d?s.drawIndexed(i[o],n,e[o]/l.array.BYTES_PER_ELEMENT,0,u):s.draw(i[o],n,e[o],u),t.update(r,i[o],n)}}else if(!0===d){const{vertexCount:i,instanceCount:n,firstVertex:a}=c,o=e.getIndirect();if(null!==o){const e=this.get(o).buffer;s.drawIndexedIndirect(e,0)}else s.drawIndexed(i,n,a,0,0);t.update(r,i,n)}else{const{vertexCount:i,instanceCount:n,firstVertex:a}=c,o=e.getIndirect();if(null!==o){const e=this.get(o).buffer;s.drawIndirect(e,0)}else s.draw(i,n,a,0);t.update(r,i,n)}};if(e.camera.isArrayCamera&&e.camera.cameras.length>0){const t=this.get(e.camera),s=e.camera.cameras,n=e.getBindingGroup("cameraIndex");if(void 0===t.indexesGPU||t.indexesGPU.length!==s.length){const e=this.get(n),r=[],i=new Uint32Array([0,0,0,0]);for(let t=0,n=s.length;t(console.warn("THREE.WebGPURenderer: WebGPU is not available, running under WebGL2 backend."),new TN(e)));super(new t(e),e),this.library=new pA,this.isWebGPURenderer=!0}}class mA extends ds{constructor(){super(),this.isBundleGroup=!0,this.type="BundleGroup",this.static=!0,this.version=0}set needsUpdate(e){!0===e&&this.version++}}class fA{constructor(e,t=nn(0,0,1,1)){this.renderer=e,this.outputNode=t,this.outputColorTransform=!0,this.needsUpdate=!0;const r=new Zh;r.name="PostProcessing",this._quadMesh=new Cy(r)}render(){this._update();const e=this.renderer,t=e.toneMapping,r=e.outputColorSpace;e.toneMapping=p,e.outputColorSpace=ue;const s=e.xr.enabled;e.xr.enabled=!1,this._quadMesh.render(e),e.xr.enabled=s,e.toneMapping=t,e.outputColorSpace=r}dispose(){this._quadMesh.material.dispose()}_update(){if(!0===this.needsUpdate){const e=this.renderer,t=e.toneMapping,r=e.outputColorSpace;this._quadMesh.material.fragmentNode=!0===this.outputColorTransform?Ou(this.outputNode,t,r):this.outputNode.context({toneMapping:t,outputColorSpace:r}),this._quadMesh.material.needsUpdate=!0,this.needsUpdate=!1}}async renderAsync(){this._update();const e=this.renderer,t=e.toneMapping,r=e.outputColorSpace;e.toneMapping=p,e.outputColorSpace=ue;const s=e.xr.enabled;e.xr.enabled=!1,await this._quadMesh.renderAsync(e),e.xr.enabled=s,e.toneMapping=t,e.outputColorSpace=r}}class yA extends x{constructor(e=1,t=1){super(),this.image={width:e,height:t},this.magFilter=K,this.minFilter=K,this.isStorageTexture=!0}}class bA extends Vy{constructor(e,t){super(e,t,Uint32Array),this.isIndirectStorageBufferAttribute=!0}}class xA extends cs{constructor(e){super(e),this.textures={},this.nodes={}}load(e,t,r,s){const i=new hs(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,(r=>{try{t(this.parse(JSON.parse(r)))}catch(t){s?s(t):console.error(t),this.manager.itemError(e)}}),r,s)}parseNodes(e){const t={};if(void 0!==e){for(const r of e){const{uuid:e,type:s}=r;t[e]=this.createNodeFromType(s),t[e].uuid=e}const r={nodes:t,textures:this.textures};for(const s of e){s.meta=r;t[s.uuid].deserialize(s),delete s.meta}}return t}parse(e){const t=this.createNodeFromType(e.type);t.uuid=e.uuid;const r={nodes:this.parseNodes(e.nodes),textures:this.textures};return e.meta=r,t.deserialize(e),delete e.meta,t}setTextures(e){return this.textures=e,this}setNodes(e){return this.nodes=e,this}createNodeFromType(e){return void 0===this.nodes[e]?(console.error("THREE.NodeLoader: Node type not found:",e),ji()):Bi(new this.nodes[e])}}class TA extends ps{constructor(e){super(e),this.nodes={},this.nodeMaterials={}}parse(e){const t=super.parse(e),r=this.nodes,s=e.inputNodes;for(const e in s){const i=s[e];t[e]=r[i]}return t}setNodes(e){return this.nodes=e,this}setNodeMaterials(e){return this.nodeMaterials=e,this}createMaterialFromType(e){const t=this.nodeMaterials[e];return void 0!==t?new t:super.createMaterialFromType(e)}}class _A extends gs{constructor(e){super(e),this.nodes={},this.nodeMaterials={},this._nodesJSON=null}setNodes(e){return this.nodes=e,this}setNodeMaterials(e){return this.nodeMaterials=e,this}parse(e,t){this._nodesJSON=e.nodes;const r=super.parse(e,t);return this._nodesJSON=null,r}parseNodes(e,t){if(void 0!==e){const r=new xA;return r.setNodes(this.nodes),r.setTextures(t),r.parseNodes(e)}return{}}parseMaterials(e,t){const r={};if(void 0!==e){const s=this.parseNodes(this._nodesJSON,t),i=new TA;i.setTextures(t),i.setNodes(s),i.setNodeMaterials(this.nodeMaterials);for(let t=0,s=e.length;t