pptx-react-viewer 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/index.js +587 -288
  2. package/dist/index.mjs +587 -288
  3. package/dist/pptx-viewer.css +1 -1
  4. package/dist/viewer/index.js +587 -288
  5. package/dist/viewer/index.mjs +587 -288
  6. package/node_modules/emf-converter/package.json +2 -2
  7. package/node_modules/mtx-decompressor/package.json +2 -2
  8. package/node_modules/pptx-viewer-core/dist/{SvgExporter--H1PDfAY.d.ts → SvgExporter-0TxiiorD.d.ts} +1 -1
  9. package/node_modules/pptx-viewer-core/dist/{SvgExporter-Dq_2eV_r.d.mts → SvgExporter-BQ4KbRO9.d.mts} +1 -1
  10. package/node_modules/pptx-viewer-core/dist/cli/index.d.mts +2 -2
  11. package/node_modules/pptx-viewer-core/dist/cli/index.d.ts +2 -2
  12. package/node_modules/pptx-viewer-core/dist/cli/index.js +2875 -321
  13. package/node_modules/pptx-viewer-core/dist/cli/index.mjs +2875 -321
  14. package/node_modules/pptx-viewer-core/dist/converter/index.d.mts +3 -3
  15. package/node_modules/pptx-viewer-core/dist/converter/index.d.ts +3 -3
  16. package/node_modules/pptx-viewer-core/dist/index.d.mts +713 -44
  17. package/node_modules/pptx-viewer-core/dist/index.d.ts +713 -44
  18. package/node_modules/pptx-viewer-core/dist/index.js +2958 -390
  19. package/node_modules/pptx-viewer-core/dist/index.mjs +2949 -390
  20. package/node_modules/pptx-viewer-core/dist/{presentation-BozkirFp.d.mts → presentation-ArhfImJ5.d.mts} +225 -8
  21. package/node_modules/pptx-viewer-core/dist/{presentation-BozkirFp.d.ts → presentation-ArhfImJ5.d.ts} +225 -8
  22. package/node_modules/pptx-viewer-core/dist/{text-operations-B2JbPA5H.d.mts → text-operations-CLj-sJyk.d.mts} +1 -1
  23. package/node_modules/pptx-viewer-core/dist/{text-operations-zwF6i4eH.d.ts → text-operations-rhJV-A_W.d.ts} +1 -1
  24. package/node_modules/pptx-viewer-core/package.json +5 -5
  25. package/package.json +20 -20
package/dist/index.mjs CHANGED
@@ -64,7 +64,7 @@ var init_extends = __esm({
64
64
  }
65
65
  });
66
66
 
