pptx-react-viewer 1.1.3 → 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-BMjoxMDV.d.ts → SvgExporter-0TxiiorD.d.ts} +1 -1
  9. package/node_modules/pptx-viewer-core/dist/{SvgExporter-z6AbXRQg.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 +2711 -304
  13. package/node_modules/pptx-viewer-core/dist/cli/index.mjs +2711 -304
  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 +692 -44
  17. package/node_modules/pptx-viewer-core/dist/index.d.ts +692 -44
  18. package/node_modules/pptx-viewer-core/dist/index.js +2794 -373
  19. package/node_modules/pptx-viewer-core/dist/index.mjs +2785 -373
  20. package/node_modules/pptx-viewer-core/dist/{presentation-CchuDGfU.d.mts → presentation-ArhfImJ5.d.mts} +225 -8
  21. package/node_modules/pptx-viewer-core/dist/{presentation-CchuDGfU.d.ts → presentation-ArhfImJ5.d.ts} +225 -8
  22. package/node_modules/pptx-viewer-core/dist/{text-operations-CeukUztU.d.mts → text-operations-CLj-sJyk.d.mts} +1 -1
  23. package/node_modules/pptx-viewer-core/dist/{text-operations-e7JxgI5l.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.js CHANGED
@@ -90,7 +90,7 @@ var init_extends = __esm({
90
90
  }
91
91
  });
92
92
 
93
- // ../../node_modules/.bun/three@0.183.2/node_modules/three/build/three.core.js
93
+ // ../../node_modules/.bun/three@0.184.0/node_modules/three/build/three.core.js
94
94
  function arrayNeedsUint32(array) {
95
95
  for (let i3 = array.length - 1; i3 >= 0; --i3) {
96
96
  if (array[i3] >= 65535) return true;
@@ -1258,7 +1258,7 @@ function cloneUniforms(src) {
1258
1258
  dst[u2] = {};
1259
1259
  for (const p3 in src[u2]) {
1260
1260
  const property = src[u2][p3];
1261
- if (property && (property.isColor || property.isMatrix3 || property.isMatrix4 || property.isVector2 || property.isVector3 || property.isVector4 || property.isTexture || property.isQuaternion)) {
1261
+ if (isThreeObject(property)) {
1262
1262
  if (property.isRenderTargetTexture) {
1263
1263
  warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().");
1264
1264
  dst[u2][p3] = null;
@@ -1266,7 +1266,15 @@ function cloneUniforms(src) {
1266
1266
  dst[u2][p3] = property.clone();
1267
1267
  }
1268
1268
  } else if (Array.isArray(property)) {
1269
- dst[u2][p3] = property.slice();
1269
+ if (isThreeObject(property[0])) {
1270
+ const clonedProperty = [];
1271
+ for (let i3 = 0, l2 = property.length; i3 < l2; i3++) {
1272
+ clonedProperty[i3] = property[i3].clone();
1273
+ }
1274
+ dst[u2][p3] = clonedProperty;
1275
+ } else {
1276
+ dst[u2][p3] = property.slice();
1277
+ }
1270
1278
  } else {
1271
1279
  dst[u2][p3] = property;
1272
1280
  }
@@ -1277,13 +1285,16 @@ function cloneUniforms(src) {
1277
1285
  function mergeUniforms(uniforms) {
1278
1286
  const merged = {};
1279
1287
  for (let u2 = 0; u2 < uniforms.length; u2++) {
1280
- const tmp2 = cloneUniforms(uniforms[u2]);
1281
- for (const p3 in tmp2) {
1282
- merged[p3] = tmp2[p3];
1288
+ const tmp3 = cloneUniforms(uniforms[u2]);
1289
+ for (const p3 in tmp3) {
1290
+ merged[p3] = tmp3[p3];
1283
1291
  }
1284
1292
  }
1285
1293
  return merged;
1286
1294
  }
1295
+ function isThreeObject(property) {
1296
+ return property && (property.isColor || property.isMatrix3 || property.isMatrix4 || property.isVector2 || property.isVector3 || property.isVector4 || property.isTexture || property.isQuaternion);
1297
+ }
1287
1298
  function cloneUniformsGroups(src) {
1288
1299
  const dst = [];
1289
1300
  for (let u2 = 0; u2 < src.length; u2++) {
@@ -1706,10 +1717,10 @@ function getTextureTypeByteLength(type) {
1706
1717
  }
1707
1718
  throw new Error(`Unknown texture type ${type}.`);
1708
1719
  }
1709
- 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;
1720
+ 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;
1710
1721
  var init_three_core = __esm({
1711
- "../../node_modules/.bun/three@0.183.2/node_modules/three/build/three.core.js"() {
1712
- REVISION = "183";
1722
+ "../../node_modules/.bun/three@0.184.0/node_modules/three/build/three.core.js"() {
1723
+ REVISION = "184";
1713
1724
  MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
1714
1725
  TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
1715
1726
  CullFaceNone = 0;
@@ -2272,6 +2283,9 @@ var init_three_core = __esm({
2272
2283
  denormalize
2273
2284
  };
2274
2285
  Vector2 = class _Vector2 {
2286
+ static {
2287
+ _Vector2.prototype.isVector2 = true;
2288
+ }
2275
2289
  /**
2276
2290
  * Constructs a new 2D vector.
2277
2291
  *
@@ -2279,7 +2293,6 @@ var init_three_core = __esm({
2279
2293
  * @param {number} [y=0] - The y value of this vector.
2280
2294
  */
2281
2295
  constructor(x2 = 0, y = 0) {
2282
- _Vector2.prototype.isVector2 = true;
2283
2296
  this.x = x2;
2284
2297
  this.y = y;
2285
2298
  }
@@ -3497,6 +3510,9 @@ var init_three_core = __esm({
3497
3510
  }
3498
3511
  };
3499
3512
  Vector3 = class _Vector3 {
3513
+ static {
3514
+ _Vector3.prototype.isVector3 = true;
3515
+ }
3500
3516
  /**
3501
3517
  * Constructs a new 3D vector.
3502
3518
  *
@@ -3505,7 +3521,6 @@ var init_three_core = __esm({
3505
3521
  * @param {number} [z=0] - The z value of this vector.
3506
3522
  */
3507
3523
  constructor(x2 = 0, y = 0, z = 0) {
3508
- _Vector3.prototype.isVector3 = true;
3509
3524
  this.x = x2;
3510
3525
  this.y = y;
3511
3526
  this.z = z;
@@ -4403,6 +4418,9 @@ var init_three_core = __esm({
4403
4418
  _vector$c = /* @__PURE__ */ new Vector3();
4404
4419
  _quaternion$5 = /* @__PURE__ */ new Quaternion();
4405
4420
  Matrix3 = class _Matrix3 {
4421
+ static {
4422
+ _Matrix3.prototype.isMatrix3 = true;
4423
+ }
4406
4424
  /**
4407
4425
  * Constructs a new 3x3 matrix. The arguments are supposed to be
4408
4426
  * in row-major order. If no arguments are provided, the constructor
@@ -4419,7 +4437,6 @@ var init_three_core = __esm({
4419
4437
  * @param {number} [n33] - 3-3 matrix element.
4420
4438
  */
4421
4439
  constructor(n11, n12, n13, n21, n22, n23, n31, n32, n33) {
4422
- _Matrix3.prototype.isMatrix3 = true;
4423
4440
  this.elements = [
4424
4441
  1,
4425
4442
  0,
@@ -4641,17 +4658,17 @@ var init_three_core = __esm({
4641
4658
  * @return {Matrix3} A reference to this matrix.
4642
4659
  */
4643
4660
  transpose() {
4644
- let tmp2;
4661
+ let tmp3;
4645
4662
  const m2 = this.elements;
4646
- tmp2 = m2[1];
4663
+ tmp3 = m2[1];
4647
4664
  m2[1] = m2[3];
4648
- m2[3] = tmp2;
4649
- tmp2 = m2[2];
4665
+ m2[3] = tmp3;
4666
+ tmp3 = m2[2];
4650
4667
  m2[2] = m2[6];
4651
- m2[6] = tmp2;
4652
- tmp2 = m2[5];
4668
+ m2[6] = tmp3;
4669
+ tmp3 = m2[5];
4653
4670
  m2[5] = m2[7];
4654
- m2[7] = tmp2;
4671
+ m2[7] = tmp3;
4655
4672
  return this;
4656
4673
  }
4657
4674
  /**
@@ -5001,7 +5018,7 @@ var init_three_core = __esm({
5001
5018
  if (typeof HTMLVideoElement !== "undefined" && data instanceof HTMLVideoElement) {
5002
5019
  target.set(data.videoWidth, data.videoHeight, 0);
5003
5020
  } else if (typeof VideoFrame !== "undefined" && data instanceof VideoFrame) {
5004
- target.set(data.displayHeight, data.displayWidth, 0);
5021
+ target.set(data.displayWidth, data.displayHeight, 0);
5005
5022
  } else if (data !== null) {
5006
5023
  target.set(data.width, data.height, data.depth || 0);
5007
5024
  } else {
@@ -5114,6 +5131,7 @@ var init_three_core = __esm({
5114
5131
  this.isRenderTargetTexture = false;
5115
5132
  this.isArrayTexture = image && image.depth && image.depth > 1 ? true : false;
5116
5133
  this.pmremVersion = 0;
5134
+ this.normalized = false;
5117
5135
  }
5118
5136
  /**
5119
5137
  * The width of the texture in pixels.
@@ -5141,11 +5159,11 @@ var init_three_core = __esm({
5141
5159
  get image() {
5142
5160
  return this.source.data;
5143
5161
  }
5144
- set image(value = null) {
5162
+ set image(value) {
5145
5163
  this.source.data = value;
5146
5164
  }
5147
5165
  /**
5148
- * Updates the texture transformation matrix from the from the properties {@link Texture#offset},
5166
+ * Updates the texture transformation matrix from the properties {@link Texture#offset},
5149
5167
  * {@link Texture#repeat}, {@link Texture#rotation}, and {@link Texture#center}.
5150
5168
  */
5151
5169
  updateMatrix() {
@@ -5194,6 +5212,7 @@ var init_three_core = __esm({
5194
5212
  this.format = source.format;
5195
5213
  this.internalFormat = source.internalFormat;
5196
5214
  this.type = source.type;
5215
+ this.normalized = source.normalized;
5197
5216
  this.offset.copy(source.offset);
5198
5217
  this.repeat.copy(source.repeat);
5199
5218
  this.center.copy(source.center);
@@ -5270,6 +5289,7 @@ var init_three_core = __esm({
5270
5289
  format: this.format,
5271
5290
  internalFormat: this.internalFormat,
5272
5291
  type: this.type,
5292
+ normalized: this.normalized,
5273
5293
  colorSpace: this.colorSpace,
5274
5294
  minFilter: this.minFilter,
5275
5295
  magFilter: this.magFilter,
@@ -5375,6 +5395,9 @@ var init_three_core = __esm({
5375
5395
  Texture.DEFAULT_MAPPING = UVMapping;
5376
5396
  Texture.DEFAULT_ANISOTROPY = 1;
5377
5397
  Vector4 = class _Vector4 {
5398
+ static {
5399
+ _Vector4.prototype.isVector4 = true;
5400
+ }
5378
5401
  /**
5379
5402
  * Constructs a new 4D vector.
5380
5403
  *
@@ -5384,7 +5407,6 @@ var init_three_core = __esm({
5384
5407
  * @param {number} [w=1] - The w value of this vector.
5385
5408
  */
5386
5409
  constructor(x2 = 0, y = 0, z = 0, w = 1) {
5387
- _Vector4.prototype.isVector4 = true;
5388
5410
  this.x = x2;
5389
5411
  this.y = y;
5390
5412
  this.z = z;
@@ -6292,6 +6314,7 @@ var init_three_core = __esm({
6292
6314
  this.resolveStencilBuffer = source.resolveStencilBuffer;
6293
6315
  if (source.depthTexture !== null) this.depthTexture = source.depthTexture.clone();
6294
6316
  this.samples = source.samples;
6317
+ this.multiview = source.multiview;
6295
6318
  return this;
6296
6319
  }
6297
6320
  /**
@@ -6415,6 +6438,9 @@ var init_three_core = __esm({
6415
6438
  }
6416
6439
  };
6417
6440
  Matrix4 = class _Matrix4 {
6441
+ static {
6442
+ _Matrix4.prototype.isMatrix4 = true;
6443
+ }
6418
6444
  /**
6419
6445
  * Constructs a new 4x4 matrix. The arguments are supposed to be
6420
6446
  * in row-major order. If no arguments are provided, the constructor
@@ -6438,7 +6464,6 @@ var init_three_core = __esm({
6438
6464
  * @param {number} [n44] - 4-4 matrix element.
6439
6465
  */
6440
6466
  constructor(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) {
6441
- _Matrix4.prototype.isMatrix4 = true;
6442
6467
  this.elements = [
6443
6468
  1,
6444
6469
  0,
@@ -6943,25 +6968,25 @@ var init_three_core = __esm({
6943
6968
  */
6944
6969
  transpose() {
6945
6970
  const te = this.elements;
6946
- let tmp2;
6947
- tmp2 = te[1];
6971
+ let tmp3;
6972
+ tmp3 = te[1];
6948
6973
  te[1] = te[4];
6949
- te[4] = tmp2;
6950
- tmp2 = te[2];
6974
+ te[4] = tmp3;
6975
+ tmp3 = te[2];
6951
6976
  te[2] = te[8];
6952
- te[8] = tmp2;
6953
- tmp2 = te[6];
6977
+ te[8] = tmp3;
6978
+ tmp3 = te[6];
6954
6979
  te[6] = te[9];
6955
- te[9] = tmp2;
6956
- tmp2 = te[3];
6980
+ te[9] = tmp3;
6981
+ tmp3 = te[3];
6957
6982
  te[3] = te[12];
6958
- te[12] = tmp2;
6959
- tmp2 = te[7];
6983
+ te[12] = tmp3;
6984
+ tmp3 = te[7];
6960
6985
  te[7] = te[13];
6961
- te[13] = tmp2;
6962
- tmp2 = te[11];
6986
+ te[13] = tmp3;
6987
+ tmp3 = te[11];
6963
6988
  te[11] = te[14];
6964
- te[14] = tmp2;
6989
+ te[14] = tmp3;
6965
6990
  return this;
6966
6991
  }
6967
6992
  /**
@@ -8801,9 +8826,7 @@ var init_three_core = __esm({
8801
8826
  this.rotation.order = source.rotation.order;
8802
8827
  this.quaternion.copy(source.quaternion);
8803
8828
  this.scale.copy(source.scale);
8804
- if (source.pivot !== null) {
8805
- this.pivot = source.pivot.clone();
8806
- }
8829
+ this.pivot = source.pivot !== null ? source.pivot.clone() : null;
8807
8830
  this.matrix.copy(source.matrix);
8808
8831
  this.matrixWorld.copy(source.matrixWorld);
8809
8832
  this.matrixAutoUpdate = source.matrixAutoUpdate;
@@ -8893,6 +8916,7 @@ var init_three_core = __esm({
8893
8916
  this._grip.linearVelocity = new Vector3();
8894
8917
  this._grip.hasAngularVelocity = false;
8895
8918
  this._grip.angularVelocity = new Vector3();
8919
+ this._grip.eventsEnabled = false;
8896
8920
  }
8897
8921
  return this._grip;
8898
8922
  }
@@ -9022,6 +9046,13 @@ var init_three_core = __esm({
9022
9046
  } else {
9023
9047
  grip.hasAngularVelocity = false;
9024
9048
  }
9049
+ if (grip.eventsEnabled) {
9050
+ grip.dispatchEvent({
9051
+ type: "gripUpdated",
9052
+ data: inputSource,
9053
+ target: this
9054
+ });
9055
+ }
9025
9056
  }
9026
9057
  }
9027
9058
  }
@@ -10101,7 +10132,7 @@ var init_three_core = __esm({
10101
10132
  static isFrontFacing(a2, b2, c2, direction) {
10102
10133
  _v0$2.subVectors(c2, b2);
10103
10134
  _v1$5.subVectors(a2, b2);
10104
- return _v0$2.cross(_v1$5).dot(direction) < 0 ? true : false;
10135
+ return _v0$2.cross(_v1$5).dot(direction) < 0;
10105
10136
  }
10106
10137
  /**
10107
10138
  * Sets the triangle's vertices by copying the given values.
@@ -10872,7 +10903,7 @@ var init_three_core = __esm({
10872
10903
  _vector$a = /* @__PURE__ */ new Vector3();
10873
10904
  _vector2$1 = /* @__PURE__ */ new Vector2();
10874
10905
  _id$2 = 0;
10875
- BufferAttribute = class {
10906
+ BufferAttribute = class extends EventDispatcher {
10876
10907
  /**
10877
10908
  * Constructs a new buffer attribute.
10878
10909
  *
@@ -10881,6 +10912,7 @@ var init_three_core = __esm({
10881
10912
  * @param {boolean} [normalized=false] - Whether the data are normalized or not.
10882
10913
  */
10883
10914
  constructor(array, itemSize, normalized = false) {
10915
+ super();
10884
10916
  if (Array.isArray(array)) {
10885
10917
  throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");
10886
10918
  }
@@ -11277,6 +11309,12 @@ var init_three_core = __esm({
11277
11309
  if (this.usage !== StaticDrawUsage) data.usage = this.usage;
11278
11310
  return data;
11279
11311
  }
11312
+ /**
11313
+ * Disposes of the buffer attribute. Available only in {@link WebGPURenderer}.
11314
+ */
11315
+ dispose() {
11316
+ this.dispatchEvent({ type: "dispose" });
11317
+ }
11280
11318
  };
11281
11319
  Int8BufferAttribute = class extends BufferAttribute {
11282
11320
  /**
@@ -12218,18 +12256,18 @@ var init_three_core = __esm({
12218
12256
  );
12219
12257
  }
12220
12258
  }
12221
- const tmp2 = new Vector3(), tmp22 = new Vector3();
12259
+ const tmp3 = new Vector3(), tmp22 = new Vector3();
12222
12260
  const n = new Vector3(), n2 = new Vector3();
12223
12261
  function handleVertex(v) {
12224
12262
  n.fromBufferAttribute(normalAttribute, v);
12225
12263
  n2.copy(n);
12226
12264
  const t2 = tan1[v];
12227
- tmp2.copy(t2);
12228
- tmp2.sub(n.multiplyScalar(n.dot(t2))).normalize();
12265
+ tmp3.copy(t2);
12266
+ tmp3.sub(n.multiplyScalar(n.dot(t2))).normalize();
12229
12267
  tmp22.crossVectors(n2, t2);
12230
12268
  const test = tmp22.dot(tan2[v]);
12231
12269
  const w = test < 0 ? -1 : 1;
12232
- tangentAttribute.setXYZW(v, tmp2.x, tmp2.y, tmp2.z, w);
12270
+ tangentAttribute.setXYZW(v, tmp3.x, tmp3.y, tmp3.z, w);
12233
12271
  }
12234
12272
  for (let i3 = 0, il = groups.length; i3 < il; ++i3) {
12235
12273
  const group = groups[i3];
@@ -14380,10 +14418,10 @@ var init_three_core = __esm({
14380
14418
  }
14381
14419
  }
14382
14420
  };
14383
- _basePosition = /* @__PURE__ */ new Vector3();
14421
+ _baseVector = /* @__PURE__ */ new Vector4();
14384
14422
  _skinIndex = /* @__PURE__ */ new Vector4();
14385
14423
  _skinWeight = /* @__PURE__ */ new Vector4();
14386
- _vector3 = /* @__PURE__ */ new Vector3();
14424
+ _vector4 = /* @__PURE__ */ new Vector4();
14387
14425
  _matrix4 = /* @__PURE__ */ new Matrix4();
14388
14426
  _vertex = /* @__PURE__ */ new Vector3();
14389
14427
  _sphere$5 = /* @__PURE__ */ new Sphere();
@@ -14525,28 +14563,37 @@ var init_three_core = __esm({
14525
14563
  }
14526
14564
  /**
14527
14565
  * Applies the bone transform associated with the given index to the given
14528
- * vertex position. Returns the updated vector.
14566
+ * vector. Can be used to transform positions or direction vectors by providing
14567
+ * a Vector4 with 1 or 0 in the w component respectively. Returns the updated vector.
14529
14568
  *
14530
14569
  * @param {number} index - The vertex index.
14531
- * @param {Vector3} target - The target object that is used to store the method's result.
14532
- * the skinned mesh's world matrix will be used instead.
14533
- * @return {Vector3} The updated vertex position.
14570
+ * @param {Vector3|Vector4} target - The target object that is used to store the method's result.
14571
+ * @return {Vector3|Vector4} The updated vertex attribute data.
14534
14572
  */
14535
14573
  applyBoneTransform(index, target) {
14536
14574
  const skeleton = this.skeleton;
14537
14575
  const geometry = this.geometry;
14538
14576
  _skinIndex.fromBufferAttribute(geometry.attributes.skinIndex, index);
14539
14577
  _skinWeight.fromBufferAttribute(geometry.attributes.skinWeight, index);
14540
- _basePosition.copy(target).applyMatrix4(this.bindMatrix);
14541
- target.set(0, 0, 0);
14578
+ if (target.isVector4) {
14579
+ _baseVector.copy(target);
14580
+ target.set(0, 0, 0, 0);
14581
+ } else {
14582
+ _baseVector.set(...target, 1);
14583
+ target.set(0, 0, 0);
14584
+ }
14585
+ _baseVector.applyMatrix4(this.bindMatrix);
14542
14586
  for (let i3 = 0; i3 < 4; i3++) {
14543
14587
  const weight = _skinWeight.getComponent(i3);
14544
14588
  if (weight !== 0) {
14545
14589
  const boneIndex = _skinIndex.getComponent(i3);
14546
14590
  _matrix4.multiplyMatrices(skeleton.bones[boneIndex].matrixWorld, skeleton.boneInverses[boneIndex]);
14547
- target.addScaledVector(_vector3.copy(_basePosition).applyMatrix4(_matrix4), weight);
14591
+ target.addScaledVector(_vector4.copy(_baseVector).applyMatrix4(_matrix4), weight);
14548
14592
  }
14549
14593
  }
14594
+ if (target.isVector4) {
14595
+ target.w = _baseVector.w;
14596
+ }
14550
14597
  return target.applyMatrix4(this.bindMatrixInverse);
14551
14598
  }
14552
14599
  };
@@ -14894,18 +14941,24 @@ var init_three_core = __esm({
14894
14941
  *
14895
14942
  * @param {number} index - The instance index.
14896
14943
  * @param {Color} color - The target object that is used to store the method's result.
14944
+ * @return {Color} A reference to the target color.
14897
14945
  */
14898
14946
  getColorAt(index, color) {
14899
- color.fromArray(this.instanceColor.array, index * 3);
14947
+ if (this.instanceColor === null) {
14948
+ return color.setRGB(1, 1, 1);
14949
+ } else {
14950
+ return color.fromArray(this.instanceColor.array, index * 3);
14951
+ }
14900
14952
  }
14901
14953
  /**
14902
14954
  * Gets the local transformation matrix of the defined instance.
14903
14955
  *
14904
14956
  * @param {number} index - The instance index.
14905
14957
  * @param {Matrix4} matrix - The target object that is used to store the method's result.
14958
+ * @return {Matrix4} A reference to the target matrix.
14906
14959
  */
14907
14960
  getMatrixAt(index, matrix) {
14908
- matrix.fromArray(this.instanceMatrix.array, index * 16);
14961
+ return matrix.fromArray(this.instanceMatrix.array, index * 16);
14909
14962
  }
14910
14963
  /**
14911
14964
  * Gets the morph target weights of the defined instance.
@@ -14952,22 +15005,26 @@ var init_three_core = __esm({
14952
15005
  *
14953
15006
  * @param {number} index - The instance index.
14954
15007
  * @param {Color} color - The instance color.
15008
+ * @return {InstancedMesh} A reference to this instanced mesh.
14955
15009
  */
14956
15010
  setColorAt(index, color) {
14957
15011
  if (this.instanceColor === null) {
14958
15012
  this.instanceColor = new InstancedBufferAttribute(new Float32Array(this.instanceMatrix.count * 3).fill(1), 3);
14959
15013
  }
14960
15014
  color.toArray(this.instanceColor.array, index * 3);
15015
+ return this;
14961
15016
  }
14962
15017
  /**
14963
15018
  * Sets the given local transformation matrix to the defined instance. Make sure you set the `needsUpdate` flag of
14964
- * {@link InstancedMesh#instanceMatrix} to `true` after updating all the colors.
15019
+ * {@link InstancedMesh#instanceMatrix} to `true` after updating all the matrices.
14965
15020
  *
14966
15021
  * @param {number} index - The instance index.
14967
15022
  * @param {Matrix4} matrix - The local transformation.
15023
+ * @return {InstancedMesh} A reference to this instanced mesh.
14968
15024
  */
14969
15025
  setMatrixAt(index, matrix) {
14970
15026
  matrix.toArray(this.instanceMatrix.array, index * 16);
15027
+ return this;
14971
15028
  }
14972
15029
  /**
14973
15030
  * Sets the morph target weights to the defined instance. Make sure you set the `needsUpdate` flag of
@@ -14976,6 +15033,7 @@ var init_three_core = __esm({
14976
15033
  * @param {number} index - The instance index.
14977
15034
  * @param {Mesh} object - A mesh which `morphTargetInfluences` property containing the morph target weights
14978
15035
  * of a single instance.
15036
+ * @return {InstancedMesh} A reference to this instanced mesh.
14979
15037
  */
14980
15038
  setMorphAt(index, object) {
14981
15039
  const objectInfluences = object.morphTargetInfluences;
@@ -14992,6 +15050,7 @@ var init_three_core = __esm({
14992
15050
  const dataIndex = len * index;
14993
15051
  array[dataIndex] = morphBaseInfluence;
14994
15052
  array.set(objectInfluences, dataIndex + 1);
15053
+ return this;
14995
15054
  }
14996
15055
  updateMorphTargets() {
14997
15056
  }
@@ -15144,9 +15203,10 @@ var init_three_core = __esm({
15144
15203
  *
15145
15204
  * @param {Line3} line - The line to compute the intersection for.
15146
15205
  * @param {Vector3} target - The target vector that is used to store the method's result.
15147
- * @return {?Vector3} The intersection point.
15206
+ * @param {boolean} [clampToLine=true] - Whether to clamp the intersection to the line segment.
15207
+ * @return {?Vector3} The intersection point. Returns `null` if no intersection is detected.
15148
15208
  */
15149
- intersectLine(line, target) {
15209
+ intersectLine(line, target, clampToLine = true) {
15150
15210
  const direction = line.delta(_vector1);
15151
15211
  const denominator = this.normal.dot(direction);
15152
15212
  if (denominator === 0) {
@@ -15156,7 +15216,7 @@ var init_three_core = __esm({
15156
15216
  return null;
15157
15217
  }
15158
15218
  const t2 = -(line.start.dot(this.normal) + this.constant) / denominator;
15159
- if (t2 < 0 || t2 > 1) {
15219
+ if (clampToLine === true && (t2 < 0 || t2 > 1)) {
15160
15220
  return null;
15161
15221
  }
15162
15222
  return target.copy(line.start).addScaledVector(direction, t2);
@@ -15664,7 +15724,6 @@ var init_three_core = __esm({
15664
15724
  this._multiDrawCounts = new Int32Array(maxInstanceCount);
15665
15725
  this._multiDrawStarts = new Int32Array(maxInstanceCount);
15666
15726
  this._multiDrawCount = 0;
15667
- this._multiDrawInstances = null;
15668
15727
  this._matricesTexture = null;
15669
15728
  this._indirectTexture = null;
15670
15729
  this._colorsTexture = null;
@@ -16209,7 +16268,15 @@ var init_three_core = __esm({
16209
16268
  */
16210
16269
  getColorAt(instanceId, color) {
16211
16270
  this.validateInstanceId(instanceId);
16212
- return color.fromArray(this._colorsTexture.image.data, instanceId * 4);
16271
+ if (this._colorsTexture === null) {
16272
+ if (color.isVector4) {
16273
+ return color.set(1, 1, 1, 1);
16274
+ } else {
16275
+ return color.setRGB(1, 1, 1);
16276
+ }
16277
+ } else {
16278
+ return color.fromArray(this._colorsTexture.image.data, instanceId * 4);
16279
+ }
16213
16280
  }
16214
16281
  /**
16215
16282
  * Sets the visibility of the instance.
@@ -17113,6 +17180,41 @@ var init_three_core = __esm({
17113
17180
  this.needsUpdate = true;
17114
17181
  }
17115
17182
  };
17183
+ HTMLTexture = class extends Texture {
17184
+ /**
17185
+ * Constructs a new texture.
17186
+ *
17187
+ * @param {HTMLElement} [element] - The HTML element.
17188
+ * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.
17189
+ * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.
17190
+ * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.
17191
+ * @param {number} [magFilter=LinearFilter] - The mag filter value.
17192
+ * @param {number} [minFilter=LinearMipmapLinearFilter] - The min filter value.
17193
+ * @param {number} [format=RGBAFormat] - The texture format.
17194
+ * @param {number} [type=UnsignedByteType] - The texture type.
17195
+ * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
17196
+ */
17197
+ constructor(element2, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy) {
17198
+ super(element2, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy);
17199
+ this.isHTMLTexture = true;
17200
+ this.generateMipmaps = false;
17201
+ this.needsUpdate = true;
17202
+ const parent = element2 ? element2.parentNode : null;
17203
+ if (parent !== null && "requestPaint" in parent) {
17204
+ parent.onpaint = () => {
17205
+ this.needsUpdate = true;
17206
+ };
17207
+ parent.requestPaint();
17208
+ }
17209
+ }
17210
+ dispose() {
17211
+ const parent = this.image ? this.image.parentNode : null;
17212
+ if (parent !== null && "onpaint" in parent) {
17213
+ parent.onpaint = null;
17214
+ }
17215
+ super.dispose();
17216
+ }
17217
+ };
17116
17218
  DepthTexture = class extends Texture {
17117
17219
  /**
17118
17220
  * Constructs a new depth texture.
@@ -18567,6 +18669,7 @@ var init_three_core = __esm({
18567
18669
  }
18568
18670
  };
18569
18671
  tmp = /* @__PURE__ */ new Vector3();
18672
+ tmp2 = /* @__PURE__ */ new Vector3();
18570
18673
  px = /* @__PURE__ */ new CubicPoly();
18571
18674
  py = /* @__PURE__ */ new CubicPoly();
18572
18675
  pz = /* @__PURE__ */ new CubicPoly();
@@ -18612,8 +18715,8 @@ var init_three_core = __esm({
18612
18715
  if (this.closed || intPoint > 0) {
18613
18716
  p0 = points[(intPoint - 1) % l2];
18614
18717
  } else {
18615
- tmp.subVectors(points[0], points[1]).add(points[0]);
18616
- p0 = tmp;
18718
+ tmp2.subVectors(points[0], points[1]).add(points[0]);
18719
+ p0 = tmp2;
18617
18720
  }
18618
18721
  const p1 = points[intPoint % l2];
18619
18722
  const p22 = points[(intPoint + 1) % l2];
@@ -23462,7 +23565,6 @@ var init_three_core = __esm({
23462
23565
  * @param {function(any)} onLoad - Executed when the loading process has been finished.
23463
23566
  * @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.
23464
23567
  * @param {onErrorCallback} [onError] - Executed when errors occur.
23465
- * @return {any|undefined} The cached resource if available.
23466
23568
  */
23467
23569
  load(url, onLoad, onProgress, onError) {
23468
23570
  if (url === void 0) url = "";
@@ -23475,7 +23577,7 @@ var init_three_core = __esm({
23475
23577
  if (onLoad) onLoad(cached);
23476
23578
  this.manager.itemEnd(url);
23477
23579
  }, 0);
23478
- return cached;
23580
+ return;
23479
23581
  }
23480
23582
  if (loading[url] !== void 0) {
23481
23583
  loading[url].push({
@@ -23919,13 +24021,13 @@ var init_three_core = __esm({
23919
24021
  let texData;
23920
24022
  try {
23921
24023
  texData = scope.parse(buffer);
23922
- } catch (error2) {
24024
+ } catch (e2) {
23923
24025
  if (onError !== void 0) {
23924
- onError(error2);
24026
+ onError(e2);
23925
24027
  } else {
23926
- error2(error2);
23927
- return;
24028
+ error(e2);
23928
24029
  }
24030
+ return;
23929
24031
  }
23930
24032
  if (texData.image !== void 0) {
23931
24033
  texture.image = texData.image;
@@ -25261,7 +25363,7 @@ var init_three_core = __esm({
25261
25363
  if (json.userData !== void 0) material.userData = json.userData;
25262
25364
  if (json.vertexColors !== void 0) {
25263
25365
  if (typeof json.vertexColors === "number") {
25264
- material.vertexColors = json.vertexColors > 0 ? true : false;
25366
+ material.vertexColors = json.vertexColors > 0;
25265
25367
  } else {
25266
25368
  material.vertexColors = json.vertexColors;
25267
25369
  }
@@ -25589,6 +25691,7 @@ var init_three_core = __esm({
25589
25691
  return geometry;
25590
25692
  }
25591
25693
  };
25694
+ _customGeometries = {};
25592
25695
  ObjectLoader = class extends Loader {
25593
25696
  /**
25594
25697
  * Constructs a new object loader.
@@ -25618,9 +25721,9 @@ var init_three_core = __esm({
25618
25721
  let json = null;
25619
25722
  try {
25620
25723
  json = JSON.parse(text2);
25621
- } catch (error2) {
25622
- if (onError !== void 0) onError(error2);
25623
- error2("ObjectLoader: Can't parse " + url + ".", error2.message);
25724
+ } catch (e2) {
25725
+ if (onError !== void 0) onError(e2);
25726
+ error("ObjectLoader: Can't parse " + url + ".", e2.message);
25624
25727
  return;
25625
25728
  }
25626
25729
  const metadata = json.metadata;
@@ -25713,6 +25816,17 @@ var init_three_core = __esm({
25713
25816
  this.bindLightTargets(object);
25714
25817
  return object;
25715
25818
  }
25819
+ /**
25820
+ * Registers the given geometry at the internal
25821
+ * geometry library.
25822
+ *
25823
+ * @static
25824
+ * @param {string} type - The geometry type.
25825
+ * @param {BufferGeometry.constructor} geometryClass - The geometry class.
25826
+ */
25827
+ static registerGeometry(type, geometryClass) {
25828
+ _customGeometries[type] = geometryClass;
25829
+ }
25716
25830
  // internals
25717
25831
  parseShapes(json) {
25718
25832
  const shapes = {};
@@ -25753,8 +25867,10 @@ var init_three_core = __esm({
25753
25867
  default:
25754
25868
  if (data.type in Geometries) {
25755
25869
  geometry = Geometries[data.type].fromJSON(data, shapes);
25870
+ } else if (data.type in _customGeometries) {
25871
+ geometry = _customGeometries[data.type].fromJSON(data, shapes);
25756
25872
  } else {
25757
- warn(`ObjectLoader: Unsupported geometry type "${data.type}"`);
25873
+ warn(`ObjectLoader: Unknown geometry type "${data.type}". Use .registerGeometry() before starting the deserialization process.`);
25758
25874
  }
25759
25875
  }
25760
25876
  geometry.uuid = data.uuid;
@@ -25955,6 +26071,7 @@ var init_three_core = __esm({
25955
26071
  if (data.premultiplyAlpha !== void 0) texture.premultiplyAlpha = data.premultiplyAlpha;
25956
26072
  if (data.unpackAlignment !== void 0) texture.unpackAlignment = data.unpackAlignment;
25957
26073
  if (data.compareFunction !== void 0) texture.compareFunction = data.compareFunction;
26074
+ if (data.normalized !== void 0) texture.normalized = data.normalized;
25958
26075
  if (data.userData !== void 0) texture.userData = data.userData;
25959
26076
  textures[data.uuid] = texture;
25960
26077
  }
@@ -26286,6 +26403,9 @@ var init_three_core = __esm({
26286
26403
  * Sets the given loader options. The structure of the object must match the `options` parameter of
26287
26404
  * [createImageBitmap](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap).
26288
26405
  *
26406
+ * Note: When caching is enabled, the cache key is based on the URL only. Loading the same URL with
26407
+ * different options will return the cached result of the first request.
26408
+ *
26289
26409
  * @param {Object} options - The loader options to set.
26290
26410
  * @return {ImageBitmapLoader} A reference to this image bitmap loader.
26291
26411
  */
@@ -26300,7 +26420,6 @@ var init_three_core = __esm({
26300
26420
  * @param {function(ImageBitmap)} onLoad - Executed when the loading process has been finished.
26301
26421
  * @param {onProgressCallback} onProgress - Unsupported in this loader.
26302
26422
  * @param {onErrorCallback} onError - Executed when errors occur.
26303
- * @return {ImageBitmap|undefined} The image bitmap.
26304
26423
  */
26305
26424
  load(url, onLoad, onProgress, onError) {
26306
26425
  if (url === void 0) url = "";
@@ -26319,7 +26438,6 @@ var init_three_core = __esm({
26319
26438
  } else {
26320
26439
  if (onLoad) onLoad(imageBitmap);
26321
26440
  scope.manager.itemEnd(url);
26322
- return imageBitmap;
26323
26441
  }
26324
26442
  });
26325
26443
  return;
@@ -26328,7 +26446,7 @@ var init_three_core = __esm({
26328
26446
  if (onLoad) onLoad(cached);
26329
26447
  scope.manager.itemEnd(url);
26330
26448
  }, 0);
26331
- return cached;
26449
+ return;
26332
26450
  }
26333
26451
  const fetchOptions = {};
26334
26452
  fetchOptions.credentials = this.crossOrigin === "anonymous" ? "same-origin" : "include";
@@ -26342,7 +26460,6 @@ var init_three_core = __esm({
26342
26460
  Cache.add(`image-bitmap:${url}`, imageBitmap);
26343
26461
  if (onLoad) onLoad(imageBitmap);
26344
26462
  scope.manager.itemEnd(url);
26345
- return imageBitmap;
26346
26463
  }).catch(function(e2) {
26347
26464
  if (onError) onError(e2);
26348
26465
  _errorMap.set(promise, e2);
@@ -26368,7 +26485,7 @@ var init_three_core = __esm({
26368
26485
  /**
26369
26486
  * Returns the global native audio context.
26370
26487
  *
26371
- * @return {AudioContext} The native audio context.
26488
+ * @return {Window.AudioContext} The native audio context.
26372
26489
  */
26373
26490
  static getContext() {
26374
26491
  if (_context === void 0) {
@@ -26379,7 +26496,7 @@ var init_three_core = __esm({
26379
26496
  /**
26380
26497
  * Allows to set the global native audio context from outside.
26381
26498
  *
26382
- * @param {AudioContext} value - The native context to set.
26499
+ * @param {Window.AudioContext} value - The native context to set.
26383
26500
  */
26384
26501
  static setContext(value) {
26385
26502
  _context = value;
@@ -26414,9 +26531,15 @@ var init_three_core = __esm({
26414
26531
  try {
26415
26532
  const bufferCopy = buffer.slice(0);
26416
26533
  const context2 = AudioContext.getContext();
26534
+ const decodeUrl = url + "#decode";
26535
+ scope.manager.itemStart(decodeUrl);
26417
26536
  context2.decodeAudioData(bufferCopy, function(audioBuffer) {
26418
26537
  onLoad(audioBuffer);
26419
- }).catch(handleError);
26538
+ scope.manager.itemEnd(decodeUrl);
26539
+ }).catch(function(e2) {
26540
+ handleError(e2);
26541
+ scope.manager.itemEnd(decodeUrl);
26542
+ });
26420
26543
  } catch (e2) {
26421
26544
  handleError(e2);
26422
26545
  }
@@ -28252,6 +28375,9 @@ var init_three_core = __esm({
28252
28375
  for (let i3 = 0; i3 !== nTracks; ++i3) {
28253
28376
  const interpolant = tracks[i3].createInterpolant(null);
28254
28377
  interpolants[i3] = interpolant;
28378
+ if (interpolant.settings) {
28379
+ Object.assign(interpolantSettings, interpolant.settings);
28380
+ }
28255
28381
  interpolant.settings = interpolantSettings;
28256
28382
  }
28257
28383
  this._interpolantSettings = interpolantSettings;
@@ -28695,6 +28821,7 @@ var init_three_core = __esm({
28695
28821
  });
28696
28822
  }
28697
28823
  } else {
28824
+ this._loopCount = loopCount;
28698
28825
  this.time = time;
28699
28826
  }
28700
28827
  if (pingPong && (loopCount & 1) === 1) {
@@ -29534,7 +29661,7 @@ var init_three_core = __esm({
29534
29661
  this.oldTime = 0;
29535
29662
  this.elapsedTime = 0;
29536
29663
  this.running = false;
29537
- warn("THREE.Clock: This module has been deprecated. Please use THREE.Timer instead.");
29664
+ warn("Clock: This module has been deprecated. Please use THREE.Timer instead.");
29538
29665
  }
29539
29666
  /**
29540
29667
  * Starts the clock. When `autoStart` is set to `true`, the method is automatically
@@ -29744,6 +29871,9 @@ var init_three_core = __esm({
29744
29871
  }
29745
29872
  };
29746
29873
  Matrix2 = class _Matrix2 {
29874
+ static {
29875
+ _Matrix2.prototype.isMatrix2 = true;
29876
+ }
29747
29877
  /**
29748
29878
  * Constructs a new 2x2 matrix. The arguments are supposed to be
29749
29879
  * in row-major order. If no arguments are provided, the constructor
@@ -29755,7 +29885,6 @@ var init_three_core = __esm({
29755
29885
  * @param {number} [n22] - 2-2 matrix element.
29756
29886
  */
29757
29887
  constructor(n11, n12, n21, n22) {
29758
- _Matrix2.prototype.isMatrix2 = true;
29759
29888
  this.elements = [
29760
29889
  1,
29761
29890
  0,
@@ -30167,6 +30296,7 @@ var init_three_core = __esm({
30167
30296
  _startP.subVectors(point, this.start);
30168
30297
  _startEnd.subVectors(this.end, this.start);
30169
30298
  const startEnd2 = _startEnd.dot(_startEnd);
30299
+ if (startEnd2 === 0) return 0;
30170
30300
  const startEnd_startP = _startEnd.dot(_startP);
30171
30301
  let t2 = startEnd_startP / startEnd2;
30172
30302
  if (clampToLine) {
@@ -31583,7 +31713,7 @@ var init_three_core = __esm({
31583
31713
  }
31584
31714
  });
31585
31715
 
31586
- // ../../node_modules/.bun/three@0.183.2/node_modules/three/build/three.module.js
31716
+ // ../../node_modules/.bun/three@0.184.0/node_modules/three/build/three.module.js
31587
31717
  var three_module_exports = {};
31588
31718
  __export(three_module_exports, {
31589
31719
  ACESFilmicToneMapping: () => ACESFilmicToneMapping,
@@ -31725,6 +31855,7 @@ __export(three_module_exports, {
31725
31855
  GreaterStencilFunc: () => GreaterStencilFunc,
31726
31856
  GridHelper: () => GridHelper,
31727
31857
  Group: () => Group,
31858
+ HTMLTexture: () => HTMLTexture,
31728
31859
  HalfFloatType: () => HalfFloatType,
31729
31860
  HemisphereLight: () => HemisphereLight,
31730
31861
  HemisphereLightHelper: () => HemisphereLightHelper,
@@ -32040,11 +32171,12 @@ function WebGLAnimation() {
32040
32171
  start: function() {
32041
32172
  if (isAnimating === true) return;
32042
32173
  if (animationLoop === null) return;
32174
+ if (context2 === null) return;
32043
32175
  requestId = context2.requestAnimationFrame(onAnimationFrame);
32044
32176
  isAnimating = true;
32045
32177
  },
32046
32178
  stop: function() {
32047
- context2.cancelAnimationFrame(requestId);
32179
+ if (context2 !== null) context2.cancelAnimationFrame(requestId);
32048
32180
  isAnimating = false;
32049
32181
  },
32050
32182
  setAnimationLoop: function(callback) {
@@ -32247,19 +32379,13 @@ function WebGLBackground(renderer, environments, state2, objects, alpha, premult
32247
32379
  });
32248
32380
  objects.update(boxMesh);
32249
32381
  }
32250
- _e1$1.copy(scene.backgroundRotation);
32251
- _e1$1.x *= -1;
32252
- _e1$1.y *= -1;
32253
- _e1$1.z *= -1;
32254
- if (background.isCubeTexture && background.isRenderTargetTexture === false) {
32255
- _e1$1.y *= -1;
32256
- _e1$1.z *= -1;
32257
- }
32258
32382
  boxMesh.material.uniforms.envMap.value = background;
32259
- boxMesh.material.uniforms.flipEnvMap.value = background.isCubeTexture && background.isRenderTargetTexture === false ? -1 : 1;
32260
32383
  boxMesh.material.uniforms.backgroundBlurriness.value = scene.backgroundBlurriness;
32261
32384
  boxMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;
32262
- boxMesh.material.uniforms.backgroundRotation.value.setFromMatrix4(_m1$12.makeRotationFromEuler(_e1$1));
32385
+ boxMesh.material.uniforms.backgroundRotation.value.setFromMatrix4(_m1$12.makeRotationFromEuler(scene.backgroundRotation)).transpose();
32386
+ if (background.isCubeTexture && background.isRenderTargetTexture === false) {
32387
+ boxMesh.material.uniforms.backgroundRotation.value.premultiply(_m$1);
32388
+ }
32263
32389
  boxMesh.material.toneMapped = ColorManagement.getTransfer(background.colorSpace) !== SRGBTransfer;
32264
32390
  if (currentBackground !== background || currentBackgroundVersion !== background.version || currentTonemapping !== renderer.toneMapping) {
32265
32391
  boxMesh.material.needsUpdate = true;
@@ -32735,27 +32861,10 @@ function WebGLBufferRenderer(gl, extensions2, info) {
32735
32861
  }
32736
32862
  info.update(elementCount, mode, 1);
32737
32863
  }
32738
- function renderMultiDrawInstances(starts, counts, drawCount, primcount) {
32739
- if (drawCount === 0) return;
32740
- const extension = extensions2.get("WEBGL_multi_draw");
32741
- if (extension === null) {
32742
- for (let i3 = 0; i3 < starts.length; i3++) {
32743
- renderInstances(starts[i3], counts[i3], primcount[i3]);
32744
- }
32745
- } else {
32746
- extension.multiDrawArraysInstancedWEBGL(mode, starts, 0, counts, 0, primcount, 0, drawCount);
32747
- let elementCount = 0;
32748
- for (let i3 = 0; i3 < drawCount; i3++) {
32749
- elementCount += counts[i3] * primcount[i3];
32750
- }
32751
- info.update(elementCount, mode, 1);
32752
- }
32753
- }
32754
32864
  this.setMode = setMode;
32755
32865
  this.render = render;
32756
32866
  this.renderInstances = renderInstances;
32757
32867
  this.renderMultiDraw = renderMultiDraw;
32758
- this.renderMultiDrawInstances = renderMultiDrawInstances;
32759
32868
  }
32760
32869
  function WebGLCapabilities(gl, extensions2, parameters, utils) {
32761
32870
  let maxAnisotropy;
@@ -32805,6 +32914,9 @@ function WebGLCapabilities(gl, extensions2, parameters, utils) {
32805
32914
  }
32806
32915
  const logarithmicDepthBuffer = parameters.logarithmicDepthBuffer === true;
32807
32916
  const reversedDepthBuffer = parameters.reversedDepthBuffer === true && extensions2.has("EXT_clip_control");
32917
+ if (parameters.reversedDepthBuffer === true && reversedDepthBuffer === false) {
32918
+ warn("WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.");
32919
+ }
32808
32920
  const maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);
32809
32921
  const maxVertexTextures = gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS);
32810
32922
  const maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);
@@ -33610,28 +33722,11 @@ function WebGLIndexedBufferRenderer(gl, extensions2, info) {
33610
33722
  }
33611
33723
  info.update(elementCount, mode, 1);
33612
33724
  }
33613
- function renderMultiDrawInstances(starts, counts, drawCount, primcount) {
33614
- if (drawCount === 0) return;
33615
- const extension = extensions2.get("WEBGL_multi_draw");
33616
- if (extension === null) {
33617
- for (let i3 = 0; i3 < starts.length; i3++) {
33618
- renderInstances(starts[i3] / bytesPerElement, counts[i3], primcount[i3]);
33619
- }
33620
- } else {
33621
- extension.multiDrawElementsInstancedWEBGL(mode, counts, 0, type, starts, 0, primcount, 0, drawCount);
33622
- let elementCount = 0;
33623
- for (let i3 = 0; i3 < drawCount; i3++) {
33624
- elementCount += counts[i3] * primcount[i3];
33625
- }
33626
- info.update(elementCount, mode, 1);
33627
- }
33628
- }
33629
33725
  this.setMode = setMode;
33630
33726
  this.setIndex = setIndex;
33631
33727
  this.render = render;
33632
33728
  this.renderInstances = renderInstances;
33633
33729
  this.renderMultiDraw = renderMultiDraw;
33634
- this.renderMultiDrawInstances = renderMultiDrawInstances;
33635
33730
  }
33636
33731
  function WebGLInfo(gl) {
33637
33732
  const memory = {
@@ -33825,7 +33920,8 @@ function WebGLOutput(type, width, height, depth, stencil) {
33825
33920
  const targetA = new WebGLRenderTarget(width, height, {
33826
33921
  type,
33827
33922
  depthBuffer: depth,
33828
- stencilBuffer: stencil
33923
+ stencilBuffer: stencil,
33924
+ depthTexture: depth ? new DepthTexture(width, height) : void 0
33829
33925
  });
33830
33926
  const targetB = new WebGLRenderTarget(width, height, {
33831
33927
  type: HalfFloatType,
@@ -33978,6 +34074,7 @@ function WebGLOutput(type, width, height, depth, stencil) {
33978
34074
  return _isCompositing;
33979
34075
  };
33980
34076
  this.dispose = function() {
34077
+ if (targetA.depthTexture) targetA.depthTexture.dispose();
33981
34078
  targetA.dispose();
33982
34079
  targetB.dispose();
33983
34080
  geometry.dispose();
@@ -34865,6 +34962,7 @@ function WebGLProgram(renderer, cacheKey, parameters, bindingStates) {
34865
34962
  parameters.thicknessMapUv ? "#define THICKNESSMAP_UV " + parameters.thicknessMapUv : "",
34866
34963
  //
34867
34964
  parameters.vertexTangents && parameters.flatShading === false ? "#define USE_TANGENT" : "",
34965
+ parameters.vertexNormals ? "#define HAS_NORMAL" : "",
34868
34966
  parameters.vertexColors ? "#define USE_COLOR" : "",
34869
34967
  parameters.vertexAlphas ? "#define USE_COLOR_ALPHA" : "",
34870
34968
  parameters.vertexUv1s ? "#define USE_UV1" : "",
@@ -34951,6 +35049,7 @@ function WebGLProgram(renderer, cacheKey, parameters, bindingStates) {
34951
35049
  parameters.normalMap ? "#define USE_NORMALMAP" : "",
34952
35050
  parameters.normalMapObjectSpace ? "#define USE_NORMALMAP_OBJECTSPACE" : "",
34953
35051
  parameters.normalMapTangentSpace ? "#define USE_NORMALMAP_TANGENTSPACE" : "",
35052
+ parameters.packedNormalMap ? "#define USE_PACKED_NORMALMAP" : "",
34954
35053
  parameters.emissiveMap ? "#define USE_EMISSIVEMAP" : "",
34955
35054
  parameters.anisotropy ? "#define USE_ANISOTROPY" : "",
34956
35055
  parameters.anisotropyMap ? "#define USE_ANISOTROPYMAP" : "",
@@ -34991,6 +35090,7 @@ function WebGLProgram(renderer, cacheKey, parameters, bindingStates) {
34991
35090
  parameters.shadowMapEnabled ? "#define " + shadowMapTypeDefine : "",
34992
35091
  parameters.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "",
34993
35092
  parameters.numLightProbes > 0 ? "#define USE_LIGHT_PROBES" : "",
35093
+ parameters.numLightProbeGrids > 0 ? "#define USE_LIGHT_PROBES_GRID" : "",
34994
35094
  parameters.decodeVideoTexture ? "#define DECODE_VIDEO_TEXTURE" : "",
34995
35095
  parameters.decodeVideoTextureEmissive ? "#define DECODE_VIDEO_TEXTURE_EMISSIVE" : "",
34996
35096
  parameters.logarithmicDepthBuffer ? "#define USE_LOGARITHMIC_DEPTH_BUFFER" : "",
@@ -35138,6 +35238,9 @@ function WebGLProgram(renderer, cacheKey, parameters, bindingStates) {
35138
35238
  this.fragmentShader = glFragmentShader;
35139
35239
  return this;
35140
35240
  }
35241
+ function isPackedRGFormat(format) {
35242
+ return format === RGFormat || format === RG11_EAC_Format || format === RED_GREEN_RGTC2_Format;
35243
+ }
35141
35244
  function WebGLPrograms(renderer, environments, extensions2, capabilities, bindingStates, clipping) {
35142
35245
  const _programLayers = new Layers();
35143
35246
  const _customShaders = new WebGLShaderCache();
@@ -35168,7 +35271,7 @@ function WebGLPrograms(renderer, environments, extensions2, capabilities, bindin
35168
35271
  if (value === 0) return "uv";
35169
35272
  return `uv${value}`;
35170
35273
  }
35171
- function getParameters(material, lights, shadows, scene, object) {
35274
+ function getParameters(material, lights, shadows, scene, object, lightProbeGrids) {
35172
35275
  const fog = scene.fog;
35173
35276
  const geometry = object.geometry;
35174
35277
  const environment = material.isMeshStandardMaterial || material.isMeshLambertMaterial || material.isMeshPhongMaterial ? scene.environment : null;
@@ -35263,7 +35366,7 @@ function WebGLPrograms(renderer, environments, extensions2, capabilities, bindin
35263
35366
  instancing: IS_INSTANCEDMESH,
35264
35367
  instancingColor: IS_INSTANCEDMESH && object.instanceColor !== null,
35265
35368
  instancingMorph: IS_INSTANCEDMESH && object.morphTexture !== null,
35266
- outputColorSpace: currentRenderTarget === null ? renderer.outputColorSpace : currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace,
35369
+ outputColorSpace: currentRenderTarget === null ? renderer.outputColorSpace : currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.colorSpace : ColorManagement.workingColorSpace,
35267
35370
  alphaToCoverage: !!material.alphaToCoverage,
35268
35371
  map: HAS_MAP,
35269
35372
  matcap: HAS_MATCAP,
@@ -35278,6 +35381,7 @@ function WebGLPrograms(renderer, environments, extensions2, capabilities, bindin
35278
35381
  emissiveMap: HAS_EMISSIVEMAP,
35279
35382
  normalMapObjectSpace: HAS_NORMALMAP && material.normalMapType === ObjectSpaceNormalMap,
35280
35383
  normalMapTangentSpace: HAS_NORMALMAP && material.normalMapType === TangentSpaceNormalMap,
35384
+ packedNormalMap: HAS_NORMALMAP && material.normalMapType === TangentSpaceNormalMap && isPackedRGFormat(material.normalMap.format),
35281
35385
  metalnessMap: HAS_METALNESSMAP,
35282
35386
  roughnessMap: HAS_ROUGHNESSMAP,
35283
35387
  anisotropy: HAS_ANISOTROPY,
@@ -35331,6 +35435,7 @@ function WebGLPrograms(renderer, environments, extensions2, capabilities, bindin
35331
35435
  alphaMapUv: HAS_ALPHAMAP && getChannel2(material.alphaMap.channel),
35332
35436
  //
35333
35437
  vertexTangents: !!geometry.attributes.tangent && (HAS_NORMALMAP || HAS_ANISOTROPY),
35438
+ vertexNormals: !!geometry.attributes.normal,
35334
35439
  vertexColors: material.vertexColors,
35335
35440
  vertexAlphas: material.vertexColors === true && !!geometry.attributes.color && geometry.attributes.color.itemSize === 4,
35336
35441
  pointsUvs: object.isPoints === true && !!geometry.attributes.uv && (HAS_MAP || HAS_ALPHAMAP),
@@ -35358,6 +35463,7 @@ function WebGLPrograms(renderer, environments, extensions2, capabilities, bindin
35358
35463
  numSpotLightShadows: lights.spotShadowMap.length,
35359
35464
  numSpotLightShadowsWithMaps: lights.numSpotLightShadowsWithMaps,
35360
35465
  numLightProbes: lights.numLightProbes,
35466
+ numLightProbeGrids: lightProbeGrids.length,
35361
35467
  numClippingPlanes: clipping.numPlanes,
35362
35468
  numClipIntersection: clipping.numIntersection,
35363
35469
  dithering: material.dithering,
@@ -35501,6 +35607,10 @@ function WebGLPrograms(renderer, environments, extensions2, capabilities, bindin
35501
35607
  _programLayers.enable(20);
35502
35608
  if (parameters.gradientMap)
35503
35609
  _programLayers.enable(21);
35610
+ if (parameters.packedNormalMap)
35611
+ _programLayers.enable(22);
35612
+ if (parameters.vertexNormals)
35613
+ _programLayers.enable(23);
35504
35614
  array.push(_programLayers.mask);
35505
35615
  _programLayers.disableAll();
35506
35616
  if (parameters.fog)
@@ -35547,6 +35657,8 @@ function WebGLPrograms(renderer, environments, extensions2, capabilities, bindin
35547
35657
  _programLayers.enable(20);
35548
35658
  if (parameters.alphaToCoverage)
35549
35659
  _programLayers.enable(21);
35660
+ if (parameters.numLightProbeGrids > 0)
35661
+ _programLayers.enable(22);
35550
35662
  array.push(_programLayers.mask);
35551
35663
  }
35552
35664
  function getUniforms(material) {
@@ -36145,10 +36257,12 @@ function WebGLRenderState(extensions2) {
36145
36257
  const lights = new WebGLLights(extensions2);
36146
36258
  const lightsArray = [];
36147
36259
  const shadowsArray = [];
36260
+ const lightProbeGridArray = [];
36148
36261
  function init(camera) {
36149
36262
  state2.camera = camera;
36150
36263
  lightsArray.length = 0;
36151
36264
  shadowsArray.length = 0;
36265
+ lightProbeGridArray.length = 0;
36152
36266
  }
36153
36267
  function pushLight(light) {
36154
36268
  lightsArray.push(light);
@@ -36156,6 +36270,9 @@ function WebGLRenderState(extensions2) {
36156
36270
  function pushShadow(shadowLight) {
36157
36271
  shadowsArray.push(shadowLight);
36158
36272
  }
36273
+ function pushLightProbeGrid(volume) {
36274
+ lightProbeGridArray.push(volume);
36275
+ }
36159
36276
  function setupLights() {
36160
36277
  lights.setup(lightsArray);
36161
36278
  }
@@ -36165,9 +36282,11 @@ function WebGLRenderState(extensions2) {
36165
36282
  const state2 = {
36166
36283
  lightsArray,
36167
36284
  shadowsArray,
36285
+ lightProbeGridArray,
36168
36286
  camera: null,
36169
36287
  lights,
36170
- transmissionRenderTarget: {}
36288
+ transmissionRenderTarget: {},
36289
+ textureUnits: 0
36171
36290
  };
36172
36291
  return {
36173
36292
  init,
@@ -36175,7 +36294,8 @@ function WebGLRenderState(extensions2) {
36175
36294
  setupLights,
36176
36295
  setupLightsView,
36177
36296
  pushLight,
36178
- pushShadow
36297
+ pushShadow,
36298
+ pushLightProbeGrid
36179
36299
  };
36180
36300
  }
36181
36301
  function WebGLRenderStates(extensions2) {
@@ -36714,6 +36834,7 @@ function WebGLState(gl, extensions2) {
36714
36834
  const uboBindings = /* @__PURE__ */ new WeakMap();
36715
36835
  const uboProgramMap = /* @__PURE__ */ new WeakMap();
36716
36836
  let enabledCapabilities = {};
36837
+ let parameters = {};
36717
36838
  let currentBoundFramebuffers = {};
36718
36839
  let currentDrawbuffers = /* @__PURE__ */ new WeakMap();
36719
36840
  let defaultDrawbuffers = [];
@@ -37138,6 +37259,19 @@ function WebGLState(gl, extensions2) {
37138
37259
  error("WebGLState:", e2);
37139
37260
  }
37140
37261
  }
37262
+ function getParameter(name) {
37263
+ if (parameters[name] !== void 0) {
37264
+ return parameters[name];
37265
+ } else {
37266
+ return gl.getParameter(name);
37267
+ }
37268
+ }
37269
+ function pixelStorei(name, value) {
37270
+ if (parameters[name] !== value) {
37271
+ gl.pixelStorei(name, value);
37272
+ parameters[name] = value;
37273
+ }
37274
+ }
37141
37275
  function scissor(scissor2) {
37142
37276
  if (currentScissor.equals(scissor2) === false) {
37143
37277
  gl.scissor(scissor2.x, scissor2.y, scissor2.z, scissor2.w);
@@ -37203,7 +37337,21 @@ function WebGLState(gl, extensions2) {
37203
37337
  gl.lineWidth(1);
37204
37338
  gl.scissor(0, 0, gl.canvas.width, gl.canvas.height);
37205
37339
  gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);
37340
+ gl.pixelStorei(gl.PACK_ALIGNMENT, 4);
37341
+ gl.pixelStorei(gl.UNPACK_ALIGNMENT, 4);
37342
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
37343
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
37344
+ gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.BROWSER_DEFAULT_WEBGL);
37345
+ gl.pixelStorei(gl.PACK_ROW_LENGTH, 0);
37346
+ gl.pixelStorei(gl.PACK_SKIP_PIXELS, 0);
37347
+ gl.pixelStorei(gl.PACK_SKIP_ROWS, 0);
37348
+ gl.pixelStorei(gl.UNPACK_ROW_LENGTH, 0);
37349
+ gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, 0);
37350
+ gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, 0);
37351
+ gl.pixelStorei(gl.UNPACK_SKIP_ROWS, 0);
37352
+ gl.pixelStorei(gl.UNPACK_SKIP_IMAGES, 0);
37206
37353
  enabledCapabilities = {};
37354
+ parameters = {};
37207
37355
  currentTextureSlot = null;
37208
37356
  currentBoundTextures = {};
37209
37357
  currentBoundFramebuffers = {};
@@ -37257,6 +37405,8 @@ function WebGLState(gl, extensions2) {
37257
37405
  compressedTexImage3D,
37258
37406
  texImage2D,
37259
37407
  texImage3D,
37408
+ pixelStorei,
37409
+ getParameter,
37260
37410
  updateUBOMapping,
37261
37411
  uniformBlockBinding,
37262
37412
  texStorage2D,
@@ -37275,6 +37425,7 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37275
37425
  const supportsInvalidateFramebuffer = typeof navigator === "undefined" ? false : /OculusBrowser/g.test(navigator.userAgent);
37276
37426
  const _imageDimensions = new Vector2();
37277
37427
  const _videoTextures = /* @__PURE__ */ new WeakMap();
37428
+ const _htmlTextures = /* @__PURE__ */ new Set();
37278
37429
  let _canvas2;
37279
37430
  const _sources = /* @__PURE__ */ new WeakMap();
37280
37431
  let useOffscreenCanvas = false;
@@ -37324,16 +37475,25 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37324
37475
  if (texture.isWebGLArrayRenderTarget || texture.isCompressedArrayTexture) return _gl.TEXTURE_2D_ARRAY;
37325
37476
  return _gl.TEXTURE_2D;
37326
37477
  }
37327
- function getInternalFormat(internalFormatName, glFormat, glType, colorSpace, forceLinearTransfer = false) {
37478
+ function getInternalFormat(internalFormatName, glFormat, glType, normalized, colorSpace, forceLinearTransfer = false) {
37328
37479
  if (internalFormatName !== null) {
37329
37480
  if (_gl[internalFormatName] !== void 0) return _gl[internalFormatName];
37330
37481
  warn("WebGLRenderer: Attempt to use non-existing WebGL internal format '" + internalFormatName + "'");
37331
37482
  }
37483
+ let ext_texture_norm16;
37484
+ if (normalized) {
37485
+ ext_texture_norm16 = extensions2.get("EXT_texture_norm16");
37486
+ if (!ext_texture_norm16) {
37487
+ warn("WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension");
37488
+ }
37489
+ }
37332
37490
  let internalFormat = glFormat;
37333
37491
  if (glFormat === _gl.RED) {
37334
37492
  if (glType === _gl.FLOAT) internalFormat = _gl.R32F;
37335
37493
  if (glType === _gl.HALF_FLOAT) internalFormat = _gl.R16F;
37336
37494
  if (glType === _gl.UNSIGNED_BYTE) internalFormat = _gl.R8;
37495
+ if (glType === _gl.UNSIGNED_SHORT && ext_texture_norm16) internalFormat = ext_texture_norm16.R16_EXT;
37496
+ if (glType === _gl.SHORT && ext_texture_norm16) internalFormat = ext_texture_norm16.R16_SNORM_EXT;
37337
37497
  }
37338
37498
  if (glFormat === _gl.RED_INTEGER) {
37339
37499
  if (glType === _gl.UNSIGNED_BYTE) internalFormat = _gl.R8UI;
@@ -37347,6 +37507,8 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37347
37507
  if (glType === _gl.FLOAT) internalFormat = _gl.RG32F;
37348
37508
  if (glType === _gl.HALF_FLOAT) internalFormat = _gl.RG16F;
37349
37509
  if (glType === _gl.UNSIGNED_BYTE) internalFormat = _gl.RG8;
37510
+ if (glType === _gl.UNSIGNED_SHORT && ext_texture_norm16) internalFormat = ext_texture_norm16.RG16_EXT;
37511
+ if (glType === _gl.SHORT && ext_texture_norm16) internalFormat = ext_texture_norm16.RG16_SNORM_EXT;
37350
37512
  }
37351
37513
  if (glFormat === _gl.RG_INTEGER) {
37352
37514
  if (glType === _gl.UNSIGNED_BYTE) internalFormat = _gl.RG8UI;
@@ -37373,6 +37535,8 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37373
37535
  if (glType === _gl.INT) internalFormat = _gl.RGBA32I;
37374
37536
  }
37375
37537
  if (glFormat === _gl.RGB) {
37538
+ if (glType === _gl.UNSIGNED_SHORT && ext_texture_norm16) internalFormat = ext_texture_norm16.RGB16_EXT;
37539
+ if (glType === _gl.SHORT && ext_texture_norm16) internalFormat = ext_texture_norm16.RGB16_SNORM_EXT;
37376
37540
  if (glType === _gl.UNSIGNED_INT_5_9_9_9_REV) internalFormat = _gl.RGB9_E5;
37377
37541
  if (glType === _gl.UNSIGNED_INT_10F_11F_11F_REV) internalFormat = _gl.R11F_G11F_B10F;
37378
37542
  }
@@ -37381,6 +37545,8 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37381
37545
  if (glType === _gl.FLOAT) internalFormat = _gl.RGBA32F;
37382
37546
  if (glType === _gl.HALF_FLOAT) internalFormat = _gl.RGBA16F;
37383
37547
  if (glType === _gl.UNSIGNED_BYTE) internalFormat = transfer === SRGBTransfer ? _gl.SRGB8_ALPHA8 : _gl.RGBA8;
37548
+ if (glType === _gl.UNSIGNED_SHORT && ext_texture_norm16) internalFormat = ext_texture_norm16.RGBA16_EXT;
37549
+ if (glType === _gl.SHORT && ext_texture_norm16) internalFormat = ext_texture_norm16.RGBA16_SNORM_EXT;
37384
37550
  if (glType === _gl.UNSIGNED_SHORT_4_4_4_4) internalFormat = _gl.RGBA4;
37385
37551
  if (glType === _gl.UNSIGNED_SHORT_5_5_5_1) internalFormat = _gl.RGB5_A1;
37386
37552
  }
@@ -37429,6 +37595,9 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37429
37595
  if (texture.isVideoTexture) {
37430
37596
  _videoTextures.delete(texture);
37431
37597
  }
37598
+ if (texture.isHTMLTexture) {
37599
+ _htmlTextures.delete(texture);
37600
+ }
37432
37601
  }
37433
37602
  function onRenderTargetDispose(event) {
37434
37603
  const renderTarget2 = event.target;
@@ -37505,6 +37674,12 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37505
37674
  function resetTextureUnits() {
37506
37675
  textureUnits = 0;
37507
37676
  }
37677
+ function getTextureUnits() {
37678
+ return textureUnits;
37679
+ }
37680
+ function setTextureUnits(value) {
37681
+ textureUnits = value;
37682
+ }
37508
37683
  function allocateTextureUnit() {
37509
37684
  const textureUnit = textureUnits;
37510
37685
  if (textureUnit >= capabilities.maxTextures) {
@@ -37687,10 +37862,10 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37687
37862
  }
37688
37863
  }
37689
37864
  updateRanges.length = mergeIndex + 1;
37690
- const currentUnpackRowLen = _gl.getParameter(_gl.UNPACK_ROW_LENGTH);
37691
- const currentUnpackSkipPixels = _gl.getParameter(_gl.UNPACK_SKIP_PIXELS);
37692
- const currentUnpackSkipRows = _gl.getParameter(_gl.UNPACK_SKIP_ROWS);
37693
- _gl.pixelStorei(_gl.UNPACK_ROW_LENGTH, image.width);
37865
+ const currentUnpackRowLen = state2.getParameter(_gl.UNPACK_ROW_LENGTH);
37866
+ const currentUnpackSkipPixels = state2.getParameter(_gl.UNPACK_SKIP_PIXELS);
37867
+ const currentUnpackSkipRows = state2.getParameter(_gl.UNPACK_SKIP_ROWS);
37868
+ state2.pixelStorei(_gl.UNPACK_ROW_LENGTH, image.width);
37694
37869
  for (let i3 = 0, l2 = updateRanges.length; i3 < l2; i3++) {
37695
37870
  const range = updateRanges[i3];
37696
37871
  const pixelStart = Math.floor(range.start / componentStride);
@@ -37699,14 +37874,14 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37699
37874
  const y = Math.floor(pixelStart / image.width);
37700
37875
  const width = pixelCount;
37701
37876
  const height = 1;
37702
- _gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS, x2);
37703
- _gl.pixelStorei(_gl.UNPACK_SKIP_ROWS, y);
37877
+ state2.pixelStorei(_gl.UNPACK_SKIP_PIXELS, x2);
37878
+ state2.pixelStorei(_gl.UNPACK_SKIP_ROWS, y);
37704
37879
  state2.texSubImage2D(_gl.TEXTURE_2D, 0, x2, y, width, height, glFormat, glType, image.data);
37705
37880
  }
37706
37881
  texture.clearUpdateRanges();
37707
- _gl.pixelStorei(_gl.UNPACK_ROW_LENGTH, currentUnpackRowLen);
37708
- _gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS, currentUnpackSkipPixels);
37709
- _gl.pixelStorei(_gl.UNPACK_SKIP_ROWS, currentUnpackSkipRows);
37882
+ state2.pixelStorei(_gl.UNPACK_ROW_LENGTH, currentUnpackRowLen);
37883
+ state2.pixelStorei(_gl.UNPACK_SKIP_PIXELS, currentUnpackSkipPixels);
37884
+ state2.pixelStorei(_gl.UNPACK_SKIP_ROWS, currentUnpackSkipRows);
37710
37885
  }
37711
37886
  }
37712
37887
  function uploadTexture(textureProperties, texture, slot) {
@@ -37719,18 +37894,21 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37719
37894
  const sourceProperties = properties.get(source);
37720
37895
  if (source.version !== sourceProperties.__version || forceUpload === true) {
37721
37896
  state2.activeTexture(_gl.TEXTURE0 + slot);
37722
- const workingPrimaries = ColorManagement.getPrimaries(ColorManagement.workingColorSpace);
37723
- const texturePrimaries = texture.colorSpace === NoColorSpace ? null : ColorManagement.getPrimaries(texture.colorSpace);
37724
- const unpackConversion = texture.colorSpace === NoColorSpace || workingPrimaries === texturePrimaries ? _gl.NONE : _gl.BROWSER_DEFAULT_WEBGL;
37725
- _gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, texture.flipY);
37726
- _gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha);
37727
- _gl.pixelStorei(_gl.UNPACK_ALIGNMENT, texture.unpackAlignment);
37728
- _gl.pixelStorei(_gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, unpackConversion);
37897
+ const isImageBitmap = typeof ImageBitmap !== "undefined" && texture.image instanceof ImageBitmap;
37898
+ if (isImageBitmap === false) {
37899
+ const workingPrimaries = ColorManagement.getPrimaries(ColorManagement.workingColorSpace);
37900
+ const texturePrimaries = texture.colorSpace === NoColorSpace ? null : ColorManagement.getPrimaries(texture.colorSpace);
37901
+ const unpackConversion = texture.colorSpace === NoColorSpace || workingPrimaries === texturePrimaries ? _gl.NONE : _gl.BROWSER_DEFAULT_WEBGL;
37902
+ state2.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, texture.flipY);
37903
+ state2.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha);
37904
+ state2.pixelStorei(_gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, unpackConversion);
37905
+ }
37906
+ state2.pixelStorei(_gl.UNPACK_ALIGNMENT, texture.unpackAlignment);
37729
37907
  let image = resizeImage(texture.image, false, capabilities.maxTextureSize);
37730
37908
  image = verifyColorSpace(texture, image);
37731
37909
  const glFormat = utils.convert(texture.format, texture.colorSpace);
37732
37910
  const glType = utils.convert(texture.type);
37733
- let glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.colorSpace, texture.isVideoTexture);
37911
+ let glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.normalized, texture.colorSpace, texture.isVideoTexture);
37734
37912
  setTextureParameters(textureType, texture);
37735
37913
  let mipmap;
37736
37914
  const mipmaps = texture.mipmaps;
@@ -37892,6 +38070,35 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37892
38070
  }
37893
38071
  }
37894
38072
  }
38073
+ } else if (texture.isHTMLTexture) {
38074
+ if ("texElementImage2D" in _gl) {
38075
+ const canvas = _gl.canvas;
38076
+ if (!canvas.hasAttribute("layoutsubtree")) {
38077
+ canvas.setAttribute("layoutsubtree", "true");
38078
+ }
38079
+ if (image.parentNode !== canvas) {
38080
+ canvas.appendChild(image);
38081
+ _htmlTextures.add(texture);
38082
+ canvas.onpaint = (event) => {
38083
+ const changed = event.changedElements;
38084
+ for (const t2 of _htmlTextures) {
38085
+ if (changed.includes(t2.image)) {
38086
+ t2.needsUpdate = true;
38087
+ }
38088
+ }
38089
+ };
38090
+ canvas.requestPaint();
38091
+ return;
38092
+ }
38093
+ const level = 0;
38094
+ const internalFormat = _gl.RGBA;
38095
+ const srcFormat = _gl.RGBA;
38096
+ const srcType = _gl.UNSIGNED_BYTE;
38097
+ _gl.texElementImage2D(_gl.TEXTURE_2D, level, internalFormat, srcFormat, srcType, image);
38098
+ _gl.texParameteri(_gl.TEXTURE_2D, _gl.TEXTURE_MIN_FILTER, _gl.LINEAR);
38099
+ _gl.texParameteri(_gl.TEXTURE_2D, _gl.TEXTURE_WRAP_S, _gl.CLAMP_TO_EDGE);
38100
+ _gl.texParameteri(_gl.TEXTURE_2D, _gl.TEXTURE_WRAP_T, _gl.CLAMP_TO_EDGE);
38101
+ }
37895
38102
  } else {
37896
38103
  if (mipmaps.length > 0) {
37897
38104
  if (useTexStorage && allocateMemory) {
@@ -37942,10 +38149,10 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37942
38149
  const workingPrimaries = ColorManagement.getPrimaries(ColorManagement.workingColorSpace);
37943
38150
  const texturePrimaries = texture.colorSpace === NoColorSpace ? null : ColorManagement.getPrimaries(texture.colorSpace);
37944
38151
  const unpackConversion = texture.colorSpace === NoColorSpace || workingPrimaries === texturePrimaries ? _gl.NONE : _gl.BROWSER_DEFAULT_WEBGL;
37945
- _gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, texture.flipY);
37946
- _gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha);
37947
- _gl.pixelStorei(_gl.UNPACK_ALIGNMENT, texture.unpackAlignment);
37948
- _gl.pixelStorei(_gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, unpackConversion);
38152
+ state2.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, texture.flipY);
38153
+ state2.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha);
38154
+ state2.pixelStorei(_gl.UNPACK_ALIGNMENT, texture.unpackAlignment);
38155
+ state2.pixelStorei(_gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, unpackConversion);
37949
38156
  const isCompressed = texture.isCompressedTexture || texture.image[0].isCompressedTexture;
37950
38157
  const isDataTexture = texture.image[0] && texture.image[0].isDataTexture;
37951
38158
  const cubeImage = [];
@@ -37957,7 +38164,7 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
37957
38164
  }
37958
38165
  cubeImage[i3] = verifyColorSpace(texture, cubeImage[i3]);
37959
38166
  }
37960
- const image = cubeImage[0], glFormat = utils.convert(texture.format, texture.colorSpace), glType = utils.convert(texture.type), glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.colorSpace);
38167
+ 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);
37961
38168
  const useTexStorage = texture.isVideoTexture !== true;
37962
38169
  const allocateMemory = sourceProperties.__version === void 0 || forceUpload === true;
37963
38170
  const dataReady = source.dataReady;
@@ -38054,7 +38261,7 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
38054
38261
  function setupFrameBufferTexture(framebuffer, renderTarget2, texture, attachment, textureTarget, level) {
38055
38262
  const glFormat = utils.convert(texture.format, texture.colorSpace);
38056
38263
  const glType = utils.convert(texture.type);
38057
- const glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.colorSpace);
38264
+ const glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.normalized, texture.colorSpace);
38058
38265
  const renderTargetProperties = properties.get(renderTarget2);
38059
38266
  const textureProperties = properties.get(texture);
38060
38267
  textureProperties.__renderTarget = renderTarget2;
@@ -38096,7 +38303,7 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
38096
38303
  const texture = textures[i3];
38097
38304
  const glFormat = utils.convert(texture.format, texture.colorSpace);
38098
38305
  const glType = utils.convert(texture.type);
38099
- const glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.colorSpace);
38306
+ const glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.normalized, texture.colorSpace);
38100
38307
  if (useMultisampledRTT(renderTarget2)) {
38101
38308
  multisampledRTTExt.renderbufferStorageMultisampleEXT(_gl.RENDERBUFFER, getRenderTargetSamples(renderTarget2), glInternalFormat, renderTarget2.width, renderTarget2.height);
38102
38309
  } else if (useMultisample) {
@@ -38296,7 +38503,7 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
38296
38503
  _gl.bindRenderbuffer(_gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[i3]);
38297
38504
  const glFormat = utils.convert(texture2.format, texture2.colorSpace);
38298
38505
  const glType = utils.convert(texture2.type);
38299
- const glInternalFormat = getInternalFormat(texture2.internalFormat, glFormat, glType, texture2.colorSpace, renderTarget2.isXRRenderTarget === true);
38506
+ const glInternalFormat = getInternalFormat(texture2.internalFormat, glFormat, glType, texture2.normalized, texture2.colorSpace, renderTarget2.isXRRenderTarget === true);
38300
38507
  const samples = getRenderTargetSamples(renderTarget2);
38301
38508
  _gl.renderbufferStorageMultisample(_gl.RENDERBUFFER, samples, glInternalFormat, renderTarget2.width, renderTarget2.height);
38302
38509
  _gl.framebufferRenderbuffer(_gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i3, _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[i3]);
@@ -38492,6 +38699,8 @@ function WebGLTextures(_gl, extensions2, state2, properties, capabilities, utils
38492
38699
  }
38493
38700
  this.allocateTextureUnit = allocateTextureUnit;
38494
38701
  this.resetTextureUnits = resetTextureUnits;
38702
+ this.getTextureUnits = getTextureUnits;
38703
+ this.setTextureUnits = setTextureUnits;
38495
38704
  this.setTexture2D = setTexture2D;
38496
38705
  this.setTexture2DArray = setTexture2DArray;
38497
38706
  this.setTexture3D = setTexture3D;
@@ -38644,7 +38853,9 @@ function WebGLMaterials(renderer, properties) {
38644
38853
  }
38645
38854
  }
38646
38855
  function refreshMaterialUniforms(uniforms, material, pixelRatio, height, transmissionRenderTarget) {
38647
- if (material.isMeshBasicMaterial) {
38856
+ if (material.isNodeMaterial) {
38857
+ material.uniformsNeedUpdate = false;
38858
+ } else if (material.isMeshBasicMaterial) {
38648
38859
  refreshUniformsCommon(uniforms, material);
38649
38860
  } else if (material.isMeshLambertMaterial) {
38650
38861
  refreshUniformsCommon(uniforms, material);
@@ -38746,16 +38957,10 @@ function WebGLMaterials(renderer, properties) {
38746
38957
  const envMapRotation = materialProperties.envMapRotation;
38747
38958
  if (envMap) {
38748
38959
  uniforms.envMap.value = envMap;
38749
- _e1.copy(envMapRotation);
38750
- _e1.x *= -1;
38751
- _e1.y *= -1;
38752
- _e1.z *= -1;
38960
+ uniforms.envMapRotation.value.setFromMatrix4(_m12.makeRotationFromEuler(envMapRotation)).transpose();
38753
38961
  if (envMap.isCubeTexture && envMap.isRenderTargetTexture === false) {
38754
- _e1.y *= -1;
38755
- _e1.z *= -1;
38962
+ uniforms.envMapRotation.value.premultiply(_m);
38756
38963
  }
38757
- uniforms.envMapRotation.value.setFromMatrix4(_m12.makeRotationFromEuler(_e1));
38758
- uniforms.flipEnvMap.value = envMap.isCubeTexture && envMap.isRenderTargetTexture === false ? -1 : 1;
38759
38964
  uniforms.reflectivity.value = material.reflectivity;
38760
38965
  uniforms.ior.value = material.ior;
38761
38966
  uniforms.refractionRatio.value = material.refractionRatio;
@@ -39021,6 +39226,8 @@ function WebGLUniformsGroups(gl, info, capabilities, state2) {
39021
39226
  uniform.__data[9] = value.elements[7];
39022
39227
  uniform.__data[10] = value.elements[8];
39023
39228
  uniform.__data[11] = 0;
39229
+ } else if (ArrayBuffer.isView(value)) {
39230
+ uniform.__data.set(new value.constructor(value.buffer, value.byteOffset, uniform.__data.length));
39024
39231
  } else {
39025
39232
  value.toArray(uniform.__data, arrayOffset);
39026
39233
  arrayOffset += info2.storage / Float32Array.BYTES_PER_ELEMENT;
@@ -39038,6 +39245,8 @@ function WebGLUniformsGroups(gl, info, capabilities, state2) {
39038
39245
  if (cache[indexString] === void 0) {
39039
39246
  if (typeof value === "number" || typeof value === "boolean") {
39040
39247
  cache[indexString] = value;
39248
+ } else if (ArrayBuffer.isView(value)) {
39249
+ cache[indexString] = value.slice();
39041
39250
  } else {
39042
39251
  cache[indexString] = value.clone();
39043
39252
  }
@@ -39049,6 +39258,8 @@ function WebGLUniformsGroups(gl, info, capabilities, state2) {
39049
39258
  cache[indexString] = value;
39050
39259
  return true;
39051
39260
  }
39261
+ } else if (ArrayBuffer.isView(value)) {
39262
+ return true;
39052
39263
  } else {
39053
39264
  if (cachedObject.equals(value) === false) {
39054
39265
  cachedObject.copy(value);
@@ -39116,6 +39327,9 @@ function WebGLUniformsGroups(gl, info, capabilities, state2) {
39116
39327
  info2.storage = 64;
39117
39328
  } else if (value.isTexture) {
39118
39329
  warn("WebGLRenderer: Texture samplers can not be part of an uniforms group.");
39330
+ } else if (ArrayBuffer.isView(value)) {
39331
+ info2.boundary = 16;
39332
+ info2.storage = value.byteLength;
39119
39333
  } else {
39120
39334
  warn("WebGLRenderer: Unsupported uniform value type.", value);
39121
39335
  }
@@ -39157,9 +39371,9 @@ function getDFGLUT() {
39157
39371
  }
39158
39372
  return lut;
39159
39373
  }
39160
- 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;
39374
+ 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;
39161
39375
  var init_three_module = __esm({
39162
- "../../node_modules/.bun/three@0.183.2/node_modules/three/build/three.module.js"() {
39376
+ "../../node_modules/.bun/three@0.184.0/node_modules/three/build/three.module.js"() {
39163
39377
  init_three_core();
39164
39378
  init_three_core();
39165
39379
  alphahash_fragment = "#ifdef USE_ALPHAHASH\n if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif";
@@ -39194,8 +39408,8 @@ var init_three_module = __esm({
39194
39408
  emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif";
39195
39409
  colorspace_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );";
39196
39410
  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}";
39197
- 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";
39198
- 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";
39411
+ 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";
39412
+ 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";
39199
39413
  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";
39200
39414
  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";
39201
39415
  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";
@@ -39207,17 +39421,18 @@ var init_three_module = __esm({
39207
39421
  lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif";
39208
39422
  lights_lambert_fragment = "LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;";
39209
39423
  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";
39210
- 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";
39424
+ 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>";
39211
39425
  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";
39212
39426
  lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;";
39213
39427
  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";
39214
39428
  lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;";
39215
39429
  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";
39216
39430
  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";
39217
- 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}";
39218
- 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";
39431
+ 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}";
39432
+ 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";
39219
39433
  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";
39220
39434
  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";
39435
+ 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";
39221
39436
  logdepthbuf_fragment = "#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif";
39222
39437
  logdepthbuf_pars_fragment = "#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n uniform float logDepthBufFC;\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif";
39223
39438
  logdepthbuf_pars_vertex = "#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif";
@@ -39234,7 +39449,7 @@ var init_three_module = __esm({
39234
39449
  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";
39235
39450
  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";
39236
39451
  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;";
39237
- 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";
39452
+ 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";
39238
39453
  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";
39239
39454
  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";
39240
39455
  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";
@@ -39253,7 +39468,7 @@ var init_three_module = __esm({
39253
39468
  roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif";
39254
39469
  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";
39255
39470
  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";
39256
- 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";
39471
+ 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";
39257
39472
  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}";
39258
39473
  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";
39259
39474
  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";
@@ -39272,7 +39487,7 @@ var init_three_module = __esm({
39272
39487
  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}";
39273
39488
  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}";
39274
39489
  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}";
39275
- 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}";
39490
+ 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}";
39276
39491
  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}";
39277
39492
  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}";
39278
39493
  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}";
@@ -39360,6 +39575,7 @@ var init_three_module = __esm({
39360
39575
  lights_fragment_begin,
39361
39576
  lights_fragment_maps,
39362
39577
  lights_fragment_end,
39578
+ lightprobes_pars_fragment,
39363
39579
  logdepthbuf_fragment,
39364
39580
  logdepthbuf_pars_fragment,
39365
39581
  logdepthbuf_pars_vertex,
@@ -39463,7 +39679,6 @@ var init_three_module = __esm({
39463
39679
  envmap: {
39464
39680
  envMap: { value: null },
39465
39681
  envMapRotation: { value: /* @__PURE__ */ new Matrix3() },
39466
- flipEnvMap: { value: -1 },
39467
39682
  reflectivity: { value: 1 },
39468
39683
  // basic, lambert, phong
39469
39684
  ior: { value: 1.5 },
@@ -39582,7 +39797,11 @@ var init_three_module = __esm({
39582
39797
  height: {}
39583
39798
  } },
39584
39799
  ltc_1: { value: null },
39585
- ltc_2: { value: null }
39800
+ ltc_2: { value: null },
39801
+ probesSH: { value: null },
39802
+ probesMin: { value: /* @__PURE__ */ new Vector3() },
39803
+ probesMax: { value: /* @__PURE__ */ new Vector3() },
39804
+ probesResolution: { value: /* @__PURE__ */ new Vector3() }
39586
39805
  },
39587
39806
  points: {
39588
39807
  diffuse: { value: /* @__PURE__ */ new Color(16777215) },
@@ -39783,7 +40002,6 @@ var init_three_module = __esm({
39783
40002
  backgroundCube: {
39784
40003
  uniforms: {
39785
40004
  envMap: { value: null },
39786
- flipEnvMap: { value: -1 },
39787
40005
  backgroundBlurriness: { value: 0 },
39788
40006
  backgroundIntensity: { value: 1 },
39789
40007
  backgroundRotation: { value: /* @__PURE__ */ new Matrix3() }
@@ -39887,8 +40105,9 @@ var init_three_module = __esm({
39887
40105
  fragmentShader: ShaderChunk.meshphysical_frag
39888
40106
  };
39889
40107
  _rgb = { r: 0, b: 0, g: 0 };
39890
- _e1$1 = /* @__PURE__ */ new Euler();
39891
40108
  _m1$12 = /* @__PURE__ */ new Matrix4();
40109
+ _m$1 = /* @__PURE__ */ new Matrix3();
40110
+ _m$1.set(-1, 0, 0, 0, 1, 0, 0, 0, 1);
39892
40111
  LOD_MIN = 4;
39893
40112
  EXTRA_LOD_SIGMA = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582];
39894
40113
  MAX_SAMPLES = 20;
@@ -41232,8 +41451,9 @@ void main() {
41232
41451
  };
41233
41452
  }
41234
41453
  };
41235
- _e1 = /* @__PURE__ */ new Euler();
41236
41454
  _m12 = /* @__PURE__ */ new Matrix4();
41455
+ _m = /* @__PURE__ */ new Matrix3();
41456
+ _m.set(-1, 0, 0, 0, 1, 0, 0, 0, 1);
41237
41457
  DATA = new Uint16Array([
41238
41458
  12469,
41239
41459
  15057,
@@ -41796,6 +42016,7 @@ void main() {
41796
42016
  ]);
41797
42017
  const uintClearColor = new Uint32Array(4);
41798
42018
  const intClearColor = new Int32Array(4);
42019
+ const objectPosition = new Vector3();
41799
42020
  let currentRenderList = null;
41800
42021
  let currentRenderState = null;
41801
42022
  const renderListStack = [];
@@ -41826,6 +42047,7 @@ void main() {
41826
42047
  this.transmissionResolutionScale = 1;
41827
42048
  const _this = this;
41828
42049
  let _isContextLost = false;
42050
+ let _nodesHandler = null;
41829
42051
  this._outputColorSpace = SRGBColorSpace;
41830
42052
  let _currentActiveCubeFace = 0;
41831
42053
  let _currentActiveMipmapLevel = 0;
@@ -41849,8 +42071,8 @@ void main() {
41849
42071
  let _clippingEnabled = false;
41850
42072
  let _localClippingEnabled = false;
41851
42073
  const _projScreenMatrix3 = new Matrix4();
41852
- const _vector32 = new Vector3();
41853
- const _vector4 = new Vector4();
42074
+ const _vector3 = new Vector3();
42075
+ const _vector42 = new Vector4();
41854
42076
  const _emptyScene = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: true };
41855
42077
  let _renderBackground = false;
41856
42078
  function getTargetPixelRatio() {
@@ -41994,13 +42216,13 @@ void main() {
41994
42216
  };
41995
42217
  this.setEffects = function(effects) {
41996
42218
  if (_outputBufferType === UnsignedByteType) {
41997
- console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");
42219
+ error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");
41998
42220
  return;
41999
42221
  }
42000
42222
  if (effects) {
42001
42223
  for (let i3 = 0; i3 < effects.length; i3++) {
42002
42224
  if (effects[i3].isOutputPass === true) {
42003
- console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");
42225
+ warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");
42004
42226
  break;
42005
42227
  }
42006
42228
  }
@@ -42091,6 +42313,7 @@ void main() {
42091
42313
  }
42092
42314
  if (depth2) {
42093
42315
  bits |= _gl.DEPTH_BUFFER_BIT;
42316
+ this.state.buffers.depth.setMask(true);
42094
42317
  }
42095
42318
  if (stencil2) {
42096
42319
  bits |= _gl.STENCIL_BUFFER_BIT;
@@ -42109,6 +42332,10 @@ void main() {
42109
42332
  this.clearStencil = function() {
42110
42333
  this.clear(false, false, true);
42111
42334
  };
42335
+ this.setNodesHandler = function(nodesHandler) {
42336
+ nodesHandler.setRenderer(this);
42337
+ _nodesHandler = nodesHandler;
42338
+ };
42112
42339
  this.dispose = function() {
42113
42340
  canvas.removeEventListener("webglcontextlost", onContextLost, false);
42114
42341
  canvas.removeEventListener("webglcontextrestored", onContextRestore, false);
@@ -42231,23 +42458,18 @@ void main() {
42231
42458
  renderer.setMode(_gl.TRIANGLES);
42232
42459
  }
42233
42460
  if (object.isBatchedMesh) {
42234
- if (object._multiDrawInstances !== null) {
42235
- warnOnce("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.");
42236
- renderer.renderMultiDrawInstances(object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount, object._multiDrawInstances);
42237
- } else {
42238
- if (!extensions2.get("WEBGL_multi_draw")) {
42239
- const starts = object._multiDrawStarts;
42240
- const counts = object._multiDrawCounts;
42241
- const drawCount2 = object._multiDrawCount;
42242
- const bytesPerElement = index ? attributes.get(index).bytesPerElement : 1;
42243
- const uniforms = properties.get(material).currentProgram.getUniforms();
42244
- for (let i3 = 0; i3 < drawCount2; i3++) {
42245
- uniforms.setValue(_gl, "_gl_DrawID", i3);
42246
- renderer.render(starts[i3] / bytesPerElement, counts[i3]);
42247
- }
42248
- } else {
42249
- renderer.renderMultiDraw(object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount);
42461
+ if (!extensions2.get("WEBGL_multi_draw")) {
42462
+ const starts = object._multiDrawStarts;
42463
+ const counts = object._multiDrawCounts;
42464
+ const drawCount2 = object._multiDrawCount;
42465
+ const bytesPerElement = index ? attributes.get(index).bytesPerElement : 1;
42466
+ const uniforms = properties.get(material).currentProgram.getUniforms();
42467
+ for (let i3 = 0; i3 < drawCount2; i3++) {
42468
+ uniforms.setValue(_gl, "_gl_DrawID", i3);
42469
+ renderer.render(starts[i3] / bytesPerElement, counts[i3]);
42250
42470
  }
42471
+ } else {
42472
+ renderer.renderMultiDraw(object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount);
42251
42473
  }
42252
42474
  } else if (object.isInstancedMesh) {
42253
42475
  renderer.renderInstances(drawStart, drawCount, object.count);
@@ -42368,6 +42590,9 @@ void main() {
42368
42590
  return;
42369
42591
  }
42370
42592
  if (_isContextLost === true) return;
42593
+ if (_nodesHandler !== null) {
42594
+ _nodesHandler.renderStart(scene, camera);
42595
+ }
42371
42596
  const isXRPresenting = xr.enabled === true && xr.isPresenting === true;
42372
42597
  const useOutput = output !== null && (_currentRenderTarget === null || isXRPresenting) && output.begin(_this, _currentRenderTarget);
42373
42598
  if (scene.matrixWorldAutoUpdate === true) scene.updateMatrixWorld();
@@ -42379,6 +42604,7 @@ void main() {
42379
42604
  if (scene.isScene === true) scene.onBeforeRender(_this, scene, camera, _currentRenderTarget);
42380
42605
  currentRenderState = renderStates.get(scene, renderStateStack.length);
42381
42606
  currentRenderState.init(camera);
42607
+ currentRenderState.state.textureUnits = textures.getTextureUnits();
42382
42608
  renderStateStack.push(currentRenderState);
42383
42609
  _projScreenMatrix3.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);
42384
42610
  _frustum2.setFromProjectionMatrix(_projScreenMatrix3, WebGLCoordinateSystem, camera.reversedDepth);
@@ -42446,6 +42672,7 @@ void main() {
42446
42672
  renderStateStack.pop();
42447
42673
  if (renderStateStack.length > 0) {
42448
42674
  currentRenderState = renderStateStack[renderStateStack.length - 1];
42675
+ textures.setTextureUnits(currentRenderState.state.textureUnits);
42449
42676
  if (_clippingEnabled === true) clipping.setGlobalState(_this.clippingPlanes, currentRenderState.state.camera);
42450
42677
  } else {
42451
42678
  currentRenderState = null;
@@ -42456,6 +42683,9 @@ void main() {
42456
42683
  } else {
42457
42684
  currentRenderList = null;
42458
42685
  }
42686
+ if (_nodesHandler !== null) {
42687
+ _nodesHandler.renderEnd();
42688
+ }
42459
42689
  };
42460
42690
  function projectObject(object, camera, groupOrder, sortObjects) {
42461
42691
  if (object.visible === false) return;
@@ -42465,6 +42695,8 @@ void main() {
42465
42695
  groupOrder = object.renderOrder;
42466
42696
  } else if (object.isLOD) {
42467
42697
  if (object.autoUpdate === true) object.update(camera);
42698
+ } else if (object.isLightProbeGrid) {
42699
+ currentRenderState.pushLightProbeGrid(object);
42468
42700
  } else if (object.isLight) {
42469
42701
  currentRenderState.pushLight(object);
42470
42702
  if (object.castShadow) {
@@ -42473,12 +42705,12 @@ void main() {
42473
42705
  } else if (object.isSprite) {
42474
42706
  if (!object.frustumCulled || _frustum2.intersectsSprite(object)) {
42475
42707
  if (sortObjects) {
42476
- _vector4.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix3);
42708
+ _vector42.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix3);
42477
42709
  }
42478
42710
  const geometry = objects.update(object);
42479
42711
  const material = object.material;
42480
42712
  if (material.visible) {
42481
- currentRenderList.push(object, geometry, material, groupOrder, _vector4.z, null);
42713
+ currentRenderList.push(object, geometry, material, groupOrder, _vector42.z, null);
42482
42714
  }
42483
42715
  }
42484
42716
  } else if (object.isMesh || object.isLine || object.isPoints) {
@@ -42488,12 +42720,12 @@ void main() {
42488
42720
  if (sortObjects) {
42489
42721
  if (object.boundingSphere !== void 0) {
42490
42722
  if (object.boundingSphere === null) object.computeBoundingSphere();
42491
- _vector4.copy(object.boundingSphere.center);
42723
+ _vector42.copy(object.boundingSphere.center);
42492
42724
  } else {
42493
42725
  if (geometry.boundingSphere === null) geometry.computeBoundingSphere();
42494
- _vector4.copy(geometry.boundingSphere.center);
42726
+ _vector42.copy(geometry.boundingSphere.center);
42495
42727
  }
42496
- _vector4.applyMatrix4(object.matrixWorld).applyMatrix4(_projScreenMatrix3);
42728
+ _vector42.applyMatrix4(object.matrixWorld).applyMatrix4(_projScreenMatrix3);
42497
42729
  }
42498
42730
  if (Array.isArray(material)) {
42499
42731
  const groups = geometry.groups;
@@ -42501,11 +42733,11 @@ void main() {
42501
42733
  const group = groups[i3];
42502
42734
  const groupMaterial = material[group.materialIndex];
42503
42735
  if (groupMaterial && groupMaterial.visible) {
42504
- currentRenderList.push(object, geometry, groupMaterial, groupOrder, _vector4.z, group);
42736
+ currentRenderList.push(object, geometry, groupMaterial, groupOrder, _vector42.z, group);
42505
42737
  }
42506
42738
  }
42507
42739
  } else if (material.visible) {
42508
- currentRenderList.push(object, geometry, material, groupOrder, _vector4.z, null);
42740
+ currentRenderList.push(object, geometry, material, groupOrder, _vector42.z, null);
42509
42741
  }
42510
42742
  }
42511
42743
  }
@@ -42631,7 +42863,7 @@ void main() {
42631
42863
  const lights = currentRenderState.state.lights;
42632
42864
  const shadowsArray = currentRenderState.state.shadowsArray;
42633
42865
  const lightsStateVersion = lights.state.version;
42634
- const parameters2 = programCache.getParameters(material, lights.state, shadowsArray, scene, object);
42866
+ const parameters2 = programCache.getParameters(material, lights.state, shadowsArray, scene, object, currentRenderState.state.lightProbeGridArray);
42635
42867
  const programCacheKey = programCache.getProgramCacheKey(parameters2);
42636
42868
  let programs = materialProperties.programs;
42637
42869
  materialProperties.environment = material.isMeshStandardMaterial || material.isMeshLambertMaterial || material.isMeshPhongMaterial ? scene.environment : null;
@@ -42652,6 +42884,9 @@ void main() {
42652
42884
  }
42653
42885
  } else {
42654
42886
  parameters2.uniforms = programCache.getUniforms(material);
42887
+ if (_nodesHandler !== null && material.isNodeMaterial) {
42888
+ _nodesHandler.build(material, object, parameters2);
42889
+ }
42655
42890
  material.onBeforeCompile(parameters2, _this);
42656
42891
  program = programCache.acquireProgram(parameters2, programCacheKey);
42657
42892
  programs.set(programCacheKey, program);
@@ -42682,6 +42917,7 @@ void main() {
42682
42917
  uniforms.spotLightMap.value = lights.state.spotLightMap;
42683
42918
  uniforms.pointShadowMatrix.value = lights.state.pointShadowMatrix;
42684
42919
  }
42920
+ materialProperties.lightProbeGrid = currentRenderState.state.lightProbeGridArray.length > 0;
42685
42921
  materialProperties.currentProgram = program;
42686
42922
  materialProperties.uniformsList = null;
42687
42923
  return program;
@@ -42712,12 +42948,24 @@ void main() {
42712
42948
  materialProperties.vertexTangents = parameters2.vertexTangents;
42713
42949
  materialProperties.toneMapping = parameters2.toneMapping;
42714
42950
  }
42951
+ function findLightProbeGrid(volumes, object) {
42952
+ if (volumes.length === 0) return null;
42953
+ if (volumes.length === 1) {
42954
+ return volumes[0].texture !== null ? volumes[0] : null;
42955
+ }
42956
+ objectPosition.setFromMatrixPosition(object.matrixWorld);
42957
+ for (let i3 = 0, l2 = volumes.length; i3 < l2; i3++) {
42958
+ const v = volumes[i3];
42959
+ if (v.texture !== null && v.boundingBox.containsPoint(objectPosition)) return v;
42960
+ }
42961
+ return null;
42962
+ }
42715
42963
  function setProgram(camera, scene, geometry, material, object) {
42716
42964
  if (scene.isScene !== true) scene = _emptyScene;
42717
42965
  textures.resetTextureUnits();
42718
42966
  const fog = scene.fog;
42719
42967
  const environment = material.isMeshStandardMaterial || material.isMeshLambertMaterial || material.isMeshPhongMaterial ? scene.environment : null;
42720
- const colorSpace = _currentRenderTarget === null ? _this.outputColorSpace : _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace;
42968
+ const colorSpace = _currentRenderTarget === null ? _this.outputColorSpace : _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.colorSpace : ColorManagement.workingColorSpace;
42721
42969
  const usePMREM = material.isMeshStandardMaterial || material.isMeshLambertMaterial && !material.envMap || material.isMeshPhongMaterial && !material.envMap;
42722
42970
  const envMap = environments.get(material.envMap || environment, usePMREM);
42723
42971
  const vertexAlphas = material.vertexColors === true && !!geometry.attributes.color && geometry.attributes.color.itemSize === 4;
@@ -42791,6 +43039,8 @@ void main() {
42791
43039
  needsProgramChange = true;
42792
43040
  } else if (materialProperties.morphTargetsCount !== morphTargetsCount) {
42793
43041
  needsProgramChange = true;
43042
+ } else if (!!materialProperties.lightProbeGrid !== currentRenderState.state.lightProbeGridArray.length > 0) {
43043
+ needsProgramChange = true;
42794
43044
  }
42795
43045
  } else {
42796
43046
  needsProgramChange = true;
@@ -42799,6 +43049,9 @@ void main() {
42799
43049
  let program = materialProperties.currentProgram;
42800
43050
  if (needsProgramChange === true) {
42801
43051
  program = getProgram(material, scene, object);
43052
+ if (_nodesHandler && material.isNodeMaterial) {
43053
+ _nodesHandler.onUpdateProgram(material, program, materialProperties);
43054
+ }
42802
43055
  }
42803
43056
  let refreshProgram = false;
42804
43057
  let refreshMaterial = false;
@@ -42813,6 +43066,13 @@ void main() {
42813
43066
  _currentMaterialId = material.id;
42814
43067
  refreshMaterial = true;
42815
43068
  }
43069
+ if (materialProperties.needsLights) {
43070
+ const objectVolume = findLightProbeGrid(currentRenderState.state.lightProbeGridArray, object);
43071
+ if (materialProperties.lightProbeGrid !== objectVolume) {
43072
+ materialProperties.lightProbeGrid = objectVolume;
43073
+ refreshMaterial = true;
43074
+ }
43075
+ }
42816
43076
  if (refreshProgram || _currentCamera !== camera) {
42817
43077
  const reversedDepthBuffer2 = state2.buffers.depth.getReversed();
42818
43078
  if (reversedDepthBuffer2 && camera.reversedDepth !== true) {
@@ -42823,7 +43083,7 @@ void main() {
42823
43083
  p_uniforms.setValue(_gl, "viewMatrix", camera.matrixWorldInverse);
42824
43084
  const uCamPos = p_uniforms.map.cameraPosition;
42825
43085
  if (uCamPos !== void 0) {
42826
- uCamPos.setValue(_gl, _vector32.setFromMatrixPosition(camera.matrixWorld));
43086
+ uCamPos.setValue(_gl, _vector3.setFromMatrixPosition(camera.matrixWorld));
42827
43087
  }
42828
43088
  if (capabilities.logarithmicDepthBuffer) {
42829
43089
  p_uniforms.setValue(
@@ -42894,6 +43154,13 @@ void main() {
42894
43154
  materials.refreshFogUniforms(m_uniforms, fog);
42895
43155
  }
42896
43156
  materials.refreshMaterialUniforms(m_uniforms, material, _pixelRatio, _height, currentRenderState.state.transmissionRenderTarget[camera.id]);
43157
+ if (materialProperties.needsLights && materialProperties.lightProbeGrid) {
43158
+ const volume = materialProperties.lightProbeGrid;
43159
+ m_uniforms.probesSH.value = volume.texture;
43160
+ m_uniforms.probesMin.value.copy(volume.boundingBox.min);
43161
+ m_uniforms.probesMax.value.copy(volume.boundingBox.max);
43162
+ m_uniforms.probesResolution.value.copy(volume.resolution);
43163
+ }
42897
43164
  WebGLUniforms.upload(_gl, getUniformList(materialProperties), m_uniforms, textures);
42898
43165
  }
42899
43166
  if (material.isShaderMaterial && material.uniformsNeedUpdate === true) {
@@ -42906,7 +43173,7 @@ void main() {
42906
43173
  p_uniforms.setValue(_gl, "modelViewMatrix", object.modelViewMatrix);
42907
43174
  p_uniforms.setValue(_gl, "normalMatrix", object.normalMatrix);
42908
43175
  p_uniforms.setValue(_gl, "modelMatrix", object.matrixWorld);
42909
- if (material.isShaderMaterial || material.isRawShaderMaterial) {
43176
+ if (material.uniformsGroups !== void 0) {
42910
43177
  const groups = material.uniformsGroups;
42911
43178
  for (let i3 = 0, l2 = groups.length; i3 < l2; i3++) {
42912
43179
  const group = groups[i3];
@@ -43175,19 +43442,20 @@ void main() {
43175
43442
  textures.setTexture2D(dstTexture, 0);
43176
43443
  glTarget = _gl.TEXTURE_2D;
43177
43444
  }
43178
- _gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, dstTexture.flipY);
43179
- _gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, dstTexture.premultiplyAlpha);
43180
- _gl.pixelStorei(_gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment);
43181
- const currentUnpackRowLen = _gl.getParameter(_gl.UNPACK_ROW_LENGTH);
43182
- const currentUnpackImageHeight = _gl.getParameter(_gl.UNPACK_IMAGE_HEIGHT);
43183
- const currentUnpackSkipPixels = _gl.getParameter(_gl.UNPACK_SKIP_PIXELS);
43184
- const currentUnpackSkipRows = _gl.getParameter(_gl.UNPACK_SKIP_ROWS);
43185
- const currentUnpackSkipImages = _gl.getParameter(_gl.UNPACK_SKIP_IMAGES);
43186
- _gl.pixelStorei(_gl.UNPACK_ROW_LENGTH, image.width);
43187
- _gl.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT, image.height);
43188
- _gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS, minX);
43189
- _gl.pixelStorei(_gl.UNPACK_SKIP_ROWS, minY);
43190
- _gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES, minZ);
43445
+ state2.activeTexture(_gl.TEXTURE0);
43446
+ state2.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, dstTexture.flipY);
43447
+ state2.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, dstTexture.premultiplyAlpha);
43448
+ state2.pixelStorei(_gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment);
43449
+ const currentUnpackRowLen = state2.getParameter(_gl.UNPACK_ROW_LENGTH);
43450
+ const currentUnpackImageHeight = state2.getParameter(_gl.UNPACK_IMAGE_HEIGHT);
43451
+ const currentUnpackSkipPixels = state2.getParameter(_gl.UNPACK_SKIP_PIXELS);
43452
+ const currentUnpackSkipRows = state2.getParameter(_gl.UNPACK_SKIP_ROWS);
43453
+ const currentUnpackSkipImages = state2.getParameter(_gl.UNPACK_SKIP_IMAGES);
43454
+ state2.pixelStorei(_gl.UNPACK_ROW_LENGTH, image.width);
43455
+ state2.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT, image.height);
43456
+ state2.pixelStorei(_gl.UNPACK_SKIP_PIXELS, minX);
43457
+ state2.pixelStorei(_gl.UNPACK_SKIP_ROWS, minY);
43458
+ state2.pixelStorei(_gl.UNPACK_SKIP_IMAGES, minZ);
43191
43459
  const isSrc3D = srcTexture.isDataArrayTexture || srcTexture.isData3DTexture;
43192
43460
  const isDst3D = dstTexture.isDataArrayTexture || dstTexture.isData3DTexture;
43193
43461
  if (srcTexture.isDepthTexture) {
@@ -43251,11 +43519,11 @@ void main() {
43251
43519
  }
43252
43520
  }
43253
43521
  }
43254
- _gl.pixelStorei(_gl.UNPACK_ROW_LENGTH, currentUnpackRowLen);
43255
- _gl.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT, currentUnpackImageHeight);
43256
- _gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS, currentUnpackSkipPixels);
43257
- _gl.pixelStorei(_gl.UNPACK_SKIP_ROWS, currentUnpackSkipRows);
43258
- _gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES, currentUnpackSkipImages);
43522
+ state2.pixelStorei(_gl.UNPACK_ROW_LENGTH, currentUnpackRowLen);
43523
+ state2.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT, currentUnpackImageHeight);
43524
+ state2.pixelStorei(_gl.UNPACK_SKIP_PIXELS, currentUnpackSkipPixels);
43525
+ state2.pixelStorei(_gl.UNPACK_SKIP_ROWS, currentUnpackSkipRows);
43526
+ state2.pixelStorei(_gl.UNPACK_SKIP_IMAGES, currentUnpackSkipImages);
43259
43527
  if (dstLevel === 0 && dstTexture.generateMipmaps) {
43260
43528
  _gl.generateMipmap(glTarget);
43261
43529
  }
@@ -43320,9 +43588,9 @@ void main() {
43320
43588
  }
43321
43589
  });
43322
43590
 
43323
- // ../../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
43591
+ // ../../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
43324
43592
  var require_use_sync_external_store_shim_development = __commonJS({
43325
- "../../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) {
43593
+ "../../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) {
43326
43594
  (function() {
43327
43595
  function is2(x2, y) {
43328
43596
  return x2 === y && (0 !== x2 || 1 / x2 === 1 / y) || x2 !== x2 && y !== y;
@@ -43383,18 +43651,18 @@ var require_use_sync_external_store_shim_development = __commonJS({
43383
43651
  }
43384
43652
  });
43385
43653
 
43386
- // ../../node_modules/.bun/use-sync-external-store@1.6.0+b1ab299f0a400331/node_modules/use-sync-external-store/shim/index.js
43654
+ // ../../node_modules/.bun/use-sync-external-store@1.6.0+3f10a4be4e334a9b/node_modules/use-sync-external-store/shim/index.js
43387
43655
  var require_shim = __commonJS({
43388
- "../../node_modules/.bun/use-sync-external-store@1.6.0+b1ab299f0a400331/node_modules/use-sync-external-store/shim/index.js"(exports$1, module) {
43656
+ "../../node_modules/.bun/use-sync-external-store@1.6.0+3f10a4be4e334a9b/node_modules/use-sync-external-store/shim/index.js"(exports$1, module) {
43389
43657
  {
43390
43658
  module.exports = require_use_sync_external_store_shim_development();
43391
43659
  }
43392
43660
  }
43393
43661
  });
43394
43662
 
43395
- // ../../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
43663
+ // ../../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
43396
43664
  var require_with_selector_development = __commonJS({
43397
- "../../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) {
43665
+ "../../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) {
43398
43666
  (function() {
43399
43667
  function is2(x2, y) {
43400
43668
  return x2 === y && (0 !== x2 || 1 / x2 === 1 / y) || x2 !== x2 && y !== y;
@@ -43458,19 +43726,19 @@ var require_with_selector_development = __commonJS({
43458
43726
  }
43459
43727
  });
43460
43728
 
43461
- // ../../node_modules/.bun/use-sync-external-store@1.6.0+b1ab299f0a400331/node_modules/use-sync-external-store/shim/with-selector.js
43729
+ // ../../node_modules/.bun/use-sync-external-store@1.6.0+3f10a4be4e334a9b/node_modules/use-sync-external-store/shim/with-selector.js
43462
43730
  var require_with_selector = __commonJS({
43463
- "../../node_modules/.bun/use-sync-external-store@1.6.0+b1ab299f0a400331/node_modules/use-sync-external-store/shim/with-selector.js"(exports$1, module) {
43731
+ "../../node_modules/.bun/use-sync-external-store@1.6.0+3f10a4be4e334a9b/node_modules/use-sync-external-store/shim/with-selector.js"(exports$1, module) {
43464
43732
  {
43465
43733
  module.exports = require_with_selector_development();
43466
43734
  }
43467
43735
  }
43468
43736
  });
43469
43737
 
43470
- // ../../node_modules/.bun/zustand@5.0.11+10f197a4cef36846/node_modules/zustand/esm/vanilla.mjs
43738
+ // ../../node_modules/.bun/zustand@5.0.11+5e3d5174673d7dcb/node_modules/zustand/esm/vanilla.mjs
43471
43739
  var createStoreImpl, createStore;
43472
43740
  var init_vanilla = __esm({
43473
- "../../node_modules/.bun/zustand@5.0.11+10f197a4cef36846/node_modules/zustand/esm/vanilla.mjs"() {
43741
+ "../../node_modules/.bun/zustand@5.0.11+5e3d5174673d7dcb/node_modules/zustand/esm/vanilla.mjs"() {
43474
43742
  createStoreImpl = (createState) => {
43475
43743
  let state2;
43476
43744
  const listeners = /* @__PURE__ */ new Set();
@@ -43508,7 +43776,7 @@ function useStoreWithEqualityFn(api, selector = identity, equalityFn) {
43508
43776
  }
43509
43777
  var import_with_selector, useSyncExternalStoreWithSelector, identity, createWithEqualityFnImpl, createWithEqualityFn;
43510
43778
  var init_traditional = __esm({
43511
- "../../node_modules/.bun/zustand@5.0.11+10f197a4cef36846/node_modules/zustand/esm/traditional.mjs"() {
43779
+ "../../node_modules/.bun/zustand@5.0.11+5e3d5174673d7dcb/node_modules/zustand/esm/traditional.mjs"() {
43512
43780
  import_with_selector = __toESM(require_with_selector(), 1);
43513
43781
  init_vanilla();
43514
43782
  ({ useSyncExternalStoreWithSelector } = import_with_selector.default);
@@ -43523,7 +43791,7 @@ var init_traditional = __esm({
43523
43791
  }
43524
43792
  });
43525
43793
 
43526
- // ../../node_modules/.bun/suspend-react@0.1.3+b1ab299f0a400331/node_modules/suspend-react/index.js
43794
+ // ../../node_modules/.bun/suspend-react@0.1.3+3f10a4be4e334a9b/node_modules/suspend-react/index.js
43527
43795
  function shallowEqualArrays(arrA, arrB, equal = (a2, b2) => a2 === b2) {
43528
43796
  if (arrA === arrB) return true;
43529
43797
  if (!arrA || !arrB) return false;
@@ -43571,7 +43839,7 @@ function query(fn, keys2 = null, preload2 = false, config = {}) {
43571
43839
  }
43572
43840
  var isPromise, globalCache, suspend, preload, clear;
43573
43841
  var init_suspend_react = __esm({
43574
- "../../node_modules/.bun/suspend-react@0.1.3+b1ab299f0a400331/node_modules/suspend-react/index.js"() {
43842
+ "../../node_modules/.bun/suspend-react@0.1.3+3f10a4be4e334a9b/node_modules/suspend-react/index.js"() {
43575
43843
  isPromise = (promise) => typeof promise === "object" && typeof promise.then === "function";
43576
43844
  globalCache = [];
43577
43845
  suspend = (fn, keys2, config) => query(fn, keys2, false, config);
@@ -43924,7 +44192,7 @@ function x() {
43924
44192
  }
43925
44193
  var a, m, p, b;
43926
44194
  var init_dist = __esm({
43927
- "../../node_modules/.bun/its-fine@2.0.0+26a211c426f3f87c/node_modules/its-fine/dist/index.js"() {
44195
+ "../../node_modules/.bun/its-fine@2.0.0+b2e33729a97476bf/node_modules/its-fine/dist/index.js"() {
43928
44196
  a = /* @__PURE__ */ l(/* @__PURE__ */ React10__namespace.createContext(null));
43929
44197
  m = class extends React10__namespace.Component {
43930
44198
  render() {
@@ -44240,6 +44508,35 @@ function releaseInternalPointerCapture(capturedMap, obj, captures, pointerId) {
44240
44508
  }
44241
44509
  }
44242
44510
  }
44511
+ function swapInteractivity(store, object, newObject) {
44512
+ const {
44513
+ internal
44514
+ } = store.getState();
44515
+ for (let i3 = 0; i3 < internal.interaction.length; i3++) {
44516
+ if (internal.interaction[i3] === object) internal.interaction[i3] = newObject;
44517
+ }
44518
+ for (let i3 = 0; i3 < internal.initialHits.length; i3++) {
44519
+ if (internal.initialHits[i3] === object) internal.initialHits[i3] = newObject;
44520
+ }
44521
+ internal.hovered.forEach((value, key) => {
44522
+ if (value.eventObject === object || value.object === object) {
44523
+ internal.hovered.delete(key);
44524
+ const next = {
44525
+ ...value,
44526
+ eventObject: value.eventObject === object ? newObject : value.eventObject,
44527
+ object: value.object === object ? newObject : value.object
44528
+ };
44529
+ internal.hovered.set(makeId(next), next);
44530
+ }
44531
+ });
44532
+ internal.capturedMap.forEach((captures) => {
44533
+ const captureData = captures.get(object);
44534
+ if (captureData) {
44535
+ captures.delete(object);
44536
+ captures.set(newObject, captureData);
44537
+ }
44538
+ });
44539
+ }
44243
44540
  function removeInteractivity(store, object) {
44244
44541
  const {
44245
44542
  internal
@@ -50635,10 +50932,10 @@ This ensures that you're testing the behavior the user would see in the browser.
50635
50932
  if ((ye & Zn) === Jn) {
50636
50933
  var n = e2.tag;
50637
50934
  if (n === 3 || n === 1 || n === 0 || n === 11 || n === 14 || n === 15) {
50638
- if (n = G(e2) || "ReactComponent", _m !== null) {
50639
- if (_m.has(n)) return;
50640
- _m.add(n);
50641
- } else _m = /* @__PURE__ */ new Set([n]);
50935
+ if (n = G(e2) || "ReactComponent", _m2 !== null) {
50936
+ if (_m2.has(n)) return;
50937
+ _m2.add(n);
50938
+ } else _m2 = /* @__PURE__ */ new Set([n]);
50642
50939
  B(e2, function() {
50643
50940
  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.");
50644
50941
  });
@@ -51860,7 +52157,7 @@ Check the top-level render call using <` + i3 + ">.");
51860
52157
  var bp = Symbol.for;
51861
52158
  pm = bp("selector.component"), hm = bp("selector.has_pseudo_class"), mm = bp("selector.role"), gm = bp("selector.test_id"), ym = bp("selector.text");
51862
52159
  }
51863
- 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;
52160
+ 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;
51864
52161
  try {
51865
52162
  var o0 = Object.preventExtensions({});
51866
52163
  } catch {
@@ -52317,9 +52614,11 @@ function swapInstances() {
52317
52614
  if (parent) {
52318
52615
  var _instance$props$objec, _instance$props$args;
52319
52616
  const target = catalogue[toPascalCase(instance.type)];
52617
+ const prevObject = instance.object;
52320
52618
  instance.object = (_instance$props$objec = instance.props.object) != null ? _instance$props$objec : new target(...(_instance$props$args = instance.props.args) != null ? _instance$props$args : []);
52321
52619
  instance.object.__r3f = instance;
52322
52620
  setFiberRef(fiber, instance.object);
52621
+ swapInteractivity(findInitialRoot(instance), prevObject, instance.object);
52323
52622
  applyProps(instance.object, instance.props);
52324
52623
  if (instance.props.attach) {
52325
52624
  attach(parent, instance);
@@ -52903,8 +53202,8 @@ function createPointerEvents(store) {
52903
53202
  };
52904
53203
  }
52905
53204
  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;
52906
- var init_events_760a1017_esm = __esm({
52907
- "../../node_modules/.bun/@react-three+fiber@9.6.0+bae906b8c0d5d7d7/node_modules/@react-three/fiber/dist/events-760a1017.esm.js"() {
53205
+ var init_events_b389eeca_esm = __esm({
53206
+ "../../node_modules/.bun/@react-three+fiber@9.6.1+26134fee8850b5e9/node_modules/@react-three/fiber/dist/events-b389eeca.esm.js"() {
52908
53207
  init_three_module();
52909
53208
  init_traditional();
52910
53209
  init_suspend_react();
@@ -53228,7 +53527,7 @@ var init_events_760a1017_esm = __esm({
53228
53527
  e = 2;
53229
53528
  packageData = {
53230
53529
  name: "@react-three/fiber",
53231
- version: "9.6.0",
53530
+ version: "9.6.1",
53232
53531
  description: "A React renderer for Threejs",
53233
53532
  keywords: [
53234
53533
  "react",
@@ -53622,13 +53921,13 @@ function E(n) {
53622
53921
  }
53623
53922
  var k, D;
53624
53923
  var init_dist2 = __esm({
53625
- "../../node_modules/.bun/react-use-measure@2.1.7+bf16f8eded5e12ee/node_modules/react-use-measure/dist/index.js"() {
53924
+ "../../node_modules/.bun/react-use-measure@2.1.7+21ccd8898788a04d/node_modules/react-use-measure/dist/index.js"() {
53626
53925
  k = ["x", "y", "top", "bottom", "left", "right", "width", "height"];
53627
53926
  D = (n, t2) => k.every((o3) => n[o3] === t2[o3]);
53628
53927
  }
53629
53928
  });
53630
53929
 
53631
- // ../../node_modules/.bun/@react-three+fiber@9.6.0+bae906b8c0d5d7d7/node_modules/@react-three/fiber/dist/react-three-fiber.esm.js
53930
+ // ../../node_modules/.bun/@react-three+fiber@9.6.1+26134fee8850b5e9/node_modules/@react-three/fiber/dist/react-three-fiber.esm.js
53632
53931
  var react_three_fiber_esm_exports = {};
53633
53932
  __export(react_three_fiber_esm_exports, {
53634
53933
  Canvas: () => Canvas,
@@ -53797,9 +54096,9 @@ function Canvas(props) {
53797
54096
  });
53798
54097
  }
53799
54098
  var init_react_three_fiber_esm = __esm({
53800
- "../../node_modules/.bun/@react-three+fiber@9.6.0+bae906b8c0d5d7d7/node_modules/@react-three/fiber/dist/react-three-fiber.esm.js"() {
53801
- init_events_760a1017_esm();
53802
- init_events_760a1017_esm();
54099
+ "../../node_modules/.bun/@react-three+fiber@9.6.1+26134fee8850b5e9/node_modules/@react-three/fiber/dist/react-three-fiber.esm.js"() {
54100
+ init_events_b389eeca_esm();
54101
+ init_events_b389eeca_esm();
53803
54102
  init_three_module();
53804
54103
  init_dist2();
53805
54104
  init_dist();
@@ -53871,7 +54170,7 @@ function isRefObject(ref) {
53871
54170
  }
53872
54171
  var v1, v2, v3, v4, epsilon, getCameraCSSMatrix, getObjectCSSMatrix, Html;
53873
54172
  var init_Html = __esm({
53874
- "../../node_modules/.bun/@react-three+drei@10.7.7+cdb3bc7f51872c1f/node_modules/@react-three/drei/web/Html.js"() {
54173
+ "../../node_modules/.bun/@react-three+drei@10.7.7+20209eb6acc591f5/node_modules/@react-three/drei/web/Html.js"() {
53875
54174
  init_extends();
53876
54175
  init_three_module();
53877
54176
  init_react_three_fiber_esm();
@@ -54188,16 +54487,16 @@ var init_Html = __esm({
54188
54487
  }
54189
54488
  });
54190
54489
 
54191
- // ../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/_polyfill/constants.js
54490
+ // ../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/_polyfill/constants.js
54192
54491
  var version;
54193
54492
  var init_constants = __esm({
54194
- "../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/_polyfill/constants.js"() {
54493
+ "../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/_polyfill/constants.js"() {
54195
54494
  init_three_module();
54196
54495
  version = /* @__PURE__ */ (() => parseInt(REVISION.replace(/\D+/g, "")))();
54197
54496
  }
54198
54497
  });
54199
54498
 
54200
- // ../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/utils/BufferGeometryUtils.js
54499
+ // ../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/utils/BufferGeometryUtils.js
54201
54500
  function toTrianglesDrawMode(geometry, drawMode) {
54202
54501
  if (drawMode === TrianglesDrawMode) {
54203
54502
  console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.");
@@ -54257,15 +54556,15 @@ function toTrianglesDrawMode(geometry, drawMode) {
54257
54556
  }
54258
54557
  }
54259
54558
  var init_BufferGeometryUtils = __esm({
54260
- "../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/utils/BufferGeometryUtils.js"() {
54559
+ "../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/utils/BufferGeometryUtils.js"() {
54261
54560
  init_three_module();
54262
54561
  }
54263
54562
  });
54264
54563
 
54265
- // ../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/controls/EventDispatcher.js
54564
+ // ../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/controls/EventDispatcher.js
54266
54565
  var __defProp2, __defNormalProp, __publicField, EventDispatcher2;
54267
54566
  var init_EventDispatcher = __esm({
54268
- "../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/controls/EventDispatcher.js"() {
54567
+ "../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/controls/EventDispatcher.js"() {
54269
54568
  __defProp2 = Object.defineProperty;
54270
54569
  __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
54271
54570
  __publicField = (obj, key, value) => {
@@ -54342,10 +54641,10 @@ var init_EventDispatcher = __esm({
54342
54641
  }
54343
54642
  });
54344
54643
 
54345
- // ../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/controls/OrbitControls.js
54644
+ // ../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/controls/OrbitControls.js
54346
54645
  var __defProp3, __defNormalProp2, __publicField2, _ray2, _plane, TILT_LIMIT, moduloWrapAround, OrbitControls;
54347
54646
  var init_OrbitControls = __esm({
54348
- "../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/controls/OrbitControls.js"() {
54647
+ "../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/controls/OrbitControls.js"() {
54349
54648
  init_three_module();
54350
54649
  init_EventDispatcher();
54351
54650
  __defProp3 = Object.defineProperty;
@@ -55181,7 +55480,7 @@ var init_OrbitControls = __esm({
55181
55480
  }
55182
55481
  });
55183
55482
 
55184
- // ../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/_polyfill/LoaderUtils.js
55483
+ // ../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/_polyfill/LoaderUtils.js
55185
55484
  function decodeText(array) {
55186
55485
  if (typeof TextDecoder !== "undefined") {
55187
55486
  return new TextDecoder().decode(array);
@@ -55197,11 +55496,11 @@ function decodeText(array) {
55197
55496
  }
55198
55497
  }
55199
55498
  var init_LoaderUtils = __esm({
55200
- "../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/_polyfill/LoaderUtils.js"() {
55499
+ "../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/_polyfill/LoaderUtils.js"() {
55201
55500
  }
55202
55501
  });
55203
55502
 
55204
- // ../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/loaders/GLTFLoader.js
55503
+ // ../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/loaders/GLTFLoader.js
55205
55504
  function GLTFRegistry() {
55206
55505
  let objects = {};
55207
55506
  return {
@@ -55447,7 +55746,7 @@ function addPrimitiveAttributes(geometry, primitiveDef, parser) {
55447
55746
  }
55448
55747
  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;
55449
55748
  var init_GLTFLoader = __esm({
55450
- "../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/loaders/GLTFLoader.js"() {
55749
+ "../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/loaders/GLTFLoader.js"() {
55451
55750
  init_three_module();
55452
55751
  init_BufferGeometryUtils();
55453
55752
  init_constants();
@@ -57829,7 +58128,7 @@ var init_GLTFLoader = __esm({
57829
58128
  }
57830
58129
  });
57831
58130
 
57832
- // ../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/loaders/DRACOLoader.js
58131
+ // ../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/loaders/DRACOLoader.js
57833
58132
  function DRACOWorker() {
57834
58133
  let decoderConfig;
57835
58134
  let decoderPending;
@@ -57957,7 +58256,7 @@ function DRACOWorker() {
57957
58256
  }
57958
58257
  var _taskCache, DRACOLoader;
57959
58258
  var init_DRACOLoader = __esm({
57960
- "../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/loaders/DRACOLoader.js"() {
58259
+ "../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/loaders/DRACOLoader.js"() {
57961
58260
  init_three_module();
57962
58261
  _taskCache = /* @__PURE__ */ new WeakMap();
57963
58262
  DRACOLoader = class extends Loader {
@@ -58174,10 +58473,10 @@ var init_DRACOLoader = __esm({
58174
58473
  }
58175
58474
  });
58176
58475
 
58177
- // ../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/libs/MeshoptDecoder.js
58476
+ // ../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/libs/MeshoptDecoder.js
58178
58477
  var generated, MeshoptDecoder;
58179
58478
  var init_MeshoptDecoder = __esm({
58180
- "../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/libs/MeshoptDecoder.js"() {
58479
+ "../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/libs/MeshoptDecoder.js"() {
58181
58480
  MeshoptDecoder = () => {
58182
58481
  if (generated)
58183
58482
  return generated;
@@ -58398,9 +58697,9 @@ var init_MeshoptDecoder = __esm({
58398
58697
  }
58399
58698
  });
58400
58699
 
58401
- // ../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/index.js
58700
+ // ../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/index.js
58402
58701
  var init_three_stdlib = __esm({
58403
- "../../node_modules/.bun/three-stdlib@2.36.1+9459c15c9e4c81b0/node_modules/three-stdlib/index.js"() {
58702
+ "../../node_modules/.bun/three-stdlib@2.36.1+7b565cd016fb14f9/node_modules/three-stdlib/index.js"() {
58404
58703
  init_OrbitControls();
58405
58704
  init_GLTFLoader();
58406
58705
  init_DRACOLoader();
@@ -58426,7 +58725,7 @@ function extensions(useDraco = true, useMeshopt = true, extendLoader) {
58426
58725
  }
58427
58726
  var dracoLoader, decoderPath, useGLTF;
58428
58727
  var init_Gltf = __esm({
58429
- "../../node_modules/.bun/@react-three+drei@10.7.7+cdb3bc7f51872c1f/node_modules/@react-three/drei/core/Gltf.js"() {
58728
+ "../../node_modules/.bun/@react-three+drei@10.7.7+20209eb6acc591f5/node_modules/@react-three/drei/core/Gltf.js"() {
58430
58729
  init_extends();
58431
58730
  init_three_stdlib();
58432
58731
  init_react_three_fiber_esm();
@@ -58442,7 +58741,7 @@ var init_Gltf = __esm({
58442
58741
  });
58443
58742
  var OrbitControls2;
58444
58743
  var init_OrbitControls2 = __esm({
58445
- "../../node_modules/.bun/@react-three+drei@10.7.7+cdb3bc7f51872c1f/node_modules/@react-three/drei/core/OrbitControls.js"() {
58744
+ "../../node_modules/.bun/@react-three+drei@10.7.7+20209eb6acc591f5/node_modules/@react-three/drei/core/OrbitControls.js"() {
58446
58745
  init_extends();
58447
58746
  init_react_three_fiber_esm();
58448
58747
  init_three_stdlib();
@@ -58520,12 +58819,12 @@ var init_OrbitControls2 = __esm({
58520
58819
  }
58521
58820
  });
58522
58821
  var init_camera_controls_module = __esm({
58523
- "../../node_modules/.bun/camera-controls@3.1.2+9459c15c9e4c81b0/node_modules/camera-controls/dist/camera-controls.module.js"() {
58822
+ "../../node_modules/.bun/camera-controls@3.1.2+7b565cd016fb14f9/node_modules/camera-controls/dist/camera-controls.module.js"() {
58524
58823
  }
58525
58824
  });
58526
58825
  var Center;
58527
58826
  var init_Center = __esm({
58528
- "../../node_modules/.bun/@react-three+drei@10.7.7+cdb3bc7f51872c1f/node_modules/@react-three/drei/core/Center.js"() {
58827
+ "../../node_modules/.bun/@react-three+drei@10.7.7+20209eb6acc591f5/node_modules/@react-three/drei/core/Center.js"() {
58529
58828
  init_extends();
58530
58829
  init_three_module();
58531
58830
  Center = /* @__PURE__ */ React10__namespace.forwardRef(function Center2({
@@ -58590,9 +58889,9 @@ var init_Center = __esm({
58590
58889
  }
58591
58890
  });
58592
58891
 
58593
- // ../../node_modules/.bun/@react-three+drei@10.7.7+cdb3bc7f51872c1f/node_modules/@react-three/drei/index.js
58892
+ // ../../node_modules/.bun/@react-three+drei@10.7.7+20209eb6acc591f5/node_modules/@react-three/drei/index.js
58594
58893
  var init_drei = __esm({
58595
- "../../node_modules/.bun/@react-three+drei@10.7.7+cdb3bc7f51872c1f/node_modules/@react-three/drei/index.js"() {
58894
+ "../../node_modules/.bun/@react-three+drei@10.7.7+20209eb6acc591f5/node_modules/@react-three/drei/index.js"() {
58596
58895
  init_Html();
58597
58896
  init_Gltf();
58598
58897
  init_OrbitControls2();
@@ -124287,7 +124586,7 @@ scheduler/cjs/scheduler.development.js:
124287
124586
  * LICENSE file in the root directory of this source tree.
124288
124587
  *)
124289
124588
 
124290
- @react-three/fiber/dist/events-760a1017.esm.js:
124589
+ @react-three/fiber/dist/events-b389eeca.esm.js:
124291
124590
  (**
124292
124591
  * @license React
124293
124592
  * react-reconciler-constants.production.js