67
- // ../../node_modules/.bun/three@0.183.2/node_modules/three/build/three.core.js
67
+ // ../../node_modules/.bun/three@0.184.0/node_modules/three/build/three.core.js
68
68
  function arrayNeedsUint32(array) {
69
69
  for (let i3 = array.length - 1; i3 >= 0; --i3) {
70
70
  if (array[i3] >= 65535) return true;
@@ -1232,7 +1232,7 @@ function cloneUniforms(src) {
1232
1232
  dst[u2] = {};
1233
1233
  for (const p3 in src[u2]) {
1234
1234
  const property = src[u2][p3];
1235
- if (property && (property.isColor || property.isMatrix3 || property.isMatrix4 || property.isVector2 || property.isVector3 || property.isVector4 || property.isTexture || property.isQuaternion)) {
1235
+ if (isThreeObject(property)) {
1236
1236
  if (property.isRenderTargetTexture) {
1237
1237
  warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().");
1238
1238
  dst[u2][p3] = null;
@@ -1240,7 +1240,15 @@ function cloneUniforms(src) {
1240
1240
  dst[u2][p3] = property.clone();
1241
1241
  }
1242
1242
  } else if (Array.isArray(property)) {
1243
- dst[u2][p3] = property.slice();
1243
+ if (isThreeObject(property[0])) {
1244
+ const clonedProperty = [];
1245
+ for (let i3 = 0, l2 = property.length; i3 < l2; i3++) {
1246
+ clonedProperty[i3] = property[i3].clone();
1247
+ }
1248
+ dst[u2][p3] = clonedProperty;
1249
+ } else {
1250
+ dst[u2][p3] = property.slice();
1251
+ }
1244
1252
  } else {
1245
1253
  dst[u2][p3] = property;
1246
1254
  }
@@ -1251,13 +1259,16 @@ function cloneUniforms(src) {
1251
1259
  function mergeUniforms(uniforms) {
1252
1260
  const merged = {};
1253
1261
  for (let u2 = 0; u2 < uniforms.length; u2++) {
1254
- const tmp2 = cloneUniforms(uniforms[u2]);
1255
- for (const p3 in tmp2) {
1256
- merged[p3] = tmp2[p3];
1262
+ const tmp3 = cloneUniforms(uniforms[u2]);
1263
+ for (const p3 in tmp3) {
1264
+ merged[p3] = tmp3[p3];
1257
1265
  }
1258
1266
  }
1259
1267
  return merged;
1260
1268
  }
1269
+ function isThreeObject(property) {
1270
+ return property && (property.isColor || property.isMatrix3 || property.isMatrix4 || property.isVector2 || property.isVector3 || property.isVector4 || property.isTexture || property.isQuaternion);
1271
+ }
1261
1272
  function cloneUniformsGroups(src) {
1262
1273
  const dst = [];
1263
1274
  for (let u2 = 0; u2 < src.length; u2++) {
@@ -1680,10 +1691,10 @@ function getTextureTypeByteLength(type) {
1680
1691
  }
1681
1692
  throw new Error(`Unknown texture type ${type}.`);
1682
1693
  }
1683
- var REVISION, MOUSE, TOUCH, CullFaceNone, CullFaceBack, CullFaceFront, CullFaceFrontBack, BasicShadowMap, PCFShadowMap, PCFSoftShadowMap, VSMShadowMap, FrontSide, BackSide, DoubleSide, NoBlending, NormalBlending, AdditiveBlending, SubtractiveBlending, MultiplyBlending, CustomBlending, MaterialBlending, AddEquation, SubtractEquation, ReverseSubtractEquation, MinEquation, MaxEquation, ZeroFactor, OneFactor, SrcColorFactor, OneMinusSrcColorFactor, SrcAlphaFactor, OneMinusSrcAlphaFactor, DstAlphaFactor, OneMinusDstAlphaFactor, DstColorFactor, OneMinusDstColorFactor, SrcAlphaSaturateFactor, ConstantColorFactor, OneMinusConstantColorFactor, ConstantAlphaFactor, OneMinusConstantAlphaFactor, NeverDepth, AlwaysDepth, LessDepth, LessEqualDepth, EqualDepth, GreaterEqualDepth, GreaterDepth, NotEqualDepth, MultiplyOperation, MixOperation, AddOperation, NoToneMapping, LinearToneMapping, ReinhardToneMapping, CineonToneMapping, ACESFilmicToneMapping, CustomToneMapping, AgXToneMapping, NeutralToneMapping, AttachedBindMode, DetachedBindMode, UVMapping, CubeReflectionMapping, CubeRefractionMapping, EquirectangularReflectionMapping, EquirectangularRefractionMapping, CubeUVReflectionMapping, RepeatWrapping, ClampToEdgeWrapping, MirroredRepeatWrapping, NearestFilter, NearestMipmapNearestFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipMapLinearFilter, LinearFilter, LinearMipmapNearestFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipMapLinearFilter, UnsignedByteType, ByteType, ShortType, UnsignedShortType, IntType, UnsignedIntType, FloatType, HalfFloatType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedInt248Type, UnsignedInt5999Type, UnsignedInt101111Type, AlphaFormat, RGBFormat, RGBAFormat, DepthFormat, DepthStencilFormat, RedFormat, RedIntegerFormat, RGFormat, RGIntegerFormat, RGBIntegerFormat, RGBAIntegerFormat, RGB_S3TC_DXT1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGB_PVRTC_4BPPV1_Format, RGB_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_PVRTC_2BPPV1_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGBA_ETC2_EAC_Format, R11_EAC_Format, SIGNED_R11_EAC_Format, RG11_EAC_Format, SIGNED_RG11_EAC_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_10x10_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_BPTC_Format, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RED_RGTC1_Format, SIGNED_RED_RGTC1_Format, RED_GREEN_RGTC2_Format, SIGNED_RED_GREEN_RGTC2_Format, LoopOnce, LoopRepeat, LoopPingPong, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InterpolateBezier, ZeroCurvatureEnding, ZeroSlopeEnding, WrapAroundEnding, NormalAnimationBlendMode, AdditiveAnimationBlendMode, TrianglesDrawMode, TriangleStripDrawMode, TriangleFanDrawMode, BasicDepthPacking, RGBADepthPacking, RGBDepthPacking, RGDepthPacking, TangentSpaceNormalMap, ObjectSpaceNormalMap, NoColorSpace, SRGBColorSpace, LinearSRGBColorSpace, LinearTransfer, SRGBTransfer, NoNormalPacking, NormalRGPacking, NormalGAPacking, ZeroStencilOp, KeepStencilOp, ReplaceStencilOp, IncrementStencilOp, DecrementStencilOp, IncrementWrapStencilOp, DecrementWrapStencilOp, InvertStencilOp, NeverStencilFunc, LessStencilFunc, EqualStencilFunc, LessEqualStencilFunc, GreaterStencilFunc, NotEqualStencilFunc, GreaterEqualStencilFunc, AlwaysStencilFunc, NeverCompare, LessCompare, EqualCompare, LessEqualCompare, GreaterCompare, NotEqualCompare, GreaterEqualCompare, AlwaysCompare, StaticDrawUsage, DynamicDrawUsage, StreamDrawUsage, StaticReadUsage, DynamicReadUsage, StreamReadUsage, StaticCopyUsage, DynamicCopyUsage, StreamCopyUsage, GLSL1, GLSL3, WebGLCoordinateSystem, WebGPUCoordinateSystem, TimestampQuery, InterpolationSamplingType, InterpolationSamplingMode, Compatibility, TYPED_ARRAYS, _cache, _setConsoleFunction, ReversedDepthFuncs, EventDispatcher, _lut, _seed, DEG2RAD, RAD2DEG, MathUtils, Vector2, Quaternion, Vector3, _vector$c, _quaternion$5, Matrix3, _m3, LINEAR_REC709_TO_XYZ, XYZ_TO_LINEAR_REC709, ColorManagement, _canvas, ImageUtils, _sourceId, Source, _textureId, _tempVec3, Texture, Vector4, RenderTarget, WebGLRenderTarget, DataArrayTexture, WebGLArrayRenderTarget, Data3DTexture, WebGL3DRenderTarget, Matrix4, _v1$7, _m1$2, _zero, _one, _x, _y, _z, _matrix$2, _quaternion$4, Euler, Layers, _object3DId, _v1$6, _q1, _m1$1, _target, _position$4, _scale$3, _quaternion$3, _xAxis, _yAxis, _zAxis, _addedEvent, _removedEvent, _childaddedEvent, _childremovedEvent, Object3D, Group, _moveEvent, WebXRController, _colorKeywords, _hslA, _hslB, Color, _color, FogExp2, Fog, Scene, _v0$2, _v1$5, _v2$4, _v3$2, _vab, _vac, _vbc, _vap, _vbp, _vcp, _v40, _v41, _v42, Triangle, Box3, _points, _vector$b, _box$4, _v0$1, _v1$4, _v2$3, _f0, _f1, _f2, _center, _extents, _triangleNormal, _testAxis, _tables, DataUtils, _vector$a, _vector2$1, _id$2, BufferAttribute, Int8BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Int16BufferAttribute, Uint16BufferAttribute, Int32BufferAttribute, Uint32BufferAttribute, Float16BufferAttribute, Float32BufferAttribute, _box$3, _v1$3, _v2$2, Sphere, _id$1, _m1, _obj, _offset, _box$2, _boxMorphTargets, _vector$9, BufferGeometry, InterleavedBuffer, _vector$8, InterleavedBufferAttribute, _materialId, Material, SpriteMaterial, _geometry, _intersectPoint, _worldScale, _mvPosition, _alignedPosition, _rotatedPosition, _viewWorldMatrix, _vA$1, _vB$1, _vC$1, _uvA, _uvB, _uvC, Sprite, _v1$2, _v2$1, LOD, _vector$7, _segCenter, _segDir, _diff, _edge1, _edge2, _normal$1, Ray, MeshBasicMaterial, _inverseMatrix$3, _ray$3, _sphere$6, _sphereHitAt, _vA, _vB, _vC, _tempA, _morphA, _intersectionPoint, _intersectionPointWorld, Mesh, _basePosition, _skinIndex, _skinWeight, _vector3, _matrix4, _vertex, _sphere$5, _inverseMatrix$2, _ray$2, SkinnedMesh, Bone, DataTexture, _offsetMatrix, _identityMatrix, Skeleton, InstancedBufferAttribute, _instanceLocalMatrix, _instanceWorldMatrix, _instanceIntersects, _box3, _identity, _mesh$1, _sphere$4, InstancedMesh, _vector1, _vector2, _normalMatrix, Plane, _sphere$3, _defaultSpriteCenter, _vector$6, Frustum, _projScreenMatrix$1, _frustum$1, FrustumArray, MultiDrawRenderList, _matrix$1, _whiteColor, _frustum, _frustumArray, _box$1, _sphere$2, _vector$5, _forward$1, _temp, _renderList, _mesh, _batchIntersects, BatchedMesh, LineBasicMaterial, _vStart, _vEnd, _inverseMatrix$1, _ray$1, _sphere$1, _intersectPointOnRay, _intersectPointOnSegment, Line, _start, _end, LineSegments, LineLoop, PointsMaterial, _inverseMatrix, _ray, _sphere, _position$3, Points, VideoTexture, VideoFrameTexture, FramebufferTexture, CompressedTexture, CompressedArrayTexture, CompressedCubeTexture, CubeTexture, CanvasTexture, DepthTexture, CubeDepthTexture, ExternalTexture, BoxGeometry, CapsuleGeometry, CircleGeometry, CylinderGeometry, ConeGeometry, PolyhedronGeometry, DodecahedronGeometry, _v0, _v1$1, _normal, _triangle, EdgesGeometry, Curve, EllipseCurve, ArcCurve, tmp, px, py, pz, CatmullRomCurve3, CubicBezierCurve, CubicBezierCurve3, LineCurve, LineCurve3, QuadraticBezierCurve, QuadraticBezierCurve3, SplineCurve, Curves, CurvePath, Path, Shape, Earcut, ShapeUtils, ExtrudeGeometry, WorldUVGenerator, IcosahedronGeometry, LatheGeometry, OctahedronGeometry, PlaneGeometry, RingGeometry, ShapeGeometry, SphereGeometry, TetrahedronGeometry, TorusGeometry, TorusKnotGeometry, TubeGeometry, WireframeGeometry, Geometries, ShadowMaterial, UniformsUtils, default_vertex, default_fragment, ShaderMaterial, RawShaderMaterial, MeshStandardMaterial, MeshPhysicalMaterial, MeshPhongMaterial, MeshToonMaterial, MeshNormalMaterial, MeshLambertMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshMatcapMaterial, LineDashedMaterial, AnimationUtils, Interpolant, CubicInterpolant, LinearInterpolant, DiscreteInterpolant, BezierInterpolant, KeyframeTrack, BooleanKeyframeTrack, ColorKeyframeTrack, NumberKeyframeTrack, QuaternionLinearInterpolant, QuaternionKeyframeTrack, StringKeyframeTrack, VectorKeyframeTrack, AnimationClip, Cache, LoadingManager, DefaultLoadingManager, Loader, loading, HttpError, FileLoader, AnimationLoader, CompressedTextureLoader, _loading, ImageLoader, CubeTextureLoader, DataTextureLoader, TextureLoader, Light, HemisphereLight, _projScreenMatrix, _lightPositionWorld, _lookTarget, LightShadow, _position$2, _quaternion$2, _scale$2, Camera, _v3$1, _minTarget, _maxTarget, PerspectiveCamera, SpotLightShadow, SpotLight, PointLightShadow, PointLight, OrthographicCamera, DirectionalLightShadow, DirectionalLight, AmbientLight, RectAreaLight, SphericalHarmonics3, LightProbe, MaterialLoader, LoaderUtils, InstancedBufferGeometry, BufferGeometryLoader, ObjectLoader, TEXTURE_MAPPING, TEXTURE_WRAPPING, TEXTURE_FILTER, _errorMap, ImageBitmapLoader, _context, AudioContext, AudioLoader, _eyeRight, _eyeLeft, _projectionMatrix, StereoCamera, fov, aspect, CubeCamera, ArrayCamera, Timer, _position$1, _quaternion$1, _scale$1, _forward, _up, AudioListener, Audio2, _position, _quaternion, _scale, _orientation, PositionalAudio, AudioAnalyser, PropertyMixer, _RESERVED_CHARS_RE, _reservedRe, _wordChar, _wordCharOrDot, _directoryRe, _nodeRe, _objectRe, _propertyRe, _trackRe, _supportedObjectNames, Composite, PropertyBinding, AnimationObjectGroup, AnimationAction, _controlInterpolantsResultBuffer, AnimationMixer, RenderTarget3D, Uniform, _id, UniformsGroup, InstancedInterleavedBuffer, GLBufferAttribute, _matrix, Raycaster, Clock, Spherical, Cylindrical, Matrix2, _vector$4, Box2, _startP, _startEnd, _d1, _d2, _r, _c1, _c2, Line3, _vector$3, SpotLightHelper, _vector$2, _boneMatrix, _matrixWorldInv, SkeletonHelper, PointLightHelper, _vector$1, _color1, _color2, HemisphereLightHelper, GridHelper, PolarGridHelper, _v1, _v2, _v3, DirectionalLightHelper, _vector, _camera, CameraHelper, _box, BoxHelper, Box3Helper, PlaneHelper, _axis, _lineGeometry, _coneGeometry, ArrowHelper, AxesHelper, ShapePath, Controls, TextureUtils;
1694
+ var REVISION, MOUSE, TOUCH, CullFaceNone, CullFaceBack, CullFaceFront, CullFaceFrontBack, BasicShadowMap, PCFShadowMap, PCFSoftShadowMap, VSMShadowMap, FrontSide, BackSide, DoubleSide, NoBlending, NormalBlending, AdditiveBlending, SubtractiveBlending, MultiplyBlending, CustomBlending, MaterialBlending, AddEquation, SubtractEquation, ReverseSubtractEquation, MinEquation, MaxEquation, ZeroFactor, OneFactor, SrcColorFactor, OneMinusSrcColorFactor, SrcAlphaFactor, OneMinusSrcAlphaFactor, DstAlphaFactor, OneMinusDstAlphaFactor, DstColorFactor, OneMinusDstColorFactor, SrcAlphaSaturateFactor, ConstantColorFactor, OneMinusConstantColorFactor, ConstantAlphaFactor, OneMinusConstantAlphaFactor, NeverDepth, AlwaysDepth, LessDepth, LessEqualDepth, EqualDepth, GreaterEqualDepth, GreaterDepth, NotEqualDepth, MultiplyOperation, MixOperation, AddOperation, NoToneMapping, LinearToneMapping, ReinhardToneMapping, CineonToneMapping, ACESFilmicToneMapping, CustomToneMapping, AgXToneMapping, NeutralToneMapping, AttachedBindMode, DetachedBindMode, UVMapping, CubeReflectionMapping, CubeRefractionMapping, EquirectangularReflectionMapping, EquirectangularRefractionMapping, CubeUVReflectionMapping, RepeatWrapping, ClampToEdgeWrapping, MirroredRepeatWrapping, NearestFilter, NearestMipmapNearestFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipMapLinearFilter, LinearFilter, LinearMipmapNearestFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipMapLinearFilter, UnsignedByteType, ByteType, ShortType, UnsignedShortType, IntType, UnsignedIntType, FloatType, HalfFloatType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedInt248Type, UnsignedInt5999Type, UnsignedInt101111Type, AlphaFormat, RGBFormat, RGBAFormat, DepthFormat, DepthStencilFormat, RedFormat, RedIntegerFormat, RGFormat, RGIntegerFormat, RGBIntegerFormat, RGBAIntegerFormat, RGB_S3TC_DXT1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGB_PVRTC_4BPPV1_Format, RGB_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_PVRTC_2BPPV1_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGBA_ETC2_EAC_Format, R11_EAC_Format, SIGNED_R11_EAC_Format, RG11_EAC_Format, SIGNED_RG11_EAC_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_10x10_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_BPTC_Format, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RED_RGTC1_Format, SIGNED_RED_RGTC1_Format, RED_GREEN_RGTC2_Format, SIGNED_RED_GREEN_RGTC2_Format, LoopOnce, LoopRepeat, LoopPingPong, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InterpolateBezier, ZeroCurvatureEnding, ZeroSlopeEnding, WrapAroundEnding, NormalAnimationBlendMode, AdditiveAnimationBlendMode, TrianglesDrawMode, TriangleStripDrawMode, TriangleFanDrawMode, BasicDepthPacking, RGBADepthPacking, RGBDepthPacking, RGDepthPacking, TangentSpaceNormalMap, ObjectSpaceNormalMap, NoColorSpace, SRGBColorSpace, LinearSRGBColorSpace, LinearTransfer, SRGBTransfer, NoNormalPacking, NormalRGPacking, NormalGAPacking, ZeroStencilOp, KeepStencilOp, ReplaceStencilOp, IncrementStencilOp, DecrementStencilOp, IncrementWrapStencilOp, DecrementWrapStencilOp, InvertStencilOp, NeverStencilFunc, LessStencilFunc, EqualStencilFunc, LessEqualStencilFunc, GreaterStencilFunc, NotEqualStencilFunc, GreaterEqualStencilFunc, AlwaysStencilFunc, NeverCompare, LessCompare, EqualCompare, LessEqualCompare, GreaterCompare, NotEqualCompare, GreaterEqualCompare, AlwaysCompare, StaticDrawUsage, DynamicDrawUsage, StreamDrawUsage, StaticReadUsage, DynamicReadUsage, StreamReadUsage, StaticCopyUsage, DynamicCopyUsage, StreamCopyUsage, GLSL1, GLSL3, WebGLCoordinateSystem, WebGPUCoordinateSystem, TimestampQuery, InterpolationSamplingType, InterpolationSamplingMode, Compatibility, TYPED_ARRAYS, _cache, _setConsoleFunction, ReversedDepthFuncs, EventDispatcher, _lut, _seed, DEG2RAD, RAD2DEG, MathUtils, Vector2, Quaternion, Vector3, _vector$c, _quaternion$5, Matrix3, _m3, LINEAR_REC709_TO_XYZ, XYZ_TO_LINEAR_REC709, ColorManagement, _canvas, ImageUtils, _sourceId, Source, _textureId, _tempVec3, Texture, Vector4, RenderTarget, WebGLRenderTarget, DataArrayTexture, WebGLArrayRenderTarget, Data3DTexture, WebGL3DRenderTarget, Matrix4, _v1$7, _m1$2, _zero, _one, _x, _y, _z, _matrix$2, _quaternion$4, Euler, Layers, _object3DId, _v1$6, _q1, _m1$1, _target, _position$4, _scale$3, _quaternion$3, _xAxis, _yAxis, _zAxis, _addedEvent, _removedEvent, _childaddedEvent, _childremovedEvent, Object3D, Group, _moveEvent, WebXRController, _colorKeywords, _hslA, _hslB, Color, _color, FogExp2, Fog, Scene, _v0$2, _v1$5, _v2$4, _v3$2, _vab, _vac, _vbc, _vap, _vbp, _vcp, _v40, _v41, _v42, Triangle, Box3, _points, _vector$b, _box$4, _v0$1, _v1$4, _v2$3, _f0, _f1, _f2, _center, _extents, _triangleNormal, _testAxis, _tables, DataUtils, _vector$a, _vector2$1, _id$2, BufferAttribute, Int8BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Int16BufferAttribute, Uint16BufferAttribute, Int32BufferAttribute, Uint32BufferAttribute, Float16BufferAttribute, Float32BufferAttribute, _box$3, _v1$3, _v2$2, Sphere, _id$1, _m1, _obj, _offset, _box$2, _boxMorphTargets, _vector$9, BufferGeometry, InterleavedBuffer, _vector$8, InterleavedBufferAttribute, _materialId, Material, SpriteMaterial, _geometry, _intersectPoint, _worldScale, _mvPosition, _alignedPosition, _rotatedPosition, _viewWorldMatrix, _vA$1, _vB$1, _vC$1, _uvA, _uvB, _uvC, Sprite, _v1$2, _v2$1, LOD, _vector$7, _segCenter, _segDir, _diff, _edge1, _edge2, _normal$1, Ray, MeshBasicMaterial, _inverseMatrix$3, _ray$3, _sphere$6, _sphereHitAt, _vA, _vB, _vC, _tempA, _morphA, _intersectionPoint, _intersectionPointWorld, Mesh, _baseVector, _skinIndex, _skinWeight, _vector4, _matrix4, _vertex, _sphere$5, _inverseMatrix$2, _ray$2, SkinnedMesh, Bone, DataTexture, _offsetMatrix, _identityMatrix, Skeleton, InstancedBufferAttribute, _instanceLocalMatrix, _instanceWorldMatrix, _instanceIntersects, _box3, _identity, _mesh$1, _sphere$4, InstancedMesh, _vector1, _vector2, _normalMatrix, Plane, _sphere$3, _defaultSpriteCenter, _vector$6, Frustum, _projScreenMatrix$1, _frustum$1, FrustumArray, MultiDrawRenderList, _matrix$1, _whiteColor, _frustum, _frustumArray, _box$1, _sphere$2, _vector$5, _forward$1, _temp, _renderList, _mesh, _batchIntersects, BatchedMesh, LineBasicMaterial, _vStart, _vEnd, _inverseMatrix$1, _ray$1, _sphere$1, _intersectPointOnRay, _intersectPointOnSegment, Line, _start, _end, LineSegments, LineLoop, PointsMaterial, _inverseMatrix, _ray, _sphere, _position$3, Points, VideoTexture, VideoFrameTexture, FramebufferTexture, CompressedTexture, CompressedArrayTexture, CompressedCubeTexture, CubeTexture, CanvasTexture, HTMLTexture, DepthTexture, CubeDepthTexture, ExternalTexture, BoxGeometry, CapsuleGeometry, CircleGeometry, CylinderGeometry, ConeGeometry, PolyhedronGeometry, DodecahedronGeometry, _v0, _v1$1, _normal, _triangle, EdgesGeometry, Curve, EllipseCurve, ArcCurve, tmp, tmp2, px, py, pz, CatmullRomCurve3, CubicBezierCurve, CubicBezierCurve3, LineCurve, LineCurve3, QuadraticBezierCurve, QuadraticBezierCurve3, SplineCurve, Curves, CurvePath, Path, Shape, Earcut, ShapeUtils, ExtrudeGeometry, WorldUVGenerator, IcosahedronGeometry, LatheGeometry, OctahedronGeometry, PlaneGeometry, RingGeometry, ShapeGeometry, SphereGeometry, TetrahedronGeometry, TorusGeometry, TorusKnotGeometry, TubeGeometry, WireframeGeometry, Geometries, ShadowMaterial, UniformsUtils, default_vertex, default_fragment, ShaderMaterial, RawShaderMaterial, MeshStandardMaterial, MeshPhysicalMaterial, MeshPhongMaterial, MeshToonMaterial, MeshNormalMaterial, MeshLambertMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshMatcapMaterial, LineDashedMaterial, AnimationUtils, Interpolant, CubicInterpolant, LinearInterpolant, DiscreteInterpolant, BezierInterpolant, KeyframeTrack, BooleanKeyframeTrack, ColorKeyframeTrack, NumberKeyframeTrack, QuaternionLinearInterpolant, QuaternionKeyframeTrack, StringKeyframeTrack, VectorKeyframeTrack, AnimationClip, Cache, LoadingManager, DefaultLoadingManager, Loader, loading, HttpError, FileLoader, AnimationLoader, CompressedTextureLoader, _loading, ImageLoader, CubeTextureLoader, DataTextureLoader, TextureLoader, Light, HemisphereLight, _projScreenMatrix, _lightPositionWorld, _lookTarget, LightShadow, _position$2, _quaternion$2, _scale$2, Camera, _v3$1, _minTarget, _maxTarget, PerspectiveCamera, SpotLightShadow, SpotLight, PointLightShadow, PointLight, OrthographicCamera, DirectionalLightShadow, DirectionalLight, AmbientLight, RectAreaLight, SphericalHarmonics3, LightProbe, MaterialLoader, LoaderUtils, InstancedBufferGeometry, BufferGeometryLoader, _customGeometries, ObjectLoader, TEXTURE_MAPPING, TEXTURE_WRAPPING, TEXTURE_FILTER, _errorMap, ImageBitmapLoader, _context, AudioContext, AudioLoader, _eyeRight, _eyeLeft, _projectionMatrix, StereoCamera, fov, aspect, CubeCamera, ArrayCamera, Timer, _position$1, _quaternion$1, _scale$1, _forward, _up, AudioListener, Audio2, _position, _quaternion, _scale, _orientation, PositionalAudio, AudioAnalyser, PropertyMixer, _RESERVED_CHARS_RE, _reservedRe, _wordChar, _wordCharOrDot, _directoryRe, _nodeRe, _objectRe, _propertyRe, _trackRe, _supportedObjectNames, Composite, PropertyBinding, AnimationObjectGroup, AnimationAction, _controlInterpolantsResultBuffer, AnimationMixer, RenderTarget3D, Uniform, _id, UniformsGroup, InstancedInterleavedBuffer, GLBufferAttribute, _matrix, Raycaster, Clock, Spherical, Cylindrical, Matrix2, _vector$4, Box2, _startP, _startEnd, _d1, _d2, _r, _c1, _c2, Line3, _vector$3, SpotLightHelper, _vector$2, _boneMatrix, _matrixWorldInv, SkeletonHelper, PointLightHelper, _vector$1, _color1, _color2, HemisphereLightHelper, GridHelper, PolarGridHelper, _v1, _v2, _v3, DirectionalLightHelper, _vector, _camera, CameraHelper, _box, BoxHelper, Box3Helper, PlaneHelper, _axis, _lineGeometry, _coneGeometry, ArrowHelper, AxesHelper, ShapePath, Controls, TextureUtils;
1684
1695
  var init_three_core = __esm({
1685
- "../../node_modules/.bun/three@0.183.2/node_modules/three/build/three.core.js"() {
1686
- REVISION = "183";
1696
+ "../../node_modules/.bun/three@0.184.0/node_modules/three/build/three.core.js"() {
1697
+ REVISION = "184";
1687
1698
  MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
1688
1699
  TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
1689
1700
  CullFaceNone = 0;
@@ -2246,6 +2257,9 @@ var init_three_core = __esm({
2246
2257
  denormalize
2247
2258
  };
2248
2259
  Vector2 = class _Vector2 {
2260
+ static {
2261
+ _Vector2.prototype.isVector2 = true;
2262
+ }
2249
2263
  /**
2250
2264
  * Constructs a new 2D vector.
2251
2265
  *
@@ -2253,7 +2267,6 @@ var init_three_core = __esm({
2253
2267
  * @param {number} [y=0] - The y value of this vector.
2254
2268
  */
2255
2269
  constructor(x2 = 0, y = 0) {
2256
- _Vector2.prototype.isVector2 = true;
2257
2270
  this.x = x2;
2258
2271
  this.y = y;
2259
2272
  }
@@ -3471,6 +3484,9 @@ var init_three_core = __esm({
3471
3484
  }
3472
3485
  };
3473
3486
  Vector3 = class _Vector3 {
3487
+ static {
3488
+ _Vector3.prototype.isVector3 = true;
3489
+ }
3474
3490
  /**
3475
3491
  * Constructs a new 3D vector.
3476
3492
  *
@@ -3479,7 +3495,6 @@ var init_three_core = __esm({
3479
3495
  * @param {number} [z=0] - The z value of this vector.
3480
3496
  */
3481
3497
  constructor(x2 = 0, y = 0, z = 0) {
3482
- _Vector3.prototype.isVector3 = true;
3483
3498
  this.x = x2;
3484
3499
  this.y = y;
3485
3500
  this.z = z;
@@ -4377,6 +4392,9 @@ var init_three_core = __esm({
4377
4392
  _vector$c = /* @__PURE__ */ new Vector3();
4378
4393
  _quaternion$5 = /* @__PURE__ */ new Quaternion();
4379
4394
  Matrix3 = class _Matrix3 {
4395
+ static {
4396
+ _Matrix3.prototype.isMatrix3 = true;
4397
+ }
4380
4398
  /**
4381
4399
  * Constructs a new 3x3 matrix. The arguments are supposed to be
4382
4400
  * in row-major order. If no arguments are provided, the constructor
@@ -4393,7 +4411,6 @@ var init_three_core = __esm({
4393
4411
  * @param {number} [n33] - 3-3 matrix element.
4394
4412
  */
4395
4413
  constructor(n11, n12, n13, n21, n22, n23, n31, n32, n33) {
4396
- _Matrix3.prototype.isMatrix3 = true;
4397
4414
  this.elements = [
4398
4415
  1,
4399
4416
  0,
@@ -4615,17 +4632,17 @@ var init_three_core = __esm({
4615
4632
  * @return {Matrix3} A reference to this matrix.
4616
4633
  */
4617
4634
  transpose() {
4618
- let tmp2;
4635
+ let tmp3;
4619
4636
  const m2 = this.elements;
4620
- tmp2 = m2[1];
4637
+ tmp3 = m2[1];
4621
4638
  m2[1] = m2[3];
4622
- m2[3] = tmp2;
4623
- tmp2 = m2[2];
4639
+ m2[3] = tmp3;
4640
+ tmp3 = m2[2];
4624
4641
  m2[2] = m2[6];
4625
- m2[6] = tmp2;
4626
- tmp2 = m2[5];
4642
+ m2[6] = tmp3;
4643
+ tmp3 = m2[5];
4627
4644
  m2[5] = m2[7];
4628
- m2[7] = tmp2;
4645
+ m2[7] = tmp3;
4629
4646
  return this;
4630
4647
  }
4631
4648
  /**
@@ -4975,7 +4992,7 @@ var init_three_core = __esm({
4975
4992
  if (typeof HTMLVideoElement !== "undefined" && data instanceof HTMLVideoElement) {
4976
4993
  target.set(data.videoWidth, data.videoHeight, 0);
4977
4994
  } else if (typeof VideoFrame !== "undefined" && data instanceof VideoFrame) {
4978
- target.set(data.displayHeight, data.displayWidth, 0);
4995
+ target.set(data.displayWidth, data.displayHeight, 0);
4979
4996
  } else if (data !== null) {
4980
4997
  target.set(data.width, data.height, data.depth || 0);
4981
4998
  } else {
@@ -5088,6 +5105,7 @@ var init_three_core = __esm({
5088
5105
  this.isRenderTargetTexture = false;
5089
5106
  this.isArrayTexture = image && image.depth && image.depth > 1 ? true : false;
5090
5107
  this.pmremVersion = 0;
5108
+ this.normalized = false;
5091
5109
  }
5092
5110
  /**
5093
5111
  * The width of the texture in pixels.
@@ -5115,11 +5133,11 @@ var init_three_core = __esm({
5115
5133
  get image() {
5116
5134
  return this.source.data;
5117
5135
  }
5118
- set image(value = null) {
5136
+ set image(value) {
5119
5137
  this.source.data = value;
5120
5138
  }
5121
5139
  /**
5122
- * Updates the texture transformation matrix from the from the properties {@link Texture#offset},
5140
+ * Updates the texture transformation matrix from the properties {@link Texture#offset},
5123
5141
  * {@link Texture#repeat}, {@link Texture#rotation}, and {@link Texture#center}.
5124
5142
  */
5125
5143
  updateMatrix() {
@@ -5168,6 +5186,7 @@ var init_three_core = __esm({
5168
5186
  this.format = source.format;
5169
5187
  this.internalFormat = source.internalFormat;
5170
5188
  this.type = source.type;
5189
+ this.normalized = source.normalized;
5171
5190
  this.offset.copy(source.offset);
5172
5191
  this.repeat.copy(source.repeat);
5173
5192
  this.center.copy(source.center);
@@ -5244,6 +5263,7 @@ var init_three_core = __esm({
5244
5263
  format: this.format,
5245
5264
  internalFormat: this.internalFormat,
5246
5265
  type: this.type,
5266
+ normalized: this.normalized,
5247
5267
  colorSpace: this.colorSpace,
5248
5268
  minFilter: this.minFilter,
5249
5269
  magFilter: this.magFilter,
@@ -5349,6 +5369,9 @@ var init_three_core = __esm({
5349
5369
  Texture.DEFAULT_MAPPING = UVMapping;
5350
5370
  Texture.DEFAULT_ANISOTROPY = 1;
5351
5371
  Vector4 = class _Vector4 {
5372
+ static {
5373
+ _Vector4.prototype.isVector4 = true;
5374
+ }
5352
5375
  /**
5353
5376
  * Constructs a new 4D vector.
5354
5377
  *
@@ -5358,7 +5381,6 @@ var init_three_core = __esm({
5358
5381
  * @param {number} [w=1] - The w value of this vector.
5359
5382
  */
5360
5383
  constructor(x2 = 0, y = 0, z = 0, w = 1) {
5361
- _Vector4.prototype.isVector4 = true;
5362
5384
  this.x = x2;
5363
5385
  this.y = y;
5364
5386
  this.z = z;
@@ -6266,6 +6288,7 @@ var init_three_core = __esm({
6266
6288
  this.resolveStencilBuffer = source.resolveStencilBuffer;
6267
6289
  if (source.depthTexture !== null) this.depthTexture = source.depthTexture.clone();
6268
6290
  this.samples = source.samples;
6291
+ this.multiview = source.multiview;
6269
6292
  return this;
6270
6293
  }
6271
6294
  /**
@@ -6389,6 +6412,9 @@ var init_three_core = __esm({
6389
6412
  }
6390
6413
  };
6391
6414
  Matrix4 = class _Matrix4 {
6415
+ static {
6416
+ _Matrix4.prototype.isMatrix4 = true;
6417
+ }
6392
6418
  /**
6393
6419
  * Constructs a new 4x4 matrix. The arguments are supposed to be
6394
6420
  * in row-major order. If no arguments are provided, the constructor
@@ -6412,7 +6438,6 @@ var init_three_core = __esm({
6412
6438
  * @param {number} [n44] - 4-4 matrix element.
6413
6439
  */
6414
6440
  constructor(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) {
6415
- _Matrix4.prototype.isMatrix4 = true;
6416
6441
  this.elements = [
6417
6442
  1,
6418
6443
  0,
@@ -6917,25 +6942,25 @@ var init_three_core = __esm({
6917
6942
  */
6918
6943
  transpose() {
6919
6944
  const te = this.elements;
6920
- let tmp2;
6921
- tmp2 = te[1];
6945
+ let tmp3;
6946
+ tmp3 = te[1];
6922
6947
  te[1] = te[4];
6923
- te[4] = tmp2;
6924
- tmp2 = te[2];
6948
+ te[4] = tmp3;
6949
+ tmp3 = te[2];
6925
6950
  te[2] = te[8];
6926
- te[8] = tmp2;
6927
- tmp2 = te[6];
6951
+ te[8] = tmp3;
6952
+ tmp3 = te[6];
6928
6953
  te[6] = te[9];
6929
- te[9] = tmp2;
6930
- tmp2 = te[3];
6954
+ te[9] = tmp3;
6955
+ tmp3 = te[3];
6931
6956
  te[3] = te[12];
6932
- te[12] = tmp2;
6933
- tmp2 = te[7];
6957
+ te[12] = tmp3;
6958
+ tmp3 = te[7];
6934
6959
  te[7] = te[13];
6935
- te[13] = tmp2;
6936
- tmp2 = te[11];
6960
+ te[13] = tmp3;
6961
+ tmp3 = te[11];
6937
6962
  te[11] = te[14];
6938
- te[14] = tmp2;
6963
+ te[14] = tmp3;
6939
6964
  return this;
6940
6965
  }
6941
6966
  /**
@@ -8775,9 +8800,7 @@ var init_three_core = __esm({
8775
8800
  this.rotation.order = source.rotation.order;
8776
8801
  this.quaternion.copy(source.quaternion);
8777
8802
  this.scale.copy(source.scale);
8778
- if (source.pivot !== null) {
8779
- this.pivot = source.pivot.clone();
8780
- }
8803
+ this.pivot = source.pivot !== null ? source.pivot.clone() : null;
8781
8804
  this.matrix.copy(source.matrix);
8782
8805
  this.matrixWorld.copy(source.matrixWorld);
8783
8806
  this.matrixAutoUpdate = source.matrixAutoUpdate;
@@ -8867,6 +8890,7 @@ var init_three_core = __esm({
8867
8890
  this._grip.linearVelocity = new Vector3();
8868
8891
  this._grip.hasAngularVelocity = false;
8869
8892
  this._grip.angularVelocity = new Vector3();
8893
+ this._grip.eventsEnabled = false;
8870
8894
  }
8871
8895
  return this._grip;
8872
8896
  }
@@ -8996,6 +9020,13 @@ var init_three_core = __esm({
8996
9020
  } else {
8997
9021
  grip.hasAngularVelocity = false;
8998
9022
  }
9023
+ if (grip.eventsEnabled) {
9024
+ grip.dispatchEvent({
9025
+ type: "gripUpdated",
9026
+ data: inputSource,
9027
+ target: this
9028
+ });
9029
+ }
8999
9030
  }
9000
9031
  }
9001
9032
  }
@@ -10075,7 +10106,7 @@ var init_three_core = __esm({
10075
10106
  static isFrontFacing(a2, b2, c2, direction) {
10076
10107
  _v0$2.subVectors(c2, b2);
10077
10108
  _v1$5.subVectors(a2, b2);
10078
- return _v0$2.cross(_v1$5).dot(direction) < 0 ? true : false;
10109
+ return _v0$2.cross(_v1$5).dot(direction) < 0;
10079
10110
  }
10080
10111
  /**
10081
10112
  * Sets the triangle's vertices by copying the given values.
@@ -10846,7 +10877,7 @@ var init_three_core = __esm({
10846
10877
  _vector$a = /* @__PURE__ */ new Vector3();
10847
10878
  _vector2$1 = /* @__PURE__ */ new Vector2();
10848
10879
  _id$2 = 0;
10849
- BufferAttribute = class {
10880
+ BufferAttribute = class extends EventDispatcher {
10850
10881
  /**
10851
10882
  * Constructs a new buffer attribute.
10852
10883
  *
@@ -10855,6 +10886,7 @@ var init_three_core = __esm({
10855
10886
  * @param {boolean} [normalized=false] - Whether the data are normalized or not.
10856
10887
  */
10857
10888
  constructor(array, itemSize, normalized = false) {
10889
+ super();
10858
10890
  if (Array.isArray(array)) {
10859
10891
  throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");
10860
10892
  }
@@ -11251,6 +11283,12 @@ var init_three_core = __esm({
11251
11283
  if (this.usage !== StaticDrawUsage) data.usage = this.usage;
11252
11284
  return data;
11253
11285
  }
11286
+ /**
11287
+ * Disposes of the buffer attribute. Available only in {@link WebGPURenderer}.
11288
+ */
11289
+ dispose() {
11290
+ this.dispatchEvent({ type: "dispose" });
11291
+ }
11254
11292
  };
11255
11293
  Int8BufferAttribute = class extends BufferAttribute {
11256
11294
  /**
@@ -12192,18 +12230,18 @@ var init_three_core = __esm({
12192
12230
  );
12193
12231
  }
12194
12232
  }
12195
- const tmp2 = new Vector3(), tmp22 = new Vector3();
12233
+ const tmp3 = new Vector3(), tmp22 = new Vector3();
12196
12234
  const n = new Vector3(), n2 = new Vector3();
12197
12235
  function handleVertex(v) {
12198
12236
  n.fromBufferAttribute(normalAttribute, v);
12199
12237
  n2.copy(n);
12200
12238
  const t2 = tan1[v];
12201
- tmp2.copy(t2);
12202
- tmp2.sub(n.multiplyScalar(n.dot(t2))).normalize();
12239
+ tmp3.copy(t2);
12240
+ tmp3.sub(n.multiplyScalar(n.dot(t2))).normalize();
12203
12241
  tmp22.crossVectors(n2, t2);
12204
12242
  const test = tmp22.dot(tan2[v]);
12205
12243
  const w = test < 0 ? -1 : 1;
12206
- tangentAttribute.setXYZW(v, tmp2.x, tmp2.y, tmp2.z, w);
12244
+ tangentAttribute.setXYZW(v, tmp3.x, tmp3.y, tmp3.z, w);
12207
12245
  }
12208
12246
  for (let i3 = 0, il = groups.length; i3 < il; ++i3) {
12209
12247
  const group = groups[i3];
@@ -14354,10 +14392,10 @@ var init_three_core = __esm({
14354
14392
  }
14355
14393
  }
14356
14394
  };
14357
- _basePosition = /* @__PURE__ */ new Vector3();
14395
+ _baseVector = /* @__PURE__ */ new Vector4();
14358
14396
  _skinIndex = /* @__PURE__ */ new Vector4();
14359
14397
  _skinWeight = /* @__PURE__ */ new Vector4();
14360
- _vector3 = /* @__PURE__ */ new Vector3();
14398
+ _vector4 = /* @__PURE__ */ new Vector4();
14361
14399
  _matrix4 = /* @__PURE__ */ new Matrix4();
14362
14400
  _vertex = /* @__PURE__ */ new Vector3();
14363
14401
  _sphere$5 = /* @__PURE__ */ new Sphere();
@@ -14499,28 +14537,37 @@ var init_three_core = __esm({
14499
14537
  }
14500
14538
  /**
14501
14539
  * Applies the bone transform associated with the given index to the given
14502
- * vertex position. Returns the updated vector.
14540
+ * vector. Can be used to transform positions or direction vectors by providing
14541
+ * a Vector4 with 1 or 0 in the w component respectively. Returns the updated vector.
14503
14542
  *
14504
14543
  * @param {number} index - The vertex index.
14505
- * @param {Vector3} target - The target object that is used to store the method's result.
14506
- * the skinned mesh's world matrix will be used instead.
14507
- * @return {Vector3} The updated vertex position.
14544
+ * @param {Vector3|Vector4} target - The target object that is used to store the method's result.
14545
+ * @return {Vector3|Vector4} The updated vertex attribute data.
14508
14546
  */
14509
14547
  applyBoneTransform(index, target) {
14510
14548
  const skeleton = this.skeleton;
14511
14549
  const geometry = this.geometry;
14512
14550
  _skinIndex.fromBufferAttribute(geometry.attributes.skinIndex, index);
14513
14551
  _skinWeight.fromBufferAttribute(geometry.attributes.skinWeight, index);
14514
- _basePosition.copy(target).applyMatrix4(this.bindMatrix);
14515
- target.set(0, 0, 0);
14552
+ if (target.isVector4) {
14553
+ _baseVector.copy(target);
14554
+ target.set(0, 0, 0, 0);
14555
+ } else {
14556
+ _baseVector.set(...target, 1);
14557
+ target.set(0, 0, 0);
14558
+ }
14559
+ _baseVector.applyMatrix4(this.bindMatrix);
14516
14560
  for (let i3 = 0; i3 < 4; i3++) {
14517
14561
  const weight = _skinWeight.getComponent(i3);
14518
14562
  if (weight !== 0) {
14519
14563
  const boneIndex = _skinIndex.getComponent(i3);
14520
14564
  _matrix4.multiplyMatrices(skeleton.bones[boneIndex].matrixWorld, skeleton.boneInverses[boneIndex]);
14521
- target.addScaledVector(_vector3.copy(_basePosition).applyMatrix4(_matrix4), weight);
14565
+ target.addScaledVector(_vector4.copy(_baseVector).applyMatrix4(_matrix4), weight);
14522
14566
  }
14523
14567
  }
14568
+ if (target.isVector4) {
14569
+ target.w = _baseVector.w;
14570
+ }
14524
14571
  return target.applyMatrix4(this.bindMatrixInverse);
14525
14572
  }
14526
14573
  };
@@ -14868,18 +14915,24 @@ var init_three_core = __esm({
14868
14915
  *
14869
14916
  * @param {number} index - The instance index.
14870
14917
  * @param {Color} color - The target object that is used to store the method's result.
14918
+ * @return {Color} A reference to the target color.
14871
14919
  */
14872
14920
  getColorAt(index, color) {
14873
- color.fromArray(this.instanceColor.array, index * 3);
14921
+ if (this.instanceColor === null) {
14922
+ return color.setRGB(1, 1, 1);
14923
+ } else {
14924
+ return color.fromArray(this.instanceColor.array, index * 3);
14925
+ }
14874
14926
  }
14875
14927
  /**
14876
14928
  * Gets the local transformation matrix of the defined instance.
14877
14929
  *
14878
14930
  * @param {number} index - The instance index.
14879
14931
  * @param {Matrix4} matrix - The target object that is used to store the method's result.
14932
+ * @return {Matrix4} A reference to the target matrix.
14880
14933
  */
14881
14934
  getMatrixAt(index, matrix) {
14882
- matrix.fromArray(this.instanceMatrix.array, index * 16);
14935
+ return matrix.fromArray(this.instanceMatrix.array, index * 16);
14883
14936
  }
14884
14937
  /**
14885
14938
  * Gets the morph target weights of the defined instance.
@@ -14926,22 +14979,26 @@ var init_three_core = __esm({
14926
14979
  *
14927
14980
  * @param {number} index - The instance index.
14928
14981
  * @param {Color} color - The instance color.
14982
+ * @return {InstancedMesh} A reference to this instanced mesh.
14929
14983
  */
14930
14984
  setColorAt(index, color) {
14931
14985
  if (this.instanceColor === null) {
14932
14986
  this.instanceColor = new InstancedBufferAttribute(new Float32Array(this.instanceMatrix.count * 3).fill(1), 3);
14933
14987
  }
14934
14988
  color.toArray(this.instanceColor.array, index * 3);
14989
+ return this;
14935
14990
  }
14936
14991
  /**
14937
14992
  * Sets the given local transformation matrix to the defined instance. Make sure you set the `needsUpdate` flag of
14938
- * {@link InstancedMesh#instanceMatrix} to `true` after updating all the colors.
14993
+ * {@link InstancedMesh#instanceMatrix} to `true` after updating all the matrices.
14939
14994
  *
14940
14995
  * @param {number} index - The instance index.
14941
14996
  * @param {Matrix4} matrix - The local transformation.
14997
+ * @return {InstancedMesh} A reference to this instanced mesh.
14942
14998
  */
14943
14999
  setMatrixAt(index, matrix) {
14944
15000
  matrix.toArray(this.instanceMatrix.array, index * 16);
15001
+ return this;
14945
15002
  }
14946
15003
  /**
14947
15004
  * Sets the morph target weights to the defined instance. Make sure you set the `needsUpdate` flag of
@@ -14950,6 +15007,7 @@ var init_three_core = __esm({
14950
15007
  * @param {number} index - The instance index.
14951
15008
  * @param {Mesh} object - A mesh which `morphTargetInfluences` property containing the morph target weights
14952
15009
  * of a single instance.
15010
+ * @return {InstancedMesh} A reference to this instanced mesh.
14953
15011
  */
14954
15012
  setMorphAt(index, object) {
14955
15013
  const objectInfluences = object.morphTargetInfluences;
@@ -14966,6 +15024,7 @@ var init_three_core = __esm({
14966
15024
  const dataIndex = len * index;
14967
15025
  array[dataIndex] = morphBaseInfluence;
14968
15026
  array.set(objectInfluences, dataIndex + 1);
15027
+ return this;
14969
15028
  }
14970
15029
  updateMorphTargets() {
14971
15030
  }
@@ -15118,9 +15177,10 @@ var init_three_core = __esm({
15118
15177
  *
15119
15178
  * @param {Line3} line - The line to compute the intersection for.
15120
15179
  * @param {Vector3} target - The target vector that is used to store the method's result.
15121
- * @return {?Vector3} The intersection point.
15180
+ * @param {boolean} [clampToLine=true] - Whether to clamp the intersection to the line segment.
15181
+ * @return {?Vector3} The intersection point. Returns `null` if no intersection is detected.
15122
15182
  */
15123
- intersectLine(line, target) {
15183
+ intersectLine(line, target, clampToLine = true) {
15124
15184
  const direction = line.delta(_vector1);
15125
15185
  const denominator = this.normal.dot(direction);
15126
15186
  if (denominator === 0) {
@@ -15130,7 +15190,7 @@ var init_three_core = __esm({
15130
15190
  return null;
15131
15191
  }
15132
15192
  const t2 = -(line.start.dot(this.normal) + this.constant) / denominator;
15133
- if (t2 < 0 || t2 > 1) {
15193
+ if (clampToLine === true && (t2 < 0 || t2 > 1)) {
15134
15194
  return null;
15135
15195
  }
15136
15196
  return target.copy(line.start).addScaledVector(direction, t2);
@@ -15638,7 +15698,6 @@ var init_three_core = __esm({
15638
15698
  this._multiDrawCounts = new Int32Array(maxInstanceCount);
15639
15699
  this._multiDrawStarts = new Int32Array(maxInstanceCount);
15640
15700
  this._multiDrawCount = 0;
15641
- this._multiDrawInstances = null;
15642
15701
  this._matricesTexture = null;
15643
15702
  this._indirectTexture = null;
15644
15703
  this._colorsTexture = null;
@@ -16183,7 +16242,15 @@ var init_three_core = __esm({
16183
16242
  */
16184
16243
  getColorAt(instanceId, color) {
16185
16244
  this.validateInstanceId(instanceId);
16186
- return color.fromArray(this._colorsTexture.image.data, instanceId * 4);
16245
+ if (this._colorsTexture === null) {
16246
+ if (color.isVector4) {
16247
+ return color.set(1, 1, 1, 1);
16248
+ } else {
16249
+ return color.setRGB(1, 1, 1);
16250
+ }
16251
+ } else {
16252
+ return color.fromArray(this._colorsTexture.image.data, instanceId * 4);
16253
+ }
16187
16254
  }
16188
16255
  /**
16189
16256
  * Sets the visibility of the instance.
@@ -17087,6 +17154,41 @@ var init_three_core = __esm({
17087
17154
  this.needsUpdate = true;
17088
17155
  }
17089
17156
  };
17157
+ HTMLTexture = class extends Texture {
17158
+ /**
17159
+ * Constructs a new texture.
17160
+ *
17161
+ * @param {HTMLElement} [element] - The HTML element.
17162
+ * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.
17163
+ * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.
17164
+ * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.
17165
+ * @param {number} [magFilter=LinearFilter] - The mag filter value.
17166
+ * @param {number} [minFilter=LinearMipmapLinearFilter] - The min filter value.
17167
+ * @param {number} [format=RGBAFormat] - The texture format.
17168
+ * @param {number} [type=UnsignedByteType] - The texture type.
17169
+ * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
17170
+ */
17171
+ constructor(element2, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy) {
17172
+ super(element2, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy);
17173
+ this.isHTMLTexture = true;
17174
+ this.generateMipmaps = false;
17175
+ this.needsUpdate = true;
17176
+ const parent = element2 ? element2.parentNode : null;
17177
+ if (parent !== null && "requestPaint" in parent) {
17178
+ parent.onpaint = () => {
17179
+ this.needsUpdate = true;
17180
+ };
17181
+ parent.requestPaint();
17182
+ }
17183
+ }
17184
+ dispose() {
17185
+ const parent = this.image ? this.image.parentNode : null;
17186
+ if (parent !== null && "onpaint" in parent) {
17187
+ parent.onpaint = null;
17188
+ }
17189
+ super.dispose();
17190
+ }
17191
+ };
17090
17192
  DepthTexture = class extends Texture {
17091
17193
  /**
17092
17194
  * Constructs a new depth texture.
@@ -18541,6 +18643,7 @@ var init_three_core = __esm({
18541
18643
  }
18542
18644
  };
18543
18645
  tmp = /* @__PURE__ */ new Vector3();
18646
+ tmp2 = /* @__PURE__ */ new Vector3();
18544
18647
  px = /* @__PURE__ */ new CubicPoly();
18545
18648
  py = /* @__PURE__ */ new CubicPoly();
18546
18649
  pz = /* @__PURE__ */ new CubicPoly();
@@ -18586,8 +18689,8 @@ var init_three_core = __esm({
18586
18689
  if (this.closed || intPoint > 0) {
18587
18690
  p0 = points[(intPoint - 1) % l2];
18588
18691
  } else {
18589
- tmp.subVectors(points[0], points[1]).add(points[0]);
18590
- p0 = tmp;
18692
+ tmp2.subVectors(points[0], points[1]).add(points[0]);
18693
+ p0 = tmp2;
18591
18694
  }
18592
18695
  const p1 = points[intPoint % l2];
18593
18696
  const p22 = points[(intPoint + 1) % l2];
@@ -23436,7 +23539,6 @@ var init_three_core = __esm({
23436
23539
  * @param {function(any)} onLoad - Executed when the loading process has been finished.
23437
23540
  * @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.
23438
23541
  * @param {onErrorCallback} [onError] - Executed when errors occur.
23439
- * @return {any|undefined} The cached resource if available.
23440
23542
  */
23441
23543
  load(url, onLoad, onProgress, onError) {
23442
23544
  if (url === void 0) url = "";
@@ -23449,7 +23551,7 @@ var init_three_core = __esm({
23449
23551
  if (onLoad) onLoad(cached);
23450
23552
  this.manager.itemEnd(url);
23451
23553
  }, 0);
23452
- return cached;
23554
+ return;
23453
23555
  }
23454
23556
  if (loading[url] !== void 0) {
23455
23557
  loading[url].push({
@@ -23893,13 +23995,13 @@ var init_three_core = __esm({
23893
23995
  let texData;
23894
23996
  try {
23895
23997
  texData = scope.parse(buffer);
23896
- } catch (error2) {
23998
+ } catch (e2) {
23897
23999
  if (onError !== void 0) {
23898
- onError(error2);
24000
+ onError(e2);
23899
24001
  } else {
23900
- error2(error2);
23901
- return;
24002
+ error(e2);
23902
24003
  }
24004
+ return;
23903
24005
  }
23904
24006
  if (texData.image !== void 0) {
23905
24007
  texture.image = texData.image;
@@ -25235,7 +25337,7 @@ var init_three_core = __esm({
25235
25337
  if (json.userData !== void 0) material.userData = json.userData;
25236
25338
  if (json.vertexColors !== void 0) {
25237
25339
  if (typeof json.vertexColors === "number") {
25238
- material.vertexColors = json.vertexColors > 0 ? true : false;
25340
+ material.vertexColors = json.vertexColors > 0;
25239
25341
  } else {
25240
25342
  material.vertexColors = json.vertexColors;
25241
25343
  }
@@ -25563,6 +25665,7 @@ var init_three_core = __esm({
25563
25665
  return geometry;
25564
25666
  }
25565
25667
  };
25668
+ _customGeometries = {};
25566
25669
  ObjectLoader = class extends Loader {
25567
25670
  /**
25568
25671
  * Constructs a new object loader.
@@ -25592,9 +25695,9 @@ var init_three_core = __esm({
25592
25695
  let json = null;
25593
25696
  try {
25594
25697
  json = JSON.parse(text2);
25595
- } catch (error2) {
25596
- if (onError !== void 0) onError(error2);
25597
- error2("ObjectLoader: Can't parse " + url + ".", error2.message);
25698
+ } catch (e2) {
25699
+ if (onError !== void 0) onError(e2);
25700
+ error("ObjectLoader: Can't parse " + url + ".", e2.message);
25598
25701
  return;
25599
25702
  }
25600
25703
  const metadata = json.metadata;
@@ -25687,6 +25790,17 @@ var init_three_core = __esm({
25687
25790
  this.bindLightTargets(object);
25688
25791
  return object;
25689
25792
  }
25793
+ /**
25794
+ * Registers the given geometry at the internal
25795
+ * geometry library.
25796
+ *
25797
+ * @static
25798
+ * @param {string} type - The geometry type.
25799
+ * @param {BufferGeometry.constructor} geometryClass - The geometry class.
25800
+ */
25801
+ static registerGeometry(type, geometryClass) {
25802
+ _customGeometries[type] = geometryClass;
25803
+ }
25690
25804
  // internals
25691
25805
  parseShapes(json) {
25692
25806
  const shapes = {};
@@ -25727,8 +25841,10 @@ var init_three_core = __esm({
25727
25841
  default:
25728
25842
  if (data.type in Geometries) {
25729
25843
  geometry = Geometries[data.type].fromJSON(data, shapes);
25844
+ } else if (data.type in _customGeometries) {
25845
+ geometry = _customGeometries[data.type].fromJSON(data, shapes);
25730
25846
  } else {
25731
- warn(`ObjectLoader: Unsupported geometry type "${data.type}"`);
25847
+ warn(`ObjectLoader: Unknown geometry type "${data.type}". Use .registerGeometry() before starting the deserialization process.`);
25732
25848
  }
25733
25849
  }
25734
25850
  geometry.uuid = data.uuid;
@@ -25929,6 +26045,7 @@ var init_three_core = __esm({
25929
26045
  if (data.premultiplyAlpha !== void 0) texture.premultiplyAlpha = data.premultiplyAlpha;
25930
26046
  if (data.unpackAlignment !== void 0) texture.unpackAlignment = data.unpackAlignment;
25931
26047
  if (data.compareFunction !== void 0) texture.compareFunction = data.compareFunction;
26048
+ if (data.normalized !== void 0) texture.normalized = data.normalized;
25932
26049
  if (data.userData !== void 0) texture.userData = data.userData;
25933
26050
  textures[data.uuid] = texture;
25934
26051
  }
@@ -26260,6 +26377,9 @@ var init_three_core = __esm({
26260
26377
  * Sets the given loader options. The structure of the object must match the `options` parameter of
26261
26378
  * [createImageBitmap](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap).
26262
26379
  *
26380
+ * Note: When caching is enabled, the cache key is based on the URL only. Loading the same URL with
26381
+ * different options will return the cached result of the first request.
26382
+ *
26263
26383
  * @param {Object} options - The loader options to set.
26264
26384
  * @return {ImageBitmapLoader} A reference to this image bitmap loader.
26265
26385
  */
@@ -26274,7 +26394,6 @@ var init_three_core = __esm({
26274
26394
  * @param {function(ImageBitmap)} onLoad - Executed when the loading process has been finished.
26275
26395
  * @param {onProgressCallback} onProgress - Unsupported in this loader.
26276
26396
  * @param {onErrorCallback} onError - Executed when errors occur.
26277
- * @return {ImageBitmap|undefined} The image bitmap.
26278
26397
  */
26279
26398
  load(url, onLoad, onProgress, onError) {
26280
26399
  if (url === void 0) url = "";
@@ -26293,7 +26412,6 @@ var init_three_core = __esm({
26293
26412
  } else {
26294
26413
  if (onLoad) onLoad(imageBitmap);
26295
26414
  scope.manager.itemEnd(url);
26296
- return imageBitmap;
26297
26415
  }
26298
26416
  });
26299
26417
  return;
@@ -26302,7 +26420,7 @@ var init_three_core = __esm({
26302
26420
  if (onLoad) onLoad(cached);
26303
26421
  scope.manager.itemEnd(url);
26304
26422
  }, 0);
26305
- return cached;
26423
+ return;
26306
26424
  }
26307
26425
  const fetchOptions = {};
26308
26426
  fetchOptions.credentials = this.crossOrigin === "anonymous" ? "same-origin" : "include";
@@ -26316,7 +26434,6 @@ var init_three_core = __esm({
26316
26434
  Cache.add(`image-bitmap:${url}`, imageBitmap);
26317
26435
  if (onLoad) onLoad(imageBitmap);
26318
26436
  scope.manager.itemEnd(url);
26319
- return imageBitmap;
26320
26437
  }).catch(function(e2) {
26321
26438
  if (onError) onError(e2);
26322
26439
  _errorMap.set(promise, e2);
@@ -26342,7 +26459,7 @@ var init_three_core = __esm({
26342
26459
  /**
26343
26460
  * Returns the global native audio context.
26344
26461
  *
26345
- * @return {AudioContext} The native audio context.
26462
+ * @return {Window.AudioContext} The native audio context.
26346
26463
  */
26347
26464
  static getContext() {
26348
26465
  if (_context === void 0) {
@@ -26353,7 +26470,7 @@ var init_three_core = __esm({
26353
26470
  /**
26354
26471
  * Allows to set the global native audio context from outside.
26355
26472
  *
26356
- * @param {AudioContext} value - The native context to set.
26473
+ * @param {Window.AudioContext} value - The native context to set.
26357
26474
  */
26358
26475
  static setContext(value) {
26359
26476
  _context = value;
@@ -26388,9 +26505,15 @@ var init_three_core = __esm({
26388
26505
  try {
26389
26506
  const bufferCopy = buffer.slice(0);
26390
26507
  const context2 = AudioContext.getContext();
26508
+ const decodeUrl = url + "#decode";
26509
+ scope.manager.itemStart(decodeUrl);
26391
26510
  context2.decodeAudioData(bufferCopy, function(audioBuffer) {
26392
26511
  onLoad(audioBuffer);
26393
- }).catch(handleError);
26512
+ scope.manager.itemEnd(decodeUrl);
26513
+ }).catch(function(e2) {
26514
+ handleError(e2);
26515
+ scope.manager.itemEnd(decodeUrl);
26516
+ });
26394
26517
  } catch (e2) {
26395
26518
  handleError(e2);
26396
26519
  }
@@ -28226,6 +28349,9 @@ var init_three_core = __esm({
28226
28349
  for (let i3 = 0; i3 !== nTracks; ++i3) {
28227
28350
  const interpolant = tracks[i3].createInterpolant(null);
28228
28351
  interpolants[i3] = interpolant;
28352
+ if (interpolant.settings) {
28353
+ Object.assign(interpolantSettings, interpolant.settings);
28354
+ }
28229
28355
  interpolant.settings = interpolantSettings;
28230
28356
  }
28231
28357
  this._interpolantSettings = interpolantSettings;
@@ -28669,6 +28795,7 @@ var init_three_core = __esm({
28669
28795
  });
28670
28796
  }
28671
28797
  } else {
28798
+ this._loopCount = loopCount;
28672
28799
  this.time = time;
28673
28800
  }
28674
28801
  if (pingPong && (loopCount & 1) === 1) {
@@ -29508,7 +29635,7 @@ var init_three_core = __esm({
29508
29635
  this.oldTime = 0;
29509
29636
  this.elapsedTime = 0;
29510
29637
  this.running = false;
29511
- warn("THREE.Clock: This module has been deprecated. Please use THREE.Timer instead.");
29638
+ warn("Clock: This module has been deprecated. Please use THREE.Timer instead.");
29512
29639
  }
29513
29640
  /**
29514
29641
  * Starts the clock. When `autoStart` is set to `true`, the method is automatically
@@ -29718,6 +29845,9 @@ var init_three_core = __esm({
29718
29845
  }
29719
29846
  };
29720
29847
  Matrix2 = class _Matrix2 {
29848
+ static {
29849
+ _Matrix2.prototype.isMatrix2 = true;
29850
+ }
29721
29851
  /**
29722
29852
  * Constructs a new 2x2 matrix. The arguments are supposed to be
29723
29853
  * in row-major order. If no arguments are provided, the constructor
@@ -29729,7 +29859,6 @@ var init_three_core = __esm({
29729
29859
  * @param {number} [n22] - 2-2 matrix element.
29730
29860
  */
29731
29861
  constructor(n11, n12, n21, n22) {
29732
- _Matrix2.prototype.isMatrix2 = true;
29733
29862
  this.elements = [
29734
29863
  1,
29735
29864
  0,
@@ -30141,6 +30270,7 @@ var init_three_core = __esm({
30141
30270
  _startP.subVectors(point, this.start);
30142
30271
  _startEnd.subVectors(this.end, this.start);
30143
30272
  const startEnd2 = _startEnd.dot(_startEnd);
30273
+ if (startEnd2 === 0) return 0;
30144
30274
  const startEnd_startP = _startEnd.dot(_startP);
30145
30275
  let t2 = startEnd_startP / startEnd2;
30146
30276
  if (clampToLine) {
@@ -31557,7 +31687,7 @@ var init_three_core = __esm({
31557
31687
  }
31558
31688
  });
31559
31689
 
31560
- // ../../node_modules/.bun/three@0.183.2/node_modules/three/build/three.module.js
31690
+ // ../../node_modules/.bun/three@0.184.0/node_modules/three/build/three.module.js
31561
31691
  var three_module_exports = {};
31562
31692
  __export(three_module_exports, {
31563
31693
  ACESFilmicToneMapping: () => ACESFilmicToneMapping,
@@ -31699,6 +31829,7 @@ __export(three_module_exports, {
31699
31829
  GreaterStencilFunc: () => GreaterStencilFunc,
31700
31830
  GridHelper: () => GridHelper,
31701
31831
  Group: () => Group,
31832
+ HTMLTexture: () => HTMLTexture,
31702
31833
  HalfFloatType: () => HalfFloatType,
31703
31834
  HemisphereLight: () => HemisphereLight,
31704
31835
  HemisphereLightHelper: () => HemisphereLightHelper,
@@ -32014,11 +32145,12 @@ function WebGLAnimation() {
32014
32145
  start: function() {
32015
32146
  if (isAnimating === true) return;
32016
32147
  if (animationLoop === null) return;
32148
+ if (context2 === null) return;
32017
32149
  requestId = context2.requestAnimationFrame(onAnimationFrame);
32018
32150
  isAnimating = true;
32019
32151
  },
32020
32152
  stop: function() {
32021
- context2.cancelAnimationFrame(requestId);
32153
+ if (context2 !== null) context2.cancelAnimationFrame(requestId);
32022
32154
  isAnimating = false;
32023
32155
  },
32024
32156
  setAnimationLoop: function(callback) {
@@ -32221,19 +32353,13 @@ function WebGLBackground(renderer, environments, state2, objects, alpha, premult
32221
32353
  });
32222
32354
  objects.update(boxMesh);
32223
32355
  }
32224
- _e1$1.copy(scene.backgroundRotation);
32225
- _e1$1.x *= -1;
32226
- _e1$1.y *= -1;
32227
- _e1$1.z *= -1;
32228
- if (background.isCubeTexture && background.isRenderTargetTexture === false) {
32229
- _e1$1.y *= -1;
32230
- _e1$1.z *= -1;
32231
- }
32232
32356
  boxMesh.material.uniforms.envMap.value = background;
32233
- boxMesh.material.uniforms.flipEnvMap.value = background.isCubeTexture && background.isRenderTargetTexture === false ? -1 : 1;
32234
32357
  boxMesh.material.uniforms.backgroundBlurriness.value = scene.backgroundBlurriness;
32235
32358
  boxMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;
32236
- boxMesh.material.uniforms.backgroundRotation.value.setFromMatrix4(_m1$12.makeRotationFromEuler(_e1$1));
32359
+ boxMesh.material.uniforms.backgroundRotation.value.setFromMatrix4(_m1$12.makeRotationFromEuler(scene.backgroundRotation)).transpose();
32360
+ if (background.isCubeTexture && background.isRenderTargetTexture === false) {
32361
+ boxMesh.material.uniforms.backgroundRotation.value.premultiply(_m$1);
32362
+ }
32237
32363
  boxMesh.material.toneMapped = ColorManagement.getTransfer(background.colorSpace) !== SRGBTransfer;
32238
32364
  if (currentBackground !== background || currentBackgroundVersion !== background.version || currentTonemapping !== renderer.toneMapping) {
32239
32365
  boxMesh.material.needsUpdate = true;
@@ -32709,27 +32835,10 @@ function WebGLBufferRenderer(gl, extensions2, info) {
32709
32835
  }
32710
32836
  info.update(elementCount, mode, 1);
32711
32837
  }
32712
- function renderMultiDrawInstances(starts, counts, drawCount, primcount) {
32713
- if (drawCount === 0) return;
32714
- const extension = extensions2.get("WEBGL_multi_draw");
32715
- if (extension === null) {
32716
- for (let i3 = 0; i3 < starts.length; i3++) {
32717
- renderInstances(starts[i3], counts[i3], primcount[i3]);
32718
- }
32719
- } else {
32720
- extension.multiDrawArraysInstancedWEBGL(mode, starts, 0, counts, 0, primcount, 0, drawCount);
32721
- let elementCount = 0;
32722
- for (let i3 = 0; i3 < drawCount; i3++) {
32723
- elementCount += counts[i3] * primcount[i3];
32724
- }
32725
- info.update(elementCount, mode, 1);
32726
- }
32727
- }
32728
32838
  this.setMode = setMode;
32729
32839
  this.render = render;
32730
32840
  this.renderInstances = renderInstances;
32731
32841
  this.renderMultiDraw = renderMultiDraw;
32732
- this.renderMultiDrawInstances = renderMultiDrawInstances;
32733
32842
  }
32734
32843
  function WebGLCapabilities(gl, extensions2, parameters, utils) {
32735
32844
  let maxAnisotropy;
@@ -32779,6 +32888,9 @@ function WebGLCapabilities(gl, extensions2, parameters, utils) {
32779
32888
  }
32780
32889
  const logarithmicDepthBuffer = parameters.logarithmicDepthBuffer === true;
32781
32890
  const reversedDepthBuffer = parameters.reversedDepthBuffer === true && extensions2.has("EXT_clip_control");
32891
+ if (parameters.reversedDepthBuffer === true && reversedDepthBuffer === false) {
32892
+ warn("WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.");
32893
+ }
32782
32894
  const maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);
32783
32895
  const maxVertexTextures = gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS);
32784
32896
  const maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);
@@ -33584,28 +33696,11 @@ function WebGLIndexedBufferRenderer(gl, extensions2, info) {
33584
33696
  }
33585
33697
  info.update(elementCount, mode, 1);
33586
33698
  }
33587
- function renderMultiDrawInstances(starts, counts, drawCount, primcount) {
33588
- if (drawCount === 0) return;
33589
- const extension = extensions2.get("WEBGL_multi_draw");
33590
- if (extension === null) {
33591
- for (let i3 = 0; i3 < starts.length; i3++) {
33592
- renderInstances(starts[i3] / bytesPerElement, counts[i3], primcount[i3]);
33593
- }
33594
- } else {
33595
- extension.multiDrawElementsInstancedWEBGL(mode, counts, 0, type, starts, 0, primcount, 0, drawCount);
33596
- let elementCount = 0;
33597
- for (let i3 = 0; i3 < drawCount; i3++) {
33598
- elementCount += counts[i3] * primcount[i3];
33599
- }
33600
- info.update(elementCount, mode, 1);
33601
- }
33602
- }
33603
33699
  this.setMode = setMode;
33604
33700
  this.setIndex = setIndex;
33605
33701
  this.render = render;
33606
33702
  this.renderInstances = renderInstances;
33607
33703
  this.renderMultiDraw = renderMultiDraw;
33608
- this.renderMultiDrawInstances = renderMultiDrawInstances;
33609
33704
  }
33610
33705
  function WebGLInfo(gl) {
33611
33706
  const memory = {
@@ -33799,7 +33894,8 @@ function WebGLOutput(type, width, height, depth, stencil) {
33799
33894
  const targetA = new WebGLRenderTarget(width, height, {
33800
33895
  type,
33801
33896
  depthBuffer: depth,
33802
- stencilBuffer: stencil
33897
+ stencilBuffer: stencil,
33898
+ depthTexture: depth ? new DepthTexture(width, height) : void 0
33803
33899
  });
33804
33900
  const targetB = new WebGLRenderTarget(width, height, {
33805
33901
  type: HalfFloatType,
@@ -33952,6 +34048,7 @@ function WebGLOutput(type, width, height, depth, stencil) {
33952
34048
  return _isCompositing;
33953
34049
  };
33954
34050
  this.dispose = function() {
34051
+ if (targetA.depthTexture) targetA.depthTexture.dispose();
33955
34052
  targetA.dispose();
33956
34053
  targetB.dispose();
33957
34054
  geometry.dispose();
@@ -34839,6 +34936,7 @@ function WebGLProgram(renderer, cacheKey, parameters, bindingStates) {
34839
34936
  parameters.thicknessMapUv ? "#define THICKNESSMAP_UV " + parameters.thicknessMapUv : "",
34840
34937
  //
34841
34938
  parameters.vertexTangents && parameters.flatShading === false ? "#define USE_TANGENT" : "",
34939
+ parameters.vertexNormals ? "#define HAS_NORMAL" : "",
34842
34940
  parameters.vertexColors ? "#define USE_COLOR" : "",
34843
34941
  parameters.vertexAlphas ? "#define USE_COLOR_ALPHA" : "",
34844
34942
  parameters.vertexUv1s ? "#define USE_UV1" : "",
@@ -34925,6 +35023,7 @@ function WebGLProgram(renderer, cacheKey, parameters, bindingStates) {
34925
35023
  parameters.normalMap ? "#define USE_NORMALMAP" : "",
34926
35024
  parameters.normalMapObjectSpace ? "#define USE_NORMALMAP_OBJECTSPACE" : "",
34927
35025
  parameters.normalMapTangentSpace ? "#define USE_NORMALMAP_TANGENTSPACE" : "",
35026
+ parameters.packedNormalMap ? "#define USE_PACKED_NORMALMAP" : "",
34928
35027
  parameters.emissiveMap ? "#define USE_EMISSIVEMAP" : "",
34929
35028
  parameters.anisotropy ? "#define USE_ANISOTROPY" : "",
34930
35029
  parameters.anisotropyMap ? "#define USE_ANISOTROPYMAP" : "",
@@ -34965,6 +35064,7 @@ function WebGLProgram(renderer, cacheKey, parameters, bindingStates) {
34965
35064
  parameters.shadowMapEnabled ? "#define " + shadowMapTypeDefine : "",
34966
35065
  parameters.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "",
34967
35066
  parameters.numLightProbes > 0 ? "#define USE_LIGHT_PROBES" : "",
35067
+ parameters.numLightProbeGrids > 0 ? "#define USE_LIGHT_PROBES_GRID" : "",
34968
35068
  parameters.decodeVideoTexture ? "#define DECODE_VIDEO_TEXTURE" : "",
34969
35069
  parameters.decodeVideoTextureEmissive ? "#define DECODE_VIDEO_TEXTURE_EMISSIVE" : "",
34970
35070
  parameters.logarithmicDepthBuffer ? "#define USE_LOGARITHMIC_DEPTH_BUFFER" : "",
@@ -35112,6 +35212,9 @@ function WebGLProgram(renderer, cacheKey, parameters, bindingStates) {
35112
35212
  this.fragmentShader = glFragmentShader;
35113
35213
  return this;
35114
35214
  }
35215
+ function isPackedRGFormat(format) {
35216
+ return format === RGFormat || format === RG11_EAC_Format || format === RED_GREEN_RGTC2_Format;
35217
+ }
35115
35218
  function WebGLPrograms(renderer, environments, extensions2, capabilities, bindingStates, clipping) {
35116
35219
  const _programLayers = new Layers();
35117
35220
  const _customShaders = new WebGLShaderCache();
@@ -35142,7 +35245,7 @@ function WebGLPrograms(renderer, environments, extensions2, capabilities, bindin
35142
35245
  if (value === 0) return "uv";
35143
35246
  return `uv${value}`;
35144
35247
  }
35145
- function getParameters(material, lights, shadows, scene, object) {
35248
+ function getParameters(material, lights, shadows, scene, object, lightProbeGrids) {
35146
35249
  const fog = scene.fog;
35147
35250
  const geometry = object.geometry;
35148
35251
  const environment = material.isMeshStandardMaterial || material.isMeshLambertMaterial || material.isMeshPhongMaterial ? scene.environment : null;
@@ -35237,7 +35340,7 @@ function WebGLPrograms(renderer, environments, extensions2, capabilities, bindin
35237
35340
  instancing: IS_INSTANCEDMESH,
35238
35341
  instancingColor: IS_INSTANCEDMESH && object.instanceColor !== null,
35239
35342
  instancingMorph: IS_INSTANCEDMESH && object.morphTexture !== null,
35240
- outputColorSpace: currentRenderTarget === null ? renderer.outputColorSpace : currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace,
35343
+ outputColorSpace: currentRenderTarget === null ? renderer.outputColorSpace : currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.colorSpace : ColorManagement.workingColorSpace,
35241
35344
  alphaToCoverage: !!material.alphaToCoverage,
35242
35345
  map: HAS_MAP,
35243
35346
  matcap: HAS_MATCAP,
@@ -35252,6 +35355,7 @@ function WebGLPrograms(renderer, environments, extensions2, capabilities, bindin
35252
35355
  emissiveMap: HAS_EMISSIVEMAP,
35253
35356
  normalMapObjectSpace: HAS_NORMALMAP && material.normalMapType === ObjectSpaceNormalMap,
35254
35357
  normalMapTangentSpace: HAS_NORMALMAP && material.normalMapType === TangentSpaceNormalMap,
35358
+ packedNormalMap: HAS_NORMALMAP && material.normalMapType === TangentSpaceNormalMap && isPackedRGFormat(material.normalMap.format),
35255
35359
  metalnessMap: HAS_METALNESSMAP,
35256
35360
  roughnessMap: HAS_ROUGHNESSMAP,
35257
35361
  anisotropy: HAS_ANISOTROPY,
@@ -35305,6 +35409,7 @@ function WebGLPrograms(renderer, environments, extensions2, capabilities, bindin
35305
35409
  alphaMapUv: HAS_ALPHAMAP && getChannel2(material.alphaMap.channel),
35306
35410
  //
35307
35411
  vertexTangents: !!geometry.attributes.tangent && (HAS_NORMALMAP || HAS_ANISOTROPY),
35412
+ vertexNormals: !!geometry.attributes.normal,
35308
35413
  vertexColors: material.vertexColors,
35309
35414
  vertexAlphas: material.vertexColors === true && !!geometry.attributes.color && geometry.attributes.color.itemSize === 4,
35310
35415
  pointsUvs: object.isPoints === true && !!geometry.attributes.uv && (HAS_MAP || HAS_ALPHAMAP),
@@ -35332,6 +35437,7 @@ function WebGLPrograms(renderer, environments, extensions2, capabilities, bindin
35332
35437
  numSpotLightShadows: lights.spotShadowMap.length,
35333
35438
  numSpotLightShadowsWithMaps: lights.numSpotLightShadowsWithMaps,
35334
35439
  numLightProbes: lights.numLightProbes,
35440
+ numLightProbeGrids: lightProbeGrids.length,
35335
35441
  numClippingPlanes: clipping.numPlanes,
35336
35442
  numClipIntersection: clipping.numIntersection,
35337
35443
  dithering: material.dithering,
@@ -35475,6 +35581,10 @@ function WebGLPrograms(renderer, environments, extensions2, capabilities, bindin
35475
35581
  _programLayers.enable(20);
35476
35582
  if (parameters.gradientMap)
35477
35583
  _programLayers.enable(21);
35584
+ if (parameters.packedNormalMap)
35585
+ _programLayers.enable(22);
35586
+ if (parameters.vertexNormals)
35587
+ _programLayers.enable(23);
35478
35588
  array.push(_programLayers.mask);
35479
35589
  _programLayers.disableAll();
35480
35590
  if (parameters.fog)
@@ -35521,6 +35631,8 @@ function WebGLPrograms(renderer, environments, extensions2, capabilities, bindin
35521
35631
  _programLayers.enable(20);
35522
35632
  if (parameters.alphaToCoverage)
35523
35633
  _programLayers.enable(21);
35634
+ if (parameters.numLightProbeGrids > 0)
35635
+ _programLayers.enable(22);
35524
35636
  array.push(_programLayers.mask);
35525
35637
  }
35526
35638
  function getUniforms(material) {
@@ -36119,10 +36231,12 @@ function WebGLRenderState(extensions2) {
36119
36231
  const lights = new WebGLLights(extensions2);
36120
36232
  const lightsArray = [];
36121
36233
  const shadowsArray = [];
36234
+ const lightProbeGridArray = [];
36122
36235
  function init(camera) {
36123
36236
  state2.camera = camera;
36124
36237
  lightsArray.length = 0;
36125
36238
  shadowsArray.length = 0;
36239
+ lightProbeGridArray.length = 0;
36126
36240
  }
36127
36241
  function pushLight(light) {
36128
36242
  lightsArray.push(light);
@@ -36130,6 +36244,9 @@ function WebGLRenderState(extensions2) {
36130
36244
  function pushShadow(shadowLight) {
36131
36245
  shadowsArray.push(shadowLight);
36132
36246
  }
36247
+ function pushLightProbeGrid(volume) {
36248
+ lightProbeGridArray.push(volume);
36249
+ }
36133
36250
  function setupLights() {
36134
36251
  lights.setup(lightsArray);
36135
36252
  }
@@ -36139,9 +36256,11 @@ function WebGLRenderState(extensions2) {
36139
36256
  const state2 = {
36140
36257
  lightsArray,
36141
36258
  shadowsArray,
36259
+ lightProbeGridArray,
36142
36260
  camera: null,
36143
36261
  lights,
36144
- transmissionRenderTarget: {}
36262
+ transmissionRenderTarget: {},
36263
+ textureUnits: 0
36145
36264
  };
36146
36265
  return {
36147
36266
  init,
@@ -36149,7 +36268,8 @@ function WebGLRenderState(extensions2) {
36149
36268
  setupLights,
36150
36269
  setupLightsView,
36151
36270
  pushLight,
36152
- pushShadow
36271
+ pushShadow,
36272
+ pushLightProbeGrid
36153
36273
  };
36154
36274
  }
36155
36275
  function WebGLRenderStates(extensions2) {
@@ -36688,6 +36808,7 @@ function WebGLState(gl, extensions2) {
36688
36808
  const uboBindings = /* @__PURE__ */ new WeakMap();
36689
36809
  const uboProgramMap = /* @__PURE__ */ new WeakMap();
36690
36810
  let enabledCapabilities = {};
36811
+ let parameters = {};
36691
36812
  let currentBoundFramebuffers = {};
36692
36813
  let currentDrawbuffers = /* @__PURE__ */ new WeakMap();
36693
36814
  let defaultDrawbuffers = [];
@@ -37112,6 +37233,19 @@ function WebGLState(gl, extensions2) {
37112
37233
  error("WebGLState:", e2);
37113
37234
  }
37114
37235
  }
37236
+ function getParameter(name) {
37237
+ if (parameters[name] !== void 0) {
37238
+ return parameters[name];
37239
+ } else {
37240
+ return gl.getParameter(name);
37241
+ }
37242
+ }
37243
+ function pixelStorei(name, value) {
37244
+ if (parameters[name] !== value) {
37245
+ gl.pixelStorei(name, value);
37246
+ parameters[name] = value;
37247
+ }
37248
+ }
37115
37249
  function scissor(scissor2) {
37116
37250
  if (currentScissor.equals(scissor2) === false) {
37117
37251
  gl.scissor(scissor2.x, scissor2.y, scissor2.z, scissor2.w);
@@ -37177,7 +37311,21 @@ function WebGLState(gl, extensions2) {
37177
37311
  gl.lineWidth(1);
37178
37312
  gl.scissor(0, 0, gl.canvas.width, gl.canvas.height);
37179
37313
  gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);
37314
+ gl.pixelStorei(gl.PACK_ALIGNMENT, 4);
37315
+ gl.pixelStorei(gl.UNPACK_ALIGNMENT, 4);
37316
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
37317
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
37318
+ gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.BROWSER_DEFAULT_WEBGL);
37319
+ gl.pixelStorei(gl.PACK_ROW_LENGTH, 0);
37320
+ gl.pixelStorei(gl.PACK_SKIP_PIXELS, 0);
37321
+ gl.pixelStorei(gl.PACK_SKIP_ROWS, 0);
37322
+ gl.pixelStorei(gl.UNPACK_ROW_LENGTH, 0);
37323
+ gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, 0);
37324
+ gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, 0);
37325
+ gl.pixelStorei(gl.UNPACK_SKIP_ROWS, 0);
37326
+ gl.pixelStorei(gl.UNPACK_SKIP_IMAGES, 0);
37180
37327
  enabledCapabilities = {};
37328
+ parameters = {};
37181
37329
  currentTextureSlot = null;
37182
37330
  currentBoundTextures = {};
37183
37331
  currentBoundFramebuffers = {};
@@ -37231,6 +37379,8 @@ function WebGLState(gl, extensions2) {
37231
37379
  compressedTexImage3D,
37232
37380
  texImage2D,
37233
37381
  texImage3D,
37382
+ pixelStorei,
37383
+ getParameter,
37234
37384
  updateUBOMapping,
37235
37385
  uniformBlockBinding,
37236
37386
  texStorage2D,
@@ -37249,6 +37399,7 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37249
37399
  const supportsInvalidateFramebuffer = typeof navigator === "undefined" ? false : /OculusBrowser/g.test(navigator.userAgent);
37250
37400
  const _imageDimensions = new Vector2();
37251
37401
  const _videoTextures = /* @__PURE__ */ new WeakMap();
37402
+ const _htmlTextures = /* @__PURE__ */ new Set();
37252
37403
  let _canvas2;
37253
37404
  const _sources = /* @__PURE__ */ new WeakMap();
37254
37405
  let useOffscreenCanvas = false;
@@ -37298,16 +37449,25 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37298
37449
  if (texture.isWebGLArrayRenderTarget || texture.isCompressedArrayTexture) return _gl.TEXTURE_2D_ARRAY;
37299
37450
  return _gl.TEXTURE_2D;
37300
37451
  }
37301
- function getInternalFormat(internalFormatName, glFormat, glType, colorSpace, forceLinearTransfer = false) {
37452
+ function getInternalFormat(internalFormatName, glFormat, glType, normalized, colorSpace, forceLinearTransfer = false) {
37302
37453
  if (internalFormatName !== null) {
37303
37454
  if (_gl[internalFormatName] !== void 0) return _gl[internalFormatName];
37304
37455
  warn("WebGLRenderer: Attempt to use non-existing WebGL internal format '" + internalFormatName + "'");
37305
37456
  }
37457
+ let ext_texture_norm16;
37458
+ if (normalized) {
37459
+ ext_texture_norm16 = extensions2.get("EXT_texture_norm16");
37460
+ if (!ext_texture_norm16) {
37461
+ warn("WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension");
37462
+ }
37463
+ }
37306
37464
  let internalFormat = glFormat;
37307
37465
  if (glFormat === _gl.RED) {
37308
37466
  if (glType === _gl.FLOAT) internalFormat = _gl.R32F;
37309
37467
  if (glType === _gl.HALF_FLOAT) internalFormat = _gl.R16F;
37310
37468
  if (glType === _gl.UNSIGNED_BYTE) internalFormat = _gl.R8;
37469
+ if (glType === _gl.UNSIGNED_SHORT && ext_texture_norm16) internalFormat = ext_texture_norm16.R16_EXT;
37470
+ if (glType === _gl.SHORT && ext_texture_norm16) internalFormat = ext_texture_norm16.R16_SNORM_EXT;
37311
37471
  }
37312
37472
  if (glFormat === _gl.RED_INTEGER) {
37313
37473
  if (glType === _gl.UNSIGNED_BYTE) internalFormat = _gl.R8UI;
@@ -37321,6 +37481,8 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37321
37481
  if (glType === _gl.FLOAT) internalFormat = _gl.RG32F;
37322
37482
  if (glType === _gl.HALF_FLOAT) internalFormat = _gl.RG16F;
37323
37483
  if (glType === _gl.UNSIGNED_BYTE) internalFormat = _gl.RG8;
37484
+ if (glType === _gl.UNSIGNED_SHORT && ext_texture_norm16) internalFormat = ext_texture_norm16.RG16_EXT;
37485
+ if (glType === _gl.SHORT && ext_texture_norm16) internalFormat = ext_texture_norm16.RG16_SNORM_EXT;
37324
37486
  }
37325
37487
  if (glFormat === _gl.RG_INTEGER) {
37326
37488
  if (glType === _gl.UNSIGNED_BYTE) internalFormat = _gl.RG8UI;
@@ -37347,6 +37509,8 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37347
37509
  if (glType === _gl.INT) internalFormat = _gl.RGBA32I;
37348
37510
  }
37349
37511
  if (glFormat === _gl.RGB) {
37512
+ if (glType === _gl.UNSIGNED_SHORT && ext_texture_norm16) internalFormat = ext_texture_norm16.RGB16_EXT;
37513
+ if (glType === _gl.SHORT && ext_texture_norm16) internalFormat = ext_texture_norm16.RGB16_SNORM_EXT;
37350
37514
  if (glType === _gl.UNSIGNED_INT_5_9_9_9_REV) internalFormat = _gl.RGB9_E5;
37351
37515
  if (glType === _gl.UNSIGNED_INT_10F_11F_11F_REV) internalFormat = _gl.R11F_G11F_B10F;
37352
37516
  }
@@ -37355,6 +37519,8 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37355
37519
  if (glType === _gl.FLOAT) internalFormat = _gl.RGBA32F;
37356
37520
  if (glType === _gl.HALF_FLOAT) internalFormat = _gl.RGBA16F;
37357
37521
  if (glType === _gl.UNSIGNED_BYTE) internalFormat = transfer === SRGBTransfer ? _gl.SRGB8_ALPHA8 : _gl.RGBA8;
37522
+ if (glType === _gl.UNSIGNED_SHORT && ext_texture_norm16) internalFormat = ext_texture_norm16.RGBA16_EXT;
37523
+ if (glType === _gl.SHORT && ext_texture_norm16) internalFormat = ext_texture_norm16.RGBA16_SNORM_EXT;
37358
37524
  if (glType === _gl.UNSIGNED_SHORT_4_4_4_4) internalFormat = _gl.RGBA4;
37359
37525
  if (glType === _gl.UNSIGNED_SHORT_5_5_5_1) internalFormat = _gl.RGB5_A1;
37360
37526
  }
@@ -37403,6 +37569,9 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37403
37569
  if (texture.isVideoTexture) {
37404
37570
  _videoTextures.delete(texture);
37405
37571
  }
37572
+ if (texture.isHTMLTexture) {
37573
+ _htmlTextures.delete(texture);
37574
+ }
37406
37575
  }
37407
37576
  function onRenderTargetDispose(event) {
37408
37577
  const renderTarget2 = event.target;
@@ -37479,6 +37648,12 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37479
37648
  function resetTextureUnits() {
37480
37649
  textureUnits = 0;
37481
37650
  }
37651
+ function getTextureUnits() {
37652
+ return textureUnits;
37653
+ }
37654
+ function setTextureUnits(value) {
37655
+ textureUnits = value;
37656
+ }
37482
37657
  function allocateTextureUnit() {
37483
37658
  const textureUnit = textureUnits;
37484
37659
  if (textureUnit >= capabilities.maxTextures) {
@@ -37661,10 +37836,10 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37661
37836
  }
37662
37837
  }
37663
37838
  updateRanges.length = mergeIndex + 1;
37664
- const currentUnpackRowLen = _gl.getParameter(_gl.UNPACK_ROW_LENGTH);
37665
- const currentUnpackSkipPixels = _gl.getParameter(_gl.UNPACK_SKIP_PIXELS);
37666
- const currentUnpackSkipRows = _gl.getParameter(_gl.UNPACK_SKIP_ROWS);
37667
- _gl.pixelStorei(_gl.UNPACK_ROW_LENGTH, image.width);
37839
+ const currentUnpackRowLen = state2.getParameter(_gl.UNPACK_ROW_LENGTH);
37840
+ const currentUnpackSkipPixels = state2.getParameter(_gl.UNPACK_SKIP_PIXELS);
37841
+ const currentUnpackSkipRows = state2.getParameter(_gl.UNPACK_SKIP_ROWS);
37842
+ state2.pixelStorei(_gl.UNPACK_ROW_LENGTH, image.width);
37668
37843
  for (let i3 = 0, l2 = updateRanges.length; i3 < l2; i3++) {
37669
37844
  const range = updateRanges[i3];
37670
37845
  const pixelStart = Math.floor(range.start / componentStride);
@@ -37673,14 +37848,14 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37673
37848
  const y = Math.floor(pixelStart / image.width);
37674
37849
  const width = pixelCount;
37675
37850
  const height = 1;
37676
- _gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS, x2);
37677
- _gl.pixelStorei(_gl.UNPACK_SKIP_ROWS, y);
37851
+ state2.pixelStorei(_gl.UNPACK_SKIP_PIXELS, x2);
37852
+ state2.pixelStorei(_gl.UNPACK_SKIP_ROWS, y);
37678
37853
  state2.texSubImage2D(_gl.TEXTURE_2D, 0, x2, y, width, height, glFormat, glType, image.data);
37679
37854
  }
37680
37855
  texture.clearUpdateRanges();
37681
- _gl.pixelStorei(_gl.UNPACK_ROW_LENGTH, currentUnpackRowLen);
37682
- _gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS, currentUnpackSkipPixels);
37683
- _gl.pixelStorei(_gl.UNPACK_SKIP_ROWS, currentUnpackSkipRows);
37856
+ state2.pixelStorei(_gl.UNPACK_ROW_LENGTH, currentUnpackRowLen);
37857
+ state2.pixelStorei(_gl.UNPACK_SKIP_PIXELS, currentUnpackSkipPixels);
37858
+ state2.pixelStorei(_gl.UNPACK_SKIP_ROWS, currentUnpackSkipRows);
37684
37859
  }
37685
37860
  }
37686
37861
  function uploadTexture(textureProperties, texture, slot) {
@@ -37693,18 +37868,21 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37693
37868
  const sourceProperties = properties.get(source);
37694
37869
  if (source.version !== sourceProperties.__version || forceUpload === true) {
37695
37870
  state2.activeTexture(_gl.TEXTURE0 + slot);
37696
- const workingPrimaries = ColorManagement.getPrimaries(ColorManagement.workingColorSpace);
37697
- const texturePrimaries = texture.colorSpace === NoColorSpace ? null : ColorManagement.getPrimaries(texture.colorSpace);
37698
- const unpackConversion = texture.colorSpace === NoColorSpace || workingPrimaries === texturePrimaries ? _gl.NONE : _gl.BROWSER_DEFAULT_WEBGL;
37699
- _gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, texture.flipY);
37700
- _gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha);
37701
- _gl.pixelStorei(_gl.UNPACK_ALIGNMENT, texture.unpackAlignment);
37702
- _gl.pixelStorei(_gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, unpackConversion);
37871
+ const isImageBitmap = typeof ImageBitmap !== "undefined" && texture.image instanceof ImageBitmap;
37872
+ if (isImageBitmap === false) {
37873
+ const workingPrimaries = ColorManagement.getPrimaries(ColorManagement.workingColorSpace);
37874
+ const texturePrimaries = texture.colorSpace === NoColorSpace ? null : ColorManagement.getPrimaries(texture.colorSpace);
37875
+ const unpackConversion = texture.colorSpace === NoColorSpace || workingPrimaries === texturePrimaries ? _gl.NONE : _gl.BROWSER_DEFAULT_WEBGL;
37876
+ state2.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, texture.flipY);
37877
+ state2.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha);
37878
+ state2.pixelStorei(_gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, unpackConversion);
37879
+ }
37880
+ state2.pixelStorei(_gl.UNPACK_ALIGNMENT, texture.unpackAlignment);
37703
37881
  let image = resizeImage(texture.image, false, capabilities.maxTextureSize);
37704
37882
  image = verifyColorSpace(texture, image);
37705
37883
  const glFormat = utils.convert(texture.format, texture.colorSpace);
37706
37884
  const glType = utils.convert(texture.type);
37707
- let glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.colorSpace, texture.isVideoTexture);
37885
+ let glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.normalized, texture.colorSpace, texture.isVideoTexture);
37708
37886
  setTextureParameters(textureType, texture);
37709
37887
  let mipmap;
37710
37888
  const mipmaps = texture.mipmaps;
@@ -37866,6 +38044,35 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37866
38044
  }
37867
38045
  }
37868
38046
  }
38047
+ } else if (texture.isHTMLTexture) {
38048
+ if ("texElementImage2D" in _gl) {
38049
+ const canvas = _gl.canvas;
38050
+ if (!canvas.hasAttribute("layoutsubtree")) {
38051
+ canvas.setAttribute("layoutsubtree", "true");
38052
+ }
38053
+ if (image.parentNode !== canvas) {
38054
+ canvas.appendChild(image);
38055
+ _htmlTextures.add(texture);
38056
+ canvas.onpaint = (event) => {
38057
+ const changed = event.changedElements;
38058
+ for (const t2 of _htmlTextures) {
38059
+ if (changed.includes(t2.image)) {
38060
+ t2.needsUpdate = true;
38061
+ }
38062
+ }
38063
+ };
38064
+ canvas.requestPaint();
38065
+ return;
38066
+ }
38067
+ const level = 0;
38068
+ const internalFormat = _gl.RGBA;
38069
+ const srcFormat = _gl.RGBA;
38070
+ const srcType = _gl.UNSIGNED_BYTE;
38071
+ _gl.texElementImage2D(_gl.TEXTURE_2D, level, internalFormat, srcFormat, srcType, image);
38072
+ _gl.texParameteri(_gl.TEXTURE_2D, _gl.TEXTURE_MIN_FILTER, _gl.LINEAR);
38073
+ _gl.texParameteri(_gl.TEXTURE_2D, _gl.TEXTURE_WRAP_S, _gl.CLAMP_TO_EDGE);
38074
+ _gl.texParameteri(_gl.TEXTURE_2D, _gl.TEXTURE_WRAP_T, _gl.CLAMP_TO_EDGE);
38075
+ }
37869
38076
  } else {
37870
38077
  if (mipmaps.length > 0) {
37871
38078
  if (useTexStorage && allocateMemory) {
@@ -37916,10 +38123,10 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37916
38123
  const workingPrimaries = ColorManagement.getPrimaries(ColorManagement.workingColorSpace);
37917
38124
  const texturePrimaries = texture.colorSpace === NoColorSpace ? null : ColorManagement.getPrimaries(texture.colorSpace);
37918
38125
  const unpackConversion = texture.colorSpace === NoColorSpace || workingPrimaries === texturePrimaries ? _gl.NONE : _gl.BROWSER_DEFAULT_WEBGL;
37919
- _gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, texture.flipY);
37920
- _gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha);
37921
- _gl.pixelStorei(_gl.UNPACK_ALIGNMENT, texture.unpackAlignment);
37922
- _gl.pixelStorei(_gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, unpackConversion);
38126
+ state2.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, texture.flipY);
38127
+ state2.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha);
38128
+ state2.pixelStorei(_gl.UNPACK_ALIGNMENT, texture.unpackAlignment);
38129
+ state2.pixelStorei(_gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, unpackConversion);
37923
38130
  const isCompressed = texture.isCompressedTexture || texture.image[0].isCompressedTexture;
37924
38131
  const isDataTexture = texture.image[0] && texture.image[0].isDataTexture;
37925
38132
  const cubeImage = [];
@@ -37931,7 +38138,7 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37931
38138
  }
37932
38139
  cubeImage[i3] = verifyColorSpace(texture, cubeImage[i3]);
37933
38140
  }
37934
- const image = cubeImage[0], glFormat = utils.convert(texture.format, texture.colorSpace), glType = utils.convert(texture.type), glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.colorSpace);
38141
+ const image = cubeImage[0], glFormat = utils.convert(texture.format, texture.colorSpace), glType = utils.convert(texture.type), glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.normalized, texture.colorSpace);
37935
38142
  const useTexStorage = texture.isVideoTexture !== true;
37936
38143
  const allocateMemory = sourceProperties.__version === void 0 || forceUpload === true;
37937
38144
  const dataReady = source.dataReady;
@@ -38028,7 +38235,7 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
38028
38235
  function setupFrameBufferTexture(framebuffer, renderTarget2, texture, attachment, textureTarget, level) {
38029
38236
  const glFormat = utils.convert(texture.format, texture.colorSpace);
38030
38237
  const glType = utils.convert(texture.type);
38031
- const glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.colorSpace);
38238
+ const glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.normalized, texture.colorSpace);
38032
38239
  const renderTargetProperties = properties.get(renderTarget2);
38033
38240
  const textureProperties = properties.get(texture);
38034
38241
  textureProperties.__renderTarget = renderTarget2;
@@ -38070,7 +38277,7 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
38070
38277
  const texture = textures[i3];
38071
38278
  const glFormat = utils.convert(texture.format, texture.colorSpace);
38072
38279
  const glType = utils.convert(texture.type);
38073
- const glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.colorSpace);
38280
+ const glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.normalized, texture.colorSpace);
38074
38281
  if (useMultisampledRTT(renderTarget2)) {
38075
38282
  multisampledRTTExt.renderbufferStorageMultisampleEXT(_gl.RENDERBUFFER, getRenderTargetSamples(renderTarget2), glInternalFormat, renderTarget2.width, renderTarget2.height);
38076
38283
  } else if (useMultisample) {
@@ -38270,7 +38477,7 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
38270
38477
  _gl.bindRenderbuffer(_gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[i3]);
38271
38478
  const glFormat = utils.convert(texture2.format, texture2.colorSpace);
38272
38479
  const glType = utils.convert(texture2.type);
38273
- const glInternalFormat = getInternalFormat(texture2.internalFormat, glFormat, glType, texture2.colorSpace, renderTarget2.isXRRenderTarget === true);
38480
+ const glInternalFormat = getInternalFormat(texture2.internalFormat, glFormat, glType, texture2.normalized, texture2.colorSpace, renderTarget2.isXRRenderTarget === true);
38274
38481
  const samples = getRenderTargetSamples(renderTarget2);
38275
38482
  _gl.renderbufferStorageMultisample(_gl.RENDERBUFFER, samples, glInternalFormat, renderTarget2.width, renderTarget2.height);
38276
38483
  _gl.framebufferRenderbuffer(_gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i3, _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[i3]);
@@ -38466,6 +38673,8 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
38466
38673
  }
38467
38674
  this.allocateTextureUnit = allocateTextureUnit;
38468
38675
  this.resetTextureUnits = resetTextureUnits;
38676
+ this.getTextureUnits = getTextureUnits;
38677
+ this.setTextureUnits = setTextureUnits;
38469
38678
  this.setTexture2D = setTexture2D;
38470
38679
  this.setTexture2DArray = setTexture2DArray;
38471
38680
  this.setTexture3D = setTexture3D;
@@ -38618,7 +38827,9 @@ function WebGLMaterials(renderer, properties) {
38618
38827
  }
38619
38828
  }
38620
38829
  function refreshMaterialUniforms(uniforms, material, pixelRatio, height, transmissionRenderTarget) {
38621
- if (material.isMeshBasicMaterial) {
38830
+ if (material.isNodeMaterial) {
38831
+ material.uniformsNeedUpdate = false;
38832
+ } else if (material.isMeshBasicMaterial) {
38622
38833
  refreshUniformsCommon(uniforms, material);
38623
38834
  } else if (material.isMeshLambertMaterial) {
38624
38835
  refreshUniformsCommon(uniforms, material);
@@ -38720,16 +38931,10 @@ function WebGLMaterials(renderer, properties) {
38720
38931
  const envMapRotation = materialProperties.envMapRotation;
38721
38932
  if (envMap) {
38722
38933
  uniforms.envMap.value = envMap;
38723
- _e1.copy(envMapRotation);
38724
- _e1.x *= -1;
38725
- _e1.y *= -1;
38726
- _e1.z *= -1;
38934
+ uniforms.envMapRotation.value.setFromMatrix4(_m12.makeRotationFromEuler(envMapRotation)).transpose();
38727
38935
  if (envMap.isCubeTexture && envMap.isRenderTargetTexture === false) {
38728
- _e1.y *= -1;
38729
- _e1.z *= -1;
38936
+ uniforms.envMapRotation.value.premultiply(_m);
38730
38937
  }
38731
- uniforms.envMapRotation.value.setFromMatrix4(_m12.makeRotationFromEuler(_e1));
38732
- uniforms.flipEnvMap.value = envMap.isCubeTexture && envMap.isRenderTargetTexture === false ? -1 : 1;
38733
38938
  uniforms.reflectivity.value = material.reflectivity;
38734
38939
  uniforms.ior.value = material.ior;
38735
38940
  uniforms.refractionRatio.value = material.refractionRatio;
@@ -38995,6 +39200,8 @@ function WebGLUniformsGroups(gl, info, capabilities, state2) {
38995
39200
  uniform.__data[9] = value.elements[7];
38996
39201
  uniform.__data[10] = value.elements[8];
38997
39202
  uniform.__data[11] = 0;
39203
+ } else if (ArrayBuffer.isView(value)) {
39204
+ uniform.__data.set(new value.constructor(value.buffer, value.byteOffset, uniform.__data.length));
38998
39205
  } else {
38999
39206
  value.toArray(uniform.__data, arrayOffset);
39000
39207
  arrayOffset += info2.storage / Float32Array.BYTES_PER_ELEMENT;
@@ -39012,6 +39219,8 @@ function WebGLUniformsGroups(gl, info, capabilities, state2) {
39012
39219
  if (cache[indexString] === void 0) {
39013
39220
  if (typeof value === "number" || typeof value === "boolean") {
39014
39221
  cache[indexString] = value;
39222
+ } else if (ArrayBuffer.isView(value)) {
39223
+ cache[indexString] = value.slice();
39015
39224
  } else {
39016
39225
  cache[indexString] = value.clone();
39017
39226
  }
@@ -39023,6 +39232,8 @@ function WebGLUniformsGroups(gl, info, capabilities, state2) {
39023
39232
  cache[indexString] = value;
39024
39233
  return true;
39025
39234
  }
39235
+ } else if (ArrayBuffer.isView(value)) {
39236
+ return true;
39026
39237
  } else {
39027
39238
  if (cachedObject.equals(value) === false) {
39028
39239
  cachedObject.copy(value);
@@ -39090,6 +39301,9 @@ function WebGLUniformsGroups(gl, info, capabilities, state2) {
39090
39301
  info2.storage = 64;
39091
39302
  } else if (value.isTexture) {
39092
39303
  warn("WebGLRenderer: Texture samplers can not be part of an uniforms group.");
39304
+ } else if (ArrayBuffer.isView(value)) {
39305
+ info2.boundary = 16;
39306
+ info2.storage = value.byteLength;
39093
39307
  } else {
39094
39308
  warn("WebGLRenderer: Unsupported uniform value type.", value);
39095
39309
  }
@@ -39131,9 +39345,9 @@ function getDFGLUT() {
39131
39345
  }
39132
39346
  return lut;
39133
39347
  }
39134
- var alphahash_fragment, alphahash_pars_fragment, alphamap_fragment, alphamap_pars_fragment, alphatest_fragment, alphatest_pars_fragment, aomap_fragment, aomap_pars_fragment, batching_pars_vertex, batching_vertex, begin_vertex, beginnormal_vertex, bsdfs, iridescence_fragment, bumpmap_pars_fragment, clipping_planes_fragment, clipping_planes_pars_fragment, clipping_planes_pars_vertex, clipping_planes_vertex, color_fragment, color_pars_fragment, color_pars_vertex, color_vertex, common, cube_uv_reflection_fragment, defaultnormal_vertex, displacementmap_pars_vertex, displacementmap_vertex, emissivemap_fragment, emissivemap_pars_fragment, colorspace_fragment, colorspace_pars_fragment, envmap_fragment, envmap_common_pars_fragment, envmap_pars_fragment, envmap_pars_vertex, envmap_vertex, fog_vertex, fog_pars_vertex, fog_fragment, fog_pars_fragment, gradientmap_pars_fragment, lightmap_pars_fragment, lights_lambert_fragment, lights_lambert_pars_fragment, lights_pars_begin, envmap_physical_pars_fragment, lights_toon_fragment, lights_toon_pars_fragment, lights_phong_fragment, lights_phong_pars_fragment, lights_physical_fragment, lights_physical_pars_fragment, lights_fragment_begin, lights_fragment_maps, lights_fragment_end, logdepthbuf_fragment, logdepthbuf_pars_fragment, logdepthbuf_pars_vertex, logdepthbuf_vertex, map_fragment, map_pars_fragment, map_particle_fragment, map_particle_pars_fragment, metalnessmap_fragment, metalnessmap_pars_fragment, morphinstance_vertex, morphcolor_vertex, morphnormal_vertex, morphtarget_pars_vertex, morphtarget_vertex, normal_fragment_begin, normal_fragment_maps, normal_pars_fragment, normal_pars_vertex, normal_vertex, normalmap_pars_fragment, clearcoat_normal_fragment_begin, clearcoat_normal_fragment_maps, clearcoat_pars_fragment, iridescence_pars_fragment, opaque_fragment, packing, premultiplied_alpha_fragment, project_vertex, dithering_fragment, dithering_pars_fragment, roughnessmap_fragment, roughnessmap_pars_fragment, shadowmap_pars_fragment, shadowmap_pars_vertex, shadowmap_vertex, shadowmask_pars_fragment, skinbase_vertex, skinning_pars_vertex, skinning_vertex, skinnormal_vertex, specularmap_fragment, specularmap_pars_fragment, tonemapping_fragment, tonemapping_pars_fragment, transmission_fragment, transmission_pars_fragment, uv_pars_fragment, uv_pars_vertex, uv_vertex, worldpos_vertex, vertex$h, fragment$h, vertex$g, fragment$g, vertex$f, fragment$f, vertex$e, fragment$e, vertex$d, fragment$d, vertex$c, fragment$c, vertex$b, fragment$b, vertex$a, fragment$a, vertex$9, fragment$9, vertex$8, fragment$8, vertex$7, fragment$7, vertex$6, fragment$6, vertex$5, fragment$5, vertex$4, fragment$4, vertex$3, fragment$3, vertex$2, fragment$2, vertex$1, fragment$1, ShaderChunk, UniformsLib, ShaderLib, _rgb, _e1$1, _m1$12, LOD_MIN, EXTRA_LOD_SIGMA, MAX_SAMPLES, GGX_SAMPLES, _flatCamera, _clearColor, _oldTarget, _oldActiveCubeFace, _oldActiveMipmapLevel, _oldXrEnabled, _origin, PMREMGenerator, WebGLCubeRenderTarget, toneMappingMap, emptyTexture, emptyShadowTexture, emptyArrayTexture, empty3dTexture, emptyCubeTexture, arrayCacheF32, arrayCacheI32, mat4array, mat3array, mat2array, SingleUniform, PureArrayUniform, StructuredUniform, RePathPart, WebGLUniforms, COMPLETION_STATUS_KHR, programIdCount, _m0, toneMappingFunctions, _v02, includePattern, shaderChunkMap, unrollLoopPattern, shadowMapTypeDefines, envMapTypeDefines, envMapModeDefines, envMapBlendingDefines, _id2, WebGLShaderCache, WebGLShaderStage, nextVersion, vertex, fragment, _cubeDirections, _cubeUps, _projScreenMatrix2, _lightPositionWorld2, _lookTarget2, _occlusion_vertex, _occlusion_fragment, WebXRDepthSensing, WebXRManager, _e1, _m12, DATA, lut, WebGLRenderer;
39348
+ var alphahash_fragment, alphahash_pars_fragment, alphamap_fragment, alphamap_pars_fragment, alphatest_fragment, alphatest_pars_fragment, aomap_fragment, aomap_pars_fragment, batching_pars_vertex, batching_vertex, begin_vertex, beginnormal_vertex, bsdfs, iridescence_fragment, bumpmap_pars_fragment, clipping_planes_fragment, clipping_planes_pars_fragment, clipping_planes_pars_vertex, clipping_planes_vertex, color_fragment, color_pars_fragment, color_pars_vertex, color_vertex, common, cube_uv_reflection_fragment, defaultnormal_vertex, displacementmap_pars_vertex, displacementmap_vertex, emissivemap_fragment, emissivemap_pars_fragment, colorspace_fragment, colorspace_pars_fragment, envmap_fragment, envmap_common_pars_fragment, envmap_pars_fragment, envmap_pars_vertex, envmap_vertex, fog_vertex, fog_pars_vertex, fog_fragment, fog_pars_fragment, gradientmap_pars_fragment, lightmap_pars_fragment, lights_lambert_fragment, lights_lambert_pars_fragment, lights_pars_begin, envmap_physical_pars_fragment, lights_toon_fragment, lights_toon_pars_fragment, lights_phong_fragment, lights_phong_pars_fragment, lights_physical_fragment, lights_physical_pars_fragment, lights_fragment_begin, lights_fragment_maps, lights_fragment_end, lightprobes_pars_fragment, logdepthbuf_fragment, logdepthbuf_pars_fragment, logdepthbuf_pars_vertex, logdepthbuf_vertex, map_fragment, map_pars_fragment, map_particle_fragment, map_particle_pars_fragment, metalnessmap_fragment, metalnessmap_pars_fragment, morphinstance_vertex, morphcolor_vertex, morphnormal_vertex, morphtarget_pars_vertex, morphtarget_vertex, normal_fragment_begin, normal_fragment_maps, normal_pars_fragment, normal_pars_vertex, normal_vertex, normalmap_pars_fragment, clearcoat_normal_fragment_begin, clearcoat_normal_fragment_maps, clearcoat_pars_fragment, iridescence_pars_fragment, opaque_fragment, packing, premultiplied_alpha_fragment, project_vertex, dithering_fragment, dithering_pars_fragment, roughnessmap_fragment, roughnessmap_pars_fragment, shadowmap_pars_fragment, shadowmap_pars_vertex, shadowmap_vertex, shadowmask_pars_fragment, skinbase_vertex, skinning_pars_vertex, skinning_vertex, skinnormal_vertex, specularmap_fragment, specularmap_pars_fragment, tonemapping_fragment, tonemapping_pars_fragment, transmission_fragment, transmission_pars_fragment, uv_pars_fragment, uv_pars_vertex, uv_vertex, worldpos_vertex, vertex$h, fragment$h, vertex$g, fragment$g, vertex$f, fragment$f, vertex$e, fragment$e, vertex$d, fragment$d, vertex$c, fragment$c, vertex$b, fragment$b, vertex$a, fragment$a, vertex$9, fragment$9, vertex$8, fragment$8, vertex$7, fragment$7, vertex$6, fragment$6, vertex$5, fragment$5, vertex$4, fragment$4, vertex$3, fragment$3, vertex$2, fragment$2, vertex$1, fragment$1, ShaderChunk, UniformsLib, ShaderLib, _rgb, _m1$12, _m$1, LOD_MIN, EXTRA_LOD_SIGMA, MAX_SAMPLES, GGX_SAMPLES, _flatCamera, _clearColor, _oldTarget, _oldActiveCubeFace, _oldActiveMipmapLevel, _oldXrEnabled, _origin, PMREMGenerator, WebGLCubeRenderTarget, toneMappingMap, emptyTexture, emptyShadowTexture, emptyArrayTexture, empty3dTexture, emptyCubeTexture, arrayCacheF32, arrayCacheI32, mat4array, mat3array, mat2array, SingleUniform, PureArrayUniform, StructuredUniform, RePathPart, WebGLUniforms, COMPLETION_STATUS_KHR, programIdCount, _m0, toneMappingFunctions, _v02, includePattern, shaderChunkMap, unrollLoopPattern, shadowMapTypeDefines, envMapTypeDefines, envMapModeDefines, envMapBlendingDefines, _id2, WebGLShaderCache, WebGLShaderStage, nextVersion, vertex, fragment, _cubeDirections, _cubeUps, _projScreenMatrix2, _lightPositionWorld2, _lookTarget2, _occlusion_vertex, _occlusion_fragment, WebXRDepthSensing, WebXRManager, _m12, _m, DATA, lut, WebGLRenderer;
39135
39349
  var init_three_module = __esm({
39136
- "../../node_modules/.bun/three@0.183.2/node_modules/three/build/three.module.js"() {
39350
+ "../../node_modules/.bun/three@0.184.0/node_modules/three/build/three.module.js"() {
39137
39351
  init_three_core();
39138
39352
  init_three_core();
39139
39353
  alphahash_fragment = "#ifdef USE_ALPHAHASH\n if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif";
@@ -39168,8 +39382,8 @@ var init_three_module = __esm({
39168
39382
  emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif";
39169
39383
  colorspace_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );";
39170
39384
  colorspace_pars_fragment = "vec4 LinearTransferOETF( in vec4 value ) {\n return value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}";
39171
- envmap_fragment = "#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vec3 cameraToFrag;\n if ( isOrthographic ) {\n cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToFrag = normalize( vWorldPosition - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n #endif\n#endif";
39172
- envmap_common_pars_fragment = "#ifdef USE_ENVMAP\n uniform float envMapIntensity;\n uniform float flipEnvMap;\n uniform mat3 envMapRotation;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n#endif";
39385
+ envmap_fragment = "#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vec3 cameraToFrag;\n if ( isOrthographic ) {\n cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToFrag = normalize( vWorldPosition - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, envMapRotation * reflectVec );\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n #endif\n#endif";
39386
+ envmap_common_pars_fragment = "#ifdef USE_ENVMAP\n uniform float envMapIntensity;\n uniform mat3 envMapRotation;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n#endif";
39173
39387
  envmap_pars_fragment = "#ifdef USE_ENVMAP\n uniform float reflectivity;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n varying vec3 vWorldPosition;\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif";
39174
39388
  envmap_pars_vertex = "#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n \n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif";
39175
39389
  envmap_vertex = "#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex;\n if ( isOrthographic ) {\n cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif";
@@ -39181,17 +39395,18 @@ var init_three_module = __esm({
39181
39395
  lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif";
39182
39396
  lights_lambert_fragment = "LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;";
39183
39397
  lights_lambert_pars_fragment = "varying vec3 vViewPosition;\nstruct LambertMaterial {\n vec3 diffuseColor;\n float specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Lambert\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert";
39184
- lights_pars_begin = "uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n uniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shCoefficients[ 0 ] * 0.886227;\n result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n return irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n if ( cutoffDistance > 0.0 ) {\n distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n }\n return distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n return smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n light.color = directionalLight.color;\n light.direction = directionalLight.direction;\n light.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = pointLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float lightDistance = length( lVector );\n light.color = pointLight.color;\n light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = spotLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float angleCos = dot( light.direction, spotLight.direction );\n float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n if ( spotAttenuation > 0.0 ) {\n float lightDistance = length( lVector );\n light.color = spotLight.color * spotAttenuation;\n light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n } else {\n light.color = vec3( 0.0 );\n light.visible = false;\n }\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1; uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n float dotNL = dot( normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n return irradiance;\n }\n#endif";
39398
+ lights_pars_begin = "uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n uniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shCoefficients[ 0 ] * 0.886227;\n result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n return irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n if ( cutoffDistance > 0.0 ) {\n distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n }\n return distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n return smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n light.color = directionalLight.color;\n light.direction = directionalLight.direction;\n light.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = pointLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float lightDistance = length( lVector );\n light.color = pointLight.color;\n light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = spotLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float angleCos = dot( light.direction, spotLight.direction );\n float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n if ( spotAttenuation > 0.0 ) {\n float lightDistance = length( lVector );\n light.color = spotLight.color * spotAttenuation;\n light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n } else {\n light.color = vec3( 0.0 );\n light.visible = false;\n }\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1; uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n float dotNL = dot( normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n return irradiance;\n }\n#endif\n#include <lightprobes_pars_fragment>";
39185
39399
  envmap_physical_pars_fragment = "#ifdef USE_ENVMAP\n vec3 getIBLIrradiance( const in vec3 normal ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n return PI * envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 reflectVec = reflect( - viewDir, normal );\n reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n return envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n #ifdef USE_ANISOTROPY\n vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 bentNormal = cross( bitangent, viewDir );\n bentNormal = normalize( cross( bentNormal, bitangent ) );\n bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n return getIBLRadiance( viewDir, bentNormal, roughness );\n #else\n return vec3( 0.0 );\n #endif\n }\n #endif\n#endif";
39186
39400
  lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;";
39187
39401
  lights_toon_pars_fragment = "varying vec3 vViewPosition;\nstruct ToonMaterial {\n vec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Toon\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon";
39188
39402
  lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;";
39189
39403
  lights_phong_pars_fragment = "varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong";
39190
39404
  lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.metalness = metalnessFactor;\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n material.ior = ior;\n #ifdef USE_SPECULAR\n float specularIntensityFactor = specularIntensity;\n vec3 specularColorFactor = specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n #endif\n material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n #else\n float specularIntensityFactor = 1.0;\n vec3 specularColorFactor = vec3( 1.0 );\n material.specularF90 = 1.0;\n #endif\n material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor;\n material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = vec3( 0.04 );\n material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );\n material.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n material.clearcoat = clearcoat;\n material.clearcoatRoughness = clearcoatRoughness;\n material.clearcoatF0 = vec3( 0.04 );\n material.clearcoatF90 = 1.0;\n #ifdef USE_CLEARCOATMAP\n material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n #endif\n #ifdef USE_CLEARCOAT_ROUGHNESSMAP\n material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n #endif\n material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n material.clearcoatRoughness += geometryRoughness;\n material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n material.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n material.iridescence = iridescence;\n material.iridescenceIOR = iridescenceIOR;\n #ifdef USE_IRIDESCENCEMAP\n material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n #endif\n #ifdef USE_IRIDESCENCE_THICKNESSMAP\n material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n #else\n material.iridescenceThickness = iridescenceThicknessMaximum;\n #endif\n#endif\n#ifdef USE_SHEEN\n material.sheenColor = sheenColor;\n #ifdef USE_SHEEN_COLORMAP\n material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n #endif\n material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 );\n #ifdef USE_SHEEN_ROUGHNESSMAP\n material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n #ifdef USE_ANISOTROPYMAP\n mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n #else\n vec2 anisotropyV = anisotropyVector;\n #endif\n material.anisotropy = length( anisotropyV );\n if( material.anisotropy == 0.0 ) {\n anisotropyV = vec2( 1.0, 0.0 );\n } else {\n anisotropyV /= material.anisotropy;\n material.anisotropy = saturate( material.anisotropy );\n }\n material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif";
39191
- lights_physical_pars_fragment = "uniform sampler2D dfgLUT;\nstruct PhysicalMaterial {\n vec3 diffuseColor;\n vec3 diffuseContribution;\n vec3 specularColor;\n vec3 specularColorBlended;\n float roughness;\n float metalness;\n float specularF90;\n float dispersion;\n #ifdef USE_CLEARCOAT\n float clearcoat;\n float clearcoatRoughness;\n vec3 clearcoatF0;\n float clearcoatF90;\n #endif\n #ifdef USE_IRIDESCENCE\n float iridescence;\n float iridescenceIOR;\n float iridescenceThickness;\n vec3 iridescenceFresnel;\n vec3 iridescenceF0;\n vec3 iridescenceFresnelDielectric;\n vec3 iridescenceFresnelMetallic;\n #endif\n #ifdef USE_SHEEN\n vec3 sheenColor;\n float sheenRoughness;\n #endif\n #ifdef IOR\n float ior;\n #endif\n #ifdef USE_TRANSMISSION\n float transmission;\n float transmissionAlpha;\n float thickness;\n float attenuationDistance;\n vec3 attenuationColor;\n #endif\n #ifdef USE_ANISOTROPY\n float anisotropy;\n float alphaT;\n vec3 anisotropyT;\n vec3 anisotropyB;\n #endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n float v = 0.5 / ( gv + gl );\n return v;\n }\n float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n float a2 = alphaT * alphaB;\n highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n highp float v2 = dot( v, v );\n float w2 = a2 / v2;\n return RECIPROCAL_PI * a2 * pow2 ( w2 );\n }\n#endif\n#ifdef USE_CLEARCOAT\n vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n vec3 f0 = material.clearcoatF0;\n float f90 = material.clearcoatF90;\n float roughness = material.clearcoatRoughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( V * D );\n }\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 f0 = material.specularColorBlended;\n float f90 = material.specularF90;\n float roughness = material.roughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n #ifdef USE_IRIDESCENCE\n F = mix( F, material.iridescenceFresnel, material.iridescence );\n #endif\n #ifdef USE_ANISOTROPY\n float dotTL = dot( material.anisotropyT, lightDir );\n float dotTV = dot( material.anisotropyT, viewDir );\n float dotTH = dot( material.anisotropyT, halfDir );\n float dotBL = dot( material.anisotropyB, lightDir );\n float dotBV = dot( material.anisotropyB, viewDir );\n float dotBH = dot( material.anisotropyB, halfDir );\n float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n #else\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n #endif\n return F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate( dot( N, V ) );\n vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n float l = length( f );\n return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n float x = dot( v1, v2 );\n float y = abs( x );\n float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n float b = 3.4175940 + ( 4.1616724 + y ) * y;\n float v = a / b;\n float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n vec3 lightNormal = cross( v1, v2 );\n if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 T1, T2;\n T1 = normalize( V - N * dot( V, N ) );\n T2 = - cross( N, T1 );\n mat3 mat = mInv * transpose( mat3( T1, T2, N ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorFormFactor = vec3( 0.0 );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n return vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n float alpha = pow2( roughness );\n float invAlpha = 1.0 / alpha;\n float cos2h = dotNH * dotNH;\n float sin2h = max( 1.0 - cos2h, 0.0078125 );\n return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float D = D_Charlie( sheenRoughness, dotNH );\n float V = V_Neubelt( dotNV, dotNL );\n return sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n float r2 = roughness * roughness;\n float rInv = 1.0 / ( roughness + 0.1 );\n float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv;\n float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv;\n float DG = exp( a * dotNV + b );\n return saturate( DG );\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;\n return specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n float dotNV = saturate( dot( normal, viewDir ) );\n vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;\n #ifdef USE_IRIDESCENCE\n vec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n #else\n vec3 Fr = specularColor;\n #endif\n vec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\nvec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg;\n vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg;\n vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y;\n vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y;\n float Ess_V = dfgV.x + dfgV.y;\n float Ess_L = dfgL.x + dfgL.y;\n float Ems_V = 1.0 - Ess_V;\n float Ems_L = 1.0 - Ess_L;\n vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619;\n vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON );\n float compensationFactor = Ems_V * Ems_L;\n vec3 multiScatter = Fms * compensationFactor;\n return singleScatter + multiScatter;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 normal = geometryNormal;\n vec3 viewDir = geometryViewDir;\n vec3 position = geometryPosition;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.roughness;\n vec3 rectCoords[ 4 ];\n rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv( normal, viewDir, roughness );\n vec4 t1 = texture2D( ltc_1, uv );\n vec4 t2 = texture2D( ltc_2, uv );\n mat3 mInv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n #ifdef USE_CLEARCOAT\n vec3 Ncc = geometryClearcoatNormal;\n vec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness );\n vec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat );\n vec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat );\n mat3 mInvClearcoat = mat3(\n vec3( t1Clearcoat.x, 0, t1Clearcoat.y ),\n vec3( 0, 1, 0 ),\n vec3( t1Clearcoat.z, 0, t1Clearcoat.w )\n );\n vec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y;\n clearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords );\n #endif\n }\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifdef USE_CLEARCOAT\n float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n vec3 ccIrradiance = dotNLcc * directLight.color;\n clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n #endif\n #ifdef USE_SHEEN\n \n sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n \n float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness );\n \n float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL );\n \n irradiance *= sheenEnergyComp;\n \n #endif\n reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution );\n #ifdef USE_SHEEN\n float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;\n diffuse *= sheenEnergyComp;\n #endif\n reflectedLight.indirectDiffuse += diffuse;\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n #ifdef USE_CLEARCOAT\n clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI;\n #endif\n vec3 singleScatteringDielectric = vec3( 0.0 );\n vec3 multiScatteringDielectric = vec3( 0.0 );\n vec3 singleScatteringMetallic = vec3( 0.0 );\n vec3 multiScatteringMetallic = vec3( 0.0 );\n #ifdef USE_IRIDESCENCE\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric );\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic );\n #else\n computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric );\n computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic );\n #endif\n vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness );\n vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness );\n vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric;\n vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n vec3 indirectSpecular = radiance * singleScattering;\n indirectSpecular += multiScattering * cosineWeightedIrradiance;\n vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance;\n #ifdef USE_SHEEN\n float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;\n indirectSpecular *= sheenEnergyComp;\n indirectDiffuse *= sheenEnergyComp;\n #endif\n reflectedLight.indirectSpecular += indirectSpecular;\n reflectedLight.indirectDiffuse += indirectDiffuse;\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}";
39192
- lights_fragment_begin = "\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n geometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n float dotNVi = saturate( dot( normal, geometryViewDir ) );\n if ( material.iridescenceThickness == 0.0 ) {\n material.iridescence = 0.0;\n } else {\n material.iridescence = saturate( material.iridescence );\n }\n if ( material.iridescence > 0.0 ) {\n material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor );\n material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness );\n material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n }\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointLightInfo( pointLight, geometryPosition, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n vec4 spotColor;\n vec3 spotLightCoord;\n bool inSpotLightMap;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, geometryPosition, directLight );\n #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n #else\n #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #endif\n #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n #endif\n #undef SPOT_LIGHT_MAP_INDEX\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n #if defined( USE_LIGHT_PROBES )\n irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n #endif\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif";
39405
+ lights_physical_pars_fragment = "uniform sampler2D dfgLUT;\nstruct PhysicalMaterial {\n vec3 diffuseColor;\n vec3 diffuseContribution;\n vec3 specularColor;\n vec3 specularColorBlended;\n float roughness;\n float metalness;\n float specularF90;\n float dispersion;\n #ifdef USE_CLEARCOAT\n float clearcoat;\n float clearcoatRoughness;\n vec3 clearcoatF0;\n float clearcoatF90;\n #endif\n #ifdef USE_IRIDESCENCE\n float iridescence;\n float iridescenceIOR;\n float iridescenceThickness;\n vec3 iridescenceFresnel;\n vec3 iridescenceF0;\n vec3 iridescenceFresnelDielectric;\n vec3 iridescenceFresnelMetallic;\n #endif\n #ifdef USE_SHEEN\n vec3 sheenColor;\n float sheenRoughness;\n #endif\n #ifdef IOR\n float ior;\n #endif\n #ifdef USE_TRANSMISSION\n float transmission;\n float transmissionAlpha;\n float thickness;\n float attenuationDistance;\n vec3 attenuationColor;\n #endif\n #ifdef USE_ANISOTROPY\n float anisotropy;\n float alphaT;\n vec3 anisotropyT;\n vec3 anisotropyB;\n #endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n }\n float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n float a2 = alphaT * alphaB;\n highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n highp float v2 = dot( v, v );\n float w2 = a2 / v2;\n return RECIPROCAL_PI * a2 * pow2 ( w2 );\n }\n#endif\n#ifdef USE_CLEARCOAT\n vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n vec3 f0 = material.clearcoatF0;\n float f90 = material.clearcoatF90;\n float roughness = material.clearcoatRoughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( V * D );\n }\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 f0 = material.specularColorBlended;\n float f90 = material.specularF90;\n float roughness = material.roughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n #ifdef USE_IRIDESCENCE\n F = mix( F, material.iridescenceFresnel, material.iridescence );\n #endif\n #ifdef USE_ANISOTROPY\n float dotTL = dot( material.anisotropyT, lightDir );\n float dotTV = dot( material.anisotropyT, viewDir );\n float dotTH = dot( material.anisotropyT, halfDir );\n float dotBL = dot( material.anisotropyB, lightDir );\n float dotBV = dot( material.anisotropyB, viewDir );\n float dotBH = dot( material.anisotropyB, halfDir );\n float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n #else\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n #endif\n return F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate( dot( N, V ) );\n vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n float l = length( f );\n return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n float x = dot( v1, v2 );\n float y = abs( x );\n float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n float b = 3.4175940 + ( 4.1616724 + y ) * y;\n float v = a / b;\n float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n vec3 lightNormal = cross( v1, v2 );\n if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 T1, T2;\n T1 = normalize( V - N * dot( V, N ) );\n T2 = - cross( N, T1 );\n mat3 mat = mInv * transpose( mat3( T1, T2, N ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorFormFactor = vec3( 0.0 );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n return vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n float alpha = pow2( roughness );\n float invAlpha = 1.0 / alpha;\n float cos2h = dotNH * dotNH;\n float sin2h = max( 1.0 - cos2h, 0.0078125 );\n return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float D = D_Charlie( sheenRoughness, dotNH );\n float V = V_Neubelt( dotNV, dotNL );\n return sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n float r2 = roughness * roughness;\n float rInv = 1.0 / ( roughness + 0.1 );\n float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv;\n float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv;\n float DG = exp( a * dotNV + b );\n return saturate( DG );\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;\n return specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n float dotNV = saturate( dot( normal, viewDir ) );\n vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;\n #ifdef USE_IRIDESCENCE\n vec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n #else\n vec3 Fr = specularColor;\n #endif\n vec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\nvec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg;\n vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg;\n vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y;\n vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y;\n float Ess_V = dfgV.x + dfgV.y;\n float Ess_L = dfgL.x + dfgL.y;\n float Ems_V = 1.0 - Ess_V;\n float Ems_L = 1.0 - Ess_L;\n vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619;\n vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON );\n float compensationFactor = Ems_V * Ems_L;\n vec3 multiScatter = Fms * compensationFactor;\n return singleScatter + multiScatter;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 normal = geometryNormal;\n vec3 viewDir = geometryViewDir;\n vec3 position = geometryPosition;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.roughness;\n vec3 rectCoords[ 4 ];\n rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv( normal, viewDir, roughness );\n vec4 t1 = texture2D( ltc_1, uv );\n vec4 t2 = texture2D( ltc_2, uv );\n mat3 mInv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n #ifdef USE_CLEARCOAT\n vec3 Ncc = geometryClearcoatNormal;\n vec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness );\n vec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat );\n vec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat );\n mat3 mInvClearcoat = mat3(\n vec3( t1Clearcoat.x, 0, t1Clearcoat.y ),\n vec3( 0, 1, 0 ),\n vec3( t1Clearcoat.z, 0, t1Clearcoat.w )\n );\n vec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y;\n clearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords );\n #endif\n }\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifdef USE_CLEARCOAT\n float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n vec3 ccIrradiance = dotNLcc * directLight.color;\n clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n #endif\n #ifdef USE_SHEEN\n \n sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n \n float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness );\n \n float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL );\n \n irradiance *= sheenEnergyComp;\n \n #endif\n reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution );\n #ifdef USE_SHEEN\n float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;\n diffuse *= sheenEnergyComp;\n #endif\n reflectedLight.indirectDiffuse += diffuse;\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n #ifdef USE_CLEARCOAT\n clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI;\n #endif\n vec3 singleScatteringDielectric = vec3( 0.0 );\n vec3 multiScatteringDielectric = vec3( 0.0 );\n vec3 singleScatteringMetallic = vec3( 0.0 );\n vec3 multiScatteringMetallic = vec3( 0.0 );\n #ifdef USE_IRIDESCENCE\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric );\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic );\n #else\n computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric );\n computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic );\n #endif\n vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness );\n vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness );\n vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric;\n vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n vec3 indirectSpecular = radiance * singleScattering;\n indirectSpecular += multiScattering * cosineWeightedIrradiance;\n vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance;\n #ifdef USE_SHEEN\n float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;\n indirectSpecular *= sheenEnergyComp;\n indirectDiffuse *= sheenEnergyComp;\n #endif\n reflectedLight.indirectSpecular += indirectSpecular;\n reflectedLight.indirectDiffuse += indirectDiffuse;\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}";
39406
+ lights_fragment_begin = "\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n geometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n float dotNVi = saturate( dot( normal, geometryViewDir ) );\n if ( material.iridescenceThickness == 0.0 ) {\n material.iridescence = 0.0;\n } else {\n material.iridescence = saturate( material.iridescence );\n }\n if ( material.iridescence > 0.0 ) {\n material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor );\n material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness );\n material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n }\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointLightInfo( pointLight, geometryPosition, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n vec4 spotColor;\n vec3 spotLightCoord;\n bool inSpotLightMap;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, geometryPosition, directLight );\n #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n #else\n #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #endif\n #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n #endif\n #undef SPOT_LIGHT_MAP_INDEX\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n #if defined( USE_LIGHT_PROBES )\n irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n #endif\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n }\n #pragma unroll_loop_end\n #endif\n #ifdef USE_LIGHT_PROBES_GRID\n vec3 probeWorldPos = ( ( vec4( geometryPosition, 1.0 ) - viewMatrix[ 3 ] ) * viewMatrix ).xyz;\n vec3 probeWorldNormal = inverseTransformDirection( geometryNormal, viewMatrix );\n irradiance += getLightProbeGridIrradiance( probeWorldPos, probeWorldNormal );\n #endif\n#endif\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif";
39193
39407
  lights_fragment_maps = "#if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV )\n #if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG )\n iblIrradiance += getIBLIrradiance( geometryNormal );\n #endif\n #endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n #ifdef USE_ANISOTROPY\n radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n #else\n radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n #endif\n #ifdef USE_CLEARCOAT\n clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n #endif\n#endif";
39194
39408
  lights_fragment_end = "#if defined( RE_IndirectDiffuse )\n #if defined( LAMBERT ) || defined( PHONG )\n irradiance += iblIrradiance;\n #endif\n RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif";
39409
+ lightprobes_pars_fragment = "#ifdef USE_LIGHT_PROBES_GRID\nuniform highp sampler3D probesSH;\nuniform vec3 probesMin;\nuniform vec3 probesMax;\nuniform vec3 probesResolution;\nvec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) {\n vec3 res = probesResolution;\n vec3 gridRange = probesMax - probesMin;\n vec3 resMinusOne = res - 1.0;\n vec3 probeSpacing = gridRange / resMinusOne;\n vec3 samplePos = worldPos + worldNormal * probeSpacing * 0.5;\n vec3 uvw = clamp( ( samplePos - probesMin ) / gridRange, 0.0, 1.0 );\n uvw = uvw * resMinusOne / res + 0.5 / res;\n float nz = res.z;\n float paddedSlices = nz + 2.0;\n float atlasDepth = 7.0 * paddedSlices;\n float uvZBase = uvw.z * nz + 1.0;\n vec4 s0 = texture( probesSH, vec3( uvw.xy, ( uvZBase ) / atlasDepth ) );\n vec4 s1 = texture( probesSH, vec3( uvw.xy, ( uvZBase + paddedSlices ) / atlasDepth ) );\n vec4 s2 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 2.0 * paddedSlices ) / atlasDepth ) );\n vec4 s3 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 3.0 * paddedSlices ) / atlasDepth ) );\n vec4 s4 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 4.0 * paddedSlices ) / atlasDepth ) );\n vec4 s5 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 5.0 * paddedSlices ) / atlasDepth ) );\n vec4 s6 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 6.0 * paddedSlices ) / atlasDepth ) );\n vec3 c0 = s0.xyz;\n vec3 c1 = vec3( s0.w, s1.xy );\n vec3 c2 = vec3( s1.zw, s2.x );\n vec3 c3 = s2.yzw;\n vec3 c4 = s3.xyz;\n vec3 c5 = vec3( s3.w, s4.xy );\n vec3 c6 = vec3( s4.zw, s5.x );\n vec3 c7 = s5.yzw;\n vec3 c8 = s6.xyz;\n float x = worldNormal.x, y = worldNormal.y, z = worldNormal.z;\n vec3 result = c0 * 0.886227;\n result += c1 * 2.0 * 0.511664 * y;\n result += c2 * 2.0 * 0.511664 * z;\n result += c3 * 2.0 * 0.511664 * x;\n result += c4 * 2.0 * 0.429043 * x * y;\n result += c5 * 2.0 * 0.429043 * y * z;\n result += c6 * ( 0.743125 * z * z - 0.247708 );\n result += c7 * 2.0 * 0.429043 * x * z;\n result += c8 * 0.429043 * ( x * x - y * y );\n return max( result, vec3( 0.0 ) );\n}\n#endif";
39195
39410
  logdepthbuf_fragment = "#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif";
39196
39411
  logdepthbuf_pars_fragment = "#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n uniform float logDepthBufFC;\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif";
39197
39412
  logdepthbuf_pars_vertex = "#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif";
@@ -39208,7 +39423,7 @@ var init_three_module = __esm({
39208
39423
  morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n #ifndef USE_INSTANCING_MORPH\n uniform float morphTargetBaseInfluence;\n uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n #endif\n uniform sampler2DArray morphTargetsTexture;\n uniform ivec2 morphTargetsTextureSize;\n vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n int y = texelIndex / morphTargetsTextureSize.x;\n int x = texelIndex - y * morphTargetsTextureSize.x;\n ivec3 morphUV = ivec3( x, y, morphTargetIndex );\n return texelFetch( morphTargetsTexture, morphUV, 0 );\n }\n#endif";
39209
39424
  morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n transformed *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n }\n#endif";
39210
39425
  normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n vec3 fdx = dFdx( vViewPosition );\n vec3 fdy = dFdy( vViewPosition );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal *= faceDirection;\n #endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n #ifdef USE_TANGENT\n mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn = getTangentFrame( - vViewPosition, normal,\n #if defined( USE_NORMALMAP )\n vNormalMapUv\n #elif defined( USE_CLEARCOAT_NORMALMAP )\n vClearcoatNormalMapUv\n #else\n vUv\n #endif\n );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn[0] *= faceDirection;\n tbn[1] *= faceDirection;\n #endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n #ifdef USE_TANGENT\n mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn2[0] *= faceDirection;\n tbn2[1] *= faceDirection;\n #endif\n#endif\nvec3 nonPerturbedNormal = normal;";
39211
- normal_fragment_maps = "#ifdef USE_NORMALMAP_OBJECTSPACE\n normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n normal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n mapN.xy *= normalScale;\n normal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif";
39426
+ normal_fragment_maps = "#ifdef USE_NORMALMAP_OBJECTSPACE\n normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n normal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n #if defined( USE_PACKED_NORMALMAP )\n mapN = vec3( mapN.xy, sqrt( saturate( 1.0 - dot( mapN.xy, mapN.xy ) ) ) );\n #endif\n mapN.xy *= normalScale;\n normal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif";
39212
39427
  normal_pars_fragment = "#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif";
39213
39428
  normal_pars_vertex = "#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif";
39214
39429
  normal_vertex = "#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif";
@@ -39227,7 +39442,7 @@ var init_three_module = __esm({
39227
39442
  roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif";
39228
39443
  shadowmap_pars_fragment = "#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #if defined( SHADOWMAP_TYPE_PCF )\n uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n #else\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n #if defined( SHADOWMAP_TYPE_PCF )\n uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n #else\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #if defined( SHADOWMAP_TYPE_PCF )\n uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n #elif defined( SHADOWMAP_TYPE_BASIC )\n uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n #if defined( SHADOWMAP_TYPE_PCF )\n float interleavedGradientNoise( vec2 position ) {\n return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) );\n }\n vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) {\n const float goldenAngle = 2.399963229728653;\n float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) );\n float theta = float( sampleIndex ) * goldenAngle + phi;\n return vec2( cos( theta ), sin( theta ) ) * r;\n }\n #endif\n #if defined( SHADOWMAP_TYPE_PCF )\n float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float radius = shadowRadius * texelSize.x;\n float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;\n shadow = (\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) +\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) +\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) +\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) +\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) )\n ) * 0.2;\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #elif defined( SHADOWMAP_TYPE_VSM )\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n shadowCoord.z -= shadowBias;\n #else\n shadowCoord.z += shadowBias;\n #endif\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg;\n float mean = distribution.x;\n float variance = distribution.y * distribution.y;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n float hard_shadow = step( mean, shadowCoord.z );\n #else\n float hard_shadow = step( shadowCoord.z, mean );\n #endif\n \n if ( hard_shadow == 1.0 ) {\n shadow = 1.0;\n } else {\n variance = max( variance, 0.0000001 );\n float d = shadowCoord.z - mean;\n float p_max = variance / ( variance + d * d );\n p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 );\n shadow = max( hard_shadow, p_max );\n }\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #else\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n shadowCoord.z -= shadowBias;\n #else\n shadowCoord.z += shadowBias;\n #endif\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n float depth = texture2D( shadowMap, shadowCoord.xy ).r;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n shadow = step( depth, shadowCoord.z );\n #else\n shadow = step( shadowCoord.z, depth );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #if defined( SHADOWMAP_TYPE_PCF )\n float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n float shadow = 1.0;\n vec3 lightToPosition = shadowCoord.xyz;\n vec3 bd3D = normalize( lightToPosition );\n vec3 absVec = abs( lightToPosition );\n float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );\n if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {\n #ifdef USE_REVERSED_DEPTH_BUFFER\n float dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n dp -= shadowBias;\n #else\n float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n dp += shadowBias;\n #endif\n float texelSize = shadowRadius / shadowMapSize.x;\n vec3 absDir = abs( bd3D );\n vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 );\n tangent = normalize( cross( bd3D, tangent ) );\n vec3 bitangent = cross( bd3D, tangent );\n float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;\n vec2 sample0 = vogelDiskSample( 0, 5, phi );\n vec2 sample1 = vogelDiskSample( 1, 5, phi );\n vec2 sample2 = vogelDiskSample( 2, 5, phi );\n vec2 sample3 = vogelDiskSample( 3, 5, phi );\n vec2 sample4 = vogelDiskSample( 4, 5, phi );\n shadow = (\n texture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) )\n ) * 0.2;\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #elif defined( SHADOWMAP_TYPE_BASIC )\n float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n float shadow = 1.0;\n vec3 lightToPosition = shadowCoord.xyz;\n vec3 absVec = abs( lightToPosition );\n float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );\n if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {\n float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n dp += shadowBias;\n vec3 bd3D = normalize( lightToPosition );\n float depth = textureCube( shadowMap, bd3D ).r;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n depth = 1.0 - depth;\n #endif\n shadow = step( dp, depth );\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #endif\n #endif\n#endif";
39229
39444
  shadowmap_pars_vertex = "#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n#endif";
39230
- shadowmap_vertex = "#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n vec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n shadowWorldPosition = worldPosition;\n #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n #endif\n vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n#endif";
39445
+ shadowmap_vertex = "#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n #ifdef HAS_NORMAL\n vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #else\n vec3 shadowWorldNormal = vec3( 0.0 );\n #endif\n vec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n shadowWorldPosition = worldPosition;\n #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n #endif\n vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n#endif";
39231
39446
  shadowmask_pars_fragment = "float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n directionalLight = directionalLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n spotLight = spotLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )\n PointLightShadow pointLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n pointLight = pointLightShadows[ i ];\n shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #endif\n return shadow;\n}";
39232
39447
  skinbase_vertex = "#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif";
39233
39448
  skinning_pars_vertex = "#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n uniform highp sampler2D boneTexture;\n mat4 getBoneMatrix( const in float i ) {\n int size = textureSize( boneTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n#endif";
@@ -39246,7 +39461,7 @@ var init_three_module = __esm({
39246
39461
  vertex$h = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n gl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
39247
39462
  fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n vec4 texColor = texture2D( t2D, vUv );\n #ifdef DECODE_VIDEO_TEXTURE\n texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}";
39248
39463
  vertex$g = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}";
39249
- fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n uniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n #ifdef ENVMAP_TYPE_CUBE\n vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n #else\n vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}";
39464
+ fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n uniform sampler2D envMap;\n#endif\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n #ifdef ENVMAP_TYPE_CUBE\n vec4 texColor = textureCube( envMap, backgroundRotation * vWorldDirection );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n #else\n vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}";
39250
39465
  vertex$f = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}";
39251
39466
  fragment$f = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n gl_FragColor = texColor;\n gl_FragColor.a *= opacity;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}";
39252
39467
  vertex$e = "#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <skinbase_vertex>\n #include <morphinstance_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vHighPrecisionZW = gl_Position.zw;\n}";
@@ -39334,6 +39549,7 @@ var init_three_module = __esm({
39334
39549
  lights_fragment_begin,
39335
39550
  lights_fragment_maps,
39336
39551
  lights_fragment_end,
39552
+ lightprobes_pars_fragment,
39337
39553
  logdepthbuf_fragment,
39338
39554
  logdepthbuf_pars_fragment,
39339
39555
  logdepthbuf_pars_vertex,
@@ -39437,7 +39653,6 @@ var init_three_module = __esm({
39437
39653
  envmap: {
39438
39654
  envMap: { value: null },
39439
39655
  envMapRotation: { value: /* @__PURE__ */ new Matrix3() },
39440
- flipEnvMap: { value: -1 },
39441
39656
  reflectivity: { value: 1 },
39442
39657
  // basic, lambert, phong
39443
39658
  ior: { value: 1.5 },
@@ -39556,7 +39771,11 @@ var init_three_module = __esm({
39556
39771
  height: {}
39557
39772
  } },
39558
39773
  ltc_1: { value: null },
39559
- ltc_2: { value: null }
39774
+ ltc_2: { value: null },
39775
+ probesSH: { value: null },
39776
+ probesMin: { value: /* @__PURE__ */ new Vector3() },
39777
+ probesMax: { value: /* @__PURE__ */ new Vector3() },
39778
+ probesResolution: { value: /* @__PURE__ */ new Vector3() }
39560
39779
  },
39561
39780
  points: {
39562
39781
  diffuse: { value: /* @__PURE__ */ new Color(16777215) },
@@ -39757,7 +39976,6 @@ var init_three_module = __esm({
39757
39976
  backgroundCube: {
39758
39977
  uniforms: {
39759
39978
  envMap: { value: null },
39760
- flipEnvMap: { value: -1 },
39761
39979
  backgroundBlurriness: { value: 0 },
39762
39980
  backgroundIntensity: { value: 1 },
39763
39981
  backgroundRotation: { value: /* @__PURE__ */ new Matrix3() }
@@ -39861,8 +40079,9 @@ var init_three_module = __esm({
39861
40079
  fragmentShader: ShaderChunk.meshphysical_frag
39862
40080
  };
39863
40081
  _rgb = { r: 0, b: 0, g: 0 };
39864
- _e1$1 = /* @__PURE__ */ new Euler();
39865
40082
  _m1$12 = /* @__PURE__ */ new Matrix4();
40083
+ _m$1 = /* @__PURE__ */ new Matrix3();
40084
+ _m$1.set(-1, 0, 0, 0, 1, 0, 0, 0, 1);
39866
40085
  LOD_MIN = 4;
39867
40086
  EXTRA_LOD_SIGMA = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582];
39868
40087
  MAX_SAMPLES = 20;
@@ -41206,8 +41425,9 @@ void main() {
41206
41425
  };
41207
41426
  }
41208
41427
  };
41209
- _e1 = /* @__PURE__ */ new Euler();
41210
41428
  _m12 = /* @__PURE__ */ new Matrix4();
41429
+ _m = /* @__PURE__ */ new Matrix3();
41430
+ _m.set(-1, 0, 0, 0, 1, 0, 0, 0, 1);
41211
41431
  DATA = new Uint16Array([
41212
41432
  12469,
41213
41433
  15057,
@@ -41770,6 +41990,7 @@ void main() {
41770
41990
  ]);
41771
41991
  const uintClearColor = new Uint32Array(4);
41772
41992
  const intClearColor = new Int32Array(4);
41993
+ const objectPosition = new Vector3();
41773
41994
  let currentRenderList = null;
41774
41995
  let currentRenderState = null;
41775
41996
  const renderListStack = [];
@@ -41800,6 +42021,7 @@ void main() {
41800
42021
  this.transmissionResolutionScale = 1;
41801
42022
  const _this = this;
41802
42023
  let _isContextLost = false;
42024
+ let _nodesHandler = null;
41803
42025
  this._outputColorSpace = SRGBColorSpace;
41804
42026
  let _currentActiveCubeFace = 0;
41805
42027
  let _currentActiveMipmapLevel = 0;
@@ -41823,8 +42045,8 @@ void main() {
41823
42045
  let _clippingEnabled = false;
41824
42046
  let _localClippingEnabled = false;
41825
42047
  const _projScreenMatrix3 = new Matrix4();
41826
- const _vector32 = new Vector3();
41827
- const _vector4 = new Vector4();
42048
+ const _vector3 = new Vector3();
42049
+ const _vector42 = new Vector4();
41828
42050
  const _emptyScene = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: true };
41829
42051
  let _renderBackground = false;
41830
42052
  function getTargetPixelRatio() {
@@ -41968,13 +42190,13 @@ void main() {
41968
42190
  };
41969
42191
  this.setEffects = function(effects) {
41970
42192
  if (_outputBufferType === UnsignedByteType) {
41971
- console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");
42193
+ error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");
41972
42194
  return;
41973
42195
  }
41974
42196
  if (effects) {
41975
42197
  for (let i3 = 0; i3 < effects.length; i3++) {
41976
42198
  if (effects[i3].isOutputPass === true) {
41977
- console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");
42199
+ warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");
41978
42200
  break;
41979
42201
  }
41980
42202
  }
@@ -42065,6 +42287,7 @@ void main() {
42065
42287
  }
42066
42288
  if (depth2) {
42067
42289
  bits |= _gl.DEPTH_BUFFER_BIT;
42290
+ this.state.buffers.depth.setMask(true);
42068
42291
  }
42069
42292
  if (stencil2) {
42070
42293
  bits |= _gl.STENCIL_BUFFER_BIT;
@@ -42083,6 +42306,10 @@ void main() {
42083
42306
  this.clearStencil = function() {
42084
42307
  this.clear(false, false, true);
42085
42308
  };
42309
+ this.setNodesHandler = function(nodesHandler) {
42310
+ nodesHandler.setRenderer(this);
42311
+ _nodesHandler = nodesHandler;
42312
+ };
42086
42313
  this.dispose = function() {
42087
42314
  canvas.removeEventListener("webglcontextlost", onContextLost, false);
42088
42315
  canvas.removeEventListener("webglcontextrestored", onContextRestore, false);
@@ -42205,23 +42432,18 @@ void main() {
42205
42432
  renderer.setMode(_gl.TRIANGLES);
42206
42433
  }
42207
42434
  if (object.isBatchedMesh) {
42208
- if (object._multiDrawInstances !== null) {
42209
- warnOnce("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.");
42210
- renderer.renderMultiDrawInstances(object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount, object._multiDrawInstances);
42211
- } else {
42212
- if (!extensions2.get("WEBGL_multi_draw")) {
42213
- const starts = object._multiDrawStarts;
42214
- const counts = object._multiDrawCounts;
42215
- const drawCount2 = object._multiDrawCount;
42216
- const bytesPerElement = index ? attributes.get(index).bytesPerElement : 1;
42217
- const uniforms = properties.get(material).currentProgram.getUniforms();
42218
- for (let i3 = 0; i3 < drawCount2; i3++) {
42219
- uniforms.setValue(_gl, "_gl_DrawID", i3);
42220
- renderer.render(starts[i3] / bytesPerElement, counts[i3]);
42221
- }
42222
- } else {
42223
- renderer.renderMultiDraw(object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount);
42435
+ if (!extensions2.get("WEBGL_multi_draw")) {
42436
+ const starts = object._multiDrawStarts;
42437
+ const counts = object._multiDrawCounts;
42438
+ const drawCount2 = object._multiDrawCount;
42439
+ const bytesPerElement = index ? attributes.get(index).bytesPerElement : 1;
42440
+ const uniforms = properties.get(material).currentProgram.getUniforms();
42441
+ for (let i3 = 0; i3 < drawCount2; i3++) {
42442
+ uniforms.setValue(_gl, "_gl_DrawID", i3);
42443
+ renderer.render(starts[i3] / bytesPerElement, counts[i3]);
42224
42444
  }
42445
+ } else {
42446
+ renderer.renderMultiDraw(object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount);
42225
42447
  }
42226
42448
  } else if (object.isInstancedMesh) {
42227
42449
  renderer.renderInstances(drawStart, drawCount, object.count);
@@ -42342,6 +42564,9 @@ void main() {
42342
42564
  return;
42343
42565
  }
42344
42566
  if (_isContextLost === true) return;
42567
+ if (_nodesHandler !== null) {
42568
+ _nodesHandler.renderStart(scene, camera);
42569
+ }
42345
42570
  const isXRPresenting = xr.enabled === true && xr.isPresenting === true;
42346
42571
  const useOutput = output !== null && (_currentRenderTarget === null || isXRPresenting) && output.begin(_this, _currentRenderTarget);
42347
42572
  if (scene.matrixWorldAutoUpdate === true) scene.updateMatrixWorld();
@@ -42353,6 +42578,7 @@ void main() {
42353
42578
  if (scene.isScene === true) scene.onBeforeRender(_this, scene, camera, _currentRenderTarget);
42354
42579
  currentRenderState = renderStates.get(scene, renderStateStack.length);
42355
42580
  currentRenderState.init(camera);
42581
+ currentRenderState.state.textureUnits = textures.getTextureUnits();
42356
42582
  renderStateStack.push(currentRenderState);
42357
42583
  _projScreenMatrix3.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);
42358
42584
  _frustum2.setFromProjectionMatrix(_projScreenMatrix3, WebGLCoordinateSystem, camera.reversedDepth);
@@ -42420,6 +42646,7 @@ void main() {
42420
42646
  renderStateStack.pop();
42421
42647
  if (renderStateStack.length > 0) {
42422
42648
  currentRenderState = renderStateStack[renderStateStack.length - 1];
42649
+ textures.setTextureUnits(currentRenderState.state.textureUnits);
42423
42650
  if (_clippingEnabled === true) clipping.setGlobalState(_this.clippingPlanes, currentRenderState.state.camera);
42424
42651
  } else {
42425
42652
  currentRenderState = null;
@@ -42430,6 +42657,9 @@ void main() {
42430
42657
  } else {
42431
42658
  currentRenderList = null;
42432
42659
  }
42660
+ if (_nodesHandler !== null) {
42661
+ _nodesHandler.renderEnd();
42662
+ }
42433
42663
  };
42434
42664
  function projectObject(object, camera, groupOrder, sortObjects) {
42435
42665
  if (object.visible === false) return;
@@ -42439,6 +42669,8 @@ void main() {
42439
42669
  groupOrder = object.renderOrder;
42440
42670
  } else if (object.isLOD) {
42441
42671
  if (object.autoUpdate === true) object.update(camera);
42672
+ } else if (object.isLightProbeGrid) {
42673
+ currentRenderState.pushLightProbeGrid(object);
42442
42674
  } else if (object.isLight) {
42443
42675
  currentRenderState.pushLight(object);
42444
42676
  if (object.castShadow) {
@@ -42447,12 +42679,12 @@ void main() {
42447
42679
  } else if (object.isSprite) {
42448
42680
  if (!object.frustumCulled || _frustum2.intersectsSprite(object)) {
42449
42681
  if (sortObjects) {
42450
- _vector4.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix3);
42682
+ _vector42.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix3);
42451
42683
  }
42452
42684
  const geometry = objects.update(object);
42453
42685
  const material = object.material;
42454
42686
  if (material.visible) {
42455
- currentRenderList.push(object, geometry, material, groupOrder, _vector4.z, null);
42687
+ currentRenderList.push(object, geometry, material, groupOrder, _vector42.z, null);
42456
42688
  }
42457
42689
  }
42458
42690
  } else if (object.isMesh || object.isLine || object.isPoints) {
@@ -42462,12 +42694,12 @@ void main() {
42462
42694
  if (sortObjects) {
42463
42695
  if (object.boundingSphere !== void 0) {
42464
42696
  if (object.boundingSphere === null) object.computeBoundingSphere();
42465
- _vector4.copy(object.boundingSphere.center);
42697
+ _vector42.copy(object.boundingSphere.center);
42466
42698
  } else {
42467
42699
  if (geometry.boundingSphere === null) geometry.computeBoundingSphere();
42468
- _vector4.copy(geometry.boundingSphere.center);
42700
+ _vector42.copy(geometry.boundingSphere.center);
42469
42701
  }
42470
- _vector4.applyMatrix4(object.matrixWorld).applyMatrix4(_projScreenMatrix3);
42702
+ _vector42.applyMatrix4(object.matrixWorld).applyMatrix4(_projScreenMatrix3);
42471
42703
  }
42472
42704
  if (Array.isArray(material)) {
42473
42705
  const groups = geometry.groups;
@@ -42475,11 +42707,11 @@ void main() {
42475
42707
  const group = groups[i3];
42476
42708
  const groupMaterial = material[group.materialIndex];
42477
42709
  if (groupMaterial && groupMaterial.visible) {
42478
- currentRenderList.push(object, geometry, groupMaterial, groupOrder, _vector4.z, group);
42710
+ currentRenderList.push(object, geometry, groupMaterial, groupOrder, _vector42.z, group);
42479
42711
  }
42480
42712
  }
42481
42713
  } else if (material.visible) {
42482
- currentRenderList.push(object, geometry, material, groupOrder, _vector4.z, null);
42714
+ currentRenderList.push(object, geometry, material, groupOrder, _vector42.z, null);
42483
42715
  }
42484
42716
  }
42485
42717
  }
@@ -42605,7 +42837,7 @@ void main() {
42605
42837
  const lights = currentRenderState.state.lights;
42606
42838
  const shadowsArray = currentRenderState.state.shadowsArray;
42607
42839
  const lightsStateVersion = lights.state.version;
42608
- const parameters2 = programCache.getParameters(material, lights.state, shadowsArray, scene, object);
42840
+ const parameters2 = programCache.getParameters(material, lights.state, shadowsArray, scene, object, currentRenderState.state.lightProbeGridArray);
42609
42841
  const programCacheKey = programCache.getProgramCacheKey(parameters2);
42610
42842
  let programs = materialProperties.programs;
42611
42843
  materialProperties.environment = material.isMeshStandardMaterial || material.isMeshLambertMaterial || material.isMeshPhongMaterial ? scene.environment : null;
@@ -42626,6 +42858,9 @@ void main() {
42626
42858
  }
42627
42859
  } else {
42628
42860
  parameters2.uniforms = programCache.getUniforms(material);
42861
+ if (_nodesHandler !== null && material.isNodeMaterial) {
42862
+ _nodesHandler.build(material, object, parameters2);
42863
+ }
42629
42864
  material.onBeforeCompile(parameters2, _this);
42630
42865
  program = programCache.acquireProgram(parameters2, programCacheKey);
42631
42866
  programs.set(programCacheKey, program);
@@ -42656,6 +42891,7 @@ void main() {
42656
42891
  uniforms.spotLightMap.value = lights.state.spotLightMap;
42657
42892
  uniforms.pointShadowMatrix.value = lights.state.pointShadowMatrix;
42658
42893
  }
42894
+ materialProperties.lightProbeGrid = currentRenderState.state.lightProbeGridArray.length > 0;
42659
42895
  materialProperties.currentProgram = program;
42660
42896
  materialProperties.uniformsList = null;
42661
42897
  return program;
@@ -42686,12 +42922,24 @@ void main() {
42686
42922
  materialProperties.vertexTangents = parameters2.vertexTangents;
42687
42923
  materialProperties.toneMapping = parameters2.toneMapping;
42688
42924
  }
42925
+ function findLightProbeGrid(volumes, object) {
42926
+ if (volumes.length === 0) return null;
42927
+ if (volumes.length === 1) {
42928
+ return volumes[0].texture !== null ? volumes[0] : null;
42929
+ }
42930
+ objectPosition.setFromMatrixPosition(object.matrixWorld);
42931
+ for (let i3 = 0, l2 = volumes.length; i3 < l2; i3++) {
42932
+ const v = volumes[i3];
42933
+ if (v.texture !== null && v.boundingBox.containsPoint(objectPosition)) return v;
42934
+ }
42935
+ return null;
42936
+ }
42689
42937
  function setProgram(camera, scene, geometry, material, object) {
42690
42938
  if (scene.isScene !== true) scene = _emptyScene;
42691
42939
  textures.resetTextureUnits();
42692
42940
  const fog = scene.fog;
42693
42941
  const environment = material.isMeshStandardMaterial || material.isMeshLambertMaterial || material.isMeshPhongMaterial ? scene.environment : null;
42694
- const colorSpace = _currentRenderTarget === null ? _this.outputColorSpace : _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace;
42942
+ const colorSpace = _currentRenderTarget === null ? _this.outputColorSpace : _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.colorSpace : ColorManagement.workingColorSpace;
42695
42943
  const usePMREM = material.isMeshStandardMaterial || material.isMeshLambertMaterial && !material.envMap || material.isMeshPhongMaterial && !material.envMap;
42696
42944
  const envMap = environments.get(material.envMap || environment, usePMREM);
42697
42945
  const vertexAlphas = material.vertexColors === true && !!geometry.attributes.color && geometry.attributes.color.itemSize === 4;
@@ -42765,6 +43013,8 @@ void main() {
42765
43013
  needsProgramChange = true;
42766
43014
  } else if (materialProperties.morphTargetsCount !== morphTargetsCount) {
42767
43015
  needsProgramChange = true;
43016
+ } else if (!!materialProperties.lightProbeGrid !== currentRenderState.state.lightProbeGridArray.length > 0) {
43017
+ needsProgramChange = true;
42768
43018
  }
42769
43019
  } else {
42770
43020
  needsProgramChange = true;
@@ -42773,6 +43023,9 @@ void main() {
42773
43023
  let program = materialProperties.currentProgram;
42774
43024
  if (needsProgramChange === true) {
42775
43025
  program = getProgram(material, scene, object);
43026
+ if (_nodesHandler && material.isNodeMaterial) {
43027
+ _nodesHandler.onUpdateProgram(material, program, materialProperties);
43028
+ }
42776
43029
  }
42777
43030
  let refreshProgram = false;
42778
43031
  let refreshMaterial = false;
@@ -42787,6 +43040,13 @@ void main() {
42787
43040
  _currentMaterialId = material.id;
42788
43041
  refreshMaterial = true;
42789
43042
  }
43043
+ if (materialProperties.needsLights) {
43044
+ const objectVolume = findLightProbeGrid(currentRenderState.state.lightProbeGridArray, object);
43045
+ if (materialProperties.lightProbeGrid !== objectVolume) {
43046
+ materialProperties.lightProbeGrid = objectVolume;
43047
+ refreshMaterial = true;
43048
+ }
43049
+ }
42790
43050
  if (refreshProgram || _currentCamera !== camera) {
42791
43051
  const reversedDepthBuffer2 = state2.buffers.depth.getReversed();
42792
43052
  if (reversedDepthBuffer2 && camera.reversedDepth !== true) {
@@ -42797,7 +43057,7 @@ void main() {
42797
43057
  p_uniforms.setValue(_gl, "viewMatrix", camera.matrixWorldInverse);
42798
43058
  const uCamPos = p_uniforms.map.cameraPosition;
42799
43059
  if (uCamPos !== void 0) {
42800
- uCamPos.setValue(_gl, _vector32.setFromMatrixPosition(camera.matrixWorld));
43060
+ uCamPos.setValue(_gl, _vector3.setFromMatrixPosition(camera.matrixWorld));
42801
43061
  }
42802
43062
  if (capabilities.logarithmicDepthBuffer) {
42803
43063
  p_uniforms.setValue(
@@ -42868,6 +43128,13 @@ void main() {
42868
43128
  materials.refreshFogUniforms(m_uniforms, fog);
42869
43129
  }
42870
43130
  materials.refreshMaterialUniforms(m_uniforms, material, _pixelRatio, _height, currentRenderState.state.transmissionRenderTarget[camera.id]);
43131
+ if (materialProperties.needsLights && materialProperties.lightProbeGrid) {
43132
+ const volume = materialProperties.lightProbeGrid;
43133
+ m_uniforms.probesSH.value = volume.texture;
43134
+ m_uniforms.probesMin.value.copy(volume.boundingBox.min);
43135
+ m_uniforms.probesMax.value.copy(volume.boundingBox.max);
43136
+ m_uniforms.probesResolution.value.copy(volume.resolution);
43137
+ }
42871
43138
  WebGLUniforms.upload(_gl, getUniformList(materialProperties), m_uniforms, textures);
42872
43139
  }
42873
43140
  if (material.isShaderMaterial && material.uniformsNeedUpdate === true) {
@@ -42880,7 +43147,7 @@ void main() {
42880
43147
  p_uniforms.setValue(_gl, "modelViewMatrix", object.modelViewMatrix);
42881
43148
  p_uniforms.setValue(_gl, "normalMatrix", object.normalMatrix);
42882
43149
  p_uniforms.setValue(_gl, "modelMatrix", object.matrixWorld);
42883
- if (material.isShaderMaterial || material.isRawShaderMaterial) {
43150
+ if (material.uniformsGroups !== void 0) {
42884
43151
  const groups = material.uniformsGroups;
42885
43152
  for (let i3 = 0, l2 = groups.length; i3 < l2; i3++) {
42886
43153
  const group = groups[i3];
@@ -43149,19 +43416,20 @@ void main() {
43149
43416
  textures.setTexture2D(dstTexture, 0);
43150
43417
  glTarget = _gl.TEXTURE_2D;
43151
43418
  }
43152
- _gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, dstTexture.flipY);
43153
- _gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, dstTexture.premultiplyAlpha);
43154
- _gl.pixelStorei(_gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment);
43155
- const currentUnpackRowLen = _gl.getParameter(_gl.UNPACK_ROW_LENGTH);
43156
- const currentUnpackImageHeight = _gl.getParameter(_gl.UNPACK_IMAGE_HEIGHT);
43157
- const currentUnpackSkipPixels = _gl.getParameter(_gl.UNPACK_SKIP_PIXELS);
43158
- const currentUnpackSkipRows = _gl.getParameter(_gl.UNPACK_SKIP_ROWS);
43159
- const currentUnpackSkipImages = _gl.getParameter(_gl.UNPACK_SKIP_IMAGES);
43160
- _gl.pixelStorei(_gl.UNPACK_ROW_LENGTH, image.width);
43161
- _gl.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT, image.height);
43162
- _gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS, minX);
43163
- _gl.pixelStorei(_gl.UNPACK_SKIP_ROWS, minY);
43164
- _gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES, minZ);
43419
+ state2.activeTexture(_gl.TEXTURE0);
43420
+ state2.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, dstTexture.flipY);
43421
+ state2.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, dstTexture.premultiplyAlpha);
43422
+ state2.pixelStorei(_gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment);
43423
+ const currentUnpackRowLen = state2.getParameter(_gl.UNPACK_ROW_LENGTH);
43424
+ const currentUnpackImageHeight = state2.getParameter(_gl.UNPACK_IMAGE_HEIGHT);
43425
+ const currentUnpackSkipPixels = state2.getParameter(_gl.UNPACK_SKIP_PIXELS);
43426
+ const currentUnpackSkipRows = state2.getParameter(_gl.UNPACK_SKIP_ROWS);
43427
+ const currentUnpackSkipImages = state2.getParameter(_gl.UNPACK_SKIP_IMAGES);
43428
+ state2.pixelStorei(_gl.UNPACK_ROW_LENGTH, image.width);
43429
+ state2.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT, image.height);
43430
+ state2.pixelStorei(_gl.UNPACK_SKIP_PIXELS, minX);
43431
+ state2.pixelStorei(_gl.UNPACK_SKIP_ROWS, minY);
43432
+ state2.pixelStorei(_gl.UNPACK_SKIP_IMAGES, minZ);
43165
43433
  const isSrc3D = srcTexture.isDataArrayTexture || srcTexture.isData3DTexture;
43166
43434
  const isDst3D = dstTexture.isDataArrayTexture || dstTexture.isData3DTexture;
43167
43435
  if (srcTexture.isDepthTexture) {
@@ -43225,11 +43493,11 @@ void main() {
43225
43493
  }
43226
43494
  }
43227
43495
  }
43228
- _gl.pixelStorei(_gl.UNPACK_ROW_LENGTH, currentUnpackRowLen);
43229
- _gl.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT, currentUnpackImageHeight);
43230
- _gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS, currentUnpackSkipPixels);
43231
- _gl.pixelStorei(_gl.UNPACK_SKIP_ROWS, currentUnpackSkipRows);
43232
- _gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES, currentUnpackSkipImages);
43496
+ state2.pixelStorei(_gl.UNPACK_ROW_LENGTH, currentUnpackRowLen);
43497
+ state2.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT, currentUnpackImageHeight);
43498
+ state2.pixelStorei(_gl.UNPACK_SKIP_PIXELS, currentUnpackSkipPixels);
43499
+ state2.pixelStorei(_gl.UNPACK_SKIP_ROWS, currentUnpackSkipRows);
43500
+ state2.pixelStorei(_gl.UNPACK_SKIP_IMAGES, currentUnpackSkipImages);
43233
43501
  if (dstLevel === 0 && dstTexture.generateMipmaps) {
43234
43502
  _gl.generateMipmap(glTarget);
43235
43503
  }
@@ -43294,9 +43562,9 @@ void main() {
43294
43562
  }
43295
43563
  });
43296
43564
 
43297
- // ../../node_modules/.bun/use-sync-external-store@1.6.0+b1ab299f0a400331/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
43565
+ // ../../node_modules/.bun/use-sync-external-store@1.6.0+3f10a4be4e334a9b/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
43298
43566
  var require_use_sync_external_store_shim_development = __commonJS({
43299
- "../../node_modules/.bun/use-sync-external-store@1.6.0+b1ab299f0a400331/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports$1) {
43567
+ "../../node_modules/.bun/use-sync-external-store@1.6.0+3f10a4be4e334a9b/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports$1) {
43300
43568
  (function() {
43301
43569
  function is2(x2, y) {
43302
43570
  return x2 === y && (0 !== x2 || 1 / x2 === 1 / y) || x2 !== x2 && y !== y;
@@ -43357,18 +43625,18 @@ var require_use_sync_external_store_shim_development = __commonJS({
43357
43625
  }
43358
43626
  });
43359
43627
 
43360
- // ../../node_modules/.bun/use-sync-external-store@1.6.0+b1ab299f0a400331/node_modules/use-sync-external-store/shim/index.js
43628
+ // ../../node_modules/.bun/use-sync-external-store@1.6.0+3f10a4be4e334a9b/node_modules/use-sync-external-store/shim/index.js
43361
43629
  var require_shim = __commonJS({
43362
- "../../node_modules/.bun/use-sync-external-store@1.6.0+b1ab299f0a400331/node_modules/use-sync-external-store/shim/index.js"(exports$1, module) {
43630
+ "../../node_modules/.bun/use-sync-external-store@1.6.0+3f10a4be4e334a9b/node_modules/use-sync-external-store/shim/index.js"(exports$1, module) {
43363
43631
  {
43364
43632
  module.exports = require_use_sync_external_store_shim_development();
43365
43633
  }
43366
43634
  }
43367
43635
  });
43368
43636
 
43369
- // ../../node_modules/.bun/use-sync-external-store@1.6.0+b1ab299f0a400331/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js
43637
+ // ../../node_modules/.bun/use-sync-external-store@1.6.0+3f10a4be4e334a9b/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js
43370
43638
  var require_with_selector_development = __commonJS({
43371
- "../../node_modules/.bun/use-sync-external-store@1.6.0+b1ab299f0a400331/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports$1) {
43639
+ "../../node_modules/.bun/use-sync-external-store@1.6.0+3f10a4be4e334a9b/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports$1) {
43372
43640
  (function() {
43373
43641
  function is2(x2, y) {
43374
43642
  return x2 === y && (0 !== x2 || 1 / x2 === 1 / y) || x2 !== x2 && y !== y;
@@ -43432,19 +43700,19 @@ var require_with_selector_development = __commonJS({
43432
43700
  }
43433
43701
  });
43434
43702
 
43435
- // ../../node_modules/.bun/use-sync-external-store@1.6.0+b1ab299f0a400331/node_modules/use-sync-external-store/shim/with-selector.js
43703
+ // ../../node_modules/.bun/use-sync-external-store@1.6.0+3f10a4be4e334a9b/node_modules/use-sync-external-store/shim/with-selector.js
43436
43704
  var require_with_selector = __commonJS({
43437
- "../../node_modules/.bun/use-sync-external-store@1.6.0+b1ab299f0a400331/node_modules/use-sync-external-store/shim/with-selector.js"(exports$1, module) {
43705
+ "../../node_modules/.bun/use-sync-external-store@1.6.0+3f10a4be4e334a9b/node_modules/use-sync-external-store/shim/with-selector.js"(exports$1, module) {
43438
43706
  {
43439
43707
  module.exports = require_with_selector_development();
43440
43708
  }
43441
43709
  }
43442
43710
  });
43443
43711
 
43444
- // ../../node_modules/.bun/zustand@5.0.11+10f197a4cef36846/node_modules/zustand/esm/vanilla.mjs
43712
+ // ../../node_modules/.bun/zustand@5.0.11+5e3d5174673d7dcb/node_modules/zustand/esm/vanilla.mjs
43445
43713
  var createStoreImpl, createStore;
43446
43714
  var init_vanilla = __esm({
43447
- "../../node_modules/.bun/zustand@5.0.11+10f197a4cef36846/node_modules/zustand/esm/vanilla.mjs"() {
43715
+ "../../node_modules/.bun/zustand@5.0.11+5e3d5174673d7dcb/node_modules/zustand/esm/vanilla.mjs"() {
43448
43716
  createStoreImpl = (createState) => {
43449
43717
  let state2;
43450
43718
  const listeners = /* @__PURE__ */ new Set();
@@ -43482,7 +43750,7 @@ function useStoreWithEqualityFn(api, selector = identity, equalityFn) {
43482
43750
  }
43483
43751
  var import_with_selector, useSyncExternalStoreWithSelector, identity, createWithEqualityFnImpl, createWithEqualityFn;
43484
43752
  var init_traditional = __esm({
43485
- "../../node_modules/.bun/zustand@5.0.11+10f197a4cef36846/node_modules/zustand/esm/traditional.mjs"() {
43753
+ "../../node_modules/.bun/zustand@5.0.11+5e3d5174673d7dcb/node_modules/zustand/esm/traditional.mjs"() {
43486
43754
  import_with_selector = __toESM(require_with_selector(), 1);
43487
43755
  init_vanilla();
43488
43756
  ({ useSyncExternalStoreWithSelector } = import_with_selector.default);
@@ -43497,7 +43765,7 @@ var init_traditional = __esm({
43497
43765
  }
43498
43766
  });
43499
43767
 
43500
- // ../../node_modules/.bun/suspend-react@0.1.3+b1ab299f0a400331/node_modules/suspend-react/index.js
43768
+ // ../../node_modules/.bun/suspend-react@0.1.3+3f10a4be4e334a9b/node_modules/suspend-react/index.js
43501
43769
  function shallowEqualArrays(arrA, arrB, equal = (a2, b2) => a2 === b2) {
43502
43770
  if (arrA === arrB) return true;
43503
43771
  if (!arrA || !arrB) return false;
@@ -43545,7 +43813,7 @@ function query(fn, keys2 = null, preload2 = false, config = {}) {
43545
43813
  }
43546
43814
  var isPromise, globalCache, suspend, preload, clear;
43547
43815
  var init_suspend_react = __esm({
43548
- "../../node_modules/.bun/suspend-react@0.1.3+b1ab299f0a400331/node_modules/suspend-react/index.js"() {
43816
+ "../../node_modules/.bun/suspend-react@0.1.3+3f10a4be4e334a9b/node_modules/suspend-react/index.js"() {
43549
43817
  isPromise = (promise) => typeof promise === "object" && typeof promise.then === "function";
43550
43818
  globalCache = [];
43551
43819
  suspend = (fn, keys2, config) => query(fn, keys2, false, config);
@@ -43898,7 +44166,7 @@ function x() {
43898
44166
  }
43899
44167
  var a, m, p, b;
43900
44168
  var init_dist = __esm({
43901
- "../../node_modules/.bun/its-fine@2.0.0+26a211c426f3f87c/node_modules/its-fine/dist/index.js"() {
44169
+ "../../node_modules/.bun/its-fine@2.0.0+b2e33729a97476bf/node_modules/its-fine/dist/index.js"() {
43902
44170
  a = /* @__PURE__ */ l(/* @__PURE__ */ React10.createContext(null));
43903
44171
  m = class extends React10.Component {
43904
44172
  render() {
@@ -44214,6 +44482,35 @@ function releaseInternalPointerCapture(capturedMap, obj, captures, pointerId) {
44214
44482
  }
44215
44483
  }
44216
44484
  }
44485
+ function swapInteractivity(store, object, newObject) {
44486
+ const {
44487
+ internal
44488
+ } = store.getState();
44489
+ for (let i3 = 0; i3 < internal.interaction.length; i3++) {
44490
+ if (internal.interaction[i3] === object) internal.interaction[i3] = newObject;
44491
+ }
44492
+ for (let i3 = 0; i3 < internal.initialHits.length; i3++) {
44493
+ if (internal.initialHits[i3] === object) internal.initialHits[i3] = newObject;
44494
+ }
44495
+ internal.hovered.forEach((value, key) => {
44496
+ if (value.eventObject === object || value.object === object) {
44497
+ internal.hovered.delete(key);
44498
+ const next = {
44499
+ ...value,
44500
+ eventObject: value.eventObject === object ? newObject : value.eventObject,
44501
+ object: value.object === object ? newObject : value.object
44502
+ };
44503
+ internal.hovered.set(makeId(next), next);
44504
+ }
44505
+ });
44506
+ internal.capturedMap.forEach((captures) => {
44507
+ const captureData = captures.get(object);
44508
+ if (captureData) {
44509
+ captures.delete(object);
44510
+ captures.set(newObject, captureData);
44511
+ }
44512
+ });
44513
+ }
44217
44514
  function removeInteractivity(store, object) {
44218
44515
  const {
44219
44516
  internal
@@ -50609,10 +50906,10 @@ This ensures that you're testing the behavior the user would see in the browser.
50609
50906
  if ((ye & Zn) === Jn) {
50610
50907
  var n = e2.tag;
50611
50908
  if (n === 3 || n === 1 || n === 0 || n === 11 || n === 14 || n === 15) {
50612
- if (n = G(e2) || "ReactComponent", _m !== null) {
50613
- if (_m.has(n)) return;
50614
- _m.add(n);
50615
- } else _m = /* @__PURE__ */ new Set([n]);
50909
+ if (n = G(e2) || "ReactComponent", _m2 !== null) {
50910
+ if (_m2.has(n)) return;
50911
+ _m2.add(n);
50912
+ } else _m2 = /* @__PURE__ */ new Set([n]);
50616
50913
  B(e2, function() {
50617
50914
  console.error("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously tries to update the component. Move this work to useEffect instead.");
50618
50915
  });
@@ -51834,7 +52131,7 @@ Check the top-level render call using <` + i3 + ">.");
51834
52131
  var bp = Symbol.for;
51835
52132
  pm = bp("selector.component"), hm = bp("selector.has_pseudo_class"), mm = bp("selector.role"), gm = bp("selector.test_id"), ym = bp("selector.text");
51836
52133
  }
51837
- var bm = [], qb = typeof WeakMap == "function" ? WeakMap : Map, Jn = 0, Zn = 2, uo = 4, ki = 0, vp = 1, iu = 2, vm = 3, Tl = 4, Sm = 6, Ky = 5, ye = Jn, je = null, se = null, ae = 0, tr = 0, km = 1, lu = 2, Sp = 3, eb = 4, Eg = 5, kp = 6, wm = 7, Ig = 8, su = 9, Le = tr, Er = null, _l = false, Pd = false, Lg = false, Ta = 0, nn = ki, Rl = 0, El = 0, Ng = 0, rr = 0, uu = 0, wp = null, Bt = null, Pm = false, xm = 0, nb = 0, tb = 300, Pp = 1 / 0, Fg = 500, xp = null, gn = null, Il = null, zm = 0, Hg = 1, Ag = 2, rb = 3, Ll = 0, ob = 1, ab = 2, ib = 3, lb = 4, Cm = 5, Rn = 0, Nl = null, xd = null, qo = 0, jg = 0, Dg = -0, Wg = null, sb = null, ub = null, Go = zm, cb = null, Gb = 50, zp = 0, Ug = null, Bg = false, Tm = false, Jb = 50, cu = 0, Cp = null, zd = false, _m = null, db = false, fb = /* @__PURE__ */ new Set(), Zb = {}, co = null, Cd = null, pb = false;
52134
+ var bm = [], qb = typeof WeakMap == "function" ? WeakMap : Map, Jn = 0, Zn = 2, uo = 4, ki = 0, vp = 1, iu = 2, vm = 3, Tl = 4, Sm = 6, Ky = 5, ye = Jn, je = null, se = null, ae = 0, tr = 0, km = 1, lu = 2, Sp = 3, eb = 4, Eg = 5, kp = 6, wm = 7, Ig = 8, su = 9, Le = tr, Er = null, _l = false, Pd = false, Lg = false, Ta = 0, nn = ki, Rl = 0, El = 0, Ng = 0, rr = 0, uu = 0, wp = null, Bt = null, Pm = false, xm = 0, nb = 0, tb = 300, Pp = 1 / 0, Fg = 500, xp = null, gn = null, Il = null, zm = 0, Hg = 1, Ag = 2, rb = 3, Ll = 0, ob = 1, ab = 2, ib = 3, lb = 4, Cm = 5, Rn = 0, Nl = null, xd = null, qo = 0, jg = 0, Dg = -0, Wg = null, sb = null, ub = null, Go = zm, cb = null, Gb = 50, zp = 0, Ug = null, Bg = false, Tm = false, Jb = 50, cu = 0, Cp = null, zd = false, _m2 = null, db = false, fb = /* @__PURE__ */ new Set(), Zb = {}, co = null, Cd = null, pb = false;
51838
52135
  try {
51839
52136
  var o0 = Object.preventExtensions({});
51840
52137
  } catch {
@@ -52291,9 +52588,11 @@ function swapInstances() {
52291
52588
  if (parent) {
52292
52589
  var _instance$props$objec, _instance$props$args;
52293
52590
  const target = catalogue[toPascalCase(instance.type)];
52591
+ const prevObject = instance.object;
52294
52592
  instance.object = (_instance$props$objec = instance.props.object) != null ? _instance$props$objec : new target(...(_instance$props$args = instance.props.args) != null ? _instance$props$args : []);
52295
52593
  instance.object.__r3f = instance;
52296
52594
  setFiberRef(fiber, instance.object);
52595
+ swapInteractivity(findInitialRoot(instance), prevObject, instance.object);
52297
52596
  applyProps(instance.object, instance.props);
52298
52597
  if (instance.props.attach) {
52299
52598
  attach(parent, instance);
@@ -52877,8 +53176,8 @@ function createPointerEvents(store) {
52877
53176
  };
52878
53177
  }
52879
53178
  var import_scheduler, threeTypes, act2, isOrthographicCamera, isRef, isColorRepresentation, useIsomorphicLayoutEffect, ErrorBoundary, is, REACT_INTERNAL_PROPS, INDEX_REGEX, RESERVED_PROPS, MEMOIZED_PROTOTYPES, colorMaps, EVENT_REGEX, isObject3D, isRenderer, context, createStore2, memoizedLoaders, isConstructor$1, t, o2, r, e, packageData, Rm, Og, Mg, Rb, Eb, t0, r0, NoEventPriority, catalogue, PREFIX_REGEX, toPascalCase, i2, isConstructor, reconstructed, handleTextInstance, NO_CONTEXT, currentUpdatePriority, NoFlags, Update, reconciler, _roots, shallowLoose, globalEffects, globalAfterEffects, globalTailEffects, addEffect, addAfterEffect, addTail, subscribers, subscription, running, useFrameInProgress, repeat, frame, state, DOM_EVENTS;
52880
- var init_events_760a1017_esm = __esm({
52881
- "../../node_modules/.bun/@react-three+fiber@9.6.0+bae906b8c0d5d7d7/node_modules/@react-three/fiber/dist/events-760a1017.esm.js"() {
53179
+ var init_events_b389eeca_esm = __esm({
53180
+ "../../node_modules/.bun/@react-three+fiber@9.6.1+26134fee8850b5e9/node_modules/@react-three/fiber/dist/events-b389eeca.esm.js"() {
52882
53181
  init_three_module();
52883
53182
  init_traditional();
52884
53183
  init_suspend_react();
@@ -53202,7 +53501,7 @@ var init_events_760a1017_esm = __esm({
53202
53501
  e = 2;
53203
53502
  packageData = {
53204
53503
  name: "@react-three/fiber",
53205
- version: "9.6.0",
53504
+ version: "9.6.1",
53206
53505
  description: "A React renderer for Threejs",
53207
53506
  keywords: [
53208
53507
  "react",
@@ -53596,13 +53895,13 @@ function E(n) {
53596
53895
  }
53597
53896
  var k, D;
53598
53897
  var init_dist2 = __esm({
53599
- "../../node_modules/.bun/react-use-measure@2.1.7+bf16f8eded5e12ee/node_modules/react-use-measure/dist/index.js"() {
53898
+ "../../node_modules/.bun/react-use-measure@2.1.7+21ccd8898788a04d/node_modules/react-use-measure/dist/index.js"() {
53600
53899
  k = ["x", "y", "top", "bottom", "left", "right", "width", "height"];
53601
53900
  D = (n, t2) => k.every((o3) => n[o3] === t2[o3]);
53602
53901
  }
53603
53902
  });
53604
53903
 
53605
- // ../../node_modules/.bun/@react-three+fiber@9.6.0+bae906b8c0d5d7d7/node_modules/@react-three/fiber/dist/react-three-fiber.esm.js
53904
+ // ../../node_modules/.bun/@react-three+fiber@9.6.1+26134fee8850b5e9/node_modules/@react-three/fiber/dist/react-three-fiber.esm.js
53606
53905
  var react_three_fiber_esm_exports = {};
53607
53906
  __export(react_three_fiber_esm_exports, {
53608
53907
  Canvas: () => Canvas,
@@ -53771,9 +54070,9 @@ function Canvas(props) {
53771
54070
  });
53772
54071
  }
53773
54072
  var init_react_three_fiber_esm = __esm({
53774
- "../../node_modules/.bun/@react-three+fiber@9.6.0+bae906b8c0d5d7d7/node_modules/@react-three/fiber/dist/react-three-fiber.esm.js"() {
53775
- init_events_760a1017_esm();
53776
- init_events_760a1017_esm();
54073
+ "../../node_modules/.bun/@react-three+fiber@9.6.1+26134fee8850b5e9/node_modules/@react-three/fiber/dist/react-three-fiber.esm.js"() {
54074
+ init_events_b389eeca_esm();
54075
+ init_events_b389eeca_esm();
53777
54076
  init_three_module();
53778
54077
  init_dist2();
53779
54078
  init_dist();
@@ -53845,7 +54144,7 @@ function isRefObject(ref) {
53845
54144
  }
53846
54145
  var v1, v2, v3, v4, epsilon, getCameraCSSMatrix, getObjectCSSMatrix, Html;
53847
54146
  var init_Html = __esm({
53848
- "../../node_modules/.bun/@react-three+drei@10.7.7+cdb3bc7f51872c1f/node_modules/@react-three/drei/web/Html.js"() {
54147
+ "../../node_modules/.bun/@react-three+drei@10.7.7+20209eb6acc591f5/node_modules/@react-three/drei/web/Html.js"() {
53849
54148
  init_extends();
53850
54149
  init_three_module();
53851
54150
  init_react_three_fiber_esm();
@@ -54162,16 +54461,16 @@ var init_Html = __esm({
54162
54461
  }
54163
54462
  });
54164
54463
 
54165
- // ../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/_polyfill/constants.js
54464
+ // ../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/_polyfill/constants.js
54166
54465
  var version;
54167
54466
  var init_constants = __esm({
54168
- "../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/_polyfill/constants.js"() {
54467
+ "../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/_polyfill/constants.js"() {
54169
54468
  init_three_module();
54170
54469
  version = /* @__PURE__ */ (() => parseInt(REVISION.replace(/\D+/g, "")))();
54171
54470
  }
54172
54471
  });
54173
54472
 
54174
- // ../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/utils/BufferGeometryUtils.js
54473
+ // ../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/utils/BufferGeometryUtils.js
54175
54474
  function toTrianglesDrawMode(geometry, drawMode) {
54176
54475
  if (drawMode === TrianglesDrawMode) {
54177
54476
  console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.");
@@ -54231,15 +54530,15 @@ function toTrianglesDrawMode(geometry, drawMode) {
54231
54530
  }
54232
54531
  }
54233
54532
  var init_BufferGeometryUtils = __esm({
54234
- "../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/utils/BufferGeometryUtils.js"() {
54533
+ "../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/utils/BufferGeometryUtils.js"() {
54235
54534
  init_three_module();
54236
54535
  }
54237
54536
  });
54238
54537
 
54239
- // ../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/controls/EventDispatcher.js
54538
+ // ../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/controls/EventDispatcher.js
54240
54539
  var __defProp2, __defNormalProp, __publicField, EventDispatcher2;
54241
54540
  var init_EventDispatcher = __esm({
54242
- "../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/controls/EventDispatcher.js"() {
54541
+ "../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/controls/EventDispatcher.js"() {
54243
54542
  __defProp2 = Object.defineProperty;
54244
54543
  __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
54245
54544
  __publicField = (obj, key, value) => {
@@ -54316,10 +54615,10 @@ var init_EventDispatcher = __esm({
54316
54615
  }
54317
54616
  });
54318
54617
 
54319
- // ../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/controls/OrbitControls.js
54618
+ // ../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/controls/OrbitControls.js
54320
54619
  var __defProp3, __defNormalProp2, __publicField2, _ray2, _plane, TILT_LIMIT, moduloWrapAround, OrbitControls;
54321
54620
  var init_OrbitControls = __esm({
54322
- "../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/controls/OrbitControls.js"() {
54621
+ "../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/controls/OrbitControls.js"() {
54323
54622
  init_three_module();
54324
54623
  init_EventDispatcher();
54325
54624
  __defProp3 = Object.defineProperty;
@@ -55155,7 +55454,7 @@ var init_OrbitControls = __esm({
55155
55454
  }
55156
55455
  });
55157
55456
 
55158
- // ../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/_polyfill/LoaderUtils.js
55457
+ // ../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/_polyfill/LoaderUtils.js
55159
55458
  function decodeText(array) {
55160
55459
  if (typeof TextDecoder !== "undefined") {
55161
55460
  return new TextDecoder().decode(array);
@@ -55171,11 +55470,11 @@ function decodeText(array) {
55171
55470
  }
55172
55471
  }
55173
55472
  var init_LoaderUtils = __esm({
55174
- "../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/_polyfill/LoaderUtils.js"() {
55473
+ "../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/_polyfill/LoaderUtils.js"() {
55175
55474
  }
55176
55475
  });
55177
55476
 
55178
- // ../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/loaders/GLTFLoader.js
55477
+ // ../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/loaders/GLTFLoader.js
55179
55478
  function GLTFRegistry() {
55180
55479
  let objects = {};
55181
55480
  return {
@@ -55421,7 +55720,7 @@ function addPrimitiveAttributes(geometry, primitiveDef, parser) {
55421
55720
  }
55422
55721
  var SRGBColorSpace2, LinearSRGBColorSpace2, sRGBEncoding, LinearEncoding, GLTFLoader, EXTENSIONS, GLTFLightsExtension, GLTFMaterialsUnlitExtension, GLTFMaterialsEmissiveStrengthExtension, GLTFMaterialsClearcoatExtension, GLTFMaterialsDispersionExtension, GLTFMaterialsIridescenceExtension, GLTFMaterialsSheenExtension, GLTFMaterialsTransmissionExtension, GLTFMaterialsVolumeExtension, GLTFMaterialsIorExtension, GLTFMaterialsSpecularExtension, GLTFMaterialsBumpExtension, GLTFMaterialsAnisotropyExtension, GLTFTextureBasisUExtension, GLTFTextureWebPExtension, GLTFTextureAVIFExtension, GLTFMeshoptCompression, GLTFMeshGpuInstancing, BINARY_EXTENSION_HEADER_MAGIC, BINARY_EXTENSION_HEADER_LENGTH, BINARY_EXTENSION_CHUNK_TYPES, GLTFBinaryExtension, GLTFDracoMeshCompressionExtension, GLTFTextureTransformExtension, GLTFMeshQuantizationExtension, GLTFCubicSplineInterpolant, _q, GLTFCubicSplineQuaternionInterpolant, WEBGL_CONSTANTS, WEBGL_COMPONENT_TYPES, WEBGL_FILTERS, WEBGL_WRAPPINGS, WEBGL_TYPE_SIZES, ATTRIBUTES, PATH_PROPERTIES, INTERPOLATION, ALPHA_MODES, _identityMatrix2, GLTFParser;
55423
55722
  var init_GLTFLoader = __esm({
55424
- "../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/loaders/GLTFLoader.js"() {
55723
+ "../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/loaders/GLTFLoader.js"() {
55425
55724
  init_three_module();
55426
55725
  init_BufferGeometryUtils();
55427
55726
  init_constants();
@@ -57803,7 +58102,7 @@ var init_GLTFLoader = __esm({
57803
58102
  }
57804
58103
  });
57805
58104
 
57806
- // ../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/loaders/DRACOLoader.js
58105
+ // ../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/loaders/DRACOLoader.js
57807
58106
  function DRACOWorker() {
57808
58107
  let decoderConfig;
57809
58108
  let decoderPending;
@@ -57931,7 +58230,7 @@ function DRACOWorker() {
57931
58230
  }
57932
58231
  var _taskCache, DRACOLoader;
57933
58232
  var init_DRACOLoader = __esm({
57934
- "../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/loaders/DRACOLoader.js"() {
58233
+ "../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/loaders/DRACOLoader.js"() {
57935
58234
  init_three_module();
57936
58235
  _taskCache = /* @__PURE__ */ new WeakMap();
57937
58236
  DRACOLoader = class extends Loader {
@@ -58148,10 +58447,10 @@ var init_DRACOLoader = __esm({
58148
58447
  }
58149
58448
  });
58150
58449
 
58151
- // ../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/libs/MeshoptDecoder.js
58450
+ // ../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/libs/MeshoptDecoder.js
58152
58451
  var generated, MeshoptDecoder;
58153
58452
  var init_MeshoptDecoder = __esm({
58154
- "../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/libs/MeshoptDecoder.js"() {
58453
+ "../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/libs/MeshoptDecoder.js"() {
58155
58454
  MeshoptDecoder = () => {
58156
58455
  if (generated)
58157
58456
  return generated;
@@ -58372,9 +58671,9 @@ var init_MeshoptDecoder = __esm({
58372
58671
  }
58373
58672
  });
58374
58673
 
58375
- // ../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/index.js
58674
+ // ../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/index.js
58376
58675
  var init_three_stdlib = __esm({
58377
- "../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/index.js"() {
58676
+ "../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/index.js"() {
58378
58677
  init_OrbitControls();
58379
58678
  init_GLTFLoader();
58380
58679
  init_DRACOLoader();
@@ -58400,7 +58699,7 @@ function extensions(useDraco = true, useMeshopt = true, extendLoader) {
58400
58699
  }
58401
58700
  var dracoLoader, decoderPath, useGLTF;
58402
58701
  var init_Gltf = __esm({
58403
- "../../node_modules/.bun/@react-three+drei@10.7.7+cdb3bc7f51872c1f/node_modules/@react-three/drei/core/Gltf.js"() {
58702
+ "../../node_modules/.bun/@react-three+drei@10.7.7+20209eb6acc591f5/node_modules/@react-three/drei/core/Gltf.js"() {
58404
58703
  init_extends();
58405
58704
  init_three_stdlib();
58406
58705
  init_react_three_fiber_esm();
@@ -58416,7 +58715,7 @@ var init_Gltf = __esm({
58416
58715
  });
58417
58716
  var OrbitControls2;
58418
58717
  var init_OrbitControls2 = __esm({
58419
- "../../node_modules/.bun/@react-three+drei@10.7.7+cdb3bc7f51872c1f/node_modules/@react-three/drei/core/OrbitControls.js"() {
58718
+ "../../node_modules/.bun/@react-three+drei@10.7.7+20209eb6acc591f5/node_modules/@react-three/drei/core/OrbitControls.js"() {
58420
58719
  init_extends();
58421
58720
  init_react_three_fiber_esm();
58422
58721
  init_three_stdlib();
@@ -58494,12 +58793,12 @@ var init_OrbitControls2 = __esm({
58494
58793
  }
58495
58794
  });
58496
58795
  var init_camera_controls_module = __esm({
58497
- "../../node_modules/.bun/camera-controls@3.1.2+9459c15c9e4c81b0/node_modules/camera-controls/dist/camera-controls.module.js"() {
58796
+ "../../node_modules/.bun/camera-controls@3.1.2+7b565cd016fb14f9/node_modules/camera-controls/dist/camera-controls.module.js"() {
58498
58797
  }
58499
58798
  });
58500
58799
  var Center;
58501
58800
  var init_Center = __esm({
58502
- "../../node_modules/.bun/@react-three+drei@10.7.7+cdb3bc7f51872c1f/node_modules/@react-three/drei/core/Center.js"() {
58801
+ "../../node_modules/.bun/@react-three+drei@10.7.7+20209eb6acc591f5/node_modules/@react-three/drei/core/Center.js"() {
58503
58802
  init_extends();
58504
58803
  init_three_module();
58505
58804
  Center = /* @__PURE__ */ React10.forwardRef(function Center2({
@@ -58564,9 +58863,9 @@ var init_Center = __esm({
58564
58863
  }
58565
58864
  });
58566
58865
 
58567
- // ../../node_modules/.bun/@react-three+drei@10.7.7+cdb3bc7f51872c1f/node_modules/@react-three/drei/index.js
58866
+ // ../../node_modules/.bun/@react-three+drei@10.7.7+20209eb6acc591f5/node_modules/@react-three/drei/index.js
58568
58867
  var init_drei = __esm({
58569
- "../../node_modules/.bun/@react-three+drei@10.7.7+cdb3bc7f51872c1f/node_modules/@react-three/drei/index.js"() {
58868
+ "../../node_modules/.bun/@react-three+drei@10.7.7+20209eb6acc591f5/node_modules/@react-three/drei/index.js"() {
58570
58869
  init_Html();
58571
58870
  init_Gltf();
58572
58871
  init_OrbitControls2();
@@ -124261,7 +124560,7 @@ scheduler/cjs/scheduler.development.js:
124261
124560
  * LICENSE file in the root directory of this source tree.
124262
124561
  *)
124263
124562
 
124264
- @react-three/fiber/dist/events-760a1017.esm.js:
124563
+ @react-three/fiber/dist/events-b389eeca.esm.js:
124265
124564
  (**
124266
124565
  * @license React
124267
124566
  * react-reconciler-constants.production.js